vzcode 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,16 +1,85 @@
1
1
  # VZCode
2
+
2
3
  Multiplayer code editor system
3
4
 
4
- * Open source code editor for JavaScript
5
- * Support for real-time collaboration
6
- * Focus on instant feedback during development
7
- * Built on open source: CodeMirror, NodeJS, ShareDB
8
- * Core component of [VizHub](https://vizhub.com/) next generation editor
5
+ [Kanban](https://github.com/orgs/vizhub-core/projects/2/views/1)
6
+
7
+ ## Project Description
8
+
9
+ - Open source code editor for JavaScript, HTML, CSS, and Markdown
10
+ - Support for real-time collaboration
11
+ - Invite collaborators over LAN or HTTP Tunneing
12
+ - Focus on instant feedback during development
13
+ - Core component of [VizHub](https://vizhub.com/) next generation editor
14
+
15
+ ## Stack
16
+
17
+ - [NodeJS](https://nodejs.org/en/)
18
+ - [Express](https://expressjs.com/)
19
+ - [ShareDB](https://github.com/share/sharedb)
20
+ - [JSON1 Operational Transform](https://github.com/ottypes/json1)
21
+ - [CodeMirror 6](https://codemirror.net/)
22
+ - [React](https://reactjs.org/)
23
+ - [Vite](https://vitejs.dev/)
9
24
 
10
- Just getting started here! Nothing in this repo yet... but there is a working demo at https://vizhub.community/ci/viz1 (try it in multiple tabs to see the real-time sync), whose source code lives at https://github.com/vizhub-core/vizhub/tree/main/vizhub-v3 . Also we'll draw from this standalone CodeMirror6 collaboration demo: https://github.com/vizhub-core/vizhub/tree/main/vizhub-v3/vizhub-codemirror. For this project we'll port components out of that demo so that the code editor is totally independent and isolated from anything specific to VizHub.
25
+ ## Goals
26
+
27
+ - Create a usable alternative to VSCode + Live Share for use in front end development
28
+ - Enable developers to "enable" the VSCode editor on their projects via NPM
29
+ - Have the `npm run edit` command start a local server
30
+ - Develop a sidebar panel that lists files in the file system
31
+ - Develop a code editor panel using CodeMirror that lets users navigate between files
32
+ - Have the server auto-save files to disk when changes are made
33
+ - Synchronize code edits across multiple clients using Operational Transform (JSON1 and ShareDB)
34
+ - Ensure that the editor works well on top of the Vite dev server
35
+ - Dogfood the product to identify ways it can be improved
36
+ - Iterate based on feedback
37
+ - Share the project with the world
38
+
39
+ ## Prior Work
40
+
41
+ This project is heavily based on prior work done in the [VizHub Project](https://github.com/vizhub-core/vizhub/). VizHub already has a code editor component that supports real-time collaboration. However, this was built using older versions of [CodeMirror](https://codemirror.net/5/) (version 5) and operational transform ([json0](https://github.com/ottypes/json0). Various prototypes were built as a proof-of-concept for building a similar editor using the latest CodeMirror (v6) and the latest operational transform library for ShareDB (json1).
42
+
43
+ There is a working demo at https://vizhub.community/ci/viz1 (try it in multiple tabs to see the real-time sync), whose source code lives at https://github.com/vizhub-core/vizhub/tree/main/vizhub-v3 . Also we'll draw from this standalone CodeMirror6 collaboration demo: https://github.com/vizhub-core/vizhub/tree/main/vizhub-v3/vizhub-codemirror. For this project we'll port components out of that demo so that the code editor is totally independent and isolated from anything specific to VizHub.
11
44
 
12
45
  ![image](https://user-images.githubusercontent.com/68416/213894278-51c7c9a9-dc11-42bc-ba10-c23109c473cd.png)
13
46
 
14
47
  It will look something like this ☝️ once it's working. This VZCode project will draw inspiration (and possibly implementation) from the existing open source editor component of VizHub, and various prototypes that have been done with CodeMirror6.
15
48
 
16
- Collaborators welcome! I'm holding a meeting on Monday January 23 at 2pm Eastern (Video call link: https://meet.google.com/ajx-nmpx-ygt), feel free to drop in if you have any interest in collaborating on this project or providing input!
49
+ ## Milestones
50
+
51
+ See also [VZCode Kanban Board](https://github.com/orgs/vizhub-core/projects/2/views/1).
52
+
53
+ February 2023
54
+
55
+ - Get the first version working, including:
56
+ - ShareDB server
57
+ - Auto-save
58
+ - Edit the content of multiple files (no support for folders initially)
59
+
60
+ March 2023
61
+
62
+ - Make it usable, including:
63
+ - UX for adding new files, renaming files, deleting files
64
+ - Implement presence (the ability to see the cursors of others in real time)
65
+ - Test out how it works using tunneling services such as NGrok
66
+
67
+ April 2023
68
+
69
+ - Add support for nested directories, including:
70
+ - Develop a tree-based sidebar UI allowing directory navigation
71
+ - Dogfood the product and try to collaboratively develop something, maybe a data visualization
72
+ - Gather feedback from early users and iterate based on that
73
+ - Publish a YouTube video presentation of the work to date
74
+
75
+ ## Team
76
+
77
+ - Curran Kelleher
78
+ - Students from [RPI RCOS](https://rcos.io/)
79
+ - Additional external collaborators, TBD
80
+ - Drop a line to Curran if interested in collaborating on this!
81
+
82
+ ## Spaces
83
+
84
+ - https://github.com/vizhub-core/vzcode
85
+ - [Discord channel within RCOS](https://discord.com/channels/738593165438746634/1066068656045441044)
package/cli.js CHANGED
@@ -1,2 +1,67 @@
1
1
  #!/usr/bin/env node
2
+ import http from 'http';
3
+ import express from 'express';
4
+ import ShareDB from 'sharedb';
5
+ import json1 from 'ot-json1';
6
+ import { WebSocketServer } from 'ws';
7
+ import WebSocketJSONStream from '@teamwork/websocket-json-stream';
8
+ import fs from 'fs';
9
+ import path from 'path';
10
+ import { fileURLToPath } from 'url';
11
+
12
+ const fullPath = process.cwd();
13
+
14
+ // Isolate files, not directories.
15
+ // Inspired by https://stackoverflow.com/questions/41472161/fs-readdir-ignore-directories
16
+ const files = fs
17
+ .readdirSync(fullPath, { withFileTypes: true })
18
+ .filter((dirent) => dirent.isFile())
19
+ .map((dirent) => dirent.name);
20
+
21
+ // Compute our initial document by reading the file system.
22
+ const initialDocument = {};
23
+ files.forEach((file) => {
24
+ const id = Math.floor(Math.random() * 10000000000);
25
+ initialDocument[id] = {
26
+ text: fs.readFileSync(file, 'utf-8'),
27
+ name: file,
28
+ };
29
+ });
30
+
2
31
  console.log('Welcome to VZCode!');
32
+
33
+ ShareDB.types.register(json1.type);
34
+
35
+ const app = express();
36
+ const port = 3030;
37
+
38
+ const shareDBBackend = new ShareDB();
39
+ const shareDBConnection = shareDBBackend.connect();
40
+ const server = http.createServer(app);
41
+ const wss = new WebSocketServer({ server });
42
+
43
+ wss.on('connection', (ws) => {
44
+ shareDBBackend.listen(new WebSocketJSONStream(ws));
45
+ });
46
+
47
+ // app.get('/', (req, res) => {
48
+ // res.send('Hello World!');
49
+ // });
50
+
51
+ // Serve static files
52
+ const __filename = fileURLToPath(import.meta.url);
53
+ const __dirname = path.dirname(__filename);
54
+ const dir = path.join(__dirname, '/dist');
55
+
56
+ app.use(express.static(dir));
57
+
58
+ // Create initial document
59
+ // TODO
60
+ // * figure out how to list files on disk with NodeJS
61
+ // * use that list to populate the files in our document.
62
+ const shareDBDoc = shareDBConnection.get('documents', '1');
63
+ shareDBDoc.create(initialDocument, json1.type.uri);
64
+
65
+ server.listen(port, () => {
66
+ console.log(`Editor is live at http://localhost:${port}`);
67
+ });
@@ -0,0 +1 @@
1
+ @import"https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap";@import"https://unpkg.com/boxicons@2.0.7/css/boxicons.min.css";*{margin:0;padding:0;box-sizing:border-box;font-family:Poppins,sans-serif}body{background:rgb(34,34,34)}.TextEdit{position:fixed;margin-top:30px;margin-left:200px;width:100%;height:100%;top:30px;bottom:0}.tabList{position:fixed;top:0;left:0;height:30px;width:100%;background:rgb(25,25,25);z-index:100;transition:all .5s ease}.bottomBar{position:absolute;bottom:0;left:0;height:20px;width:100%;background:rgb(45,45,45);z-index:100;transition:all .5s ease}.sidebar{position:fixed;top:0;left:0;height:100%;width:200px;background:rgb(92,92,92);z-index:100;transition:all .5s ease}.sidebar.close{width:78px}.sidebar .nav-links{height:100%;padding:0 0 150px;overflow:auto}.sidebar.close .nav-links{overflow:visible}.sidebar .nav-links::-webkit-scrollbar{display:none}.sidebar .nav-links li{position:relative;list-style:none;transition:all .4s ease}.sidebar .nav-links li:hover{background:rgb(92,92,92)}.sidebar .nav-links li .icon-link{display:flex;align-items:center;justify-content:space-between}.sidebar.close .nav-links li .icon-link{display:block}.sidebar .nav-links li i{height:50px;min-width:78px;text-align:center;line-height:50px;color:#fff;font-size:20px;cursor:pointer;transition:all .3s ease}.sidebar .nav-links li.showMenu i.arrow{transform:rotate(-180deg)}.sidebar.close .nav-links i.arrow{display:none}.sidebar .nav-links li a{display:flex;align-items:center;text-decoration:none}.sidebar .nav-links li a .link_name{font-size:18px;font-weight:400;color:#fff;transition:all .4s ease}.sidebar.close .nav-links li a .link_name{opacity:0;pointer-events:none}.sidebar .nav-links li .sub-menu{padding:6px 6px 14px 80px;margin-top:-10px;background:rgb(92,92,92);display:none}.sidebar .nav-links li.showMenu .sub-menu{display:block}.sidebar .nav-links li .sub-menu a{color:#fff;font-size:15px;padding:5px 0;white-space:nowrap;opacity:.6;transition:all .3s ease}.sidebar .nav-links li .sub-menu a:hover{opacity:1}.sidebar.close .nav-links li .sub-menu{position:absolute;left:100%;top:-10px;margin-top:0;padding:10px 20px;border-radius:0 6px 6px 0;opacity:0;display:block;pointer-events:none;transition:0s}.sidebar.close .nav-links li:hover .sub-menu{top:0;opacity:1;pointer-events:auto;transition:all .4s ease}.sidebar .nav-links li .sub-menu .link_name{display:none}.sidebar.close .nav-links li .sub-menu .link_name{font-size:18px;opacity:1;display:block}.sidebar .nav-links li .sub-menu.blank{opacity:1;pointer-events:auto;padding:3px 20px 6px 16px;opacity:0;pointer-events:none}.sidebar .nav-links li:hover .sub-menu.blank{top:50%;transform:translateY(-50%)}.sidebar .profile-details{position:fixed;bottom:0;width:200px;display:flex;align-items:center;justify-content:space-between;background:rgb(92,92,92);padding:12px 0;transition:all .5s ease}.sidebar.close .profile-details{background:none}.sidebar.close .profile-details{width:78px}.sidebar .profile-details .profile-content{display:flex;align-items:center}.sidebar .profile-details img{height:52px;width:52px;object-fit:cover;border-radius:16px;margin:0 14px 0 12px;background:rgb(92,92,92);transition:all .5s ease}.sidebar.close .profile-details img{padding:10px}.sidebar .profile-details .profile_name,.sidebar .profile-details .job{color:#fff;font-size:18px;font-weight:500;white-space:nowrap}.sidebar .profile-details .job{font-size:12px}.sidebar.close~.home-section{left:78px;width:calc(100% - 78px)}
@@ -0,0 +1,40 @@
1
+ function uf(Z,Ke){for(var N=0;N<Ke.length;N++){const lt=Ke[N];if(typeof lt!="string"&&!Array.isArray(lt)){for(const Ie in lt)if(Ie!=="default"&&!(Ie in Z)){const Ve=Object.getOwnPropertyDescriptor(lt,Ie);Ve&&Object.defineProperty(Z,Ie,Ve.get?Ve:{enumerable:!0,get:()=>lt[Ie]})}}}return Object.freeze(Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"}))}(function(){const Ke=document.createElement("link").relList;if(Ke&&Ke.supports&&Ke.supports("modulepreload"))return;for(const Ie of document.querySelectorAll('link[rel="modulepreload"]'))lt(Ie);new MutationObserver(Ie=>{for(const Ve of Ie)if(Ve.type==="childList")for(const gt of Ve.addedNodes)gt.tagName==="LINK"&&gt.rel==="modulepreload"&&lt(gt)}).observe(document,{childList:!0,subtree:!0});function N(Ie){const Ve={};return Ie.integrity&&(Ve.integrity=Ie.integrity),Ie.referrerpolicy&&(Ve.referrerPolicy=Ie.referrerpolicy),Ie.crossorigin==="use-credentials"?Ve.credentials="include":Ie.crossorigin==="anonymous"?Ve.credentials="omit":Ve.credentials="same-origin",Ve}function lt(Ie){if(Ie.ep)return;Ie.ep=!0;const Ve=N(Ie);fetch(Ie.href,Ve)}})();var ks=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cc(Z){return Z&&Z.__esModule&&Object.prototype.hasOwnProperty.call(Z,"default")?Z.default:Z}function sf(Z){if(Z.__esModule)return Z;var Ke=Z.default;if(typeof Ke=="function"){var N=function lt(){if(this instanceof lt){var Ie=[null];Ie.push.apply(Ie,arguments);var Ve=Function.bind.apply(Ke,Ie);return new Ve}return Ke.apply(this,arguments)};N.prototype=Ke.prototype}else N={};return Object.defineProperty(N,"__esModule",{value:!0}),Object.keys(Z).forEach(function(lt){var Ie=Object.getOwnPropertyDescriptor(Z,lt);Object.defineProperty(N,lt,Ie.get?Ie:{enumerable:!0,get:function(){return Z[lt]}})}),N}var Ls={},Df={get exports(){return Ls},set exports(Z){Ls=Z}},Ns={},oo={},Mf={get exports(){return oo},set exports(Z){oo=Z}},tt={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var ef;function xf(){if(ef)return tt;ef=1;var Z=Symbol.for("react.element"),Ke=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),lt=Symbol.for("react.strict_mode"),Ie=Symbol.for("react.profiler"),Ve=Symbol.for("react.provider"),gt=Symbol.for("react.context"),Nt=Symbol.for("react.forward_ref"),nt=Symbol.for("react.suspense"),Be=Symbol.for("react.memo"),on=Symbol.for("react.lazy"),Ft=Symbol.iterator;function Lt(g){return g===null||typeof g!="object"?null:(g=Ft&&g[Ft]||g["@@iterator"],typeof g=="function"?g:null)}var nr={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},rr=Object.assign,It={};function ht(g,j,Ee){this.props=g,this.context=j,this.refs=It,this.updater=Ee||nr}ht.prototype.isReactComponent={},ht.prototype.setState=function(g,j){if(typeof g!="object"&&typeof g!="function"&&g!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,g,j,"setState")},ht.prototype.forceUpdate=function(g){this.updater.enqueueForceUpdate(this,g,"forceUpdate")};function Qr(){}Qr.prototype=ht.prototype;function mr(g,j,Ee){this.props=g,this.context=j,this.refs=It,this.updater=Ee||nr}var ir=mr.prototype=new Qr;ir.constructor=mr,rr(ir,ht.prototype),ir.isPureReactComponent=!0;var pn=Array.isArray,On=Object.prototype.hasOwnProperty,Rn={current:null},Dn={key:!0,ref:!0,__self:!0,__source:!0};function or(g,j,Ee){var Je,Me={},it=null,ot=null;if(j!=null)for(Je in j.ref!==void 0&&(ot=j.ref),j.key!==void 0&&(it=""+j.key),j)On.call(j,Je)&&!Dn.hasOwnProperty(Je)&&(Me[Je]=j[Je]);var _t=arguments.length-2;if(_t===1)Me.children=Ee;else if(1<_t){for(var Ge=Array(_t),Zt=0;Zt<_t;Zt++)Ge[Zt]=arguments[Zt+2];Me.children=Ge}if(g&&g.defaultProps)for(Je in _t=g.defaultProps,_t)Me[Je]===void 0&&(Me[Je]=_t[Je]);return{$$typeof:Z,type:g,key:it,ref:ot,props:Me,_owner:Rn.current}}function Lr(g,j){return{$$typeof:Z,type:g.type,key:j,ref:g.ref,props:g.props,_owner:g._owner}}function Yr(g){return typeof g=="object"&&g!==null&&g.$$typeof===Z}function di(g){var j={"=":"=0",":":"=2"};return"$"+g.replace(/[=:]/g,function(Ee){return j[Ee]})}var gr=/\/+/g;function qn(g,j){return typeof g=="object"&&g!==null&&g.key!=null?di(""+g.key):j.toString(36)}function _r(g,j,Ee,Je,Me){var it=typeof g;(it==="undefined"||it==="boolean")&&(g=null);var ot=!1;if(g===null)ot=!0;else switch(it){case"string":case"number":ot=!0;break;case"object":switch(g.$$typeof){case Z:case Ke:ot=!0}}if(ot)return ot=g,Me=Me(ot),g=Je===""?"."+qn(ot,0):Je,pn(Me)?(Ee="",g!=null&&(Ee=g.replace(gr,"$&/")+"/"),_r(Me,j,Ee,"",function(Zt){return Zt})):Me!=null&&(Yr(Me)&&(Me=Lr(Me,Ee+(!Me.key||ot&&ot.key===Me.key?"":(""+Me.key).replace(gr,"$&/")+"/")+g)),j.push(Me)),1;if(ot=0,Je=Je===""?".":Je+":",pn(g))for(var _t=0;_t<g.length;_t++){it=g[_t];var Ge=Je+qn(it,_t);ot+=_r(it,j,Ee,Ge,Me)}else if(Ge=Lt(g),typeof Ge=="function")for(g=Ge.call(g),_t=0;!(it=g.next()).done;)it=it.value,Ge=Je+qn(it,_t++),ot+=_r(it,j,Ee,Ge,Me);else if(it==="object")throw j=String(g),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(g).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.");return ot}function Ir(g,j,Ee){if(g==null)return g;var Je=[],Me=0;return _r(g,Je,"","",function(it){return j.call(Ee,it,Me++)}),Je}function hn(g){if(g._status===-1){var j=g._result;j=j(),j.then(function(Ee){(g._status===0||g._status===-1)&&(g._status=1,g._result=Ee)},function(Ee){(g._status===0||g._status===-1)&&(g._status=2,g._result=Ee)}),g._status===-1&&(g._status=0,g._result=j)}if(g._status===1)return g._result.default;throw g._result}var vt={current:null},re={transition:null},Re={ReactCurrentDispatcher:vt,ReactCurrentBatchConfig:re,ReactCurrentOwner:Rn};return tt.Children={map:Ir,forEach:function(g,j,Ee){Ir(g,function(){j.apply(this,arguments)},Ee)},count:function(g){var j=0;return Ir(g,function(){j++}),j},toArray:function(g){return Ir(g,function(j){return j})||[]},only:function(g){if(!Yr(g))throw Error("React.Children.only expected to receive a single React element child.");return g}},tt.Component=ht,tt.Fragment=N,tt.Profiler=Ie,tt.PureComponent=mr,tt.StrictMode=lt,tt.Suspense=nt,tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Re,tt.cloneElement=function(g,j,Ee){if(g==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+g+".");var Je=rr({},g.props),Me=g.key,it=g.ref,ot=g._owner;if(j!=null){if(j.ref!==void 0&&(it=j.ref,ot=Rn.current),j.key!==void 0&&(Me=""+j.key),g.type&&g.type.defaultProps)var _t=g.type.defaultProps;for(Ge in j)On.call(j,Ge)&&!Dn.hasOwnProperty(Ge)&&(Je[Ge]=j[Ge]===void 0&&_t!==void 0?_t[Ge]:j[Ge])}var Ge=arguments.length-2;if(Ge===1)Je.children=Ee;else if(1<Ge){_t=Array(Ge);for(var Zt=0;Zt<Ge;Zt++)_t[Zt]=arguments[Zt+2];Je.children=_t}return{$$typeof:Z,type:g.type,key:Me,ref:it,props:Je,_owner:ot}},tt.createContext=function(g){return g={$$typeof:gt,_currentValue:g,_currentValue2:g,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},g.Provider={$$typeof:Ve,_context:g},g.Consumer=g},tt.createElement=or,tt.createFactory=function(g){var j=or.bind(null,g);return j.type=g,j},tt.createRef=function(){return{current:null}},tt.forwardRef=function(g){return{$$typeof:Nt,render:g}},tt.isValidElement=Yr,tt.lazy=function(g){return{$$typeof:on,_payload:{_status:-1,_result:g},_init:hn}},tt.memo=function(g,j){return{$$typeof:Be,type:g,compare:j===void 0?null:j}},tt.startTransition=function(g){var j=re.transition;re.transition={};try{g()}finally{re.transition=j}},tt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},tt.useCallback=function(g,j){return vt.current.useCallback(g,j)},tt.useContext=function(g){return vt.current.useContext(g)},tt.useDebugValue=function(){},tt.useDeferredValue=function(g){return vt.current.useDeferredValue(g)},tt.useEffect=function(g,j){return vt.current.useEffect(g,j)},tt.useId=function(){return vt.current.useId()},tt.useImperativeHandle=function(g,j,Ee){return vt.current.useImperativeHandle(g,j,Ee)},tt.useInsertionEffect=function(g,j){return vt.current.useInsertionEffect(g,j)},tt.useLayoutEffect=function(g,j){return vt.current.useLayoutEffect(g,j)},tt.useMemo=function(g,j){return vt.current.useMemo(g,j)},tt.useReducer=function(g,j,Ee){return vt.current.useReducer(g,j,Ee)},tt.useRef=function(g){return vt.current.useRef(g)},tt.useState=function(g){return vt.current.useState(g)},tt.useSyncExternalStore=function(g,j,Ee){return vt.current.useSyncExternalStore(g,j,Ee)},tt.useTransition=function(){return vt.current.useTransition()},tt.version="18.2.0",tt}(function(Z){Z.exports=xf()})(Mf);const jf=Cc(oo),zf=uf({__proto__:null,default:jf},[oo]),af=sf(zf);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var tf;function Ff(){if(tf)return Ns;tf=1;var Z=af,Ke=Symbol.for("react.element"),N=Symbol.for("react.fragment"),lt=Object.prototype.hasOwnProperty,Ie=Z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ve={key:!0,ref:!0,__self:!0,__source:!0};function gt(Nt,nt,Be){var on,Ft={},Lt=null,nr=null;Be!==void 0&&(Lt=""+Be),nt.key!==void 0&&(Lt=""+nt.key),nt.ref!==void 0&&(nr=nt.ref);for(on in nt)lt.call(nt,on)&&!Ve.hasOwnProperty(on)&&(Ft[on]=nt[on]);if(Nt&&Nt.defaultProps)for(on in nt=Nt.defaultProps,nt)Ft[on]===void 0&&(Ft[on]=nt[on]);return{$$typeof:Ke,type:Nt,key:Lt,ref:nr,props:Ft,_owner:Ie.current}}return Ns.Fragment=N,Ns.jsx=gt,Ns.jsxs=gt,Ns}(function(Z){Z.exports=Ff()})(Df);const Uf=Ls.Fragment,dn=Ls.jsx,Fo=Ls.jsxs;var Ba={},Bf={get exports(){return Ba},set exports(Z){Ba=Z}},yr={},Va={},Vf={get exports(){return Va},set exports(Z){Va=Z}},Oc={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var nf;function $f(){return nf||(nf=1,function(Z){function Ke(re,Re){var g=re.length;re.push(Re);e:for(;0<g;){var j=g-1>>>1,Ee=re[j];if(0<Ie(Ee,Re))re[j]=Re,re[g]=Ee,g=j;else break e}}function N(re){return re.length===0?null:re[0]}function lt(re){if(re.length===0)return null;var Re=re[0],g=re.pop();if(g!==Re){re[0]=g;e:for(var j=0,Ee=re.length,Je=Ee>>>1;j<Je;){var Me=2*(j+1)-1,it=re[Me],ot=Me+1,_t=re[ot];if(0>Ie(it,g))ot<Ee&&0>Ie(_t,it)?(re[j]=_t,re[ot]=g,j=ot):(re[j]=it,re[Me]=g,j=Me);else if(ot<Ee&&0>Ie(_t,g))re[j]=_t,re[ot]=g,j=ot;else break e}}return Re}function Ie(re,Re){var g=re.sortIndex-Re.sortIndex;return g!==0?g:re.id-Re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var Ve=performance;Z.unstable_now=function(){return Ve.now()}}else{var gt=Date,Nt=gt.now();Z.unstable_now=function(){return gt.now()-Nt}}var nt=[],Be=[],on=1,Ft=null,Lt=3,nr=!1,rr=!1,It=!1,ht=typeof setTimeout=="function"?setTimeout:null,Qr=typeof clearTimeout=="function"?clearTimeout:null,mr=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ir(re){for(var Re=N(Be);Re!==null;){if(Re.callback===null)lt(Be);else if(Re.startTime<=re)lt(Be),Re.sortIndex=Re.expirationTime,Ke(nt,Re);else break;Re=N(Be)}}function pn(re){if(It=!1,ir(re),!rr)if(N(nt)!==null)rr=!0,hn(On);else{var Re=N(Be);Re!==null&&vt(pn,Re.startTime-re)}}function On(re,Re){rr=!1,It&&(It=!1,Qr(or),or=-1),nr=!0;var g=Lt;try{for(ir(Re),Ft=N(nt);Ft!==null&&(!(Ft.expirationTime>Re)||re&&!di());){var j=Ft.callback;if(typeof j=="function"){Ft.callback=null,Lt=Ft.priorityLevel;var Ee=j(Ft.expirationTime<=Re);Re=Z.unstable_now(),typeof Ee=="function"?Ft.callback=Ee:Ft===N(nt)&&lt(nt),ir(Re)}else lt(nt);Ft=N(nt)}if(Ft!==null)var Je=!0;else{var Me=N(Be);Me!==null&&vt(pn,Me.startTime-Re),Je=!1}return Je}finally{Ft=null,Lt=g,nr=!1}}var Rn=!1,Dn=null,or=-1,Lr=5,Yr=-1;function di(){return!(Z.unstable_now()-Yr<Lr)}function gr(){if(Dn!==null){var re=Z.unstable_now();Yr=re;var Re=!0;try{Re=Dn(!0,re)}finally{Re?qn():(Rn=!1,Dn=null)}}else Rn=!1}var qn;if(typeof mr=="function")qn=function(){mr(gr)};else if(typeof MessageChannel<"u"){var _r=new MessageChannel,Ir=_r.port2;_r.port1.onmessage=gr,qn=function(){Ir.postMessage(null)}}else qn=function(){ht(gr,0)};function hn(re){Dn=re,Rn||(Rn=!0,qn())}function vt(re,Re){or=ht(function(){re(Z.unstable_now())},Re)}Z.unstable_IdlePriority=5,Z.unstable_ImmediatePriority=1,Z.unstable_LowPriority=4,Z.unstable_NormalPriority=3,Z.unstable_Profiling=null,Z.unstable_UserBlockingPriority=2,Z.unstable_cancelCallback=function(re){re.callback=null},Z.unstable_continueExecution=function(){rr||nr||(rr=!0,hn(On))},Z.unstable_forceFrameRate=function(re){0>re||125<re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Lr=0<re?Math.floor(1e3/re):5},Z.unstable_getCurrentPriorityLevel=function(){return Lt},Z.unstable_getFirstCallbackNode=function(){return N(nt)},Z.unstable_next=function(re){switch(Lt){case 1:case 2:case 3:var Re=3;break;default:Re=Lt}var g=Lt;Lt=Re;try{return re()}finally{Lt=g}},Z.unstable_pauseExecution=function(){},Z.unstable_requestPaint=function(){},Z.unstable_runWithPriority=function(re,Re){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var g=Lt;Lt=re;try{return Re()}finally{Lt=g}},Z.unstable_scheduleCallback=function(re,Re,g){var j=Z.unstable_now();switch(typeof g=="object"&&g!==null?(g=g.delay,g=typeof g=="number"&&0<g?j+g:j):g=j,re){case 1:var Ee=-1;break;case 2:Ee=250;break;case 5:Ee=1073741823;break;case 4:Ee=1e4;break;default:Ee=5e3}return Ee=g+Ee,re={id:on++,callback:Re,priorityLevel:re,startTime:g,expirationTime:Ee,sortIndex:-1},g>j?(re.sortIndex=g,Ke(Be,re),N(nt)===null&&re===N(Be)&&(It?(Qr(or),or=-1):It=!0,vt(pn,g-j))):(re.sortIndex=Ee,Ke(nt,re),rr||nr||(rr=!0,hn(On))),re},Z.unstable_shouldYield=di,Z.unstable_wrapCallback=function(re){var Re=Lt;return function(){var g=Lt;Lt=Re;try{return re.apply(this,arguments)}finally{Lt=g}}}}(Oc)),Oc}var rf;function Hf(){return rf||(rf=1,function(Z){Z.exports=$f()}(Vf)),Va}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var of;function Wf(){if(of)return yr;of=1;var Z=af,Ke=Hf();function N(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var lt=new Set,Ie={};function Ve(e,t){gt(e,t),gt(e+"Capture",t)}function gt(e,t){for(Ie[e]=t,e=0;e<t.length;e++)lt.add(t[e])}var Nt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nt=Object.prototype.hasOwnProperty,Be=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,on={},Ft={};function Lt(e){return nt.call(Ft,e)?!0:nt.call(on,e)?!1:Be.test(e)?Ft[e]=!0:(on[e]=!0,!1)}function nr(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function rr(e,t,n,r){if(t===null||typeof t>"u"||nr(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function It(e,t,n,r,o,s,c){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=c}var ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ht[e]=new It(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ht[t]=new It(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){ht[e]=new It(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ht[e]=new It(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ht[e]=new It(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){ht[e]=new It(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){ht[e]=new It(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){ht[e]=new It(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){ht[e]=new It(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qr=/[\-:]([a-z])/g;function mr(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Qr,mr);ht[t]=new It(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Qr,mr);ht[t]=new It(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Qr,mr);ht[t]=new It(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){ht[e]=new It(e,1,!1,e.toLowerCase(),null,!1,!1)}),ht.xlinkHref=new It("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){ht[e]=new It(e,1,!1,e.toLowerCase(),null,!0,!0)});function ir(e,t,n,r){var o=ht.hasOwnProperty(t)?ht[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(rr(t,n,o,r)&&(n=null),r||o===null?Lt(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var pn=Z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,On=Symbol.for("react.element"),Rn=Symbol.for("react.portal"),Dn=Symbol.for("react.fragment"),or=Symbol.for("react.strict_mode"),Lr=Symbol.for("react.profiler"),Yr=Symbol.for("react.provider"),di=Symbol.for("react.context"),gr=Symbol.for("react.forward_ref"),qn=Symbol.for("react.suspense"),_r=Symbol.for("react.suspense_list"),Ir=Symbol.for("react.memo"),hn=Symbol.for("react.lazy"),vt=Symbol.for("react.offscreen"),re=Symbol.iterator;function Re(e){return e===null||typeof e!="object"?null:(e=re&&e[re]||e["@@iterator"],typeof e=="function"?e:null)}var g=Object.assign,j;function Ee(e){if(j===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);j=t&&t[1]||""}return`
34
+ `+j+e}var Je=!1;function Me(e,t){if(!e||Je)return"";Je=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(L){var r=L}Reflect.construct(e,[],t)}else{try{t.call()}catch(L){r=L}e.call(t.prototype)}else{try{throw Error()}catch(L){r=L}e()}}catch(L){if(L&&r&&typeof L.stack=="string"){for(var o=L.stack.split(`
35
+ `),s=r.stack.split(`
36
+ `),c=o.length-1,v=s.length-1;1<=c&&0<=v&&o[c]!==s[v];)v--;for(;1<=c&&0<=v;c--,v--)if(o[c]!==s[v]){if(c!==1||v!==1)do if(c--,v--,0>v||o[c]!==s[v]){var m=`
37
+ `+o[c].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),m}while(1<=c&&0<=v);break}}}finally{Je=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ee(e):""}function it(e){switch(e.tag){case 5:return Ee(e.type);case 16:return Ee("Lazy");case 13:return Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 2:case 15:return e=Me(e.type,!1),e;case 11:return e=Me(e.type.render,!1),e;case 1:return e=Me(e.type,!0),e;default:return""}}function ot(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Dn:return"Fragment";case Rn:return"Portal";case Lr:return"Profiler";case or:return"StrictMode";case qn:return"Suspense";case _r:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case di:return(e.displayName||"Context")+".Consumer";case Yr:return(e._context.displayName||"Context")+".Provider";case gr:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ir:return t=e.displayName||null,t!==null?t:ot(e.type)||"Memo";case hn:t=e._payload,e=e._init;try{return ot(e(t))}catch{}}return null}function _t(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ot(t);case 8:return t===or?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ge(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fi(e){var t=Zt(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(c){r=""+c,s.call(this,c)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(c){r=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ui(e){e._valueTracker||(e._valueTracker=Fi(e))}function Is(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Zt(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Uo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function pu(e,t){var n=t.checked;return g({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function hu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ge(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function As(e,t){t=t.checked,t!=null&&ir(e,"checked",t,!1)}function vu(e,t){As(e,t);var n=Ge(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?yu(e,t.type,n):t.hasOwnProperty("defaultValue")&&yu(e,t.type,Ge(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ds(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function yu(e,t,n){(t!=="number"||Uo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bo=Array.isArray;function lo(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Ge(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function mu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(N(91));return g({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ms(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(N(92));if(Bo(n)){if(1<n.length)throw Error(N(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ge(n)}}function xs(e,t){var n=Ge(t.value),r=Ge(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function pi(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function js(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function gu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?js(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var wl,zs=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(wl=wl||document.createElement("div"),wl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=wl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $o={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$a=["Webkit","ms","Moz","O"];Object.keys($o).forEach(function(e){$a.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),$o[t]=$o[e]})});function Fs(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||$o.hasOwnProperty(e)&&$o[e]?(""+t).trim():t+"px"}function Us(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Fs(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Ha=g({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _u(e,t){if(t){if(Ha[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function hi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Eu=null;function Su(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wu=null,uo=null,lr=null;function ur(e){if(e=Qt(e)){if(typeof wu!="function")throw Error(N(280));var t=e.stateNode;t&&(t=jl(t),wu(e.stateNode,e.type,t))}}function Ou(e){uo?lr?lr.push(e):lr=[e]:uo=e}function Ru(){if(uo){var e=uo,t=lr;if(lr=uo=null,ur(e),t)for(e=0;e<t.length;e++)ur(t[e])}}function Bs(e,t){return e(t)}function Vs(){}var Ol=!1;function $s(e,t,n){if(Ol)return e(t,n);Ol=!0;try{return Bs(e,t,n)}finally{Ol=!1,(uo!==null||lr!==null)&&(Vs(),Ru())}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=jl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(N(231,t,typeof n));return n}var so=!1;if(Nt)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){so=!0}}),window.addEventListener("test",Cn,Cn),window.removeEventListener("test",Cn,Cn)}catch{so=!1}function Wa(e,t,n,r,o,s,c,v,m){var L=Array.prototype.slice.call(arguments,3);try{t.apply(n,L)}catch($){this.onError($)}}var Ho=!1,un=null,Wo=!1,qe=null,qa={onError:function(e){Ho=!0,un=e}};function Qa(e,t,n,r,o,s,c,v,m){Ho=!1,un=null,Wa.apply(qa,arguments)}function Ya(e,t,n,r,o,s,c,v,m){if(Qa.apply(this,arguments),Ho){if(Ho){var L=un;Ho=!1,un=null}else throw Error(N(198));Wo||(Wo=!0,qe=L)}}function Ar(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Cu(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Hs(e){if(Ar(e)!==e)throw Error(N(188))}function Ws(e){var t=e.alternate;if(!t){if(t=Ar(e),t===null)throw Error(N(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return Hs(o),e;if(s===r)return Hs(o),t;s=s.sibling}throw Error(N(188))}if(n.return!==r.return)n=o,r=s;else{for(var c=!1,v=o.child;v;){if(v===n){c=!0,n=o,r=s;break}if(v===r){c=!0,r=o,n=s;break}v=v.sibling}if(!c){for(v=s.child;v;){if(v===n){c=!0,n=s,r=o;break}if(v===r){c=!0,r=s,n=o;break}v=v.sibling}if(!c)throw Error(N(189))}}if(n.alternate!==r)throw Error(N(190))}if(n.tag!==3)throw Error(N(188));return n.stateNode.current===n?e:t}function Tn(e){return e=Ws(e),e!==null?Tu(e):null}function Tu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Tu(e);if(t!==null)return t;e=e.sibling}return null}var qs=Ke.unstable_scheduleCallback,Pu=Ke.unstable_cancelCallback,Dr=Ke.unstable_shouldYield,Ga=Ke.unstable_requestPaint,Vt=Ke.unstable_now,ku=Ke.unstable_getCurrentPriorityLevel,qo=Ke.unstable_ImmediatePriority,Nu=Ke.unstable_UserBlockingPriority,ao=Ke.unstable_NormalPriority,Qs=Ke.unstable_LowPriority,Ys=Ke.unstable_IdlePriority,Rl=null,Qn=null;function Lu(e){if(Qn&&typeof Qn.onCommitFiberRoot=="function")try{Qn.onCommitFiberRoot(Rl,e,void 0,(e.current.flags&128)===128)}catch{}}var Er=Math.clz32?Math.clz32:Qo,Gs=Math.log,Kt=Math.LN2;function Qo(e){return e>>>=0,e===0?32:31-(Gs(e)/Kt|0)|0}var Yo=64,Cl=4194304;function co(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Tl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,c=n&268435455;if(c!==0){var v=c&~o;v!==0?r=co(v):(s&=c,s!==0&&(r=co(s)))}else c=n&~o,c!==0?r=co(c):s!==0&&(r=co(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Er(t),o=1<<n,r|=e[n],t&=~o;return r}function Sr(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ks(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var c=31-Er(s),v=1<<c,m=o[c];m===-1?(!(v&n)||v&r)&&(o[c]=Sr(v,t)):m<=t&&(e.expiredLanes|=v),s&=~v}}function Bi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function bs(){var e=Yo;return Yo<<=1,!(Yo&4194240)&&(Yo=64),e}function Iu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Er(t),e[t]=n}function Xs(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Er(n),s=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~s}}function Au(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Er(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ft=0;function Vi(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Js,Du,Zs,ea,Mu,Pl=!1,vi=[],Gr=null,yi=null,mi=null,$i=new Map,fo=new Map,gi=[],Ka="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function kl(e,t){switch(e){case"focusin":case"focusout":Gr=null;break;case"dragenter":case"dragleave":yi=null;break;case"mouseover":case"mouseout":mi=null;break;case"pointerover":case"pointerout":$i.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fo.delete(t.pointerId)}}function Go(e,t,n,r,o,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[o]},t!==null&&(t=Qt(t),t!==null&&Du(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function ba(e,t,n,r,o){switch(t){case"focusin":return Gr=Go(Gr,e,t,n,r,o),!0;case"dragenter":return yi=Go(yi,e,t,n,r,o),!0;case"mouseover":return mi=Go(mi,e,t,n,r,o),!0;case"pointerover":var s=o.pointerId;return $i.set(s,Go($i.get(s)||null,e,t,n,r,o)),!0;case"gotpointercapture":return s=o.pointerId,fo.set(s,Go(fo.get(s)||null,e,t,n,r,o)),!0}return!1}function ta(e){var t=Gn(e.target);if(t!==null){var n=Ar(t);if(n!==null){if(t=n.tag,t===13){if(t=Cu(n),t!==null){e.blockedOn=t,Mu(e.priority,function(){Zs(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ko(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ne(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Eu=r,n.target.dispatchEvent(r),Eu=null}else return t=Qt(n),t!==null&&Du(t),e.blockedOn=n,!1;t.shift()}return!0}function na(e,t,n){Ko(e)&&n.delete(t)}function Xa(){Pl=!1,Gr!==null&&Ko(Gr)&&(Gr=null),yi!==null&&Ko(yi)&&(yi=null),mi!==null&&Ko(mi)&&(mi=null),$i.forEach(na),fo.forEach(na)}function po(e,t){e.blockedOn===t&&(e.blockedOn=null,Pl||(Pl=!0,Ke.unstable_scheduleCallback(Ke.unstable_NormalPriority,Xa)))}function Kr(e){function t(o){return po(o,e)}if(0<vi.length){po(vi[0],e);for(var n=1;n<vi.length;n++){var r=vi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Gr!==null&&po(Gr,e),yi!==null&&po(yi,e),mi!==null&&po(mi,e),$i.forEach(t),fo.forEach(t),n=0;n<gi.length;n++)r=gi[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<gi.length&&(n=gi[0],n.blockedOn===null);)ta(n),n.blockedOn===null&&gi.shift()}var Hi=pn.ReactCurrentBatchConfig,Mn=!0;function bo(e,t,n,r){var o=ft,s=Hi.transition;Hi.transition=null;try{ft=1,Ll(e,t,n,r)}finally{ft=o,Hi.transition=s}}function Nl(e,t,n,r){var o=ft,s=Hi.transition;Hi.transition=null;try{ft=4,Ll(e,t,n,r)}finally{ft=o,Hi.transition=s}}function Ll(e,t,n,r){if(Mn){var o=Ne(e,t,n,r);if(o===null)Ln(e,t,r,Il,n),kl(e,r);else if(ba(o,e,t,n,r))r.stopPropagation();else if(kl(e,r),t&4&&-1<Ka.indexOf(e)){for(;o!==null;){var s=Qt(o);if(s!==null&&Js(s),s=Ne(e,t,n,r),s===null&&Ln(e,t,r,Il,n),s===o)break;o=s}o!==null&&r.stopPropagation()}else Ln(e,t,r,null,n)}}var Il=null;function Ne(e,t,n,r){if(Il=null,e=Su(r),e=Gn(e),e!==null)if(t=Ar(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Cu(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Il=e,null}function xu(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ku()){case qo:return 1;case Nu:return 4;case ao:case Qs:return 16;case Ys:return 536870912;default:return 16}default:return 16}}var wr=null,ju=null,Xo=null;function zu(){if(Xo)return Xo;var e,t=ju,n=t.length,r,o="value"in wr?wr.value:wr.textContent,s=o.length;for(e=0;e<n&&t[e]===o[e];e++);var c=n-e;for(r=1;r<=c&&t[n-r]===o[s-r];r++);return Xo=o.slice(e,1<r?1-r:void 0)}function ho(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Al(){return!0}function ra(){return!1}function Pn(e){function t(n,r,o,s,c){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=s,this.target=c,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(n=e[v],this[v]=n?n(s):s[v]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Al:ra,this.isPropagationStopped=ra,this}return g(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Al)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Al)},persist:function(){},isPersistent:Al}),t}var _i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jo=Pn(_i),Wi=g({},_i,{view:0,detail:0}),Fu=Pn(Wi),Zo,Mr,Ei,vo=g({},Wi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:V,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ei&&(Ei&&e.type==="mousemove"?(Zo=e.screenX-Ei.screenX,Mr=e.screenY-Ei.screenY):Mr=Zo=0,Ei=e),Zo)},movementY:function(e){return"movementY"in e?e.movementY:Mr}}),Uu=Pn(vo),ia=g({},vo,{dataTransfer:0}),oa=Pn(ia),Ja=g({},Wi,{relatedTarget:0}),Dl=Pn(Ja),i=g({},_i,{animationName:0,elapsedTime:0,pseudoElement:0}),l=Pn(i),u=g({},_i,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),f=Pn(u),p=g({},_i,{data:0}),_=Pn(p),S={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},R={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},K={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function we(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=K[e])?!!t[e]:!1}function V(){return we}var C=g({},Wi,{key:function(e){if(e.key){var t=S[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ho(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?R[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:V,charCode:function(e){return e.type==="keypress"?ho(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ho(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),I=Pn(C),z=g({},vo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pe=Pn(z),He=g({},Wi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:V}),Ct=Pn(He),be=g({},_i,{propertyName:0,elapsedTime:0,pseudoElement:0}),Oe=Pn(be),xr=g({},vo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ht=Pn(xr),F=[9,13,27,32],q=Nt&&"CompositionEvent"in window,b=null;Nt&&"documentMode"in document&&(b=document.documentMode);var xe=Nt&&"TextEvent"in window&&!b,We=Nt&&(!q||b&&8<b&&11>=b),je=String.fromCharCode(32),en=!1;function Tt(e,t){switch(e){case"keyup":return F.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dt(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var st=!1;function Wt(e,t){switch(e){case"compositionend":return dt(t);case"keypress":return t.which!==32?null:(en=!0,je);case"textInput":return e=t.data,e===je&&en?null:e;default:return null}}function xn(e,t){if(st)return e==="compositionend"||!q&&Tt(e,t)?(e=zu(),Xo=ju=wr=null,st=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return We&&t.locale!=="ko"?null:t.data;default:return null}}var Bu={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Bu[e.type]:t==="textarea"}function br(e,t,n,r){Ou(r),t=Or(t,"onChange"),0<t.length&&(n=new Jo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Si=null,Qi=null;function wi(e){le(e,0)}function yo(e){var t=go(e);if(Is(t))return e}function Ml(e,t){if(e==="change")return t}var w=!1;if(Nt){var D;if(Nt){var Y="oninput"in document;if(!Y){var ie=document.createElement("div");ie.setAttribute("oninput","return;"),Y=typeof ie.oninput=="function"}D=Y}else D=!1;w=D&&(!document.documentMode||9<document.documentMode)}function M(){Si&&(Si.detachEvent("onpropertychange",J),Qi=Si=null)}function J(e){if(e.propertyName==="value"&&yo(Qi)){var t=[];br(t,Qi,e,Su(e)),$s(wi,t)}}function Ce(e,t,n){e==="focusin"?(M(),Si=t,Qi=n,Si.attachEvent("onpropertychange",J)):e==="focusout"&&M()}function Te(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yo(Qi)}function U(e,t){if(e==="click")return yo(t)}function X(e,t){if(e==="input"||e==="change")return yo(t)}function te(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var G=typeof Object.is=="function"?Object.is:te;function Se(e,t){if(G(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!nt.call(t,o)||!G(e[o],t[o]))return!1}return!0}function Ae(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function H(e,t){var n=Ae(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ae(n)}}function ye(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ye(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ye(){for(var e=window,t=Uo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Uo(e.document)}return t}function rt(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ze(e){var t=Ye(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ye(n.ownerDocument.documentElement,n)){if(r!==null&&rt(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=H(n,s);var c=H(n,r);o&&c&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==c.node||e.focusOffset!==c.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(c.node,c.offset)):(t.setEnd(c.node,c.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Et=Nt&&"documentMode"in document&&11>=document.documentMode,yn=null,$t=null,Pt=null,yt=!1;function kn(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yt||yn==null||yn!==Uo(r)||(r=yn,"selectionStart"in r&&rt(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Pt&&Se(Pt,r)||(Pt=r,r=Or($t,"onSelect"),0<r.length&&(t=new Jo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=yn)))}function mn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var jn={animationend:mn("Animation","AnimationEnd"),animationiteration:mn("Animation","AnimationIteration"),animationstart:mn("Animation","AnimationStart"),transitionend:mn("Transition","TransitionEnd")},gn={},_n={};Nt&&(_n=document.createElement("div").style,"AnimationEvent"in window||(delete jn.animationend.animation,delete jn.animationiteration.animation,delete jn.animationstart.animation),"TransitionEvent"in window||delete jn.transitionend.transition);function zn(e){if(gn[e])return gn[e];if(!jn[e])return e;var t=jn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in _n)return gn[e]=t[n];return e}var Xe=zn("animationend"),ae=zn("animationiteration"),De=zn("animationstart"),de=zn("transitionend"),oe=new Map,_e="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Fe(e,t){oe.set(e,t),Ve(t,[e])}for(var Qe=0;Qe<_e.length;Qe++){var Ze=_e[Qe],Ut=Ze.toLowerCase(),At=Ze[0].toUpperCase()+Ze.slice(1);Fe(Ut,"on"+At)}Fe(Xe,"onAnimationEnd"),Fe(ae,"onAnimationIteration"),Fe(De,"onAnimationStart"),Fe("dblclick","onDoubleClick"),Fe("focusin","onFocus"),Fe("focusout","onBlur"),Fe(de,"onTransitionEnd"),gt("onMouseEnter",["mouseout","mouseover"]),gt("onMouseLeave",["mouseout","mouseover"]),gt("onPointerEnter",["pointerout","pointerover"]),gt("onPointerLeave",["pointerout","pointerover"]),Ve("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ve("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ve("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ve("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ve("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ve("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var at="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),bt=new Set("cancel close invalid load scroll toggle".split(" ").concat(at));function $e(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Ya(r,t,void 0,e),e.currentTarget=null}function le(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var c=r.length-1;0<=c;c--){var v=r[c],m=v.instance,L=v.currentTarget;if(v=v.listener,m!==s&&o.isPropagationStopped())break e;$e(o,v,L),s=m}else for(c=0;c<r.length;c++){if(v=r[c],m=v.instance,L=v.currentTarget,v=v.listener,m!==s&&o.isPropagationStopped())break e;$e(o,v,L),s=m}}}if(Wo)throw e=qe,Wo=!1,qe=null,e}function ue(e,t){var n=t[Vu];n===void 0&&(n=t[Vu]=new Set);var r=e+"__bubble";n.has(r)||(jr(t,e,2,!1),n.add(r))}function kt(e,t,n){var r=0;t&&(r|=4),jr(n,e,r,t)}var qt="_reactListening"+Math.random().toString(36).slice(2);function Nn(e){if(!e[qt]){e[qt]=!0,lt.forEach(function(n){n!=="selectionchange"&&(bt.has(n)||kt(n,!1,e),kt(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qt]||(t[qt]=!0,kt("selectionchange",!1,t))}}function jr(e,t,n,r){switch(xu(t)){case 1:var o=bo;break;case 4:o=Nl;break;default:o=Ll}n=o.bind(null,t,n,e),o=void 0,!so||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ln(e,t,n,r,o){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var c=r.tag;if(c===3||c===4){var v=r.stateNode.containerInfo;if(v===o||v.nodeType===8&&v.parentNode===o)break;if(c===4)for(c=r.return;c!==null;){var m=c.tag;if((m===3||m===4)&&(m=c.stateNode.containerInfo,m===o||m.nodeType===8&&m.parentNode===o))return;c=c.return}for(;v!==null;){if(c=Gn(v),c===null)return;if(m=c.tag,m===5||m===6){r=s=c;continue e}v=v.parentNode}}r=r.return}$s(function(){var L=s,$=Su(n),W=[];e:{var B=oe.get(e);if(B!==void 0){var se=Jo,fe=e;switch(e){case"keypress":if(ho(n)===0)break e;case"keydown":case"keyup":se=I;break;case"focusin":fe="focus",se=Dl;break;case"focusout":fe="blur",se=Dl;break;case"beforeblur":case"afterblur":se=Dl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=Uu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=oa;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=Ct;break;case Xe:case ae:case De:se=l;break;case de:se=Oe;break;case"scroll":se=Fu;break;case"wheel":se=Ht;break;case"copy":case"cut":case"paste":se=f;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=pe}var ve=(t&4)!==0,nn=!ve&&e==="scroll",O=ve?B!==null?B+"Capture":null:B;ve=[];for(var E=L,P;E!==null;){P=E;var Q=P.stateNode;if(P.tag===5&&Q!==null&&(P=Q,O!==null&&(Q=ln(E,O),Q!=null&&ve.push(et(E,Q,P)))),nn)break;E=E.return}0<ve.length&&(B=new se(B,fe,null,n,$),W.push({event:B,listeners:ve}))}}if(!(t&7)){e:{if(B=e==="mouseover"||e==="pointerover",se=e==="mouseout"||e==="pointerout",B&&n!==Eu&&(fe=n.relatedTarget||n.fromElement)&&(Gn(fe)||fe[Jr]))break e;if((se||B)&&(B=$.window===$?$:(B=$.ownerDocument)?B.defaultView||B.parentWindow:window,se?(fe=n.relatedTarget||n.toElement,se=L,fe=fe?Gn(fe):null,fe!==null&&(nn=Ar(fe),fe!==nn||fe.tag!==5&&fe.tag!==6)&&(fe=null)):(se=null,fe=L),se!==fe)){if(ve=Uu,Q="onMouseLeave",O="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(ve=pe,Q="onPointerLeave",O="onPointerEnter",E="pointer"),nn=se==null?B:go(se),P=fe==null?B:go(fe),B=new ve(Q,E+"leave",se,n,$),B.target=nn,B.relatedTarget=P,Q=null,Gn($)===L&&(ve=new ve(O,E+"enter",fe,n,$),ve.target=P,ve.relatedTarget=nn,Q=ve),nn=Q,se&&fe)t:{for(ve=se,O=fe,E=0,P=ve;P;P=sn(P))E++;for(P=0,Q=O;Q;Q=sn(Q))P++;for(;0<E-P;)ve=sn(ve),E--;for(;0<P-E;)O=sn(O),P--;for(;E--;){if(ve===O||O!==null&&ve===O.alternate)break t;ve=sn(ve),O=sn(O)}ve=null}else ve=null;se!==null&&Fn(W,B,se,ve,!1),fe!==null&&nn!==null&&Fn(W,nn,fe,ve,!0)}}e:{if(B=L?go(L):window,se=B.nodeName&&B.nodeName.toLowerCase(),se==="select"||se==="input"&&B.type==="file")var ge=Ml;else if(qi(B))if(w)ge=X;else{ge=Te;var Pe=Ce}else(se=B.nodeName)&&se.toLowerCase()==="input"&&(B.type==="checkbox"||B.type==="radio")&&(ge=U);if(ge&&(ge=ge(e,L))){br(W,ge,n,$);break e}Pe&&Pe(e,B,L),e==="focusout"&&(Pe=B._wrapperState)&&Pe.controlled&&B.type==="number"&&yu(B,"number",B.value)}switch(Pe=L?go(L):window,e){case"focusin":(qi(Pe)||Pe.contentEditable==="true")&&(yn=Pe,$t=L,Pt=null);break;case"focusout":Pt=$t=yn=null;break;case"mousedown":yt=!0;break;case"contextmenu":case"mouseup":case"dragend":yt=!1,kn(W,n,$);break;case"selectionchange":if(Et)break;case"keydown":case"keyup":kn(W,n,$)}var ke;if(q)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else st?Tt(e,n)&&(Ue="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ue="onCompositionStart");Ue&&(We&&n.locale!=="ko"&&(st||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&st&&(ke=zu()):(wr=$,ju="value"in wr?wr.value:wr.textContent,st=!0)),Pe=Or(L,Ue),0<Pe.length&&(Ue=new _(Ue,e,null,n,$),W.push({event:Ue,listeners:Pe}),ke?Ue.data=ke:(ke=dt(n),ke!==null&&(Ue.data=ke)))),(ke=xe?Wt(e,n):xn(e,n))&&(L=Or(L,"onBeforeInput"),0<L.length&&($=new _("onBeforeInput","beforeinput",null,n,$),W.push({event:$,listeners:L}),$.data=ke))}le(W,t)})}function et(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Or(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,s=o.stateNode;o.tag===5&&s!==null&&(o=s,s=ln(e,n),s!=null&&r.unshift(et(e,s,o)),s=ln(e,t),s!=null&&r.push(et(e,s,o))),e=e.return}return r}function sn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Fn(e,t,n,r,o){for(var s=t._reactName,c=[];n!==null&&n!==r;){var v=n,m=v.alternate,L=v.stateNode;if(m!==null&&m===r)break;v.tag===5&&L!==null&&(v=L,o?(m=ln(n,s),m!=null&&c.unshift(et(n,m,v))):o||(m=ln(n,s),m!=null&&c.push(et(n,m,v)))),n=n.return}c.length!==0&&e.push({event:t,listeners:c})}var me=/\r\n?/g,St=/\u0000|\uFFFD/g;function Dt(e){return(typeof e=="string"?e:""+e).replace(me,`
38
+ `).replace(St,"")}function pt(e,t,n){if(t=Dt(t),Dt(e)!==t&&n)throw Error(N(425))}function an(){}var Yn=null,Yi=null;function Oi(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mo=typeof setTimeout=="function"?setTimeout:void 0,zr=typeof clearTimeout=="function"?clearTimeout:void 0,Un=typeof Promise=="function"?Promise:void 0,Ri=typeof queueMicrotask=="function"?queueMicrotask:typeof Un<"u"?function(e){return Un.resolve(null).then(e).catch(Xr)}:mo;function Xr(e){setTimeout(function(){throw e})}function Rr(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Kr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Kr(t)}function Ci(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function la(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ti=Math.random().toString(36).slice(2),Fr="__reactFiber$"+Ti,el="__reactProps$"+Ti,Jr="__reactContainer$"+Ti,Vu="__reactEvents$"+Ti,Ur="__reactListeners$"+Ti,xl="__reactHandles$"+Ti;function Gn(e){var t=e[Fr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Jr]||n[Fr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=la(e);e!==null;){if(n=e[Fr])return n;e=la(e)}return t}e=n,n=e.parentNode}return null}function Qt(e){return e=e[Fr]||e[Jr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function go(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(N(33))}function jl(e){return e[el]||null}var Br=[],Cr=-1;function Zr(e){return{current:e}}function mt(e){0>Cr||(e.current=Br[Cr],Br[Cr]=null,Cr--)}function wt(e,t){Cr++,Br[Cr]=e.current,e.current=t}var Kn={},Yt=Zr(Kn),En=Zr(!1),Pi=Kn;function ei(e,t){var n=e.type.contextTypes;if(!n)return Kn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Bn(e){return e=e.childContextTypes,e!=null}function zl(){mt(En),mt(Yt)}function _o(e,t,n){if(Yt.current!==Kn)throw Error(N(168));wt(Yt,t),wt(En,n)}function ua(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(N(108,_t(e)||"Unknown",o));return g({},n,r)}function Fl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kn,Pi=Yt.current,wt(Yt,e),wt(En,En.current),!0}function sa(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=ua(e,t,Pi),r.__reactInternalMemoizedMergedChildContext=e,mt(En),mt(Yt),wt(Yt,e)):mt(En),wt(En,n)}var sr=null,Eo=!1,ki=!1;function aa(e){sr===null?sr=[e]:sr.push(e)}function Za(e){Eo=!0,aa(e)}function Ni(){if(!ki&&sr!==null){ki=!0;var e=0,t=ft;try{var n=sr;for(ft=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}sr=null,Eo=!1}catch(o){throw sr!==null&&(sr=sr.slice(e+1)),qs(qo,Ni),o}finally{ft=t,ki=!1}}return null}var Gi=[],Ki=0,So=null,Ul=0,ar=[],cr=0,bi=null,ti=1,ni="";function Xi(e,t){Gi[Ki++]=Ul,Gi[Ki++]=So,So=e,Ul=t}function ca(e,t,n){ar[cr++]=ti,ar[cr++]=ni,ar[cr++]=bi,bi=e;var r=ti;e=ni;var o=32-Er(r)-1;r&=~(1<<o),n+=1;var s=32-Er(t)+o;if(30<s){var c=o-o%5;s=(r&(1<<c)-1).toString(32),r>>=c,o-=c,ti=1<<32-Er(t)+o|n<<o|r,ni=s+e}else ti=1<<s|n<<o|r,ni=e}function $u(e){e.return!==null&&(Xi(e,1),ca(e,1,0))}function Hu(e){for(;e===So;)So=Gi[--Ki],Gi[Ki]=null,Ul=Gi[--Ki],Gi[Ki]=null;for(;e===bi;)bi=ar[--cr],ar[cr]=null,ni=ar[--cr],ar[cr]=null,ti=ar[--cr],ar[cr]=null}var bn=null,Xn=null,Mt=!1,Tr=null;function Wu(e,t){var n=qr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function fa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,bn=e,Xn=Ci(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,bn=e,Xn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=bi!==null?{id:ti,overflow:ni}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=qr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,bn=e,Xn=null,!0):!1;default:return!1}}function qu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qu(e){if(Mt){var t=Xn;if(t){var n=t;if(!fa(e,t)){if(qu(e))throw Error(N(418));t=Ci(n.nextSibling);var r=bn;t&&fa(e,t)?Wu(r,n):(e.flags=e.flags&-4097|2,Mt=!1,bn=e)}}else{if(qu(e))throw Error(N(418));e.flags=e.flags&-4097|2,Mt=!1,bn=e}}}function da(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;bn=e}function Bl(e){if(e!==bn)return!1;if(!Mt)return da(e),Mt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Oi(e.type,e.memoizedProps)),t&&(t=Xn)){if(qu(e))throw pa(),Error(N(418));for(;t;)Wu(e,t),t=Ci(t.nextSibling)}if(da(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Xn=Ci(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Xn=null}}else Xn=bn?Ci(e.stateNode.nextSibling):null;return!0}function pa(){for(var e=Xn;e;)e=Ci(e.nextSibling)}function Li(){Xn=bn=null,Mt=!1}function tl(e){Tr===null?Tr=[e]:Tr.push(e)}var ec=pn.ReactCurrentBatchConfig;function fr(e,t){if(e&&e.defaultProps){t=g({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var nl=Zr(null),rl=null,wo=null,Vl=null;function $l(){Vl=wo=rl=null}function Yu(e){var t=nl.current;mt(nl),e._currentValue=t}function Gu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Oo(e,t){rl=e,Vl=wo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(h=!0),e.firstContext=null)}function dr(e){var t=e._currentValue;if(Vl!==e)if(e={context:e,memoizedValue:t,next:null},wo===null){if(rl===null)throw Error(N(308));wo=e,rl.dependencies={lanes:0,firstContext:e}}else wo=wo.next=e;return t}var Ji=null;function Hl(e){Ji===null?Ji=[e]:Ji.push(e)}function ha(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Hl(t)):(n.next=o.next,o.next=n),t.interleaved=n,ri(e,r)}function ri(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ii=!1;function Ku(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function va(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ii(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ai(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ut&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ri(e,n)}return o=r.interleaved,o===null?(t.next=t,Hl(r)):(t.next=o.next,o.next=t),r.interleaved=t,ri(e,n)}function Wl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Au(e,n)}}function bu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var c={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=c:s=s.next=c,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vn(e,t,n,r){var o=e.updateQueue;Ii=!1;var s=o.firstBaseUpdate,c=o.lastBaseUpdate,v=o.shared.pending;if(v!==null){o.shared.pending=null;var m=v,L=m.next;m.next=null,c===null?s=L:c.next=L,c=m;var $=e.alternate;$!==null&&($=$.updateQueue,v=$.lastBaseUpdate,v!==c&&(v===null?$.firstBaseUpdate=L:v.next=L,$.lastBaseUpdate=m))}if(s!==null){var W=o.baseState;c=0,$=L=m=null,v=s;do{var B=v.lane,se=v.eventTime;if((r&B)===B){$!==null&&($=$.next={eventTime:se,lane:0,tag:v.tag,payload:v.payload,callback:v.callback,next:null});e:{var fe=e,ve=v;switch(B=t,se=n,ve.tag){case 1:if(fe=ve.payload,typeof fe=="function"){W=fe.call(se,W,B);break e}W=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=ve.payload,B=typeof fe=="function"?fe.call(se,W,B):fe,B==null)break e;W=g({},W,B);break e;case 2:Ii=!0}}v.callback!==null&&v.lane!==0&&(e.flags|=64,B=o.effects,B===null?o.effects=[v]:B.push(v))}else se={eventTime:se,lane:B,tag:v.tag,payload:v.payload,callback:v.callback,next:null},$===null?(L=$=se,m=W):$=$.next=se,c|=B;if(v=v.next,v===null){if(v=o.shared.pending,v===null)break;B=v,v=B.next,B.next=null,o.lastBaseUpdate=B,o.shared.pending=null}}while(1);if($===null&&(m=W),o.baseState=m,o.firstBaseUpdate=L,o.lastBaseUpdate=$,t=o.shared.interleaved,t!==null){o=t;do c|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);ml|=c,e.lanes=c,e.memoizedState=W}}function Xu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(N(191,o));o.call(r)}}}var Ju=new Z.Component().refs;function ql(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:g({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var oi={isMounted:function(e){return(e=e._reactInternals)?Ar(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=tr(),o=Mo(e),s=ii(r,o);s.payload=t,n!=null&&(s.callback=n),t=Ai(e,s,o),t!==null&&(fi(t,e,o,r),Wl(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=tr(),o=Mo(e),s=ii(r,o);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Ai(e,s,o),t!==null&&(fi(t,e,o,r),Wl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tr(),r=Mo(e),o=ii(n,r);o.tag=2,t!=null&&(o.callback=t),t=Ai(e,o,r),t!==null&&(fi(t,e,r,n),Wl(t,e,r))}};function li(e,t,n,r,o,s,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,c):t.prototype&&t.prototype.isPureReactComponent?!Se(n,r)||!Se(o,s):!0}function Ql(e,t,n){var r=!1,o=Kn,s=t.contextType;return typeof s=="object"&&s!==null?s=dr(s):(o=Bn(t)?Pi:Yt.current,r=t.contextTypes,s=(r=r!=null)?ei(e,o):Kn),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=oi,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=s),t}function Zu(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&oi.enqueueReplaceState(t,t.state,null)}function es(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=Ju,Ku(e);var s=t.contextType;typeof s=="object"&&s!==null?o.context=dr(s):(s=Bn(t)?Pi:Yt.current,o.context=ei(e,s)),o.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(ql(e,t,s,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&oi.enqueueReplaceState(o,o.state,null),Vn(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Di(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(N(309));var r=n.stateNode}if(!r)throw Error(N(147,e));var o=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(c){var v=o.refs;v===Ju&&(v=o.refs={}),c===null?delete v[s]:v[s]=c},t._stringRef=s,t)}if(typeof e!="string")throw Error(N(284));if(!n._owner)throw Error(N(290,e))}return e}function il(e,t){throw e=Object.prototype.toString.call(t),Error(N(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ts(e){var t=e._init;return t(e._payload)}function ns(e){function t(O,E){if(e){var P=O.deletions;P===null?(O.deletions=[E],O.flags|=16):P.push(E)}}function n(O,E){if(!e)return null;for(;E!==null;)t(O,E),E=E.sibling;return null}function r(O,E){for(O=new Map;E!==null;)E.key!==null?O.set(E.key,E):O.set(E.index,E),E=E.sibling;return O}function o(O,E){return O=jo(O,E),O.index=0,O.sibling=null,O}function s(O,E,P){return O.index=P,e?(P=O.alternate,P!==null?(P=P.index,P<E?(O.flags|=2,E):P):(O.flags|=2,E)):(O.flags|=1048576,E)}function c(O){return e&&O.alternate===null&&(O.flags|=2),O}function v(O,E,P,Q){return E===null||E.tag!==6?(E=mc(P,O.mode,Q),E.return=O,E):(E=o(E,P),E.return=O,E)}function m(O,E,P,Q){var ge=P.type;return ge===Dn?$(O,E,P.props.children,Q,P.key):E!==null&&(E.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===hn&&ts(ge)===E.type)?(Q=o(E,P.props),Q.ref=Di(O,E,P),Q.return=O,Q):(Q=Aa(P.type,P.key,P.props,null,O.mode,Q),Q.ref=Di(O,E,P),Q.return=O,Q)}function L(O,E,P,Q){return E===null||E.tag!==4||E.stateNode.containerInfo!==P.containerInfo||E.stateNode.implementation!==P.implementation?(E=gc(P,O.mode,Q),E.return=O,E):(E=o(E,P.children||[]),E.return=O,E)}function $(O,E,P,Q,ge){return E===null||E.tag!==7?(E=Sl(P,O.mode,Q,ge),E.return=O,E):(E=o(E,P),E.return=O,E)}function W(O,E,P){if(typeof E=="string"&&E!==""||typeof E=="number")return E=mc(""+E,O.mode,P),E.return=O,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case On:return P=Aa(E.type,E.key,E.props,null,O.mode,P),P.ref=Di(O,null,E),P.return=O,P;case Rn:return E=gc(E,O.mode,P),E.return=O,E;case hn:var Q=E._init;return W(O,Q(E._payload),P)}if(Bo(E)||Re(E))return E=Sl(E,O.mode,P,null),E.return=O,E;il(O,E)}return null}function B(O,E,P,Q){var ge=E!==null?E.key:null;if(typeof P=="string"&&P!==""||typeof P=="number")return ge!==null?null:v(O,E,""+P,Q);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case On:return P.key===ge?m(O,E,P,Q):null;case Rn:return P.key===ge?L(O,E,P,Q):null;case hn:return ge=P._init,B(O,E,ge(P._payload),Q)}if(Bo(P)||Re(P))return ge!==null?null:$(O,E,P,Q,null);il(O,P)}return null}function se(O,E,P,Q,ge){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return O=O.get(P)||null,v(E,O,""+Q,ge);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case On:return O=O.get(Q.key===null?P:Q.key)||null,m(E,O,Q,ge);case Rn:return O=O.get(Q.key===null?P:Q.key)||null,L(E,O,Q,ge);case hn:var Pe=Q._init;return se(O,E,P,Pe(Q._payload),ge)}if(Bo(Q)||Re(Q))return O=O.get(P)||null,$(E,O,Q,ge,null);il(E,Q)}return null}function fe(O,E,P,Q){for(var ge=null,Pe=null,ke=E,Ue=E=0,wn=null;ke!==null&&Ue<P.length;Ue++){ke.index>Ue?(wn=ke,ke=null):wn=ke.sibling;var ct=B(O,ke,P[Ue],Q);if(ct===null){ke===null&&(ke=wn);break}e&&ke&&ct.alternate===null&&t(O,ke),E=s(ct,E,Ue),Pe===null?ge=ct:Pe.sibling=ct,Pe=ct,ke=wn}if(Ue===P.length)return n(O,ke),Mt&&Xi(O,Ue),ge;if(ke===null){for(;Ue<P.length;Ue++)ke=W(O,P[Ue],Q),ke!==null&&(E=s(ke,E,Ue),Pe===null?ge=ke:Pe.sibling=ke,Pe=ke);return Mt&&Xi(O,Ue),ge}for(ke=r(O,ke);Ue<P.length;Ue++)wn=se(ke,O,Ue,P[Ue],Q),wn!==null&&(e&&wn.alternate!==null&&ke.delete(wn.key===null?Ue:wn.key),E=s(wn,E,Ue),Pe===null?ge=wn:Pe.sibling=wn,Pe=wn);return e&&ke.forEach(function(zo){return t(O,zo)}),Mt&&Xi(O,Ue),ge}function ve(O,E,P,Q){var ge=Re(P);if(typeof ge!="function")throw Error(N(150));if(P=ge.call(P),P==null)throw Error(N(151));for(var Pe=ge=null,ke=E,Ue=E=0,wn=null,ct=P.next();ke!==null&&!ct.done;Ue++,ct=P.next()){ke.index>Ue?(wn=ke,ke=null):wn=ke.sibling;var zo=B(O,ke,ct.value,Q);if(zo===null){ke===null&&(ke=wn);break}e&&ke&&zo.alternate===null&&t(O,ke),E=s(zo,E,Ue),Pe===null?ge=zo:Pe.sibling=zo,Pe=zo,ke=wn}if(ct.done)return n(O,ke),Mt&&Xi(O,Ue),ge;if(ke===null){for(;!ct.done;Ue++,ct=P.next())ct=W(O,ct.value,Q),ct!==null&&(E=s(ct,E,Ue),Pe===null?ge=ct:Pe.sibling=ct,Pe=ct);return Mt&&Xi(O,Ue),ge}for(ke=r(O,ke);!ct.done;Ue++,ct=P.next())ct=se(ke,O,Ue,ct.value,Q),ct!==null&&(e&&ct.alternate!==null&&ke.delete(ct.key===null?Ue:ct.key),E=s(ct,E,Ue),Pe===null?ge=ct:Pe.sibling=ct,Pe=ct);return e&&ke.forEach(function(Af){return t(O,Af)}),Mt&&Xi(O,Ue),ge}function nn(O,E,P,Q){if(typeof P=="object"&&P!==null&&P.type===Dn&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case On:e:{for(var ge=P.key,Pe=E;Pe!==null;){if(Pe.key===ge){if(ge=P.type,ge===Dn){if(Pe.tag===7){n(O,Pe.sibling),E=o(Pe,P.props.children),E.return=O,O=E;break e}}else if(Pe.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===hn&&ts(ge)===Pe.type){n(O,Pe.sibling),E=o(Pe,P.props),E.ref=Di(O,Pe,P),E.return=O,O=E;break e}n(O,Pe);break}else t(O,Pe);Pe=Pe.sibling}P.type===Dn?(E=Sl(P.props.children,O.mode,Q,P.key),E.return=O,O=E):(Q=Aa(P.type,P.key,P.props,null,O.mode,Q),Q.ref=Di(O,E,P),Q.return=O,O=Q)}return c(O);case Rn:e:{for(Pe=P.key;E!==null;){if(E.key===Pe)if(E.tag===4&&E.stateNode.containerInfo===P.containerInfo&&E.stateNode.implementation===P.implementation){n(O,E.sibling),E=o(E,P.children||[]),E.return=O,O=E;break e}else{n(O,E);break}else t(O,E);E=E.sibling}E=gc(P,O.mode,Q),E.return=O,O=E}return c(O);case hn:return Pe=P._init,nn(O,E,Pe(P._payload),Q)}if(Bo(P))return fe(O,E,P,Q);if(Re(P))return ve(O,E,P,Q);il(O,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,E!==null&&E.tag===6?(n(O,E.sibling),E=o(E,P),E.return=O,O=E):(n(O,E),E=mc(P,O.mode,Q),E.return=O,O=E),c(O)):n(O,E)}return nn}var Vr=ns(!0),Zi=ns(!1),Ro={},Jn=Zr(Ro),ui=Zr(Ro),Mi=Zr(Ro);function xi(e){if(e===Ro)throw Error(N(174));return e}function Yl(e,t){switch(wt(Mi,t),wt(ui,e),wt(Jn,Ro),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gu(t,e)}mt(Jn),wt(Jn,t)}function eo(){mt(Jn),mt(ui),mt(Mi)}function Gl(e){xi(Mi.current);var t=xi(Jn.current),n=gu(t,e.type);t!==n&&(wt(ui,e),wt(Jn,n))}function Kl(e){ui.current===e&&(mt(Jn),mt(ui))}var xt=Zr(0);function ol(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Co=[];function to(){for(var e=0;e<Co.length;e++)Co[e]._workInProgressVersionPrimary=null;Co.length=0}var ji=pn.ReactCurrentDispatcher,ll=pn.ReactCurrentBatchConfig,$r=0,Ot=null,Bt=null,Gt=null,ul=!1,sl=!1,al=0,rs=0;function tn(){throw Error(N(321))}function no(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!G(e[n],t[n]))return!1;return!0}function To(e,t,n,r,o,s){if($r=s,Ot=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ji.current=e===null||e.memoizedState===null?tc:iu,e=n(r,o),sl){s=0;do{if(sl=!1,al=0,25<=s)throw Error(N(301));s+=1,Gt=Bt=null,t.updateQueue=null,ji.current=ga,e=n(r,o)}while(sl)}if(ji.current=ru,t=Bt!==null&&Bt.next!==null,$r=0,Gt=Bt=Ot=null,ul=!1,t)throw Error(N(300));return e}function bl(){var e=al!==0;return al=0,e}function Zn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gt===null?Ot.memoizedState=Gt=e:Gt=Gt.next=e,Gt}function er(){if(Bt===null){var e=Ot.alternate;e=e!==null?e.memoizedState:null}else e=Bt.next;var t=Gt===null?Ot.memoizedState:Gt.next;if(t!==null)Gt=t,Bt=e;else{if(e===null)throw Error(N(310));Bt=e,e={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},Gt===null?Ot.memoizedState=Gt=e:Gt=Gt.next=e}return Gt}function Po(e,t){return typeof t=="function"?t(e):t}function Xl(e){var t=er(),n=t.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=e;var r=Bt,o=r.baseQueue,s=n.pending;if(s!==null){if(o!==null){var c=o.next;o.next=s.next,s.next=c}r.baseQueue=o=s,n.pending=null}if(o!==null){s=o.next,r=r.baseState;var v=c=null,m=null,L=s;do{var $=L.lane;if(($r&$)===$)m!==null&&(m=m.next={lane:0,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),r=L.hasEagerState?L.eagerState:e(r,L.action);else{var W={lane:$,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null};m===null?(v=m=W,c=r):m=m.next=W,Ot.lanes|=$,ml|=$}L=L.next}while(L!==null&&L!==s);m===null?c=r:m.next=v,G(r,t.memoizedState)||(h=!0),t.memoizedState=r,t.baseState=c,t.baseQueue=m,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do s=o.lane,Ot.lanes|=s,ml|=s,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ko(e){var t=er(),n=t.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,s=t.memoizedState;if(o!==null){n.pending=null;var c=o=o.next;do s=e(s,c.action),c=c.next;while(c!==o);G(s,t.memoizedState)||(h=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function is(){}function os(e,t){var n=Ot,r=er(),o=t(),s=!G(r.memoizedState,o);if(s&&(r.memoizedState=o,h=!0),r=r.queue,Lo(cl.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Gt!==null&&Gt.memoizedState.tag&1){if(n.flags|=2048,No(9,us.bind(null,n,r,o,t),void 0,null),Sn===null)throw Error(N(349));$r&30||ls(n,t,o)}return o}function ls(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ot.updateQueue,t===null?(t={lastEffect:null,stores:null},Ot.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function us(e,t,n,r){t.value=n,t.getSnapshot=r,ss(t)&&Jl(e)}function cl(e,t,n){return n(function(){ss(t)&&Jl(e)})}function ss(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!G(e,n)}catch{return!0}}function Jl(e){var t=ri(e,1);t!==null&&fi(t,e,1,-1)}function as(e){var t=Zn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t.queue=e,e=e.dispatch=nu.bind(null,Ot,e),[t.memoizedState,e]}function No(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ot.updateQueue,t===null?(t={lastEffect:null,stores:null},Ot.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Zl(){return er().memoizedState}function fl(e,t,n,r){var o=Zn();Ot.flags|=e,o.memoizedState=No(1|t,n,void 0,r===void 0?null:r)}function dl(e,t,n,r){var o=er();r=r===void 0?null:r;var s=void 0;if(Bt!==null){var c=Bt.memoizedState;if(s=c.destroy,r!==null&&no(r,c.deps)){o.memoizedState=No(t,n,s,r);return}}Ot.flags|=e,o.memoizedState=No(1|t,n,s,r)}function pl(e,t){return fl(8390656,8,e,t)}function Lo(e,t){return dl(2048,8,e,t)}function cs(e,t){return dl(4,2,e,t)}function fs(e,t){return dl(4,4,e,t)}function ds(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function eu(e,t,n){return n=n!=null?n.concat([e]):null,dl(4,4,ds.bind(null,t,e),n)}function tu(){}function ps(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&no(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hl(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&no(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function hs(e,t,n){return $r&21?(G(n,t)||(n=bs(),Ot.lanes|=n,ml|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,h=!0),e.memoizedState=n)}function ya(e,t){var n=ft;ft=n!==0&&4>n?n:4,e(!0);var r=ll.transition;ll.transition={};try{e(!1),t()}finally{ft=n,ll.transition=r}}function vl(){return er().memoizedState}function yl(e,t,n){var r=Mo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},vs(e))ys(t,n);else if(n=ha(e,t,n,r),n!==null){var o=tr();fi(n,e,r,o),ma(n,t,r)}}function nu(e,t,n){var r=Mo(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(vs(e))ys(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var c=t.lastRenderedState,v=s(c,n);if(o.hasEagerState=!0,o.eagerState=v,G(v,c)){var m=t.interleaved;m===null?(o.next=o,Hl(t)):(o.next=m.next,m.next=o),t.interleaved=o;return}}catch{}finally{}n=ha(e,t,o,r),n!==null&&(o=tr(),fi(n,e,r,o),ma(n,t,r))}}function vs(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function ys(e,t){sl=ul=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ma(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Au(e,n)}}var ru={readContext:dr,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useInsertionEffect:tn,useLayoutEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useMutableSource:tn,useSyncExternalStore:tn,useId:tn,unstable_isNewReconciler:!1},tc={readContext:dr,useCallback:function(e,t){return Zn().memoizedState=[e,t===void 0?null:t],e},useContext:dr,useEffect:pl,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fl(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fl(4194308,4,e,t)},useInsertionEffect:function(e,t){return fl(4,2,e,t)},useMemo:function(e,t){var n=Zn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Zn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yl.bind(null,Ot,e),[r.memoizedState,e]},useRef:function(e){var t=Zn();return e={current:e},t.memoizedState=e},useState:as,useDebugValue:tu,useDeferredValue:function(e){return Zn().memoizedState=e},useTransition:function(){var e=as(!1),t=e[0];return e=ya.bind(null,e[1]),Zn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ot,o=Zn();if(Mt){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),Sn===null)throw Error(N(349));$r&30||ls(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,pl(cl.bind(null,r,s,e),[e]),r.flags|=2048,No(9,us.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Zn(),t=Sn.identifierPrefix;if(Mt){var n=ni,r=ti;n=(r&~(1<<32-Er(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=al++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=rs++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},iu={readContext:dr,useCallback:ps,useContext:dr,useEffect:Lo,useImperativeHandle:eu,useInsertionEffect:cs,useLayoutEffect:fs,useMemo:hl,useReducer:Xl,useRef:Zl,useState:function(){return Xl(Po)},useDebugValue:tu,useDeferredValue:function(e){var t=er();return hs(t,Bt.memoizedState,e)},useTransition:function(){var e=Xl(Po)[0],t=er().memoizedState;return[e,t]},useMutableSource:is,useSyncExternalStore:os,useId:vl,unstable_isNewReconciler:!1},ga={readContext:dr,useCallback:ps,useContext:dr,useEffect:Lo,useImperativeHandle:eu,useInsertionEffect:cs,useLayoutEffect:fs,useMemo:hl,useReducer:ko,useRef:Zl,useState:function(){return ko(Po)},useDebugValue:tu,useDeferredValue:function(e){var t=er();return Bt===null?t.memoizedState=e:hs(t,Bt.memoizedState,e)},useTransition:function(){var e=ko(Po)[0],t=er().memoizedState;return[e,t]},useMutableSource:is,useSyncExternalStore:os,useId:vl,unstable_isNewReconciler:!1};function ro(e,t){try{var n="",r=t;do n+=it(r),r=r.return;while(r);var o=n}catch(s){o=`
39
+ Error generating stack: `+s.message+`
40
+ `+s.stack}return{value:e,source:t,stack:o,digest:null}}function ou(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function lu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var _a=typeof WeakMap=="function"?WeakMap:Map;function uu(e,t,n){n=ii(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ta||(Ta=!0,ac=r),lu(e,t)},n}function ms(e,t,n){n=ii(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){lu(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){lu(e,t),typeof r!="function"&&(Ao===null?Ao=new Set([this]):Ao.add(this));var c=t.stack;this.componentDidCatch(t.value,{componentStack:c!==null?c:""})}),n}function gs(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new _a;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Sf.bind(null,e,t,n),t.then(e,e))}function Ea(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function a(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ii(-1,1),t.tag=2,Ai(n,t,1))),n.lanes|=1),e)}var d=pn.ReactCurrentOwner,h=!1;function y(e,t,n,r){t.child=e===null?Zi(t,null,n,r):Vr(t,e.child,n,r)}function k(e,t,n,r,o){n=n.render;var s=t.ref;return Oo(t,o),r=To(e,t,n,r,s,o),n=bl(),e!==null&&!h?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,kr(e,t,o)):(Mt&&n&&$u(t),t.flags|=1,y(e,t,r,o),t.child)}function T(e,t,n,r,o){if(e===null){var s=n.type;return typeof s=="function"&&!yc(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,A(e,t,s,r,o)):(e=Aa(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&o)){var c=s.memoizedProps;if(n=n.compare,n=n!==null?n:Se,n(c,r)&&e.ref===t.ref)return kr(e,t,o)}return t.flags|=1,e=jo(s,r),e.ref=t.ref,e.return=t,t.child=e}function A(e,t,n,r,o){if(e!==null){var s=e.memoizedProps;if(Se(s,r)&&e.ref===t.ref)if(h=!1,t.pendingProps=r=s,(e.lanes&o)!==0)e.flags&131072&&(h=!0);else return t.lanes=e.lanes,kr(e,t,o)}return he(e,t,n,r,o)}function x(e,t,n){var r=t.pendingProps,o=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(cu,Nr),Nr|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,wt(cu,Nr),Nr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,wt(cu,Nr),Nr|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,wt(cu,Nr),Nr|=r;return y(e,t,o,n),t.child}function ee(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function he(e,t,n,r,o){var s=Bn(n)?Pi:Yt.current;return s=ei(t,s),Oo(t,o),n=To(e,t,n,r,s,o),r=bl(),e!==null&&!h?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,kr(e,t,o)):(Mt&&r&&$u(t),t.flags|=1,y(e,t,n,o),t.child)}function ne(e,t,n,r,o){if(Bn(n)){var s=!0;Fl(t)}else s=!1;if(Oo(t,o),t.stateNode===null)si(e,t),Ql(t,n,r),es(t,n,r,o),r=!0;else if(e===null){var c=t.stateNode,v=t.memoizedProps;c.props=v;var m=c.context,L=n.contextType;typeof L=="object"&&L!==null?L=dr(L):(L=Bn(n)?Pi:Yt.current,L=ei(t,L));var $=n.getDerivedStateFromProps,W=typeof $=="function"||typeof c.getSnapshotBeforeUpdate=="function";W||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(v!==r||m!==L)&&Zu(t,c,r,L),Ii=!1;var B=t.memoizedState;c.state=B,Vn(t,r,c,o),m=t.memoizedState,v!==r||B!==m||En.current||Ii?(typeof $=="function"&&(ql(t,n,$,r),m=t.memoizedState),(v=Ii||li(t,n,v,r,B,m,L))?(W||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=m),c.props=r,c.state=m,c.context=L,r=v):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{c=t.stateNode,va(e,t),v=t.memoizedProps,L=t.type===t.elementType?v:fr(t.type,v),c.props=L,W=t.pendingProps,B=c.context,m=n.contextType,typeof m=="object"&&m!==null?m=dr(m):(m=Bn(n)?Pi:Yt.current,m=ei(t,m));var se=n.getDerivedStateFromProps;($=typeof se=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(v!==W||B!==m)&&Zu(t,c,r,m),Ii=!1,B=t.memoizedState,c.state=B,Vn(t,r,c,o);var fe=t.memoizedState;v!==W||B!==fe||En.current||Ii?(typeof se=="function"&&(ql(t,n,se,r),fe=t.memoizedState),(L=Ii||li(t,n,L,r,B,fe,m)||!1)?($||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(r,fe,m),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(r,fe,m)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||v===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=fe),c.props=r,c.state=fe,c.context=m,r=L):(typeof c.componentDidUpdate!="function"||v===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),r=!1)}return Le(e,t,n,r,s,o)}function Le(e,t,n,r,o,s){ee(e,t);var c=(t.flags&128)!==0;if(!r&&!c)return o&&sa(t,n,!1),kr(e,t,s);r=t.stateNode,d.current=t;var v=c&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&c?(t.child=Vr(t,e.child,null,s),t.child=Vr(t,null,v,s)):y(e,t,v,s),t.memoizedState=r.state,o&&sa(t,n,!0),t.child}function Rt(e){var t=e.stateNode;t.pendingContext?_o(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_o(e,t.context,!1),Yl(e,t.containerInfo)}function cn(e,t,n,r,o){return Li(),tl(o),t.flags|=256,y(e,t,n,r),t.child}var pr={dehydrated:null,treeContext:null,retryLane:0};function $n(e){return{baseLanes:e,cachePool:null,transitions:null}}function Pr(e,t,n){var r=t.pendingProps,o=xt.current,s=!1,c=(t.flags&128)!==0,v;if((v=c)||(v=e!==null&&e.memoizedState===null?!1:(o&2)!==0),v?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),wt(xt,o&1),e===null)return Qu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(c=r.children,e=r.fallback,s?(r=t.mode,s=t.child,c={mode:"hidden",children:c},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=c):s=Da(c,r,0,null),e=Sl(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=$n(n),t.memoizedState=pr,e):_s(t,c));if(o=e.memoizedState,o!==null&&(v=o.dehydrated,v!==null))return jt(e,t,c,r,v,o,n);if(s){s=r.fallback,c=t.mode,o=e.child,v=o.sibling;var m={mode:"hidden",children:r.children};return!(c&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=m,t.deletions=null):(r=jo(o,m),r.subtreeFlags=o.subtreeFlags&14680064),v!==null?s=jo(v,s):(s=Sl(s,c,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,c=e.child.memoizedState,c=c===null?$n(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},s.memoizedState=c,s.childLanes=e.childLanes&~n,t.memoizedState=pr,r}return s=e.child,e=s.sibling,r=jo(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function _s(e,t){return t=Da({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function su(e,t,n,r){return r!==null&&tl(r),Vr(t,e.child,null,n),e=_s(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jt(e,t,n,r,o,s,c){if(n)return t.flags&256?(t.flags&=-257,r=ou(Error(N(422))),su(e,t,c,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,o=t.mode,r=Da({mode:"visible",children:r.children},o,0,null),s=Sl(s,o,c,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Vr(t,e.child,null,c),t.child.memoizedState=$n(c),t.memoizedState=pr,s);if(!(t.mode&1))return su(e,t,c,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var v=r.dgst;return r=v,s=Error(N(419)),r=ou(s,r,void 0),su(e,t,c,r)}if(v=(c&e.childLanes)!==0,h||v){if(r=Sn,r!==null){switch(c&-c){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|c)?0:o,o!==0&&o!==s.retryLane&&(s.retryLane=o,ri(e,o),fi(r,e,o,-1))}return vc(),r=ou(Error(N(421))),su(e,t,c,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=wf.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,Xn=Ci(o.nextSibling),bn=t,Mt=!0,Tr=null,e!==null&&(ar[cr++]=ti,ar[cr++]=ni,ar[cr++]=bi,ti=e.id,ni=e.overflow,bi=t),t=_s(t,r.children),t.flags|=4096,t)}function zt(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gu(e.return,t,n)}function Xt(e,t,n,r,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=o)}function Hr(e,t,n){var r=t.pendingProps,o=r.revealOrder,s=r.tail;if(y(e,t,r.children,n),r=xt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zt(e,n,t);else if(e.tag===19)zt(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(wt(xt,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&ol(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Xt(t,!1,o,n,s);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&ol(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Xt(t,!0,n,null,s);break;case"together":Xt(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function si(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function kr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ml|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(N(153));if(t.child!==null){for(e=t.child,n=jo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=jo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Es(e,t,n){switch(t.tag){case 3:Rt(t),Li();break;case 5:Gl(t);break;case 1:Bn(t.type)&&Fl(t);break;case 4:Yl(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;wt(nl,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(wt(xt,xt.current&1),t.flags|=128,null):n&t.child.childLanes?Pr(e,t,n):(wt(xt,xt.current&1),e=kr(e,t,n),e!==null?e.sibling:null);wt(xt,xt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Hr(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),wt(xt,xt.current),r)break;return null;case 22:case 23:return t.lanes=0,x(e,t,n)}return kr(e,t,n)}var Sa,Ss,Tc,Pc;Sa=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ss=function(){},Tc=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,xi(Jn.current);var s=null;switch(n){case"input":o=pu(e,o),r=pu(e,r),s=[];break;case"select":o=g({},o,{value:void 0}),r=g({},r,{value:void 0}),s=[];break;case"textarea":o=mu(e,o),r=mu(e,r),s=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=an)}_u(n,r);var c;n=null;for(L in o)if(!r.hasOwnProperty(L)&&o.hasOwnProperty(L)&&o[L]!=null)if(L==="style"){var v=o[L];for(c in v)v.hasOwnProperty(c)&&(n||(n={}),n[c]="")}else L!=="dangerouslySetInnerHTML"&&L!=="children"&&L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&L!=="autoFocus"&&(Ie.hasOwnProperty(L)?s||(s=[]):(s=s||[]).push(L,null));for(L in r){var m=r[L];if(v=o!=null?o[L]:void 0,r.hasOwnProperty(L)&&m!==v&&(m!=null||v!=null))if(L==="style")if(v){for(c in v)!v.hasOwnProperty(c)||m&&m.hasOwnProperty(c)||(n||(n={}),n[c]="");for(c in m)m.hasOwnProperty(c)&&v[c]!==m[c]&&(n||(n={}),n[c]=m[c])}else n||(s||(s=[]),s.push(L,n)),n=m;else L==="dangerouslySetInnerHTML"?(m=m?m.__html:void 0,v=v?v.__html:void 0,m!=null&&v!==m&&(s=s||[]).push(L,m)):L==="children"?typeof m!="string"&&typeof m!="number"||(s=s||[]).push(L,""+m):L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&(Ie.hasOwnProperty(L)?(m!=null&&L==="onScroll"&&ue("scroll",e),s||v===m||(s=[])):(s=s||[]).push(L,m))}n&&(s=s||[]).push("style",n);var L=s;(t.updateQueue=L)&&(t.flags|=4)}},Pc=function(e,t,n,r){n!==r&&(t.flags|=4)};function ws(e,t){if(!Mt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Hn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ff(e,t,n){var r=t.pendingProps;switch(Hu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hn(t),null;case 1:return Bn(t.type)&&zl(),Hn(t),null;case 3:return r=t.stateNode,eo(),mt(En),mt(Yt),to(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Bl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tr!==null&&(dc(Tr),Tr=null))),Ss(e,t),Hn(t),null;case 5:Kl(t);var o=xi(Mi.current);if(n=t.type,e!==null&&t.stateNode!=null)Tc(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(N(166));return Hn(t),null}if(e=xi(Jn.current),Bl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Fr]=t,r[el]=s,e=(t.mode&1)!==0,n){case"dialog":ue("cancel",r),ue("close",r);break;case"iframe":case"object":case"embed":ue("load",r);break;case"video":case"audio":for(o=0;o<at.length;o++)ue(at[o],r);break;case"source":ue("error",r);break;case"img":case"image":case"link":ue("error",r),ue("load",r);break;case"details":ue("toggle",r);break;case"input":hu(r,s),ue("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ue("invalid",r);break;case"textarea":Ms(r,s),ue("invalid",r)}_u(n,s),o=null;for(var c in s)if(s.hasOwnProperty(c)){var v=s[c];c==="children"?typeof v=="string"?r.textContent!==v&&(s.suppressHydrationWarning!==!0&&pt(r.textContent,v,e),o=["children",v]):typeof v=="number"&&r.textContent!==""+v&&(s.suppressHydrationWarning!==!0&&pt(r.textContent,v,e),o=["children",""+v]):Ie.hasOwnProperty(c)&&v!=null&&c==="onScroll"&&ue("scroll",r)}switch(n){case"input":Ui(r),Ds(r,s,!0);break;case"textarea":Ui(r),pi(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=an)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=js(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),n==="select"&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Fr]=t,e[el]=r,Sa(e,t,!1,!1),t.stateNode=e;e:{switch(c=hi(n,r),n){case"dialog":ue("cancel",e),ue("close",e),o=r;break;case"iframe":case"object":case"embed":ue("load",e),o=r;break;case"video":case"audio":for(o=0;o<at.length;o++)ue(at[o],e);o=r;break;case"source":ue("error",e),o=r;break;case"img":case"image":case"link":ue("error",e),ue("load",e),o=r;break;case"details":ue("toggle",e),o=r;break;case"input":hu(e,r),o=pu(e,r),ue("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=g({},r,{value:void 0}),ue("invalid",e);break;case"textarea":Ms(e,r),o=mu(e,r),ue("invalid",e);break;default:o=r}_u(n,o),v=o;for(s in v)if(v.hasOwnProperty(s)){var m=v[s];s==="style"?Us(e,m):s==="dangerouslySetInnerHTML"?(m=m?m.__html:void 0,m!=null&&zs(e,m)):s==="children"?typeof m=="string"?(n!=="textarea"||m!=="")&&Vo(e,m):typeof m=="number"&&Vo(e,""+m):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ie.hasOwnProperty(s)?m!=null&&s==="onScroll"&&ue("scroll",e):m!=null&&ir(e,s,m,c))}switch(n){case"input":Ui(e),Ds(e,r,!1);break;case"textarea":Ui(e),pi(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ge(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?lo(e,!!r.multiple,s,!1):r.defaultValue!=null&&lo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=an)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Hn(t),null;case 6:if(e&&t.stateNode!=null)Pc(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(N(166));if(n=xi(Mi.current),xi(Jn.current),Bl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Fr]=t,(s=r.nodeValue!==n)&&(e=bn,e!==null))switch(e.tag){case 3:pt(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&pt(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Fr]=t,t.stateNode=r}return Hn(t),null;case 13:if(mt(xt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Mt&&Xn!==null&&t.mode&1&&!(t.flags&128))pa(),Li(),t.flags|=98560,s=!1;else if(s=Bl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(N(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(N(317));s[Fr]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hn(t),s=!1}else Tr!==null&&(dc(Tr),Tr=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||xt.current&1?fn===0&&(fn=3):vc())),t.updateQueue!==null&&(t.flags|=4),Hn(t),null);case 4:return eo(),Ss(e,t),e===null&&Nn(t.stateNode.containerInfo),Hn(t),null;case 10:return Yu(t.type._context),Hn(t),null;case 17:return Bn(t.type)&&zl(),Hn(t),null;case 19:if(mt(xt),s=t.memoizedState,s===null)return Hn(t),null;if(r=(t.flags&128)!==0,c=s.rendering,c===null)if(r)ws(s,!1);else{if(fn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=ol(e),c!==null){for(t.flags|=128,ws(s,!1),r=c.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return wt(xt,xt.current&1|2),t.child}e=e.sibling}s.tail!==null&&Vt()>fu&&(t.flags|=128,r=!0,ws(s,!1),t.lanes=4194304)}else{if(!r)if(e=ol(c),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ws(s,!0),s.tail===null&&s.tailMode==="hidden"&&!c.alternate&&!Mt)return Hn(t),null}else 2*Vt()-s.renderingStartTime>fu&&n!==1073741824&&(t.flags|=128,r=!0,ws(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n!==null?n.sibling=c:t.child=c,s.last=c)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Vt(),t.sibling=null,n=xt.current,wt(xt,r?n&1|2:n&1),t):(Hn(t),null);case 22:case 23:return hc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Nr&1073741824&&(Hn(t),t.subtreeFlags&6&&(t.flags|=8192)):Hn(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function df(e,t){switch(Hu(t),t.tag){case 1:return Bn(t.type)&&zl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return eo(),mt(En),mt(Yt),to(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Kl(t),null;case 13:if(mt(xt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return mt(xt),null;case 4:return eo(),null;case 10:return Yu(t.type._context),null;case 22:case 23:return hc(),null;case 24:return null;default:return null}}var wa=!1,Wn=!1,pf=typeof WeakSet=="function"?WeakSet:Set,ce=null;function au(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Jt(e,t,r)}else n.current=null}function nc(e,t,n){try{n()}catch(r){Jt(e,t,r)}}var kc=!1;function hf(e,t){if(Yn=Mn,e=Ye(),rt(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var c=0,v=-1,m=-1,L=0,$=0,W=e,B=null;t:for(;;){for(var se;W!==n||o!==0&&W.nodeType!==3||(v=c+o),W!==s||r!==0&&W.nodeType!==3||(m=c+r),W.nodeType===3&&(c+=W.nodeValue.length),(se=W.firstChild)!==null;)B=W,W=se;for(;;){if(W===e)break t;if(B===n&&++L===o&&(v=c),B===s&&++$===r&&(m=c),(se=W.nextSibling)!==null)break;W=B,B=W.parentNode}W=se}n=v===-1||m===-1?null:{start:v,end:m}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yi={focusedElem:e,selectionRange:n},Mn=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var fe=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(fe!==null){var ve=fe.memoizedProps,nn=fe.memoizedState,O=t.stateNode,E=O.getSnapshotBeforeUpdate(t.elementType===t.type?ve:fr(t.type,ve),nn);O.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var P=t.stateNode.containerInfo;P.nodeType===1?P.textContent="":P.nodeType===9&&P.documentElement&&P.removeChild(P.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(Q){Jt(t,t.return,Q)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return fe=kc,kc=!1,fe}function Os(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&nc(t,n,s)}o=o.next}while(o!==r)}}function Oa(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function rc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Nc(e){var t=e.alternate;t!==null&&(e.alternate=null,Nc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fr],delete t[el],delete t[Vu],delete t[Ur],delete t[xl])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Lc(e){return e.tag===5||e.tag===3||e.tag===4}function Ic(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ic(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=an));else if(r!==4&&(e=e.child,e!==null))for(ic(e,t,n),e=e.sibling;e!==null;)ic(e,t,n),e=e.sibling}function oc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(oc(e,t,n),e=e.sibling;e!==null;)oc(e,t,n),e=e.sibling}var In=null,ai=!1;function Io(e,t,n){for(n=n.child;n!==null;)Ac(e,t,n),n=n.sibling}function Ac(e,t,n){if(Qn&&typeof Qn.onCommitFiberUnmount=="function")try{Qn.onCommitFiberUnmount(Rl,n)}catch{}switch(n.tag){case 5:Wn||au(n,t);case 6:var r=In,o=ai;In=null,Io(e,t,n),In=r,ai=o,In!==null&&(ai?(e=In,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):In.removeChild(n.stateNode));break;case 18:In!==null&&(ai?(e=In,n=n.stateNode,e.nodeType===8?Rr(e.parentNode,n):e.nodeType===1&&Rr(e,n),Kr(e)):Rr(In,n.stateNode));break;case 4:r=In,o=ai,In=n.stateNode.containerInfo,ai=!0,Io(e,t,n),In=r,ai=o;break;case 0:case 11:case 14:case 15:if(!Wn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,c=s.destroy;s=s.tag,c!==void 0&&(s&2||s&4)&&nc(n,t,c),o=o.next}while(o!==r)}Io(e,t,n);break;case 1:if(!Wn&&(au(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(v){Jt(n,t,v)}Io(e,t,n);break;case 21:Io(e,t,n);break;case 22:n.mode&1?(Wn=(r=Wn)||n.memoizedState!==null,Io(e,t,n),Wn=r):Io(e,t,n);break;default:Io(e,t,n)}}function Dc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new pf),t.forEach(function(r){var o=Of.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ci(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var s=e,c=t,v=c;e:for(;v!==null;){switch(v.tag){case 5:In=v.stateNode,ai=!1;break e;case 3:In=v.stateNode.containerInfo,ai=!0;break e;case 4:In=v.stateNode.containerInfo,ai=!0;break e}v=v.return}if(In===null)throw Error(N(160));Ac(s,c,o),In=null,ai=!1;var m=o.alternate;m!==null&&(m.return=null),o.return=null}catch(L){Jt(o,t,L)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Mc(t,e),t=t.sibling}function Mc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ci(t,e),zi(e),r&4){try{Os(3,e,e.return),Oa(3,e)}catch(ve){Jt(e,e.return,ve)}try{Os(5,e,e.return)}catch(ve){Jt(e,e.return,ve)}}break;case 1:ci(t,e),zi(e),r&512&&n!==null&&au(n,n.return);break;case 5:if(ci(t,e),zi(e),r&512&&n!==null&&au(n,n.return),e.flags&32){var o=e.stateNode;try{Vo(o,"")}catch(ve){Jt(e,e.return,ve)}}if(r&4&&(o=e.stateNode,o!=null)){var s=e.memoizedProps,c=n!==null?n.memoizedProps:s,v=e.type,m=e.updateQueue;if(e.updateQueue=null,m!==null)try{v==="input"&&s.type==="radio"&&s.name!=null&&As(o,s),hi(v,c);var L=hi(v,s);for(c=0;c<m.length;c+=2){var $=m[c],W=m[c+1];$==="style"?Us(o,W):$==="dangerouslySetInnerHTML"?zs(o,W):$==="children"?Vo(o,W):ir(o,$,W,L)}switch(v){case"input":vu(o,s);break;case"textarea":xs(o,s);break;case"select":var B=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!s.multiple;var se=s.value;se!=null?lo(o,!!s.multiple,se,!1):B!==!!s.multiple&&(s.defaultValue!=null?lo(o,!!s.multiple,s.defaultValue,!0):lo(o,!!s.multiple,s.multiple?[]:"",!1))}o[el]=s}catch(ve){Jt(e,e.return,ve)}}break;case 6:if(ci(t,e),zi(e),r&4){if(e.stateNode===null)throw Error(N(162));o=e.stateNode,s=e.memoizedProps;try{o.nodeValue=s}catch(ve){Jt(e,e.return,ve)}}break;case 3:if(ci(t,e),zi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Kr(t.containerInfo)}catch(ve){Jt(e,e.return,ve)}break;case 4:ci(t,e),zi(e);break;case 13:ci(t,e),zi(e),o=e.child,o.flags&8192&&(s=o.memoizedState!==null,o.stateNode.isHidden=s,!s||o.alternate!==null&&o.alternate.memoizedState!==null||(sc=Vt())),r&4&&Dc(e);break;case 22:if($=n!==null&&n.memoizedState!==null,e.mode&1?(Wn=(L=Wn)||$,ci(t,e),Wn=L):ci(t,e),zi(e),r&8192){if(L=e.memoizedState!==null,(e.stateNode.isHidden=L)&&!$&&e.mode&1)for(ce=e,$=e.child;$!==null;){for(W=ce=$;ce!==null;){switch(B=ce,se=B.child,B.tag){case 0:case 11:case 14:case 15:Os(4,B,B.return);break;case 1:au(B,B.return);var fe=B.stateNode;if(typeof fe.componentWillUnmount=="function"){r=B,n=B.return;try{t=r,fe.props=t.memoizedProps,fe.state=t.memoizedState,fe.componentWillUnmount()}catch(ve){Jt(r,n,ve)}}break;case 5:au(B,B.return);break;case 22:if(B.memoizedState!==null){zc(W);continue}}se!==null?(se.return=B,ce=se):zc(W)}$=$.sibling}e:for($=null,W=e;;){if(W.tag===5){if($===null){$=W;try{o=W.stateNode,L?(s=o.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(v=W.stateNode,m=W.memoizedProps.style,c=m!=null&&m.hasOwnProperty("display")?m.display:null,v.style.display=Fs("display",c))}catch(ve){Jt(e,e.return,ve)}}}else if(W.tag===6){if($===null)try{W.stateNode.nodeValue=L?"":W.memoizedProps}catch(ve){Jt(e,e.return,ve)}}else if((W.tag!==22&&W.tag!==23||W.memoizedState===null||W===e)&&W.child!==null){W.child.return=W,W=W.child;continue}if(W===e)break e;for(;W.sibling===null;){if(W.return===null||W.return===e)break e;$===W&&($=null),W=W.return}$===W&&($=null),W.sibling.return=W.return,W=W.sibling}}break;case 19:ci(t,e),zi(e),r&4&&Dc(e);break;case 21:break;default:ci(t,e),zi(e)}}function zi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Lc(n)){var r=n;break e}n=n.return}throw Error(N(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Vo(o,""),r.flags&=-33);var s=Ic(e);oc(e,s,o);break;case 3:case 4:var c=r.stateNode.containerInfo,v=Ic(e);ic(e,v,c);break;default:throw Error(N(161))}}catch(m){Jt(e,e.return,m)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vf(e,t,n){ce=e,xc(e)}function xc(e,t,n){for(var r=(e.mode&1)!==0;ce!==null;){var o=ce,s=o.child;if(o.tag===22&&r){var c=o.memoizedState!==null||wa;if(!c){var v=o.alternate,m=v!==null&&v.memoizedState!==null||Wn;v=wa;var L=Wn;if(wa=c,(Wn=m)&&!L)for(ce=o;ce!==null;)c=ce,m=c.child,c.tag===22&&c.memoizedState!==null?Fc(o):m!==null?(m.return=c,ce=m):Fc(o);for(;s!==null;)ce=s,xc(s),s=s.sibling;ce=o,wa=v,Wn=L}jc(e)}else o.subtreeFlags&8772&&s!==null?(s.return=o,ce=s):jc(e)}}function jc(e){for(;ce!==null;){var t=ce;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Wn||Oa(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Wn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:fr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Xu(t,s,r);break;case 3:var c=t.updateQueue;if(c!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Xu(t,c,n)}break;case 5:var v=t.stateNode;if(n===null&&t.flags&4){n=v;var m=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":m.autoFocus&&n.focus();break;case"img":m.src&&(n.src=m.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var L=t.alternate;if(L!==null){var $=L.memoizedState;if($!==null){var W=$.dehydrated;W!==null&&Kr(W)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(N(163))}Wn||t.flags&512&&rc(t)}catch(B){Jt(t,t.return,B)}}if(t===e){ce=null;break}if(n=t.sibling,n!==null){n.return=t.return,ce=n;break}ce=t.return}}function zc(e){for(;ce!==null;){var t=ce;if(t===e){ce=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Fc(e){for(;ce!==null;){var t=ce;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Oa(4,t)}catch(m){Jt(t,n,m)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(m){Jt(t,o,m)}}var s=t.return;try{rc(t)}catch(m){Jt(t,s,m)}break;case 5:var c=t.return;try{rc(t)}catch(m){Jt(t,c,m)}}}catch(m){Jt(t,t.return,m)}if(t===e){ce=null;break}var v=t.sibling;if(v!==null){v.return=t.return,ce=v;break}ce=t.return}}var yf=Math.ceil,Ra=pn.ReactCurrentDispatcher,lc=pn.ReactCurrentOwner,Wr=pn.ReactCurrentBatchConfig,ut=0,Sn=null,rn=null,An=0,Nr=0,cu=Zr(0),fn=0,Rs=null,ml=0,Ca=0,uc=0,Cs=null,hr=null,sc=0,fu=1/0,io=null,Ta=!1,ac=null,Ao=null,Pa=!1,Do=null,ka=0,Ts=0,cc=null,Na=-1,La=0;function tr(){return ut&6?Vt():Na!==-1?Na:Na=Vt()}function Mo(e){return e.mode&1?ut&2&&An!==0?An&-An:ec.transition!==null?(La===0&&(La=bs()),La):(e=ft,e!==0||(e=window.event,e=e===void 0?16:xu(e.type)),e):1}function fi(e,t,n,r){if(50<Ts)throw Ts=0,cc=null,Error(N(185));vn(e,n,r),(!(ut&2)||e!==Sn)&&(e===Sn&&(!(ut&2)&&(Ca|=n),fn===4&&xo(e,An)),vr(e,r),n===1&&ut===0&&!(t.mode&1)&&(fu=Vt()+500,Eo&&Ni()))}function vr(e,t){var n=e.callbackNode;Ks(e,t);var r=Tl(e,e===Sn?An:0);if(r===0)n!==null&&Pu(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Pu(n),t===1)e.tag===0?Za(Bc.bind(null,e)):aa(Bc.bind(null,e)),Ri(function(){!(ut&6)&&Ni()}),n=null;else{switch(Vi(r)){case 1:n=qo;break;case 4:n=Nu;break;case 16:n=ao;break;case 536870912:n=Ys;break;default:n=ao}n=Gc(n,Uc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Uc(e,t){if(Na=-1,La=0,ut&6)throw Error(N(327));var n=e.callbackNode;if(du()&&e.callbackNode!==n)return null;var r=Tl(e,e===Sn?An:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ia(e,r);else{t=r;var o=ut;ut|=2;var s=$c();(Sn!==e||An!==t)&&(io=null,fu=Vt()+500,_l(e,t));do try{_f();break}catch(v){Vc(e,v)}while(1);$l(),Ra.current=s,ut=o,rn!==null?t=0:(Sn=null,An=0,t=fn)}if(t!==0){if(t===2&&(o=Bi(e),o!==0&&(r=o,t=fc(e,o))),t===1)throw n=Rs,_l(e,0),xo(e,r),vr(e,Vt()),n;if(t===6)xo(e,r);else{if(o=e.current.alternate,!(r&30)&&!mf(o)&&(t=Ia(e,r),t===2&&(s=Bi(e),s!==0&&(r=s,t=fc(e,s))),t===1))throw n=Rs,_l(e,0),xo(e,r),vr(e,Vt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(N(345));case 2:El(e,hr,io);break;case 3:if(xo(e,r),(r&130023424)===r&&(t=sc+500-Vt(),10<t)){if(Tl(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){tr(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=mo(El.bind(null,e,hr,io),t);break}El(e,hr,io);break;case 4:if(xo(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var c=31-Er(r);s=1<<c,c=t[c],c>o&&(o=c),r&=~s}if(r=o,r=Vt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yf(r/1960))-r,10<r){e.timeoutHandle=mo(El.bind(null,e,hr,io),r);break}El(e,hr,io);break;case 5:El(e,hr,io);break;default:throw Error(N(329))}}}return vr(e,Vt()),e.callbackNode===n?Uc.bind(null,e):null}function fc(e,t){var n=Cs;return e.current.memoizedState.isDehydrated&&(_l(e,t).flags|=256),e=Ia(e,t),e!==2&&(t=hr,hr=n,t!==null&&dc(t)),e}function dc(e){hr===null?hr=e:hr.push.apply(hr,e)}function mf(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],s=o.getSnapshot;o=o.value;try{if(!G(s(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xo(e,t){for(t&=~uc,t&=~Ca,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Er(t),r=1<<n;e[n]=-1,t&=~r}}function Bc(e){if(ut&6)throw Error(N(327));du();var t=Tl(e,0);if(!(t&1))return vr(e,Vt()),null;var n=Ia(e,t);if(e.tag!==0&&n===2){var r=Bi(e);r!==0&&(t=r,n=fc(e,r))}if(n===1)throw n=Rs,_l(e,0),xo(e,t),vr(e,Vt()),n;if(n===6)throw Error(N(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,El(e,hr,io),vr(e,Vt()),null}function pc(e,t){var n=ut;ut|=1;try{return e(t)}finally{ut=n,ut===0&&(fu=Vt()+500,Eo&&Ni())}}function gl(e){Do!==null&&Do.tag===0&&!(ut&6)&&du();var t=ut;ut|=1;var n=Wr.transition,r=ft;try{if(Wr.transition=null,ft=1,e)return e()}finally{ft=r,Wr.transition=n,ut=t,!(ut&6)&&Ni()}}function hc(){Nr=cu.current,mt(cu)}function _l(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,zr(n)),rn!==null)for(n=rn.return;n!==null;){var r=n;switch(Hu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&zl();break;case 3:eo(),mt(En),mt(Yt),to();break;case 5:Kl(r);break;case 4:eo();break;case 13:mt(xt);break;case 19:mt(xt);break;case 10:Yu(r.type._context);break;case 22:case 23:hc()}n=n.return}if(Sn=e,rn=e=jo(e.current,null),An=Nr=t,fn=0,Rs=null,uc=Ca=ml=0,hr=Cs=null,Ji!==null){for(t=0;t<Ji.length;t++)if(n=Ji[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,s=n.pending;if(s!==null){var c=s.next;s.next=o,r.next=c}n.pending=r}Ji=null}return e}function Vc(e,t){do{var n=rn;try{if($l(),ji.current=ru,ul){for(var r=Ot.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ul=!1}if($r=0,Gt=Bt=Ot=null,sl=!1,al=0,lc.current=null,n===null||n.return===null){fn=1,Rs=t,rn=null;break}e:{var s=e,c=n.return,v=n,m=t;if(t=An,v.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){var L=m,$=v,W=$.tag;if(!($.mode&1)&&(W===0||W===11||W===15)){var B=$.alternate;B?($.updateQueue=B.updateQueue,$.memoizedState=B.memoizedState,$.lanes=B.lanes):($.updateQueue=null,$.memoizedState=null)}var se=Ea(c);if(se!==null){se.flags&=-257,a(se,c,v,s,t),se.mode&1&&gs(s,L,t),t=se,m=L;var fe=t.updateQueue;if(fe===null){var ve=new Set;ve.add(m),t.updateQueue=ve}else fe.add(m);break e}else{if(!(t&1)){gs(s,L,t),vc();break e}m=Error(N(426))}}else if(Mt&&v.mode&1){var nn=Ea(c);if(nn!==null){!(nn.flags&65536)&&(nn.flags|=256),a(nn,c,v,s,t),tl(ro(m,v));break e}}s=m=ro(m,v),fn!==4&&(fn=2),Cs===null?Cs=[s]:Cs.push(s),s=c;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var O=uu(s,m,t);bu(s,O);break e;case 1:v=m;var E=s.type,P=s.stateNode;if(!(s.flags&128)&&(typeof E.getDerivedStateFromError=="function"||P!==null&&typeof P.componentDidCatch=="function"&&(Ao===null||!Ao.has(P)))){s.flags|=65536,t&=-t,s.lanes|=t;var Q=ms(s,v,t);bu(s,Q);break e}}s=s.return}while(s!==null)}Wc(n)}catch(ge){t=ge,rn===n&&n!==null&&(rn=n=n.return);continue}break}while(1)}function $c(){var e=Ra.current;return Ra.current=ru,e===null?ru:e}function vc(){(fn===0||fn===3||fn===2)&&(fn=4),Sn===null||!(ml&268435455)&&!(Ca&268435455)||xo(Sn,An)}function Ia(e,t){var n=ut;ut|=2;var r=$c();(Sn!==e||An!==t)&&(io=null,_l(e,t));do try{gf();break}catch(o){Vc(e,o)}while(1);if($l(),ut=n,Ra.current=r,rn!==null)throw Error(N(261));return Sn=null,An=0,fn}function gf(){for(;rn!==null;)Hc(rn)}function _f(){for(;rn!==null&&!Dr();)Hc(rn)}function Hc(e){var t=Yc(e.alternate,e,Nr);e.memoizedProps=e.pendingProps,t===null?Wc(e):rn=t,lc.current=null}function Wc(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=df(n,t),n!==null){n.flags&=32767,rn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{fn=6,rn=null;return}}else if(n=ff(n,t,Nr),n!==null){rn=n;return}if(t=t.sibling,t!==null){rn=t;return}rn=t=e}while(t!==null);fn===0&&(fn=5)}function El(e,t,n){var r=ft,o=Wr.transition;try{Wr.transition=null,ft=1,Ef(e,t,n,r)}finally{Wr.transition=o,ft=r}return null}function Ef(e,t,n,r){do du();while(Do!==null);if(ut&6)throw Error(N(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(N(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(Xs(e,s),e===Sn&&(rn=Sn=null,An=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Pa||(Pa=!0,Gc(ao,function(){return du(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Wr.transition,Wr.transition=null;var c=ft;ft=1;var v=ut;ut|=4,lc.current=null,hf(e,n),Mc(n,e),ze(Yi),Mn=!!Yn,Yi=Yn=null,e.current=n,vf(n),Ga(),ut=v,ft=c,Wr.transition=s}else e.current=n;if(Pa&&(Pa=!1,Do=e,ka=o),s=e.pendingLanes,s===0&&(Ao=null),Lu(n.stateNode),vr(e,Vt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Ta)throw Ta=!1,e=ac,ac=null,e;return ka&1&&e.tag!==0&&du(),s=e.pendingLanes,s&1?e===cc?Ts++:(Ts=0,cc=e):Ts=0,Ni(),null}function du(){if(Do!==null){var e=Vi(ka),t=Wr.transition,n=ft;try{if(Wr.transition=null,ft=16>e?16:e,Do===null)var r=!1;else{if(e=Do,Do=null,ka=0,ut&6)throw Error(N(331));var o=ut;for(ut|=4,ce=e.current;ce!==null;){var s=ce,c=s.child;if(ce.flags&16){var v=s.deletions;if(v!==null){for(var m=0;m<v.length;m++){var L=v[m];for(ce=L;ce!==null;){var $=ce;switch($.tag){case 0:case 11:case 15:Os(8,$,s)}var W=$.child;if(W!==null)W.return=$,ce=W;else for(;ce!==null;){$=ce;var B=$.sibling,se=$.return;if(Nc($),$===L){ce=null;break}if(B!==null){B.return=se,ce=B;break}ce=se}}}var fe=s.alternate;if(fe!==null){var ve=fe.child;if(ve!==null){fe.child=null;do{var nn=ve.sibling;ve.sibling=null,ve=nn}while(ve!==null)}}ce=s}}if(s.subtreeFlags&2064&&c!==null)c.return=s,ce=c;else e:for(;ce!==null;){if(s=ce,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Os(9,s,s.return)}var O=s.sibling;if(O!==null){O.return=s.return,ce=O;break e}ce=s.return}}var E=e.current;for(ce=E;ce!==null;){c=ce;var P=c.child;if(c.subtreeFlags&2064&&P!==null)P.return=c,ce=P;else e:for(c=E;ce!==null;){if(v=ce,v.flags&2048)try{switch(v.tag){case 0:case 11:case 15:Oa(9,v)}}catch(ge){Jt(v,v.return,ge)}if(v===c){ce=null;break e}var Q=v.sibling;if(Q!==null){Q.return=v.return,ce=Q;break e}ce=v.return}}if(ut=o,Ni(),Qn&&typeof Qn.onPostCommitFiberRoot=="function")try{Qn.onPostCommitFiberRoot(Rl,e)}catch{}r=!0}return r}finally{ft=n,Wr.transition=t}}return!1}function qc(e,t,n){t=ro(n,t),t=uu(e,t,1),e=Ai(e,t,1),t=tr(),e!==null&&(vn(e,1,t),vr(e,t))}function Jt(e,t,n){if(e.tag===3)qc(e,e,n);else for(;t!==null;){if(t.tag===3){qc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ao===null||!Ao.has(r))){e=ro(n,e),e=ms(t,e,1),t=Ai(t,e,1),e=tr(),t!==null&&(vn(t,1,e),vr(t,e));break}}t=t.return}}function Sf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=tr(),e.pingedLanes|=e.suspendedLanes&n,Sn===e&&(An&n)===n&&(fn===4||fn===3&&(An&130023424)===An&&500>Vt()-sc?_l(e,0):uc|=n),vr(e,t)}function Qc(e,t){t===0&&(e.mode&1?(t=Cl,Cl<<=1,!(Cl&130023424)&&(Cl=4194304)):t=1);var n=tr();e=ri(e,t),e!==null&&(vn(e,t,n),vr(e,n))}function wf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qc(e,n)}function Of(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(N(314))}r!==null&&r.delete(t),Qc(e,n)}var Yc;Yc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||En.current)h=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return h=!1,Es(e,t,n);h=!!(e.flags&131072)}else h=!1,Mt&&t.flags&1048576&&ca(t,Ul,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;si(e,t),e=t.pendingProps;var o=ei(t,Yt.current);Oo(t,n),o=To(null,t,r,e,o,n);var s=bl();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Bn(r)?(s=!0,Fl(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Ku(t),o.updater=oi,t.stateNode=o,o._reactInternals=t,es(t,r,e,n),t=Le(null,t,r,!0,s,n)):(t.tag=0,Mt&&s&&$u(t),y(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(si(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Cf(r),e=fr(r,e),o){case 0:t=he(null,t,r,e,n);break e;case 1:t=ne(null,t,r,e,n);break e;case 11:t=k(null,t,r,e,n);break e;case 14:t=T(null,t,r,fr(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),he(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),ne(e,t,r,o,n);case 3:e:{if(Rt(t),e===null)throw Error(N(387));r=t.pendingProps,s=t.memoizedState,o=s.element,va(e,t),Vn(t,r,null,n);var c=t.memoizedState;if(r=c.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=ro(Error(N(423)),t),t=cn(e,t,r,n,o);break e}else if(r!==o){o=ro(Error(N(424)),t),t=cn(e,t,r,n,o);break e}else for(Xn=Ci(t.stateNode.containerInfo.firstChild),bn=t,Mt=!0,Tr=null,n=Zi(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Li(),r===o){t=kr(e,t,n);break e}y(e,t,r,n)}t=t.child}return t;case 5:return Gl(t),e===null&&Qu(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,c=o.children,Oi(r,o)?c=null:s!==null&&Oi(r,s)&&(t.flags|=32),ee(e,t),y(e,t,c,n),t.child;case 6:return e===null&&Qu(t),null;case 13:return Pr(e,t,n);case 4:return Yl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Vr(t,null,r,n):y(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),k(e,t,r,o,n);case 7:return y(e,t,t.pendingProps,n),t.child;case 8:return y(e,t,t.pendingProps.children,n),t.child;case 12:return y(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,c=o.value,wt(nl,r._currentValue),r._currentValue=c,s!==null)if(G(s.value,c)){if(s.children===o.children&&!En.current){t=kr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var v=s.dependencies;if(v!==null){c=s.child;for(var m=v.firstContext;m!==null;){if(m.context===r){if(s.tag===1){m=ii(-1,n&-n),m.tag=2;var L=s.updateQueue;if(L!==null){L=L.shared;var $=L.pending;$===null?m.next=m:(m.next=$.next,$.next=m),L.pending=m}}s.lanes|=n,m=s.alternate,m!==null&&(m.lanes|=n),Gu(s.return,n,t),v.lanes|=n;break}m=m.next}}else if(s.tag===10)c=s.type===t.type?null:s.child;else if(s.tag===18){if(c=s.return,c===null)throw Error(N(341));c.lanes|=n,v=c.alternate,v!==null&&(v.lanes|=n),Gu(c,n,t),c=s.sibling}else c=s.child;if(c!==null)c.return=s;else for(c=s;c!==null;){if(c===t){c=null;break}if(s=c.sibling,s!==null){s.return=c.return,c=s;break}c=c.return}s=c}y(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Oo(t,n),o=dr(o),r=r(o),t.flags|=1,y(e,t,r,n),t.child;case 14:return r=t.type,o=fr(r,t.pendingProps),o=fr(r.type,o),T(e,t,r,o,n);case 15:return A(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),si(e,t),t.tag=1,Bn(r)?(e=!0,Fl(t)):e=!1,Oo(t,n),Ql(t,r,o),es(t,r,o,n),Le(null,t,r,!0,e,n);case 19:return Hr(e,t,n);case 22:return x(e,t,n)}throw Error(N(156,t.tag))};function Gc(e,t){return qs(e,t)}function Rf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qr(e,t,n,r){return new Rf(e,t,n,r)}function yc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cf(e){if(typeof e=="function")return yc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gr)return 11;if(e===Ir)return 14}return 2}function jo(e,t){var n=e.alternate;return n===null?(n=qr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Aa(e,t,n,r,o,s){var c=2;if(r=e,typeof e=="function")yc(e)&&(c=1);else if(typeof e=="string")c=5;else e:switch(e){case Dn:return Sl(n.children,o,s,t);case or:c=8,o|=8;break;case Lr:return e=qr(12,n,t,o|2),e.elementType=Lr,e.lanes=s,e;case qn:return e=qr(13,n,t,o),e.elementType=qn,e.lanes=s,e;case _r:return e=qr(19,n,t,o),e.elementType=_r,e.lanes=s,e;case vt:return Da(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yr:c=10;break e;case di:c=9;break e;case gr:c=11;break e;case Ir:c=14;break e;case hn:c=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=qr(c,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function Sl(e,t,n,r){return e=qr(7,e,r,t),e.lanes=n,e}function Da(e,t,n,r){return e=qr(22,e,r,t),e.elementType=vt,e.lanes=n,e.stateNode={isHidden:!1},e}function mc(e,t,n){return e=qr(6,e,null,t),e.lanes=n,e}function gc(e,t,n){return t=qr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Tf(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Iu(0),this.expirationTimes=Iu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Iu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function _c(e,t,n,r,o,s,c,v,m){return e=new Tf(e,t,n,v,m),t===1?(t=1,s===!0&&(t|=8)):t=0,s=qr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ku(s),e}function Pf(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Kc(e){if(!e)return Kn;e=e._reactInternals;e:{if(Ar(e)!==e||e.tag!==1)throw Error(N(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Bn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(N(171))}if(e.tag===1){var n=e.type;if(Bn(n))return ua(e,n,t)}return t}function bc(e,t,n,r,o,s,c,v,m){return e=_c(n,r,!0,e,o,s,c,v,m),e.context=Kc(null),n=e.current,r=tr(),o=Mo(n),s=ii(r,o),s.callback=t??null,Ai(n,s,o),e.current.lanes=o,vn(e,o,r),vr(e,r),e}function Ma(e,t,n,r){var o=t.current,s=tr(),c=Mo(o);return n=Kc(n),t.context===null?t.context=n:t.pendingContext=n,t=ii(s,c),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ai(o,t,c),e!==null&&(fi(e,o,c,s),Wl(e,o,c)),c}function xa(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Xc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ec(e,t){Xc(e,t),(e=e.alternate)&&Xc(e,t)}function kf(){return null}var Jc=typeof reportError=="function"?reportError:function(e){console.error(e)};function Sc(e){this._internalRoot=e}ja.prototype.render=Sc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(N(409));Ma(e,t,null,null)},ja.prototype.unmount=Sc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gl(function(){Ma(null,e,null,null)}),t[Jr]=null}};function ja(e){this._internalRoot=e}ja.prototype.unstable_scheduleHydration=function(e){if(e){var t=ea();e={blockedOn:null,target:e,priority:t};for(var n=0;n<gi.length&&t!==0&&t<gi[n].priority;n++);gi.splice(n,0,e),n===0&&ta(e)}};function wc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function za(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Zc(){}function Nf(e,t,n,r,o){if(o){if(typeof r=="function"){var s=r;r=function(){var L=xa(c);s.call(L)}}var c=bc(t,r,e,0,null,!1,!1,"",Zc);return e._reactRootContainer=c,e[Jr]=c.current,Nn(e.nodeType===8?e.parentNode:e),gl(),c}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var v=r;r=function(){var L=xa(m);v.call(L)}}var m=_c(e,0,!1,null,null,!1,!1,"",Zc);return e._reactRootContainer=m,e[Jr]=m.current,Nn(e.nodeType===8?e.parentNode:e),gl(function(){Ma(t,m,n,r)}),m}function Fa(e,t,n,r,o){var s=n._reactRootContainer;if(s){var c=s;if(typeof o=="function"){var v=o;o=function(){var m=xa(c);v.call(m)}}Ma(t,c,e,o)}else c=Nf(n,t,e,o,r);return xa(c)}Js=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=co(t.pendingLanes);n!==0&&(Au(t,n|1),vr(t,Vt()),!(ut&6)&&(fu=Vt()+500,Ni()))}break;case 13:gl(function(){var r=ri(e,1);if(r!==null){var o=tr();fi(r,e,1,o)}}),Ec(e,1)}},Du=function(e){if(e.tag===13){var t=ri(e,134217728);if(t!==null){var n=tr();fi(t,e,134217728,n)}Ec(e,134217728)}},Zs=function(e){if(e.tag===13){var t=Mo(e),n=ri(e,t);if(n!==null){var r=tr();fi(n,e,t,r)}Ec(e,t)}},ea=function(){return ft},Mu=function(e,t){var n=ft;try{return ft=e,t()}finally{ft=n}},wu=function(e,t,n){switch(t){case"input":if(vu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=jl(r);if(!o)throw Error(N(90));Is(r),vu(r,o)}}}break;case"textarea":xs(e,n);break;case"select":t=n.value,t!=null&&lo(e,!!n.multiple,t,!1)}},Bs=pc,Vs=gl;var Lf={usingClientEntryPoint:!1,Events:[Qt,go,jl,Ou,Ru,pc]},Ps={findFiberByHostInstance:Gn,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},If={bundleType:Ps.bundleType,version:Ps.version,rendererPackageName:Ps.rendererPackageName,rendererConfig:Ps.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:pn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Tn(e),e===null?null:e.stateNode},findFiberByHostInstance:Ps.findFiberByHostInstance||kf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ua=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ua.isDisabled&&Ua.supportsFiber)try{Rl=Ua.inject(If),Qn=Ua}catch{}}return yr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lf,yr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wc(t))throw Error(N(200));return Pf(e,t,null,n)},yr.createRoot=function(e,t){if(!wc(e))throw Error(N(299));var n=!1,r="",o=Jc;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=_c(e,1,!1,null,null,n,!1,r,o),e[Jr]=t.current,Nn(e.nodeType===8?e.parentNode:e),new Sc(t)},yr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(N(188)):(e=Object.keys(e).join(","),Error(N(268,e)));return e=Tn(t),e=e===null?null:e.stateNode,e},yr.flushSync=function(e){return gl(e)},yr.hydrate=function(e,t,n){if(!za(t))throw Error(N(200));return Fa(null,e,t,!0,n)},yr.hydrateRoot=function(e,t,n){if(!wc(e))throw Error(N(405));var r=n!=null&&n.hydratedSources||null,o=!1,s="",c=Jc;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(c=n.onRecoverableError)),t=bc(t,null,e,1,n??null,o,!1,s,c),e[Jr]=t.current,Nn(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new ja(t)},yr.render=function(e,t,n){if(!za(t))throw Error(N(200));return Fa(null,e,t,!1,n)},yr.unmountComponentAtNode=function(e){if(!za(e))throw Error(N(40));return e._reactRootContainer?(gl(function(){Fa(null,null,e,!1,function(){e._reactRootContainer=null,e[Jr]=null})}),!0):!1},yr.unstable_batchedUpdates=pc,yr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!za(n))throw Error(N(200));if(e==null||e._reactInternals===void 0)throw Error(N(38));return Fa(e,t,n,!1,r)},yr.version="18.2.0-next-9e3b772b8-20220608",yr}(function(Z){function Ke(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ke)}catch(N){console.error(N)}}Ke(),Z.exports=Wf()})(Bf);const qf=Cc(Ba),Qf=uf({__proto__:null,default:qf},[Ba]),Yf=sf(Qf);var cf,lf=Yf;cf=lf.createRoot,lf.hydrateRoot;var Rc={},Gf={get exports(){return Rc},set exports(Z){Rc=Z}};(function(Z,Ke){(function(N,lt){Z.exports=lt()})(ks,function(){var N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ks<"u"?ks:typeof self<"u"?self:{};function lt(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Ie(i){if(i.__esModule)return i;var l=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(i).forEach(function(u){var f=Object.getOwnPropertyDescriptor(i,u);Object.defineProperty(l,u,f.get?f:{enumerable:!0,get:function(){return i[u]}})}),l}var Ve={},gt={},Nt;function nt(){}nt.prototype=Object.create(null);function Be(){Be.init.call(this)}Be.EventEmitter=Be,Be.usingDomains=!1,Be.prototype.domain=void 0,Be.prototype._events=void 0,Be.prototype._maxListeners=void 0,Be.defaultMaxListeners=10,Be.init=function(){this.domain=null,Be.usingDomains&&Nt.active,(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new nt,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Be.prototype.setMaxListeners=function(l){if(typeof l!="number"||l<0||isNaN(l))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=l,this};function on(i){return i._maxListeners===void 0?Be.defaultMaxListeners:i._maxListeners}Be.prototype.getMaxListeners=function(){return on(this)};function Ft(i,l,u){if(l)i.call(u);else for(var f=i.length,p=On(i,f),_=0;_<f;++_)p[_].call(u)}function Lt(i,l,u,f){if(l)i.call(u,f);else for(var p=i.length,_=On(i,p),S=0;S<p;++S)_[S].call(u,f)}function nr(i,l,u,f,p){if(l)i.call(u,f,p);else for(var _=i.length,S=On(i,_),R=0;R<_;++R)S[R].call(u,f,p)}function rr(i,l,u,f,p,_){if(l)i.call(u,f,p,_);else for(var S=i.length,R=On(i,S),K=0;K<S;++K)R[K].call(u,f,p,_)}function It(i,l,u,f){if(l)i.apply(u,f);else for(var p=i.length,_=On(i,p),S=0;S<p;++S)_[S].apply(u,f)}Be.prototype.emit=function(l){var u,f,p,_,S,R,K,we=l==="error";if(R=this._events,R)we=we&&R.error==null;else if(!we)return!1;if(K=this.domain,we){if(u=arguments[1],K)u||(u=new Error('Uncaught, unspecified "error" event')),u.domainEmitter=this,u.domain=K,u.domainThrown=!1,K.emit("error",u);else{if(u instanceof Error)throw u;var V=new Error('Uncaught, unspecified "error" event. ('+u+")");throw V.context=u,V}return!1}if(f=R[l],!f)return!1;var C=typeof f=="function";switch(p=arguments.length,p){case 1:Ft(f,C,this);break;case 2:Lt(f,C,this,arguments[1]);break;case 3:nr(f,C,this,arguments[1],arguments[2]);break;case 4:rr(f,C,this,arguments[1],arguments[2],arguments[3]);break;default:for(_=new Array(p-1),S=1;S<p;S++)_[S-1]=arguments[S];It(f,C,this,_)}return!0};function ht(i,l,u,f){var p,_,S;if(typeof u!="function")throw new TypeError('"listener" argument must be a function');if(_=i._events,_?(_.newListener&&(i.emit("newListener",l,u.listener?u.listener:u),_=i._events),S=_[l]):(_=i._events=new nt,i._eventsCount=0),!S)S=_[l]=u,++i._eventsCount;else if(typeof S=="function"?S=_[l]=f?[u,S]:[S,u]:f?S.unshift(u):S.push(u),!S.warned&&(p=on(i),p&&p>0&&S.length>p)){S.warned=!0;var R=new Error("Possible EventEmitter memory leak detected. "+S.length+" "+l+" listeners added. Use emitter.setMaxListeners() to increase limit");R.name="MaxListenersExceededWarning",R.emitter=i,R.type=l,R.count=S.length,Qr(R)}return i}function Qr(i){typeof console.warn=="function"?console.warn(i):console.log(i)}Be.prototype.addListener=function(l,u){return ht(this,l,u,!1)},Be.prototype.on=Be.prototype.addListener,Be.prototype.prependListener=function(l,u){return ht(this,l,u,!0)};function mr(i,l,u){var f=!1;function p(){i.removeListener(l,p),f||(f=!0,u.apply(i,arguments))}return p.listener=u,p}Be.prototype.once=function(l,u){if(typeof u!="function")throw new TypeError('"listener" argument must be a function');return this.on(l,mr(this,l,u)),this},Be.prototype.prependOnceListener=function(l,u){if(typeof u!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(l,mr(this,l,u)),this},Be.prototype.removeListener=function(l,u){var f,p,_,S,R;if(typeof u!="function")throw new TypeError('"listener" argument must be a function');if(p=this._events,!p)return this;if(f=p[l],!f)return this;if(f===u||f.listener&&f.listener===u)--this._eventsCount===0?this._events=new nt:(delete p[l],p.removeListener&&this.emit("removeListener",l,f.listener||u));else if(typeof f!="function"){for(_=-1,S=f.length;S-- >0;)if(f[S]===u||f[S].listener&&f[S].listener===u){R=f[S].listener,_=S;break}if(_<0)return this;if(f.length===1){if(f[0]=void 0,--this._eventsCount===0)return this._events=new nt,this;delete p[l]}else pn(f,_);p.removeListener&&this.emit("removeListener",l,R||u)}return this},Be.prototype.off=function(i,l){return this.removeListener(i,l)},Be.prototype.removeAllListeners=function(l){var u,f;if(f=this._events,!f)return this;if(!f.removeListener)return arguments.length===0?(this._events=new nt,this._eventsCount=0):f[l]&&(--this._eventsCount===0?this._events=new nt:delete f[l]),this;if(arguments.length===0){for(var p=Object.keys(f),_=0,S;_<p.length;++_)S=p[_],S!=="removeListener"&&this.removeAllListeners(S);return this.removeAllListeners("removeListener"),this._events=new nt,this._eventsCount=0,this}if(u=f[l],typeof u=="function")this.removeListener(l,u);else if(u)do this.removeListener(l,u[u.length-1]);while(u[0]);return this},Be.prototype.listeners=function(l){var u,f,p=this._events;return p?(u=p[l],u?typeof u=="function"?f=[u.listener||u]:f=Rn(u):f=[]):f=[],f},Be.listenerCount=function(i,l){return typeof i.listenerCount=="function"?i.listenerCount(l):ir.call(i,l)},Be.prototype.listenerCount=ir;function ir(i){var l=this._events;if(l){var u=l[i];if(typeof u=="function")return 1;if(u)return u.length}return 0}Be.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function pn(i,l){for(var u=l,f=u+1,p=i.length;f<p;u+=1,f+=1)i[u]=i[f];i.pop()}function On(i,l){for(var u=new Array(l);l--;)u[l]=i[l];return u}function Rn(i){for(var l=new Array(i.length),u=0;u<l.length;++u)l[u]=i[u].listener||i[u];return l}var Dn=Object.freeze({__proto__:null,default:Be,EventEmitter:Be}),or=Ie(Dn),Lr=or.EventEmitter;gt.EventEmitter=Lr,gt.mixin=Yr;function Yr(i){for(var l in Lr.prototype)i.prototype[l]=Lr.prototype[l]}var di=["info","warn","error"];function gr(){var i={};di.forEach(function(l){i[l]=console[l].bind(console)}),this.setMethods(i)}var qn=gr;gr.prototype.setMethods=function(i){i=i||{};var l=this;di.forEach(function(u){typeof i[u]=="function"&&(l[u]=i[u])})};var _r=qn,Ir=new _r,hn=Ir;function vt(i,l){this.code=i,this.message=l||"",Error.captureStackTrace?Error.captureStackTrace(this,vt):this.stack=new Error().stack}vt.prototype=Object.create(Error.prototype),vt.prototype.constructor=vt,vt.prototype.name="ShareDBError",vt.CODES={ERR_APPLY_OP_VERSION_DOES_NOT_MATCH_SNAPSHOT:"ERR_APPLY_OP_VERSION_DOES_NOT_MATCH_SNAPSHOT",ERR_APPLY_SNAPSHOT_NOT_PROVIDED:"ERR_APPLY_SNAPSHOT_NOT_PROVIDED",ERR_CLIENT_ID_BADLY_FORMED:"ERR_CLIENT_ID_BADLY_FORMED",ERR_CONNECTION_SEQ_INTEGER_OVERFLOW:"ERR_CONNECTION_SEQ_INTEGER_OVERFLOW",ERR_CONNECTION_STATE_TRANSITION_INVALID:"ERR_CONNECTION_STATE_TRANSITION_INVALID",ERR_DATABASE_ADAPTER_NOT_FOUND:"ERR_DATABASE_ADAPTER_NOT_FOUND",ERR_DATABASE_DOES_NOT_SUPPORT_SUBSCRIBE:"ERR_DATABASE_DOES_NOT_SUPPORT_SUBSCRIBE",ERR_DATABASE_METHOD_NOT_IMPLEMENTED:"ERR_DATABASE_METHOD_NOT_IMPLEMENTED",ERR_DEFAULT_TYPE_MISMATCH:"ERR_DEFAULT_TYPE_MISMATCH",ERR_DOC_MISSING_VERSION:"ERR_DOC_MISSING_VERSION",ERR_DOC_ALREADY_CREATED:"ERR_DOC_ALREADY_CREATED",ERR_DOC_DOES_NOT_EXIST:"ERR_DOC_DOES_NOT_EXIST",ERR_DOC_TYPE_NOT_RECOGNIZED:"ERR_DOC_TYPE_NOT_RECOGNIZED",ERR_DOC_WAS_DELETED:"ERR_DOC_WAS_DELETED",ERR_INFLIGHT_OP_MISSING:"ERR_INFLIGHT_OP_MISSING",ERR_INGESTED_SNAPSHOT_HAS_NO_VERSION:"ERR_INGESTED_SNAPSHOT_HAS_NO_VERSION",ERR_MAX_SUBMIT_RETRIES_EXCEEDED:"ERR_MAX_SUBMIT_RETRIES_EXCEEDED",ERR_MESSAGE_BADLY_FORMED:"ERR_MESSAGE_BADLY_FORMED",ERR_MILESTONE_ARGUMENT_INVALID:"ERR_MILESTONE_ARGUMENT_INVALID",ERR_OP_ALREADY_SUBMITTED:"ERR_OP_ALREADY_SUBMITTED",ERR_OP_NOT_ALLOWED_IN_PROJECTION:"ERR_OP_NOT_ALLOWED_IN_PROJECTION",ERR_OP_SUBMIT_REJECTED:"ERR_OP_SUBMIT_REJECTED",ERR_OP_VERSION_MISMATCH_AFTER_TRANSFORM:"ERR_OP_VERSION_MISMATCH_AFTER_TRANSFORM",ERR_OP_VERSION_MISMATCH_DURING_TRANSFORM:"ERR_OP_VERSION_MISMATCH_DURING_TRANSFORM",ERR_OP_VERSION_NEWER_THAN_CURRENT_SNAPSHOT:"ERR_OP_VERSION_NEWER_THAN_CURRENT_SNAPSHOT",ERR_OT_LEGACY_JSON0_OP_CANNOT_BE_NORMALIZED:"ERR_OT_LEGACY_JSON0_OP_CANNOT_BE_NORMALIZED",ERR_OT_OP_BADLY_FORMED:"ERR_OT_OP_BADLY_FORMED",ERR_OT_OP_NOT_APPLIED:"ERR_OT_OP_NOT_APPLIED",ERR_OT_OP_NOT_PROVIDED:"ERR_OT_OP_NOT_PROVIDED",ERR_PRESENCE_TRANSFORM_FAILED:"ERR_PRESENCE_TRANSFORM_FAILED",ERR_PROTOCOL_VERSION_NOT_SUPPORTED:"ERR_PROTOCOL_VERSION_NOT_SUPPORTED",ERR_QUERY_EMITTER_LISTENER_NOT_ASSIGNED:"ERR_QUERY_EMITTER_LISTENER_NOT_ASSIGNED",ERR_SNAPSHOT_READ_SILENT_REJECTION:"ERR_SNAPSHOT_READ_SILENT_REJECTION",ERR_SNAPSHOT_READS_REJECTED:"ERR_SNAPSHOT_READS_REJECTED",ERR_SUBMIT_TRANSFORM_OPS_NOT_FOUND:"ERR_SUBMIT_TRANSFORM_OPS_NOT_FOUND",ERR_TYPE_CANNOT_BE_PROJECTED:"ERR_TYPE_CANNOT_BE_PROJECTED",ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE:"ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE",ERR_UNKNOWN_ERROR:"ERR_UNKNOWN_ERROR"};var re=vt,Re={},g={type:{name:"json0",uri:"http://sharejs.org/types/JSONv0"}};(function(i){i.defaultType=g.type,i.map={},i.register=function(l){l.name&&(i.map[l.name]=l),l.uri&&(i.map[l.uri]=l)},i.register(i.defaultType)})(Re);var j=typeof ks<"u"?ks:typeof self<"u"?self:typeof window<"u"?window:{};function Ee(){throw new Error("setTimeout has not been defined")}function Je(){throw new Error("clearTimeout has not been defined")}var Me=Ee,it=Je;typeof j.setTimeout=="function"&&(Me=setTimeout),typeof j.clearTimeout=="function"&&(it=clearTimeout);function ot(i){if(Me===setTimeout)return setTimeout(i,0);if((Me===Ee||!Me)&&setTimeout)return Me=setTimeout,setTimeout(i,0);try{return Me(i,0)}catch{try{return Me.call(null,i,0)}catch{return Me.call(this,i,0)}}}function _t(i){if(it===clearTimeout)return clearTimeout(i);if((it===Je||!it)&&clearTimeout)return it=clearTimeout,clearTimeout(i);try{return it(i)}catch{try{return it.call(null,i)}catch{return it.call(this,i)}}}var Ge=[],Zt=!1,Fi,Ui=-1;function Is(){!Zt||!Fi||(Zt=!1,Fi.length?Ge=Fi.concat(Ge):Ui=-1,Ge.length&&Uo())}function Uo(){if(!Zt){var i=ot(Is);Zt=!0;for(var l=Ge.length;l;){for(Fi=Ge,Ge=[];++Ui<l;)Fi&&Fi[Ui].run();Ui=-1,l=Ge.length}Fi=null,Zt=!1,_t(i)}}function pu(i){var l=new Array(arguments.length-1);if(arguments.length>1)for(var u=1;u<arguments.length;u++)l[u-1]=arguments[u];Ge.push(new hu(i,l)),Ge.length===1&&!Zt&&ot(Uo)}function hu(i,l){this.fun=i,this.array=l}hu.prototype.run=function(){this.fun.apply(null,this.array)};var As="browser",vu="browser",Ds=!0,yu={},Bo=[],lo="",mu={},Ms={},xs={};function pi(){}var js=pi,gu=pi,wl=pi,zs=pi,Vo=pi,$o=pi,$a=pi;function Fs(i){throw new Error("process.binding is not supported")}function Us(){return"/"}function Ha(i){throw new Error("process.chdir is not supported")}function _u(){return 0}var hi=j.performance||{},Eu=hi.now||hi.mozNow||hi.msNow||hi.oNow||hi.webkitNow||function(){return new Date().getTime()};function Su(i){var l=Eu.call(hi)*.001,u=Math.floor(l),f=Math.floor(l%1*1e9);return i&&(u=u-i[0],f=f-i[1],f<0&&(u--,f+=1e9)),[u,f]}var wu=new Date;function uo(){var i=new Date,l=i-wu;return l/1e3}var lr={nextTick:pu,title:As,browser:Ds,env:yu,argv:Bo,version:lo,versions:mu,on:js,addListener:gu,once:wl,off:zs,removeListener:Vo,removeAllListeners:$o,emit:$a,binding:Fs,cwd:Us,chdir:Ha,umask:_u,hrtime:Su,platform:vu,release:Ms,config:xs,uptime:uo},ur={};(function(i){i.doNothing=l;function l(){}i.hasKeys=function(u){for(var f in u)return!0;return!1},i.isInteger=Number.isInteger||function(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u},i.isValidVersion=function(u){return u===null?!0:i.isInteger(u)&&u>=0},i.isValidTimestamp=function(u){return i.isValidVersion(u)},i.MAX_SAFE_INTEGER=9007199254740991,i.dig=function(){for(var u=arguments[0],f=1;f<arguments.length;f++){var p=arguments[f];u=u[p]||(f===arguments.length-1?void 0:{})}return u},i.digOrCreate=function(){for(var u=arguments[0],f=arguments[arguments.length-1],p=1;p<arguments.length-1;p++){var _=arguments[p];u=u[_]||(u[_]=p===arguments.length-2?f():{})}return u},i.digAndRemove=function(){for(var u=arguments[0],f=[u],p=1;p<arguments.length-1;p++){var _=arguments[p];if(!u.hasOwnProperty(_))break;u=u[_],f.push(u)}for(var p=f.length-1;p>=0;p--){var S=f[p],_=arguments[p+1],R=S[_];(p===f.length-1||!i.hasKeys(R))&&delete S[_]}},i.supportsPresence=function(u){return u&&typeof u.transformPresence=="function"},i.callEach=function(u,f){var p=!1;return u.forEach(function(_){_&&(_(f),p=!0)}),p},i.truthy=function(u){return!!u},i.nextTick=function(u){if(typeof lr<"u"&&lr.nextTick)return lr.nextTick.apply(null,arguments);for(var f=[],p=1;p<arguments.length;p++)f[p-1]=arguments[p];setTimeout(function(){u.apply(null,f)})},i.clone=function(u){return u===void 0?void 0:JSON.parse(JSON.stringify(u))}})(ur);var Ou=Array.isArray,Ru=Object.keys,Bs=Object.prototype.hasOwnProperty,Vs=function i(l,u){if(l===u)return!0;if(l&&u&&typeof l=="object"&&typeof u=="object"){var f=Ou(l),p=Ou(u),_,S,R;if(f&&p){if(S=l.length,S!=u.length)return!1;for(_=S;_--!==0;)if(!i(l[_],u[_]))return!1;return!0}if(f!=p)return!1;var K=l instanceof Date,we=u instanceof Date;if(K!=we)return!1;if(K&&we)return l.getTime()==u.getTime();var V=l instanceof RegExp,C=u instanceof RegExp;if(V!=C)return!1;if(V&&C)return l.toString()==u.toString();var I=Ru(l);if(S=I.length,S!==Ru(u).length)return!1;for(_=S;_--!==0;)if(!Bs.call(u,I[_]))return!1;for(_=S;_--!==0;)if(R=I[_],!i(l[R],u[R]))return!1;return!0}return l!==l&&u!==u},Ol=gt,$s=hn,ln=re,so=Re,Cn=ur,Wa=Cn.clone,Ho=Vs,un=ln.CODES,Wo=qe;function qe(i,l,u){Ol.EventEmitter.call(this),this.connection=i,this.collection=l,this.id=u,this.version=null,this.type=null,this.data=void 0,this.inflightFetch=[],this.inflightSubscribe=null,this.pendingFetch=[],this.pendingSubscribe=[],this.subscribed=!1,this.wantSubscribe=!1,this.inflightOp=null,this.pendingOps=[],this.type=null,this.applyStack=null,this.preventCompose=!1,this.submitSource=!1,this.paused=!1,this._dataStateVersion=0}Ol.mixin(qe),qe.prototype.destroy=function(i){var l=this;l.whenNothingPending(function(){l.wantSubscribe?l.unsubscribe(function(u){if(u)return i?i(u):l.emit("error",u);l.connection._destroyDoc(l),l.emit("destroy"),i&&i()}):(l.connection._destroyDoc(l),l.emit("destroy"),i&&i())})},qe.prototype._setType=function(i){if(typeof i=="string"&&(i=so.map[i]),i)this.type=i;else if(i===null)this.type=i,this._setData(void 0);else{var l=new ln(un.ERR_DOC_TYPE_NOT_RECOGNIZED,"Missing type "+i);return this.emit("error",l)}},qe.prototype._setData=function(i){this.data=i,this._dataStateVersion++},qe.prototype.ingestSnapshot=function(i,l){if(!i)return l&&l();if(typeof i.v!="number"){var u=new ln(un.ERR_INGESTED_SNAPSHOT_HAS_NO_VERSION,"Missing version in ingested snapshot. "+this.collection+"."+this.id);return l?l(u):this.emit("error",u)}if(this.type||this.hasWritePending()){if(this.version==null){if(this.hasWritePending())return l&&this.once("no write pending",l);var u=new ln(un.ERR_DOC_MISSING_VERSION,"Cannot ingest snapshot in doc with null version. "+this.collection+"."+this.id);return l?l(u):this.emit("error",u)}return i.v>this.version?this.fetch(l):l&&l()}if(this.version>i.v)return l&&l();this.version=i.v;var f=i.type===void 0?so.defaultType:i.type;this._setType(f),this._setData(this.type&&this.type.deserialize?this.type.deserialize(i.data):i.data),this.emit("load"),l&&l()},qe.prototype.whenNothingPending=function(i){var l=this;Cn.nextTick(function(){if(l.hasPending()){l.once("nothing pending",i);return}i()})},qe.prototype.hasPending=function(){return!!(this.inflightOp||this.pendingOps.length||this.inflightFetch.length||this.inflightSubscribe||this.pendingFetch.length||this.pendingSubscribe.length)},qe.prototype.hasWritePending=function(){return!!(this.inflightOp||this.pendingOps.length)},qe.prototype._emitNothingPending=function(){this.hasWritePending()||(this.emit("no write pending"),!this.hasPending()&&this.emit("nothing pending"))},qe.prototype._emitResponseError=function(i,l){if(i&&i.code===un.ERR_SNAPSHOT_READ_SILENT_REJECTION){this.wantSubscribe=!1,l&&l(),this._emitNothingPending();return}if(l){l(i),this._emitNothingPending();return}this._emitNothingPending(),this.emit("error",i)},qe.prototype._handleFetch=function(i,l){var u=this.pendingFetch;this.pendingFetch=[];var f=this.inflightFetch.shift();if(f&&u.push(f),u.length&&(f=function(p){Cn.callEach(u,p)}),i)return this._emitResponseError(i,f);this.ingestSnapshot(l,f),this._emitNothingPending()},qe.prototype._handleSubscribe=function(i,l){var u=this.inflightSubscribe;this.inflightSubscribe=null;var f=this.pendingFetch;this.pendingFetch=[],u.callback&&f.push(u.callback);var p;if(f.length&&(p=function(_){Cn.callEach(f,_)}),i)return this._emitResponseError(i,p);this.subscribed=u.wantSubscribe,this.subscribed?this.ingestSnapshot(l,p):p&&p(),this._emitNothingPending(),this._flushSubscribe()},qe.prototype._handleOp=function(i,l){if(i)return this.inflightOp?(i.code===un.ERR_OP_SUBMIT_REJECTED&&(i=null),this._rollback(i)):this.emit("error",i);if(this.inflightOp&&l.src===this.inflightOp.src&&l.seq===this.inflightOp.seq){this._opAcknowledged(l);return}if(this.version==null||l.v>this.version){this.fetch();return}if(!(l.v<this.version)){if(this.inflightOp){var u=Ar(this.inflightOp,l);if(u)return this._hardRollback(u)}for(var f=0;f<this.pendingOps.length;f++){var u=Ar(this.pendingOps[f],l);if(u)return this._hardRollback(u)}this.version++;try{this._otApply(l,!1)}catch(p){return this._hardRollback(p)}}},qe.prototype._onConnectionStateChanged=function(){this.connection.canSend?(this.flush(),this._resubscribe()):(this.inflightOp&&(this.pendingOps.unshift(this.inflightOp),this.inflightOp=null),this.subscribed=!1,this.inflightSubscribe&&(this.inflightSubscribe.wantSubscribe?(this.pendingSubscribe.unshift(this.inflightSubscribe),this.inflightSubscribe=null):this._handleSubscribe()),this.inflightFetch.length&&(this.pendingFetch=this.pendingFetch.concat(this.inflightFetch),this.inflightFetch.length=0))},qe.prototype._resubscribe=function(){if(!this.pendingSubscribe.length&&this.wantSubscribe)return this.subscribe();var i=this.pendingSubscribe.some(function(l){return l.wantSubscribe});!i&&this.pendingFetch.length&&this.fetch(),this._flushSubscribe()},qe.prototype.fetch=function(i){if(this.connection.canSend){var l=this.connection.sendFetch(this);qa(this.inflightFetch,l,i);return}this.pendingFetch.push(i)},qe.prototype.subscribe=function(i){var l=!0;this._queueSubscribe(l,i)},qe.prototype.unsubscribe=function(i){var l=!1;this._queueSubscribe(l,i)},qe.prototype._queueSubscribe=function(i,l){var u=this.pendingSubscribe[this.pendingSubscribe.length-1]||this.inflightSubscribe,f=u&&u.wantSubscribe===i;if(f){u.callback=Qa([u.callback,l]);return}this.pendingSubscribe.push({wantSubscribe:!!i,callback:l}),this._flushSubscribe()},qe.prototype._flushSubscribe=function(){if(!(this.inflightSubscribe||!this.pendingSubscribe.length)){if(this.connection.canSend){this.inflightSubscribe=this.pendingSubscribe.shift(),this.wantSubscribe=this.inflightSubscribe.wantSubscribe,this.wantSubscribe?this.connection.sendSubscribe(this):(this.subscribed=!1,this.connection.sendUnsubscribe(this));return}if(!this.pendingSubscribe[0].wantSubscribe){this.inflightSubscribe=this.pendingSubscribe.shift();var i=this;Cn.nextTick(function(){i._handleSubscribe()})}}};function qa(i,l,u){if(l){var f=i.pop();i.push(function(p){f&&f(p),u&&u(p)})}else i.push(u)}function Qa(i){return i=i.filter(Cn.truthy),i.length?function(l){Cn.callEach(i,l)}:null}qe.prototype.flush=function(){!this.connection.canSend||this.inflightOp||!this.paused&&this.pendingOps.length&&this._sendOp()};function Ya(i){delete i.op,delete i.create,delete i.del}function Ar(i,l){if(i.del)return Ya(l);if(l.del)return new ln(un.ERR_DOC_WAS_DELETED,"Document was deleted");if(l.create)return new ln(un.ERR_DOC_ALREADY_CREATED,"Document already created");if("op"in l){if(i.create)return new ln(un.ERR_DOC_ALREADY_CREATED,"Document already created");if(i.type.transformX){var u=i.type.transformX(i.op,l.op);i.op=u[0],l.op=u[1]}else{var f=i.type.transform(i.op,l.op,"left"),p=i.type.transform(l.op,i.op,"right");i.op=f,l.op=p}}}qe.prototype._otApply=function(i,l){if("op"in i){if(!this.type)throw new ln(un.ERR_DOC_DOES_NOT_EXIST,"Cannot apply op to uncreated document. "+this.collection+"."+this.id);if(this.emit("before op batch",i.op,l),!l&&this.type===so.defaultType&&i.op.length>1){this.applyStack||(this.applyStack=[]);for(var u=this.applyStack.length,f=0;f<i.op.length;f++){var p=i.op[f],_={op:[p]};this.emit("before op",_.op,l,i.src);for(var S=u;S<this.applyStack.length;S++){var R=Ar(this.applyStack[S],_);if(R)return this._hardRollback(R)}this._setData(this.type.apply(this.data,_.op)),this.emit("op",_.op,l,i.src)}this.emit("op batch",i.op,l),this._popApplyStack(u);return}this.emit("before op",i.op,l,i.src),this._setData(this.type.apply(this.data,i.op)),this.emit("op",i.op,l,i.src),this.emit("op batch",i.op,l);return}if(i.create){this._setType(i.create.type),this.type.deserialize?this.type.createDeserialized?this._setData(this.type.createDeserialized(i.create.data)):this._setData(this.type.deserialize(this.type.create(i.create.data))):this._setData(this.type.create(i.create.data)),this.emit("create",l);return}if(i.del){var K=this.data;this._setType(null),this.emit("del",K,l);return}},qe.prototype._sendOp=function(){if(this.connection.canSend){var i=this.connection.id;this.inflightOp||(this.inflightOp=this.pendingOps.shift());var l=this.inflightOp;if(!l){var u=new ln(un.ERR_INFLIGHT_OP_MISSING,"No op to send on call to _sendOp");return this.emit("error",u)}if(l.sentAt=Date.now(),l.retries=l.retries==null?0:l.retries+1,l.seq==null){if(this.connection.seq>=Cn.MAX_SAFE_INTEGER)return this.emit("error",new ln(un.ERR_CONNECTION_SEQ_INTEGER_OVERFLOW,"Connection seq has exceeded the max safe integer, maybe from being open for too long"));l.seq=this.connection.seq++}this.connection.sendOp(this,l),l.src==null&&(l.src=i)}},qe.prototype._submit=function(i,l,u){if(l||(l=!0),"op"in i){if(!this.type){var f=new ln(un.ERR_DOC_DOES_NOT_EXIST,"Cannot submit op. Document has not been created. "+this.collection+"."+this.id);return u?u(f):this.emit("error",f)}this.type.normalize&&(i.op=this.type.normalize(i.op))}try{this._pushOp(i,l,u),this._otApply(i,l)}catch(_){return this._hardRollback(_)}var p=this;Cn.nextTick(function(){p.flush()})},qe.prototype._pushOp=function(i,l,u){if(i.source=l,this.applyStack)this.applyStack.push(i);else{var f=this._tryCompose(i);if(f){f.callbacks.push(u);return}}i.type=this.type,i.callbacks=[u],this.pendingOps.push(i)},qe.prototype._popApplyStack=function(i){if(i>0){this.applyStack.length=i;return}var l=this.applyStack[0];if(this.applyStack=null,!!l){var u=this.pendingOps.indexOf(l);if(u!==-1)for(var f=this.pendingOps.splice(u),u=0;u<f.length;u++){var l=f[u],p=this._tryCompose(l);p?p.callbacks=p.callbacks.concat(l.callbacks):this.pendingOps.push(l)}}},qe.prototype._tryCompose=function(i){if(!this.preventCompose){var l=this.pendingOps[this.pendingOps.length-1];if(!(!l||l.sentAt)&&!(this.submitSource&&!Ho(i.source,l.source))){if(l.create&&"op"in i)return l.create.data=this.type.apply(l.create.data,i.op),l;if("op"in l&&"op"in i&&this.type.compose)return l.op=this.type.compose(l.op,i.op),l}}},qe.prototype.submitOp=function(i,l,u){typeof l=="function"&&(u=l,l=null);var f={op:i},p=l&&l.source;this._submit(f,p,u)},qe.prototype.create=function(i,l,u,f){if(typeof l=="function"?(f=l,u=null,l=null):typeof u=="function"&&(f=u,u=null),l||(l=so.defaultType.uri),this.type){var p=new ln(un.ERR_DOC_ALREADY_CREATED,"Document already exists");return f?f(p):this.emit("error",p)}var _={create:{type:l,data:i}},S=u&&u.source;this._submit(_,S,f)},qe.prototype.del=function(i,l){if(typeof i=="function"&&(l=i,i=null),!this.type){var u=new ln(un.ERR_DOC_DOES_NOT_EXIST,"Document does not exist");return l?l(u):this.emit("error",u)}var f={del:!0},p=i&&i.source;this._submit(f,p,l)},qe.prototype.pause=function(){this.paused=!0},qe.prototype.resume=function(){this.paused=!1,this.flush()},qe.prototype.toSnapshot=function(){return{v:this.version,data:Wa(this.data),type:this.type.uri}},qe.prototype._opAcknowledged=function(i){if(this.inflightOp.create)this.version=i.v;else if(i.v!==this.version)return $s.warn("Invalid version from server. Expected: "+this.version+" Received: "+i.v,i),this.fetch();this.version++,this._clearInflightOp()},qe.prototype._rollback=function(i){var l=this.inflightOp;if("op"in l&&l.type.invert){try{l.op=l.type.invert(l.op)}catch{return this._hardRollback(i)}for(var u=0;u<this.pendingOps.length;u++){var f=Ar(this.pendingOps[u],l);if(f)return this._hardRollback(f)}try{this._otApply(l,!1)}catch(p){return this._hardRollback(p)}this._clearInflightOp(i);return}this._hardRollback(i)},qe.prototype._hardRollback=function(i){var l=[];this.inflightOp&&l.push(this.inflightOp),l=l.concat(this.pendingOps),this._setType(null),this.version=null,this.inflightOp=null,this.pendingOps=[];var u=this;this.fetch(function(){for(var f=!!l.length,p=0;p<l.length;p++)f=Cn.callEach(l[p].callbacks,i)&&f;if(i&&!f)return u.emit("error",i)})},qe.prototype._clearInflightOp=function(i){var l=this.inflightOp;this.inflightOp=null;var u=Cn.callEach(l.callbacks,i);if(this.flush(),this._emitNothingPending(),i&&!u)return this.emit("error",i)};var Cu=gt,Hs=ur,Ws=Tn;function Tn(i,l,u,f,p,_,S){Cu.EventEmitter.call(this),this.action=i,this.connection=l,this.id=u,this.collection=f,this.query=p,this.results=null,_&&_.results&&(this.results=_.results,delete _.results),this.extra=void 0,this.options=_,this.callback=S,this.ready=!1,this.sent=!1}Cu.mixin(Tn),Tn.prototype.hasPending=function(){return!this.ready},Tn.prototype.send=function(){if(this.connection.canSend){var i={a:this.action,id:this.id,c:this.collection,q:this.query};if(this.options&&(i.o=this.options),this.results){for(var l=[],u=0;u<this.results.length;u++){var f=this.results[u];l.push([f.id,f.version])}i.r=l}this.connection.send(i),this.sent=!0}},Tn.prototype.destroy=function(i){this.connection.canSend&&this.action==="qs"&&this.connection.send({a:"qu",id:this.id}),this.connection._destroyQuery(this),i&&Hs.nextTick(i)},Tn.prototype._onConnectionStateChanged=function(){this.connection.canSend&&!this.sent?this.send():this.sent=!1},Tn.prototype._handleFetch=function(i,l,u){this.connection._destroyQuery(this),this._handleResponse(i,l,u)},Tn.prototype._handleSubscribe=function(i,l,u){this._handleResponse(i,l,u)},Tn.prototype._handleResponse=function(i,l,u){var f=this.callback;if(this.callback=null,i)return this._finishResponse(i,f);if(!l)return this._finishResponse(null,f);var p=this,_=1,S=function(V){if(V)return p._finishResponse(V,f);--_||p._finishResponse(null,f)};if(Array.isArray(l))_+=l.length,this.results=this._ingestSnapshots(l,S),this.extra=u;else for(var R in l){_++;var K=l[R],we=this.connection.get(K.c||this.collection,R);we.ingestSnapshot(K,S)}S()},Tn.prototype._ingestSnapshots=function(i,l){for(var u=[],f=0;f<i.length;f++){var p=i[f],_=this.connection.get(p.c||this.collection,p.d);_.ingestSnapshot(p,l),u.push(_)}return u},Tn.prototype._finishResponse=function(i,l){if(this.emit("ready"),this.ready=!0,i)return this.connection._destroyQuery(this),l?l(i):this.emit("error",i);l&&l(null,this.results,this.extra)},Tn.prototype._handleError=function(i){this.emit("error",i)},Tn.prototype._handleDiff=function(i){for(var l=0;l<i.length;l++){var u=i[l];u.type==="insert"&&(u.values=this._ingestSnapshots(u.values))}for(var l=0;l<i.length;l++){var u=i[l];switch(u.type){case"insert":var f=u.values;Array.prototype.splice.apply(this.results,[u.index,0].concat(f)),this.emit("insert",f,u.index);break;case"remove":var _=u.howMany||1,p=this.results.splice(u.index,_);this.emit("remove",p,u.index);break;case"move":var _=u.howMany||1,S=this.results.splice(u.from,_);Array.prototype.splice.apply(this.results,[u.to,0].concat(S)),this.emit("move",S,u.from,u.to);break}}this.emit("changed",this.results)},Tn.prototype._handleExtra=function(i){this.extra=i,this.emit("extra",i)};var Tu=gt,qs=ur,Pu=Dr;function Dr(i,l){if(Tu.EventEmitter.call(this),!l||typeof l!="string")throw new Error("LocalPresence presenceId must be a string");this.presence=i,this.presenceId=l,this.connection=i.connection,this.presenceVersion=0,this.value=null,this._pendingMessages=[],this._callbacksByPresenceVersion={}}Tu.mixin(Dr),Dr.prototype.submit=function(i,l){this.value=i,this.send(l)},Dr.prototype.send=function(i){var l=this._message();this._pendingMessages.push(l),this._callbacksByPresenceVersion[l.pv]=i,this._sendPending()},Dr.prototype.destroy=function(i){var l=this;this.submit(null,function(u){if(u)return l._callbackOrEmit(u,i);delete l.presence.localPresences[l.presenceId],i&&i()})},Dr.prototype._sendPending=function(){if(this.connection.canSend){var i=this;this._pendingMessages.forEach(function(l){i.connection.send(l)}),this._pendingMessages=[]}},Dr.prototype._ack=function(i,l){var u=this._getCallback(l);this._callbackOrEmit(i,u)},Dr.prototype._message=function(){return{a:"p",ch:this.presence.channel,id:this.presenceId,p:this.value,pv:this.presenceVersion++}},Dr.prototype._getCallback=function(i){var l=this._callbacksByPresenceVersion[i];return delete this._callbacksByPresenceVersion[i],l},Dr.prototype._callbackOrEmit=function(i,l){if(l)return qs.nextTick(l,i);i&&this.emit("error",i)};var Ga=ur,Vt=ku;function ku(i,l){this.presence=i,this.presenceId=l,this.connection=this.presence.connection,this.value=null,this.presenceVersion=0}ku.prototype.receiveUpdate=function(i){i.pv<this.presenceVersion||(this.value=i.p,this.presenceVersion=i.pv,this.presence._updateRemotePresence(this))},ku.prototype.destroy=function(i){delete this.presence._remotePresenceInstances[this.presenceId],delete this.presence.remotePresences[this.presenceId],i&&Ga.nextTick(i)};var qo={exports:{}};(function(i,l){(function(u,f){f(l)})(N,function(u){function f(a,d){d=d|0;for(var h=Math.max(a.length-d,0),y=Array(h),k=0;k<h;k++)y[k]=a[d+k];return y}var p=function(a){var d=f(arguments,1);return function(){var h=f(arguments);return a.apply(null,d.concat(h))}},_=function(a){return function(){var d=f(arguments),h=d.pop();a.call(this,d,h)}};function S(a){var d=typeof a;return a!=null&&(d=="object"||d=="function")}var R=typeof setImmediate=="function"&&setImmediate,K=typeof lr=="object"&&typeof lr.nextTick=="function";function we(a){setTimeout(a,0)}function V(a){return function(d){var h=f(arguments,1);a(function(){d.apply(null,h)})}}var C;R?C=setImmediate:K?C=lr.nextTick:C=we;var I=V(C);function z(a){return _(function(d,h){var y;try{y=a.apply(this,d)}catch(k){return h(k)}S(y)&&typeof y.then=="function"?y.then(function(k){pe(h,null,k)},function(k){pe(h,k.message?k:new Error(k))}):h(null,y)})}function pe(a,d,h){try{a(d,h)}catch(y){I(He,y)}}function He(a){throw a}var Ct=typeof Symbol=="function";function be(a){return Ct&&a[Symbol.toStringTag]==="AsyncFunction"}function Oe(a){return be(a)?z(a):a}function xr(a){return function(d){var h=f(arguments,1),y=_(function(k,T){var A=this;return a(d,function(x,ee){Oe(x).apply(A,k.concat(ee))},T)});return h.length?y.apply(this,h):y}}var Ht=typeof N=="object"&&N&&N.Object===Object&&N,F=typeof self=="object"&&self&&self.Object===Object&&self,q=Ht||F||Function("return this")(),b=q.Symbol,xe=Object.prototype,We=xe.hasOwnProperty,je=xe.toString,en=b?b.toStringTag:void 0;function Tt(a){var d=We.call(a,en),h=a[en];try{a[en]=void 0;var y=!0}catch{}var k=je.call(a);return y&&(d?a[en]=h:delete a[en]),k}var dt=Object.prototype,st=dt.toString;function Wt(a){return st.call(a)}var xn="[object Null]",Bu="[object Undefined]",qi=b?b.toStringTag:void 0;function br(a){return a==null?a===void 0?Bu:xn:qi&&qi in Object(a)?Tt(a):Wt(a)}var Si="[object AsyncFunction]",Qi="[object Function]",wi="[object GeneratorFunction]",yo="[object Proxy]";function Ml(a){if(!S(a))return!1;var d=br(a);return d==Qi||d==wi||d==Si||d==yo}var w=9007199254740991;function D(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=w}function Y(a){return a!=null&&D(a.length)&&!Ml(a)}var ie={};function M(){}function J(a){return function(){if(a!==null){var d=a;a=null,d.apply(this,arguments)}}}var Ce=typeof Symbol=="function"&&Symbol.iterator,Te=function(a){return Ce&&a[Ce]&&a[Ce]()};function U(a,d){for(var h=-1,y=Array(a);++h<a;)y[h]=d(h);return y}function X(a){return a!=null&&typeof a=="object"}var te="[object Arguments]";function G(a){return X(a)&&br(a)==te}var Se=Object.prototype,Ae=Se.hasOwnProperty,H=Se.propertyIsEnumerable,ye=G(function(){return arguments}())?G:function(a){return X(a)&&Ae.call(a,"callee")&&!H.call(a,"callee")},Ye=Array.isArray;function rt(){return!1}var ze=typeof u=="object"&&u&&!u.nodeType&&u,Et=ze&&!0&&i&&!i.nodeType&&i,yn=Et&&Et.exports===ze,$t=yn?q.Buffer:void 0,Pt=$t?$t.isBuffer:void 0,yt=Pt||rt,kn=9007199254740991,mn=/^(?:0|[1-9]\d*)$/;function jn(a,d){var h=typeof a;return d=d??kn,!!d&&(h=="number"||h!="symbol"&&mn.test(a))&&a>-1&&a%1==0&&a<d}var gn="[object Arguments]",_n="[object Array]",zn="[object Boolean]",Xe="[object Date]",ae="[object Error]",De="[object Function]",de="[object Map]",oe="[object Number]",_e="[object Object]",Fe="[object RegExp]",Qe="[object Set]",Ze="[object String]",Ut="[object WeakMap]",At="[object ArrayBuffer]",at="[object DataView]",bt="[object Float32Array]",$e="[object Float64Array]",le="[object Int8Array]",ue="[object Int16Array]",kt="[object Int32Array]",qt="[object Uint8Array]",Nn="[object Uint8ClampedArray]",jr="[object Uint16Array]",Ln="[object Uint32Array]",et={};et[bt]=et[$e]=et[le]=et[ue]=et[kt]=et[qt]=et[Nn]=et[jr]=et[Ln]=!0,et[gn]=et[_n]=et[At]=et[zn]=et[at]=et[Xe]=et[ae]=et[De]=et[de]=et[oe]=et[_e]=et[Fe]=et[Qe]=et[Ze]=et[Ut]=!1;function Or(a){return X(a)&&D(a.length)&&!!et[br(a)]}function sn(a){return function(d){return a(d)}}var Fn=typeof u=="object"&&u&&!u.nodeType&&u,me=Fn&&!0&&i&&!i.nodeType&&i,St=me&&me.exports===Fn,Dt=St&&Ht.process,pt=function(){try{var a=me&&me.require&&me.require("util").types;return a||Dt&&Dt.binding&&Dt.binding("util")}catch{}}(),an=pt&&pt.isTypedArray,Yn=an?sn(an):Or,Yi=Object.prototype,Oi=Yi.hasOwnProperty;function mo(a,d){var h=Ye(a),y=!h&&ye(a),k=!h&&!y&&yt(a),T=!h&&!y&&!k&&Yn(a),A=h||y||k||T,x=A?U(a.length,String):[],ee=x.length;for(var he in a)(d||Oi.call(a,he))&&!(A&&(he=="length"||k&&(he=="offset"||he=="parent")||T&&(he=="buffer"||he=="byteLength"||he=="byteOffset")||jn(he,ee)))&&x.push(he);return x}var zr=Object.prototype;function Un(a){var d=a&&a.constructor,h=typeof d=="function"&&d.prototype||zr;return a===h}function Ri(a,d){return function(h){return a(d(h))}}var Xr=Ri(Object.keys,Object),Rr=Object.prototype,Ci=Rr.hasOwnProperty;function la(a){if(!Un(a))return Xr(a);var d=[];for(var h in Object(a))Ci.call(a,h)&&h!="constructor"&&d.push(h);return d}function Ti(a){return Y(a)?mo(a):la(a)}function Fr(a){var d=-1,h=a.length;return function(){return++d<h?{value:a[d],key:d}:null}}function el(a){var d=-1;return function(){var y=a.next();return y.done?null:(d++,{value:y.value,key:d})}}function Jr(a){var d=Ti(a),h=-1,y=d.length;return function(){var T=d[++h];return h<y?{value:a[T],key:T}:null}}function Vu(a){if(Y(a))return Fr(a);var d=Te(a);return d?el(d):Jr(a)}function Ur(a){return function(){if(a===null)throw new Error("Callback was already called.");var d=a;a=null,d.apply(this,arguments)}}function xl(a){return function(d,h,y){if(y=J(y||M),a<=0||!d)return y(null);var k=Vu(d),T=!1,A=0,x=!1;function ee(ne,Le){if(A-=1,ne)T=!0,y(ne);else{if(Le===ie||T&&A<=0)return T=!0,y(null);x||he()}}function he(){for(x=!0;A<a&&!T;){var ne=k();if(ne===null){T=!0,A<=0&&y(null);return}A+=1,h(ne.value,ne.key,Ur(ee))}x=!1}he()}}function Gn(a,d,h,y){xl(d)(a,Oe(h),y)}function Qt(a,d){return function(h,y,k){return a(h,d,y,k)}}function go(a,d,h){h=J(h||M);var y=0,k=0,T=a.length;T===0&&h(null);function A(x,ee){x?h(x):(++k===T||ee===ie)&&h(null)}for(;y<T;y++)d(a[y],y,Ur(A))}var jl=Qt(Gn,1/0),Br=function(a,d,h){var y=Y(a)?go:jl;y(a,Oe(d),h)};function Cr(a){return function(d,h,y){return a(Br,d,Oe(h),y)}}function Zr(a,d,h,y){y=y||M,d=d||[];var k=[],T=0,A=Oe(h);a(d,function(x,ee,he){var ne=T++;A(x,function(Le,Rt){k[ne]=Rt,he(Le)})},function(x){y(x,k)})}var mt=Cr(Zr),wt=xr(mt);function Kn(a){return function(d,h,y,k){return a(xl(h),d,Oe(y),k)}}var Yt=Kn(Zr),En=Qt(Yt,1),Pi=xr(En);function ei(a,d){for(var h=-1,y=a==null?0:a.length;++h<y&&d(a[h],h,a)!==!1;);return a}function Bn(a){return function(d,h,y){for(var k=-1,T=Object(d),A=y(d),x=A.length;x--;){var ee=A[a?x:++k];if(h(T[ee],ee,T)===!1)break}return d}}var zl=Bn();function _o(a,d){return a&&zl(a,d,Ti)}function ua(a,d,h,y){for(var k=a.length,T=h+(y?1:-1);y?T--:++T<k;)if(d(a[T],T,a))return T;return-1}function Fl(a){return a!==a}function sa(a,d,h){for(var y=h-1,k=a.length;++y<k;)if(a[y]===d)return y;return-1}function sr(a,d,h){return d===d?sa(a,d,h):ua(a,Fl,h)}var Eo=function(a,d,h){typeof d=="function"&&(h=d,d=null),h=J(h||M);var y=Ti(a),k=y.length;if(!k)return h(null);d||(d=k);var T={},A=0,x=!1,ee=Object.create(null),he=[],ne=[],Le={};_o(a,function(jt,zt){if(!Ye(jt)){Rt(zt,[jt]),ne.push(zt);return}var Xt=jt.slice(0,jt.length-1),Hr=Xt.length;if(Hr===0){Rt(zt,jt),ne.push(zt);return}Le[zt]=Hr,ei(Xt,function(si){if(!a[si])throw new Error("async.auto task `"+zt+"` has a non-existent dependency `"+si+"` in "+Xt.join(", "));pr(si,function(){Hr--,Hr===0&&Rt(zt,jt)})})}),_s(),cn();function Rt(jt,zt){he.push(function(){Pr(jt,zt)})}function cn(){if(he.length===0&&A===0)return h(null,T);for(;he.length&&A<d;){var jt=he.shift();jt()}}function pr(jt,zt){var Xt=ee[jt];Xt||(Xt=ee[jt]=[]),Xt.push(zt)}function $n(jt){var zt=ee[jt]||[];ei(zt,function(Xt){Xt()}),cn()}function Pr(jt,zt){if(!x){var Xt=Ur(function(si,kr){if(A--,arguments.length>2&&(kr=f(arguments,1)),si){var Es={};_o(T,function(Sa,Ss){Es[Ss]=Sa}),Es[jt]=kr,x=!0,ee=Object.create(null),h(si,Es)}else T[jt]=kr,$n(jt)});A++;var Hr=Oe(zt[zt.length-1]);zt.length>1?Hr(T,Xt):Hr(Xt)}}function _s(){for(var jt,zt=0;ne.length;)jt=ne.pop(),zt++,ei(su(jt),function(Xt){--Le[Xt]===0&&ne.push(Xt)});if(zt!==k)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function su(jt){var zt=[];return _o(a,function(Xt,Hr){Ye(Xt)&&sr(Xt,jt,0)>=0&&zt.push(Hr)}),zt}};function ki(a,d){for(var h=-1,y=a==null?0:a.length,k=Array(y);++h<y;)k[h]=d(a[h],h,a);return k}var aa="[object Symbol]";function Za(a){return typeof a=="symbol"||X(a)&&br(a)==aa}var Ni=1/0,Gi=b?b.prototype:void 0,Ki=Gi?Gi.toString:void 0;function So(a){if(typeof a=="string")return a;if(Ye(a))return ki(a,So)+"";if(Za(a))return Ki?Ki.call(a):"";var d=a+"";return d=="0"&&1/a==-Ni?"-0":d}function Ul(a,d,h){var y=-1,k=a.length;d<0&&(d=-d>k?0:k+d),h=h>k?k:h,h<0&&(h+=k),k=d>h?0:h-d>>>0,d>>>=0;for(var T=Array(k);++y<k;)T[y]=a[y+d];return T}function ar(a,d,h){var y=a.length;return h=h===void 0?y:h,!d&&h>=y?a:Ul(a,d,h)}function cr(a,d){for(var h=a.length;h--&&sr(d,a[h],0)>-1;);return h}function bi(a,d){for(var h=-1,y=a.length;++h<y&&sr(d,a[h],0)>-1;);return h}function ti(a){return a.split("")}var ni="\\ud800-\\udfff",Xi="\\u0300-\\u036f",ca="\\ufe20-\\ufe2f",$u="\\u20d0-\\u20ff",Hu=Xi+ca+$u,bn="\\ufe0e\\ufe0f",Xn="\\u200d",Mt=RegExp("["+Xn+ni+Hu+bn+"]");function Tr(a){return Mt.test(a)}var Wu="\\ud800-\\udfff",fa="\\u0300-\\u036f",qu="\\ufe20-\\ufe2f",Qu="\\u20d0-\\u20ff",da=fa+qu+Qu,Bl="\\ufe0e\\ufe0f",pa="["+Wu+"]",Li="["+da+"]",tl="\\ud83c[\\udffb-\\udfff]",ec="(?:"+Li+"|"+tl+")",fr="[^"+Wu+"]",nl="(?:\\ud83c[\\udde6-\\uddff]){2}",rl="[\\ud800-\\udbff][\\udc00-\\udfff]",wo="\\u200d",Vl=ec+"?",$l="["+Bl+"]?",Yu="(?:"+wo+"(?:"+[fr,nl,rl].join("|")+")"+$l+Vl+")*",Gu=$l+Vl+Yu,Oo="(?:"+[fr+Li+"?",Li,nl,rl,pa].join("|")+")",dr=RegExp(tl+"(?="+tl+")|"+Oo+Gu,"g");function Ji(a){return a.match(dr)||[]}function Hl(a){return Tr(a)?Ji(a):ti(a)}function ha(a){return a==null?"":So(a)}var ri=/^\s+|\s+$/g;function Ii(a,d,h){if(a=ha(a),a&&(h||d===void 0))return a.replace(ri,"");if(!a||!(d=So(d)))return a;var y=Hl(a),k=Hl(d),T=bi(y,k),A=cr(y,k)+1;return ar(y,T,A).join("")}var Ku=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,va=/,/,ii=/(=.+)?(\s*)$/,Ai=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;function Wl(a){return a=a.toString().replace(Ai,""),a=a.match(Ku)[2].replace(" ",""),a=a?a.split(va):[],a=a.map(function(d){return Ii(d.replace(ii,""))}),a}function bu(a,d){var h={};_o(a,function(y,k){var T,A=be(y),x=!A&&y.length===1||A&&y.length===0;if(Ye(y))T=y.slice(0,-1),y=y[y.length-1],h[k]=T.concat(T.length>0?ee:y);else if(x)h[k]=y;else{if(T=Wl(y),y.length===0&&!A&&T.length===0)throw new Error("autoInject task functions require explicit parameters.");A||T.pop(),h[k]=T.concat(ee)}function ee(he,ne){var Le=ki(T,function(Rt){return he[Rt]});Le.push(ne),Oe(y).apply(null,Le)}}),Eo(h,d)}function Vn(){this.head=this.tail=null,this.length=0}function Xu(a,d){a.length=1,a.head=a.tail=d}Vn.prototype.removeLink=function(a){return a.prev?a.prev.next=a.next:this.head=a.next,a.next?a.next.prev=a.prev:this.tail=a.prev,a.prev=a.next=null,this.length-=1,a},Vn.prototype.empty=function(){for(;this.head;)this.shift();return this},Vn.prototype.insertAfter=function(a,d){d.prev=a,d.next=a.next,a.next?a.next.prev=d:this.tail=d,a.next=d,this.length+=1},Vn.prototype.insertBefore=function(a,d){d.prev=a.prev,d.next=a,a.prev?a.prev.next=d:this.head=d,a.prev=d,this.length+=1},Vn.prototype.unshift=function(a){this.head?this.insertBefore(this.head,a):Xu(this,a)},Vn.prototype.push=function(a){this.tail?this.insertAfter(this.tail,a):Xu(this,a)},Vn.prototype.shift=function(){return this.head&&this.removeLink(this.head)},Vn.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},Vn.prototype.toArray=function(){for(var a=Array(this.length),d=this.head,h=0;h<this.length;h++)a[h]=d.data,d=d.next;return a},Vn.prototype.remove=function(a){for(var d=this.head;d;){var h=d.next;a(d)&&this.removeLink(d),d=h}return this};function Ju(a,d,h){if(d==null)d=1;else if(d===0)throw new Error("Concurrency must not be zero");var y=Oe(a),k=0,T=[],A=!1;function x(Le,Rt,cn){if(cn!=null&&typeof cn!="function")throw new Error("task callback must be a function");if(ne.started=!0,Ye(Le)||(Le=[Le]),Le.length===0&&ne.idle())return I(function(){ne.drain()});for(var pr=0,$n=Le.length;pr<$n;pr++){var Pr={data:Le[pr],callback:cn||M};Rt?ne._tasks.unshift(Pr):ne._tasks.push(Pr)}A||(A=!0,I(function(){A=!1,ne.process()}))}function ee(Le){return function(Rt){k-=1;for(var cn=0,pr=Le.length;cn<pr;cn++){var $n=Le[cn],Pr=sr(T,$n,0);Pr===0?T.shift():Pr>0&&T.splice(Pr,1),$n.callback.apply($n,arguments),Rt!=null&&ne.error(Rt,$n.data)}k<=ne.concurrency-ne.buffer&&ne.unsaturated(),ne.idle()&&ne.drain(),ne.process()}}var he=!1,ne={_tasks:new Vn,concurrency:d,payload:h,saturated:M,unsaturated:M,buffer:d/4,empty:M,drain:M,error:M,started:!1,paused:!1,push:function(Le,Rt){x(Le,!1,Rt)},kill:function(){ne.drain=M,ne._tasks.empty()},unshift:function(Le,Rt){x(Le,!0,Rt)},remove:function(Le){ne._tasks.remove(Le)},process:function(){if(!he){for(he=!0;!ne.paused&&k<ne.concurrency&&ne._tasks.length;){var Le=[],Rt=[],cn=ne._tasks.length;ne.payload&&(cn=Math.min(cn,ne.payload));for(var pr=0;pr<cn;pr++){var $n=ne._tasks.shift();Le.push($n),T.push($n),Rt.push($n.data)}k+=1,ne._tasks.length===0&&ne.empty(),k===ne.concurrency&&ne.saturated();var Pr=Ur(ee(Le));y(Rt,Pr)}he=!1}},length:function(){return ne._tasks.length},running:function(){return k},workersList:function(){return T},idle:function(){return ne._tasks.length+k===0},pause:function(){ne.paused=!0},resume:function(){ne.paused!==!1&&(ne.paused=!1,I(ne.process))}};return ne}function ql(a,d){return Ju(a,1,d)}var oi=Qt(Gn,1);function li(a,d,h,y){y=J(y||M);var k=Oe(h);oi(a,function(T,A,x){k(d,T,function(ee,he){d=he,x(ee)})},function(T){y(T,d)})}function Ql(){var a=ki(arguments,Oe);return function(){var d=f(arguments),h=this,y=d[d.length-1];typeof y=="function"?d.pop():y=M,li(a,d,function(k,T,A){T.apply(h,k.concat(function(x){var ee=f(arguments,1);A(x,ee)}))},function(k,T){y.apply(h,[k].concat(T))})}}var Zu=function(){return Ql.apply(null,f(arguments).reverse())},es=Array.prototype.concat,Di=function(a,d,h,y){y=y||M;var k=Oe(h);Yt(a,d,function(T,A){k(T,function(x){return x?A(x):A(null,f(arguments,1))})},function(T,A){for(var x=[],ee=0;ee<A.length;ee++)A[ee]&&(x=es.apply(x,A[ee]));return y(T,x)})},il=Qt(Di,1/0),ts=Qt(Di,1),ns=function(){var a=f(arguments),d=[null].concat(a);return function(){var h=arguments[arguments.length-1];return h.apply(this,d)}};function Vr(a){return a}function Zi(a,d){return function(h,y,k,T){T=T||M;var A=!1,x;h(y,function(ee,he,ne){k(ee,function(Le,Rt){Le?ne(Le):a(Rt)&&!x?(A=!0,x=d(!0,ee),ne(null,ie)):ne()})},function(ee){ee?T(ee):T(null,A?x:d(!1))})}}function Ro(a,d){return d}var Jn=Cr(Zi(Vr,Ro)),ui=Kn(Zi(Vr,Ro)),Mi=Qt(ui,1);function xi(a){return function(d){var h=f(arguments,1);h.push(function(y){var k=f(arguments,1);typeof console=="object"&&(y?console.error&&console.error(y):console[a]&&ei(k,function(T){console[a](T)}))}),Oe(d).apply(null,h)}}var Yl=xi("dir");function eo(a,d,h){h=Ur(h||M);var y=Oe(a),k=Oe(d);function T(x){if(x)return h(x);var ee=f(arguments,1);ee.push(A),k.apply(this,ee)}function A(x,ee){if(x)return h(x);if(!ee)return h(null);y(T)}A(null,!0)}function Gl(a,d,h){h=Ur(h||M);var y=Oe(a),k=function(T){if(T)return h(T);var A=f(arguments,1);if(d.apply(this,A))return y(k);h.apply(null,[null].concat(A))};y(k)}function Kl(a,d,h){Gl(a,function(){return!d.apply(this,arguments)},h)}function xt(a,d,h){h=Ur(h||M);var y=Oe(d),k=Oe(a);function T(x){if(x)return h(x);k(A)}function A(x,ee){if(x)return h(x);if(!ee)return h(null);y(T)}k(A)}function ol(a){return function(d,h,y){return a(d,y)}}function Co(a,d,h){Br(a,ol(Oe(d)),h)}function to(a,d,h,y){xl(d)(a,ol(Oe(h)),y)}var ji=Qt(to,1);function ll(a){return be(a)?a:_(function(d,h){var y=!0;d.push(function(){var k=arguments;y?I(function(){h.apply(null,k)}):h.apply(null,k)}),a.apply(this,d),y=!1})}function $r(a){return!a}var Ot=Cr(Zi($r,$r)),Bt=Kn(Zi($r,$r)),Gt=Qt(Bt,1);function ul(a){return function(d){return d==null?void 0:d[a]}}function sl(a,d,h,y){var k=new Array(d.length);a(d,function(T,A,x){h(T,function(ee,he){k[A]=!!he,x(ee)})},function(T){if(T)return y(T);for(var A=[],x=0;x<d.length;x++)k[x]&&A.push(d[x]);y(null,A)})}function al(a,d,h,y){var k=[];a(d,function(T,A,x){h(T,function(ee,he){ee?x(ee):(he&&k.push({index:A,value:T}),x())})},function(T){T?y(T):y(null,ki(k.sort(function(A,x){return A.index-x.index}),ul("value")))})}function rs(a,d,h,y){var k=Y(d)?sl:al;k(a,d,Oe(h),y||M)}var tn=Cr(rs),no=Kn(rs),To=Qt(no,1);function bl(a,d){var h=Ur(d||M),y=Oe(ll(a));function k(T){if(T)return h(T);y(k)}k()}var Zn=function(a,d,h,y){y=y||M;var k=Oe(h);Yt(a,d,function(T,A){k(T,function(x,ee){return x?A(x):A(null,{key:ee,val:T})})},function(T,A){for(var x={},ee=Object.prototype.hasOwnProperty,he=0;he<A.length;he++)if(A[he]){var ne=A[he].key,Le=A[he].val;ee.call(x,ne)?x[ne].push(Le):x[ne]=[Le]}return y(T,x)})},er=Qt(Zn,1/0),Po=Qt(Zn,1),Xl=xi("log");function ko(a,d,h,y){y=J(y||M);var k={},T=Oe(h);Gn(a,d,function(A,x,ee){T(A,x,function(he,ne){if(he)return ee(he);k[x]=ne,ee()})},function(A){y(A,k)})}var is=Qt(ko,1/0),os=Qt(ko,1);function ls(a,d){return d in a}function us(a,d){var h=Object.create(null),y=Object.create(null);d=d||Vr;var k=Oe(a),T=_(function(x,ee){var he=d.apply(null,x);ls(h,he)?I(function(){ee.apply(null,h[he])}):ls(y,he)?y[he].push(ee):(y[he]=[ee],k.apply(null,x.concat(function(){var ne=f(arguments);h[he]=ne;var Le=y[he];delete y[he];for(var Rt=0,cn=Le.length;Rt<cn;Rt++)Le[Rt].apply(null,ne)})))});return T.memo=h,T.unmemoized=a,T}var cl;K?cl=lr.nextTick:R?cl=setImmediate:cl=we;var ss=V(cl);function Jl(a,d,h){h=h||M;var y=Y(d)?[]:{};a(d,function(k,T,A){Oe(k)(function(x,ee){arguments.length>2&&(ee=f(arguments,1)),y[T]=ee,A(x)})},function(k){h(k,y)})}function as(a,d){Jl(Br,a,d)}function No(a,d,h){Jl(xl(d),a,h)}var Zl=function(a,d){var h=Oe(a);return Ju(function(y,k){h(y[0],k)},d,1)},fl=function(a,d){var h=Zl(a,d);return h.push=function(y,k,T){if(T==null&&(T=M),typeof T!="function")throw new Error("task callback must be a function");if(h.started=!0,Ye(y)||(y=[y]),y.length===0)return I(function(){h.drain()});k=k||0;for(var A=h._tasks.head;A&&k>=A.priority;)A=A.next;for(var x=0,ee=y.length;x<ee;x++){var he={data:y[x],priority:k,callback:T};A?h._tasks.insertBefore(A,he):h._tasks.push(he)}I(h.process)},delete h.unshift,h};function dl(a,d){if(d=J(d||M),!Ye(a))return d(new TypeError("First argument to race must be an array of functions"));if(!a.length)return d();for(var h=0,y=a.length;h<y;h++)Oe(a[h])(d)}function pl(a,d,h,y){var k=f(a).reverse();li(k,d,h,y)}function Lo(a){var d=Oe(a);return _(function(y,k){return y.push(function(A,x){if(A)k(null,{error:A});else{var ee;arguments.length<=2?ee=x:ee=f(arguments,1),k(null,{value:ee})}}),d.apply(this,y)})}function cs(a){var d;return Ye(a)?d=ki(a,Lo):(d={},_o(a,function(h,y){d[y]=Lo.call(this,h)})),d}function fs(a,d,h,y){rs(a,d,function(k,T){h(k,function(A,x){T(A,!x)})},y)}var ds=Cr(fs),eu=Kn(fs),tu=Qt(eu,1);function ps(a){return function(){return a}}function hl(a,d,h){var y=5,k=0,T={times:y,intervalFunc:ps(k)};function A(ne,Le){if(typeof Le=="object")ne.times=+Le.times||y,ne.intervalFunc=typeof Le.interval=="function"?Le.interval:ps(+Le.interval||k),ne.errorFilter=Le.errorFilter;else if(typeof Le=="number"||typeof Le=="string")ne.times=+Le||y;else throw new Error("Invalid arguments for async.retry")}if(arguments.length<3&&typeof a=="function"?(h=d||M,d=a):(A(T,a),h=h||M),typeof d!="function")throw new Error("Invalid arguments for async.retry");var x=Oe(d),ee=1;function he(){x(function(ne){ne&&ee++<T.times&&(typeof T.errorFilter!="function"||T.errorFilter(ne))?setTimeout(he,T.intervalFunc(ee)):h.apply(null,arguments)})}he()}var hs=function(a,d){d||(d=a,a=null);var h=Oe(d);return _(function(y,k){function T(A){h.apply(null,y.concat(A))}a?hl(a,T,k):hl(T,k)})};function ya(a,d){Jl(oi,a,d)}var vl=Cr(Zi(Boolean,Vr)),yl=Kn(Zi(Boolean,Vr)),nu=Qt(yl,1);function vs(a,d,h){var y=Oe(d);mt(a,function(T,A){y(T,function(x,ee){if(x)return A(x);A(null,{value:T,criteria:ee})})},function(T,A){if(T)return h(T);h(null,ki(A.sort(k),ul("value")))});function k(T,A){var x=T.criteria,ee=A.criteria;return x<ee?-1:x>ee?1:0}}function ys(a,d,h){var y=Oe(a);return _(function(k,T){var A=!1,x;function ee(){var he=a.name||"anonymous",ne=new Error('Callback function "'+he+'" timed out.');ne.code="ETIMEDOUT",h&&(ne.info=h),A=!0,T(ne)}k.push(function(){A||(T.apply(null,arguments),clearTimeout(x))}),x=setTimeout(ee,d),y.apply(null,k)})}var ma=Math.ceil,ru=Math.max;function tc(a,d,h,y){for(var k=-1,T=ru(ma((d-a)/(h||1)),0),A=Array(T);T--;)A[y?T:++k]=a,a+=h;return A}function iu(a,d,h,y){var k=Oe(h);Yt(tc(0,a,1),d,k,y)}var ga=Qt(iu,1/0),ro=Qt(iu,1);function ou(a,d,h,y){arguments.length<=3&&(y=h,h=d,d=Ye(a)?[]:{}),y=J(y||M);var k=Oe(h);Br(a,function(T,A,x){k(d,T,A,x)},function(T){y(T,d)})}function lu(a,d){var h=null,y;d=d||M,ji(a,function(k,T){Oe(k)(function(A,x){arguments.length>2?y=f(arguments,1):y=x,h=A,T(!A)})},function(){d(h,y)})}function _a(a){return function(){return(a.unmemoized||a).apply(null,arguments)}}function uu(a,d,h){h=Ur(h||M);var y=Oe(d);if(!a())return h(null);var k=function(T){if(T)return h(T);if(a())return y(k);var A=f(arguments,1);h.apply(null,[null].concat(A))};y(k)}function ms(a,d,h){uu(function(){return!a.apply(this,arguments)},d,h)}var gs=function(a,d){if(d=J(d||M),!Ye(a))return d(new Error("First argument to waterfall must be an array of functions"));if(!a.length)return d();var h=0;function y(T){var A=Oe(a[h++]);T.push(Ur(k)),A.apply(null,T)}function k(T){if(T||h===a.length)return d.apply(null,arguments);y(f(arguments,1))}y([])},Ea={apply:p,applyEach:wt,applyEachSeries:Pi,asyncify:z,auto:Eo,autoInject:bu,cargo:ql,compose:Zu,concat:il,concatLimit:Di,concatSeries:ts,constant:ns,detect:Jn,detectLimit:ui,detectSeries:Mi,dir:Yl,doDuring:eo,doUntil:Kl,doWhilst:Gl,during:xt,each:Co,eachLimit:to,eachOf:Br,eachOfLimit:Gn,eachOfSeries:oi,eachSeries:ji,ensureAsync:ll,every:Ot,everyLimit:Bt,everySeries:Gt,filter:tn,filterLimit:no,filterSeries:To,forever:bl,groupBy:er,groupByLimit:Zn,groupBySeries:Po,log:Xl,map:mt,mapLimit:Yt,mapSeries:En,mapValues:is,mapValuesLimit:ko,mapValuesSeries:os,memoize:us,nextTick:ss,parallel:as,parallelLimit:No,priorityQueue:fl,queue:Zl,race:dl,reduce:li,reduceRight:pl,reflect:Lo,reflectAll:cs,reject:ds,rejectLimit:eu,rejectSeries:tu,retry:hl,retryable:hs,seq:Ql,series:ya,setImmediate:I,some:vl,someLimit:yl,someSeries:nu,sortBy:vs,timeout:ys,times:ga,timesLimit:iu,timesSeries:ro,transform:ou,tryEach:lu,unmemoize:_a,until:ms,waterfall:gs,whilst:uu,all:Ot,allLimit:Bt,allSeries:Gt,any:vl,anyLimit:yl,anySeries:nu,find:Jn,findLimit:ui,findSeries:Mi,forEach:Co,forEachSeries:ji,forEachLimit:to,forEachOf:Br,forEachOfSeries:oi,forEachOfLimit:Gn,inject:li,foldl:li,foldr:pl,select:tn,selectLimit:no,selectSeries:To,wrapSync:z};u.default=Ea,u.apply=p,u.applyEach=wt,u.applyEachSeries=Pi,u.asyncify=z,u.auto=Eo,u.autoInject=bu,u.cargo=ql,u.compose=Zu,u.concat=il,u.concatLimit=Di,u.concatSeries=ts,u.constant=ns,u.detect=Jn,u.detectLimit=ui,u.detectSeries=Mi,u.dir=Yl,u.doDuring=eo,u.doUntil=Kl,u.doWhilst=Gl,u.during=xt,u.each=Co,u.eachLimit=to,u.eachOf=Br,u.eachOfLimit=Gn,u.eachOfSeries=oi,u.eachSeries=ji,u.ensureAsync=ll,u.every=Ot,u.everyLimit=Bt,u.everySeries=Gt,u.filter=tn,u.filterLimit=no,u.filterSeries=To,u.forever=bl,u.groupBy=er,u.groupByLimit=Zn,u.groupBySeries=Po,u.log=Xl,u.map=mt,u.mapLimit=Yt,u.mapSeries=En,u.mapValues=is,u.mapValuesLimit=ko,u.mapValuesSeries=os,u.memoize=us,u.nextTick=ss,u.parallel=as,u.parallelLimit=No,u.priorityQueue=fl,u.queue=Zl,u.race=dl,u.reduce=li,u.reduceRight=pl,u.reflect=Lo,u.reflectAll=cs,u.reject=ds,u.rejectLimit=eu,u.rejectSeries=tu,u.retry=hl,u.retryable=hs,u.seq=Ql,u.series=ya,u.setImmediate=I,u.some=vl,u.someLimit=yl,u.someSeries=nu,u.sortBy=vs,u.timeout=ys,u.times=ga,u.timesLimit=iu,u.timesSeries=ro,u.transform=ou,u.tryEach=lu,u.unmemoize=_a,u.until=ms,u.waterfall=gs,u.whilst=uu,u.all=Ot,u.allLimit=Bt,u.allSeries=Gt,u.any=vl,u.anyLimit=yl,u.anySeries=nu,u.find=Jn,u.findLimit=ui,u.findSeries=Mi,u.forEach=Co,u.forEachSeries=ji,u.forEachLimit=to,u.forEachOf=Br,u.forEachOfSeries=oi,u.forEachOfLimit=Gn,u.inject=li,u.foldl=li,u.foldr=pl,u.select=tn,u.selectLimit=no,u.selectSeries=To,u.wrapSync=z,Object.defineProperty(u,"__esModule",{value:!0})})})(qo,qo.exports);var Nu={exports:{}},ao=Nu.exports=function(i,l){if(l||(l=16),i===void 0&&(i=128),i<=0)return"0";for(var u=Math.log(Math.pow(2,i))/Math.log(l),f=2;u===1/0;f*=2)u=Math.log(Math.pow(2,i/f))/Math.log(l)*f;for(var p=u-Math.floor(u),_="",f=0;f<Math.floor(u);f++){var S=Math.floor(Math.random()*l).toString(l);_=S+_}if(p){var R=Math.pow(l,p),S=Math.floor(Math.random()*R).toString(l);_=S+_}var K=parseInt(_,l);return K!==1/0&&K>=Math.pow(2,i)?ao(i,l):_};ao.rack=function(i,l,u){var f=function(_){var S=0;do{if(S++>10)if(u)i+=u;else throw new Error("too many ID collisions, use more bits");var R=ao(i,l)}while(Object.hasOwnProperty.call(p,R));return p[R]=_,R},p=f.hats={};return f.get=function(_){return f.hats[_]},f.set=function(_,S){return f.hats[_]=S,f},f.bits=i||128,f.base=l||16,f};var Qs=gt,Ys=Pu,Rl=Vt,Qn=ur,Lu=qo.exports,Er=Nu.exports,Gs=Kt;function Kt(i,l){if(Qs.EventEmitter.call(this),!l||typeof l!="string")throw new Error("Presence channel must be provided");this.connection=i,this.channel=l,this.wantSubscribe=!1,this.subscribed=!1,this.remotePresences={},this.localPresences={},this._remotePresenceInstances={},this._subscriptionCallbacksBySeq={}}Qs.mixin(Kt),Kt.prototype.subscribe=function(i){this._sendSubscriptionAction(!0,i)},Kt.prototype.unsubscribe=function(i){this._sendSubscriptionAction(!1,i)},Kt.prototype.create=function(i){i=i||Er();var l=this._createLocalPresence(i);return this.localPresences[i]=l,l},Kt.prototype.destroy=function(i){var l=this;this.unsubscribe(function(u){if(u)return l._callbackOrEmit(u,i);var f=Object.keys(l.localPresences),p=Object.keys(l._remotePresenceInstances);Lu.parallel([function(_){Lu.each(f,function(S,R){l.localPresences[S].destroy(R)},_)},function(_){Lu.each(p,function(S,R){l._remotePresenceInstances[S].destroy(R)},_)}],function(_){delete l.connection._presences[l.channel],l._callbackOrEmit(_,i)})})},Kt.prototype._sendSubscriptionAction=function(i,l){this.wantSubscribe=!!i;var u=this.wantSubscribe?"ps":"pu",f=this.connection._presenceSeq++;this._subscriptionCallbacksBySeq[f]=l,this.connection.canSend&&this.connection._sendPresenceAction(u,f,this)},Kt.prototype._handleSubscribe=function(i,l){this.wantSubscribe&&(this.subscribed=!0);var u=this._subscriptionCallback(l);this._callbackOrEmit(i,u)},Kt.prototype._handleUnsubscribe=function(i,l){this.subscribed=!1;var u=this._subscriptionCallback(l);this._callbackOrEmit(i,u)},Kt.prototype._receiveUpdate=function(i,l){var u=Qn.dig(this.localPresences,l.id);if(u)return u._ack(i,l.pv);if(i)return this.emit("error",i);var f=this,p=Qn.digOrCreate(this._remotePresenceInstances,l.id,function(){return f._createRemotePresence(l.id)});p.receiveUpdate(l)},Kt.prototype._updateRemotePresence=function(i){this.remotePresences[i.presenceId]=i.value,i.value===null&&this._removeRemotePresence(i.presenceId),this.emit("receive",i.presenceId,i.value)},Kt.prototype._broadcastAllLocalPresence=function(i){if(i)return this.emit("error",i);for(var l in this.localPresences){var u=this.localPresences[l];u.value!==null&&u.send()}},Kt.prototype._removeRemotePresence=function(i){this._remotePresenceInstances[i].destroy(),delete this._remotePresenceInstances[i],delete this.remotePresences[i]},Kt.prototype._onConnectionStateChanged=function(){if(this.connection.canSend){this._resubscribe();for(var i in this.localPresences)this.localPresences[i]._sendPending()}},Kt.prototype._resubscribe=function(){var i=[];for(var l in this._subscriptionCallbacksBySeq){var u=this._subscriptionCallback(l);i.push(u)}if(!this.wantSubscribe)return this._callEachOrEmit(i);var f=this;this.subscribe(function(p){f._callEachOrEmit(i,p)})},Kt.prototype._subscriptionCallback=function(i){var l=this._subscriptionCallbacksBySeq[i];return delete this._subscriptionCallbacksBySeq[i],l},Kt.prototype._callbackOrEmit=function(i,l){if(l)return Qn.nextTick(l,i);i&&this.emit("error",i)},Kt.prototype._createLocalPresence=function(i){return new Ys(this,i)},Kt.prototype._createRemotePresence=function(i){return new Rl(this,i)},Kt.prototype._callEachOrEmit=function(i,l){var u=Qn.callEach(i,l);!u&&l&&this.emit("error",l)};var Qo=Pu,Yo=re,Cl=ur,co=Yo.CODES,Tl=Sr;function Sr(i,l){Qo.call(this,i,l),this.collection=this.presence.collection,this.id=this.presence.id,this._doc=this.connection.get(this.collection,this.id),this._isSending=!1,this._docDataVersionByPresenceVersion={},this._opHandler=this._transformAgainstOp.bind(this),this._createOrDelHandler=this._handleCreateOrDel.bind(this),this._loadHandler=this._handleLoad.bind(this),this._destroyHandler=this.destroy.bind(this),this._registerWithDoc()}Sr.prototype=Object.create(Qo.prototype),Sr.prototype.submit=function(i,l){if(!this._doc.type){if(i===null)return this._callbackOrEmit(null,l);var u={code:co.ERR_DOC_DOES_NOT_EXIST,message:"Cannot submit presence. Document has not been created"};return this._callbackOrEmit(u,l)}this._docDataVersionByPresenceVersion[this.presenceVersion]=this._doc._dataStateVersion,Qo.prototype.submit.call(this,i,l)},Sr.prototype.destroy=function(i){this._doc.removeListener("op",this._opHandler),this._doc.removeListener("create",this._createOrDelHandler),this._doc.removeListener("del",this._createOrDelHandler),this._doc.removeListener("load",this._loadHandler),this._doc.removeListener("destroy",this._destroyHandler),Qo.prototype.destroy.call(this,i)},Sr.prototype._sendPending=function(){if(!this._isSending){this._isSending=!0;var i=this;this._doc.whenNothingPending(function(){i._isSending=!1,i.connection.canSend&&(i._pendingMessages.forEach(function(l){l.t=i._doc.type.uri,l.v=i._doc.version,i.connection.send(l)}),i._pendingMessages=[],i._docDataVersionByPresenceVersion={})})}},Sr.prototype._registerWithDoc=function(){this._doc.on("op",this._opHandler),this._doc.on("create",this._createOrDelHandler),this._doc.on("del",this._createOrDelHandler),this._doc.on("load",this._loadHandler),this._doc.on("destroy",this._destroyHandler)},Sr.prototype._transformAgainstOp=function(i,l){var u=this,f=this._doc._dataStateVersion;this._pendingMessages.forEach(function(p){var _=u._docDataVersionByPresenceVersion[p.pv];if(!(_>=f))try{p.p=u._transformPresence(p.p,i,l),u._docDataVersionByPresenceVersion[p.pv]=f}catch(R){var S=u._getCallback(p.pv);u._callbackOrEmit(R,S)}});try{this.value=this._transformPresence(this.value,i,l)}catch(p){this.emit("error",p)}},Sr.prototype._handleCreateOrDel=function(){this._pendingMessages.forEach(function(i){i.p=null}),this.value=null},Sr.prototype._handleLoad=function(){this.value=null,this._pendingMessages=[],this._docDataVersionByPresenceVersion={}},Sr.prototype._message=function(){var i=Qo.prototype._message.call(this);return i.c=this.collection,i.d=this.id,i.v=null,i.t=null,i},Sr.prototype._transformPresence=function(i,l,u){var f=this._doc.type;if(!Cl.supportsPresence(f))throw new Yo(co.ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE,"Type does not support presence: "+f.name);return f.transformPresence(i,l,u)};var Ks={};(function(i){var l=Re,u=re,f=ur,p=u.CODES;i.checkOp=function(R){if(R==null||typeof R!="object")return new u(p.ERR_OT_OP_BADLY_FORMED,"Op must be an object");if(R.create!=null){if(typeof R.create!="object")return new u(p.ERR_OT_OP_BADLY_FORMED,"Create data must be an object");var K=R.create.type;if(typeof K!="string")return new u(p.ERR_OT_OP_BADLY_FORMED,"Missing create type");var we=l.map[K];if(we==null||typeof we!="object")return new u(p.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type")}else if(R.del!=null){if(R.del!==!0)return new u(p.ERR_OT_OP_BADLY_FORMED,"del value must be true")}else if(!("op"in R))return new u(p.ERR_OT_OP_BADLY_FORMED,"Missing op, create, or del");if(R.src!=null&&typeof R.src!="string")return new u(p.ERR_OT_OP_BADLY_FORMED,"src must be a string");if(R.seq!=null&&typeof R.seq!="number")return new u(p.ERR_OT_OP_BADLY_FORMED,"seq must be a number");if(R.src==null&&R.seq!=null||R.src!=null&&R.seq==null)return new u(p.ERR_OT_OP_BADLY_FORMED,"Both src and seq must be set together");if(R.m!=null&&typeof R.m!="object")return new u(p.ERR_OT_OP_BADLY_FORMED,"op.m must be an object or null")},i.normalizeType=function(R){return l.map[R]&&l.map[R].uri},i.apply=function(R,K){if(typeof R!="object")return new u(p.ERR_APPLY_SNAPSHOT_NOT_PROVIDED,"Missing snapshot");if(R.v!=null&&K.v!=null&&R.v!==K.v)return new u(p.ERR_APPLY_OP_VERSION_DOES_NOT_MATCH_SNAPSHOT,"Version mismatch");if(K.create){if(R.type)return new u(p.ERR_DOC_ALREADY_CREATED,"Document already exists");var we=K.create,V=l.map[we.type];if(!V)return new u(p.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type");try{R.data=V.create(we.data),R.type=V.uri,R.v++}catch(I){return I}}else if(K.del)R.data=void 0,R.type=null,R.v++;else if("op"in K){var C=_(R,K.op);if(C)return C;R.v++}else R.v++};function _(R,K){if(!R.type)return new u(p.ERR_DOC_DOES_NOT_EXIST,"Document does not exist");if(K===void 0)return new u(p.ERR_OT_OP_NOT_PROVIDED,"Missing op");var we=l.map[R.type];if(!we)return new u(p.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type");try{R.data=we.apply(R.data,K)}catch(V){return new u(p.ERR_OT_OP_NOT_APPLIED,V.message)}}i.transform=function(R,K,we){if(K.v!=null&&K.v!==we.v)return new u(p.ERR_OP_VERSION_MISMATCH_DURING_TRANSFORM,"Version mismatch");if(we.del){if(K.create||"op"in K)return new u(p.ERR_DOC_WAS_DELETED,"Document was deleted")}else{if(we.create&&("op"in K||K.create||K.del)||"op"in we&&K.create)return new u(p.ERR_DOC_ALREADY_CREATED,"Document was created remotely");if("op"in we&&"op"in K){if(!R)return new u(p.ERR_DOC_DOES_NOT_EXIST,"Document does not exist");if(typeof R=="string"&&(R=l.map[R],!R))return new u(p.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type");try{K.op=R.transform(K.op,we.op,"left")}catch(V){return V}}}K.v!=null&&K.v++},i.applyOps=function(R,K,we){we=we||{};for(var V=0;V<K.length;V++){var C=K[V];if(we._normalizeLegacyJson0Ops)try{S(R,C)}catch{return new u(p.ERR_OT_LEGACY_JSON0_OP_CANNOT_BE_NORMALIZED,"Cannot normalize legacy json0 op")}R.v=C.v;var I=i.apply(R,C);if(I)return I}},i.transformPresence=function(R,K,we){var V=this.checkOp(K);if(V)return V;var C=R.t;if(typeof C=="string"&&(C=l.map[C]),!C)return{code:p.ERR_DOC_TYPE_NOT_RECOGNIZED,message:"Unknown type"};if(!f.supportsPresence(C))return{code:p.ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE,message:"Type does not support presence"};if(K.create||K.del){R.p=null,R.v++;return}try{R.p=R.p===null?null:C.transformPresence(R.p,K.op,we)}catch(I){return{code:p.ERR_PRESENCE_TRANSFORM_FAILED,message:I.message||I}}R.v++};function S(R,K){if(R.type===l.defaultType.uri){var we=K.op;if(we){var V=R.data;we.length>1&&(V=f.clone(V));for(var C=0;C<we.length;C++){var I=we[C];typeof I.lm=="string"&&(I.lm=+I.lm);for(var z=I.p,pe=V,He=0;He<z.length;He++){var Ct=z[He];Object.prototype.toString.call(pe)=="[object Array]"?z[He]=+Ct:pe.constructor===Object&&(z[He]=Ct.toString()),pe=pe[Ct]}C<we.length-1&&(V=l.defaultType.apply(V,[I]))}}}}})(Ks);var Bi=Vt,bs=Ks,Iu=vn;function vn(i,l){Bi.call(this,i,l),this.collection=this.presence.collection,this.id=this.presence.id,this.src=null,this.presenceVersion=null,this._doc=this.connection.get(this.collection,this.id),this._pending=null,this._opCache=null,this._pendingSetPending=!1,this._opHandler=this._handleOp.bind(this),this._createDelHandler=this._handleCreateDel.bind(this),this._loadHandler=this._handleLoad.bind(this),this._registerWithDoc()}vn.prototype=Object.create(Bi.prototype),vn.prototype.receiveUpdate=function(i){this._pending&&i.pv<this._pending.pv||(this.src=i.src,this._pending=i,this._setPendingPresence())},vn.prototype.destroy=function(i){this._doc.removeListener("op",this._opHandler),this._doc.removeListener("create",this._createDelHandler),this._doc.removeListener("del",this._createDelHandler),this._doc.removeListener("load",this._loadHandler),Bi.prototype.destroy.call(this,i)},vn.prototype._registerWithDoc=function(){this._doc.on("op",this._opHandler),this._doc.on("create",this._createDelHandler),this._doc.on("del",this._createDelHandler),this._doc.on("load",this._loadHandler)},vn.prototype._setPendingPresence=function(){if(!this._pendingSetPending){this._pendingSetPending=!0;var i=this;this._doc.whenNothingPending(function(){if(i._pendingSetPending=!1,!!i._pending){if(i._pending.pv<i.presenceVersion)return i._pending=null;if(i._pending.v>i._doc.version)return i._doc.fetch();i._catchUpStalePresence()&&(i.value=i._pending.p,i.presenceVersion=i._pending.pv,i._pending=null,i.presence._updateRemotePresence(i))}})}},vn.prototype._handleOp=function(i,l,u){var f=u===this.src;this._transformAgainstOp(i,f),this._cacheOp(i,f),this._setPendingPresence()},Bi.prototype._handleCreateDel=function(){this._cacheOp(null),this._setPendingPresence()},Bi.prototype._handleLoad=function(){this.value=null,this._pending=null,this._opCache=null,this.presence._updateRemotePresence(this)},vn.prototype._transformAgainstOp=function(i,l){if(this.value){try{this.value=this._doc.type.transformPresence(this.value,i,l)}catch(u){return this.presence.emit("error",u)}this.presence._updateRemotePresence(this)}},vn.prototype._catchUpStalePresence=function(){if(this._pending.v>=this._doc.version)return!0;if(!this._opCache)return this._startCachingOps(),this._doc.fetch(),this.presence.subscribe(),!1;for(;this._opCache[this._pending.v];){var i=this._opCache[this._pending.v],l=i.op,u=i.isOwnOp;l===null?(this._pending.p=null,this._pending.v++):bs.transformPresence(this._pending,l,u)}var f=this._pending.v>=this._doc.version;return f&&this._stopCachingOps(),f},vn.prototype._startCachingOps=function(){this._opCache=[]},vn.prototype._stopCachingOps=function(){this._opCache=null},vn.prototype._cacheOp=function(i,l){this._opCache&&(i=i?{op:i}:null,this._opCache[this._doc.version-1]={op:i,isOwnOp:l})};var Xs=Gs,Au=Tl,ft=Iu;function Vi(i,l,u){var f=Vi.channel(l,u);Xs.call(this,i,f),this.collection=l,this.id=u}var Js=Vi;Vi.prototype=Object.create(Xs.prototype),Vi.channel=function(i,l){return i+"."+l},Vi.prototype._createLocalPresence=function(i){return new Au(this,i)},Vi.prototype._createRemotePresence=function(i){return new ft(this,i)};var Du=Zs;function Zs(i,l,u,f,p){this.id=i,this.v=l,this.type=u,this.data=f,this.m=p}var ea=Du,Mu=gt,Pl=vi;function vi(i,l,u,f,p){if(Mu.EventEmitter.call(this),typeof p!="function")throw new Error("Callback is required for SnapshotRequest");this.requestId=l,this.connection=i,this.id=f,this.collection=u,this.callback=p,this.sent=!1}Mu.mixin(vi),vi.prototype.send=function(){this.connection.canSend&&(this.connection.send(this._message()),this.sent=!0)},vi.prototype._onConnectionStateChanged=function(){this.connection.canSend?this.sent||this.send():this.sent=!1},vi.prototype._handleResponse=function(i,l){if(this.emit("ready"),i)return this.callback(i);var u=l.meta?l.meta:null,f=new ea(this.id,l.v,l.type,l.data,u);this.callback(null,f)};var Gr=Pl,yi=ur,mi=$i;function $i(i,l,u,f,p,_){if(Gr.call(this,i,l,u,f,_),!yi.isValidVersion(p))throw new Error("Snapshot version must be a positive integer or null");this.version=p}$i.prototype=Object.create(Gr.prototype),$i.prototype._message=function(){return{a:"nf",id:this.requestId,c:this.collection,d:this.id,v:this.version}};var fo=Pl,gi=ur,Ka=kl;function kl(i,l,u,f,p,_){if(fo.call(this,i,l,u,f,_),!gi.isValidTimestamp(p))throw new Error("Snapshot timestamp must be a positive integer or null");this.timestamp=p}kl.prototype=Object.create(fo.prototype),kl.prototype._message=function(){return{a:"nt",id:this.requestId,c:this.collection,d:this.id,ts:this.timestamp}};var Go=Wo,ba=Ws,ta=Gs,Ko=Js,na=mi,Xa=Ka,po=gt,Kr=re,Hi=Re,Mn=ur,bo=hn,Nl=Kr.CODES;function Ll(i){return i.readyState===0||i.readyState===1?"connecting":"disconnected"}var Il=Ne;function Ne(i){po.EventEmitter.call(this),this.collections={},this.nextQueryId=1,this.nextSnapshotRequestId=1,this.queries={},this._presences={},this._snapshotRequests={},this.seq=1,this._presenceSeq=1,this.id=null,this.agent=null,this.debug=!1,this.state=Ll(i),this.bindToSocket(i)}po.mixin(Ne),Ne.prototype.bindToSocket=function(i){this.socket&&(this.socket.close(),this.socket.onmessage=null,this.socket.onopen=null,this.socket.onerror=null,this.socket.onclose=null),this.socket=i;var l=Ll(i);this._setState(l),this.canSend=!1;var u=this;i.onmessage=function(f){try{var p=typeof f.data=="string"?JSON.parse(f.data):f.data}catch{bo.warn("Failed to parse message",f);return}u.debug&&bo.info("RECV",JSON.stringify(p));var _={data:p};if(u.emit("receive",_),!!_.data)try{u.handleMessage(_.data)}catch(S){Mn.nextTick(function(){u.emit("error",S)})}},i.readyState===1&&u._initializeHandshake(),i.onopen=function(){u._setState("connecting"),u._initializeHandshake()},i.onerror=function(f){u.emit("connection error",f)},i.onclose=function(f){f==="closed"||f==="Closed"?u._setState("closed",f):f==="stopped"||f==="Stopped by server"?u._setState("stopped",f):u._setState("disconnected",f)}},Ne.prototype.handleMessage=function(i){var l=null;switch(i.error&&(l=xu(i.error,i),delete i.error),i.a){case"init":return this._handleLegacyInit(i);case"hs":return this._handleHandshake(l,i);case"qf":var u=this.queries[i.id];u&&u._handleFetch(l,i.data,i.extra);return;case"qs":var u=this.queries[i.id];u&&u._handleSubscribe(l,i.data,i.extra);return;case"qu":return;case"q":var u=this.queries[i.id];if(!u)return;if(l)return u._handleError(l);i.diff&&u._handleDiff(i.diff),i.hasOwnProperty("extra")&&u._handleExtra(i.extra);return;case"bf":return this._handleBulkMessage(l,i,"_handleFetch");case"bs":case"bu":return this._handleBulkMessage(l,i,"_handleSubscribe");case"nf":case"nt":return this._handleSnapshotFetch(l,i);case"f":var f=this.getExisting(i.c,i.d);f&&f._handleFetch(l,i.data);return;case"s":case"u":var f=this.getExisting(i.c,i.d);f&&f._handleSubscribe(l,i.data);return;case"op":var f=this.getExisting(i.c,i.d);f&&f._handleOp(l,i);return;case"p":return this._handlePresence(l,i);case"ps":return this._handlePresenceSubscribe(l,i);case"pu":return this._handlePresenceUnsubscribe(l,i);case"pr":return this._handlePresenceRequest(l,i);default:bo.warn("Ignoring unrecognized message",i)}};function xu(i,l){var u=new Error(i.message);return u.code=i.code,l&&(u.data=l),u}Ne.prototype._handleBulkMessage=function(i,l,u){if(l.data)for(var f in l.data){var p=l.data[f],_=this.getExisting(l.c,f);_&&(i?_[u](i):p.error?_[u](xu(p.error)):_[u](null,p))}else if(Array.isArray(l.b))for(var S=0;S<l.b.length;S++){var f=l.b[S],_=this.getExisting(l.c,f);_&&_[u](i)}else if(l.b)for(var f in l.b){var _=this.getExisting(l.c,f);_&&_[u](i)}else bo.error("Invalid bulk message",l)},Ne.prototype._reset=function(){this.agent=null},Ne.prototype._setState=function(i,l){if(this.state!==i){if(i==="connecting"&&this.state!=="disconnected"&&this.state!=="stopped"&&this.state!=="closed"||i==="connected"&&this.state!=="connecting"){var u=new Kr(Nl.ERR_CONNECTION_STATE_TRANSITION_INVALID,"Cannot transition directly from "+this.state+" to "+i);return this.emit("error",u)}this.state=i,this.canSend=i==="connected",(i==="disconnected"||i==="stopped"||i==="closed")&&this._reset(),this.startBulk();for(var f in this.queries){var p=this.queries[f];p._onConnectionStateChanged()}for(var _ in this.collections){var S=this.collections[_];for(var f in S)S[f]._onConnectionStateChanged()}for(var R in this._presences)this._presences[R]._onConnectionStateChanged();for(var f in this._snapshotRequests){var K=this._snapshotRequests[f];K._onConnectionStateChanged()}this.endBulk(),this.emit(i,l),this.emit("state",i,l)}},Ne.prototype.startBulk=function(){this.bulk||(this.bulk={})},Ne.prototype.endBulk=function(){if(this.bulk)for(var i in this.bulk){var l=this.bulk[i];this._sendBulk("f",i,l.f),this._sendBulk("s",i,l.s),this._sendBulk("u",i,l.u)}this.bulk=null},Ne.prototype._sendBulk=function(i,l,u){if(u){var f=[],p={},_=0,S;for(var R in u){var K=u[R];K==null?f.push(R):(p[R]=K,S=R,_++)}if(f.length===1){var R=f[0];this.send({a:i,c:l,d:R})}else f.length&&this.send({a:"b"+i,c:l,b:f});if(_===1){var we=p[S];this.send({a:i,c:l,d:S,v:we})}else _&&this.send({a:"b"+i,c:l,b:p})}},Ne.prototype._sendAction=function(i,l,u){if(this._addDoc(l),this.bulk){var f=this.bulk[l.collection]||(this.bulk[l.collection]={}),p=f[i]||(f[i]={}),_=p.hasOwnProperty(l.id);return p[l.id]=u,_}else{var S={a:i,c:l.collection,d:l.id,v:u};this.send(S)}},Ne.prototype.sendFetch=function(i){return this._sendAction("f",i,i.version)},Ne.prototype.sendSubscribe=function(i){return this._sendAction("s",i,i.version)},Ne.prototype.sendUnsubscribe=function(i){return this._sendAction("u",i)},Ne.prototype.sendOp=function(i,l){this._addDoc(i);var u={a:"op",c:i.collection,d:i.id,v:i.version,src:l.src,seq:l.seq,x:{}};"op"in l&&(u.op=l.op),l.create&&(u.create=l.create),l.del&&(u.del=l.del),i.submitSource&&(u.x.source=l.source),this.send(u)},Ne.prototype.send=function(i){this.debug&&bo.info("SEND",JSON.stringify(i)),this.emit("send",i),this.socket.send(JSON.stringify(i))},Ne.prototype.close=function(){this.socket.close()},Ne.prototype.getExisting=function(i,l){if(this.collections[i])return this.collections[i][l]},Ne.prototype.get=function(i,l){var u=this.collections[i]||(this.collections[i]={}),f=u[l];return f||(f=u[l]=new Go(this,i,l),this.emit("doc",f)),f},Ne.prototype._destroyDoc=function(i){Mn.digAndRemove(this.collections,i.collection,i.id)},Ne.prototype._addDoc=function(i){var l=this.collections[i.collection];l||(l=this.collections[i.collection]={}),l[i.id]!==i&&(l[i.id]=i)},Ne.prototype._createQuery=function(i,l,u,f,p){var _=this.nextQueryId++,S=new ba(i,this,_,l,u,f,p);return this.queries[_]=S,S.send(),S},Ne.prototype._destroyQuery=function(i){delete this.queries[i.id]},Ne.prototype.createFetchQuery=function(i,l,u,f){return this._createQuery("qf",i,l,u,f)},Ne.prototype.createSubscribeQuery=function(i,l,u,f){return this._createQuery("qs",i,l,u,f)},Ne.prototype.hasPending=function(){return!!(this._firstDoc(wr)||this._firstQuery(wr)||this._firstSnapshotRequest())};function wr(i){return i.hasPending()}Ne.prototype.hasWritePending=function(){return!!this._firstDoc(ju)};function ju(i){return i.hasWritePending()}Ne.prototype.whenNothingPending=function(i){var l=this._firstDoc(wr);if(l){l.once("nothing pending",this._nothingPendingRetry(i));return}var u=this._firstQuery(wr);if(u){u.once("ready",this._nothingPendingRetry(i));return}var f=this._firstSnapshotRequest();if(f){f.once("ready",this._nothingPendingRetry(i));return}Mn.nextTick(i)},Ne.prototype._nothingPendingRetry=function(i){var l=this;return function(){Mn.nextTick(function(){l.whenNothingPending(i)})}},Ne.prototype._firstDoc=function(i){for(var l in this.collections){var u=this.collections[l];for(var f in u){var p=u[f];if(i(p))return p}}},Ne.prototype._firstQuery=function(i){for(var l in this.queries){var u=this.queries[l];if(i(u))return u}},Ne.prototype._firstSnapshotRequest=function(){for(var i in this._snapshotRequests)return this._snapshotRequests[i]},Ne.prototype.fetchSnapshot=function(i,l,u,f){typeof u=="function"&&(f=u,u=null);var p=this.nextSnapshotRequestId++,_=new na(this,p,i,l,u,f);this._snapshotRequests[_.requestId]=_,_.send()},Ne.prototype.fetchSnapshotByTimestamp=function(i,l,u,f){typeof u=="function"&&(f=u,u=null);var p=this.nextSnapshotRequestId++,_=new Xa(this,p,i,l,u,f);this._snapshotRequests[_.requestId]=_,_.send()},Ne.prototype._handleSnapshotFetch=function(i,l){var u=this._snapshotRequests[l.id];u&&(delete this._snapshotRequests[l.id],u._handleResponse(i,l))},Ne.prototype._handleLegacyInit=function(i){if(i.protocolMinor)return this._initializeHandshake();this._initialize(i)},Ne.prototype._initializeHandshake=function(){this.send({a:"hs",id:this.id})},Ne.prototype._handleHandshake=function(i,l){if(i)return this.emit("error",i);this._initialize(l)},Ne.prototype._initialize=function(i){if(this.state==="connecting"){if(i.protocol!==1)return this.emit("error",new Kr(Nl.ERR_PROTOCOL_VERSION_NOT_SUPPORTED,"Unsupported protocol version: "+i.protocol));if(Hi.map[i.type]!==Hi.defaultType)return this.emit("error",new Kr(Nl.ERR_DEFAULT_TYPE_MISMATCH,i.type+" does not match the server default type"));if(typeof i.id!="string")return this.emit("error",new Kr(Nl.ERR_CLIENT_ID_BADLY_FORMED,"Client id must be a string"));this.id=i.id,this._setState("connected")}},Ne.prototype.getPresence=function(i){var l=this;return Mn.digOrCreate(this._presences,i,function(){return new ta(l,i)})},Ne.prototype.getDocPresence=function(i,l){var u=Ko.channel(i,l),f=this;return Mn.digOrCreate(this._presences,u,function(){return new Ko(f,i,l)})},Ne.prototype._sendPresenceAction=function(i,l,u){this._addPresence(u);var f={a:i,ch:u.channel,seq:l};return this.send(f),f.seq},Ne.prototype._addPresence=function(i){Mn.digOrCreate(this._presences,i.channel,function(){return i})},Ne.prototype._handlePresenceSubscribe=function(i,l){var u=Mn.dig(this._presences,l.ch);u&&u._handleSubscribe(i,l.seq)},Ne.prototype._handlePresenceUnsubscribe=function(i,l){var u=Mn.dig(this._presences,l.ch);u&&u._handleUnsubscribe(i,l.seq)},Ne.prototype._handlePresence=function(i,l){var u=Mn.dig(this._presences,l.ch);u&&u._receiveUpdate(i,l)},Ne.prototype._handlePresenceRequest=function(i,l){var u=Mn.dig(this._presences,l.ch);u&&u._broadcastAllLocalPresence(i,l)},Ve.Connection=Il,Ve.Doc=Wo,Ve.Error=re,Ve.Query=Ws,Ve.types=Re,Ve.logger=hn;var Xo={},zu={},ho={};Object.defineProperty(ho,"__esModule",{value:!0});function Al(i,l){if(Array.isArray(l))return!1;for(let u in i)if(!Pn(i[u],l[u]))return!1;for(let u in l)if(i[u]===void 0)return!1;return!0}function ra(i,l){if(!Array.isArray(l)||i.length!==l.length)return!1;for(let u=0;u<i.length;u++)if(!Pn(i[u],l[u]))return!1;return!0}function Pn(i,l){return i===l?!0:i===null||l===null||typeof i!="object"||typeof l!="object"?!1:Array.isArray(i)?ra(i,l):Al(i,l)}ho.default=Pn;var _i={};Object.defineProperty(_i,"__esModule",{value:!0});function Jo(i){if(i===null)return null;if(Array.isArray(i))return i.map(Jo);if(typeof i=="object"){const l={};for(let u in i)l[u]=Jo(i[u]);return l}else return i}_i.default=Jo;var Wi={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.eachChildOf=i.advancer=i.readCursor=i.writeCursor=i.WriteCursor=i.ReadCursor=i.isValidPathItem=void 0;function l(V,C){if(!V)throw new Error(C)}const u=V=>V!=null&&typeof V=="object"&&!Array.isArray(V),f=(V,C)=>typeof V==typeof C?V>C:typeof V=="string"&&typeof C=="number";function p(V,C){for(let I in V){const z=I;C.write(z,V[z])}}i.isValidPathItem=V=>typeof V=="number"||typeof V=="string"&&V!=="__proto__";class _{constructor(C=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=C}ascend(){l(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(l(this.idx>0),this.idx--,u(this.container[this.idx])&&this.idx--)}getPath(){const C=[];let I=this.container,z=this.parents.length-1,pe=this.idx;for(;pe>=0;)C.unshift(I[pe]),pe===0?(pe=this.indexes[z*2],I=this.parents[z--]):pe-=u(I[pe-1])?2:1;return C}}class S extends _{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return l(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let C;return this.container&&this.container.length>this.idx+1&&u(C=this.container[this.idx+1])?C:null}descendFirst(){let C=this.idx+1;if(!this.container||C>=this.container.length||u(this.container[C])&&C+1>=this.container.length)return!1;u(this.container[C])&&C++;const I=this.container[C];return Array.isArray(I)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(C),this.idx=0,this.container=I):this.idx=C,!0}nextSibling(){if(l(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const C=this.indexes[this.indexes.length-1]+1,I=this.parents[this.parents.length-1];return C>=I.length?!1:(l(!isNaN(C)),this.indexes[this.indexes.length-1]=C,this.container=I[C],!0)}_init(C,I,z,pe){this.container=C,this.idx=I,this.parents=z.slice(),this.indexes=pe.slice()}clone(){const C=new S;return C._init(this.container,this.idx,this.parents,this.indexes),C}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(C,I){const z=this.getComponent();z&&I(z,C);for(const pe of this)C&&C.descend(pe),this.traverse(C,I),C&&C.ascend()}eachPick(C,I){this.traverse(C,(z,pe)=>{z.p!=null&&I(z.p,pe)})}eachDrop(C,I){this.traverse(C,(z,pe)=>{z.d!=null&&I(z.d,pe)})}}i.ReadCursor=S;class R extends _{constructor(C=null){super(C),this.pendingDescent=[],this._op=C}flushDescent(){l(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let C=0;C<this.pendingDescent.length;C++){const I=this.pendingDescent[C];let z=this.idx+1;if(z<this.container.length&&u(this.container[z])&&z++,l(z===this.container.length||!u(this.container[z])),z===this.container.length)this.container.push(I),this.idx=z;else if(this.container[z]===I)this.idx=z;else{if(!Array.isArray(this.container[z])){const pe=this.container.splice(z,this.container.length-z);this.container.push(pe),this.lcIdx>-1&&(this.lcIdx=z)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(l(f(I,this.container[this.lcIdx][0])),z=this.lcIdx+1,this.lcIdx=-1);z<this.container.length&&f(I,this.container[z][0]);)z++;if(this.indexes.push(z),this.idx=0,z<this.container.length&&this.container[z][0]===I)this.container=this.container[z];else{const pe=[I];this.container.splice(z,0,pe),this.container=pe}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const C=this.idx+1;if(C<this.container.length&&u(this.container[C]))return this.container[C];{const I={};return this.container.splice(C,0,I),I}}write(C,I){const z=this.getComponent();l(z[C]==null||z[C]===I,"Internal consistency error: Overwritten component. File a bug"),z[C]=I}get(){return this._op}descend(C){if(!i.isValidPathItem(C))throw Error("Invalid JSON key");this.pendingDescent.push(C)}descendPath(C){return this.pendingDescent.push(...C),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(C,I=p){if(C===null)return;if(l(Array.isArray(C)),C===this._op)throw Error("Cannot merge into my own tree");const z=this.lcIdx,pe=this.parents.length;let He=0;for(let Ct=0;Ct<C.length;Ct++){const be=C[Ct];typeof be=="string"||typeof be=="number"?(He++,this.descend(be)):Array.isArray(be)?this.mergeTree(be,I):typeof be=="object"&&I(be,this)}for(;He--;)this.ascend();this.lcIdx=this.parents.length===pe?z:-1}at(C,I){this.descendPath(C),I(this);for(let z=0;z<C.length;z++)this.ascend();return this}writeAtPath(C,I,z){return this.at(C,()=>this.write(I,z)),this.reset(),this}writeMove(C,I,z=0){return this.writeAtPath(C,"p",z).writeAtPath(I,"d",z)}getPath(){const C=super.getPath();return C.push(...this.pendingDescent),C}}i.WriteCursor=R,i.writeCursor=()=>new R,i.readCursor=V=>new S(V);function K(V,C,I){let z,pe;pe=z=V?V.descendFirst():!1;function He(Ct){let be;for(;pe;){const Oe=be=V.getKey();if(Ct!=null){let xr=!1;if(C&&typeof Oe=="number"&&(be=C(Oe,V.getComponent()),be<0&&(be=~be,xr=!0)),f(be,Ct))return null;if(be===Ct&&!xr)return V}I&&typeof be=="number"&&I(be,V.getComponent()),pe=V.nextSibling()}return null}return He.end=()=>{z&&V.ascend()},He}i.advancer=K;function we(V,C,I){let z,pe,He,Ct;for(z=pe=V&&V.descendFirst(),He=Ct=C&&C.descendFirst();z||He;){let be=z?V.getKey():null,Oe=He?C.getKey():null;be!==null&&Oe!==null&&(f(Oe,be)?Oe=null:be!==Oe&&(be=null)),I(be??Oe,be!=null?V:null,Oe!=null?C:null),be!=null&&z&&(z=V.nextSibling()),Oe!=null&&He&&(He=C.nextSibling())}pe&&V.ascend(),Ct&&C.ascend()}i.eachChildOf=we})(Wi);var Fu={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.ConflictType=void 0,function(l){l[l.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",l[l.DROP_COLLISION=2]="DROP_COLLISION",l[l.BLACKHOLE=3]="BLACKHOLE"}(i.ConflictType||(i.ConflictType={}))})(Fu);var Zo={},Mr={};Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.uniToStrPos=Mr.strPosToUni=void 0,Mr.strPosToUni=(i,l=i.length)=>{let u=0,f=0;for(;f<l;f++){const p=i.charCodeAt(f);p>=55296&&p<=57343&&(u++,f++)}if(f!==l)throw Error("Invalid offset - splits unicode bytes");return f-u},Mr.uniToStrPos=(i,l)=>{let u=0;for(;l>0;l--){const f=i.charCodeAt(u);u+=f>=55296&&f<=57343?2:1}return u};var Ei={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.uniSlice=i.dlen=i.eachOp=void 0;const l=Mr,u=F=>{if(!Array.isArray(F))throw Error("Op must be an array of components");let q=null;for(let b=0;b<F.length;b++){const xe=F[b];switch(typeof xe){case"object":if(typeof xe.d!="number"&&typeof xe.d!="string")throw Error("Delete must be number or string");if(i.dlen(xe.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(xe.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(xe>0))throw Error("Skip components must be >0");if(typeof q=="number")throw Error("Adjacent skip components should be combined");break}q=xe}if(typeof q=="number")throw Error("Op has a trailing skip")};function f(F,q){let b=0,xe=0;for(let We=0;We<F.length;We++){const je=F[We];switch(q(je,b,xe),typeof je){case"object":b+=i.dlen(je.d);break;case"string":xe+=l.strPosToUni(je);break;case"number":b+=je,xe+=je;break}}}i.eachOp=f;function p(F,q){const b=[],xe=R(b);return f(F,(We,je,en)=>{xe(q(We,je,en))}),C(b)}const _=F=>F,S=F=>p(F,_);i.dlen=F=>typeof F=="number"?F:l.strPosToUni(F);const R=F=>q=>{if(!(!q||q.d===0||q.d===""))if(F.length===0)F.push(q);else if(typeof q==typeof F[F.length-1])if(typeof q=="object"){const b=F[F.length-1];b.d=typeof b.d=="string"&&typeof q.d=="string"?b.d+q.d:i.dlen(b.d)+i.dlen(q.d)}else F[F.length-1]+=q;else F.push(q)},K=F=>typeof F=="number"?F:typeof F=="string"?l.strPosToUni(F):typeof F.d=="number"?F.d:l.strPosToUni(F.d);i.uniSlice=(F,q,b)=>{const xe=l.uniToStrPos(F,q),We=b==null?1/0:l.uniToStrPos(F,b);return F.slice(xe,We)};const we=(F,q,b)=>typeof F=="number"?b==null?F-q:Math.min(F,b)-q:i.uniSlice(F,q,b),V=F=>{let q=0,b=0;return{take:(je,en)=>{if(q===F.length)return je===-1?null:je;const Tt=F[q];let dt;if(typeof Tt=="number")return je===-1||Tt-b<=je?(dt=Tt-b,++q,b=0,dt):(b+=je,je);if(typeof Tt=="string"){if(je===-1||en==="i"||l.strPosToUni(Tt.slice(b))<=je)return dt=Tt.slice(b),++q,b=0,dt;{const st=b+l.uniToStrPos(Tt.slice(b),je);return dt=Tt.slice(b,st),b=st,dt}}else{if(je===-1||en==="d"||i.dlen(Tt.d)-b<=je)return dt={d:we(Tt.d,b)},++q,b=0,dt;{let st=we(Tt.d,b,b+je);return b+=je,{d:st}}}},peek:()=>F[q]}},C=F=>(F.length>0&&typeof F[F.length-1]=="number"&&F.pop(),F);function I(F,q,b){if(b!=="left"&&b!=="right")throw Error("side ("+b+") must be 'left' or 'right'");u(F),u(q);const xe=[],We=R(xe),{take:je,peek:en}=V(F);for(let dt=0;dt<q.length;dt++){const st=q[dt];let Wt,xn;switch(typeof st){case"number":for(Wt=st;Wt>0;)xn=je(Wt,"i"),We(xn),typeof xn!="string"&&(Wt-=K(xn));break;case"string":b==="left"&&typeof en()=="string"&&We(je(-1)),We(l.strPosToUni(st));break;case"object":for(Wt=i.dlen(st.d);Wt>0;)switch(xn=je(Wt,"i"),typeof xn){case"number":Wt-=xn;break;case"string":We(xn);break;case"object":Wt-=i.dlen(xn.d)}break}}let Tt;for(;Tt=je(-1);)We(Tt);return C(xe)}function z(F,q){u(F),u(q);const b=[],xe=R(b),{take:We}=V(F);for(let en=0;en<q.length;en++){const Tt=q[en];let dt,st;switch(typeof Tt){case"number":for(dt=Tt;dt>0;)st=We(dt,"d"),xe(st),typeof st!="object"&&(dt-=K(st));break;case"string":xe(Tt);break;case"object":dt=i.dlen(Tt.d);let Wt=0;for(;Wt<dt;)switch(st=We(dt-Wt,"d"),typeof st){case"number":xe({d:we(Tt.d,Wt,Wt+st)}),Wt+=st;break;case"string":Wt+=l.strPosToUni(st);break;case"object":xe(st)}break}}let je;for(;je=We(-1);)xe(je);return C(b)}const pe=(F,q)=>{let b=0;for(let xe=0;xe<q.length&&F>b;xe++){const We=q[xe];switch(typeof We){case"number":{b+=We;break}case"string":const je=l.strPosToUni(We);b+=je,F+=je;break;case"object":F-=Math.min(i.dlen(We.d),F-b);break}}return F},He=(F,q)=>typeof F=="number"?pe(F,q):F.map(b=>pe(b,q));function Ct(F,q,b){return p(F,(xe,We)=>typeof xe=="object"&&typeof xe.d=="number"?{d:b.slice(q,We,We+xe.d)}:xe)}function be(F){return p(F,q=>{switch(typeof q){case"object":if(typeof q.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return q.d;case"string":return{d:q};case"number":return q}})}function Oe(F){return p(F,q=>typeof q=="object"&&typeof q.d=="string"?{d:l.strPosToUni(q.d)}:q)}function xr(F){let q=!0;return f(F,b=>{typeof b=="object"&&typeof b.d=="number"&&(q=!1)}),q}function Ht(F){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:C,normalize:S,checkOp:u,create(q=""){if(typeof q!="string")throw Error("Initial data must be a string");return F.create(q)},apply(q,b){u(b);const xe=F.builder(q);for(let We=0;We<b.length;We++){const je=b[We];switch(typeof je){case"number":xe.skip(je);break;case"string":xe.append(je);break;case"object":xe.del(i.dlen(je.d));break}}return xe.build()},transform:I,compose:z,transformPosition:pe,transformSelection:He,isInvertible:xr,makeInvertible(q,b){return Ct(q,b,F)},stripInvertible:Oe,invert:be,invertWithDoc(q,b){return be(Ct(q,b,F))},isNoop:q=>q.length===0}}i.default=Ht})(Ei);var vo={};Object.defineProperty(vo,"__esModule",{value:!0});const Uu=Ei,ia=Mr;function oa(i,l){return{get:i,getLength(){return i().length},insert(u,f,p){const _=ia.strPosToUni(i(),u);return l([_,f],p)},remove(u,f,p){const _=ia.strPosToUni(i(),u);return l([_,{d:f}],p)},_onOp(u){Uu.eachOp(u,(f,p,_)=>{switch(typeof f){case"string":this.onInsert&&this.onInsert(_,f);break;case"object":const S=Uu.dlen(f.d);this.onRemove&&this.onRemove(_,S)}})},onInsert:null,onRemove:null}}vo.default=oa,oa.provides={text:!0},function(i){var l=N&&N.__createBinding||(Object.create?function(I,z,pe,He){He===void 0&&(He=pe),Object.defineProperty(I,He,{enumerable:!0,get:function(){return z[pe]}})}:function(I,z,pe,He){He===void 0&&(He=pe),I[He]=z[pe]}),u=N&&N.__setModuleDefault||(Object.create?function(I,z){Object.defineProperty(I,"default",{enumerable:!0,value:z})}:function(I,z){I.default=z}),f=N&&N.__importStar||function(I){if(I&&I.__esModule)return I;var z={};if(I!=null)for(var pe in I)Object.hasOwnProperty.call(I,pe)&&l(z,I,pe);return u(z,I),z},p=N&&N.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(i,"__esModule",{value:!0}),i.type=i.remove=i.insert=void 0;const _=Mr,S=f(Ei),R=p(vo),K={create(I){return I},toString(I){return I},builder(I){if(typeof I!="string")throw Error("Invalid document snapshot: "+I);const z=[];return{skip(pe){let He=_.uniToStrPos(I,pe);if(He>I.length)throw Error("The op is too long for this document");z.push(I.slice(0,He)),I=I.slice(He)},append(pe){z.push(pe)},del(pe){I=I.slice(_.uniToStrPos(I,pe))},build(){return z.join("")+I}}},slice:S.uniSlice},we=S.default(K),V=Object.assign(Object.assign({},we),{api:R.default});i.type=V,i.insert=(I,z)=>z.length===0?[]:I===0?[z]:[I,z],i.remove=(I,z)=>S.dlen(z)===0?[]:I===0?[{d:z}]:[I,{d:z}];var C=Ei;Object.defineProperty(i,"makeType",{enumerable:!0,get:function(){return C.default}})}(Zo);var Ja=lt(Zo);(function(i){var l=N&&N.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(i,"__esModule",{value:!0}),i.editOp=i.replaceOp=i.insertOp=i.moveOp=i.removeOp=i.type=void 0;const u=l(ho),f=l(_i),p=Wi,_=Fu;function S(w,D){if(!w)throw new Error(D)}i.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:p.readCursor,writeCursor:p.writeCursor,create:w=>w,isNoop:w=>w==null,setDebug(w){},registerSubtype:be,checkValidOp:We,normalize:je,apply:en,transformPosition:Tt,compose:dt,tryTransform:br,transform:Qi,makeInvertible:xn,invert:st,invertWithDoc:Bu,RM_UNEXPECTED_CONTENT:_.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:_.ConflictType.DROP_COLLISION,BLACKHOLE:_.ConflictType.BLACKHOLE,transformNoConflict:(w,D,Y)=>Ml(()=>!0,w,D,Y),typeAllowingConflictsPred:w=>Object.assign(Object.assign({},i.type),{transform:(D,Y,ie)=>Ml(w,D,Y,ie)})};const R=w=>w?w.getComponent():null;function K(w){return w&&typeof w=="object"&&!Array.isArray(w)}const we=w=>Array.isArray(w)?w.slice():w!==null&&typeof w=="object"?Object.assign({},w):w,V=w=>w&&(w.p!=null||w.r!==void 0),C=w=>w&&(w.d!=null||w.i!==void 0);function I(w,D){return S(w!=null),typeof D=="number"?(S(Array.isArray(w),"Invalid key - child is not an array"),(w=w.slice()).splice(D,1)):(S(K(w),"Invalid key - child is not an object"),delete(w=Object.assign({},w))[D]),w}function z(w,D,Y){return typeof D=="number"?(S(w!=null,"Container is missing for key"),S(Array.isArray(w),"Cannot use numerical key for object container"),S(w.length>=D,"Cannot insert into out of bounds index"),w.splice(D,0,Y)):(S(K(w),"Cannot insert into missing item"),S(w[D]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),w[D]=Y),Y}i.removeOp=(w,D=!0)=>p.writeCursor().writeAtPath(w,"r",D).get(),i.moveOp=(w,D)=>p.writeCursor().writeMove(w,D).get(),i.insertOp=(w,D)=>p.writeCursor().writeAtPath(w,"i",D).get(),i.replaceOp=(w,D,Y)=>p.writeCursor().at(w,ie=>{ie.write("r",D),ie.write("i",Y)}).get(),i.editOp=(w,D,Y,ie=!1)=>p.writeCursor().at(w,M=>q(M,D,Y,ie)).get();const pe=(w,D)=>w!=null&&(typeof D=="number"?Array.isArray(w):typeof w=="object"),He=(w,D)=>pe(w,D)?w[D]:void 0,Ct={};function be(w){let D=w.type?w.type:w;D.name&&(Ct[D.name]=D),D.uri&&(Ct[D.uri]=D)}const Oe=w=>{const D=Ct[w];if(D)return D;throw Error("Missing type: "+w)};be(Zo);const xr=(w,D)=>w+D;be({name:"number",apply:xr,compose:xr,invert:w=>-w,transform:w=>w});const Ht=w=>w==null?null:w.et?Oe(w.et):w.es?Ct["text-unicode"]:w.ena!=null?Ct.number:null,F=w=>w.es?w.es:w.ena!=null?w.ena:w.e,q=(w,D,Y,ie=!1)=>{const[M,J]=typeof D=="string"?[Oe(D),D]:[D,D.name];!ie&&M.isNoop&&M.isNoop(Y)||(J==="number"?w.write("ena",Y):J==="text-unicode"?w.write("es",Y):(w.write("et",J),w.write("e",Y)))};function b(w){S(typeof w=="number"),S(w>=0),S(w===(0|w))}function xe(w){typeof w=="number"?b(w):S(typeof w=="string")}function We(w){if(w===null)return;const D=new Set,Y=new Set,ie=J=>{let Ce=!0,Te=!1;for(let U in J){const X=J[U];if(Ce=!1,S(U==="p"||U==="r"||U==="d"||U==="i"||U==="e"||U==="es"||U==="ena"||U==="et","Invalid component item '"+U+"'"),U==="p")b(X),S(!D.has(X)),D.add(X),S(J.r===void 0);else if(U==="d")b(X),S(!Y.has(X)),Y.add(X),S(J.i===void 0);else if(U==="e"||U==="es"||U==="ena"){S(!Te),Te=!0;const te=Ht(J);S(te,"Missing type in edit"),te.checkValidOp&&te.checkValidOp(F(J))}}S(!Ce)},M=(J,Ce,Te)=>{if(!Array.isArray(J))throw Error("Op must be null or a list");if(J.length===0)throw Error("Empty descent");Ce||xe(J[0]);let U=1,X=0,te=0;for(let G=0;G<J.length;G++){const Se=J[G];if(S(Se!=null),Array.isArray(Se)){const Ae=M(Se,!1);if(X){const H=typeof te,ye=typeof Ae;H===ye?S(te<Ae,"descent keys are not in order"):S(H==="number"&&ye==="string")}te=Ae,X++,U=3}else typeof Se=="object"?(S(U===1,`Prev not scalar - instead ${U}`),ie(Se),U=2):(S(U!==3),xe(Se),S(p.isValidPathItem(Se),"Invalid path key"),U=1)}return S(X!==1,"Operation makes multiple descents. Remove some []"),S(U===2||U===3),J[0]};M(w,!0),S(D.size===Y.size,"Mismatched picks and drops in op");for(let J=0;J<D.size;J++)S(D.has(J)),S(Y.has(J))}function je(w){let D=0,Y=[];const ie=p.writeCursor();return ie.mergeTree(w,(M,J)=>{const Ce=Ht(M);if(Ce){const U=F(M);q(J,Ce,Ce.normalize?Ce.normalize(U):U)}for(const U of["r","p","i","d"])if(M[U]!==void 0){const X=U==="p"||U==="d"?(Te=M[U],Y[Te]==null&&(Y[Te]=D++),Y[Te]):M[U];J.write(U,X)}var Te}),ie.get()}function en(w,D){if(We(D),D===null)return w;const Y=[];return function ie(M,J){let Ce=M,Te=0,U={root:M},X=0,te=U,G="root";function Se(){for(;X<Te;X++){let Ae=J[X];typeof Ae!="object"&&(S(pe(te,G)),te=te[G]=we(te[G]),G=Ae)}}for(;Te<J.length;Te++){const Ae=J[Te];if(Array.isArray(Ae)){const H=ie(Ce,Ae);H!==Ce&&H!==void 0&&(Se(),Ce=te[G]=H)}else if(typeof Ae=="object"){Ae.d!=null?(Se(),Ce=z(te,G,Y[Ae.d])):Ae.i!==void 0&&(Se(),Ce=z(te,G,Ae.i));const H=Ht(Ae);if(H)Se(),Ce=te[G]=H.apply(Ce,F(Ae));else if(Ae.e!==void 0)throw Error("Subtype "+Ae.et+" undefined")}else Ce=He(Ce,Ae)}return U.root}(w=function ie(M,J){const Ce=[];let Te=0;for(;Te<J.length;Te++){const G=J[Te];if(Array.isArray(G))break;typeof G!="object"&&(Ce.push(M),M=He(M,G))}for(let G=J.length-1;G>=Te;G--)M=ie(M,J[G]);for(--Te;Te>=0;Te--){const G=J[Te];if(typeof G!="object"){const Se=Ce.pop();M=M===He(Se,G)?Se:M===void 0?I(Se,G):(X=G,te=M,(U=we(U=Se))[X]=te,U)}else V(G)&&(S(M!==void 0,"Cannot pick up or remove undefined"),G.p!=null&&(Y[G.p]=M),M=void 0)}var U,X,te;return M}(w,D),D)}function Tt(w,D){w=w.slice(),We(D);const Y=p.readCursor(D);let ie,M,J=!1;const Ce=[];for(let U=0;;U++){const X=w[U],te=Y.getComponent();if(te&&(te.r!==void 0?J=!0:te.p!=null&&(J=!1,ie=te.p,M=U)),U>=w.length)break;let G=0;const Se=p.advancer(Y,void 0,(H,ye)=>{V(ye)&&G++});Ce.unshift(Se);const Ae=Se(X);if(typeof X=="number"&&(w[U]-=G),!Ae)break}if(Ce.forEach(U=>U.end()),J)return null;const Te=()=>{let U=0;if(ie!=null){const X=Y.getPath();U=X.length,w=X.concat(w.slice(M))}for(;U<w.length;U++){const X=w[U],te=R(Y),G=Ht(te);if(G){const H=F(te);G.transformPosition&&(w[U]=G.transformPosition(w[U],H));break}let Se=0;const Ae=p.advancer(Y,(H,ye)=>C(ye)?~(H-Se):H-Se,(H,ye)=>{C(ye)&&Se++})(X);if(typeof X=="number"&&(w[U]+=Se),!Ae)break}};return ie!=null?Y.eachDrop(null,U=>{U===ie&&Te()}):Te(),w}function dt(w,D){if(We(w),We(D),w==null)return D;if(D==null)return w;let Y=0;const ie=p.readCursor(w),M=p.readCursor(D),J=p.writeCursor(),Ce=[],Te=[],U=[],X=[],te=[],G=[],Se=new Set;ie.traverse(null,H=>{H.p!=null&&(U[H.p]=ie.clone())}),M.traverse(null,H=>{H.d!=null&&(X[H.d]=M.clone())});const Ae=p.writeCursor();return function H(ye,Ye,rt,ze,Et,yn,$t,Pt){S(Ye||rt);const yt=R(Ye),kn=R(rt),mn=!!kn&&kn.r!==void 0,jn=!!yt&&yt.i!==void 0,gn=yt?yt.d:null,_n=kn?kn.p:null,zn=(yn||mn)&&_n==null;if(_n!=null)ze=X[_n],$t=Te[_n]=new p.WriteCursor;else if(kn&&kn.r!==void 0)ze=null;else{const le=R(ze);le&&le.d!=null&&(ze=null)}const Xe=R(ze);if(gn!=null)if(ye=U[gn],Pt=Ce[gn]=new p.WriteCursor,zn)yn&&!mn&&Pt.write("r",!0);else{const le=te[gn]=Y++;$t.write("d",le)}else if(yt&&yt.i!==void 0)ye=null;else{const le=R(ye);le&&le.p!=null&&(ye=null)}let ae;jn?(S(Et===void 0),ae=yt.i):ae=Et;const De=(_n==null?!jn||yn||mn:ae===void 0)?null:$t.getComponent();if(_n!=null){if(!(Et!==void 0||jn)){const le=gn!=null?te[gn]:Y++;G[_n]=le,Pt.write("p",le)}}else mn&&(jn||Et!==void 0||(kn.r,Pt.write("r",kn.r)));const de=zn?null:Ht(yt),oe=Ht(Xe);if((de||oe)&&(de&&de.name,oe&&oe.name),de&&oe){S(de===oe);const le=F(yt),ue=F(Xe),kt=de.compose(le,ue);q($t,de,kt),Se.add(Xe)}else de?q($t,de,F(yt)):oe&&(q($t,oe,F(Xe)),Se.add(Xe));const _e=typeof ae=="object"&&ae!=null;let Fe=!1,Qe=0,Ze=0,Ut=0,At=0,at=0;const bt=p.advancer(ze,(le,ue)=>C(ue)?At-le-1:le-At,(le,ue)=>{C(ue)&&At++}),$e=p.advancer(ye,(le,ue)=>V(ue)?Qe-le-1:le-Qe,(le,ue)=>{V(ue)&&Qe++});if(p.eachChildOf(Ye,rt,(le,ue,kt)=>{let qt,Nn,jr=le,Ln=le,et=le;if(typeof le=="number"){let Dt=le+Ut;Nn=bt(Dt),Ln=Dt+At;let pt=le+Ze;qt=$e(pt),C(R(Nn))&&(qt=null),jr=pt+Qe,et=le+at,S(jr>=0,"p1PickKey is negative"),S(Ln>=0,"p2DropKey is negative");const an=C(R(ue)),Yn=V(R(kt));(an||Yn&&!zn)&&at--,an&&Ze--,Yn&&Ut--}else qt=$e(le),Nn=bt(le);Pt.descend(jr),$t.descend(Ln);const Or=_e&&!C(R(ue))?ae[et]:void 0,sn=H(qt,ue,kt,Nn,Or,zn,$t,Pt);var Fn,me,St;_e&&!zn?Or!==sn&&(Fe||(ae=Array.isArray(ae)?ae.slice():Object.assign({},ae),Fe=!0),Fn=ae,St=sn,typeof(me=et)=="number"?(S(Array.isArray(Fn)),S(me<Fn.length)):(S(!Array.isArray(Fn)),S(Fn[me]!==void 0)),St===void 0?typeof me=="number"?Fn.splice(me,1):delete Fn[me]:Fn[me]=St):S(sn===void 0),$t.ascend(),Pt.ascend()}),$e.end(),bt.end(),De!=null)De.i=ae;else if(!yn&&!mn&&_n==null)return ae}(ie,ie.clone(),M,M.clone(),void 0,!1,J,Ae),J.reset(),J.mergeTree(Ae.get()),J.reset(),J.get(),Ce.map(H=>H.get()),Te.map(H=>H.get()),ie.traverse(J,(H,ye)=>{const Ye=H.p;if(Ye!=null){const rt=te[Ye];rt!=null&&ye.write("p",rt);const ze=Ce[Ye];ze&&ze.get(),ze&&ye.mergeTree(ze.get())}else H.r!==void 0&&ye.write("r",H.r)}),J.reset(),J.get(),M.traverse(J,(H,ye)=>{const Ye=H.d;if(Ye!=null){const ze=G[Ye];ze!=null&&ye.write("d",ze);const Et=Te[Ye];Et&&ye.mergeTree(Et.get())}else H.i!==void 0&&ye.write("i",H.i);const rt=Ht(H);rt&&!Se.has(H)&&q(ye,rt,F(H))}),J.get()}function st(w){if(w==null)return null;const D=new p.ReadCursor(w),Y=new p.WriteCursor;let ie;const M=[],J=[];return function Ce(Te,U,X){const te=Te.getComponent();let G,Se=!1;if(te){te.p!=null&&(U.write("d",te.p),M[te.p]=Te.clone()),te.r!==void 0&&U.write("i",te.r),te.d!=null&&(U.write("p",te.d),X=void 0),te.i!==void 0&&(X=G=te.i);const H=Ht(te);H&&(X===void 0?(ie||(ie=new Set),ie.add(te)):(F(te),X=H.apply(X,F(te)),Se=!0))}let Ae=0;for(const H of Te){U.descend(H);const ye=typeof H=="number"?H-Ae:H,Ye=He(X,ye);C(Te.getComponent())&&Ae++;const rt=Ce(Te,U,Ye);if(X!==void 0&&rt!==void 0){if(Se||(Se=!0,X=we(X)),!pe(X,ye))throw Error("Cannot modify child - invalid operation");X[ye]=rt}U.ascend()}if(G===void 0)return Se?X:void 0;U.write("r",X)}(D,Y,void 0),ie&&(Y.reset(),function Ce(Te,U,X){const te=U.getComponent();if(te){const H=te.d;if(H!=null&&(Te=M[H],X=J[H]=p.writeCursor()),ie.has(te)){const ye=Ht(te);if(!ye.invert)throw Error(`Cannot invert subtype ${ye.name}`);q(X,ye,ye.invert(F(te)))}}let G=0,Se=0;const Ae=p.advancer(Te,(H,ye)=>V(ye)?G-H-1:H-G,(H,ye)=>{V(ye)&&G++});for(const H of U)if(typeof H=="number"){const ye=H-Se,Ye=Ae(ye),rt=ye+G;X.descend(rt),Ce(Ye,U,X),C(U.getComponent())&&Se++,X.ascend()}else X.descend(H),Ce(Ae(H),U,X),X.ascend();Ae.end()}(D.clone(),D,Y),J.length&&(Y.reset(),D.traverse(Y,(Ce,Te)=>{const U=Ce.p;if(U!=null){const X=J[U];X&&X.get(),X&&Te.mergeTree(X.get())}}))),Y.get()}const Wt=(w,D)=>w.some(Y=>typeof Y=="object"&&(Array.isArray(Y)?Wt(Y,D):D(Y)));function xn(w,D){if(w==null||!Wt(w,U=>{var X;return U.r!==void 0||((X=Ht(U))===null||X===void 0?void 0:X.makeInvertible)!=null}))return w;const Y=new p.ReadCursor(w),ie=new p.WriteCursor;let M=!1;const J=[],Ce=[],Te=(U,X,te)=>{const G=U.getComponent();let Se=!1;if(G){G.d!=null&&X.write("d",G.d),G.i!==void 0&&X.write("i",G.i);const H=G.p;if(H!=null&&(J[H]=U.clone(),S(te!==void 0,"Operation picks up at an invalid key"),Ce[H]=te,X.write("p",G.p)),G.r!==void 0&&te===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const ye=Ht(G);ye&&(ye.makeInvertible?M=!0:q(X,ye,F(G),!0))}let Ae=0;for(const H of U){X.descend(H);const ye=typeof H=="number"?H-Ae:H,Ye=He(te,ye),rt=Te(U,X,Ye);Ye!==rt&&(Se||(Se=!0,te=we(te)),rt===void 0?(te=I(te,ye),typeof H=="number"&&Ae++):te[ye]=rt),X.ascend()}return G&&(G.r!==void 0?(X.write("r",f.default(te)),te=void 0):G.p!=null&&(te=void 0)),te};return Te(Y,ie,D),ie.get(),M&&(ie.reset(),function U(X,te,G,Se,Ae){const H=te.getComponent();if(H){H.i!==void 0?(Se=H.i,Ae=!0):H.d!=null&&(Se=Ce[H.d],X=J[H.d],Ae=!1,H.d);let ze=Ht(H);if(ze&&ze.makeInvertible){const Et=F(H);q(G,ze,ze.makeInvertible(Et,Se),!0)}}let ye=0,Ye=0;const rt=p.advancer(X,(ze,Et)=>V(Et)?ye-ze-1:ze-ye,(ze,Et)=>{V(Et)&&ye++});for(const ze of te)if(typeof ze=="number"){const Et=ze-Ye,yn=rt(Et),$t=Et+ye,Pt=He(Se,Ae?Et:$t);G.descend(ze),U(yn,te,G,Pt,Ae),C(te.getComponent())&&Ye++,G.ascend()}else{const Et=He(Se,ze);G.descend(ze),U(rt(ze),te,G,Et,Ae),G.ascend()}rt.end()}(Y.clone(),Y,ie,D,!1)),ie.get()}function Bu(w,D){return st(xn(w,D))}const qi=w=>{if(w==null)return null;const D=w.slice();for(let Y=0;Y<w.length;Y++){const ie=D[Y];Array.isArray(ie)&&(D[Y]=qi(ie))}return D};function br(w,D,Y){S(Y==="left"||Y==="right","Direction must be left or right");const ie=Y==="left"?0:1;if(D==null)return{ok:!0,result:w};We(w),We(D);let M=null;const J=[],Ce=[],Te=[],U=[],X=[],te=[],G=[],Se=[],Ae=[],H=[],ye=[],Ye=[],rt=[],ze=[],Et=[];let yn=0;const $t=p.readCursor(w),Pt=p.readCursor(D),yt=p.writeCursor();if(function Xe(ae,De=null,de){const oe=R(De);oe&&(oe.r!==void 0?de=De.clone():oe.p!=null&&(de=null,te[oe.p]=ae.clone()));const _e=ae.getComponent();let Fe;_e&&(Fe=_e.p)!=null&&(X[Fe]=De?De.clone():null,Te[Fe]=ae.clone(),de&&(H[Fe]=!0,Ae[Fe]=de),oe&&oe.p!=null&&(ze[Fe]=oe.p));const Qe=p.advancer(De);for(const Ze of ae)Xe(ae,Qe(Ze),de);Qe.end()}(Pt,$t,null),function Xe(ae,De,de,oe,_e){const Fe=de.getComponent();let Qe,Ze=!1;Fe&&((Qe=Fe.d)!=null?(U[Qe]=de.clone(),oe!=null&&(Et[oe]==null&&(Et[oe]=[]),Et[oe].push(Qe)),ae=X[Qe]||null,De=Te[Qe]||null,H[Qe]?(_e&&(ye[Qe]=!0),_e=Ae[Qe]||null):!_e||ie!==1&&ze[Qe]!=null||M==null&&(M={type:_.ConflictType.RM_UNEXPECTED_CONTENT,op1:i.removeOp(_e.getPath()),op2:i.moveOp(De.getPath(),de.getPath())}),Ze=!0):Fe.i!==void 0&&(ae=De=null,Ze=!0,_e&&M==null&&(M={type:_.ConflictType.RM_UNEXPECTED_CONTENT,op1:i.removeOp(_e.getPath()),op2:i.insertOp(de.getPath(),Fe.i)})));const Ut=R(ae);Ut&&(Ut.r!==void 0?_e=ae.clone():Ut.p!=null&&(Ut.p,oe=Ut.p,_e=null));const At=Ht(Fe);At&&_e&&M==null&&(M={type:_.ConflictType.RM_UNEXPECTED_CONTENT,op1:i.removeOp(_e.getPath()),op2:i.editOp(de.getPath(),At,F(Fe),!0)});let at=0,bt=0;const $e=p.advancer(De,(ue,kt)=>V(kt)?at-ue-1:ue-at,(ue,kt)=>{V(kt)&&at++}),le=p.advancer(ae);for(const ue of de)if(typeof ue=="number"){const kt=ue-bt,qt=$e(kt);bt+=+Xe(le(kt+at),qt,de,oe,_e)}else{const kt=$e(ue);Xe(le(ue),kt,de,oe,_e)}return $e.end(),le.end(),Ze}($t,Pt,Pt.clone(),null,null),U.map(Xe=>Xe&&Xe.get()),M)return{ok:!1,conflict:M};ye.map(Xe=>!!Xe);const kn=[];let mn=null;(function Xe(ae,De,de,oe,_e){let Fe=!1;const Qe=R(De);if(V(Qe)){const $e=Qe.p;$e!=null?(de=U[$e],oe=Ye[$e]=p.writeCursor(),Fe=!0,_e=null):(de=null,_e=De.clone())}else C(R(de))&&(de=null);const Ze=ae.getComponent();if(Ze){const $e=Ze.p;$e!=null?(_e&&(Se[$e]=_e),kn[$e]=_e||ie===1&&Fe?null:oe.getComponent(),J[$e]=ae.clone(),de&&(G[$e]=de.clone())):Ze.r!==void 0&&(_e||oe.write("r",!0),(_e||Fe)&&(mn==null&&(mn=new Set),mn.add(Ze)))}let Ut=0,At=0;const at=p.advancer(De,void 0,($e,le)=>{V(le)&&Ut++}),bt=p.advancer(de,($e,le)=>C(le)?~($e-At):$e-At,($e,le)=>{C(le)&&At++});if(ae)for(const $e of ae)if(typeof $e=="string"){const le=at($e),ue=bt($e);oe.descend($e),Xe(ae,le,ue,oe,_e),oe.ascend()}else{const le=at($e),ue=$e-Ut,kt=V(R(le))?null:bt(ue),qt=ue+At;S(qt>=0),oe.descend(qt),Xe(ae,le,kt,oe,_e),oe.ascend()}at.end(),bt.end()})($t,Pt,Pt.clone(),yt,null),yt.reset();let jn=[];if(function Xe(ae,De,de,oe,_e,Fe){S(De);const Qe=De.getComponent();let Ze=R(oe),Ut=!1;const At=(me,St,Dt)=>me?i.moveOp(me.getPath(),St.getPath()):i.insertOp(St.getPath(),Dt.i);if(C(Qe)){const me=Qe.d;me!=null&&(Ce[me]=De.clone());const St=me!=null?kn[me]:null;let Dt=!1;if(Qe.i!==void 0||me!=null&&St){let pt;Ze&&(Ze.i!==void 0||(pt=Ze.d)!=null&&!H[pt])&&(Dt=pt!=null?me!=null&&me===ze[pt]:u.default(Ze.i,Qe.i),Dt||pt!=null&&ie!==1&&ze[pt]!=null||M==null&&(M={type:_.ConflictType.DROP_COLLISION,op1:At(me!=null?J[me]:null,De,Qe),op2:At(pt!=null?Te[pt]:null,oe,Ze)})),Dt||(Fe?M==null&&(M={type:_.ConflictType.RM_UNEXPECTED_CONTENT,op1:At(me!=null?J[me]:null,De,Qe),op2:i.removeOp(Fe.getPath())}):(me!=null?(jn[yn]=me,_e.write("d",St.p=yn++)):_e.write("i",f.default(Qe.i)),Ut=!0))}else if(me!=null&&!St){const pt=Se[me];pt&&(Fe=pt.clone())}me!=null?(ae=J[me],de=te[me],oe=G[me]):Qe.i!==void 0&&(ae=de=null,Dt||(oe=null))}else V(R(ae))&&(ae=de=oe=null);const at=R(ae),bt=R(de);if(V(bt)){const me=bt.p;bt.r!==void 0&&(!at||at.r===void 0)||H[me]?(oe=null,Fe=de.clone()):me!=null&&(oe=U[me],ie!==1&&ze[me]!=null||((_e=rt[me])||(_e=rt[me]=p.writeCursor()),_e.reset(),Fe=null))}else!C(Qe)&&C(Ze)&&(oe=null);Ze=oe!=null?oe.getComponent():null;const $e=Ht(Qe);if($e){const me=F(Qe);if(Fe)M==null&&(M={type:_.ConflictType.RM_UNEXPECTED_CONTENT,op1:i.editOp(De.getPath(),$e,me,!0),op2:i.removeOp(Fe.getPath())});else{const St=Ht(Ze);let Dt;if(St){if($e!==St)throw Error("Transforming incompatible types");const pt=F(Ze);Dt=$e.transform(me,pt,Y)}else Dt=f.default(me);q(_e,$e,Dt)}}let le=0,ue=0,kt=0,qt=0,Nn=0,jr=0,Ln=ae!=null&&ae.descendFirst(),et=Ln;const Or=p.advancer(de,void 0,(me,St)=>{V(St)&&kt++});let sn=oe!=null&&oe.descendFirst(),Fn=sn;for(const me of De)if(typeof me=="number"){let St;const Dt=C(De.getComponent()),pt=me-ue;{let zr;for(;Ln&&typeof(zr=ae.getKey())=="number";){zr+=le;const Un=ae.getComponent(),Ri=V(Un);if(zr>pt||zr===pt&&(!Ri||ie===0&&Dt))break;if(Ri){le--;const Xr=Un.p;ze.includes(Xr),Un.d,R(rt[Un.d]),V(R(rt[Un.d])),(Un.r===void 0||mn&&mn.has(Un))&&(Xr==null||!kn[Xr]||ie!==1&&ze.includes(Xr))||Nn--}Ln=ae.nextSibling()}St=Ln&&zr===pt?ae:null}const an=pt-le;let Yn=Or(an);const Yi=an-kt;let Oi=null;{let zr,Un;for(;sn&&typeof(zr=oe.getKey())=="number";){Un=zr-qt;const Ri=oe.getComponent(),Xr=C(Ri);if(Un>Yi)break;if(Un===Yi){if(!Xr){Oi=oe;break}{if(ie===0&&Dt){Oi=oe;break}const Rr=Yn&&V(Yn.getComponent());if(ie===0&&Rr)break}}if(Xr){const Rr=Ri.d;ze[Rr],Ri.i===void 0&&(H[Rr]||ze[Rr]!=null&&ie!==1)?(H[Rr]||ze[Rr]!=null&&ie===0)&&(qt++,jr--):qt++}sn=oe.nextSibling()}}const mo=Yi+qt+Nn+jr;S(mo>=0,"trying to descend to a negative index"),_e.descend(mo),Dt&&(St=Yn=Oi=null,ue++),Xe(St,De,Yn,Oi,_e,Fe)&&jr++,_e.ascend()}else{let St;for(;Ln&&(St=ae.getKey(),typeof St!="string"||!(St>me||St===me));)Ln=ae.nextSibling();const Dt=Ln&&St===me?ae:null,pt=Or(me);let an;for(;sn&&(an=oe.getKey(),typeof an!="string"||!(an>me||an===me));)sn=oe.nextSibling();const Yn=sn&&an===me?oe:null;_e.descend(me),Xe(Dt,De,pt,Yn,_e,Fe),_e.ascend()}return Or.end(),et&&ae.ascend(),Fn&&oe.ascend(),Ut}($t,$t.clone(),Pt,Pt.clone(),yt,null),M)return{ok:!1,conflict:M};yt.reset();const gn=(Xe,ae,De)=>Xe.traverse(ae,(de,oe)=>{de.d!=null&&De(de.d,Xe,oe)});(H.length||Ye.length)&&(gn(Pt,yt,(Xe,ae,De)=>{H[Xe]&&!ye[Xe]&&De.write("r",!0),Ye[Xe]&&De.mergeTree(Ye[Xe].get())}),yt.reset());const _n=[],zn=[];if((rt.length||H.length)&&!M){const Xe=p.readCursor(qi(yt.get()));if(gn(Xe,null,(ae,De)=>{_n[ae]=De.clone()}),rt.forEach(ae=>{ae&&gn(p.readCursor(ae.get()),null,(De,de)=>{_n[De]=de.clone()})}),function ae(De,de,oe,_e,Fe,Qe){const Ze=R(de);if(Ze&&V(Ze))if(Ze.p!=null){const le=Ze.p;_n[le].getPath(),oe=_n[le],_e=zn[le]=p.writeCursor()}else Ze.r!==void 0&&(oe=null);else C(R(oe))&&(oe=null);const Ut=De.getComponent();if(Ut){let le;if((le=Ut.d)!=null){const ue=rt[le];ue&&(ue.get(),_e.mergeTree(ue.get()),oe=p.readCursor(ue.get()))}}let At=0,at=0;const bt=p.advancer(de,void 0,(le,ue)=>{V(ue)&&At--}),$e=p.advancer(oe,(le,ue)=>C(ue)?-(le-at)-1:le-at,(le,ue)=>{C(ue)&&at++});for(const le of De)if(typeof le=="number"){const ue=bt(le),kt=le+At,qt=$e(kt),Nn=kt+at;_e.descend(Nn),ae(De,ue,qt,_e),_e.ascend()}else _e.descend(le),ae(De,bt(le),$e(le),_e),_e.ascend();bt.end(),$e.end()}(Pt,Xe,Xe.clone(),yt),yt.reset(),M)return{ok:!1,conflict:M};if(yt.get(),zn.length){const ae=zn.map(de=>de?de.get():null),De=p.readCursor(qi(yt.get()));if(gn(De,yt,(de,oe,_e)=>{const Fe=ae[de];Fe&&(_e.mergeTree(Fe),ae[de]=null)}),ae.find(de=>de)){const de=p.writeCursor(),oe=p.writeCursor();let _e=0,Fe=0;ae.forEach(Qe=>{Qe!=null&&gn(p.readCursor(Qe),null,Ze=>{const Ut=jn[Ze];de.writeMove(J[Ut].getPath(),Ce[Ut].getPath(),_e++);const At=Et[Ut];At&&At.forEach(at=>{H[at]||ie!==1&&ze[at]!=null||oe.writeMove(Te[at].getPath(),U[at].getPath(),Fe++)})})}),M={type:_.ConflictType.BLACKHOLE,op1:de.get(),op2:oe.get()}}}}return M?{ok:!1,conflict:M}:{ok:!0,result:yt.get()}}const Si=w=>{const D=new Error("Transform detected write conflict");throw D.conflict=w,D.type=D.name="writeConflict",D};function Qi(w,D,Y){const ie=br(w,D,Y);if(ie.ok)return ie.result;Si(ie.conflict)}const wi=w=>{const D=p.writeCursor();return p.readCursor(w).traverse(D,(Y,ie)=>{(C(Y)||Ht(Y))&&ie.write("r",!0)}),D.get()},yo=(w,D)=>{const{type:Y,op1:ie,op2:M}=w;switch(Y){case _.ConflictType.DROP_COLLISION:return D==="left"?[null,wi(M)]:[wi(ie),null];case _.ConflictType.RM_UNEXPECTED_CONTENT:let J=!1;return p.readCursor(ie).traverse(null,Ce=>{Ce.r!==void 0&&(J=!0)}),J?[null,wi(M)]:[wi(ie),null];case _.ConflictType.BLACKHOLE:return[wi(ie),wi(M)];default:throw Error("Unrecognised conflict: "+Y)}};function Ml(w,D,Y,ie){let M=null;for(;;){const J=br(D,Y,ie);if(J.ok)return dt(M,J.result);{const{conflict:Ce}=J;w(Ce)||Si(Ce);const[Te,U]=yo(Ce,ie);D=dt(je(D),Te),Y=dt(je(Y),U),M=dt(M,U)}}}})(zu),function(i){var l=N&&N.__createBinding||(Object.create?function(_,S,R,K){K===void 0&&(K=R),Object.defineProperty(_,K,{enumerable:!0,get:function(){return S[R]}})}:function(_,S,R,K){K===void 0&&(K=R),_[K]=S[R]}),u=N&&N.__exportStar||function(_,S){for(var R in _)R!=="default"&&!S.hasOwnProperty(R)&&l(S,_,R)};Object.defineProperty(i,"__esModule",{value:!0}),u(zu,i);var f=Wi;Object.defineProperty(i,"ReadCursor",{enumerable:!0,get:function(){return f.ReadCursor}}),Object.defineProperty(i,"WriteCursor",{enumerable:!0,get:function(){return f.WriteCursor}});var p=Fu;Object.defineProperty(i,"ConflictType",{enumerable:!0,get:function(){return p.ConflictType}})}(Xo);var Dl=lt(Xo);return Ve.types.register(Dl.type),Ve.json1=Dl,Ve.textUnicode=Ja,Ve})})(Gf);const Kf=Cc(Rc),{Connection:bf}=Kf,Xf=new WebSocket("ws://"+window.location.host),Jf=new bf(Xf);function Zf(){const[Z,Ke]=oo.useState(null),[N,lt]=oo.useState(!1),[Ie,Ve]=oo.useState(null);oo.useEffect(()=>{const Nt=Jf.get("documents","1");Nt.subscribe(()=>{Ke(Nt.data)})},[]);const gt=Z&&Ie?Z[Ie].text:"";return Fo(Uf,{children:[dn("div",{className:"tabList"}),dn("div",{className:"bottomBar"}),dn("div",{className:"sidebar show",children:Fo("ul",{className:"nav-links",children:[Fo("li",{className:N?"showMenu":"",children:[Fo("div",{className:"icon-link",children:[Fo("a",{href:"#",children:[dn("i",{id:"folderIcon",className:N?"bx bx-folder-open":"bx bx-folder"}),dn("span",{className:"link_name",children:"Files"})]}),dn("i",{className:"bx bxs-chevron-down arrow",onClick:()=>{lt(!N)}})]}),Fo("ul",{className:"sub-menu",children:[dn("li",{children:dn("a",{className:"link_name",href:"#",children:"Files"})}),Z?Object.keys(Z).map(Nt=>dn("li",{onClick:()=>{Ve(Nt)},children:dn("a",{children:Z[Nt].name})})):null]})]}),dn("li",{children:Fo("div",{className:"profile-details",children:[Fo("a",{href:"#",children:[dn("i",{className:"bx bx-cog"}),dn("span",{className:"link_name",children:"Setting"})]}),dn("ul",{className:"sub-menu blank",children:dn("li",{children:dn("a",{className:"link_name",href:"#",children:"Setting"})})})]})})]})}),dn("textarea",{className:"TextEdit",name:"editor",id:"edit",value:Ie&&gt?Z[Ie].text:""})]})}cf(document.getElementById("root")).render(dn(oo.StrictMode,{children:dn(Zf,{})}));
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + React</title>
8
+ <script type="module" crossorigin src="/assets/index-384263a3.js"></script>
9
+ <link rel="stylesheet" href="/assets/index-2dc57e74.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+
14
+ </body>
15
+ </html>
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json CHANGED
@@ -1,10 +1,21 @@
1
1
  {
2
2
  "name": "vzcode",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Multiplayer code editor system",
5
5
  "main": "index.js",
6
+ "type": "module",
6
7
  "bin": "cli.js",
7
- "scripts": {},
8
+ "files": [
9
+ "dist/**"
10
+ ],
11
+ "scripts": {
12
+ "test": "cd test; node ../cli.js",
13
+ "prettier": "prettier {*.*,**/*.*} --single-quote --write",
14
+ "dev": "vite",
15
+ "build": "vite build",
16
+ "preview": "vite preview",
17
+ "prepublishOnly": "npm run build"
18
+ },
8
19
  "repository": {
9
20
  "type": "git",
10
21
  "url": "git+https://github.com/vizhub-core/vzcode.git"
@@ -25,5 +36,25 @@
25
36
  "bugs": {
26
37
  "url": "https://github.com/vizhub-core/vzcode/issues"
27
38
  },
28
- "homepage": "https://github.com/vizhub-core/vzcode#readme"
39
+ "homepage": "https://github.com/vizhub-core/vzcode#readme",
40
+ "dependencies": {
41
+ "@teamwork/websocket-json-stream": "^2.0.0",
42
+ "express": "^4.18.2",
43
+ "ot-json1": "^1.0.2",
44
+ "react": "^18.2.0",
45
+ "react-dom": "^18.2.0",
46
+ "sharedb": "^3.2.1",
47
+ "sharedb-client-browser": "^2.2.49",
48
+ "ws": "^8.12.0"
49
+ },
50
+ "devDependencies": {
51
+ "@rollup/plugin-commonjs": "^24.0.1",
52
+ "@rollup/plugin-node-resolve": "^15.0.1",
53
+ "@types/react": "^18.0.26",
54
+ "@types/react-dom": "^18.0.9",
55
+ "@vitejs/plugin-react": "^3.0.0",
56
+ "prettier": "^2.8.3",
57
+ "rollup-plugin-polyfill-node": "^0.12.0",
58
+ "vite": "^4.0.0"
59
+ }
29
60
  }