diff --git a/.gitignore b/.gitignore index c18b352..17699b5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ /coverage # production -/build +# /build # misc .DS_Store diff --git a/build/asset-manifest.json b/build/asset-manifest.json new file mode 100644 index 0000000..8cefb4a --- /dev/null +++ b/build/asset-manifest.json @@ -0,0 +1,22 @@ +{ + "files": { + "main.css": "/static/css/main.ae178036.chunk.css", + "main.js": "/static/js/main.fe36fbf4.chunk.js", + "main.js.map": "/static/js/main.fe36fbf4.chunk.js.map", + "runtime-main.js": "/static/js/runtime-main.096b27bc.js", + "runtime-main.js.map": "/static/js/runtime-main.096b27bc.js.map", + "static/js/2.6ee1e354.chunk.js": "/static/js/2.6ee1e354.chunk.js", + "static/js/2.6ee1e354.chunk.js.map": "/static/js/2.6ee1e354.chunk.js.map", + "index.html": "/index.html", + "static/css/main.ae178036.chunk.css.map": "/static/css/main.ae178036.chunk.css.map", + "static/js/2.6ee1e354.chunk.js.LICENSE.txt": "/static/js/2.6ee1e354.chunk.js.LICENSE.txt", + "static/media/delete-icon.1129c53a.svg": "/static/media/delete-icon.1129c53a.svg", + "static/media/mode-icon.651cf792.svg": "/static/media/mode-icon.651cf792.svg" + }, + "entrypoints": [ + "static/js/runtime-main.096b27bc.js", + "static/js/2.6ee1e354.chunk.js", + "static/css/main.ae178036.chunk.css", + "static/js/main.fe36fbf4.chunk.js" + ] +} \ No newline at end of file diff --git a/build/favicon.ico b/build/favicon.ico new file mode 100644 index 0000000..a11777c Binary files /dev/null and b/build/favicon.ico differ diff --git a/build/index.html b/build/index.html new file mode 100644 index 0000000..ebe90ea --- /dev/null +++ b/build/index.html @@ -0,0 +1 @@ +React App
\ No newline at end of file diff --git a/build/logo192.png b/build/logo192.png new file mode 100644 index 0000000..fc44b0a Binary files /dev/null and b/build/logo192.png differ diff --git a/build/logo512.png b/build/logo512.png new file mode 100644 index 0000000..a4e47a6 Binary files /dev/null and b/build/logo512.png differ diff --git a/build/manifest.json b/build/manifest.json new file mode 100644 index 0000000..080d6c7 --- /dev/null +++ b/build/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/build/robots.txt b/build/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/build/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/build/static/css/main.ae178036.chunk.css b/build/static/css/main.ae178036.chunk.css new file mode 100644 index 0000000..8500bad --- /dev/null +++ b/build/static/css/main.ae178036.chunk.css @@ -0,0 +1,2 @@ +@import url(https://fonts.googleapis.com/css2?family=Raleway:wght@100;200;300;400;500;600;700;800&display=swap);#root,body,html{height:100%}body{font-family:Raleway,sans-serif;font-size:1.4em;background:#dfdfdf;color:#333}body,h1,h2,h3,p{margin:0}input,textarea{color:#333;padding:8px;font-size:1em;border-radius:4px;border:1px solid #d4d4d4;background-color:#fff;display:block;width:100%;box-sizing:border-box}.page-title{color:#333}.error,.loading,.page-title{text-align:center;margin:40px auto}.App{min-height:100%}.App.dark{background:#333}.navbar{background:#58249c;padding:20px;color:#fff}.navbar nav{display:flex;align-items:center;max-width:1200px;margin:0 auto}.source-code{border:1px solid #fff;border-radius:4px;padding:8px}.navbar a.brand,.source-code{color:#fff;text-decoration:none}.navbar a.brand{margin-right:auto}.navbar a:last-child{color:#fff;text-decoration:none;margin-left:40px;padding:8px;border:1px solid #fff;border-radius:4px}.navbar a:last-child:hover{background:#fff;color:#333}.theme-selector{display:flex;justify-content:flex-end;align-items:center;max-width:1200px;margin:20px auto}.theme-buttons div{display:inline-block;width:20px;height:20px;cursor:pointer;margin-left:15px;border-radius:50%}.mode-toggle{margin-right:auto}.mode-toggle img{width:24px;height:24px;cursor:pointer}.create{color:#555;max-width:480px;margin:60px auto;transition:all .3s ease}.create label span{display:block;margin:30px 0 10px}.create p{margin-top:10px;font-size:.8em}.create button{display:block;font-size:1em;color:#fff;padding:8px 20px;border:0;border-radius:4px;background-color:#58249c;cursor:pointer;text-decoration:none;margin:20px auto}.create.dark,.create.dark>h2{color:#fff;transition:all .3s ease}.recipe-list{display:grid;grid-template-columns:1fr 1fr 1fr;grid-gap:40px;max-width:1200px;margin:40px auto}.recipe-list .card{background:#fff;color:#333;padding:20px;border-radius:4px;box-shadow:3px 3px 3px rgba(0,0,0,.05);transition:all .3s ease;position:relative}.recipe-list .card:hover{-webkit-transform:rotate(3deg);transform:rotate(3deg)}.recipe-list .card h3{color:#555;margin-bottom:6px}.recipe-list .card p{color:#999;font-size:.9em}.recipe-list .card div{color:#555;font-size:.7em;margin:20px 0;line-height:1.5em}.recipe-list .card a{color:#555;text-decoration:none;display:block;background:#e2e2e2;font-size:.9em;width:100px;text-align:center;width:120px;padding:8px;border-radius:4px;margin:20px auto 0}.recipe-list .card.dark{background:#555}.recipe-list .card.dark div,.recipe-list .card.dark h3,.recipe-list .card.dark p{color:#e4e4e4}.delete{position:absolute;top:10px;right:10px;cursor:pointer;-webkit-filter:invert(60%);filter:invert(60%)}.home{max-width:1200px;margin:60px auto}.home.dark p{color:#fff}.recipe{max-width:1200px;margin:40px auto;text-align:center;background:#fff;padding:40px;box-sizing:border-box}.recipe>h2{text-decoration:underline}.recipe ul{display:flex;padding:0;justify-content:center;margin-top:0}.recipe li{list-style-type:none;margin-right:10px;color:#777}.recipe li:after{content:","}.recipe li:last-child:after{content:"."}.method{text-align:left}.recipe .button{color:#555;text-decoration:none;display:block;background:#e2e2e2;font-size:.9em;width:100px;text-align:center;width:120px;padding:8px;border-radius:4px;margin:20px auto 0}.recipe.dark{background:#555;color:#e4e4e4}.recipe.dark>h2{color:#e4e4e4;text-decoration:underline}.recipe.dark li{color:#e4e4e4}.page-title.dark{color:#e2e2e2}.edit{color:#555;max-width:480px;margin:60px auto;transition:all .3s ease}.edit label span{display:block;margin:30px 0 10px}.edit p{margin-top:10px;font-size:.8em}.edit button{display:block;font-size:1em;color:#fff;padding:8px 20px;border:0;border-radius:4px;background-color:#58249c;cursor:pointer;text-decoration:none;margin:20px auto}.ingredients{display:flex;align-items:center}.ingredients button{margin:0 0 0 10px}.edit.dark,.edit.dark>h2{color:#fff;transition:all .3s ease} +/*# sourceMappingURL=main.ae178036.chunk.css.map */ \ No newline at end of file diff --git a/build/static/css/main.ae178036.chunk.css.map b/build/static/css/main.ae178036.chunk.css.map new file mode 100644 index 0000000..fcf0c6a --- /dev/null +++ b/build/static/css/main.ae178036.chunk.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["main.ae178036.chunk.css","webpack://src/index.css","webpack://src/App.css","webpack://src/components/Navbar.css","webpack://src/components/ThemeSelector.css","webpack://src/pages/create/Create.css","webpack://src/components/RecipeList.css","webpack://src/pages/home/Home.css","webpack://src/pages/recipe/Recipe.css","webpack://src/pages/search/Search.css","webpack://src/pages/edit/Edit.css"],"names":[],"mappings":"AAAA,+GAA+G,CCG/G,gBACE,WACF,CACA,KACE,8BAAgC,CAEhC,eAAgB,CAChB,kBAAmB,CACnB,UACF,CACA,gBALE,QAOF,CACA,eACE,UAAW,CACX,WAAY,CACZ,aAAc,CACd,iBAAkB,CAClB,wBAAyB,CACzB,qBAAsB,CACtB,aAAc,CACd,UAAW,CACX,qBACF,CACA,YAGE,UACF,CACA,4BAJE,iBAAkB,CAClB,gBAMF,CCnCA,KACE,eACF,CACA,UACE,eACF,CCLA,QACE,kBAAmB,CACnB,YAAa,CACb,UACF,CACA,YACE,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CACjB,aACF,CACA,aAEE,qBAAsB,CACtB,iBAAkB,CAClB,WAEF,CACA,6BANE,UAAW,CAIX,oBAMF,CAJA,gBACE,iBAGF,CACA,qBACE,UAAW,CACX,oBAAqB,CACrB,gBAAiB,CACjB,WAAY,CACZ,qBAAsB,CACtB,iBACF,CACA,2BACE,eAAgB,CAChB,UACF,CClCA,gBACE,YAAa,CACb,wBAAyB,CACzB,kBAAmB,CACnB,gBAAiB,CACjB,gBACF,CACA,mBACE,oBAAqB,CACrB,UAAW,CACX,WAAY,CACZ,cAAe,CACf,gBAAiB,CACjB,iBACF,CACA,aACE,iBACF,CACA,iBACE,UAAW,CACX,WAAY,CACZ,cACF,CCtBA,QACE,UAAW,CACX,eAAgB,CAChB,gBAAiB,CACjB,uBACF,CACA,mBACE,aAAc,CACd,kBACF,CACA,UACE,eAAgB,CAChB,cACF,CACA,eACE,aAAc,CACd,aAAc,CACd,UAAW,CACX,gBAAiB,CACjB,QAAS,CACT,iBAAkB,CAClB,wBAAyB,CACzB,cAAe,CACf,oBAAqB,CACrB,gBACF,CAWA,6BAEE,UAAc,CACd,uBACF,CCxCA,aACE,YAAa,CACb,iCAAkC,CAClC,aAAc,CACd,gBAAiB,CACjB,gBACF,CACA,mBACE,eAAgB,CAChB,UAAW,CACX,YAAa,CACb,iBAAkB,CAClB,sCAA2C,CAC3C,uBAAyB,CACzB,iBACF,CACA,yBACE,8BAAuB,CAAvB,sBACF,CACA,sBACE,UAAW,CACX,iBACF,CACA,qBACE,UAAW,CACX,cACF,CACA,uBACE,UAAW,CACX,cAAgB,CAChB,aAAc,CACd,iBACF,CACA,qBACE,UAAW,CACX,oBAAqB,CACrB,aAAc,CACd,kBAAmB,CACnB,cAAgB,CAChB,WAAY,CACZ,iBAAkB,CAClB,WAAY,CACZ,WAAY,CACZ,iBAAkB,CAClB,kBACF,CACA,wBACE,eACF,CACA,iFAGE,aACF,CAGA,QACE,iBAAkB,CAClB,QAAS,CACT,UAAW,CACX,cAAe,CACf,0BAAkB,CAAlB,kBACF,CC9DA,MACE,gBAAiB,CACjB,gBACF,CAEA,aACE,UACF,CCPA,QACE,gBAAiB,CACjB,gBAAiB,CACjB,iBAAkB,CAClB,eAAgB,CAChB,YAAa,CACb,qBACF,CACA,WACE,yBACF,CACA,WACE,YAAa,CACb,SAAU,CACV,sBAAuB,CACvB,YAEF,CACA,WACE,oBAAqB,CACrB,iBAAkB,CAClB,UACF,CAIA,iBACE,WACF,CACA,4BACE,WACF,CACA,QACE,eACF,CACA,gBACE,UAAW,CACX,oBAAqB,CACrB,aAAc,CACd,kBAAmB,CACnB,cAAgB,CAChB,WAAY,CACZ,iBAAkB,CAClB,WAAY,CACZ,WAAY,CACZ,iBAAkB,CAClB,kBACF,CAEA,aACE,eAAgB,CAChB,aACF,CACA,gBACE,aAAc,CACd,yBACF,CACA,gBACE,aACF,CC3DA,iBACI,aACJ,CCFA,MACE,UAAW,CACX,eAAgB,CAChB,gBAAiB,CACjB,uBACF,CACA,iBACE,aAAc,CACd,kBACF,CACA,QACE,eAAgB,CAChB,cACF,CACA,aACE,aAAc,CACd,aAAc,CACd,UAAW,CACX,gBAAiB,CACjB,QAAS,CACT,iBAAkB,CAClB,wBAAyB,CACzB,cAAe,CACf,oBAAqB,CACrB,gBACF,CACA,aACE,YAAa,CACb,kBACF,CACA,oBACE,iBACF,CACA,yBAEE,UAAc,CACd,uBACF","file":"main.ae178036.chunk.css","sourcesContent":["@import url(https://fonts.googleapis.com/css2?family=Raleway:wght@100;200;300;400;500;600;700;800&display=swap);\n/* base styles */\nhtml, body, #root {\n height: 100%;\n}\nbody {\n font-family: Raleway, sans-serif;\n margin: 0;\n font-size: 1.4em;\n background: #dfdfdf;\n color: #333;\n}\nh1,h2,h3,p {\n margin: 0;\n}\ninput, textarea {\n color: #333;\n padding: 8px;\n font-size: 1em;\n border-radius: 4px;\n border: 1px solid #d4d4d4;\n background-color: #fff;\n display: block;\n width: 100%;\n box-sizing: border-box;\n}\n.page-title {\n text-align: center;\n margin: 40px auto;\n color: #333;\n}\n.loading, .error {\n text-align: center;\n margin: 40px auto;\n}\n.App {\r\n min-height: 100%;\r\n}\r\n.App.dark {\r\n background: #333;\r\n}\n.navbar {\r\n background: #58249c;\r\n padding: 20px;\r\n color: #fff;\r\n}\r\n.navbar nav {\r\n display: flex;\r\n align-items: center;\r\n max-width: 1200px;\r\n margin: 0 auto;\r\n}\r\n.source-code{\r\n color: #fff;\r\n border: 1px solid #fff;\r\n border-radius: 4px;\r\n padding: 8px;\r\n text-decoration: none;\r\n}\r\n.navbar a.brand {\r\n margin-right: auto;\r\n color: #fff;\r\n text-decoration: none;\r\n}\r\n.navbar a:last-child {\r\n color: #fff;\r\n text-decoration: none;\r\n margin-left: 40px;\r\n padding: 8px;\r\n border: 1px solid #fff;\r\n border-radius: 4px;\r\n}\r\n.navbar a:last-child:hover {\r\n background: #fff;\r\n color: #333;\r\n}\r\n\n.theme-selector {\r\n display: flex;\r\n justify-content: flex-end;\r\n align-items: center;\r\n max-width: 1200px;\r\n margin: 20px auto;\r\n}\r\n.theme-buttons div {\r\n display: inline-block;\r\n width: 20px;\r\n height: 20px;\r\n cursor: pointer;\r\n margin-left: 15px;\r\n border-radius: 50%;\r\n}\r\n.mode-toggle {\r\n margin-right: auto;\r\n}\r\n.mode-toggle img {\r\n width: 24px;\r\n height: 24px;\r\n cursor: pointer;\r\n}\r\n\n.create {\r\n color: #555;\r\n max-width: 480px;\r\n margin: 60px auto;\r\n transition: all 0.3s ease;\r\n}\r\n.create label span {\r\n display: block;\r\n margin: 30px 0 10px;\r\n}\r\n.create p {\r\n margin-top: 10px;\r\n font-size: 0.8em;\r\n}\r\n.create button {\r\n display: block;\r\n font-size: 1em;\r\n color: #fff;\r\n padding: 8px 20px;\r\n border: 0;\r\n border-radius: 4px;\r\n background-color: #58249c;\r\n cursor: pointer;\r\n text-decoration: none;\r\n margin: 20px auto;\r\n}\r\n.ingredients {\r\n display: flex;\r\n align-items: center;\r\n}\r\n.ingredients button {\r\n margin: 0 0 0 10px;\r\n}\r\n/* input{\r\n transition: all 0.3s ease;\r\n} */\r\n.create.dark,\r\n.create.dark > h2 {\r\n color: #ffffff;\r\n transition: all 0.3s ease;\r\n}\r\n\n.recipe-list {\r\n display: grid;\r\n grid-template-columns: 1fr 1fr 1fr;\r\n grid-gap: 40px;\r\n max-width: 1200px;\r\n margin: 40px auto;\r\n}\r\n.recipe-list .card {\r\n background: #fff;\r\n color: #333;\r\n padding: 20px;\r\n border-radius: 4px;\r\n box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.05);\r\n transition: all 0.3s ease;\r\n position: relative;\r\n}\r\n.recipe-list .card:hover {\r\n -webkit-transform: rotate(3deg);\r\n transform: rotate(3deg);\r\n}\r\n.recipe-list .card h3 {\r\n color: #555;\r\n margin-bottom: 6px;\r\n}\r\n.recipe-list .card p {\r\n color: #999;\r\n font-size: 0.9em;\r\n}\r\n.recipe-list .card div {\r\n color: #555;\r\n font-size: 0.7em;\r\n margin: 20px 0;\r\n line-height: 1.5em;\r\n}\r\n.recipe-list .card a {\r\n color: #555;\r\n text-decoration: none;\r\n display: block;\r\n background: #e2e2e2;\r\n font-size: 0.9em;\r\n width: 100px;\r\n text-align: center;\r\n width: 120px;\r\n padding: 8px;\r\n border-radius: 4px;\r\n margin: 20px auto 0;\r\n}\r\n.recipe-list .card.dark {\r\n background: #555;\r\n}\r\n.recipe-list .card.dark p,\r\n.recipe-list .card.dark h3,\r\n.recipe-list .card.dark div {\r\n color: #e4e4e4;\r\n}\r\n\r\n/* delete icon */\r\n.delete{\r\n position: absolute;\r\n top: 10px;\r\n right: 10px;\r\n cursor: pointer;\r\n -webkit-filter:invert(60%);\r\n filter:invert(60%);\r\n}\n.home {\r\n max-width: 1200px;\r\n margin: 60px auto;\r\n}\r\n/* dark */\r\n.home.dark p{\r\n color: #ffffff\r\n}\n.recipe {\r\n max-width: 1200px;\r\n margin: 40px auto;\r\n text-align: center;\r\n background: #fff;\r\n padding: 40px;\r\n box-sizing: border-box;\r\n}\r\n.recipe>h2{\r\n text-decoration: underline;\r\n}\r\n.recipe ul {\r\n display: flex;\r\n padding: 0;\r\n justify-content: center;\r\n margin-top: 0;\r\n\r\n}\r\n.recipe li {\r\n list-style-type: none;\r\n margin-right: 10px;\r\n color: #777;\r\n}\r\n/* .recipe li:first-child::before{\r\n content:\": \";\r\n} */\r\n.recipe li::after {\r\n content: \",\";\r\n}\r\n.recipe li:last-child::after {\r\n content: \".\";\r\n}\r\n.method {\r\n text-align: left;\r\n}\r\n.recipe .button {\r\n color: #555;\r\n text-decoration: none;\r\n display: block;\r\n background: #e2e2e2;\r\n font-size: 0.9em;\r\n width: 100px;\r\n text-align: center;\r\n width: 120px;\r\n padding: 8px;\r\n border-radius: 4px;\r\n margin: 20px auto 0;\r\n}\r\n/* dark mode */\r\n.recipe.dark {\r\n background: #555;\r\n color: #e4e4e4;\r\n}\r\n.recipe.dark>h2{\r\n color: #e4e4e4;\r\n text-decoration: underline;\r\n}\r\n.recipe.dark li{\r\n color: #e4e4e4;\r\n}\r\n\r\n\n.page-title.dark{\r\n color: #e2e2e2\r\n}\n.edit {\r\n color: #555;\r\n max-width: 480px;\r\n margin: 60px auto;\r\n transition: all 0.3s ease;\r\n}\r\n.edit label span {\r\n display: block;\r\n margin: 30px 0 10px;\r\n}\r\n.edit p {\r\n margin-top: 10px;\r\n font-size: 0.8em;\r\n}\r\n.edit button {\r\n display: block;\r\n font-size: 1em;\r\n color: #fff;\r\n padding: 8px 20px;\r\n border: 0;\r\n border-radius: 4px;\r\n background-color: #58249c;\r\n cursor: pointer;\r\n text-decoration: none;\r\n margin: 20px auto;\r\n}\r\n.ingredients {\r\n display: flex;\r\n align-items: center;\r\n}\r\n.ingredients button {\r\n margin: 0 0 0 10px;\r\n}\r\n.edit.dark,\r\n.edit.dark > h2 {\r\n color: #ffffff;\r\n transition: all 0.3s ease;\r\n}\r\n\n","@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@100;200;300;400;500;600;700;800&display=swap');\n\n/* base styles */\nhtml, body, #root {\n height: 100%;\n}\nbody {\n font-family: Raleway, sans-serif;\n margin: 0;\n font-size: 1.4em;\n background: #dfdfdf;\n color: #333;\n}\nh1,h2,h3,p {\n margin: 0;\n}\ninput, textarea {\n color: #333;\n padding: 8px;\n font-size: 1em;\n border-radius: 4px;\n border: 1px solid #d4d4d4;\n background-color: #fff;\n display: block;\n width: 100%;\n box-sizing: border-box;\n}\n.page-title {\n text-align: center;\n margin: 40px auto;\n color: #333;\n}\n.loading, .error {\n text-align: center;\n margin: 40px auto;\n}",".App {\r\n min-height: 100%;\r\n}\r\n.App.dark {\r\n background: #333;\r\n}",".navbar {\r\n background: #58249c;\r\n padding: 20px;\r\n color: #fff;\r\n}\r\n.navbar nav {\r\n display: flex;\r\n align-items: center;\r\n max-width: 1200px;\r\n margin: 0 auto;\r\n}\r\n.source-code{\r\n color: #fff;\r\n border: 1px solid #fff;\r\n border-radius: 4px;\r\n padding: 8px;\r\n text-decoration: none;\r\n}\r\n.navbar a.brand {\r\n margin-right: auto;\r\n color: #fff;\r\n text-decoration: none;\r\n}\r\n.navbar a:last-child {\r\n color: #fff;\r\n text-decoration: none;\r\n margin-left: 40px;\r\n padding: 8px;\r\n border: 1px solid #fff;\r\n border-radius: 4px;\r\n}\r\n.navbar a:last-child:hover {\r\n background: #fff;\r\n color: #333;\r\n}\r\n",".theme-selector {\r\n display: flex;\r\n justify-content: flex-end;\r\n align-items: center;\r\n max-width: 1200px;\r\n margin: 20px auto;\r\n}\r\n.theme-buttons div {\r\n display: inline-block;\r\n width: 20px;\r\n height: 20px;\r\n cursor: pointer;\r\n margin-left: 15px;\r\n border-radius: 50%;\r\n}\r\n.mode-toggle {\r\n margin-right: auto;\r\n}\r\n.mode-toggle img {\r\n width: 24px;\r\n height: 24px;\r\n cursor: pointer;\r\n}\r\n",".create {\r\n color: #555;\r\n max-width: 480px;\r\n margin: 60px auto;\r\n transition: all 0.3s ease;\r\n}\r\n.create label span {\r\n display: block;\r\n margin: 30px 0 10px;\r\n}\r\n.create p {\r\n margin-top: 10px;\r\n font-size: 0.8em;\r\n}\r\n.create button {\r\n display: block;\r\n font-size: 1em;\r\n color: #fff;\r\n padding: 8px 20px;\r\n border: 0;\r\n border-radius: 4px;\r\n background-color: #58249c;\r\n cursor: pointer;\r\n text-decoration: none;\r\n margin: 20px auto;\r\n}\r\n.ingredients {\r\n display: flex;\r\n align-items: center;\r\n}\r\n.ingredients button {\r\n margin: 0 0 0 10px;\r\n}\r\n/* input{\r\n transition: all 0.3s ease;\r\n} */\r\n.create.dark,\r\n.create.dark > h2 {\r\n color: #ffffff;\r\n transition: all 0.3s ease;\r\n}\r\n",".recipe-list {\r\n display: grid;\r\n grid-template-columns: 1fr 1fr 1fr;\r\n grid-gap: 40px;\r\n max-width: 1200px;\r\n margin: 40px auto;\r\n}\r\n.recipe-list .card {\r\n background: #fff;\r\n color: #333;\r\n padding: 20px;\r\n border-radius: 4px;\r\n box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.05);\r\n transition: all 0.3s ease;\r\n position: relative;\r\n}\r\n.recipe-list .card:hover {\r\n transform: rotate(3deg);\r\n}\r\n.recipe-list .card h3 {\r\n color: #555;\r\n margin-bottom: 6px;\r\n}\r\n.recipe-list .card p {\r\n color: #999;\r\n font-size: 0.9em;\r\n}\r\n.recipe-list .card div {\r\n color: #555;\r\n font-size: 0.7em;\r\n margin: 20px 0;\r\n line-height: 1.5em;\r\n}\r\n.recipe-list .card a {\r\n color: #555;\r\n text-decoration: none;\r\n display: block;\r\n background: #e2e2e2;\r\n font-size: 0.9em;\r\n width: 100px;\r\n text-align: center;\r\n width: 120px;\r\n padding: 8px;\r\n border-radius: 4px;\r\n margin: 20px auto 0;\r\n}\r\n.recipe-list .card.dark {\r\n background: #555;\r\n}\r\n.recipe-list .card.dark p,\r\n.recipe-list .card.dark h3,\r\n.recipe-list .card.dark div {\r\n color: #e4e4e4;\r\n}\r\n\r\n/* delete icon */\r\n.delete{\r\n position: absolute;\r\n top: 10px;\r\n right: 10px;\r\n cursor: pointer;\r\n filter:invert(60%);\r\n}",".home {\r\n max-width: 1200px;\r\n margin: 60px auto;\r\n}\r\n/* dark */\r\n.home.dark p{\r\n color: #ffffff\r\n}",".recipe {\r\n max-width: 1200px;\r\n margin: 40px auto;\r\n text-align: center;\r\n background: #fff;\r\n padding: 40px;\r\n box-sizing: border-box;\r\n}\r\n.recipe>h2{\r\n text-decoration: underline;\r\n}\r\n.recipe ul {\r\n display: flex;\r\n padding: 0;\r\n justify-content: center;\r\n margin-top: 0;\r\n\r\n}\r\n.recipe li {\r\n list-style-type: none;\r\n margin-right: 10px;\r\n color: #777;\r\n}\r\n/* .recipe li:first-child::before{\r\n content:\": \";\r\n} */\r\n.recipe li::after {\r\n content: \",\";\r\n}\r\n.recipe li:last-child::after {\r\n content: \".\";\r\n}\r\n.method {\r\n text-align: left;\r\n}\r\n.recipe .button {\r\n color: #555;\r\n text-decoration: none;\r\n display: block;\r\n background: #e2e2e2;\r\n font-size: 0.9em;\r\n width: 100px;\r\n text-align: center;\r\n width: 120px;\r\n padding: 8px;\r\n border-radius: 4px;\r\n margin: 20px auto 0;\r\n}\r\n/* dark mode */\r\n.recipe.dark {\r\n background: #555;\r\n color: #e4e4e4;\r\n}\r\n.recipe.dark>h2{\r\n color: #e4e4e4;\r\n text-decoration: underline;\r\n}\r\n.recipe.dark li{\r\n color: #e4e4e4;\r\n}\r\n\r\n",".page-title.dark{\r\n color: #e2e2e2\r\n}",".edit {\r\n color: #555;\r\n max-width: 480px;\r\n margin: 60px auto;\r\n transition: all 0.3s ease;\r\n}\r\n.edit label span {\r\n display: block;\r\n margin: 30px 0 10px;\r\n}\r\n.edit p {\r\n margin-top: 10px;\r\n font-size: 0.8em;\r\n}\r\n.edit button {\r\n display: block;\r\n font-size: 1em;\r\n color: #fff;\r\n padding: 8px 20px;\r\n border: 0;\r\n border-radius: 4px;\r\n background-color: #58249c;\r\n cursor: pointer;\r\n text-decoration: none;\r\n margin: 20px auto;\r\n}\r\n.ingredients {\r\n display: flex;\r\n align-items: center;\r\n}\r\n.ingredients button {\r\n margin: 0 0 0 10px;\r\n}\r\n.edit.dark,\r\n.edit.dark > h2 {\r\n color: #ffffff;\r\n transition: all 0.3s ease;\r\n}\r\n"]} \ No newline at end of file diff --git a/build/static/js/2.6ee1e354.chunk.js b/build/static/js/2.6ee1e354.chunk.js new file mode 100644 index 0000000..2e30ff1 --- /dev/null +++ b/build/static/js/2.6ee1e354.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.6ee1e354.chunk.js.LICENSE.txt */ +(this["webpackJsonpcooking-ninja"]=this["webpackJsonpcooking-ninja"]||[]).push([[2],[function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return u}));var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{s(r.next(e))}catch(t){o(t)}}function u(e){try{s(r.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function a(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>6|192,t[n++]=63&i|128):55296===(64512&i)&&r+1>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},o={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i>2,f=(3&o)<<4|u>>4,h=(15&u)<<2|c>>6,d=63&c;s||(d=64,a||(h=64)),r.push(n[l],n[f],n[h],n[d])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(i(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,r=0;n191&&i<224){var o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=e[n++]))<<12|(63&(u=e[n++]))<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(a>>10)),t[r++]=String.fromCharCode(56320+(1023&a))}else{o=e[n++];var u=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&u)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i>4;if(r.push(c),64!==u){var l=a<<4&240|u>>2;if(r.push(l),64!==s){var f=u<<6&192|s;r.push(f)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};function a(e){return u(void 0,e)}function u(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&"__proto__"!==n&&(e[n]=u(e[n],t[n]));return e}var s=function(){function e(){var e=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))}return e.prototype.wrapCallback=function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"===typeof e&&(t.promise.catch((function(){})),1===e.length?e(n):e(n,r))}},e}();function c(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var n=t||"demo-project",i=e.iat||0,a=e.sub||e.user_id;if(!a)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var u=Object(r.a)({iss:"https://securetoken.google.com/"+n,aud:n,iat:i,exp:i+3600,auth_time:i,sub:a,user_id:a,firebase:{sign_in_provider:"custom",identities:{}}},e);return[o.encodeString(JSON.stringify({alg:"none",type:"JWT"}),!1),o.encodeString(JSON.stringify(u),!1),""].join(".")}function l(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}function f(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(l())}function h(){try{return"[object process]"===Object.prototype.toString.call(e.process)}catch(t){return!1}}function d(){return"object"===typeof self&&self.self===self}function p(){var e="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof e&&void 0!==e.id}function y(){return"object"===typeof navigator&&"ReactNative"===navigator.product}function v(){return l().indexOf("Electron/")>=0}function m(){var e=l();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function g(){return l().indexOf("MSAppHost/")>=0}var b=function(e){function t(n,r,i){var o=e.call(this,r)||this;return o.code=n,o.customData=i,o.name="FirebaseError",Object.setPrototypeOf(o,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,w.prototype.create),o}return Object(r.b)(t,e),t}(Error),w=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n}return e.prototype.create=function(e){for(var t=[],n=1;n"}))}var _=/\{\$([^}]+)}/g;function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}!function(){function e(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var e=1;e>>31)}var o,a,u=this.chain_[0],s=this.chain_[1],c=this.chain_[2],l=this.chain_[3],f=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(o=l^s&(c^l),a=1518500249):(o=s^c^l,a=1859775393):r<60?(o=s&c|l&(s|c),a=2400959708):(o=s^c^l,a=3395469782);i=(u<<5|u>>>27)+o+f+a+n[r]&4294967295;f=l,l=c,c=4294967295&(s<<30|s>>>2),s=u,u=i}this.chain_[0]=this.chain_[0]+u&4294967295,this.chain_[1]=this.chain_[1]+s&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+f&4294967295},e.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r=56;n--)this.buf_[n]=255&t,t/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)e[r]=this.chain_[n]>>i&255,++r;return e}}();function O(e,t){var n=new T(e,t);return n.subscribe.bind(n)}var T=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((function(){e(n)})).catch((function(e){n.error(e)}))}return e.prototype.next=function(e){this.forEachObserver((function(t){t.next(e)}))},e.prototype.error=function(e){this.forEachObserver((function(t){t.error(e)})),this.close(e)},e.prototype.complete=function(){this.forEachObserver((function(e){e.complete()})),this.close()},e.prototype.subscribe=function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!==typeof e||null===e)return!1;for(var n=0,r=t;n0&&(!0===e.index&&a(!1),E(e.children,t,s,u)),(null!=e.path||e.index)&&t.push({path:u,score:O(u,e.index),routesMeta:s})})),t}var _=/^:\w+$/,S=function(e){return"*"===e};function O(e,t){var n=e.split("/"),r=n.length;return n.some(S)&&(r+=-2),t&&(r+=2),n.filter((function(e){return!S(e)})).reduce((function(e,t){return e+(_.test(t)?3:""===t?1:10)}),r)}function T(e,t,n){for(var r=t,i=e.routesMeta,o={},a="/",u=[],s=0;s=0?t[u]:"/"}var c=function(e,t){void 0===t&&(t="/");var n="string"===typeof e?Object(o.f)(e):e,r=n.pathname,i=n.search,a=void 0===i?"":i,u=n.hash,s=void 0===u?"":u;return{pathname:r?r.startsWith("/")?r:function(e,t){var n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((function(e){".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(r,t):t,search:D(a),hash:P(s)}}(i,r);return a&&"/"!==a&&a.endsWith("/")&&!c.pathname.endsWith("/")&&(c.pathname+="/"),c}function N(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;var n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}var x=function(e){return e.join("/").replace(/\/\/+/g,"/")},A=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},D=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},P=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(15);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return n}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return lc})),n.d(t,"b",(function(){return fc})),n.d(t,"c",(function(){return ec})),n.d(t,"d",(function(){return Zs})),n.d(t,"e",(function(){return O})),n.d(t,"f",(function(){return ic})),n.d(t,"g",(function(){return rc})),n.d(t,"h",(function(){return Hu})),n.d(t,"i",(function(){return hc})),n.d(t,"j",(function(){return pc})),n.d(t,"k",(function(){return Mu})),n.d(t,"l",(function(){return ac})),n.d(t,"m",(function(){return Js})),n.d(t,"n",(function(){return mc})),n.d(t,"o",(function(){return nc})),n.d(t,"p",(function(){return gc})),n.d(t,"q",(function(){return yc})),n.d(t,"r",(function(){return Lu}));var r=n(3),i=n(9),o=n(7),a=n(0),u=function(){function e(e,t){var n=this;this.previousValue=e,t&&(t.sequenceNumberHandler=function(e){return n.t(e)},this.i=function(e){return t.writeSequenceNumber(e)})}return e.prototype.t=function(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue},e.prototype.next=function(){var e=++this.previousValue;return this.i&&this.i(e),e},e}();u.o=-1;var s={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},c=function(e){function t(t,n){var r=this;return(r=e.call(this,n)||this).code=t,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return Object(a.b)(t,e),t}(Error),l=new i.b("@firebase/firestore");function f(){return l.logLevel}function h(e){for(var t=[],n=1;nt?1:0}function _(e,t,n){return e.length===t.length&&e.every((function(e,r){return n(e,t[r])}))}function S(e){return e+"\0"}var O=function(){function e(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new c(s.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new c(s.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new c(s.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new c(s.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}return e.now=function(){return e.fromMillis(Date.now())},e.fromDate=function(t){return e.fromMillis(t.getTime())},e.fromMillis=function(t){var n=Math.floor(t/1e3);return new e(n,Math.floor(1e6*(t-1e3*n)))},e.prototype.toDate=function(){return new Date(this.toMillis())},e.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},e.prototype._compareTo=function(e){return this.seconds===e.seconds?E(this.nanoseconds,e.nanoseconds):E(this.seconds,e.seconds)},e.prototype.isEqual=function(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds},e.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},e.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},e.prototype.valueOf=function(){var e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},e}(),T=function(){function e(e){this.timestamp=e}return e.fromTimestamp=function(t){return new e(t)},e.min=function(){return new e(new O(0,0))},e.prototype.compareTo=function(e){return this.timestamp._compareTo(e.timestamp)},e.prototype.isEqual=function(e){return this.timestamp.isEqual(e.timestamp)},e.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},e.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},e.prototype.toTimestamp=function(){return this.timestamp},e}();function k(e){var t=0;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function I(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function C(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}var N=function(){function e(e,t,n){void 0===t?t=0:t>e.length&&v(),void 0===n?n=e.length-t:n>e.length-t&&v(),this.segments=e,this.offset=t,this.len=n}return Object.defineProperty(e.prototype,"length",{get:function(){return this.len},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return 0===e.comparator(this,t)},e.prototype.child=function(t){var n=this.segments.slice(this.offset,this.limit());return t instanceof e?t.forEach((function(e){n.push(e)})):n.push(t),this.construct(n)},e.prototype.limit=function(){return this.offset+this.length},e.prototype.popFirst=function(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)},e.prototype.popLast=function(){return this.construct(this.segments,this.offset,this.length-1)},e.prototype.firstSegment=function(){return this.segments[this.offset]},e.prototype.lastSegment=function(){return this.get(this.length-1)},e.prototype.get=function(e){return this.segments[this.offset+e]},e.prototype.isEmpty=function(){return 0===this.length},e.prototype.isPrefixOf=function(e){if(e.lengtho)return 1}return e.lengtht.length?1:0},e}(),x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.b)(t,e),t.prototype.construct=function(e,n,r){return new t(e,n,r)},t.prototype.canonicalString=function(){return this.toArray().join("/")},t.prototype.toString=function(){return this.canonicalString()},t.fromString=function(){for(var e=[],n=0;n=0)throw new c(s.INVALID_ARGUMENT,"Invalid segment ("+a+"). Paths must not contain // in them.");r.push.apply(r,a.split("/").filter((function(e){return e.length>0})))}return new t(r)},t.emptyPath=function(){return new t([])},t}(N),A=/^[_a-zA-Z][_a-zA-Z0-9]*$/,D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.b)(t,e),t.prototype.construct=function(e,n,r){return new t(e,n,r)},t.isValidIdentifier=function(e){return A.test(e)},t.prototype.canonicalString=function(){return this.toArray().map((function(e){return e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),t.isValidIdentifier(e)||(e="`"+e+"`"),e})).join(".")},t.prototype.toString=function(){return this.canonicalString()},t.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},t.keyField=function(){return new t(["__name__"])},t.fromServerFormat=function(e){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new c(s.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},a=!1;i=Number.MIN_SAFE_INTEGER}var H=function(){function e(e){this.path=e}return e.fromPath=function(t){return new e(x.fromString(t))},e.fromName=function(t){return new e(x.fromString(t).popFirst(5))},e.prototype.hasCollectionId=function(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e},e.prototype.isEqual=function(e){return null!==e&&0===x.comparator(this.path,e.path)},e.prototype.toString=function(){return this.path.toString()},e.comparator=function(e,t){return x.comparator(e.path,t.path)},e.isDocumentKey=function(e){return e.length%2==0},e.fromSegments=function(t){return new e(new x(t.slice()))},e}();function W(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?U(e)?4:10:v()}function G(e,t){var n=W(e);if(n!==W(t))return!1;switch(n){case 0:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return q(e).isEqual(q(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;var n=L(e.timestampValue),r=L(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return F(e.bytesValue).isEqual(F(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return M(e.geoPointValue.latitude)===M(t.geoPointValue.latitude)&&M(e.geoPointValue.longitude)===M(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return M(e.integerValue)===M(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){var n=M(e.doubleValue),r=M(t.doubleValue);return n===r?z(n)===z(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return _(e.arrayValue.values||[],t.arrayValue.values||[],G);case 10:return function(e,t){var n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(k(n)!==k(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!G(n[i],r[i])))return!1;return!0}(e,t);default:return v()}}function Q(e,t){return void 0!==(e.values||[]).find((function(e){return G(e,t)}))}function $(e,t){var n=W(e),r=W(t);if(n!==r)return E(n,r);switch(n){case 0:return 0;case 1:return E(e.booleanValue,t.booleanValue);case 2:return function(e,t){var n=M(e.integerValue||e.doubleValue),r=M(t.integerValue||t.doubleValue);return nr?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return Y(e.timestampValue,t.timestampValue);case 4:return Y(q(e),q(t));case 5:return E(e.stringValue,t.stringValue);case 6:return function(e,t){var n=F(e),r=F(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){for(var n=e.split("/"),r=t.split("/"),i=0;i":return e>0;case">=":return e>=0;default:return v()}},t.prototype.g=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},t}((function(){})),pe=function(e){function t(t,n,r){var i=this;return(i=e.call(this,t,n,r)||this).key=H.fromName(r.referenceValue),i}return Object(a.b)(t,e),t.prototype.matches=function(e){var t=H.comparator(e.key,this.key);return this.m(t)},t}(de),ye=function(e){function t(t,n){var r=this;return(r=e.call(this,t,"in",n)||this).keys=me("in",n),r}return Object(a.b)(t,e),t.prototype.matches=function(e){return this.keys.some((function(t){return t.isEqual(e.key)}))},t}(de),ve=function(e){function t(t,n){var r=this;return(r=e.call(this,t,"not-in",n)||this).keys=me("not-in",n),r}return Object(a.b)(t,e),t.prototype.matches=function(e){return!this.keys.some((function(t){return t.isEqual(e.key)}))},t}(de);function me(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map((function(e){return H.fromName(e.referenceValue)}))}var ge=function(e){function t(t,n){return e.call(this,t,"array-contains",n)||this}return Object(a.b)(t,e),t.prototype.matches=function(e){var t=e.data.field(this.field);return te(t)&&Q(t.arrayValue,this.value)},t}(de),be=function(e){function t(t,n){return e.call(this,t,"in",n)||this}return Object(a.b)(t,e),t.prototype.matches=function(e){var t=e.data.field(this.field);return null!==t&&Q(this.value.arrayValue,t)},t}(de),we=function(e){function t(t,n){return e.call(this,t,"not-in",n)||this}return Object(a.b)(t,e),t.prototype.matches=function(e){if(Q(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var t=e.data.field(this.field);return null!==t&&!Q(this.value.arrayValue,t)},t}(de),Ee=function(e){function t(t,n){return e.call(this,t,"array-contains-any",n)||this}return Object(a.b)(t,e),t.prototype.matches=function(e){var t=this,n=e.data.field(this.field);return!(!te(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(e){return Q(t.value.arrayValue,e)}))},t}(de),_e=function(e,t){this.position=e,this.before=t};function Se(e){return(e.before?"b":"a")+":"+e.position.map((function(e){return X(e)})).join(",")}var Oe=function(e,t){void 0===t&&(t="asc"),this.field=e,this.dir=t};function Te(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}function ke(e,t,n){for(var r=0,i=0;i0?e.explicitOrderBy[0].field:null}function je(e){for(var t=0,n=e.filters;t0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";t.p.push(new Oe(D.keyField(),s))}}}return t.p}function Me(e){var t=g(e);if(!t.T)if("F"===t.limitType)t.T=ce(t.path,t.collectionGroup,Le(t),t.filters,t.limit,t.startAt,t.endAt);else{for(var n=[],r=0,i=Le(t);r0&&(t+=", orderBy: ["+e.orderBy.map((function(e){return function(e){return e.field.canonicalString()+" ("+e.dir+")"}(e)})).join(", ")+"]"),e.startAt&&(t+=", startAt: "+Se(e.startAt)),e.endAt&&(t+=", endAt: "+Se(e.endAt)),"Target("+t+")"}(Me(e))+"; limitType="+e.limitType+")"}function Be(e,t){return t.isFoundDocument()&&function(e,t){var n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):H.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(var n=0,r=e.explicitOrderBy;n0&&(t=t.right)}return null},e.prototype.indexOf=function(e){for(var t=0,n=this.root;!n.isEmpty();){var r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1},e.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(e.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),e.prototype.minKey=function(){return this.root.minKey()},e.prototype.maxKey=function(){return this.root.maxKey()},e.prototype.inorderTraversal=function(e){return this.root.inorderTraversal(e)},e.prototype.forEach=function(e){this.inorderTraversal((function(t,n){return e(t,n),!1}))},e.prototype.toString=function(){var e=[];return this.inorderTraversal((function(t,n){return e.push(t+":"+n),!1})),"{"+e.join(", ")+"}"},e.prototype.reverseTraversal=function(e){return this.root.reverseTraversal(e)},e.prototype.getIterator=function(){return new Nt(this.root,null,this.comparator,!1)},e.prototype.getIteratorFrom=function(e){return new Nt(this.root,e,this.comparator,!1)},e.prototype.getReverseIterator=function(){return new Nt(this.root,null,this.comparator,!0)},e.prototype.getReverseIteratorFrom=function(e){return new Nt(this.root,e,this.comparator,!0)},e}(),Nt=function(){function e(e,t,n,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!e.isEmpty();)if(i=t?n(e.key,t):1,r&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(0===i){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}return e.prototype.getNext=function(){var e=this.nodeStack.pop(),t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t},e.prototype.hasNext=function(){return this.nodeStack.length>0},e.prototype.peek=function(){if(0===this.nodeStack.length)return null;var e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}},e}(),xt=function(){function e(t,n,r,i,o){this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:e.EMPTY,this.right=null!=o?o:e.EMPTY,this.size=this.left.size+1+this.right.size}return e.prototype.copy=function(t,n,r,i,o){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},e.prototype.minKey=function(){return this.min().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,n){var r=this,i=n(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n))).fixUp()},e.prototype.removeMin=function(){if(this.left.isEmpty())return e.EMPTY;var t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),(t=t.copy(null,null,null,t.left.removeMin(),null)).fixUp()},e.prototype.remove=function(t,n){var r,i=this;if(n(t,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(t,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===n(t,i.key)){if(i.right.isEmpty())return e.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(t,n))}return i.fixUp()},e.prototype.isRed=function(){return this.color},e.prototype.fixUp=function(){var e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e},e.prototype.moveRedLeft=function(){var e=this.colorFlip();return e.right.left.isRed()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight())).rotateLeft()).colorFlip()),e},e.prototype.moveRedRight=function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=(e=e.rotateRight()).colorFlip()),e},e.prototype.rotateLeft=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth=function(){var e=this.check();return Math.pow(2,e)<=this.size+1},e.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw v();if(this.right.isRed())throw v();var e=this.left.check();if(e!==this.right.check())throw v();return e+(this.isRed()?0:1)},e}();xt.EMPTY=null,xt.RED=!0,xt.BLACK=!1,xt.EMPTY=new(function(){function e(){this.size=0}return Object.defineProperty(e.prototype,"key",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){throw v()},enumerable:!1,configurable:!0}),e.prototype.copy=function(e,t,n,r,i){return this},e.prototype.insert=function(e,t,n){return new xt(e,t)},e.prototype.remove=function(e,t){return this},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.isRed=function(){return!1},e.prototype.checkMaxDepth=function(){return!0},e.prototype.check=function(){return 0},e}());var At=function(){function e(e){this.comparator=e,this.data=new Ct(this.comparator)}return e.prototype.has=function(e){return null!==this.data.get(e)},e.prototype.first=function(){return this.data.minKey()},e.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(e.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),e.prototype.indexOf=function(e){return this.data.indexOf(e)},e.prototype.forEach=function(e){this.data.inorderTraversal((function(t,n){return e(t),!1}))},e.prototype.forEachInRange=function(e,t){for(var n=this.data.getIteratorFrom(e[0]);n.hasNext();){var r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}},e.prototype.forEachWhile=function(e,t){var n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return},e.prototype.firstAfterOrEqual=function(e){var t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null},e.prototype.getIterator=function(){return new Dt(this.data.getIterator())},e.prototype.getIteratorFrom=function(e){return new Dt(this.data.getIteratorFrom(e))},e.prototype.add=function(e){return this.copy(this.data.remove(e).insert(e,!0))},e.prototype.delete=function(e){return this.has(e)?this.copy(this.data.remove(e)):this},e.prototype.isEmpty=function(){return this.data.isEmpty()},e.prototype.unionWith=function(e){var t=this;return t.size0&&(this.F=!0,this.C=e)},e.prototype.M=function(){var e=Vt(),t=Vt(),n=Vt();return this.D.forEach((function(r,i){switch(i){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:v()}})),new Kt(this.C,this.N,e,t,n)},e.prototype.L=function(){this.F=!1,this.D=Xt()},e.prototype.B=function(e,t){this.F=!0,this.D=this.D.insert(e,t)},e.prototype.q=function(e){this.F=!0,this.D=this.D.remove(e)},e.prototype.U=function(){this.S+=1},e.prototype.K=function(){this.S-=1},e.prototype.j=function(){this.F=!0,this.N=!0},e}(),$t=function(){function e(e){this.W=e,this.G=new Map,this.H=jt(),this.J=Yt(),this.Y=new At(E)}return e.prototype.X=function(e){for(var t=0,n=e.v;t0?e.targetIds.forEach(t):this.G.forEach((function(e,r){n.st(r)&&t(r)}))},e.prototype.rt=function(e){var t=e.targetId,n=e.V.count,r=this.ot(t);if(r){var i=r.target;if(he(i))if(0===n){var o=new H(i.path);this.tt(t,o,ue.newNoDocument(o,T.min()))}else m(1===n);else this.ct(t)!==n&&(this.it(t),this.Y=this.Y.add(t))}},e.prototype.ut=function(e){var t=this,n=new Map;this.G.forEach((function(r,i){var o=t.ot(i);if(o){if(r.current&&he(o.target)){var a=new H(o.target.path);null!==t.H.get(a)||t.at(i,a)||t.tt(i,a,ue.newNoDocument(a,e))}r.O&&(n.set(i,r.M()),r.L())}}));var r=Vt();this.J.forEach((function(e,n){var i=!0;n.forEachWhile((function(e){var n=t.ot(e);return!n||2===n.purpose||(i=!1,!1)})),i&&(r=r.add(e))}));var i=new zt(e,n,this.Y,this.H,r);return this.H=jt(),this.J=Yt(),this.Y=new At(E),i},e.prototype.Z=function(e,t){if(this.st(e)){var n=this.at(e,t.key)?2:0;this.nt(e).B(t.key,n),this.H=this.H.insert(t.key,t),this.J=this.J.insert(t.key,this.ht(t.key).add(e))}},e.prototype.tt=function(e,t,n){if(this.st(e)){var r=this.nt(e);this.at(e,t)?r.B(t,1):r.q(t),this.J=this.J.insert(t,this.ht(t).delete(e)),n&&(this.H=this.H.insert(t,n))}},e.prototype.removeTarget=function(e){this.G.delete(e)},e.prototype.ct=function(e){var t=this.nt(e).M();return this.W.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size},e.prototype.U=function(e){this.nt(e).U()},e.prototype.nt=function(e){var t=this.G.get(e);return t||(t=new Qt,this.G.set(e,t)),t},e.prototype.ht=function(e){var t=this.J.get(e);return t||(t=new At(E),this.J=this.J.insert(e,t)),t},e.prototype.st=function(e){var t=null!==this.ot(e);return t||h("WatchChangeAggregator","Detected inactive target",e),t},e.prototype.ot=function(e){var t=this.G.get(e);return t&&t.k?null:this.W.lt(e)},e.prototype.it=function(e){var t=this;this.G.set(e,new Qt),this.W.getRemoteKeysForTarget(e).forEach((function(n){t.tt(e,n,null)}))},e.prototype.at=function(e,t){return this.W.getRemoteKeysForTarget(e).has(t)},e}();function Yt(){return new Ct(H.comparator)}function Xt(){return new Ct(H.comparator)}var Jt={asc:"ASCENDING",desc:"DESCENDING"},Zt={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},en=function(e,t){this.databaseId=e,this.I=t};function tn(e,t){return e.I?new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+t.nanoseconds).slice(-9)+"Z":{seconds:""+t.seconds,nanos:t.nanoseconds}}function nn(e,t){return e.I?t.toBase64():t.toUint8Array()}function rn(e,t){return tn(e,t.toTimestamp())}function on(e){return m(!!e),T.fromTimestamp(function(e){var t=L(e);return new O(t.seconds,t.nanos)}(e))}function an(e,t){return function(e){return new x(["projects",e.projectId,"databases",e.database])}(e).child("documents").child(t).canonicalString()}function un(e){var t=x.fromString(e);return m(An(t)),t}function sn(e,t){return an(e.databaseId,t.path)}function cn(e,t){var n=un(t);if(n.get(1)!==e.databaseId.projectId)throw new c(s.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new c(s.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new H(dn(n))}function ln(e,t){return an(e.databaseId,t)}function fn(e){var t=un(e);return 4===t.length?x.emptyPath():dn(t)}function hn(e){return new x(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function dn(e){return m(e.length>4&&"documents"===e.get(4)),e.popFirst(5)}function pn(e,t,n){return{name:sn(e,t),fields:n.toProto().mapValue.fields}}function yn(e,t,n){var r=cn(e,t.name),i=on(t.updateTime),o=new oe({mapValue:{fields:t.fields}}),a=ue.newFoundDocument(r,i,o);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function vn(e,t){var n;if(t instanceof vt)n={update:pn(e,t.key,t.value)};else if(t instanceof St)n={delete:sn(e,t.key)};else if(t instanceof mt)n={update:pn(e,t.key,t.data),updateMask:xn(t.fieldMask)};else{if(!(t instanceof Ot))return v();n={verify:sn(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map((function(e){return function(e,t){var n=t.transform;if(n instanceof Je)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof Ze)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof tt)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof rt)return{fieldPath:t.field.canonicalString(),increment:n.A};throw v()}(0,e)}))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:rn(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:v()}(e,t.precondition)),n}function mn(e,t){var n=t.currentDocument?function(e){return void 0!==e.updateTime?st.updateTime(on(e.updateTime)):void 0!==e.exists?st.exists(e.exists):st.none()}(t.currentDocument):st.none(),r=t.updateTransforms?t.updateTransforms.map((function(t){return function(e,t){var n=null;if("setToServerValue"in t)m("REQUEST_TIME"===t.setToServerValue),n=new Je;else if("appendMissingElements"in t){var r=t.appendMissingElements.values||[];n=new Ze(r)}else if("removeAllFromArray"in t){var i=t.removeAllFromArray.values||[];n=new tt(i)}else"increment"in t?n=new rt(e,t.increment):v();var o=D.fromServerFormat(t.fieldPath);return new at(o,n)}(e,t)})):[];if(t.update){t.update.name;var i=cn(e,t.update.name),o=new oe({mapValue:{fields:t.update.fields}});if(t.updateMask){var a=function(e){var t=e.fieldPaths||[];return new P(t.map((function(e){return D.fromServerFormat(e)})))}(t.updateMask);return new mt(i,o,a,n,r)}return new vt(i,o,n,r)}if(t.delete){var u=cn(e,t.delete);return new St(u,n)}if(t.verify){var s=cn(e,t.verify);return new Ot(s,n)}return v()}function gn(e,t){return{documents:[ln(e,t.path)]}}function bn(e,t){var n={structuredQuery:{}},r=t.path;null!==t.collectionGroup?(n.parent=ln(e,r),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=ln(e,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);var i=function(e){if(0!==e.length){var t=e.map((function(e){return function(e){if("=="===e.op){if(re(e.value))return{unaryFilter:{field:kn(e.field),op:"IS_NAN"}};if(ne(e.value))return{unaryFilter:{field:kn(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(re(e.value))return{unaryFilter:{field:kn(e.field),op:"IS_NOT_NAN"}};if(ne(e.value))return{unaryFilter:{field:kn(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:kn(e.field),op:Tn(e.op),value:e.value}}}(e)}));return 1===t.length?t[0]:{compositeFilter:{op:"AND",filters:t}}}}(t.filters);i&&(n.structuredQuery.where=i);var o=function(e){if(0!==e.length)return e.map((function(e){return function(e){return{field:kn(e.field),direction:On(e.dir)}}(e)}))}(t.orderBy);o&&(n.structuredQuery.orderBy=o);var a=function(e,t){return e.I||B(t)?t:{value:t}}(e,t.limit);return null!==a&&(n.structuredQuery.limit=a),t.startAt&&(n.structuredQuery.startAt=_n(t.startAt)),t.endAt&&(n.structuredQuery.endAt=_n(t.endAt)),n}function wn(e){var t=fn(e.parent),n=e.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){m(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:t=t.child(o.collectionId)}var a=[];n.where&&(a=En(n.where));var u=[];n.orderBy&&(u=n.orderBy.map((function(e){return function(e){return new Oe(In(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e)})));var s=null;n.limit&&(s=function(e){var t;return B(t="object"==typeof e?e.value:e)?null:t}(n.limit));var c=null;n.startAt&&(c=Sn(n.startAt));var l=null;return n.endAt&&(l=Sn(n.endAt)),Ne(t,i,u,a,s,"F",c,l)}function En(e){return e?void 0!==e.unaryFilter?[Nn(e)]:void 0!==e.fieldFilter?[Cn(e)]:void 0!==e.compositeFilter?e.compositeFilter.filters.map((function(e){return En(e)})).reduce((function(e,t){return e.concat(t)})):v():[]}function _n(e){return{before:e.before,values:e.position}}function Sn(e){var t=!!e.before,n=e.values||[];return new _e(n,t)}function On(e){return Jt[e]}function Tn(e){return Zt[e]}function kn(e){return{fieldPath:e.canonicalString()}}function In(e){return D.fromServerFormat(e.fieldPath)}function Cn(e){return de.create(In(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return v()}}(e.fieldFilter.op),e.fieldFilter.value)}function Nn(e){switch(e.unaryFilter.op){case"IS_NAN":var t=In(e.unaryFilter.field);return de.create(t,"==",{doubleValue:NaN});case"IS_NULL":var n=In(e.unaryFilter.field);return de.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=In(e.unaryFilter.field);return de.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=In(e.unaryFilter.field);return de.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return v()}}function xn(e){var t=[];return e.fields.forEach((function(e){return t.push(e.canonicalString())})),{fieldPaths:t}}function An(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}function Dn(e){for(var t="",n=0;n0&&(t=jn(t)),t=Pn(e.get(n),t);return jn(t)}function Pn(e,t){for(var n=t,r=e.length,i=0;i=2),2===t)return m("\x01"===e.charAt(0)&&"\x01"===e.charAt(1)),x.emptyPath();for(var n=t-2,r=[],i="",o=0;on)&&v(),e.charAt(a+1)){case"\x01":var u=e.substring(o,a),s=void 0;0===i.length?s=u:(s=i+=u,i=""),r.push(s);break;case"\x10":i+=e.substring(o,a),i+="\0";break;case"\x11":i+=e.substring(o,a+1);break;default:v()}o=a+2}return new x(r)}var Ln=function(e,t){this.seconds=e,this.nanoseconds=t},Mn=function(e,t,n){this.ownerId=e,this.allowTabSynchronization=t,this.leaseTimestampMs=n};Mn.store="owner",Mn.key="owner";var Fn=function(e,t,n){this.userId=e,this.lastAcknowledgedBatchId=t,this.lastStreamToken=n};Fn.store="mutationQueues",Fn.keyPath="userId";var Un=function(e,t,n,r,i){this.userId=e,this.batchId=t,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};Un.store="mutations",Un.keyPath="batchId",Un.userMutationsIndex="userMutationsIndex",Un.userMutationsKeyPath=["userId","batchId"];var Vn=function(){function e(){}return e.prefixForUser=function(e){return[e]},e.prefixForPath=function(e,t){return[e,Dn(t)]},e.key=function(e,t,n){return[e,Dn(t),n]},e}();Vn.store="documentMutations",Vn.PLACEHOLDER=new Vn;var qn=function(e,t){this.path=e,this.readTime=t},Bn=function(e,t){this.path=e,this.version=t},zn=function(e,t,n,r,i,o){this.unknownDocument=e,this.noDocument=t,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=o};zn.store="remoteDocuments",zn.readTimeIndex="readTimeIndex",zn.readTimeIndexPath="readTime",zn.collectionReadTimeIndex="collectionReadTimeIndex",zn.collectionReadTimeIndexPath=["parentPath","readTime"];var Kn=function(e){this.byteSize=e};Kn.store="remoteDocumentGlobal",Kn.key="remoteDocumentGlobalKey";var Hn=function(e,t,n,r,i,o,a){this.targetId=e,this.canonicalId=t,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=a};Hn.store="targets",Hn.keyPath="targetId",Hn.queryTargetsIndexName="queryTargetsIndex",Hn.queryTargetsKeyPath=["canonicalId","targetId"];var Wn=function(e,t,n){this.targetId=e,this.path=t,this.sequenceNumber=n};Wn.store="targetDocuments",Wn.keyPath=["targetId","path"],Wn.documentTargetsIndex="documentTargetsIndex",Wn.documentTargetsKeyPath=["path","targetId"];var Gn=function(e,t,n,r){this.highestTargetId=e,this.highestListenSequenceNumber=t,this.lastRemoteSnapshotVersion=n,this.targetCount=r};Gn.key="targetGlobalKey",Gn.store="targetGlobal";var Qn=function(e,t){this.collectionId=e,this.parent=t};Qn.store="collectionParents",Qn.keyPath=["collectionId","parent"];var $n=function(e,t,n,r){this.clientId=e,this.updateTimeMs=t,this.networkEnabled=n,this.inForeground=r};$n.store="clientMetadata",$n.keyPath="clientId";var Yn=function(e,t,n){this.bundleId=e,this.createTime=t,this.version=n};Yn.store="bundles",Yn.keyPath="bundleId";var Xn=function(e,t,n){this.name=e,this.readTime=t,this.bundledQuery=n};Xn.store="namedQueries",Xn.keyPath="name";var Jn=Object(a.d)(Object(a.d)([],Object(a.d)(Object(a.d)([],Object(a.d)(Object(a.d)([],Object(a.d)(Object(a.d)([],[Fn.store,Un.store,Vn.store,zn.store,Hn.store,Mn.store,Gn.store,Wn.store]),[$n.store])),[Kn.store])),[Qn.store])),[Yn.store,Xn.store]),Zn="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",er=function(){function e(){this.onCommittedListeners=[]}return e.prototype.addOnCommittedListener=function(e){this.onCommittedListeners.push(e)},e.prototype.raiseOnCommittedEvent=function(){this.onCommittedListeners.forEach((function(e){return e()}))},e}(),tr=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))},nr=function(){function e(e){var t=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((function(e){t.isDone=!0,t.result=e,t.nextCallback&&t.nextCallback(e)}),(function(e){t.isDone=!0,t.error=e,t.catchCallback&&t.catchCallback(e)}))}return e.prototype.catch=function(e){return this.next(void 0,e)},e.prototype.next=function(t,n){var r=this;return this.callbackAttached&&v(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(t,this.result):new e((function(e,i){r.nextCallback=function(n){r.wrapSuccess(t,n).next(e,i)},r.catchCallback=function(t){r.wrapFailure(n,t).next(e,i)}}))},e.prototype.toPromise=function(){var e=this;return new Promise((function(t,n){e.next(t,n)}))},e.prototype.wrapUserFunction=function(t){try{var n=t();return n instanceof e?n:e.resolve(n)}catch(t){return e.reject(t)}},e.prototype.wrapSuccess=function(t,n){return t?this.wrapUserFunction((function(){return t(n)})):e.resolve(n)},e.prototype.wrapFailure=function(t,n){return t?this.wrapUserFunction((function(){return t(n)})):e.reject(n)},e.resolve=function(t){return new e((function(e,n){e(t)}))},e.reject=function(t){return new e((function(e,n){n(t)}))},e.waitFor=function(t){return new e((function(e,n){var r=0,i=0,o=!1;t.forEach((function(t){++r,t.next((function(){++i,o&&i===r&&e()}),(function(e){return n(e)}))})),o=!0,i===r&&e()}))},e.or=function(t){for(var n=e.resolve(!1),r=function(t){n=n.next((function(n){return n?e.resolve(n):t()}))},i=0,o=t;i0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||i||a)},t.gt=function(){var t;return"undefined"!=typeof e&&"YES"===(null===(t=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_FIREBASE_API_KEY:"AIzaSyAe4IkiQyjxjgFwf32xIOkdHClG2Naz3Nc",REACT_APP_FIREBASE_APP_ID:"1:390496285457:web:7aafa4ffc19bd3546792b0",REACT_APP_FIREBASE_AUTH_DOMAIN:"cooking-recipe-website.firebaseapp.com",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"390496285457",REACT_APP_FIREBASE_PROJECT_ID:"cooking-recipe-website",REACT_APP_FIREBASE_STORAGE_BUCKET:"cooking-recipe-website.appspot.com"}))||void 0===t?void 0:t.Tt)},t.It=function(e,t){return e.store(t)},t._t=function(e){var t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(n)},t.Et=function(e){var t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)},t.prototype.At=function(e){return Object(a.a)(this,void 0,void 0,(function(){var t,n=this;return Object(a.c)(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:(h("SimpleDb","Opening database:",this.name),t=this,[4,new Promise((function(t,r){var i=indexedDB.open(n.name,n.version);i.onsuccess=function(e){var n=e.target.result;t(n)},i.onblocked=function(){r(new ar(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=function(t){var n=t.target.error;"VersionError"===n.name?r(new c(s.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.")):r(new ar(e,n))},i.onupgradeneeded=function(e){h("SimpleDb",'Database "'+n.name+'" requires upgrade from version:',e.oldVersion);var t=e.target.result;n.wt.Rt(t,i.transaction,e.oldVersion,n.version).next((function(){h("SimpleDb","Database upgrade to version "+n.version+" complete")}))}}))]);case 1:t.db=r.sent(),r.label=2;case 2:return[2,(this.bt&&(this.db.onversionchange=function(e){return n.bt(e)}),this.db)]}}))}))},t.prototype.vt=function(e){this.bt=e,this.db&&(this.db.onversionchange=function(t){return e(t)})},t.prototype.runTransaction=function(e,t,n,r){return Object(a.a)(this,void 0,void 0,(function(){var i,o,u,s,c;return Object(a.c)(this,(function(l){switch(l.label){case 0:i="readonly"===t,o=0,u=function(){var t,u,c,l,f;return Object(a.c)(this,(function(a){switch(a.label){case 0:++o,a.label=1;case 1:return a.trys.push([1,4,,5]),[4,s.At(e)];case 2:return s.db=a.sent(),t=rr.open(s.db,e,i?"readonly":"readwrite",n),u=r(t).catch((function(e){return t.abort(e),nr.reject(e)})).toPromise(),c={},u.catch((function(){})),[4,t.dt];case 3:return[2,(c.value=(a.sent(),u),c)];case 4:return l=a.sent(),f="FirebaseError"!==l.name&&o<3,h("SimpleDb","Transaction failed with error:",l.message,"Retrying:",f),s.close(),f?[3,5]:[2,{value:Promise.reject(l)}];case 5:return[2]}}))},s=this,l.label=1;case 1:return[5,u()];case 2:if("object"==typeof(c=l.sent()))return[2,c.value];l.label=3;case 3:return[3,1];case 4:return[2]}}))}))},t.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},t}(),or=function(){function e(e){this.Pt=e,this.Vt=!1,this.St=null}return Object.defineProperty(e.prototype,"isDone",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Dt",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cursor",{set:function(e){this.Pt=e},enumerable:!1,configurable:!0}),e.prototype.done=function(){this.Vt=!0},e.prototype.Ct=function(e){this.St=e},e.prototype.delete=function(){return cr(this.Pt.delete())},e}(),ar=function(e){function t(t,n){var r=this;return(r=e.call(this,s.UNAVAILABLE,"IndexedDB transaction '"+t+"' failed: "+n)||this).name="IndexedDbTransactionError",r}return Object(a.b)(t,e),t}(c);function ur(e){return"IndexedDbTransactionError"===e.name}var sr=function(){function e(e){this.store=e}return e.prototype.put=function(e,t){var n;return void 0!==t?(h("SimpleDb","PUT",this.store.name,e,t),n=this.store.put(t,e)):(h("SimpleDb","PUT",this.store.name,"",e),n=this.store.put(e)),cr(n)},e.prototype.add=function(e){return h("SimpleDb","ADD",this.store.name,e,e),cr(this.store.add(e))},e.prototype.get=function(e){var t=this;return cr(this.store.get(e)).next((function(n){return void 0===n&&(n=null),h("SimpleDb","GET",t.store.name,e,n),n}))},e.prototype.delete=function(e){return h("SimpleDb","DELETE",this.store.name,e),cr(this.store.delete(e))},e.prototype.count=function(){return h("SimpleDb","COUNT",this.store.name),cr(this.store.count())},e.prototype.Nt=function(e,t){var n=this.cursor(this.options(e,t)),r=[];return this.xt(n,(function(e,t){r.push(t)})).next((function(){return r}))},e.prototype.Ft=function(e,t){h("SimpleDb","DELETE ALL",this.store.name);var n=this.options(e,t);n.kt=!1;var r=this.cursor(n);return this.xt(r,(function(e,t,n){return n.delete()}))},e.prototype.Ot=function(e,t){var n;t?n=e:(n={},t=e);var r=this.cursor(n);return this.xt(r,t)},e.prototype.$t=function(e){var t=this.cursor({});return new nr((function(n,r){t.onerror=function(e){var t=fr(e.target.error);r(t)},t.onsuccess=function(t){var r=t.target.result;r?e(r.primaryKey,r.value).next((function(e){e?r.continue():n()})):n()}}))},e.prototype.xt=function(e,t){var n=[];return new nr((function(r,i){e.onerror=function(e){i(e.target.error)},e.onsuccess=function(e){var i=e.target.result;if(i){var o=new or(i),a=t(i.primaryKey,i.value,o);if(a instanceof nr){var u=a.catch((function(e){return o.done(),nr.reject(e)}));n.push(u)}o.isDone?r():null===o.Dt?i.continue():i.continue(o.Dt)}else r()}})).next((function(){return nr.waitFor(n)}))},e.prototype.options=function(e,t){var n;return void 0!==e&&("string"==typeof e?n=e:t=e),{index:n,range:t}},e.prototype.cursor=function(e){var t="next";if(e.reverse&&(t="prev"),e.index){var n=this.store.index(e.index);return e.kt?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)},e}();function cr(e){return new nr((function(t,n){e.onsuccess=function(e){var n=e.target.result;t(n)},e.onerror=function(e){var t=fr(e.target.error);n(t)}}))}var lr=!1;function fr(e){var t=ir._t(Object(r.i)());if(t>=12.2&&t<13){var n="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(n)>=0){var i=new c("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.");return lr||(lr=!0,setTimeout((function(){throw i}),0)),i}}return e}var hr=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).Mt=t,r.currentSequenceNumber=n,r}return Object(a.b)(t,e),t}(er);function dr(e,t){var n=g(e);return ir.It(n.Mt,t)}var pr=function(){function e(e,t,n,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=r}return e.prototype.applyToRemoteDocument=function(e,t){for(var n=t.mutationResults,r=0;r=r),o=Or(n.R,t)),i.done()})).next((function(){return o}))},e.prototype.getHighestUnacknowledgedBatchId=function(e){var t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return qr(e).Ot({index:Un.userMutationsIndex,range:t,reverse:!0},(function(e,t,r){n=t.batchId,r.done()})).next((function(){return n}))},e.prototype.getAllMutationBatches=function(e){var t=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return qr(e).Nt(Un.userMutationsIndex,n).next((function(e){return e.map((function(e){return Or(t.R,e)}))}))},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var n=this,r=Vn.prefixForPath(this.userId,t.path),i=IDBKeyRange.lowerBound(r),o=[];return Br(e).Ot({range:i},(function(r,i,a){var u=r[0],s=r[1],c=r[2],l=Rn(s);if(u===n.userId&&t.path.isEqual(l))return qr(e).get(c).next((function(e){if(!e)throw v();m(e.userId===n.userId),o.push(Or(n.R,e))}));a.done()})).next((function(){return o}))},e.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,t){var n=this,r=new At(E),i=[];return t.forEach((function(t){var o=Vn.prefixForPath(n.userId,t.path),a=IDBKeyRange.lowerBound(o),u=Br(e).Ot({range:a},(function(e,i,o){var a=e[0],u=e[1],s=e[2],c=Rn(u);a===n.userId&&t.path.isEqual(c)?r=r.add(s):o.done()}));i.push(u)})),nr.waitFor(i).next((function(){return n.Wt(e,r)}))},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){var n=this,r=t.path,i=r.length+1,o=Vn.prefixForPath(this.userId,r),a=IDBKeyRange.lowerBound(o),u=new At(E);return Br(e).Ot({range:a},(function(e,t,o){var a=e[0],s=e[1],c=e[2],l=Rn(s);a===n.userId&&r.isPrefixOf(l)?l.length===i&&(u=u.add(c)):o.done()})).next((function(){return n.Wt(e,u)}))},e.prototype.Wt=function(e,t){var n=this,r=[],i=[];return t.forEach((function(t){i.push(qr(e).get(t).next((function(e){if(null===e)throw v();m(e.userId===n.userId),r.push(Or(n.R,e))})))})),nr.waitFor(i).next((function(){return r}))},e.prototype.removeMutationBatch=function(e,t){var n=this;return Mr(e.Mt,this.userId,t).next((function(r){return e.addOnCommittedListener((function(){n.Gt(t.batchId)})),nr.forEach(r,(function(t){return n.referenceDelegate.markPotentiallyOrphaned(e,t)}))}))},e.prototype.Gt=function(e){delete this.Qt[e]},e.prototype.performConsistencyCheck=function(e){var t=this;return this.checkEmpty(e).next((function(n){if(!n)return nr.resolve();var r=IDBKeyRange.lowerBound(Vn.prefixForUser(t.userId)),i=[];return Br(e).Ot({range:r},(function(e,n,r){if(e[0]===t.userId){var o=Rn(e[1]);i.push(o)}else r.done()})).next((function(){m(0===i.length)}))}))},e.prototype.containsKey=function(e,t){return Vr(e,this.userId,t)},e.prototype.zt=function(e){var t=this;return zr(e).get(this.userId).next((function(e){return e||new Fn(t.userId,-1,"")}))},e}();function Vr(e,t,n){var r=Vn.prefixForPath(t,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),a=!1;return Br(e).Ot({range:o,kt:!0},(function(e,n,r){var o=e[0],u=e[1];e[2],o===t&&u===i&&(a=!0),r.done()})).next((function(){return a}))}function qr(e){return dr(e,Un.store)}function Br(e){return dr(e,Vn.store)}function zr(e){return dr(e,Fn.store)}var Kr=function(){function e(e){this.Ht=e}return e.prototype.next=function(){return this.Ht+=2,this.Ht},e.Jt=function(){return new e(0)},e.Yt=function(){return new e(-1)},e}(),Hr=function(){function e(e,t){this.referenceDelegate=e,this.R=t}return e.prototype.allocateTargetId=function(e){var t=this;return this.Xt(e).next((function(n){var r=new Kr(n.highestTargetId);return n.highestTargetId=r.next(),t.Zt(e,n).next((function(){return n.highestTargetId}))}))},e.prototype.getLastRemoteSnapshotVersion=function(e){return this.Xt(e).next((function(e){return T.fromTimestamp(new O(e.lastRemoteSnapshotVersion.seconds,e.lastRemoteSnapshotVersion.nanoseconds))}))},e.prototype.getHighestSequenceNumber=function(e){return this.Xt(e).next((function(e){return e.highestListenSequenceNumber}))},e.prototype.setTargetsMetadata=function(e,t,n){var r=this;return this.Xt(e).next((function(i){return i.highestListenSequenceNumber=t,n&&(i.lastRemoteSnapshotVersion=n.toTimestamp()),t>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=t),r.Zt(e,i)}))},e.prototype.addTargetData=function(e,t){var n=this;return this.te(e,t).next((function(){return n.Xt(e).next((function(r){return r.targetCount+=1,n.ee(t,r),n.Zt(e,r)}))}))},e.prototype.updateTargetData=function(e,t){return this.te(e,t)},e.prototype.removeTargetData=function(e,t){var n=this;return this.removeMatchingKeysForTargetId(e,t.targetId).next((function(){return Wr(e).delete(t.targetId)})).next((function(){return n.Xt(e)})).next((function(t){return m(t.targetCount>0),t.targetCount-=1,n.Zt(e,t)}))},e.prototype.removeTargets=function(e,t,n){var r=this,i=0,o=[];return Wr(e).Ot((function(a,u){var s=Tr(u);s.sequenceNumber<=t&&null===n.get(s.targetId)&&(i++,o.push(r.removeTargetData(e,s)))})).next((function(){return nr.waitFor(o)})).next((function(){return i}))},e.prototype.forEachTarget=function(e,t){return Wr(e).Ot((function(e,n){var r=Tr(n);t(r)}))},e.prototype.Xt=function(e){return Gr(e).get(Gn.key).next((function(e){return m(null!==e),e}))},e.prototype.Zt=function(e,t){return Gr(e).put(Gn.key,t)},e.prototype.te=function(e,t){return Wr(e).put(kr(this.R,t))},e.prototype.ee=function(e,t){var n=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,n=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,n=!0),n},e.prototype.getTargetCount=function(e){return this.Xt(e).next((function(e){return e.targetCount}))},e.prototype.getTargetData=function(e,t){var n=le(t),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return Wr(e).Ot({range:r,index:Hn.queryTargetsIndexName},(function(e,n,r){var o=Tr(n);fe(t,o.target)&&(i=o,r.done())})).next((function(){return i}))},e.prototype.addMatchingKeys=function(e,t,n){var r=this,i=[],o=Qr(e);return t.forEach((function(t){var a=Dn(t.path);i.push(o.put(new Wn(n,a))),i.push(r.referenceDelegate.addReference(e,n,t))})),nr.waitFor(i)},e.prototype.removeMatchingKeys=function(e,t,n){var r=this,i=Qr(e);return nr.forEach(t,(function(t){var o=Dn(t.path);return nr.waitFor([i.delete([n,o]),r.referenceDelegate.removeReference(e,n,t)])}))},e.prototype.removeMatchingKeysForTargetId=function(e,t){var n=Qr(e),r=IDBKeyRange.bound([t],[t+1],!1,!0);return n.delete(r)},e.prototype.getMatchingKeysForTargetId=function(e,t){var n=IDBKeyRange.bound([t],[t+1],!1,!0),r=Qr(e),i=Vt();return r.Ot({range:n,kt:!0},(function(e,t,n){var r=Rn(e[1]),o=new H(r);i=i.add(o)})).next((function(){return i}))},e.prototype.containsKey=function(e,t){var n=Dn(t.path),r=IDBKeyRange.bound([n],[S(n)],!1,!0),i=0;return Qr(e).Ot({index:Wn.documentTargetsIndex,kt:!0,range:r},(function(e,t,n){var r=e[0];e[1],0!==r&&(i++,n.done())})).next((function(){return i>0}))},e.prototype.lt=function(e,t){return Wr(e).get(t).next((function(e){return e?Tr(e):null}))},e}();function Wr(e){return dr(e,Hn.store)}function Gr(e){return dr(e,Gn.store)}function Qr(e){return dr(e,Wn.store)}function $r(e){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(t){if(e.code!==s.FAILED_PRECONDITION||e.message!==Zn)throw e;return h("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}function Yr(e,t){var n=e[0],r=e[1],i=t[0],o=t[1],a=E(n,i);return 0===a?E(r,o):a}var Xr=function(){function e(e){this.ne=e,this.buffer=new At(Yr),this.se=0}return e.prototype.ie=function(){return++this.se},e.prototype.re=function(e){var t=[e,this.ie()];if(this.buffer.sizel.params.maximumSequenceNumbersToCollect?(h("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+l.params.maximumSequenceNumbersToCollect+" from "+t),r=l.params.maximumSequenceNumbersToCollect):r=t,a=Date.now(),l.nthSequenceNumber(e,r)})).next((function(r){return n=r,u=Date.now(),l.removeTargets(e,n,t)})).next((function(t){return o=t,s=Date.now(),l.removeOrphanedDocuments(e,n)})).next((function(e){return c=Date.now(),f()<=i.a.DEBUG&&h("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(a-d)+"ms\n\tDetermined least recently used "+r+" in "+(u-a)+"ms\n\tRemoved "+o+" targets in "+(s-u)+"ms\n\tRemoved "+e+" documents in "+(c-s)+"ms\nTotal Duration: "+(c-d)+"ms"),nr.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:o,documentsRemoved:e})}))},e}(),ei=function(){function e(e,t){this.db=e,this.garbageCollector=function(e,t){return new Zr(e,t)}(this,t)}return e.prototype.he=function(e){var t=this.de(e);return this.db.getTargetCache().getTargetCount(e).next((function(e){return t.next((function(t){return e+t}))}))},e.prototype.de=function(e){var t=0;return this.le(e,(function(e){t++})).next((function(){return t}))},e.prototype.forEachTarget=function(e,t){return this.db.getTargetCache().forEachTarget(e,t)},e.prototype.le=function(e,t){return this.we(e,(function(e,n){return t(n)}))},e.prototype.addReference=function(e,t,n){return ti(e,n)},e.prototype.removeReference=function(e,t,n){return ti(e,n)},e.prototype.removeTargets=function(e,t,n){return this.db.getTargetCache().removeTargets(e,t,n)},e.prototype.markPotentiallyOrphaned=function(e,t){return ti(e,t)},e.prototype._e=function(e,t){return function(e,t){var n=!1;return zr(e).$t((function(r){return Vr(e,r,t).next((function(e){return e&&(n=!0),nr.resolve(!e)}))})).next((function(){return n}))}(e,t)},e.prototype.removeOrphanedDocuments=function(e,t){var n=this,r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[],o=0;return this.we(e,(function(a,u){if(u<=t){var s=n._e(e,a).next((function(t){if(!t)return o++,r.getEntry(e,a).next((function(){return r.removeEntry(a),Qr(e).delete([0,Dn(a.path)])}))}));i.push(s)}})).next((function(){return nr.waitFor(i)})).next((function(){return r.apply(e)})).next((function(){return o}))},e.prototype.removeTarget=function(e,t){var n=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,n)},e.prototype.updateLimboDocument=function(e,t){return ti(e,t)},e.prototype.we=function(e,t){var n,r=Qr(e),i=u.o;return r.Ot({index:Wn.documentTargetsIndex},(function(e,r){var o=e[0],a=(e[1],r.path),s=r.sequenceNumber;0===o?(i!==u.o&&t(new H(Rn(n)),i),i=s,n=a):i=u.o})).next((function(){i!==u.o&&t(new H(Rn(n)),i)}))},e.prototype.getCacheSize=function(e){return this.db.getRemoteDocumentCache().getSize(e)},e}();function ti(e,t){return Qr(e).put(function(e,t){return new Wn(0,Dn(e.path),t)}(t,e.currentSequenceNumber))}var ni=function(){function e(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={}}return e.prototype.get=function(e){var t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(var r=0,i=n;r=0&&r<=11);var o=new rr("createOrUpgrade",t);n<1&&r>=1&&(function(e){e.createObjectStore(Mn.store)}(e),function(e){e.createObjectStore(Fn.store,{keyPath:Fn.keyPath}),e.createObjectStore(Un.store,{keyPath:Un.keyPath,autoIncrement:!0}).createIndex(Un.userMutationsIndex,Un.userMutationsKeyPath,{unique:!0}),e.createObjectStore(Vn.store)}(e),li(e),function(e){e.createObjectStore(zn.store)}(e));var a=nr.resolve();return n<3&&r>=3&&(0!==n&&(function(e){e.deleteObjectStore(Wn.store),e.deleteObjectStore(Hn.store),e.deleteObjectStore(Gn.store)}(e),li(e)),a=a.next((function(){return function(e){var t=e.store(Gn.store),n=new Gn(0,0,T.min().toTimestamp(),0);return t.put(Gn.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(a=a.next((function(){return function(e,t){return t.store(Un.store).Nt().next((function(n){e.deleteObjectStore(Un.store),e.createObjectStore(Un.store,{keyPath:Un.keyPath,autoIncrement:!0}).createIndex(Un.userMutationsIndex,Un.userMutationsKeyPath,{unique:!0});var r=t.store(Un.store),i=n.map((function(e){return r.put(e)}));return nr.waitFor(i)}))}(e,o)}))),a=a.next((function(){!function(e){e.createObjectStore($n.store,{keyPath:$n.keyPath})}(e)}))),n<5&&r>=5&&(a=a.next((function(){return i.Re(o)}))),n<6&&r>=6&&(a=a.next((function(){return function(e){e.createObjectStore(Kn.store)}(e),i.be(o)}))),n<7&&r>=7&&(a=a.next((function(){return i.ve(o)}))),n<8&&r>=8&&(a=a.next((function(){return i.Pe(e,o)}))),n<9&&r>=9&&(a=a.next((function(){!function(e){e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")}(e),function(e){var t=e.objectStore(zn.store);t.createIndex(zn.readTimeIndex,zn.readTimeIndexPath,{unique:!1}),t.createIndex(zn.collectionReadTimeIndex,zn.collectionReadTimeIndexPath,{unique:!1})}(t)}))),n<10&&r>=10&&(a=a.next((function(){return i.Ve(o)}))),n<11&&r>=11&&(a=a.next((function(){!function(e){e.createObjectStore(Yn.store,{keyPath:Yn.keyPath})}(e),function(e){e.createObjectStore(Xn.store,{keyPath:Xn.keyPath})}(e)}))),a},e.prototype.be=function(e){var t=0;return e.store(zn.store).Ot((function(e,n){t+=Fr(n)})).next((function(){var n=new Kn(t);return e.store(Kn.store).put(Kn.key,n)}))},e.prototype.Re=function(e){var t=this,n=e.store(Fn.store),r=e.store(Un.store);return n.Nt().next((function(n){return nr.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.Nt(Un.userMutationsIndex,i).next((function(r){return nr.forEach(r,(function(r){m(r.userId===n.userId);var i=Or(t.R,r);return Mr(e,n.userId,i).next((function(){}))}))}))}))}))},e.prototype.ve=function(e){var t=e.store(Wn.store),n=e.store(zn.store);return e.store(Gn.store).get(Gn.key).next((function(e){var r=[];return n.Ot((function(n,i){var o=new x(n),a=function(e){return[0,Dn(e)]}(o);r.push(t.get(a).next((function(n){return n?nr.resolve():function(n){return t.put(new Wn(0,Dn(n),e.highestListenSequenceNumber))}(o)})))})).next((function(){return nr.waitFor(r)}))}))},e.prototype.Pe=function(e,t){e.createObjectStore(Qn.store,{keyPath:Qn.keyPath});var n=t.store(Qn.store),r=new Dr,i=function(e){if(r.add(e)){var t=e.lastSegment(),i=e.popLast();return n.put({collectionId:t,parent:Dn(i)})}};return t.store(zn.store).Ot({kt:!0},(function(e,t){var n=new x(e);return i(n.popLast())})).next((function(){return t.store(Vn.store).Ot({kt:!0},(function(e,t){e[0];var n=e[1],r=(e[2],Rn(n));return i(r.popLast())}))}))},e.prototype.Ve=function(e){var t=this,n=e.store(Hn.store);return n.Ot((function(e,r){var i=Tr(r),o=kr(t.R,i);return n.put(o)}))},e}();function li(e){e.createObjectStore(Wn.store,{keyPath:Wn.keyPath}).createIndex(Wn.documentTargetsIndex,Wn.documentTargetsKeyPath,{unique:!0}),e.createObjectStore(Hn.store,{keyPath:Hn.keyPath}).createIndex(Hn.queryTargetsIndexName,Hn.queryTargetsKeyPath,{unique:!0}),e.createObjectStore(Gn.store)}var fi="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.",hi=function(){function e(t,n,r,i,o,a,u,l,f,h){if(this.allowTabSynchronization=t,this.persistenceKey=n,this.clientId=r,this.Se=o,this.window=a,this.document=u,this.De=f,this.Ce=h,this.Ne=null,this.xe=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Fe=null,this.inForeground=!1,this.ke=null,this.Oe=null,this.$e=Number.NEGATIVE_INFINITY,this.Me=function(e){return Promise.resolve()},!e.yt())throw new c(s.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new ei(this,i),this.Le=n+"main",this.R=new mr(l),this.Be=new ir(this.Le,11,new ci(this.R)),this.qe=new Hr(this.referenceDelegate,this.R),this.Ut=new Pr,this.Ue=function(e,t){return new ii(e,t)}(this.R,this.Ut),this.Qe=new Cr,this.window&&this.window.localStorage?this.Ke=this.window.localStorage:(this.Ke=null,!1===h&&d("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return e.prototype.start=function(){var e=this;return this.je().then((function(){if(!e.isPrimary&&!e.allowTabSynchronization)throw new c(s.FAILED_PRECONDITION,fi);return e.We(),e.Ge(),e.ze(),e.runTransaction("getHighestListenSequenceNumber","readonly",(function(t){return e.qe.getHighestSequenceNumber(t)}))})).then((function(t){e.Ne=new u(t,e.De)})).then((function(){e.xe=!0})).catch((function(t){return e.Be&&e.Be.close(),Promise.reject(t)}))},e.prototype.He=function(e){var t=this;return this.Me=function(n){return Object(a.a)(t,void 0,void 0,(function(){return Object(a.c)(this,(function(t){return this.started?[2,e(n)]:[2]}))}))},e(this.isPrimary)},e.prototype.setDatabaseDeletedListener=function(e){var t=this;this.Be.vt((function(n){return Object(a.a)(t,void 0,void 0,(function(){return Object(a.c)(this,(function(t){switch(t.label){case 0:return null===n.newVersion?[4,e()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}))},e.prototype.setNetworkEnabled=function(e){var t=this;this.networkEnabled!==e&&(this.networkEnabled=e,this.Se.enqueueAndForget((function(){return Object(a.a)(t,void 0,void 0,(function(){return Object(a.c)(this,(function(e){switch(e.label){case 0:return this.started?[4,this.je()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))})))},e.prototype.je=function(){var e=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(t){return pi(t).put(new $n(e.clientId,Date.now(),e.networkEnabled,e.inForeground)).next((function(){if(e.isPrimary)return e.Je(t).next((function(t){t||(e.isPrimary=!1,e.Se.enqueueRetryable((function(){return e.Me(!1)})))}))})).next((function(){return e.Ye(t)})).next((function(n){return e.isPrimary&&!n?e.Xe(t).next((function(){return!1})):!!n&&e.Ze(t).next((function(){return!0}))}))})).catch((function(t){if(ur(t))return h("IndexedDbPersistence","Failed to extend owner lease: ",t),e.isPrimary;if(!e.allowTabSynchronization)throw t;return h("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1})).then((function(t){e.isPrimary!==t&&e.Se.enqueueRetryable((function(){return e.Me(t)})),e.isPrimary=t}))},e.prototype.Je=function(e){var t=this;return di(e).get(Mn.key).next((function(e){return nr.resolve(t.tn(e))}))},e.prototype.en=function(e){return pi(e).delete(this.clientId)},e.prototype.nn=function(){return Object(a.a)(this,void 0,void 0,(function(){var e,t,n,r,i=this;return Object(a.c)(this,(function(o){switch(o.label){case 0:return!this.isPrimary||this.sn(this.$e,18e5)?[3,2]:(this.$e=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(e){var t=dr(e,$n.store);return t.Nt().next((function(e){var n=i.rn(e,18e5),r=e.filter((function(e){return-1===n.indexOf(e)}));return nr.forEach(r,(function(e){return t.delete(e.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(e=o.sent(),this.Ke)for(t=0,n=e;tn&&(d("Detected an update time that is in the future: "+e+" > "+n),1))},e.prototype.We=function(){var e=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.ke=function(){e.Se.enqueueAndForget((function(){return e.inForeground="visible"===e.document.visibilityState,e.je()}))},this.document.addEventListener("visibilitychange",this.ke),this.inForeground="visible"===this.document.visibilityState)},e.prototype.an=function(){this.ke&&(this.document.removeEventListener("visibilitychange",this.ke),this.ke=null)},e.prototype.Ge=function(){var e,t=this;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.Fe=function(){t.un(),t.Se.enqueueAndForget((function(){return t.shutdown()}))},this.window.addEventListener("unload",this.Fe))},e.prototype.hn=function(){this.Fe&&(this.window.removeEventListener("unload",this.Fe),this.Fe=null)},e.prototype.cn=function(e){var t;try{var n=null!==(null===(t=this.Ke)||void 0===t?void 0:t.getItem(this.on(e)));return h("IndexedDbPersistence","Client '"+e+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(e){return d("IndexedDbPersistence","Failed to get zombied client id.",e),!1}},e.prototype.un=function(){if(this.Ke)try{this.Ke.setItem(this.on(this.clientId),String(Date.now()))}catch(e){d("Failed to set zombie client id.",e)}},e.prototype.ln=function(){if(this.Ke)try{this.Ke.removeItem(this.on(this.clientId))}catch(e){}},e.prototype.on=function(e){return"firestore_zombie_"+this.persistenceKey+"_"+e},e}();function di(e){return dr(e,Mn.store)}function pi(e){return dr(e,$n.store)}function yi(e,t){var n=e.projectId;return e.isDefaultDatabase||(n+="."+e.database),"firestore/"+t+"/"+n+"/"}var vi=function(e,t){this.progress=e,this.wn=t},mi=function(){function e(e,t,n){this.Ue=e,this._n=t,this.Ut=n}return e.prototype.mn=function(e,t){var n=this;return this._n.getAllMutationBatchesAffectingDocumentKey(e,t).next((function(r){return n.yn(e,t,r)}))},e.prototype.yn=function(e,t,n){return this.Ue.getEntry(e,t).next((function(e){for(var t=0,r=n;t0)},e.prototype.Dn=function(e,t){return f()<=i.a.DEBUG&&h("QueryEngine","Using full collection scan to execute query:",qe(t)),this.Sn.getDocumentsMatchingQuery(e,t,T.min())},e}(),wi=function(){function e(e,t,n,r){this.persistence=e,this.xn=t,this.R=r,this.Fn=new Ct(E),this.kn=new ni((function(e){return le(e)}),fe),this.On=T.min(),this._n=e.getMutationQueue(n),this.$n=e.getRemoteDocumentCache(),this.qe=e.getTargetCache(),this.Mn=new mi(this.$n,this._n,this.persistence.getIndexManager()),this.Qe=e.getBundleCache(),this.xn.Vn(this.Mn)}return e.prototype.collectGarbage=function(e){var t=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return e.collect(n,t.Fn)}))},e}();function Ei(e,t,n,r){return new wi(e,t,n,r)}function _i(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i,o;return Object(a.c)(this,(function(a){switch(a.label){case 0:return n=g(e),r=n._n,i=n.Mn,[4,n.persistence.runTransaction("Handle user change","readonly",(function(e){var o;return n._n.getAllMutationBatches(e).next((function(a){return o=a,r=n.persistence.getMutationQueue(t),i=new mi(n.$n,r,n.persistence.getIndexManager()),r.getAllMutationBatches(e)})).next((function(t){for(var n=[],r=[],a=Vt(),u=0,s=o;u0){var c=u.withResumeToken(s,r).withSequenceNumber(e.currentSequenceNumber);i=i.insert(o,c),function(e,t,n){return m(t.resumeToken.approximateByteSize()>0),0===e.resumeToken.approximateByteSize()||t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(u,c,t)&&a.push(n.qe.updateTargetData(e,c))}}}));var u=jt();if(t.documentUpdates.forEach((function(r,i){t.resolvedLimboDocuments.has(r)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(e,r))})),a.push(ki(e,o,t.documentUpdates,r,void 0).next((function(e){u=e}))),!r.isEqual(T.min())){var s=n.qe.getLastRemoteSnapshotVersion(e).next((function(t){return n.qe.setTargetsMetadata(e,e.currentSequenceNumber,r)}));a.push(s)}return nr.waitFor(a).next((function(){return o.apply(e)})).next((function(){return n.Mn.En(e,u)})).next((function(){return u}))})).then((function(e){return n.Fn=i,e}))}function ki(e,t,n,r,i){var o=Vt();return n.forEach((function(e){return o=o.add(e)})),t.getEntries(e,o).next((function(e){var o=jt();return n.forEach((function(n,a){var u=e.get(n),s=(null==i?void 0:i.get(n))||r;a.isNoDocument()&&a.version.isEqual(T.min())?(t.removeEntry(n,s),o=o.insert(n,a)):!u.isValidDocument()||a.version.compareTo(u.version)>0||0===a.version.compareTo(u.version)&&u.hasPendingWrites?(t.addEntry(a,s),o=o.insert(n,a)):h("LocalStore","Ignoring outdated watch update for ",n,". Current version:",u.version," Watch version:",a.version)})),o}))}function Ii(e,t){var n=g(e);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(e){return void 0===t&&(t=-1),n._n.getNextMutationBatchAfterBatchId(e,t)}))}function Ci(e,t){var n=g(e);return n.persistence.runTransaction("Allocate target","readwrite",(function(e){var r;return n.qe.getTargetData(e,t).next((function(i){return i?(r=i,nr.resolve(r)):n.qe.allocateTargetId(e).next((function(i){return r=new vr(t,i,0,e.currentSequenceNumber),n.qe.addTargetData(e,r).next((function(){return r}))}))}))})).then((function(e){var r=n.Fn.get(e.targetId);return(null===r||e.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.Fn=n.Fn.insert(e.targetId,e),n.kn.set(t,e.targetId)),e}))}function Ni(e,t,n){return Object(a.a)(this,void 0,void 0,(function(){var r,i,o,u;return Object(a.c)(this,(function(a){switch(a.label){case 0:r=g(e),i=r.Fn.get(t),o=n?"readwrite":"readwrite-primary",a.label=1;case 1:return a.trys.push([1,4,,5]),n?[3,3]:[4,r.persistence.runTransaction("Release target",o,(function(e){return r.persistence.referenceDelegate.removeTarget(e,i)}))];case 2:a.sent(),a.label=3;case 3:return[3,5];case 4:if(!ur(u=a.sent()))throw u;return h("LocalStore","Failed to update sequence numbers for target "+t+": "+u),[3,5];case 5:return r.Fn=r.Fn.remove(t),r.kn.delete(i.target),[2]}}))}))}function xi(e,t,n){var r=g(e),i=T.min(),o=Vt();return r.persistence.runTransaction("Execute query","readonly",(function(e){return function(e,t,n){var r=g(e),i=r.kn.get(n);return void 0!==i?nr.resolve(r.Fn.get(i)):r.qe.getTargetData(t,n)}(r,e,Me(t)).next((function(t){if(t)return i=t.lastLimboFreeSnapshotVersion,r.qe.getMatchingKeysForTargetId(e,t.targetId).next((function(e){o=e}))})).next((function(){return r.xn.getDocumentsMatchingQuery(e,t,n?i:T.min(),n?o:Vt())})).next((function(e){return{documents:e,Bn:o}}))}))}function Ai(e,t){var n=g(e),r=g(n.qe),i=n.Fn.get(t);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(e){return r.lt(e,t).next((function(e){return e?e.target:null}))}))}function Di(e){var t=g(e);return t.persistence.runTransaction("Get new document changes","readonly",(function(e){return function(e,t,n){var r=g(e),i=jt(),o=wr(n),a=ui(t),u=IDBKeyRange.lowerBound(o,!0);return a.Ot({index:zn.readTimeIndex,range:u},(function(e,t){var n=gr(r.R,t);i=i.insert(n.key,n),o=t.readTime})).next((function(){return{wn:i,readTime:Er(o)}}))}(t.$n,e,t.On)})).then((function(e){var n=e.wn,r=e.readTime;return t.On=r,n}))}function Pi(e){return Object(a.a)(this,void 0,void 0,(function(){var t;return Object(a.c)(this,(function(n){return[2,(t=g(e)).persistence.runTransaction("Synchronize last document change read time","readonly",(function(e){return function(e){var t=ui(e),n=T.min();return t.Ot({index:zn.readTimeIndex,reverse:!0},(function(e,t,r){t.readTime&&(n=Er(t.readTime)),r.done()})).next((function(){return n}))}(e)})).then((function(e){t.On=e}))]}))}))}function ji(e,t,n,r){return Object(a.a)(this,void 0,void 0,(function(){var i,o,u,s,c,l,f,h,d,p;return Object(a.c)(this,(function(a){switch(a.label){case 0:for(i=g(e),o=Vt(),u=jt(),s=Ft(),c=0,l=n;c=0)return i.Qe.saveNamedQuery(e,t);var a=r.withResumeToken(j.EMPTY_BYTE_STRING,o);return i.Fn=i.Fn.insert(a.targetId,a),i.qe.updateTargetData(e,a).next((function(){return i.qe.removeMatchingKeysForTargetId(e,r.targetId)})).next((function(){return i.qe.addMatchingKeys(e,n,r.targetId)})).next((function(){return i.Qe.saveNamedQuery(e,t)}))}))]}}))}))}var Li=function(){function e(e){this.R=e,this.Kn=new Map,this.jn=new Map}return e.prototype.getBundleMetadata=function(e,t){return nr.resolve(this.Kn.get(t))},e.prototype.saveBundleMetadata=function(e,t){var n;return this.Kn.set(t.id,{id:(n=t).id,version:n.version,createTime:on(n.createTime)}),nr.resolve()},e.prototype.getNamedQuery=function(e,t){return nr.resolve(this.jn.get(t))},e.prototype.saveNamedQuery=function(e,t){return this.jn.set(t.name,function(e){return{name:e.name,query:Ir(e.bundledQuery),readTime:on(e.readTime)}}(t)),nr.resolve()},e}(),Mi=function(){function e(){this.Wn=new At(Fi.Gn),this.zn=new At(Fi.Hn)}return e.prototype.isEmpty=function(){return this.Wn.isEmpty()},e.prototype.addReference=function(e,t){var n=new Fi(e,t);this.Wn=this.Wn.add(n),this.zn=this.zn.add(n)},e.prototype.Jn=function(e,t){var n=this;e.forEach((function(e){return n.addReference(e,t)}))},e.prototype.removeReference=function(e,t){this.Yn(new Fi(e,t))},e.prototype.Xn=function(e,t){var n=this;e.forEach((function(e){return n.removeReference(e,t)}))},e.prototype.Zn=function(e){var t=this,n=new H(new x([])),r=new Fi(n,e),i=new Fi(n,e+1),o=[];return this.zn.forEachInRange([r,i],(function(e){t.Yn(e),o.push(e.key)})),o},e.prototype.ts=function(){var e=this;this.Wn.forEach((function(t){return e.Yn(t)}))},e.prototype.Yn=function(e){this.Wn=this.Wn.delete(e),this.zn=this.zn.delete(e)},e.prototype.es=function(e){var t=new H(new x([])),n=new Fi(t,e),r=new Fi(t,e+1),i=Vt();return this.zn.forEachInRange([n,r],(function(e){i=i.add(e.key)})),i},e.prototype.containsKey=function(e){var t=new Fi(e,0),n=this.Wn.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)},e}(),Fi=function(){function e(e,t){this.key=e,this.ns=t}return e.Gn=function(e,t){return H.comparator(e.key,t.key)||E(e.ns,t.ns)},e.Hn=function(e,t){return E(e.ns,t.ns)||H.comparator(e.key,t.key)},e}(),Ui=function(){function e(e,t){this.Ut=e,this.referenceDelegate=t,this._n=[],this.ss=1,this.rs=new At(Fi.Gn)}return e.prototype.checkEmpty=function(e){return nr.resolve(0===this._n.length)},e.prototype.addMutationBatch=function(e,t,n,r){var i=this.ss;this.ss++,this._n.length>0&&this._n[this._n.length-1];var o=new pr(i,t,n,r);this._n.push(o);for(var a=0,u=r;ai?this._n[i]:null)},e.prototype.getHighestUnacknowledgedBatchId=function(){return nr.resolve(0===this._n.length?-1:this.ss-1)},e.prototype.getAllMutationBatches=function(e){return nr.resolve(this._n.slice())},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var n=this,r=new Fi(t,0),i=new Fi(t,Number.POSITIVE_INFINITY),o=[];return this.rs.forEachInRange([r,i],(function(e){var t=n.os(e.ns);o.push(t)})),nr.resolve(o)},e.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,t){var n=this,r=new At(E);return t.forEach((function(e){var t=new Fi(e,0),i=new Fi(e,Number.POSITIVE_INFINITY);n.rs.forEachInRange([t,i],(function(e){r=r.add(e.ns)}))})),nr.resolve(this.us(r))},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){var n=t.path,r=n.length+1,i=n;H.isDocumentKey(i)||(i=i.child(""));var o=new Fi(new H(i),0),a=new At(E);return this.rs.forEachWhile((function(e){var t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(a=a.add(e.ns)),!0)}),o),nr.resolve(this.us(a))},e.prototype.us=function(e){var t=this,n=[];return e.forEach((function(e){var r=t.os(e);null!==r&&n.push(r)})),n},e.prototype.removeMutationBatch=function(e,t){var n=this;m(0===this.hs(t.batchId,"removed")),this._n.shift();var r=this.rs;return nr.forEach(t.mutations,(function(i){var o=new Fi(i.key,t.batchId);return r=r.delete(o),n.referenceDelegate.markPotentiallyOrphaned(e,i.key)})).next((function(){n.rs=r}))},e.prototype.Gt=function(e){},e.prototype.containsKey=function(e,t){var n=new Fi(t,0),r=this.rs.firstAfterOrEqual(n);return nr.resolve(t.isEqual(r&&r.key))},e.prototype.performConsistencyCheck=function(e){return this._n.length,nr.resolve()},e.prototype.hs=function(e,t){return this.cs(e)},e.prototype.cs=function(e){return 0===this._n.length?0:e-this._n[0].batchId},e.prototype.os=function(e){var t=this.cs(e);return t<0||t>=this._n.length?null:this._n[t]},e}(),Vi=function(){function e(e,t){this.Ut=e,this.ls=t,this.docs=new Ct(H.comparator),this.size=0}return e.prototype.addEntry=function(e,t,n){var r=t.key,i=this.docs.get(r),o=i?i.size:0,a=this.ls(t);return this.docs=this.docs.insert(r,{document:t.clone(),size:a,readTime:n}),this.size+=a-o,this.Ut.addToCollectionParentIndex(e,r.path.popLast())},e.prototype.removeEntry=function(e){var t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)},e.prototype.getEntry=function(e,t){var n=this.docs.get(t);return nr.resolve(n?n.document.clone():ue.newInvalidDocument(t))},e.prototype.getEntries=function(e,t){var n=this,r=jt();return t.forEach((function(e){var t=n.docs.get(e);r=r.insert(e,t?t.document.clone():ue.newInvalidDocument(e))})),nr.resolve(r)},e.prototype.getDocumentsMatchingQuery=function(e,t,n){for(var r=jt(),i=new H(t.path.child("")),o=this.docs.getIteratorFrom(i);o.hasNext();){var a=o.getNext(),u=a.key,s=a.value,c=s.document,l=s.readTime;if(!t.path.isPrefixOf(u.path))break;l.compareTo(n)<=0||Be(t,c)&&(r=r.insert(c.key,c.clone()))}return nr.resolve(r)},e.prototype.fs=function(e,t){return nr.forEach(this.docs,(function(e){return t(e)}))},e.prototype.newChangeBuffer=function(e){return new qi(this)},e.prototype.getSize=function(e){return nr.resolve(this.size)},e}(),qi=function(e){function t(t){var n=this;return(n=e.call(this)||this).Ie=t,n}return Object(a.b)(t,e),t.prototype.applyChanges=function(e){var t=this,n=[];return this.changes.forEach((function(r,i){i.document.isValidDocument()?n.push(t.Ie.addEntry(e,i.document,t.getReadTime(r))):t.Ie.removeEntry(r)})),nr.waitFor(n)},t.prototype.getFromCache=function(e,t){return this.Ie.getEntry(e,t)},t.prototype.getAllFromCache=function(e,t){return this.Ie.getEntries(e,t)},t}(ri),Bi=function(){function e(e){this.persistence=e,this.ds=new ni((function(e){return le(e)}),fe),this.lastRemoteSnapshotVersion=T.min(),this.highestTargetId=0,this.ws=0,this._s=new Mi,this.targetCount=0,this.ys=Kr.Jt()}return e.prototype.forEachTarget=function(e,t){return this.ds.forEach((function(e,n){return t(n)})),nr.resolve()},e.prototype.getLastRemoteSnapshotVersion=function(e){return nr.resolve(this.lastRemoteSnapshotVersion)},e.prototype.getHighestSequenceNumber=function(e){return nr.resolve(this.ws)},e.prototype.allocateTargetId=function(e){return this.highestTargetId=this.ys.next(),nr.resolve(this.highestTargetId)},e.prototype.setTargetsMetadata=function(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.ws&&(this.ws=t),nr.resolve()},e.prototype.te=function(e){this.ds.set(e.target,e);var t=e.targetId;t>this.highestTargetId&&(this.ys=new Kr(t),this.highestTargetId=t),e.sequenceNumber>this.ws&&(this.ws=e.sequenceNumber)},e.prototype.addTargetData=function(e,t){return this.te(t),this.targetCount+=1,nr.resolve()},e.prototype.updateTargetData=function(e,t){return this.te(t),nr.resolve()},e.prototype.removeTargetData=function(e,t){return this.ds.delete(t.target),this._s.Zn(t.targetId),this.targetCount-=1,nr.resolve()},e.prototype.removeTargets=function(e,t,n){var r=this,i=0,o=[];return this.ds.forEach((function(a,u){u.sequenceNumber<=t&&null===n.get(u.targetId)&&(r.ds.delete(a),o.push(r.removeMatchingKeysForTargetId(e,u.targetId)),i++)})),nr.waitFor(o).next((function(){return i}))},e.prototype.getTargetCount=function(e){return nr.resolve(this.targetCount)},e.prototype.getTargetData=function(e,t){var n=this.ds.get(t)||null;return nr.resolve(n)},e.prototype.addMatchingKeys=function(e,t,n){return this._s.Jn(t,n),nr.resolve()},e.prototype.removeMatchingKeys=function(e,t,n){this._s.Xn(t,n);var r=this.persistence.referenceDelegate,i=[];return r&&t.forEach((function(t){i.push(r.markPotentiallyOrphaned(e,t))})),nr.waitFor(i)},e.prototype.removeMatchingKeysForTargetId=function(e,t){return this._s.Zn(t),nr.resolve()},e.prototype.getMatchingKeysForTargetId=function(e,t){var n=this._s.es(t);return nr.resolve(n)},e.prototype.containsKey=function(e,t){return nr.resolve(this._s.containsKey(t))},e}(),zi=function(){function e(e,t){var n=this;this.gs={},this.Ne=new u(0),this.xe=!1,this.xe=!0,this.referenceDelegate=e(this),this.qe=new Bi(this),this.Ut=new Ar,this.Ue=function(e,t){return new Vi(e,(function(e){return n.referenceDelegate.ps(e)}))}(this.Ut),this.R=new mr(t),this.Qe=new Li(this.R)}return e.prototype.start=function(){return Promise.resolve()},e.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(e.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),e.prototype.setDatabaseDeletedListener=function(){},e.prototype.setNetworkEnabled=function(){},e.prototype.getIndexManager=function(){return this.Ut},e.prototype.getMutationQueue=function(e){var t=this.gs[e.toKey()];return t||(t=new Ui(this.Ut,this.referenceDelegate),this.gs[e.toKey()]=t),t},e.prototype.getTargetCache=function(){return this.qe},e.prototype.getRemoteDocumentCache=function(){return this.Ue},e.prototype.getBundleCache=function(){return this.Qe},e.prototype.runTransaction=function(e,t,n){var r=this;h("MemoryPersistence","Starting transaction:",e);var i=new Ki(this.Ne.next());return this.referenceDelegate.Es(),n(i).next((function(e){return r.referenceDelegate.Ts(i).next((function(){return e}))})).toPromise().then((function(e){return i.raiseOnCommittedEvent(),e}))},e.prototype.Is=function(e,t){return nr.or(Object.values(this.gs).map((function(n){return function(){return n.containsKey(e,t)}})))},e}(),Ki=function(e){function t(t){var n=this;return(n=e.call(this)||this).currentSequenceNumber=t,n}return Object(a.b)(t,e),t}(er),Hi=function(){function e(e){this.persistence=e,this.As=new Mi,this.Rs=null}return e.bs=function(t){return new e(t)},Object.defineProperty(e.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw v()},enumerable:!1,configurable:!0}),e.prototype.addReference=function(e,t,n){return this.As.addReference(n,t),this.vs.delete(n.toString()),nr.resolve()},e.prototype.removeReference=function(e,t,n){return this.As.removeReference(n,t),this.vs.add(n.toString()),nr.resolve()},e.prototype.markPotentiallyOrphaned=function(e,t){return this.vs.add(t.toString()),nr.resolve()},e.prototype.removeTarget=function(e,t){var n=this;this.As.Zn(t.targetId).forEach((function(e){return n.vs.add(e.toString())}));var r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next((function(e){e.forEach((function(e){return n.vs.add(e.toString())}))})).next((function(){return r.removeTargetData(e,t)}))},e.prototype.Es=function(){this.Rs=new Set},e.prototype.Ts=function(e){var t=this,n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return nr.forEach(this.vs,(function(r){var i=H.fromPath(r);return t.Ps(e,i).next((function(e){e||n.removeEntry(i)}))})).next((function(){return t.Rs=null,n.apply(e)}))},e.prototype.updateLimboDocument=function(e,t){var n=this;return this.Ps(e,t).next((function(e){e?n.vs.delete(t.toString()):n.vs.add(t.toString())}))},e.prototype.ps=function(e){return 0},e.prototype.Ps=function(e,t){var n=this;return nr.or([function(){return nr.resolve(n.As.containsKey(t))},function(){return n.persistence.getTargetCache().containsKey(e,t)},function(){return n.persistence.Is(e,t)}])},e}(),Wi=function(){function e(e){this.uid=e}return e.prototype.isAuthenticated=function(){return null!=this.uid},e.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},e.prototype.isEqual=function(e){return e.uid===this.uid},e}();function Gi(e,t){return"firestore_clients_"+e+"_"+t}function Qi(e,t,n){var r="firestore_mutations_"+e+"_"+n;return t.isAuthenticated()&&(r+="_"+t.uid),r}function $i(e,t){return"firestore_targets_"+e+"_"+t}Wi.UNAUTHENTICATED=new Wi(null),Wi.GOOGLE_CREDENTIALS=new Wi("google-credentials-uid"),Wi.FIRST_PARTY=new Wi("first-party-uid");var Yi=function(){function e(e,t,n,r){this.user=e,this.batchId=t,this.state=n,this.error=r}return e.Vs=function(t,n,r){var i,o=JSON.parse(r),a="object"==typeof o&&-1!==["pending","acknowledged","rejected"].indexOf(o.state)&&(void 0===o.error||"object"==typeof o.error);return a&&o.error&&(a="string"==typeof o.error.message&&"string"==typeof o.error.code)&&(i=new c(o.error.code,o.error.message)),a?new e(t,n,o.state,i):(d("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},e.prototype.Ss=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),Xi=function(){function e(e,t,n){this.targetId=e,this.state=t,this.error=n}return e.Vs=function(t,n){var r,i=JSON.parse(n),o="object"==typeof i&&-1!==["not-current","current","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error);return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(r=new c(i.error.code,i.error.message)),o?new e(t,i.state,r):(d("SharedClientState","Failed to parse target state for ID '"+t+"': "+n),null)},e.prototype.Ss=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),Ji=function(){function e(e,t){this.clientId=e,this.activeTargetIds=t}return e.Vs=function(t,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=Bt(),a=0;i&&a0){var r=u.getResponseJson().error;if(r&&r.status&&r.message){var l=function(e){var t=e.toLowerCase().replace(/_/g,"-");return Object.values(s).indexOf(t)>=0?t:s.UNKNOWN}(r.status);a(new c(l,r.message))}else a(new c(s.UNKNOWN,"Server responded with status "+u.getStatus()))}else a(new c(s.UNAVAILABLE,"Connection failed."));break;default:v()}}finally{h("Connection",'RPC "'+e+'" completed.')}}));var l=JSON.stringify(r);u.send(t,"POST",l,n,15)}))},t.prototype.$i=function(e,t){var n=[this.Di,"/","google.firestore.v1.Firestore","/",e,"/channel"],i=Object(o.g)(),a=Object(o.h)(),u={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.Fi(u.initMessageHeaders,t),Object(r.n)()||Object(r.p)()||Object(r.l)()||Object(r.m)()||Object(r.q)()||Object(r.k)()||(u.httpHeadersOverwriteParam="$httpHeaders");var l=n.join("");h("Connection","Creating WebChannel: "+l,u);var f=i.createWebChannel(l,u),d=!1,y=!1,v=new ao({Ei:function(e){y?h("Connection","Not sending because WebChannel is closed:",e):(d||(h("Connection","Opening WebChannel transport."),f.open(),d=!0),h("Connection","WebChannel sending:",e),f.send(e))},Ti:function(){return f.close()}}),g=function(e,t,n){e.listen(t,(function(e){try{n(e)}catch(e){setTimeout((function(){throw e}),0)}}))};return g(f,o.e.EventType.OPEN,(function(){y||h("Connection","WebChannel transport opened.")})),g(f,o.e.EventType.CLOSE,(function(){y||(y=!0,h("Connection","WebChannel transport closed"),v.Vi())})),g(f,o.e.EventType.ERROR,(function(e){y||(y=!0,p("Connection","WebChannel transport errored:",e),v.Vi(new c(s.UNAVAILABLE,"The operation could not be completed")))})),g(f,o.e.EventType.MESSAGE,(function(e){var t;if(!y){var n=e.data[0];m(!!n);var r=n,i=r.error||(null===(t=r[0])||void 0===t?void 0:t.error);if(i){h("Connection","WebChannel received error:",i);var o=i.status,a=function(e){var t=Et[e];if(void 0!==t)return It(t)}(o),u=i.message;void 0===a&&(a=s.INTERNAL,u="Unknown error status: "+o+" with message "+i.message),y=!0,v.Vi(new c(a,u)),f.close()}else h("Connection","WebChannel received:",n),v.Si(n)}})),g(a,o.b.STAT_EVENT,(function(e){e.stat===o.d.PROXY?h("Connection","Detected buffering proxy"):e.stat===o.d.NOPROXY&&h("Connection","Detected no buffering proxy")})),setTimeout((function(){v.Pi()}),0),v},t}(function(){function e(e){this.databaseInfo=e,this.databaseId=e.databaseId;var t=e.ssl?"https":"http";this.Di=t+"://"+e.host,this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}return e.prototype.Ni=function(e,t,n,r){var i=this.xi(e,t);h("RestConnection","Sending: ",i,n);var o={};return this.Fi(o,r),this.ki(e,i,o,n).then((function(e){return h("RestConnection","Received: ",e),e}),(function(t){throw p("RestConnection",e+" failed with error: ",t,"url: ",i,"request:",n),t}))},e.prototype.Oi=function(e,t,n,r){return this.Ni(e,t,n,r)},e.prototype.Fi=function(e,t){if(e["X-Goog-Api-Client"]="gl-js/ fire/8.5.0",e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t)for(var n in t.authHeaders)t.authHeaders.hasOwnProperty(n)&&(e[n]=t.authHeaders[n])},e.prototype.xi=function(e,t){var n=oo[e];return this.Di+"/v1/"+t+":"+n},e}());function so(){return"undefined"!=typeof window?window:null}function co(){return"undefined"!=typeof document?document:null}function lo(e){return new en(e,!0)}var fo=function(){function e(e,t,n,r,i){void 0===n&&(n=1e3),void 0===r&&(r=1.5),void 0===i&&(i=6e4),this.Se=e,this.timerId=t,this.Mi=n,this.Li=r,this.Bi=i,this.qi=0,this.Ui=null,this.Qi=Date.now(),this.reset()}return e.prototype.reset=function(){this.qi=0},e.prototype.Ki=function(){this.qi=this.Bi},e.prototype.ji=function(e){var t=this;this.cancel();var n=Math.floor(this.qi+this.Wi()),r=Math.max(0,Date.now()-this.Qi),i=Math.max(0,n-r);i>0&&h("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.qi+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.Ui=this.Se.enqueueAfterDelay(this.timerId,i,(function(){return t.Qi=Date.now(),e()})),this.qi*=this.Li,this.qithis.Bi&&(this.qi=this.Bi)},e.prototype.Gi=function(){null!==this.Ui&&(this.Ui.skipDelay(),this.Ui=null)},e.prototype.cancel=function(){null!==this.Ui&&(this.Ui.cancel(),this.Ui=null)},e.prototype.Wi=function(){return(Math.random()-.5)*this.qi},e}(),ho=function(){function e(e,t,n,r,i,o){this.Se=e,this.zi=n,this.Hi=r,this.Ji=i,this.listener=o,this.state=0,this.Yi=0,this.Xi=null,this.stream=null,this.Zi=new fo(e,t)}return e.prototype.tr=function(){return 1===this.state||2===this.state||4===this.state},e.prototype.er=function(){return 2===this.state},e.prototype.start=function(){3!==this.state?this.auth():this.nr()},e.prototype.stop=function(){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(e){switch(e.label){case 0:return this.tr()?[4,this.close(0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.sr=function(){this.state=0,this.Zi.reset()},e.prototype.ir=function(){var e=this;this.er()&&null===this.Xi&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,(function(){return e.rr()})))},e.prototype.cr=function(e){this.ur(),this.stream.send(e)},e.prototype.rr=function(){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(e){return this.er()?[2,this.close(0)]:[2]}))}))},e.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},e.prototype.close=function(e,t){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(n){switch(n.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,3!==e?this.Zi.reset():t&&t.code===s.RESOURCE_EXHAUSTED?(d(t.toString()),d("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Ki()):t&&t.code===s.UNAUTHENTICATED&&this.Ji.invalidateToken(),null!==this.stream&&(this.ar(),this.stream.close(),this.stream=null),this.state=e,[4,this.listener.Ri(t)];case 1:return n.sent(),[2]}}))}))},e.prototype.ar=function(){},e.prototype.auth=function(){var e=this;this.state=1;var t=this.hr(this.Yi),n=this.Yi;this.Ji.getToken().then((function(t){e.Yi===n&&e.lr(t)}),(function(n){t((function(){var t=new c(s.UNKNOWN,"Fetching auth token failed: "+n.message);return e.dr(t)}))}))},e.prototype.lr=function(e){var t=this,n=this.hr(this.Yi);this.stream=this.wr(e),this.stream.Ii((function(){n((function(){return t.state=2,t.listener.Ii()}))})),this.stream.Ri((function(e){n((function(){return t.dr(e)}))})),this.stream.onMessage((function(e){n((function(){return t.onMessage(e)}))}))},e.prototype.nr=function(){var e=this;this.state=4,this.Zi.ji((function(){return Object(a.a)(e,void 0,void 0,(function(){return Object(a.c)(this,(function(e){return this.state=0,this.start(),[2]}))}))}))},e.prototype.dr=function(e){return h("PersistentStream","close with error: "+e),this.stream=null,this.close(3,e)},e.prototype.hr=function(e){var t=this;return function(n){t.Se.enqueueAndForget((function(){return t.Yi===e?n():(h("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},e}(),po=function(e){function t(t,n,r,i,o){var a=this;return(a=e.call(this,t,"listen_stream_connection_backoff","listen_stream_idle",n,r,o)||this).R=i,a}return Object(a.b)(t,e),t.prototype.wr=function(e){return this.Hi.$i("Listen",e)},t.prototype.onMessage=function(e){this.Zi.reset();var t=function(e,t){var n;if("targetChange"in t){t.targetChange;var r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:v()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],o=function(e,t){return e.I?(m(void 0===t||"string"==typeof t),j.fromBase64String(t||"")):(m(void 0===t||t instanceof Uint8Array),j.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),a=(u=t.targetChange.cause)&&function(e){var t=void 0===e.code?s.UNKNOWN:It(e.code);return new c(t,e.message||"")}(u);n=new Gt(r,i,o,a||null)}else if("documentChange"in t){t.documentChange,(r=t.documentChange).document,r.document.name,r.document.updateTime,i=cn(e,r.document.name),o=on(r.document.updateTime);var u=new oe({mapValue:{fields:r.document.fields}}),l=(a=ue.newFoundDocument(i,o,u),r.targetIds||[]),f=r.removedTargetIds||[];n=new Ht(l,f,a.key,a)}else if("documentDelete"in t)t.documentDelete,(r=t.documentDelete).document,i=cn(e,r.document),o=r.readTime?on(r.readTime):T.min(),u=ue.newNoDocument(i,o),a=r.removedTargetIds||[],n=new Ht([],a,u.key,u);else if("documentRemove"in t)t.documentRemove,(r=t.documentRemove).document,i=cn(e,r.document),o=r.removedTargetIds||[],n=new Ht([],o,i,null);else{if(!("filter"in t))return v();t.filter;var h=t.filter;h.targetId,r=h.count||0,i=new Tt(r),o=h.targetId,n=new Wt(o,i)}return n}(this.R,e),n=function(e){if(!("targetChange"in e))return T.min();var t=e.targetChange;return t.targetIds&&t.targetIds.length?T.min():t.readTime?on(t.readTime):T.min()}(e);return this.listener._r(t,n)},t.prototype.mr=function(e){var t={};t.database=hn(this.R),t.addTarget=function(e,t){var n,r=t.target;return(n=he(r)?{documents:gn(e,r)}:{query:bn(e,r)}).targetId=t.targetId,t.resumeToken.approximateByteSize()>0?n.resumeToken=nn(e,t.resumeToken):t.snapshotVersion.compareTo(T.min())>0&&(n.readTime=tn(e,t.snapshotVersion.toTimestamp())),n}(this.R,e);var n=function(e,t){var n=function(e,t){switch(t){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return v()}}(0,t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.R,e);n&&(t.labels=n),this.cr(t)},t.prototype.yr=function(e){var t={};t.database=hn(this.R),t.removeTarget=e,this.cr(t)},t}(ho),yo=function(e){function t(t,n,r,i,o){var a=this;return(a=e.call(this,t,"write_stream_connection_backoff","write_stream_idle",n,r,o)||this).R=i,a.gr=!1,a}return Object(a.b)(t,e),Object.defineProperty(t.prototype,"pr",{get:function(){return this.gr},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.gr=!1,this.lastStreamToken=void 0,e.prototype.start.call(this)},t.prototype.ar=function(){this.gr&&this.Er([])},t.prototype.wr=function(e){return this.Hi.$i("Write",e)},t.prototype.onMessage=function(e){if(m(!!e.streamToken),this.lastStreamToken=e.streamToken,this.gr){this.Zi.reset();var t=function(e,t){return e&&e.length>0?(m(void 0!==t),e.map((function(e){return function(e,t){var n=e.updateTime?on(e.updateTime):on(t);return n.isEqual(T.min())&&(n=on(t)),new ut(n,e.transformResults||[])}(e,t)}))):[]}(e.writeResults,e.commitTime),n=on(e.commitTime);return this.listener.Tr(n,t)}return m(!e.writeResults||0===e.writeResults.length),this.gr=!0,this.listener.Ir()},t.prototype.Ar=function(){var e={};e.database=hn(this.R),this.cr(e)},t.prototype.Er=function(e){var t=this,n={streamToken:this.lastStreamToken,writes:e.map((function(e){return vn(t.R,e)}))};this.cr(n)},t}(ho),vo=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).credentials=t,i.Hi=n,i.R=r,i.Rr=!1,i}return Object(a.b)(t,e),t.prototype.br=function(){if(this.Rr)throw new c(s.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.Ni=function(e,t,n){var r=this;return this.br(),this.credentials.getToken().then((function(i){return r.Hi.Ni(e,t,n,i)})).catch((function(e){throw"FirebaseError"===e.name?(e.code===s.UNAUTHENTICATED&&r.credentials.invalidateToken(),e):new c(s.UNKNOWN,e.toString())}))},t.prototype.Oi=function(e,t,n){var r=this;return this.br(),this.credentials.getToken().then((function(i){return r.Hi.Oi(e,t,n,i)})).catch((function(e){throw"FirebaseError"===e.name?(e.code===s.UNAUTHENTICATED&&r.credentials.invalidateToken(),e):new c(s.UNKNOWN,e.toString())}))},t.prototype.terminate=function(){this.Rr=!0},t}((function(){})),mo=function(){function e(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.vr=0,this.Pr=null,this.Vr=!0}return e.prototype.Sr=function(){var e=this;0===this.vr&&(this.Dr("Unknown"),this.Pr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(function(){return e.Pr=null,e.Cr("Backend didn't respond within 10 seconds."),e.Dr("Offline"),Promise.resolve()})))},e.prototype.Nr=function(e){"Online"===this.state?this.Dr("Unknown"):(this.vr++,this.vr>=1&&(this.Fr(),this.Cr("Connection failed 1 times. Most recent error: "+e.toString()),this.Dr("Offline")))},e.prototype.set=function(e){this.Fr(),this.vr=0,"Online"===e&&(this.Vr=!1),this.Dr(e)},e.prototype.Dr=function(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))},e.prototype.Cr=function(e){var t="Could not reach Cloud Firestore backend. "+e+"\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.";this.Vr?(d(t),this.Vr=!1):h("OnlineStateTracker",t)},e.prototype.Fr=function(){null!==this.Pr&&(this.Pr.cancel(),this.Pr=null)},e}(),go=function(e,t,n,r,i){var o=this;this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.kr=[],this.Or=new Map,this.$r=new Set,this.Mr=[],this.Lr=i,this.Lr.di((function(e){n.enqueueAndForget((function(){return Object(a.a)(o,void 0,void 0,(function(){return Object(a.c)(this,(function(e){switch(e.label){case 0:return Io(this)?(h("RemoteStore","Restarting streams for network reachability change."),[4,function(e){return Object(a.a)(this,void 0,void 0,(function(){var t;return Object(a.c)(this,(function(n){switch(n.label){case 0:return(t=g(e)).$r.add(4),[4,wo(t)];case 1:return n.sent(),t.Br.set("Unknown"),t.$r.delete(4),[4,bo(t)];case 2:return n.sent(),[2]}}))}))}(this)]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))})),this.Br=new mo(n,r)};function bo(e){return Object(a.a)(this,void 0,void 0,(function(){var t,n;return Object(a.c)(this,(function(r){switch(r.label){case 0:if(!Io(e))return[3,4];t=0,n=e.Mr,r.label=1;case 1:return t0}function Io(e){return 0===g(e).$r.size}function Co(e){e.qr=void 0}function No(e){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(t){return e.Or.forEach((function(t,n){So(e,t)})),[2]}))}))}function xo(e,t){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(n){return Co(e),ko(e)?(e.Br.Nr(t),To(e)):e.Br.set("Unknown"),[2]}))}))}function Ao(e,t,n){return Object(a.a)(this,void 0,void 0,(function(){var r,i,o;return Object(a.c)(this,(function(u){switch(u.label){case 0:if(e.Br.set("Online"),!(t instanceof Gt&&2===t.state&&t.cause))return[3,6];u.label=1;case 1:return u.trys.push([1,3,,5]),[4,function(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i,o;return Object(a.c)(this,(function(a){switch(a.label){case 0:n=t.cause,r=0,i=t.targetIds,a.label=1;case 1:return r=0?[4,function(e,t){var n=e.qr.ut(t);return n.targetChanges.forEach((function(n,r){if(n.resumeToken.approximateByteSize()>0){var i=e.Or.get(r);i&&e.Or.set(r,i.withResumeToken(n.resumeToken,t))}})),n.targetMismatches.forEach((function(t){var n=e.Or.get(t);if(n){e.Or.set(t,n.withResumeToken(j.EMPTY_BYTE_STRING,n.snapshotVersion)),Oo(e,t);var r=new vr(n.target,t,1,n.sequenceNumber);So(e,r)}})),e.remoteSyncer.applyRemoteEvent(n)}(e,n)]:[3,10];case 9:u.sent(),u.label=10;case 10:return[3,13];case 11:return h("RemoteStore","Failed to raise snapshot:",o=u.sent()),[4,Do(e,o)];case 12:return u.sent(),[3,13];case 13:return[2]}}))}))}function Do(e,t,n){return Object(a.a)(this,void 0,void 0,(function(){var r=this;return Object(a.c)(this,(function(i){switch(i.label){case 0:if(!ur(t))throw t;return e.$r.add(1),[4,wo(e)];case 1:return i.sent(),e.Br.set("Offline"),n||(n=function(){return Oi(e.localStore)}),e.asyncQueue.enqueueRetryable((function(){return Object(a.a)(r,void 0,void 0,(function(){return Object(a.c)(this,(function(t){switch(t.label){case 0:return h("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return t.sent(),e.$r.delete(1),[4,bo(e)];case 2:return t.sent(),[2]}}))}))})),[2]}}))}))}function Po(e,t){return t().catch((function(n){return Do(e,n,t)}))}function jo(e){return Object(a.a)(this,void 0,void 0,(function(){var t,n,r,i,o;return Object(a.c)(this,(function(a){switch(a.label){case 0:t=g(e),n=zo(t),r=t.kr.length>0?t.kr[t.kr.length-1].batchId:-1,a.label=1;case 1:if(!function(e){return Io(e)&&e.kr.length<10}(t))return[3,7];a.label=2;case 2:return a.trys.push([2,4,,6]),[4,Ii(t.localStore,r)];case 3:return null===(i=a.sent())?(0===t.kr.length&&n.ir(),[3,7]):(r=i.batchId,function(e,t){e.kr.push(t);var n=zo(e);n.er()&&n.pr&&n.Er(t.mutations)}(t,i),[3,6]);case 4:return o=a.sent(),[4,Do(t,o)];case 5:return a.sent(),[3,6];case 6:return[3,1];case 7:return Ro(t)&&Lo(t),[2]}}))}))}function Ro(e){return Io(e)&&!zo(e).tr()&&e.kr.length>0}function Lo(e){zo(e).start()}function Mo(e){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(t){return zo(e).Ar(),[2]}))}))}function Fo(e){return Object(a.a)(this,void 0,void 0,(function(){var t,n,r,i;return Object(a.c)(this,(function(o){for(t=zo(e),n=0,r=e.kr;n0&&(h("RemoteStore","Stopping write stream with "+e.kr.length+" pending writes"),e.kr=[]),t.label=4;case 4:return[2]}}))}))}))),e.Qr}var Ko=function(){function e(e,t,n,r,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new tr,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((function(e){}))}return e.createAndSchedule=function(t,n,r,i,o){var a=new e(t,n,Date.now()+r,i,o);return a.start(r),a},e.prototype.start=function(e){var t=this;this.timerHandle=setTimeout((function(){return t.handleDelayElapsed()}),e)},e.prototype.skipDelay=function(){return this.handleDelayElapsed()},e.prototype.cancel=function(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new c(s.CANCELLED,"Operation cancelled"+(e?": "+e:""))))},e.prototype.handleDelayElapsed=function(){var e=this;this.asyncQueue.enqueueAndForget((function(){return null!==e.timerHandle?(e.clearTimeout(),e.op().then((function(t){return e.deferred.resolve(t)}))):Promise.resolve()}))},e.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},e}();function Ho(e,t){if(d("AsyncQueue",t+": "+e),ur(e))return new c(s.UNAVAILABLE,t+": "+e);throw e}var Wo=function(){function e(e){this.comparator=e?function(t,n){return e(t,n)||H.comparator(t.key,n.key)}:function(e,t){return H.comparator(e.key,t.key)},this.keyedMap=Lt(),this.sortedSet=new Ct(this.comparator)}return e.emptySet=function(t){return new e(t.comparator)},e.prototype.has=function(e){return null!=this.keyedMap.get(e)},e.prototype.get=function(e){return this.keyedMap.get(e)},e.prototype.first=function(){return this.sortedSet.minKey()},e.prototype.last=function(){return this.sortedSet.maxKey()},e.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},e.prototype.indexOf=function(e){var t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1},Object.defineProperty(e.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e){this.sortedSet.inorderTraversal((function(t,n){return e(t),!1}))},e.prototype.add=function(e){var t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))},e.prototype.delete=function(e){var t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this},e.prototype.isEqual=function(t){if(!(t instanceof e))return!1;if(this.size!==t.size)return!1;for(var n=this.sortedSet.getIterator(),r=t.sortedSet.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0},e.prototype.toString=function(){var e=[];return this.forEach((function(t){e.push(t.toString())})),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"},e.prototype.copy=function(t,n){var r=new e;return r.comparator=this.comparator,r.keyedMap=t,r.sortedSet=n,r},e}(),Go=function(){function e(){this.Kr=new Ct(H.comparator)}return e.prototype.track=function(e){var t=e.doc.key,n=this.Kr.get(t);n?0!==e.type&&3===n.type?this.Kr=this.Kr.insert(t,e):3===e.type&&1!==n.type?this.Kr=this.Kr.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.Kr=this.Kr.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.Kr=this.Kr.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.Kr=this.Kr.remove(t):1===e.type&&2===n.type?this.Kr=this.Kr.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.Kr=this.Kr.insert(t,{type:2,doc:e.doc}):v():this.Kr=this.Kr.insert(t,e)},e.prototype.jr=function(){var e=[];return this.Kr.inorderTraversal((function(t,n){e.push(n)})),e},e}(),Qo=function(){function e(e,t,n,r,i,o,a,u){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=u}return e.fromInitialDocuments=function(t,n,r,i){var o=[];return n.forEach((function(e){o.push({type:0,doc:e})})),new e(t,n,Wo.emptySet(n),o,r,i,!0,!1)},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){if(!(this.fromCache===e.fromCache&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Ue(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;var t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(var r=0;r=0&&(o.listeners.splice(u,1),i=0===o.listeners.length),i?[2,(n.queries.delete(r),n.onUnlisten(r))]:[2]}))}))}function Zo(e,t){for(var n=g(e),r=!1,i=0,o=t;i0)return!0;var t=this.Xr&&this.Xr.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges},e.prototype.no=function(e){e=Qo.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache),this.Yr=!0,this.Jr.next(e)},e}(),ra=function(){function e(e,t){this.payload=e,this.byteLength=t}return e.prototype.io=function(){return"metadata"in this.payload},e}(),ia=function(){function e(e){this.R=e}return e.prototype.qn=function(e){return cn(this.R,e)},e.prototype.Un=function(e){return e.metadata.exists?yn(this.R,e.document,!1):ue.newNoDocument(this.qn(e.metadata.name),this.Qn(e.metadata.readTime))},e.prototype.Qn=function(e){return on(e)},e}();!function(){function e(e,t,n){this.ro=e,this.localStore=t,this.R=n,this.queries=[],this.documents=[],this.progress=oa(e)}e.prototype.oo=function(e){this.progress.bytesLoaded+=e.byteLength;var t=this.progress.documentsLoaded;return e.payload.namedQuery?this.queries.push(e.payload.namedQuery):e.payload.documentMetadata?(this.documents.push({metadata:e.payload.documentMetadata}),e.payload.documentMetadata.exists||++t):e.payload.document&&(this.documents[this.documents.length-1].document=e.payload.document,++t),t!==this.progress.documentsLoaded?(this.progress.documentsLoaded=t,Object.assign({},this.progress)):null},e.prototype.co=function(e){for(var t=new Map,n=new ia(this.R),r=0,i=e;r0||c&&n.lo(f,c)<0)&&(u=!0)):!l&&f?(r.track({type:0,doc:f}),p=!0):l&&!f&&(r.track({type:1,doc:l}),p=!0,(s||c)&&(u=!0)),p&&(f?(a=a.add(f),o=d?o.add(e):o.delete(e)):(a=a.delete(e),o=o.delete(e)))})),Ae(this.query)||De(this.query))for(;a.size>this.query.limit;){var l=Ae(this.query)?a.last():a.first();a=a.delete(l.key),o=o.delete(l.key),r.track({type:1,doc:l})}return{fo:a,mo:r,Nn:u,mutatedKeys:o}},e.prototype.yo=function(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations},e.prototype.applyChanges=function(e,t,n){var r=this,i=this.fo;this.fo=e.fo,this.mutatedKeys=e.mutatedKeys;var o=e.mo.jr();o.sort((function(e,t){return function(e,t){var n=function(e){switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return v()}};return n(e)-n(t)}(e.type,t.type)||r.lo(e.doc,t.doc)})),this.po(n);var a=t?this.Eo():[],u=0===this.ho.size&&this.current?1:0,s=u!==this.ao;return this.ao=u,0!==o.length||s?{snapshot:new Qo(this.query,e.fo,i,o,e.mutatedKeys,0===u,s,!1),To:a}:{To:a}},e.prototype.zr=function(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({fo:this.fo,mo:new Go,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},e.prototype.Io=function(e){return!this.uo.has(e)&&!!this.fo.has(e)&&!this.fo.get(e).hasLocalMutations},e.prototype.po=function(e){var t=this;e&&(e.addedDocuments.forEach((function(e){return t.uo=t.uo.add(e)})),e.modifiedDocuments.forEach((function(e){})),e.removedDocuments.forEach((function(e){return t.uo=t.uo.delete(e)})),this.current=e.current)},e.prototype.Eo=function(){var e=this;if(!this.current)return[];var t=this.ho;this.ho=Vt(),this.fo.forEach((function(t){e.Io(t.key)&&(e.ho=e.ho.add(t.key))}));var n=[];return t.forEach((function(t){e.ho.has(t)||n.push(new ua(t))})),this.ho.forEach((function(e){t.has(e)||n.push(new aa(e))})),n},e.prototype.Ao=function(e){this.uo=e.Bn,this.ho=Vt();var t=this._o(e.documents);return this.applyChanges(t,!0)},e.prototype.Ro=function(){return Qo.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,0===this.ao)},e}(),ca=function(e,t,n){this.query=e,this.targetId=t,this.view=n},la=function(e){this.key=e,this.bo=!1},fa=function(){function e(e,t,n,r,i,o){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.vo={},this.Po=new ni((function(e){return Ve(e)}),Ue),this.Vo=new Map,this.So=new Set,this.Do=new Ct(H.comparator),this.Co=new Map,this.No=new Mi,this.xo={},this.Fo=new Map,this.ko=Kr.Yt(),this.onlineState="Unknown",this.Oo=void 0}return Object.defineProperty(e.prototype,"isPrimaryClient",{get:function(){return!0===this.Oo},enumerable:!1,configurable:!0}),e}();function ha(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i,o,u,s;return Object(a.c)(this,(function(a){switch(a.label){case 0:return n=qa(e),(o=n.Po.get(t))?(r=o.targetId,n.sharedClientState.addLocalQueryTarget(r),i=o.view.Ro(),[3,4]):[3,1];case 1:return[4,Ci(n.localStore,Me(t))];case 2:return u=a.sent(),s=n.sharedClientState.addLocalQueryTarget(u.targetId),r=u.targetId,[4,da(n,t,r,"current"===s)];case 3:i=a.sent(),n.isPrimaryClient&&Eo(n.remoteStore,u),a.label=4;case 4:return[2,i]}}))}))}function da(e,t,n,r){return Object(a.a)(this,void 0,void 0,(function(){var i,o,u,s,c,l;return Object(a.c)(this,(function(f){switch(f.label){case 0:return e.$o=function(t,n,r){return function(e,t,n,r){return Object(a.a)(this,void 0,void 0,(function(){var i,o,u;return Object(a.c)(this,(function(a){switch(a.label){case 0:return(i=t.view._o(n)).Nn?[4,xi(e.localStore,t.query,!1).then((function(e){var n=e.documents;return t.view._o(n,i)}))]:[3,2];case 1:i=a.sent(),a.label=2;case 2:return o=r&&r.targetChanges.get(t.targetId),u=t.view.applyChanges(i,e.isPrimaryClient,o),[2,(ka(e,t.targetId,u.To),u.snapshot)]}}))}))}(e,t,n,r)},[4,xi(e.localStore,t,!0)];case 1:return i=f.sent(),o=new sa(t,i.Bn),u=o._o(i.documents),s=Kt.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==e.onlineState),c=o.applyChanges(u,e.isPrimaryClient,s),ka(e,n,c.To),l=new ca(t,n,o),[2,(e.Po.set(t,l),e.Vo.has(n)?e.Vo.get(n).push(t):e.Vo.set(n,[t]),c.snapshot)]}}))}))}function pa(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i;return Object(a.c)(this,(function(o){switch(o.label){case 0:return n=g(e),r=n.Po.get(t),(i=n.Vo.get(r.targetId)).length>1?[2,(n.Vo.set(r.targetId,i.filter((function(e){return!Ue(e,t)}))),void n.Po.delete(t))]:n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)?[3,2]:[4,Ni(n.localStore,r.targetId,!1).then((function(){n.sharedClientState.clearQueryState(r.targetId),_o(n.remoteStore,r.targetId),Oa(n,r.targetId)})).catch($r)]):[3,3];case 1:o.sent(),o.label=2;case 2:return[3,5];case 3:return Oa(n,r.targetId),[4,Ni(n.localStore,r.targetId,!0)];case 4:o.sent(),o.label=5;case 5:return[2]}}))}))}function ya(e,t,n){return Object(a.a)(this,void 0,void 0,(function(){var r,i,o,u;return Object(a.c)(this,(function(a){switch(a.label){case 0:r=Ba(e),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,function(e,t){var n,r=g(e),i=O.now(),o=t.reduce((function(e,t){return e.add(t.key)}),Vt());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(e){return r.Mn.pn(e,o).next((function(o){n=o;for(var a=[],u=0,s=t;u0?r.bo=!0:e.modifiedDocuments.size>0?m(r.bo):e.removedDocuments.size>0&&(m(r.bo),r.bo=!1))})),[4,Na(n,r,t)];case 3:return i.sent(),[3,6];case 4:return[4,$r(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function ma(e,t,n){var r=g(e);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){var i=[];r.Po.forEach((function(e,n){var r=n.view.zr(t);r.snapshot&&i.push(r.snapshot)})),function(e,t){var n=g(e);n.onlineState=t;var r=!1;n.queries.forEach((function(e,n){for(var i=0,o=n.listeners;i0&&e.Do.size0)throw new c(s.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i,o,u,s;return Object(a.c)(this,(function(a){switch(a.label){case 0:return n=g(e),r=hn(n.R)+"/documents",i={documents:t.map((function(e){return sn(n.R,e)}))},[4,n.Oi("BatchGetDocuments",r,i)];case 1:return o=a.sent(),u=new Map,o.forEach((function(e){var t=function(e,t){return"found"in t?function(e,t){m(!!t.found),t.found.name,t.found.updateTime;var n=cn(e,t.found.name),r=on(t.found.updateTime),i=new oe({mapValue:{fields:t.found.fields}});return ue.newFoundDocument(n,r,i)}(e,t):"missing"in t?function(e,t){m(!!t.missing),m(!!t.readTime);var n=cn(e,t.missing),r=on(t.readTime);return ue.newNoDocument(n,r)}(e,t):v()}(n.R,e);u.set(t.key.toString(),t)})),s=[],[2,(t.forEach((function(e){var t=u.get(e.toString());m(!!t),s.push(t)})),s)]}}))}))}(this.datastore,e)];case 1:return[2,((t=r.sent()).forEach((function(e){return n.recordVersion(e)})),t)]}}))}))},e.prototype.set=function(e,t){this.write(t.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())},e.prototype.update=function(e,t){try{this.write(t.toMutation(e,this.preconditionForUpdate(e)))}catch(e){this.lastWriteError=e}this.writtenDocs.add(e.toString())},e.prototype.delete=function(e){this.write(new St(e,this.precondition(e))),this.writtenDocs.add(e.toString())},e.prototype.commit=function(){return Object(a.a)(this,void 0,void 0,(function(){var e,t=this;return Object(a.c)(this,(function(n){switch(n.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;return e=this.readVersions,this.mutations.forEach((function(t){e.delete(t.key.toString())})),e.forEach((function(e,n){var r=H.fromPath(n);t.mutations.push(new Ot(r,t.precondition(r)))})),[4,function(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i;return Object(a.c)(this,(function(o){switch(o.label){case 0:return n=g(e),r=hn(n.R)+"/documents",i={writes:t.map((function(e){return vn(n.R,e)}))},[4,n.Ni("Commit",r,i)];case 1:return o.sent(),[2]}}))}))}(this.datastore,this.mutations)];case 1:return n.sent(),this.committed=!0,[2]}}))}))},e.prototype.recordVersion=function(e){var t;if(e.isFoundDocument())t=e.version;else{if(!e.isNoDocument())throw v();t=T.min()}var n=this.readVersions.get(e.key.toString());if(n){if(!t.isEqual(n))throw new c(s.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),t)},e.prototype.precondition=function(e){var t=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&t?st.updateTime(t):st.none()},e.prototype.preconditionForUpdate=function(e){var t=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&t){if(t.isEqual(T.min()))throw new c(s.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return st.updateTime(t)}return st.exists(!0)},e.prototype.write=function(e){this.ensureCommitNotCalled(),this.mutations.push(e)},e.prototype.ensureCommitNotCalled=function(){},e}()),$a=function(){function e(e,t,n,r){this.asyncQueue=e,this.datastore=t,this.updateFunction=n,this.deferred=r,this.ec=5,this.Zi=new fo(this.asyncQueue,"transaction_retry")}return e.prototype.run=function(){this.nc()},e.prototype.nc=function(){var e=this;this.Zi.ji((function(){return Object(a.a)(e,void 0,void 0,(function(){var e,t,n=this;return Object(a.c)(this,(function(r){return e=new Qa(this.datastore),(t=this.sc(e))&&t.then((function(t){n.asyncQueue.enqueueAndForget((function(){return e.commit().then((function(){n.deferred.resolve(t)})).catch((function(e){n.ic(e)}))}))})).catch((function(e){n.ic(e)})),[2]}))}))}))},e.prototype.sc=function(e){try{var t=this.updateFunction(e);return!B(t)&&t.catch&&t.then?t:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(e){return this.deferred.reject(e),null}},e.prototype.ic=function(e){var t=this;this.ec>0&&this.rc(e)?(this.ec-=1,this.asyncQueue.enqueueAndForget((function(){return t.nc(),Promise.resolve()}))):this.deferred.reject(e)},e.prototype.rc=function(e){if("FirebaseError"===e.name){var t=e.code;return"aborted"===t||"failed-precondition"===t||!kt(t)}return!1},e}(),Ya=function(){function e(e,t,n){var r=this;this.credentials=e,this.asyncQueue=t,this.databaseInfo=n,this.user=Wi.UNAUTHENTICATED,this.clientId=w.u(),this.credentialListener=function(){},this.receivedInitialUser=new tr,this.credentials.setChangeListener((function(e){h("FirestoreClient","Received user=",e.uid),r.user=e,r.credentialListener(e),r.receivedInitialUser.resolve()}))}return e.prototype.getConfiguration=function(){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(e){switch(e.label){case 0:return[4,this.receivedInitialUser.promise];case 1:return[2,(e.sent(),{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100})]}}))}))},e.prototype.setCredentialChangeListener=function(e){var t=this;this.credentialListener=e,this.receivedInitialUser.promise.then((function(){return t.credentialListener(t.user)}))},e.prototype.verifyNotTerminated=function(){if(this.asyncQueue.isShuttingDown)throw new c(s.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.terminate=function(){var e=this;this.asyncQueue.enterRestrictedMode();var t=new tr;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((function(){return Object(a.a)(e,void 0,void 0,(function(){var e,n;return Object(a.c)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),this.onlineComponents?[4,this.onlineComponents.terminate()]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.offlineComponents?[4,this.offlineComponents.terminate()]:[3,4];case 3:r.sent(),r.label=4;case 4:return this.credentials.removeChangeListener(),t.resolve(),[3,6];case 5:return e=r.sent(),n=Ho(e,"Failed to shutdown persistence"),t.reject(n),[3,6];case 6:return[2]}}))}))})),t.promise},e}();function Xa(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i=this;return Object(a.c)(this,(function(o){switch(o.label){case 0:return e.asyncQueue.verifyOperationInProgress(),h("FirestoreClient","Initializing OfflineComponentProvider"),[4,e.getConfiguration()];case 1:return n=o.sent(),[4,t.initialize(n)];case 2:return o.sent(),r=n.initialUser,e.setCredentialChangeListener((function(n){r.isEqual(n)||(r=n,e.asyncQueue.enqueueRetryable((function(){return Object(a.a)(i,void 0,void 0,(function(){return Object(a.c)(this,(function(e){switch(e.label){case 0:return[4,_i(t.localStore,n)];case 1:return e.sent(),[2]}}))}))})))})),t.persistence.setDatabaseDeletedListener((function(){return e.terminate()})),e.offlineComponents=t,[2]}}))}))}function Ja(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r;return Object(a.c)(this,(function(i){switch(i.label){case 0:return e.asyncQueue.verifyOperationInProgress(),[4,Za(e)];case 1:return n=i.sent(),h("FirestoreClient","Initializing OnlineComponentProvider"),[4,e.getConfiguration()];case 2:return r=i.sent(),[4,t.initialize(n,r)];case 3:return i.sent(),e.setCredentialChangeListener((function(n){return e.asyncQueue.enqueueRetryable((function(){return function(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r;return Object(a.c)(this,(function(i){switch(i.label){case 0:return(n=g(e)).asyncQueue.verifyOperationInProgress(),h("RemoteStore","RemoteStore received new credentials"),r=Io(n),n.$r.add(3),[4,wo(n)];case 1:return i.sent(),r&&n.Br.set("Unknown"),[4,n.remoteSyncer.handleCredentialChange(t)];case 2:return i.sent(),n.$r.delete(3),[4,bo(n)];case 3:return i.sent(),[2]}}))}))}(t.remoteStore,n)}))})),e.onlineComponents=t,[2]}}))}))}function Za(e){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(t){switch(t.label){case 0:return e.offlineComponents?[3,2]:(h("FirestoreClient","Using default OfflineComponentProvider"),[4,Xa(e,new za)]);case 1:t.sent(),t.label=2;case 2:return[2,e.offlineComponents]}}))}))}function eu(e){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(t){switch(t.label){case 0:return e.onlineComponents?[3,2]:(h("FirestoreClient","Using default OnlineComponentProvider"),[4,Ja(e,new Wa)]);case 1:t.sent(),t.label=2;case 2:return[2,e.onlineComponents]}}))}))}function tu(e){return Za(e).then((function(e){return e.persistence}))}function nu(e){return Za(e).then((function(e){return e.localStore}))}function ru(e){return eu(e).then((function(e){return e.remoteStore}))}function iu(e){return eu(e).then((function(e){return e.syncEngine}))}function ou(e){return Object(a.a)(this,void 0,void 0,(function(){var t,n;return Object(a.c)(this,(function(r){switch(r.label){case 0:return[4,eu(e)];case 1:return t=r.sent(),[2,((n=t.eventManager).onListen=ha.bind(null,t.syncEngine),n.onUnlisten=pa.bind(null,t.syncEngine),n)]}}))}))}function au(e,t,n){var r=this;void 0===n&&(n={});var i=new tr;return e.asyncQueue.enqueueAndForget((function(){return Object(a.a)(r,void 0,void 0,(function(){var r;return Object(a.c)(this,(function(o){switch(o.label){case 0:return r=function(e,t,n,r,i){var o=new Ga({next:function(o){t.enqueueAndForget((function(){return Jo(e,a)}));var u=o.docs.has(n);!u&&o.fromCache?i.reject(new c(s.UNAVAILABLE,"Failed to get document because the client is offline.")):u&&o.fromCache&&r&&"server"===r.source?i.reject(new c(s.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)},error:function(e){return i.reject(e)}}),a=new na(xe(n.path),o,{includeMetadataChanges:!0,so:!0});return Xo(e,a)},[4,ou(e)];case 1:return[2,r.apply(void 0,[o.sent(),e.asyncQueue,t,n,i])]}}))}))})),i.promise}function uu(e,t,n){var r=this;void 0===n&&(n={});var i=new tr;return e.asyncQueue.enqueueAndForget((function(){return Object(a.a)(r,void 0,void 0,(function(){var r;return Object(a.c)(this,(function(o){switch(o.label){case 0:return r=function(e,t,n,r,i){var o=new Ga({next:function(n){t.enqueueAndForget((function(){return Jo(e,a)})),n.fromCache&&"server"===r.source?i.reject(new c(s.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)},error:function(e){return i.reject(e)}}),a=new na(n,o,{includeMetadataChanges:!0,so:!0});return Xo(e,a)},[4,ou(e)];case 1:return[2,r.apply(void 0,[o.sent(),e.asyncQueue,t,n,i])]}}))}))})),i.promise}var su=function(e,t,n,r,i,o,a){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=a},cu=function(){function e(e,t){this.projectId=e,this.database=t||"(default)"}return Object.defineProperty(e.prototype,"isDefaultDatabase",{get:function(){return"(default)"===this.database},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.projectId===this.projectId&&t.database===this.database},e}(),lu=new Map,fu=function(e,t){this.user=t,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization="Bearer "+e},hu=function(){function e(){this.changeListener=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.invalidateToken=function(){},e.prototype.setChangeListener=function(e){this.changeListener=e,e(Wi.UNAUTHENTICATED)},e.prototype.removeChangeListener=function(){this.changeListener=null},e}(),du=function(){function e(e){this.token=e,this.changeListener=null}return e.prototype.getToken=function(){return Promise.resolve(this.token)},e.prototype.invalidateToken=function(){},e.prototype.setChangeListener=function(e){this.changeListener=e,e(this.token.user)},e.prototype.removeChangeListener=function(){this.changeListener=null},e}(),pu=function(){function e(e){var t=this;this.oc=null,this.currentUser=Wi.UNAUTHENTICATED,this.receivedInitialUser=!1,this.cc=0,this.changeListener=null,this.forceRefresh=!1,this.oc=function(){t.cc++,t.currentUser=t.uc(),t.receivedInitialUser=!0,t.changeListener&&t.changeListener(t.currentUser)},this.cc=0,this.auth=e.getImmediate({optional:!0}),this.auth?this.auth.addAuthTokenListener(this.oc):(this.oc(null),e.get().then((function(e){t.auth=e,t.oc&&t.auth.addAuthTokenListener(t.oc)}),(function(){})))}return e.prototype.getToken=function(){var e=this,t=this.cc,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return e.cc!==t?(h("FirebaseCredentialsProvider","getToken aborted due to token change."),e.getToken()):n?(m("string"==typeof n.accessToken),new fu(n.accessToken,e.currentUser)):null})):Promise.resolve(null)},e.prototype.invalidateToken=function(){this.forceRefresh=!0},e.prototype.setChangeListener=function(e){this.changeListener=e,this.receivedInitialUser&&e(this.currentUser)},e.prototype.removeChangeListener=function(){this.auth&&this.auth.removeAuthTokenListener(this.oc),this.oc=null,this.changeListener=null},e.prototype.uc=function(){var e=this.auth&&this.auth.getUid();return m(null===e||"string"==typeof e),new Wi(e)},e}(),yu=function(){function e(e,t,n){this.ac=e,this.hc=t,this.lc=n,this.type="FirstParty",this.user=Wi.FIRST_PARTY}return Object.defineProperty(e.prototype,"authHeaders",{get:function(){var e={"X-Goog-AuthUser":this.hc},t=this.ac.auth.getAuthHeaderValueForFirstParty([]);return t&&(e.Authorization=t),this.lc&&(e["X-Goog-Iam-Authorization-Token"]=this.lc),e},enumerable:!1,configurable:!0}),e}(),vu=function(){function e(e,t,n){this.ac=e,this.hc=t,this.lc=n}return e.prototype.getToken=function(){return Promise.resolve(new yu(this.ac,this.hc,this.lc))},e.prototype.setChangeListener=function(e){e(Wi.FIRST_PARTY)},e.prototype.removeChangeListener=function(){},e.prototype.invalidateToken=function(){},e}();function mu(e,t,n){if(!n)throw new c(s.INVALID_ARGUMENT,"Function "+e+"() cannot be called with an empty "+t+".")}function gu(e,t){if(void 0===t)return{merge:!1};if(void 0!==t.mergeFields&&void 0!==t.merge)throw new c(s.INVALID_ARGUMENT,"Invalid options passed to function "+e+'(): You cannot specify both "merge" and "mergeFields".');return t}function bu(e,t,n,r){if(!0===t&&!0===r)throw new c(s.INVALID_ARGUMENT,e+" and "+n+" cannot be used together.")}function wu(e){if(!H.isDocumentKey(e))throw new c(s.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e+" has "+e.length+".")}function Eu(e){if(H.isDocumentKey(e))throw new c(s.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+e+" has "+e.length+".")}function _u(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=e.substring(0,20)+"..."),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";var t=function(e){if(e.constructor){var t=/function\s+([^\s(]+)\s*\(/.exec(e.constructor.toString());if(t&&t.length>1)return t[1]}return null}(e);return t?"a custom "+t+" object":"an object"}return"function"==typeof e?"a function":v()}function Su(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new c(s.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=_u(e);throw new c(s.INVALID_ARGUMENT,"Expected type '"+t.name+"', but it was: "+n)}return e}function Ou(e,t){if(t<=0)throw new c(s.INVALID_ARGUMENT,"Function "+e+"() requires a positive number, but it was: "+t+".")}var Tu=function(){function e(e){var t;if(void 0===e.host){if(void 0!==e.ssl)throw new c(s.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new c(s.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,bu("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling)}return e.prototype.isEqual=function(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties},e}(),ku=function(){function e(e,t){this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Tu({}),this._settingsFrozen=!1,e instanceof cu?(this._databaseId=e,this._credentials=new hu):(this._app=e,this._databaseId=function(e){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new c(s.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new cu(e.options.projectId)}(e),this._credentials=new pu(t))}return Object.defineProperty(e.prototype,"app",{get:function(){if(!this._app)throw new c(s.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_initialized",{get:function(){return this._settingsFrozen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_terminated",{get:function(){return void 0!==this._terminateTask},enumerable:!1,configurable:!0}),e.prototype._setSettings=function(e){if(this._settingsFrozen)throw new c(s.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.");this._settings=new Tu(e),void 0!==e.credentials&&(this._credentials=function(e){if(!e)return new hu;switch(e.type){case"gapi":var t=e.client;return m(!("object"!=typeof t||null===t||!t.auth||!t.auth.getAuthHeaderValueForFirstParty)),new vu(t,e.sessionIndex||"0",e.iamToken||null);case"provider":return e.client;default:throw new c(s.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(e.credentials))},e.prototype._getSettings=function(){return this._settings},e.prototype._freezeSettings=function(){return this._settingsFrozen=!0,this._settings},e.prototype._delete=function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask},e.prototype.toJSON=function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}},e.prototype._terminate=function(){return this,(e=lu.get(this))&&(h("ComponentProvider","Removing Datastore"),lu.delete(this),e.terminate()),Promise.resolve();var e},e}(),Iu=function(){function e(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}return Object.defineProperty(e.prototype,"_path",{get:function(){return this._key.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new Nu(this.firestore,this.converter,this._key.path.popLast())},enumerable:!1,configurable:!0}),e.prototype.withConverter=function(t){return new e(this.firestore,t,this._key)},e}(),Cu=function(){function e(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}return e.prototype.withConverter=function(t){return new e(this.firestore,t,this._query)},e}(),Nu=function(e){function t(t,n,r){var i=this;return(i=e.call(this,t,n,xe(r))||this)._path=r,i.type="collection",i}return Object(a.b)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this._path.popLast();return e.isEmpty()?null:new Iu(this.firestore,null,new H(e))},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(e){return new t(this.firestore,e,this._path)},t}(Cu);function xu(e,t){for(var n,i=[],o=2;o0&&this.Zi.ji((function(){return t.Ac()})),n.label=5;case 5:return[2]}}))}))},e.prototype.Ic=function(e){var t=this,n=this.fc.then((function(){return t.yc=!0,e().catch((function(e){throw t.mc=e,t.yc=!1,d("INTERNAL UNHANDLED ERROR: ",function(e){var t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}(e)),e})).then((function(e){return t.yc=!1,e}))}));return this.fc=n,n},e.prototype.enqueueAfterDelay=function(e,t,n){var r=this;this.Tc(),this.gc.indexOf(e)>-1&&(t=0);var i=Ko.createAndSchedule(this,e,t,n,(function(e){return r.Rc(e)}));return this._c.push(i),i},e.prototype.Tc=function(){this.mc&&v()},e.prototype.verifyOperationInProgress=function(){},e.prototype.bc=function(){return Object(a.a)(this,void 0,void 0,(function(){var e;return Object(a.c)(this,(function(t){switch(t.label){case 0:return[4,e=this.fc];case 1:t.sent(),t.label=2;case 2:if(e!==this.fc)return[3,0];t.label=3;case 3:return[2]}}))}))},e.prototype.vc=function(e){for(var t=0,n=this._c;t90)throw new c(s.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new c(s.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}return Object.defineProperty(e.prototype,"latitude",{get:function(){return this._lat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"longitude",{get:function(){return this._long},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){return this._lat===e._lat&&this._long===e._long},e.prototype.toJSON=function(){return{latitude:this._lat,longitude:this._long}},e.prototype._compareTo=function(e){return E(this._lat,e._lat)||E(this._long,e._long)},e}(),Wu=/^__.*__$/,Gu=function(){function e(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}return e.prototype.toMutation=function(e,t){return null!==this.fieldMask?new mt(e,this.data,this.fieldMask,t,this.fieldTransforms):new vt(e,this.data,t,this.fieldTransforms)},e}(),Qu=function(){function e(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}return e.prototype.toMutation=function(e,t){return new mt(e,this.data,this.fieldMask,t,this.fieldTransforms)},e}();function $u(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw v()}}var Yu=function(){function e(e,t,n,r,i,o){this.settings=e,this.databaseId=t,this.R=n,this.ignoreUndefinedProperties=r,void 0===i&&this.Sc(),this.fieldTransforms=i||[],this.fieldMask=o||[]}return Object.defineProperty(e.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Dc",{get:function(){return this.settings.Dc},enumerable:!1,configurable:!0}),e.prototype.Cc=function(t){return new e(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)},e.prototype.Nc=function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Cc({path:n,xc:!1});return r.Fc(e),r},e.prototype.kc=function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Cc({path:n,xc:!1});return r.Sc(),r},e.prototype.Oc=function(e){return this.Cc({path:void 0,xc:!0})},e.prototype.$c=function(e){return vs(e,this.settings.methodName,this.settings.Mc||!1,this.path,this.settings.Lc)},e.prototype.contains=function(e){return void 0!==this.fieldMask.find((function(t){return e.isPrefixOf(t)}))||void 0!==this.fieldTransforms.find((function(t){return e.isPrefixOf(t.field)}))},e.prototype.Sc=function(){if(this.path)for(var e=0;e=0;--y)if(!ms(d,l[y])){var v=l[y],m=f[y];m=Object(r.h)(m);var g=u.kc(v);if(m instanceof es)d.push(v);else{var b=cs(m,g);null!=b&&(d.push(v),p.set(v,b))}}var w=new P(d);return new Qu(p,w,u.fieldTransforms)}function ss(e,t,n,r){return void 0===r&&(r=!1),cs(n,e.Bc(r?4:3,t))}function cs(e,t){if(fs(e=Object(r.h)(e)))return hs("Unsupported field value:",t,e),ls(e,t);if(e instanceof Ku)return function(e,t){if(!$u(t.Dc))throw t.$c(e._methodName+"() can only be used with update() and set()");if(!t.path)throw t.$c(e._methodName+"() is not currently supported inside arrays");var n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.xc&&4!==t.Dc)throw t.$c("Nested arrays are not supported");return function(e,t){for(var n=[],r=0,i=0,o=e;i0&&t.fieldMask.push(t.path):I(e,(function(e,r){var i=cs(r,t.Nc(e));null!=i&&(n[e]=i)})),{mapValue:{fields:n}}}function fs(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof O||e instanceof Hu||e instanceof zu||e instanceof Iu||e instanceof Ku)}function hs(e,t,n){if(!fs(n)||!function(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}(n)){var r=_u(n);throw"an object"===r?t.$c(e+" a custom object"):t.$c(e+" "+r)}}function ds(e,t,n){if((t=Object(r.h)(t))instanceof Bu)return t._internalPath;if("string"==typeof t)return ys(e,t);throw vs("Field path arguments must be of type string or FieldPath.",e,!1,void 0,n)}var ps=new RegExp("[~\\*/\\[\\]]");function ys(e,t,n){if(t.search(ps)>=0)throw vs("Invalid field path ("+t+"). Paths must not contain '~', '*', '/', '[', or ']'",e,!1,void 0,n);try{return(new(Bu.bind.apply(Bu,Object(a.d)([void 0],t.split(".")))))._internalPath}catch(r){throw vs("Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",e,!1,void 0,n)}}function vs(e,t,n,r,i){var o=r&&!r.isEmpty(),a=void 0!==i,u="Function "+t+"() called with invalid data";n&&(u+=" (via `toFirestore()`)");var l="";return(o||a)&&(l+=" (found",o&&(l+=" in field "+r),a&&(l+=" in document "+i),l+=")"),new c(s.INVALID_ARGUMENT,(u+=". ")+e+l)}function ms(e,t){return e.some((function(e){return e.isEqual(t)}))}var gs=function(){function e(e,t,n,r,i){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=r,this._converter=i}return Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new Iu(this._firestore,this._converter,this._key)},enumerable:!1,configurable:!0}),e.prototype.exists=function(){return null!==this._document},e.prototype.data=function(){if(this._document){if(this._converter){var e=new bs(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.toProto())}},e.prototype.get=function(e){if(this._document){var t=this._document.data.field(ws("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}},e}(),bs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.b)(t,e),t.prototype.data=function(){return e.prototype.data.call(this)},t}(gs);function ws(e,t){return"string"==typeof t?ys(e,t):t instanceof Bu?t._internalPath:t._delegate._internalPath}var Es=function(){function e(e,t){this.hasPendingWrites=e,this.fromCache=t}return e.prototype.isEqual=function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache},e}(),_s=function(e){function t(t,n,r,i,o,a){var u=this;return(u=e.call(this,t,n,r,i,a)||this)._firestore=t,u._firestoreImpl=t,u.metadata=o,u}return Object(a.b)(t,e),t.prototype.exists=function(){return e.prototype.exists.call(this)},t.prototype.data=function(e){if(void 0===e&&(e={}),this._document){if(this._converter){var t=new Ss(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.toProto(),e.serverTimestamps)}},t.prototype.get=function(e,t){if(void 0===t&&(t={}),this._document){var n=this._document.data.field(ws("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}},t}(gs),Ss=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.b)(t,e),t.prototype.data=function(t){return void 0===t&&(t={}),e.prototype.data.call(this,t)},t}(_s),Os=function(){function e(e,t,n,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new Es(r.hasPendingWrites,r.fromCache),this.query=n}return Object.defineProperty(e.prototype,"docs",{get:function(){var e=[];return this.forEach((function(t){return e.push(t)})),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this.size},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e,t){var n=this;this._snapshot.docs.forEach((function(r){e.call(t,new Ss(n._firestore,n._userDataWriter,r.key,r,new Es(n._snapshot.mutatedKeys.has(r.key),n._snapshot.fromCache),n.query.converter))}))},e.prototype.docChanges=function(e){void 0===e&&(e={});var t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new c(s.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){var n=0;return e._snapshot.docChanges.map((function(t){var r=new Ss(e._firestore,e._userDataWriter,t.doc.key,t.doc,new Es(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);return t.doc,{type:"added",doc:r,oldIndex:-1,newIndex:n++}}))}var r=e._snapshot.oldDocs;return e._snapshot.docChanges.filter((function(e){return t||3!==e.type})).map((function(t){var n=new Ss(e._firestore,e._userDataWriter,t.doc.key,t.doc,new Es(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),i=-1,o=-1;return 0!==t.type&&(i=r.indexOf(t.doc.key),r=r.delete(t.doc.key)),1!==t.type&&(o=(r=r.add(t.doc)).indexOf(t.doc.key)),{type:Ts(t.type),doc:n,oldIndex:i,newIndex:o}}))}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges},e}();function Ts(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return v()}}function ks(e,t){return e instanceof _s&&t instanceof _s?e._firestore===t._firestore&&e._key.isEqual(t._key)&&(null===e._document?null===t._document:e._document.isEqual(t._document))&&e._converter===t._converter:e instanceof Os&&t instanceof Os&&e._firestore===t._firestore&&Pu(e.query,t.query)&&e.metadata.isEqual(t.metadata)&&e._snapshot.isEqual(t._snapshot)}function Is(e){if(De(e)&&0===e.explicitOrderBy.length)throw new c(s.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var Cs=function(){};function Ns(e){for(var t=[],n=1;n, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+t.field.toString()+"'");var r=Pe(e);null!==r&&Fs(e,t.field,r)}var i=function(e,t){for(var n=0,r=e.filters;n=0)return i.op}return null}(e,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==i)throw i===t.op?new c(s.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+t.op.toString()+"' filter."):new c(s.INVALID_ARGUMENT,"Invalid query. You cannot use '"+t.op.toString()+"' filters with '"+i.toString()+"' filters.")}(e,p),p}(e._query,0,t,e.firestore._databaseId,this.Qc,this.Kc,this.jc);return new Cu(e.firestore,e.converter,function(e,t){var n=e.filters.concat([t]);return new Ce(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}(e._query,n))},t}(Cs),As=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).Qc=t,r.Wc=n,r.type="orderBy",r}return Object(a.b)(t,e),t.prototype._apply=function(e){var t=function(e,t,n){if(null!==e.startAt)throw new c(s.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new c(s.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new Oe(t,n);return function(e,t){if(null===Pe(e)){var n=je(e);null!==n&&Fs(e,n,t.field)}}(e,r),r}(e._query,this.Qc,this.Wc);return new Cu(e.firestore,e.converter,function(e,t){var n=e.explicitOrderBy.concat([t]);return new Ce(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))},t}(Cs),Ds=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).type=t,i.Gc=n,i.zc=r,i}return Object(a.b)(t,e),t.prototype._apply=function(e){return new Cu(e.firestore,e.converter,Fe(e._query,this.Gc,this.zc))},t}(Cs),Ps=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).type=t,i.Hc=n,i.Jc=r,i}return Object(a.b)(t,e),t.prototype._apply=function(e){var t=Rs(e,this.type,this.Hc,this.Jc);return new Cu(e.firestore,e.converter,function(e,t){return new Ce(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,t,e.endAt)}(e._query,t))},t}(Cs),js=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).type=t,i.Hc=n,i.Jc=r,i}return Object(a.b)(t,e),t.prototype._apply=function(e){var t=Rs(e,this.type,this.Hc,this.Jc);return new Cu(e.firestore,e.converter,function(e,t){return new Ce(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,t)}(e._query,t))},t}(Cs);function Rs(e,t,n,i){if(n[0]=Object(r.h)(n[0]),n[0]instanceof gs)return function(e,t,n,r,i){if(!r)throw new c(s.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],a=0,u=Le(e);aa.length)throw new c(s.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var u=[],l=0;l10)throw new c(s.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters support a maximum of 10 elements in the value array.")}function Fs(e,t,n){if(!n.isEqual(t))throw new c(s.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '"+t.toString()+"' and so you must also use '"+t.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}var Us=function(){function e(){}return e.prototype.convertValue=function(e,t){switch(void 0===t&&(t="none"),W(e)){case 0:return null;case 1:return e.booleanValue;case 2:return M(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(F(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 10:return this.convertObject(e.mapValue,t);default:throw v()}},e.prototype.convertObject=function(e,t){var n=this,r={};return I(e.fields||{},(function(e,i){r[e]=n.convertValue(i,t)})),r},e.prototype.convertGeoPoint=function(e){return new Hu(M(e.latitude),M(e.longitude))},e.prototype.convertArray=function(e,t){var n=this;return(e.values||[]).map((function(e){return n.convertValue(e,t)}))},e.prototype.convertServerTimestamp=function(e,t){switch(t){case"previous":var n=V(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(q(e));default:return null}},e.prototype.convertTimestamp=function(e){var t=L(e);return new O(t.seconds,t.nanos)},e.prototype.convertDocumentKey=function(e,t){var n=x.fromString(e);m(An(n));var r=new cu(n.get(1),n.get(3)),i=new H(n.popFirst(5));return r.isEqual(t)||d("Document "+i+" contains a document reference within a different database ("+r.projectId+"/"+r.database+") which is not supported. It will be treated as a reference in the current database ("+t.projectId+"/"+t.database+") instead."),i},e}();function Vs(e,t,n){return e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t}var qs=function(e){function t(t){var n=this;return(n=e.call(this)||this).firestore=t,n}return Object(a.b)(t,e),t.prototype.convertBytes=function(e){return new zu(e)},t.prototype.convertReference=function(e){var t=this.convertDocumentKey(e,this.firestore._databaseId);return new Iu(this.firestore,null,t)},t}(Us),Bs=function(){function e(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=Ju(e)}return e.prototype.set=function(e,t,n){this._verifyNotCommitted();var r=zs(e,this._firestore),i=Vs(r.converter,t,n),o=Zu(this._dataReader,"WriteBatch.set",r._key,i,null!==r.converter,n);return this._mutations.push(o.toMutation(r._key,st.none())),this},e.prototype.update=function(e,t,n){for(var i=[],o=3;o0?this._commitHandler(this._mutations):Promise.resolve()},e.prototype._verifyNotCommitted=function(){if(this._committed)throw new c(s.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},e}();function zs(e,t){if((e=Object(r.h)(e)).firestore!==t)throw new c(s.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}var Ks=function(e){function t(t){var n=this;return(n=e.call(this)||this).firestore=t,n}return Object(a.b)(t,e),t.prototype.convertBytes=function(e){return new zu(e)},t.prototype.convertReference=function(e){var t=this.convertDocumentKey(e,this.firestore._databaseId);return new Iu(this.firestore,null,t)},t}(Us);function Hs(e,t,n){for(var i=[],o=3;o=0)throw new c(s.INVALID_ARGUMENT,"Invalid collection ID '"+t+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new Cu(e,null,function(e){return new Ce(x.emptyPath(),e)}(t))}(this._delegate,e))}catch(e){throw uc(e,"collectionGroup()","Firestore.collectionGroup()")}},e.prototype.runTransaction=function(e){var t=this;return function(e,t){return function(e,t){var n=this,r=new tr;return e.asyncQueue.enqueueAndForget((function(){return Object(a.a)(n,void 0,void 0,(function(){var n;return Object(a.c)(this,(function(i){switch(i.label){case 0:return[4,function(e){return eu(e).then((function(e){return e.datastore}))}(e)];case 1:return n=i.sent(),new $a(e.asyncQueue,n,t,r).run(),[2]}}))}))})),r.promise}(Fu(e),(function(n){return t(new $s(e,n))}))}(this._delegate,(function(n){return e(new rc(t,n))}))},e.prototype.batch=function(){var e=this;return Fu(this._delegate),new ic(new Bs(this._delegate,(function(t){return Gs(e._delegate,t)})))},e.prototype.loadBundle=function(e){throw new c(s.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?')},e.prototype.namedQuery=function(e){throw new c(s.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?')},e}(),tc=function(e){function t(t){var n=this;return(n=e.call(this)||this).firestore=t,n}return Object(a.b)(t,e),t.prototype.convertBytes=function(e){return new Js(new zu(e))},t.prototype.convertReference=function(e){var t=this.convertDocumentKey(e,this.firestore._databaseId);return ac.Zc(t,this.firestore,null)},t}(Us);function nc(e){var t;t=e,l.setLogLevel(t)}var rc=function(){function e(e,t){this._firestore=e,this._delegate=t,this._userDataWriter=new tc(e)}return e.prototype.get=function(e){var t=this,n=vc(e);return this._delegate.get(n).then((function(e){return new lc(t._firestore,new _s(t._firestore._delegate,t._userDataWriter,e._key,e._document,e.metadata,n.converter))}))},e.prototype.set=function(e,t,n){var r=vc(e);return n?(gu("Transaction.set",n),this._delegate.set(r,t,n)):this._delegate.set(r,t),this},e.prototype.update=function(e,t,n){for(var r,i=[],o=3;o=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var o,a="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{},u=u||{},s=a||self;function c(){}function l(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function f(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var h="closure_uid_"+(1e9*Math.random()>>>0),d=0;function p(e,t,n){return e.call.apply(e.bind,arguments)}function y(e,t,n){if(!e)throw Error();if(2t?1:0}e:{var x=s.navigator;if(x){var A=x.userAgent;if(A){k=A;break e}}k=""}function D(e,t,n){for(var r in e)t.call(n,e[r],r,e)}function P(e){var t={};for(var n in e)t[n]=e[n];return t}var j="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function R(e,t){for(var n,r,i=1;iparseFloat(H)){M=String(G);break e}}M=H}var Q,$={};function Y(e){return function(e,t){var n=$;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,(function(){for(var t=0,n=I(String(M)).split("."),r=I(String(e)).split("."),i=Math.max(n.length,r.length),o=0;0==t&&o=e.keyCode)&&(e.keyCode=-1)}catch(t){}};var oe="closure_listenable_"+(1e6*Math.random()|0),ae=0;function ue(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ca=i,this.key=++ae,this.Y=this.Z=!1}function se(e){e.Y=!0,e.listener=null,e.proxy=null,e.src=null,e.ca=null}function ce(e){this.src=e,this.a={},this.b=0}function le(e,t){var n=t.type;if(n in e.a){var r,i=e.a[n],o=E(i,t);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(se(t),0==e.a[n].length&&(delete e.a[n],e.b--))}}function fe(e,t,n,r){for(var i=0;i>>0);function Oe(e){return"function"===typeof e?e:(e[Se]||(e[Se]=function(t){return e.handleEvent(t)}),e[Se])}function Te(){w.call(this),this.c=new ce(this),this.J=this,this.C=null}function ke(e,t){var n,r=e.C;if(r)for(n=[];r;r=r.C)n.push(r);if(e=e.J,r=t.type||t,"string"===typeof t)t=new ne(t,e);else if(t instanceof ne)t.target=t.target||e;else{var i=t;R(t=new ne(r,e),i)}if(i=!0,n)for(var o=n.length-1;0<=o;o--){var a=t.a=n[o];i=Ie(a,r,!0,t)&&i}if(i=Ie(a=t.a=e,r,!0,t)&&i,i=Ie(a,r,!1,t)&&i,n)for(o=0;ot.b&&(t.b++,e.next=t.a,t.a=e)}Le=!1}function Ue(e,t){Te.call(this),this.b=e||1,this.a=t||s,this.f=v(this.Za,this),this.g=g()}function Ve(e){e.aa=!1,e.M&&(e.a.clearTimeout(e.M),e.M=null)}function qe(e,t,n){if("function"===typeof e)n&&(e=v(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=v(e.handleEvent,e)}return 2147483647r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var a=1;at.length?gt:(t=t.substr(r,n),e.D=r+n,t))}function St(e){e.T=g()+e.P,Ot(e,e.P)}function Ot(e,t){if(null!=e.o)throw Error("WatchDog timer not null");e.o=it(v(e.Va,e),t)}function Tt(e){e.o&&(s.clearTimeout(e.o),e.o=null)}function kt(e){0==e.g.v||e.A||Kn(e.g,e)}function It(e){Tt(e);var t=e.F;t&&"function"==typeof t.ja&&t.ja(),e.F=null,Ve(e.R),Ge(e.J),e.a&&(t=e.a,e.a=null,t.abort(),t.ja())}function Ct(e,t){try{var n=e.g;if(0!=n.v&&(n.a==e||sn(n.b,e)))if(n.I=e.N,!e.C&&sn(n.b,e)&&3==n.v){try{var r=n.ka.a.parse(t)}catch(m){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.j){if(n.a){if(!(n.a.u+3e3i[2]&&n.H&&0==n.o&&!n.m&&(n.m=it(v(n.Sa,n),6e3));if(1>=un(n.b)&&n.ea){try{n.ea()}catch(m){}n.ea=void 0}}else Wn(n,11)}else if((e.C||n.a==e)&&zn(n),!T(t))for(t=r=n.ka.a.parse(t),r=0;rt||3==t&&!q&&!this.a.$())){this.A||4!=t||7==n||et(8==n||0>=r?3:2),Tt(this);var i=this.a.W();this.N=i;var o=this.a.$();if(this.b=200==i,function(e,t,n,r,i,o,a){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+o+" "+a}))}(this.c,this.m,this.l,this.f,this.S,t,i),this.b){if(this.U&&!this.C){t:{if(this.a){var a,u=this.a;if((a=u.a?u.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!T(a)){var s=a;break t}}s=null}if(!s){this.b=!1,this.h=3,nt(12),It(this),kt(this);break e}$e(this.c,this.f,s,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,Ct(this,s)}this.I?(Et(this,t,o),q&&this.b&&3==t&&(We(this.J,this.R,"tick",this.Wa),this.R.start())):($e(this.c,this.f,o,null),Ct(this,o)),4==t&&It(this),this.b&&!this.A&&(4==t?Kn(this.g,this):(this.b=!1,St(this)))}else 400==i&&0t)throw Error("Bad port number "+t);e.h=t}else e.h=null}function Ut(e,t,n){t instanceof Yt?(e.b=t,function(e,t){t&&!e.f&&(Xt(e),e.c=null,e.a.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Jt(this,t),en(this,n,e))}),e)),e.f=t}(e.b,e.a)):(n||(t=zt(t,Qt)),e.b=new Yt(t,e.a))}function Vt(e,t,n){e.b.set(t,n)}function qt(e){return Vt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^g()).toString(36)),e}function Bt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function zt(e,t,n){return"string"===typeof e?(e=encodeURI(e).replace(t,Kt),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Kt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}jt.prototype.toString=function(){var e=[],t=this.f;t&&e.push(zt(t,Ht,!0),":");var n=this.c;return(n||"file"==t)&&(e.push("//"),(t=this.j)&&e.push(zt(t,Ht,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&e.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&e.push("/"),e.push(zt(n,"/"==n.charAt(0)?Gt:Wt,!0))),(n=this.b.toString())&&e.push("?",n),(n=this.i)&&e.push("#",zt(n,$t)),e.join("")};var Ht=/[#\/\?@]/g,Wt=/[#\?:]/g,Gt=/[#\?]/g,Qt=/[#\?@]/g,$t=/#/g;function Yt(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function Xt(e){e.a||(e.a=new xt,e.b=0,e.c&&function(e,t){if(e){e=e.split("&");for(var n=0;n2*e.c&&At(e)))}function Zt(e,t){return Xt(e),t=tn(e,t),Dt(e.a.b,t)}function en(e,t,n){Jt(e,t),0=e.f}function un(e){return e.b?1:e.a?e.a.size:0}function sn(e,t){return e.b?e.b==t:!!e.a&&e.a.has(t)}function cn(e,t){e.a?e.a.add(t):e.b=t}function ln(e,t){e.b&&e.b==t?e.b=null:e.a&&e.a.has(t)&&e.a.delete(t)}function fn(e){var t,n;if(null!=e.b)return e.c.concat(e.b.s);if(null!=e.a&&0!==e.a.size){var r=e.c;try{for(var o=i(e.a.values()),a=o.next();!a.done;a=o.next()){var u=a.value;r=r.concat(u.s)}}catch(s){t={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}return O(e.c)}function hn(){}function dn(){this.a=new hn}function pn(e,t,n){var r=n||"";try{Nt(e,(function(e,n){var i=e;f(e)&&(i=Ce(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(i){throw t.push(r+"type="+encodeURIComponent("_badmap")),i}}function yn(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(o){}}rn.prototype.cancel=function(){var e,t;if(this.c=fn(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=i(this.a.values()),r=n.next();!r.done;r=n.next()){r.value.cancel()}}catch(o){e={error:o}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.a.clear()}},hn.prototype.stringify=function(e){return s.JSON.stringify(e,void 0)},hn.prototype.parse=function(e){return s.JSON.parse(e,void 0)};var vn=s.JSON.parse;function mn(e){Te.call(this),this.headers=new xt,this.H=e||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=gn,this.D=this.F=!1}b(mn,Te);var gn="",bn=/^https?$/i,wn=["POST","PUT"];function En(e){return"content-type"==e.toLowerCase()}function _n(e,t){e.b=!1,e.a&&(e.g=!0,e.a.abort(),e.g=!1),e.f=t,e.h=5,Sn(e),Tn(e)}function Sn(e){e.u||(e.u=!0,ke(e,"complete"),ke(e,"error"))}function On(e){if(e.b&&"undefined"!=typeof u&&(!e.s[1]||4!=In(e)||2!=e.W()))if(e.l&&4==In(e))qe(e.za,0,e);else if(ke(e,"readystatechange"),4==In(e)){e.b=!1;try{var t,n=e.W();e:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break e;default:r=!1}if(!(t=r)){var i;if(i=0===n){var o=String(e.B).match(Pt)[1]||null;if(!o&&s.self&&s.self.location){var a=s.self.location.protocol;o=a.substr(0,a.length-1)}i=!bn.test(o?o.toLowerCase():"")}t=i}if(t)ke(e,"complete"),ke(e,"success");else{e.h=6;try{var c=2(c-=o))o=Math.max(0,i[s].b-100),u=!1;else try{pn(l,a,"req"+c+"_")}catch(f){r&&r(l)}}if(u){r=a.join("&");break e}}return e=e.g.splice(0,n),t.s=e,r}function Un(e){e.a||e.j||(e.T=1,Re(e.Aa,e),e.o=0)}function Vn(e){return!(e.a||e.j||3<=e.o)&&(e.T++,e.j=it(v(e.Aa,e),Hn(e,e.o)),e.o++,!0)}function qn(e){null!=e.s&&(s.clearTimeout(e.s),e.s=null)}function Bn(e){e.a=new yt(e,e.c,"rpc",e.T),null===e.i&&(e.a.B=e.l),e.a.O=0;var t=Rt(e.la);Vt(t,"RID","rpc"),Vt(t,"SID",e.J),Vt(t,"CI",e.H?"0":"1"),Vt(t,"AID",e.P),Mn(e,t),Vt(t,"TYPE","xmlhttp"),e.i&&e.l&&Cn(t,e.i,e.l),e.D&&e.a.setTimeout(e.D);var n=e.a;e=e.ga,n.H=1,n.i=qt(Rt(t)),n.j=null,n.I=!0,wt(n,e)}function zn(e){null!=e.m&&(s.clearTimeout(e.m),e.m=null)}function Kn(e,t){var n=null;if(e.a==t){zn(e),qn(e),e.a=null;var r=2}else{if(!sn(e.b,t))return;n=t.s,ln(e.b,t),r=1}if(e.I=t.N,0!=e.v)if(t.b)if(1==r){n=t.j?t.j.length:0,t=g()-t.u;var i=e.u;ke(r=Je(),new rt(r,n,t,i)),Rn(e)}else Un(e);else if(3==(i=t.h)||0==i&&0=e.b.f-(e.h?1:0))&&(e.h?(e.g=t.s.concat(e.g),!0):!(1==e.v||2==e.v||e.u>=(e.La?0:e.Ma))&&(e.h=it(v(e.Ba,e,t),Hn(e,e.u)),e.u++,!0))}(e,t)||2==r&&Vn(e)))switch(n&&0t?null:"string"===typeof e?e.charAt(t):e[t]}(i.L()),n=s.FormData&&e instanceof s.FormData,!(0<=E(wn,t))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(e,t){this.a.setRequestHeader(t,e)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{kn(this),0=this.N)){var e=2*this.N;this.c.info("BP detection timer enabled: "+e),this.s=it(v(this.Ta,this),e)}},o.Ta=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,nt(10),Dn(this),Bn(this))},o.Sa=function(){null!=this.m&&(this.m=null,Dn(this),Vn(this),nt(19))},o.Ya=function(e){e?(this.c.info("Successfully pinged google.com"),nt(2)):(this.c.info("Failed to ping google.com"),nt(1))},(o=Yn.prototype).ta=function(){},o.sa=function(){},o.ra=function(){},o.qa=function(){},o.Ja=function(){},Xn.prototype.a=function(e,t){return new Jn(e,t)},b(Jn,Te),Jn.prototype.g=function(){this.a.f=this.f,this.m&&(this.a.C=!0);var e=this.a,t=this.o,n=this.b||void 0;nt(0),e.fa=t,e.V=n||{},e.H=e.S,e.B=Qn(e,null,e.fa),Rn(e)},Jn.prototype.close=function(){An(this.a)},Jn.prototype.h=function(e){if("string"===typeof e){var t={};t.__data__=e,jn(this.a,t)}else this.l?((t={}).__data__=Ce(e),jn(this.a,t)):jn(this.a,e)},Jn.prototype.G=function(){this.a.f=null,delete this.f,An(this.a),delete this.a,Jn.X.G.call(this)},b(Zn,ht),b(er,dt),b(tr,Yn),tr.prototype.ta=function(){ke(this.a,"a")},tr.prototype.sa=function(e){ke(this.a,new Zn(e))},tr.prototype.ra=function(e){ke(this.a,new er(e))},tr.prototype.qa=function(){ke(this.a,"b")},Xn.prototype.createWebChannel=Xn.prototype.a,Jn.prototype.send=Jn.prototype.h,Jn.prototype.open=Jn.prototype.g,Jn.prototype.close=Jn.prototype.close,ot.NO_ERROR=0,ot.TIMEOUT=8,ot.HTTP_ERROR=6,at.COMPLETE="complete",ct.EventType=ft,ft.OPEN="a",ft.CLOSE="b",ft.ERROR="c",ft.MESSAGE="d",Te.prototype.listen=Te.prototype.va,mn.prototype.listenOnce=mn.prototype.wa,mn.prototype.getLastError=mn.prototype.Qa,mn.prototype.getLastErrorCode=mn.prototype.ua,mn.prototype.getStatus=mn.prototype.W,mn.prototype.getResponseJson=mn.prototype.Pa,mn.prototype.getResponseText=mn.prototype.$,mn.prototype.send=mn.prototype.ba;var nr=function(){return new Xn},rr=function(){return Je()},ir=ot,or=at,ar=Ye,ur={gb:0,jb:1,kb:2,Db:3,Ib:4,Fb:5,Gb:6,Eb:7,Cb:8,Hb:9,PROXY:10,NOPROXY:11,Ab:12,wb:13,xb:14,vb:15,yb:16,zb:17,bb:18,ab:19,cb:20},sr=ct,cr=mn}).call(this,n(22))},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t=(null!==r&&void 0!==r?r:t.logLevel)&&e({level:o[n].toLowerCase(),message:u,args:i,type:t.name})}},r=0,i=a;r=0||(i[n]=e[n]);return i}var c=["onClick","replace","state","target","to"];function l(e){var t=e.basename,n=e.children,u=e.window,s=Object(i.useRef)();null==s.current&&(s.current=Object(o.b)({window:u}));var c=s.current,l=Object(i.useState)({action:c.action,location:c.location}),f=Object(r.a)(l,2),h=f[0],d=f[1];return Object(i.useLayoutEffect)((function(){return c.listen(d)}),[c]),Object(i.createElement)(a.b,{basename:t,children:n,action:h.action,location:h.location,navigator:c})}var f=Object(i.forwardRef)((function(e,t){var n=e.onClick,r=e.replace,l=void 0!==r&&r,f=e.state,h=e.target,d=e.to,p=s(e,c),y=Object(a.d)(d),v=function(e,t){var n=void 0===t?{}:t,r=n.target,u=n.replace,s=n.state,c=Object(a.f)(),l=Object(a.e)(),f=Object(a.h)(e);return Object(i.useCallback)((function(t){if(0===t.button&&(!r||"_self"===r)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t)){t.preventDefault();var n=!!u||Object(o.e)(l)===Object(o.e)(f);c(e,{replace:n,state:s})}}),[l,c,f,u,s,r,e])}(d,{replace:l,state:f,target:h});return Object(i.createElement)("a",u({},p,{href:y,onClick:function(e){n&&n(e),e.defaultPrevented||v(e)},ref:t,target:h}))}))},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(u){i={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i=0&&p.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 ")}var b=v.initializeApp;v.initializeApp=function(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n