diff --git a/frontend-dist/JuliaMono-Bold.68f7f035.woff2 b/frontend-dist/JuliaMono-Bold.68f7f035.woff2 new file mode 100644 index 0000000000..7cb28c7db1 Binary files /dev/null and b/frontend-dist/JuliaMono-Bold.68f7f035.woff2 differ diff --git a/frontend-dist/JuliaMono-BoldLatin.a78b1eda.woff2 b/frontend-dist/JuliaMono-BoldLatin.a78b1eda.woff2 new file mode 100644 index 0000000000..3ce0143c23 Binary files /dev/null and b/frontend-dist/JuliaMono-BoldLatin.a78b1eda.woff2 differ diff --git a/frontend-dist/JuliaMono-Regular.de4da299.woff2 b/frontend-dist/JuliaMono-Regular.de4da299.woff2 new file mode 100644 index 0000000000..e24039dda8 Binary files /dev/null and b/frontend-dist/JuliaMono-Regular.de4da299.woff2 differ diff --git a/frontend-dist/JuliaMono-RegularItalic.963ec4f3.woff2 b/frontend-dist/JuliaMono-RegularItalic.963ec4f3.woff2 new file mode 100644 index 0000000000..3ef6f2865b Binary files /dev/null and b/frontend-dist/JuliaMono-RegularItalic.963ec4f3.woff2 differ diff --git a/frontend-dist/JuliaMono-RegularLatin.d51844a8.woff2 b/frontend-dist/JuliaMono-RegularLatin.d51844a8.woff2 new file mode 100644 index 0000000000..f334d875b3 Binary files /dev/null and b/frontend-dist/JuliaMono-RegularLatin.d51844a8.woff2 differ diff --git a/frontend-dist/Vollkorn-Black.0ebdfbf5.woff2 b/frontend-dist/Vollkorn-Black.0ebdfbf5.woff2 new file mode 100644 index 0000000000..b51a37a406 Binary files /dev/null and b/frontend-dist/Vollkorn-Black.0ebdfbf5.woff2 differ diff --git a/frontend-dist/Vollkorn-BlackItalic.4095acfe.woff2 b/frontend-dist/Vollkorn-BlackItalic.4095acfe.woff2 new file mode 100644 index 0000000000..bb2e060ce4 Binary files /dev/null and b/frontend-dist/Vollkorn-BlackItalic.4095acfe.woff2 differ diff --git a/frontend-dist/Vollkorn-Bold.6e1feb70.woff2 b/frontend-dist/Vollkorn-Bold.6e1feb70.woff2 new file mode 100644 index 0000000000..cfb12e1520 Binary files /dev/null and b/frontend-dist/Vollkorn-Bold.6e1feb70.woff2 differ diff --git a/frontend-dist/Vollkorn-BoldItalic.a48ab300.woff2 b/frontend-dist/Vollkorn-BoldItalic.a48ab300.woff2 new file mode 100644 index 0000000000..23d7a6c844 Binary files /dev/null and b/frontend-dist/Vollkorn-BoldItalic.a48ab300.woff2 differ diff --git a/frontend-dist/Vollkorn-SemiBold.8072eb6c.woff2 b/frontend-dist/Vollkorn-SemiBold.8072eb6c.woff2 new file mode 100644 index 0000000000..78b781055b Binary files /dev/null and b/frontend-dist/Vollkorn-SemiBold.8072eb6c.woff2 differ diff --git a/frontend-dist/Vollkorn-SemiBoldItalic.5c3cd265.woff2 b/frontend-dist/Vollkorn-SemiBoldItalic.5c3cd265.woff2 new file mode 100644 index 0000000000..2162ab8ef4 Binary files /dev/null and b/frontend-dist/Vollkorn-SemiBoldItalic.5c3cd265.woff2 differ diff --git a/frontend-dist/add-outline.e3c93c35.svg b/frontend-dist/add-outline.e3c93c35.svg new file mode 100644 index 0000000000..7c7fb14877 --- /dev/null +++ b/frontend-dist/add-outline.e3c93c35.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/alegreya-sans-all-400-italic.f87bfe89.woff b/frontend-dist/alegreya-sans-all-400-italic.f87bfe89.woff new file mode 100644 index 0000000000..75ef6a5671 Binary files /dev/null and b/frontend-dist/alegreya-sans-all-400-italic.f87bfe89.woff differ diff --git a/frontend-dist/alegreya-sans-all-400-normal.a91dc265.woff b/frontend-dist/alegreya-sans-all-400-normal.a91dc265.woff new file mode 100644 index 0000000000..0658fd17cc Binary files /dev/null and b/frontend-dist/alegreya-sans-all-400-normal.a91dc265.woff differ diff --git a/frontend-dist/alegreya-sans-all-500-italic.8917c3da.woff b/frontend-dist/alegreya-sans-all-500-italic.8917c3da.woff new file mode 100644 index 0000000000..02b7436cd3 Binary files /dev/null and b/frontend-dist/alegreya-sans-all-500-italic.8917c3da.woff differ diff --git a/frontend-dist/alegreya-sans-all-500-normal.5db27a5b.woff b/frontend-dist/alegreya-sans-all-500-normal.5db27a5b.woff new file mode 100644 index 0000000000..4a6b7ff755 Binary files /dev/null and b/frontend-dist/alegreya-sans-all-500-normal.5db27a5b.woff differ diff --git a/frontend-dist/alegreya-sans-all-700-italic.a6d70e05.woff b/frontend-dist/alegreya-sans-all-700-italic.a6d70e05.woff new file mode 100644 index 0000000000..5118953a73 Binary files /dev/null and b/frontend-dist/alegreya-sans-all-700-italic.a6d70e05.woff differ diff --git a/frontend-dist/alegreya-sans-all-700-normal.29d7dfa9.woff b/frontend-dist/alegreya-sans-all-700-normal.29d7dfa9.woff new file mode 100644 index 0000000000..b8c1d8a284 Binary files /dev/null and b/frontend-dist/alegreya-sans-all-700-normal.29d7dfa9.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-400-italic.8c81649c.woff2 b/frontend-dist/alegreya-sans-cyrillic-400-italic.8c81649c.woff2 new file mode 100644 index 0000000000..3ebce2cffa Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-400-italic.8c81649c.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-400-normal.ab3d1dcc.woff2 b/frontend-dist/alegreya-sans-cyrillic-400-normal.ab3d1dcc.woff2 new file mode 100644 index 0000000000..3434d6ed9e Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-400-normal.ab3d1dcc.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-500-italic.a40f95be.woff2 b/frontend-dist/alegreya-sans-cyrillic-500-italic.a40f95be.woff2 new file mode 100644 index 0000000000..7338c02062 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-500-italic.a40f95be.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-500-normal.8a029e9d.woff2 b/frontend-dist/alegreya-sans-cyrillic-500-normal.8a029e9d.woff2 new file mode 100644 index 0000000000..c3c821ba91 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-500-normal.8a029e9d.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-700-italic.c4ef17a2.woff2 b/frontend-dist/alegreya-sans-cyrillic-700-italic.c4ef17a2.woff2 new file mode 100644 index 0000000000..ad187b0b86 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-700-italic.c4ef17a2.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-700-normal.5a5aa5e3.woff2 b/frontend-dist/alegreya-sans-cyrillic-700-normal.5a5aa5e3.woff2 new file mode 100644 index 0000000000..dafc6f88c2 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-700-normal.5a5aa5e3.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.7c2a4a40.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.7c2a4a40.woff2 new file mode 100644 index 0000000000..4ead31cd71 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.7c2a4a40.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.5f5cc2ef.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.5f5cc2ef.woff2 new file mode 100644 index 0000000000..f81ae10995 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.5f5cc2ef.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.78248b65.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.78248b65.woff2 new file mode 100644 index 0000000000..387eb05d64 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.78248b65.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.0e6ee102.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.0e6ee102.woff2 new file mode 100644 index 0000000000..5f05b9e7d0 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.0e6ee102.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.69b0617e.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.69b0617e.woff2 new file mode 100644 index 0000000000..ae9dc86ec0 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.69b0617e.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.2e02b08f.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.2e02b08f.woff2 new file mode 100644 index 0000000000..43b5ba1286 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.2e02b08f.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-400-italic.1b909c63.woff2 b/frontend-dist/alegreya-sans-greek-400-italic.1b909c63.woff2 new file mode 100644 index 0000000000..c1cebd7a3f Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-400-italic.1b909c63.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-400-normal.4e5a8597.woff2 b/frontend-dist/alegreya-sans-greek-400-normal.4e5a8597.woff2 new file mode 100644 index 0000000000..19ba95016c Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-400-normal.4e5a8597.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-500-italic.19d09eea.woff2 b/frontend-dist/alegreya-sans-greek-500-italic.19d09eea.woff2 new file mode 100644 index 0000000000..5b9906e9c0 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-500-italic.19d09eea.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-500-normal.54a6041f.woff2 b/frontend-dist/alegreya-sans-greek-500-normal.54a6041f.woff2 new file mode 100644 index 0000000000..5cb0e6b5a0 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-500-normal.54a6041f.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-700-italic.5aef27cf.woff2 b/frontend-dist/alegreya-sans-greek-700-italic.5aef27cf.woff2 new file mode 100644 index 0000000000..2a17d2edfa Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-700-italic.5aef27cf.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-700-normal.452fc62e.woff2 b/frontend-dist/alegreya-sans-greek-700-normal.452fc62e.woff2 new file mode 100644 index 0000000000..7415e7b66d Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-700-normal.452fc62e.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-400-italic.550f5118.woff2 b/frontend-dist/alegreya-sans-greek-ext-400-italic.550f5118.woff2 new file mode 100644 index 0000000000..4ddc332622 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-400-italic.550f5118.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-400-normal.b82a0aea.woff2 b/frontend-dist/alegreya-sans-greek-ext-400-normal.b82a0aea.woff2 new file mode 100644 index 0000000000..f85a41731d Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-400-normal.b82a0aea.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-500-italic.8b2e952b.woff2 b/frontend-dist/alegreya-sans-greek-ext-500-italic.8b2e952b.woff2 new file mode 100644 index 0000000000..77cf5e4551 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-500-italic.8b2e952b.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-500-normal.00f2c6f3.woff2 b/frontend-dist/alegreya-sans-greek-ext-500-normal.00f2c6f3.woff2 new file mode 100644 index 0000000000..a6681017e2 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-500-normal.00f2c6f3.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-700-italic.a1ccc0c2.woff2 b/frontend-dist/alegreya-sans-greek-ext-700-italic.a1ccc0c2.woff2 new file mode 100644 index 0000000000..ad23a55e70 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-700-italic.a1ccc0c2.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-700-normal.ca9ee8e1.woff2 b/frontend-dist/alegreya-sans-greek-ext-700-normal.ca9ee8e1.woff2 new file mode 100644 index 0000000000..49c5654293 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-700-normal.ca9ee8e1.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-400-italic.ec56f658.woff2 b/frontend-dist/alegreya-sans-latin-400-italic.ec56f658.woff2 new file mode 100644 index 0000000000..df999c7eb2 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-400-italic.ec56f658.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-400-normal.62b57001.woff2 b/frontend-dist/alegreya-sans-latin-400-normal.62b57001.woff2 new file mode 100644 index 0000000000..5d98f5cde9 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-400-normal.62b57001.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-500-italic.6d8350bf.woff2 b/frontend-dist/alegreya-sans-latin-500-italic.6d8350bf.woff2 new file mode 100644 index 0000000000..7cd291700f Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-500-italic.6d8350bf.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-500-normal.4428c984.woff2 b/frontend-dist/alegreya-sans-latin-500-normal.4428c984.woff2 new file mode 100644 index 0000000000..cf40f1fce9 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-500-normal.4428c984.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-700-italic.abc64c8a.woff2 b/frontend-dist/alegreya-sans-latin-700-italic.abc64c8a.woff2 new file mode 100644 index 0000000000..befb4809c6 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-700-italic.abc64c8a.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-700-normal.96e2fcc9.woff2 b/frontend-dist/alegreya-sans-latin-700-normal.96e2fcc9.woff2 new file mode 100644 index 0000000000..de0826d1b8 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-700-normal.96e2fcc9.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-400-italic.b9ce632b.woff2 b/frontend-dist/alegreya-sans-latin-ext-400-italic.b9ce632b.woff2 new file mode 100644 index 0000000000..c15ce0ec2c Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-400-italic.b9ce632b.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-400-normal.1c1602b0.woff2 b/frontend-dist/alegreya-sans-latin-ext-400-normal.1c1602b0.woff2 new file mode 100644 index 0000000000..cc81c0133c Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-400-normal.1c1602b0.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-500-italic.d15c8f11.woff2 b/frontend-dist/alegreya-sans-latin-ext-500-italic.d15c8f11.woff2 new file mode 100644 index 0000000000..c707422915 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-500-italic.d15c8f11.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-500-normal.637067c1.woff2 b/frontend-dist/alegreya-sans-latin-ext-500-normal.637067c1.woff2 new file mode 100644 index 0000000000..6b61635fa8 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-500-normal.637067c1.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-700-italic.733aea09.woff2 b/frontend-dist/alegreya-sans-latin-ext-700-italic.733aea09.woff2 new file mode 100644 index 0000000000..631822edac Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-700-italic.733aea09.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-700-normal.b5306f41.woff2 b/frontend-dist/alegreya-sans-latin-ext-700-normal.b5306f41.woff2 new file mode 100644 index 0000000000..1896761236 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-700-normal.b5306f41.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-400-italic.d08e8dff.woff2 b/frontend-dist/alegreya-sans-vietnamese-400-italic.d08e8dff.woff2 new file mode 100644 index 0000000000..5552c00e3d Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-400-italic.d08e8dff.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-400-normal.bdc8a622.woff2 b/frontend-dist/alegreya-sans-vietnamese-400-normal.bdc8a622.woff2 new file mode 100644 index 0000000000..3ec2c8eb20 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-400-normal.bdc8a622.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-500-italic.3ff20df8.woff2 b/frontend-dist/alegreya-sans-vietnamese-500-italic.3ff20df8.woff2 new file mode 100644 index 0000000000..528c2f36f7 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-500-italic.3ff20df8.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-500-normal.97e250df.woff2 b/frontend-dist/alegreya-sans-vietnamese-500-normal.97e250df.woff2 new file mode 100644 index 0000000000..7f1f015cb3 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-500-normal.97e250df.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-700-italic.7de0cccc.woff2 b/frontend-dist/alegreya-sans-vietnamese-700-italic.7de0cccc.woff2 new file mode 100644 index 0000000000..8bdb25ba3c Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-700-italic.7de0cccc.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-700-normal.59390763.woff2 b/frontend-dist/alegreya-sans-vietnamese-700-normal.59390763.woff2 new file mode 100644 index 0000000000..bc5e38d57d Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-700-normal.59390763.woff2 differ diff --git a/frontend-dist/arrow-back-outline.9ae1bed8.svg b/frontend-dist/arrow-back-outline.9ae1bed8.svg new file mode 100644 index 0000000000..8fc34ff6ec --- /dev/null +++ b/frontend-dist/arrow-back-outline.9ae1bed8.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/arrow-forward-outline.f5f68f5c.svg b/frontend-dist/arrow-forward-outline.f5f68f5c.svg new file mode 100644 index 0000000000..32a9f4f309 --- /dev/null +++ b/frontend-dist/arrow-forward-outline.f5f68f5c.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/arrow-redo-circle-outline.dfa899f4.svg b/frontend-dist/arrow-redo-circle-outline.dfa899f4.svg new file mode 100644 index 0000000000..d0d9e1124d --- /dev/null +++ b/frontend-dist/arrow-redo-circle-outline.dfa899f4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/arrow-undo-outline.d8c99108.svg b/frontend-dist/arrow-undo-outline.d8c99108.svg new file mode 100644 index 0000000000..a5d529e729 --- /dev/null +++ b/frontend-dist/arrow-undo-outline.d8c99108.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/arrow-up-circle-outline.3f146ffe.svg b/frontend-dist/arrow-up-circle-outline.3f146ffe.svg new file mode 100644 index 0000000000..ba46f260f7 --- /dev/null +++ b/frontend-dist/arrow-up-circle-outline.3f146ffe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/ban-outline.c97da9b4.svg b/frontend-dist/ban-outline.c97da9b4.svg new file mode 100644 index 0000000000..c52ff62277 --- /dev/null +++ b/frontend-dist/ban-outline.c97da9b4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/bandage-outline.37f88b63.svg b/frontend-dist/bandage-outline.37f88b63.svg new file mode 100644 index 0000000000..a9e3764e9f --- /dev/null +++ b/frontend-dist/bandage-outline.37f88b63.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/caret-down-outline.4253a2fe.svg b/frontend-dist/caret-down-outline.4253a2fe.svg new file mode 100644 index 0000000000..c4c15b4722 --- /dev/null +++ b/frontend-dist/caret-down-outline.4253a2fe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/caret-forward-circle-outline.d0bf2b34.svg b/frontend-dist/caret-forward-circle-outline.d0bf2b34.svg new file mode 100644 index 0000000000..093c8e4ca2 --- /dev/null +++ b/frontend-dist/caret-forward-circle-outline.d0bf2b34.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/caret-forward-outline.348a84b6.svg b/frontend-dist/caret-forward-outline.348a84b6.svg new file mode 100644 index 0000000000..888285c953 --- /dev/null +++ b/frontend-dist/caret-forward-outline.348a84b6.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/chatbox-ellipses-outline.4334a3a4.svg b/frontend-dist/chatbox-ellipses-outline.4334a3a4.svg new file mode 100644 index 0000000000..4e04a58545 --- /dev/null +++ b/frontend-dist/chatbox-ellipses-outline.4334a3a4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/checkmark-outline.4fb8c646.svg b/frontend-dist/checkmark-outline.4fb8c646.svg new file mode 100644 index 0000000000..f62dcf9212 --- /dev/null +++ b/frontend-dist/checkmark-outline.4fb8c646.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/chevron-down-outline.1efaf1cc.svg b/frontend-dist/chevron-down-outline.1efaf1cc.svg new file mode 100644 index 0000000000..e7a50cd112 --- /dev/null +++ b/frontend-dist/chevron-down-outline.1efaf1cc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/chevron-forward-circle-outline.babf2a99.svg b/frontend-dist/chevron-forward-circle-outline.babf2a99.svg new file mode 100644 index 0000000000..9e63a3c049 --- /dev/null +++ b/frontend-dist/chevron-forward-circle-outline.babf2a99.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/close-circle-outline.4baeedb9.svg b/frontend-dist/close-circle-outline.4baeedb9.svg new file mode 100644 index 0000000000..588e2d4c82 --- /dev/null +++ b/frontend-dist/close-circle-outline.4baeedb9.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/close-circle.d0f6eac6.svg b/frontend-dist/close-circle.d0f6eac6.svg new file mode 100644 index 0000000000..cce96081a3 --- /dev/null +++ b/frontend-dist/close-circle.d0f6eac6.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/close-outline.9c22a232.svg b/frontend-dist/close-outline.9c22a232.svg new file mode 100644 index 0000000000..17d07818e6 --- /dev/null +++ b/frontend-dist/close-outline.9c22a232.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/cloud-download-outline.8c1ff9bb.svg b/frontend-dist/cloud-download-outline.8c1ff9bb.svg new file mode 100644 index 0000000000..939a8c238e --- /dev/null +++ b/frontend-dist/cloud-download-outline.8c1ff9bb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/cloud-offline-outline.ac2eade9.svg b/frontend-dist/cloud-offline-outline.ac2eade9.svg new file mode 100644 index 0000000000..426ff3b0d9 --- /dev/null +++ b/frontend-dist/cloud-offline-outline.ac2eade9.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/copy-outline.0f561529.svg b/frontend-dist/copy-outline.0f561529.svg new file mode 100644 index 0000000000..01e29db632 --- /dev/null +++ b/frontend-dist/copy-outline.0f561529.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/document-text-outline.8d1e2333.svg b/frontend-dist/document-text-outline.8d1e2333.svg new file mode 100644 index 0000000000..dacd264f49 --- /dev/null +++ b/frontend-dist/document-text-outline.8d1e2333.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/download-outline.523a74d8.svg b/frontend-dist/download-outline.523a74d8.svg new file mode 100644 index 0000000000..8f0e680543 --- /dev/null +++ b/frontend-dist/download-outline.523a74d8.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/editor.30fdc042.js b/frontend-dist/editor.30fdc042.js new file mode 100644 index 0000000000..3c4726b9af --- /dev/null +++ b/frontend-dist/editor.30fdc042.js @@ -0,0 +1,5 @@ +function e(e,t,i,n){Object.defineProperty(e,t,{get:i,set:n,enumerable:!0,configurable:!0})}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i={},n={},r=t.parcelRequire94c2;null==r&&((r=function(e){if(e in i)return i[e].exports;if(e in n){var t=n[e];delete n[e];var r={id:e,exports:{}};return i[e]=r,t.call(r.exports,r,r.exports),r.exports}var O=new Error("Cannot find module '"+e+"'");throw O.code="MODULE_NOT_FOUND",O}).register=function(e,t){n[e]=t},t.parcelRequire94c2=r),r.register("fBBKY",(function(t,i){e(t.exports,"html",(()=>O)),e(t.exports,"render",(()=>r("29nid").render)),e(t.exports,"Component",(()=>r("29nid").Component)),e(t.exports,"useEffect",(()=>r("1051i").useEffect)),e(t.exports,"useLayoutEffect",(()=>r("1051i").useLayoutEffect)),e(t.exports,"useState",(()=>r("1051i").useState)),e(t.exports,"useRef",(()=>r("1051i").useRef)),e(t.exports,"useMemo",(()=>r("1051i").useMemo)),e(t.exports,"useCallback",(()=>r("1051i").useCallback)),e(t.exports,"createContext",(()=>r("29nid").createContext)),e(t.exports,"createRef",(()=>r("29nid").createRef)),e(t.exports,"useContext",(()=>r("1051i").useContext)),e(t.exports,"h",(()=>r("29nid").h)),e(t.exports,"cloneElement",(()=>r("29nid").cloneElement)),e(t.exports,"hydrate",(()=>r("29nid").hydrate)),r("3DSZl");var n=r("29nid");r("8Fvxu");r("1051i");r("17pQx");const O=r("k2XV1").default.bind(n.h)})),r.register("3DSZl",(function(t,i){e(t.exports,"h",(()=>r("29nid").h)),e(t.exports,"render",(()=>r("29nid").render)),e(t.exports,"Component",(()=>r("29nid").Component)),e(t.exports,"createContext",(()=>r("29nid").createContext)),e(t.exports,"createRef",(()=>r("29nid").createRef)),e(t.exports,"cloneElement",(()=>r("29nid").cloneElement)),e(t.exports,"hydrate",(()=>r("29nid").hydrate)),r("29nid")})),r.register("29nid",(function(t,i){e(t.exports,"options",(()=>r)),e(t.exports,"createRef",(()=>Q)),e(t.exports,"Component",(()=>g)),e(t.exports,"render",(()=>Y)),e(t.exports,"hydrate",(()=>N)),e(t.exports,"cloneElement",(()=>Z)),e(t.exports,"createContext",(()=>z)),e(t.exports,"h",(()=>p));var n,r,O,s,o,a,l,h={},c=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(e,t){for(var i in t)e[i]=t[i];return e}function d(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,i){var r,O,s,o={};for(s in t)"key"==s?r=t[s]:"ref"==s?O=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return $(e,o,r,O,null)}function $(e,t,i,n,s){var o={type:e,props:t,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:s??++O};return null==s&&null!=r.vnode&&r.vnode(o),o}function Q(){return{current:null}}function m(e){return e.children}function g(e,t){this.props=e,this.context=t}function P(e,t){if(null==t)return e.__?P(e.__,e.__.__k.indexOf(e)+1):null;for(var i;t0?$(p.type,p.props,p.key,null,p.__v):p)){if(p.__=i,p.__b=i.__b+1,null===(d=y[u])||d&&p.key==d.key&&p.type===d.type)y[u]=void 0;else for(f=0;f2&&(o.children=arguments.length>3?n.call(arguments,2):i),$(e.type,o,r||e.key,O||e.ref,null)}function z(e,t){var i={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var i,n;return this.getChildContext||(i=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&i.some(y)},this.sub=function(e){i.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){i.splice(i.indexOf(e),1),t&&t.call(e)}}),e.children}};return i.Provider.__=i.Consumer.contextType=i}n=c.slice,r={__e:function(e,t){for(var i,n,r;t=t.__;)if((i=t.__c)&&!i.__)try{if((n=i.constructor)&&null!=n.getDerivedStateFromError&&(i.setState(n.getDerivedStateFromError(e)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e),r=i.__d),r)return i.__E=i}catch(t){e=t}throw e}},O=0,g.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof e&&(e=e(f({},i),this.props)),e&&f(i,e),null!=e&&this.__v&&(t&&this.__h.push(t),y(this))},g.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),y(this))},g.prototype.render=m,s=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,w.__r=0,l=0})),r.register("8Fvxu",(function(t,i){e(t.exports,"useEffect",(()=>r("1051i").useEffect)),e(t.exports,"useLayoutEffect",(()=>r("1051i").useLayoutEffect)),e(t.exports,"useState",(()=>r("1051i").useState)),e(t.exports,"useRef",(()=>r("1051i").useRef)),e(t.exports,"useMemo",(()=>r("1051i").useMemo)),e(t.exports,"useCallback",(()=>r("1051i").useCallback)),e(t.exports,"useContext",(()=>r("1051i").useContext)),r("1051i")})),r.register("1051i",(function(t,i){e(t.exports,"useState",(()=>$)),e(t.exports,"useEffect",(()=>Q)),e(t.exports,"useLayoutEffect",(()=>m)),e(t.exports,"useRef",(()=>g)),e(t.exports,"useMemo",(()=>P)),e(t.exports,"useCallback",(()=>X)),e(t.exports,"useContext",(()=>y));var n,O,s,o=r("29nid"),a=0,l=[],h=o.options.__b,c=o.options.__r,u=o.options.diffed,f=o.options.__c,d=o.options.unmount;function p(e,t){o.options.__h&&o.options.__h(O,e,a||t),a=0;var i=O.__H||(O.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function $(e){return a=1,function(e,t,i){var r=p(n++,2);return r.t=e,r.__c||(r.__=[i?i(t):v(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=O),r.__}(v,e)}function Q(e,t){var i=p(n++,3);!o.options.__s&&k(i.__H,t)&&(i.__=e,i.__H=t,O.__H.__h.push(i))}function m(e,t){var i=p(n++,4);!o.options.__s&&k(i.__H,t)&&(i.__=e,i.__H=t,O.__h.push(i))}function g(e){return a=5,P((function(){return{current:e}}),[])}function P(e,t){var i=p(n++,7);return k(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function X(e,t){return a=8,P((function(){return e}),t)}function y(e){var t=O.context[e.__c],i=p(n++,9);return i.c=e,t?(null==i.__&&(i.__=!0,t.sub(O)),t.props.value):e.__}function w(){for(var e;e=l.shift();)if(e.__P)try{e.__H.__h.forEach(x),e.__H.__h.forEach(S),e.__H.__h=[]}catch(t){e.__H.__h=[],o.options.__e(t,e.__v)}}o.options.__b=function(e){O=null,h&&h(e)},o.options.__r=function(e){c&&c(e),n=0;var t=(O=e.__c).__H;t&&(t.__h.forEach(x),t.__h.forEach(S),t.__h=[])},o.options.diffed=function(e){u&&u(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==l.push(t)&&s===o.options.requestAnimationFrame||((s=o.options.requestAnimationFrame)||function(e){var t,i=function(){clearTimeout(n),b&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(i,100);b&&(t=requestAnimationFrame(i))})(w)),O=null},o.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(x),e.__h=e.__h.filter((function(e){return!e.__||S(e)}))}catch(i){t.some((function(e){e.__h&&(e.__h=[])})),t=[],o.options.__e(i,e.__v)}})),f&&f(e,t)},o.options.unmount=function(e){d&&d(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach((function(e){try{x(e)}catch(e){t=e}})),t&&o.options.__e(t,i.__v))};var b="function"==typeof requestAnimationFrame;function x(e){var t=O,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),O=t}function S(e){var t=O;e.__c=e.__(),O=t}function k(e,t){return!e||e.length!==t.length||t.some((function(t,i){return t!==e[i]}))}function v(e,t){return"function"==typeof t?t(e):t}})),r.register("17pQx",(function(t,i){var n;n=t.exports,Object.defineProperty(n,"__esModule",{value:!0,configurable:!0}),e(t.exports,"default",(()=>r("k2XV1").default));r("k2XV1"),r("k2XV1")})),r.register("k2XV1",(function(t,i){e(t.exports,"default",(()=>O));var n=function(e,t,i,r){var O;t[0]=0;for(var s=1;s=5&&((r||!e&&5===n)&&(s.push(n,0,r,i),n=6),e&&(s.push(n,e,0,i),n=6)),r=""},a=0;a"===t?(n=1,r=""):r=t+r[0]:O?t===O?O="":r+=t:'"'===t||"'"===t?O=t:">"===t?(o(),n=1):n&&("="===t?(n=5,i=r,r=""):"/"===t&&(n<5||">"===e[a][l+1])?(o(),3===n&&(s=s[0]),n=s,(s=s[0]).push(2,0,n),n=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(o(),n=2):r+=t),3===n&&"!--"===r&&(n=4,s=s[0])}return o(),s}(e)),t),arguments,[])).length>1?t:t[0]}})),r.register("8aCbc",(function(e,t){try{null==window.process&&(window.process={}),null==window.process.env&&(window.process.env={}),window.process.env.NODE_ENV="production"}catch(e){console.warn("Couldn't set window.process.env, this might break some things")}})),r.register("9lAXI",(function(t,i){e(t.exports,"default",(()=>n));var n=window._})),r.register("5Kx1V",(function(t,i){e(t.exports,"timeout_promise",(()=>s)),e(t.exports,"ws_address_from_base",(()=>u)),e(t.exports,"create_pluto_connection",(()=>d));var n=r("wLwQ2"),O=r("bmSg5");r("cz9Zp");const s=(e,t)=>Promise.race([e,new Promise(((e,i)=>{setTimeout((()=>{i(new Error("Promise timed out."))}),t)}))]),o=()=>crypto.getRandomValues(new Uint32Array(1))[0].toString(36),a=e=>e.readyState==WebSocket.OPEN||e.readyState==WebSocket.CONNECTING,l=e=>{e.onopen=()=>{l(e)},e.onmessage=e.onclose=e.onerror=void 0;try{e.close(1e3,"byebye")}catch(e){}},h=(e,{on_message:t,on_socket_close:i},n=30)=>new Promise(((r,s)=>{const o=new WebSocket(e);let h=!1;const c=setTimeout((()=>{console.warn("Creating websocket timed out",(new Date).toLocaleTimeString()),l(o),s("Socket timeout")}),1e3*n),u=e=>{const t=O.pack(e);o.send(t)};let f=Promise.resolve();o.onmessage=e=>{f=f.then((async()=>{try{const i=await e.data.arrayBuffer(),n=O.unpack(new Uint8Array(i));try{t(n)}catch(t){console.error("Failed to process message from websocket",t,{message:n}),alert(`Something went wrong! You might need to refresh the page.\n\nPlease open an issue on https://github.com/fonsp/Pluto.jl with this info:\n\nFailed to process update\n${t.message}\n\n${JSON.stringify(e)}`)}}catch(t){console.error("Failed to unpack message from websocket",t,{event:e}),alert(`Something went wrong! You might need to refresh the page.\n\nPlease open an issue on https://github.com/fonsp/Pluto.jl with this info:\n\nFailed to unpack message\n${t}\n\n${JSON.stringify(e)}`)}}))},o.onerror=async e=>{console.error(`Socket did an oopsie - ${e.type}`,(new Date).toLocaleTimeString(),"was open:",h,e),await(e=>new Promise((t=>{a(e)?t(!0):setTimeout((()=>{t(a(e))}),1e3)})))(o)?(console.log("The socket somehow recovered from an error?! Onbegrijpelijk"),console.log(o),console.log(o.readyState)):h?(i(),l(o)):s(e)},o.onclose=async e=>{console.error(`Socket did an oopsie - ${e.type}`,(new Date).toLocaleTimeString(),"was open:",h,e),h?(i(),l(o)):s(e)},o.onopen=()=>{console.log("Socket opened",(new Date).toLocaleTimeString()),clearInterval(c),h=!0,r({socket:o,send:u})},console.log("Waiting for socket to open...",(new Date).toLocaleTimeString())}));const c=e=>{let t=null,i=[],n=null;return async(r,O,s,o)=>{if("update_notebook"===r){if(null!=n&&n!=s.notebook_id)throw new Error("Switched notebook inbetween same-tick updates??? WHAT?!?!");return i=[...i,...O.updates],n=s.notebook_id,null==t&&(t=new Promise((e=>setTimeout(e,0))).then((async()=>{let O=i;return t=null,i=[],n=null,await e(r,{updates:O},s,o)}))),await t}return await e(r,O,s,o)}},u=e=>{const t=new URL("./",e);return t.protocol=t.protocol.replace("http","ws"),String(t)},f=()=>u(window.location.href),d=async({on_unrequested_update:e,on_reconnect:t,on_connection_status:i,connect_metadata:r={},ws_address:O=f()})=>{var s=null;const a={send:null,session_options:null,version_info:{julia:"unknown",pluto:"unknown",dismiss_update_notification:!1},notebook_exists:!0,kill:null},l=o(),u=new Map,d=async(t,i={},n={},r=!0)=>{const O=o(),a={type:t,client_id:l,request_id:O,body:i,...n};let h=(()=>{let e=()=>{},t=()=>{};return{current:new Promise(((i,n)=>{e=i,t=n})),resolve:e,reject:t}})();return u.set(O,(t=>{h.resolve(t),!1===r&&e(t,!0)})),s.send(a),await h.current};a.send=c(d);const p=async()=>{(async()=>{try{const e=new URL(window.location.href),t=await fetch("possible_binder_token_please");if(!t.ok)return;const i=await t.text();""!==i&&e.searchParams.get("token")!==i&&(e.searchParams.set("token",i),history.replaceState({},"",e.toString()))}catch(e){console.warn("Error while setting binder url:",e)}})();try{s=await h(String(O),{on_message:t=>{const i=t.initiator_id==l,n=t.request_id;if(i&&n){const e=u.get(n);if(e)return e(t),void u.delete(n)}e(t,i)},on_socket_close:async()=>{i(!1),console.log("Starting new websocket",(new Date).toLocaleTimeString()),await n.Promises.delay(500),await p(),console.log("Starting state sync",(new Date).toLocaleTimeString());const e=t();console.log(`State sync ${e?"":"not "}successful`,(new Date).toLocaleTimeString()),i(e),e||alert("Connection out of sync 😥\n\nRefresh the page to continue")}}),console.log("Hello?");const o=await d("connect",{},r);if(console.log("Hello!"),a.session_options=o.message.options,a.version_info=o.message.version_info,a.notebook_exists=o.message.notebook_exists,console.log("Client object: ",a),null!=r.notebook_id&&!o.message.notebook_exists)return confirm("A new server was started - this notebook session is no longer running.\n\nWould you like to go back to the main menu?")&&(window.location.href="./"),i(!1),{};i(!0);const c=()=>{d("ping",{},{}).then((()=>{setTimeout(c,28e3)})).catch()};return c(),o.message}catch(e){return console.error("connect() failed",e),await n.Promises.delay(5e3),await p()}};return await p(),a}})),r.register("wLwQ2",(function(t,i){e(t.exports,"default",(()=>r)),e(t.exports,"observablehq_for_cells",(()=>O)),e(t.exports,"Promises",(()=>s));let n=()=>{let e=new window.observablehq.Library;return{DOM:e.DOM,Files:e.Files,Generators:e.Generators,Promises:e.Promises,now:e.now,svg:e.svg(),html:e.html(),require:e.require()}};const r=n(),O=n();r.DOM,r.Files,r.Generators;let s=r.Promises;r.now,r.svg,r.html,r.require})),r.register("bmSg5",(function(t,i){e(t.exports,"pack",(()=>o)),e(t.exports,"unpack",(()=>a));var n=r("6nd3I");const O=n.default.createCodec(),s=e=>new Uint8Array(e.buffer);O.addExtPacker(17,Int8Array,s),O.addExtPacker(18,Uint8Array,s),O.addExtPacker(19,Int16Array,s),O.addExtPacker(20,Uint16Array,s),O.addExtPacker(21,Int32Array,s),O.addExtPacker(22,Uint32Array,s),O.addExtPacker(23,Float32Array,s),O.addExtPacker(24,Float64Array,s),O.addExtPacker(18,Uint8ClampedArray,s),O.addExtPacker(18,ArrayBuffer,(e=>new Uint8Array(e))),O.addExtPacker(18,DataView,s),O.addExtPacker(13,Date,(e=>new BigInt64Array([BigInt(+e)]))),O.addExtUnpacker(13,(e=>{if("getBigInt64"in DataView.prototype){let t=new DataView(e.buffer,e.byteOffset,e.byteLength).getBigInt64(0,!0);if(t>Number.MAX_SAFE_INTEGER)throw new Error("Can't read too big number as date (how far in the future is this?!)");return new Date(Number(t))}return new Date(NaN)})),O.addExtUnpacker(17,(e=>new Int8Array(e.buffer))),O.addExtUnpacker(18,(e=>new Uint8Array(e.buffer))),O.addExtUnpacker(19,(e=>new Int16Array(e.buffer))),O.addExtUnpacker(20,(e=>new Uint16Array(e.buffer))),O.addExtUnpacker(21,(e=>new Int32Array(e.buffer))),O.addExtUnpacker(22,(e=>new Uint32Array(e.buffer))),O.addExtUnpacker(23,(e=>new Float32Array(e.buffer))),O.addExtUnpacker(24,(e=>new Float64Array(e.buffer)));const o=e=>n.default.encode(e,{codec:O}),a=e=>n.default.decode(e,{codec:O})})),r.register("6nd3I",(function(t,i){e(t.exports,"default",(()=>n));var n=r("lJisg").default})),r.register("lJisg",(function(i,n){e(i.exports,"default",(()=>O));const r=function e(t,i,n){function r(s,o){if(!i[s]){if(!t[s]){var a=void 0;if(!o&&a)return a(s,!0);if(O)return O(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[s]={exports:{}};t[s][0].call(h.exports,(function(e){var i=t[s][1][e];return r(i||e)}),h,h.exports,e,t,i,n)}return i[s].exports}for(var O=void 0,s=0;s>>6,i[n++]=128|63&O):O<55296||O>57343?(i[n++]=224|O>>>12,i[n++]=128|O>>>6&63,i[n++]=128|63&O):(O=65536+(O-55296<<10|e.charCodeAt(s++)-56320),i[n++]=240|O>>>18,i[n++]=128|O>>>12&63,i[n++]=128|O>>>6&63,i[n++]=128|63&O);return n-t}function r(e,t,i){var n=this,r=0|t;i||(i=n.length);for(var O="",s=0;r=65536?(s-=65536,O+=String.fromCharCode(55296+(s>>>10),56320+(1023&s))):O+=String.fromCharCode(s));return O}function O(e,t,i,n){var r;i||(i=0),n||0===n||(n=this.length),t||(t=0);var O=n-i;if(e===this&&i=0;r--)e[r+t]=this[r+i];else for(r=0;rthis.buffer.length)throw new Error($);return this.offset=i,t}return{bufferish:f,write:e,fetch:a,flush:t,push:h,pull:c,read:l,reserve:i,offset:0}}function s(){function e(){var e=this.start;if(e1?this.bufferish.concat(e):e[0];return e.length=0,t}function n(e){var t=0|e;if(this.buffer){var i=this.buffer.length,n=0|this.offset,r=n+t;if(rthis.minBufferSize)this.flush(),this.push(e);else{var i=this.reserve(t);f.prototype.copy.call(e,this.buffer,i)}}return{bufferish:f,write:o,fetch:e,flush:t,push:h,pull:i,read:l,reserve:n,send:r,maxBufferSize:p,minBufferSize:d,offset:0,start:0}}function o(){throw new Error("method not implemented: write()")}function a(){throw new Error("method not implemented: fetch()")}function l(){return this.buffers&&this.buffers.length?(this.flush(),this.pull()):this.fetch()}function h(e){(this.buffers||(this.buffers=[])).push(e)}function c(){return(this.buffers||(this.buffers=[])).shift()}function u(e){function t(t){for(var i in e)t[i]=e[i];return t}return t}i.FlexDecoder=n,i.FlexEncoder=r;var f=e("./bufferish"),d=2048,p=65536,$="BUFFER_SHORTAGE";n.mixin=u(O()),n.mixin(n.prototype),r.mixin=u(s()),r.mixin(r.prototype)},{"./bufferish":8}],22:[function(e,t,i){function n(e){function t(e){var t=l(e),n=i[t];if(!n)throw new Error("Invalid type: "+(t?"0x"+t.toString(16):t));return n(e)}var i=h.getReadToken(e);return t}function r(){var e=this.options;return this.decode=n(e),e&&e.preset&&a.setExtUnpackers(this),this}function O(e,t){(this.extUnpackers||(this.extUnpackers=[]))[e]=c.filter(t)}function s(e){function t(t){return new o(t,e)}return(this.extUnpackers||(this.extUnpackers=[]))[e]||t}var o=e("./ext-buffer").ExtBuffer,a=e("./ext-unpacker"),l=e("./read-format").readUint8,h=e("./read-token"),c=e("./codec-base");c.install({addExtUnpacker:O,getExtUnpacker:s,init:r}),i.preset=r.call(c.preset)},{"./codec-base":9,"./ext-buffer":17,"./ext-unpacker":19,"./read-format":23,"./read-token":24}],23:[function(e,t,i){function n(e){var t=v.hasArrayBuffer&&e&&e.binarraybuffer,i=e&&e.int64;return{map:W&&e&&e.usemap?O:r,array:s,str:o,bin:t?l:a,ext:h,uint8:c,uint16:f,uint32:p,uint64:Q(8,i?P:m),int8:u,int16:d,int32:$,int64:Q(8,i?X:g),float32:Q(4,y),float64:Q(8,w)}}function r(e,t){var i,n={},r=new Array(t),O=new Array(t),s=e.codec.decode;for(i=0;i>>8,r[n]=i}}function l(e){return function(t,i){var n=t.reserve(5),r=t.buffer;r[n++]=e,r[n++]=i>>>24,r[n++]=i>>>16,r[n++]=i>>>8,r[n]=i}}function h(e,t,i,n){return function(r,O){var s=r.reserve(t+1);r.buffer[s++]=e,i.call(r.buffer,O,s,n)}}function c(e,t){new Q(this,t,e)}function u(e,t){new m(this,t,e)}function f(e,t){p.write(this,e,t,!1,23,4)}function d(e,t){p.write(this,e,t,!1,52,8)}var p=e("ieee754"),$=e("int64-buffer"),Q=$.Uint64BE,m=$.Int64BE,g=e("./write-uint8").uint8,P=e("./bufferish"),X=P.global,y=P.hasBuffer&&"TYPED_ARRAY_SUPPORT"in X&&!X.TYPED_ARRAY_SUPPORT,w=P.hasBuffer&&X.prototype||{};i.getWriteToken=n},{"./bufferish":8,"./write-uint8":28,ieee754:32,"int64-buffer":33}],27:[function(e,t,i){function n(e){function t(e,t){R[t?195:194](e,t)}function i(e,t){var i=0|t;return t!==i?void R[203](e,t):void R[-32<=i&&i<=127?255&i:0<=i?i<=255?204:i<=65535?205:206:-128<=i?208:-32768<=i?209:210](e,i)}function n(e,t){R[207](e,t.toArray())}function O(e,t){R[211](e,t.toArray())}function $(e){return e<32?1:e<=255?2:e<=65535?3:5}function Q(e){return e<32?1:e<=65535?3:5}function m(e){function t(t,i){var n=i.length,r=5+3*n;t.offset=t.reserve(r);var O=t.buffer,s=e(n),o=t.offset+s;n=l.write.call(O,i,o);var a=e(n);if(s!==a){var h=o+a-s,c=o+n;l.copy.call(O,O,h,o,c)}R[1===a?160+n:a<=3?215+a:219](t,n),t.offset+=n}return t}function g(e,t){if(null===t)return X(e,t);if(_(t))return V(e,t);if(r(t))return y(e,t);if(s.isUint64BE(t))return n(e,t);if(o.isInt64BE(t))return O(e,t);var i=e.codec.getExtPacker(t);return i&&(t=i(t)),t instanceof u?x(e,t):void q(e,t)}function P(e,t){return _(t)?v(e,t):void g(e,t)}function X(e,t){R[192](e,t)}function y(e,t){var i=t.length;R[i<16?144+i:i<=65535?220:221](e,i);for(var n=e.codec.encode,r=0;r=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function $(e){return+e!=e&&(e=0),s.alloc(+e)}function Q(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return E(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return L(e).length;default:if(n)return E(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return V(this,t,i);case"utf8":case"utf-8":return R(this,t,i);case"ascii":return T(this,t,i);case"latin1":case"binary":return _(this,t,i);case"base64":return v(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function P(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:X(e,t,i,n,r);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):X(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function X(e,t,i,n,r){function O(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var s,o=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,i/=2}if(r){var h=-1;for(s=i;sa&&(i=a-l),s=i;s>=0;s--){for(var c=!0,u=0;ur&&(n=r):n=r;var O=t.length;if(O%2!=0)throw new TypeError("Invalid hex string");n>O/2&&(n=O/2);for(var s=0;s239?4:l>223?3:l>191?2:1;if(r+c<=i)switch(c){case 1:l<128&&(h=l);break;case 2:128==(192&(O=e[r+1]))&&(a=(31&l)<<6|63&O)>127&&(h=a);break;case 3:O=e[r+1],s=e[r+2],128==(192&O)&&128==(192&s)&&(a=(15&l)<<12|(63&O)<<6|63&s)>2047&&(a<55296||a>57343)&&(h=a);break;case 4:O=e[r+1],s=e[r+2],o=e[r+3],128==(192&O)&&128==(192&s)&&128==(192&o)&&(a=(15&l)<<18|(63&O)<<12|(63&s)<<6|63&o)>65535&&a<1114112&&(h=a)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),r+=c}return W(n)}function W(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var i="",n=0;nn)&&(i=n);for(var r="",O=t;Oi)throw new RangeError("Trying to access beyond buffer length")}function Y(e,t,i,n,r,O){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function N(e,t,i,n){t<0&&(t=65535+t+1);for(var r=0,O=Math.min(e.length-i,2);r>>8*(n?r:1-r)}function Z(e,t,i,n){t<0&&(t=4294967295+t+1);for(var r=0,O=Math.min(e.length-i,4);r>>8*(n?r:3-r)&255}function z(e,t,i,n,r,O){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function C(e,t,i,n,r){return r||z(e,t,i,4,34028234663852886e22,-34028234663852886e22),H.write(e,t,i,n,23,4),i+4}function U(e,t,i,n,r){return r||z(e,t,i,8,17976931348623157e292,-17976931348623157e292),H.write(e,t,i,n,52,8),i+8}function G(e){if((e=I(e).replace(te,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function I(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function j(e){return e<16?"0"+e.toString(16):e.toString(16)}function E(e,t){t=t||1/0;for(var i,n=e.length,r=null,O=[],s=0;s55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&O.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&O.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&O.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&O.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;O.push(i)}else if(i<2048){if((t-=2)<0)break;O.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;O.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;O.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return O}function D(e){for(var t=[],i=0;i>8,r=i%256,O.push(r),O.push(n);return O}function L(e){return F.toByteArray(G(e))}function B(e,t,i,n){for(var r=0;r=t.length||r>=e.length);++r)t[r+i]=e[r];return r}function K(e){return e!=e}var F=e("base64-js"),H=e("ieee754"),J=e("isarray");n.Buffer=s,n.SlowBuffer=$,n.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),n.kMaxLength=r(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,i){return o(null,e,t,i)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,i){return l(null,e,t,i)},s.allocUnsafe=function(e){return h(null,e)},s.allocUnsafeSlow=function(e){return h(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,r=0,O=Math.min(i,n);r0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},s.prototype.compare=function(e,t,i,n,r){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var O=(r>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(O,o),l=this.slice(n,r),h=e.slice(t,i),c=0;cr)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var O=!1;;)switch(n){case"hex":return y(this,e,t,i);case"utf8":case"utf-8":return w(this,e,t,i);case"ascii":return b(this,e,t,i);case"latin1":case"binary":return x(this,e,t,i);case"base64":return S(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,i);default:if(O)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),O=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;s.prototype.slice=function(e,t){var i,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(r*=256);)n+=this[e+--t]*r;return n},s.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=this[e],r=1,O=0;++O=(r*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=t,r=1,O=this[e+--n];n>0&&(r*=256);)O+=this[e+--n]*r;return O>=(r*=128)&&(O-=Math.pow(2,8*t)),O},s.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},s.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},s.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),H.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),H.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),H.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),H.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,i,n){e=+e,t|=0,i|=0,n||Y(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,O=0;for(this[t]=255&e;++O=0&&(O*=256);)this[t+r]=e/O&255;return t+i},s.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||Y(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||Y(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||Y(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||Y(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Z(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||Y(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);Y(this,e,t,i,r-1,-r)}var O=0,s=1,o=0;for(this[t]=255&e;++O>0)-o&255;return t+i},s.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);Y(this,e,t,i,r-1,-r)}var O=i-1,s=1,o=0;for(this[t+O]=255&e;--O>=0&&(s*=256);)e<0&&0===o&&0!==this[t+O+1]&&(o=1),this[t+O]=(e/s>>0)-o&255;return t+i},s.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||Y(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||Y(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||Y(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||Y(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Z(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||Y(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,i){return C(this,e,t,!0,i)},s.prototype.writeFloatBE=function(e,t,i){return C(this,e,t,!1,i)},s.prototype.writeDoubleLE=function(e,t,i){return U(this,e,t,!0,i)},s.prototype.writeDoubleBE=function(e,t,i){return U(this,e,t,!1,i)},s.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--r)e[r+t]=this[r+i];else if(O<1e3||!s.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(O=t;O0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function r(e){return 3*e.length/4-n(e)}function O(e){var t,i,r,O,s,o,a=e.length;s=n(e),o=new c(3*a/4-s),r=s>0?a-4:a;var l=0;for(t=0,i=0;t>16&255,o[l++]=O>>8&255,o[l++]=255&O;return 2===s?(O=h[e.charCodeAt(t)]<<2|h[e.charCodeAt(t+1)]>>4,o[l++]=255&O):1===s&&(O=h[e.charCodeAt(t)]<<10|h[e.charCodeAt(t+1)]<<4|h[e.charCodeAt(t+2)]>>2,o[l++]=O>>8&255,o[l++]=255&O),o}function s(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function o(e,t,i){for(var n,r=[],O=t;Oh?h:a+s));return 1===n?(t=e[i-1],r+=l[t>>2],r+=l[t<<4&63],r+="=="):2===n&&(t=(e[i-2]<<8)+e[i-1],r+=l[t>>10],r+=l[t>>4&63],r+=l[t<<2&63],r+="="),O.push(r),O.join("")}i.byteLength=r,i.toByteArray=O,i.fromByteArray=a;for(var l=[],h=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=u.length;f>1,h=-7,c=i?r-1:0,u=i?-1:1,f=e[t+c];for(c+=u,O=f&(1<<-h)-1,f>>=-h,h+=o;h>0;O=256*O+e[t+c],c+=u,h-=8);for(s=O&(1<<-h)-1,O>>=-h,h+=n;h>0;s=256*s+e[t+c],c+=u,h-=8);if(0===O)O=1-l;else{if(O===a)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),O-=l}return(f?-1:1)*s*Math.pow(2,O-n)},i.write=function(e,t,i,n,r,O){var s,o,a,l=8*O-r-1,h=(1<>1,u=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:O-1,d=n?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-s))<1&&(s--,a*=2),(t+=s+c>=1?u/a:u*Math.pow(2,1-c))*a>=2&&(s++,a/=2),s+c>=h?(o=0,s=h):s+c>=1?(o=(t*a-1)*Math.pow(2,r),s+=c):(o=t*Math.pow(2,c-1)*Math.pow(2,r),s=0));r>=8;e[i+f]=255&o,f+=d,o/=256,r-=8);for(s=s<0;e[i+f]=255&s,f+=d,s/=256,l-=8);e[i+f-d]|=128*p}},{}],33:[function(e,t,i){(function(e){!function(t){function i(e,i,f){function P(e,t,i,n){return this instanceof P?b(this,e,t,i,n):new P(e,t,i,n)}function w(e){return!(!e||!e[C])}function b(e,t,i,n,r){Q&&m&&(t instanceof m&&(t=new Q(t)),n instanceof m&&(n=new Q(n))),t||i||n||d?(s(t,i)||(r=i,n=t,i=0,t=new(d||Array)(8)),e.buffer=t,e.offset=i|=0,p!==typeof n&&("string"==typeof n?x(t,i,n,r||10):s(n,r)?o(t,i,n,r):"number"==typeof r?(v(t,i+W,n),v(t,i+T,r)):n>0?Y(t,i,n):n<0?N(t,i,n):o(t,i,g,0))):e.buffer=a(g,0)}function x(e,t,i,n){var r=0,O=i.length,s=0,o=0;"-"===i[0]&&r++;for(var a=r;r=0))break;o=o*n+l,s=s*n+Math.floor(o/X),o%=X}a&&(s=~s,o?o=X-o:s++),v(e,t+W,s),v(e,t+T,o)}function S(){var e=this.buffer,t=this.offset,i=R(e,t+W),n=R(e,t+T);return f||(i|=0),i?i*X+n:n}function k(e){var t=this.buffer,i=this.offset,n=R(t,i+W),r=R(t,i+T),O="",s=!f&&2147483648&n;for(s&&(n=~n,r=X-r),e=e||10;;){var o=n%e*X+r;if(n=Math.floor(n/e),r=Math.floor(o/e),O=(o%e).toString(e)+O,!n&&!r)break}return s&&(O="-"+O),O}function v(e,t,i){e[t+A]=255&i,i>>=8,e[t+q]=255&i,i>>=8,e[t+V]=255&i,i>>=8,e[t+_]=255&i}function R(e,t){return e[t+_]*y+(e[t+V]<<16)+(e[t+q]<<8)+e[t+A]}var W=i?0:4,T=i?4:0,_=i?0:3,V=i?1:2,q=i?2:1,A=i?3:0,Y=i?l:c,N=i?h:u,Z=P.prototype,z="is"+e,C="_"+z;return Z.buffer=void 0,Z.offset=0,Z[C]=!0,Z.toNumber=S,Z.toString=k,Z.toJSON=S,Z.toArray=n,$&&(Z.toBuffer=r),Q&&(Z.toArrayBuffer=O),P[z]=w,t[e]=P,P}function n(e){var t=this.buffer,i=this.offset;return d=null,!1!==e&&0===i&&8===t.length&&P(t)?t:a(t,i)}function r(t){var i=this.buffer,n=this.offset;if(d=$,!1!==t&&0===n&&8===i.length&&e.isBuffer(i))return i;var r=new $(8);return o(r,0,i,n),r}function O(e){var t=this.buffer,i=this.offset,n=t.buffer;if(d=Q,!1!==e&&0===i&&n instanceof m&&8===n.byteLength)return n;var r=new Q(8);return o(r,0,t,i),r.buffer}function s(e,t){var i=e&&e.length;return t|=0,i&&t+8<=i&&"string"!=typeof e[t]}function o(e,t,i,n){t|=0,n|=0;for(var r=0;r<8;r++)e[t++]=255&i[n++]}function a(e,t){return Array.prototype.slice.call(e,t,t+8)}function l(e,t,i){for(var n=t+8;n>t;)e[--n]=255&i,i/=256}function h(e,t,i){var n=t+8;for(i++;n>t;)e[--n]=255&-i^255,i/=256}function c(e,t,i){for(var n=t+8;t{e.onload=()=>{t(e.result)},e.onerror=t=>{e.abort(),i(t)}}));return e.readAsText(this),t}),null==Blob.prototype.arrayBuffer&&(Blob.prototype.arrayBuffer=function(){return new Response(this).arrayBuffer()}),i.polyfill()})),r.register("dM7tv",(function(t,i){e(t.exports,"polyfill",(()=>r("duQYe").polyfill)),r("duQYe")})),r.register("duQYe",(function(t,i){e(t.exports,"polyfill",(()=>j));var n=e=>void 0===e||"auto"===e||"instant"===e||"smooth"===e;function r(e,t){this.scrollLeft=e,this.scrollTop=t}var O=(e,t,i="cannot convert to dictionary.")=>`Failed to execute '${e}' on '${t}': ${i}`,s=(e,t,i)=>O(e,t,`The provided value '${i}' is not a valid enum value of type ScrollBehavior.`),o=(e,t,i)=>{var n;let r=`__SEAMLESS.BACKUP$${t}`;return!e[r]&&e[t]&&!(null!==(n=e[t])&&void 0!==n&&n.__isPolyfill)&&(e[r]=e[t]),e[r]||i},a=e=>{let t=typeof e;return null!==e&&("object"===t||"function"===t)},l=()=>"scrollBehavior"in window.document.documentElement.style,h=e=>{Object.defineProperty(e,"__isPolyfill",{value:!0})},c=(e,t)=>{h(t),[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach((i=>{o(i,e),i[e]=t}))},u=e=>e.ownerDocument.scrollingElement||e.ownerDocument.documentElement,f=e=>.5*(1-Math.cos(Math.PI*e));function d(){var e;let t;return t=null!==(e=window.performance)&&void 0!==e&&e.now?()=>window.performance.now():()=>window.Date.now(),d=t,t()}var p=e=>{let t=(d()-e.timeStamp)/(e.duration||500);if(t>1)return e.method(e.targetX,e.targetY),void e.callback();let i=(e.timingFunc||f)(t),n=e.startX+(e.targetX-e.startX)*i,r=e.startY+(e.targetY-e.startY)*i;e.method(n,r),e.rafId=window.requestAnimationFrame((()=>{p(e)}))},$=e=>isFinite(e)?Number(e):0,Q=e=>(t,i,l)=>{let[h,c]=(e=>e.window===e)(t)?[u(t.document.documentElement),"Window"]:[t,"Element"],f=null!=i?i:{};if(!a(f))throw new TypeError(O(e,c));if(!n(f.behavior))throw new TypeError(s(e,c,f.behavior));"scrollBy"===e&&(f.left=$(f.left)+h.scrollLeft,f.top=$(f.top)+h.scrollTop),((e,t,i)=>{var n,O;if(!(e=>{var t;return null!==(t=e.isConnected)&&void 0!==t?t:!(e.ownerDocument&&1&e.ownerDocument.compareDocumentPosition(e))})(e))return;let s=e.scrollLeft,a=e.scrollTop,l=$(null!==(n=t.left)&&void 0!==n?n:s),h=$(null!==(O=t.top)&&void 0!==O?O:a);if(l===s&&h===a)return;let c=o(HTMLElement.prototype,"scroll",r),u=o(Object.getPrototypeOf(e),"scroll",c).bind(e);if("smooth"!==t.behavior)return void u(l,h);let f=()=>{window.removeEventListener("wheel",m),window.removeEventListener("touchmove",m)},Q=Object.assign(Object.assign({},i),{timeStamp:d(),startX:s,startY:a,targetX:l,targetY:h,rafId:0,method:u,callback:f}),m=()=>{window.cancelAnimationFrame(Q.rafId),f()};window.addEventListener("wheel",m,{passive:!0,once:!0}),window.addEventListener("touchmove",m,{passive:!0,once:!0}),p(Q)})(h,f,l)},m=Q("scroll"),g=Q("scrollTo"),P=Q("scrollBy"),X=m,y=(e,t)=>i=>{if(l())return;let n={scroll:m,scrollTo:g,scrollBy:P}[e];t(e,(function(){let e=arguments;if(1===arguments.length)return void n(this,e[0],i);let t=e[0],r=e[1];n(this,{left:t,top:r})}))},w=y("scroll",c),b=y("scrollTo",c),x=y("scrollBy",c),S=(e,t)=>{h(t),o(window,e),window[e]=t},k=y("scroll",S),v=y("scrollTo",S),R=y("scrollBy",S),W=e=>{switch(e){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":return 0;case"vertical-rl":case"tb":case"tb-rl":return 1;case"vertical-lr":case"tb-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4}return 0},T=(e,t,i,n)=>{let r=0;switch(t||(r^=2),e){case 0:r=r>>1|(1&r)<<1,[i,n]=[n,i];break;case 1:case 3:r^=1;break;case 4:r^=2}return[r,i,n]},_=e=>1==(1&T(W(e.writingMode),"rtl"!==e.direction,void 0,void 0)[0]),V=(e,t,i,n,r,O,s)=>0!==e?e:ri||r>t&&O=i&&s>=n?2:O>i&&sn?3:null,q=e=>"visible"!==e&&"clip"!==e,A=(e,t)=>(e.clientHeight{let t=e.parentNode,i=e.parentElement;if(null===i&&null!==t){if(11===t.nodeType)return t.host;if(9===t.nodeType)return(e=>{var t;try{return(null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.frameElement)||null}catch(e){return null}})(e)}return i},N=(e,t,i)=>ei?i:e,Z=(e,t,i)=>{switch(e){case 1:return(t+i)/2;case 3:return i;case 2:case 0:return t}},z=(e,t)=>{var i,n,r;let O=null===(i=e.ownerDocument.defaultView)||void 0===i?void 0:i.visualViewport,[s,o,a,l]=e===u(e)?[0,0,null!==(n=null==O?void 0:O.width)&&void 0!==n?n:e.clientWidth,null!==(r=null==O?void 0:O.height)&&void 0!==r?r:e.clientHeight]:[t.left,t.top,e.clientWidth,e.clientHeight],h=s+e.clientLeft,c=o+e.clientTop;return[c,h+a,c+l,h]},C=(e,t)=>{let i=[],n=e.ownerDocument,r=n.defaultView;if(!r)return i;let O=window.getComputedStyle(e),s="rtl"!==O.direction,o=W(O.writingMode||O.getPropertyValue("-webkit-writing-mode")||O.getPropertyValue("-ms-writing-mode")),[a,l]=((e,t,i)=>{let[n,r,O]=T(t,i,e.block||"start",e.inline||"nearest");return[r,O].map(((e,t)=>{switch(e){case"center":return 1;case"nearest":return 0;default:return"start"===e==!(n>>t&1)?2:3}}))})(t,o,s),[h,c,u,f]=((e,t,i)=>{let{top:n,right:r,bottom:O,left:s}=t,o=(e=>["scroll-margin","scroll-snap-margin"].filter((t=>t in e.documentElement.style))[0])(e.ownerDocument);if(!o)return[n,r,O,s];let a=e=>{let t=i.getPropertyValue(`${o}-${e}`);return parseInt(t,10)||0};return[n-a("top"),r+a("right"),O+a("bottom"),s-a("left")]})(e,e.getBoundingClientRect(),O);for(let O=Y(e);null!==O;O=Y(O)){if(n!==O.ownerDocument){if(n=O.ownerDocument,r=n.defaultView,!r)break;let{left:e,top:t}=O.getBoundingClientRect();h+=t,c+=e,u+=t,f+=e}let e=r.getComputedStyle(O);if("fixed"===e.position)break;if(!A(O,e))continue;let s=O.getBoundingClientRect(),[o,d,p,$]=z(O,s),Q=V(a,$,d,O.clientWidth,f,c,c-f),m=V(l,o,p,O.clientHeight,h,u,u-h),g=null===Q?0:Z(Q,f,c)-Z(Q,$,d),P=null===m?0:Z(m,h,u)-Z(m,o,p),X=_(e)?N(g,-O.scrollWidth+O.clientWidth-O.scrollLeft,-O.scrollLeft):N(g,-O.scrollLeft,O.scrollWidth-O.clientWidth-O.scrollLeft),y=N(P,-O.scrollTop,O.scrollHeight-O.clientHeight-O.scrollTop);i.push([O,{left:O.scrollLeft+X,top:O.scrollTop+y,behavior:t.behavior}]),h=Math.max(h-y,o),c=Math.min(c-X,d),u=Math.min(u-y,p),f=Math.max(f-X,$)}return i},U=(e,t,i)=>{let r=t||{};if(!n(r.behavior))throw new TypeError(s("scrollIntoView","Element",r.behavior));C(e,r).forEach((([e,t])=>{X(e,t,i)}))};function G(e){U(this,{block:null==e||e?"start":"end",inline:"nearest"})}var I=e=>{if(l())return;let t=o(window.HTMLElement.prototype,"scrollIntoView",G);c("scrollIntoView",(function(){let i=arguments,n=i[0];1===i.length&&a(n)?U(this,n,e):t.apply(this,i)}))},j=e=>{l()||(w(e),b(e),x(e),I(e),k(e),v(e),R(e))}})),r.register("cu5N4",(function(e,t){})),r.register("gZ62d",(function(t,i){e(t.exports,"is_mac_keyboard",(()=>n)),e(t.exports,"ctrl_or_cmd_name",(()=>r)),e(t.exports,"has_ctrl_or_cmd_pressed",(()=>O)),e(t.exports,"in_textarea_or_input",(()=>s));let n=/Mac/.test(navigator.platform),r=n?"Cmd":"Ctrl",O=e=>e.ctrlKey||n&&e.metaKey,s=()=>{const e=null!=document.activeElement.closest("footer"),t=null!=document.activeElement.closest("header"),i=null!=document.activeElement.closest(".cm-editor"),{tagName:n}=document.activeElement;return"INPUT"===n||"TEXTAREA"===n||e||t||i}})),r.register("85ulz",(function(t,i){e(t.exports,"FilePicker",(()=>f));var n=r("fBBKY"),O=r("29nid"),s=r("8qR4G");r("gZ62d"),r("61LLQ");var o=r("9i4md");let{autocompletion:a,completionKeymap:l}=o.autocomplete,h=l.find((e=>"Ctrl-Space"===e.key)),c=l.find((e=>"Enter"===e.key)),u=l.find((e=>"Escape"===e.key));class f extends O.Component{constructor(e){super(e),this.state={is_button_disabled:!0},this.forced_value="",this.cm=null,this.suggest_not_tmp=()=>{const e=this.props.suggest_new_file;null!=e&&0===this.cm.state.doc.length&&(this.cm.dispatch({changes:{from:0,to:this.cm.state.doc.length,insert:e.base},selection:o.EditorSelection.cursor(e.base.length)}),this.request_path_completions()),window.dispatchEvent(new CustomEvent("collapse_cell_selection",{}))};this.on_submit=()=>this.cm.state.doc.toString()===this.forced_value?(this.suggest_not_tmp(),!0):((async e=>{await e()})((async()=>{try{await this.props.on_submit(this.cm.state.doc.toString()),this.cm.dom.blur()}catch(e){this.cm.dispatch({changes:{from:0,to:this.cm.state.doc.length,insert:this.props.value},selection:o.EditorSelection.cursor(this.props.value.length)})}})),!0)}componentDidUpdate(){this.forced_value!=this.props.value&&(this.cm.dispatch({changes:{from:0,to:this.cm.state.doc.length,insert:this.props.value},selection:o.EditorSelection.cursor(this.props.value.length)}),this.forced_value=this.props.value,this.cm.scrollDOM.scrollLeft=1e5,setTimeout((()=>{this.cm.scrollDOM.scrollLeft=1e5}),100))}componentDidMount(){const e=window.matchMedia("(prefers-color-scheme: dark)").matches;this.cm=new o.EditorView({state:o.EditorState.create({doc:"",extensions:[o.drawSelection(),o.EditorView.domEventHandlers({focus:(e,t)=>(setTimeout((()=>{this.props.suggest_new_file?this.suggest_not_tmp():0===t.state.doc.length&&this.request_path_completions()}),0),!0),blur:(e,t)=>{setTimeout((()=>{t.hasFocus||(t.dispatch({changes:{from:0,to:t.state.doc.length,insert:this.props.value},selection:o.EditorSelection.cursor(this.props.value.length)}),t.scrollPosIntoView(this.props.value.length),setTimeout((()=>{this.cm.scrollPosIntoView(this.props.value.length)}),100))}),200)}}),o.EditorView.updateListener.of((e=>{e.docChanged&&this.setState({is_button_disabled:0===e.state.doc.length})})),o.EditorView.theme({"&":{fontSize:"inherit"},".cm-scroller":{fontFamily:"inherit",overflowY:"hidden",overflowX:"auto"}},{dark:e}),o.history(),a({activateOnTyping:!0,override:[d({suggest_new_file:this.props.suggest_new_file,client:this.props.client})],defaultKeymap:!1,maxRenderedOptions:512,optionClass:e=>e.type}),o.EditorView.updateListener.of((e=>{e.transactions.forEach((t=>{null!=t.annotation(o.autocomplete.pickedCompletion)&&(e.view.scrollPosIntoView(e.state.doc.length),this.request_path_completions())}))})),o.keymap.of([{key:"Enter",run:e=>c.run(e)},{key:"Enter",run:this.on_submit},{key:"Ctrl-Enter",mac:"Cmd-Enter",run:this.on_submit},{key:"Ctrl-Shift-Enter",mac:"Cmd-Shift-Enter",run:this.on_submit},{key:"Escape",run:e=>(u.run(e),e.dispatch({changes:{from:0,to:e.state.doc.length,insert:this.props.value},selection:o.EditorSelection.cursor(this.props.value.length)}),document.activeElement.blur(),!0),preventDefault:!0},{key:"Tab",run:e=>c.run(e)?(this.request_path_completions(),!0):this.request_path_completions()}]),o.keymap.of(l),o.placeholder(this.props.placeholder)]})}),this.base.insertBefore(this.cm.dom,this.base.firstElementChild)}render(){return n.html` + + + + `}request_path_completions(){let e=this.cm.state.selection.main;if(e.from===e.to&&this.cm.state.doc.length===e.to)return h.run(this.cm)}}const d=({client:e,suggest_new_file:t})=>i=>{i.state.selection.main.to;const n=i.state.doc.toString();return e.send("completepath",{query:n}).then((e=>{const i=n.split("/").pop().split("\\").pop(),r=e.message.results,O=s.utf8index_to_ut16index(n,e.message.start),o=s.utf8index_to_ut16index(n,e.message.stop);if(r.length>=1&&r[0]==i)return null;let a=r.map((e=>{let t=e.endsWith("/")||e.endsWith("\\");return{label:e,type:t?"dir":"file",boost:t?1:0}}));if(null!=t)for(let e=3;e>=0;e--){const t=".jl".substring(0,e);if(i.endsWith(t)){let t=i+".jl".substring(e);if(".jl"==t&&(t="notebook.jl"),3==e)return null;r.includes(t)||a.push({label:t+" (new)",apply:t,type:"file new",boost:-99});break}}return{options:a,from:O,to:o}}))}})),r.register("8qR4G",(function(t,i){e(t.exports,"utf8index_to_ut16index",(()=>O)),e(t.exports,"slice_utf8",(()=>s));const n=new TextEncoder,r=new TextDecoder,O=(e,t)=>r.decode(n.encode(e).slice(0,t)).length,s=(e,t,i)=>{const O=n.encode(e);return r.decode(O.slice(t,i))};console.assert("e é hannes ❤ is a dog"===((e,t,i,O)=>{const s=n.encode(e),o=n.encode(O),a=new Uint8Array(s.length+o.length-(i-t));return a.set(s.slice(0,t),0),a.set(o,t),a.set(s.slice(i),t+o.length),r.decode(a)})("e é 🐶 is a dog",5,9,"hannes ❤")),console.assert("🐶"===s("e é 🐶 is a dog",5,9))})),r.register("61LLQ",(function(t,i){e(t.exports,"EditorState",(()=>r("9i4md").EditorState)),e(t.exports,"EditorSelection",(()=>r("9i4md").EditorSelection)),e(t.exports,"Compartment",(()=>r("9i4md").Compartment)),e(t.exports,"EditorView",(()=>r("9i4md").EditorView)),e(t.exports,"placeholder",(()=>r("9i4md").placeholder)),e(t.exports,"julia_andrey",(()=>r("9i4md").julia_andrey)),e(t.exports,"keymap",(()=>r("9i4md").keymap)),e(t.exports,"history",(()=>r("9i4md").history)),e(t.exports,"historyKeymap",(()=>r("9i4md").historyKeymap)),e(t.exports,"defaultKeymap",(()=>r("9i4md").defaultKeymap)),e(t.exports,"indentMore",(()=>r("9i4md").indentMore)),e(t.exports,"indentLess",(()=>r("9i4md").indentLess)),e(t.exports,"tags",(()=>r("9i4md").tags)),e(t.exports,"HighlightStyle",(()=>r("9i4md").HighlightStyle)),e(t.exports,"lineNumbers",(()=>r("9i4md").lineNumbers)),e(t.exports,"highlightSpecialChars",(()=>r("9i4md").highlightSpecialChars)),e(t.exports,"drawSelection",(()=>r("9i4md").drawSelection)),e(t.exports,"indentOnInput",(()=>r("9i4md").indentOnInput)),e(t.exports,"defaultHighlightStyle",(()=>r("9i4md").defaultHighlightStyle)),e(t.exports,"closeBrackets",(()=>r("9i4md").closeBrackets)),e(t.exports,"rectangularSelection",(()=>r("9i4md").rectangularSelection)),e(t.exports,"highlightSelectionMatches",(()=>r("9i4md").highlightSelectionMatches)),e(t.exports,"closeBracketsKeymap",(()=>r("9i4md").closeBracketsKeymap)),e(t.exports,"foldKeymap",(()=>r("9i4md").foldKeymap)),e(t.exports,"syntaxTree",(()=>r("9i4md").syntaxTree)),e(t.exports,"syntaxTreeAvailable",(()=>r("9i4md").syntaxTreeAvailable)),e(t.exports,"Decoration",(()=>r("9i4md").Decoration)),e(t.exports,"ViewPlugin",(()=>r("9i4md").ViewPlugin)),e(t.exports,"WidgetType",(()=>r("9i4md").WidgetType)),e(t.exports,"Facet",(()=>r("9i4md").Facet)),e(t.exports,"StateField",(()=>r("9i4md").StateField)),e(t.exports,"StateEffect",(()=>r("9i4md").StateEffect)),e(t.exports,"indentUnit",(()=>r("9i4md").indentUnit)),e(t.exports,"combineConfig",(()=>r("9i4md").combineConfig)),e(t.exports,"autocomplete",(()=>r("9i4md").autocomplete)),e(t.exports,"html",(()=>r("9i4md").html)),e(t.exports,"htmlLanguage",(()=>r("9i4md").htmlLanguage)),e(t.exports,"javascriptLanguage",(()=>r("9i4md").javascriptLanguage)),e(t.exports,"markdown",(()=>r("9i4md").markdown)),e(t.exports,"markdownLanguage",(()=>r("9i4md").markdownLanguage)),e(t.exports,"parseCode",(()=>r("9i4md").parseCode)),e(t.exports,"parseMixed",(()=>r("9i4md").parseMixed)),e(t.exports,"PostgreSQL",(()=>r("9i4md").PostgreSQL)),e(t.exports,"pythonLanguage",(()=>r("9i4md").pythonLanguage)),e(t.exports,"sql",(()=>r("9i4md").sql)),e(t.exports,"javascript",(()=>r("9i4md").javascript)),e(t.exports,"python",(()=>r("9i4md").python)),e(t.exports,"Text",(()=>r("9i4md").Text));r("9i4md")})),r.register("9i4md",(function(t,i){e(t.exports,"Text",(()=>m)),e(t.exports,"EditorSelection",(()=>z)),e(t.exports,"Facet",(()=>I)),e(t.exports,"StateField",(()=>B)),e(t.exports,"Compartment",(()=>re)),e(t.exports,"StateEffect",(()=>ge)),e(t.exports,"EditorState",(()=>Te)),e(t.exports,"combineConfig",(()=>_e)),e(t.exports,"parseMixed",(()=>ot)),e(t.exports,"WidgetType",(()=>Bi)),e(t.exports,"Decoration",(()=>Fi)),e(t.exports,"ViewPlugin",(()=>Sn)),e(t.exports,"EditorView",(()=>bO)),e(t.exports,"keymap",(()=>VO)),e(t.exports,"drawSelection",(()=>CO)),e(t.exports,"highlightSpecialChars",(()=>is)),e(t.exports,"placeholder",(()=>os)),e(t.exports,"syntaxTree",(()=>ds)),e(t.exports,"syntaxTreeAvailable",(()=>ps)),e(t.exports,"indentUnit",(()=>vs)),e(t.exports,"indentOnInput",(()=>Gs)),e(t.exports,"HighlightStyle",(()=>Oo)),e(t.exports,"tags",(()=>ko)),e(t.exports,"defaultHighlightStyle",(()=>vo)),e(t.exports,"autocomplete",(()=>Gh)),e(t.exports,"julia_andrey",(()=>Kh)),e(t.exports,"lineNumbers",(()=>dc)),e(t.exports,"history",(()=>Xc)),e(t.exports,"historyKeymap",(()=>Nc)),e(t.exports,"indentMore",(()=>Uu)),e(t.exports,"indentLess",(()=>Gu)),e(t.exports,"defaultKeymap",(()=>Eu)),e(t.exports,"rectangularSelection",(()=>Lu)),e(t.exports,"foldKeymap",(()=>Of)),e(t.exports,"closeBrackets",(()=>$f)),e(t.exports,"closeBracketsKeymap",(()=>Xf)),e(t.exports,"highlightSelectionMatches",(()=>Bf)),e(t.exports,"parseCode",(()=>Up)),e(t.exports,"javascriptLanguage",(()=>eQ)),e(t.exports,"javascript",(()=>rQ)),e(t.exports,"htmlLanguage",(()=>yQ)),e(t.exports,"html",(()=>bQ)),e(t.exports,"markdownLanguage",(()=>WQ)),e(t.exports,"markdown",(()=>zQ)),e(t.exports,"sql",(()=>um)),e(t.exports,"PostgreSQL",(()=>dm)),e(t.exports,"pythonLanguage",(()=>bm)),e(t.exports,"python",(()=>xm));var n=r("cu5N4");let O="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let e=1;ee)return O[t-1]<=e;return!1}function o(e){return e>=127462&&e<=127487}function a(e,t,i=!0,n=!0){return(i?l:h)(e,t,n)}function l(e,t,i){if(t==e.length)return t;t&&c(e.charCodeAt(t))&&u(e.charCodeAt(t-1))&&t--;let n=f(e,t);for(t+=p(n);t=0&&o(f(e,n));)i++,n-=2;if(i%2==0)break;t+=2}}}return t}function h(e,t,i){for(;t>0;){let n=l(e,t-2,i);if(n=56320&&e<57344}function u(e){return e>=55296&&e<56320}function f(e,t){let i=e.charCodeAt(t);if(!u(i)||t+1==e.length)return i;let n=e.charCodeAt(t+1);return c(n)?n-56320+(i-55296<<10)+65536:i}function d(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function p(e){return e<65536?1:2}function $(e,t,i=e.length){let n=0;for(let r=0;r=t)return n;if(n==e.length)break;r+=9==e.charCodeAt(n)?i-r%i:1,n=a(e,n)}return!0===n?-1:e.length}class m{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),P.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),P.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),n=new w(this),r=new w(e);for(let e=t,O=t;;){if(n.next(e),r.next(e),e=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(O+=n.value.length,n.done||O>=i)return!0}}iter(e=1){return new w(this,e)}iterRange(e,t=this.length){return new b(this,e,t)}iterLines(e,t){let i;if(null==e)i=this.iter();else{null==t&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new x(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new g(e):P.from(g.split(e,[])):m.empty}}class g extends m{constructor(e,t=function(e){let t=-1;for(let i of e)t+=i.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let r=0;;r++){let O=this.text[r],s=n+O.length;if((t?i:s)>=e)return new S(n,s,i,O);n=s+1,i++}}decompose(e,t,i,n){let r=e<=0&&t>=this.length?this:new g(y(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&n){let e=i.pop(),t=X(r.text,e.text.slice(),0,r.length);if(t.length<=32)i.push(new g(t,e.length+r.length));else{let e=t.length>>1;i.push(new g(t.slice(0,e)),new g(t.slice(e)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof g))return super.replace(e,t,i);let n=X(this.text,X(i.text,y(this.text,0,e)),t),r=this.length+i.length-(t-e);return n.length<=32?new g(n,r):P.from(g.split(n,[]),r)}sliceString(e,t=this.length,i="\n"){let n="";for(let r=0,O=0;r<=t&&Oe&&O&&(n+=i),er&&(n+=s.slice(Math.max(0,e-r),t-r)),r=o+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let r of e)i.push(r),n+=r.length+1,32==i.length&&(t.push(new g(i,n)),i=[],n=-1);return n>-1&&t.push(new g(i,n)),t}}class P extends m{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,i,n){for(let r=0;;r++){let O=this.children[r],s=n+O.length,o=i+O.lines-1;if((t?o:s)>=e)return O.lineInner(e,t,i,n);n=s+1,i=o+1}}decompose(e,t,i,n){for(let r=0,O=0;O<=t&&r=O){let r=n&((O<=e?1:0)|(o>=t?2:0));O>=e&&o<=t&&!r?i.push(s):s.decompose(e-O,t-O,i,r)}O=o+1}}replace(e,t,i){if(i.lines=r&&t<=s){let o=O.replace(e-r,t-r,i),a=this.lines-O.lines+o.lines;if(o.lines>4&&o.lines>a>>6){let r=this.children.slice();return r[n]=o,new P(r,this.length-(t-e)+i.length)}return super.replace(r,s,o)}r=s+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i="\n"){let n="";for(let r=0,O=0;re&&r&&(n+=i),eO&&(n+=s.sliceString(e-O,t-O,i)),O=o+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof P))return 0;let i=0,[n,r,O,s]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,r+=t){if(n==O||r==s)return i;let o=this.children[n],a=e.children[r];if(o!=a)return i+o.scanIdentical(a,t);i+=o.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let i=0;for(let t of e)i+=t.lines;if(i<32){let i=[];for(let t of e)t.flatten(i);return new g(i,t)}let n=Math.max(32,i>>5),r=n<<1,O=n>>1,s=[],o=0,a=-1,l=[];function h(e){let t;if(e.lines>r&&e instanceof P)for(let t of e.children)h(t);else e.lines>O&&(o>O||!o)?(c(),s.push(e)):e instanceof g&&o&&(t=l[l.length-1])instanceof g&&e.lines+t.lines<=32?(o+=e.lines,a+=e.length+1,l[l.length-1]=new g(t.text.concat(e.text),t.length+1+e.length)):(o+e.lines>n&&c(),o+=e.lines,a+=e.length+1,l.push(e))}function c(){0!=o&&(s.push(1==l.length?l[0]:P.from(l,a)),a=-1,o=l.length=0)}for(let t of e)h(t);return c(),1==s.length?s[0]:new P(s,t)}}function X(e,t,i=0,n=1e9){for(let r=0,O=0,s=!0;O=i&&(a>n&&(o=o.slice(0,n-r)),r0?1:(e instanceof g?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],O=r>>1,s=n instanceof g?n.text.length:n.children.length;if(O==(t>0?s:0)){if(0==i)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[i]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(n instanceof g){let r=n.text[O+(t<0?-1:0)];if(this.offsets[i]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=n.children[O+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof g?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class b{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new w(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class x{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(m.prototype[Symbol.iterator]=function(){return this.iter()},w.prototype[Symbol.iterator]=b.prototype[Symbol.iterator]=x.prototype[Symbol.iterator]=function(){return this});class S{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}}const k=/\r\n?|\n/;var v,R=((v=R||(R={}))[v.Simple=0]="Simple",v[v.TrackDel=1]="TrackDel",v[v.TrackBefore=2]="TrackBefore",v[v.TrackAfter=3]="TrackAfter",v);class W{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-n);r+=s}else{if(i!=R.Simple&&a>=e&&(i==R.TrackDel&&ne||i==R.TrackBefore&&ne))return null;if(a>e||a==e&&t<0&&!s)return e==n||t<0?r:r+o;r+=o}n=a}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return r}touchesRange(e,t=e){for(let i=0,n=0;i=0&&n<=t&&r>=e)return!(nt)||"cover";n=r}return!1}toString(){let e="";for(let t=0;t=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new W(e)}}class T extends W{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return q(this,((t,i,n,r,O)=>e=e.replace(n,n+(i-t),O)),!1),e}mapDesc(e,t=!1){return A(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let n=0,r=0;n=0){t[n]=s,t[n+1]=O;let o=n>>1;for(;i.length0&&V(i,t,r.text),r.forward(e),s+=e}let a=e[O++];for(;s>1].toJSON()))}return e}static of(e,t,i){let n=[],r=[],O=0,s=null;function o(e=!1){if(!e&&!n.length)return;Os||e<0||s>t)throw new RangeError(`Invalid change range ${e} to ${s} (in doc of length ${t})`);let h=l?"string"==typeof l?m.of(l.split(i||k)):l:m.empty,c=h.length;if(e==s&&0==c)return;eO&&_(n,e-O,-1),_(n,s-e,c),V(r,n,h),O=s}}(e),o(!s),s}static empty(e){return new T(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let n=0;nt&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;i.length=0&&i<=0&&i==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=i:n?(e[r]+=t,e[r+1]+=i):e.push(t,i)}function V(e,t,i){if(0==i.length)return;let n=t.length-2>>1;if(n>1])),!(i||s==e.sections.length||e.sections[s+1]<0);)o=e.sections[s++],a=e.sections[s++];t(r,l,O,h,c),r=l,O=h}}}function A(e,t,i,n=!1){let r=[],O=n?[]:null,s=new N(e),o=new N(t);for(let e=0,t=0;;)if(-1==s.ins)e+=s.len,s.next();else if(-1==o.ins&&t=0&&(s.done||tt&&!s.done&&e+s.len=0)){if(s.done&&o.done)return O?new T(r,O):new W(r);throw new Error("Mismatched change set lengths")}{let i=0,n=e+s.len;for(;;)if(o.ins>=0&&t>e&&t+o.lent||s.ins>=0&&s.len>t)&&(e||n.length>i),O.forward2(t),s.forward(t)}}else _(n,0,s.ins,e),r&&V(r,n,s.text),s.next()}}class N{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?m.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?m.empty:t[i].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Z{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){let e=3&this.flags;return 3==e?null:e}get goalColumn(){let e=this.flags>>5;return 33554431==e?void 0:e}map(e,t=-1){let i,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new Z(i,n,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return z.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return z.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return z.range(e.anchor,e.head)}}class z{constructor(e,t=0){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:z.create(this.ranges.map((i=>i.map(e,t))),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new z(e.ranges.map((e=>Z.fromJSON(e))),e.main)}static single(e,t=e){return new z([z.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;ne?4:0))}}function C(e,t=0){let i=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(i);for(let i=1;in.head?z.range(s,O):z.range(O,s))}}return new z(e,t)}function U(e,t){for(let i of e.ranges)if(i.to>t)throw new RangeError("Selection points outside of document")}let G=0;class I{constructor(e,t,i,n,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.extensions=r,this.id=G++,this.default=e([])}static define(e={}){return new I(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:j),!!e.static,e.enables)}of(e){return new E([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new E(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new E(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(i=>t(i.field(e))))}}function j(e,t){return e==t||e.length==t.length&&e.every(((e,i)=>e===t[i]))}class E{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=G++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,r=this.id,O=e[r]>>1,s=2==this.type,o=!1,a=!1,l=[];for(let i of this.dependencies)"doc"==i?o=!0:"selection"==i?a=!0:0==(1&(null!==(t=e[i.id])&&void 0!==t?t:1))&&l.push(e[i.id]);return{create:e=>(e.values[O]=i(e),1),update(e,t){if(o&&t.docChanged||a&&(t.docChanged||t.selection)||l.some((t=>(1&oe(e,t))>0))){let t=i(e);if(s?!D(t,e.values[O],n):!n(t,e.values[O]))return e.values[O]=t,1}return 0},reconfigure(e,t){let o=i(e),a=t.config.address[r];if(null!=a){let i=ae(t,a);if(s?D(o,i,n):n(o,i))return e.values[O]=i,0}return e.values[O]=o,1}}}}function D(e,t,i){if(e.length!=t.length)return!1;for(let n=0;ne[t.id])),r=i.map((e=>e.type)),O=n.filter((e=>!(1&e))),s=e[t.id]>>1;function o(e){let i=[];for(let t=0;t1&oe(e,t))))return 0;let n=o(e);return t.compare(n,e.values[s])?0:(e.values[s]=n,1)},reconfigure(e,r){let O=n.some((t=>1&oe(e,t))),a=r.config.facets[t.id],l=r.facet(t);if(a&&!O&&j(i,a))return e.values[s]=l,0;let h=o(e);return t.compare(h,l)?(e.values[s]=l,0):(e.values[s]=h,1)}}}const L=I.define({static:!0});class B{constructor(e,t,i,n,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=n,this.spec=r,this.provides=void 0}static define(e){let t=new B(G++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(L).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,i)=>{let n=e.values[t],r=this.updateF(n,i);return this.compareF(n,r)?0:(e.values[t]=r,1)},reconfigure:(e,i)=>null!=i.config.address[this.id]?(e.values[t]=i.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,L.of({field:this,create:e})]}get extension(){return this}}const K=4,F=3,H=2,J=1,ee=0;function te(e){return t=>new ne(t,e)}const ie={lowest:te(K),low:te(F),default:te(H),high:te(J),highest:te(ee),fallback:te(K),extend:te(J),override:te(ee)};class ne{constructor(e,t){this.inner=e,this.prec=t}}class re{of(e){return new Oe(this,e)}reconfigure(e){return re.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Oe{constructor(e,t){this.compartment=e,this.inner=t}}class se{constructor(e,t,i,n,r,O){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=O,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let n=[],r=Object.create(null),O=new Map;for(let i of function(e,t,i){let n=[[],[],[],[],[]],r=new Map;return function e(O,s){let o=r.get(O);if(null!=o){if(o>=s)return;let e=n[o].indexOf(O);e>-1&&n[o].splice(e,1),O instanceof Oe&&i.delete(O.compartment)}if(r.set(O,s),Array.isArray(O))for(let t of O)e(t,s);else if(O instanceof Oe){if(i.has(O.compartment))throw new RangeError("Duplicate use of compartment in extensions");let n=t.get(O.compartment)||O.inner;i.set(O.compartment,n),e(n,s)}else if(O instanceof ne)e(O.inner,O.prec);else if(O instanceof B)n[s].push(O),O.provides&&e(O.provides,s);else if(O instanceof E)n[s].push(O),O.facet.extensions&&e(O.facet.extensions,s);else{let t=O.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${O}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,s)}}(e,H),n.reduce(((e,t)=>e.concat(t)))}(e,t,O))i instanceof B?n.push(i):(r[i.facet.id]||(r[i.facet.id]=[])).push(i);let s=Object.create(null),o=[],a=[];for(let e of n)s[e.id]=a.length<<1,a.push((t=>e.slot(t)));let l=null==i?void 0:i.config.facets;for(let e in r){let t=r[e],n=t[0].facet,O=l&&l[e]||[];if(t.every((e=>0==e.type)))if(s[n.id]=o.length<<1|1,j(O,t))o.push(i.facet(n));else{let e=n.combine(t.map((e=>e.value)));o.push(i&&n.compare(e,i.facet(n))?i.facet(n):e)}else{for(let e of t)0==e.type?(s[e.id]=o.length<<1|1,o.push(e.value)):(s[e.id]=a.length<<1,a.push((t=>e.dynamicSlot(t))));s[n.id]=a.length<<1,a.push((e=>M(e,n,t)))}}let h=a.map((e=>e(s)));return new se(e,O,h,s,o,r)}}function oe(e,t){if(1&t)return 2;let i=t>>1,n=e.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;e.status[i]=4;let r=e.computeSlot(e,e.config.dynamicSlots[i]);return e.status[i]=2|r}function ae(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const le=I.define(),he=I.define({combine:e=>e.some((e=>e)),static:!0}),ce=I.define({combine:e=>e.length?e[0]:void 0,static:!0}),ue=I.define(),fe=I.define(),de=I.define(),pe=I.define({combine:e=>!!e.length&&e[0]});class $e{constructor(e,t){this.type=e,this.value=t}static define(){return new Qe}}class Qe{of(e){return new $e(this,e)}}class me{constructor(e){this.map=e}of(e){return new ge(this,e)}}class ge{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new ge(this.type,t)}is(e){return this.type==e}static define(e={}){return new me(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let e=n.map(t);e&&i.push(e)}return i}}ge.reconfigure=ge.define(),ge.appendConfig=ge.define();class Pe{constructor(e,t,i,n,r,O){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=O,this._doc=null,this._state=null,i&&U(i,t.newLength),r.some((e=>e.type==Pe.time))||(this.annotations=r.concat(Pe.time.of(Date.now())))}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Pe.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function Xe(e,t){let i=[];for(let n=0,r=0;;){let O,s;if(n=e[n]))O=e[n++],s=e[n++];else{if(!(r=0;r--){let O=i[r](e);O&&Object.keys(O).length&&(n=ye(e,we(t,O,e.changes.newLength),!0))}return n==e?e:new Pe(t,e.changes,e.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(e){let t=e.startState,i=!0;for(let n of t.facet(ue)){let t=n(e);if(!1===t){i=!1;break}Array.isArray(t)&&(i=!0===i?t:Xe(i,t))}if(!0!==i){let n,r;if(!1===i)r=e.changes.invertedDesc,n=T.empty(t.doc.length);else{let t=e.changes.filter(i);n=t.changes,r=t.filtered.invertedDesc}e=new Pe(t,n,e.selection&&e.selection.map(r),ge.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let n=t.facet(fe);for(let i=n.length-1;i>=0;i--){let r=n[i](e);e=r instanceof Pe?r:Array.isArray(r)&&1==r.length&&r[0]instanceof Pe?r[0]:be(t,Se(r),!1)}return e}(r):r)}Pe.time=$e.define(),Pe.userEvent=$e.define(),Pe.addToHistory=$e.define(),Pe.remote=$e.define();const xe=[];function Se(e){return null==e?xe:Array.isArray(e)?e:[e]}var ke=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(ke||(ke={}));const ve=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Re;try{Re=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}function We(e){return t=>{if(!/\S/.test(t))return ke.Space;if(function(e){if(Re)return Re.test(e);for(let t=0;t"€"&&(i.toUpperCase()!=i.toLowerCase()||ve.test(i)))return!0}return!1}(t))return ke.Word;for(let i=0;i-1)return ke.Word;return ke.Other}}class Te{constructor(e,t,i,n,r,O){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=r,O&&(O._state=this);for(let e=0;er.set(t,e))),i=null),r.set(t.value.compartment,t.value.extension)):t.is(ge.reconfigure)?(i=null,n=t.value):t.is(ge.appendConfig)&&(i=null,n=Se(n).concat(t.value));i?t=e.startState.values.slice():(i=se.resolve(n,r,this),t=new Te(i,this.doc,this.selection,i.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values),new Te(i,e.newDoc,e.newSelection,t,((t,i)=>i.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:z.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),r=[i.range],O=Se(i.effects);for(let i=1;ir.spec.fromJSON(O,e))))}return Te.create({doc:e.doc,selection:z.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=se.resolve(e.extensions||[],new Map),i=e.doc instanceof m?e.doc:m.of((e.doc||"").split(t.staticFacet(Te.lineSeparator)||k)),n=e.selection?e.selection instanceof z?e.selection:z.single(e.selection.anchor,e.selection.head):z.single(0);return U(n,i.length),t.staticFacet(he)||(n=n.asSingle()),new Te(t,i,n,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(Te.tabSize)}get lineBreak(){return this.facet(Te.lineSeparator)||"\n"}get readOnly(){return this.facet(pe)}phrase(e){for(let t of this.facet(Te.phrases))if(Object.prototype.hasOwnProperty.call(t,e))return t[e];return e}languageDataAt(e,t,i=-1){let n=[];for(let r of this.facet(le))for(let O of r(this,t,i))Object.prototype.hasOwnProperty.call(O,e)&&n.push(O[e]);return n}charCategorizer(e){return We(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:n}=this.doc.lineAt(e),r=this.charCategorizer(e),O=e-i,s=e-i;for(;O>0;){let e=a(t,O,!1);if(r(t.slice(e,O))!=ke.Word)break;O=e}for(;se.length?e[0]:4}),Te.lineSeparator=ce,Te.readOnly=pe,Te.phrases=I.define(),Te.languageData=le,Te.changeFilter=ue,Te.transactionFilter=fe,Te.transactionExtender=de,re.reconfigure=ge.define();const Ve=1024;let qe=0;class Ae{constructor(e,t){this.from=e,this.to=t}}class Ye{constructor(e={}){this.id=qe++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=ze.match(e)),t=>{let i=e(t);return void 0===i?null:[this,i]}}}Ye.closedBy=new Ye({deserialize:e=>e.split(" ")}),Ye.openedBy=new Ye({deserialize:e=>e.split(" ")}),Ye.group=new Ye({deserialize:e=>e.split(" ")}),Ye.contextHash=new Ye({perNode:!0}),Ye.lookAhead=new Ye({perNode:!0}),Ye.mounted=new Ye({perNode:!0});class Ne{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}}const Ze=Object.create(null);class ze{constructor(e,t,i,n=0){this.name=e,this.props=t,this.id=i,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):Ze,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),n=new ze(e.name||"",t,e.id,i);if(e.props)for(let i of e.props)if(Array.isArray(i)||(i=i(n)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[i[0].id]=i[1]}return n}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(Ye.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let n of i.split(" "))t[n]=e[i];return e=>{for(let i=e.prop(Ye.group),n=-1;n<(i?i.length:0);n++){let r=t[n<0?e.name:i[n]];if(r)return r}}}}ze.none=new ze("",Object.create(null),0,8);class Ce{constructor(e){this.types=e;for(let t=0;te.node;;){let s=!1;if(e.from<=r&&e.to>=n&&(e.type.isAnonymous||!1!==t(e.type,e.from,e.to,O))){if(e.firstChild())continue;e.type.isAnonymous||(s=!0)}for(;s&&i&&i(e.type,e.from,e.to,O),s=e.type.isAnonymous,!e.nextSibling();){if(!e.parent())return;s=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:nt(ze.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,i)=>new Ie(this.type,e,t,i,this.propValues)),e.makeTree||((e,t,i)=>new Ie(ze.none,e,t,i)))}static build(e){return function(e){var t;let{buffer:i,nodeSet:n,maxBufferLength:r=Ve,reused:O=[],minRepeatType:s=n.types.length}=e,o=Array.isArray(i)?new je(i,i.length):i,a=n.types,l=0,h=0;function c(e,t,i,p,$){let{id:Q,start:m,end:g,size:P}=o,X=h;for(;P<0;){if(o.next(),-1==P){let t=O[Q];return i.push(t),void p.push(m-e)}if(-3==P)return void(l=Q);if(-4==P)return void(h=Q);throw new RangeError(`Unrecognized record size: ${P}`)}let y,w,b=a[Q],x=m-e;if(g-m<=r&&(w=function(e,t){let i=o.fork(),n=0,O=0,a=0,l=i.end-r,h={size:0,start:0,skip:0};e:for(let r=i.pos-e;i.pos>r;){let e=i.size;if(i.id==t&&e>=0){h.size=n,h.start=O,h.skip=a,a+=4,n+=4,i.next();continue}let o=i.pos-e;if(e<0||o=s?4:0,u=i.start;for(i.next();i.pos>o;){if(i.size<0){if(-3!=i.size)break e;c+=4}else i.id>=s&&(c+=4);i.next()}O=u,n+=e,a+=c}return(t<0||n==e)&&(h.size=n,h.start=O,h.skip=a),h.size>4?h:void 0}(o.pos-t,$))){let t=new Uint16Array(w.size-w.skip),i=o.pos-w.size,r=t.length;for(;o.pos>i;)r=d(w.start,t,r);y=new Ee(t,g-w.start,n),x=w.start-e}else{let e=o.pos-P;o.next();let t=[],i=[],n=Q>=s?Q:-1,O=0,a=g;for(;o.pos>e;)n>=0&&o.id==n&&o.size>=0?(o.end<=a-r&&(u(t,i,m,O,o.end,a,n,X),O=t.length,a=o.end),o.next()):c(m,e,t,i,n);if(n>=0&&O>0&&O-1&&O>0){let e=function(e){return(t,i,n)=>{let r,O,s=0,o=t.length-1;if(o>=0&&(r=t[o])instanceof Ie){if(!o&&r.type==e&&r.length==n)return r;(O=r.prop(Ye.lookAhead))&&(s=i[o]+r.length+O)}return f(e,t,i,n,s)}}(b);y=nt(b,t,i,0,t.length,0,g-m,e,e)}else y=f(b,t,i,g-m,X-g)}i.push(y),p.push(x)}function u(e,t,i,r,O,s,o,a){let l=[],h=[];for(;e.length>r;)l.push(e.pop()),h.push(t.pop()+i-O);e.push(f(n.types[o],l,h,s-O,a-s)),t.push(O-i)}function f(e,t,i,n,r=0,O){if(l){let e=[Ye.contextHash,l];O=O?[e].concat(O):[e]}if(r>25){let e=[Ye.lookAhead,r];O=O?[e].concat(O):[e]}return new Ie(e,t,i,n,O)}function d(e,t,i){let{id:n,start:r,end:O,size:a}=o;if(o.next(),a>=0&&n4){let n=o.pos-(a-4);for(;o.pos>n;)i=d(e,t,i)}t[--i]=s,t[--i]=O-e,t[--i]=r-e,t[--i]=n}else-3==a?l=n:-4==a&&(h=n);return i}let p=[],$=[];for(;o.pos>0;)c(e.start||0,e.bufferStart||0,p,$,-1);let Q=null!==(t=e.length)&&void 0!==t?t:p.length?$[0]+p[0].length:0;return new Ie(a[e.topID],p.reverse(),$.reverse(),Q)}(e)}}Ie.empty=new Ie(ze.none,[],[],0);class je{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new je(this.buffer,this.index)}}class Ee{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ze.none}toString(){let e=[];for(let t=0;t0));o=O[o+3]);return s}slice(e,t,i,n){let r=this.buffer,O=new Uint16Array(t-e);for(let n=e,s=0;n=t&&it;case 1:return i<=t&&n>t;case 2:return n>t;case 4:return!0}}function Me(e,t){let i=e.childBefore(t);for(;i;){let t=i.lastChild;if(!t||t.to!=i.to)break;t.type.isError&&t.from==t.to?(e=i,i=t.prevSibling):i=t}return e}function Le(e,t,i,n){for(var r;e.from==e.to||(i<1?e.from>=t:e.from>t)||(i>-1?e.to<=t:e.to0?s.length:-1;e!=a;e+=t){let a=s[e],l=o[e]+O._from;if(De(n,i,l,l+a.length))if(a instanceof Ee){if(2&r)continue;let s=a.findChild(0,a.buffer.length,t,i-l,n);if(s>-1)return new He(new Fe(O,a,e,l),null,s)}else if(1&r||!a.type.isAnonymous||et(a)){let s;if(!(1&r)&&a.props&&(s=a.prop(Ye.mounted))&&!s.overlay)return new Be(s.tree,l,e,O);let o=new Be(a,l,e,O);return 1&r||!o.type.isAnonymous?o:o.nextChild(t<0?a.children.length-1:0,t,i,n)}}if(1&r||!O.type.isAnonymous)return null;if(e=O.index>=0?O.index+t:t<0?-1:O._parent.node.children.length,O=O._parent,!O)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this.node.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this.node.children.length-1,-1,e,-2)}enter(e,t,i=!0,n=!0){let r;if(i&&(r=this.node.prop(Ye.mounted))&&r.overlay){let i=e-this.from;for(let{from:e,to:n}of r.overlay)if((t>0?e<=i:e=i:n>i))return new Be(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n?0:2)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get cursor(){return new Je(this)}get tree(){return this.node}toTree(){return this.node}resolve(e,t=0){return Le(this,e,t,!1)}resolveInner(e,t=0){return Le(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Me(this,e)}getChild(e,t=null,i=null){let n=Ke(this,e,t,i);return n.length?n[0]:null}getChildren(e,t=null,i=null){return Ke(this,e,t,i)}toString(){return this.node.toString()}}function Ke(e,t,i,n){let r=e.cursor,O=[];if(!r.firstChild())return O;if(null!=i)for(;!r.type.is(i);)if(!r.nextSibling())return O;for(;;){if(null!=n&&r.type.is(n))return O;if(r.type.is(t)&&O.push(r.node),!r.nextSibling())return null==n?O:[]}}class Fe{constructor(e,t,i,n){this.parent=e,this.buffer=t,this.index=i,this.start=n}}class He{constructor(e,t,i){this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(e,t,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new He(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i,n=!0){if(!n)return null;let{buffer:r}=this.context,O=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return O<0?null:new He(this.context,this,O)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new He(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new He(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get cursor(){return new Je(this)}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let O=i.buffer[this.index+1],s=i.buffer[this.index+2];e.push(i.slice(n,r,O,s)),t.push(0)}return new Ie(this.type,e,t,this.to-this.from)}resolve(e,t=0){return Le(this,e,t,!1)}resolveInner(e,t=0){return Le(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Me(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let n=Ke(this,e,t,i);return n.length?n[0]:null}getChildren(e,t=null,i=null){return Ke(this,e,t,i)}}class Je{constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Be)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:i,buffer:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=i+n.buffer[e+1],this.to=i+n.buffer[e+2],!0}yield(e){return!!e&&(e instanceof Be?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree.node.children.length-1:0,e,t,i,this.mode));let{buffer:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,i);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=!0,n=!0){return this.buffer?!!n&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i&&!(1&this.mode),n))}parent(){if(!this.buffer)return this.yieldNode(1&this.mode?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=1&this.mode?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let e=i<0?0:this.stack[i]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(e)}return i<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:n}=this;if(n){if(e>0){if(this.index-1)for(let n=t+e,r=e<0?-1:i.node.children.length;n!=r;n+=e){let e=i.node.children[n];if(1&this.mode||e instanceof Ee||!e.type.isAnonymous||et(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let O=e;O;O=O._parent)if(O.index==n){if(n==this.index)return O;t=O,i=r+1;break e}n=this.stack[--r]}for(let e=i;ee instanceof Ee||!e.type.isAnonymous||et(e)))}const tt=new WeakMap;function it(e,t){if(!e.isAnonymous||t instanceof Ee||t.type!=e)return 1;let i=tt.get(t);if(null==i){i=1;for(let n of t.children){if(n.type!=e||!(n instanceof Ie)){i=1;break}i+=it(e,n)}tt.set(t,i)}return i}function nt(e,t,i,n,r,O,s,o,a){let l=0;for(let i=n;i=h)break;d+=t}if(l==r+1){if(d>h){let e=i[r];t(e.children,e.positions,0,e.children.length,n[r]+o);continue}c.push(i[r])}else{let t=n[l-1]+i[l-1].length-f;c.push(nt(e,i,n,r,l,f,t,null,a))}u.push(f+o-O)}}(t,i,n,r,0),(o||a)(c,u,s)}class rt{constructor(e,t,i,n,r=!1,O=!1){this.from=e,this.to=t,this.tree=i,this.offset=n,this.open=(r?1:0)|(O?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],i=!1){let n=[new rt(0,e.length,e,0,!1,i)];for(let i of t)i.to>e.length&&n.push(i);return n}static applyChanges(e,t,i=128){if(!t.length)return e;let n=[],r=1,O=e.length?e[0]:null;for(let s=0,o=0,a=0;;s++){let l=s=i)for(;O&&O.from=t.from||h<=t.to||a){let e=Math.max(t.from,o)-a,i=Math.min(t.to,h)-a;t=e>=i?null:new rt(e,i,t.tree,t.offset+a,s>0,!!l)}if(t&&n.push(t),O.to>h)break;O=rnew Ae(e.from,e.to))):[new Ae(0,0)]:[new Ae(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let n=this.startParse(e,t,i);for(;;){let e=n.advance();if(e)return e}}}class st{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function ot(e){return(t,i,n,r)=>new ct(t,e,i,n,r)}class at{constructor(e,t,i,n,r){this.parser=e,this.parse=t,this.overlay=i,this.target=n,this.ranges=r}}class lt{constructor(e,t,i,n,r,O,s){this.parser=e,this.predicate=t,this.mounts=i,this.index=n,this.start=r,this.target=O,this.prev=s,this.depth=0,this.ranges=[]}}const ht=new Ye({perNode:!0});class ct{constructor(e,t,i,n,r){this.nest=t,this.input=i,this.fragments=n,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),null!=this.stoppedAt)for(let e of this.inner)e.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let e=this.baseTree;return null!=this.stoppedAt&&(e=new Ie(e.type,e.children,e.positions,e.length,e.propValues.concat([[ht,this.stoppedAt]]))),e}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[Ye.mounted.id]=new Ne(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;te.frag.from<=n.from&&e.frag.to>=n.to&&e.mount.overlay));if(e)for(let i of e.mount.overlay){let r=i.from+e.pos,O=i.to+e.pos;r>=n.from&&O<=n.to&&!t.ranges.some((e=>e.fromr))&&t.ranges.push({from:r,to:O})}}o=!1}else if(i&&(O=ut(i.ranges,n.from,n.to)))o=2!=O;else if(!n.type.isAnonymous&&n.fromnew Ae(e.from-n.from,e.to-n.from))):null,n.tree,e)),r.overlay?e.length&&(i={ranges:e,depth:0,prev:i}):o=!1}}else t&&(s=t.predicate(n))&&(!0===s&&(s=new Ae(n.from,n.to)),s.fromnew Ae(e.from-t.start,e.to-t.start))),t.target,e)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function ut(e,t,i){for(let n of e){if(n.from>=i)break;if(n.to>t)return n.from<=t&&n.to>=i?2:1}return 0}function ft(e,t,i,n,r,O){if(t=t.to);n++);let s=r.children[n],o=s.buffer;r.children[n]=function e(i,n,r,a,l){let h=i;for(;o[h+2]+O<=t.from;)h=o[h+3];let c=[],u=[];ft(s,i,h,c,u,a);let f=o[h+1],d=o[h+2],p=f+O==t.from&&d+O==t.to&&o[h]==t.type.id;return c.push(p?t.toTree():e(h+4,o[h+3],s.set.types[o[h]],f,d-f)),u.push(f-a),ft(s,o[h+3],n,c,u,a),new Ie(r,c,u,l)}(0,o.length,ze.none,0,s.length);for(let n=0;n<=i;n++)e.childAfter(t.from)}class pt{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.fullCursor()}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,!1,!1)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(!(t.children.length&&0==t.positions[0]&&t.children[0]instanceof Ie))break;t=t.children[0]}return!1}}class $t{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=null!==(t=i.tree.prop(ht))&&void 0!==t?t:i.to,this.inner=new pt(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(e=t.tree.prop(ht))&&void 0!==e?e:t.to,this.inner=new pt(t.tree,-t.offset)}}findMounts(e,t){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let r=null===(i=e.tree)||void 0===i?void 0:i.prop(Ye.mounted);if(r&&r.parser==t)for(let t=this.fragI;t=e.to)break;i.tree==this.curFrag.tree&&n.push({frag:i,pos:e.from-i.offset,mount:r})}}}return n}}function Qt(e,t){let i=null,n=t;for(let r=1,O=0;r=o)break;e.to<=s||(i||(n=i=t.slice()),e.fromo&&i.splice(O+1,0,new Ae(o,e.to))):e.to>o?i[O--]=new Ae(o,e.to):i.splice(O--,1))}}return n}function mt(e,t,i,n){let r=0,O=0,s=!1,o=!1,a=-1e9,l=[];for(;;){let h=r==e.length?1e9:s?e[r].to:e[r].from,c=O==t.length?1e9:o?t[O].to:t[O].from;if(s!=o){let e=Math.max(a,i),t=Math.min(h,c,n);enew Ae(e.from+n,e.to+n))),o,a);for(let t=0,n=o;;t++){let o=t==s.length,l=o?a:s[t].from;if(l>n&&i.push(new rt(n,l,r.tree,-e,O.from>=n,O.to<=l)),o)break;n=s[t].to}}else i.push(new rt(o,a,r.tree,-e,O.from>=e,O.to<=s))}return i}const Pt="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),Xt="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),yt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class wt{constructor(e,t){this.rules=[];let{finish:i}=t||{};function n(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function r(e,t,O,s){let o=[],a=/^@(\w+)\b/.exec(e[0]),l=a&&"keyframes"==a[1];if(a&&null==t)return O.push(e[0]+";");for(let i in t){let s=t[i];if(/&/.test(i))r(i.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),s,O);else if(s&&"object"==typeof s){if(!a)throw new RangeError("The value of a property ("+i+") should be a primitive value.");r(n(i),s,o,l)}else null!=s&&o.push(i.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+s+";")}(o.length||l)&&O.push((!i||a||s?e:e.map(i)).join(", ")+" {"+o.join(" ")+"}")}for(let t in e)r(n(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=yt[Pt]||1;return yt[Pt]=e+1,"ͼ"+e.toString(36)}static mount(e,t){(e[Xt]||new xt(e)).mount(Array.isArray(t)?t:[t])}}let bt=null;class xt{constructor(e){if(!e.head&&e.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(bt)return e.adoptedStyleSheets=[bt.sheet].concat(e.adoptedStyleSheets),e[Xt]=bt;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),bt=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[Xt]=this}mount(e){let t=this.sheet,i=0,n=0;for(let r=0;r-1&&(this.modules.splice(s,1),n--,s=-1),-1==s){if(this.modules.splice(n++,0,O),t)for(let e=0;e>1,o=r[n]-e||(i?this.value[n].endSide:this.value[n].startSide)-t;if(n==O)return o>=0?O:s;o>=0?s=n:O=n+1}}between(e,t,i,n){for(let r=this.findIndex(t,-1e9,!0),O=this.findIndex(i,1e9,!1,r);rl||a==l&&h.startSide>0&&h.endSide<=0)continue;(l-a||h.endSide-h.startSide)<0||(O<0&&(O=a),h.point&&(s=Math.max(s,l-a)),i.push(h),n.push(a-O),r.push(l-O))}return{mapped:i.length?new Rt(n,r,i,s):null,pos:O}}}class Wt{constructor(e,t,i=Wt.empty,n){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=n}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:n=0,filterTo:r=this.length}=e,O=e.filter;if(0==t.length&&!O)return this;if(i&&(t=t.slice().sort(vt)),this.isEmpty)return t.length?Wt.of(t):this;let s=new Vt(this,null,-1).goto(0),o=0,a=[],l=new Tt;for(;s.value||o=0){let e=t[o++];l.addInner(e.from,e.to,e.value)||a.push(e)}else 1==s.rangeIndex&&s.chunkIndexthis.chunkEnd(s.chunkIndex)||rs.to||r=r&&e<=r+O.length&&!1===O.between(r,e-r,t-r,i))return}this.nextLayer.between(e,t,i)}}iter(e=0){return qt.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return qt.from(e).goto(t)}static compare(e,t,i,n,r=-1){let O=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),s=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),o=_t(O,s,i),a=new Yt(O,o,r),l=new Yt(s,o,r);i.iterGaps(((e,t,i)=>Nt(a,e,l,t,i,n))),i.empty&&0==i.length&&Nt(a,0,l,0,0,n)}static eq(e,t,i=0,n){null==n&&(n=1e9);let r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),O=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(r.length!=O.length)return!1;if(!r.length)return!0;let s=_t(r,O),o=new Yt(r,s,0).goto(i),a=new Yt(O,s,0).goto(i);for(;;){if(o.to!=a.to||!Zt(o.active,a.active)||o.point&&(!a.point||!o.point.eq(a.point)))return!1;if(o.to>n)return!0;o.next(),a.next()}}static spans(e,t,i,n,r=-1){var O;let s=new Yt(e,null,r,null===(O=n.filterPoint)||void 0===O?void 0:O.bind(n)).goto(t),o=t,a=s.openStart;for(;;){let e=Math.min(s.to,i);if(s.point?(n.point(o,e,s.point,s.activeForPoint(s.to),a),a=s.openEnd(e)+(s.to>e?1:0)):e>o&&(n.span(o,e,s.active,a),a=s.openEnd(e)),s.to>i)break;o=s.to,s.next()}return a}static of(e,t=!1){let i=new Tt;for(let n of e instanceof kt?[e]:t?function(e){if(e.length>1)for(let t=e[0],i=1;i0)return e.slice().sort(vt);t=n}return e}(e):e)i.add(n.from,n.to,n.value);return i.finish()}}Wt.empty=new Wt([],[],null,-1),Wt.empty.nextLayer=Wt.empty;class Tt{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(e){this.chunks.push(new Rt(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new Tt)).add(e,t,i)}addInner(e,t,i){let n=e-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(Wt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=new Wt(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function _t(e,t,i){let n=new Map;for(let t of e)for(let e=0;e=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&n.push(new Vt(O,t,i,r));return 1==n.length?n[0]:new qt(n)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)At(this.heap,e);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)At(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),At(this.heap,0)}}}function At(e,t){for(let i=e[t];;){let n=1+(t<<1);if(n>=e.length)break;let r=e[n];if(n+1=0&&(r=e[n+1],n++),i.compare(r)<0)break;e[n]=i,e[t]=r,t=n}}class Yt{constructor(e,t,i,n=(()=>!0)){this.minPoint=i,this.filterPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=qt.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){zt(this.active,e),zt(this.activeTo,e),zt(this.activeRank,e),this.minActive=Ut(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:n,rank:r}=this.cursor;for(;t-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&zt(i,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let r=this.cursor.value;if(r.point)if(t&&this.cursor.to==this.to&&this.cursor.from=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Nt(e,t,i,n,r,O){e.goto(t),i.goto(n);let s=n+r,o=n,a=n-t;for(;;){let t=e.to+a-i.to||e.endSide-i.endSide,n=t<0?e.to+a:i.to,r=Math.min(n,s);if(e.point||i.point?e.point&&i.point&&(e.point==i.point||e.point.eq(i.point))&&Zt(e.activeForPoint(e.to+a),i.activeForPoint(i.to))||O.comparePoint(o,r,e.point,i.point):r>o&&!Zt(e.active,i.active)&&O.compareRange(o,r,e.active,i.active),n>s)break;o=n,t<=0&&e.next(),t>=0&&i.next()}}function Zt(e,t){if(e.length!=t.length)return!1;for(let i=0;i=t;i--)e[i+1]=e[i];e[t]=i}function Ut(e,t){let i=-1,n=1e9;for(let r=0;r",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},jt="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Et="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Dt="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Mt="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Lt="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Bt=jt&&(Mt||+jt[1]<57)||Dt&&Mt,Kt=0;Kt<10;Kt++)Gt[48+Kt]=Gt[96+Kt]=String(Kt);for(Kt=1;Kt<=24;Kt++)Gt[Kt+111]="F"+Kt;for(Kt=65;Kt<=90;Kt++)Gt[Kt]=String.fromCharCode(Kt+32),It[Kt]=String.fromCharCode(Kt);for(var Ft in Gt)It.hasOwnProperty(Ft)||(It[Ft]=Gt[Ft]);function Ht(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Jt(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function ei(e,t){if(!t.anchorNode)return!1;try{return Jt(e,t.anchorNode)}catch(e){return!1}}function ti(e){return 3==e.nodeType?fi(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function ii(e,t,i,n){return!!i&&(ri(e,t,i,n,-1)||ri(e,t,i,n,1))}function ni(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function ri(e,t,i,n,r){for(;;){if(e==i&&t==n)return!0;if(t==(r<0?0:Oi(e))){if("DIV"==e.nodeName)return!1;let i=e.parentNode;if(!i||1!=i.nodeType)return!1;t=ni(e)+(r<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?Oi(e):0}}}function Oi(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}const si={left:0,right:0,top:0,bottom:0};function oi(e,t){let i=t?e.left:e.right;return{left:i,right:i,top:e.top,bottom:e.bottom}}function ai(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}class li{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=n}}let hi,ci=null;function ui(e){if(e.setActive)return e.setActive();if(ci)return e.focus(ci);let t=[];for(let i=e;i&&(t.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(e.focus(null==ci?{get preventScroll(){return ci={preventScroll:!0},!0}}:void 0),!ci){ci=!1;for(let e=0;et)return i.domBoundsAround(e,t,a);if(h>=e&&-1==n&&(n=o,r=a),a>t&&i.dom.parentNode==this.dom){O=o,s=l;break}l=h,a=h+i.breakAfter}return{from:r,to:s<0?i+this.length:s,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:O=0?this.children[O].dom:null}}markDirty(e=!1){this.dirty|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),1&t.dirty)return;t.dirty|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=Qi){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Xi(e,t,i,n,r,O,s,o,a){let{children:l}=e,h=l.length?l[t]:null,c=O.length?O[O.length-1]:null,u=c?c.breakAfter:s;if(!(t==n&&h&&!s&&!u&&O.length<2&&h.merge(i,r,O.length?c:null,0==i,o,a))){if(n0&&(!s&&O.length&&h.merge(i,h.length,O[0],!1,o,0)?h.breakAfter=O.shift().breakAfter:(i2);var qi={mac:Vi||/Mac/.test(wi.platform),windows:/Win/.test(wi.platform),linux:/Linux|X11/.test(wi.platform),ie:vi,ie_version:Si?bi.documentMode||6:ki?+ki[1]:xi?+xi[1]:0,gecko:Ri,gecko_version:Ri?+(/Firefox\/(\d+)/.exec(wi.userAgent)||[0,0])[1]:0,chrome:!!Wi,chrome_version:Wi?+Wi[1]:0,ios:Vi,android:/Android\b/.test(wi.userAgent),webkit:Ti,safari:_i,webkit_version:Ti?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=bi.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class Ai extends mi{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,i){return(!i||i instanceof Ai&&!(this.length-(t-e)+i.length>256))&&(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Ai(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new $i(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Ni(this.dom,e,t)}}class Yi extends mi{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let e of t)e.setParent(this)}setAttrs(e){if(pi(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}sync(e){this.dom?4&this.dirty&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e)}merge(e,t,i,n,r,O){return!(i&&(!(i instanceof Yi&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(n=r),i=s,r++}let O=this.length-e;return this.length=e,n>-1&&(this.children.length=n,this.markDirty()),new Yi(this.mark,t,O)}domAtPos(e){return Ii(this.dom,this.children,e)}coordsAt(e,t){return Ei(this,e,t)}}function Ni(e,t,i){let n=e.nodeValue.length;t>n&&(t=n);let r=t,O=t,s=0;0==t&&i<0||t==n&&i>=0?qi.chrome||qi.gecko||(t?(r--,s=1):(O++,s=-1)):i<0?r--:O++;let o=fi(e,r,O).getClientRects();if(!o.length)return si;let a=o[(s?s<0:i>=0)?0:o.length-1];return qi.safari&&!s&&0==a.width&&(a=Array.prototype.find.call(o,(e=>e.width))||a),s?oi(a,s<0):a||null}class Zi extends mi{constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}static create(e,t,i){return new(e.customView||Zi)(e,t,i)}split(e){let t=Zi.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(){this.dom&&this.widget.updateDOM(this.dom)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,n,r,O){return!(i&&(!(i instanceof Zi&&this.widget.compare(i.widget))||e>0&&r<=0||t0?i.length-1:0;n=i[t],!(e>0?0==t:t==i.length-1||n.top0?-1:1);return 0==e&&t>0||e==this.length&&t<=0?n:oi(n,0==e)}get isEditable(){return!1}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class zi extends Zi{domAtPos(e){let{topView:t,text:i}=this.widget;return t?Ci(e,0,t,i,((e,t)=>e.domAtPos(t)),(e=>new $i(i,Math.min(e,i.nodeValue.length)))):new $i(i,Math.min(e,i.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(e,t){let{topView:i,text:n}=this.widget;return i?Ui(e,t,i,n):Math.min(t,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(e,t){let{topView:i,text:n}=this.widget;return i?Ci(e,t,i,n,((e,t,i)=>e.coordsAt(t,i)),((e,t)=>Ni(n,e,t))):Ni(n,e,t)}destroy(){var e;super.destroy(),null===(e=this.widget.topView)||void 0===e||e.destroy()}get isEditable(){return!0}}function Ci(e,t,i,n,r,O){if(i instanceof Yi){for(let s of i.children){let i=Jt(s.dom,n),o=i?n.nodeValue.length:s.length;if(e=0;)if(t<0?n>0:n0?-1:1);return i&&i.topt.top?{left:t.left,right:t.right,top:i.top,bottom:i.bottom}:t}get overrideDOMText(){return m.empty}}function Ii(e,t,i){let n=0;for(let r=0;nr&&i0;n--){let i=t[n-1].dom;if(i.parentNode==e)return $i.after(i)}return new $i(e,0)}function ji(e,t,i){let n,{children:r}=e;i>0&&t instanceof Yi&&r.length&&(n=r[r.length-1])instanceof Yi&&n.mark.eq(t.mark)?ji(n,t.children[0],i-1):(r.push(t),t.setParent(e)),e.length+=t.length}function Ei(e,t,i){for(let n=0,r=0;r0?o>=t:o>t)&&(t0)){let e=0;if(o==n){if(s.getSide()<=0)continue;e=i=-s.getSide()}let r=s.coordsAt(Math.max(0,t-n),i);return e&&r?oi(r,i<0):r}n=o}let n=e.dom.lastChild;if(!n)return e.dom.getBoundingClientRect();let r=ti(n);return r[r.length-1]||null}function Di(e,t){for(let i in e)"class"==i&&t.class?t.class+=" "+e.class:"style"==i&&t.style?t.style+=";"+e.style:t[i]=e[i];return t}function Mi(e,t){if(e==t)return!0;if(!e||!t)return!1;let i=Object.keys(e),n=Object.keys(t);if(i.length!=n.length)return!1;for(let r of i)if(-1==n.indexOf(r)||e[r]!==t[r])return!1;return!0}function Li(e,t,i){if(t)for(let n in t)i&&n in i||e.removeAttribute(n);if(i)for(let n in i)t&&t[n]==i[n]||e.setAttribute(n,i[n])}Ai.prototype.children=Zi.prototype.children=Gi.prototype.children=Qi;class Bi{eq(e){return!1}updateDOM(e){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}ignoreEvent(e){return!0}get customView(){return null}destroy(e){}}var Ki=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(Ki||(Ki={}));class Fi extends St{constructor(e,t,i,n){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(e){return new Hi(e)}static widget(e){let t=e.side||0,i=!!e.block;return t+=i?t>0?3e8:-4e8:t>0?1e8:-1e8,new en(e,t,t,i,e.widget||null,!1)}static replace(e){let t,i,n=!!e.block;if(e.isBlockGap)t=-5e8,i=4e8;else{let{start:r,end:O}=tn(e,n);t=(r?n?-3e8:-1:5e8)-1,i=1+(O?n?2e8:1:-6e8)}return new en(e,t,i,n,e.widget||null,!0)}static line(e){return new Ji(e)}static set(e,t=!1){return Wt.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}Fi.none=Wt.empty;class Hi extends Fi{constructor(e){let{start:t,end:i}=tn(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){return this==e||e instanceof Hi&&this.tagName==e.tagName&&this.class==e.class&&Mi(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Hi.prototype.point=!1;class Ji extends Fi{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Ji&&Mi(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Ji.prototype.mapMode=R.TrackBefore,Ji.prototype.point=!0;class en extends Fi{constructor(e,t,i,n,r,O){super(t,i,r,e),this.block=n,this.isReplace=O,this.mapMode=n?t<=0?R.TrackBefore:R.TrackAfter:R.TrackDel}get type(){return this.startSide=5}eq(e){return e instanceof en&&function(e,t){return e==t||!!(e&&t&&e.compare(t))}(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function tn(e,t=!1){let{inclusiveStart:i,inclusiveEnd:n}=e;return null==i&&(i=e.inclusive),null==n&&(n=e.inclusive),{start:null!=i?i:t,end:null!=n?n:t}}function nn(e,t,i,n=0){let r=i.length-1;r>=0&&i[r]+n>=e?i[r]=Math.max(i[r],t):i.push(e,t)}en.prototype.point=!0;class rn extends mi{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,n,r,O){if(i){if(!(i instanceof rn))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),yi(this,e,t,i?i.children:[],r,O),!0}split(e){let t=new rn;if(t.breakAfter=this.breakAfter,0==this.length)return t;let{i:i,off:n}=this.childPos(e);n&&(t.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let e=i;e0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Mi(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){ji(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=Di(t,this.attrs||{})),i&&(this.attrs=Di({class:i},this.attrs||{}))}domAtPos(e){return Ii(this.dom,this.children,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.dirty|=6)}sync(e){var t;this.dom?4&this.dirty&&(pi(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(Li(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e);let i=this.dom.lastChild;for(;i&&mi.get(i)instanceof Yi;)i=i.lastChild;if(!(i&&this.length&&("BR"==i.nodeName||0!=(null===(t=mi.get(i))||void 0===t?void 0:t.isEditable)||qi.ios&&this.children.some((e=>e instanceof Ai))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e=0;for(let t of this.children){if(!(t instanceof Ai))return null;let i=ti(t.dom);if(1!=i.length)return null;e+=i[0].width}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}}coordsAt(e,t){return Ei(this,e,t)}become(e){return!1}get type(){return Ki.Text}static find(e,t){for(let i=0,n=0;i=t){if(r instanceof rn)return r;if(O>t)break}n=O+r.breakAfter}return null}}class On extends mi{constructor(e,t,i){super(),this.widget=e,this.length=t,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,n,r,O){return!(i&&(!(i instanceof On&&this.widget.compare(i.widget))||e>0&&r<=0||t0;){if(this.textOff==this.text.length){let{value:t,lineBreak:i,done:n}=this.cursor.next(this.skip);if(this.skip=0,n)throw new Error("Ran out of text content when drawing inline views");if(i){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,e--;continue}this.text=t,this.textOff=0}let n=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(0,i)),this.getLine().append(on(new Ai(this.text.slice(this.textOff,this.textOff+n)),t),i),this.atCursorPos=!0,this.textOff+=n,e-=n,i=0}}span(e,t,i,n){this.buildText(t-e,i,n),this.pos=t,this.openStart<0&&(this.openStart=n)}point(e,t,i,n,r){let O=t-e;if(i instanceof en)if(i.block){let{type:e}=i;e!=Ki.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new On(i.widget||new an("div"),O,e))}else{let s=Zi.create(i.widget||new an("span"),O,i.startSide),o=this.atCursorPos&&!s.isEditable&&r<=n.length&&(e0),a=!s.isEditable&&(ethis.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}return!0}static build(e,t,i,n,r){let O=new sn(e,t,i,r);return O.openEnd=Wt.spans(n,t,i,O),O.openStart<0&&(O.openStart=O.openEnd),O.finish(O.openEnd),O}}function on(e,t){for(let i of t)e=new Yi(i,[e],e.length);return e}class an extends Bi{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}}const ln=[],hn=I.define(),cn=I.define(),un=I.define(),fn=I.define(),dn=I.define(),pn=I.define(),$n=ge.define({map:(e,t)=>e.map(t)}),Qn=ge.define({map:(e,t)=>e.map(t)});class mn{constructor(e,t="nearest",i="nearest",n=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=n,this.xMargin=r}map(e){return e.empty?this:new mn(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const gn=ge.define({map:(e,t)=>e.map(t)});function Pn(e,t,i){let n=e.facet(fn);n.length?n[0](t):window.onerror?window.onerror(String(t),i,void 0,void 0,t):i?console.error(i+":",t):console.error(t)}const Xn=I.define({combine:e=>!e.length||e[0]});class yn{constructor(e,t){this.field=e,this.get=t}}class wn{from(e){return new yn(this,e)}static define(){return new wn}}wn.decorations=wn.define(),wn.atomicRanges=wn.define(),wn.scrollMargins=wn.define();let bn=0;const xn=I.define();class Sn{constructor(e,t,i){this.id=e,this.create=t,this.fields=i,this.extension=xn.of(this)}static define(e,t){let{eventHandlers:i,provide:n,decorations:r}=t||{},O=[];if(n)for(let e of Array.isArray(n)?n:[n])O.push(e);return i&&O.push(kn.from((e=>({plugin:e,handlers:i})))),r&&O.push(wn.decorations.from(r)),new Sn(bn++,e,O)}static fromClass(e,t){return Sn.define((t=>new e(t)),t)}}const kn=wn.define();class vn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}takeField(e,t){if(this.spec)for(let{field:i,get:n}of this.spec.fields)i==e&&t.push(n(this.value))}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(Pn(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Pn(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){Pn(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Rn=I.define(),Wn=I.define(),Tn=I.define(),_n=I.define();class Vn{constructor(e,t,i,n){this.fromA=e,this.toA=t,this.fromB=i,this.toB=n}join(e){return new Vn(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let n=e[t-1];if(!(n.fromA>i.toA)){if(n.toAl)break;r+=2}if(!o)return i;new Vn(o.fromA,o.toA,o.fromB,o.toB).addToSet(i),O=o.toA,s=o.toB}}}class qn{constructor(e,t,i=ln){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=T.empty(this.startState.doc.length);for(let e of i)this.changes=this.changes.compose(e.changes);let n=[];this.changes.iterChangedRanges(((e,t,i,r)=>n.push(new Vn(e,t,i,r)))),this.changedRanges=n;let r=e.hasFocus;r!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=r,this.flags|=1)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}var An=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(An||(An={}));const Yn=An.LTR,Nn=An.RTL;function Zn(e){let t=[];for(let i=0;i=t){if(s.level==i)return O;(r<0||(0!=n?n<0?s.fromt:e[r].level>s.level))&&(r=O)}}if(r<0)throw new RangeError("Index out of range");return r}}const Dn=[];function Mn(e){return[new En(0,e,0)]}let Ln="";function Bn(e,t,i,n,r){var O;let s=n.head-e.from,o=-1;if(0==s){if(!r||!e.length)return null;t[0].level!=i&&(s=t[0].side(!1,i),o=0)}else if(s==e.length){if(r)return null;let e=t[t.length-1];e.level!=i&&(s=e.side(!0,i),o=t.length-1)}o<0&&(o=En.find(t,s,null!==(O=n.bidiLevel)&&void 0!==O?O:-1,n.assoc));let l=t[o];s==l.side(r,i)&&(l=t[o+=r?1:-1],s=l.side(!r,i));let h=r==(l.dir==i),c=a(e.text,s,h);if(Ln=e.text.slice(Math.min(s,c),Math.max(s,c)),c!=l.side(r,i))return z.cursor(c+e.from,h?-1:1,l.level);let u=o==(r?t.length-1:0)?null:t[o+(r?1:-1)];return u||l.level==i?u&&u.level1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=s-1);i=O+s}}readNode(e){if(e.cmIgnore)return;let t=mi.get(e),i=t&&t.overrideDOMText;if(null!=i){this.findPointInside(e,i.length);for(let e=i.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(3==e.nodeType?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+Math.min(t,i.offset))}}function Fn(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}class Hn{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Jn extends mi{constructor(e){super(),this.view=e,this.compositionDeco=Fi.none,this.decorations=[],this.pluginDecorationLength=0,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new rn],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Vn(0,0,0,e.state.doc.length)],0)}get root(){return this.view.root}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every((({fromA:e,toA:t})=>tthis.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=Fi.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=function(e,t){let i=tr(e);if(!i)return Fi.none;let{from:n,to:r,node:O,text:s}=i,o=t.mapPos(n,1),a=Math.max(o,t.mapPos(r,-1)),{state:l}=e,h=3==O.nodeType?O.nodeValue:new Kn([],l).readRange(O.firstChild,null).text;if(a-o{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.minWidth=this.minWidth?this.minWidth+"px":"";let e=qi.chrome||qi.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(e),this.dirty=0,e&&(e.written||i.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""}));let n=[];if(this.view.viewport.from||this.view.viewport.to=0?e[t]:null;if(!n)break;let{fromA:r,toA:O,fromB:s,toB:o}=n,{content:a,breakAtStart:l,openStart:h,openEnd:c}=sn.build(this.view.state.doc,s,o,this.decorations,this.pluginDecorationLength),{i:u,off:f}=i.findPos(O,1),{i:d,off:p}=i.findPos(r,-1);Xi(this,d,p,u,f,a,l,h,c)}}updateSelection(e=!1,t=!1){if(e&&this.view.observer.readSelectionRange(),!t&&!this.mayControlSelection()||qi.ios&&this.view.inputState.rapidCompositionStart)return;let i=this.forceSelection;this.forceSelection=!1;let n=this.view.state.selection.main,r=this.domAtPos(n.anchor),O=n.empty?r:this.domAtPos(n.head);if(qi.gecko&&n.empty&&function(e){return 1==e.node.nodeType&&e.node.firstChild&&(0==e.offset||"false"==e.node.childNodes[e.offset-1].contentEditable)&&(e.offset==e.node.childNodes.length||"false"==e.node.childNodes[e.offset].contentEditable)}(r)){let e=document.createTextNode("");this.view.observer.ignore((()=>r.node.insertBefore(e,r.node.childNodes[r.offset]||null))),r=O=new $i(e,0),i=!0}let s=this.view.observer.selectionRange;!i&&s.focusNode&&ii(r.node,r.offset,s.anchorNode,s.anchorOffset)&&ii(O.node,O.offset,s.focusNode,s.focusOffset)||(this.view.observer.ignore((()=>{qi.android&&qi.chrome&&this.dom.contains(s.focusNode)&&function(e,t){for(let i=e;i&&i!=t;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(s.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=Ht(this.root);if(n.empty){if(qi.gecko){let e=function(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(tn.head&&([r,O]=[O,r]),t.setEnd(O.node,O.offset),t.setStart(r.node,r.offset),e.removeAllRanges(),e.addRange(t)}})),this.view.observer.setSelectionRange(r,O)),this.impreciseAnchor=r.precise?null:new $i(s.anchorNode,s.anchorOffset),this.impreciseHead=O.precise?null:new $i(s.focusNode,s.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let e=this.view.state.selection.main,t=Ht(this.root);if(!e.empty||!e.assoc||!t.modify)return;let i=rn.find(this,e.head);if(!i)return;let n=i.posAtStart;if(e.head==n||e.head==n+i.length)return;let r=this.coordsAt(e.head,-1),O=this.coordsAt(e.head,1);if(!r||!O||r.bottom>O.top)return;let s=this.domAtPos(e.head+e.assoc);t.collapse(s.node,s.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}mayControlSelection(){return this.view.state.facet(Xn)?this.root.activeElement==this.dom:ei(this.dom,this.view.observer.selectionRange)}nearest(e){for(let t=e;t;){let e=mi.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;tO||e==O&&r.type!=Ki.WidgetBefore&&r.type!=Ki.WidgetAfter&&(!n||2==t||this.children[n-1].breakAfter||this.children[n-1].type==Ki.WidgetBefore&&t>-2))return r.coordsAt(e-O,t);i=O}}measureVisibleLineHeights(){let e=[],{from:t,to:i}=this.view.viewState.viewport,n=this.view.contentDOM.clientWidth,r=n>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,O=-1;for(let s=0,o=0;oi)break;if(s>=t){let t=a.dom.getBoundingClientRect();if(e.push(t.height),r){let e=a.dom.lastChild,i=e?ti(e):[];if(i.length){let e=i[i.length-1],r=this.view.textDirection==An.LTR?e.right-t.left:t.right-e.left;r>O&&(O=r,this.minWidth=n,this.minWidthFrom=s,this.minWidthTo=l)}}}s=l+a.breakAfter}return e}measureTextSize(){for(let e of this.children)if(e instanceof rn){let t=e.measureTextSize();if(t)return t}let e,t,i=document.createElement("div");return i.className="cm-line",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(i);let n=ti(i.firstChild)[0];e=i.getBoundingClientRect().height,t=n?n.width/27:7,i.remove()})),{lineHeight:e,charWidth:t}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Pi(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,n=0;;n++){let r=n==t.viewports.length?null:t.viewports[n],O=r?r.from-1:this.length;if(O>i){let n=t.lineBlockAt(O).bottom-t.lineBlockAt(i).top;e.push(Fi.replace({widget:new er(n),block:!0,inclusive:!0,isBlockGap:!0}).range(i,O))}if(!r)break;i=r.to+1}return Fi.set(e)}updateDeco(){let e=this.view.pluginField(wn.decorations);return this.pluginDecorationLength=e.length,this.decorations=[...e,...this.view.state.facet(Tn),this.compositionDeco,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]}scrollIntoView(e){let t,{range:i}=e,n=this.coordsAt(i.head,i.empty?i.assoc:i.head>i.anchor?-1:1);if(!n)return;!i.empty&&(t=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,t.left),top:Math.min(n.top,t.top),right:Math.max(n.right,t.right),bottom:Math.max(n.bottom,t.bottom)});let r=0,O=0,s=0,o=0;for(let e of this.view.pluginField(wn.scrollMargins))if(e){let{left:t,right:i,top:n,bottom:a}=e;null!=t&&(r=Math.max(r,t)),null!=i&&(O=Math.max(O,i)),null!=n&&(s=Math.max(s,n)),null!=a&&(o=Math.max(o,a))}let a={left:n.left-r,top:n.top-s,right:n.right+O,bottom:n.bottom+o};!function(e,t,i,n,r,O,s,o){let a=e.ownerDocument,l=a.defaultView;for(let h=e;h;)if(1==h.nodeType){let e,c=h==a.body;if(c)e=ai(l);else{if(h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.parentNode;continue}let t=h.getBoundingClientRect();e={left:t.left,right:t.left+h.clientWidth,top:t.top,bottom:t.top+h.clientHeight}}let u=0,f=0;if("nearest"==r)t.top0&&t.bottom>e.bottom+f&&(f=t.bottom-e.bottom+f+s)):t.bottom>e.bottom&&(f=t.bottom-e.bottom+s,i<0&&t.top-f0&&t.right>e.right+u&&(u=t.right-e.right+u+O)):t.right>e.right&&(u=t.right-e.right+O,i<0&&t.left0&&i<=0)t=Oi(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}class rr{constructor(){this.changes=[]}compareRange(e,t){nn(e,t,this.changes)}comparePoint(e,t){nn(e,t,this.changes)}}function Or(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function sr(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function or(e,t){return e.topt.top+1}function ar(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function hr(e,t,i){let n,r,O,s,o,a,l,h;for(let c=e.firstChild;c;c=c.nextSibling){let e=ti(c);for(let u=0;up||s==p&&O>d)&&(n=c,r=f,O=d,s=p),0==d?i>f.bottom&&(!l||l.bottomf.top)&&(a=c,h=f):l&&or(l,f)?l=lr(l,f.bottom):h&&or(h,f)&&(h=ar(h,f.top))}}if(l&&l.bottom>=i?(n=o,r=l):h&&h.top<=i&&(n=a,r=h),!n)return{node:e,offset:0};let c=Math.max(r.left,Math.min(r.right,t));return 3==n.nodeType?cr(n,c,i):O||"true"!=n.contentEditable?{node:e,offset:Array.prototype.indexOf.call(e.childNodes,n)+(t>=(r.left+r.right)/2?1:0)}:hr(n,c,i)}function cr(e,t,i){let n=e.nodeValue.length,r=-1,O=1e9,s=0;for(let o=0;oi?l.top-i:i-l.bottom)-1;if(l.left-1<=t&&l.right+1>=t&&h=(l.left+l.right)/2,n=i;if((qi.chrome||qi.gecko)&&fi(e,o).getBoundingClientRect().left==l.right&&(n=!i),h<=0)return{node:e,offset:o+(n?1:0)};r=o+(n?1:0),O=h}}}return{node:e,offset:r>-1?r:s>0?e.nodeValue.length:0}}function ur(e,{x:t,y:i},n,r=-1){var O;let s,o=e.contentDOM.getBoundingClientRect(),a=o.top+e.viewState.paddingTop,{docHeight:l}=e.viewState,h=i-a;if(h<0)return 0;if(h>l)return e.state.doc.length;for(let t=e.defaultLineHeight/2,i=!1;s=e.elementAtHeight(h),s.type!=Ki.Text;)for(;h=r>0?s.bottom+t:s.top-t,!(h>=0&&h<=l);){if(i)return n?null:0;i=!0,r=-r}i=a+h;let c=s.from;if(ce.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:fr(e,o,s,t,i);let u=e.dom.ownerDocument,f=e.root.elementFromPoint?e.root:u,d=f.elementFromPoint(t,i);d&&!e.contentDOM.contains(d)&&(d=null),d||(t=Math.max(o.left+1,Math.min(o.right-1,t)),d=f.elementFromPoint(t,i),d&&!e.contentDOM.contains(d)&&(d=null));let p,$=-1;if(d&&0!=(null===(O=e.docView.nearest(d))||void 0===O?void 0:O.isEditable))if(u.caretPositionFromPoint){let e=u.caretPositionFromPoint(t,i);e&&({offsetNode:p,offset:$}=e)}else if(u.caretRangeFromPoint){let e=u.caretRangeFromPoint(t,i);e&&(({startContainer:p,startOffset:$}=e),qi.safari&&function(e,t,i){let n;if(3!=e.nodeType||t!=(n=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=t.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return fi(e,n-1,n).getBoundingClientRect().left>i}(p,$,t)&&(p=void 0))}if(!p||!e.docView.dom.contains(p)){let n=rn.find(e.docView,c);if(!n)return h>s.top+s.height/2?s.to:s.from;({node:p,offset:$}=hr(n.dom,t,i))}return e.docView.posFromDOM(p,$)}function fr(e,t,i,n,r){let O=Math.round((n-t.left)*e.defaultCharacterWidth);e.lineWrapping&&i.height>1.5*e.defaultLineHeight&&(O+=Math.floor((r-i.top)/e.defaultLineHeight)*e.viewState.heightOracle.lineLength);let s=e.state.sliceDoc(i.from,i.to);return i.from+Q(s,O,e.state.tabSize)}function dr(e,t,i,n){let r=e.state.doc.lineAt(t.head),O=e.bidiSpans(r);for(let s=t,o=null;;){let t=Bn(r,O,e.textDirection,s,i),a=Ln;if(!t){if(r.number==(i?e.state.doc.lines:1))return s;a="\n",r=e.state.doc.line(r.number+(i?1:-1)),O=e.bidiSpans(r),t=z.cursor(i?r.from:r.to)}if(o){if(!o(a))return s}else{if(!n)return t;o=n(a)}s=t}}function pr(e,t,i){let n=e.pluginField(wn.atomicRanges);for(;;){let e=!1;for(let r of n)r.between(i.from-1,i.from+1,((n,r,O)=>{i.from>n&&i.fromi.from?z.cursor(n,1):z.cursor(r,-1),e=!0)}));if(!e)return i}}class $r{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;for(let t in Xr){let i=Xr[t];e.contentDOM.addEventListener(t,(n=>{Pr(e,n)&&!this.ignoreDuringComposition(n)&&("keydown"==t&&this.keydown(e,n)||(this.mustFlushObserver(n)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,n)?n.preventDefault():i(e,n)))})),this.registeredEvents.push(t)}this.notifiedFocused=e.hasFocus,this.ensureHandlers(e),qi.safari&&e.contentDOM.addEventListener("input",(()=>null))}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e){let t=this.customHandlers=e.pluginField(kn);for(let i of t)for(let t in i.handlers)this.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(this.registeredEvents.push(t),e.contentDOM.addEventListener(t,(i=>{Pr(e,i)&&this.runCustomHandlers(t,e,i)&&i.preventDefault()})))}runCustomHandlers(e,t,i){for(let n of this.customHandlers){let r=n.handlers[e];if(r)try{if(r.call(n.plugin,i,t)||i.defaultPrevented)return!0}catch(e){Pn(t.state,e)}}return!1}runScrollHandlers(e,t){for(let i of this.customHandlers){let n=i.handlers.scroll;if(n)try{n.call(i.plugin,t,e)}catch(t){Pn(e.state,t)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&Date.now()e.keyCode==t.keyCode)))||t.ctrlKey||t.altKey||t.metaKey||t.synthetic||(this.pendingIOSKey=i,setTimeout((()=>this.flushIOSKey(e)),250),0))}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&(this.pendingIOSKey=void 0,di(e.contentDOM,t.key,t.keyCode))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(qi.safari&&Date.now()-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}mustFlushObserver(e){return"keydown"==e.type&&229!=e.keyCode||"compositionend"==e.type&&!qi.ios}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const Qr=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],mr=[16,17,18,20,91,92,224,225];class gr{constructor(e,t,i,n){this.view=e,this.style=i,this.mustSelect=n,this.lastEvent=t;let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Te.allowMultipleSelections)&&function(e,t){let i=e.state.facet(hn);return i.length?i[0](t):qi.mac?t.metaKey:t.ctrlKey}(e,t),this.dragMove=function(e,t){let i=e.state.facet(cn);return i.length?i[0](t):qi.mac?!t.altKey:!t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:i}=e.state.selection;if(i.empty)return!1;let n=Ht(e.root);if(0==n.rangeCount)return!0;let r=n.getRangeAt(0).getClientRects();for(let e=0;e=t.clientX&&i.top<=t.clientY&&i.bottom>=t.clientY)return!0}return!1}(e,t)||1!=qr(t))&&null,!1===this.dragging&&(t.preventDefault(),this.select(t))}move(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(this.lastEvent=e)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}select(e){let t=this.style.get(e,this.extend,this.multiple);!this.mustSelect&&t.eq(this.view.state.selection)&&t.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout((()=>this.select(this.lastEvent)),20)}}function Pr(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let i,n=t.target;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=mi.get(n))&&i.ignoreEvent(t))return!1;return!0}const Xr=Object.create(null),yr=qi.ie&&qi.ie_version<15||qi.ios&&qi.webkit_version<604;function wr(e,t){let i,{state:n}=e,r=1,O=n.toText(t),s=O.lines==n.selection.ranges.length;if(null!=Yr&&n.selection.ranges.every((e=>e.empty))&&Yr==O.toString()){let e=-1;i=n.changeByRange((i=>{let o=n.doc.lineAt(i.from);if(o.from==e)return{range:i};e=o.from;let a=n.toText((s?O.line(r++).text:t)+n.lineBreak);return{changes:{from:o.from,insert:a},range:z.cursor(i.from+a.length)}}))}else i=s?n.changeByRange((e=>{let t=O.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:z.cursor(e.from+t.length)}})):n.replaceSelection(O);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Xr.keydown=(e,t)=>{e.inputState.setSelectionOrigin("select"),27==t.keyCode?e.inputState.lastEscPress=Date.now():mr.indexOf(t.keyCode)<0&&(e.inputState.lastEscPress=0)};let br=0;function xr(e,t,i,n){if(1==n)return z.cursor(t,i);if(2==n)return function(e,t,i=1){let n=e.charCategorizer(t),r=e.doc.lineAt(t),O=t-r.from;if(0==r.length)return z.cursor(t);0==O?i=1:O==r.length&&(i=-1);let s=O,o=O;i<0?s=a(r.text,O,!1):o=a(r.text,O);let l=n(r.text.slice(s,o));for(;s>0;){let e=a(r.text,s,!1);if(n(r.text.slice(e,s))!=l)break;s=e}for(;o{br=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},Xr.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Xr.mousedown=(e,t)=>{if(e.observer.flush(),br>Date.now()-2e3&&1==qr(t))return;let i=null;for(let n of e.state.facet(un))if(i=n(e,t),i)break;if(i||0!=t.button||(i=function(e,t){let i=Rr(e,t),n=qr(t),r=e.state.selection,O=i,s=t;return{update(e){e.docChanged&&(i&&(i.pos=e.changes.mapPos(i.pos)),r=r.map(e.changes),s=null)},get(t,o,a){let l;if(s&&t.clientX==s.clientX&&t.clientY==s.clientY?l=O:(l=O=Rr(e,t),s=t),!l||!i)return r;let h=xr(e,l.pos,l.bias,n);if(i.pos!=l.pos&&!o){let t=xr(e,i.pos,i.bias,n),r=Math.min(t.from,h.from),O=Math.max(t.to,h.to);h=rui(e.contentDOM))),e.inputState.startMouseSelection(new gr(e,t,i,n))}};let Sr=(e,t)=>e>=t.top&&e<=t.bottom,kr=(e,t,i)=>Sr(t,i)&&e>=i.left&&e<=i.right;function vr(e,t,i,n){let r=rn.find(e.docView,t);if(!r)return 1;let O=t-r.posAtStart;if(0==O)return 1;if(O==r.length)return-1;let s=r.coordsAt(O,-1);if(s&&kr(i,n,s))return-1;let o=r.coordsAt(O,1);return o&&kr(i,n,o)?1:s&&Sr(n,s)?-1:1}function Rr(e,t){let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:i,bias:vr(e,i,t.clientX,t.clientY)}}const Wr=qi.ie&&qi.ie_version<=11;let Tr=null,_r=0,Vr=0;function qr(e){if(!Wr)return e.detail;let t=Tr,i=Vr;return Tr=e,Vr=Date.now(),_r=!t||i>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(_r+1)%3:1}function Ar(e,t,i,n){if(!i)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1);t.preventDefault();let{mouseSelection:O}=e.inputState,s=n&&O&&O.dragging&&O.dragMove?{from:O.dragging.from,to:O.dragging.to}:null,o={from:r,insert:i},a=e.state.changes(s?[s,o]:o);e.focus(),e.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:s?"move.drop":"input.drop"})}Xr.dragstart=(e,t)=>{let{selection:{main:i}}=e.state,{mouseSelection:n}=e.inputState;n&&(n.dragging=i),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(i.from,i.to)),t.dataTransfer.effectAllowed="copyMove")},Xr.drop=(e,t)=>{if(!t.dataTransfer)return;if(e.state.readOnly)return t.preventDefault();let i=t.dataTransfer.files;if(i&&i.length){t.preventDefault();let n=Array(i.length),r=0,O=()=>{++r==i.length&&Ar(e,t,n.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(n[e]=t.result),O()},t.readAsText(i[e])}}else Ar(e,t,t.dataTransfer.getData("Text"),!0)},Xr.paste=(e,t)=>{if(e.state.readOnly)return t.preventDefault();e.observer.flush();let i=yr?null:t.clipboardData;i?(wr(e,i.getData("text/plain")),t.preventDefault()):function(e){let t=e.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout((()=>{e.focus(),i.remove(),wr(e,i.value)}),50)}(e)};let Yr=null;function Nr(e,t){if(e.docView.compositionDeco.size){e.inputState.rapidCompositionStart=t;try{e.update([])}finally{e.inputState.rapidCompositionStart=!1}}}Xr.copy=Xr.cut=(e,t)=>{let{text:i,ranges:n,linewise:r}=function(e){let t=[],i=[],n=!1;for(let n of e.selection.ranges)n.empty||(t.push(e.sliceDoc(n.from,n.to)),i.push(n));if(!t.length){let r=-1;for(let{from:n}of e.selection.ranges){let O=e.doc.lineAt(n);O.number>r&&(t.push(O.text),i.push({from:O.from,to:Math.min(e.doc.length,O.to+1)})),r=O.number}n=!0}return{text:t.join(e.lineBreak),ranges:i,linewise:n}}(e.state);if(!i&&!r)return;Yr=r?i:null;let O=yr?null:t.clipboardData;O?(t.preventDefault(),O.clearData(),O.setData("text/plain",i)):function(e,t){let i=e.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=t,n.focus(),n.selectionEnd=t.length,n.selectionStart=0,setTimeout((()=>{n.remove(),e.focus()}),50)}(e,i),"cut"!=t.type||e.state.readOnly||e.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"})},Xr.focus=Xr.blur=e=>{setTimeout((()=>{e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)},Xr.compositionstart=Xr.compositionupdate=e=>{null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0,e.docView.compositionDeco.size&&(e.observer.flush(),Nr(e,!0)))},Xr.compositionend=e=>{e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionFirstChange=null,setTimeout((()=>{e.inputState.composing<0&&Nr(e,!1)}),50)},Xr.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Xr.beforeinput=(e,t)=>{var i;let n;if(qi.chrome&&qi.android&&(n=Qr.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(n.key,n.keyCode),"Backspace"==n.key||"Delete"==n.key)){let t=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout((()=>{var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}};const Zr=["pre-wrap","normal","pre-line","break-spaces"];class zr{constructor(){this.doc=m.empty,this.lineWrapping=!1,this.direction=An.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength)),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForStyle(e,t){return Zr.indexOf(e)>-1!=this.lineWrapping||this.direction!=t}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,o=Math.round(i)!=Math.round(this.lineHeight)||this.lineWrapping!=s||this.direction!=t;if(this.lineWrapping=s,this.direction=t,this.lineHeight=i,this.charWidth=n,this.lineLength=r,o){this.heightSamples={};for(let e=0;et.moveY(e))):this.type):this}}var Gr=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(Gr||(Gr={}));class Ir{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>.001&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return Ir.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,n){let r=this;for(let O=n.length-1;O>=0;O--){let{fromA:s,toA:o,fromB:a,toB:l}=n[O],h=r.lineAt(s,Gr.ByPosNoHeight,t,0,0),c=h.to>=o?h:r.lineAt(o,Gr.ByPosNoHeight,t,0,0);for(l+=c.to-o,o=c.to;O>0&&h.from<=n[O-1].toA;)s=n[O-1].fromA,a=n[O-1].fromB,O--,s2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),i+=1+r.break,n-=r.size}else{if(!(r>2*n))break;{let t=e[i];t.break?e.splice(i,1,t.left,null,t.right):e.splice(i,1,t.left,t.right),i+=2+t.break,r-=t.size}}else if(n0){let e=i[i.length-1];e instanceof Dr?i[i.length-1]=new Dr(e.length+n):i.push(null,new Dr(n-1))}if(e>0){let t=i[0];t instanceof Dr?i[0]=new Dr(e+t.length):i.unshift(new Dr(e-1),null)}return Ir.of(i)}decomposeLeft(e,t){t.push(new Dr(e-1),null)}decomposeRight(e,t){t.push(null,new Dr(this.length-e-1))}updateHeight(e,t=0,i=!1,n){let r=t+this.length;if(n&&n.from<=t+this.length&&n.more){let i=[],O=Math.max(t,n.from),s=-1,o=e.heightChanged;for(n.from>t&&i.push(new Dr(n.from-t-1).updateHeight(e,t));O<=r&&n.more;){let t=e.doc.lineAt(O).length;i.length&&i.push(null);let r=n.heights[n.index++];-1==s?s=r:Math.abs(r-s)>=.001&&(s=-2);let o=new Er(t,r);o.outdated=!1,i.push(o),O+=t+1}O<=r&&i.push(null,new Dr(r-O).updateHeight(e,O));let a=Ir.of(i);return e.heightChanged=o||s<0||Math.abs(a.height-this.height)>=.001||Math.abs(s-this.lines(e.doc,t).lineHeight)>=.001,a}return(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class Mr extends Ir{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return 1&this.flags}blockAt(e,t,i,n){let r=i+this.left.height;return es))return a;let l=t==Gr.ByPosNoHeight?Gr.ByPosNoHeight:Gr.ByPos;return o?a.join(this.right.lineAt(s,l,i,O,s)):this.left.lineAt(s,l,i,n,r).join(a)}forEachLine(e,t,i,n,r,O){let s=n+this.left.height,o=r+this.left.length+this.break;if(this.break)e=o&&this.right.forEachLine(e,t,i,s,o,O);else{let a=this.lineAt(o,Gr.ByPos,i,n,r);e=e&&a.from<=t&&O(a),t>a.to&&this.right.forEachLine(a.to+1,t,i,s,o,O)}}replace(e,t,i){let n=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,i));let r=[];e>0&&this.decomposeLeft(e,r);let O=r.length;for(let e of i)r.push(e);if(e>0&&Lr(r,O-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,n=i+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e2*t.size||t.size>2*e.size?Ir.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,n){let{left:r,right:O}=this,s=t+r.length+this.break,o=null;return n&&n.from<=t+r.length&&n.more?o=r=r.updateHeight(e,t,i,n):r.updateHeight(e,t,i),n&&n.from<=s+O.length&&n.more?o=O=O.updateHeight(e,s,i,n):O.updateHeight(e,s,i),o?this.balanced(r,O):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Lr(e,t){let i,n;null==e[t]&&(i=e[t-1])instanceof Dr&&(n=e[t+1])instanceof Dr&&e.splice(t-1,3,new Dr(i.length+1+n.length))}class Br{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Er?i.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Er(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=5)&&this.addLineDeco(n,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Er(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new Dr(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Er)return e;let t=new Er(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine(),e.type!=Ki.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=Ki.WidgetBefore&&(this.covering=e)}addLineDeco(e,t){let i=this.ensureLine();i.length+=t,i.collapsed+=t,i.widgetHeight=Math.max(i.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof Er||this.isCovered?(this.writtenToe.clientHeight||e.scrollWidth>e.clientWidth)&&"visible"!=i.overflow){let t=e.getBoundingClientRect();n=Math.max(n,t.left),r=Math.min(r,t.right),O=Math.max(O,t.top),s=Math.min(s,t.bottom)}t="absolute"==i.position||"fixed"==i.position?e.offsetParent:e.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:n-i.left,right:Math.max(n,r)-i.left,top:O-(i.top+t),bottom:Math.max(O,s)-(i.top+t)}}function Hr(e,t){let i=e.getBoundingClientRect();return{left:0,right:i.right-i.left,top:t,bottom:i.bottom-(i.top+t)}}class Jr{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;ie.draw(!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let n=i?t.head:t.anchor;if(!e.some((({from:e,to:t})=>n>=e&&n<=t))){let{from:t,to:i}=this.lineBlockAt(n);e.push(new iO(t,i))}}this.viewports=e.sort(((e,t)=>e.from-t.from)),this.scaler=this.heightMap.height<=7e6?aO:new lO(this.heightOracle.doc,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,(e=>{this.viewportLines.push(1==this.scaler.scale?e:hO(e,this.scaler))}))}update(e,t=null){let i=this.state;this.state=e.state;let n=this.state.facet(Tn),r=e.changedRanges,O=Vn.extendWithRanges(r,function(e,t,i){let n=new Kr;return Wt.compare(e,t,i,n,0),n.changes}(e.startState.facet(Tn),n,e?e.changes:T.empty(this.state.doc.length))),s=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(n,i.doc,this.heightOracle.setDoc(this.state.doc),O),this.heightMap.height!=s&&(e.flags|=2);let o=O.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heado.to)||!this.viewportIsAppropriate(o))&&(o=this.getViewport(0,t));let a=!e.changes.empty||2&e.flags||o.from!=this.viewport.from||o.to!=this.viewport.to;this.viewport=o,this.updateForViewport(),a&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),n=this.heightOracle,r=i.whiteSpace,O="rtl"==i.direction?An.RTL:An.LTR,s=this.heightOracle.mustRefreshForStyle(r,O),o=s||this.mustMeasureContent||this.contentDOMHeight!=t.clientHeight,a=0,l=0;if(this.editorWidth!=e.scrollDOM.clientWidth&&(n.lineWrapping&&(o=!0),this.editorWidth=e.scrollDOM.clientWidth,a|=8),o){this.mustMeasureContent=!1,this.contentDOMHeight=t.clientHeight;let e=parseInt(i.paddingTop)||0,n=parseInt(i.paddingBottom)||0;this.paddingTop==e&&this.paddingBottom==n||(a|=8,this.paddingTop=e,this.paddingBottom=n)}let h=(this.printing?Hr:Fr)(t,this.paddingTop),c=h.top-this.pixelViewport.top,u=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let f=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(f!=this.inView&&(this.inView=f,f&&(o=!0)),!this.inView)return 0;let d=t.clientWidth;if(this.contentDOMWidth==d&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=d,this.editorHeight=e.scrollDOM.clientHeight,a|=8),o){let t=e.docView.measureVisibleLineHeights();if(n.mustRefreshForHeights(t)&&(s=!0),s||n.lineWrapping&&Math.abs(d-this.contentDOMWidth)>n.charWidth){let{lineHeight:i,charWidth:o}=e.docView.measureTextSize();s=n.refresh(r,O,i,o,d/o,t),s&&(e.docView.minWidth=0,a|=8)}c>0&&u>0?l=Math.max(c,u):c<0&&u<0&&(l=Math.min(c,u)),n.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(n,0,s,new Cr(this.viewport.from,t)),n.heightChanged&&(a|=2)}let p=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return p&&(this.viewport=this.getViewport(l,this.scrollTarget)),this.updateForViewport(),(2&a||p)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps)),a|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),a}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),n=this.heightMap,r=this.state.doc,{visibleTop:O,visibleBottom:s}=this,o=new iO(n.lineAt(O-1e3*i,Gr.ByHeight,r,0,0).from,n.lineAt(s+1e3*(1-i),Gr.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(eo.to){let i,O=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),s=n.lineAt(e,Gr.ByPos,r,0,0);i="center"==t.y?(s.top+s.bottom)/2-O/2:"start"==t.y||"nearest"==t.y&&e=s+Math.max(10,Math.min(i,250)))&&n>O-2e3&&ri.from&&s.push({from:i.from,to:n}),r=i.from&&o.from<=i.to&&sO(s,o.from-10,o.from+10),!o.empty&&o.to>=i.from&&o.to<=i.to&&sO(s,o.to-10,o.to+10);for(let{from:n,to:r}of s)r-n>1e3&&t.push(oO(e,(e=>e.from>=i.from&&e.to<=i.to&&Math.abs(e.from-n)<1e3&&Math.abs(e.to-r)<1e3))||new Jr(n,r,this.gapSize(i,n,r,O)))}return t}gapSize(e,t,i,n){let r=OO(n,i)-OO(n,t);return this.heightOracle.lineWrapping?e.height*r:n.total*this.heightOracle.charWidth*r}updateLineGaps(e){Jr.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Fi.set(e.map((e=>e.draw(this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.state.facet(Tn);this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Wt.spans(e,this.viewport.from,this.viewport.to,{span(e,i){t.push({from:e,to:i})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,i)=>e.from!=t[i].from||e.to!=t[i].to));return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||hO(this.heightMap.lineAt(e,Gr.ByPos,this.state.doc,0,0),this.scaler)}lineBlockAtHeight(e){return hO(this.heightMap.lineAt(this.scaler.fromDOM(e),Gr.ByHeight,this.state.doc,0,0),this.scaler)}elementAtHeight(e){return hO(this.heightMap.blockAt(this.scaler.fromDOM(e),this.state.doc,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class iO{constructor(e,t){this.from=e,this.to=t}}function nO(e,t,i){let n=[],r=e,O=0;return Wt.spans(i.facet(Tn),e,t,{span(){},point(e,t){e>r&&(n.push({from:r,to:e}),O+=e-r),r=t}},20),r=1)return t[t.length-1].to;let n=Math.floor(e*i);for(let e=0;;e++){let{from:i,to:r}=t[e],O=r-i;if(n<=O)return i+n;n-=O}}function OO(e,t){let i=0;for(let{from:n,to:r}of e.ranges){if(t<=r){i+=t-n;break}i+=r-n}return i/e.total}function sO(e,t,i){for(let n=0;nt){let O=[];r.fromi&&O.push({from:i,to:r.to}),e.splice(n,1,...O),n+=O.length-1}}}function oO(e,t){for(let i of e)if(t(i))return i}const aO={toDOM:e=>e,fromDOM:e=>e,scale:1};class lO{constructor(e,t,i){let n=0,r=0,O=0;this.viewports=i.map((({from:i,to:r})=>{let O=t.lineAt(i,Gr.ByPos,e,0,0).top,s=t.lineAt(r,Gr.ByPos,e,0,0).bottom;return n+=s-O,{from:i,to:r,top:O,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-n)/(t.height-n);for(let e of this.viewports)e.domTop=O+(e.top-r)*this.scale,O=e.domBottom=e.domTop+(e.bottom-e.top),r=e.bottom}toDOM(e){for(let t=0,i=0,n=0;;t++){let r=thO(e,t))):e.type)}const cO=I.define({combine:e=>e.join(" ")}),uO=I.define({combine:e=>e.indexOf(!0)>-1}),fO=wt.newName(),dO=wt.newName(),pO=wt.newName(),$O={"&light":"."+dO,"&dark":"."+pO};function QO(e,t,i){return new wt(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!i||!i[t])throw new RangeError(`Unsupported selector: ${t}`);return i[t]})):e+" "+t})}const mO=QO("."+fO,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},".cm-cursor, .cm-dropCursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},$O),gO={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},PO=qi.ie&&qi.ie_version<=11;class XO{constructor(e,t,i){this.view=e,this.onChange=t,this.onScrollChanged=i,this.active=!1,this.selectionRange=new li,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(qi.ie&&qi.ie_version<=11||qi.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),PO&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),window.addEventListener("resize",this.onResize=this.onResize.bind(this)),"function"==typeof ResizeObserver&&(this.resize=new ResizeObserver((()=>{this.view.docView.lastUpdate{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange(),this.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,i)=>t!=e[i])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:t}=this,i=this.selectionRange;if(t.state.facet(Xn)?t.root.activeElement!=this.dom:!ei(t.dom,i))return;let n=i.anchorNode&&t.docView.nearest(i.anchorNode);n&&n.ignoreEvent(e)||((qi.ie&&qi.ie_version<=11||qi.android&&qi.chrome)&&!t.state.selection.main.empty&&i.focusNode&&ii(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1))}readSelectionRange(){let{root:e}=this.view,t=Ht(e),i=qi.safari&&11==e.nodeType&&function(){let e=document.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}()==this.view.contentDOM&&function(e){let t=null;function i(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",i,!0),document.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),!t)return null;let n=t.startContainer,r=t.startOffset,O=t.endContainer,s=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor);return ii(o.node,o.offset,O,s)&&([n,r,O,s]=[O,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:O,focusOffset:s}}(this.view)||t;return!this.selectionRange.eq(i)&&(this.selectionRange.setRange(i),this.selectionChanged=!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(1==i.nodeType)!t&&e{let e=this.delayedAndroidKey;this.delayedAndroidKey=null;let t=this.view.state;di(this.view.contentDOM,e.key,e.keyCode)?this.processRecords():this.flush(),this.view.state==t&&this.view.update([])})),this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t})}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=window.setTimeout((()=>{this.delayedFlush=-1,this.flush()}),20))}forceFlush(){this.delayedFlush>=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}processRecords(){let e=this.queue;for(let t of this.observer.takeRecords())e.push(t);e.length&&(this.queue=[]);let t=-1,i=-1,n=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(n=!0),-1==t?({from:t,to:i}=e):(t=Math.min(e.from,t),i=Math.max(e.to,i)))}return{from:t,to:i,typeOver:n}}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return;e&&this.readSelectionRange();let{from:t,to:i,typeOver:n}=this.processRecords(),r=this.selectionChanged&&ei(this.dom,this.selectionRange);if(t<0&&!r)return;this.selectionChanged=!1;let O=this.view.state;this.onChange(t,i,n),this.view.state==O&&this.view.update([])}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.dirty|=4),"childList"==e.type){let i=yO(t,e.previousSibling||e.target.previousSibling,-1),n=yO(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:n?t.posBefore(n):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}destroy(){var e,t,i;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(i=this.resize)||void 0===i||i.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);window.removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.onResize),window.removeEventListener("beforeprint",this.onPrint),this.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout)}}function yO(e,t,i){for(;t;){let n=mi.get(t);if(n&&n.parent==e)return n;let r=t.parentNode;t=r!=e.dom?r:i>0?t.nextSibling:t.previousSibling}return null}function wO(e,t,i,n){let r,O,s=e.state.selection.main;if(t>-1){let n=e.docView.domBoundsAround(t,i,0);if(!n||e.state.readOnly)return;let{from:o,to:a}=n,l=e.docView.impreciseHead||e.docView.impreciseAnchor?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:O}=e.observer.selectionRange;return i&&(t.push(new Hn(i,n)),r==i&&O==n||t.push(new Hn(r,O))),t}(e),h=new Kn(l,e.state);h.readRange(n.startDOM,n.endDOM);let c=s.from,u=null;(8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100||qi.android&&h.text.length0&&o>0&&e.charCodeAt(s-1)==t.charCodeAt(o-1);)s--,o--;"end"==n&&(i-=s+Math.max(0,O-Math.min(s,o))-O);s=s?O-i:0,o=O+(o-s),s=O):o=o?O-i:0,s=O+(s-o),o=O);return{from:O,toA:s,toB:o}}(e.state.doc.sliceString(o,a,"￿"),h.text,c-o,u);f&&(qi.chrome&&13==e.inputState.lastKeyCode&&f.toB==f.from+2&&"￿￿"==h.text.slice(f.from,f.toB)&&f.toB--,r={from:o+f.from,to:o+f.toA,insert:m.of(h.text.slice(f.from,f.toB).split("￿"))}),O=function(e,t){if(0==e.length)return null;let i=e[0].pos,n=2==e.length?e[1].pos:i;return i>-1&&n>-1?z.single(i+t,n+t):null}(l,o)}else if(e.hasFocus||!e.state.facet(Xn)){let t=e.observer.selectionRange,{impreciseHead:i,impreciseAnchor:n}=e.docView,r=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!Jt(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),o=n&&n.node==t.anchorNode&&n.offset==t.anchorOffset||!Jt(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset);r==s.head&&o==s.anchor||(O=z.single(o,r))}if(r||O)if(!r&&n&&!s.empty&&O&&O.main.empty?r={from:s.from,to:s.to,insert:e.state.doc.slice(s.from,s.to)}:r&&r.from>=s.from&&r.to<=s.to&&(r.from!=s.from||r.to!=s.to)&&s.to-s.from-(r.to-r.from)<=4&&(r={from:s.from,to:s.to,insert:e.state.doc.slice(s.from,r.from).append(r.insert).append(e.state.doc.slice(r.to,s.to))}),r){let t=e.state;if(qi.ios&&e.inputState.flushIOSKey(e))return;if(qi.android&&(r.from==s.from&&r.to==s.to&&1==r.insert.length&&2==r.insert.lines&&di(e.contentDOM,"Enter",13)||r.from==s.from-1&&r.to==s.to&&0==r.insert.length&&di(e.contentDOM,"Backspace",8)||r.from==s.from&&r.to==s.to+1&&0==r.insert.length&&di(e.contentDOM,"Delete",46)))return;let i,n=r.insert.toString();if(e.state.facet(pn).some((t=>t(e,r.from,r.to,n))))return;if(e.inputState.composing>=0&&e.inputState.composing++,r.from>=s.from&&r.to<=s.to&&r.to-r.from>=(s.to-s.from)/3&&(!O||O.main.empty&&O.main.from==r.from+r.insert.length)&&e.inputState.composing<0){let n=s.fromr.to?t.sliceDoc(r.to,s.to):"";i=t.replaceSelection(e.state.toText(n+r.insert.sliceString(0,void 0,e.state.lineBreak)+O))}else{let n=t.changes(r),o=O&&!t.selection.main.eq(O.main)&&O.main.to<=n.newLength?O.main:void 0;if(t.selection.ranges.length>1&&e.inputState.composing>=0&&r.to<=s.to&&r.to>=s.to-10){let O=e.state.sliceDoc(r.from,r.to),a=tr(e)||e.state.doc.lineAt(s.head),l=s.to-r.to,h=s.to-s.from;i=t.changeByRange((i=>{if(i.from==s.from&&i.to==s.to)return{changes:n,range:o||i.map(n)};let c=i.to-l,u=c-O.length;if(i.to-i.from!=h||e.state.sliceDoc(u,c)!=O||a&&i.to>=a.from&&i.from<=a.to)return{range:i};let f=t.changes({from:u,to:c,insert:r.insert}),d=i.to-s.to;return{changes:f,range:o?z.range(Math.max(0,o.anchor+d),Math.max(0,o.head+d)):i.map(f)}}))}else i={changes:n,selection:o&&t.selection.replaceRange(o)}}let o="input.type";e.composing&&(o+=".compose",e.inputState.compositionFirstChange&&(o+=".start",e.inputState.compositionFirstChange=!1)),e.dispatch(i,{scrollIntoView:!0,userEvent:o})}else if(O&&!O.main.eq(s)){let t=!1,i="select";e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),i=e.inputState.lastSelectionOrigin),e.dispatch({selection:O,scrollIntoView:t,userEvent:i})}}class bO{constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(e=>this.update([e])),this.dispatch=this.dispatch.bind(this),this.root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new tO(e.state||Te.create()),this.plugins=this.state.facet(xn).map((e=>new vn(e)));for(let e of this.plugins)e.update(this);this.observer=new XO(this,((e,t,i)=>{wO(this,e,t,i)}),(e=>{this.inputState.runScrollHandlers(this,e),this.observer.intersecting&&this.measure()})),this.inputState=new $r(this),this.docView=new Jn(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}dispatch(...e){this._dispatch(1==e.length&&e[0]instanceof Pe?e[0]:this.state.update(...e))}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,i=!1,n=this.state;for(let t of e){if(t.startState!=n)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");n=t.state}if(this.destroyed)return void(this.viewState.state=n);if(n.facet(Te.phrases)!=this.state.facet(Te.phrases))return this.setState(n);t=new qn(this,n,e);let r=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(r&&(r=r.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;r=new mn(e.empty?e:z.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is($n)?r=new mn(e.value):e.is(Qn)?r=new mn(e.value,"center"):e.is(gn)&&(r=e.value)}this.viewState.update(t,r),this.bidiCache=vO.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),i=this.docView.update(t),this.state.facet(_n)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(i,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(cO)!=t.state.facet(cO)&&(this.viewState.mustMeasureContent=!0),(i||r||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!t.empty)for(let e of this.state.facet(dn))e(t)}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new tO(e),this.plugins=e.facet(xn).map((e=>new vn(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView=new Jn(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(xn),i=e.state.facet(xn);if(t!=i){let n=[];for(let r of i){let i=t.indexOf(r);if(i<0)n.push(new vn(r));else{let t=this.plugins[i];t.mustUpdate=e,n.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=n,this.pluginMap.clear(),this.inputState.ensureHandlers(this)}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.flush();let t=null;try{for(let e=0;;e++){this.updateState=1;let i=this.viewport,n=this.viewState.measure(this);if(!n&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let r=[];4&n||([this.measureRequests,r]=[r,this.measureRequests]);let O=r.map((e=>{try{return e.read(this)}catch(e){return Pn(this.state,e),kO}})),s=new qn(this,this.state),o=!1,a=!1;s.flags|=n,t?t.flags|=n:t=s,this.updateState=2,s.empty||(this.updatePlugins(s),this.inputState.update(s),this.updateAttrs(),o=this.docView.update(s));for(let e=0;e{Li(this.contentDOM,this.contentAttrs,t),Li(this.dom,this.editorAttrs,e)})),this.editorAttrs=e,this.contentAttrs=t}showAnnouncements(e){let t=!0;for(let i of e)for(let e of i.effects)e.is(bO.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(_n),wt.mount(this.root,this.styleModules.concat(mO).reverse())}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((()=>this.measure()))),e){if(null!=e.key)for(let t=0;tt.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}blockAtHeight(e,t){let i=SO(t,this);return this.elementAtHeight(e-i).moveY(i)}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}visualLineAtHeight(e,t){let i=SO(t,this);return this.lineBlockAtHeight(e-i).moveY(i)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}viewportLines(e,t){let i=SO(t,this);for(let t of this.viewportLineBlocks)e(t.moveY(i))}get viewportLineBlocks(){return this.viewState.viewportLines}visualLineAt(e,t=0){return this.lineBlockAt(e).moveY(t+this.viewState.paddingTop)}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return pr(this,e,dr(this,e,t,i))}moveByGroup(e,t){return pr(this,e,dr(this,e,t,(t=>function(e,t,i){let n=e.state.charCategorizer(t),r=n(i);return e=>{let t=n(e);return r==ke.Space&&(r=t),r==t}}(this,e.head,t))))}moveToLineBoundary(e,t,i=!0){return function(e,t,i,n){let r=e.state.doc.lineAt(t.head),O=n&&e.lineWrapping?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(O){let t=e.dom.getBoundingClientRect(),n=e.posAtCoords({x:i==(e.textDirection==An.LTR)?t.right-1:t.left+1,y:(O.top+O.bottom)/2});if(null!=n)return z.cursor(n,i?-1:1)}let s=rn.find(e.docView,t.head),o=s?i?s.posAtEnd:s.posAtStart:i?r.to:r.from;return z.cursor(o,i?-1:1)}(this,e,t,i)}moveVertically(e,t,i){return pr(this,e,function(e,t,i,n){let r=t.head,O=i?1:-1;if(r==(i?e.state.doc.length:0))return z.cursor(r,t.assoc);let s,o=t.goalColumn,a=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(r),h=e.documentTop;if(l)null==o&&(o=l.left-a.left),s=O<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(r-h);null==o&&(o=Math.min(a.right-a.left,e.defaultCharacterWidth*(r-t.from))),s=(O<0?t.top:t.bottom)+h}let c=a.left+o,u=null!=n?n:e.defaultLineHeight>>1;for(let i=0;;i+=10){let n=s+(u+i)*O,l=ur(e,{x:c,y:n},!1,O);if(na.bottom||(O<0?lr))return z.cursor(l,t.assoc,void 0,o)}}(this,e,t,i))}scrollPosIntoView(e){this.dispatch({effects:$n.of(z.cursor(e))})}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),ur(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(e),r=this.bidiSpans(n);return oi(i,r[En.find(r,e-n.from,-1,t)].dir==An.LTR==t>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.heightOracle.direction}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>xO)return Mn(e.length);let t=this.textDirection;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==t)return i.order;let i=function(e,t){let i=e.length,n=t==Yn?1:2,r=t==Yn?2:1;if(!e||1==n&&!jn.test(e))return Mn(i);for(let t=0,r=n,O=n;t=0;e-=3)if(Gn[e+1]==-O){let t=Gn[e+2],i=2&t?n:4&t?1&t?r:n:0;i&&(Dn[o]=Dn[Gn[e]]=i),a=e;break}}else{if(189==Gn.length)break;Gn[a++]=o,Gn[a++]=t,Gn[a++]=l}else if(2==(s=Dn[o])||1==s){let e=s==n;l=e?0:1;for(let t=a-3;t>=0;t-=3){let i=Gn[t+2];if(2&i)break;if(e)Gn[t+2]|=2;else{if(4&i)break;Gn[t+2]|=4}}}for(let e=0;et;){let e=i,n=2!=Dn[--i];for(;i>t&&n==(2!=Dn[i-1]);)i--;O.push(new En(i,e,n?2:1))}else O.push(new En(t,e,0))}else for(let e=0;eDate.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{ui(this.contentDOM),this.docView.updateSelection()}))}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return gn.of(new mn("number"==typeof e?z.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return Sn.define((()=>({})),{eventHandlers:e})}static theme(e,t){let i=wt.newName(),n=[cO.of(i),_n.of(QO(`.${i}`,e))];return t&&t.dark&&n.push(uO.of(!0)),n}static baseTheme(e){return ie.lowest(_n.of(QO("."+fO,e,$O)))}}bO.scrollTo=$n,bO.centerOn=Qn,bO.styleModule=_n,bO.inputHandler=pn,bO.exceptionSink=fn,bO.updateListener=dn,bO.editable=Xn,bO.mouseSelectionStyle=un,bO.dragMovesSelection=cn,bO.clickAddsSelectionRange=hn,bO.decorations=Tn,bO.darkTheme=uO,bO.contentAttributes=Wn,bO.editorAttributes=Rn,bO.lineWrapping=bO.contentAttributes.of({class:"cm-lineWrapping"}),bO.announce=ge.define();const xO=4096;function SO(e,t){return(null==e?t.contentDOM.getBoundingClientRect().top:e)+t.viewState.paddingTop}const kO={};class vO{constructor(e,t,i,n){this.from=e,this.to=t,this.dir=i,this.order=n}static update(e,t){if(t.empty)return e;let i=[],n=e.length?e[e.length-1].dir:An.LTR;for(let r=Math.max(0,e.length-10);r=0;r--){let t=n[r],O="function"==typeof t?t(e):t;O&&Di(O,i)}return i}const WO=qi.mac?"mac":qi.windows?"win":qi.linux?"linux":"key";function TO(e,t,i){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==i&&t.shiftKey&&(e="Shift-"+e),e}const _O=bO.domEventHandlers({keydown:(e,t)=>NO(AO(t.state),e,t,"editor")}),VO=I.define({enables:_O}),qO=new WeakMap;function AO(e){let t=e.facet(VO),i=qO.get(t);return i||qO.set(t,i=function(e,t=WO){let i=Object.create(null),n=Object.create(null),r=(e,t)=>{let i=n[e];if(null==i)n[e]=t;else if(i!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},O=(e,n,O,s)=>{let o=i[e]||(i[e]=Object.create(null)),a=n.split(/ (?!$)/).map((e=>function(e,t){const i=e.split(/-(?!$)/);let n,r,O,s,o=i[i.length-1];"Space"==o&&(o=" ");for(let e=0;e{let n=YO={view:t,prefix:i,scope:e};return setTimeout((()=>{YO==n&&(YO=null)}),4e3),!0}]})}let l=a.join(" ");r(l,!1);let h=o[l]||(o[l]={preventDefault:!1,commands:[]});h.commands.push(O),s&&(h.preventDefault=!0)};for(let i of e){let e=i[t]||i.key;if(e)for(let t of i.scope?i.scope.split(" "):["editor"])O(t,e,i.run,i.preventDefault),i.shift&&O(t,"Shift-"+e,i.shift,i.preventDefault)}return i}(t.reduce(((e,t)=>e.concat(t)),[]))),i}let YO=null;function NO(e,t,i,n){let r=function(e){var t=!(Bt&&(e.ctrlKey||e.altKey||e.metaKey)||(Et||Lt)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?It:Gt)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),O=1==r.length&&" "!=r,s="",o=!1;YO&&YO.view==i&&YO.scope==n&&(s=YO.prefix+" ",(o=mr.indexOf(t.keyCode)<0)&&(YO=null));let a,l=e=>{if(e){for(let t of e.commands)if(t(i))return!0;e.preventDefault&&(o=!0)}return!1},h=e[n];if(h){if(l(h[s+TO(r,t,!O)]))return!0;if(O&&(t.shiftKey||t.altKey||t.metaKey)&&(a=Gt[t.keyCode])&&a!=r){if(l(h[s+TO(a,t,!0)]))return!0}else if(O&&t.shiftKey&&l(h[s+TO(r,t,!0)]))return!0}return o}const ZO=!qi.ios,zO=I.define({combine:e=>_e(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function CO(e={}){return[zO.of(e),GO,jO]}class UO{constructor(e,t,i,n,r){this.left=e,this.top=t,this.width=i,this.height=n,this.className=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}const GO=Sn.fromClass(class{constructor(e){this.view=e,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=e.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(zO).cursorBlinkRate+"ms"}update(e){let t=e.startState.facet(zO)!=e.state.facet(zO);(t||e.selectionSet||e.geometryChanged||e.viewportChanged)&&this.view.requestMeasure(this.measureReq),e.transactions.some((e=>e.scrollIntoView))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),t&&this.setBlinkRate()}readPos(){let{state:e}=this.view,t=e.facet(zO),i=e.selection.ranges.map((e=>e.empty?[]:function(e,t){if(t.to<=e.viewport.from||t.from>=e.viewport.to)return[];let i=Math.max(t.from,e.viewport.from),n=Math.min(t.to,e.viewport.to),r=e.textDirection==An.LTR,O=e.contentDOM,s=O.getBoundingClientRect(),o=EO(e),a=window.getComputedStyle(O.firstChild),l=s.left+parseInt(a.paddingLeft)+Math.min(0,parseInt(a.textIndent)),h=s.right-parseInt(a.paddingRight),c=MO(e,i),u=MO(e,n),f=c.type==Ki.Text?c:null,d=u.type==Ki.Text?u:null;if(e.lineWrapping&&(f&&(f=DO(e,i,f)),d&&(d=DO(e,n,d))),f&&d&&f.from==d.from)return $(Q(t.from,t.to,f));{let i=f?Q(t.from,null,f):m(c,!1),n=d?Q(null,t.to,d):m(u,!0),r=[];return(f||c).to<(d||u).from-1?r.push(p(l,i.bottom,h,n.top)):i.bottomc&&n.from=O)break;o>r&&a(Math.max(e,r),null==t&&e<=c,Math.min(o,O),null==i&&o>=u,s.dir)}if(r=n.to+1,r>=O)break}return 0==o.length&&a(c,null==t,u,null==i,e.textDirection),{top:O,bottom:s,horizontal:o}}function m(e,t){let i=s.top+(t?e.top:e.bottom);return{top:i,bottom:i,horizontal:[]}}}(this.view,e))).reduce(((e,t)=>e.concat(t))),n=[];for(let i of e.selection.ranges){let r=i==e.selection.main;if(i.empty?!r||ZO:t.drawRangeCursor){let e=LO(this.view,i,r);e&&n.push(e)}}return{rangePieces:i,cursors:n}}drawSel({rangePieces:e,cursors:t}){if(e.length!=this.rangePieces.length||e.some(((e,t)=>!e.eq(this.rangePieces[t])))){this.selectionLayer.textContent="";for(let t of e)this.selectionLayer.appendChild(t.draw());this.rangePieces=e}if(t.length!=this.cursors.length||t.some(((e,t)=>!e.eq(this.cursors[t])))){let e=this.cursorLayer.children;if(e.length!==t.length){this.cursorLayer.textContent="";for(const e of t)this.cursorLayer.appendChild(e.draw())}else t.forEach(((t,i)=>t.adjust(e[i])));this.cursors=t}}destroy(){this.selectionLayer.remove(),this.cursorLayer.remove()}}),IO={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};ZO&&(IO[".cm-line"].caretColor="transparent !important");const jO=ie.highest(bO.theme(IO));function EO(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==An.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}function DO(e,t,i){let n=z.cursor(t);return{from:Math.max(i.from,e.moveToLineBoundary(n,!1,!0).from),to:Math.min(i.to,e.moveToLineBoundary(n,!0,!0).from),type:Ki.Text}}function MO(e,t){let i=e.lineBlockAt(t);if(Array.isArray(i.type))for(let e of i.type)if(e.to>t||e.to==t&&(e.to==i.to||e.type==Ki.Text))return e;return i}function LO(e,t,i){let n=e.coordsAtPos(t.head,t.assoc||1);if(!n)return null;let r=EO(e);return new UO(n.left-r.left,n.top-r.top,-1,n.bottom-n.top,i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}function BO(e,t,i,n,r){t.lastIndex=0;for(let O,s=e.iterRange(i,n),o=i;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;O=t.exec(s.value);)r(o+O.index,o+O.index+O[0].length,O)}class KO{constructor(e){let{regexp:t,decoration:i,boundary:n,maxLength:r=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");this.regexp=t,this.getDeco="function"==typeof i?i:()=>i,this.boundary=n,this.maxLength=r}createDeco(e){let t=new Tt;for(let{from:i,to:n}of function(e,t){let i=e.visibleRanges;if(1==i.length&&i[0].from==e.viewport.from&&i[0].to==e.viewport.to)return i;let n=[];for(let{from:r,to:O}of i)r=Math.max(e.state.doc.lineAt(r).from,r-t),O=Math.min(e.state.doc.lineAt(O).to,O+t),n.length&&n[n.length-1].to>=r?n[n.length-1].to=O:n.push({from:r,to:O});return n}(e,this.maxLength))BO(e.state.doc,this.regexp,i,n,((i,n,r)=>t.add(i,n,this.getDeco(r,e,i))));return t.finish()}updateDeco(e,t){let i=1e9,n=-1;return e.docChanged&&e.changes.iterChanges(((t,r,O,s)=>{s>e.view.viewport.from&&O1e3?this.createDeco(e.view):n>-1?this.updateRange(e.view,t.map(e.changes),i,n):t}updateRange(e,t,i,n){for(let r of e.visibleRanges){let O=Math.max(r.from,i),s=Math.min(r.to,n);if(s>O){let i=e.state.doc.lineAt(O),n=i.toi.from;O--)if(this.boundary.test(i.text[O-1-i.from])){o=O;break}for(;sh.push(this.getDeco(n,e,t).range(t,i))));t=t.update({filterFrom:o,filterTo:a,filter:(e,t)=>ea,add:h})}}return t}}const FO=null!=/x/.unicode?"gu":"g",HO=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮\ufeff-]",FO),JO={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let es=null;const ts=I.define({combine(e){let t=_e(e,{render:null,specialChars:HO,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==es&&"undefined"!=typeof document&&document.body){let t=document.body.style;es=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return es||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,FO)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,FO)),t}});function is(e={}){return[ts.of(e),ns||(ns=Sn.fromClass(class{constructor(e){this.view=e,this.decorations=Fi.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(ts)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new KO({regexp:e.specialChars,decoration:(t,i,n)=>{let{doc:r}=i.state,O=f(t[0],0);if(9==O){let e=r.lineAt(n),t=i.state.tabSize,O=$(e.text,t,n-e.from);return Fi.replace({widget:new Os((t-O%t)*this.view.defaultCharacterWidth)})}return this.decorationCache[O]||(this.decorationCache[O]=Fi.replace({widget:new rs(e,O)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(ts);e.startState.facet(ts)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let ns=null;class rs extends Bi{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=function(e){return e>=32?"•":10==e?"␤":String.fromCharCode(9216+e)}(this.code),i=e.state.phrase("Control character")+" "+(JO[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,t);if(n)return n;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Os extends Bi{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class ss extends Bi{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function os(e){return Sn.fromClass(class{constructor(t){this.view=t,this.placeholder=Fi.set([Fi.widget({widget:new ss(e),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?Fi.none:this.placeholder}},{decorations:e=>e.decorations})}var as;const ls=new Ye;function hs(e){return I.define({combine:e?t=>t.concat(e):void 0})}class cs{constructor(e,t,i,n=[]){this.data=e,this.topNode=i,Te.prototype.hasOwnProperty("tree")||Object.defineProperty(Te.prototype,"tree",{get(){return ds(this)}}),this.parser=t,this.extension=[bs.of(this),Te.languageData.of(((e,t,i)=>e.facet(us(e,t,i))))].concat(n)}isActiveAt(e,t,i=-1){return us(e,t,i)==this.data}findRegions(e){let t=e.facet(bs);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],n=(e,t)=>{if(e.prop(ls)==this.data)return void i.push({from:t,to:t+e.length});let r=e.prop(Ye.mounted);if(r){if(r.tree.prop(ls)==this.data){if(r.overlay)for(let e of r.overlay)i.push({from:e.from+t,to:e.to+t});else i.push({from:t,to:t+e.length});return}if(r.overlay){let e=i.length;if(n(r.tree,r.overlay[0].from+t),i.length>e)return}}for(let i=0;ie.isTop?t:void 0))]}))}configure(e){return new fs(this.data,this.parser.configure(e))}get allowsNesting(){return this.parser.wrappers.length>0}}function ds(e){let t=e.field(cs.state,!1);return t?t.tree:Ie.empty}function ps(e,t=e.doc.length){var i;return(null===(i=e.field(cs.state,!1))||void 0===i?void 0:i.context.isDone(t))||!1}class $s{constructor(e,t=e.length){this.doc=e,this.length=t,this.cursorPos=0,this.string="",this.cursor=e.iter()}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Qs=null;class ms{constructor(e,t,i=[],n,r,O,s,o){this.parser=e,this.state=t,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=O,this.skipped=s,this.scheduleOn=o,this.parse=null,this.tempSkipped=[]}startParse(){return this.parser.startParse(new $s(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=Ie.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var i;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(rt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Qs;Qs=this;try{return e()}finally{Qs=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=gs(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:n,treeLen:r,viewport:O,skipped:s}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,i,n,r)=>t.push({fromA:e,toA:i,fromB:n,toB:r}))),i=rt.applyChanges(i,t),n=Ie.empty,r=0,O={from:e.mapPos(O.from,-1),to:e.mapPos(O.to,1)},this.skipped.length){s=[];for(let t of this.skipped){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);ie.from&&(this.fragments=gs(this.fragments,i,n),this.skipped.splice(t--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ot{createParse(t,i,n){let r=n[0].from,O=n[n.length-1].to;return{parsedPos:r,advance(){let t=Qs;if(t){for(let e of n)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=O,new Ie(ze.none,[],[],O-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return Qs}}function gs(e,t,i){return rt.applyChanges(e,[{fromA:t,toA:i,fromB:t,toB:i}])}class Ps{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Ps(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=new ms(e.facet(bs).parser,e,[],Ie.empty,0,{from:0,to:t},[],null);return i.work(20,t)||i.takeTree(),new Ps(i)}}cs.state=B.define({create:Ps.init,update(e,t){for(let e of t.effects)if(e.is(cs.setState))return e.value;return t.startState.facet(bs)!=t.state.facet(bs)?Ps.init(t.state):e.apply(t)}});let Xs=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(Xs=e=>{let t=-1,i=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(i):cancelIdleCallback(t)});const ys="undefined"!=typeof navigator&&(null===(as=navigator.scheduling)||void 0===as?void 0:as.isInputPending)?()=>navigator.scheduling.isInputPending():null,ws=Sn.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(cs.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(cs.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=Xs(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndn+1e3,o=r.context.work((()=>ys&&ys()||Date.now()>O),n+(s?0:1e5));this.chunkBudget-=Date.now()-t,(o||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:cs.setState.of(new Ps(r.context))})),this.chunkBudget>0&&(!o||s)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>Pn(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),bs=I.define({combine:e=>e.length?e[0]:null,enables:[cs.state,ws]});class xs{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Ss{constructor(e,t,i,n,r,O){this.name=e,this.alias=t,this.extensions=i,this.filename=n,this.loadFunc=r,this.support=O,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((e=>this.support=e),(e=>{throw this.loading=null,e})))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new Ss(e.name,(e.alias||[]).concat(e.name).map((e=>e.toLowerCase())),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let i=/\.([^.]+)$/.exec(t);if(i)for(let t of e)if(t.extensions.indexOf(i[1])>-1)return t;return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some((e=>e==t)))return i;if(i)for(let i of e)for(let e of i.alias){let n=t.indexOf(e);if(n>-1&&(e.length>2||!/\w/.test(t[n-1])&&!/\w/.test(t[n+e.length])))return i}return null}}const ks=I.define(),vs=I.define({combine:e=>{if(!e.length)return" ";if(!/^(?: +|\t+)$/.test(e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return e[0]}});function Rs(e){let t=e.facet(vs);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function Ws(e,t){let i="",n=e.tabSize;if(9==e.facet(vs).charCodeAt(0))for(;t>=n;)i+="\t",t-=n;for(let e=0;e=i.from&&n<=i.to?r&&n==e?{text:"",from:e}:(t<0?n-1&&(r+=O-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return $(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:n}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(n);if(e>-1)return e}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Vs=new Ye;function qs(e){let t=e.type.prop(Vs);if(t)return t;let i,n=e.firstChild;if(n&&(i=n.type.prop(Ye.closedBy))){let t=e.lastChild,n=t&&i.indexOf(t.name)>-1;return e=>Cs(e,!0,1,void 0,n&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?Ys:null}function As(e,t,i){for(;e;e=e.parent){let n=qs(e);if(n)return n(new Ns(i,t,e))}return null}function Ys(){return 0}class Ns extends _s{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.node=i}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(Zs(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?As(e,this.pos,this.base):0}}function Zs(e,t){for(let i=t;i;i=i.parent)if(e==i)return!0;return!1}function zs({closing:e,align:t=!0,units:i=1}){return n=>Cs(n,t,i,e)}function Cs(e,t,i,n,r){let O=e.textAfter,s=O.match(/^\s*/)[0].length,o=n&&O.slice(s,s+n.length)==n||r==e.pos+s,a=t?function(e){let t=e.node,i=t.childAfter(t.from),n=t.lastChild;if(!i)return null;let r=e.options.simulateBreak,O=e.state.doc.lineAt(i.from),s=null==r||r<=O.from?O.to:Math.min(O.to,r);for(let e=i.to;;){let r=t.childAfter(e);if(!r||r==n)return null;if(!r.type.isSkipped)return r.from{let n=e&&e.test(i.textAfter);return i.baseIndent+(n?0:t*i.unit)}}function Gs(){return Te.transactionFilter.of((e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let i=e.newDoc,{head:n}=e.newSelection.main,r=i.lineAt(n);if(n>r.from+200)return e;let O=i.sliceString(r.from,n);if(!t.some((e=>e.test(O))))return e;let{state:s}=e,o=-1,a=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==o)continue;o=t.from;let i=Ts(s,t.from);if(null==i)continue;let n=/^\s*/.exec(t.text)[0],r=Ws(s,i);n!=r&&a.push({from:t.from,to:t.from+n.length,insert:r})}return a.length?[e,{changes:a,sequential:!0}]:e}))}const Is=I.define(),js=new Ye;function Es(e){let t=e.firstChild,i=e.lastChild;return t&&t.toi)continue;if(r&&O.from=t&&n.to>i&&(r=n)}}return r}(e,t,i)}let Ls=0;class Bs{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=Ls++}static define(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let t=new Bs([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new Fs;return t=>t.modified.indexOf(e)>-1?t:Fs.get(t.base||t,t.modified.concat(e).sort(((e,t)=>e.id-t.id)))}}let Ks=0;class Fs{constructor(){this.instances=[],this.id=Ks++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find((i=>i.base==e&&function(e,t){return e.length==t.length&&e.every(((e,i)=>e==t[i]))}(t,i.modified)));if(i)return i;let n=[],r=new Bs(n,e,t);for(let e of t)e.instances.push(r);let O=Hs(t);for(let t of e.set)for(let e of O)n.push(Fs.get(t,e));return r}}function Hs(e){let t=[e];for(let i=0;i0&&t+3==e.length){r=1;break}let n=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(O);if(!n)throw new RangeError("Invalid path: "+e);if(i.push("*"==n[0]?null:'"'==n[0][0]?JSON.parse(n[0]):n[0]),t+=n[0].length,t==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){r=0;break}if("/"!=s)throw new RangeError("Invalid path: "+e);O=e.slice(t)}let s=i.length-1,o=i[s];if(!o)throw new RangeError("Invalid path: "+e);let a=new ro(n,r,s>0?i.slice(0,s):null);t[o]=a.sort(t[o])}}return eo.add(t)}const eo=new Ye,to=I.define({combine:e=>e.length?Oo.combinedMatch(e):null}),io=I.define({combine:e=>e.length?e[0].match:null});function no(e){return e.facet(to)||e.facet(io)}class ro{constructor(e,t,i,n){this.tags=e,this.mode=t,this.context=i,this.next=n}sort(e){return!e||e.depthe.facet(bO.darkTheme)==("dark"==t.themeType)?[this]:[]))),this.fallback=r.concat(io.of(this))}match(e,t){if(this.scope&&t!=this.scope)return null;for(let t of e.set){let i=this.map[t.id];if(void 0!==i)return t!=e&&(this.map[e.id]=i),i}return this.map[e.id]=this.all}static combinedMatch(e){if(1==e.length)return e[0].match;let t=e.some((e=>e.scope))?void 0:Object.create(null);return(i,n)=>{let r=t&&t[i.id];if(void 0!==r)return r;let O=null;for(let t of e){let e=t.match(i,n);e&&(O=O?O+" "+e:e)}return t&&(t[i.id]=O),O}}static define(e,t){return new Oo(e,t||{})}static get(e,t,i){let n=no(e);return n&&n(t,i||ze.none)}}const so=ie.high(Sn.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=ds(e.state),this.decorations=this.buildDeco(e,no(e.state))}update(e){let t=ds(e.state),i=no(e.state),n=i!=e.startState.facet(to);t.length{i.add(e,t,this.markCache[n]||(this.markCache[n]=Fi.mark({class:n})))}));return i.finish()}},{decorations:e=>e.decorations})),oo=[""];class ao{constructor(e,t,i){this.at=e,this.style=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,n,r,O){let{type:s,from:o,to:a}=e;if(o>=i||a<=t)return;oo[r]=s.name,s.isTop&&(O=s);let l=n,h=s.prop(eo),c=!1;for(;h;){if(!h.context||ho(h.context,oo,r)){for(let e of h.tags){let t=this.style(e,O);t&&(l&&(l+=" "),l+=t,1==h.mode?n+=(n?" ":"")+t:0==h.mode&&(c=!0))}break}h=h.next}if(this.startSpan(e.from,l),c)return;let u=e.tree&&e.tree.prop(Ye.mounted);if(u&&u.overlay){let s=e.node.enter(u.overlay[0].from+o,1),h=e.firstChild();for(let c=0,f=o;;c++){let d=c=p)&&e.nextSibling()););if(!d||p>i)break;f=d.to+o,f>t&&(this.highlightRange(s.cursor,Math.max(t,d.from+o),Math.min(i,f),n,r,u.tree.type),this.startSpan(f,l))}h&&e.parent()}else if(e.firstChild()){do{if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,n,r+1,O),this.startSpan(Math.min(i,e.to),l)}}while(e.nextSibling());e.parent()}}}function lo(e,t,i,n,r){let O=new ao(t,n,r);O.highlightRange(e.cursor(),t,i,"",0,e.type),O.flush(i)}function ho(e,t,i){if(e.length>i-1)return!1;for(let n=i-1,r=e.length-1;r>=0;r--,n--){let i=e[r];if(i&&i!=t[n])return!1}return!0}const co=Bs.define,uo=co(),fo=co(),po=co(fo),$o=co(fo),Qo=co(),mo=co(Qo),go=co(Qo),Po=co(),Xo=co(Po),yo=co(),wo=co(),bo=co(),xo=co(bo),So=co(),ko={comment:uo,lineComment:co(uo),blockComment:co(uo),docComment:co(uo),name:fo,variableName:co(fo),typeName:po,tagName:co(po),propertyName:$o,attributeName:co($o),className:co(fo),labelName:co(fo),namespace:co(fo),macroName:co(fo),literal:Qo,string:mo,docString:co(mo),character:co(mo),attributeValue:co(mo),number:go,integer:co(go),float:co(go),bool:co(Qo),regexp:co(Qo),escape:co(Qo),color:co(Qo),url:co(Qo),keyword:yo,self:co(yo),null:co(yo),atom:co(yo),unit:co(yo),modifier:co(yo),operatorKeyword:co(yo),controlKeyword:co(yo),definitionKeyword:co(yo),moduleKeyword:co(yo),operator:wo,derefOperator:co(wo),arithmeticOperator:co(wo),logicOperator:co(wo),bitwiseOperator:co(wo),compareOperator:co(wo),updateOperator:co(wo),definitionOperator:co(wo),typeOperator:co(wo),controlOperator:co(wo),punctuation:bo,separator:co(bo),bracket:xo,angleBracket:co(xo),squareBracket:co(xo),paren:co(xo),brace:co(xo),content:Po,heading:Xo,heading1:co(Xo),heading2:co(Xo),heading3:co(Xo),heading4:co(Xo),heading5:co(Xo),heading6:co(Xo),contentSeparator:co(Po),list:co(Po),quote:co(Po),emphasis:co(Po),strong:co(Po),link:co(Po),monospace:co(Po),strikethrough:co(Po),inserted:co(),deleted:co(),changed:co(),invalid:co(),meta:So,documentMeta:co(So),annotation:co(So),processingInstruction:co(So),definition:Bs.defineModifier(),constant:Bs.defineModifier(),function:Bs.defineModifier(),standard:Bs.defineModifier(),local:Bs.defineModifier(),special:Bs.defineModifier()},vo=Oo.define([{tag:ko.link,textDecoration:"underline"},{tag:ko.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ko.emphasis,fontStyle:"italic"},{tag:ko.strong,fontWeight:"bold"},{tag:ko.strikethrough,textDecoration:"line-through"},{tag:ko.keyword,color:"#708"},{tag:[ko.atom,ko.bool,ko.url,ko.contentSeparator,ko.labelName],color:"#219"},{tag:[ko.literal,ko.inserted],color:"#164"},{tag:[ko.string,ko.deleted],color:"#a11"},{tag:[ko.regexp,ko.escape,ko.special(ko.string)],color:"#e40"},{tag:ko.definition(ko.variableName),color:"#00f"},{tag:ko.local(ko.variableName),color:"#30a"},{tag:[ko.typeName,ko.namespace],color:"#085"},{tag:ko.className,color:"#167"},{tag:[ko.special(ko.variableName),ko.macroName],color:"#256"},{tag:ko.definition(ko.propertyName),color:"#00c"},{tag:ko.comment,color:"#940"},{tag:ko.meta,color:"#7a757a"},{tag:ko.invalid,color:"#f00"}]);const Ro=Object.create(null),Wo=[ze.none],To=(new Ce(Wo),[]),_o=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","typeName"],["attribute","propertyName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])_o[e]=Ao(Ro,t);class Vo{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),_o)}resolve(e){return e?this.table[e]||(this.table[e]=Ao(this.extra,e)):0}}new Vo(Ro);function qo(e,t){To.indexOf(e)>-1||(To.push(e),console.warn(t))}function Ao(e,t){let i=null;for(let n of t.split(".")){let t=e[n]||ko[n];t?"function"==typeof t?i?i=t(i):qo(n,`Modifier ${n} used at start of tag`):i?qo(n,`Tag ${n} used as modifier`):i=t:qo(n,`Unknown highlighting tag ${n}`)}if(!i)return 0;let n=t.replace(/ /g,"_"),r=ze.define({id:Wo.length,name:n,props:[Js({[n]:i})]});return Wo.push(r),r.id}function Yo(e,t,i){return void 0===i&&(i=""),void 0===t&&(t="\\b"),new RegExp("^"+i+"(("+e.join(")|(")+"))"+t)}var No=["[<>]:","[<>=]=","<<=?",">>>?=?","=>","--?>","<--[->]?","\\/\\/","\\.{2,3}","[\\.\\\\%*+\\-<>!\\/^|&]=?","\\?","\\$","~",":"],Zo=(Yo(["[<>]:","[<>=]=","<<=?",">>>?=?","=>","--?>","<--[->]?","\\/\\/","[\\\\%*+\\-<>!\\/^|&\\u00F7\\u22BB]=?","\\?","\\$","~",":","\\u00D7","\\u2208","\\u2209","\\u220B","\\u220C","\\u2218","\\u221A","\\u221B","\\u2229","\\u222A","\\u2260","\\u2264","\\u2265","\\u2286","\\u2288","\\u228A","\\u22C5","\\b(in|isa)\\b(?!.?\\()"],""),Yo(["\\\\[0-7]{1,3}","\\\\x[A-Fa-f0-9]{1,2}","\\\\[abefnrtv0%?'\"\\\\]","([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])"],"'"),["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","where","macro","module","baremodule","struct","type","mutable","immutable","quote","typealias","abstract","primitive","bitstype"]),zo=["true","false","nothing","NaN","Inf"];Yo(["begin","function","type","struct","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"]),Yo(["end","else","elseif","catch","finally"]),Yo(Zo),Yo(zo),Yo(No,"","@"),Yo(No,"",":");Zo.concat(zo);class Co{constructor(e,t,i,n,r,O,s,o,a,l=0,h){this.p=e,this.stack=t,this.state=i,this.reducePos=n,this.pos=r,this.score=O,this.buffer=s,this.bufferBase=o,this.curContext=a,this.lookAhead=l,this.parent=h}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new Co(e,[],t,i,i,0,[],0,n?new Uo(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,i=65535&e,{parser:n}=this.p,r=n.dynamicPrecedence(i);if(r&&(this.score+=r),0==t)return this.pushState(n.getGoto(this.state,i,!0),this.reducePos),iO;)this.stack.pop();this.reduceContext(i,s)}storeNode(e,t,i,n=4,r=!1){if(0==e){let e=this,n=this.buffer.length;if(0==n&&e.parent&&(n=e.bufferBase-e.parent.bufferBase,e=e.parent),n>0&&0==e.buffer[n-4]&&e.buffer[n-1]>-1){if(t==i)return;if(e.buffer[n-2]>=t)return void(e.buffer[n-2]=i)}}if(r&&this.pos!=i){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>i;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,n>4&&(n-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=i,this.buffer[r+3]=n}else this.buffer.push(e,t,i,n)}shift(e,t,i){let n=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:O}=this.p;(i>this.pos||t<=O.maxNode)&&(this.pos=i,O.stateFlag(r,1)||(this.reducePos=i)),this.pushState(r,n),this.shiftContext(t,n),t<=O.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,i){65536&e?this.reduce(e):this.shift(e,t,i)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new Co(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Io(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&i))return!0;if(0==i)return!1;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let n,r=0;r1&t&&e==n))||i.push(t[e],n)}t=i}let i=[];for(let e=0;e>19,n=65535&e,r=this.stack.length-3*i;if(r<0||t.getGoto(this.stack[r],n,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reduce(e),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Uo{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}var Go;!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(Go||(Go={}));class Io{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,i=e>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class jo{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new jo(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new jo(this.stack,this.pos,this.index)}}class Eo{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Do=new Eo;class Mo{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Do,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,n=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(n==this.ranges.length-1)return null;let e=this.ranges[++n];r+=e.from-i.to,i=e}return r}peek(e){let t,i,n=this.chunkOff+e;if(n>=0&&n=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Do,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(i+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return i}}class Lo{constructor(e,t){this.data=e,this.id=t}token(e,t){!function(e,t,i,n){let r=0,O=1<0){let i=e[n];if(o.allows(i)&&(-1==t.token.value||t.token.value==i||s.overrides(i,t.token.value))){t.acceptToken(i);break}}for(let n=t.next,O=0,s=e[r+2];O>1,a=i+o+(o<<1),l=e[a],h=e[a+1];if(n=h)){r=e[a+2],t.advance();continue e}O=o+1}}break}}(this.data,e,t,this.id)}}Lo.prototype.contextual=Lo.prototype.fallback=Lo.prototype.extend=!1;class Bo{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ko(e,t=Uint16Array){if("string"!=typeof e)return e;let i=null;for(let n=0,r=0;n=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,i=!0),O+=r,i)break;O*=46}i?i[r++]=O:i=new t(O)}return i}const Fo=void 0!==n&&/\bparse\b/.test(void 0);let Ho=null;var Jo,ea;function ta(e,t,i){let n=e.fullCursor();for(n.moveTo(t);;)if(!(i<0?n.childBefore(t):n.childAfter(t)))for(;;){if((i<0?n.tot)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,t-25)):Math.min(e.length,Math.max(n.from+1,t+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(Jo||(Jo={}));class ia{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?ta(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?ta(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=O,null;if(r instanceof Ie){if(O==e){if(O=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(O),this.index.push(0))}else this.index[t]++,this.nextStart=O+r.length}}}class na{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new Eo))}getActions(e){let t=0,i=null,{parser:n}=e.p,{tokenizers:r}=n,O=n.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,o=0;for(let n=0;nl.end+25&&(o=Math.max(l.lookAhead,o)),0!=l.value)){let n=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!a.extend&&(i=l,t>n))break}}for(;this.actions.length>t;)this.actions.pop();return o&&e.setLookAhead(o),i||e.pos!=this.stream.end||(i=new Eo,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Eo,{pos:i,p:n}=e;return t.start=i,t.end=Math.min(i+1,n.stream.end),t.value=i==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,i){if(t.token(this.stream.reset(i.pos,e),i),e.value>-1){let{parser:t}=i.p;for(let n=0;n=0&&i.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=Math.min(i.p.stream.end,i.pos+1)}putAction(e,t,i,n){for(let t=0;t4*e.bufferLength?new ia(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,i=this.stacks,n=this.minStackPos,r=this.stacks=[];for(let O=0;On)r.push(s);else{if(this.advanceStack(s,r,i))continue;{e||(e=[],t=[]),e.push(s);let i=this.tokens.getMainToken(s);t.push(i.value,i.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let i of e){let e=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=e&&i.pos>e)&&i.p.parser.stateFlag(i.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(i)return this.stackToTree(i.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>n))&&this.recovering--}else if(r.length>1)e:for(let e=0;e500&&n.buffer.length>500){if(!((t.score-n.score||t.buffer.length-n.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(i--,1)}}}this.minStackPos=r[0].pos;for(let e=1;e ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,i=t?e.curContext.hash:0;for(let s=this.fragments.nodeAt(n);s;){let n=this.parser.nodeSet.types[s.type.id]==s.type?r.getGoto(e.state,s.type.id):-1;if(n>-1&&s.length&&(!t||(s.prop(Ye.contextHash)||0)==i))return e.useNode(s,n),Fo&&console.log(O+this.stackID(e)+` (via reuse of ${r.getName(s.type.id)})`),!0;if(!(s instanceof Ie)||0==s.children.length||s.positions[0]>0)break;let o=s.children[0];if(!(o instanceof Ie&&0==s.positions[0]))break;s=o}}let s=r.stateSlot(e.state,4);if(s>0)return e.reduce(s),Fo&&console.log(O+this.stackID(e)+` (via always-reduce ${r.getName(65535&s)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let o=this.tokens.getActions(e);for(let s=0;sn?t.push(u):i.push(u)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return Oa(e,t),!0}}runRecovery(e,t,i){let n=null,r=!1;for(let O=0;O ":"";if(s.deadEnd){if(r)continue;if(r=!0,s.restart(),Fo&&console.log(l+this.stackID(s)+" (restarted)"),this.advanceFully(s,i))continue}let h=s.split(),c=l;for(let e=0;h.forceReduce()&&e<10&&(Fo&&console.log(c+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,i));e++)Fo&&(c=this.stackID(h)+" -> ");for(let e of s.recoverByInsert(o))Fo&&console.log(l+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,i);this.stream.end>s.pos?(a==s.pos&&(a++,o=0),s.recoverByDelete(o,a),Fo&&console.log(l+this.stackID(s)+` (via recover-delete ${this.parser.getName(o)})`),Oa(s,i)):(!n||n.scoree;class aa{constructor(e){this.start=e.start,this.shift=e.shift||oa,this.reduce=e.reduce||oa,this.reuse=e.reuse||oa,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}class la extends Ot{constructor(e){if(super(),this.wrappers=[],13!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (13)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let i=0;ie.topRules[t][1])),n=[];for(let e=0;e=0)r(n,e,t[i++]);else{let O=t[i+-n];for(let s=-n;s>0;s--)r(t[i++],e,O);i++}}}this.nodeSet=new Ce(t.map(((t,r)=>ze.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:n[r],top:i.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),this.strict=!1,this.bufferLength=Ve;let O=Ko(e.tokenData);if(this.context=e.context,this.specialized=new Uint16Array(e.specialized?e.specialized.length:0),this.specializers=[],e.specialized)for(let t=0;t"number"==typeof e?new Lo(O,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let n=new ra(this,e,t,i);for(let r of this.wrappers)n=r(n,e,t,i);return n}getGoto(e,t,i=!1){let n=this.goto;if(t>=n[0])return-1;for(let r=n[t+1];;){let t=n[r++],O=1&t,s=n[r++];if(O&&i)return s;for(let i=r+(t>>1);r0}validAction(e,t){if(t==this.stateSlot(e,4))return!0;for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])return!1;i=ha(this.data,i+2)}if(t==ha(this.data,i+1))return!0}}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=ha(this.data,i+2)}if(0==(1&this.data[i+2])){let e=this.data[i+1];t.some(((t,i)=>1&i&&t==e))||t.push(this.data[i],e)}}return t}overrides(e,t){let i=ca(this.data,this.tokenPrecTable,t);return i<0||ca(this.data,this.tokenPrecTable,e){let i=e.tokenizers.find((e=>e.from==t));return i?i.to:t}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map((()=>!1));if(e)for(let n of e.split(" ")){let e=t.indexOf(n);e>=0&&(i[e]=!0)}let n=null;for(let e=0;e{e.peek(0)===ba&&t.canShift(254)&&e.acceptToken(254,1)}));function Ka(e,t){return Va.test(e)||qa.test(e)||Aa.test(e)||Ya.test(e)||Na.test(e)||Ga.test(e)||Ea.test(e)||La.test(e)||Ma.test(e)&&!(t>=8592&&t<=8703)&&65532!=t&&65533!=t&&9023!=t&&166!=t||t>=8512&&t<=10780&&(t>=8512&&t<=8516||8767==t||8894==t||8895==t||8868==t||8869==t||t>=8706&&t<=8755&&(8706==t||8709==t||8710==t||8711==t||8718==t||8719==t||8720==t||8721==t||8734==t||8735==t||t>=8747)||t>=8896&&t<=8899||t>=9720&&t<=9727||t>=9839&&(9839==t||10200==t||10201==t||t>=10176&&t<=10177||t>=10672&&t<=10676||t>=10752&&t<=10758||t>=10761&&t<=10774||10779==t||10780==t))||t>=120513&&(120513==t||120539==t||120571==t||120597==t||120629==t||120655==t||120687==t||120713==t||120745==t||120771==t)||t>=8314&&t<=8318||t>=8330&&t<=8334||t>=8736&&t<=8738||t>=10651&&t<=10671||8472==t||8494==t||t>=12443&&t<=12444||t>=120782&&t<=120801}function Fa(e,t){let i=e.peek(t);if(i>=xa&&i<=Sa||i>=ka&&i<=va||i==Ta)return 1;if(i<161||i>1114111)return 0;{let n=Ha(e,t);return Ka(n,i)?n.length:0}}function Ha(e,t){let i=1,n=e.peek(t),r=String.fromCodePoint(n);for(;;){let O=e.peek(t+i);if(!(55296<=n&&n<=56319&&56320<=O&&O<=57343))break;r+=String.fromCodePoint(O),n=O,i+=1}return r}const Ja=e=>new Bo(((t,i)=>{let n=!0,r=0,O=1;for(;;){let e=t.peek(r);if(-1===e)break;if(n){if(n=!1,O=Fa(t,r),0===O)break}else if(e>=xa&&e<=Sa||e>=ka&&e<=va||e>=Ra&&e<=Wa||e==Ta||e==_a);else{if(e<161||e>1114111)break;{let i=Ha(t,r);if(O=i.length,Ka(i,e));else if(!(za.test(i)||Ca.test(i)||Ua.test(i)||ja.test(i)||Da.test(i)||Za.test(i)||Ia.test(i)||e>=8242&&e<=8247||8279==e))break}}r+=O,O=1}0!==r&&t.acceptToken(e,r)})),el=Ja(1),tl=Ja(255),il=(e,t)=>{let i=e.peek(t),n=e.peek(t+1);return i===pa&&(0!==Fa(e,t+1)||n==ma)},nl=({till:e,term:t})=>new Bo(((i,n)=>{let r=0,O=!1;for(;;){let n=i.peek(r);if(-1===n)break;if(O)O=!1;else if(n===fa)O=!0;else if(il(i,r)||e(i,r))return void(r>0&&i.acceptToken(t,r));r+=1}})),rl=({till:e,term:t})=>new Bo(((i,n)=>{let r=0,O=!1;for(;;){let n=i.peek(r);if(-1===n)break;if(O)O=!1;else if(n===fa)O=!0;else if(e(i,r))return void(r>0&&i.acceptToken(t,r));r+=1}})),Ol=(e,t)=>e.peek(t)===ya&&e.peek(t+1)===ya&&e.peek(t+2)===ya,sl=(e,t)=>e.peek(t)===ya,ol=(e,t)=>e.peek(t)===da,al=nl({term:256,till:Ol}),ll=nl({term:257,till:sl}),hl=nl({term:258,till:ol}),cl=rl({term:259,till:Ol}),ul=rl({term:260,till:sl}),fl=rl({term:261,till:ol}),dl=(e,t)=>e.peek(t)===$a&&e.peek(t+1)===Qa,pl=(e,t)=>e.peek(t)===Qa&&e.peek(t+1)===$a,$l=new Bo(((e,t)=>{if(dl(e,0)){let t=1,i=2;for(;-1!==e.peek(i);)if(pl(e,i)){if(t-=1,0===t)return void e.acceptToken(2,i+2);i+=2}else dl(e,i)?(t+=1,i+=2):i+=1;e.acceptToken(2,i)}})),Ql=(e,t)=>{let i=e.peek(t);return i>=9&&i<14||i>=32&&i<33||i>=133&&i<134||i>=160&&i<161||i>=5760&&i<5761||i>=8192&&i<8203||i>=8232&&i<8234||i>=8239&&i<8240||i>=8287&&i<8288||i>=12288&&i<12289},ml=new Bo(((e,t)=>{e.peek(0)!==ma||Ql(e,-1)||!t.canShift(245)?e.peek(0)!==Xa||Ql(e,-1)||!t.canShift(246)?e.peek(0)!==ga||Ql(e,-1)||!t.canShift(247)?e.peek(0)!==Pa||Ql(e,-1)||!t.canShift(248)?e.peek(0)!==wa||Ql(e,-1)||!t.canShift(249)?e.peek(0)!==ya||Ql(e,-1)||!t.canShift(250)?e.peek(0)!==da||Ql(e,-1)||!t.canShift(251)?e.peek(0)!==ua||Ql(e,-1)||!t.canShift(252)?Ql(e,-1)||Ql(e,0)||-1===e.peek(0)||!t.canShift(253)||e.acceptToken(253,0):e.acceptToken(252,0):e.acceptToken(251,0):e.acceptToken(250,0):e.acceptToken(249,0):e.acceptToken(248,0):e.acceptToken(247,0):e.acceptToken(246,0):e.acceptToken(245,0)}),{extend:!0}),gl={__proto__:null,if:14,elseif:20,else:24,end:26,try:30,catch:34,finally:40,for:44,primitive:74,type:76,abstract:84,mutable:90,struct:92,module:98,baremodule:104,macro:110,in:132,isa:134,function:152,do:164,where:170,true:204,false:204,begin:264,while:320,let:326,const:334,global:342,local:346,quote:350,break:354,continue:358,return:362,using:366,import:368,as:376,export:384},Pl=la.deserialize({version:13,states:"%<^Q$tQNSOOOOQj'#IP'#IPOOQj'#Gt'#GtO${QNSO'#IOO*cQNTO'#DoO*mQNTO'#DoO/eQNTO'#IRO0OQMyO'#IlOOQk'#Il'#IlO0TQNTO'#IlOOQk'#Do'#DoO:sQNTO'#DoO>{QNQO'#DtOOQk'#Ib'#IbO@WQNUO'#EWO@bONzO'#EhO@mONYO'#ElO@xO!!^O'#EmOATQMyO'#EoODRQNTO'#EoODYQMyO'#EnOGsQNQO'#FiOOQk'#I['#I[OLwQNTO'#I[ONrQNTO'#IOO! tQNSO'#IOOOQk'#IS'#ISO!!OQNTO'#GfO!#hQNTO'#GfO!$}QNQO'#GjO!(`QMxO'#GnO!(eQNTO'#IROOQk'#IR'#IRO! YQNSO'#IOO! YQNSO'#IOQOQMxOOO!(oQNQO'#CbOOQk'#Is'#IsO!$}QNQO'#FxO!,QQNQO'#F|O!/cQNQO'#GOOOQk'#GS'#GSOOQk'#GU'#GUO!2tQNTO'#GWO!4TQNQO'#GYO!4]QNQO'#GcO!4eQNSO'#CaO!4rQNSO'#CjO!5PQNQO'#DQO!5UQNQO'#DVO!5ZQNQO'#DYO!6}QNQO'#DYO!7SQNQO'#D^O!7XQNQO'#DaO!8eQNQO'#DdO!:]QNQO'#DyO!:gQNQO'#CqO!(oQNQO'#FqO!:oQNSO'#FtO!4kQNSO'#GQO!4k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z2Rf4_!o5f5p5y5}6Y6o7U7]:S:Wl4`#a#w+U+a5g5q5t5z6Z6p7V7^:T:Xd4a5h5r5u5{6[6q7W7_:U:Y`4b5i5v6]6r7X7`8^:Zd4c$R%R*e5s6^6s7Y7a:V:[h4d)])_)y+[/f5j5x6_6t7Z7b:]t4e'T6`6u7[7c:^=x=y=z={=|=}>OCaCsCtCuCvf9_+x+}0z0|:_:j;P;f;mij9c/a0_0a0p1h2Q2[2]:n;T;j;q<``9d.m:b:o;U;k;rb>c>d>e>f>g>hC{C|C}DO`=b=m=p=s=v=w>R>^>_`?[&k?p?v@S@`@dAvAx^?]?q?w@T@a@eAwAy[?^,q?x@U@b@fAz^?_,z?y@V@c@gA{Cb^AbA|BSB`BlBpCOCQ[AcBTBaBmBqCRCm`Ad0fA}BUBbBnBrCPCS]AeBVBcBoBsCTClU!v[%g`>a@l@m@n@o@v@w@x@y@z@{@|@}AOAPAQARASATAUAVAWAXAYAZA[A]A^A_A`AaAbAcAdAeAfAgAhAiAjAkAlAmAnAoApAqArAsAtAuBxByBzB{B|B}CdCeCfCgChCiCjDUDVDWDXQ.Q+hR0^.RS+t({.OR.`+pQ+o({S._+p.O^0b.X0d0k1u1y2S2dU0g.Z0i1wR1X/bS#P_#QS#T`#UT#Wa#XT+u({/bW,g)T+l-k0UR.l+xR.y,RR-Y*Sg$Yw ArgumentList ListCompherension ForClause IfClause Parameters FunctionDefinition function Definition TypedExpression CallExpression BroadcastDot DoClause do DoClauseArguments CallExpression where TypeParameters MacroExpression MacroIdentifier MacroName Operator MacroFieldExpression FieldExpression SubscriptExpression AssignmentExpression Symbol SymbolName CallExpression BroadcastDot ArgumentList AssignmentExpression Parameters BooleanLiteral Character String $ ( ) TripleString CommandString PrefixedString Prefix FieldEpxression String TripleString CommandString ParenthesizedExpression TupleExpression ArrayExpression ArrayComprehensionExpression ForClause ForBinding AssignOperator = ∈ IfClause MatrixExpression MatrixRow GeneratorExpression TypedExpression ParameterizedIdentifier TypeArgumentList begin MacroFieldName MacroArgumentList AssignmentExpression BareTupleExpression UnaryExpression Operator BinaryExpression TernaryExpression FunctionExpression AssignmentExpression CoefficientExpression TransposeExpression Coefficient CallExpression FieldExpression ParenthesizedExpression SpreadExpression AssignmentExpression ArrayExpression ArrayComprehensionExpression MatrixExpression MatrixRow GeneratorExpression TypedExpression ParameterizedIdentifier AssignOperator WhileStatement while WhileBinding LetStatement let LetBinding VariableDeclaration ConstStatement const AssignmentExpression BareTupleExpression GlobalStatement global LocalStatement local QuoteStatement quote BreakStatement break ContinueStatement continue ReturnStatement return ImportStatement using import Import ScopedIdentifier RenamedIdentifier as SelectedImport RenamedImport ExportStatement export CompoundExpression MacroExpression MacroFieldExpression MacroFieldName MacroArgumentList UnaryExpression Operator BinaryExpression TernaryExpression FunctionExpression AssignmentExpression CoefficientExpression TransposeExpression SpreadExpression FunctionAssignmentExpression",maxTerm:331,nodeProps:[[Ye.closedBy,-2,5,8,"end else elseif",-15,11,19,21,36,41,44,48,51,54,75,81,159,162,174,193,"end",14,"end catch finally",16,"end finally",-9,34,58,93,118,119,126,151,152,153,"]",-2,62,131,"}",-7,63,70,99,116,128,148,155,")"],[Ye.group,-35,7,10,12,13,15,17,20,22,37,38,42,45,46,49,52,55,66,67,76,82,85,132,160,163,167,171,173,175,177,179,181,183,184,188,192,"keyword",-9,27,28,65,90,105,106,107,123,124,"operator"]],skippedNodes:[0,2,3],repeatNodeCount:36,tokenData:"#$d~R.[XYHwYZHwpqHwqrJursK[stKotuKzuvLPvwL^wxLnxyMhyzMmz{LP{|Mr|}Mz}!ONP!O!PNo!P!Q!Gu!Q!R!Lu!R![!Mo![!]# s!]!^#!T!^!_#!Y!_!`#!r!`!a!JT!b!c##P!}#O##U#O#P!Js#P#Q##Z#Q#R!Jx#S#T##`#o#p##e#p#q##j#q#r#$W#r#s!LY$r$s!Jc$w$x!Ko%o%p!Js&a&bLP%!]%!^!Js%#t%#uNe%#u%#v!La%#v%#wNe%#w%#x!La%#x%#yNe%$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}],tokenPrec:51925}),Xl="undefined"!=typeof navigator&&!/Edge\/(\d+)/.exec(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),yl="-10000px";class wl{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e)),this.tooltipViews=this.tooltips.map(i)}update(e){let t=e.state.facet(this.facet),i=t.filter((e=>e));if(t===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let n=[];for(let t=0;t{var t,i,n;return{position:Xl?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(i=e.find((e=>e.parent)))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(n=e.find((e=>e.tooltipSpace)))||void 0===n?void 0:n.tooltipSpace)||bl}}}),Sl=Sn.fromClass(class{constructor(e){var t;this.view=e,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let i=e.state.facet(xl);this.position=i.position,this.parent=i.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new wl(e,Rl,(e=>this.createTooltip(e))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),null===(t=e.dom.ownerDocument.defaultView)||void 0===t||t.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e);t&&this.observeIntersection();let i=t||e.geometryChanged,n=e.state.facet(xl);if(n.position!=this.position){this.position=n.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(e){let t=e.create(this.view);if(t.dom.classList.add("cm-tooltip"),e.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",t.dom.appendChild(e)}return t.dom.style.position=this.position,t.dom.style.top=yl,this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}destroy(){var e,t;null===(e=this.view.dom.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",this.measureSoon);for(let{dom:e}of this.manager.tooltipViews)e.remove();null===(t=this.intersectionObserver)||void 0===t||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect();return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(xl).tooltipSpace(this.view)}}writeMeasure(e){let{editor:t,space:i}=e,n=[];for(let r=0;r=Math.min(t.bottom,i.bottom)||a.rightMath.min(t.right,i.right)+.1){o.style.top=yl;continue}let h=O.arrow?s.dom.querySelector(".cm-tooltip-arrow"):null,c=h?7:0,u=l.right-l.left,f=l.bottom-l.top,d=s.offset||vl,p=this.view.textDirection==An.LTR,$=l.width>i.right-i.left?p?i.left:i.right-l.width:p?Math.min(a.left-(h?14:0)+d.x,i.right-u):Math.max(i.left,a.left-u+(h?14:0)-d.x),Q=!!O.above;!O.strictSide&&(Q?a.top-(l.bottom-l.top)-d.yi.bottom)&&Q==i.bottom-a.bottom>a.top-i.top&&(Q=!Q);let m=Q?a.top-f-c-d.y:a.bottom+c+d.y,g=$+u;if(!0!==s.overlap)for(let e of n)e.left$&&e.topm&&(m=Q?e.top-f-2-c:e.bottom+c+2);"absolute"==this.position?(o.style.top=m-e.parent.top+"px",o.style.left=$-e.parent.left+"px"):(o.style.top=m+"px",o.style.left=$+"px"),h&&(h.style.left=a.left+(p?d.x:-d.x)-($+14-7)+"px"),!0!==s.overlap&&n.push({left:$,top:m,right:g,bottom:m+f}),o.classList.toggle("cm-tooltip-above",Q),o.classList.toggle("cm-tooltip-below",!Q),s.positioned&&s.positioned()}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=yl}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),kl=bO.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),vl={x:0,y:0},Rl=I.define({enables:[Sl,kl]});class Wl{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ds(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),n=t.text.slice(i-t.from,this.pos-t.from),r=n.search(Yl(e,!1));return r<0?null:{from:i+r,to:this.pos,text:n.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function Tl(e){let t=Object.keys(e).join(""),i=/\w/.test(t);return i&&(t=t.replace(/\w/g,"")),`[${i?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function _l(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[i,n]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),i=Object.create(null);for(let{label:n}of e){t[n[0]]=!0;for(let e=1;e{let r=e.matchBefore(n);return r||e.explicit?{from:r?r.from:e.pos,options:t,span:i}:null}}function Vl(e,t){return i=>{for(let t=ds(i.state).resolveInner(i.pos,-1);t;t=t.parent)if(e.indexOf(t.name)>-1)return null;return t(i)}}class ql{constructor(e,t,i){this.completion=e,this.source=t,this.match=i}}function Al(e){return e.selection.main.head}function Yl(e,t){var i;let{source:n}=e,r=t&&"^"!=n[0],O="$"!=n[n.length-1];return r||O?new RegExp(`${r?"^":""}(?:${n})${O?"$":""}`,null!==(i=e.flags)&&void 0!==i?i:e.ignoreCase?"i":""):e}const Nl=$e.define();function Zl(e,t){let i=t.completion.apply||t.completion.label,n=t.source;"string"==typeof i?e.dispatch({changes:{from:n.from,to:n.to,insert:i},selection:{anchor:n.from+i.length},userEvent:"input.complete",annotations:Nl.of(t.completion)}):i(e,t.completion,n.from,n.to)}const zl=new WeakMap;function Cl(e){if(!Array.isArray(e))return e;let t=zl.get(e);return t||zl.set(e,t=_l(e)),t}class Ul{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t=48&&a<=57||a>=97&&a<=122?2:a>=65&&a<=90?1:0:(X=d(a))!=X.toLowerCase()?1:X!=X.toUpperCase()?2:0;(!n||1==y&&m||0==P&&0!=y)&&(t[h]==a||i[h]==a&&(c=!0)?O[h++]=n:O.length&&(g=!1)),P=y,n+=p(a)}return h==o&&0==O[0]&&g?this.result((c?-200:0)-100,O,e):u==o&&0==$?[-200-e.length,0,Q]:s>-1?[-700-e.length,s,s+this.pattern.length]:u==o?[-900-e.length,$,Q]:h==o?this.result((c?-200:0)-100-700+(g?0:-1100),O,e):2==t.length?null:this.result((n[0]?-700:0)-200-1100,n,e)}result(e,t,i){let n=[e-i.length],r=1;for(let e of t){let t=e+(this.astral?p(f(i,e)):1);r>1&&n[r-1]==e?n[r-1]=t:(n[r++]=e,n[r++]=t)}return n}}const Gl=I.define({combine:e=>_e(e,{activateOnTyping:!0,override:null,maxRenderedOptions:100,defaultKeymap:!0,optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[]},{defaultKeymap:(e,t)=>e&&t,icons:(e,t)=>e&&t,optionClass:(e,t)=>i=>function(e,t){return e?t?e+" "+t:e:t}(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})});function Il(e,t,i){if(e<=i)return{from:0,to:e};if(t<=e>>1){let e=Math.floor(t/i);return{from:e*i,to:(e+1)*i}}let n=Math.floor((e-t)/i);return{from:e-(n+1)*i,to:e-n*i}}class jl{constructor(e,t){this.view=e,this.stateField=t,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:e=>this.positionInfo(e),key:this};let i=e.state.field(t),{options:n,selected:r}=i.open,O=e.state.facet(Gl);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,i){let n=document.createElement("span");n.className="cm-completionLabel";let{label:r}=e,O=0;for(let e=1;eO&&n.appendChild(document.createTextNode(r.slice(O,t)));let o=n.appendChild(document.createElement("span"));o.appendChild(document.createTextNode(r.slice(t,s))),o.className="cm-completionMatchedText",O=s}return Oe.position-t.position)).map((e=>e.render))}(O),this.optionClass=O.optionClass,this.range=Il(n.length,r,O.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",(t=>{for(let i,r=t.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(i=/-(\d+)$/.exec(r.id))&&+i[1]{this.info&&this.view.requestMeasure(this.placeInfo)}))}mount(){this.updateSel()}update(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}positioned(){this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected=this.range.to)&&(this.range=Il(t.options.length,t.selected,this.view.state.facet(Gl).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfo)}))),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:i}=t.options[t.selected],{info:n}=i;if(!n)return;let r="string"==typeof n?document.createTextNode(n):n(i);if(!r)return;"then"in r?r.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t)})).catch((e=>Pn(this.view.state,e,"completion info"))):this.addInfoPane(r)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)n==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&function(e,t){let i=e.getBoundingClientRect(),n=t.getBoundingClientRect();n.topi.bottom&&(e.scrollTop+=n.bottom-i.bottom)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=e.getBoundingClientRect();if(n.top>Math.min(innerHeight,t.bottom)-10||n.bottomnew jl(t,e)}function Dl(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class Ml{constructor(e,t,i,n,r){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=n,this.selected=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Ml(this.options,Kl(t,e),this.tooltip,this.timestamp,e)}static build(e,t,i,n,r){let O=function(e,t){let i=[],n=0;for(let r of e)if(r.hasResult())if(!1===r.result.filter)for(let e of r.result.options)i.push(new ql(e,r,[1e9-n++]));else{let e,n=new Ul(t.sliceDoc(r.from,r.to));for(let t of r.result.options)(e=n.match(t.label))&&(null!=t.boost&&(e[0]+=t.boost),i.push(new ql(t,r,e)))}let r=[],O=null;for(let e of i.sort(Hl)){if(300==r.length)break;!O||O.label!=e.completion.label||O.detail!=e.completion.detail||null!=O.type&&null!=e.completion.type&&O.type!=e.completion.type||O.apply!=e.completion.apply?r.push(e):Dl(e.completion)>Dl(O)&&(r[r.length-1]=e),O=e.completion}return r}(e,t);if(!O.length)return null;let s=0;if(n&&n.selected){let e=n.options[n.selected].completion;for(let t=0;tt.hasResult()?Math.min(e,t.from):e),1e8),create:El(sh),above:r.aboveCursor},n?n.timestamp:Date.now(),s)}map(e){return new Ml(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}class Ll{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Ll(Fl,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Gl),n=(i.override||t.languageDataAt("autocomplete",Al(t)).map(Cl)).map((t=>(this.active.find((e=>e.source==t))||new eh(t,this.active.some((e=>0!=e.state))?1:0)).update(e,i)));n.length==this.active.length&&n.every(((e,t)=>e==this.active[t]))&&(n=this.active);let r=e.selection||n.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let i=0,n=0;;){for(;i1!=e.state))&&n.some((e=>e.hasResult()))&&(n=n.map((e=>e.hasResult()?new eh(e.source,0):e)));for(let t of e.effects)t.is(Oh)&&(r=r&&r.setSelected(t.value,this.id));return n==this.active&&r==this.open?this:new Ll(n,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Bl}}const Bl={"aria-autocomplete":"list"};function Kl(e,t){return{"aria-autocomplete":"list","aria-haspopup":"listbox","aria-activedescendant":e+"-"+t,"aria-controls":e}}const Fl=[];function Hl(e,t){return t.match[0]-e.match[0]||e.completion.label.localeCompare(t.completion.label)}function Jl(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class eh{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Jl(e),n=this;i?n=n.handleUserEvent(e,i,t):e.docChanged?n=n.handleChange(e):e.selection&&0!=n.state&&(n=new eh(n.source,0));for(let t of e.effects)if(t.is(ih))n=new eh(n.source,1,t.value?Al(e.state):-1);else if(t.is(nh))n=new eh(n.source,0);else if(t.is(rh))for(let e of t.value)e.source==n.source&&(n=e);return n}handleUserEvent(e,t,i){return"delete"!=t&&i.activateOnTyping?new eh(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(Al(e.startState))?new eh(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new eh(this.source,this.state,e.mapPos(this.explicitPos))}}class th extends eh{constructor(e,t,i,n,r,O){super(e,2,t),this.result=i,this.from=n,this.to=r,this.span=O}hasResult(){return!0}handleUserEvent(e,t,i){let n=e.changes.mapPos(this.from),r=e.changes.mapPos(this.to,1),O=Al(e.state);if((this.explicitPos<0?O<=n:Or||"delete"==t&&Al(e.startState)==this.from)return new eh(this.source,"input"==t&&i.activateOnTyping?1:0);let s=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return this.span&&(n==r||this.span.test(e.state.sliceDoc(n,r)))?new th(this.source,s,this.result,n,r,this.span):new eh(this.source,1,s)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new eh(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new th(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1),this.span)}}const ih=ge.define(),nh=ge.define(),rh=ge.define({map:(e,t)=>e.map((e=>e.map(t)))}),Oh=ge.define(),sh=B.define({create:()=>Ll.start(),update:(e,t)=>e.update(t),provide:e=>[Rl.from(e,(e=>e.tooltip)),bO.contentAttributes.from(e,(e=>e.attrs))]});function oh(e,t="option"){return i=>{let n=i.state.field(sh,!1);if(!n||!n.open||Date.now()-n.open.timestamp<75)return!1;let r,O=1;"page"==t&&(r=function(e,t){let i=e.plugin(Sl);if(!i)return null;let n=i.manager.tooltips.indexOf(t);return n<0?null:i.manager.tooltipViews[n]}(i,n.open.tooltip))&&(O=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let s=n.open.selected+O*(e?1:-1),{length:o}=n.open.options;return s<0?s="page"==t?0:o-1:s>=o&&(s="page"==t?o-1:0),i.dispatch({effects:Oh.of(s)}),!0}}const ah=e=>{let t=e.state.field(sh,!1);return!(e.state.readOnly||!t||!t.open||Date.now()-t.open.timestamp<75||(Zl(e,t.open.options[t.open.selected]),0))},lh=e=>!!e.state.field(sh,!1)&&(e.dispatch({effects:ih.of(!0)}),!0),hh=e=>{let t=e.state.field(sh,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:nh.of(null)}),0))};class ch{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const uh=Sn.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let t of e.state.field(sh).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(sh);if(!e.selectionSet&&!e.docChanged&&e.startState.field(sh)==t)return;let i=e.transactions.some((e=>(e.selection||e.docChanged)&&!Jl(e)));for(let t=0;t50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){Pn(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let t of e.transactions)"input"==Jl(t)?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(sh);for(let e of t.active)1!=e.state||this.running.some((t=>t.active.source==e.source))||this.startQuery(e)}startQuery(e){let{state:t}=this.view,i=Al(t),n=new Wl(t,i,e.explicitPos==i),r=new ch(e,n);this.running.push(r),Promise.resolve(e.source(n)).then((e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:nh.of(null)}),Pn(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),50))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],i=this.view.state.facet(Gl);for(let n=0;ne.source==r.active.source));if(O&&1==O.state)if(null==r.done){let e=new eh(r.active.source,0);for(let t of r.updates)e=e.update(t,i);1!=e.state&&t.push(e)}else this.startQuery(O)}t.length&&this.view.dispatch({effects:rh.of(t)})}},{eventHandlers:{compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:ih.of(!1)})),20),this.composing=0}}}),fh=bO.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class dh{constructor(e,t,i,n){this.field=e,this.line=t,this.from=i,this.to=n}}class ph{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,R.TrackDel),i=e.mapPos(this.to,1,R.TrackDel);return null==t||null==i?null:new ph(this.field,t,i)}}class $h{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],n=[t],r=e.doc.lineAt(t),O=/^\s*/.exec(r.text)[0];for(let r of this.lines){if(i.length){let i=O,s=/^\t*/.exec(r)[0].length;for(let t=0;tnew ph(e.field,n[e.line]+e.from,n[e.line]+e.to)));return{text:i,ranges:s}}static parse(e){let t,i=[],n=[],r=[];for(let O of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(O);){let e=t[1]?+t[1]:null,s=t[2]||t[3]||"",o=-1;for(let t=0;t=o&&e.field++}r.push(new dh(o,n.length,t.index,t.index+s.length)),O=O.slice(0,t.index)+s+O.slice(t.index+t[0].length)}n.push(O)}return new $h(n,r)}}let Qh=Fi.widget({widget:new class extends Bi{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),mh=Fi.mark({class:"cm-snippetField"});class gh{constructor(e,t){this.ranges=e,this.active=t,this.deco=Fi.set(e.map((e=>(e.from==e.to?Qh:mh).range(e.from,e.to))))}map(e){let t=[];for(let i of this.ranges){let n=i.map(e);if(!n)return null;t.push(n)}return new gh(t,this.active)}selectionInsideField(e){return e.ranges.every((e=>this.ranges.some((t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))))}}const Ph=ge.define({map:(e,t)=>e&&e.map(t)}),Xh=ge.define(),yh=B.define({create:()=>null,update(e,t){for(let i of t.effects){if(i.is(Ph))return i.value;if(i.is(Xh)&&e)return new gh(e.ranges,i.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>bO.decorations.from(e,(e=>e?e.deco:Fi.none))});function wh(e,t){return z.create(e.filter((e=>e.field==t)).map((e=>z.range(e.from,e.to))))}function bh(e){let t=$h.parse(e);return(e,i,n,r)=>{let{text:O,ranges:s}=t.instantiate(e.state,n),o={changes:{from:n,to:r,insert:m.of(O)}};if(s.length&&(o.selection=wh(s,0)),s.length>1){let t=new gh(s,0),i=o.effects=[Ph.of(t)];void 0===e.state.field(yh,!1)&&i.push(ge.appendConfig.of([yh,Th,Vh,fh]))}e.dispatch(e.state.update(o))}}function xh(e){return({state:t,dispatch:i})=>{let n=t.field(yh,!1);if(!n||e<0&&0==n.active)return!1;let r=n.active+e,O=e>0&&!n.ranges.some((t=>t.field==r+e));return i(t.update({selection:wh(n.ranges,r),effects:Ph.of(O?null:new gh(n.ranges,r))})),!0}}const Sh=({state:e,dispatch:t})=>!!e.field(yh,!1)&&(t(e.update({effects:Ph.of(null)})),!0),kh=xh(1),vh=xh(-1),Rh=[{key:"Tab",run:kh,shift:vh},{key:"Escape",run:Sh}],Wh=I.define({combine:e=>e.length?e[0]:Rh}),Th=ie.highest(VO.compute([Wh],(e=>e.facet(Wh))));function _h(e,t){return Object.assign(Object.assign({},t),{apply:bh(e)})}const Vh=bO.domEventHandlers({mousedown(e,t){let i,n=t.state.field(yh,!1);if(!n||null==(i=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=n.ranges.find((e=>e.from<=i&&e.to>=i));return!(!r||r.field==n.active||(t.dispatch({selection:wh(n.ranges,r.field),effects:Ph.of(n.ranges.some((e=>e.field>r.field))?new gh(n.ranges,r.field):null)}),0))}});function qh(e,t){return new RegExp(t(e.source),e.unicode?"u":"")}const Ah=Object.create(null);function Yh(e){return Ah[e]||(Ah[e]=new WeakMap)}function Nh(e,t,i,n,r){for(let O=e.iterLines(),s=0;!O.next().done;){let e,{value:o}=O;for(t.lastIndex=0;e=t.exec(o);)if(!n[e[0]]&&s+e.index!=r&&(i.push({type:"text",label:e[0]}),n[e[0]]=!0,i.length>=2e3))return;s+=o.length+1}}function Zh(e,t,i,n,r){let O=e.length>=1e3,s=O&&t.get(e);if(s)return s;let o=[],a=Object.create(null);if(e.children){let O=0;for(let s of e.children){if(s.length>=1e3)for(let e of Zh(s,t,i,n-O,r-O))a[e.label]||(a[e.label]=!0,o.push(e));else Nh(s,i,o,a,r-O);O+=s.length+1}}else Nh(e,i,o,a,r);return O&&o.length<2e3&&t.set(e,o),o}const zh=[{key:"Ctrl-Space",run:lh},{key:"Escape",run:hh},{key:"ArrowDown",run:oh(!0)},{key:"ArrowUp",run:oh(!1)},{key:"PageDown",run:oh(!0,"page")},{key:"PageUp",run:oh(!1,"page")},{key:"Enter",run:ah}],Ch=ie.highest(VO.computeN([Gl],(e=>e.facet(Gl).defaultKeymap?[zh]:[])));const Uh=new WeakMap;var Gh=Object.freeze({__proto__:null,CompletionContext:Wl,acceptCompletion:ah,autocompletion:function(e={}){return[sh,Gl.of(e),uh,Ch,fh]},clearSnippet:Sh,closeCompletion:hh,completeAnyWord:e=>{let t=e.state.languageDataAt("wordChars",e.pos).join(""),i=function(e){let t=e.replace(/[\\[.+*?(){|^$]/g,"\\$&");try{return new RegExp(`[\\p{Alphabetic}\\p{Number}_${t}]+`,"ug")}catch(e){return new RegExp(`[w${t}]`,"g")}}(t),n=e.matchBefore(qh(i,(e=>e+"$")));if(!n&&!e.explicit)return null;let r=n?n.from:e.pos;return{from:r,options:Zh(e.state.doc,Yh(t),i,5e4,r),span:qh(i,(e=>"^"+e))}},completeFromList:_l,completionKeymap:zh,completionStatus:function(e){let t=e.field(sh,!1);return t&&t.active.some((e=>1==e.state))?"pending":t&&t.active.some((e=>0!=e.state))?"active":null},currentCompletions:function(e){var t;let i=null===(t=e.field(sh,!1))||void 0===t?void 0:t.open;if(!i)return[];let n=Uh.get(i.options);return n||Uh.set(i.options,n=i.options.map((e=>e.completion))),n},ifIn:function(e,t){return i=>{for(let n=ds(i.state).resolveInner(i.pos,-1);n;n=n.parent)if(e.indexOf(n.name)>-1)return t(i);return null}},ifNotIn:Vl,moveCompletionSelection:oh,nextSnippetField:kh,pickedCompletion:Nl,prevSnippetField:vh,selectedCompletion:function(e){var t;let i=null===(t=e.field(sh,!1))||void 0===t?void 0:t.open;return i?i.options[i.selected].completion:null},selectedCompletionIndex:function(e){var t;let i=null===(t=e.field(sh,!1))||void 0===t?void 0:t.open;return i?i.selected:null},setSelectedCompletion:function(e){return Oh.of(e)},snippet:bh,snippetCompletion:_h,snippetKeymap:Wh,startCompletion:lh});function Ih({closing:e,units:t=1}){return i=>function(e,t,i){let n=e.textAfter,r=n.match(/^\s*/)[0].length,O=!1;switch(i.length){case 1:O=n.slice(r,r+i[0].length)===i[0];break;case 2:O=n.slice(r,r+i[0].length)===i[0]||n.slice(r,r+i[1].length)===i[1];break;case 3:O=n.slice(r,r+i[0].length)===i[0]||n.slice(r,r+i[1].length)===i[1]||n.slice(r,r+i[2].length)===i[2];break;default:O=i.some((e=>n.slice(r,r+e.length)===e))}return e.baseIndent+(O?0:e.unit*t)}(i,t,e)}function jh(e){return e.baseIndent}let Eh=function(){let e={indents:{VariableDeclaration:Us(),AssignmentExpression:Us()},keywords:[]};for(let t of Pl.nodeSet.types){let i,n=t.prop(Ye.group);"keyword"===(null!=n?n[0]:null)&&e.keywords.push(t);let r=t.prop(Ye.closedBy);i=r?Ih({closing:r}):jh,e.indents[t.name]=i}return e}(),Dh=Js({String:ko.string,TripleString:ko.string,CommandString:ko.string,StringWithoutInterpolation:ko.string,TripleStringWithoutInterpolation:ko.string,CommandStringWithoutInterpolation:ko.string,Comment:ko.lineComment,BlockComment:ko.comment,"mutable struct StructDefinition/end":ko.definitionKeyword,"primitive type PrimitiveDefinition/end":ko.definitionKeyword,"const local global":ko.definitionKeyword,"ForStatement/for ForBinding/in ForStatement/end":ko.controlKeyword,"WhileStatement/while WhileStatement/end":ko.controlKeyword,"IfClause/if IfClause/elseif ElseClause/else IfStatement/end":ko.controlKeyword,"default break return":ko.controlKeyword,"TryStatement/try CatchClause/catch FinallyClause/finally TryStatement/end":ko.controlKeyword,"( )":ko.paren,"[ ]":ko.paren,"{ }":ko.paren,[Eh.keywords.map((e=>e.name)).join(" ")]:ko.keyword,BooleanLiteral:ko.bool,Number:ko.number,"Coefficient/PrefixedString!":ko.unit,"Type! TypeParameters!":ko.typeName,"StructDefinition/Identifier StructDefinition/AssignmentExpression/Identifier StructDefinition/TypedExpression/Identifier StructDefinition/AssignmentExpression/TypedExpression/Identifier":ko.definition(ko.propertyName),":: <:":ko.typeOperator,Identifier:ko.variableName,"MacroIdentifier! MacroFieldExpression!":ko.macroName,"MacroDefinition/Definition!":ko.definition(ko.macroName),"FieldName!":ko.propertyName,FieldExpression:ko.propertyName,"FieldExpression .":ko.derefOperator,"Symbol!":ko.atom}),Mh=fs.define({parser:Pl.configure({props:[Dh,Vs.add(Object.assign(Object.assign({},Eh.indents),{ModuleDefinition:jh,BareModuleDefinition:jh,VariableDeclaration:Us(),AssignmentExpression:Us()}))]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*(\]|\}|\)|end|else|elseif|catch|finally)/,closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});const Lh=Mh.data.of({autocomplete:_l(Eh.keywords.map((e=>({label:e.name,type:"keyword"}))))});let Bh={enableKeywordCompletion:!1};function Kh(e=Bh){let t=[];return(e=Object.assign(Object.assign({},Bh),e)).enableKeywordCompletion&&t.push(Lh),new xs(Mh,t)}class Fh extends St{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Fh.prototype.elementClass="",Fh.prototype.toDOM=void 0,Fh.prototype.mapMode=R.TrackBefore,Fh.prototype.startSide=Fh.prototype.endSide=-1,Fh.prototype.point=!0;const Hh=I.define(),Jh=I.define();const ec=bO.baseTheme({".cm-gutters":{display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#999",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"}}),tc=I.define({combine:e=>e.some((e=>e))});function ic(e){let t=[nc,ec];return e&&!1===e.fixed&&t.push(tc.of(!0)),t}const nc=Sn.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight+"px",this.gutters=e.state.facet(Jh).map((t=>new oc(e,t)));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!e.state.facet(tc),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,i=e.view.viewport,n=Math.min(t.to,i.to)-Math.max(t.from,i.from);this.syncGutters(n<.8*(i.to-i.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(tc)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let i=Wt.iter(this.view.state.facet(Hh),this.view.viewport.from),n=[],r=this.gutters.map((e=>new sc(e,this.view.viewport,-this.view.documentPadding.top)));for(let e of this.view.viewportLineBlocks){let t;if(Array.isArray(e.type)){for(let i of e.type)if(i.type==Ki.Text){t=i;break}}else t=e.type==Ki.Text?e:void 0;if(t){n.length&&(n=[]),Oc(i,n,e.from);for(let e of r)e.line(this.view,t,n)}}for(let e of r)e.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(Jh),i=e.state.facet(Jh),n=e.docChanged||e.heightChanged||e.viewportChanged||!Wt.eq(e.startState.facet(Hh),e.state.facet(Hh),e.view.viewport.from,e.view.viewport.to);if(t==i)for(let t of this.gutters)t.update(e)&&(n=!0);else{n=!0;let r=[];for(let n of i){let i=t.indexOf(n);i<0?r.push(new oc(this.view,n)):(this.gutters[i].update(e),r.push(this.gutters[i]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return n}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:wn.scrollMargins.from((e=>0!=e.gutters.length&&e.fixed?e.view.textDirection==An.LTR?{left:e.dom.offsetWidth}:{right:e.dom.offsetWidth}:null))});function rc(e){return Array.isArray(e)?e:[e]}function Oc(e,t,i){for(;e.value&&e.from<=i;)e.from==i&&t.push(e.value),e.next()}class sc{constructor(e,t,i){this.gutter=e,this.height=i,this.localMarkers=[],this.i=0,this.cursor=Wt.iter(e.markers,t.from)}line(e,t,i){this.localMarkers.length&&(this.localMarkers=[]),Oc(this.cursor,this.localMarkers,t.from);let n=i.length?this.localMarkers.concat(i):this.localMarkers,r=this.gutter.config.lineMarker(e,t,n);r&&n.unshift(r);let O=this.gutter;if(0==n.length&&!O.config.renderEmptyElements)return;let s=t.top-this.height;if(this.i==O.elements.length){let i=new ac(e,t.height,s,n);O.elements.push(i),O.dom.appendChild(i.dom)}else O.elements[this.i].update(e,t.height,s,n);this.height=t.bottom,this.i++}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class oc{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,(n=>{let r=e.lineBlockAtHeight(n.clientY-e.documentTop);t.domEventHandlers[i](e,r,n)&&n.preventDefault()}));this.markers=rc(t.markers(e)),t.initialSpacer&&(this.spacer=new ac(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=rc(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let i=e.view.viewport;return!Wt.eq(this.markers,t,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class ac{constructor(e,t,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.update(e,t,i,n)}update(e,t,i,n){this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let i=0;i_e(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let e in t){let n=i[e],r=t[e];i[e]=n?(e,t,i)=>n(e,t,i)||r(e,t,i):r}return i}})});class cc extends Fh{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function uc(e,t){return e.state.facet(hc).formatNumber(t,e.state)}const fc=Jh.compute([hc],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(lc),lineMarker:(e,t,i)=>i.some((e=>e.toDOM))?null:new cc(uc(e,e.state.doc.lineAt(t.from).number)),lineMarkerChange:e=>e.startState.facet(hc)!=e.state.facet(hc),initialSpacer:e=>new cc(uc(e,pc(e.state.doc.lines))),updateSpacer(e,t){let i=uc(t.view,pc(t.view.state.doc.lines));return i==e.number?e:new cc(i)},domEventHandlers:e.facet(hc).domEventHandlers})));function dc(e={}){return[hc.of(e),ic(),fc]}function pc(e){let t=9;for(;t_e(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})});const Pc=B.define({create:()=>Yc.empty,update(e,t){let i=t.state.facet(gc),n=t.annotation($c);if(n){let r=t.docChanged?z.single(function(e){let t=0;return e.iterChangedRanges(((e,i)=>t=i)),t}(t.changes)):void 0,O=kc.fromTransaction(t,r),s=n.side,o=0==s?e.undone:e.done;return o=O?vc(o,o.length,i.minDepth,O):Tc(o,t.startState.selection),new Yc(0==s?n.rest:o,0==s?o:n.rest)}let r=t.annotation(Qc);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(Pe.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let O=kc.fromTransaction(t),s=t.annotation(Pe.time),o=t.annotation(Pe.userEvent);return O?e=e.addChanges(O,s,o,i.newGroupDelay,i.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,s,o,i.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new Yc(e.done.map(kc.fromJSON),e.undone.map(kc.fromJSON))});function Xc(e={}){return[Pc,gc.of(e),bO.domEventHandlers({beforeinput(e,t){let i="historyUndo"==e.inputType?wc:"historyRedo"==e.inputType?bc:null;return!!i&&(e.preventDefault(),i(t))}})]}function yc(e,t){return function({state:i,dispatch:n}){if(!t&&i.readOnly)return!1;let r=i.field(Pc,!1);if(!r)return!1;let O=r.pop(e,i,t);return!!O&&(n(O),!0)}}const wc=yc(0,!1),bc=yc(1,!1),xc=yc(0,!0),Sc=yc(1,!0);class kc{constructor(e,t,i,n,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(e){return new kc(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new kc(e.changes&&T.fromJSON(e.changes),[],e.mapped&&W.fromJSON(e.mapped),e.startSelection&&z.fromJSON(e.startSelection),e.selectionsAfter.map(z.fromJSON))}static fromTransaction(e,t){let i=Wc;for(let t of e.startState.facet(mc)){let n=t(e);n.length&&(i=i.concat(n))}return!i.length&&e.changes.empty?null:new kc(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Wc)}static selection(e){return new kc(void 0,Wc,void 0,void 0,e)}}function vc(e,t,i,n){let r=t+1>i+20?t-i-1:0,O=e.slice(r,t);return O.push(n),O}function Rc(e,t){return e.length?t.length?e.concat(t):e:t}const Wc=[];function Tc(e,t){if(e.length){let i=e[e.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-200));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),vc(e,e.length-1,1e9,i.setSelAfter(n)))}return[kc.selection([t])]}function _c(e){let t=e[e.length-1],i=e.slice();return i[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),i}function Vc(e,t){if(!e.length)return e;let i=e.length,n=Wc;for(;i;){let r=qc(e[i-1],t,n);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,i);return t[i-1]=r,t}t=r.mapped,i--,n=r.selectionsAfter}return n.length?[kc.selection(n)]:Wc}function qc(e,t,i){let n=Rc(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):Wc,i);if(!e.changes)return kc.selection(n);let r=e.changes.map(t),O=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(O):O;return new kc(r,ge.mapEffects(e.effects,t),s,e.startSelection.map(O),n)}const Ac=/^(input\.type|delete)($|\.)/;class Yc{constructor(e,t,i=0,n){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Yc(this.done,this.undone):this}addChanges(e,t,i,n,r){let O=this.done,s=O[O.length-1];return O=s&&s.changes&&!s.changes.empty&&e.changes&&(!i||Ac.test(i))&&(!s.selectionsAfter.length&&t-this.prevTimei.push(e,t))),t.iterChangedRanges(((e,t,r,O)=>{for(let e=0;e=t&&r<=s&&(n=!0)}})),n}(s.changes,e.changes)||"input.type.compose"==i)?vc(O,O.length-1,r,new kc(e.changes.compose(s.changes),Rc(e.effects,s.effects),s.mapped,s.startSelection,Wc)):vc(O,O.length,r,e),new Yc(O,Wc,t,i)}addSelection(e,t,i,n){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Wc;return r.length>0&&t-this.prevTimee.empty!=t.ranges[i].empty)).length}(r[r.length-1],e)?this:new Yc(Tc(this.done,e),this.undone,t,i)}addMapping(e){return new Yc(Vc(this.done,e),Vc(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let n=0==e?this.done:this.undone;if(0==n.length)return null;let r=n[n.length-1];if(i&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:$c.of({side:e,rest:_c(n)}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let i=1==n.length?Wc:n.slice(0,n.length-1);return r.mapped&&(i=Vc(i,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:$c.of({side:e,rest:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}Yc.empty=new Yc(Wc,Wc);const Nc=[{key:"Mod-z",run:wc,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:bc,preventDefault:!0},{key:"Mod-u",run:xc,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Sc,preventDefault:!0}],Zc=(bO.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),I.define({combine:e=>_e(e,{afterCursor:!0,brackets:"()[]{}",maxScanDistance:1e4})})),zc=Fi.mark({class:"cm-matchingBracket"}),Cc=Fi.mark({class:"cm-nonmatchingBracket"});B.define({create:()=>Fi.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let i=[],n=t.state.facet(Zc);for(let e of t.state.selection.ranges){if(!e.empty)continue;let r=Gc(t.state,e.head,-1,n)||e.head>0&&Gc(t.state,e.head-1,1,n)||n.afterCursor&&(Gc(t.state,e.head,1,n)||e.headbO.decorations.from(e)});function Uc(e,t,i){let n=e.prop(t<0?Ye.openedBy:Ye.closedBy);if(n)return n;if(1==e.name.length){let n=i.indexOf(e.name);if(n>-1&&n%2==(t<0?1:0))return[i[n+t]]}return null}function Gc(e,t,i,n={}){let r=n.maxScanDistance||1e4,O=n.brackets||"()[]{}",s=ds(e),o=s.resolveInner(t,i);for(let n=o;n;n=n.parent){let r=Uc(n.type,i,O);if(r&&n.from0)return null;let l={from:i<0?t-1:t,to:i>0?t+1:t},h=e.doc.iterRange(t,i>0?e.doc.length:0),c=0;for(let e=0;!h.next().done&&e<=O;){let O=h.value;i<0&&(e+=O.length);let o=t+e*i;for(let e=i>0?0:O.length-1,t=i>0?O.length:-1;e!=t;e+=i){let t=s.indexOf(O[e]);if(!(t<0||n.resolve(o+e,1).type!=r))if(t%2==0==i>0)c++;else{if(1==c)return{start:l,end:{from:o+e,to:o+e+1},matched:t>>1==a>>1};c--}}i>0&&(e+=O.length)}return h.done?{start:l,matched:!1}:null}(e,t,i,s,o.type,r,O)}function Ic(e,t,i,n,r,O){let s=n.parent,o={from:n.from,to:n.to},a=0,l=null==s?void 0:s.cursor;if(l&&(i<0?l.childBefore(n.from):l.childAfter(n.to)))do{if(i<0?l.to<=n.from:l.from>=n.to){if(0==a&&r.indexOf(l.type.name)>-1&&l.fromi.empty?e.moveByChar(i,t):Mc(i,t)))}const Bc=e=>Lc(e,e.textDirection!=An.LTR),Kc=e=>Lc(e,e.textDirection==An.LTR);function Fc(e,t){return Dc(e,(i=>i.empty?e.moveByGroup(i,t):Mc(i,t)))}function Hc(e,t,i){if(t.type.prop(i))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Jc(e,t,i){let n,r,O=ds(e).resolveInner(t.head),s=i?Ye.closedBy:Ye.openedBy;for(let n=t.head;;){let t=i?O.childAfter(n):O.childBefore(n);if(!t)break;Hc(e,t,s)?O=t:n=i?t.to:t.from}return r=O.type.prop(s)&&(n=i?Gc(e,O.from,1):Gc(e,O.to,-1))&&n.matched?i?n.end.to:n.end.from:i?O.to:O.from,z.cursor(r,i?-1:1)}function eu(e,t){return Dc(e,(i=>{if(!i.empty)return Mc(i,t);let n=e.moveVertically(i,t);return n.head!=i.head?n:e.moveToLineBoundary(i,t)}))}const tu=e=>eu(e,!1),iu=e=>eu(e,!0);function nu(e,t){let{state:i}=e,n=jc(i.selection,(i=>i.empty?e.moveVertically(i,t,e.dom.clientHeight):Mc(i,t)));if(n.eq(i.selection))return!1;let r=e.coordsAtPos(i.selection.main.head),O=e.scrollDOM.getBoundingClientRect();return e.dispatch(Ec(i,n),{effects:r&&r.top>O.top&&r.bottomnu(e,!1),Ou=e=>nu(e,!0);function su(e,t,i){let n=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,i);if(r.head==t.head&&r.head!=(i?n.to:n.from)&&(r=e.moveToLineBoundary(t,i,!1)),!i&&r.head==n.from&&n.length){let i=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;i&&t.head!=n.from+i&&(r=z.cursor(n.from+i))}return r}const ou=e=>Dc(e,(t=>su(e,t,!0))),au=e=>Dc(e,(t=>su(e,t,!1)));function lu(e,t){let i=jc(e.state.selection,(e=>{let i=t(e);return z.range(e.anchor,i.head,i.goalColumn)}));return!i.eq(e.state.selection)&&(e.dispatch(Ec(e.state,i)),!0)}function hu(e,t){return lu(e,(i=>e.moveByChar(i,t)))}const cu=e=>hu(e,e.textDirection!=An.LTR),uu=e=>hu(e,e.textDirection==An.LTR);function fu(e,t){return lu(e,(i=>e.moveByGroup(i,t)))}function du(e,t){return lu(e,(i=>e.moveVertically(i,t)))}const pu=e=>du(e,!1),$u=e=>du(e,!0);function Qu(e,t){return lu(e,(i=>e.moveVertically(i,t,e.dom.clientHeight)))}const mu=e=>Qu(e,!1),gu=e=>Qu(e,!0),Pu=e=>lu(e,(t=>su(e,t,!0))),Xu=e=>lu(e,(t=>su(e,t,!1))),yu=({state:e,dispatch:t})=>(t(Ec(e,{anchor:0})),!0),wu=({state:e,dispatch:t})=>(t(Ec(e,{anchor:e.doc.length})),!0),bu=({state:e,dispatch:t})=>(t(Ec(e,{anchor:e.selection.main.anchor,head:0})),!0),xu=({state:e,dispatch:t})=>(t(Ec(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function Su({state:e,dispatch:t},i){if(e.readOnly)return!1;let n="delete.selection",r=e.changeByRange((e=>{let{from:t,to:r}=e;if(t==r){let e=i(t);et&&(n="delete.forward"),t=Math.min(t,e),r=Math.max(r,e)}return t==r?{range:e}:{changes:{from:t,to:r},range:z.cursor(t)}}));return!r.changes.empty&&(t(e.update(r,{scrollIntoView:!0,userEvent:n})),!0)}function ku(e,t,i){if(e instanceof bO)for(let n of e.pluginField(wn.atomicRanges))n.between(t,t,((e,n)=>{et&&(t=i?n:e)}));return t}const vu=(e,t)=>Su(e,(i=>{let n,r,{state:O}=e,s=O.doc.lineAt(i);if(!t&&i>s.from&&ivu(e,!1),Wu=e=>vu(e,!0),Tu=(e,t)=>Su(e,(i=>{let n=i,{state:r}=e,O=r.doc.lineAt(n),s=r.charCategorizer(n);for(let e=null;;){if(n==(t?O.to:O.from)){n==i&&O.number!=(t?r.doc.lines:1)&&(n+=t?1:-1);break}let o=a(O.text,n-O.from,t)+O.from,l=O.text.slice(Math.min(n,o)-O.from,Math.max(n,o)-O.from),h=s(l);if(null!=e&&h!=e)break;" "==l&&n==i||(e=h),n=o}return ku(e,n,t)})),_u=e=>Tu(e,!1),Vu=e=>Su(e,(t=>{let i=e.lineBlockAt(t).to;return ku(e,t=r.number){let e=t[t.length-1];e.to=O.to,e.ranges.push(n)}else t.push({from:r.from,to:O.to,ranges:[n]});i=O.number+1}return t}function Au(e,t,i){if(e.readOnly)return!1;let n=[],r=[];for(let t of qu(e)){if(i?t.to==e.doc.length:0==t.from)continue;let O=e.doc.lineAt(i?t.to+1:t.from-1),s=O.length+1;if(i){n.push({from:t.to,to:O.to},{from:t.from,insert:O.text+e.lineBreak});for(let i of t.ranges)r.push(z.range(Math.min(e.doc.length,i.anchor+s),Math.min(e.doc.length,i.head+s)))}else{n.push({from:O.from,to:t.from},{from:t.to,insert:e.lineBreak+O.text});for(let e of t.ranges)r.push(z.range(e.anchor-s,e.head-s))}}return!!n.length&&(t(e.update({changes:n,scrollIntoView:!0,selection:z.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function Yu(e,t,i){if(e.readOnly)return!1;let n=[];for(let t of qu(e))i?n.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):n.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Nu=zu(!1),Zu=zu(!0);function zu(e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let n=t.changeByRange((i=>{let{from:n,to:r}=i,O=t.doc.lineAt(n),s=!e&&n==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let i,n=ds(e).resolveInner(t),r=n.childBefore(t),O=n.childAfter(t);return r&&O&&r.to<=t&&O.from>=t&&(i=r.type.prop(Ye.closedBy))&&i.indexOf(O.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(O.from).from?{from:r.to,to:O.from}:null}(t,n);e&&(n=r=(r<=O.to?O:t.doc.lineAt(r)).to);let o=new _s(t,{simulateBreak:n,simulateDoubleBreak:!!s}),a=Ts(o,n);for(null==a&&(a=/^\s*/.exec(t.doc.lineAt(n).text)[0].length);rO.from&&n{let r=[];for(let O=n.from;O<=n.to;){let s=e.doc.lineAt(O);s.number>i&&(n.empty||n.to>s.from)&&(t(s,r,n),i=s.number),O=s.to+1}let O=e.changes(r);return{changes:r,range:z.range(O.mapPos(n.anchor,1),O.mapPos(n.head,1))}}))}const Uu=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Cu(e,((t,i)=>{i.push({from:t.from,insert:e.facet(vs)})})),{userEvent:"input.indent"})),!0),Gu=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Cu(e,((t,i)=>{let n=/^\s*/.exec(t.text)[0];if(!n)return;let r=$(n,e.tabSize),O=0,s=Ws(e,Math.max(0,r-Rs(e)));for(;ODc(e,(t=>z.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>lu(e,(t=>z.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>Dc(e,(t=>z.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>lu(e,(t=>z.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:Wu},{key:"Ctrl-h",run:Ru},{key:"Ctrl-k",run:Vu},{key:"Ctrl-Alt-h",run:_u},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:m.of(["",""])},range:z.cursor(e.from)})));return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let i=t.from,n=e.doc.lineAt(i),r=i==n.from?i-1:a(n.text,i-n.from,!1)+n.from,O=i==n.to?i+1:a(n.text,i-n.from,!0)+n.from;return{changes:{from:r,to:O,insert:e.doc.slice(i,O).append(e.doc.slice(r,i))},range:z.cursor(O)}}));return!i.changes.empty&&(t(e.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Ou}],ju=[{key:"ArrowLeft",run:Bc,shift:cu,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>Fc(e,e.textDirection!=An.LTR),shift:e=>fu(e,e.textDirection!=An.LTR)},{mac:"Cmd-ArrowLeft",run:au,shift:Xu},{key:"ArrowRight",run:Kc,shift:uu,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>Fc(e,e.textDirection==An.LTR),shift:e=>fu(e,e.textDirection==An.LTR)},{mac:"Cmd-ArrowRight",run:ou,shift:Pu},{key:"ArrowUp",run:tu,shift:pu,preventDefault:!0},{mac:"Cmd-ArrowUp",run:yu,shift:bu},{mac:"Ctrl-ArrowUp",run:ru,shift:mu},{key:"ArrowDown",run:iu,shift:$u,preventDefault:!0},{mac:"Cmd-ArrowDown",run:wu,shift:xu},{mac:"Ctrl-ArrowDown",run:Ou,shift:gu},{key:"PageUp",run:ru,shift:mu},{key:"PageDown",run:Ou,shift:gu},{key:"Home",run:au,shift:Xu},{key:"Mod-Home",run:yu,shift:bu},{key:"End",run:ou,shift:Pu},{key:"Mod-End",run:wu,shift:xu},{key:"Enter",run:Nu},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Ru,shift:Ru},{key:"Delete",run:Wu},{key:"Mod-Backspace",mac:"Alt-Backspace",run:_u},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>Tu(e,!0)},{mac:"Mod-Backspace",run:e=>Su(e,(t=>{let i=e.lineBlockAt(t).from;return ku(e,t>i?i:Math.max(0,t-1),!1)}))},{mac:"Mod-Delete",run:Vu}].concat(Iu.map((e=>({mac:e.key,run:e.run,shift:e.shift})))),Eu=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>Dc(e,(t=>Jc(e.state,t,e.textDirection!=An.LTR))),shift:e=>lu(e,(t=>Jc(e.state,t,e.textDirection!=An.LTR)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>Dc(e,(t=>Jc(e.state,t,e.textDirection==An.LTR))),shift:e=>lu(e,(t=>Jc(e.state,t,e.textDirection==An.LTR)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Au(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>Yu(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Au(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>Yu(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let i=e.selection,n=null;return i.ranges.length>1?n=z.create([i.main]):i.main.empty||(n=z.create([z.cursor(i.main.head)])),!!n&&(t(Ec(e,n)),!0)}},{key:"Mod-Enter",run:Zu},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let i=qu(e).map((({from:t,to:i})=>z.range(t,Math.min(i+1,e.doc.length))));return t(e.update({selection:z.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let i=jc(e.selection,(t=>{var i;let n=ds(e).resolveInner(t.head,1);for(;!(n.from=t.to||n.to>t.to&&n.from<=t.from)&&(null===(i=n.parent)||void 0===i?void 0:i.parent);)n=n.parent;return z.range(n.to,n.from)}));return t(Ec(e,i)),!0},preventDefault:!0},{key:"Mod-[",run:Gu},{key:"Mod-]",run:Uu},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=Object.create(null),n=new _s(e,{overrideIndentation:e=>{let t=i[e];return null==t?-1:t}}),r=Cu(e,((t,r,O)=>{let s=Ts(n,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);let o=/^\s*/.exec(t.text)[0],a=Ws(e,s);(o!=a||O.from{if(e.state.readOnly)return!1;let{state:t}=e,i=t.changes(qu(t).map((({from:e,to:i})=>(e>0?e--:ie.moveVertically(t,!0))).map(i);return e.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,i){let n=!1,r=jc(e.selection,(t=>{let r=Gc(e,t.head,-1)||Gc(e,t.head,1)||t.head>0&&Gc(e,t.head-1,1)||t.head2e3?-1:r==n.length?function(e,t){let i=e.coordsAtPos(e.viewport.from);return i?Math.round(Math.abs((i.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):$(n.text,e.state.tabSize,i-n.from);return{line:n.number,col:O,off:r}}function Mu(e,t){let i=Du(e,t),n=e.state.selection;return i?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(i.line).from),r=e.state.doc.lineAt(t);i={line:r.number,col:i.col,off:Math.min(i.off,r.length)},n=n.map(e.changes)}},get(t,r,O){let s=Du(e,t);if(!s)return n;let o=function(e,t,i){let n=Math.min(t.line,i.line),r=Math.max(t.line,i.line),O=[];if(t.off>2e3||i.off>2e3||t.col<0||i.col<0){let s=Math.min(t.off,i.off),o=Math.max(t.off,i.off);for(let t=n;t<=r;t++){let i=e.doc.line(t);i.length<=o&&O.push(z.range(i.from+s,i.to+o))}}else{let s=Math.min(t.col,i.col),o=Math.max(t.col,i.col);for(let t=n;t<=r;t++){let i=e.doc.line(t),n=Q(i.text,s,e.tabSize,!0);if(n>-1){let t=Q(i.text,o,e.tabSize);O.push(z.range(i.from+n,i.from+t))}}}return O}(e.state,i,s);return o.length?O?z.create(o.concat(n.ranges)):z.create(o):n}}:null}function Lu(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return bO.mouseSelectionStyle.of(((e,i)=>t(i)?Mu(e,i):null))}function Bu(e,t){let i=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);return i>=n?void 0:{from:i,to:n}}const Ku=ge.define({map:Bu}),Fu=ge.define({map:Bu});function Hu(e){let t=[];for(let{head:i}of e.state.selection.ranges)t.some((e=>e.from<=i&&e.to>=i))||t.push(e.lineBlockAt(i));return t}const Ju=B.define({create:()=>Fi.none,update(e,t){e=e.map(t.changes);for(let i of t.effects)i.is(Ku)&&!tf(e,i.value.from,i.value.to)?e=e.update({add:[lf.range(i.value.from,i.value.to)]}):i.is(Fu)&&(e=e.update({filter:(e,t)=>i.value.from!=e||i.value.to!=t,filterFrom:i.value.from,filterTo:i.value.to}));if(t.selection){let i=!1,{head:n}=t.selection.main;e.between(n,n,((e,t)=>{en&&(i=!0)})),i&&(e=e.update({filterFrom:n,filterTo:n,filter:(e,t)=>t<=n||e>=n}))}return e},provide:e=>bO.decorations.from(e)});function ef(e,t,i){var n;let r=null;return null===(n=e.field(Ju,!1))||void 0===n||n.between(t,i,((e,t)=>{(!r||r.from>e)&&(r={from:e,to:t})})),r}function tf(e,t,i){let n=!1;return e.between(t,t,((e,r)=>{e==t&&r==i&&(n=!0)})),n}function nf(e,t){return e.field(Ju,!1)?t:t.concat(ge.appendConfig.of(af()))}function rf(e,t,i=!0){let n=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return bO.announce.of(`${e.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${e.state.phrase("to")} ${r}.`)}const Of=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of Hu(e)){let i=Ms(e.state,t.from,t.to);if(i)return e.dispatch({effects:nf(e.state,[Ku.of(i),rf(e,i)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(Ju,!1))return!1;let t=[];for(let i of Hu(e)){let n=ef(e.state,i.from,i.to);n&&t.push(Fu.of(n),rf(e,n,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,i=[];for(let n=0;n{let t=e.state.field(Ju,!1);if(!t||!t.size)return!1;let i=[];return t.between(0,e.state.doc.length,((e,t)=>{i.push(Fu.of({from:e,to:t}))})),e.dispatch({effects:i}),!0}}],sf={placeholderDOM:null,placeholderText:"…"},of=I.define({combine:e=>_e(e,sf)});function af(e){let t=[Ju,hf];return e&&t.push(of.of(e)),t}const lf=Fi.replace({widget:new class extends Bi{toDOM(e){let{state:t}=e,i=t.facet(of),n=t=>{let i=e.lineBlockAt(e.posAtDOM(t.target)),n=ef(e.state,i.from,i.to);n&&e.dispatch({effects:Fu.of(n)}),t.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,n);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=n,r}}});const hf=bO.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),cf={brackets:["(","[","{","'",'"'],before:")]}:;>"},uf=ge.define({map(e,t){let i=t.mapPos(e,-1,R.TrackAfter);return null==i?void 0:i}}),ff=ge.define({map:(e,t)=>t.mapPos(e)}),df=new class extends St{};df.startSide=1,df.endSide=-1;const pf=B.define({create:()=>Wt.empty,update(e,t){if(t.selection){let i=t.state.doc.lineAt(t.selection.main.head).from,n=t.startState.doc.lineAt(t.startState.selection.main.head).from;i!=t.changes.mapPos(n,-1)&&(e=Wt.empty)}e=e.map(t.changes);for(let i of t.effects)i.is(uf)?e=e.update({add:[df.range(i.value,i.value+1)]}):i.is(ff)&&(e=e.update({filter:e=>e!=i.value}));return e}});function $f(){return[Pf,pf]}function Qf(e){for(let t=0;t<8;t+=2)if("()[]{}<>".charCodeAt(t)==e)return"()[]{}<>".charAt(t+1);return d(e<128?e:e+1)}function mf(e,t){return e.languageDataAt("closeBrackets",t)[0]||cf}const gf="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),Pf=bO.inputHandler.of(((e,t,i,n)=>{if((gf?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(n.length>2||2==n.length&&1==p(f(n,0))||t!=r.from||i!=r.to)return!1;let O=function(e,t){let i=mf(e,e.selection.main.head),n=i.brackets||cf.brackets;for(let r of n){let O=Qf(f(r,0));if(t==r)return O==r?Sf(e,r,n.indexOf(r+r+r)>-1):bf(e,r,O,i.before||cf.before);if(t==O&&yf(e,e.selection.main.from))return xf(e,r,O)}return null}(e.state,n);return!!O&&(e.dispatch(O),!0)})),Xf=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=mf(e,e.selection.main.head).brackets||cf.brackets,n=null,r=e.changeByRange((t=>{if(t.empty){let n=function(e,t){let i=e.sliceString(t-2,t);return p(f(i,0))==i.length?i:i.slice(1)}(e.doc,t.head);for(let r of i)if(r==n&&wf(e.doc,t.head)==Qf(f(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:z.cursor(t.head-r.length),userEvent:"delete.backward"}}return{range:n=t}}));return n||t(e.update(r,{scrollIntoView:!0})),!n}}];function yf(e,t){let i=!1;return e.field(pf).between(0,e.doc.length,(e=>{e==t&&(i=!0)})),i}function wf(e,t){let i=e.sliceString(t,t+2);return i.slice(0,p(f(i,0)))}function bf(e,t,i,n){let r=null,O=e.changeByRange((O=>{if(!O.empty)return{changes:[{insert:t,from:O.from},{insert:i,from:O.to}],effects:uf.of(O.to+t.length),range:z.range(O.anchor+t.length,O.head+t.length)};let s=wf(e.doc,O.head);return!s||/\s/.test(s)||n.indexOf(s)>-1?{changes:{insert:t+i,from:O.head},effects:uf.of(O.head+t.length),range:z.cursor(O.head+t.length)}:{range:r=O}}));return r?null:e.update(O,{scrollIntoView:!0,userEvent:"input.type"})}function xf(e,t,i){let n=null,r=e.selection.ranges.map((t=>t.empty&&wf(e.doc,t.head)==i?z.cursor(t.head+i.length):n=t));return n?null:e.update({selection:z.create(r,e.selection.mainIndex),scrollIntoView:!0,effects:e.selection.ranges.map((({from:e})=>ff.of(e)))})}function Sf(e,t,i){let n=null,r=e.changeByRange((r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:uf.of(r.to+t.length),range:z.range(r.anchor+t.length,r.head+t.length)};let O=r.head,s=wf(e.doc,O);if(s==t){if(kf(e,O))return{changes:{insert:t+t,from:O},effects:uf.of(O+t.length),range:z.cursor(O+t.length)};if(yf(e,O)){let n=i&&e.sliceDoc(O,O+3*t.length)==t+t+t;return{range:z.cursor(O+t.length*(n?3:1)),effects:ff.of(O)}}}else{if(i&&e.sliceDoc(O-2*t.length,O)==t+t&&kf(e,O-2*t.length))return{changes:{insert:t+t+t+t,from:O},effects:uf.of(O+t.length),range:z.cursor(O+t.length)};if(e.charCategorizer(O)(s)!=ke.Word){let i=e.sliceDoc(O-1,O);if(i!=t&&e.charCategorizer(O)(i)!=ke.Word&&!function(e,t,i){let n=ds(e).resolveInner(t,-1);for(let r=0;r<5;r++){if(e.sliceDoc(n.from,n.from+i.length)==i)return!0;let r=n.to==t&&n.parent;if(!r)break;n=r}return!1}(e,O,t))return{changes:{insert:t+t,from:O},effects:uf.of(O+t.length),range:z.cursor(O+t.length)}}}return{range:n=r}}));return n?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function kf(e,t){let i=ds(e).resolveInner(t+1);return i.parent&&i.from==t}const vf=I.define({combine(e){let t,i;for(let n of e)t=t||n.topContainer,i=i||n.bottomContainer;return{topContainer:t,bottomContainer:i}}});function Rf(e,t){let i=e.plugin(Wf),n=i?i.specs.indexOf(t):-1;return n>-1?i.panels[n]:null}const Wf=Sn.fromClass(class{constructor(e){this.input=e.state.facet(qf),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(vf);this.top=new Tf(e,!0,t.topContainer),this.bottom=new Tf(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(vf);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Tf(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Tf(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=e.state.facet(qf);if(i!=this.input){let t=i.filter((e=>e)),n=[],r=[],O=[],s=[];for(let i of t){let t,o=this.specs.indexOf(i);o<0?(t=i(e.view),s.push(t)):(t=this.panels[o],t.update&&t.update(e)),n.push(t),(t.top?r:O).push(t)}this.specs=t,this.panels=n,this.top.sync(r),this.bottom.sync(O);for(let e of s)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:wn.scrollMargins.from((e=>({top:e.top.scrollMargin(),bottom:e.bottom.scrollMargin()})))});class Tf{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=_f(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=_f(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function _f(e){let t=e.nextSibling;return e.remove(),t}const Vf=bO.baseTheme({".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"}}),qf=I.define({enables:[Wf,Vf]});function Af(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var r=i[n];"string"==typeof r?e.setAttribute(n,r):null!=r&&(e[n]=r)}t++}for(;te.normalize("NFKD"):e=>e;class Zf{constructor(e,t,i=0,n=e.length,r){this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,n),this.bufferStart=i,this.normalize=r?e=>r(Nf(e)):Nf,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return f(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=d(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=p(e);let n=this.normalize(t);for(let e=0,r=i;;e++){let O=n.charCodeAt(e),s=this.match(O,r);if(s)return this.value=s,this;if(e==n.length-1)break;r==i&&ethis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,n=i+t[0].length;if(this.matchPos=n+(i==n?1:0),i==this.curLine.length&&this.nextLine(),ithis.value.to)return this.value={from:i,to:n,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=i||n.to<=t){let n=new If(t,e.sliceString(t,i));return Gf.set(e,n),n}if(n.from==t&&n.to==i)return n;let{text:r,from:O}=n;return O>t&&(r=e.sliceString(t,O)+r,O=t),n.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t&&this.flat.tothis.flat.text.length-10&&(t=null),t){let e=this.flat.from+t.index,i=e+t[0].length;return this.value={from:e,to:i,match:t},this.matchPos=i+(e==i?1:0),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=If.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Ef(e){let t=Af("input",{class:"cm-textfield",name:"line"});function i(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!i)return;let{state:n}=e,r=n.doc.lineAt(n.selection.main.head),[,O,s,o,a]=i,l=o?+o.slice(1):0,h=s?+s:r.number;if(s&&a){let e=h/100;O&&(e=e*("-"==O?-1:1)+r.number/n.doc.lines),h=Math.round(n.doc.lines*e)}else s&&O&&(h=h*("-"==O?-1:1)+r.number);let c=n.doc.line(Math.max(1,Math.min(n.doc.lines,h)));e.dispatch({effects:Df.of(!1),selection:z.cursor(c.from+Math.max(0,Math.min(l,c.length))),scrollIntoView:!0}),e.focus()}return{dom:Af("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:Df.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),i())},onsubmit:e=>{e.preventDefault(),i()}},Af("label",e.state.phrase("Go to line"),": ",t)," ",Af("button",{class:"cm-button",type:"submit"},e.state.phrase("go"))),pos:-10}}"undefined"!=typeof Symbol&&(Uf.prototype[Symbol.iterator]=jf.prototype[Symbol.iterator]=function(){return this});const Df=ge.define(),Mf=(B.define({create:()=>!0,update(e,t){for(let i of t.effects)i.is(Df)&&(e=i.value);return e},provide:e=>qf.from(e,(e=>e?Ef:null))}),bO.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),{highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!0}),Lf=I.define({combine:e=>_e(e,Mf,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})});function Bf(e){let t=[ed,Jf];return e&&t.push(Lf.of(e)),t}const Kf=Fi.mark({class:"cm-selectionMatch"}),Ff=Fi.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Hf(e,t,i,n){return!(0!=i&&e(t.sliceDoc(i-1,i))==ke.Word||n!=t.doc.length&&e(t.sliceDoc(n,n+1))==ke.Word)}const Jf=Sn.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Lf),{state:i}=e,n=i.selection;if(n.ranges.length>1)return Fi.none;let r,O=n.main,s=null;if(O.empty){if(!t.highlightWordAroundCursor)return Fi.none;let e=i.wordAt(O.head);if(!e)return Fi.none;s=i.charCategorizer(O.head),r=i.sliceDoc(e.from,e.to)}else{let e=O.to-O.from;if(e200)return Fi.none;if(t.wholeWords){if(r=i.sliceDoc(O.from,O.to),s=i.charCategorizer(O.head),!Hf(s,i,O.from,O.to)||!function(e,t,i,n){return e(t.sliceDoc(i,i+1))==ke.Word&&e(t.sliceDoc(n-1,n))==ke.Word}(s,i,O.from,O.to))return Fi.none}else if(r=i.sliceDoc(O.from,O.to).trim(),!r)return Fi.none}let o=[];for(let n of e.visibleRanges){let e=new Zf(i.doc,r,n.from,n.to);for(;!e.next().done;){let{from:n,to:r}=e.value;if((!s||Hf(s,i,n,r))&&(O.empty&&n<=O.from&&r>=O.to?o.push(Ff.range(n,r)):(n>=O.to||r<=O.from)&&o.push(Kf.range(n,r)),o.length>t.maxMatches))return Fi.none}}return Fi.set(o)}},{decorations:e=>e.decorations}),ed=bO.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});const td=I.define({combine(e){var t;return{top:e.reduce(((e,t)=>null!=e?e:t.top),void 0)||!1,caseSensitive:e.reduce(((e,t)=>null!=e?e:t.caseSensitive||t.matchCase),void 0)||!1,createPanel:(null===(t=e.find((e=>e.createPanel)))||void 0===t?void 0:t.createPanel)||(e=>new xd(e))}}});class id{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Cf),!0}catch(e){return!1}}(this.search)),this.unquoted=this.search.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new od(this):new Od(this)}getCursor(e,t=0,i=e.length){return this.regexp?sd(this,e,t,i):rd(this,e,t,i)}}class nd{constructor(e){this.spec=e}}function rd(e,t,i,n){return new Zf(t,e.unquoted,i,n,e.caseSensitive?void 0:e=>e.toLowerCase())}class Od extends nd{constructor(e){super(e)}nextMatch(e,t,i){let n=rd(this.spec,e,i,e.length).nextOverlapping();return n.done&&(n=rd(this.spec,e,0,t).nextOverlapping()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=i;;){let i=Math.max(t,n-1e4-this.spec.unquoted.length),r=rd(this.spec,e,i,n),O=null;for(;!r.nextOverlapping().done;)O=r.value;if(O)return O;if(i==t)return null;n-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let i=rd(this.spec,e,0,e.length),n=[];for(;!i.next().done;){if(n.length>=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=rd(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function sd(e,t,i,n){return new Uf(t,e.search,e.caseSensitive?void 0:{ignoreCase:!0},i,n)}class od extends nd{nextMatch(e,t,i){let n=sd(this.spec,e,i,e.length).next();return n.done&&(n=sd(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let r=Math.max(t,i-1e4*n),O=sd(this.spec,e,r,i),s=null;for(;!O.next().done;)s=O.value;if(s&&(r==t||s.from>r+10))return s;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,((t,i)=>"$"==i?"$":"&"==i?e.match[0]:"0"!=i&&+i=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=sd(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const ad=ge.define(),ld=ge.define(),hd=B.define({create:e=>new cd(yd(e).create(),null),update(e,t){for(let i of t.effects)i.is(ad)?e=new cd(i.value.create(),e.panel):i.is(ld)&&(e=new cd(e.query,i.value?Xd:null));return e},provide:e=>qf.from(e,(e=>e.panel))});class cd{constructor(e,t){this.query=e,this.panel=t}}const ud=Fi.mark({class:"cm-searchMatch"}),fd=Fi.mark({class:"cm-searchMatch cm-searchMatch-selected"}),dd=Sn.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(hd))}update(e){let t=e.state.field(hd);(t!=e.startState.field(hd)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Fi.none;let{view:i}=this,n=new Tt;for(let t=0,r=i.visibleRanges,O=r.length;tr[t+1].from-500;)o=r[++t].to;e.highlight(i.state.doc,s,o,((e,t)=>{let r=i.state.selection.ranges.some((i=>i.from==e&&i.to==t));n.add(e,t,r?fd:ud)}))}return n.finish()}},{decorations:e=>e.decorations});function pd(e){return t=>{let i=t.state.field(hd,!1);return i&&i.query.spec.valid?e(t,i):wd(t)}}const $d=pd(((e,{query:t})=>{let{from:i,to:n}=e.state.selection.main,r=t.nextMatch(e.state.doc,i,n);return!(!r||r.from==i&&r.to==n||(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:vd(e,r),userEvent:"select.search"}),0))})),Qd=pd(((e,{query:t})=>{let{state:i}=e,{from:n,to:r}=i.selection.main,O=t.prevMatch(i.doc,n,r);return!!O&&(e.dispatch({selection:{anchor:O.from,head:O.to},scrollIntoView:!0,effects:vd(e,O),userEvent:"select.search"}),!0)})),md=pd(((e,{query:t})=>{let i=t.matchAll(e.state.doc,1e3);return!(!i||!i.length||(e.dispatch({selection:z.create(i.map((e=>z.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),gd=pd(((e,{query:t})=>{let{state:i}=e,{from:n,to:r}=i.selection.main;if(i.readOnly)return!1;let O=t.nextMatch(i.doc,n,n);if(!O)return!1;let s,o,a=[];if(O.from==n&&O.to==r&&(o=i.toText(t.getReplacement(O)),a.push({from:O.from,to:O.to,insert:o}),O=t.nextMatch(i.doc,O.from,O.to)),O){let e=0==a.length||a[0].from>=O.to?0:O.to-O.from-o.length;s={anchor:O.from-e,head:O.to-e}}return e.dispatch({changes:a,selection:s,scrollIntoView:!!s,effects:O?vd(e,O):void 0,userEvent:"input.replace"}),!0})),Pd=pd(((e,{query:t})=>{if(e.state.readOnly)return!1;let i=t.matchAll(e.state.doc,1e9).map((e=>{let{from:i,to:n}=e;return{from:i,to:n,insert:t.getReplacement(e)}}));return!!i.length&&(e.dispatch({changes:i,userEvent:"input.replace.all"}),!0)}));function Xd(e){return e.state.facet(td).createPanel(e)}function yd(e,t){var i;let n=e.selection.main,r=n.empty||n.to>n.from+100?"":e.sliceDoc(n.from,n.to),O=null!==(i=null==t?void 0:t.caseSensitive)&&void 0!==i?i:e.facet(td).caseSensitive;return t&&!r?t:new id({search:r.replace(/\n/g,"\\n"),caseSensitive:O})}const wd=e=>{let t=e.state.field(hd,!1);if(t&&t.panel){let i=Rf(e,Xd);if(!i)return!1;let n=i.dom.querySelector("[name=search]");if(n!=e.root.activeElement){let i=yd(e.state,t.query.spec);i.valid&&e.dispatch({effects:ad.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[ld.of(!0),t?ad.of(yd(e.state,t.query.spec)):ge.appendConfig.of(Wd)]});return!0},bd=e=>{let t=e.state.field(hd,!1);if(!t||!t.panel)return!1;let i=Rf(e,Xd);return i&&i.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:ld.of(!1)}),!0};class xd{constructor(e){this.view=e;let t=this.query=e.state.field(hd).query.spec;function i(e,t,i){return Af("button",{class:"cm-button",name:e,onclick:t,type:"button"},i)}this.commit=this.commit.bind(this),this.searchField=Af("input",{value:t.search,placeholder:Sd(e,"Find"),"aria-label":Sd(e,"Find"),class:"cm-textfield",name:"search",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Af("input",{value:t.replace,placeholder:Sd(e,"Replace"),"aria-label":Sd(e,"Replace"),class:"cm-textfield",name:"replace",onchange:this.commit,onkeyup:this.commit}),this.caseField=Af("input",{type:"checkbox",name:"case",checked:t.caseSensitive,onchange:this.commit}),this.reField=Af("input",{type:"checkbox",name:"re",checked:t.regexp,onchange:this.commit}),this.dom=Af("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,i("next",(()=>$d(e)),[Sd(e,"next")]),i("prev",(()=>Qd(e)),[Sd(e,"previous")]),i("select",(()=>md(e)),[Sd(e,"all")]),Af("label",null,[this.caseField,Sd(e,"match case")]),Af("label",null,[this.reField,Sd(e,"regexp")]),...e.state.readOnly?[]:[Af("br"),this.replaceField,i("replace",(()=>gd(e)),[Sd(e,"replace")]),i("replaceAll",(()=>Pd(e)),[Sd(e,"replace all")]),Af("button",{name:"close",onclick:()=>bd(e),"aria-label":Sd(e,"close"),type:"button"},["×"])]])}commit(){let e=new id({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:ad.of(e)}))}keydown(e){!function(e,t,i){return NO(AO(e.state),t,e,i)}(this.view,e,"search-panel")?13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Qd:$d)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),gd(this.view)):e.preventDefault()}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(ad)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(td).top}}function Sd(e,t){return e.state.phrase(t)}const kd=/[\s\.,:;?!]/;function vd(e,{from:t,to:i}){let n=e.state.doc.lineAt(t).from,r=e.state.doc.lineAt(i).to,O=Math.max(n,t-30),s=Math.min(r,i+30),o=e.state.sliceDoc(O,s);if(O!=n)for(let e=0;e<30;e++)if(!kd.test(o[e+1])&&kd.test(o[e])){o=o.slice(e);break}if(s!=r)for(let e=o.length-1;e>o.length-30;e--)if(!kd.test(o[e-1])&&kd.test(o[e])){o=o.slice(0,e);break}return bO.announce.of(`${e.state.phrase("current match")}. ${o} ${e.state.phrase("on line")} ${e.state.doc.lineAt(t).number}`)}const Rd=bO.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Wd=[hd,ie.lowest(dd),Rd];function Td(e,t){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let r=e(t,i);return!!r&&(n(i.update(r)),!0)}}Td((function(e,t,i=t.selection.ranges){let n=[],r=-1;for(let{from:e,to:O}of i){let i=n.length,s=1e9;for(let i=e;i<=O;){let o=t.doc.lineAt(i);if(o.from>r&&(e==O||O>o.from)){r=o.from;let e=_d(t,i).line;if(!e)continue;let O=/^\s*/.exec(o.text)[0].length,a=O==o.length,l=o.text.slice(O,O+e.length)==e?O:-1;Oe.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:i,indent:r,empty:O,single:s}of n)!s&&O||e.push({from:t.from+r,insert:i+" "});let i=t.changes(e);return{changes:i,selection:t.selection.map(i,1)}}if(1!=e&&n.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:i,token:r}of n)if(i>=0){let n=t.from+i,O=n+r.length;" "==t.text[O-t.from]&&O++,e.push({from:n,to:O})}return{changes:e}}return null}),0),Td(Vd,0),Td(((e,t)=>Vd(e,t,function(e){let t=[];for(let i of e.selection.ranges){let n=e.doc.lineAt(i.from),r=i.to<=n.to?n:e.doc.lineAt(i.to),O=t.length-1;O>=0&&t[O].to>n.from?t[O].to=r.to:t.push({from:n.from,to:r.to})}return t}(t))),0);function _d(e,t=e.selection.main.head){let i=e.languageDataAt("commentTokens",t);return i.length?i[0]:{}}function Vd(e,t,i=t.selection.ranges){let n=i.map((e=>_d(t,e.from).block));if(!n.every((e=>e)))return null;let r=i.map(((e,i)=>function(e,{open:t,close:i},n,r){let O,s,o=e.sliceDoc(n-50,n),a=e.sliceDoc(r,r+50),l=/\s*$/.exec(o)[0].length,h=/^\s*/.exec(a)[0].length,c=o.length-l;if(o.slice(c-t.length,c)==t&&a.slice(h,h+i.length)==i)return{open:{pos:n-l,margin:l&&1},close:{pos:r+h,margin:h&&1}};r-n<=100?O=s=e.sliceDoc(n,r):(O=e.sliceDoc(n,n+50),s=e.sliceDoc(r-50,r));let u=/^\s*/.exec(O)[0].length,f=/\s*$/.exec(s)[0].length,d=s.length-f-i.length;return O.slice(u,u+t.length)==t&&s.slice(d,d+i.length)==i?{open:{pos:n+u+t.length,margin:/\s/.test(O.charAt(u+t.length))?1:0},close:{pos:r-f-i.length,margin:/\s/.test(s.charAt(d-1))?1:0}}:null}(t,n[i],e.from,e.to)));if(2!=e&&!r.every((e=>e)))return{changes:t.changes(i.map(((e,t)=>r[t]?[]:[{from:e.from,insert:n[t].open+" "},{from:e.to,insert:" "+n[t].close}])))};if(1!=e&&r.some((e=>e))){let e=[];for(let t,i=0;i=0&&(t=Math.max(t,this.positions[i]+this.children[i].length+this.from)),new Ie(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,i)=>new Ie(ze.none,e,t,i,this.hashProp)})}}var Ad;!function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.URL=33]="URL",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel"}(Ad||(Ad={}));class Yd{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class Nd{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Ud(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,i=0){for(let n=t;n=t.stack[i.depth+1].value+i.baseIndent)return!0;if(i.indent>=i.baseIndent+4)return!1;let n=(e.type==Ad.OrderedList?Ld:Md)(i,t,!1);return n>0&&(e.type!=Ad.BulletList||Ed(i,t,!1)<0)&&i.text.charCodeAt(i.pos+n-1)==e.value}const zd={[Ad.Blockquote]:(e,t,i)=>62==i.next&&(i.markers.push(yp(Ad.QuoteMark,t.lineStart+i.pos,t.lineStart+i.pos+1)),i.moveBase(i.pos+(Cd(i.text.charCodeAt(i.pos+1))?2:1)),e.end=t.lineStart+i.text.length,!0),[Ad.ListItem]:(e,t,i)=>!(i.indent-1||(i.moveBaseColumn(i.baseIndent+e.value),0)),[Ad.OrderedList]:Zd,[Ad.BulletList]:Zd,[Ad.Document]:()=>!0};function Cd(e){return 32==e||9==e||10==e||13==e}function Ud(e,t=0){for(;ti&&Cd(e.charCodeAt(t-1));)t--;return t}function Id(e){if(96!=e.next&&126!=e.next)return-1;let t=e.pos+1;for(;t-1&&e.depth==t.stack.length||n<3?-1:1}function Dd(e,t){for(let i=e.stack.length-1;i>=0;i--)if(e.stack[i].type==t)return!0;return!1}function Md(e,t,i){return 45!=e.next&&43!=e.next&&42!=e.next||e.pos!=e.text.length-1&&!Cd(e.text.charCodeAt(e.pos+1))||!(!i||Dd(t,Ad.BulletList)||e.skipSpace(e.pos+2)=48&&r<=57;){if(n++,n==e.text.length)return-1;r=e.text.charCodeAt(n)}return n==e.pos||n>e.pos+9||46!=r&&41!=r||ne.pos+1||49!=e.next)?-1:n+1-e.pos}function Bd(e){if(35!=e.next)return-1;let t=e.pos+1;for(;t6?-1:i}function Kd(e){if(45!=e.next&&61!=e.next||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t/,Jd=/\?>/,ep=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(n);if(O)return e.append(yp(Ad.Comment,i,i+1+O[0].length));let s=/^\?[^]*?\?>/.exec(n);if(s)return e.append(yp(Ad.ProcessingInstruction,i,i+1+s[0].length));let o=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return o?e.append(yp(Ad.HTMLTag,i,i+1+o[0].length)):-1},Emphasis(e,t,i){if(95!=t&&42!=t)return-1;let n=i+1;for(;e.char(n)==t;)n++;let r=e.slice(i-1,i),O=e.slice(n,n+1),s=Rp.test(r),o=Rp.test(O),a=/\s|^$/.test(r),l=/\s|^$/.test(O),h=!l&&(!o||a||s),c=!a&&(!s||l||o),u=h&&(42==t||!c||s),f=c&&(42==t||!h||o);return e.append(new kp(95==t?wp:bp,i,n,(u?1:0)|(f?2:0)))},HardBreak(e,t,i){if(92==t&&10==e.char(i+1))return e.append(yp(Ad.HardBreak,i,i+2));if(32==t){let t=i+1;for(;32==e.char(t);)t++;if(10==e.char(t)&&t>=i+2)return e.append(yp(Ad.HardBreak,i,t+1))}return-1},Link:(e,t,i)=>91==t?e.append(new kp(xp,i,i+1,1)):-1,Image:(e,t,i)=>33==t&&91==e.char(i+1)?e.append(new kp(Sp,i,i+2,1)):-1,LinkEnd(e,t,i){if(93!=t)return-1;for(let t=e.parts.length-1;t>=0;t--){let n=e.parts[t];if(n instanceof kp&&(n.type==xp||n.type==Sp)){if(!n.side||e.skipSpace(n.to)==i&&!/[(\[]/.test(e.slice(i+1,i+2)))return e.parts[t]=null,-1;let r=e.takeContent(t),O=e.parts[t]=Tp(e,r,n.type==xp?Ad.Link:Ad.Image,n.from,i+1);if(n.type==xp)for(let i=0;it?yp(Ad.URL,t+i,r+i):r==e.length&&null}}function Vp(e,t,i){let n=e.charCodeAt(t);if(39!=n&&34!=n&&40!=n)return!1;let r=40==n?41:n;for(let n=t+1,O=!1;n=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,i,n,r){return this.append(new kp(e,t,i,(n?1:0)|(r?2:0)))}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t=e;s--){let e=this.parts[s];if(e instanceof kp&&1&e.side&&e.type==i.type&&!(r&&(1&i.side||2&e.side)&&(e.to-e.from+O)%3==0&&((e.to-e.from)%3||O%3))){n=e;break}}if(!n)continue;let o=i.type.resolve,a=[],l=n.from,h=i.to;if(r){let e=Math.min(2,n.to-n.from,O);l=n.to-e,h=i.from+e,o=1==e?"Emphasis":"StrongEmphasis"}n.type.mark&&a.push(this.elt(n.type.mark,l,n.to));for(let e=s+1;e=0;t--){let i=this.parts[t];if(i instanceof kp&&i.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}skipSpace(e){return Ud(this.text,e-this.offset)+this.offset}elt(e,t,i,n){return"string"==typeof e?yp(this.parser.getNodeType(e),t,i,n):new Xp(e,t)}}function Yp(e,t){if(!t.length)return e;if(!e.length)return t;let i=e.slice(),n=0;for(let e of t){for(;n(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&"\n"!=this.input.read(e-1,e);)e--;this.fragmentEnd=e?e-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let n=e+this.fragment.offset;for(;i.to<=n;)if(!i.parent())return!1;for(;;){if(i.from>=n)return this.fragment.from<=t;if(!i.childAfter(n))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Ye.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,n=this.fragmentEnd-(this.fragment.openEnd?1:0),r=e.absoluteLineStart,O=r,s=e.block.children.length,o=O,a=s;for(;;){if(t.to-i>n){if(t.type.isAnonymous&&t.firstChild())continue;break}if(e.dontInject.add(t.tree),e.addNode(t.tree,t.from-i),t.type.is("Block")&&(Np.indexOf(t.type.id)<0?(O=t.to-i,s=e.block.children.length):(O=o,s=a,o=t.to-i,a=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>s;)e.block.children.pop(),e.block.positions.pop();return O-r}}const zp=new fp(new Ce(Qp),Object.keys(rp).map((e=>rp[e])),Object.keys(rp).map((e=>ap[e])),Object.keys(rp),lp,zd,Object.keys(Wp).map((e=>Wp[e])),Object.keys(Wp),[]);function Cp(e,t,i){let n=[];for(let r=e.firstChild,O=t;;r=r.nextSibling){let e=r?r.from:i;if(e>O&&n.push({from:O,to:e}),!r)break;O=r.to}return n}function Up(e){let{codeParser:t,htmlParser:i}=e,n=ot(((e,n)=>{let r=e.type.id;if(!t||r!=Ad.CodeBlock&&r!=Ad.FencedCode){if(i&&(r==Ad.HTMLBlock||r==Ad.HTMLTag))return{parser:i,overlay:Cp(e.node,e.from,e.to)}}else{let i="";if(r==Ad.FencedCode){let t=e.node.getChild(Ad.CodeInfo);t&&(i=n.read(t.from,t.to))}let O=t(i);if(O)return{parser:O,overlay:e=>e.type.id==Ad.CodeText}}return null}));return{wrap:n}}const Gp={resolve:"Strikethrough",mark:"StrikethroughMark"},Ip={defineNodes:["Strikethrough","StrikethroughMark"],parseInline:[{name:"Strikethrough",parse:(e,t,i)=>126!=t||126!=e.char(i+1)?-1:e.addDelimiter(Gp,i,i+2,!0,!0),after:"Emphasis"}]};function jp(e,t,i=0,n,r=0){let O=0,s=!0,o=-1,a=-1,l=!1,h=()=>{n.push(e.elt("TableCell",r+o,r+a,e.parser.parseInline(t.slice(o,a),r+o)))};for(let c=i;c-1)&&O++,s=!1,n&&(o>-1&&h(),n.push(e.elt("TableDelimiter",c+r,c+r+1))),o=a=-1),l=!l&&92==i}return o>-1&&(O++,n&&h()),O}function Ep(e,t){for(let i=t;iEp(t.content,0)?new Mp:null,endLeaf(e,t,i){if(i.parsers.some((e=>e instanceof Mp))||!Ep(t.text,t.basePos))return!1;let n=e.scanLine(e.absoluteLineEnd+1).text;return Dp.test(n)&&jp(e,t.text,t.basePos)==jp(e,n,t.basePos)},before:"SetextHeading"}]};class Bp{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const Kp={defineNodes:[{name:"Task",block:!0},"TaskMarker"],parseBlock:[{name:"TaskList",leaf:(e,t)=>/^\[[ xX]\]/.test(t.content)&&"ListItem"==e.parentType().name?new Bp:null,after:"SetextHeading"}]},Fp=[Lp,Kp,Ip];function Hp(e,t,i){return(n,r,O)=>{if(r!=e||n.char(O+1)==e)return-1;let s=[n.elt(i,O,O+1)];for(let r=O+1;r=65&&e<=90||95==e||e>=97&&e<=122||e>=161}function s$(e){return 9==e||10==e||13==e||32==e}let o$=null,a$=null,l$=0;function h$(e,t){let i=e.pos+t;if(l$==i&&a$==e)return o$;let n=e.peek(t);for(;s$(n);)n=e.peek(++t);let r="";for(;O$(n);)r+=String.fromCharCode(n),n=e.peek(++t);return a$=e,l$=i,o$=r?r.toLowerCase():n==c$||n==u$?void 0:null}const c$=63,u$=33;function f$(e,t){this.name=e,this.parent=t,this.hash=t?t.hash:0;for(let t=0;td$.indexOf(t)>-1?new f$(h$(n,1)||"",e):e,reduce:(e,t)=>18==t&&e?e.parent:e,reuse(e,t,i,n){let r=t.type.id;return 4==r||35==r?new f$(h$(n,1)||"",e):e},hash:e=>e?e.hash:0,strict:!1}),$$=new Bo(((e,t)=>{if(60!=e.next)return void(e.next<0&&t.context&&e.acceptToken(56));e.advance();let i=47==e.next;i&&e.advance();let n=h$(e,0);if(void 0===n)return;if(!n)return e.acceptToken(i?12:4);let r=t.context?t.context.name:null;if(i){if(n==r)return e.acceptToken(9);if(r&&n$[r])return e.acceptToken(56,-2);if(t.dialectEnabled(0))return e.acceptToken(10);for(let e=t.context;e;e=e.parent)if(e.name==n)return;e.acceptToken(11)}else{if("script"==n)return e.acceptToken(5);if("style"==n)return e.acceptToken(6);if("textarea"==n)return e.acceptToken(7);if(i$.hasOwnProperty(n))return e.acceptToken(8);r&&r$[r]&&r$[r][n]?e.acceptToken(56,-1):e.acceptToken(4)}}),{contextual:!0}),Q$=new Bo((e=>{for(let t=0,i=0;;i++){if(e.next<0){i&&e.acceptToken(57);break}if(e.next=="--\x3e".charCodeAt(t)){if(t++,3==t){i>3&&e.acceptToken(57,-2);break}}else t=0;e.advance()}}));function m$(e,t,i){let n=2+e.length;return new Bo((r=>{for(let O=0,s=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(t);break}if(0==O&&60==r.next||1==O&&47==r.next||O>=2&&Os?r.acceptToken(t,-s):r.acceptToken(i,-(s-2));break}if((10==r.next||13==r.next)&&o){r.acceptToken(t,1);break}O=s=0}else s++;r.advance()}}))}const g$=m$("script",53,1),P$=m$("style",54,2),X$=m$("textarea",55,3),y$=la.deserialize({version:13,states:",xOVOxOOO!WQ!bO'#CoO!]Q!bO'#CyO!bQ!bO'#C|O!gQ!bO'#DPO!lQ!bO'#DRO!qOXO'#CnO!|OYO'#CnO#XO[O'#CnO$eOxO'#CnOOOW'#Cn'#CnO$lO!rO'#DSO$tQ!bO'#DUO$yQ!bO'#DVOOOW'#Dj'#DjOOOW'#DX'#DXQVOxOOO%OQ#tO,59ZO%WQ#tO,59eO%`Q#tO,59hO%hQ#tO,59kO%pQ#tO,59mOOOX'#D]'#D]O%xOXO'#CwO&TOXO,59YOOOY'#D^'#D^O&]OYO'#CzO&hOYO,59YOOO['#D_'#D_O&pO[O'#C}O&{O[O,59YOOOW'#D`'#D`O'TOxO,59YO'[Q!bO'#DQOOOW,59Y,59YOOO`'#Da'#DaO'aO!rO,59nOOOW,59n,59nO'iQ!bO,59pO'nQ!bO,59qOOO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jO~Od!kO~Od!lO~Od!mO~Oj!nO~Oi!qO!_!oO!a!pO~Oj!rO~Oj!sO~Oj!tO~O_!uO`!uO!_!wO!`!uO~O_!xO`!xO!a!wO!b!xO~O_!uO`!uO!_!{O!`!uO~O_!xO`!xO!a!{O!b!xO~O`_a!cwz!c~",goto:"%o!_PPPPPPPPPPPPPPPPPP!`!fP!lPP!xPP!{#O#R#X#[#_#e#h#k#q#w!`P!`!`P#}$T$k$q$w$}%T%Z%aPPPPPPPP%gX^OX`pXUOX`pezabcde{}!P!R!TR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!TeZ!e{}!P!R!TQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue EndTag ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:66,context:p$,nodeProps:[[Ye.closedBy,-11,1,2,3,4,5,6,7,8,9,10,11,"EndTag",-4,19,29,32,35,"CloseTag"],[Ye.group,-9,12,15,16,17,18,38,39,40,41,"Entity",14,"Entity TextContent",-3,27,30,33,"TextContent Entity"],[Ye.openedBy,26,"StartTag StartCloseTag",-4,28,31,34,36,"OpenTag"]],skippedNodes:[0],repeatNodeCount:9,tokenData:"!#b!aR!WOX$kXY)sYZ)sZ]$k]^)s^p$kpq)sqr$krs*zsv$kvw+dwx2yx}$k}!O3f!O!P$k!P!Q7_!Q![$k![!]8u!]!^$k!^!_>b!_!`!!p!`!a8T!a!c$k!c!}8u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!``!bpOr(krs'gsv(kwx(]x#X(k#X#YDq#Y~(k!RKqW!``!bpOrKjrsLZsvKjvwLowxNPx!aKj!a!b! g!b~KjqL`T!bpOvLZvxLox!aLZ!a!bM^!b~LZPLrRO!aLo!a!bL{!b~LoPMORO!`Lo!`!aMX!a~LoPM^OwPqMcT!bpOvLZvxLox!`LZ!`!aMr!a~LZqMyQ!bpwPOv'gx~'gaNUV!``OrNPrsLosvNPvwLow!aNP!a!bNk!b~NPaNpV!``OrNPrsLosvNPvwLow!`NP!`!a! V!a~NPa! ^R!``wPOr(]sv(]w~(]!R! nW!``!bpOrKjrsLZsvKjvwLowxNPx!`Kj!`!a!!W!a~Kj!R!!aT!``!bpwPOr(krs'gsv(kwx(]x~(k!V!!{VgS^P!``!bpOr&Rrs&qsv&Rwx'rx!^&R!^!_(k!_~&R",tokenizers:[g$,P$,X$,$$,Q$,0,1,2,3,4,5],topRules:{Document:[0,13]},dialects:{noMatch:0},tokenPrec:464});function w$(e,t){let i=Object.create(null);for(let n of e.firstChild.getChildren("Attribute")){let e=n.getChild("AttributeName"),r=n.getChild("AttributeValue")||n.getChild("UnquotedAttributeValue");e&&(i[t.read(e.from,e.to)]=r?"AttributeValue"==r.name?t.read(r.from+1,r.to-1):t.read(r.from,r.to):"")}return i}function b$(e,t,i){let n;for(let r of i)if(!r.attrs||r.attrs(n||(n=w$(e.node.parent,t))))return{parser:r.parser};return null}const x$=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function S$(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function k$(e){return e>=48&&e<=57}const v$=new Bo(((e,t)=>{for(let i=!1,n=0,r=0;;r++){let{next:O}=e;if(!(S$(O)||45==O||95==O||i&&k$(O))){i&&e.acceptToken(40==O?94:2==n&&t.canShift(2)?2:95);break}!i&&(45!=O||r>0)&&(i=!0),n===r&&45==O&&n++,e.advance()}})),R$=new Bo((e=>{if(x$.includes(e.peek(-1))){let{next:t}=e;(S$(t)||95==t||35==t||46==t||91==t||58==t||45==t)&&e.acceptToken(93)}})),W$=new Bo((e=>{if(!x$.includes(e.peek(-1))){let{next:t}=e;if(37==t&&(e.advance(),e.acceptToken(1)),S$(t)){do{e.advance()}while(S$(e.next));e.acceptToken(1)}}})),T$={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,dir:32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},_$={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},V$={__proto__:null,not:128,only:128,from:158,to:160},q$=la.deserialize({version:13,states:"7WOYQ[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO!ZQ[O'#CfO!}QXO'#CaO#UQ[O'#ChO#aQ[O'#DPO#fQ[O'#DTOOQP'#Ec'#EcO#kQdO'#DeO$VQ[O'#DrO#kQdO'#DtO$hQ[O'#DvO$sQ[O'#DyO$xQ[O'#EPO%WQ[O'#EROOQS'#Eb'#EbOOQS'#ES'#ESQYQ[OOOOQP'#Cg'#CgOOQP,59Q,59QO!ZQ[O,59QO%_Q[O'#EVO%yQWO,58{O&RQ[O,59SO#aQ[O,59kO#fQ[O,59oO%_Q[O,59sO%_Q[O,59uO%_Q[O,59vO'bQ[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO'iQWO,59SO'nQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO'sQ`O,59oOOQS'#Cp'#CpO#kQdO'#CqO'{QvO'#CsO)VQtO,5:POOQO'#Cx'#CxO'iQWO'#CwO)kQWO'#CyOOQS'#Ef'#EfOOQO'#Dh'#DhO)pQ[O'#DoO*OQWO'#EiO$xQ[O'#DmO*^QWO'#DpOOQO'#Ej'#EjO%|QWO,5:^O*cQpO,5:`OOQS'#Dx'#DxO*kQWO,5:bO*pQ[O,5:bOOQO'#D{'#D{O*xQWO,5:eO*}QWO,5:kO+V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q!c!}>e!}#T%Q#T#o>e#o~%QX?aQxPOy%Qz~%Q^?lQvUOy%Qz~%QX?uSOy%Qz#b%Q#b#c@R#c~%QX@WSoWOy%Qz#W%Q#W#X@d#X~%QX@kQ!`PoWOy%Qz~%QX@tSOy%Qz#f%Q#f#g@d#g~%QXAVQ!RPOy%Qz~%Q_AbQ!QVOy%Qz~%QZAmS!PPOy%Qz!_%Q!_!`2e!`~%Q",tokenizers:[R$,W$,v$,0,1,2,3],topRules:{StyleSheet:[0,4]},specialized:[{term:94,get:e=>T$[e]||-1},{term:56,get:e=>_$[e]||-1},{term:95,get:e=>V$[e]||-1}],tokenPrec:1078});let A$=null;function Y$(){if(!A$&&"object"==typeof document&&document.body){let e=[];for(let t in document.body.style)/[A-Z]|^-|^(item|length)$/.test(t)||e.push(t);A$=e.sort().map((e=>({type:"property",label:e})))}return A$||[]}const N$=["active","after","before","checked","default","disabled","empty","enabled","first-child","first-letter","first-line","first-of-type","focus","hover","in-range","indeterminate","invalid","lang","last-child","last-of-type","link","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-of-type","only-child","optional","out-of-range","placeholder","read-only","read-write","required","root","selection","target","valid","visited"].map((e=>({type:"class",label:e}))),Z$=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map((e=>({type:"keyword",label:e}))).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map((e=>({type:"constant",label:e})))),z$=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map((e=>({type:"type",label:e}))),C$=/^[\w-]*/,U$=fs.define({parser:q$.configure({props:[Vs.add({Declaration:Us()}),js.add({Block:Es}),Js({"import charset namespace keyframes":ko.definitionKeyword,"media supports":ko.controlKeyword,"from to selector":ko.keyword,NamespaceName:ko.namespace,KeyframeName:ko.labelName,TagName:ko.tagName,ClassName:ko.className,PseudoClassName:ko.constant(ko.className),IdName:ko.labelName,"FeatureName PropertyName":ko.propertyName,AttributeName:ko.attributeName,NumberLiteral:ko.number,KeywordQuery:ko.keyword,UnaryQueryOp:ko.operatorKeyword,"CallTag ValueName":ko.atom,VariableName:ko.variableName,Callee:ko.operatorKeyword,Unit:ko.unit,"UniversalSelector NestingSelector":ko.definitionOperator,AtKeyword:ko.keyword,MatchOp:ko.compareOperator,"ChildOp SiblingOp, LogicOp":ko.logicOperator,BinOp:ko.arithmeticOperator,Important:ko.modifier,Comment:ko.blockComment,ParenthesizedContent:ko.special(ko.name),ColorLiteral:ko.color,StringLiteral:ko.string,":":ko.punctuation,"PseudoOp #":ko.derefOperator,"; ,":ko.separator,"( )":ko.paren,"[ ]":ko.squareBracket,"{ }":ko.brace})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}}),G$=U$.data.of({autocomplete:e=>{let{state:t,pos:i}=e,n=ds(t).resolveInner(i,-1);if("PropertyName"==n.name)return{from:n.from,options:Y$(),span:C$};if("ValueName"==n.name)return{from:n.from,options:Z$,span:C$};if("PseudoClassName"==n.name)return{from:n.from,options:N$,span:C$};if("TagName"==n.name){for(let{parent:e}=n;e;e=e.parent)if("Block"==e.name)return{from:n.from,options:Y$(),span:C$};return{from:n.from,options:z$,span:C$}}if(!e.explicit)return null;let r=n.resolve(i),O=r.childBefore(i);return O&&":"==O.name&&"PseudoClassSelector"==r.name?{from:i,options:N$,span:C$}:O&&":"==O.name&&"Declaration"==r.name||"ArgList"==r.name?{from:i,options:Z$,span:C$}:"Block"==r.name?{from:i,options:Y$(),span:C$}:null}});const I$=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],j$=new aa({start:!1,shift:(e,t)=>5==t||6==t||284==t?e:285==t,strict:!1}),E$=new Bo(((e,t)=>{let{next:i}=e;(125==i||-1==i||t.context)&&t.canShift(282)&&e.acceptToken(282)}),{contextual:!0,fallback:!0}),D$=new Bo(((e,t)=>{let i,{next:n}=e;I$.indexOf(n)>-1||(47!=n||47!=(i=e.peek(1))&&42!=i)&&125!=n&&59!=n&&-1!=n&&!t.context&&t.canShift(279)&&e.acceptToken(279)}),{contextual:!0}),M$=new Bo(((e,t)=>{let{next:i}=e;if((43==i||45==i)&&(e.advance(),i==e.next)){e.advance();let i=!t.context&&t.canShift(1);e.acceptToken(i?1:2)}}),{contextual:!0}),L$=new Bo((e=>{for(let t=!1,i=0;;i++){let{next:n}=e;if(n<0){i&&e.acceptToken(280);break}if(96==n){i?e.acceptToken(280):e.acceptToken(281,1);break}if(123==n&&t){1==i?e.acceptToken(3,1):e.acceptToken(280,-1);break}if(10==n&&i){e.advance(),e.acceptToken(280);break}92==n&&e.advance(),t=36==n,e.advance()}}));const B$={__proto__:null,export:18,as:23,from:29,default:32,async:37,function:38,this:48,true:56,false:56,void:66,typeof:70,null:86,super:88,new:122,await:139,yield:141,delete:142,class:152,extends:154,public:197,private:197,protected:197,readonly:199,instanceof:220,in:222,const:224,import:256,keyof:307,unique:311,infer:317,is:351,abstract:371,implements:373,type:375,let:378,var:380,interface:387,enum:391,namespace:397,module:399,declare:403,global:407,for:428,of:437,while:440,with:444,do:448,if:452,else:454,switch:458,case:464,try:470,catch:472,finally:474,return:478,throw:482,break:486,continue:490,debugger:494},K$={__proto__:null,async:109,get:111,set:113,public:161,private:161,protected:161,static:163,abstract:165,override:167,readonly:173,new:355},F$={__proto__:null,"<":129},H$=la.deserialize({version:13,states:"$1jO`QYOOO'QQ!LdO'#ChO'XOSO'#DVO)dQYO'#D]O)tQYO'#DhO){QYO'#DrO-xQYO'#DxOOQO'#E]'#E]O.]QWO'#E[O.bQWO'#E[OOQ!LS'#Ef'#EfO0aQ!LdO'#IrO2wQ!LdO'#IsO3eQWO'#EzO3jQpO'#FaOOQ!LS'#FS'#FSO3rO!bO'#FSO4QQWO'#FhO5_QWO'#FgOOQ!LS'#Is'#IsOOQ!LQ'#Ir'#IrOOQQ'#J['#J[O5dQWO'#HnO5iQ!LYO'#HoOOQQ'#If'#IfOOQQ'#Hp'#HpQ`QYOOO){QYO'#DjO5qQWO'#G[O5vQ#tO'#CmO6UQWO'#EZO6aQWO'#EgO6fQ#tO'#FRO7QQWO'#G[O7VQWO'#G`O7bQWO'#G`O7pQWO'#GcO7pQWO'#GdO7pQWO'#GfO5qQWO'#GiO8aQWO'#GlO9oQWO'#CdO:PQWO'#GyO:XQWO'#HPO:XQWO'#HRO`QYO'#HTO:XQWO'#HVO:XQWO'#HYO:^QWO'#H`O:cQ!LZO'#HdO){QYO'#HfO:nQ!LZO'#HhO:yQ!LZO'#H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Z!@Y#BZ$IS2`$IS$I_!@Y$I_$JT2`$JT$JU!@Y$JU$KV2`$KV$KW!@Y$KW&FU2`&FU&FV!@Y&FV?HT2`?HT?HU!@Y?HU~2`,T!CO_$UW'X+{#zS'Z%k'epOt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$g%T$g~2`",tokenizers:[D$,M$,L$,0,1,2,3,4,5,6,7,8,E$],topRules:{Script:[0,7]},dialects:{jsx:11335,ts:11337},dynamicPrecedences:{149:1,176:1},specialized:[{term:287,get:(e,t)=>function(e,t){return"extends"==e&&t.dialectEnabled(1)?4:-1}(e,t)<<1},{term:287,get:e=>B$[e]||-1},{term:297,get:e=>K$[e]||-1},{term:63,get:e=>F$[e]||-1}],tokenPrec:11358}),J$=[_h("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),_h("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),_h("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),_h("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"block",type:"keyword"}),_h("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),_h('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),_h('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],eQ=fs.define({parser:H$.configure({props:[Vs.add({IfStatement:Us({except:/^\s*({|else\b)/}),TryStatement:Us({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:e=>e.baseIndent,SwitchBody:e=>{let t=e.textAfter,i=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(i?0:n?1:2)*e.unit},Block:zs({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>-1,"Statement Property":Us({except:/^{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag":e=>e.column(e.node.from)+e.unit}),js.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression":Es,BlockComment:e=>({from:e.from+2,to:e.to-2})}),Js({"get set async static":ko.modifier,"for while do if else switch try catch finally return throw break continue default case":ko.controlKeyword,"in of await yield void typeof delete instanceof":ko.operatorKeyword,"let var const function class extends":ko.definitionKeyword,"import export from":ko.moduleKeyword,"with debugger as new":ko.keyword,TemplateString:ko.special(ko.string),Super:ko.atom,BooleanLiteral:ko.bool,this:ko.self,null:ko.null,Star:ko.modifier,VariableName:ko.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":ko.function(ko.variableName),VariableDefinition:ko.definition(ko.variableName),Label:ko.labelName,PropertyName:ko.propertyName,PrivatePropertyName:ko.special(ko.propertyName),"CallExpression/MemberExpression/PropertyName":ko.function(ko.propertyName),"FunctionDeclaration/VariableDefinition":ko.function(ko.definition(ko.variableName)),"ClassDeclaration/VariableDefinition":ko.definition(ko.className),PropertyDefinition:ko.definition(ko.propertyName),PrivatePropertyDefinition:ko.definition(ko.special(ko.propertyName)),UpdateOp:ko.updateOperator,LineComment:ko.lineComment,BlockComment:ko.blockComment,Number:ko.number,String:ko.string,ArithOp:ko.arithmeticOperator,LogicOp:ko.logicOperator,BitOp:ko.bitwiseOperator,CompareOp:ko.compareOperator,RegExp:ko.regexp,Equals:ko.definitionOperator,"Arrow : Spread":ko.punctuation,"( )":ko.paren,"[ ]":ko.squareBracket,"{ }":ko.brace,"InterpolationStart InterpolationEnd":ko.special(ko.brace),".":ko.derefOperator,", ;":ko.separator,TypeName:ko.typeName,TypeDefinition:ko.definition(ko.typeName),"type enum interface implements namespace module declare":ko.definitionKeyword,"abstract global Privacy readonly override":ko.modifier,"is keyof unique infer":ko.operatorKeyword,JSXAttributeValue:ko.attributeValue,JSXText:ko.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":ko.angleBracket,"JSXIdentifier JSXNameSpacedName":ko.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":ko.attributeName})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),tQ=eQ.configure({dialect:"ts"}),iQ=eQ.configure({dialect:"jsx"}),nQ=eQ.configure({dialect:"jsx ts"});function rQ(e={}){let t=e.jsx?e.typescript?nQ:iQ:e.typescript?tQ:eQ;return new xs(t,eQ.data.of({autocomplete:Vl(["LineComment","BlockComment","String"],_l(J$))}))}const OQ=["_blank","_self","_top","_parent"],sQ=["ascii","utf-8","utf-16","latin1","latin1"],oQ=["get","post","put","delete"],aQ=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],lQ=["true","false"],hQ={},cQ={a:{attrs:{href:null,ping:null,type:null,media:null,target:OQ,hreflang:null}},abbr:hQ,acronym:hQ,address:hQ,applet:hQ,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:hQ,aside:hQ,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:hQ,base:{attrs:{href:null,target:OQ}},basefont:hQ,bdi:hQ,bdo:hQ,big:hQ,blockquote:{attrs:{cite:null}},body:hQ,br:hQ,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:aQ,formmethod:oQ,formnovalidate:["novalidate"],formtarget:OQ,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:hQ,center:hQ,cite:hQ,code:hQ,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:hQ,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:hQ,dir:hQ,div:hQ,dl:hQ,dt:hQ,em:hQ,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:hQ,figure:hQ,font:hQ,footer:hQ,form:{attrs:{action:null,name:null,"accept-charset":sQ,autocomplete:["on","off"],enctype:aQ,method:oQ,novalidate:["novalidate"],target:OQ}},frame:hQ,frameset:hQ,h1:hQ,h2:hQ,h3:hQ,h4:hQ,h5:hQ,h6:hQ,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:hQ,hgroup:hQ,hr:hQ,html:{attrs:{manifest:null}},i:hQ,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:aQ,formmethod:oQ,formnovalidate:["novalidate"],formtarget:OQ,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:hQ,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:hQ,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:hQ,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:sQ,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:hQ,noframes:hQ,noscript:hQ,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:hQ,param:{attrs:{name:null,value:null}},pre:hQ,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:hQ,rt:hQ,ruby:hQ,s:hQ,samp:hQ,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:sQ}},section:hQ,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},small:hQ,source:{attrs:{src:null,type:null,media:null}},span:hQ,strike:hQ,strong:hQ,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:hQ,summary:hQ,sup:hQ,table:hQ,tbody:hQ,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:hQ,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:hQ,time:{attrs:{datetime:null}},title:hQ,tr:hQ,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},tt:hQ,u:hQ,ul:{children:["li","script","template","ul","ol"]},var:hQ,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:hQ},uQ={accesskey:null,class:null,contenteditable:lQ,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:lQ,autocorrect:lQ,autocapitalize:lQ,style:null,tabindex:null,title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":lQ,"aria-autocomplete":["inline","list","both","none"],"aria-busy":lQ,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":lQ,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":lQ,"aria-hidden":lQ,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":lQ,"aria-multiselectable":lQ,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":lQ,"aria-relevant":null,"aria-required":lQ,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},fQ=Object.keys(cQ),dQ=Object.keys(uQ);function pQ(e,t,i=e.length){if(!t)return"";let n=t.firstChild,r=n&&n.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,i)):""}function $Q(e,t=!1){for(let i=e.parent;i;i=i.parent)if("Element"==i.name){if(!t)return i;t=!1}return null}function QQ(e,t){let i=cQ[pQ(e,$Q(t,!0))];return(null==i?void 0:i.children)||fQ}function mQ(e,t){let i=[];for(let n=t;n=$Q(n);){let r=pQ(e,n);if(r&&"CloseTag"==n.lastChild.name)break;r&&i.indexOf(r)<0&&("EndTag"==t.name||t.from>=n.firstChild.to)&&i.push(r)}return i}const gQ=/^[:\-\.\w\u00b7-\uffff]+$/;function PQ(e,t,i,n){let r=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:QQ(e.doc,t).map((e=>({label:e,type:"type"}))).concat(mQ(e.doc,t).map(((e,t)=>({label:"/"+e,apply:"/"+e+r,type:"type",boost:99-t})))),span:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function XQ(e,t,i,n){let r=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:mQ(e.doc,t).map(((e,t)=>({label:e,apply:e+r,type:"type",boost:99-t}))),span:gQ}}const yQ=fs.define({parser:y$.configure({props:[Vs.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag":e=>e.column(e.node.from)+e.unit,Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length{let O=e.type.id;return 27==O?b$(e,r,t):30==O?b$(e,r,i):33==O?b$(e,r,n):null}))}([{tag:"script",attrs:e=>!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type),parser:eQ.parser},{tag:"style",attrs:e=>(!e.lang||"css"==e.lang)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type)),parser:U$.parser}])}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),wQ=yQ.data.of({autocomplete:function(e){let{state:t,pos:i}=e,n=ds(t).resolveInner(i),r=n.resolve(i,-1);for(let e,t=i;n==r&&(e=r.childBefore(t));){let i=e.lastChild;if(!i||!i.type.isError||i.from({label:e,type:"property"}))),span:gQ}}(t,r,"AttributeName"==r.name?r.from:i,i):"Is"==r.name||"AttributeValue"==r.name||"UnquotedAttributeValue"==r.name?function(e,t,i,n){var r;let O,s=null===(r=t.parent)||void 0===r?void 0:r.getChild("AttributeName"),o=[];if(s){let r=e.sliceDoc(s.from,s.to),a=uQ[r];if(!a){let i=$Q(t),n=i?cQ[pQ(e.doc,i)]:null;a=(null==n?void 0:n.attrs)&&n.attrs[r]}if(a){let t=e.sliceDoc(i,n).toLowerCase(),r='"',s='"';/^['"]/.test(t)?(O='"'==t[0]?/^[^"]*$/:/^[^']*$/,r="",s=e.sliceDoc(n,n+1)==t[0]?"":t[0],t=t.slice(1),i++):O=/^[^\s<>='"]*$/;for(let e of a)o.push({label:e,apply:r+e+s,type:"constant"})}}return{from:i,to:n,options:o,span:O}}(t,r,"Is"==r.name?i:r.from,i):!e.explicit||"Element"!=n.name&&"Text"!=n.name&&"Document"!=n.name?null:function(e,t,i){let n=[],r=0;for(let i of QQ(e.doc,t))n.push({label:"<"+i,type:"type"});for(let i of mQ(e.doc,t))n.push({label:"",type:"type",boost:99-r++});return{from:i,to:i,options:n,span:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(t,r,i)}});function bQ(e={}){let t=yQ;return!1===e.matchClosingTags&&(t=t.configure({dialect:"noMatch"})),new xs(t,[wQ,!1!==e.autoCloseTags?xQ:[],rQ().support,new xs(U$,G$).support])}const xQ=bO.inputHandler.of(((e,t,i,n)=>{if(e.composing||e.state.readOnly||t!=i||">"!=n&&"/"!=n||!yQ.isActiveAt(e.state,t,-1))return!1;let{state:r}=e,O=r.changeByRange((e=>{var t,i,O;let s,{head:o}=e,a=ds(r).resolveInner(o,-1);if("TagName"!=a.name&&"StartTag"!=a.name||(a=a.parent),">"==n&&"OpenTag"==a.name){if("CloseTag"!=(null===(i=null===(t=a.parent)||void 0===t?void 0:t.lastChild)||void 0===i?void 0:i.name)&&(s=pQ(r.doc,a.parent,o)))return{range:z.cursor(o+1),changes:{from:o,insert:`>`}}}else if("/"==n&&"OpenTag"==a.name){let e=a.parent,t=null==e?void 0:e.parent;if(e.from==o-1&&"CloseTag"!=(null===(O=t.lastChild)||void 0===O?void 0:O.name)&&(s=pQ(r.doc,t,o))){let e=`/${s}>`;return{range:z.cursor(o+e.length),changes:{from:o,insert:e}}}}return{range:e}}));return!O.changes.empty&&(e.dispatch(O,{userEvent:"input.type",scrollIntoView:!0}),!0)})),SQ=hs({block:{open:"\x3c!--",close:"--\x3e"}}),kQ=zp.configure({props:[Js({"Blockquote/...":ko.quote,HorizontalRule:ko.contentSeparator,"ATXHeading1/... SetextHeading1/...":ko.heading1,"ATXHeading2/... SetextHeading2/...":ko.heading2,"ATXHeading3/...":ko.heading3,"ATXHeading4/...":ko.heading4,"ATXHeading5/...":ko.heading5,"ATXHeading6/...":ko.heading6,"Comment CommentBlock":ko.comment,Escape:ko.escape,Entity:ko.character,"Emphasis/...":ko.emphasis,"StrongEmphasis/...":ko.strong,"Link/... Image/...":ko.link,"OrderedList/... BulletList/...":ko.list,"BlockQuote/...":ko.quote,"InlineCode CodeText":ko.monospace,URL:ko.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":ko.processingInstruction,"CodeInfo LinkLabel":ko.labelName,LinkTitle:ko.string,Paragraph:ko.content}),js.add((e=>{if(e.is("Block")&&!e.is("Document"))return(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})),Vs.add({Document:()=>null}),ls.add({Document:SQ})]});function vQ(e){return new cs(SQ,e,e.nodeSet.types.find((e=>"Document"==e.name)))}const RQ=vQ(kQ),WQ=vQ(kQ.configure([Fp,e$,Jp,t$,{props:[Js({"TableDelimiter SubscriptMark SuperscriptMark StrikethroughMark":ko.processingInstruction,"TableHeader/...":ko.heading,"Strikethrough/...":ko.strikethrough,TaskMarker:ko.atom,Task:ko.list,Emoji:ko.character,"Subscript Superscript":ko.special(ko.content),TableCell:ko.content})]}]));function TQ(e,t){return t.sliceString(e.from,e.from+50)}class _Q{constructor(e,t,i,n,r,O,s){this.node=e,this.from=t,this.to=i,this.spaceBefore=n,this.spaceAfter=r,this.type=O,this.item=s}blank(e=!0){let t=this.spaceBefore;if("Blockquote"==this.node.name)t+=">";else for(let e=this.to-this.from-t.length-this.spaceAfter.length;e>0;e--)t+=" ";return t+(e?this.spaceAfter:"")}marker(e,t){let i="OrderedList"==this.node.name?String(+qQ(this.item,e)[2]+t):"";return this.spaceBefore+i+this.type+this.spaceAfter}}function VQ(e,t,i){let n=[];for(let t=e;t&&"Document"!=t.name;t=t.parent)"ListItem"!=t.name&&"Blockquote"!=t.name||n.push(t);let r=[],O=0;for(let e=n.length-1;e>=0;e--){let s,o=n[e],a=O;if("Blockquote"==o.name&&(s=/^[ \t]*>( ?)/.exec(t.slice(O))))O+=s[0].length,r.push(new _Q(o,a,O,"",s[1],">",null));else if("ListItem"==o.name&&"OrderedList"==o.parent.name&&(s=/^([ \t]*)\d+([.)])([ \t]*)/.exec(TQ(o,i)))){let e=s[3],t=s[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),O+=t,r.push(new _Q(o.parent,a,O,s[1],e,s[2],o))}else if("ListItem"==o.name&&"BulletList"==o.parent.name&&(s=/^([ \t]*)([-+*])([ \t]+)/.exec(TQ(o,i)))){let e=s[3],t=s[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4),O+=t,r.push(new _Q(o.parent,a,O,s[1],e,s[2],o))}}return r}function qQ(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function AQ(e,t,i,n=0){for(let r=-1,O=e;;){if("ListItem"==O.name){let e=qQ(O,t),s=+e[2];if(r>=0){if(s!=r+1)return;i.push({from:O.from+e[1].length,to:O.from+e[0].length,insert:String(r+2+n)})}r=s}let e=O.nextSibling;if(!e)break;O=e}}function YQ(e){return"QuoteMark"==e.name||"ListMark"==e.name}const NQ=[{key:"Enter",run:({state:e,dispatch:t})=>{let i=ds(e),{doc:n}=e,r=null,O=e.changeByRange((t=>{if(!t.empty||!WQ.isActiveAt(e,t.from))return r={range:t};let O=t.from,s=n.lineAt(O),o=VQ(i.resolveInner(O,-1),s.text,n);for(;o.length&&o[o.length-1].from>O-s.from;)o.pop();if(!o.length)return r={range:t};let a=o[o.length-1];if(a.to-a.spaceAfter.length>O-s.from)return r={range:t};let l=O>=a.to-a.spaceAfter.length&&!/\S/.test(s.text.slice(a.to));if(a.item&&l){if(a.node.firstChild.to>=O||s.from>0&&!/[^\s>]/.test(n.lineAt(s.from-1).text)){let e,t=o.length>1?o[o.length-2]:null,i="";t&&t.item?(e=s.from+t.from,i=t.marker(n,1)):e=s.from+(t?t.to:0);let r=[{from:e,to:O,insert:i}];return"OrderedList"==a.node.name&&AQ(a.item,n,r,-2),t&&"OrderedList"==t.node.name&&AQ(t.item,n,r),{range:z.cursor(e+i.length),changes:r}}{let t="";for(let e=0,i=o.length-2;e<=i;e++)t+=o[e].blank(e\s*$/.exec(i.text);if(r&&r.index==a.from){let n=e.changes([{from:i.from+r.index,to:i.to},{from:s.from+a.from,to:s.to}]);return{range:t.map(n),changes:n}}}let h=[];"OrderedList"==a.node.name&&AQ(a.item,n,h);let c=e.lineBreak,u=a.item&&a.item.from]*/.exec(s.text)[0].length>=a.to)for(let e=0,t=o.length-1;e<=t;e++)c+=e!=t||u?o[e].blank():o[e].marker(n,1);let f=O;for(;f>s.from&&/\s/.test(s.text.charAt(f-s.from-1));)f--;return h.push({from:f,to:O,insert:c}),{range:z.cursor(f+c.length),changes:h}}));return!r&&(t(e.update(O,{scrollIntoView:!0,userEvent:"input"})),!0)}},{key:"Backspace",run:({state:e,dispatch:t})=>{let i=ds(e),n=null,r=e.changeByRange((t=>{let r=t.from,{doc:O}=e;if(t.empty&&WQ.isActiveAt(e,t.from)){let e=O.lineAt(r),n=VQ(function(e,t){let i,n=e.resolveInner(t,-1),r=t;for(YQ(n)&&(r=n.from,n=n.parent);i=n.childBefore(r);)if(YQ(i))r=i.from;else{if("OrderedList"!=i.name&&"BulletList"!=i.name)break;n=i.lastChild,r=n.to}return n}(i,r),e.text,O);if(n.length){let i=n[n.length-1],O=i.to-i.spaceAfter.length+(i.spaceAfter?1:0);if(r-e.from>O&&!/\S/.test(e.text.slice(O,r-e.from)))return{range:z.cursor(e.from+O),changes:{from:e.from+O,to:r}};if(r-e.from==O){let n=e.from+i.from;if(i.item&&i.node.from{let n=i&&Ss.matchLanguageName(e,i,!0);return n?n.support?n.support.language.parser:ms.getSkippingParser(n.load()):t?t.parser:null}}(t||[],O):void 0;return s.push(Up({codeParser:a,htmlParser:ZQ.language.parser})),n&&o.push(ie.high(VO.of(NQ))),new xs(vQ(r.configure(s)),o)}function CQ(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function UQ(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function GQ(e,t,i){for(let n=!1;;){if(e.next<0)return;if(e.next==t&&!n)return void e.advance();n=i&&!n&&92==e.next,e.advance()}}function IQ(e,t){for(;95==e.next||CQ(e.next);)null!=t&&(t+=String.fromCharCode(e.next)),e.advance();return t}function jQ(e,t){for(;;){if(46==e.next){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(69==e.next||101==e.next)for(e.advance(),43!=e.next&&45!=e.next||e.advance();e.next>=48&&e.next<=57;)e.advance()}function EQ(e){for(;!(e.next<0||10==e.next);)e.advance()}function DQ(e,t){for(let i=0;i!=&|~^/",specialVar:"?",identifierQuotes:'"',words:LQ(KQ,BQ)};function HQ(e){return new Bo((t=>{var i;let{next:n}=t;if(t.advance(),DQ(n,MQ)){for(;DQ(t.next,MQ);)t.advance();t.acceptToken(34)}else if(39==n||34==n&&e.doubleQuotedStrings)GQ(t,n,e.backslashEscapes),t.acceptToken(3);else if(35==n&&e.hashComments||47==n&&47==t.next&&e.slashComments)EQ(t),t.acceptToken(1);else if(45!=n||45!=t.next||e.spaceAfterDashes&&32!=t.peek(2))if(47==n&&42==t.next){t.advance();for(let e=-1,i=1;!(t.next<0);)if(t.advance(),42==e&&47==t.next){if(i--,!i)break;e=-1}else 47==e&&42==t.next?(i++,e=-1):e=t.next;t.acceptToken(2)}else if(101!=n&&69!=n||39!=t.next)if(110!=n&&78!=n||39!=t.next||!e.charSetCasts){if(95==n&&e.charSetCasts)for(let i=0;;i++){if(39==t.next&&i>1){t.advance(),GQ(t,39,e.backslashEscapes),t.acceptToken(3);break}if(!CQ(t.next))break;t.advance()}else if(40==n)t.acceptToken(7);else if(41==n)t.acceptToken(8);else if(123==n)t.acceptToken(9);else if(125==n)t.acceptToken(10);else if(91==n)t.acceptToken(11);else if(93==n)t.acceptToken(12);else if(59==n)t.acceptToken(13);else if(48==n&&(98==t.next||66==t.next)||(98==n||66==n)&&39==t.next){let e=39==t.next;for(t.advance();48==t.next||49==t.next;)t.advance();e&&39==t.next&&t.advance(),t.acceptToken(4)}else if(48==n&&(120==t.next||88==t.next)||(120==n||88==n)&&39==t.next){let e=39==t.next;for(t.advance();UQ(t.next);)t.advance();e&&39==t.next&&t.advance(),t.acceptToken(4)}else if(46==n&&t.next>=48&&t.next<=57)jQ(t,!0),t.acceptToken(4);else if(46==n)t.acceptToken(14);else if(n>=48&&n<=57)jQ(t,!1),t.acceptToken(4);else if(DQ(n,e.operatorChars)){for(;DQ(t.next,e.operatorChars);)t.advance();t.acceptToken(15)}else if(DQ(n,e.specialVar))t.next==n&&t.advance(),function(e){if(39==e.next||34==e.next||96==e.next){let t=e.next;e.advance(),GQ(e,t,!1)}else IQ(e)}(t),t.acceptToken(17);else if(DQ(n,e.identifierQuotes))GQ(t,n,!1),t.acceptToken(19);else if(58==n||44==n)t.acceptToken(16);else if(CQ(n)){let r=IQ(t,String.fromCharCode(n));t.acceptToken(null!==(i=e.words[r.toLowerCase()])&&void 0!==i?i:18)}}else t.advance(),GQ(t,39,e.backslashEscapes),t.acceptToken(3);else t.advance(),GQ(t,39,!0);else EQ(t),t.acceptToken(1)}))}const JQ=HQ(FQ),em=la.deserialize({version:13,states:"%dQ]QQOOO#kQRO'#DQO#rQQO'#CuO%RQQO'#CvO%YQQO'#CwO%aQQO'#CxOOQQ'#DQ'#DQOOQQ'#C{'#C{O&lQRO'#CyOOQQ'#Ct'#CtOOQQ'#Cz'#CzQ]QQOOQOQQOOO&vQQO,59aO'RQQO,59aO'WQQO'#DQOOQQ,59b,59bO'eQQO,59bOOQQ,59c,59cO'lQQO,59cOOQQ,59d,59dO'sQQO,59dOOQQ-E6y-E6yOOQQ,59`,59`OOQQ-E6x-E6xOOQQ'#C|'#C|OOQQ1G.{1G.{O&vQQO1G.{OOQQ1G.|1G.|OOQQ1G.}1G.}OOQQ1G/O1G/OP'zQQO'#C{POQQ-E6z-E6zOOQQ7+$g7+$g",stateData:"(R~OrOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUO~O^]ORtXStXTtXUtXVtXXtXZtX]tX_tX`tXatXbtXctXdtXetXftX~OqtX~P!dOa^Ob^Oc^O~ORUOSUOTUOUUOVROXSOZTO^QO_UO`UOa_Ob_Oc_OdUOeUOfUO~OW`O~P#}OYbO~P#}O[dO~P#}ORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUO~O]gOqmX~P%hOaiObiOciO~O^kO~OWtXYtX[tX~P!dOWlO~P#}OYmO~P#}O[nO~P#}O]gO~P#}O",goto:"#YuPPPPPPPPPPPPPPPPPPPPPPPPvzzzz!W![!b!vPPP!|TYOZeUORSTWZaceoT[OZQZORhZSWOZQaRQcSQeTZfWaceoQj]RqkeVORSTWZaceo",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) [ ] { } ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:36,skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,JQ],topRules:{Script:[0,23]},tokenPrec:0});function tm(e){let t=e.cursor.moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function im(e){let t=/^[`'"](.*)[`'"]$/.exec(e);return t?t[1]:e}function nm(e,t){return e?t.map((t=>Object.assign(Object.assign({},t),{label:e+t.label+e,apply:void 0}))):t}const rm=/^\w*$/,Om=/^[`'"]?\w*[`'"]?$/;function sm(e,t,i){let n=Object.create(null);for(let t in e)n[t]=e[t].map((e=>"string"==typeof e?{label:e,type:"property"}:e));let r=(t||Object.keys(n).map((e=>({label:e,type:"type"})))).concat(i&&n[i]||[]);return e=>{let{parent:t,from:i,quoted:O,empty:s}=function(e,t){let i=ds(e).resolveInner(t,-1),n=!1;if("Identifier"==i.name||"QuotedIdentifier"==i.name){n=!1;let t=null,r=tm(i);if(r&&"."==r.name){let i=tm(r);(i&&"Identifier"==i.name||"QuotedIdentifier"==i.name)&&(t=im(e.sliceDoc(i.from,i.to).toLowerCase()))}return{parent:t,from:i.from,quoted:"QuotedIdentifier"==i.name?e.sliceDoc(i.from,i.from+1):null}}if("."==i.name){let n=tm(i);if(n&&"Identifier"==n.name||"QuotedIdentifier"==n.name)return{parent:im(e.sliceDoc(n.from,n.to).toLowerCase()),from:t,quoted:null}}else n=!0;return{parent:null,from:t,quoted:null,empty:n}}(e.state,e.pos);if(s&&!e.explicit)return null;let o=r;if(t){let e=n[t];if(!e)return null;o=e}return{from:i,to:O&&e.state.sliceDoc(e.pos,e.pos+1)==O?e.pos+1:void 0,options:nm(O,o),span:O?Om:rm}}}function om(e,t){return Vl(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],_l(Object.keys(e).map((i=>({label:t?i.toUpperCase():i,type:21==e[i]?"type":20==e[i]?"keyword":"variable",boost:-1})))))}let am=em.configure({props:[Vs.add({Statement:Us()}),js.add({Statement:e=>({from:e.firstChild.to,to:e.to}),BlockComment:e=>({from:e.from+2,to:e.to-2})}),Js({Keyword:ko.keyword,Type:ko.typeName,Builtin:ko.standard(ko.name),Bool:ko.bool,Null:ko.null,Number:ko.number,String:ko.string,Identifier:ko.name,QuotedIdentifier:ko.special(ko.string),SpecialVar:ko.special(ko.name),LineComment:ko.lineComment,BlockComment:ko.blockComment,Operator:ko.operator,"Semi Punctuation":ko.punctuation,"( )":ko.paren,"{ }":ko.brace,"[ ]":ko.squareBracket})]});class lm{constructor(e,t){this.dialect=e,this.language=t}get extension(){return this.language.extension}static define(e){let t=function(e,t,i,n){let r={};for(let t in FQ)r[t]=(e.hasOwnProperty(t)?e:FQ)[t];return t&&(r.words=LQ(t,i||"",n)),r}(e,e.keywords,e.types,e.builtin),i=fs.define({parser:am.configure({tokenizers:[{from:JQ,to:HQ(t)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new lm(t,i)}}function hm(e,t=!1){return e.language.data.of({autocomplete:om(e.dialect.words,t)})}function cm(e){return e.schema?(e.dialect||fm).language.data.of({autocomplete:sm(e.schema,e.tables,e.defaultTable)}):[]}function um(e={}){let t=e.dialect||fm;return new xs(t.language,[cm(e),hm(t,!!e.upperCaseKeywords)])}const fm=lm.define({}),dm=lm.define({charSetCasts:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:"",keywords:KQ+"a abort abs absent access according ada admin aggregate alias also always analyse analyze array_agg array_max_cardinality asensitive assert assignment asymmetric atomic attach attribute attributes avg backward base64 begin_frame begin_partition bernoulli bit_length blocked bom c cache called cardinality catalog_name ceil ceiling chain char_length character_length character_set_catalog character_set_name character_set_schema characteristics characters checkpoint class class_origin cluster coalesce cobol collation_catalog collation_name collation_schema collect column_name columns command_function command_function_code comment comments committed concurrently condition_number configuration conflict connection_name constant constraint_catalog constraint_name constraint_schema contains content control conversion convert copy corr cost covar_pop covar_samp csv cume_dist current_catalog current_row current_schema cursor_name database datalink datatype datetime_interval_code datetime_interval_precision db debug defaults defined definer degree delimiter delimiters dense_rank depends derived detach detail dictionary disable discard dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue document dump dynamic_function dynamic_function_code element elsif empty enable encoding encrypted end_frame end_partition endexec enforced enum errcode error event every exclude excluding exclusive exp explain expression extension extract family file filter final first_value flag floor following force foreach fortran forward frame_row freeze fs functions fusion g generated granted greatest groups handler header hex hierarchy hint id ignore ilike immediately immutable implementation implicit import include including increment indent index indexes info inherit inherits inline insensitive instance instantiable instead integrity intersection invoker isnull k key_member key_type label lag last_value lead leakproof least length library like_regex link listen ln load location lock locked log logged lower m mapping matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text min minvalue mod mode more move multiset mumps name namespace nfc nfd nfkc nfkd nil normalize normalized nothing notice notify notnull nowait nth_value ntile nullable nullif nulls number occurrences_regex octet_length octets off offset oids operator options ordering others over overlay overriding owned owner p parallel parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partition pascal passing passthrough password percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding prepared print_strict_params procedural procedures program publication query quote raise range rank reassign recheck recovery refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex rename repeatable replace replica requiring reset respect restart restore result_oid returned_cardinality returned_length returned_octet_length returned_sqlstate returning reverse routine_catalog routine_name routine_schema routines row_count row_number rowtype rule scale schema_name schemas scope scope_catalog scope_name scope_schema security selective self sensitive sequence sequences serializable server server_name setof share show simple skip slice snapshot source specific_name sqlcode sqlerror sqrt stable stacked standalone statement statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time t table_name tables tablesample tablespace temp template ties token top_level_count transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex trigger_catalog trigger_name trigger_schema trim trim_array truncate trusted type types uescape unbounded uncommitted unencrypted unlink unlisten unlogged unnamed untyped upper uri use_column use_variable user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema vacuum valid validate validator value_of var_pop var_samp varbinary variable_conflict variadic verbose version versioning views volatile warning whitespace width_bucket window within wrapper xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate yes",types:BQ+"bigint int8 bigserial serial8 varbit bool box bytea cidr circle precision float8 inet int4 json jsonb line lseg macaddr macaddr8 money numeric pg_lsn point polygon float4 int2 smallserial serial2 serial serial4 text timetz timestamptz tsquery tsvector txid_snapshot uuid xml"}),pm=[21,47,48,228,63,121,52,55,203,60,61,56,59,71],$m=new Bo(((e,t)=>{if(e.next<0)e.acceptToken(167);else if(10!=e.next&&13!=e.next);else if(t.context.depth<0)e.acceptToken(165,1);else{e.advance();let t=0;for(;32==e.next||9==e.next;)e.advance(),t++;let i=10==e.next||13==e.next||35==e.next;e.acceptToken(i?166:164,-t)}}),{contextual:!0,fallback:!0}),Qm=new Bo(((e,t)=>{let i=t.context.depth;if(i<0)return;let n=e.peek(-1);if((10==n||13==n)&&t.context.depth>=0){let t=0,n=0;for(;;){if(32==e.next)t++;else{if(9!=e.next)break;t+=8-t%8}e.advance(),n++}t!=i&&10!=e.next&&13!=e.next&&35!=e.next&&(te.depth<0&&pm.indexOf(t)>-1?e.parent:e,shift:(e,t,i,n)=>162==t?new mm(e,function(e){let t=0;for(let i=0;ie.hash}),Pm=new Bo((e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let i=e.peek(t);if(32!=i&&9!=i)return void(40!=i&&46!=i&&10!=i&&13!=i&&35!=i&&e.acceptToken(1))}})),Xm={__proto__:null,await:40,or:48,and:50,in:54,not:56,is:58,if:64,else:66,lambda:70,yield:88,from:90,async:98,for:100,None:152,True:154,False:154,del:168,pass:172,break:176,continue:180,return:184,raise:192,import:196,as:198,global:202,nonlocal:204,assert:208,elif:218,while:222,try:228,except:230,finally:232,with:236,def:240,class:250},ym=la.deserialize({version:13,states:"!?pO`Q$IXOOO%cQ$I[O'#GaOOQ$IS'#Cm'#CmOOQ$IS'#Cn'#CnO'RQ$IWO'#ClO(tQ$I[O'#G`OOQ$IS'#Ga'#GaOOQ$IS'#DR'#DROOQ$IS'#G`'#G`O)bQ$IWO'#CqO)rQ$IWO'#DbO*SQ$IWO'#DfOOQ$IS'#Ds'#DsO*gO`O'#DsO*oOpO'#DsO*wO!bO'#DtO+SO#tO'#DtO+_O&jO'#DtO+jO,UO'#DtO-lQ$I[O'#GQOOQ$IS'#GQ'#GQO'RQ$IWO'#GPO/OQ$I[O'#GPOOQ$IS'#E]'#E]O/gQ$IWO'#E^OOQ$IS'#GO'#GOO/qQ$IWO'#F}OOQ$IV'#F}'#F}O/|Q$IWO'#FPOOQ$IS'#Fr'#FrO0RQ$IWO'#FOOOQ$IV'#H]'#H]OOQ$IV'#F|'#F|OOQ$IT'#FR'#FRQ`Q$IXOOO'RQ$IWO'#CoO0aQ$IWO'#CzO0hQ$IWO'#DOO0vQ$IWO'#GeO1WQ$I[O'#EQO'RQ$IWO'#EROOQ$IS'#ET'#ETOOQ$IS'#EV'#EVOOQ$IS'#EX'#EXO1lQ$IWO'#EZO2SQ$IWO'#E_O/|Q$IWO'#EaO2gQ$I[O'#EaO/|Q$IWO'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c!h&!_!h!i&5u!i!t&!_!t!u&,a!u!}&!_!}#O$}#O#P! n#P#R$}#R#S&!_#S#T$}#T#U&!_#U#V&,a#V#Y&!_#Y#Z&5u#Z#o&!_#o#p!#U#p#q$}#q#r!!S#r$g$}$g~&!_G{&:UZ!V,X%q7[%hS%kW%n`%tp%w!b%y#tOr$}rs&Rsw$}wxFSx#O$}#O#P! n#P#o$}#o#p!#U#p#q$}#q#r!!S#r~$}d]$uQ%q7[%hS%kW%n`%tp%w!b%y#tOr$}rs&Rsw$}wxFSx!_$}!_!`$-Z!`#O$}#O#P! n#P#o$}#o#p!#U#p#q$}#q#r!!S#r~$}Xm[e]||-1}],tokenPrec:6584});function wm(e,t){let i=e.lineIndent(t.from),n=e.lineAt(e.pos,-1),r=n.from+n.text.length;return!/\S/.test(n.text)&&e.node.toi?null:i+e.unit}const bm=fs.define({parser:ym.configure({props:[Vs.add({Body:e=>{var t;return null!==(t=wm(e,e.node))&&void 0!==t?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except |finally:)/.test(e.textAfter)?e.baseIndent:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":zs({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":zs({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":zs({closing:"]"}),Script:e=>{if(e.pos+/\s*/.exec(e.textAfter)[0].length>=e.node.to){let t=null;for(let i=e.node,n=i.to;i=i.lastChild,i&&i.to==n;)"Body"==i.type.name&&(t=i);if(t){let i=wm(e,t);if(null!=i)return i}}return e.continue()}}),js.add({"ArrayExpression DictionaryExpression":Es,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)})}),Js({"async '*' '**' FormatConversion":ko.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield":ko.controlKeyword,"in not and or is del":ko.operatorKeyword,"from def class global nonlocal lambda":ko.definitionKeyword,import:ko.moduleKeyword,"with as print":ko.keyword,self:ko.self,Boolean:ko.bool,None:ko.null,VariableName:ko.variableName,"CallExpression/VariableName":ko.function(ko.variableName),"FunctionDefinition/VariableName":ko.function(ko.definition(ko.variableName)),"ClassDefinition/VariableName":ko.definition(ko.className),PropertyName:ko.propertyName,"CallExpression/MemberExpression/PropertyName":ko.function(ko.propertyName),Comment:ko.lineComment,Number:ko.number,String:ko.string,FormatString:ko.special(ko.string),UpdateOp:ko.updateOperator,ArithOp:ko.arithmeticOperator,BitOp:ko.bitwiseOperator,CompareOp:ko.compareOperator,AssignOp:ko.definitionOperator,Ellipsis:ko.punctuation,At:ko.meta,"( )":ko.paren,"[ ]":ko.squareBracket,"{ }":ko.brace,".":ko.derefOperator,", ;":ko.separator})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""']},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function xm(){return new xs(bm)}class Sm{constructor(e,t,i,n){this.origin=e,this.changes=t,this.effects=i,this.clientID=n}}class km{constructor(e,t){this.version=e,this.unconfirmed=t}}const vm=I.define({combine(e){let t=_e(e,{startVersion:0,clientID:null,sharedEffects:()=>[]});return null==t.clientID&&(t.clientID=e.length&&e[0].generatedID||""),t}}),Rm=$e.define();B.define({create:e=>new km(e.facet(vm).startVersion,[]),update(e,t){let i=t.annotation(Rm);if(i)return i;let{sharedEffects:n,clientID:r}=t.startState.facet(vm),O=n(t);return O.length||!t.changes.empty?new km(e.version,e.unconfirmed.concat(new Sm(t,t.changes,O,r))):e}})})),r.register("inK2Y",(function(t,i){e(t.exports,"cl",(()=>n));const n=e=>e?Object.entries(e).reduce(((e,[t,i])=>i?t+" "+e:e),""):null})); \ No newline at end of file diff --git a/frontend-dist/editor.3384f40b.css b/frontend-dist/editor.3384f40b.css new file mode 100644 index 0000000000..2bbbe1249f --- /dev/null +++ b/frontend-dist/editor.3384f40b.css @@ -0,0 +1 @@ +@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(roboto-mono-cyrillic-ext-400-normal.dcb520ee.woff2) format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff) format("woff");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(roboto-mono-cyrillic-400-normal.638e826e.woff2) format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff) format("woff");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(roboto-mono-greek-400-normal.dd843e41.woff2) format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff) format("woff");unicode-range:U+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(roboto-mono-vietnamese-400-normal.306e7635.woff2) format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(roboto-mono-latin-ext-400-normal.d9409874.woff2) format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(roboto-mono-latin-400-normal.cf1eee5f.woff2) format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(roboto-mono-cyrillic-ext-400-italic.db052448.woff2) format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff) format("woff");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(roboto-mono-cyrillic-400-italic.e399ed93.woff2) format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff) format("woff");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(roboto-mono-greek-400-italic.6f7e0b2f.woff2) format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff) format("woff");unicode-range:U+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(roboto-mono-vietnamese-400-italic.d8e0a32a.woff2) format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(roboto-mono-latin-ext-400-italic.aaa9a959.woff2) format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(roboto-mono-latin-400-italic.ef82d48f.woff2) format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@media (prefers-color-scheme:light){:root{--image-filters:none;--out-of-focus-opacity:0.25;--main-bg-color:#fff;--rule-color:rgba(0,0,0,0.15);--kbd-border-color:#dfdfdf;--header-bg-color:#fff;--header-border-color:rgba(0,0,0,0.1);--ui-button-color:#2a2a2b;--cursor-color:#000;--normal-cell:0,0,0;--code-differs:160,130,28;--error-color:240,168,168;--normal-cell-color:rgba(var(--normal-cell),0.1);--dark-normal-cell-color:rgba(var(--normal-cell),0.2);--selected-cell-color:rgba(40,78,189,0.4);--code-differs-cell-color:rgba(var(--code-differs),0.68);--error-cell-color:rgba(var(--error-color),0.7);--bright-error-cell-color:rgb(var(--error-color));--light-error-cell-color:rgba(var(--error-color),0.05);--export-bg-color:#3c4365;--export-color:hsla(0,0%,100%,0.7);--export-card-bg-color:hsla(0,0%,100%,0.8);--export-card-title-color:rgba(0,0,0,0.7);--export-card-text-color:rgba(0,0,0,0.5);--export-card-shadow-color:#00000029;--pluto-schema-types-color:rgba(0,0,0,0.4);--pluto-schema-types-border-color:rgba(0,0,0,0.2);--pluto-output-color:#404040;--pluto-output-h-color:#1f1f1f;--pluto-output-bg-color:#fff;--a-underline:#00000059;--blockquote-color:#555;--blockquote-bg:#f2f2f2;--admonition-title-color:#fff;--jl-message-color:#dbe9d4;--jl-message-accent-color:#9ec889;--jl-info-color:#d6e3f4;--jl-info-accent-color:#94b6e2;--jl-warn-color:#ecead5;--jl-warn-accent-color:#cfc78a;--jl-danger-color:#f5dad7;--jl-danger-accent-color:#e29d94;--jl-debug-color:#f5dad7;--jl-debug-accent-color:#e29d94;--table-border-color:rgba(0,0,0,0.2);--table-bg-hover-color:rgba(159,158,224,0.15);--pluto-tree-color:rgb(0 0 0/38%);--disabled-cell-bg-color:hsla(0,0%,55%,0.25);--selected-cell-bg-color:rgba(40,78,189,0.24);--hover-scrollbar-color-1:rgba(0,0,0,0.15);--hover-scrollbar-color-2:rgba(0,0,0,0.05);--shoulder-hover-bg-color:rgba(0,0,0,0.05);--pluto-logs-bg-color:#efeff3;--pluto-logs-progress-fill:#fff;--pluto-logs-progress-border:#b2bdc7;--nav-h1-text-color:#000;--nav-filepicker-color:#6f6f6f;--nav-filepicker-border-color:#b2b2b2;--nav-process-status-bg-color:#fff;--nav-process-status-color:var(--pluto-output-h-color);--restart-recc-header-color:rgba(114,192,255,0.56);--restart-req-header-color:rgba(170,41,32,0.56);--dead-process-header-color:rgb(230 88 46/38%);--loading-header-color:hsla(290,10%,80%,0.5);--disconnected-header-color:rgba(255,169,114,0.56);--binder-loading-header-color:hsla(51,64%,90%,0.5);--loading-grad-color-1:#f1dba9;--loading-grad-color-2:#d7d7d0;--overlay-button-bg:#fff;--overlay-button-border:#f3f2f2;--overlay-button-border-save:#f3f2f2;--input-context-menu-border-color:rgba(0,0,0,0.1);--input-context-menu-bg-color:#fff;--input-context-menu-soon-color:#55555544;--input-context-menu-hover-bg-color:rgba(0,0,0,0.1);--input-context-menu-li-color:#6b6a6a;--pkg-popup-bg:#fff;--pkg-popup-border-color:#f0e4ee;--pkg-popup-buttons-bg-color:#fff;--black:#000;--white:#fff;--pkg-terminal-bg-color:#232433;--pkg-terminal-border-color:#c3c3c3;--pluto-runarea-bg-color:hsl(0,0,97%);--pluto-runarea-span-color:#a89fa0;--dropruler-bg-color:rgba(0,0,0,0.5);--jlerror-header-color:#4f1616;--jlerror-mark-bg-color:#f3f3f3;--jlerror-a-bg-color:#f5efd9;--jlerror-a-border-left-color:#704141;--jlerror-mark-color:#000;--helpbox-bg-color:#fff;--helpbox-box-shadow-color:#00000010;--helpbox-header-bg-color:#eef1f7;--helpbox-header-color:#181920;--helpbox-notfound-header-color:#8b8b8b;--helpbox-text-color:#000;--code-section-bg-color:#f5f5f5;--code-section-bg-color:#f3f3f3;--footer-color:#333;--footer-bg-color:#d7dcd3;--footer-atag-color:#000;--footer-input-border-color:#818181;--footer-filepicker-button-color:#fff;--footer-filepicker-focus-color:#896c6c;--footnote-border-color:rgba(23,115,119,0.15);--undo-delete-box-shadow-color:#0083;--cm-editor-tooltip-border-color:rgba(0,0,0,0.2);--cm-editor-li-aria-selected-bg-color:#16659d;--cm-editor-li-aria-selected-color:#fff;--cm-editor-li-notexported-color:rgba(0,0,0,0.5);--code-background:#fefcf5;--cm-code-differs-gutters-color:rgba(214,172,35,0.2);--cm-line-numbers-color:#8d86875e;--cm-selection-background:rgba(117,177,255,0.48);--cm-selection-background-blurred:hsla(0,0%,73%,0.48);--cm-editor-text-color:#41323f;--cm-comment-color:#e96ba8;--cm-atom-color:#815ba4;--cm-number-color:#815ba4;--cm-property-color:#b67a48;--cm-keyword-color:#ef6155;--cm-string-color:#da5616;--cm-var-color:#5668a4;--cm-macro-color:#5c8c5f;--cm-var2-color:#37768a;--cm-builtin-color:#5e7ad3;--cm-function-color:#cc80ac;--cm-type-color:#879794;--cm-bracket-color:#41323f;--cm-tag-color:#ef6155;--cm-link-color:#815ba4;--cm-error-bg-color:#ef6155;--cm-error-color:#f7f7f7;--cm-matchingBracket-color:#000;--cm-matchingBracket-bg-color:#1b4bbb21;--cm-placeholder-text-color:rgba(0,0,0,0.2);--autocomplete-menu-bg-color:#fff;--index-text-color:hsl(0,0,60);--index-clickable-text-color:hsl(0,0,30);--docs-binding-bg:#8383830a;--cm-html-color:#48b685;--cm-html-accent-color:#00ab85;--cm-css-color:#876800;--cm-css-accent-color:#696200;--cm-css-why-doesnt-codemirror-highlight-all-the-text-aaa:#3b3700;--cm-md-color:#005a9b;--cm-md-accent-color:#00a9d1}}@media (prefers-color-scheme:dark){:root{--image-filters:invert(1) hue-rotate(180deg) contrast(0.8);--out-of-focus-opacity:0.5;--main-bg-color:#1f1f1f;--rule-color:hsla(0,0%,100%,0.15);--kbd-border-color:#222;--header-bg-color:#2a2928;--header-border-color:transparent;--ui-button-color:#fff;--cursor-color:#fff;--normal-cell:100,100,100;--error-color:255,125,125;--normal-cell-color:rgba(var(--normal-cell),0.2);--dark-normal-cell-color:rgba(var(--normal-cell),0.4);--selected-cell-color:rgb(40 147 189/65%);--code-differs-cell-color:#9b906c;--error-cell-color:rgba(var(--error-color),0.6);--bright-error-cell-color:rgba(var(--error-color),0.9);--light-error-cell-color:rgba(var(--error-color),0);--export-bg-color:#262a36;--export-color:rgb(255 255 255/84%);--export-card-bg-color:#494949;--export-card-title-color:hsla(0,0%,100%,0.85);--export-card-text-color:rgb(255 255 255/70%);--export-card-shadow-color:#0000001c;--pluto-schema-types-color:hsla(0,0%,100%,0.6);--pluto-schema-types-border-color:hsla(0,0%,100%,0.2);--pluto-dim-output-color:hsl(0,0,70%);--pluto-output-color:#c4c4c4;--pluto-output-h-color:#e6e6e6;--pluto-output-bg-color:var(--main-bg-color);--a-underline:#ffffff69;--blockquote-color:inherit;--blockquote-bg:#2e2e2e;--admonition-title-color:#000;--jl-message-color:#265a20;--jl-message-accent-color:#83bf8a;--jl-info-color:#2a4973;--jl-info-accent-color:#5c8ccd;--jl-warn-color:#605a22;--jl-warn-accent-color:#ddd464;--jl-danger-color:#642f27;--jl-danger-accent-color:#ff7562;--jl-debug-color:#522e5c;--jl-debug-accent-color:#c481df;--table-border-color:hsla(0,0%,100%,0.2);--table-bg-hover-color:rgba(193,192,235,0.15);--pluto-tree-color:rgb(209 207 207/61%);--disabled-cell-bg-color:hsla(0,0%,55%,0.25);--selected-cell-bg-color:rgb(42 115 205/78%);--hover-scrollbar-color-1:rgba(0,0,0,0.15);--hover-scrollbar-color-2:rgba(0,0,0,0.05);--shoulder-hover-bg-color:hsla(0,0%,100%,0.05);--pluto-logs-bg-color:#434351;--pluto-logs-progress-fill:#5f7f5b;--pluto-logs-progress-border:#9fb8d1;--nav-h1-text-color:#fff;--nav-filepicker-color:#b6b6b6;--nav-filepicker-border-color:#c7c7c7;--nav-process-status-bg-color:#525252;--nav-process-status-color:var(--pluto-output-h-color);--restart-recc-header-color:rgb(44 106 157/56%);--restart-req-header-color:rgb(145 66 60/56%);--dead-process-header-color:rgba(250,75,21,0.473);--loading-header-color:rgba(51,51,51,0.5);--disconnected-header-color:rgba(255,169,114,0.56);--binder-loading-header-color:hsla(51,64%,90%,0.5);--loading-grad-color-1:#a9d4f1;--loading-grad-color-2:#d0d4d7;--overlay-button-bg:#2c2c2c;--overlay-button-border:#9e9e9e70;--overlay-button-border-save:#c7a74670;--overlay-button-color:#fff;--input-context-menu-border-color:hsla(0,0%,100%,0.1);--input-context-menu-bg-color:#27282f;--input-context-menu-soon-color:#b1b1b144;--input-context-menu-hover-bg-color:hsla(0,0%,100%,0.1);--input-context-menu-li-color:#c7c7c7;--pkg-popup-bg:#3d2f44;--pkg-popup-border-color:#574f56;--pkg-popup-buttons-bg-color:var(--input-context-menu-bg-color);--black:#fff;--white:#000;--pkg-terminal-bg-color:#252627;--pkg-terminal-border-color:#c3c3c388;--pluto-runarea-bg-color:#2b2b2b;--pluto-runarea-span-color:#a89fa0;--dropruler-bg-color:hsla(0,0%,100%,0.1);--jlerror-header-color:#d9baba;--jlerror-mark-bg-color:rgb(0 0 0/18%);--jlerror-a-bg-color:rgba(82,58,58,0.5);--jlerror-a-border-left-color:#704141;--jlerror-mark-color:#b1a9a9;--helpbox-bg-color:#1e221f;--helpbox-box-shadow-color:#00000017;--helpbox-header-bg-color:#2c3e36;--helpbox-header-color:#fff8eb;--helpbox-notfound-header-color:#8b8b8b;--helpbox-text-color:#e6e6e6;--code-section-bg-color:#2c2c2c;--code-section-border-color:#555a64;--footer-color:#cacaca;--footer-bg-color:#26272c;--footer-atag-color:#72a1df;--footer-input-border-color:#6c6c6c;--footer-filepicker-button-color:#000;--footer-filepicker-focus-color:#9d9d9d;--footnote-border-color:rgba(114,225,231,0.15);--undo-delete-box-shadow-color:hsla(240,1%,84%,0.2);--cm-editor-tooltip-border-color:rgba(0,0,0,0.2);--cm-editor-li-aria-selected-bg-color:#3271e7;--cm-editor-li-aria-selected-color:#fff;--cm-editor-li-notexported-color:hsla(0,0%,100%,0.5);--code-background:#292d38;--cm-code-differs-gutters-color:rgb(235 213 28/11%);--cm-line-numbers-color:#8d86875e;--cm-selection-background:rgba(84,139,217,0.48);--cm-selection-background-blurred:hsla(0,0%,59%,0.48);--cm-editor-text-color:#ffe9fc;--cm-comment-color:#e96ba8;--cm-atom-color:#e46b58;--cm-number-color:#a57acd;--cm-property-color:#f99b15;--cm-keyword-color:#ff7a6f;--cm-string-color:#df7e4e;--cm-var-color:#afb7d3;--cm-var2-color:#06b6ef;--cm-macro-color:#82b38b;--cm-builtin-color:#5e7ad3;--cm-function-color:#f99b15;--cm-type-color:#94894c;--cm-bracket-color:#a2a273;--cm-tag-color:#ef6155;--cm-link-color:#815ba4;--cm-error-bg-color:#ef6155;--cm-error-color:#f7f7f7;--cm-matchingBracket-color:#fff;--cm-matchingBracket-bg-color:#c58c237a;--cm-placeholder-text-color:rgb(255 255 255/20%);--autocomplete-menu-bg-color:var(--input-context-menu-bg-color);--index-text-color:#c7c7c7;--index-clickable-text-color:#ebebeb;--docs-binding-bg:#323431;--cm-html-color:#00ab85;--cm-html-accent-color:#00e7b4;--cm-css-color:#ebd073;--cm-css-accent-color:#fffed2;--cm-css-why-doesnt-codemirror-highlight-all-the-text-aaa:#ffffea;--cm-md-color:#a2c9d5;--cm-md-accent-color:#00a9d1}} \ No newline at end of file diff --git a/frontend-dist/editor.38d394c2.js b/frontend-dist/editor.38d394c2.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/frontend-dist/editor.52fc68a2.css b/frontend-dist/editor.52fc68a2.css new file mode 100644 index 0000000000..4128624732 --- /dev/null +++ b/frontend-dist/editor.52fc68a2.css @@ -0,0 +1 @@ +#binder_spinners{display:block;height:100%;opacity:0;overflow:hidden;pointer-events:none;position:absolute;transition:opacity 1s ease-in-out;width:100%}binder-spinner#ring_1{animation-duration:2s;border-top-color:#f5a252;height:300px;margin-left:-150px;margin-top:-150px;width:300px}binder-spinner#ring_2{animation-duration:3s;border-top-color:#579aca;height:380px;margin-left:-190px;margin-top:-190px;width:380px}binder-spinner#ring_3{animation-duration:4s;border-top-color:#e56581;height:460px;margin-left:-230px;margin-top:-230px;width:460px}binder-spinner{animation:spin 4s linear infinite;border:25px solid transparent;border-radius:100%;display:block;left:80vw;position:absolute;top:117px}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.edit_or_run{position:fixed;right:8px;top:9px;z-index:2000}.binder_help_text button{background:#fffdf7;box-shadow:0 0 20px 0 #fff;color:#0000009c;cursor:pointer;display:block;font-family:Roboto Mono;font-size:14px;font-style:italic;letter-spacing:-.2px;padding:7px 20px;white-space:nowrap}body.wiggle_binder .edit_or_run>button{animation:wiggle-binder-button .3s ease-in-out 0s 1}@keyframes wiggle-binder-button{0%{transform:rotate(0deg)}30%{transform:rotate(10deg)}70%{transform:rotate(-10deg)}to{transform:rotate(0deg)}}.binder_help_text button img{color:#000;font-style:normal;font-weight:900;margin:-8px -8px -8px 0}.edit_or_run>button{background:unset;background-color:var(--overlay-button-bg);border:3px solid rgba(92,97,163,.46);border-radius:30px;box-shadow:none;color:var(--black);cursor:pointer;display:block;font-family:Roboto Mono;font-family:var(--lato-ui-font-stack);font-size:16px;letter-spacing:.1px;padding:8px 16px;text-align:center;white-space:nowrap;width:100%;z-index:2000}.edit_or_run>button:hover{text-decoration:underline}.binder_help_text{--width:min(85vw,570px);background-color:#fff;border-radius:8px;box-shadow:0 0 0 100vmax #0000004a;color:#000;font-family:Lato,sans-serif;left:calc(50vw - var(--width)/2);max-height:calc(100vh - 4rem);overflow:auto;padding:16px;position:fixed;top:5rem;width:var(--width)}.binder_help_text a{color:#000}@media (max-width:500px){.binder_help_text{left:0;max-height:100vh;top:0;width:100vw}}.binder_help_text .close{background-image:url(close-outline.9c22a232.svg);background-size:24px 24px;cursor:pointer;height:24px;position:absolute;right:12px;top:12px;width:24px}.copy_div,.download_div{align-items:center;display:flex;height:40px;justify-content:space-between;margin-bottom:.75rem;padding:4px 8px}.binder_help_text button,.copy_div,.download_div{border:3px solid #3f448c5e;border-radius:8px;margin:0 auto;overflow:hidden;width:max(60%,10rem)}.copy_div input,.download_div a{border:none;cursor:text;font-family:Roboto Mono,monospace;font-size:.7rem;line-height:1.4;outline:none;width:calc(100% - 8px - 1rem)}.download_div,.download_div a{cursor:pointer}.copy_icon,.download_icon{background-image:url(copy-outline.0f561529.svg);background-position:50%;background-repeat:no-repeat;background-size:1rem 1rem;box-shadow:0 0 60px 60px #fff;cursor:pointer;height:1.5rem;position:relative;width:1.5rem}.download_icon{background-image:url(download-outline.523a74d8.svg)}.copy_icon.success_copy:after{animation:fadeout 3s;background-color:#dcebf5;content:"Copied!"}.copy_icon.success_copy:after,.copy_icon:not(.success_copy):hover:after{border-radius:.5rem;font-family:JuliaMono,monospace;font-size:.75rem;font-weight:700;line-height:1.5rem;position:absolute;text-align:center;width:4rem}.copy_icon:not(.success_copy):hover:after{background-color:#f4f5dc;content:"Copy"}.copy_icon:after{right:1.5rem}@keyframes fadeout{0%{opacity:1}20%{opacity:1}40%{opacity:0}to{opacity:0}}.command{font-size:1.2rem;font-weight:700;margin-bottom:.75rem}.edit_or_run li{margin-bottom:2rem}.edit_or_run li img,.edit_or_run li video{border:5px solid #d4d4d4;border-radius:5px;width:100%} \ No newline at end of file diff --git a/frontend-dist/editor.58971363.js b/frontend-dist/editor.58971363.js new file mode 100644 index 0000000000..98612a9e08 --- /dev/null +++ b/frontend-dist/editor.58971363.js @@ -0,0 +1,837 @@ +function e(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},r={},a=t.parcelRequire94c2;null==a&&((a=function(e){if(e in n)return n[e].exports;if(e in r){var t=r[e];delete r[e];var a={id:e,exports:{}};return n[e]=a,t.call(a.exports,a,a.exports),a.exports}var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,t){r[e]=t},t.parcelRequire94c2=a),a.register("4TPVQ",(function(t,n){var r,a;e(t.exports,"register",(()=>r),(e=>r=e)),e(t.exports,"resolve",(()=>a),(e=>a=e));var o={};r=function(e){for(var t=Object.keys(e),n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:h(e)?2:f(e)?3:0}function u(e,t){return 2===d(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function p(e,t){return 2===d(e)?e.get(t):e[t]}function m(e,t,n){var r=d(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function g(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function h(e){return K&&e instanceof Map}function f(e){return H&&e instanceof Set}function _(e){return e.o||e.t}function b(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=X(e);delete t[V];for(var n=Q(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=v),Object.freeze(e),t&&c(e,(function(e,t){return y(t,!0)}),!0)),e}function v(){i(2)}function w(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function k(e){var t=Y[e];return t||i(18,e),t}function E(e,t){Y[e]||(Y[e]=t)}function $(){return z}function x(e,t){t&&(k("Patches"),e.u=[],e.s=[],e.v=t)}function S(e){N(e),e.p.forEach(A),e.p=null}function N(e){e===z&&(z=e.l)}function C(e){return z={p:[],l:z,h:e,m:!0,_:0}}function A(e){var t=e[V];0===t.i||1===t.i?t.j():t.g=!0}function O(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.O||k("ES5").S(t,e,r),r?(n[V].P&&(S(t),i(4)),l(e)&&(e=M(t,e),t.l||T(t,e)),t.u&&k("Patches").M(n[V],e,t.u,t.s)):e=M(t,n,[]),S(t),t.u&&t.v(t.u,t.s),e!==G?e:void 0}function M(e,t,n){if(w(t))return t;var r=t[V];if(!r)return c(t,(function(a,o){return R(e,r,t,a,o,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return T(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var a=4===r.i||5===r.i?r.o=b(r.k):r.o;c(3===r.i?new Set(a):a,(function(t,o){return R(e,r,a,t,o,n)})),T(e,a,!1),n&&e.u&&k("Patches").R(r,n,e.u,e.s)}return r.o}function R(e,t,n,r,a,o){if(s(a)){var i=M(e,a,o&&t&&3!==t.i&&!u(t.D,r)?o.concat(r):void 0);if(m(n,r,i),!s(i))return;e.m=!1}if(l(a)&&!w(a)){if(!e.h.N&&e._<1)return;M(e,a),t&&t.A.l||T(e,a)}}function T(e,t,n){void 0===n&&(n=!1),e.h.N&&e.m&&y(t,n)}function L(e,t){var n=e[V];return(n?_(n):e)[t]}function D(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function I(e){e.P||(e.P=!0,e.l&&I(e.l))}function B(e){e.o||(e.o=b(e.t))}function j(e,t,n){var r=h(t)?k("MapSet").T(t,n):f(t)?k("MapSet").F(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:$(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},a=r,o=J;n&&(a=[r],o=ee);var i=Proxy.revocable(a,o),s=i.revoke,l=i.proxy;return r.k=l,r.j=s,l}(t,n):k("ES5").J(t,n);return(n?n.A:$()).p.push(r),r}function P(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return b(e)}function U(){function e(t){if(!l(t))return t;if(Array.isArray(t))return t.map(e);if(h(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(f(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return n}function t(t){return s(t)?e(t):t}var n="add";E("Patches",{$:function(t,r){return r.forEach((function(r){for(var a=r.path,o=r.op,s=t,l=0;l1?o-1:0),s=1;s1?n-1:0),o=1;o=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}var a=k("Patches").$;return s(e)?a(e,t):this.produce(e,(function(e){return a(e,t.slice(n+1))}))},e}(),ne=new te,re=ne.produce,ae=ne.produceWithPatches.bind(ne),oe=ne.setAutoFreeze.bind(ne),ie=(ne.setUseProxies.bind(ne),ne.applyPatches.bind(ne)),se=(ne.createDraft.bind(ne),ne.finishDraft.bind(ne),re);U(),oe(!1);var le=a("9lAXI"),ce=a("5Kx1V");ce=a("5Kx1V");let de=async e=>e(),ue=null;a.register("7VI2u",(function(e,t){e.exports=import("./"+a("4TPVQ").resolve("1WtP8")).then((()=>a("5O3mA")))})),a.register("9KWrB",(function(e,t){e.exports=Promise.all([import("./"+a("4TPVQ").resolve("1WtP8")),import("./"+a("4TPVQ").resolve("1r6Vz"))]).then((()=>a("5zn1O")))}));const pe=async()=>(null==ue&&(ue=de((async()=>{let[{initializeApp:e},t]=await Promise.all([a("7VI2u"),a("9KWrB")]),{getFirestore:n,addDoc:r,doc:o,collection:i}=t,s=i(n(e({apiKey:"AIzaSyC0DqEcaM8AZ6cvApXuNcNU2RgZZOj7F68",authDomain:"localhost",projectId:"pluto-feedback"})),"feedback");return console.log("🔥base loaded"),async e=>{await r(s,e)}}))),await ue),me=async()=>{try{const e=document.querySelector("form#feedback");e.addEventListener("submit",(t=>{const n=prompt("Would you like us to contact you?\n\nEmail: (leave blank to stay anonymous 👀)");t.preventDefault(),de((async()=>{try{let r=await pe();await ce.timeout_promise(r({feedback:new FormData(t.target).get("opinion"),timestamp:Date.now(),email:n||""}),5e3);let a="Submitted. Thank you for your feedback! 💕";console.log(a),alert(a),e.querySelector("#opinion").value=""}catch(e){let t="Whoops, failed to send feedback 😢\nWe would really like to hear from you! Please got to https://github.com/fonsp/Pluto.jl/issues to report this failure:\n\n";console.error(t),console.error(e),alert(t+e)}}))})),e.addEventListener("focusin",(()=>{pe()}))}catch(e){console.error("Something went wrong loading the feedback form:",e),document.querySelector("form#feedback").style.opacity=0;for(let e of"Oh noooooooooooooooooo...")document.querySelector("form#feedback input").value+=e,await new Promise((e=>setTimeout(e,200)))}};var ge=a("gZ62d");function he(e){return e.replace(/\r\n/g,"\n").split(/# ╔═╡ \S+\n/).map((e=>e.trim())).filter((e=>""!==e))}function fe(e){const t=e.replace(/\r\n/g,"\n").split("julia> "),n=" ".repeat(prompt.length);return t.map((function(e){return(n+e).split("\n").filter((e=>e.startsWith(n))).map((e=>e.replace(n,""))).join("\n")})).map((e=>e.trim())).filter((e=>""!==e))}const _e=(e,t=!0)=>e.trim().startsWith("julia> ")?fe:t&&!ge.in_textarea_or_input()||e.match(/# ╔═╡ ........-....-....-....-............/g)?.length?he:null;var be=a("85ulz"),ye=(o=a("fBBKY"),a("inK2Y"));let ve=(o=a("fBBKY")).createContext(),we=o.createContext(null),ke=o.createContext();class Ee extends Set{constructor(e){super(),this.callback=e}delete(e){let t=super.delete(e);return t&&0===this.size&&this.callback(),t}}ge=a("gZ62d");const $e=()=>"visible"===document.visibilityState?Promise.resolve():new Promise((e=>{const t=()=>{$e().then(e),document.removeEventListener("visibilitychange",t)};document.addEventListener("visibilitychange",t)})),xe=({any_code_differs:e,last_update_time:t,last_hot_reload_time:n,connected:r})=>{let a=o.useContext(ve);const[i,s]=o.useState(""),[l,c]=o.useState(""),d=o.useRef(null),u=o.useRef(null);o.useEffect((()=>(clearTimeout(d?.current),e?s("ask_to_save"):Date.now()-t<1e3?(s("saved"),d.current=setTimeout((()=>{s("")}),1e3)):s(""),()=>clearTimeout(d?.current))),[e]);const[p,m]=o.useState(!1);return o.useEffect((()=>{r&&setTimeout((()=>m(!0)),1e3)}),[r]),o.useEffect((()=>{if(console.log("Hottt",n,p),p)return c("reloaded_from_file"),console.log("set state"),$e().then((()=>{u.current=setTimeout((()=>{c(""),console.log("reset state")}),8e3)})),()=>clearTimeout(u?.current)}),[n]),o.html` + ${"ask_to_save"===i?o.html` +
+ +
+ `:"saved"===i||"saving"===i?o.html` +
+ Saved +
+ `:"reloaded_from_file"===l?o.html` +
+ File change detected, notebook updated +
+ `:null} +
`};o=a("fBBKY"),le=a("9lAXI"),o=a("fBBKY"),o=a("fBBKY"),o=a("fBBKY");const Se=({frame:e,cell_id:t})=>{const n=e.file.indexOf("#==#");if(-1!=n){const r=e.file.substr(n+4),a=o.html`
{window.dispatchEvent(new CustomEvent("cell_focus",{detail:{cell_id:r,line:e.line-1}})),t.preventDefault()}} + > + ${r==t?"Local":"Other"}: ${e.line} + `;return o.html`${a}`}return o.html`${e.file}:${e.line}`},Ne=({frame:e})=>{const t=e.call.indexOf("(");return-1!=t?o.html`${e.call.substr(0,t)}${e.call.substr(t)}`:o.html`${e.call}`},Ce=e=>e.flatMap(((t,n)=>n===e.length-1?[t]:n===e.length-2?[t," and "]:[t,", "])),Ae=({msg:e,stacktrace:t,cell_id:n})=>{let r=o.useContext(ve);const a=[{pattern:/syntax: extra token after end of expression/,display:e=>{const t=o.html`{e.preventDefault(),r.wrap_remote_cell(n,"begin")}} + >Wrap all code in a begin ... end block.`;if(e.includes("\n\nBoundaries: ")){const a=JSON.parse(e.split("\n\nBoundaries: ")[1]).map((e=>e-1)),i=o.html`

+ {e.preventDefault(),r.split_remote_cell(n,a,!0)}} + >Split this cell into ${a.length} cells, or +

`;return o.html`

Multiple expressions in one cell.

+

How would you like to fix it?

+
    +
  • ${i}
  • +
  • ${t}
  • +
`}return o.html`

Multiple expressions in one cell.

+

${t}

`}},{pattern:/LoadError: cannot assign a value to variable workspace#\d+\..+ from module workspace#\d+/,display:()=>o.html`

Tried to reevaluate an include call, this is not supported. You might need to restart this notebook from the main menu.

+

+ For a workaround, use the alternative version of include described here: + GH issue 115 +

+

In the future, include will be deprecated, and this will be the default.

`},{pattern:/MethodError: no method matching .*\nClosest candidates are:/,display:e=>e.split("\n").map((e=>o.html`

${e}

`))},{pattern:/Cyclic references among (.*)\./,display:e=>e.split("\n").map((e=>{const t=e.match(/Cyclic references among (.*)\./);if(t){let e=t[1].split(/, | and /).map((e=>o.html`${e}`));return o.html`

Cyclic references among${" "}${Ce(e)}.

`}return o.html`

${e}

`}))},{pattern:/Multiple definitions for (.*)\./,display:e=>e.split("\n").map((e=>{const t=e.match(/Multiple definitions for (.*)\./);if(t){let e=t[1].split(/, | and /).map((e=>o.html`{const r=document.querySelector(`pluto-cell:not([id='${n}']) span[id='${encodeURI(e)}']`);t.preventDefault(),r.scrollIntoView()}}>${e}`));return o.html`

Multiple definitions for${" "}${Ce(e)}.

`}return o.html`

${e}

`}))},{pattern:/.?/,display:e=>e.split("\n").map((e=>o.html`

${e}

`))}].find((({pattern:t})=>t.test(e)));return o.html` +
${a.display(e)}
+ ${0==t.length?null:o.html`
+
    + ${t.map((e=>o.html`
  1. + <${Ne} frame=${e} /> + @ + <${Se} frame=${e} cell_id=${n} /> + ${e.inlined?o.html`[inlined]`:null} +
  2. `))} +
+
`} +
`};o=a("fBBKY");const Oe=({mime:e,body:t,cell_id:n,persist_js_state:r})=>{switch(e){case"image/png":case"image/jpg":case"image/jpeg":case"image/gif":case"image/bmp":case"image/svg+xml":return o.html`<${uo} mime=${e} body=${t} />`;case"text/plain":return o.html`
${t}
`;case"application/vnd.pluto.tree+object":return o.html`<${Te} cell_id=${n} body=${t} persist_js_state=${r} />`;default:return po({mime:e,body:t,cell_id:n,persist_js_state:r,last_run_timestamp:null})}},Me=({on_click_more:e})=>{const[t,n]=o.useState(!1);return o.html`{t||!1!==e()&&n(!0)}} + >more`},Re=({prefix:e,prefix_short:t})=>o.html`${e}${t}`,Te=({mime:e,body:t,cell_id:n,persist_js_state:r})=>{let a=o.useContext(ve);const i=o.useRef(null),s=e=>o.html`<${Oe} cell_id=${n} mime=${e[1]} body=${e[0]} persist_js_state=${r} />`,l=o.html`<${Me} on_click_more=${()=>{if(null!=i.current.closest("pluto-tree.collapsed"))return!1;(a??i.current.closest("pluto-cell")._internal_pluto_actions).reshow_cell(n??i.current.closest("pluto-cell").id,t.objectid,1)}} />`;var c=null;switch(t.type){case"Pair":const e=t.key_value;return o.html`${s(e[0])}${s(e[1])}`;case"circular":return o.html`circular reference`;case"Array":case"Set":case"Tuple":c=o.html`${Re(t)}${t.elements.map((e=>"more"===e?l:o.html`${"Set"===t.type?"":o.html`${e[0]}`}${s(e[1])}`))}`;break;case"Dict":c=o.html`${Re(t)}${t.elements.map((e=>"more"===e?l:o.html`${s(e[0])}${s(e[1])}`))}`;break;case"NamedTuple":c=o.html`${Re(t)}${t.elements.map((e=>"more"===e?l:o.html`${e[0]}${s(e[1])}`))}`;break;case"struct":c=o.html`${Re(t)}${t.elements.map((e=>o.html`${e[0]}${s(e[1])}`))}`}return o.html``},Le=({mime:e,body:t,cell_id:n,persist_js_state:r})=>{let a=o.useContext(ve);const i=o.useRef(null),s=e=>o.html`<${Me} + on_click_more=${()=>{(a??i.current.closest("pluto-cell")._internal_pluto_actions).reshow_cell(n??i.current.closest("pluto-cell").id,t.objectid,e)}} + />`,l=null==t.schema?null:o.html` + + ${["",...t.schema.names].map((e=>o.html`${"more"===e?s(2):e}`))} + + + ${["",...t.schema.types].map((e=>o.html`${"more"===e?null:e}`))} + + `,c=o.html` + ${t.rows.map((e=>o.html` + ${"more"===e?o.html`${s(1)}`:o.html`${e[0]} + ${e[1].map((e=>{return o.html`${"more"===e?null:(t=e,o.html`<${Oe} cell_id=${n} mime=${t[1]} body=${t[0]} persist_js_state=${r} />`)}`;var t}))}`} + `))} + `;return o.html` + ${l}${c} +
`};le=a("9lAXI");var De=a("wLwQ2");function Ie(e){if(!(e instanceof HTMLInputElement))return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,(e=>e.value)):e.value;switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];default:return e.value}}const Be=(e,t)=>{if(!(e instanceof HTMLInputElement&&"file"===e.type))if(null!=t){if(e instanceof HTMLInputElement)switch(e.type){case"range":case"number":return void(e.valueAsNumber!==t&&(e.valueAsNumber=t));case"date":return void(null!=e.valueAsDate&&Number(e.valueAsDate)===Number(t)||(e.valueAsDate=t));case"checkbox":return void(e.checked!==t&&(e.checked=t));case"file":return}else if(e instanceof HTMLSelectElement&&e.multiple){for(let n of Array.from(e.options))n.selected=t.includes(n.value);return}e.value!==t&&(e.value=t)}else e.value=t},je=(e,t)=>{for(let n of e.querySelectorAll("bond")){let e=n.getAttribute("def");if(null!=n.firstElementChild&&null!=t[e]){let r=t[e].value;try{Be(n.firstElementChild,r)}catch(e){console.error("Error while setting input value",n.firstElementChild,"to value",r,": ",e)}}}},Pe=(e,t,n)=>{let r=!1;return e.querySelectorAll("bond").forEach((async e=>{const a=e.getAttribute("def"),o=Ie(e.firstElementChild);const i=Object.keys(n).includes(a)&&le.default.isEqual(n[a]?.value,o)?null:t(a,o).catch(console.error);let s=!1;const l=e.firstElementChild;for(let e of function(e){return De.default.Generators.observe((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=Ie(e);function a(){t(Ie(e))}return e.addEventListener(n,a),void 0!==r&&t(r),function(){e.removeEventListener(n,a)}}))}(l)){if(r)break;if(!1===s){s=!0;continue}const n=await Ue(await e);await i,await t(a,n).catch(console.error)}})),function(){r=!0}},Ue=async e=>e instanceof FileList?Promise.all(Array.from(e).map((e=>Ue(e)))):e instanceof File?await new Promise((t=>{const n=new FileReader;n.onload=()=>t({name:e.name,type:e.type,data:new Uint8Array(n.result)}),n.onerror=()=>t({name:e.name,type:e.type,data:null}),n.readAsArrayBuffer(e)})):e;ye=a("inK2Y"),De=a("wLwQ2"),o=a("fBBKY");function Fe(e){this.getChildContext=()=>e.context;const{context:t,children:n,...r}=e;return o.cloneElement(n,r)}function ze(){if(this.on_connect)this.on_connect();else{const e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e);const t=e.detail.context;this._vdom=o.h(Fe,{...this._props,context:t},Ge(this,this._vdomComponent)),(this.hasAttribute("hydrate")?o.hydrate:o.render)(this._vdom,this._root)}}function qe(e){return e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():""))}function Ke(e,t,n){if(!this._vdom)return;n=null==n?void 0:n;const r={};r[e]=n,r[qe(e)]=n,this._vdom=o.cloneElement(this._vdom,r),o.render(this._vdom,this._root)}function He(){const e=setTimeout((()=>{o.render(this._vdom=null,this._root)}),500);this.on_connect=()=>clearTimeout(e)}function We(e,t){return o.h("slot",{...e,ref:e=>{e?(this.ref=e,this._listener||(this._listener=e=>{e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",this._listener))):this.ref.removeEventListener("_preact",this._listener)}})}function Ge(e,t){if(3===e.nodeType)return e.data;if(1!==e.nodeType)return null;let n=[],r={},a=0,i=e.attributes,s=e.childNodes;for(a=i.length;a--;)"slot"!==i[a].name&&(r[i[a].name]=i[a].value,r[qe(i[a].name)]=i[a].value);for(a=s.length;a--;){const e=Ge(s[a],null),t=s[a].slot;t?r[t]=o.h(We,{name:t},e):n[a]=e}const l=t?o.h(We,null,n):n;return o.h(t||e.nodeName.toLowerCase(),r,l)}var Ze=a("61LLQ");o=a("fBBKY");a("wLwQ2");le=a("9lAXI");var Ve=a("8qR4G");Ze=a("61LLQ"),Ze=a("61LLQ");a("9lAXI");Ze=a("61LLQ"),le=a("9lAXI");var Qe={};e(Qe,"default",(()=>ut),(e=>ut=e));var Xe,Ye,Je=Object.create,et=Object.defineProperty,tt=Object.getOwnPropertyDescriptor,nt=Object.getOwnPropertyNames,rt=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty,ot=(e,t)=>((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of nt(t))!at.call(e,a)&&(n||"default"!==a)&&et(e,a,{get:()=>t[a],enumerable:!(r=tt(t,a))||r.enumerable});return e})((e=>et(e,"__esModule",{value:!0}))(et(null!=e?Je(rt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),it=(Xe=(e,t)=>{var n=Symbol("baseMap"),r=class{constructor(e){this.value=e}};function a(e){if(!Array.isArray(e))throw new TypeError("The keys parameter must be an array")}function o({[n]:e},t,r){for(let n of t){if(!e.has(n)){if(!r)return;e.set(n,new WeakMap)}e=e.get(n)}return e}t.exports=class extends WeakMap{constructor(){super(),this[n]=new WeakMap;let[e]=arguments;if(null!=e){if("function"!=typeof e[Symbol.iterator])throw new TypeError(typeof e+" is not iterable (cannot read property Symbol(Symbol.iterator))");for(let[t,n]of e)this.set(t,n)}}set(e,t){return a(e),o(this,e,!0).set(r,t),this}get(e){a(e);let t=o(this,e);return t?t.get(r):void 0}has(e){a(e);let t=o(this,e);return Boolean(t)&&t.has(r)}delete(e){a(e);let t=o(this,e);return Boolean(t)&&t.delete(r)}get[Symbol.toStringTag](){return"ManyKeysWeakMap"}}},()=>(Ye||Xe((Ye={exports:{}}).exports,Ye),Ye.exports)),st=ot(it()),lt=ot(it()),{default:ct,...dt}=lt,ut=st.default??ct??dt;let pt=e=>Ze.julia_andrey().language.parser.parse(e).topNode.firstChild;let mt=(e,t=(e=>e),n=new Map)=>(...r)=>{let a=t(...r),o=n.get(a);if(null!=o)return o;{let t=e(...r);if(null==t)throw new Error("Memoized function returned undefined");return n.set(a,t),t}},gt=(e,t=((...e)=>e))=>mt(e,t,new Qe.default),ht=e=>mt(e,(e=>e),new WeakMap),ft=function*(e){if(e.firstChild())try{do{yield e}while(e.nextSibling())}finally{e.parent()}},_t=function*(e){if(e.firstChild){let t=e.firstChild;do{yield t}while(t=t.nextSibling)}},bt=(e,t,n,r=!1)=>{if(r){console.group("Current haystack:",e?e.node.name:null),console.groupCollapsed("Details");try{console.log("template:",t),console.log("haystack_cursor:",e?e.node.toString():null),"node"in t?(console.log("template.node:",t.node),console.log("template.node.toString():",t.node.toString())):"pattern"in t&&console.log("template.pattern:",t.pattern)}finally{console.groupEnd()}}try{if("pattern"in t){let a=t.pattern;if("function"!=typeof a)throw new Error(`Unknown pattern "${a}"`);let o={};r&&(o={...n},console.groupCollapsed(`Matching against pattern: ${t.pattern.name}()`));let i=null;try{i=a(e,n,r)}finally{r&&console.groupEnd()}if(r)if(i){if(console.log("✅ because the pattern was happy! All hail the pattern!"),!le.default.isEqual(n,o)){let e=le.default.omit(n,Object.keys(o));console.log(" WE EVEN GOT NEW MATCHES SAY WHAAAAAAT:",e)}}else console.log("❌ because... well, you should ask the pattern that!");return i}if(!("node"in t))throw console.log("template:",t),new Error("waaaah");{let{node:a,children:o}=t;if(r&&console.log(`Matching against node: ${t.node.name}`),!e)return"end"===a.name?(r&&console.log("✅ No node left to match, but it was the end anyway"),!0):(r&&console.log("❌ because no cursor left to match against"),!1);if(e.type.isError)return r&&console.log("✅ because ⚠"),!0;if(e.name!==a.name)return r&&console.log(`❌ because name mismatch "${e.name}" !== "${a.name}"`),!1;if(!e.firstChild()){if(0!==t.children.length){r&&console.log("Haystack node is empty, but template has children... lets see");for(let e of t.children)if(!bt(null,e,n,r))return r&&console.log("❌ because child template wasn't okay with having no children",e),!1;return r&&console.log("✅ All template children we're fine with having no children to check on"),!0}return r&&console.log("✅ Template also has no children, yayyy"),!0}try{let a=!1;for(let t of o){if(a){if(r&&console.log("Haystack is empty, but there are more children in template... lets see"),!bt(null,t,n,r))return r&&console.log("❌ template child did not accept null for an answer",t,e.toString()),!1;r&&console.log("👌🏽 This template child was fine with null");continue}for(;("Comment"===e.name||"BlockComment"===e.name)&&e.nextSibling(););if(!bt(e,t,n,r))return r&&console.log("❌ because a child mismatch",t,e.toString()),!1;a=!e.nextSibling()}if(r&&!a){let n=[];do{n.push(e.node)}while(e.nextSibling());for(let t of n)e.prevSibling();console.warn("We did match all the children of the template, but there are more in the haystack... Might want to actually not match this?",n,t)}return r&&console.log("✅ because all children match"),!0}finally{e.parent()}}}finally{r&&console.groupEnd()}};class yt{constructor(e,t){let n=[],r=[];n.push(e[0]);for(let[a,o]of le.default.zip(e.slice(1),t))if(o instanceof yt){n[n.length-1]+=o.template[0];for(let[e,t]of le.default.zip(o.template.slice(1),o.substitutions))r.push(t),n.push(e);n[n.length-1]+=a}else r.push(o),n.push(a);this.template=n,this.substitutions=r}}let vt=(e,t)=>{for(let n of t)if(e.from===n.from&&e.to===n.to){n.used=!0;let t=n.generator.next({name:e.name,from:e.from,to:e.to,node:e});if(t.done)return t.value;throw new Error("Template generator not done providing ast node")}return{name:e.name,from:e.from,to:e.to,children:Array.from(_t(e)).map((e=>vt(e,t))),node:e}},wt=function*(e){if(e instanceof yt){let t="",n=[];for(let[r,a]of le.default.zip(e.template,e.substitutions))if(t+=r,a){let e=wt(a),r=Dt(e.next());n.push({from:t.length,to:t.length+r.length,generator:e}),t+=r}let r=yield t,a=n.map((e=>({from:e.from+r.from,to:e.to+r.from,generator:e.generator,used:!1})));false;let o=vt(r.node,a),i=a.filter((e=>!e.used)).map((e=>({text:t.slice(e.from,e.to),from:e.from,to:e.to})));if(i.length>0)throw new Error("Some substitutions not applied, this means it couldn't be matched to a AST position:",i);return o}if("function"==typeof e)return yield*e();throw console.log("julia_code_object:",e),new Error("Unknown substition type")},kt=gt(((e,...t)=>new yt(e,t))),Et=new WeakMap,$t=(e,...t)=>{let n=Et.get(e);if(null!=n){let{input:e,result:t}=n;return t}{let n=new yt(e,t);return Et.set(e,{input:t,result:n}),n}},xt=ht((e=>{let t=wt(e),n=Dt(t.next()),r=pt(n),a=It(t.next({from:0,to:n.length,name:r.name,node:r}));return{template_description:a,match(e,t=!1){if("node"in a&&a.node.name!==e.name)return;if(e.type.isError)return null;"cursor"in e&&(e=e.cursor);let n={};t&&console.groupCollapsed(`Starting a match at ${e.name}`);try{return bt(e,a,n,t)?n:null}finally{t&&console.groupEnd()}}}})),St=ht((e=>{let t=wt(e),n=Dt(t.next());return t.return(),n})),Nt=(ht((e=>pt(St(e)))),ht((e=>Ze.Text.of([St(e)]))),e=>{let t={},n=mt((n=>ht((r=>r===t?e(n):e(n,r)))));return(e,r=t)=>n(e)(r)});function*Ct(){return yield"expression",{pattern:function(e,t,n=!1){return e?!e.type.is("keyword")||(n&&console.log("❌ Keywords are not allowed!"),!1):(n&&console.log("❌ I want anything!! YOU GIVE ME NULL???"),!1)}}}const At={any:Ct,many:Nt(((e,t=Ct)=>function*(){let n=wt(t),r=yield Dt(n.next()),a=null,o=null;return r.node.firstChild&&r.node.from===r.node.firstChild.from&&r.node.to===r.node.firstChild.to?(a=r.node,o=It(n.next({...r,node:r.node.firstChild}))):o=It(n.next(r)),{narrowed_node:a,sub_template:o,pattern:function(t,n,r=!1){if(!t)return r&&console.log("✅ Nothing to see here... I'm fine with that - many"),!0;if(a){if(t.name!==a.name)return r&&console.log("❌ Tried to go in, but she wasn't my type - many"),t.prevSibling(),!0;t.firstChild()}try{let i=[];for(;;){let e={};if(!bt(t,o,e,r)){t.prevSibling();break}if(i.push({node:t.node,match:e}),!t.nextSibling())break}return null!=e&&(n[e]=i),!0}finally{a&&t.parent()}}}})),maybe:ht((e=>function*(){let t=yield*wt(e);return{sub_template:t,pattern:function(e,n,r=!1){if(!e)return!0;if(e.type.isError)return!0;return!1===bt(e,t,n,r)&&e.prevSibling(),!0}}})),anything_that_fits:ht((e=>function*(){return yield*wt(e),{pattern:function(e,t,n=!1){return!0}}})),something_with_the_same_type_as:ht((e=>function*(){let t=wt(e),n=Dt(t.next()),r=yield n;return t.return(),{pattern:function(e,t,n=!1){return e&&r.name===e.name}}})),as:Nt(((e,t=Ct)=>function*(){let n=yield*wt(t);return{sub_template:n,pattern:function(t,r,a=!1){let o=bt(t,n,r,a);return!0===o&&(r[e]=t?.node),t&&o}}})),Identifier:function*(){return yield"identifier",{pattern:function(e,t,n=!1){return e&&"Identifier"===Rt(e)}}},Number:function*(){return yield"69",{pattern:function(e,t,n=!1){return e&&"Number"===Rt(e)}}},String:function*(){return yield'"A113"',{pattern:function(e,t,n=!1){return e&&("StringWithoutInterpolation"===Rt(e)||"TripleStringWithoutInterpolation"===Rt(e))}}}};let Ot=gt(((e,t)=>{let n=wt(e),r=Dt(n.next()),a=pt(r),o=null;if(o=t.match(a)){let{content:e}=o,t=[];for(;e.firstChild&&e.firstChild.from==e.from&&e.firstChild.to==e.to;)t.push(e.type),e=e.firstChild;if(null==e)throw console.log("match:",o),new Error("No content match?");let r=It(n.next({name:e.name,node:e,from:a.from,to:a.to}));return{possible_parents:t,template_description:r,match(e,n=!1){if(e.type.isError)return n&&console.log(`❌ Short circuiting because haystack(${e.name}) is an error`),!1;"cursor"in e&&(e=e.cursor);let a=0;for(let r of t){if(e.type!==r)break;{let t=e.from,o=e.to;if(e.firstChild()){if(e.from!==t||e.to!==o){e.parent(),n&&console.log(`❌ Was matching possible parent (${r}), but it wasn't filling?! That's weird.... ${e.toString()}`);for(let t=0;te.firstChild&&e.firstChild.from===e.from&&e.firstChild.to===e.to?Mt(e.firstChild):e,Rt=e=>{let t=e.from,n=e.to;if(e.firstChild())try{if(e.from===t&&e.to===n)return Rt(e)}finally{e.parent()}return e.name},Tt=e=>t=>{let n=xt(e(At.as("content",t)));return Ot(e(t),n)};function Lt({tree:e,enter:t,leave:n,from:r=0,to:a=e.length}){let o=e.cursor();for(;;){let e=!1;if(o.from<=a&&o.to>=r&&(o.type.isAnonymous||!1!==t(o))){if(o.firstChild())continue;o.type.isAnonymous||(e=!0)}for(;e&&n&&n(o),e=o.type.isAnonymous,!o.nextSibling();){if(!o.parent())return;e=!0}}}let Dt=e=>{if(e.done)throw new Error("Expected `yield`-d value, but got `return`");return e.value},It=e=>{if(e.done)return e.value;throw new Error("Expected `yield`-d value, but got `return`")},Bt=(e,t)=>{if(e===t)return e;let n=[...e.usages,...t.usages],r=new Map(e.definitions);for(let[e,n]of t.definitions)r.set(e,n);return{usages:n,definitions:r,locals:[...e.locals,...t.locals]}},jt=function*(e){for(let t of ft(e))if("InterpolationExpression"===t.name)yield e;else if("QuoteExpression"===t.name||"QuoteStatement"===t.name)for(let e of jt(t))yield*jt(e);else yield*jt(t)},Pt=e=>{let t=Tt(e);return function(e,n=!1){return null==e?(e,...n)=>t($t(e,...n)):function(r,...a){return t($t(r,...a)).match(e,n)}}},Ut=Pt((e=>kt`[i for i in i ${e}]`)),Ft=Pt((e=>kt`${e} = nothing`)),zt=Pt((e=>kt`function f(${e}) end`)),qt=Pt((e=>kt`f(${e})`)),Kt=Pt((e=>kt`f(; ${e})`)),Ht=(e,t,n,r=!1)=>{let a=null;if(a=qt(e)`; ${At.many("named_args")}`){let{named_args:e=[]}=a;for(let{node:a}of e)n=Ht(a,t,n,r);return n}if(a=zt(e)`${At.Identifier}`)return en(n,t,e);if(a=zt(e)`${At.as("subject")}...`)return Wt(a.subject,t,n,null,r);if(a=zt(e)`${At.as("name")} = ${At.as("value")}`){let{name:e,value:o}=a;return n=Wt(e,t,n,o.to,r),n=tn(o.cursor,t,n,r)}if((a=zt(e)`${At.as("name")}::${At.as("type")}`)??(a=zt(e)`${At.as("name")}:`)??(a=zt(e)`::${At.as("type")}`)){let{name:e,type:o}=a;return e&&(n=Wt(e,t,n,o.to,r)),o&&(n=tn(o.cursor,t,n,r)),n}return r&&console.warn("UNKNOWN FUNCTION DEFINITION ARGUMENT:",e.toString()),n},Wt=(e,t,n,r=null,a=!1)=>{let o=null;if(o=Ft(e)`${At.Identifier}`)return en(n,t,e,r);if(o=Ft(e)`${At.as("object")}::${At.as("type")}`){let{object:e,type:r}=o;return n=tn(r.cursor,t,n,a),n=en(n,t,e)}if(o=Ft(e)`${At.as("subject")}...`)return Wt(o.subject,t,n,r,a);if(o=zt(e)`${At.as("name")} = ${At.as("value")}`){let{name:e,value:r}=o;return n=Wt(e,t,n,r.from,a),n=tn(r.cursor,t,n,a)}if((o=Ft(e)`${At.as("first")}, ${At.many("rest")}`)??(o=Ft(e)`(${At.as("first")}, ${At.many("rest")})`)){for(let{node:e}of[{node:o.first},...o.rest??[]])n=Wt(e.cursor,t,n,r,a);return n}if(o=Zt(e)`${At.as("prefix")}${At.as("string",At.String)}`){let{prefix:r,string:i}=o;if("var"===t.sliceString(r.from,r.to)){let r=t.sliceString(i.from+1,i.to-1);0!==r.length&&n.definitions.set(r,{from:e.from,to:e.to,valid_from:e.to})}else n=tn("cursor"in e?e.cursor:e,t,n,a);return n}if(o=Ft(e)`${At.as("object")}[${At.as("property")}]`){let{object:e,property:r}=o;return n=tn(e.cursor,t,n,a),r&&(n=tn(r.cursor,t,n,a)),n}if(o=Ft(e)`${At.as("object")}.${At.as("property")}`){let{object:e,property:r}=o;return n=tn(e.cursor,t,n,a)}return a&&console.warn("UNKNOWN PATTERN:",e.toString(),t.sliceString(e.from,e.to)),n},Gt=function(e,t,n,r=!1){let a=null;if("Definition"!==e.name||!e.firstChild()){if("Identifier"===e.name)return{inner:en(n,t,e),outer:en(Xt(),t,e)};if(a=Zt(e)`${At.as("subject")}{ ${At.many("parameters")} }`){let{subject:e,parameters:r}=a,o=Xt();if(e){let r=Gt(e.cursor,t,n);o=r.outer,n=r.inner}for(let{node:e}of r){let{inner:r}=Gt(e.cursor,t,n);n=r}return{inner:n,outer:o}}if(a=Zt(e)`${At.as("subject")} <: ${At.maybe(At.as("type"))}`){let{subject:e,type:r}=a,o=Xt();return e&&({outer:o,inner:n}=Gt(e.cursor,t,n)),r&&(n=tn(r.cursor,t,n)),{inner:n,outer:o}}return r&&console.warn(`Unknown thing in definition: "${t.sliceString(e.from,e.to)}", "${e.toString()}"`),{inner:n,outer:Xt()}}try{return Gt(e,t,n)}finally{e.parent()}},Zt=(Vt=xt,function(e,t=!1){return null==e?(e,...t)=>Vt($t(e,...t)):function(n,...r){return Vt($t(n,...r)).match(e,t)}});var Vt;let Qt=(e,t,n,r=!1)=>{let a=null,o=Pt((e=>kt`${e} x y z`));if(a=o(e)`${At.as("macro",$t`@${At.any}`)}`){let{macro:e}=a,r=t.sliceString(e.from,e.to);return n.usages.push({usage:e,definition:n.definitions.get(r),name:r}),n}if(a=o(e)`${At.as("object")}.@${At.as("macro")}`){let{object:e}=a,r=t.sliceString(e.from,e.to);return n.usages.push({usage:e,definition:n.definitions.get(r),name:r}),n}if(a=o(e)`@${At.as("object")}.${At.as("macro")}`){let{object:e}=a,r=t.sliceString(e.from,e.to);return n.usages.push({usage:e,definition:n.definitions.get(r),name:r}),n}r&&console.warn("Mwep mweeeep",e.toString())},Xt=()=>({usages:[],definitions:new Map,locals:[]}),Yt=e=>({usages:[],definitions:new Map(e.definitions),locals:[]}),Jt=(e,t,n=null)=>({usages:[...t.usages,...e.usages],definitions:t.definitions,locals:[]}),en=(e,t,n,r=null)=>(r=null===r?n.to:r,e.definitions.set(t.sliceString(n.from,n.to),{from:n.from,to:n.to,valid_from:r}),e),tn=(e,t,n={usages:[],definitions:new Map,locals:[]},r=!1)=>{"cursor"in e&&(e=e.cursor);let a=null;if(r){console.group(`Explorer: ${e.name}`),console.groupCollapsed("Details");try{console.log(`Full tree: ${e.toString()}`),console.log("Full text:",t.sliceString(e.from,e.to)),console.log("scopestate:",n)}finally{console.groupEnd()}a=e.node}try{let a=null;if(e.type.is("keyword")||"SourceFile"===e.name||"BooleanLiteral"===e.name||"Character"===e.name||"String"===e.name||"Number"===e.name||"Comment"===e.name||"BinaryExpression"===e.name||"Operator"===e.name||"MacroArgumentList"===e.name||"ReturnStatement"===e.name||"BareTupleExpression"===e.name||"ParenthesizedExpression"===e.name||"Type"===e.name||"InterpolationExpression"===e.name||"SpreadExpression"===e.name||"CompoundExpression"===e.name||"ParameterizedIdentifier"===e.name||"TypeArgumentList"===e.name||"TernaryExpression"===e.name||"Coefficient"===e.name||"TripleString"===e.name||"RangeExpression"===e.name||"SubscriptExpression"===e.name||"UnaryExpression"===e.name||"ConstStatement"===e.name||"GlobalStatement"===e.name||"ContinueStatement"===e.name||"MatrixExpression"===e.name||"MatrixRow"===e.name||"ArrayExpression"===e.name){for(let a of ft(e))n=tn(a,t,n,r);return n}if("Identifier"===e.name||"MacroIdentifier"===e.name){let r=t.sliceString(e.from,e.to);return n.usages.push({name:r,usage:{from:e.from,to:e.to},definition:n.definitions.get(r)}),n}if(a=Zt(e)`:${At.any}`)return n;if(a=Zt(e)`${At.Number}`)return n;if(a=Zt(e)`${At.String}`)return n;if(a=Zt(e)`${At.as("object")}.${At.as("property")}`){let{object:e,property:o}=a;return e&&(n=tn(e.cursor,t,n,r)),n}if(a=Zt(e)`${At.as("assignee")} = ${At.maybe(At.as("value"))}`){let{assignee:e,value:o}=a;return o&&(n=tn(o.cursor,t,n,r)),e&&(n=Wt(e.cursor,t,n,o?.to??null,r)),n}if(a=Zt(e)` + ${At.as("macro",At.anything_that_fits($t`@macro`))}(${At.many("args")}) ${At.maybe($t`do ${At.maybe(At.many("do_args"))} + ${At.many("do_expressions")} + end`)}} + `){let{macro:o,args:i=[],do_args:s,do_expressions:l}=a;o&&Qt(o.cursor,t,n,r);for(let{node:e}of i)if(a=qt(e)`${At.as("name")} = ${At.as("value")}`){let{name:e,value:o}=a;o&&(n=tn(o.cursor,t,n,r))}else n=tn(e.cursor,t,n,r);if(s&&l){let a=Yt(n),o=s.firstChild;if("Identifier"===o.name)a=en(a,t,o);else if("ArgumentList"===o.name)for(let e of _t(o))a=Ht(e,t,a);else if("BareTupleExpression"===o.name)for(let e of _t(o))a=Ht(e,t,a);else r&&console.warn("Unrecognized do args",o.toString());for(let{node:e}of l)a=tn(e.cursor,t,a,r);return Jt(a,n,e.to)}return n}if(a=Zt(e)`${At.as("macro",At.anything_that_fits($t`@macro`))} ${At.many("args")}`){let{macro:e,args:o=[]}=a;e&&Qt(e.cursor,t,n,r);for(let{node:e}of o)n=tn(e.cursor,t,n,r);return n}if((a=Zt(e)` + struct ${At.as("defined_as")} + ${At.many("expressions")} + end + `)??(a=Zt(e)` + mutable struct ${At.as("defined_as")} + ${At.many("expressions")} + end + `)){let{defined_as:o,expressions:i=[]}=a;o=Mt(o);let s=Yt(n),l=Xt();o&&({inner:s,outer:l}=Gt(o.cursor,t,s));for(let{node:n}of i)if("Identifier"===e.name);else if(a=Zt(n)`${At.as("subject")}::${At.as("type")}`){let{subject:e,type:n}=a;s=tn(n.cursor,t,s,r)}else if(a=Zt(n)`${At.as("assignee")} = ${At.as("value")}`){let{assignee:e,value:n}=a;if(a=Zt(e)`${At.as("subject")}::${At.as("type")}`){let{subject:e,type:n}=a;s=tn(n.cursor,t,s,r)}s=tn(n.cursor,t,s,r)}return n=Jt(s,n,e.to),n=Bt(n,l)}if(a=Zt(e)`abstract type ${At.as("name")} end`){let{name:e}=a;if(e){let{outer:r}=Gt(e.cursor,t,n);n=Bt(n,r)}return n}if((a=Zt(e)`quote ${At.many("body")} end`)??(a=Zt(e)`:(${At.many("body")})`)){for(let a of function*(e){if("QuoteExpression"!==e.name&&"QuoteStatement"!==e.name)throw new Error("Expected QuotedExpression or QuoteStatement");yield*jt(e)}(e))n=tn(a,t,n,r);return n}if(a=Zt(e)` + module ${At.as("name")} + ${At.many("expressions")} + end + `){let{name:e,expressions:r=[]}=a;e&&(n=en(n,t,e));let o=Xt();for(let{node:e}of r)o=tn(e.cursor,t,o);n=Bt(n,{usages:Array.from(o.usages).filter((e=>null!=e.definition)),definitions:new Map,locals:[]});for(let{node:e}of r)n=tn(e.cursor,t,n);return n}if(a=Zt(e)`${At.as("prefix")}${At.as("string",At.String)}`){let{prefix:r,string:o}=a,i=t.sliceString(r.from,r.to);if("var"===i){let r=t.sliceString(o.from+1,o.to-1);return 0!==r.length&&n.usages.push({name:r,usage:{from:e.from,to:e.to},definition:n.definitions.get(r)??null}),n}{let e=`@${i}_str`;n.usages.push({name:e,usage:{from:r.from,to:r.to},definition:n.definitions.get(e)??null})}return n}if(a=Zt(e)`${At.Number}${At.as("unit")}`)return tn(a.unit.cursor,t,n,r);if((a=Zt(e)`import ${At.any}: ${At.many("specifiers")}`)??(a=Zt(e)`using ${At.any}: ${At.many("specifiers")}`)){let{specifiers:e=[]}=a,o=Pt((e=>kt`import X: ${e}`));for(let{node:i}of e)if(a=o(i)`${At.as("name")} as ${At.as("alias")}`){let{alias:e}=a;n=en(n,t,e)}else if(a=o(i)`${At.as("name",At.Identifier)}`){let{name:e}=a;n=en(n,t,e)}else r&&console.warn("Hmmmm, I don't know what to do with this selected import specifier:",i);return n}if(a=Zt(e)`import ${At.many("specifiers")}`){let{specifiers:e=[]}=a,o=Pt((e=>kt`import ${e}`));for(let{node:i}of e)if(a=o(i)`${At.any} as ${At.as("alias")}`){let{alias:e}=a;n=en(n,t,e)}else if(a=o(i)`${At.as("package")}.${At.as("name",At.Identifier)}`)n=en(n,t,a.name);else if(a=o(i)`.${At.as("scoped")}`){let e=null;for(;e=o(a.scoped)`.${At.as("scoped")}`;)a=e;n=en(n,t,a.scoped)}else(a=o(i)`${At.as("name",At.Identifier)}`)?n=en(n,t,a.name):r&&console.warn("Hmmm, I don't know what to do with this import specifier:",i);return n}if(a=Zt(e)`using ${At.many()}`)return n;if(a=Zt(e)` + for ${At.many("bindings",At.something_with_the_same_type_as($t`x in y`))}; + ${At.many("expressions")} + end + `){let o=Tt((e=>kt`for ${e}; x end`)),i=e=>(...t)=>o($t(...t)).match(e),{bindings:s,expressions:l}=a,c=Yt(n);for(let{node:e}of s){let n=null;if((n=i(e)`${At.as("name")} in ${At.as("range")}`)??(n=i(e)`${At.as("name")} ∈ ${At.as("range")}`)??(n=i(e)`${At.as("name")} = ${At.as("range")}`)){let{name:e,range:a}=n;a&&(c=tn(a.cursor,t,c,r)),e&&(c=Wt(e,t,c,a?.to??null,r))}else r&&console.warn("Unrecognized for loop binding",e.toString())}for(let{node:e}of l)c=tn(e.cursor,t,c,r);return Jt(c,n,e.to)}if((a=Zt(e)` + ${At.as("callee")}(${At.many("args")}) ${At.maybe($t`do ${At.maybe(At.many("do_args"))} + ${At.many("do_expressions")} + end`)} + `)??(a=Zt(e)` + ${At.as("callee")}.(${At.many("args")}) + `)){let{callee:o,args:i=[],do_args:s=[],do_expressions:l=[]}=a;n=tn(o.cursor,t,n,r);for(let{node:a}of i){let o=null;if(o=qt(a)`; ${At.many("named_args")}`){let{named_args:e=[]}=o;for(let{node:a}of e){let e=null;if(e=Kt(a)`${At.as("name")} = ${At.as("value")}`){let{name:a,value:o}=e;n=tn(o.cursor,t,n,r)}else n=tn(a.cursor,t,n,r)}}else if(o=qt(a)`${At.as("name")} = ${At.as("value")}`){let{name:e,value:a}=o;a&&(n=tn(a.cursor,t,n,r))}else{if(o=qt(a)`${At.as("result")} ${At.many("clauses",At.anything_that_fits($t`for x = y`))}`){let{result:a,clauses:i}=o,s=Yt(n);for(let{node:e}of i){let n=null;if((n=Ut(e)`for ${At.as("variable")} = ${At.maybe(At.as("value"))}`)??(n=Ut(e)`for ${At.as("variable")} in ${At.maybe(At.as("value"))}`)??(n=Ut(e)`for ${At.as("variable")} ∈ ${At.maybe(At.as("value"))}`)??(n=Ut(e)`for ${At.as("variable")}`)){let{variable:e,value:a}=n;a&&(s=tn(a.cursor,t,s,r)),e&&(s=Wt(e,t,s))}else if(n=Ut(e)`if ${At.maybe(At.as("if"))}`){let{if:e}=n;e&&(s=tn(e.cursor,t,s,r))}else r&&console.log("Hmmm, can't parse for binding",e)}return s=tn(a.cursor,t,s,r),Jt(s,n,e.to)}n=tn(a.cursor,t,n,r)}}let c=Yt(n);for(let{node:e}of s)c=Ht(e,t,c);for(let{node:e}of l)c=tn(e.cursor,t,c,r);return Jt(c,n,e.to)}if(a=Zt(e)`(${At.many("tuple_elements")},)`){let{tuple_elements:o=[]}=a,i=Pt((e=>kt`(${e},)`)),s=o.map((({node:t})=>null!=i(e)`${At.Identifier} = ${At.any}`));if(s.every((e=>!0===e))||s.every((e=>!1===e)))for(let{node:a}of o){let o=null;if(o=i(e)`${At.as("name")} = ${At.as("value")}`){let{name:e,value:a}=o;a&&(n=tn(a.cursor,t,n,r))}else n=tn(a.cursor,t,n,r)}else for(let{node:a}of o){let o=null;if(o=i(e)`${At.as("name")} = ${At.as("value")}`){let{name:e,value:a}=o;a&&(n=tn(a.cursor,t,n,r)),e&&(n=en(n,t,e,a?.to??null))}else n=tn(a.cursor,t,n,r)}return n}if((a=Zt(e)`(${At.many("args")}) -> ${At.many("body")}`)??(a=Zt(e)`${At.as("arg")} -> ${At.many("body")}`)??(a=Zt(e)`${At.as("name")}(${At.many("args")})::${At.as("return_type")} = ${At.many("body")}`)??(a=Zt(e)`${At.as("name")}(${At.many("args")}) = ${At.many("body")}`)??(a=Zt(e)`${At.as("name")}(${At.many("args")}) = ${At.many("body",At.anything_that_fits($t`x, y`))}`)??(a=Zt(e)` + function ${At.as("name")}(${At.many("args")})::${At.as("return_type")} where ${At.as("type_param")} + ${At.many("body")} + end + `)??(a=Zt(e)` + function ${At.as("name")}(${At.many("args")}) where ${At.as("type_param")} + ${At.many("body")} + end + `)??(a=Zt(e)` + function ${At.as("name")}(${At.many("args")})::${At.as("return_type")} + ${At.many("body")} + end + `)??(a=Zt(e)` + function ${At.as("name")}(${At.many("args")}) + ${At.many("body")} + end + `)??(a=Zt(e)` + function ${At.as("name",At.Identifier)} end + `)??(a=Zt(e)`macro ${At.as("macro_name")} end`)??(a=Zt(e)` + macro ${At.as("macro_name")}(${At.many("args")}) + ${At.many("body")} + end + `)){let{name:o,macro_name:i,arg:s,args:l=[],return_type:c,type_param:d,body:u=[]}=a;s&&l.push({node:s}),o?n=en(n,t,o):i&&n.definitions.set(`@${t.sliceString(i.from,i.to)}`,{from:i.from,to:i.to,valid_from:i.to});let p=Yt(n);if(d){let e=Pt((e=>kt`function X() where ${e} end`)),n=Pt((e=>kt`function X() where {${e}} end`)),a=[{node:d}],o=e(d)`{${At.many("type_params")}}`;o&&(a=o.type_params);for(let{node:e}of a){let a=null;if(a=n(e)`${At.as("defined",At.Identifier)} <: ${At.as("parent_type")}`){let{defined:e,parent_type:n}=a;p=tn(n,t,p,r),p=en(p,t,e)}else if(a=n(e)`${At.as("defined",At.Identifier)}`){let{defined:e}=a;p=en(p,t,e)}else r&&console.warn("Can't handle type param:",e)}}c&&(p=tn(Mt(c).cursor,t,p,r));for(let{node:e}of l)p=Ht(e.cursor,t,p,r);for(let{node:e}of u)p=tn(e.cursor,t,p,r);return Jt(p,n,e.to)}if(a=Zt(e)` + let ${At.many("assignments",$t`${At.as("assignee")} = ${At.as("value")}`)} + ${At.many("body",At.any)} + end + `){let{assignments:o=[],body:i=[]}=a,s=Yt(n);for(let{match:{assignee:e,value:a}}of o)e&&(s=Wt(e,t,s,a?.to??null,r)),a&&(n=tn(a.cursor,t,n,r));for(let{node:e}of i)s=tn(e.cursor,t,s,r);return Jt(s,n,e.to)}if((a=Zt(e)`[ + ${At.as("result")} + ${At.many("clauses",At.anything_that_fits($t`for x = y`))} + ]`)??(a=Zt(e)`( + ${At.as("result")} + ${At.many("clauses",At.anything_that_fits($t`for x = y`))} + )`)){let{result:o,clauses:i}=a,s=Yt(n);for(let{node:e}of i){let n=null;if((n=Ut(e)`for ${At.as("variable")} = ${At.maybe(At.as("value"))}`)??(n=Ut(e)`for ${At.as("variable")} in ${At.maybe(At.as("value"))}`)??(n=Ut(e)`for ${At.as("variable")} ∈ ${At.maybe(At.as("value"))}`)??(n=Ut(e)`for ${At.as("variable")}`)){let{variable:e,value:a}=n;a&&(s=tn(a.cursor,t,s,r)),e&&(s=Wt(e,t,s))}else if(n=Ut(e)`if ${At.maybe(At.as("if"))}`){let{if:e}=n;e&&(s=tn(e.cursor,t,s,r))}else r&&console.warn("Hmmm, can't parse for binding",e)}return s=tn(o.cursor,t,s,r),Jt(s,n,e.to)}r&&(console.groupCollapsed("Cycling through all children of",e.name),console.log("text:",t.sliceString(e.from,e.to)),console.groupEnd());for(let a of ft(e))n=tn(a,t,n,r);return n}finally{r&&console.groupEnd()}},nn=Ze.StateField.define({create(e){try{let t=Ze.syntaxTree(e).cursor();return tn(t,e.doc,void 0)}catch(e){return console.error("Something went wrong while parsing variables...",e),{usages:[],definitions:new Map,locals:[]}}},update(e,t){try{if(Ze.syntaxTree(t.state)!=Ze.syntaxTree(t.startState)){let e=Ze.syntaxTree(t.state).cursor();return tn(e,t.state.doc,void 0)}return e}catch(e){return console.error("Something went wrong while parsing variables...",e),{usages:[],definitions:new Map,locals:[]}}}}),rn=e=>"SubscriptExpression"===e.name||"FieldExpression"===e.name?(e.firstChild(),rn(e)):"Identifier"===e.name?(e.firstChild(),e.node):null,an=["Identifier","FieldExpression","SubscriptExpression","MacroFieldExpression","MacroIdentifier","Operator","Definition","ParameterizedIdentifier"],on=["import","export","try","catch","finally","quote","do","struct","mutable"],sn=e=>{if(on.includes(e.name))return!0;if(an.includes(e.name)){if(e.firstChild()){do{if("Number"!==e.name&&"TypeArgumentList"!==e.name&&"FieldName"!==e.name&&"MacroName"!==e.name&&"MacroFieldName"!==e.name&&!sn(e))return!1}while(e.nextSibling());return e.parent(),!0}return!0}return!1},ln=(e,t=!1)=>{let n=e.selection.main,r=e.field(nn);if(n.from!==n.to)return e.doc.sliceString(n.from,n.to).trim();{let a=e.doc.lineAt(n.from).text;if("?"===a[0])return a.slice(1);let o=Ze.syntaxTree(e).cursor();t&&console.log("Full tree:",o.toString()),o.moveTo(n.to,-1);let i=0;do{t&&console.group(`Iteration #${i}`);try{if(t&&console.log("cursor",o.toString()),i>100){console.group("Infinite loop while checking docs"),console.log("Selection:",n,e.doc.sliceString(n.from,n.to).trim()),console.log("Current node:",o.name,e.doc.sliceString(o.from,o.to).trim()),console.groupEnd();break}i+=1;let a=o.node.cursor,s=[];for(;a.parent();)s.push(a.name);let l=o.node.parent;if(null==l)break;t&&console.log("parents:",s);let c=s.indexOf("StructDefinition");if(-1!==c)if(s.includes("AssignmentExpression")&&s.indexOf("AssignmentExpression")e.usage.from===t.from&&e.usage.to===t.to))?.definition)return e.doc.sliceString(o.from,o.to)}if("FunctionDefinition"===l.name)return;if("AssignmentExpression"===l.name)return}finally{t&&console.groupEnd()}}while(o.parent())}};Ze=a("61LLQ"),ge=a("gZ62d"),le=a("9lAXI");let cn=(e,{scopestate:t,global_definitions:n})=>Ze.Decoration.set(t.usages.map((({definition:e,usage:t,name:r})=>null==e?n[r]?Ze.Decoration.mark({tagName:"pluto-variable-link",attributes:{title:`${ge.ctrl_or_cmd_name}-Click to jump to the definition of ${r}.`,"data-pluto-variable":r,href:`#${r}`}}).range(t.from,t.to):null:Ze.Decoration.mark({tagName:"pluto-variable-link",attributes:{title:`${ge.ctrl_or_cmd_name}-Click to jump to the definition of ${r}.`,"data-cell-variable":r,"data-cell-variable-from":`${e.from}`,"data-cell-variable-to":`${e.to}`,href:"#"}}).range(t.from,t.to))).filter((e=>null!=e)),!0);const dn=Ze.Facet.define({combine:e=>e[0],compare:le.default.isEqual}),un=Ze.ViewPlugin.fromClass(class{constructor(e){let t=e.state.facet(dn);this.decorations=cn(e.state,{scopestate:e.state.field(nn),global_definitions:t})}update(e){let t=e.state.facet(dn);(e.docChanged||e.viewportChanged||t!==e.startState.facet(dn))&&(this.decorations=cn(e.state,{scopestate:e.state.field(nn),global_definitions:t}))}},{decorations:e=>e.decorations,eventHandlers:{pointerdown:(e,t)=>{if(ge.has_ctrl_or_cmd_pressed(e)&&0===e.button&&e.target instanceof Element){let n=e.target.closest("[data-pluto-variable]");if(n){let r=n.getAttribute("data-pluto-variable");e.preventDefault();let a=`[id='${encodeURI(r)}']`;document.querySelector(a).scrollIntoView({behavior:"smooth",block:"center"});let o=t.state.facet(dn);if(o[r])return window.dispatchEvent(new CustomEvent("cell_focus",{detail:{cell_id:o[r],line:0,definition_of:r}})),!0}let r=e.target.closest("[data-cell-variable]");if(r){r.getAttribute("data-cell-variable");let e=Number(r.getAttribute("data-cell-variable-from")),n=Number(r.getAttribute("data-cell-variable-to"));return t.dispatch({scrollIntoView:!0,selection:{anchor:e,head:n}}),t.focus(),!0}}}}});Ze=a("61LLQ"),le=a("9lAXI");const pn=(Ze=a("61LLQ")).htmlLanguage.parser,mn=Ze.markdownLanguage.parser.configure(Ze.parseCode({htmlParser:pn})),gn=Ze.PostgreSQL.language.parser,hn=(Ze.sql({dialect:Ze.PostgreSQL}),Ze.pythonLanguage.parser),fn=["md","mermaid","cm","markdown","mdx","mdl","markdownliteral"].flatMap((e=>[e,`@${e}`])),_n=new Set(["TripleString","String","CommandString","TripleStringWithoutInterpolation","StringWithoutInterpolation","CommandStringWithoutInterpolation"]);Ze.parseMixed(((e,t)=>{if(!_n.has(e.type.name))return null;const n="TripleString"===e.name||"TripleStringWithoutInterpolation"===e.name?3:1,r=[{from:e.from+n,to:Math.min(e.to-n,t.length)}];if(r[0].from>=r[0].to)return null;const a=e.node?.prevSibling||e.node?.parent?.prevSibling;if(!a)return null;const o=t.read(a.from,a.to);let i,s=[];if("@htl"===o||"html"===o)i=pn;else if(fn.includes(o))i=mn;else if("@javascript"===o||"@js"===o||"js"===o||"javascript"===o)i=Ze.javascriptLanguage.parser;else if("py"===o||"pyr"===o||"python"===o||"@python"===o)i=hn;else{if("sql"!==o)return null;i=gn}let l=e.from;for(let t=e.node.firstChild;s!==r&&null!==t&&t.to<=e.to;t=t?.nextSibling)s.push({from:l,to:t.from}),l=t.to;return 0===s.length||null===e.node.firstChild?s=r:s!==r&&(s.push({from:l,to:e.to}),"TripleString"===e.type.name?(s[0].from+=3,s[s.length-1].to-=3):(s[0].from+=1,s[s.length-1].to-=1)),["@htl","@javascript",...fn].includes(o)&&(s=((e,t)=>e.flatMap((({from:e,to:n})=>{const r=t.read(e,n),a=[...r.matchAll(/\\n/g)].map((({index:t})=>({from:e+t,to:e+t+2}))),o=[...r.matchAll(/\\\$/g)].map((({index:t})=>({from:e+t,to:e+t+1}))),i=[...r.matchAll(/[^\\]\$/g)].map((({index:t})=>({from:e+t,to:e+t+2}))),s=le.default.sortBy([...a,...o,...i],"from"),l=[];let c=e,d=n;return s.forEach((({from:e,to:t})=>{l.push({from:c,to:e}),c=t})),l.push({from:c,to:d}),l})))(s,t)),[...fn].includes(o)?{parser:i,overlay:r}:{parser:i,overlay:s}}));Ze=a("61LLQ"),Ze=a("61LLQ"),le=a("9lAXI");a("8qR4G");Ze=a("61LLQ"),ye=a("inK2Y");let{autocompletion:bn,completionKeymap:yn,completionStatus:vn,acceptCompletion:wn}=Ze.autocomplete,kn=bn()[0];const En=Ze.StateEffect.define(),$n=Ze.StateField.define({create:()=>!1,update(e,t){for(let e of t.effects)if(e.is(En))return!0;return(null==t.startState.field(kn,!1)?.open||null!=t.state.field(kn,!1)?.open)&&((null==t.startState.field(kn,!1).open||t.startState.field(kn,!1)===t.state.field(kn,!1))&&e)}});const xn=[{key:"Tab",run:e=>{if(wn(e))return!0;let t=e.state.selection.main,n=e.state.sliceDoc(t.from-1,t.from);return!!t.empty&&(!/^(\t| |\n|\=|\)|)$/.test(n)&&(e.dispatch({effects:En.of(10)}),Ze.autocomplete.startCompletion(e)))}},{key:"?",run:e=>{if(e.state.field(kn,!1)?.open??!1)return window.dispatchEvent(new CustomEvent("open_live_docs")),!0}},{key:".",run:e=>(wn(e),!1)}];let Sn=e=>Ze.EditorView.updateListener.of((t=>{let n=t.state.field(kn,!1)?.open;if(null==n)return;let r=n.options[n.selected],a=r.completion.apply??r.completion.label;if("string"!=typeof a)return;let o=t.state.update({changes:{from:r.source.from,to:r.source.to,insert:a}}),i=ln(o.state);null!=i&&e(i)})),Nn=e=>async t=>{let n=(e=>e.matchBefore(/\\[^\s"'.`]*/))(t)||(e=>e.matchBefore(/~\//))(t);if(null==n)return null;let r=t.state.sliceDoc(0,t.pos),{start:a,stop:o,results:i}=await e({text:r});return{from:a,to:o,filter:!1,options:i.map((([e],t)=>({label:e})))}},Cn=e=>/^[@a-zA-Z_][a-zA-Z0-9!_]*\"?$/.test(e)?null:":"===e?`:(${e})`:`:${e}`;const An=function*(e,t,n){let r=0;for(let[a,{valid_from:o}]of e.entries())!t.has(a)&&oasync t=>{let n=t.state.sliceDoc(0,t.pos),r=(e=>e.matchBefore(/\.\:[^\s"'`()\[\].]*/))(t);r&&(n=n.slice(0,r.from+1)+n.slice(r.from+2));let{start:a,stop:o,results:i}=await e({text:n});r&&(o+=1);const s=t.state.field(nn).definitions,l=new Set;let c="."===n.slice(0,a).slice(-1);return{from:a,to:o,options:[...i.map((([e,t,n,r,a],o)=>{let d=c?Cn(e)??e:e;return s.has(e)&&l.add(e),{label:e,apply:d,type:ye.cl({c_notexported:!n,[`c_${t}`]:null!=t,[`completion_${a}`]:null!=a,c_from_notebook:r}),boost:50-o/i.length}})),...i.filter((([e])=>c&&null!=Cn(e))).map((([e,t,n],r)=>{let a=Cn(e);return{label:a,apply:a,type:(n?"":"c_notexported ")+(null==t?"":"c_"+t),boost:-99-r/i.length,is_not_exported:!n}})),...Array.from(An(s,l,t.pos))]}},Mn=async e=>{const t=await Ze.autocomplete.completeAnyWord(e);return{from:t.from,options:t.options.map((({label:e},t)=>({label:e,apply:e,type:null,boost:0-t})))}};let Rn=({request_autocomplete:e,on_update_doc_query:t})=>{let n=null,r=null,a=async t=>(le.default.isEqual(t,n)||(n=t,r=e(t)),await r);return[$n,bn({activateOnTyping:!1,override:[Nn(a),On(a),Mn],defaultKeymap:!1,maxRenderedOptions:512,optionClass:e=>e.type}),Ze.EditorView.updateListener.of((e=>{let t=e.state.field(kn,!1),n=e.state.field($n,!1);null!=t?.open&&n&&"active"===vn(e.state)&&1===t.open.options.length&&((e,t)=>{let n=t.completion.apply||t.completion.label,r=t.source;"string"==typeof n?e.dispatch({changes:{from:r.from,to:r.to,insert:n},selection:{anchor:r.from+n.length},userEvent:"input.complete"}):n(e,t.completion,r.from,r.to)})(e.view,t.open.options[0])})),Ze.EditorView.updateListener.of((e=>{for(let t of e.transactions){let n=t.annotation(Ze.autocomplete.pickedCompletion);n&&"string"==typeof n.apply&&n.apply.endsWith("/")&&n.type?.match(/(^| )completion_path( |$)/)&&Ze.autocomplete.startCompletion(e.view)}})),Sn(t),Ze.keymap.of(xn),Ze.keymap.of(yn)]};le=a("9lAXI"),Ze=a("61LLQ"),le=a("9lAXI"),o=a("fBBKY");const Tn=e=>null==e?[null]:Object.entries(e).flat(),Ln=({nbpkg:e,package_name:t,available_versions:n,is_disable_pkg:r})=>{let a=null,i=null,s=null,l=!1;const c=e?.installed_versions[t],d=(e?.busy_packages??[]).includes(t)||!(e?.instantiated??1);if(r){const e=t;a="disable_pkg",i=`${e} disables Pluto's built-in package manager.`,s=o.html`${e} disables Pluto's built-in package manager.`}else null!=c||le.default.isEqual(n,["stdlib"])?null==c||"stdlib"===c?(a="installed",i=`${t} is part of Julia's pre-installed 'standard library'.`,s=o.html`${t} is part of Julia's pre-installed standard library.`):d?(a="busy",i=`${t} (v${c}) is installing...`,s=o.html`
${t} v${c}
+ is installing...`):(a="installed",i=`${t} (v${c}) is installed in the notebook.`,s=o.html`
${t} v${c}
+ is installed in the notebook.`,p=n,l=!("stdlib"===(u=c)||!le.default.isArray(p))&&le.default.last(p)!==u):le.default.isArray(n)&&(0===n.length?(a="not_found",i=`The package "${t}" could not be found in the registry. Did you make a typo?`,s=o.html`The package "${t}" could not be found in the registry. +
Did you make a typo?
`):(a="will_be_installed",i=`${t} (v${le.default.last(n)}) will be installed in the notebook when you run this cell.`,s=o.html`
${t} v${le.default.last(n)}
+ will be installed in the notebook when you run this cell.`));var u,p;return{status:a,hint:s,hint_raw:i,available_versions:n,chosen_version:c,busy:d,offer_update:l}},Dn=({package_name:e,pluto_actions:t,notebook_id:n,nbpkg:r})=>{const[a,i]=o.useState(null);o.useEffect((()=>{(t.get_avaible_versions({package_name:e,notebook_id:n})??Promise.resolve([])).then((e=>{i(e)}))}),[e]);const{status:s,hint_raw:l}=Ln({nbpkg:r,package_name:e,is_disable_pkg:!1,available_versions:a});return o.html` + + + + `},In=({package_name:e})=>{const{hint_raw:t}=Ln({nbpkg:null,package_name:e,is_disable_pkg:!0,available_versions:null});return o.html` + + + + `};o=a("fBBKY"),o=a("fBBKY"),Ze=a("61LLQ");class Bn extends Ze.WidgetType{constructor(e){super(),this.element=e}eq(e){return!1}toDOM(){let e=document.createElement("span");return o.render(this.element,e),e}updateDOM(e){return o.render(this.element,e),!0}}const jn=["Pkg.activate","Pkg.API.activate","Pkg.develop","Pkg.API.develop","Pkg.add","Pkg.API.add","quickactivate","@quickactivate"];function Pn(e,{pluto_actions:t,notebook_id:n,nbpkg:r}){let a=new Set,i=e.visibleRanges.flatMap((({from:i,to:s})=>{let l=function({doc:e,tree:t,from:n,to:r}){let a=0,o=[];return Lt({tree:t,from:n,to:r,enter:t=>{if("QuoteExpression"!==t.name&&"QuoteStatement"!==t.name||a++,"InterpolationExpression"===t.name&&a--,0!==a)return;if("CallExpression"===t.name||"MacroExpression"===t.name){let n=t.node.firstChild,r=e.sliceString(n.from,n.to);return void(jn.includes(r)&&o.push({type:"package_disabler",name:r,from:t.to,to:t.to}))}let n=Tt((e=>kt`import A, ${e}`)),r=e=>{let t=null;return(t=n($t`${At.as("package")}.${At.any}`).match(e))?r(t.package):(t=n($t`.${At.maybe(At.any)}`).match(e))?null:(t=n($t`${At.Identifier}`).match(e))?e:void console.warn("Unknown nested import specifier: "+e.toString())},i=null;if((i=xt($t`import ${At.as("specifier")}: ${At.many()}`).match(t))??(i=xt($t`import ${At.as("specifier")}, ${At.many("specifiers")}`).match(t))??(i=xt($t`using ${At.as("specifier")}: ${At.many()}`).match(t))??(i=xt($t`using ${At.as("specifier")}, ${At.many("specifiers")}`).match(t))){let{specifier:a,specifiers:s=[]}=i;a&&(s=[{node:a},...s]);for(let{node:t}of s){t=Mt(t);let a=null;if(a=n($t`${At.as("package")} as ${At.maybe(At.any)}`).match(t)){let t=r(a.package);t&&o.push({type:"package",name:e.sliceString(t.from,t.to),from:t.to,to:t.to})}else if(a=n($t`${At.as("package")}.${At.any}`).match(t)){let t=r(a.package);t&&o.push({type:"package",name:e.sliceString(t.from,t.to),from:t.to,to:t.to})}else if(a=n($t`.${At.as("scoped")}`).match(t));else if(a=n($t`${At.as("package")}`).match(t)){let t=r(a.package);t&&o.push({type:"package",name:e.sliceString(t.from,t.to),from:t.to,to:t.to})}else console.warn("Unknown import specifier: "+t.toString())}if(i=null,i=xt($t`using ${At.as("specifier")}, ${At.many("specifiers")}`).match(t)){let{specifier:t}=i;t&&("\n"!==e.sliceString(t.to,t.to+1)&&""!==e.sliceString(t.to,t.to+1)||o.push({type:"implicit_using",name:e.sliceString(t.from,t.to),from:t.to,to:t.to}))}return!1}if("ImportStatement"===t.name)throw new Error("What")},leave:e=>{"QuoteExpression"!==e.name&&"QuoteStatement"!==e.name||a--,"InterpolationExpression"===e.name&&a++}}),o}({doc:e.state.doc,tree:Ze.syntaxTree(e.state),from:i,to:s});return l.map((e=>{if("package"===e.type){let{name:i}=e;if("Base"!==i&&"Core"!==i&&!a.has(i)){return a.add(i),Ze.Decoration.widget({widget:new Bn(o.html` + <${Dn} + key=${i} + package_name=${i} + pluto_actions=${t} + notebook_id=${n} + nbpkg=${r} + /> + `),side:1}).range(e.to)}}else{if("package_disabler"===e.type){return Ze.Decoration.widget({widget:new Bn(o.html` <${In} package_name=${e.name} /> `),side:1}).range(e.to)}if("implicit_using"===e.type&&"HypertextLiteral"===e.name){return Ze.Decoration.widget({widget:new Bn(o.html` +
+ : @htl, @htl_str +
+
`),side:1}).range(e.to)}}}))})).filter((e=>null!=e));return Ze.Decoration.set(i,!0)}const Un=Ze.Facet.define({combine:e=>e[0],compare:le.default.isEqual}),Fn=({pluto_actions:e,notebook_id:t})=>Ze.ViewPlugin.fromClass(class{update_decos(n){const r=Pn(n,{pluto_actions:e,notebook_id:t,nbpkg:n.state.facet(Un)});this.decorations=r}constructor(e){this.update_decos(e)}update(e){(e.docChanged||e.viewportChanged||e.state.facet(Un)!==e.startState.facet(Un))&&this.update_decos(e.view)}},{decorations:e=>e.decorations,eventHandlers:{pointerdown:(e,t)=>{e.target}}});le=a("9lAXI"),Ze=a("61LLQ"),o=a("fBBKY");const zn=Ze.StateEffect.define({}),qn=Ze.StateField.define({create:()=>({defaultCharacterWidth:null,measuredSpaceWidth:null,measuredTabWidth:null}),update(e,t){for(let e of t.effects)if(e.is(zn))return e.value;return e}});let Kn=Ze.EditorView.updateListener.of((e=>{let t=e.view.defaultCharacterWidth,{defaultCharacterWidth:n,measuredSpaceWidth:r}=e.view.state.field(qn,!1);if(n!==t){let n,r;e.view.dispatch({effects:[zn.of({defaultCharacterWidth:t,measuredSpaceWidth:n,measuredTabWidth:r})]})}})),Hn=Ze.StateField.define({create:()=>Ze.Decoration.none,update(e,t){let n=t.startState.field(qn,!1),r=n.measuredSpaceWidth??n.defaultCharacterWidth,{measuredSpaceWidth:a,defaultCharacterWidth:i}=t.state.field(qn,!1),s=a??i;if(null==s)return Ze.Decoration.none;if(!t.docChanged&&e!==Ze.Decoration.none&&r===s)return e;let l=[];for(let e of le.default.range(0,t.state.doc.lines)){let n=t.state.doc.line(e+1);if(0===n.length)continue;let r=0;for(let e of n.text){if("\t"!==e)break;r++}const a=Math.min(r,12),i=4*a*s,c=Ze.Decoration.line({attributes:{style:`--indented: ${i}px;`,class:"awesome-wrapping-plugin-the-line"}});if(l.push(c.range(n.from,n.from)),0!==a&&l.push(Ze.Decoration.mark({class:"awesome-wrapping-plugin-the-tabs"}).range(n.from,n.from+a)),r>a)for(let e of le.default.range(a,r))l.push(Ze.Decoration.replace({widget:new Bn(o.html``),block:!1}).range(n.from+e,n.from+e+1))}return Ze.Decoration.set(l)},provide:e=>Ze.EditorView.decorations.from(e)}),Wn=Ze.Decoration.mark({class:"indentation-so-dont-break"}),Gn=(Ze.StateField.define({create:()=>Ze.Decoration.none,update(e,t){let n=[];for(let e of t.newDoc)for(let t of e.matchAll(/[^ \t]+([ \t]|$)+/g))0!==t.index&&n.push(Wn.range(0+t.index,0+t.index+t[0].length));return Ze.Decoration.set(n,!0)},provide:e=>Ze.EditorView.decorations.from(e)}),[qn,Kn,Hn]);let Zn=(Ze=a("61LLQ")).autocomplete.autocompletion()[0],Vn=Ze.EditorView.domEventHandlers({keydown:(e,t)=>{let n=t.state.selection.main;if(!n.empty)return!1;if(!e.repeat)return!1;if("Backspace"===e.key&&0===t.state.doc.length)return!0;if("Delete"===e.key&&0===t.state.doc.length)return!0;let r=t.state.field(Zn,!1)?.open??!1;return"ArrowUp"!==e.key||r?"ArrowDown"!==e.key||r?"ArrowLeft"===e.key&&e.repeat?!!t.moveByChar(n,!1).eq(n):"ArrowRight"===e.key?!!t.moveByChar(n,!0).eq(n):void 0:!!t.moveVertically(t.state.selection.main,!0).eq(n):!!t.moveVertically(t.state.selection.main,!1).eq(n)}}),Qn=({focus_on_neighbor:e})=>(({focus_on_neighbor:e})=>Ze.keymap.of([{key:"PageUp",run:()=>(e({cell_delta:-1,line:0,character:0}),!0)},{key:"PageDown",run:()=>(e({cell_delta:1,line:0,character:0}),!0)},{key:"ArrowLeft",run:t=>{let n=t.state.selection.main;return!!n.empty&&!!t.moveByChar(n,!1).eq(n)&&(e({cell_delta:-1,line:1/0,character:1/0}),!0)}},{key:"ArrowUp",run:t=>{let n=t.state.selection.main;return!!n.empty&&!!t.moveVertically(n,!1).eq(n)&&(e({cell_delta:-1,line:1/0,character:1/0}),!0)}},{key:"ArrowRight",run:t=>{let n=t.state.selection.main;return!!n.empty&&!!t.moveByChar(n,!0).eq(n)&&(e({cell_delta:1,line:0,character:0}),!0)}},{key:"ArrowDown",run:t=>{let n=t.state.selection.main;return!!n.empty&&!!t.moveVertically(n,!0).eq(n)&&(e({cell_delta:1,line:0,character:0}),!0)}}]))({focus_on_neighbor:e});Ze=a("61LLQ");let Xn=({pluto_actions:e,cell_id:t})=>Ze.EditorView.domEventHandlers({paste:(n,r)=>{if(!r.hasFocus)return console.log("CodeMirror, why are you registring this paste? You aren't focused!"),!0;n.stopPropagation();const a=n.clipboardData.getData("text/plain"),o=_e(a,!1);return null!=o&&(0===r.state.selection.main.from&&r.state.selection.main.to===r.state.doc.length?(e.add_deserialized_cells(a,t,o),e.confirm_delete_multiple("This Should Never Be Visible",[t]),!0):(r.state.selection.main.to===r.state.doc.length||0===r.state.selection.main.from)&&(e.add_deserialized_cells(a,t,o),!0))}});Ze=a("61LLQ"),Ze=a("61LLQ"),Ze=a("61LLQ");const Yn=(Ze=a("61LLQ")).EditorView.baseTheme({".cm-matchingBracket":{backgroundColor:"#328c8252"},".cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Jn=Ze.Facet.define({combine:e=>Ze.combineConfig(e,{afterCursor:!0,brackets:"()[]{}",maxScanDistance:1e4})}),er=Ze.Decoration.mark({class:"cm-matchingBracket"}),tr=(Ze.Decoration.mark({class:"cm-nonmatchingBracket"}),[Ze.StateField.define({create:()=>Ze.Decoration.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(Jn);for(let e of t.state.selection.ranges){if(!e.empty)continue;let a=rr(t.state,e.head,-1,r)||e.head>0&&rr(t.state,e.head-1,1,r)||r.afterCursor&&(rr(t.state,e.head,1,r)||e.headZe.EditorView.decorations.from(e)}),Yn]);function nr(e={}){return[Jn.of(e),tr]}function rr(e,t,n,r={}){let a=r.maxScanDistance||1e4,o=r.brackets||"()[]{}",i=Ze.syntaxTree(e),s=i.resolveInner(t,n),l=function(e){if("end"===e.name&&(e=e.parent.firstChild),"mutable"===e.name||"struct"===e.name){"struct"===e.name&&(e=e.parent.firstChild);let t=e.parent.getChild("struct"),n=e.parent.lastChild;return"end"===n.name&&t?[{from:e.from,to:t.to},{from:n.from,to:n.to}]:null}if("struct"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("quote"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("begin"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("do"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("for"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("let"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("macro"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("function"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("while"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("type"===e.name&&(e=e.parent.firstChild),"abstract"===e.name||"primitive"===e.name){let t=e.parent.lastChild,n="end"===t.name,r=e.parent.getChild("type");return n&&r?[{from:e.from,to:r.to},{from:t.from,to:t.to}]:null}if("try"===e.name||"catch"===e.name||"finally"===e.name){"catch"===e.name&&(e=e.parent),"finally"===e.name&&(e=e.parent);let t=e.parent.firstChild,n=e.parent.lastChild;if("end"!==n.name)return null;let r=e.parent.getChild("CatchClause")?.firstChild,a=e.parent.getChild("FinallyClause")?.firstChild;return[{from:t.from,to:t.to},r&&{from:r.from,to:r.to},a&&{from:a.from,to:a.to},{from:n.from,to:n.to}].filter((e=>null!=e))}if("if"===e.name||"else"===e.name||"elseif"===e.name){"else"===e.name&&(e=e.parent);let t=e.parent.firstChild,n=e.parent.lastChild;if("end"!==n.name)return null;let r=[];r.push({from:t.from,to:t.to});for(let t of e.parent.getChildren("ElseClause")){let e=t.firstChild;r.push({from:e.from,to:e.to})}for(let t of e.parent.getChildren("elseif"))r.push({from:t.from,to:t.to});return r.push({from:n.from,to:n.to}),r}return null}(s);return l||function(e,t,n,r,a,o,i){let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=i.indexOf(s);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),u=0;for(let e=0;!d.next().done&&e<=o;){let o=d.value;n<0&&(e+=o.length);let s=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=i.indexOf(o[e]);if(!(t<0||r.resolve(s+e,1).type!=a))if(t%2==0==n>0)u++;else{if(1==u)return t>>1==l>>1?[c,{from:s+e,to:s+e+1}]:null;u--}}n>0&&(e+=o.length)}return d.done?[c]:null}(e,t,n,i,s.type,a,o)}ye=a("inK2Y");(Ze=a("61LLQ")).Decoration.line({attributes:{class:"cm-highlighted-line"}});const ar=Ze.Facet.define({combine:e=>e[0],compare:(e,t)=>e===t});Ze=a("61LLQ");function or(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let a=e(t,n.selection.ranges,n);return!!a&&(r(n.update(a)),!0)}}const ir=or(ur,0),sr=(or(ur,1),or(ur,2),or(dr,0)),lr=(or(dr,1),or(dr,2),[{key:"Mod-/",run:e=>{let t=cr(e.state);return t.line?ir(e):!!t.block&&sr(e)}},{key:"Alt-A",run:sr}]);function cr(e,t=e.selection.main.head){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function dr(e,t,n){let r=t.map((e=>cr(n,e.from).block));if(!r.every((e=>e)))return null;let a=t.map(((e,t)=>function(e,{open:t,close:n},r,a){let o,i,s=e.sliceDoc(r-50,r),l=e.sliceDoc(a,a+50),c=/\s*$/.exec(s)[0].length,d=/^\s*/.exec(l)[0].length,u=s.length-c;if(s.slice(u-t.length,u)==t&&l.slice(d,d+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:a+d,margin:d&&1}};a-r<=100?o=i=e.sliceDoc(r,a):(o=e.sliceDoc(r,r+50),i=e.sliceDoc(a-50,a));let p=/^\s*/.exec(o)[0].length,m=/\s*$/.exec(i)[0].length,g=i.length-m-n.length;return o.slice(p,p+t.length)==t&&i.slice(g,g+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(o.charAt(p+t.length))?1:0},close:{pos:a-m-n.length,margin:/\s/.test(i.charAt(g-1))?1:0}}:null}(n,r[t],e.from,e.to)));if(2!=e&&!a.every((e=>e))){let e=0;return n.changeByRange((t=>{let{open:n,close:o}=r[e++];if(a[e])return{range:t};let i=n.length+1;return{changes:[{from:t.from,insert:n+" "},{from:t.to,insert:" "+o}],range:Ze.EditorSelection.range(t.anchor+i,t.head+i)}}))}if(1!=e&&a.some((e=>e))){let e=[];for(let t,n=0;na&&(e==o||o>s.from)){a=s.from;let e=i??cr(n,t).line;if(!e)continue;let o=/^\s*/.exec(s.text)[0].length,c=o==s.length,d=s.text.slice(o,o+e.length)==e?o:-1;oe.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:n,indent:a,empty:o,single:i}of r)!i&&o||e.push({from:t.from+a,insert:n+" "});let t=n.changes(e);return{changes:t,selection:n.selection.map(t,1)}}if(1!=e&&r.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:n,token:a}of r)if(n>=0){let r=t.from+n,o=r+a.length;" "==t.text[o-t.from]&&o++,e.push({from:r,to:o})}return{changes:e}}return null}Ze=a("61LLQ");Ze.EditorView.updateListener.of((e=>{if(e.docChanged||e.selectionSet||Ze.syntaxTree(e.state)!==Ze.syntaxTree(e.startState))if(Ze.syntaxTreeAvailable(e.state)){let n=e.state;console.group("Selection");try{console.groupCollapsed("Lezer tree");try{console.log(Ze.syntaxTree(n).toString())}finally{console.groupEnd()}console.groupCollapsed("Document text");try{console.log(e.state.doc.sliceString(0,e.state.doc.length))}finally{console.groupEnd()}console.group("Lezer errors");try{t=e.state.doc,Lt({tree:Ze.syntaxTree(n),enter:e=>{if(e.type.isError){console.group(`Found error node in ${e.node.parent.name}`);try{let n=t.sliceString(e.from-10,e.from),r=t.sliceString(e.from,e.to),a=t.sliceString(e.to,e.to+10);""===r?(console.log(`${n}⚠${a}`),console.log(`${" ".repeat(n.length)}^$${" ".repeat(a.length)}`)):(console.log(`${n}${r}${a}`),console.log(`${" ".repeat(n.length)}${"^".repeat(r.length)}$${" ".repeat(a.length)}`))}finally{console.groupEnd()}return!1}},leave:()=>{}})}finally{console.groupEnd()}}finally{console.groupEnd()}}else console.log("⚠️ Full syntax tree not available");var t}));const pr=Ze.HighlightStyle.define([{tag:Ze.tags.propertyName,color:"var(--cm-property-color)"},{tag:Ze.tags.unit,color:"var(--cm-tag-color)"},{tag:Ze.tags.literal,color:"var(--cm-builtin-color)",fontWeight:700},{tag:Ze.tags.macroName,color:"var(--cm-macro-color)",fontWeight:700},{tag:Ze.tags.standard(Ze.tags.variableName),color:"var(--cm-builtin-color)",fontWeight:700},{tag:Ze.tags.bool,color:"var(--cm-builtin-color)",fontWeight:700},{tag:Ze.tags.keyword,color:"var(--cm-keyword-color)"},{tag:Ze.tags.comment,color:"var(--cm-comment-color)",fontStyle:"italic"},{tag:Ze.tags.atom,color:"var(--cm-atom-color)"},{tag:Ze.tags.number,color:"var(--cm-number-color)"},{tag:Ze.tags.keyword,color:"var(--cm-keyword-color)"},{tag:Ze.tags.string,color:"var(--cm-string-color)"},{tag:Ze.tags.variableName,color:"var(--cm-var-color)",fontWeight:700},{tag:Ze.tags.typeName,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:Ze.tags.typeOperator,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:Ze.tags.bracket,color:"var(--cm-bracket-color)"},{tag:Ze.tags.brace,color:"var(--cm-bracket-color)"},{tag:Ze.tags.tagName,color:"var(--cm-tag-color)"},{tag:Ze.tags.link,color:"var(--cm-link-color)"},{tag:Ze.tags.invalid,color:"var(--cm-error-color)",background:"var(--cm-error-bg-color)"}],{all:{color:"var(--cm-editor-text-color)"},scope:Ze.julia_andrey().language.topNode}),mr=Ze.HighlightStyle.define([{tag:Ze.tags.propertyName,color:"var(--cm-property-color)"},{tag:Ze.tags.unit,color:"var(--cm-tag-color)"},{tag:Ze.tags.literal,color:"var(--cm-builtin-color)",fontWeight:700},{tag:Ze.tags.macroName,color:"var(--cm-macro-color)",fontWeight:700},{tag:Ze.tags.standard(Ze.tags.variableName),color:"var(--cm-builtin-color)",fontWeight:700},{tag:Ze.tags.bool,color:"var(--cm-builtin-color)",fontWeight:700},{tag:Ze.tags.keyword,color:"var(--cm-keyword-color)"},{tag:Ze.tags.atom,color:"var(--cm-atom-color)"},{tag:Ze.tags.number,color:"var(--cm-number-color)"},{tag:Ze.tags.keyword,color:"var(--cm-keyword-color)"},{tag:Ze.tags.string,color:"var(--cm-string-color)"},{tag:Ze.tags.variableName,color:"var(--cm-var-color)",fontWeight:700},{tag:Ze.tags.typeName,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:Ze.tags.typeOperator,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:Ze.tags.bracket,color:"var(--cm-bracket-color)"},{tag:Ze.tags.brace,color:"var(--cm-bracket-color)"},{tag:Ze.tags.tagName,color:"var(--cm-tag-color)"},{tag:Ze.tags.link,color:"var(--cm-link-color)"},{tag:Ze.tags.invalid,color:"var(--cm-error-color)",background:"var(--cm-error-bg-color)"},{tag:Ze.tags.comment,color:"var(--cm-comment-color)",fontStyle:"italic",filter:"none"}],{scope:Ze.javascriptLanguage.topNode,all:{color:"var(--cm-editor-text-color)",filter:"contrast(0.5)"}}),gr=Ze.HighlightStyle.define([{tag:Ze.tags.propertyName,color:"var(--cm-property-color)"},{tag:Ze.tags.unit,color:"var(--cm-tag-color)"},{tag:Ze.tags.literal,color:"var(--cm-builtin-color)",fontWeight:700},{tag:Ze.tags.macroName,color:"var(--cm-macro-color)",fontWeight:700},{tag:Ze.tags.standard(Ze.tags.variableName),color:"var(--cm-builtin-color)",fontWeight:700},{tag:Ze.tags.bool,color:"var(--cm-builtin-color)",fontWeight:700},{tag:Ze.tags.keyword,color:"var(--cm-keyword-color)"},{tag:Ze.tags.comment,color:"var(--cm-comment-color)",fontStyle:"italic"},{tag:Ze.tags.atom,color:"var(--cm-atom-color)"},{tag:Ze.tags.number,color:"var(--cm-number-color)"},{tag:Ze.tags.keyword,color:"var(--cm-keyword-color)"},{tag:Ze.tags.string,color:"var(--cm-string-color)"},{tag:Ze.tags.variableName,color:"var(--cm-var-color)",fontWeight:700},{tag:Ze.tags.typeName,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:Ze.tags.typeOperator,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:Ze.tags.bracket,color:"var(--cm-bracket-color)"},{tag:Ze.tags.brace,color:"var(--cm-bracket-color)"},{tag:Ze.tags.tagName,color:"var(--cm-tag-color)"},{tag:Ze.tags.link,color:"var(--cm-link-color)"},{tag:Ze.tags.invalid,color:"var(--cm-error-color)",background:"var(--cm-error-bg-color)"}],{scope:Ze.pythonLanguage.topNode,all:{color:"var(--cm-editor-text-color)",filter:"contrast(0.5)"}}),hr=Ze.HighlightStyle.define([{tag:Ze.tags.propertyName,color:"var(--cm-css-accent-color)",fontWeight:700},{tag:Ze.tags.variableName,color:"var(--cm-css-accent-color)",fontWeight:700},{tag:Ze.tags.definitionOperator,color:"var(--cm-css-color)"},{tag:Ze.tags.keyword,color:"var(--cm-css-color)"},{tag:Ze.tags.modifier,color:"var(--cm-css-accent-color)"},{tag:Ze.tags.punctuation,opacity:.5},{tag:Ze.tags.literal,color:"var(--cm-css-color)"},{tag:Ze.tags.tagName,color:"var(--cm-css-color)",fontWeight:700},{tag:Ze.tags.className,color:"var(--cm-css-why-doesnt-codemirror-highlight-all-the-text-aaa)"},{tag:Ze.tags.constant(Ze.tags.className),color:"var(--cm-css-why-doesnt-codemirror-highlight-all-the-text-aaa)"},{tag:Ze.tags.comment,color:"var(--cm-comment-color)",fontStyle:"italic"}],{all:{color:"var(--cm-css-color)"}}),fr=Ze.HighlightStyle.define([{tag:Ze.tags.tagName,color:"var(--cm-html-accent-color)",fontWeight:600},{tag:Ze.tags.attributeName,color:"var(--cm-html-accent-color)",fontWeight:600},{tag:Ze.tags.attributeValue,color:"var(--cm-html-accent-color)"},{tag:Ze.tags.angleBracket,color:"var(--cm-html-accent-color)",fontWeight:600},{tag:Ze.tags.content,color:"var(--cm-html-color)",fontWeight:400},{tag:Ze.tags.documentMeta,color:"var(--cm-html-accent-color)"},{tag:Ze.tags.comment,color:"var(--cm-comment-color)",fontStyle:"italic"}],{scope:Ze.htmlLanguage.topNode,all:{color:"var(--cm-html-color)"}}),_r=Ze.HighlightStyle.define([{tag:Ze.tags.content,color:"var(--cm-md-color)"},{tag:Ze.tags.quote,color:"var(--cm-md-color)"},{tag:Ze.tags.link,textDecoration:"underline"},{tag:Ze.tags.url,color:"var(--cm-md-color)",textDecoration:"none"},{tag:Ze.tags.emphasis,fontStyle:"italic"},{tag:Ze.tags.strong,fontWeight:"bolder"},{tag:Ze.tags.heading,color:"var(--cm-md-color)",fontWeight:700},{tag:Ze.tags.comment,color:"var(--cm-comment-color)",fontStyle:"italic"},{tag:Ze.tags.processingInstruction,color:"var(--cm-md-accent-color) !important",opacity:"0.5"},{tag:Ze.tags.monospace,color:"var(--cm-md-accent-color)"}],{scope:Ze.markdownLanguage.topNode,all:{color:"var(--cm-md-color)"}}),br=e=>e.state.doc.toString(),yr=(e,t)=>e.dispatch({changes:{from:0,to:e.state.doc.length,insert:t}}),vr=(e,t,n,r)=>e.dispatch({changes:{from:n,to:r,insert:t}});let wr=(e,t)=>{let n=o.useRef(new Ze.Compartment),r=o.useRef(n.current.of(t));return o.useLayoutEffect((()=>{e.current?.dispatch?.({effects:n.current.reconfigure(t)})}),[t]),r.current},kr=(e,{line:t,ch:n})=>{let r=e.line(le.default.clamp(t+1,1,e.lines)),a=le.default.clamp(n,0,r.length);return r.from+a};const Er=({local_code:e,remote_code:t,disable_input:n,focus_after_creation:r,cm_forced_focus:a,set_cm_forced_focus:i,show_input:s,on_submit:l,on_delete:c,on_add_after:d,on_change:u,on_update_doc_query:p,on_focus_neighbor:m,on_line_heights:g,nbpkg:h,cell_id:f,notebook_id:_,any_logs:b,show_logs:y,set_show_logs:v,cm_highlighted_line:w,metadata:k,global_definition_locations:E})=>{let $=o.useContext(ve);const{disabled:x}=k,S=o.useRef(null),N=o.useRef(null),C=o.useRef(null);o.useRef(null).current=u;let A=wr(S,Un.of(h)),O=wr(S,dn.of(E)),M=wr(S,ar.of(w)),R=wr(S,Ze.EditorState.readOnly.of(n)),T=wr(S,o.useMemo((()=>Ze.EditorView.updateListener.of((e=>{e.docChanged&&u(e.state.doc.toString())}))),[u]));return o.useLayoutEffect((()=>{const t=e=>((async e=>{await e()})((async()=>{await d();e.state.doc.toString()!==C.current&&l()})),!0);let n=Ze.autocomplete.completionKeymap.find((e=>"Enter"===e.key));const a=()=>{const e=S.current,t=br(e),n=t.trim(),r=t.length-t.trimStart().length;if(console.table({value:t,trimmed:n,offset:r}),n.startsWith('md"')&&n.endsWith('"')){let t,a;if(n.startsWith('md"""')&&n.endsWith('"""')?(t=5,a=n.length-3):(t=3,a=n.length-1),t>=a||""==n.substring(t,a).trim())yr(e,"");else{for(;/\s/.test(n[t]);)++t;for(;/\s/.test(n[a-1]);)--a;vr(e,"",a+r,e.state.doc.length),vr(e,"",0,t+r)}}else{let t='md"""\n',n='\n"""',r=e.state.selection.main;e.dispatch({changes:[{from:0,to:0,insert:t},{from:e.state.doc.length,to:e.state.doc.length,insert:n}],selection:0===r.from?{anchor:r.from+t.length,head:r.to+t.length}:void 0})}return!0},o=e=>!e.state.facet(Ze.EditorState.readOnly)&&(0===e.state.doc.length?(m(f,1),c(),!0):void 0),s=e=>{if(!e.state.facet(Ze.EditorState.readOnly))return 0===e.state.doc.length?(m(f,-1,1/0,1/0),c(),!0):void 0},u=[{key:"Shift-Enter",run:()=>(l(),!0)},{key:"Ctrl-Enter",mac:"Cmd-Enter",run:t},{key:"Ctrl-Enter",run:t},{key:"Tab",run:e=>{if(n.run(e))return!0;let t=e.state.selection.main;return t.empty?(e.dispatch({changes:{from:t.from,to:t.to,insert:"\t"},selection:Ze.EditorSelection.cursor(t.from+1)}),!0):Ze.indentMore(e)},shift:Ze.indentLess},{key:"Ctrl-m",mac:"Cmd-m",run:a},{key:"Ctrl-m",run:a},{key:"Ctrl-M",run:a},{key:"Delete",run:o},{key:"Ctrl-Delete",run:o},{key:"Backspace",run:s},{key:"Ctrl-Backspace",run:s}];let h=!1;const b=Ze.EditorView.updateListener.of((e=>{if(e.view.hasFocus&&(e.docChanged||e.selectionSet)){let t=e.state;try{let e=ln(t,h);null!=e&&p(e)}finally{}}}));window.tags=Ze.tags;const y=window.matchMedia("(prefers-color-scheme: dark)").matches,v=S.current=new Ze.EditorView({state:Ze.EditorState.create({doc:e,extensions:[Ze.EditorView.theme({},{dark:y}),A,M,O,R,Vn,Fn({pluto_actions:$,notebook_id:_}),nn,pr,fr,_r,mr,gr,hr,Ze.lineNumbers(),Ze.highlightSpecialChars(),Ze.history(),Ze.drawSelection(),Ze.EditorState.allowMultipleSelections.of(!0),Ze.EditorView.clickAddsSelectionRange.of((e=>e.altKey&&!e.shiftKey)),Ze.indentOnInput(),Ze.defaultHighlightStyle.fallback,Ze.EditorState.languageData.of(((e,t,n)=>[{closeBrackets:{brackets:["(","[","{"]}}])),Ze.closeBrackets(),Ze.rectangularSelection({eventFilter:e=>e.altKey&&e.shiftKey&&0==e.button}),Ze.highlightSelectionMatches(),nr(),b,Ze.EditorView.domEventHandlers({blur:(e,t)=>{t.dispatch({selection:{anchor:t.state.selection.main.head,head:t.state.selection.main.head}}),i(null)}}),Xn({pluto_actions:$,cell_id:f}),Ze.EditorView.updateListener.of((e=>{e.docChanged&&e.state.doc.length>0&&"?"===e.state.sliceDoc(0,1)&&window.dispatchEvent(new CustomEvent("open_live_docs"))})),Ze.EditorState.tabSize.of(4),Ze.indentUnit.of("\t"),Ze.julia_andrey(),un,Rn({request_autocomplete:async({text:e})=>{let{message:t}=await $.send("complete",{query:e},{notebook_id:_});return{start:Ve.utf8index_to_ut16index(e,t.start),stop:Ve.utf8index_to_ut16index(e,t.stop),results:t.results}},on_update_doc_query:p}),Ze.keymap.of(u),Qn({focus_on_neighbor:({cell_delta:e,line:t,character:n})=>m(f,e,t,n)}),Ze.keymap.of([...Ze.closeBracketsKeymap,...Ze.defaultKeymap,...Ze.historyKeymap,...Ze.foldKeymap,...lr]),Ze.placeholder("Enter cell code..."),Ze.EditorView.lineWrapping,Gn,T]}),parent:N.current});v.dom.CodeMirror={getValue:()=>br(v),setValue:e=>yr(v,e)},r&&setTimeout((()=>{let e=S.current;e.dom.scrollIntoView({behavior:"smooth",block:"nearest"}),e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}}),e.focus()}));const w=N.current.querySelector("div.cm-content"),k=new ResizeObserver((()=>{const e=w.children,t=le.default.map(e,(e=>e.offsetTop)),n=[...t.slice(1).map(((e,n)=>e-t[n])),15];g(n)}));return k.observe(w),()=>{k.unobserve(w)}}),[]),o.useEffect((()=>{if(null==S.current)return;const e=br(S.current)??"";null==C.current&&""===t&&""!==e||(C.current=t,e!==t&&yr(S.current,t))}),[t]),o.useEffect((()=>{const e=S.current;if(null==a)e.dispatch({selection:{anchor:e.state.selection.main.head,head:e.state.selection.main.head}});else{let t={anchor:kr(e.state.doc,a[0]),head:kr(e.state.doc,a[1])};if(a[2]?.definition_of){let n=e.state.field(nn)?.definitions.get(a[2]?.definition_of);n&&(t={anchor:n.from,head:n.to})}e.dom.scrollIntoView({behavior:"smooth",block:"nearest"}),S.current.focus(),S.current.dispatch({scrollIntoView:!0,selection:t,effects:[Ze.EditorView.scrollIntoView(Ze.EditorSelection.range(t.anchor,t.head),{yMargin:80})]})}}),[a]),o.html` + + <${$r} + on_delete=${c} + cell_id=${f} + run_cell=${l} + running_disabled=${x} + any_logs=${b} + show_logs=${y} + set_show_logs=${v} + /> + + `},$r=({on_delete:e,cell_id:t,run_cell:n,running_disabled:r,any_logs:a,show_logs:i,set_show_logs:s})=>{const l=o.useRef(null);let c=o.useContext(ve);const[d,u]=o.useState(!1);return o.html` `};o=a("fBBKY"); +/*! + Highlight.js v11.4.0 (git: 2d0e7c1094) + (c) 2006-2022 Ivan Sagalaev and other contributors + License: BSD-3-Clause + */var xr={exports:{}};function Sr(e){return e instanceof Map?e.clear=e.delete=e.set=()=>{throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{throw Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{var n=e[t];"object"!=typeof n||Object.isFrozen(n)||Sr(n)})),e}xr.exports=Sr,xr.exports.default=Sr;var Nr=xr.exports;class Cr{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Ar(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Or(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const Mr=e=>!!e.kind;class Rr{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Ar(e)}openNode(e){if(!Mr(e))return;let t=e.kind;t=e.sublanguage?"language-"+t:((e,{prefix:t})=>{if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(t,{prefix:this.classPrefix}),this.span(t)}closeNode(e){Mr(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}class Tr{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{Tr._collapse(e)})))}}class Lr extends Tr{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new Rr(this,this.options).value()}finalize(){return!0}}function Dr(e){return e?"string"==typeof e?e:e.source:null}function Ir(e){return Pr("(?=",e,")")}function Br(e){return Pr("(?:",e,")*")}function jr(e){return Pr("(?:",e,")?")}function Pr(...e){return e.map((e=>Dr(e))).join("")}function Ur(...e){const t=(e=>{const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}})(e);return"("+(t.capture?"":"?:")+e.map((e=>Dr(e))).join("|")+")"}function Fr(e){return RegExp(e.toString()+"|").exec("").length-1}const zr=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function qr(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n;let r=Dr(e),a="";for(;r.length>0;){const e=zr.exec(r);if(!e){a+=r;break}a+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?a+="\\"+(Number(e[1])+t):(a+=e[0],"("===e[0]&&n++)}return a})).map((e=>`(${e})`)).join(t)}const Kr={begin:"\\\\[\\s\\S]",relevance:0},Hr={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Kr]},Wr={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Kr]},Gr=(e,t,n={})=>{const r=Or({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=Ur("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Pr(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Zr=Gr("//","$"),Vr=Gr("/\\*","\\*/"),Qr=Gr("#","$");var Xr=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:"(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Pr(t,/.*\b/,e.binary,/\b.*/)),Or({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:Kr,APOS_STRING_MODE:Hr,QUOTE_STRING_MODE:Wr,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:Gr,C_LINE_COMMENT_MODE:Zr,C_BLOCK_COMMENT_MODE:Vr,HASH_COMMENT_MODE:Qr,NUMBER_MODE:{scope:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C_NUMBER_MODE:{scope:"number",begin:"(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:"\\b(0b[01]+)",relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Kr,{begin:/\[/,end:/\]/,relevance:0,contains:[Kr]}]}]},TITLE_MODE:{scope:"title",begin:"[a-zA-Z]\\w*",relevance:0},UNDERSCORE_TITLE_MODE:{scope:"title",begin:"[a-zA-Z_]\\w*",relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function Yr(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function Jr(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function ea(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Yr,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function ta(e,t){Array.isArray(e.illegal)&&(e.illegal=Ur(...e.illegal))}function na(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function ra(e,t){void 0===e.relevance&&(e.relevance=1)}const aa=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=n.keywords,e.begin=Pr(n.beforeMatch,Ir(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},oa=["of","and","for","in","not","or","if","then","parent","list","value"];function ia(e,t,n="keyword"){const r=Object.create(null);function a(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|");r[n[0]]=[e,sa(n[0],n[1])]}))}return"string"==typeof e?a(n,e.split(" ")):Array.isArray(e)?a(n,e):Object.keys(e).forEach((n=>{Object.assign(r,ia(e[n],t,n))})),r}function sa(e,t){return t?Number(t):(e=>oa.includes(e.toLowerCase()))(e)?0:1}const la={},ca=e=>{console.error(e)},da=(e,...t)=>{console.log("WARN: "+e,...t)},ua=(e,t)=>{la[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),la[`${e}/${t}`]=!0)},pa=Error();function ma(e,t,{key:n}){let r=0;const a=e[n],o={},i={};for(let e=1;e<=t.length;e++)i[e+r]=a[e],o[e+r]=!0,r+=Fr(t[e-1]);e[n]=i,e[n]._emit=o,e[n]._multi=!0}function ga(e){(e=>{e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),(e=>{if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ca("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),pa;if("object"!=typeof e.beginScope||null===e.beginScope)throw ca("beginScope must be object"),pa;ma(e,e.begin,{key:"beginScope"}),e.begin=qr(e.begin,{joinWith:""})}})(e),(e=>{if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ca("skip, excludeEnd, returnEnd not compatible with endScope: {}"),pa;if("object"!=typeof e.endScope||null===e.endScope)throw ca("endScope must be object"),pa;ma(e,e.end,{key:"endScope"}),e.end=qr(e.end,{joinWith:""})}})(e)}function ha(e){function t(t,n){return RegExp(Dr(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=Fr(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(qr(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Or(e.classNameAliases||{}),function n(a,o){const i=a;if(a.isCompiled)return i;[Jr,na,ga,aa].forEach((e=>e(a,o))),e.compilerExtensions.forEach((e=>e(a,o))),a.__beforeBegin=null,[ea,ta,ra].forEach((e=>e(a,o))),a.isCompiled=!0;let s=null;return"object"==typeof a.keywords&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),s=a.keywords.$pattern,delete a.keywords.$pattern),s=s||/\w+/,a.keywords&&(a.keywords=ia(a.keywords,e.case_insensitive)),i.keywordPatternRe=t(s,!0),o&&(a.begin||(a.begin=/\B|\b/),i.beginRe=t(i.begin),a.end||a.endsWithParent||(a.end=/\B|\b/),a.end&&(i.endRe=t(i.end)),i.terminatorEnd=Dr(i.end)||"",a.endsWithParent&&o.terminatorEnd&&(i.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(i.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>Or(e,{variants:null},t)))),e.cachedVariants?e.cachedVariants:fa(e)?Or(e,{starts:e.starts?Or(e.starts):null}):Object.isFrozen(e)?Or(e):e))("self"===e?a:e)))),a.contains.forEach((e=>{n(e,i)})),a.starts&&n(a.starts,o),i.matcher=(e=>{const t=new r;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(i),i}(e)}function fa(e){return!!e&&(e.endsWithParent||fa(e.starts))}class _a extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const ba=Ar,ya=Or,va=Symbol("nomatch");var wa=(e=>{const t=Object.create(null),n=Object.create(null),r=[];let a=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Lr};function l(e){return s.noHighlightRe.test(e)}function c(e,t,n){let r="",a="";"object"==typeof t?(r=e,n=t.ignoreIllegals,a=t.language):(ua("10.7.0","highlight(lang, code, ...args) has been deprecated."),ua("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),a=e,r=t),void 0===n&&(n=!0);const o={code:r,language:a};b("before:highlight",o);const i=o.result?o.result:d(o.language,o.code,n);return i.code=o.code,b("after:highlight",i),i}function d(e,n,r,i){const l=Object.create(null);function c(){if(!$.keywords)return void S.addText(N);let e=0;$.keywordPatternRe.lastIndex=0;let t=$.keywordPatternRe.exec(N),n="";for(;t;){n+=N.substring(e,t.index);const a=w.case_insensitive?t[0].toLowerCase():t[0],o=(r=a,$.keywords[r]);if(o){const[e,r]=o;if(S.addText(n),n="",l[a]=(l[a]||0)+1,l[a]<=7&&(C+=r),e.startsWith("_"))n+=t[0];else{const n=w.classNameAliases[e]||e;S.addKeyword(t[0],n)}}else n+=t[0];e=$.keywordPatternRe.lastIndex,t=$.keywordPatternRe.exec(N)}var r;n+=N.substr(e),S.addText(n)}function p(){null!=$.subLanguage?(()=>{if(""===N)return;let e=null;if("string"==typeof $.subLanguage){if(!t[$.subLanguage])return void S.addText(N);e=d($.subLanguage,N,!0,x[$.subLanguage]),x[$.subLanguage]=e._top}else e=u(N,$.subLanguage.length?$.subLanguage:null);$.relevance>0&&(C+=e.relevance),S.addSublanguage(e._emitter,e.language)})():c(),N=""}function m(e,t){let n=1;for(;void 0!==t[n];){if(!e._emit[n]){n++;continue}const r=w.classNameAliases[e[n]]||e[n],a=t[n];r?S.addKeyword(a,r):(N=a,c(),N=""),n++}}function g(e,t){return e.scope&&"string"==typeof e.scope&&S.openNode(w.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(S.addKeyword(N,w.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),N=""):e.beginScope._multi&&(m(e.beginScope,t),N="")),$=Object.create(e,{parent:{value:$}}),$}function f(e,t,n){let r=((e,t)=>{const n=e&&e.exec(t);return n&&0===n.index})(e.endRe,n);if(r){if(e["on:end"]){const n=new Cr(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return f(e.parent,t,n)}function _(e){return 0===$.matcher.regexIndex?(N+=e[0],1):(M=!0,0)}function b(e){const t=e[0],r=n.substr(e.index),a=f($,e,r);if(!a)return va;const o=$;$.endScope&&$.endScope._wrap?(p(),S.addKeyword(t,$.endScope._wrap)):$.endScope&&$.endScope._multi?(p(),m($.endScope,e)):o.skip?N+=t:(o.returnEnd||o.excludeEnd||(N+=t),p(),o.excludeEnd&&(N=t));do{$.scope&&S.closeNode(),$.skip||$.subLanguage||(C+=$.relevance),$=$.parent}while($!==a.parent);return a.starts&&g(a.starts,e),o.returnEnd?0:t.length}let y={};function v(t,o){const i=o&&o[0];if(N+=t,null==i)return p(),0;if("begin"===y.type&&"end"===o.type&&y.index===o.index&&""===i){if(N+=n.slice(o.index,o.index+1),!a){const t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=y.rule,t}return 1}if(y=o,"begin"===o.type)return(e=>{const t=e[0],n=e.rule,r=new Cr(n),a=[n.__beforeBegin,n["on:begin"]];for(const n of a)if(n&&(n(e,r),r.isMatchIgnored))return _(t);return n.skip?N+=t:(n.excludeBegin&&(N+=t),p(),n.returnBegin||n.excludeBegin||(N=t)),g(n,e),n.returnBegin?0:t.length})(o);if("illegal"===o.type&&!r){const e=Error('Illegal lexeme "'+i+'" for mode "'+($.scope||"")+'"');throw e.mode=$,e}if("end"===o.type){const e=b(o);if(e!==va)return e}if("illegal"===o.type&&""===i)return 1;if(O>1e5&&O>3*o.index)throw Error("potential infinite loop, way more iterations than matches");return N+=i,i.length}const w=h(e);if(!w)throw ca(o.replace("{}",e)),Error('Unknown language: "'+e+'"');const k=ha(w);let E="",$=i||k;const x={},S=new s.__emitter(s);(()=>{const e=[];for(let t=$;t!==w;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>S.openNode(e)))})();let N="",C=0,A=0,O=0,M=!1;try{for($.matcher.considerAll();;){O++,M?M=!1:$.matcher.considerAll(),$.matcher.lastIndex=A;const e=$.matcher.exec(n);if(!e)break;const t=v(n.substring(A,e.index),e);A=e.index+t}return v(n.substr(A)),S.closeAllNodes(),S.finalize(),E=S.toHTML(),{language:e,value:E,relevance:C,illegal:!1,_emitter:S,_top:$}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:ba(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:A,context:n.slice(A-100,A+100),mode:t.mode,resultSoFar:E},_emitter:S};if(a)return{language:e,value:ba(n),illegal:!1,relevance:0,errorRaised:t,_emitter:S,_top:$};throw t}}function u(e,n){n=n||s.languages||Object.keys(t);const r=(e=>{const t={value:ba(e),illegal:!1,relevance:0,_top:i,_emitter:new s.__emitter(s)};return t._emitter.addText(e),t})(e),a=n.filter(h).filter(_).map((t=>d(t,e,!1)));a.unshift(r);const o=a.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(h(e.language).supersetOf===t.language)return 1;if(h(t.language).supersetOf===e.language)return-1}return 0})),[l,c]=o,u=l;return u.secondBest=c,u}function p(e){let t=null;const r=(e=>{let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=s.languageDetectRe.exec(t);if(n){const t=h(n[1]);return t||(da(o.replace("{}",n[1])),da("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>l(e)||h(e)))})(e);if(l(r))return;if(b("before:highlightElement",{el:e,language:r}),e.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),s.throwUnescapedHTML))throw new _a("One of your code blocks includes unescaped HTML.",e.innerHTML);t=e;const a=t.textContent,i=r?c(a,{language:r,ignoreIllegals:!0}):u(a);e.innerHTML=i.value,((e,t,r)=>{const a=t&&n[t]||r;e.classList.add("hljs"),e.classList.add("language-"+a)})(e,r,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),b("after:highlightElement",{el:e,result:i,text:a})}let m=!1;function g(){"loading"!==document.readyState?document.querySelectorAll(s.cssSelector).forEach(p):m=!0}function h(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function f(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{n[e.toLowerCase()]=t}))}function _(e){const t=h(e);return t&&!t.disableAutodetect}function b(e,t){const n=e;r.forEach((e=>{e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{m&&g()}),!1),Object.assign(e,{highlight:c,highlightAuto:u,highlightAll:g,highlightElement:p,highlightBlock:e=>(ua("10.7.0","highlightBlock will be removed entirely in v12.0"),ua("10.7.0","Please use highlightElement now."),p(e)),configure:e=>{s=ya(s,e)},initHighlighting:()=>{g(),ua("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:()=>{g(),ua("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:(n,r)=>{let o=null;try{o=r(e)}catch(e){if(ca("Language definition for '{}' could not be registered.".replace("{}",n)),!a)throw e;ca(e),o=i}o.name||(o.name=n),t[n]=o,o.rawDefinition=r.bind(null,e),o.aliases&&f(o.aliases,{languageName:n})},unregisterLanguage:e=>{delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:()=>Object.keys(t),getLanguage:h,registerAliases:f,autoDetection:_,inherit:ya,addPlugin:e=>{(e=>{e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),r.push(e)}}),e.debugMode=()=>{a=!1},e.safeMode=()=>{a=!0},e.versionString="11.4.0",e.regex={concat:Pr,lookahead:Ir,either:Ur,optional:jr,anyNumberOfTimes:Br};for(const e in Xr)"object"==typeof Xr[e]&&Nr(Xr[e]);return Object.assign(e,Xr),e})({});const ka=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),Ea=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],$a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],xa=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Sa=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Na=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-height","max-width","min-height","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),Ca=xa.concat(Sa);var Aa={className:"number",variants:[{begin:"(\\b([0-9](_*[0-9])*)((\\.([0-9](_*[0-9])*))|\\.)?|(\\.([0-9](_*[0-9])*)))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b"},{begin:"\\b([0-9](_*[0-9])*)((\\.([0-9](_*[0-9])*))[fFdD]?\\b|\\.([fFdD]\\b)?)"},{begin:"(\\.([0-9](_*[0-9])*))[fFdD]?\\b"},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{begin:"\\b0[xX](([0-9a-fA-F](_*[0-9a-fA-F])*)\\.?|([0-9a-fA-F](_*[0-9a-fA-F])*)?\\.([0-9a-fA-F](_*[0-9a-fA-F])*))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b"},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:"\\b0[xX]([0-9a-fA-F](_*[0-9a-fA-F])*)[lL]?\\b"},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Oa(e,t,n){return-1===n?"":e.replace(t,(r=>Oa(e,t,n-1)))}const Ma=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Ra=["true","false","null","undefined","NaN","Infinity"],Ta=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],La=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Da=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ia=["arguments","this","super","console","window","document","localStorage","module","global"],Ba=[].concat(Da,Ta,La);function ja(e){const t=e.regex,n="[A-Za-z$_][0-9A-Za-z$_]*",r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let a;">"===r&&(((e,{after:t})=>{const n="",x={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead($)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[f]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:h,CLASS_REFERENCE:b},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,d,u,p,s,b,{className:"attr",begin:n+t.lookahead(":"),relevance:0},x,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,e.REGEXP_MODE,{className:"function",begin:$,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:h}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:""},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},y,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[f,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[f]},v,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},_,E,{match:/\$[(.]/}]}}const Pa=e=>Pr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Ua=["Protocol","Type"].map(Pa),Fa=["init","self"].map(Pa),za=["Any","Self"],qa=["actor","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Ka=["false","nil","true"],Ha=["assignment","associativity","higherThan","left","lowerThan","none","right"],Wa=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],Ga=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Za=Ur(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Va=Ur(Za,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Qa=Pr(Za,Va,"*"),Xa=Ur(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Ya=Ur(Xa,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ja=Pr(Xa,Ya,"*"),eo=Pr(/[A-Z]/,Ya,"*"),to=["autoclosure",Pr(/convention\(/,Ur("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Pr(/objc\(/,Ja,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],no=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];var ro=Object.freeze({__proto__:null,grmr_bash:e=>{const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},i={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(i);const s={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),c,s,e.HASH_COMMENT_MODE,o,{match:/(\/[a-z._-]+)+/},i,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},n]}},grmr_c:e=>{const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="[a-zA-Z_]\\w*::",a="(decltype\\(auto\\)|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},i={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(i,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",u={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},p=[l,o,n,e.C_BLOCK_COMMENT_MODE,s,i],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:u,contains:p.concat([{begin:/\(/,end:/\)/,keywords:u,contains:p.concat(["self"]),relevance:0}]),relevance:0},g={begin:"("+a+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:u,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(c,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,i,s,o,{begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,i,s,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C",aliases:["h"],keywords:u,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:i,keywords:u}}},grmr_cpp:e=>{const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="[a-zA-Z_]\\w*::",a="(?!struct)(decltype\\(auto\\)|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},i={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(i,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",u={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},p={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},m=[p,l,o,n,e.C_BLOCK_COMMENT_MODE,s,i],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:u,contains:m.concat([{begin:/\(/,end:/\)/,keywords:u,contains:m.concat(["self"]),relevance:0}]),relevance:0},h={className:"function",begin:"("+a+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:u,relevance:0},{begin:d,returnBegin:!0,contains:[c],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[i,s]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,i,s,o,{begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,i,s,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:u,illegal:"",keywords:u,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:u},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}},grmr_csharp:e=>{const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),r={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},a={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},o=e.inherit(a,{illegal:/\n/}),i={className:"subst",begin:/\{/,end:/\}/,keywords:t},s=e.inherit(i,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,s]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},i]},d=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]});i.contains=[c,l,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE],s.contains=[d,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const u={variants:[c,l,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},m=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",g={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},u,r,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+m+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial",relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,p],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[u,r,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},g]}},grmr_css:e=>{const t=e.regex,n=ka(e),r=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+xa.join("|")+")"},{begin:":(:)?("+Sa.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Na.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...r,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:$a.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ea.join("|")+")\\b"}]}},grmr_diff:e=>{const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}},grmr_go:e=>{const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"{const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const a={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},i={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},s={begin:/\[/,end:/\]/,contains:[r,o,a,i,n,"self"],relevance:0},l=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:t.concat(l,"(\\s*\\.\\s*",l,")*",t.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[r,s,o,a,i,n]}}]}},grmr_java:e=>{e.regex;const t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n=t+Oa("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),r={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},a={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},o={className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:r,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t,/\s+/,t,/\s+/,/=/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+n+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:r,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Aa,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Aa,a]}},grmr_javascript:ja,grmr_json:e=>({name:"JSON",contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,{beginKeywords:"true false null"},e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}),grmr_kotlin:e=>{const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,r]}]};r.contains.push(o);const i={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},s={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"})]}]},l=Aa,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},u=d;return u.variants[1].contains=[d],d.variants[1].contains=[u],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,i,s,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,i,s,o,e.C_NUMBER_MODE]},c]},{className:"class",beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/,excludeBegin:!0,returnEnd:!0},i,s]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}},grmr_less:e=>{const t=ka(e),n=Ca,r="([\\w-]+|@\\{[\\w-]+\\})",a=[],o=[],i=e=>({className:"string",begin:"~?"+e+".*?"+e}),s=(e,t,n)=>({className:e,begin:t,relevance:n}),l={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:$a.join(" ")},c={begin:"\\(",end:"\\)",contains:o,keywords:l,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,i("'"),i('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,c,s("variable","@@?[\\w-]+",10),s("variable","@\\{[\\w-]+\\}"),s("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT);const d=o.concat({begin:/\{/,end:/\}/,contains:a}),u={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},p={begin:r+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Na.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:o,relevance:0}},g={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:d}},h={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u,s("keyword","all\\b"),s("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+Ea.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,s("selector-tag",r,0),s("selector-id","#"+r),s("selector-class","\\."+r,0),s("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+xa.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Sa.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},t.FUNCTION_DISPATCH]},f={begin:`[\\w-]+:(:)?(${n.join("|")})`,returnBegin:!0,contains:[h]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,g,f,p,h),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:a}},grmr_lua:e=>{const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},a=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[",n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:a.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}},grmr_makefile:e=>{const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{const t=e.regex,n=t.concat(/[A-Z_]/,t.optional(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),i=e.inherit(e.APOS_STRING_MODE,{className:"string"}),s=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[a,s,i,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[a,o,s,i]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}},grmr_markdown:e=>{const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},r={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},a={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};r.contains.push(a),a.contains.push(r);let o=[t,n];return r.contains=r.contains.concat(o),a.contains=a.contains.concat(o),o=o.concat(r,a),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:o},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:o}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},r,a,{className:"quote",begin:"^>\\s+",contains:o,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}},grmr_objectivec:e=>{const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{$pattern:t,keyword:["int","float","while","char","export","sizeof","typedef","const","struct","for","union","unsigned","long","volatile","static","bool","mutable","if","do","return","goto","void","enum","else","break","extern","asm","case","short","default","double","register","explicit","signed","typename","this","switch","continue","wchar_t","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","super","unichar","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["BOOL","dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"]},illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}},grmr_perl:e=>{const t=e.regex,n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0"},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},i={variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},s=[e.BACKSLASH_ESCAPE,a,i],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,r,a="\\1")=>{const o="\\1"===a?a:t.concat(a,r);return t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,o,/(?:\\.|[^\\\/])*?/,a,n)},d=(e,r,a)=>t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,a,n),u=[i,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:s,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:c("s|tr|y",t.either(...l,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",t.either(...l,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=u,o.contains=u,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:u}},grmr_php:e=>{const t=e.regex,n="[a-zA-Z0-9_-ÿ]*(?![A-Za-z0-9])(?![$]))",r=t.concat("([a-zA-Z_\\x7f-\\xff]",n),a=t.concat("([A-Z]",n),o={scope:"variable",match:"\\$+"+r},i={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},s=e.inherit(e.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(i)}),s,e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(i)})]},d={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},u=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],p=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],m={keyword:u,literal:(e=>{const t=[];return["false","null","true"].forEach((e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())})),t})(),built_in:p},g=e=>e.map((e=>e.replace(/\|\d+$/,""))),h={variants:[{match:[/new/,t.concat(l,"+"),t.concat("(?!",g(p).join("\\b|"),"\\b)"),t.concat(/\\?/,r),t.concat(l,"*",/\(/)],scope:{1:"keyword",4:"title.class"}}]},f={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",g(u).join("\\b|"),"|",g(p).join("\\b|"),"\\b)"),r,t.concat(l,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"}},_=t.concat(r,"\\b(?!\\()"),b={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]};return{case_insensitive:!1,keywords:m,contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},o,f,b,{match:[/const/,/\s/,r,/\s*=/],scope:{1:"keyword",3:"variable.constant"}},h,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",o,b,e.C_BLOCK_COMMENT_MODE,c,d]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},c,d]}},grmr_php_template:e=>({name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}),grmr_plaintext:e=>({name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}),grmr_python:e=>{const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},s={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,s,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,s,i]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,u="\\b|"+r.join("|"),p={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${d}))[eE][+-]?(${c})[jJ]?(?=${u})`},{begin:`(${d})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${u})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${u})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${u})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${u})`},{begin:`\\b(${c})[jJ](?=${u})`}]},m={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",o,p,l,e.HASH_COMMENT_MODE]}]};return i.contains=[l,p,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|->|\?)|=>/,contains:[o,p,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,m,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[p,g,l]}]}},grmr_python_repl:e=>({aliases:["pycon"],contains:[{className:"meta",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}),grmr_r:e=>{const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),a=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[a,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}},grmr_ruby:e=>{const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__",built_in:"proc lambda",literal:"true false nil"},a={className:"doctag",begin:"@[A-Za-z]+"},o={begin:"#<",end:">"},i=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__","\\n$")],s={className:"subst",begin:/#\{/,end:/\}/,keywords:r},l={className:"string",contains:[e.BACKSLASH_ESCAPE,s],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,s]})]}]},c="[0-9](_?[0-9])*",d={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${c}))?([eE][+-]?(${c})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},u={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:r},p=[l,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE,relevance:0}]}].concat(i)},{className:"function",begin:t.concat(/def\s+/,t.lookahead(n+"\\s*(\\(|;|$)")),relevance:0,keywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:n}),u].concat(i)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[l,{begin:n}],relevance:0},d,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:r},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,s],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(o,i),relevance:0}].concat(o,i);s.contains=p,u.contains=p;const m=[{begin:/^\s*=>/,starts:{end:"$",contains:p}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",contains:p}}];return i.unshift(o),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:r,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(m).concat(i).concat(p)}},grmr_rust:e=>{const t=e.regex,n={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",a=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bin!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"],keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:a},illegal:""},n]}},grmr_scss:e=>{const t=ka(e),n=Sa,r=xa,a="@[a-z-]+",o={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b"};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Ea.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Na.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT]},{begin:"@(page|font-face)",keywords:{$pattern:a,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:$a.join(" ")},contains:[{begin:a,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}},grmr_shell:e=>({name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}),grmr_sql:e=>{const t=e.regex,n=e.COMMENT("--","$"),r=["true","false","unknown"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],o=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],i=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],s=o,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!o.includes(e))),c={begin:t.concat(/\b/,t.either(...s),/\s*\(/),relevance:0,keywords:{built_in:s}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:((e,{exceptions:t,when:n}={})=>{const r=n;return t=t||[],e.map((e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?e+"|0":e))})(l,{when:e=>e.length<3}),literal:r,type:a,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:t.either(...i),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:l.concat(i),literal:r,type:a}},{className:"type",begin:t.either("double precision","large object","with timezone","without timezone")},c,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}},grmr_swift:e=>{const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],a={match:[/\./,Ur(...Ua,...Fa)],className:{2:"keyword"}},o={match:Pr(/\./,Ur(...qa)),relevance:0},i=qa.filter((e=>"string"==typeof e)).concat(["_|0"]),s={variants:[{className:"keyword",match:Ur(...qa.filter((e=>"string"!=typeof e)).concat(za).map(Pa),...Fa)}]},l={$pattern:Ur(/\b\w+/,/#\w+/),keyword:i.concat(Wa),literal:Ka},c=[a,o,s],d=[{match:Pr(/\./,Ur(...Ga)),relevance:0},{className:"built_in",match:Pr(/\b/,Ur(...Ga),/(?=\()/)}],u={match:/->/,relevance:0},p=[u,{className:"operator",relevance:0,variants:[{match:Qa},{match:`\\.(\\.|${Va})+`}]}],m="([0-9a-fA-F]_*)+",g={className:"number",relevance:0,variants:[{match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(([0-9]_*)+))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},h=(e="")=>({className:"subst",variants:[{match:Pr(/\\/,e,/[0\\tnr"']/)},{match:Pr(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),f=(e="")=>({className:"subst",match:Pr(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),_=(e="")=>({className:"subst",label:"interpol",begin:Pr(/\\/,e,/\(/),end:/\)/}),b=(e="")=>({begin:Pr(e,/"""/),end:Pr(/"""/,e),contains:[h(e),f(e),_(e)]}),y=(e="")=>({begin:Pr(e,/"/),end:Pr(/"/,e),contains:[h(e),_(e)]}),v={className:"string",variants:[b(),b("#"),b("##"),b("###"),y(),y("#"),y("##"),y("###")]},w={match:Pr(/`/,Ja,/`/)},k=[w,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${Ya}+`}],E=[{match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:no,contains:[...p,g,v]}]}},{className:"keyword",match:Pr(/@/,Ur(...to))},{className:"meta",match:Pr(/@/,Ja)}],$={match:Ir(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Pr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Ya,"+")},{className:"type",match:eo,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Pr(/\s+&\s+/,Ir(eo)),relevance:0}]},x={begin://,keywords:l,contains:[...r,...c,...E,u,$]};$.contains.push(x);const S={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:Pr(Ja,/\s*:/),keywords:"_|0",relevance:0},...r,...c,...d,...p,g,v,...k,...E,$]},N={begin://,contains:[...r,$]},C={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:Ur(Ir(Pr(Ja,/\s*:/)),Ir(Pr(Ja,/\s+/,Ja,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ja}]},...r,...c,...p,g,v,...E,$,S],endsParent:!0,illegal:/["']/},A={match:[/func/,/\s+/,Ur(w.match,Ja,Qa)],className:{1:"keyword",3:"title.function"},contains:[N,C,t],illegal:[/\[/,/%/]},O={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[N,C,t],illegal:/\[|%/},M={match:[/operator/,/\s+/,Qa],className:{1:"keyword",3:"title"}},R={begin:[/precedencegroup/,/\s+/,eo],className:{1:"keyword",3:"title"},contains:[$],keywords:[...Ha,...Ka],end:/}/};for(const e of v.variants){const t=e.contains.find((e=>"interpol"===e.label));t.keywords=l;const n=[...c,...d,...p,g,v,...k];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,A,O,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},M,R,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...c,...d,...p,g,v,...k,...E,$,S]}},grmr_typescript:e=>{const t=ja(e),n=["any","void","number","boolean","string","object","never","enum"],r={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:n},contains:[t.exports.CLASS_REFERENCE]},o={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Ma.concat(["type","namespace","typedef","interface","public","private","protected","implements","declare","abstract","readonly"]),literal:Ra,built_in:Ba.concat(n),"variable.language":Ia},i={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},s=(e,t,n)=>{const r=e.contains.findIndex((e=>e.label===t));if(-1===r)throw Error("can not find mode to replace");e.contains.splice(r,1,n)};return Object.assign(t.keywords,o),t.exports.PARAMS_CONTAINS.push(i),t.contains=t.contains.concat([i,r,a]),s(t,"shebang",e.SHEBANG()),s(t,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),t.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx"]}),t},grmr_vbnet:e=>{const t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,i={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,n),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(r,n),/ +/,t.either(a,o),/ *#/)}]},s=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},s,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}},grmr_yaml:e=>{const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},a=e.inherit(r,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),o={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},i={begin:/\{/,end:/\}/,contains:[o],illegal:"\\n",relevance:0},s={begin:"\\[",end:"\\]",contains:[o],illegal:"\\n",relevance:0},l=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},i,s,r],c=[...l];return c.pop(),c.push(a),o.contains=c,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:l}}});const ao=wa;for(const e of Object.keys(ro)){const t=e.replace("grmr_","").replace("_","-");ao.registerLanguage(t,ro[e])} +/*! `julia` grammar compiled for Highlight.js 11.4.0 */var oo=e=>{var t="[A-Za-z_\\u00A1-\\uFFFF][A-Za-z_0-9\\u00A1-\\uFFFF]*",n={$pattern:t,keyword:["baremodule","begin","break","catch","ccall","const","continue","do","else","elseif","end","export","false","finally","for","function","global","if","import","in","isa","let","local","macro","module","quote","return","true","try","using","where","while"],literal:["ARGS","C_NULL","DEPOT_PATH","ENDIAN_BOM","ENV","Inf","Inf16","Inf32","Inf64","InsertionSort","LOAD_PATH","MergeSort","NaN","NaN16","NaN32","NaN64","PROGRAM_FILE","QuickSort","RoundDown","RoundFromZero","RoundNearest","RoundNearestTiesAway","RoundNearestTiesUp","RoundToZero","RoundUp","VERSION|0","devnull","false","im","missing","nothing","pi","stderr","stdin","stdout","true","undef","π","ℯ"],built_in:["AbstractArray","AbstractChannel","AbstractChar","AbstractDict","AbstractDisplay","AbstractFloat","AbstractIrrational","AbstractMatrix","AbstractRange","AbstractSet","AbstractString","AbstractUnitRange","AbstractVecOrMat","AbstractVector","Any","ArgumentError","Array","AssertionError","BigFloat","BigInt","BitArray","BitMatrix","BitSet","BitVector","Bool","BoundsError","CapturedException","CartesianIndex","CartesianIndices","Cchar","Cdouble","Cfloat","Channel","Char","Cint","Cintmax_t","Clong","Clonglong","Cmd","Colon","Complex","ComplexF16","ComplexF32","ComplexF64","CompositeException","Condition","Cptrdiff_t","Cshort","Csize_t","Cssize_t","Cstring","Cuchar","Cuint","Cuintmax_t","Culong","Culonglong","Cushort","Cvoid","Cwchar_t","Cwstring","DataType","DenseArray","DenseMatrix","DenseVecOrMat","DenseVector","Dict","DimensionMismatch","Dims","DivideError","DomainError","EOFError","Enum","ErrorException","Exception","ExponentialBackOff","Expr","Float16","Float32","Float64","Function","GlobalRef","HTML","IO","IOBuffer","IOContext","IOStream","IdDict","IndexCartesian","IndexLinear","IndexStyle","InexactError","InitError","Int","Int128","Int16","Int32","Int64","Int8","Integer","InterruptException","InvalidStateException","Irrational","KeyError","LinRange","LineNumberNode","LinearIndices","LoadError","MIME","Matrix","Method","MethodError","Missing","MissingException","Module","NTuple","NamedTuple","Nothing","Number","OrdinalRange","OutOfMemoryError","OverflowError","Pair","PartialQuickSort","PermutedDimsArray","Pipe","ProcessFailedException","Ptr","QuoteNode","Rational","RawFD","ReadOnlyMemoryError","Real","ReentrantLock","Ref","Regex","RegexMatch","RoundingMode","SegmentationFault","Set","Signed","Some","StackOverflowError","StepRange","StepRangeLen","StridedArray","StridedMatrix","StridedVecOrMat","StridedVector","String","StringIndexError","SubArray","SubString","SubstitutionString","Symbol","SystemError","Task","TaskFailedException","Text","TextDisplay","Timer","Tuple","Type","TypeError","TypeVar","UInt","UInt128","UInt16","UInt32","UInt64","UInt8","UndefInitializer","UndefKeywordError","UndefRefError","UndefVarError","Union","UnionAll","UnitRange","Unsigned","Val","Vararg","VecElement","VecOrMat","Vector","VersionNumber","WeakKeyDict","WeakRef"]},r={keywords:n,illegal:/<\//},a={className:"subst",begin:/\$\(/,end:/\)/,keywords:n},o={className:"variable",begin:"\\$"+t},i={className:"string",contains:[e.BACKSLASH_ESCAPE,a,o],variants:[{begin:/\w*"""/,end:/"""\w*/,relevance:10},{begin:/\w*"/,end:/"\w*/}]},s={className:"string",contains:[e.BACKSLASH_ESCAPE,a,o],begin:"`",end:"`"},l={className:"meta",begin:"@"+t};return r.name="Julia",r.contains=[{className:"number",begin:/(\b0x[\d_]*(\.[\d_]*)?|0x\.\d[\d_]*)p[-+]?\d+|\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\b\d[\d_]*(\.[\d_]*)?|\.\d[\d_]*)([eEfF][-+]?\d+)?/,relevance:0},{className:"string",begin:/'(.|\\[xXuU][a-zA-Z0-9]+)'/},i,s,l,{className:"comment",variants:[{begin:"#=",end:"=#",relevance:10},{begin:"#",end:"$"}]},e.HASH_COMMENT_MODE,{className:"keyword",begin:"\\b(((abstract|primitive)\\s+)type|(mutable\\s+)?struct)\\b"},{begin:/<:/}],a.contains=r.contains,r},io=oo,so=e=>({name:"Julia REPL",contains:[{className:"meta",begin:/^julia>/,relevance:10,starts:{end:/^(?![ ]{6})/,subLanguage:"julia"}}],aliases:["jldoctest"]});ao.registerLanguage("julia",io),ao.registerLanguage("julia-repl",so);var lo=ao;Ze=a("61LLQ");class co extends o.Component{constructor(){super(),this.state={error:null},this.old_height=0,this.resize_observer=new ResizeObserver((e=>{const t=this.base.offsetHeight;if(document.body.querySelector("pluto-cell:focus-within")){const e=document.body.querySelectorAll("pluto-cell:focus-within ~ pluto-cell > pluto-output");"SUMMARY"==document.activeElement.tagName||0!=e.length&&Array.from(e).includes(this.base)||window.scrollBy(0,t-this.old_height)}this.old_height=t}))}shouldComponentUpdate({last_run_timestamp:e}){return e!==this.props.last_run_timestamp}componentDidMount(){this.resize_observer.observe(this.base)}componentWillUnmount(){this.resize_observer.unobserve(this.base)}render(){const e=this.props.errored||!this.props.body||"application/vnd.pluto.tree+object"!==this.props.mime&&"application/vnd.pluto.table+object"!==this.props.mime&&"text/plain"!==this.props.mime,t=!this.props.errored&&e;return o.html` + + ${this.props.rootassignee} + ${this.state.error?o.html`
${this.state.error.message}
`:o.html`<${po} ...${this.props} />`} +
+ `}}let uo=({body:e,mime:t})=>{let n=o.useRef();return o.useLayoutEffect((()=>{let r=URL.createObjectURL(new Blob([e],{type:t}));return n.current.onload=n.current.onerror=()=>{n.current&&(n.current.style.display=null)},""===n.current.src&&(n.current.style.display="none"),n.current.type=t,n.current.src=r,()=>URL.revokeObjectURL(r)}),[e,t]),o.html``};const po=({mime:e,body:t,cell_id:n,persist_js_state:r=!1,last_run_timestamp:a})=>{switch(e){case"image/png":case"image/jpg":case"image/jpeg":case"image/gif":case"image/bmp":case"image/svg+xml":return o.html`
<${uo} mime=${e} body=${t} />
`;case"text/html":return t.startsWith("`:o.html`<${yo} + cell_id=${n} + body=${t} + persist_js_state=${r} + last_run_timestamp=${a} + />`;case"application/vnd.pluto.tree+object":return o.html`
+ <${Te} cell_id=${n} body=${t} persist_js_state=${r} /> +
`;case"application/vnd.pluto.table+object":return o.html`<${Le} cell_id=${n} body=${t} persist_js_state=${r} />`;case"application/vnd.pluto.stacktrace+object":return o.html`
<${Ae} cell_id=${n} ...${t} />
`;case"application/vnd.pluto.divelement+object":return(({cell_id:e,style:t,classname:n,children:r})=>o.html`
${r.map((t=>o.html`<${Oe} cell_id=${e} mime=${t[1]} body=${t[0]} persist_js_state=${!1} />`))}
`)({cell_id:n,...t});case"text/plain":return t?o.html`
+
${t}
+
`:o.html`
`;case null:case void 0:case"":return o.html``;default:return o.html`
🛑
`}};!function(e,t,n,r){function a(){const t=Reflect.construct(HTMLElement,[],a);return t._vdomComponent=e,t._root=r&&r.shadow?t.attachShadow({mode:"open"}):t,t}a.prototype=Object.create(HTMLElement.prototype),a.prototype.constructor=a,a.prototype.connectedCallback=ze,a.prototype.attributeChangedCallback=Ke,a.prototype.disconnectedCallback=He,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),a.observedAttributes=n,n.forEach((e=>{Object.defineProperty(a.prototype,e,{get(){return this._vdom.props[e]},set(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());const n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})})),customElements.define(t||e.tagName||e.displayName||e.name,a)}(po,"pluto-display",["mime","body","cell_id","persist_js_state","last_run_timestamp"]);let mo=({body:e})=>{let t=o.useRef();return o.useLayoutEffect((()=>{let n=URL.createObjectURL(new Blob([e],{type:"text/html"}));return t.current.src=n,_o((async()=>{await new Promise((e=>t.current.addEventListener("load",(()=>e()))));let e=t.current.contentWindow.document,n=document.querySelector("#iframe-resizer-content-window-script"),r=e.createElement("script");r.src=n.src,r.crossOrigin="anonymous",e.head.appendChild(r),new Promise((e=>r.addEventListener("load",(()=>e())))),window.iFrameResize({checkOrigin:!1},t.current)})),()=>URL.revokeObjectURL(n)}),[e]),o.html``},go=async({environment:e,code:t})=>{const n=`"use strict"; return (async () => {${t}})()`;let{this:r,...a}=e,o=Object.keys(a),i=Object.values(a);return await Function(...o,n).bind(r)(...i)},ho=async(e,t)=>{let n=document.createElement("script");for(let t of e.attributes)n.attributes.setNamedItem(t.cloneNode(!0));n.textContent="{\n window.____FUNCTION_TO_RUN_INSIDE_SCRIPT.result = window.____FUNCTION_TO_RUN_INSIDE_SCRIPT.function_to_run(window.____FUNCTION_TO_RUN_INSIDE_SCRIPT.currentScript)\n }",window.____FUNCTION_TO_RUN_INSIDE_SCRIPT={function_to_run:t,currentScript:n,result:null},e.parentNode.replaceChild(n,e);let r=await window.____FUNCTION_TO_RUN_INSIDE_SCRIPT.result;return window.____FUNCTION_TO_RUN_INSIDE_SCRIPT={function_to_run:t,result:null},{node:n,result:r}};const fo=e=>e instanceof Element&&e.nodeType===Node.ELEMENT_NODE;let _o=e=>e(),bo=e=>{try{const t=e.getAttribute("shadowroot"),n=e.parentElement.attachShadow({mode:t});n.appendChild(e.content),e.remove();return Array.from(n.querySelectorAll("script, template[shadowroot]")).flatMap((e=>"SCRIPT"===e.nodeName?[e]:"TEMPLATE"===e.nodeName?bo(e):void 0))}catch(t){return console.error("Couldn't attach declarative shadow dom to",e,"because of",t),[]}},yo=({body:e,className:t="",persist_js_state:n=!1,last_run_timestamp:r})=>{let a=o.useContext(ve),i=o.useContext(we),s=o.useContext(ke),l=o.useRef(new Map),c=o.useRef((()=>{})),d=o.useRef(null);return o.useLayoutEffect((()=>{je(d.current,i)}),[e,n,a,i]),o.useLayoutEffect((()=>{let t=new Promise((e=>{c.current=()=>{e()}}));document.createElement("p-dumpster").append(...d.current.childNodes),d.current.innerHTML=e;const r=[...Array.from(d.current.querySelectorAll("template[shadowroot]")).flatMap((e=>bo(e))),...Array.from(d.current.querySelectorAll("script"))];return _o((async()=>{try{if(s?.add(d.current),l.current=await(async({root_node:e,script_nodes:t,previous_results_map:n,invalidation:r})=>{let a=new Map;for(let e of t)if(null!=e.src&&""!==e.src);else{let t=e.id,r=t?n.get(t):null;fo(r)&&e.parentElement.insertBefore(r,e)}for(let i of t)if(null!=i.src&&""!==i.src){var o=Array.from(document.head.querySelectorAll("script")).find((e=>e.src===i.src));null==o&&((o=document.createElement("script")).src=i.src,o.type="module"===i.type?"module":"text/javascript",o.pluto_is_loading_me=!0),null!=o.pluto_is_loading_me&&(await new Promise((e=>{o.addEventListener("load",e),o.addEventListener("error",e),document.head.appendChild(o)})),o.pluto_is_loading_me=void 0)}else try{let t=i.id,o=t?n.get(t):null;if("module"===i.type&&console.warn("We don't (yet) fully support
\ No newline at end of file diff --git a/frontend-dist/ellipsis-horizontal-circle-outline.6279ed30.svg b/frontend-dist/ellipsis-horizontal-circle-outline.6279ed30.svg new file mode 100644 index 0000000000..4b8d05ea8e --- /dev/null +++ b/frontend-dist/ellipsis-horizontal-circle-outline.6279ed30.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/ellipsis-horizontal-outline.abb6e818.svg b/frontend-dist/ellipsis-horizontal-outline.abb6e818.svg new file mode 100644 index 0000000000..bf94f28aca --- /dev/null +++ b/frontend-dist/ellipsis-horizontal-outline.abb6e818.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/ellipsis-horizontal.c9a6cc29.svg b/frontend-dist/ellipsis-horizontal.c9a6cc29.svg new file mode 100644 index 0000000000..5df322580b --- /dev/null +++ b/frontend-dist/ellipsis-horizontal.c9a6cc29.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/ellipsis-vertical.a30e7430.svg b/frontend-dist/ellipsis-vertical.a30e7430.svg new file mode 100644 index 0000000000..27f793a2cb --- /dev/null +++ b/frontend-dist/ellipsis-vertical.a30e7430.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/error.jl.html b/frontend-dist/error.jl.html new file mode 100644 index 0000000000..1b7e01eefb --- /dev/null +++ b/frontend-dist/error.jl.html @@ -0,0 +1 @@ +⚡ Pluto.jl ⚡$STYLE

$TITLE

$ADVICE


Go back


$BODYTITLE

$BODY
\ No newline at end of file diff --git a/frontend-dist/eye-off-outline.a37e03db.svg b/frontend-dist/eye-off-outline.a37e03db.svg new file mode 100644 index 0000000000..4a7e915939 --- /dev/null +++ b/frontend-dist/eye-off-outline.a37e03db.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/eye-outline.6e6e0f7c.svg b/frontend-dist/eye-outline.6e6e0f7c.svg new file mode 100644 index 0000000000..6901ef405b --- /dev/null +++ b/frontend-dist/eye-outline.6e6e0f7c.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/favicon-16x16.347d2855.png b/frontend-dist/favicon-16x16.347d2855.png new file mode 100644 index 0000000000..bd77b08001 Binary files /dev/null and b/frontend-dist/favicon-16x16.347d2855.png differ diff --git a/frontend-dist/favicon-32x32.8789add4.png b/frontend-dist/favicon-32x32.8789add4.png new file mode 100644 index 0000000000..96580877eb Binary files /dev/null and b/frontend-dist/favicon-32x32.8789add4.png differ diff --git a/frontend-dist/favicon-96x96.48689391.png b/frontend-dist/favicon-96x96.48689391.png new file mode 100644 index 0000000000..1d5d57d5b2 Binary files /dev/null and b/frontend-dist/favicon-96x96.48689391.png differ diff --git a/frontend-dist/favicon_unsaturated.d1387b25.svg b/frontend-dist/favicon_unsaturated.d1387b25.svg new file mode 100644 index 0000000000..ccc316f314 --- /dev/null +++ b/frontend-dist/favicon_unsaturated.d1387b25.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/firebase-app.23e859d5.js b/frontend-dist/firebase-app.23e859d5.js new file mode 100644 index 0000000000..18b8ba4c22 --- /dev/null +++ b/frontend-dist/firebase-app.23e859d5.js @@ -0,0 +1,213 @@ +function e(e,t,n,i){Object.defineProperty(e,t,{get:n,set:i,enumerable:!0,configurable:!0})}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire94c2.register("5O3mA",(function(t,n){e(t.exports,"FirebaseError",(()=>r)),e(t.exports,"_DEFAULT_ENTRY_NAME",(()=>O)),e(t.exports,"_apps",(()=>C)),e(t.exports,"_components",(()=>D)),e(t.exports,"_addComponent",(()=>A)),e(t.exports,"_addOrOverwriteComponent",(()=>R)),e(t.exports,"_registerComponent",(()=>N)),e(t.exports,"_getProvider",(()=>S)),e(t.exports,"_removeServiceInstance",(()=>$)),e(t.exports,"_clearComponents",(()=>j)),e(t.exports,"SDK_VERSION",(()=>k)),e(t.exports,"initializeApp",(()=>z)),e(t.exports,"getApp",(()=>T)),e(t.exports,"getApps",(()=>P)),e(t.exports,"deleteApp",(()=>x)),e(t.exports,"registerVersion",(()=>M)),e(t.exports,"onLog",(()=>U)),e(t.exports,"setLogLevel",(()=>B)); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class i{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch((()=>{})),1===e.length?e(t):e(t,n))}}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class r extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,r.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,s.prototype.create)}}class s{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],a=s?function(e,t){return e.replace(o,((e,n)=>{const i=t[n];return null!=i?String(i):`<${n}?>`}))}(s,n):"Error",c=`${this.serviceName}: ${a} (${i}).`;return new r(i,c,n)}}const o=/\{\$([^}]+)}/g;function a(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);for(const r of n){if(!i.includes(r))return!1;const n=e[r],s=t[r];if(c(n)&&c(s)){if(!a(n,s))return!1}else if(n!==s)return!1}for(const e of i)if(!n.includes(e))return!1;return!0}function c(e){return null!==e&&"object"==typeof e}class l{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const p="[DEFAULT]"; +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class h{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new i;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),i=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(i)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(i)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */(e))try{this.getOrInitializeService({instanceIdentifier:p})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e="[DEFAULT]"){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter((e=>"INTERNAL"in e)).map((e=>e.INTERNAL.delete())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(e="[DEFAULT]"){return this.instances.has(e)}getOptions(e="[DEFAULT]"){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(e)&&t.resolve(i)}return i}onInit(e,t){var n;const i=this.normalizeInstanceIdentifier(t),r=null!==(n=this.onInitCallbacks.get(i))&&void 0!==n?n:new Set;r.add(e),this.onInitCallbacks.set(i,r);const s=this.instances.get(i);return s&&e(s,i),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const i of n)try{i(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(i=e,i===p?void 0:i),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var i;return n||null}normalizeInstanceIdentifier(e="[DEFAULT]"){return this.component?this.component.multipleInstances?e:p:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class f{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new h(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const d=[];var u,m;(m=u||(u={}))[m.DEBUG=0]="DEBUG",m[m.VERBOSE=1]="VERBOSE",m[m.INFO=2]="INFO",m[m.WARN=3]="WARN",m[m.ERROR=4]="ERROR",m[m.SILENT=5]="SILENT";const g={debug:u.DEBUG,verbose:u.VERBOSE,info:u.INFO,warn:u.WARN,error:u.ERROR,silent:u.SILENT},b=u.INFO,v={[u.DEBUG]:"log",[u.VERBOSE]:"log",[u.INFO]:"info",[u.WARN]:"warn",[u.ERROR]:"error"},I=(e,t,...n)=>{if(t{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const E="https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js",y="0.7.6",_=new class{constructor(e){this.name=e,this._logLevel=b,this._logHandler=I,this._userLogHandler=null,d.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in u))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?g[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,u.DEBUG,...e),this._logHandler(this,u.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,u.VERBOSE,...e),this._logHandler(this,u.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,u.INFO,...e),this._logHandler(this,u.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,u.WARN,...e),this._logHandler(this,u.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,u.ERROR,...e),this._logHandler(this,u.ERROR,...e)}}("https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js"),O="[DEFAULT]",L={[E]:"fire-core","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-check":"fire-app-check","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},C=new Map,D=new Map;function A(e,t){try{e.container.addComponent(t)}catch(n){_.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function R(e,t){e.container.addOrOverwriteComponent(t)}function N(e){const t=e.name;if(D.has(t))return _.debug(`There were multiple attempts to register component ${t}.`),!1;D.set(t,e);for(const t of C.values())A(t,e);return!0}function S(e,t){return e.container.getProvider(t)}function $(e,t,n=O){S(e,t).clearInstance(n)}function j(){D.clear()} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const H=new s("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function."}); +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class F{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new l("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw H.create("app-deleted",{appName:this._name})}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const k="9.3.0";function z(e,t={}){if("object"!=typeof t){t={name:t}}const n=Object.assign({name:O,automaticDataCollectionEnabled:!1},t),i=n.name;if("string"!=typeof i||!i)throw H.create("bad-app-name",{appName:String(i)});const r=C.get(i);if(r){if(a(e,r.options)&&a(n,r.config))return r;throw H.create("duplicate-app",{appName:i})}const s=new f(i);for(const e of D.values())s.addComponent(e);const o=new F(e,n,s);return C.set(i,o),o}function T(e=O){const t=C.get(e);if(!t)throw H.create("no-app",{appName:e});return t}function P(){return Array.from(C.values())}async function x(e){const t=e.name;C.has(t)&&(C.delete(t),await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function M(e,t,n){var i;let r=null!==(i=L[e])&&void 0!==i?i:e;n&&(r+=`-${n}`);const s=r.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const e=[`Unable to register library "${r}" with version "${t}":`];return s&&e.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&e.push("and"),o&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void _.warn(e.join(" "))}N(new l(`${r}-version`,(()=>({library:r,version:t})),"VERSION"))}function U(e,t){if(null!==e&&"function"!=typeof e)throw H.create("invalid-log-argument");!function(e,t){for(const n of d){let i=null;t&&t.level&&(i=g[t.level]),n.userLogHandler=null===e?null:(t,n,...r)=>{const s=r.map((e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}})).filter((e=>e)).join(" ");n>=(null!=i?i:t.logLevel)&&e({level:u[n].toLowerCase(),message:s,args:r,type:t.name})}}}(e,t)}function B(e){var t;t=e,d.forEach((e=>{e.setLogLevel(t)}))} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var V;V="",N(new l("platform-logger",(e=>new w(e)),"PRIVATE")),M(E,y,V),M(E,y,"esm2017"),M("fire-js",""); +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +M("firebase","9.3.0","cdn")})); \ No newline at end of file diff --git a/frontend-dist/firebase-app.341f693c.js b/frontend-dist/firebase-app.341f693c.js new file mode 100644 index 0000000000..4f29c8364a --- /dev/null +++ b/frontend-dist/firebase-app.341f693c.js @@ -0,0 +1,213 @@ +(()=>{function e(e,t,n,i){Object.defineProperty(e,t,{get:n,set:i,enumerable:!0,configurable:!0})}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire94c2.register("krEeT",(function(t,n){e(t.exports,"FirebaseError",(()=>r)),e(t.exports,"_DEFAULT_ENTRY_NAME",(()=>O)),e(t.exports,"_apps",(()=>C)),e(t.exports,"_components",(()=>D)),e(t.exports,"_addComponent",(()=>A)),e(t.exports,"_addOrOverwriteComponent",(()=>R)),e(t.exports,"_registerComponent",(()=>N)),e(t.exports,"_getProvider",(()=>S)),e(t.exports,"_removeServiceInstance",(()=>$)),e(t.exports,"_clearComponents",(()=>j)),e(t.exports,"SDK_VERSION",(()=>F)),e(t.exports,"initializeApp",(()=>z)),e(t.exports,"getApp",(()=>T)),e(t.exports,"getApps",(()=>P)),e(t.exports,"deleteApp",(()=>x)),e(t.exports,"registerVersion",(()=>M)),e(t.exports,"onLog",(()=>U)),e(t.exports,"setLogLevel",(()=>B)); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class i{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch((()=>{})),1===e.length?e(t):e(t,n))}}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class r extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,r.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,s.prototype.create)}}class s{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],a=s?function(e,t){return e.replace(o,((e,n)=>{const i=t[n];return null!=i?String(i):`<${n}?>`}))}(s,n):"Error",c=`${this.serviceName}: ${a} (${i}).`;return new r(i,c,n)}}const o=/\{\$([^}]+)}/g;function a(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);for(const r of n){if(!i.includes(r))return!1;const n=e[r],s=t[r];if(c(n)&&c(s)){if(!a(n,s))return!1}else if(n!==s)return!1}for(const e of i)if(!n.includes(e))return!1;return!0}function c(e){return null!==e&&"object"==typeof e}class l{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const p="[DEFAULT]"; +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class h{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new i;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),i=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(i)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(i)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */(e))try{this.getOrInitializeService({instanceIdentifier:p})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e="[DEFAULT]"){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter((e=>"INTERNAL"in e)).map((e=>e.INTERNAL.delete())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(e="[DEFAULT]"){return this.instances.has(e)}getOptions(e="[DEFAULT]"){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(e)&&t.resolve(i)}return i}onInit(e,t){var n;const i=this.normalizeInstanceIdentifier(t),r=null!==(n=this.onInitCallbacks.get(i))&&void 0!==n?n:new Set;r.add(e),this.onInitCallbacks.set(i,r);const s=this.instances.get(i);return s&&e(s,i),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const i of n)try{i(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(i=e,i===p?void 0:i),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var i;return n||null}normalizeInstanceIdentifier(e="[DEFAULT]"){return this.component?this.component.multipleInstances?e:p:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class f{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new h(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const d=[];var u,m;(m=u||(u={}))[m.DEBUG=0]="DEBUG",m[m.VERBOSE=1]="VERBOSE",m[m.INFO=2]="INFO",m[m.WARN=3]="WARN",m[m.ERROR=4]="ERROR",m[m.SILENT=5]="SILENT";const g={debug:u.DEBUG,verbose:u.VERBOSE,info:u.INFO,warn:u.WARN,error:u.ERROR,silent:u.SILENT},b=u.INFO,v={[u.DEBUG]:"log",[u.VERBOSE]:"log",[u.INFO]:"info",[u.WARN]:"warn",[u.ERROR]:"error"},I=(e,t,...n)=>{if(t{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const E="https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js",y="0.7.6",_=new class{constructor(e){this.name=e,this._logLevel=b,this._logHandler=I,this._userLogHandler=null,d.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in u))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?g[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,u.DEBUG,...e),this._logHandler(this,u.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,u.VERBOSE,...e),this._logHandler(this,u.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,u.INFO,...e),this._logHandler(this,u.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,u.WARN,...e),this._logHandler(this,u.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,u.ERROR,...e),this._logHandler(this,u.ERROR,...e)}}("https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js"),O="[DEFAULT]",L={[E]:"fire-core","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-check":"fire-app-check","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},C=new Map,D=new Map;function A(e,t){try{e.container.addComponent(t)}catch(n){_.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function R(e,t){e.container.addOrOverwriteComponent(t)}function N(e){const t=e.name;if(D.has(t))return _.debug(`There were multiple attempts to register component ${t}.`),!1;D.set(t,e);for(const t of C.values())A(t,e);return!0}function S(e,t){return e.container.getProvider(t)}function $(e,t,n=O){S(e,t).clearInstance(n)}function j(){D.clear()} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const H=new s("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function."}); +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class k{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new l("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw H.create("app-deleted",{appName:this._name})}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const F="9.3.0";function z(e,t={}){if("object"!=typeof t){t={name:t}}const n=Object.assign({name:O,automaticDataCollectionEnabled:!1},t),i=n.name;if("string"!=typeof i||!i)throw H.create("bad-app-name",{appName:String(i)});const r=C.get(i);if(r){if(a(e,r.options)&&a(n,r.config))return r;throw H.create("duplicate-app",{appName:i})}const s=new f(i);for(const e of D.values())s.addComponent(e);const o=new k(e,n,s);return C.set(i,o),o}function T(e=O){const t=C.get(e);if(!t)throw H.create("no-app",{appName:e});return t}function P(){return Array.from(C.values())}async function x(e){const t=e.name;C.has(t)&&(C.delete(t),await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function M(e,t,n){var i;let r=null!==(i=L[e])&&void 0!==i?i:e;n&&(r+=`-${n}`);const s=r.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const e=[`Unable to register library "${r}" with version "${t}":`];return s&&e.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&e.push("and"),o&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void _.warn(e.join(" "))}N(new l(`${r}-version`,(()=>({library:r,version:t})),"VERSION"))}function U(e,t){if(null!==e&&"function"!=typeof e)throw H.create("invalid-log-argument");!function(e,t){for(const n of d){let i=null;t&&t.level&&(i=g[t.level]),n.userLogHandler=null===e?null:(t,n,...r)=>{const s=r.map((e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}})).filter((e=>e)).join(" ");n>=(null!=i?i:t.logLevel)&&e({level:u[n].toLowerCase(),message:s,args:r,type:t.name})}}}(e,t)}function B(e){var t;t=e,d.forEach((e=>{e.setLogLevel(t)}))} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var V;V="",N(new l("platform-logger",(e=>new w(e)),"PRIVATE")),M(E,y,V),M(E,y,"esm2017"),M("fire-js",""); +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +M("firebase","9.3.0","cdn")}))})(); \ No newline at end of file diff --git a/frontend-dist/firebase-firestore.675c1fad.js b/frontend-dist/firebase-firestore.675c1fad.js new file mode 100644 index 0000000000..bb17183011 --- /dev/null +++ b/frontend-dist/firebase-firestore.675c1fad.js @@ -0,0 +1,2039 @@ +var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function e(t,e,n,s){Object.defineProperty(t,e,{get:n,set:s,enumerable:!0,configurable:!0})}var n=t.parcelRequire94c2;n.register("5zn1O",(function(s,r){e(s.exports,"setLogLevel",(()=>Ps)),e(s.exports,"_logWarn",(()=>qs)),e(s.exports,"_debugAssert",(()=>$s)),e(s.exports,"FirestoreError",(()=>Hs)),e(s.exports,"_EmptyCredentialsProvider",(()=>Ys)),e(s.exports,"Timestamp",(()=>ar)),e(s.exports,"_FieldPath",(()=>mr)),e(s.exports,"_isBase64Available",(()=>yr)),e(s.exports,"_DocumentKey",(()=>xr)),e(s.exports,"_DatabaseId",(()=>$l)),e(s.exports,"_validateIsNotUsedTogether",(()=>Hl)),e(s.exports,"_cast",(()=>Xl)),e(s.exports,"connectFirestoreEmulator",(()=>ed)),e(s.exports,"DocumentReference",(()=>nd)),e(s.exports,"CollectionReference",(()=>rd)),e(s.exports,"Query",(()=>sd)),e(s.exports,"collection",(()=>id)),e(s.exports,"collectionGroup",(()=>od)),e(s.exports,"doc",(()=>ad)),e(s.exports,"refEqual",(()=>cd)),e(s.exports,"queryEqual",(()=>ud)),e(s.exports,"LoadBundleTask",(()=>dd)),e(s.exports,"CACHE_SIZE_UNLIMITED",(()=>fd)),e(s.exports,"Firestore",(()=>gd)),e(s.exports,"initializeFirestore",(()=>md)),e(s.exports,"getFirestore",(()=>pd)),e(s.exports,"ensureFirestoreConfigured",(()=>yd)),e(s.exports,"enableIndexedDbPersistence",(()=>vd)),e(s.exports,"enableMultiTabIndexedDbPersistence",(()=>bd)),e(s.exports,"clearIndexedDbPersistence",(()=>Ed)),e(s.exports,"waitForPendingWrites",(()=>Id)),e(s.exports,"enableNetwork",(()=>Sd)),e(s.exports,"disableNetwork",(()=>_d)),e(s.exports,"terminate",(()=>Nd)),e(s.exports,"loadBundle",(()=>Ad)),e(s.exports,"namedQuery",(()=>Dd)),e(s.exports,"FieldPath",(()=>Cd)),e(s.exports,"documentId",(()=>kd)),e(s.exports,"Bytes",(()=>Rd)),e(s.exports,"FieldValue",(()=>Ld)),e(s.exports,"GeoPoint",(()=>Od)),e(s.exports,"SnapshotMetadata",(()=>lf)),e(s.exports,"DocumentSnapshot",(()=>df)),e(s.exports,"QueryDocumentSnapshot",(()=>ff)),e(s.exports,"QuerySnapshot",(()=>gf)),e(s.exports,"snapshotEqual",(()=>pf)),e(s.exports,"QueryConstraint",(()=>wf)),e(s.exports,"query",(()=>vf)),e(s.exports,"where",(()=>Tf)),e(s.exports,"orderBy",(()=>If)),e(s.exports,"limit",(()=>_f)),e(s.exports,"limitToLast",(()=>Nf)),e(s.exports,"startAt",(()=>Df)),e(s.exports,"startAfter",(()=>xf)),e(s.exports,"endBefore",(()=>kf)),e(s.exports,"endAt",(()=>Rf)),e(s.exports,"AbstractUserDataWriter",(()=>Pf)),e(s.exports,"WriteBatch",(()=>qf)),e(s.exports,"getDoc",(()=>jf)),e(s.exports,"getDocFromCache",(()=>$f)),e(s.exports,"getDocFromServer",(()=>Gf)),e(s.exports,"getDocs",(()=>zf)),e(s.exports,"getDocsFromCache",(()=>Hf)),e(s.exports,"getDocsFromServer",(()=>Qf)),e(s.exports,"setDoc",(()=>Wf)),e(s.exports,"executeWrite",(()=>eg)),e(s.exports,"updateDoc",(()=>Yf)),e(s.exports,"deleteDoc",(()=>Xf)),e(s.exports,"addDoc",(()=>Jf)),e(s.exports,"onSnapshot",(()=>Zf)),e(s.exports,"onSnapshotsInSync",(()=>tg)),e(s.exports,"Transaction",(()=>sg)),e(s.exports,"runTransaction",(()=>rg)),e(s.exports,"deleteField",(()=>ig)),e(s.exports,"serverTimestamp",(()=>og)),e(s.exports,"arrayUnion",(()=>ag)),e(s.exports,"arrayRemove",(()=>cg)),e(s.exports,"increment",(()=>ug)),e(s.exports,"writeBatch",(()=>hg));var i=n("5O3mA"),o=n("cu5N4"); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const a=function(t){const e=[];let n=0;for(let s=0;s>6|192,e[n++]=63&r|128):55296==(64512&r)&&s+1>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128)}return e},c={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let e=0;e>2,h=(3&r)<<4|o>>4;let l=(15&o)<<2|c>>6,d=63&c;a||(d=64,i||(l=64)),s.push(n[u],n[h],n[l],n[d])}return s.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(a(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let n=0,s=0;for(;n191&&r<224){const i=t[n++];e[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){const i=((7&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536;e[s++]=String.fromCharCode(55296+(i>>10)),e[s++]=String.fromCharCode(56320+(1023&i))}else{const i=t[n++],o=t[n++];e[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&o)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let e=0;e>4;if(s.push(c),64!==o){const t=i<<4&240|o>>2;if(s.push(t),64!==a){const t=o<<6&192|a;s.push(t)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},u=function(t){return function(t){const e=a(t);return c.encodeByteArray(e,!0)}(t).replace(/\./g,"")}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function h(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function l(){return!function(){try{return"[object process]"===Object.prototype.toString.call(t.process)}catch(t){return!1}}()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function d(t,e){if(t===e)return!0;const n=Object.keys(t),s=Object.keys(e);for(const r of n){if(!s.includes(r))return!1;const n=t[r],i=e[r];if(f(n)&&f(i)){if(!d(n,i))return!1}else if(n!==i)return!1}for(const t of s)if(!n.includes(t))return!1;return!0}function f(t){return null!==t&&"object"==typeof t} +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function g(t){return t&&t._delegate?t._delegate:t}class m{constructor(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var p,y;(y=p||(p={}))[y.DEBUG=0]="DEBUG",y[y.VERBOSE=1]="VERBOSE",y[y.INFO=2]="INFO",y[y.WARN=3]="WARN",y[y.ERROR=4]="ERROR",y[y.SILENT=5]="SILENT";const w={debug:p.DEBUG,verbose:p.VERBOSE,info:p.INFO,warn:p.WARN,error:p.ERROR,silent:p.SILENT},v=p.INFO,b={[p.DEBUG]:"log",[p.VERBOSE]:"log",[p.INFO]:"info",[p.WARN]:"warn",[p.ERROR]:"error"},T=(t,e,...n)=>{if(e>>0),C=0;function k(t,e,n){return t.call.apply(t.bind,arguments)}function R(t,e,n){if(!t)throw Error();if(2e?1:0}t:{var H=_.navigator;if(H){var Q=H.userAgent;if(Q){K=Q;break t}}K=""}function W(t,e,n){for(const s in t)e.call(n,t[s],s,t)}function Y(t){const e={};for(const n in t)e[n]=t[n];return e}var X="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function J(t,e){let n,s;for(let e=1;eparseFloat(ut)){tt=String(lt);break t}}tt=ut}var dt,ft={};function gt(){return function(t){var e=ft;return Object.prototype.hasOwnProperty.call(e,9)?e[9]:e[9]=t(9)}((function(){let t=0;const e=$(String(tt)).split("."),n=$("9").split("."),s=Math.max(e.length,n.length);for(let o=0;0==t&&o>>0);function Ut(t){return"function"==typeof t?t:(t[Vt]||(t[Vt]=function(e){return t.handleEvent(e)}),t[Vt])}function qt(){F.call(this),this.i=new _t(this),this.P=this,this.I=null}function Bt(t,e){var n,s=t.I;if(s)for(n=[];s;s=s.I)n.push(s);if(t=t.P,s=e.type||e,"string"==typeof e)e=new wt(e,t);else if(e instanceof wt)e.target=e.target||t;else{var r=e;J(e=new wt(s,t),r)}if(r=!0,n)for(var i=n.length-1;0<=i;i--){var o=e.g=n[i];r=jt(o,s,!0,e)&&r}if(r=jt(o=e.g=t,s,!0,e)&&r,r=jt(o,s,!1,e)&&r,n)for(i=0;inew Ht),(t=>t.reset()));class Ht{constructor(){this.next=this.g=this.h=null}set(t,e){this.h=t,this.g=e,this.next=null}reset(){this.next=this.g=this.h=null}}function Qt(t){_.setTimeout((()=>{throw t}),0)}function Wt(t,e){Gt||function(){var t=_.Promise.resolve(void 0);Gt=function(){t.then(Jt)}}(),Yt||(Gt(),Yt=!0),Xt.add(t,e)}var Yt=!1,Xt=new class{constructor(){this.h=this.g=null}add(t,e){const n=zt.get();n.set(t,e),this.h?this.h.next=n:this.g=n,this.h=n}};function Jt(){for(var t;t=$t();){try{t.h.call(t.g)}catch(t){Qt(t)}var e=zt;e.j(t),100>e.h&&(e.h++,t.next=e.g,e.g=t)}Yt=!1}function Zt(t,e){qt.call(this),this.h=t||1,this.g=e||_,this.j=L(this.kb,this),this.l=Date.now()}function te(t){t.da=!1,t.S&&(t.g.clearTimeout(t.S),t.S=null)}function ee(t,e,n){if("function"==typeof t)n&&(t=L(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=L(t.handleEvent,t)}return 2147483647{t.g=null,t.i&&(t.i=!1,ne(t))}),t.j);const e=t.h;t.h=null,t.m.apply(null,e)}M(Zt,qt),(E=Zt.prototype).da=!1,E.S=null,E.kb=function(){if(this.da){var t=Date.now()-this.l;0s.length)){var r=s[1];if(Array.isArray(r)&&!(1>r.length)){var i=r[0];if("noop"!=i&&"stop"!=i&&"close"!=i)for(var o=1;oe.length?Le:(e=e.substr(s,n),t.C=s+n,e))}function Ue(t){t.Y=Date.now()+t.P,qe(t,t.P)}function qe(t,e){if(null!=t.B)throw Error("WatchDog timer not null");t.B=we(L(t.eb,t),e)}function Be(t){t.B&&(_.clearTimeout(t.B),t.B=null)}function je(t){0==t.l.G||t.I||ds(t.l,t)}function Ke(t){Be(t);var e=t.L;e&&"function"==typeof e.na&&e.na(),t.L=null,te(t.W),ae(t.V),t.g&&(e=t.g,t.g=null,e.abort(),e.na())}function $e(t,e){try{var n=t.l;if(0!=n.G&&(n.g==t||In(n.i,t)))if(n.I=t.N,!t.J&&In(n.i,t)&&3==n.G){try{var s=n.Ca.g.parse(e)}catch(t){s=null}if(Array.isArray(s)&&3==s.length){var r=s;if(0==r[0]){t:if(!n.u){if(n.g){if(!(n.g.F+3e3r[2]&&n.N&&0==n.A&&!n.v&&(n.v=we(L(n.ab,n),6e3));if(1>=En(n.i)&&n.ka){try{n.ka()}catch(t){}n.ka=void 0}}else gs(n,11)}else if((t.J||n.g==t)&&ls(n),!j(e))for(r=n.Ca.g.parse(e),e=0;eh)&&(3!=h||it||this.g&&(this.h.h||this.g.ga()||Wn(this.g)))){this.I||4!=h||7==e||ge(8==e||0>=l?3:2),Be(this);var n=this.g.ba();this.N=n;e:if(Fe(this)){var s=Wn(this.g);t="";var r=s.length,i=4==Qn(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){Ke(this),je(this);var o="";break e}this.h.i=new _.TextDecoder}for(e=0;ee)throw Error("Bad port number "+e);t.m=e}else t.m=null}function en(t,e,n){e instanceof fn?(t.h=e,function(t,e){e&&!t.j&&(gn(t),t.i=null,t.g.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(mn(this,e),yn(this,n,t))}),t)),t.j=e}(t.h,t.g)):(n||(e=on(e,ln)),t.h=new fn(e,t.g))}function nn(t,e,n){t.h.set(e,n)}function sn(t){return nn(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function rn(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function on(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,an),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function an(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Ye.prototype.toString=function(){var t=[],e=this.j;e&&t.push(on(e,cn,!0),":");var n=this.i;return(n||"file"==e)&&(t.push("//"),(e=this.s)&&t.push(on(e,cn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&t.push(":",String(n))),(n=this.l)&&(this.i&&"/"!=n.charAt(0)&&t.push("/"),t.push(on(n,"/"==n.charAt(0)?hn:un,!0))),(n=this.h.toString())&&t.push("?",n),(n=this.o)&&t.push("#",on(n,dn)),t.join("")};var cn=/[#\/\?@]/g,un=/[#\?:]/g,hn=/[#\?]/g,ln=/[#\?@]/g,dn=/#/g;function fn(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function gn(t){t.g||(t.g=new ze,t.h=0,t.i&&function(t,e){if(t){t=t.split("&");for(var n=0;n2*t.i&&He(t)))}function pn(t,e){return gn(t),e=wn(t,e),Qe(t.g.h,e)}function yn(t,e,n){mn(t,e),0=t.j}function En(t){return t.h?1:t.g?t.g.size:0}function In(t,e){return t.h?t.h==e:!!t.g&&t.g.has(e)}function Sn(t,e){t.g?t.g.add(e):t.h=e}function _n(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}function Nn(t){if(null!=t.h)return t.i.concat(t.h.D);if(null!=t.g&&0!==t.g.size){let e=t.i;for(const n of t.g.values())e=e.concat(n.D);return e}return B(t.i)}function An(){}function Dn(){this.g=new An}function xn(t,e,n){const s=n||"";try{Ge(t,(function(t,n){let r=t;D(t)&&(r=Kt(t)),e.push(s+n+"="+encodeURIComponent(r))}))}catch(t){throw e.push(s+"type="+encodeURIComponent("_badmap")),t}}function Cn(t,e,n,s,r){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,r(s)}catch(t){}}function kn(t){this.l=t.$b||null,this.j=t.ib||!1}function Rn(t,e){qt.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=Ln,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}vn.prototype.cancel=function(){if(this.i=Nn(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const t of this.g.values())t.cancel();this.g.clear()}},An.prototype.stringify=function(t){return _.JSON.stringify(t,void 0)},An.prototype.parse=function(t){return _.JSON.parse(t,void 0)},M(kn,Te),kn.prototype.g=function(){return new Rn(this.l,this.j)},kn.prototype.i=function(t){return function(){return t}}({}),M(Rn,qt);var Ln=0;function On(t){t.j.read().then(t.Sa.bind(t)).catch(t.ha.bind(t))}function Mn(t){t.readyState=4,t.l=null,t.j=null,t.A=null,Fn(t)}function Fn(t){t.onreadystatechange&&t.onreadystatechange.call(t)}(E=Rn.prototype).open=function(t,e){if(this.readyState!=Ln)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,Fn(this)},E.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||_).fetch(new Request(this.B,e)).then(this.Va.bind(this),this.ha.bind(this))},E.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,Mn(this)),this.readyState=Ln},E.Va=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,Fn(this)),this.g&&(this.readyState=3,Fn(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(void 0!==_.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;On(this)}else t.text().then(this.Ua.bind(this),this.ha.bind(this))},E.Sa=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?Mn(this):Fn(this),3==this.readyState&&On(this)}},E.Ua=function(t){this.g&&(this.response=this.responseText=t,Mn(this))},E.Ta=function(t){this.g&&(this.response=t,Mn(this))},E.ha=function(){this.g&&Mn(this)},E.setRequestHeader=function(t,e){this.v.append(t,e)},E.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},E.getAllResponseHeaders=function(){if(!this.h)return"";const t=[],e=this.h.entries();for(var n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(Rn.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}});var Pn=_.JSON.parse;function Vn(t){qt.call(this),this.headers=new ze,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=Un,this.K=this.L=!1}M(Vn,qt);var Un="",qn=/^https?$/i,Bn=["POST","PUT"];function jn(t){return"content-type"==t.toLowerCase()}function Kn(t,e){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=e,t.m=5,$n(t),zn(t)}function $n(t){t.D||(t.D=!0,Bt(t,"complete"),Bt(t,"error"))}function Gn(t){if(t.h&&void 0!==S&&(!t.C[1]||4!=Qn(t)||2!=t.ba()))if(t.v&&4==Qn(t))ee(t.Fa,0,t);else if(Bt(t,"readystatechange"),4==Qn(t)){t.h=!1;try{const a=t.ba();t:switch(a){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break t;default:e=!1}var n;if(!(n=e)){var s;if(s=0===a){var r=String(t.H).match(We)[1]||null;if(!r&&_.self&&_.self.location){var i=_.self.location.protocol;r=i.substr(0,i.length-1)}s=!qn.test(r?r.toLowerCase():"")}n=s}if(n)Bt(t,"complete"),Bt(t,"success");else{t.m=6;try{var o=2n)e=Math.max(0,r[o].h-100),i=!1;else try{xn(a,t,"req"+n+"_")}catch(t){s&&s(a)}}if(i){s=t.join("&");break t}}}return t=t.l.splice(0,n),e.D=t,s}function as(t){t.g||t.u||(t.Y=1,Wt(t.Ga,t),t.A=0)}function cs(t){return!(t.g||t.u||3<=t.A)&&(t.Y++,t.u=we(L(t.Ga,t),fs(t,t.A)),t.A++,!0)}function us(t){null!=t.B&&(_.clearTimeout(t.B),t.B=null)}function hs(t){t.g=new xe(t,t.h,"rpc",t.Y),null===t.o&&(t.g.H=t.s),t.g.O=0;var e=Xe(t.oa);nn(e,"RID","rpc"),nn(e,"SID",t.J),nn(e,"CI",t.N?"0":"1"),nn(e,"AID",t.U),is(t,e),nn(e,"TYPE","xmlhttp"),t.o&&t.s&&Yn(e,t.o,t.s),t.K&&t.g.setTimeout(t.K);var n=t.g;t=t.la,n.K=1,n.v=sn(Xe(e)),n.s=null,n.U=!0,Me(n,t)}function ls(t){null!=t.v&&(_.clearTimeout(t.v),t.v=null)}function ds(t,e){var n=null;if(t.g==e){ls(t),us(t),t.g=null;var s=2}else{if(!In(t.i,e))return;n=e.D,_n(t.i,e),s=1}if(t.I=e.N,0!=t.G)if(e.i)if(1==s){n=e.s?e.s.length:0,e=Date.now()-e.F;var r=t.C;Bt(s=de(),new ye(s,n,e,r)),ss(t)}else as(t);else if(3==(r=e.o)||0==r&&0=t.i.j-(t.m?1:0)||(t.m?(t.l=e.D.concat(t.l),0):1==t.G||2==t.G||t.C>=(t.Xa?0:t.Ya)||(t.m=we(L(t.Ha,t,e),fs(t,t.C)),t.C++,0)))}(t,e)||2==s&&cs(t)))switch(n&&0e?null:"string"==typeof t?t.charAt(e):t[e]}(r.T()),n=_.FormData&&t instanceof _.FormData,!(0<=V(Bn,e))||s||n||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),r.forEach((function(t,e){this.g.setRequestHeader(e,t)}),this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Hn(this),0=this.O)){var t=2*this.O;this.h.info("BP detection timer enabled: "+t),this.B=we(L(this.bb,this),t)}},E.bb=function(){this.B&&(this.B=null,this.h.info("BP detection timeout reached."),this.h.info("Buffering proxy detected and switch to long-polling!"),this.N=!1,this.L=!0,pe(10),ts(this),hs(this))},E.ab=function(){null!=this.v&&(this.v=null,ts(this),cs(this),pe(19))},E.jb=function(t){t?(this.h.info("Successfully pinged google.com"),pe(2)):(this.h.info("Failed to ping google.com"),pe(1))},(E=ws.prototype).xa=function(){},E.wa=function(){},E.va=function(){},E.ua=function(){},E.Oa=function(){},vs.prototype.g=function(t,e){return new bs(t,e)},M(bs,qt),bs.prototype.m=function(){this.g.j=this.j,this.A&&(this.g.H=!0);var t=this.g,e=this.l,n=this.h||void 0;t.Wa&&(t.h.info("Origin Trials enabled."),Wt(L(t.hb,t,e))),pe(0),t.W=e,t.aa=n||{},t.N=t.X,t.F=ps(t,null,t.W),ss(t)},bs.prototype.close=function(){Zn(this.g)},bs.prototype.u=function(t){if("string"==typeof t){var e={};e.__data__=t,ns(this.g,e)}else this.v?((e={}).__data__=Kt(t),ns(this.g,e)):ns(this.g,t)},bs.prototype.M=function(){this.g.j=null,delete this.j,Zn(this.g),delete this.g,bs.Z.M.call(this)},M(Ts,Ne),M(Es,Ae),M(Is,ws),Is.prototype.xa=function(){Bt(this.g,"a")},Is.prototype.wa=function(t){Bt(this.g,new Ts(t))},Is.prototype.va=function(t){Bt(this.g,new Es(t))},Is.prototype.ua=function(){Bt(this.g,"b")},vs.prototype.createWebChannel=vs.prototype.g,bs.prototype.send=bs.prototype.u,bs.prototype.open=bs.prototype.m,bs.prototype.close=bs.prototype.close,ve.NO_ERROR=0,ve.TIMEOUT=8,ve.HTTP_ERROR=6,be.COMPLETE="complete",Ie.EventType=_e,_e.OPEN="a",_e.CLOSE="b",_e.ERROR="c",_e.MESSAGE="d",qt.prototype.listen=qt.prototype.N,Vn.prototype.listenOnce=Vn.prototype.O,Vn.prototype.getLastError=Vn.prototype.La,Vn.prototype.getLastErrorCode=Vn.prototype.Da,Vn.prototype.getStatus=Vn.prototype.ba,Vn.prototype.getResponseJson=Vn.prototype.Qa,Vn.prototype.getResponseText=Vn.prototype.ga,Vn.prototype.send=Vn.prototype.ea;var Ss=ve,_s=be,Ns=he,As=10,Ds=11,xs=kn,Cs=Ie,ks=Vn;const Rs="@firebase/firestore"; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ls{constructor(t){this.uid=t}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(t){return t.uid===this.uid}}Ls.UNAUTHENTICATED=new Ls(null),Ls.GOOGLE_CREDENTIALS=new Ls("google-credentials-uid"),Ls.FIRST_PARTY=new Ls("first-party-uid"),Ls.MOCK_USER=new Ls("mock-user"); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +let Os="9.3.0"; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Ms=new class{constructor(t){this.name=t,this._logLevel=v,this._logHandler=T,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in p))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?w[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,p.DEBUG,...t),this._logHandler(this,p.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,p.VERBOSE,...t),this._logHandler(this,p.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,p.INFO,...t),this._logHandler(this,p.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,p.WARN,...t),this._logHandler(this,p.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,p.ERROR,...t),this._logHandler(this,p.ERROR,...t)}}("@firebase/firestore");function Fs(){return Ms.logLevel}function Ps(t){Ms.setLogLevel(t)}function Vs(t,...e){if(Ms.logLevel<=p.DEBUG){const n=e.map(Bs);Ms.debug(`Firestore (${Os}): ${t}`,...n)}}function Us(t,...e){if(Ms.logLevel<=p.ERROR){const n=e.map(Bs);Ms.error(`Firestore (${Os}): ${t}`,...n)}}function qs(t,...e){if(Ms.logLevel<=p.WARN){const n=e.map(Bs);Ms.warn(`Firestore (${Os}): ${t}`,...n)}}function Bs(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var e} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function js(t="Unexpected state"){const e=`FIRESTORE (${Os}) INTERNAL ASSERTION FAILED: `+t;throw Us(e),new Error(e)}function Ks(t,e){t||js()}function $s(t,e){t||js()}function Gs(t,e){return t} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const zs={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Hs extends Error{constructor(t,e){super(e),this.code=t,this.message=e,this.name="FirebaseError",this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Qs{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ws{constructor(t,e){this.user=e,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization=`Bearer ${t}`}}class Ys{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,e){t.enqueueRetryable((()=>e(Ls.UNAUTHENTICATED)))}shutdown(){}}class Xs{constructor(t){this.token=t,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(t,e){this.changeListener=e,t.enqueueRetryable((()=>e(this.token.user)))}shutdown(){this.changeListener=null}}class Js{constructor(t){this.t=t,this.currentUser=Ls.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(t,e){let n=this.i;const s=t=>this.i!==n?(n=this.i,e(t)):Promise.resolve();let r=new Qs;this.o=()=>{this.i++,this.currentUser=this.u(),r.resolve(),r=new Qs,t.enqueueRetryable((()=>s(this.currentUser)))};const i=()=>{const e=r;t.enqueueRetryable((async()=>{await e.promise,await s(this.currentUser)}))},o=t=>{Vs("FirebaseCredentialsProvider","Auth detected"),this.auth=t,this.auth.addAuthTokenListener(this.o),i()};this.t.onInit((t=>o(t))),setTimeout((()=>{if(!this.auth){const t=this.t.getImmediate({optional:!0});t?o(t):(Vs("FirebaseCredentialsProvider","Auth not yet detected"),r.resolve(),r=new Qs)}}),0),i()}getToken(){const t=this.i,e=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(e).then((e=>this.i!==t?(Vs("FirebaseCredentialsProvider","getToken aborted due to token change."),this.getToken()):e?(Ks("string"==typeof e.accessToken),new Ws(e.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const t=this.auth&&this.auth.getUid();return Ks(null===t||"string"==typeof t),new Ls(t)}}class Zs{constructor(t,e,n){this.h=t,this.l=e,this.m=n,this.type="FirstParty",this.user=Ls.FIRST_PARTY}get authHeaders(){const t={"X-Goog-AuthUser":this.l},e=this.h.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),this.m&&(t["X-Goog-Iam-Authorization-Token"]=this.m),t}}class tr{constructor(t,e,n){this.h=t,this.l=e,this.m=n}getToken(){return Promise.resolve(new Zs(this.h,this.l,this.m))}start(t,e){t.enqueueRetryable((()=>e(Ls.FIRST_PARTY)))}shutdown(){}invalidateToken(){}} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class er{constructor(t,e){this.previousValue=t,e&&(e.sequenceNumberHandler=t=>this.g(t),this.p=t=>e.writeSequenceNumber(t))}g(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this.p&&this.p(t),t}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function nr(t){const e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(let e=0;ee?1:0}function ir(t,e,n){return t.length===e.length&&t.every(((t,s)=>n(t,e[s])))}function or(t){return t+"\0"} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ar{constructor(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new Hs(zs.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new Hs(zs.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new Hs(zs.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new Hs(zs.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}static now(){return ar.fromMillis(Date.now())}static fromDate(t){return ar.fromMillis(t.getTime())}static fromMillis(t){const e=Math.floor(t/1e3),n=Math.floor(1e6*(t-1e3*e));return new ar(e,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(t){return this.seconds===t.seconds?rr(this.nanoseconds,t.nanoseconds):rr(this.seconds,t.seconds)}isEqual(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class cr{constructor(t){this.timestamp=t}static fromTimestamp(t){return new cr(t)}static min(){return new cr(new ar(0,0))}compareTo(t){return this.timestamp._compareTo(t.timestamp)}isEqual(t){return this.timestamp.isEqual(t.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ur(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function hr(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function lr(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class dr{constructor(t,e,n){void 0===e?e=0:e>t.length&&js(),void 0===n?n=t.length-e:n>t.length-e&&js(),this.segments=t,this.offset=e,this.len=n}get length(){return this.len}isEqual(t){return 0===dr.comparator(this,t)}child(t){const e=this.segments.slice(this.offset,this.limit());return t instanceof dr?t.forEach((t=>{e.push(t)})):e.push(t),this.construct(e)}limit(){return this.offset+this.length}popFirst(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(t){return this.segments[this.offset+t]}isEmpty(){return 0===this.length}isPrefixOf(t){if(t.lengthr)return 1}return t.lengthe.length?1:0}}class fr extends dr{construct(t,e,n){return new fr(t,e,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...t){const e=[];for(const n of t){if(n.indexOf("//")>=0)throw new Hs(zs.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);e.push(...n.split("/").filter((t=>t.length>0)))}return new fr(e)}static emptyPath(){return new fr([])}}const gr=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class mr extends dr{construct(t,e,n){return new mr(t,e,n)}static isValidIdentifier(t){return gr.test(t)}canonicalString(){return this.toArray().map((t=>(t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),mr.isValidIdentifier(t)||(t="`"+t+"`"),t))).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new mr(["__name__"])}static fromServerFormat(t){const e=[];let n="",s=0;const r=()=>{if(0===n.length)throw new Hs(zs.INVALID_ARGUMENT,`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);e.push(n),n=""};let i=!1;for(;st.isEqual(e)))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function yr(){return"undefined"!=typeof atob} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class wr{constructor(t){this.binaryString=t}static fromBase64String(t){const e=atob(t);return new wr(e)}static fromUint8Array(t){const e=function(t){let e="";for(let n=0;n=Number.MIN_SAFE_INTEGER} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xr{constructor(t){this.path=t}static fromPath(t){return new xr(fr.fromString(t))}static fromName(t){return new xr(fr.fromString(t).popFirst(5))}hasCollectionId(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t}isEqual(t){return null!==t&&0===fr.comparator(this.path,t.path)}toString(){return this.path.toString()}static comparator(t,e){return fr.comparator(t.path,e.path)}static isDocumentKey(t){return t.length%2==0}static fromSegments(t){return new xr(new fr(t.slice()))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Cr(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?Ir(t)?4:10:js()}function kr(t,e){const n=Cr(t);if(n!==Cr(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return _r(t).isEqual(_r(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;const n=br(t.timestampValue),s=br(e.timestampValue);return n.seconds===s.seconds&&n.nanos===s.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return Er(t.bytesValue).isEqual(Er(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return Tr(t.geoPointValue.latitude)===Tr(e.geoPointValue.latitude)&&Tr(t.geoPointValue.longitude)===Tr(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return Tr(t.integerValue)===Tr(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){const n=Tr(t.doubleValue),s=Tr(e.doubleValue);return n===s?Ar(n)===Ar(s):isNaN(n)&&isNaN(s)}return!1}(t,e);case 9:return ir(t.arrayValue.values||[],e.arrayValue.values||[],kr);case 10:return function(t,e){const n=t.mapValue.fields||{},s=e.mapValue.fields||{};if(ur(n)!==ur(s))return!1;for(const t in n)if(n.hasOwnProperty(t)&&(void 0===s[t]||!kr(n[t],s[t])))return!1;return!0}(t,e);default:return js()}}function Rr(t,e){return void 0!==(t.values||[]).find((t=>kr(t,e)))}function Lr(t,e){const n=Cr(t),s=Cr(e);if(n!==s)return rr(n,s);switch(n){case 0:return 0;case 1:return rr(t.booleanValue,e.booleanValue);case 2:return function(t,e){const n=Tr(t.integerValue||t.doubleValue),s=Tr(e.integerValue||e.doubleValue);return ns?1:n===s?0:isNaN(n)?isNaN(s)?0:-1:1}(t,e);case 3:return Or(t.timestampValue,e.timestampValue);case 4:return Or(_r(t),_r(e));case 5:return rr(t.stringValue,e.stringValue);case 6:return function(t,e){const n=Er(t),s=Er(e);return n.compareTo(s)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){const n=t.split("/"),s=e.split("/");for(let t=0;te.mapValue.fields[t]=Kr(n))),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Kr(t.arrayValue.values[n]);return e}return Object.assign({},t)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class $r{constructor(t){this.value=t}static empty(){return new $r({mapValue:{}})}field(t){if(t.isEmpty())return this.value;{let e=this.value;for(let n=0;n{if(!e.isImmediateParentOf(r)){const t=this.getFieldsMap(e);this.applyChanges(t,n,s),n={},s=[],e=r.popLast()}t?n[r.lastSegment()]=Kr(t):s.push(r.lastSegment())}));const r=this.getFieldsMap(e);this.applyChanges(r,n,s)}delete(t){const e=this.field(t.popLast());jr(e)&&e.mapValue.fields&&delete e.mapValue.fields[t.lastSegment()]}isEqual(t){return kr(this.value,t.value)}getFieldsMap(t){let e=this.value;e.mapValue.fields||(e.mapValue={fields:{}});for(let n=0;nt[e]=n));for(const e of n)delete t[e]}clone(){return new $r(Kr(this.value))}}function Gr(t){const e=[];return hr(t.fields,((t,n)=>{const s=new mr([t]);if(jr(n)){const t=Gr(n.mapValue).fields;if(0===t.length)e.push(s);else for(const n of t)e.push(s.child(n))}else e.push(s)})),new pr(e) +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class zr{constructor(t,e,n,s,r){this.key=t,this.documentType=e,this.version=n,this.data=s,this.documentState=r}static newInvalidDocument(t){return new zr(t,0,cr.min(),$r.empty(),0)}static newFoundDocument(t,e,n){return new zr(t,1,e,n,0)}static newNoDocument(t,e){return new zr(t,2,e,$r.empty(),0)}static newUnknownDocument(t,e){return new zr(t,3,e,$r.empty(),2)}convertToFoundDocument(t,e){return this.version=t,this.documentType=1,this.data=e,this.documentState=0,this}convertToNoDocument(t){return this.version=t,this.documentType=2,this.data=$r.empty(),this.documentState=0,this}convertToUnknownDocument(t){return this.version=t,this.documentType=3,this.data=$r.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(t){return t instanceof zr&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)}clone(){return new zr(this.key,this.documentType,this.version,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Hr{constructor(t,e=null,n=[],s=[],r=null,i=null,o=null){this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=s,this.limit=r,this.startAt=i,this.endAt=o,this.A=null}}function Qr(t,e=null,n=[],s=[],r=null,i=null,o=null){return new Hr(t,e,n,s,r,i,o)}function Wr(t){const e=Gs(t);if(null===e.A){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map((t=>function(t){return t.field.canonicalString()+t.op.toString()+Mr(t.value)}(t))).join(","),t+="|ob:",t+=e.orderBy.map((t=>function(t){return t.field.canonicalString()+t.dir}(t))).join(","),Nr(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=ci(e.startAt)),e.endAt&&(t+="|ub:",t+=ci(e.endAt)),e.A=t}return e.A}function Yr(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n":return t>0;case">=":return t>=0;default:return js()}}v(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}}class Zr extends Jr{constructor(t,e,n){super(t,e,n),this.key=xr.fromName(n.referenceValue)}matches(t){const e=xr.comparator(t.key,this.key);return this.P(e)}}class ti extends Jr{constructor(t,e){super(t,"in",e),this.keys=ni("in",e)}matches(t){return this.keys.some((e=>e.isEqual(t.key)))}}class ei extends Jr{constructor(t,e){super(t,"not-in",e),this.keys=ni("not-in",e)}matches(t){return!this.keys.some((e=>e.isEqual(t.key)))}}function ni(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((t=>xr.fromName(t.referenceValue)))}class si extends Jr{constructor(t,e){super(t,"array-contains",e)}matches(t){const e=t.data.field(this.field);return Ur(e)&&Rr(e.arrayValue,this.value)}}class ri extends Jr{constructor(t,e){super(t,"in",e)}matches(t){const e=t.data.field(this.field);return null!==e&&Rr(this.value.arrayValue,e)}}class ii extends Jr{constructor(t,e){super(t,"not-in",e)}matches(t){if(Rr(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const e=t.data.field(this.field);return null!==e&&!Rr(this.value.arrayValue,e)}}class oi extends Jr{constructor(t,e){super(t,"array-contains-any",e)}matches(t){const e=t.data.field(this.field);return!(!Ur(e)||!e.arrayValue.values)&&e.arrayValue.values.some((t=>Rr(this.value.arrayValue,t)))}}class ai{constructor(t,e){this.position=t,this.before=e}}function ci(t){return`${t.before?"b":"a"}:${t.position.map((t=>Mr(t))).join(",")}`}class ui{constructor(t,e="asc"){this.field=t,this.dir=e}}function hi(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function li(t,e,n){let s=0;for(let r=0;r0?t.explicitOrderBy[0].field:null}function vi(t){for(const e of t.filters)if(e.v())return e.field;return null}function bi(t){return null!==t.collectionGroup}function Ti(t){const e=Gs(t);if(null===e.V){e.V=[];const t=vi(e),n=wi(e);if(null!==t&&null===n)t.isKeyField()||e.V.push(new ui(t)),e.V.push(new ui(mr.keyField(),"asc"));else{let t=!1;for(const n of e.explicitOrderBy)e.V.push(n),n.field.isKeyField()&&(t=!0);if(!t){const t=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.V.push(new ui(mr.keyField(),t))}}}return e.V}function Ei(t){const e=Gs(t);if(!e.S)if("F"===e.limitType)e.S=Qr(e.path,e.collectionGroup,Ti(e),e.filters,e.limit,e.startAt,e.endAt);else{const t=[];for(const n of Ti(e)){const e="desc"===n.dir?"asc":"desc";t.push(new ui(n.field,e))}const n=e.endAt?new ai(e.endAt.position,!e.endAt.before):null,s=e.startAt?new ai(e.startAt.position,!e.startAt.before):null;e.S=Qr(e.path,e.collectionGroup,t,e.filters,e.limit,n,s)}return e.S}function Ii(t,e,n){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function Si(t,e){return Yr(Ei(t),Ei(e))&&t.limitType===e.limitType}function _i(t){return`${Wr(Ei(t))}|lt:${t.limitType}`}function Ni(t){return`Query(target=${function(t){let e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=`, filters: [${t.filters.map((t=>{var e;return`${(e=t).field.canonicalString()} ${e.op} ${Mr(e.value)}`})).join(", ")}]`),Nr(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=`, orderBy: [${t.orderBy.map((t=>function(t){return`${t.field.canonicalString()} (${t.dir})`}(t))).join(", ")}]`),t.startAt&&(e+=", startAt: "+ci(t.startAt)),t.endAt&&(e+=", endAt: "+ci(t.endAt)),`Target(${e})`}(Ei(t))}; limitType=${t.limitType})`}function Ai(t,e){return e.isFoundDocument()&&function(t,e){const n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):xr.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(const n of t.explicitOrderBy)if(!n.field.isKeyField()&&null===e.data.field(n.field))return!1;return!0}(t,e)&&function(t,e){for(const n of t.filters)if(!n.matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!li(t.startAt,Ti(t),e))&&(!t.endAt||!li(t.endAt,Ti(t),e))}(t,e)}function Di(t){return(e,n)=>{let s=!1;for(const r of Ti(t)){const t=xi(r,e,n);if(0!==t)return t;s=s||r.field.isKeyField()}return 0}}function xi(t,e,n){const s=t.field.isKeyField()?xr.comparator(e.key,n.key):function(t,e,n){const s=e.data.field(t),r=n.data.field(t);return null!==s&&null!==r?Lr(s,r):js()}(t.field,e,n);switch(t.dir){case"asc":return s;case"desc":return-1*s;default:return js()}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Ci(t,e){if(t.D){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Ar(e)?"-0":e}}function ki(t){return{integerValue:""+t}}function Ri(t,e){return Dr(e)?ki(e):Ci(t,e)} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Li{constructor(){this._=void 0}}function Oi(t,e,n){return t instanceof Pi?function(t,e){const n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof Vi?Ui(t,e):t instanceof qi?Bi(t,e):function(t,e){const n=Fi(t,e),s=Ki(n)+Ki(t.C);return Vr(n)&&Vr(t.C)?ki(s):Ci(t.N,s)}(t,e)}function Mi(t,e,n){return t instanceof Vi?Ui(t,e):t instanceof qi?Bi(t,e):n}function Fi(t,e){var n;return t instanceof ji?Vr(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null}class Pi extends Li{}class Vi extends Li{constructor(t){super(),this.elements=t}}function Ui(t,e){const n=$i(e);for(const e of t.elements)n.some((t=>kr(t,e)))||n.push(e);return{arrayValue:{values:n}}}class qi extends Li{constructor(t){super(),this.elements=t}}function Bi(t,e){let n=$i(e);for(const e of t.elements)n=n.filter((t=>!kr(t,e)));return{arrayValue:{values:n}}}class ji extends Li{constructor(t,e){super(),this.N=t,this.C=e}}function Ki(t){return Tr(t.integerValue||t.doubleValue)}function $i(t){return Ur(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Gi{constructor(t,e){this.field=t,this.transform=e}}class zi{constructor(t,e){this.version=t,this.transformResults=e}}class Hi{constructor(t,e){this.updateTime=t,this.exists=e}static none(){return new Hi}static exists(t){return new Hi(void 0,t)}static updateTime(t){return new Hi(t)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function Qi(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}class Wi{}function Yi(t,e,n){t instanceof eo?function(t,e,n){const s=t.value.clone(),r=ro(t.fieldTransforms,e,n.transformResults);s.setAll(r),e.convertToFoundDocument(n.version,s).setHasCommittedMutations()}(t,e,n):t instanceof no?function(t,e,n){if(!Qi(t.precondition,e))return void e.convertToUnknownDocument(n.version);const s=ro(t.fieldTransforms,e,n.transformResults),r=e.data;r.setAll(so(t)),r.setAll(s),e.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function Xi(t,e,n){t instanceof eo?function(t,e,n){if(!Qi(t.precondition,e))return;const s=t.value.clone(),r=io(t.fieldTransforms,n,e);s.setAll(r),e.convertToFoundDocument(to(e),s).setHasLocalMutations()}(t,e,n):t instanceof no?function(t,e,n){if(!Qi(t.precondition,e))return;const s=io(t.fieldTransforms,n,e),r=e.data;r.setAll(so(t)),r.setAll(s),e.convertToFoundDocument(to(e),r).setHasLocalMutations()}(t,e,n):function(t,e){Qi(t.precondition,e)&&e.convertToNoDocument(cr.min())}(t,e)}function Ji(t,e){let n=null;for(const s of t.fieldTransforms){const t=e.data.field(s.field),r=Fi(s.transform,t||null);null!=r&&(null==n&&(n=$r.empty()),n.set(s.field,r))}return n||null}function Zi(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&ir(t,e,((t,e)=>function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof Vi&&e instanceof Vi||t instanceof qi&&e instanceof qi?ir(t.elements,e.elements,kr):t instanceof ji&&e instanceof ji?kr(t.C,e.C):t instanceof Pi&&e instanceof Pi}(t.transform,e.transform)}(t,e)))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}function to(t){return t.isFoundDocument()?t.version:cr.min()}class eo extends Wi{constructor(t,e,n,s=[]){super(),this.key=t,this.value=e,this.precondition=n,this.fieldTransforms=s,this.type=0}}class no extends Wi{constructor(t,e,n,s,r=[]){super(),this.key=t,this.data=e,this.fieldMask=n,this.precondition=s,this.fieldTransforms=r,this.type=1}}function so(t){const e=new Map;return t.fieldMask.fields.forEach((n=>{if(!n.isEmpty()){const s=t.data.field(n);e.set(n,s)}})),e}function ro(t,e,n){const s=new Map;Ks(t.length===n.length);for(let r=0;r0&&(e=e.right)}return null}indexOf(t){let e=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(t,n.key);if(0===s)return e+n.left.size;s<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(t){return this.root.inorderTraversal(t)}forEach(t){this.inorderTraversal(((e,n)=>(t(e,n),!1)))}toString(){const t=[];return this.inorderTraversal(((e,n)=>(t.push(`${e}:${n}`),!1))),`{${t.join(", ")}}`}reverseTraversal(t){return this.root.reverseTraversal(t)}getIterator(){return new mo(this.root,null,this.comparator,!1)}getIteratorFrom(t){return new mo(this.root,t,this.comparator,!1)}getReverseIterator(){return new mo(this.root,null,this.comparator,!0)}getReverseIteratorFrom(t){return new mo(this.root,t,this.comparator,!0)}}class mo{constructor(t,e,n,s){this.isReverse=s,this.nodeStack=[];let r=1;for(;!t.isEmpty();)if(r=e?n(t.key,e):1,s&&(r*=-1),r<0)t=this.isReverse?t.left:t.right;else{if(0===r){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}getNext(){let t=this.nodeStack.pop();const e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}}}class po{constructor(t,e,n,s,r){this.key=t,this.value=e,this.color=null!=n?n:po.RED,this.left=null!=s?s:po.EMPTY,this.right=null!=r?r:po.EMPTY,this.size=this.left.size+1+this.right.size}copy(t,e,n,s,r){return new po(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=s?s:this.left,null!=r?r:this.right)}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(t,e,n){let s=this;const r=n(t,s.key);return s=r<0?s.copy(null,null,null,s.left.insert(t,e,n),null):0===r?s.copy(null,e,null,null,null):s.copy(null,null,null,null,s.right.insert(t,e,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return po.EMPTY;let t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()}remove(t,e){let n,s=this;if(e(t,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(t,e),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),0===e(t,s.key)){if(s.right.isEmpty())return po.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(t,e))}return s.fixUp()}isRed(){return this.color}fixUp(){let t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t}moveRedLeft(){let t=this.colorFlip();return t.right.left.isRed()&&(t=t.copy(null,null,null,null,t.right.rotateRight()),t=t.rotateLeft(),t=t.colorFlip()),t}moveRedRight(){let t=this.colorFlip();return t.left.left.isRed()&&(t=t.rotateRight(),t=t.colorFlip()),t}rotateLeft(){const t=this.copy(null,null,po.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight(){const t=this.copy(null,null,po.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip(){const t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)}checkMaxDepth(){const t=this.check();return Math.pow(2,t)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw js();if(this.right.isRed())throw js();const t=this.left.check();if(t!==this.right.check())throw js();return t+(this.isRed()?0:1)}}po.EMPTY=null,po.RED=!0,po.BLACK=!1,po.EMPTY=new class{constructor(){this.size=0}get key(){throw js()}get value(){throw js()}get color(){throw js()}get left(){throw js()}get right(){throw js()}copy(t,e,n,s,r){return this}insert(t,e,n){return new po(t,e)}remove(t,e){return this}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class yo{constructor(t){this.comparator=t,this.data=new go(this.comparator)}has(t){return null!==this.data.get(t)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(t){return this.data.indexOf(t)}forEach(t){this.data.inorderTraversal(((e,n)=>(t(e),!1)))}forEachInRange(t,e){const n=this.data.getIteratorFrom(t[0]);for(;n.hasNext();){const s=n.getNext();if(this.comparator(s.key,t[1])>=0)return;e(s.key)}}forEachWhile(t,e){let n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return}firstAfterOrEqual(t){const e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null}getIterator(){return new wo(this.data.getIterator())}getIteratorFrom(t){return new wo(this.data.getIteratorFrom(t))}add(t){return this.copy(this.data.remove(t).insert(t,!0))}delete(t){return this.has(t)?this.copy(this.data.remove(t)):this}isEmpty(){return this.data.isEmpty()}unionWith(t){let e=this;return e.size{e=e.add(t)})),e}isEqual(t){if(!(t instanceof yo))return!1;if(this.size!==t.size)return!1;const e=this.data.getIterator(),n=t.data.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(0!==this.comparator(t,s))return!1}return!0}toArray(){const t=[];return this.forEach((e=>{t.push(e)})),t}toString(){const t=[];return this.forEach((e=>t.push(e))),"SortedSet("+t.toString()+")"}copy(t){const e=new yo(this.comparator);return e.data=t,e}}class wo{constructor(t){this.iter=t}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const vo=new go(xr.comparator);function bo(){return vo}const To=new go(xr.comparator);function Eo(){return To}const Io=new go(xr.comparator);function So(){return Io}const _o=new yo(xr.comparator);function No(...t){let e=_o;for(const n of t)e=e.add(n);return e}const Ao=new yo(rr);function Do(){return Ao} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xo{constructor(t,e,n,s,r){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=s,this.resolvedLimboDocuments=r}static createSynthesizedRemoteEventForCurrentChange(t,e){const n=new Map;return n.set(t,Co.createSynthesizedTargetChangeForCurrentChange(t,e)),new xo(cr.min(),n,Do(),bo(),No())}}class Co{constructor(t,e,n,s,r){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=s,this.removedDocuments=r}static createSynthesizedTargetChangeForCurrentChange(t,e){return new Co(wr.EMPTY_BYTE_STRING,e,No(),No(),No())}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ko{constructor(t,e,n,s){this.k=t,this.removedTargetIds=e,this.key=n,this.$=s}}class Ro{constructor(t,e){this.targetId=t,this.O=e}}class Lo{constructor(t,e,n=wr.EMPTY_BYTE_STRING,s=null){this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=s}}class Oo{constructor(){this.F=0,this.M=Po(),this.L=wr.EMPTY_BYTE_STRING,this.B=!1,this.U=!0}get current(){return this.B}get resumeToken(){return this.L}get q(){return 0!==this.F}get K(){return this.U}j(t){t.approximateByteSize()>0&&(this.U=!0,this.L=t)}W(){let t=No(),e=No(),n=No();return this.M.forEach(((s,r)=>{switch(r){case 0:t=t.add(s);break;case 2:e=e.add(s);break;case 1:n=n.add(s);break;default:js()}})),new Co(this.L,this.B,t,e,n)}G(){this.U=!1,this.M=Po()}H(t,e){this.U=!0,this.M=this.M.insert(t,e)}J(t){this.U=!0,this.M=this.M.remove(t)}Y(){this.F+=1}X(){this.F-=1}Z(){this.U=!0,this.B=!0}}class Mo{constructor(t){this.tt=t,this.et=new Map,this.nt=bo(),this.st=Fo(),this.it=new yo(rr)}rt(t){for(const e of t.k)t.$&&t.$.isFoundDocument()?this.ot(e,t.$):this.ct(e,t.key,t.$);for(const e of t.removedTargetIds)this.ct(e,t.key,t.$)}at(t){this.forEachTarget(t,(e=>{const n=this.ut(e);switch(t.state){case 0:this.ht(e)&&n.j(t.resumeToken);break;case 1:n.X(),n.q||n.G(),n.j(t.resumeToken);break;case 2:n.X(),n.q||this.removeTarget(e);break;case 3:this.ht(e)&&(n.Z(),n.j(t.resumeToken));break;case 4:this.ht(e)&&(this.lt(e),n.j(t.resumeToken));break;default:js()}}))}forEachTarget(t,e){t.targetIds.length>0?t.targetIds.forEach(e):this.et.forEach(((t,n)=>{this.ht(n)&&e(n)}))}ft(t){const e=t.targetId,n=t.O.count,s=this.dt(e);if(s){const t=s.target;if(Xr(t))if(0===n){const n=new xr(t.path);this.ct(e,n,zr.newNoDocument(n,cr.min()))}else Ks(1===n);else this.wt(e)!==n&&(this.lt(e),this.it=this.it.add(e))}}_t(t){const e=new Map;this.et.forEach(((n,s)=>{const r=this.dt(s);if(r){if(n.current&&Xr(r.target)){const e=new xr(r.target.path);null!==this.nt.get(e)||this.gt(s,e)||this.ct(s,e,zr.newNoDocument(e,t))}n.K&&(e.set(s,n.W()),n.G())}}));let n=No();this.st.forEach(((t,e)=>{let s=!0;e.forEachWhile((t=>{const e=this.dt(t);return!e||2===e.purpose||(s=!1,!1)})),s&&(n=n.add(t))}));const s=new xo(t,e,this.it,this.nt,n);return this.nt=bo(),this.st=Fo(),this.it=new yo(rr),s}ot(t,e){if(!this.ht(t))return;const n=this.gt(t,e.key)?2:0;this.ut(t).H(e.key,n),this.nt=this.nt.insert(e.key,e),this.st=this.st.insert(e.key,this.yt(e.key).add(t))}ct(t,e,n){if(!this.ht(t))return;const s=this.ut(t);this.gt(t,e)?s.H(e,1):s.J(e),this.st=this.st.insert(e,this.yt(e).delete(t)),n&&(this.nt=this.nt.insert(e,n))}removeTarget(t){this.et.delete(t)}wt(t){const e=this.ut(t).W();return this.tt.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size}Y(t){this.ut(t).Y()}ut(t){let e=this.et.get(t);return e||(e=new Oo,this.et.set(t,e)),e}yt(t){let e=this.st.get(t);return e||(e=new yo(rr),this.st=this.st.insert(t,e)),e}ht(t){const e=null!==this.dt(t);return e||Vs("WatchChangeAggregator","Detected inactive target",t),e}dt(t){const e=this.et.get(t);return e&&e.q?null:this.tt.Tt(t)}lt(t){this.et.set(t,new Oo),this.tt.getRemoteKeysForTarget(t).forEach((e=>{this.ct(t,e,null)}))}gt(t,e){return this.tt.getRemoteKeysForTarget(t).has(e)}}function Fo(){return new go(xr.comparator)}function Po(){return new go(xr.comparator)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Vo={asc:"ASCENDING",desc:"DESCENDING"},Uo={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"};class qo{constructor(t,e){this.databaseId=t,this.D=e}}function Bo(t,e){return t.D?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function jo(t,e){return t.D?e.toBase64():e.toUint8Array()}function Ko(t,e){return Bo(t,e.toTimestamp())}function $o(t){return Ks(!!t),cr.fromTimestamp(function(t){const e=br(t);return new ar(e.seconds,e.nanos)}(t))}function Go(t,e){return function(t){return new fr(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).canonicalString()}function zo(t){const e=fr.fromString(t);return Ks(pa(e)),e}function Ho(t,e){return Go(t.databaseId,e.path)}function Qo(t,e){const n=zo(e);if(n.get(1)!==t.databaseId.projectId)throw new Hs(zs.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new Hs(zs.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new xr(Jo(n))}function Wo(t,e){return Go(t.databaseId,e)}function Yo(t){const e=zo(t);return 4===e.length?fr.emptyPath():Jo(e)}function Xo(t){return new fr(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Jo(t){return Ks(t.length>4&&"documents"===t.get(4)),t.popFirst(5)}function Zo(t,e,n){return{name:Ho(t,e),fields:n.value.mapValue.fields}}function ta(t,e,n){const s=Qo(t,e.name),r=$o(e.updateTime),i=new $r({mapValue:{fields:e.fields}}),o=zr.newFoundDocument(s,r,i);return n&&o.setHasCommittedMutations(),n?o.setHasCommittedMutations():o}function ea(t,e){let n;if(e instanceof eo)n={update:Zo(t,e.key,e.value)};else if(e instanceof oo)n={delete:Ho(t,e.key)};else if(e instanceof no)n={update:Zo(t,e.key,e.data),updateMask:ma(e.fieldMask)};else{if(!(e instanceof ao))return js();n={verify:Ho(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map((t=>function(t,e){const n=e.transform;if(n instanceof Pi)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof Vi)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof qi)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof ji)return{fieldPath:e.field.canonicalString(),increment:n.C};throw js()}(0,t)))),e.precondition.isNone||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:Ko(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:js()}(t,e.precondition)),n}function na(t,e){const n=e.currentDocument?function(t){return void 0!==t.updateTime?Hi.updateTime($o(t.updateTime)):void 0!==t.exists?Hi.exists(t.exists):Hi.none()}(e.currentDocument):Hi.none(),s=e.updateTransforms?e.updateTransforms.map((e=>function(t,e){let n=null;if("setToServerValue"in e)Ks("REQUEST_TIME"===e.setToServerValue),n=new Pi;else if("appendMissingElements"in e){const t=e.appendMissingElements.values||[];n=new Vi(t)}else if("removeAllFromArray"in e){const t=e.removeAllFromArray.values||[];n=new qi(t)}else"increment"in e?n=new ji(t,e.increment):js();const s=mr.fromServerFormat(e.fieldPath);return new Gi(s,n)}(t,e))):[];if(e.update){e.update.name;const r=Qo(t,e.update.name),i=new $r({mapValue:{fields:e.update.fields}});if(e.updateMask){const t=function(t){const e=t.fieldPaths||[];return new pr(e.map((t=>mr.fromServerFormat(t))))}(e.updateMask);return new no(r,i,t,n,s)}return new eo(r,i,n,s)}if(e.delete){const s=Qo(t,e.delete);return new oo(s,n)}if(e.verify){const s=Qo(t,e.verify);return new ao(s,n)}return js()}function sa(t,e){return{documents:[Wo(t,e.path)]}}function ra(t,e){const n={structuredQuery:{}},s=e.path;null!==e.collectionGroup?(n.parent=Wo(t,s),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Wo(t,s.popLast()),n.structuredQuery.from=[{collectionId:s.lastSegment()}]);const r=function(t){if(0===t.length)return;const e=t.map((t=>function(t){if("=="===t.op){if(Br(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NAN"}};if(qr(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(Br(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NOT_NAN"}};if(qr(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:la(t.field),op:ha(t.op),value:t.value}}}(t)));return 1===e.length?e[0]:{compositeFilter:{op:"AND",filters:e}}}(e.filters);r&&(n.structuredQuery.where=r);const i=function(t){if(0!==t.length)return t.map((t=>function(t){return{field:la(t.field),direction:ua(t.dir)}}(t)))}(e.orderBy);i&&(n.structuredQuery.orderBy=i);const o=function(t,e){return t.D||Nr(e)?e:{value:e}}(t,e.limit);return null!==o&&(n.structuredQuery.limit=o),e.startAt&&(n.structuredQuery.startAt=aa(e.startAt)),e.endAt&&(n.structuredQuery.endAt=aa(e.endAt)),n}function ia(t){let e=Yo(t.parent);const n=t.structuredQuery,s=n.from?n.from.length:0;let r=null;if(s>0){Ks(1===s);const t=n.from[0];t.allDescendants?r=t.collectionId:e=e.child(t.collectionId)}let i=[];n.where&&(i=oa(n.where));let o=[];n.orderBy&&(o=n.orderBy.map((t=>function(t){return new ui(da(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t))));let a=null;n.limit&&(a=function(t){let e;return e="object"==typeof t?t.value:t,Nr(e)?null:e}(n.limit));let c=null;n.startAt&&(c=ca(n.startAt));let u=null;return n.endAt&&(u=ca(n.endAt)),gi(e,r,o,i,a,"F",c,u)}function oa(t){return t?void 0!==t.unaryFilter?[ga(t)]:void 0!==t.fieldFilter?[fa(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((t=>oa(t))).reduce(((t,e)=>t.concat(e))):js():[]}function aa(t){return{before:t.before,values:t.position}}function ca(t){const e=!!t.before,n=t.values||[];return new ai(n,e)}function ua(t){return Vo[t]}function ha(t){return Uo[t]}function la(t){return{fieldPath:t.canonicalString()}}function da(t){return mr.fromServerFormat(t.fieldPath)}function fa(t){return Jr.create(da(t.fieldFilter.field),function(t){switch(t){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return js()}}(t.fieldFilter.op),t.fieldFilter.value)}function ga(t){switch(t.unaryFilter.op){case"IS_NAN":const e=da(t.unaryFilter.field);return Jr.create(e,"==",{doubleValue:NaN});case"IS_NULL":const n=da(t.unaryFilter.field);return Jr.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=da(t.unaryFilter.field);return Jr.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const r=da(t.unaryFilter.field);return Jr.create(r,"!=",{nullValue:"NULL_VALUE"});default:return js()}}function ma(t){const e=[];return t.fields.forEach((t=>e.push(t.canonicalString()))),{fieldPaths:e}}function pa(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ya(t){let e="";for(let n=0;n0&&(e=va(e)),e=wa(t.get(n),e);return va(e)}function wa(t,e){let n=e;const s=t.length;for(let e=0;e=2),2===e)return Ks(""===t.charAt(0)&&""===t.charAt(1)),fr.emptyPath();const n=e-2,s=[];let r="";for(let i=0;in)&&js(),t.charAt(e+1)){case"":const n=t.substring(i,e);let o;0===r.length?o=n:(r+=n,o=r,r=""),s.push(o);break;case"":r+=t.substring(i,e),r+="\0";break;case"":r+=t.substring(i,e+1);break;default:js()}i=e+2}return new fr(s)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ta{constructor(t,e){this.seconds=t,this.nanoseconds=e}}class Ea{constructor(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n}}Ea.store="owner",Ea.key="owner";class Ia{constructor(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n}}Ia.store="mutationQueues",Ia.keyPath="userId";class Sa{constructor(t,e,n,s,r){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=s,this.mutations=r}}Sa.store="mutations",Sa.keyPath="batchId",Sa.userMutationsIndex="userMutationsIndex",Sa.userMutationsKeyPath=["userId","batchId"];class _a{constructor(){}static prefixForUser(t){return[t]}static prefixForPath(t,e){return[t,ya(e)]}static key(t,e,n){return[t,ya(e),n]}}_a.store="documentMutations",_a.PLACEHOLDER=new _a;class Na{constructor(t,e){this.path=t,this.readTime=e}}class Aa{constructor(t,e){this.path=t,this.version=e}}class Da{constructor(t,e,n,s,r,i){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=s,this.readTime=r,this.parentPath=i}}Da.store="remoteDocuments",Da.readTimeIndex="readTimeIndex",Da.readTimeIndexPath="readTime",Da.collectionReadTimeIndex="collectionReadTimeIndex",Da.collectionReadTimeIndexPath=["parentPath","readTime"];class xa{constructor(t){this.byteSize=t}}xa.store="remoteDocumentGlobal",xa.key="remoteDocumentGlobalKey";class Ca{constructor(t,e,n,s,r,i,o){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=s,this.lastListenSequenceNumber=r,this.lastLimboFreeSnapshotVersion=i,this.query=o}}Ca.store="targets",Ca.keyPath="targetId",Ca.queryTargetsIndexName="queryTargetsIndex",Ca.queryTargetsKeyPath=["canonicalId","targetId"];class ka{constructor(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n}}ka.store="targetDocuments",ka.keyPath=["targetId","path"],ka.documentTargetsIndex="documentTargetsIndex",ka.documentTargetsKeyPath=["path","targetId"];class Ra{constructor(t,e,n,s){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=s}}Ra.key="targetGlobalKey",Ra.store="targetGlobal";class La{constructor(t,e){this.collectionId=t,this.parent=e}}La.store="collectionParents",La.keyPath=["collectionId","parent"];class Oa{constructor(t,e,n,s){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=s}}Oa.store="clientMetadata",Oa.keyPath="clientId";class Ma{constructor(t,e,n){this.bundleId=t,this.createTime=e,this.version=n}}Ma.store="bundles",Ma.keyPath="bundleId";class Fa{constructor(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n}}Fa.store="namedQueries",Fa.keyPath="name";const Pa=[Ia.store,Sa.store,_a.store,Da.store,Ca.store,Ea.store,Ra.store,ka.store,Oa.store,xa.store,La.store,Ma.store,Fa.store],Va="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class Ua{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(t){this.onCommittedListeners.push(t)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((t=>t()))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qa{constructor(t){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)}),(t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)}))}catch(t){return this.next(void 0,t)}next(t,e){return this.callbackAttached&&js(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(e,this.error):this.wrapSuccess(t,this.result):new qa(((n,s)=>{this.nextCallback=e=>{this.wrapSuccess(t,e).next(n,s)},this.catchCallback=t=>{this.wrapFailure(e,t).next(n,s)}}))}toPromise(){return new Promise(((t,e)=>{this.next(t,e)}))}wrapUserFunction(t){try{const e=t();return e instanceof qa?e:qa.resolve(e)}catch(t){return qa.reject(t)}}wrapSuccess(t,e){return t?this.wrapUserFunction((()=>t(e))):qa.resolve(e)}wrapFailure(t,e){return t?this.wrapUserFunction((()=>t(e))):qa.reject(e)}static resolve(t){return new qa(((e,n)=>{e(t)}))}static reject(t){return new qa(((e,n)=>{n(t)}))}static waitFor(t){return new qa(((e,n)=>{let s=0,r=0,i=!1;t.forEach((t=>{++s,t.next((()=>{++r,i&&r===s&&e()}),(t=>n(t)))})),i=!0,r===s&&e()}))}static or(t){let e=qa.resolve(!1);for(const n of t)e=e.next((t=>t?qa.resolve(t):n()));return e}static forEach(t,e){const n=[];return t.forEach(((t,s)=>{n.push(e.call(this,t,s))})),this.waitFor(n)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ba{constructor(t,e){this.action=t,this.transaction=e,this.aborted=!1,this.Et=new Qs,this.transaction.oncomplete=()=>{this.Et.resolve()},this.transaction.onabort=()=>{e.error?this.Et.reject(new $a(t,e.error)):this.Et.resolve()},this.transaction.onerror=e=>{const n=Wa(e.target.error);this.Et.reject(new $a(t,n))}}static open(t,e,n,s){try{return new Ba(e,t.transaction(s,n))}catch(t){throw new $a(e,t)}}get It(){return this.Et.promise}abort(t){t&&this.Et.reject(t),this.aborted||(Vs("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}store(t){const e=this.transaction.objectStore(t);return new za(e)}}class ja{constructor(t,e,n){this.name=t,this.version=e,this.At=n,12.2===ja.Rt(h())&&Us("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}static delete(t){return Vs("SimpleDb","Removing database:",t),Ha(window.indexedDB.deleteDatabase(t)).toPromise()}static bt(){if("object"!=typeof indexedDB)return!1;if(ja.Pt())return!0;const t=h(),e=ja.Rt(t),n=00||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0||n||r)}static Pt(){var t;return void 0!==o&&"YES"===(void 0===(t={})?void 0:t.Vt)}static St(t,e){return t.store(e)}static Rt(t){const e=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=e?e[1].split("_").slice(0,2).join("."):"-1";return Number(n)}static vt(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}async Dt(t){return this.db||(Vs("SimpleDb","Opening database:",this.name),this.db=await new Promise(((e,n)=>{const s=indexedDB.open(this.name,this.version);s.onsuccess=t=>{const n=t.target.result;e(n)},s.onblocked=()=>{n(new $a(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},s.onerror=e=>{const s=e.target.error;"VersionError"===s.name?n(new Hs(zs.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):"InvalidStateError"===s.name?n(new Hs(zs.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+s)):n(new $a(t,s))},s.onupgradeneeded=t=>{Vs("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',t.oldVersion);const e=t.target.result;this.At.Ct(e,s.transaction,t.oldVersion,this.version).next((()=>{Vs("SimpleDb","Database upgrade to version "+this.version+" complete")}))}}))),this.Nt&&(this.db.onversionchange=t=>this.Nt(t)),this.db}xt(t){this.Nt=t,this.db&&(this.db.onversionchange=e=>t(e))}async runTransaction(t,e,n,s){const r="readonly"===e;let i=0;for(;;){++i;try{this.db=await this.Dt(t);const e=Ba.open(this.db,t,r?"readonly":"readwrite",n),i=s(e).catch((t=>(e.abort(t),qa.reject(t)))).toPromise();return i.catch((()=>{})),await e.It,i}catch(t){const e="FirebaseError"!==t.name&&i<3;if(Vs("SimpleDb","Transaction failed with error:",t.message,"Retrying:",e),this.close(),!e)return Promise.reject(t)}}}close(){this.db&&this.db.close(),this.db=void 0}}class Ka{constructor(t){this.kt=t,this.$t=!1,this.Ot=null}get isDone(){return this.$t}get Ft(){return this.Ot}set cursor(t){this.kt=t}done(){this.$t=!0}Mt(t){this.Ot=t}delete(){return Ha(this.kt.delete())}}class $a extends Hs{constructor(t,e){super(zs.UNAVAILABLE,`IndexedDB transaction '${t}' failed: ${e}`),this.name="IndexedDbTransactionError"}}function Ga(t){return"IndexedDbTransactionError"===t.name}class za{constructor(t){this.store=t}put(t,e){let n;return void 0!==e?(Vs("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(Vs("SimpleDb","PUT",this.store.name,"",t),n=this.store.put(t)),Ha(n)}add(t){return Vs("SimpleDb","ADD",this.store.name,t,t),Ha(this.store.add(t))}get(t){return Ha(this.store.get(t)).next((e=>(void 0===e&&(e=null),Vs("SimpleDb","GET",this.store.name,t,e),e)))}delete(t){return Vs("SimpleDb","DELETE",this.store.name,t),Ha(this.store.delete(t))}count(){return Vs("SimpleDb","COUNT",this.store.name),Ha(this.store.count())}Lt(t,e){const n=this.cursor(this.options(t,e)),s=[];return this.Bt(n,((t,e)=>{s.push(e)})).next((()=>s))}Ut(t,e){Vs("SimpleDb","DELETE ALL",this.store.name);const n=this.options(t,e);n.qt=!1;const s=this.cursor(n);return this.Bt(s,((t,e,n)=>n.delete()))}Kt(t,e){let n;e?n=t:(n={},e=t);const s=this.cursor(n);return this.Bt(s,e)}jt(t){const e=this.cursor({});return new qa(((n,s)=>{e.onerror=t=>{const e=Wa(t.target.error);s(e)},e.onsuccess=e=>{const s=e.target.result;s?t(s.primaryKey,s.value).next((t=>{t?s.continue():n()})):n()}}))}Bt(t,e){const n=[];return new qa(((s,r)=>{t.onerror=t=>{r(t.target.error)},t.onsuccess=t=>{const r=t.target.result;if(!r)return void s();const i=new Ka(r),o=e(r.primaryKey,r.value,i);if(o instanceof qa){const t=o.catch((t=>(i.done(),qa.reject(t))));n.push(t)}i.isDone?s():null===i.Ft?r.continue():r.continue(i.Ft)}})).next((()=>qa.waitFor(n)))}options(t,e){let n;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}}cursor(t){let e="next";if(t.reverse&&(e="prev"),t.index){const n=this.store.index(t.index);return t.qt?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)}}function Ha(t){return new qa(((e,n)=>{t.onsuccess=t=>{const n=t.target.result;e(n)},t.onerror=t=>{const e=Wa(t.target.error);n(e)}}))}let Qa=!1;function Wa(t){const e=ja.Rt(h());if(e>=12.2&&e<13){const e="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(e)>=0){const t=new Hs("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return Qa||(Qa=!0,setTimeout((()=>{throw t}),0)),t}}return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ya extends Ua{constructor(t,e){super(),this.Qt=t,this.currentSequenceNumber=e}}function Xa(t,e){const n=Gs(t);return ja.St(n.Qt,e)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ja{constructor(t,e,n,s){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=s}applyToRemoteDocument(t,e){const n=e.mutationResults;for(let e=0;e{const n=t.get(e.key),s=n;this.applyToLocalView(s),n.isValidDocument()||s.convertToNoDocument(cr.min())}))}keys(){return this.mutations.reduce(((t,e)=>t.add(e.key)),No())}isEqual(t){return this.batchId===t.batchId&&ir(this.mutations,t.mutations,((t,e)=>Zi(t,e)))&&ir(this.baseMutations,t.baseMutations,((t,e)=>Zi(t,e)))}}class Za{constructor(t,e,n,s){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.docVersions=s}static from(t,e,n){Ks(t.mutations.length===n.length);let s=So();const r=t.mutations;for(let t=0;tna(t.Wt,e)));for(let t=0;tna(t.Wt,e))),r=ar.fromMillis(e.localWriteTimeMs);return new Ja(e.batchId,r,n,s)}function uc(t){const e=ac(t.readTime),n=void 0!==t.lastLimboFreeSnapshotVersion?ac(t.lastLimboFreeSnapshotVersion):cr.min();let s;var r;return void 0!==t.query.documents?(Ks(1===(r=t.query).documents.length),s=Ei(mi(Yo(r.documents[0])))):s=function(t){return Ei(ia(t))}(t.query),new tc(s,t.targetId,0,t.lastListenSequenceNumber,e,n,wr.fromBase64String(t.resumeToken))}function hc(t,e){const n=oc(e.snapshotVersion),s=oc(e.lastLimboFreeSnapshotVersion);let r;r=Xr(e.target)?sa(t.Wt,e.target):ra(t.Wt,e.target);const i=e.resumeToken.toBase64();return new Ca(e.targetId,Wr(e.target),n,i,e.sequenceNumber,s,r)}function lc(t){const e=ia({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?Ii(e,e.limit,"L"):e} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class dc{getBundleMetadata(t,e){return fc(t).get(e).next((t=>{if(t)return{id:(e=t).bundleId,createTime:ac(e.createTime),version:e.version};var e}))}saveBundleMetadata(t,e){var n;return fc(t).put({bundleId:(n=e).id,createTime:oc($o(n.createTime)),version:n.version})}getNamedQuery(t,e){return gc(t).get(e).next((t=>{if(t)return{name:(e=t).name,query:lc(e.bundledQuery),readTime:ac(e.readTime)};var e}))}saveNamedQuery(t,e){return gc(t).put(function(t){return{name:t.name,readTime:oc($o(t.readTime)),bundledQuery:t.bundledQuery}}(e))}}function fc(t){return Xa(t,Ma.store)}function gc(t){return Xa(t,Fa.store)} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class mc{constructor(){this.Gt=new pc}addToCollectionParentIndex(t,e){return this.Gt.add(e),qa.resolve()}getCollectionParents(t,e){return qa.resolve(this.Gt.getEntries(e))}}class pc{constructor(){this.index={}}add(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e]||new yo(fr.comparator),r=!s.has(n);return this.index[e]=s.add(n),r}has(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e];return s&&s.has(n)}getEntries(t){return(this.index[t]||new yo(fr.comparator)).toArray()}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class yc{constructor(){this.zt=new pc}addToCollectionParentIndex(t,e){if(!this.zt.has(e)){const n=e.lastSegment(),s=e.popLast();t.addOnCommittedListener((()=>{this.zt.add(e)}));const r={collectionId:n,parent:ya(s)};return wc(t).put(r)}return qa.resolve()}getCollectionParents(t,e){const n=[],s=IDBKeyRange.bound([e,""],[or(e),""],!1,!0);return wc(t).Lt(s).next((t=>{for(const s of t){if(s.collectionId!==e)break;n.push(ba(s.parent))}return n}))}}function wc(t){return Xa(t,La.store)} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const vc={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0};class bc{constructor(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}static withCacheSize(t){return new bc(t,bc.DEFAULT_COLLECTION_PERCENTILE,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Tc(t,e,n){const s=t.store(Sa.store),r=t.store(_a.store),i=[],o=IDBKeyRange.only(n.batchId);let a=0;const c=s.Kt({range:o},((t,e,n)=>(a++,n.delete())));i.push(c.next((()=>{Ks(1===a)})));const u=[];for(const t of n.mutations){const s=_a.key(e,t.key.path,n.batchId);i.push(r.delete(s)),u.push(t.key)}return qa.waitFor(i).next((()=>u))}function Ec(t){if(!t)return 0;let e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw js();e=t.noDocument}return JSON.stringify(e).length} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */bc.DEFAULT_COLLECTION_PERCENTILE=10,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,bc.DEFAULT=new bc(41943040,bc.DEFAULT_COLLECTION_PERCENTILE,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),bc.DISABLED=new bc(-1,0,0);class Ic{constructor(t,e,n,s){this.userId=t,this.N=e,this.Ht=n,this.referenceDelegate=s,this.Jt={}}static Yt(t,e,n,s){Ks(""!==t.uid);const r=t.isAuthenticated()?t.uid:"";return new Ic(r,e,n,s)}checkEmpty(t){let e=!0;const n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return _c(t).Kt({index:Sa.userMutationsIndex,range:n},((t,n,s)=>{e=!1,s.done()})).next((()=>e))}addMutationBatch(t,e,n,s){const r=Nc(t),i=_c(t);return i.add({}).next((o=>{Ks("number"==typeof o);const a=new Ja(o,e,n,s),c=function(t,e,n){const s=n.baseMutations.map((e=>ea(t.Wt,e))),r=n.mutations.map((e=>ea(t.Wt,e)));return new Sa(e,n.batchId,n.localWriteTime.toMillis(),s,r)}(this.N,this.userId,a),u=[];let h=new yo(((t,e)=>rr(t.canonicalString(),e.canonicalString())));for(const t of s){const e=_a.key(this.userId,t.key.path,o);h=h.add(t.key.path.popLast()),u.push(i.put(c)),u.push(r.put(e,_a.PLACEHOLDER))}return h.forEach((e=>{u.push(this.Ht.addToCollectionParentIndex(t,e))})),t.addOnCommittedListener((()=>{this.Jt[o]=a.keys()})),qa.waitFor(u).next((()=>a))}))}lookupMutationBatch(t,e){return _c(t).get(e).next((t=>t?(Ks(t.userId===this.userId),cc(this.N,t)):null))}Xt(t,e){return this.Jt[e]?qa.resolve(this.Jt[e]):this.lookupMutationBatch(t,e).next((t=>{if(t){const n=t.keys();return this.Jt[e]=n,n}return null}))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,s=IDBKeyRange.lowerBound([this.userId,n]);let r=null;return _c(t).Kt({index:Sa.userMutationsIndex,range:s},((t,e,s)=>{e.userId===this.userId&&(Ks(e.batchId>=n),r=cc(this.N,e)),s.done()})).next((()=>r))}getHighestUnacknowledgedBatchId(t){const e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let n=-1;return _c(t).Kt({index:Sa.userMutationsIndex,range:e,reverse:!0},((t,e,s)=>{n=e.batchId,s.done()})).next((()=>n))}getAllMutationBatches(t){const e=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return _c(t).Lt(Sa.userMutationsIndex,e).next((t=>t.map((t=>cc(this.N,t)))))}getAllMutationBatchesAffectingDocumentKey(t,e){const n=_a.prefixForPath(this.userId,e.path),s=IDBKeyRange.lowerBound(n),r=[];return Nc(t).Kt({range:s},((n,s,i)=>{const[o,a,c]=n,u=ba(a);if(o===this.userId&&e.path.isEqual(u))return _c(t).get(c).next((t=>{if(!t)throw js();Ks(t.userId===this.userId),r.push(cc(this.N,t))}));i.done()})).next((()=>r))}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new yo(rr);const s=[];return e.forEach((e=>{const r=_a.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=Nc(t).Kt({range:i},((t,s,r)=>{const[i,o,a]=t,c=ba(o);i===this.userId&&e.path.isEqual(c)?n=n.add(a):r.done()}));s.push(o)})),qa.waitFor(s).next((()=>this.Zt(t,n)))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,s=n.length+1,r=_a.prefixForPath(this.userId,n),i=IDBKeyRange.lowerBound(r);let o=new yo(rr);return Nc(t).Kt({range:i},((t,e,r)=>{const[i,a,c]=t,u=ba(a);i===this.userId&&n.isPrefixOf(u)?u.length===s&&(o=o.add(c)):r.done()})).next((()=>this.Zt(t,o)))}Zt(t,e){const n=[],s=[];return e.forEach((e=>{s.push(_c(t).get(e).next((t=>{if(null===t)throw js();Ks(t.userId===this.userId),n.push(cc(this.N,t))})))})),qa.waitFor(s).next((()=>n))}removeMutationBatch(t,e){return Tc(t.Qt,this.userId,e).next((n=>(t.addOnCommittedListener((()=>{this.te(e.batchId)})),qa.forEach(n,(e=>this.referenceDelegate.markPotentiallyOrphaned(t,e))))))}te(t){delete this.Jt[t]}performConsistencyCheck(t){return this.checkEmpty(t).next((e=>{if(!e)return qa.resolve();const n=IDBKeyRange.lowerBound(_a.prefixForUser(this.userId)),s=[];return Nc(t).Kt({range:n},((t,e,n)=>{if(t[0]===this.userId){const e=ba(t[1]);s.push(e)}else n.done()})).next((()=>{Ks(0===s.length)}))}))}containsKey(t,e){return Sc(t,this.userId,e)}ee(t){return Ac(t).get(this.userId).next((t=>t||new Ia(this.userId,-1,"")))}}function Sc(t,e,n){const s=_a.prefixForPath(e,n.path),r=s[1],i=IDBKeyRange.lowerBound(s);let o=!1;return Nc(t).Kt({range:i,qt:!0},((t,n,s)=>{const[i,a,c]=t;i===e&&a===r&&(o=!0),s.done()})).next((()=>o))}function _c(t){return Xa(t,Sa.store)}function Nc(t){return Xa(t,_a.store)}function Ac(t){return Xa(t,Ia.store)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Dc{constructor(t){this.ne=t}next(){return this.ne+=2,this.ne}static se(){return new Dc(0)}static ie(){return new Dc(-1)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xc{constructor(t,e){this.referenceDelegate=t,this.N=e}allocateTargetId(t){return this.re(t).next((e=>{const n=new Dc(e.highestTargetId);return e.highestTargetId=n.next(),this.oe(t,e).next((()=>e.highestTargetId))}))}getLastRemoteSnapshotVersion(t){return this.re(t).next((t=>cr.fromTimestamp(new ar(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))))}getHighestSequenceNumber(t){return this.re(t).next((t=>t.highestListenSequenceNumber))}setTargetsMetadata(t,e,n){return this.re(t).next((s=>(s.highestListenSequenceNumber=e,n&&(s.lastRemoteSnapshotVersion=n.toTimestamp()),e>s.highestListenSequenceNumber&&(s.highestListenSequenceNumber=e),this.oe(t,s))))}addTargetData(t,e){return this.ce(t,e).next((()=>this.re(t).next((n=>(n.targetCount+=1,this.ae(e,n),this.oe(t,n))))))}updateTargetData(t,e){return this.ce(t,e)}removeTargetData(t,e){return this.removeMatchingKeysForTargetId(t,e.targetId).next((()=>Cc(t).delete(e.targetId))).next((()=>this.re(t))).next((e=>(Ks(e.targetCount>0),e.targetCount-=1,this.oe(t,e))))}removeTargets(t,e,n){let s=0;const r=[];return Cc(t).Kt(((i,o)=>{const a=uc(o);a.sequenceNumber<=e&&null===n.get(a.targetId)&&(s++,r.push(this.removeTargetData(t,a)))})).next((()=>qa.waitFor(r))).next((()=>s))}forEachTarget(t,e){return Cc(t).Kt(((t,n)=>{const s=uc(n);e(s)}))}re(t){return kc(t).get(Ra.key).next((t=>(Ks(null!==t),t)))}oe(t,e){return kc(t).put(Ra.key,e)}ce(t,e){return Cc(t).put(hc(this.N,e))}ae(t,e){let n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n}getTargetCount(t){return this.re(t).next((t=>t.targetCount))}getTargetData(t,e){const n=Wr(e),s=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]);let r=null;return Cc(t).Kt({range:s,index:Ca.queryTargetsIndexName},((t,n,s)=>{const i=uc(n);Yr(e,i.target)&&(r=i,s.done())})).next((()=>r))}addMatchingKeys(t,e,n){const s=[],r=Rc(t);return e.forEach((e=>{const i=ya(e.path);s.push(r.put(new ka(n,i))),s.push(this.referenceDelegate.addReference(t,n,e))})),qa.waitFor(s)}removeMatchingKeys(t,e,n){const s=Rc(t);return qa.forEach(e,(e=>{const r=ya(e.path);return qa.waitFor([s.delete([n,r]),this.referenceDelegate.removeReference(t,n,e)])}))}removeMatchingKeysForTargetId(t,e){const n=Rc(t),s=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(s)}getMatchingKeysForTargetId(t,e){const n=IDBKeyRange.bound([e],[e+1],!1,!0),s=Rc(t);let r=No();return s.Kt({range:n,qt:!0},((t,e,n)=>{const s=ba(t[1]),i=new xr(s);r=r.add(i)})).next((()=>r))}containsKey(t,e){const n=ya(e.path),s=IDBKeyRange.bound([n],[or(n)],!1,!0);let r=0;return Rc(t).Kt({index:ka.documentTargetsIndex,qt:!0,range:s},(([t,e],n,s)=>{0!==t&&(r++,s.done())})).next((()=>r>0))}Tt(t,e){return Cc(t).get(e).next((t=>t?uc(t):null))}}function Cc(t){return Xa(t,Ca.store)}function kc(t){return Xa(t,Ra.store)}function Rc(t){return Xa(t,ka.store)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */async function Lc(t){if(t.code!==zs.FAILED_PRECONDITION||t.message!==Va)throw t;Vs("LocalStore","Unexpectedly lost primary lease")} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Oc([t,e],[n,s]){const r=rr(t,n);return 0===r?rr(e,s):r}class Mc{constructor(t){this.ue=t,this.buffer=new yo(Oc),this.he=0}le(){return++this.he}fe(t){const e=[t,this.le()];if(this.buffer.size{this.we=null,this.de=!0;try{await t.collectGarbage(this.garbageCollector)}catch(t){Ga(t)?Vs("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",t):await Lc(t)}await this._e(t)}))}}class Pc{constructor(t,e){this.me=t,this.params=e}calculateTargetCount(t,e){return this.me.ge(t).next((t=>Math.floor(e/100*t)))}nthSequenceNumber(t,e){if(0===e)return qa.resolve(er.T);const n=new Mc(e);return this.me.forEachTarget(t,(t=>n.fe(t.sequenceNumber))).next((()=>this.me.ye(t,(t=>n.fe(t))))).next((()=>n.maxValue))}removeTargets(t,e,n){return this.me.removeTargets(t,e,n)}removeOrphanedDocuments(t,e){return this.me.removeOrphanedDocuments(t,e)}collect(t,e){return-1===this.params.cacheSizeCollectionThreshold?(Vs("LruGarbageCollector","Garbage collection skipped; disabled"),qa.resolve(vc)):this.getCacheSize(t).next((n=>n(e>this.params.maximumSequenceNumbersToCollect?(Vs("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`),s=this.params.maximumSequenceNumbersToCollect):s=e,i=Date.now(),this.nthSequenceNumber(t,s)))).next((s=>(n=s,o=Date.now(),this.removeTargets(t,n,e)))).next((e=>(r=e,a=Date.now(),this.removeOrphanedDocuments(t,n)))).next((t=>(c=Date.now(),Fs()<=p.DEBUG&&Vs("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${i-u}ms\n\tDetermined least recently used ${s} in `+(o-i)+"ms\n"+`\tRemoved ${r} targets in `+(a-o)+"ms\n"+`\tRemoved ${t} documents in `+(c-a)+"ms\n"+`Total Duration: ${c-u}ms`),qa.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:r,documentsRemoved:t}))))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Vc{constructor(t,e){this.db=t,this.garbageCollector=function(t,e){return new Pc(t,e)}(this,e)}ge(t){const e=this.Te(t);return this.db.getTargetCache().getTargetCount(t).next((t=>e.next((e=>t+e))))}Te(t){let e=0;return this.ye(t,(t=>{e++})).next((()=>e))}forEachTarget(t,e){return this.db.getTargetCache().forEachTarget(t,e)}ye(t,e){return this.Ee(t,((t,n)=>e(n)))}addReference(t,e,n){return Uc(t,n)}removeReference(t,e,n){return Uc(t,n)}removeTargets(t,e,n){return this.db.getTargetCache().removeTargets(t,e,n)}markPotentiallyOrphaned(t,e){return Uc(t,e)}Ie(t,e){return function(t,e){let n=!1;return Ac(t).jt((s=>Sc(t,s,e).next((t=>(t&&(n=!0),qa.resolve(!t)))))).next((()=>n))}(t,e)}removeOrphanedDocuments(t,e){const n=this.db.getRemoteDocumentCache().newChangeBuffer(),s=[];let r=0;return this.Ee(t,((i,o)=>{if(o<=e){const e=this.Ie(t,i).next((e=>{if(!e)return r++,n.getEntry(t,i).next((()=>(n.removeEntry(i),Rc(t).delete([0,ya(i.path)]))))}));s.push(e)}})).next((()=>qa.waitFor(s))).next((()=>n.apply(t))).next((()=>r))}removeTarget(t,e){const n=e.withSequenceNumber(t.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(t,n)}updateLimboDocument(t,e){return Uc(t,e)}Ee(t,e){const n=Rc(t);let s,r=er.T;return n.Kt({index:ka.documentTargetsIndex},(([t,n],{path:i,sequenceNumber:o})=>{0===t?(r!==er.T&&e(new xr(ba(s)),r),r=o,s=i):r=er.T})).next((()=>{r!==er.T&&e(new xr(ba(s)),r)}))}getCacheSize(t){return this.db.getRemoteDocumentCache().getSize(t)}}function Uc(t,e){return Rc(t).put(function(t,e){return new ka(0,ya(t.path),e)}(e,t.currentSequenceNumber))} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qc{constructor(t,e){this.mapKeyFn=t,this.equalsFn=e,this.inner={}}get(t){const e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(const[e,s]of n)if(this.equalsFn(e,t))return s}has(t){return void 0!==this.get(t)}set(t,e){const n=this.mapKeyFn(t),s=this.inner[n];if(void 0!==s){for(let n=0;n{for(const[e,s]of n)t(e,s)}))}isEmpty(){return lr(this.inner)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Bc{constructor(){this.changes=new qc((t=>t.toString()),((t,e)=>t.isEqual(e))),this.changesApplied=!1}getReadTime(t){const e=this.changes.get(t);return e?e.readTime:cr.min()}addEntry(t,e){this.assertNotApplied(),this.changes.set(t.key,{document:t,readTime:e})}removeEntry(t,e=null){this.assertNotApplied(),this.changes.set(t,{document:zr.newInvalidDocument(t),readTime:e})}getEntry(t,e){this.assertNotApplied();const n=this.changes.get(e);return void 0!==n?qa.resolve(n.document):this.getFromCache(t,e)}getEntries(t,e){return this.getAllFromCache(t,e)}apply(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)}assertNotApplied(){}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class jc{constructor(t,e){this.N=t,this.Ht=e}addEntry(t,e,n){return Gc(t).put(zc(e),n)}removeEntry(t,e){const n=Gc(t),s=zc(e);return n.delete(s)}updateMetadata(t,e){return this.getMetadata(t).next((n=>(n.byteSize+=e,this.Ae(t,n))))}getEntry(t,e){return Gc(t).get(zc(e)).next((t=>this.Re(e,t)))}be(t,e){return Gc(t).get(zc(e)).next((t=>({document:this.Re(e,t),size:Ec(t)})))}getEntries(t,e){let n=bo();return this.Pe(t,e,((t,e)=>{const s=this.Re(t,e);n=n.insert(t,s)})).next((()=>n))}ve(t,e){let n=bo(),s=new go(xr.comparator);return this.Pe(t,e,((t,e)=>{const r=this.Re(t,e);n=n.insert(t,r),s=s.insert(t,Ec(e))})).next((()=>({documents:n,Ve:s})))}Pe(t,e,n){if(e.isEmpty())return qa.resolve();const s=IDBKeyRange.bound(e.first().path.toArray(),e.last().path.toArray()),r=e.getIterator();let i=r.getNext();return Gc(t).Kt({range:s},((t,e,s)=>{const o=xr.fromSegments(t);for(;i&&xr.comparator(i,o)<0;)n(i,null),i=r.getNext();i&&i.isEqual(o)&&(n(i,e),i=r.hasNext()?r.getNext():null),i?s.Mt(i.path.toArray()):s.done()})).next((()=>{for(;i;)n(i,null),i=r.hasNext()?r.getNext():null}))}getDocumentsMatchingQuery(t,e,n){let s=bo();const r=e.path.length+1,i={};if(n.isEqual(cr.min())){const t=e.path.toArray();i.range=IDBKeyRange.lowerBound(t)}else{const t=e.path.toArray(),s=rc(n);i.range=IDBKeyRange.lowerBound([t,s],!0),i.index=Da.collectionReadTimeIndex}return Gc(t).Kt(i,((t,n,i)=>{if(t.length!==r)return;const o=nc(this.N,n);e.path.isPrefixOf(o.key.path)?Ai(e,o)&&(s=s.insert(o.key,o)):i.done()})).next((()=>s))}newChangeBuffer(t){return new Kc(this,!!t&&t.trackRemovals)}getSize(t){return this.getMetadata(t).next((t=>t.byteSize))}getMetadata(t){return $c(t).get(xa.key).next((t=>(Ks(!!t),t)))}Ae(t,e){return $c(t).put(xa.key,e)}Re(t,e){if(e){const t=nc(this.N,e);if(!t.isNoDocument()||!t.version.isEqual(cr.min()))return t}return zr.newInvalidDocument(t)}}class Kc extends Bc{constructor(t,e){super(),this.Se=t,this.trackRemovals=e,this.De=new qc((t=>t.toString()),((t,e)=>t.isEqual(e)))}applyChanges(t){const e=[];let n=0,s=new yo(((t,e)=>rr(t.canonicalString(),e.canonicalString())));return this.changes.forEach(((r,i)=>{const o=this.De.get(r);if(i.document.isValidDocument()){const a=sc(this.Se.N,i.document,this.getReadTime(r));s=s.add(r.path.popLast());const c=Ec(a);n+=c-o,e.push(this.Se.addEntry(t,r,a))}else if(n-=o,this.trackRemovals){const n=sc(this.Se.N,zr.newNoDocument(r,cr.min()),this.getReadTime(r));e.push(this.Se.addEntry(t,r,n))}else e.push(this.Se.removeEntry(t,r))})),s.forEach((n=>{e.push(this.Se.Ht.addToCollectionParentIndex(t,n))})),e.push(this.Se.updateMetadata(t,n)),qa.waitFor(e)}getFromCache(t,e){return this.Se.be(t,e).next((t=>(this.De.set(e,t.size),t.document)))}getAllFromCache(t,e){return this.Se.ve(t,e).next((({documents:t,Ve:e})=>(e.forEach(((t,e)=>{this.De.set(t,e)})),t)))}}function $c(t){return Xa(t,xa.store)}function Gc(t){return Xa(t,Da.store)}function zc(t){return t.path.toArray()} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Hc{constructor(t){this.N=t}Ct(t,e,n,s){Ks(n=0&&s<=11);const r=new Ba("createOrUpgrade",e);n<1&&s>=1&&(function(t){t.createObjectStore(Ea.store)}(t),function(t){t.createObjectStore(Ia.store,{keyPath:Ia.keyPath}),t.createObjectStore(Sa.store,{keyPath:Sa.keyPath,autoIncrement:!0}).createIndex(Sa.userMutationsIndex,Sa.userMutationsKeyPath,{unique:!0}),t.createObjectStore(_a.store)}(t),Qc(t),function(t){t.createObjectStore(Da.store)}(t));let i=qa.resolve();return n<3&&s>=3&&(0!==n&&(function(t){t.deleteObjectStore(ka.store),t.deleteObjectStore(Ca.store),t.deleteObjectStore(Ra.store)}(t),Qc(t)),i=i.next((()=>function(t){const e=t.store(Ra.store),n=new Ra(0,0,cr.min().toTimestamp(),0);return e.put(Ra.key,n)}(r)))),n<4&&s>=4&&(0!==n&&(i=i.next((()=>function(t,e){return e.store(Sa.store).Lt().next((n=>{t.deleteObjectStore(Sa.store),t.createObjectStore(Sa.store,{keyPath:Sa.keyPath,autoIncrement:!0}).createIndex(Sa.userMutationsIndex,Sa.userMutationsKeyPath,{unique:!0});const s=e.store(Sa.store),r=n.map((t=>s.put(t)));return qa.waitFor(r)}))}(t,r)))),i=i.next((()=>{!function(t){t.createObjectStore(Oa.store,{keyPath:Oa.keyPath})}(t)}))),n<5&&s>=5&&(i=i.next((()=>this.Ce(r)))),n<6&&s>=6&&(i=i.next((()=>(function(t){t.createObjectStore(xa.store)}(t),this.Ne(r))))),n<7&&s>=7&&(i=i.next((()=>this.xe(r)))),n<8&&s>=8&&(i=i.next((()=>this.ke(t,r)))),n<9&&s>=9&&(i=i.next((()=>{!function(t){t.objectStoreNames.contains("remoteDocumentChanges")&&t.deleteObjectStore("remoteDocumentChanges")}(t),function(t){const e=t.objectStore(Da.store);e.createIndex(Da.readTimeIndex,Da.readTimeIndexPath,{unique:!1}),e.createIndex(Da.collectionReadTimeIndex,Da.collectionReadTimeIndexPath,{unique:!1})}(e)}))),n<10&&s>=10&&(i=i.next((()=>this.$e(r)))),n<11&&s>=11&&(i=i.next((()=>{!function(t){t.createObjectStore(Ma.store,{keyPath:Ma.keyPath})}(t),function(t){t.createObjectStore(Fa.store,{keyPath:Fa.keyPath})}(t)}))),i}Ne(t){let e=0;return t.store(Da.store).Kt(((t,n)=>{e+=Ec(n)})).next((()=>{const n=new xa(e);return t.store(xa.store).put(xa.key,n)}))}Ce(t){const e=t.store(Ia.store),n=t.store(Sa.store);return e.Lt().next((e=>qa.forEach(e,(e=>{const s=IDBKeyRange.bound([e.userId,-1],[e.userId,e.lastAcknowledgedBatchId]);return n.Lt(Sa.userMutationsIndex,s).next((n=>qa.forEach(n,(n=>{Ks(n.userId===e.userId);const s=cc(this.N,n);return Tc(t,e.userId,s).next((()=>{}))}))))}))))}xe(t){const e=t.store(ka.store),n=t.store(Da.store);return t.store(Ra.store).get(Ra.key).next((t=>{const s=[];return n.Kt(((n,r)=>{const i=new fr(n),o=function(t){return[0,ya(t)]}(i);s.push(e.get(o).next((n=>n?qa.resolve():(n=>e.put(new ka(0,ya(n),t.highestListenSequenceNumber)))(i))))})).next((()=>qa.waitFor(s)))}))}ke(t,e){t.createObjectStore(La.store,{keyPath:La.keyPath});const n=e.store(La.store),s=new pc,r=t=>{if(s.add(t)){const e=t.lastSegment(),s=t.popLast();return n.put({collectionId:e,parent:ya(s)})}};return e.store(Da.store).Kt({qt:!0},((t,e)=>{const n=new fr(t);return r(n.popLast())})).next((()=>e.store(_a.store).Kt({qt:!0},(([t,e,n],s)=>{const i=ba(e);return r(i.popLast())}))))}$e(t){const e=t.store(Ca.store);return e.Kt(((t,n)=>{const s=uc(n),r=hc(this.N,s);return e.put(r)}))}}function Qc(t){t.createObjectStore(ka.store,{keyPath:ka.keyPath}).createIndex(ka.documentTargetsIndex,ka.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(Ca.store,{keyPath:Ca.keyPath}).createIndex(Ca.queryTargetsIndexName,Ca.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(Ra.store)}const Wc="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";class Yc{constructor(t,e,n,s,r,i,o,a,c,u){if(this.allowTabSynchronization=t,this.persistenceKey=e,this.clientId=n,this.Oe=r,this.window=i,this.document=o,this.Fe=c,this.Me=u,this.Le=null,this.Be=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Ue=null,this.inForeground=!1,this.qe=null,this.Ke=null,this.je=Number.NEGATIVE_INFINITY,this.Qe=t=>Promise.resolve(),!Yc.bt())throw new Hs(zs.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new Vc(this,s),this.We=e+"main",this.N=new ec(a),this.Ge=new ja(this.We,11,new Hc(this.N)),this.ze=new xc(this.referenceDelegate,this.N),this.Ht=new yc,this.He=function(t,e){return new jc(t,e)}(this.N,this.Ht),this.Je=new dc,this.window&&this.window.localStorage?this.Ye=this.window.localStorage:(this.Ye=null,!1===u&&Us("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.Xe().then((()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new Hs(zs.FAILED_PRECONDITION,Wc);return this.Ze(),this.tn(),this.en(),this.runTransaction("getHighestListenSequenceNumber","readonly",(t=>this.ze.getHighestSequenceNumber(t)))})).then((t=>{this.Le=new er(t,this.Fe)})).then((()=>{this.Be=!0})).catch((t=>(this.Ge&&this.Ge.close(),Promise.reject(t))))}nn(t){return this.Qe=async e=>{if(this.started)return t(e)},t(this.isPrimary)}setDatabaseDeletedListener(t){this.Ge.xt((async e=>{null===e.newVersion&&await t()}))}setNetworkEnabled(t){this.networkEnabled!==t&&(this.networkEnabled=t,this.Oe.enqueueAndForget((async()=>{this.started&&await this.Xe()})))}Xe(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(t=>Jc(t).put(new Oa(this.clientId,Date.now(),this.networkEnabled,this.inForeground)).next((()=>{if(this.isPrimary)return this.sn(t).next((t=>{t||(this.isPrimary=!1,this.Oe.enqueueRetryable((()=>this.Qe(!1))))}))})).next((()=>this.rn(t))).next((e=>this.isPrimary&&!e?this.on(t).next((()=>!1)):!!e&&this.cn(t).next((()=>!0)))))).catch((t=>{if(Ga(t))return Vs("IndexedDbPersistence","Failed to extend owner lease: ",t),this.isPrimary;if(!this.allowTabSynchronization)throw t;return Vs("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1})).then((t=>{this.isPrimary!==t&&this.Oe.enqueueRetryable((()=>this.Qe(t))),this.isPrimary=t}))}sn(t){return Xc(t).get(Ea.key).next((t=>qa.resolve(this.an(t))))}un(t){return Jc(t).delete(this.clientId)}async hn(){if(this.isPrimary&&!this.ln(this.je,18e5)){this.je=Date.now();const t=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(t=>{const e=Xa(t,Oa.store);return e.Lt().next((t=>{const n=this.fn(t,18e5),s=t.filter((t=>-1===n.indexOf(t)));return qa.forEach(s,(t=>e.delete(t.clientId))).next((()=>s))}))})).catch((()=>[]));if(this.Ye)for(const e of t)this.Ye.removeItem(this.dn(e.clientId))}}en(){this.Ke=this.Oe.enqueueAfterDelay("client_metadata_refresh",4e3,(()=>this.Xe().then((()=>this.hn())).then((()=>this.en()))))}an(t){return!!t&&t.ownerId===this.clientId}rn(t){return this.Me?qa.resolve(!0):Xc(t).get(Ea.key).next((e=>{if(null!==e&&this.ln(e.leaseTimestampMs,5e3)&&!this.wn(e.ownerId)){if(this.an(e)&&this.networkEnabled)return!0;if(!this.an(e)){if(!e.allowTabSynchronization)throw new Hs(zs.FAILED_PRECONDITION,Wc);return!1}}return!(!this.networkEnabled||!this.inForeground)||Jc(t).Lt().next((t=>void 0===this.fn(t,5e3).find((t=>{if(this.clientId!==t.clientId){const e=!this.networkEnabled&&t.networkEnabled,n=!this.inForeground&&t.inForeground,s=this.networkEnabled===t.networkEnabled;if(e||n&&s)return!0}return!1}))))})).next((t=>(this.isPrimary!==t&&Vs("IndexedDbPersistence",`Client ${t?"is":"is not"} eligible for a primary lease.`),t)))}async shutdown(){this.Be=!1,this._n(),this.Ke&&(this.Ke.cancel(),this.Ke=null),this.mn(),this.gn(),await this.Ge.runTransaction("shutdown","readwrite",[Ea.store,Oa.store],(t=>{const e=new Ya(t,er.T);return this.on(e).next((()=>this.un(e)))})),this.Ge.close(),this.yn()}fn(t,e){return t.filter((t=>this.ln(t.updateTimeMs,e)&&!this.wn(t.clientId)))}pn(){return this.runTransaction("getActiveClients","readonly",(t=>Jc(t).Lt().next((t=>this.fn(t,18e5).map((t=>t.clientId))))))}get started(){return this.Be}getMutationQueue(t){return Ic.Yt(t,this.N,this.Ht,this.referenceDelegate)}getTargetCache(){return this.ze}getRemoteDocumentCache(){return this.He}getIndexManager(){return this.Ht}getBundleCache(){return this.Je}runTransaction(t,e,n){Vs("IndexedDbPersistence","Starting transaction:",t);const s="readonly"===e?"readonly":"readwrite";let r;return this.Ge.runTransaction(t,s,Pa,(s=>(r=new Ya(s,this.Le?this.Le.next():er.T),"readwrite-primary"===e?this.sn(r).next((t=>!!t||this.rn(r))).next((e=>{if(!e)throw Us(`Failed to obtain primary lease for action '${t}'.`),this.isPrimary=!1,this.Oe.enqueueRetryable((()=>this.Qe(!1))),new Hs(zs.FAILED_PRECONDITION,Va);return n(r)})).next((t=>this.cn(r).next((()=>t)))):this.Tn(r).next((()=>n(r)))))).then((t=>(r.raiseOnCommittedEvent(),t)))}Tn(t){return Xc(t).get(Ea.key).next((t=>{if(null!==t&&this.ln(t.leaseTimestampMs,5e3)&&!this.wn(t.ownerId)&&!this.an(t)&&!(this.Me||this.allowTabSynchronization&&t.allowTabSynchronization))throw new Hs(zs.FAILED_PRECONDITION,Wc)}))}cn(t){const e=new Ea(this.clientId,this.allowTabSynchronization,Date.now());return Xc(t).put(Ea.key,e)}static bt(){return ja.bt()}on(t){const e=Xc(t);return e.get(Ea.key).next((t=>this.an(t)?(Vs("IndexedDbPersistence","Releasing primary lease."),e.delete(Ea.key)):qa.resolve()))}ln(t,e){const n=Date.now();return!(tn&&(Us(`Detected an update time that is in the future: ${t} > ${n}`),1))}Ze(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.qe=()=>{this.Oe.enqueueAndForget((()=>(this.inForeground="visible"===this.document.visibilityState,this.Xe())))},this.document.addEventListener("visibilitychange",this.qe),this.inForeground="visible"===this.document.visibilityState)}mn(){this.qe&&(this.document.removeEventListener("visibilitychange",this.qe),this.qe=null)}tn(){var t;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.Ue=()=>{this._n(),l()&&navigator.appVersion.match("Version/14")&&this.Oe.enterRestrictedMode(!0),this.Oe.enqueueAndForget((()=>this.shutdown()))},this.window.addEventListener("pagehide",this.Ue))}gn(){this.Ue&&(this.window.removeEventListener("pagehide",this.Ue),this.Ue=null)}wn(t){var e;try{const n=null!==(null===(e=this.Ye)||void 0===e?void 0:e.getItem(this.dn(t)));return Vs("IndexedDbPersistence",`Client '${t}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(t){return Us("IndexedDbPersistence","Failed to get zombied client id.",t),!1}}_n(){if(this.Ye)try{this.Ye.setItem(this.dn(this.clientId),String(Date.now()))}catch(t){Us("Failed to set zombie client id.",t)}}yn(){if(this.Ye)try{this.Ye.removeItem(this.dn(this.clientId))}catch(t){}}dn(t){return`firestore_zombie_${this.persistenceKey}_${t}`}}function Xc(t){return Xa(t,Ea.store)}function Jc(t){return Xa(t,Oa.store)}function Zc(t,e){let n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/" +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class tu{constructor(t,e){this.progress=t,this.En=e}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class eu{constructor(t,e,n){this.He=t,this.In=e,this.Ht=n}An(t,e){return this.In.getAllMutationBatchesAffectingDocumentKey(t,e).next((n=>this.Rn(t,e,n)))}Rn(t,e,n){return this.He.getEntry(t,e).next((t=>{for(const e of n)e.applyToLocalView(t);return t}))}bn(t,e){t.forEach(((t,n)=>{for(const t of e)t.applyToLocalView(n)}))}Pn(t,e){return this.He.getEntries(t,e).next((e=>this.vn(t,e).next((()=>e))))}vn(t,e){return this.In.getAllMutationBatchesAffectingDocumentKeys(t,e).next((t=>this.bn(e,t)))}getDocumentsMatchingQuery(t,e,n){return function(t){return xr.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Vn(t,e.path):bi(e)?this.Sn(t,e,n):this.Dn(t,e,n)}Vn(t,e){return this.An(t,new xr(e)).next((t=>{let e=Eo();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e}))}Sn(t,e,n){const s=e.collectionGroup;let r=Eo();return this.Ht.getCollectionParents(t,s).next((i=>qa.forEach(i,(i=>{const o=function(t,e){return new fi(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,i.child(s));return this.Dn(t,o,n).next((t=>{t.forEach(((t,e)=>{r=r.insert(t,e)}))}))})).next((()=>r))))}Dn(t,e,n){let s,r;return this.He.getDocumentsMatchingQuery(t,e,n).next((n=>(s=n,this.In.getAllMutationBatchesAffectingQuery(t,e)))).next((e=>(r=e,this.Cn(t,r,s).next((t=>{s=t;for(const t of r)for(const e of t.mutations){const n=e.key;let r=s.get(n);null==r&&(r=zr.newInvalidDocument(n),s=s.insert(n,r)),Xi(e,r,t.localWriteTime),r.isFoundDocument()||(s=s.remove(n))}}))))).next((()=>(s.forEach(((t,n)=>{Ai(e,n)||(s=s.remove(t))})),s)))}Cn(t,e,n){let s=No();for(const t of e)for(const e of t.mutations)e instanceof no&&null===n.get(e.key)&&(s=s.add(e.key));let r=n;return this.He.getEntries(t,s).next((t=>(t.forEach(((t,e)=>{e.isFoundDocument()&&(r=r.insert(t,e))})),r)))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class nu{constructor(t,e,n,s){this.targetId=t,this.fromCache=e,this.Nn=n,this.xn=s}static kn(t,e){let n=No(),s=No();for(const t of e.docChanges)switch(t.type){case 0:n=n.add(t.doc.key);break;case 1:s=s.add(t.doc.key)}return new nu(t,e.fromCache,n,s)}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class su{$n(t){this.On=t}getDocumentsMatchingQuery(t,e,n,s){return function(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}(e)||n.isEqual(cr.min())?this.Fn(t,e):this.On.Pn(t,s).next((r=>{const i=this.Mn(e,r);return(pi(e)||yi(e))&&this.Ln(e.limitType,i,s,n)?this.Fn(t,e):(Fs()<=p.DEBUG&&Vs("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),Ni(e)),this.On.getDocumentsMatchingQuery(t,e,n).next((t=>(i.forEach((e=>{t=t.insert(e.key,e)})),t))))}))}Mn(t,e){let n=new yo(Di(t));return e.forEach(((e,s)=>{Ai(t,s)&&(n=n.add(s))})),n}Ln(t,e,n,s){if(n.size!==e.size)return!0;const r="F"===t?e.last():e.first();return!!r&&(r.hasPendingWrites||r.version.compareTo(s)>0)}Fn(t,e){return Fs()<=p.DEBUG&&Vs("QueryEngine","Using full collection scan to execute query:",Ni(e)),this.On.getDocumentsMatchingQuery(t,e,cr.min())}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ru{constructor(t,e,n,s){this.persistence=t,this.Bn=e,this.N=s,this.Un=new go(rr),this.qn=new qc((t=>Wr(t)),Yr),this.Kn=cr.min(),this.In=t.getMutationQueue(n),this.jn=t.getRemoteDocumentCache(),this.ze=t.getTargetCache(),this.Qn=new eu(this.jn,this.In,this.persistence.getIndexManager()),this.Je=t.getBundleCache(),this.Bn.$n(this.Qn)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(e=>t.collect(e,this.Un)))}}function iu(t,e,n,s){return new ru(t,e,n,s)}async function ou(t,e){const n=Gs(t);let s=n.In,r=n.Qn;const i=await n.persistence.runTransaction("Handle user change","readonly",(t=>{let i;return n.In.getAllMutationBatches(t).next((o=>(i=o,s=n.persistence.getMutationQueue(e),r=new eu(n.jn,s,n.persistence.getIndexManager()),s.getAllMutationBatches(t)))).next((e=>{const n=[],s=[];let o=No();for(const t of i){n.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}for(const t of e){s.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}return r.Pn(t,o).next((t=>({Wn:t,removedBatchIds:n,addedBatchIds:s})))}))}));return n.In=s,n.Qn=r,n.Bn.$n(n.Qn),i}function au(t){const e=Gs(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(t=>e.ze.getLastRemoteSnapshotVersion(t)))}function cu(t,e,n,s,r){let i=No();return n.forEach((t=>i=i.add(t))),e.getEntries(t,i).next((t=>{let i=bo();return n.forEach(((n,o)=>{const a=t.get(n),c=(null==r?void 0:r.get(n))||s;o.isNoDocument()&&o.version.isEqual(cr.min())?(e.removeEntry(n,c),i=i.insert(n,o)):!a.isValidDocument()||o.version.compareTo(a.version)>0||0===o.version.compareTo(a.version)&&a.hasPendingWrites?(e.addEntry(o,c),i=i.insert(n,o)):Vs("LocalStore","Ignoring outdated watch update for ",n,". Current version:",a.version," Watch version:",o.version)})),i}))}function uu(t,e){const n=Gs(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(t=>(void 0===e&&(e=-1),n.In.getNextMutationBatchAfterBatchId(t,e))))}function hu(t,e){const n=Gs(t);return n.persistence.runTransaction("Allocate target","readwrite",(t=>{let s;return n.ze.getTargetData(t,e).next((r=>r?(s=r,qa.resolve(s)):n.ze.allocateTargetId(t).next((r=>(s=new tc(e,r,0,t.currentSequenceNumber),n.ze.addTargetData(t,s).next((()=>s)))))))})).then((t=>{const s=n.Un.get(t.targetId);return(null===s||t.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(n.Un=n.Un.insert(t.targetId,t),n.qn.set(e,t.targetId)),t}))}async function lu(t,e,n){const s=Gs(t),r=s.Un.get(e),i=n?"readwrite":"readwrite-primary";try{n||await s.persistence.runTransaction("Release target",i,(t=>s.persistence.referenceDelegate.removeTarget(t,r)))}catch(t){if(!Ga(t))throw t;Vs("LocalStore",`Failed to update sequence numbers for target ${e}: ${t}`)}s.Un=s.Un.remove(e),s.qn.delete(r.target)}function du(t,e,n){const s=Gs(t);let r=cr.min(),i=No();return s.persistence.runTransaction("Execute query","readonly",(t=>function(t,e,n){const s=Gs(t),r=s.qn.get(n);return void 0!==r?qa.resolve(s.Un.get(r)):s.ze.getTargetData(e,n)}(s,t,Ei(e)).next((e=>{if(e)return r=e.lastLimboFreeSnapshotVersion,s.ze.getMatchingKeysForTargetId(t,e.targetId).next((t=>{i=t}))})).next((()=>s.Bn.getDocumentsMatchingQuery(t,e,n?r:cr.min(),n?i:No()))).next((t=>({documents:t,Gn:i})))))}function fu(t,e){const n=Gs(t),s=Gs(n.ze),r=n.Un.get(e);return r?Promise.resolve(r.target):n.persistence.runTransaction("Get target data","readonly",(t=>s.Tt(t,e).next((t=>t?t.target:null))))}function gu(t){const e=Gs(t);return e.persistence.runTransaction("Get new document changes","readonly",(t=>function(t,e,n){const s=Gs(t);let r=bo(),i=rc(n);const o=Gc(e),a=IDBKeyRange.lowerBound(i,!0);return o.Kt({index:Da.readTimeIndex,range:a},((t,e)=>{const n=nc(s.N,e);r=r.insert(n.key,n),i=e.readTime})).next((()=>({En:r,readTime:ic(i)})))}(e.jn,t,e.Kn))).then((({En:t,readTime:n})=>(e.Kn=n,t)))}async function mu(t,e,n=No()){const s=await hu(t,Ei(lc(e.bundledQuery))),r=Gs(t);return r.persistence.runTransaction("Save named query","readwrite",(t=>{const i=$o(e.readTime);if(s.snapshotVersion.compareTo(i)>=0)return r.Je.saveNamedQuery(t,e);const o=s.withResumeToken(wr.EMPTY_BYTE_STRING,i);return r.Un=r.Un.insert(o.targetId,o),r.ze.updateTargetData(t,o).next((()=>r.ze.removeMatchingKeysForTargetId(t,s.targetId))).next((()=>r.ze.addMatchingKeys(t,n,s.targetId))).next((()=>r.Je.saveNamedQuery(t,e)))}))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class pu{constructor(t){this.N=t,this.Yn=new Map,this.Xn=new Map}getBundleMetadata(t,e){return qa.resolve(this.Yn.get(e))}saveBundleMetadata(t,e){var n;return this.Yn.set(e.id,{id:(n=e).id,version:n.version,createTime:$o(n.createTime)}),qa.resolve()}getNamedQuery(t,e){return qa.resolve(this.Xn.get(e))}saveNamedQuery(t,e){return this.Xn.set(e.name,function(t){return{name:t.name,query:lc(t.bundledQuery),readTime:$o(t.readTime)}}(e)),qa.resolve()}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class yu{constructor(){this.Zn=new yo(wu.ts),this.es=new yo(wu.ns)}isEmpty(){return this.Zn.isEmpty()}addReference(t,e){const n=new wu(t,e);this.Zn=this.Zn.add(n),this.es=this.es.add(n)}ss(t,e){t.forEach((t=>this.addReference(t,e)))}removeReference(t,e){this.rs(new wu(t,e))}os(t,e){t.forEach((t=>this.removeReference(t,e)))}cs(t){const e=new xr(new fr([])),n=new wu(e,t),s=new wu(e,t+1),r=[];return this.es.forEachInRange([n,s],(t=>{this.rs(t),r.push(t.key)})),r}us(){this.Zn.forEach((t=>this.rs(t)))}rs(t){this.Zn=this.Zn.delete(t),this.es=this.es.delete(t)}hs(t){const e=new xr(new fr([])),n=new wu(e,t),s=new wu(e,t+1);let r=No();return this.es.forEachInRange([n,s],(t=>{r=r.add(t.key)})),r}containsKey(t){const e=new wu(t,0),n=this.Zn.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)}}class wu{constructor(t,e){this.key=t,this.ls=e}static ts(t,e){return xr.comparator(t.key,e.key)||rr(t.ls,e.ls)}static ns(t,e){return rr(t.ls,e.ls)||xr.comparator(t.key,e.key)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class vu{constructor(t,e){this.Ht=t,this.referenceDelegate=e,this.In=[],this.fs=1,this.ds=new yo(wu.ts)}checkEmpty(t){return qa.resolve(0===this.In.length)}addMutationBatch(t,e,n,s){const r=this.fs;this.fs++,this.In.length>0&&this.In[this.In.length-1];const i=new Ja(r,e,n,s);this.In.push(i);for(const e of s)this.ds=this.ds.add(new wu(e.key,r)),this.Ht.addToCollectionParentIndex(t,e.key.path.popLast());return qa.resolve(i)}lookupMutationBatch(t,e){return qa.resolve(this.ws(e))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,s=this._s(n),r=s<0?0:s;return qa.resolve(this.In.length>r?this.In[r]:null)}getHighestUnacknowledgedBatchId(){return qa.resolve(0===this.In.length?-1:this.fs-1)}getAllMutationBatches(t){return qa.resolve(this.In.slice())}getAllMutationBatchesAffectingDocumentKey(t,e){const n=new wu(e,0),s=new wu(e,Number.POSITIVE_INFINITY),r=[];return this.ds.forEachInRange([n,s],(t=>{const e=this.ws(t.ls);r.push(e)})),qa.resolve(r)}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new yo(rr);return e.forEach((t=>{const e=new wu(t,0),s=new wu(t,Number.POSITIVE_INFINITY);this.ds.forEachInRange([e,s],(t=>{n=n.add(t.ls)}))})),qa.resolve(this.gs(n))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,s=n.length+1;let r=n;xr.isDocumentKey(r)||(r=r.child(""));const i=new wu(new xr(r),0);let o=new yo(rr);return this.ds.forEachWhile((t=>{const e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===s&&(o=o.add(t.ls)),!0)}),i),qa.resolve(this.gs(o))}gs(t){const e=[];return t.forEach((t=>{const n=this.ws(t);null!==n&&e.push(n)})),e}removeMutationBatch(t,e){Ks(0===this.ys(e.batchId,"removed")),this.In.shift();let n=this.ds;return qa.forEach(e.mutations,(s=>{const r=new wu(s.key,e.batchId);return n=n.delete(r),this.referenceDelegate.markPotentiallyOrphaned(t,s.key)})).next((()=>{this.ds=n}))}te(t){}containsKey(t,e){const n=new wu(e,0),s=this.ds.firstAfterOrEqual(n);return qa.resolve(e.isEqual(s&&s.key))}performConsistencyCheck(t){return this.In.length,qa.resolve()}ys(t,e){return this._s(t)}_s(t){return 0===this.In.length?0:t-this.In[0].batchId}ws(t){const e=this._s(t);return e<0||e>=this.In.length?null:this.In[e]}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class bu{constructor(t,e){this.Ht=t,this.ps=e,this.docs=new go(xr.comparator),this.size=0}addEntry(t,e,n){const s=e.key,r=this.docs.get(s),i=r?r.size:0,o=this.ps(e);return this.docs=this.docs.insert(s,{document:e.clone(),size:o,readTime:n}),this.size+=o-i,this.Ht.addToCollectionParentIndex(t,s.path.popLast())}removeEntry(t){const e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)}getEntry(t,e){const n=this.docs.get(e);return qa.resolve(n?n.document.clone():zr.newInvalidDocument(e))}getEntries(t,e){let n=bo();return e.forEach((t=>{const e=this.docs.get(t);n=n.insert(t,e?e.document.clone():zr.newInvalidDocument(t))})),qa.resolve(n)}getDocumentsMatchingQuery(t,e,n){let s=bo();const r=new xr(e.path.child("")),i=this.docs.getIteratorFrom(r);for(;i.hasNext();){const{key:t,value:{document:r,readTime:o}}=i.getNext();if(!e.path.isPrefixOf(t.path))break;o.compareTo(n)<=0||Ai(e,r)&&(s=s.insert(r.key,r.clone()))}return qa.resolve(s)}Ts(t,e){return qa.forEach(this.docs,(t=>e(t)))}newChangeBuffer(t){return new Tu(this)}getSize(t){return qa.resolve(this.size)}}class Tu extends Bc{constructor(t){super(),this.Se=t}applyChanges(t){const e=[];return this.changes.forEach(((n,s)=>{s.document.isValidDocument()?e.push(this.Se.addEntry(t,s.document,this.getReadTime(n))):this.Se.removeEntry(n)})),qa.waitFor(e)}getFromCache(t,e){return this.Se.getEntry(t,e)}getAllFromCache(t,e){return this.Se.getEntries(t,e)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Eu{constructor(t){this.persistence=t,this.Es=new qc((t=>Wr(t)),Yr),this.lastRemoteSnapshotVersion=cr.min(),this.highestTargetId=0,this.Is=0,this.As=new yu,this.targetCount=0,this.Rs=Dc.se()}forEachTarget(t,e){return this.Es.forEach(((t,n)=>e(n))),qa.resolve()}getLastRemoteSnapshotVersion(t){return qa.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(t){return qa.resolve(this.Is)}allocateTargetId(t){return this.highestTargetId=this.Rs.next(),qa.resolve(this.highestTargetId)}setTargetsMetadata(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.Is&&(this.Is=e),qa.resolve()}ce(t){this.Es.set(t.target,t);const e=t.targetId;e>this.highestTargetId&&(this.Rs=new Dc(e),this.highestTargetId=e),t.sequenceNumber>this.Is&&(this.Is=t.sequenceNumber)}addTargetData(t,e){return this.ce(e),this.targetCount+=1,qa.resolve()}updateTargetData(t,e){return this.ce(e),qa.resolve()}removeTargetData(t,e){return this.Es.delete(e.target),this.As.cs(e.targetId),this.targetCount-=1,qa.resolve()}removeTargets(t,e,n){let s=0;const r=[];return this.Es.forEach(((i,o)=>{o.sequenceNumber<=e&&null===n.get(o.targetId)&&(this.Es.delete(i),r.push(this.removeMatchingKeysForTargetId(t,o.targetId)),s++)})),qa.waitFor(r).next((()=>s))}getTargetCount(t){return qa.resolve(this.targetCount)}getTargetData(t,e){const n=this.Es.get(e)||null;return qa.resolve(n)}addMatchingKeys(t,e,n){return this.As.ss(e,n),qa.resolve()}removeMatchingKeys(t,e,n){this.As.os(e,n);const s=this.persistence.referenceDelegate,r=[];return s&&e.forEach((e=>{r.push(s.markPotentiallyOrphaned(t,e))})),qa.waitFor(r)}removeMatchingKeysForTargetId(t,e){return this.As.cs(e),qa.resolve()}getMatchingKeysForTargetId(t,e){const n=this.As.hs(e);return qa.resolve(n)}containsKey(t,e){return qa.resolve(this.As.containsKey(e))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Iu{constructor(t,e){this.bs={},this.Le=new er(0),this.Be=!1,this.Be=!0,this.referenceDelegate=t(this),this.ze=new Eu(this),this.Ht=new mc,this.He=function(t,e){return new bu(t,e)}(this.Ht,(t=>this.referenceDelegate.Ps(t))),this.N=new ec(e),this.Je=new pu(this.N)}start(){return Promise.resolve()}shutdown(){return this.Be=!1,Promise.resolve()}get started(){return this.Be}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(){return this.Ht}getMutationQueue(t){let e=this.bs[t.toKey()];return e||(e=new vu(this.Ht,this.referenceDelegate),this.bs[t.toKey()]=e),e}getTargetCache(){return this.ze}getRemoteDocumentCache(){return this.He}getBundleCache(){return this.Je}runTransaction(t,e,n){Vs("MemoryPersistence","Starting transaction:",t);const s=new Su(this.Le.next());return this.referenceDelegate.vs(),n(s).next((t=>this.referenceDelegate.Vs(s).next((()=>t)))).toPromise().then((t=>(s.raiseOnCommittedEvent(),t)))}Ss(t,e){return qa.or(Object.values(this.bs).map((n=>()=>n.containsKey(t,e))))}}class Su extends Ua{constructor(t){super(),this.currentSequenceNumber=t}}class _u{constructor(t){this.persistence=t,this.Ds=new yu,this.Cs=null}static Ns(t){return new _u(t)}get xs(){if(this.Cs)return this.Cs;throw js()}addReference(t,e,n){return this.Ds.addReference(n,e),this.xs.delete(n.toString()),qa.resolve()}removeReference(t,e,n){return this.Ds.removeReference(n,e),this.xs.add(n.toString()),qa.resolve()}markPotentiallyOrphaned(t,e){return this.xs.add(e.toString()),qa.resolve()}removeTarget(t,e){this.Ds.cs(e.targetId).forEach((t=>this.xs.add(t.toString())));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(t,e.targetId).next((t=>{t.forEach((t=>this.xs.add(t.toString())))})).next((()=>n.removeTargetData(t,e)))}vs(){this.Cs=new Set}Vs(t){const e=this.persistence.getRemoteDocumentCache().newChangeBuffer();return qa.forEach(this.xs,(n=>{const s=xr.fromPath(n);return this.ks(t,s).next((t=>{t||e.removeEntry(s)}))})).next((()=>(this.Cs=null,e.apply(t))))}updateLimboDocument(t,e){return this.ks(t,e).next((t=>{t?this.xs.delete(e.toString()):this.xs.add(e.toString())}))}Ps(t){return 0}ks(t,e){return qa.or([()=>qa.resolve(this.Ds.containsKey(e)),()=>this.persistence.getTargetCache().containsKey(t,e),()=>this.persistence.Ss(t,e)])}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Nu(t,e){return`firestore_clients_${t}_${e}`}function Au(t,e,n){let s=`firestore_mutations_${t}_${n}`;return e.isAuthenticated()&&(s+=`_${e.uid}`),s}function Du(t,e){return`firestore_targets_${t}_${e}`}class xu{constructor(t,e,n,s){this.user=t,this.batchId=e,this.state=n,this.error=s}static $s(t,e,n){const s=JSON.parse(n);let r,i="object"==typeof s&&-1!==["pending","acknowledged","rejected"].indexOf(s.state)&&(void 0===s.error||"object"==typeof s.error);return i&&s.error&&(i="string"==typeof s.error.message&&"string"==typeof s.error.code,i&&(r=new Hs(s.error.code,s.error.message))),i?new xu(t,e,s.state,r):(Us("SharedClientState",`Failed to parse mutation state for ID '${e}': ${n}`),null)}Os(){const t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)}}class Cu{constructor(t,e,n){this.targetId=t,this.state=e,this.error=n}static $s(t,e){const n=JSON.parse(e);let s,r="object"==typeof n&&-1!==["not-current","current","rejected"].indexOf(n.state)&&(void 0===n.error||"object"==typeof n.error);return r&&n.error&&(r="string"==typeof n.error.message&&"string"==typeof n.error.code,r&&(s=new Hs(n.error.code,n.error.message))),r?new Cu(t,n.state,s):(Us("SharedClientState",`Failed to parse target state for ID '${t}': ${e}`),null)}Os(){const t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)}}class ku{constructor(t,e){this.clientId=t,this.activeTargetIds=e}static $s(t,e){const n=JSON.parse(e);let s="object"==typeof n&&n.activeTargetIds instanceof Array,r=Do();for(let t=0;s&&tthis.shutdown())),this.started=!0}writeSequenceNumber(t){this.setItem(this.Qs,JSON.stringify(t))}getAllActiveQueryTargets(){return this.ti(this.qs)}isActiveQueryTarget(t){let e=!1;return this.qs.forEach(((n,s)=>{s.activeTargetIds.has(t)&&(e=!0)})),e}addPendingMutation(t){this.ei(t,"pending")}updateMutationState(t,e,n){this.ei(t,e,n),this.ni(t)}addLocalQueryTarget(t){let e="not-current";if(this.isActiveQueryTarget(t)){const n=this.storage.getItem(Du(this.persistenceKey,t));if(n){const s=Cu.$s(t,n);s&&(e=s.state)}}return this.si.Fs(t),this.Ys(),e}removeLocalQueryTarget(t){this.si.Ms(t),this.Ys()}isLocalQueryTarget(t){return this.si.activeTargetIds.has(t)}clearQueryState(t){this.removeItem(Du(this.persistenceKey,t))}updateQueryState(t,e,n){this.ii(t,e,n)}handleUserChange(t,e,n){e.forEach((t=>{this.ni(t)})),this.currentUser=t,n.forEach((t=>{this.addPendingMutation(t)}))}setOnlineState(t){this.ri(t)}notifyBundleLoaded(){this.oi()}shutdown(){this.started&&(this.window.removeEventListener("storage",this.Bs),this.removeItem(this.js),this.started=!1)}getItem(t){const e=this.storage.getItem(t);return Vs("SharedClientState","READ",t,e),e}setItem(t,e){Vs("SharedClientState","SET",t,e),this.storage.setItem(t,e)}removeItem(t){Vs("SharedClientState","REMOVE",t),this.storage.removeItem(t)}Us(t){const e=t;if(e.storageArea===this.storage){if(Vs("SharedClientState","EVENT",e.key,e.newValue),e.key===this.js)return void Us("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Oe.enqueueRetryable((async()=>{if(this.started){if(null!==e.key)if(this.Ws.test(e.key)){if(null==e.newValue){const t=this.ci(e.key);return this.ai(t,null)}{const t=this.ui(e.key,e.newValue);if(t)return this.ai(t.clientId,t)}}else if(this.Gs.test(e.key)){if(null!==e.newValue){const t=this.hi(e.key,e.newValue);if(t)return this.li(t)}}else if(this.zs.test(e.key)){if(null!==e.newValue){const t=this.fi(e.key,e.newValue);if(t)return this.di(t)}}else if(e.key===this.Hs){if(null!==e.newValue){const t=this.Xs(e.newValue);if(t)return this.Zs(t)}}else if(e.key===this.Qs){const t=function(t){let e=er.T;if(null!=t)try{const n=JSON.parse(t);Ks("number"==typeof n),e=n}catch(t){Us("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(e.newValue);t!==er.T&&this.sequenceNumberHandler(t)}else if(e.key===this.Js)return this.syncEngine.wi()}else this.Ks.push(e)}))}}get si(){return this.qs.get(this.Ls)}Ys(){this.setItem(this.js,this.si.Os())}ei(t,e,n){const s=new xu(this.currentUser,t,e,n),r=Au(this.persistenceKey,this.currentUser,t);this.setItem(r,s.Os())}ni(t){const e=Au(this.persistenceKey,this.currentUser,t);this.removeItem(e)}ri(t){const e={clientId:this.Ls,onlineState:t};this.storage.setItem(this.Hs,JSON.stringify(e))}ii(t,e,n){const s=Du(this.persistenceKey,t),r=new Cu(t,e,n);this.setItem(s,r.Os())}oi(){this.setItem(this.Js,"value-not-used")}ci(t){const e=this.Ws.exec(t);return e?e[1]:null}ui(t,e){const n=this.ci(t);return ku.$s(n,e)}hi(t,e){const n=this.Gs.exec(t),s=Number(n[1]),r=void 0!==n[2]?n[2]:null;return xu.$s(new Ls(r),s,e)}fi(t,e){const n=this.zs.exec(t),s=Number(n[1]);return Cu.$s(s,e)}Xs(t){return Ru.$s(t)}async li(t){if(t.user.uid===this.currentUser.uid)return this.syncEngine._i(t.batchId,t.state,t.error);Vs("SharedClientState",`Ignoring mutation for non-active user ${t.user.uid}`)}di(t){return this.syncEngine.mi(t.targetId,t.state,t.error)}ai(t,e){const n=e?this.qs.insert(t,e):this.qs.remove(t),s=this.ti(this.qs),r=this.ti(n),i=[],o=[];return r.forEach((t=>{s.has(t)||i.push(t)})),s.forEach((t=>{r.has(t)||o.push(t)})),this.syncEngine.gi(i,o).then((()=>{this.qs=n}))}Zs(t){this.qs.get(t.clientId)&&this.onlineStateHandler(t.onlineState)}ti(t){let e=Do();return t.forEach(((t,n)=>{e=e.unionWith(n.activeTargetIds)})),e}}class Mu{constructor(){this.yi=new Lu,this.pi={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,e,n){}addLocalQueryTarget(t){return this.yi.Fs(t),this.pi[t]||"not-current"}updateQueryState(t,e,n){this.pi[t]=e}removeLocalQueryTarget(t){this.yi.Ms(t)}isLocalQueryTarget(t){return this.yi.activeTargetIds.has(t)}clearQueryState(t){delete this.pi[t]}getAllActiveQueryTargets(){return this.yi.activeTargetIds}isActiveQueryTarget(t){return this.yi.activeTargetIds.has(t)}start(){return this.yi=new Lu,Promise.resolve()}handleUserChange(t,e,n){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Fu{Ti(t){}shutdown(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Pu{constructor(){this.Ei=()=>this.Ii(),this.Ai=()=>this.Ri(),this.bi=[],this.Pi()}Ti(t){this.bi.push(t)}shutdown(){window.removeEventListener("online",this.Ei),window.removeEventListener("offline",this.Ai)}Pi(){window.addEventListener("online",this.Ei),window.addEventListener("offline",this.Ai)}Ii(){Vs("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const t of this.bi)t(0)}Ri(){Vs("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const t of this.bi)t(1)}static bt(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Vu={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Uu{constructor(t){this.vi=t.vi,this.Vi=t.Vi}Si(t){this.Di=t}Ci(t){this.Ni=t}onMessage(t){this.xi=t}close(){this.Vi()}send(t){this.vi(t)}ki(){this.Di()}$i(t){this.Ni(t)}Oi(t){this.xi(t)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qu extends class{constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const e=t.ssl?"https":"http";this.Fi=e+"://"+t.host,this.Mi="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}Li(t,e,n,s){const r=this.Bi(t,e);Vs("RestConnection","Sending: ",r,n);const i={};return this.Ui(i,s),this.qi(t,r,i,n).then((t=>(Vs("RestConnection","Received: ",t),t)),(e=>{throw qs("RestConnection",`${t} failed with error: `,e,"url: ",r,"request:",n),e}))}Ki(t,e,n,s){return this.Li(t,e,n,s)}Ui(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/"+Os,t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e)for(const n in e.authHeaders)e.authHeaders.hasOwnProperty(n)&&(t[n]=e.authHeaders[n])}Bi(t,e){const n=Vu[t];return`${this.Fi}/v1/${e}:${n}`}}{constructor(t){super(t),this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams}qi(t,e,n,s){return new Promise(((r,i)=>{const o=new ks;o.listenOnce(_s.COMPLETE,(()=>{try{switch(o.getLastErrorCode()){case Ss.NO_ERROR:const e=o.getResponseJson();Vs("Connection","XHR received:",JSON.stringify(e)),r(e);break;case Ss.TIMEOUT:Vs("Connection",'RPC "'+t+'" timed out'),i(new Hs(zs.DEADLINE_EXCEEDED,"Request time out"));break;case Ss.HTTP_ERROR:const n=o.getStatus();if(Vs("Connection",'RPC "'+t+'" failed with status:',n,"response text:",o.getResponseText()),n>0){const t=o.getResponseJson().error;if(t&&t.status&&t.message){const e=function(t){const e=t.toLowerCase().replace(/_/g,"-");return Object.values(zs).indexOf(e)>=0?e:zs.UNKNOWN}(t.status);i(new Hs(e,t.message))}else i(new Hs(zs.UNKNOWN,"Server responded with status "+o.getStatus()))}else i(new Hs(zs.UNAVAILABLE,"Connection failed."));break;default:js()}}finally{Vs("Connection",'RPC "'+t+'" completed.')}}));const a=JSON.stringify(s);o.send(e,"POST",a,n,15)}))}ji(t,e){const n=[this.Fi,"/","google.firestore.v1.Firestore","/",t,"/channel"],s=new vs,r=de(),i={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(i.xmlHttpFactory=new xs({})),this.Ui(i.initMessageHeaders,e),"undefined"!=typeof window&&(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(h())||"object"==typeof navigator&&"ReactNative"===navigator.product||h().indexOf("Electron/")>=0||function(){const t=h();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}()||h().indexOf("MSAppHost/")>=0||function(){const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}()||(i.httpHeadersOverwriteParam="$httpHeaders");const o=n.join("");Vs("Connection","Creating WebChannel: "+o,i);const a=s.createWebChannel(o,i);let c=!1,u=!1;const l=new Uu({vi:t=>{u?Vs("Connection","Not sending because WebChannel is closed:",t):(c||(Vs("Connection","Opening WebChannel transport."),a.open(),c=!0),Vs("Connection","WebChannel sending:",t),a.send(t))},Vi:()=>a.close()}),d=(t,e,n)=>{t.listen(e,(t=>{try{n(t)}catch(t){setTimeout((()=>{throw t}),0)}}))};return d(a,Cs.EventType.OPEN,(()=>{u||Vs("Connection","WebChannel transport opened.")})),d(a,Cs.EventType.CLOSE,(()=>{u||(u=!0,Vs("Connection","WebChannel transport closed"),l.$i())})),d(a,Cs.EventType.ERROR,(t=>{u||(u=!0,qs("Connection","WebChannel transport errored:",t),l.$i(new Hs(zs.UNAVAILABLE,"The operation could not be completed")))})),d(a,Cs.EventType.MESSAGE,(t=>{var e;if(!u){const n=t.data[0];Ks(!!n);const s=n,r=s.error||(null===(e=s[0])||void 0===e?void 0:e.error);if(r){Vs("Connection","WebChannel received error:",r);const t=r.status;let e=function(t){const e=uo[t];if(void 0!==e)return fo(e)}(t),n=r.message;void 0===e&&(e=zs.INTERNAL,n="Unknown error status: "+t+" with message "+r.message),u=!0,l.$i(new Hs(e,n)),a.close()}else Vs("Connection","WebChannel received:",n),l.Oi(n)}})),d(r,Ns.STAT_EVENT,(t=>{t.stat===As?Vs("Connection","Detected buffering proxy"):t.stat===Ds&&Vs("Connection","Detected no buffering proxy")})),setTimeout((()=>{l.ki()}),0),l}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Bu(){return"undefined"!=typeof window?window:null}function ju(){return"undefined"!=typeof document?document:null} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Ku(t){return new qo(t,!0)}class $u{constructor(t,e,n=1e3,s=1.5,r=6e4){this.Oe=t,this.timerId=e,this.Qi=n,this.Wi=s,this.Gi=r,this.zi=0,this.Hi=null,this.Ji=Date.now(),this.reset()}reset(){this.zi=0}Yi(){this.zi=this.Gi}Xi(t){this.cancel();const e=Math.floor(this.zi+this.Zi()),n=Math.max(0,Date.now()-this.Ji),s=Math.max(0,e-n);s>0&&Vs("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.zi} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),this.Hi=this.Oe.enqueueAfterDelay(this.timerId,s,(()=>(this.Ji=Date.now(),t()))),this.zi*=this.Wi,this.zithis.Gi&&(this.zi=this.Gi)}tr(){null!==this.Hi&&(this.Hi.skipDelay(),this.Hi=null)}cancel(){null!==this.Hi&&(this.Hi.cancel(),this.Hi=null)}Zi(){return(Math.random()-.5)*this.zi}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Gu{constructor(t,e,n,s,r,i,o){this.Oe=t,this.er=n,this.nr=s,this.sr=r,this.credentialsProvider=i,this.listener=o,this.state=0,this.ir=0,this.rr=null,this.cr=null,this.stream=null,this.ar=new $u(t,e)}ur(){return 1===this.state||5===this.state||this.hr()}hr(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.lr()}async stop(){this.ur()&&await this.close(0)}dr(){this.state=0,this.ar.reset()}wr(){this.hr()&&null===this.rr&&(this.rr=this.Oe.enqueueAfterDelay(this.er,6e4,(()=>this._r())))}mr(t){this.gr(),this.stream.send(t)}async _r(){if(this.hr())return this.close(0)}gr(){this.rr&&(this.rr.cancel(),this.rr=null)}yr(){this.cr&&(this.cr.cancel(),this.cr=null)}async close(t,e){this.gr(),this.yr(),this.ar.cancel(),this.ir++,4!==t?this.ar.reset():e&&e.code===zs.RESOURCE_EXHAUSTED?(Us(e.toString()),Us("Using maximum backoff delay to prevent overloading the backend."),this.ar.Yi()):e&&e.code===zs.UNAUTHENTICATED&&3!==this.state&&this.credentialsProvider.invalidateToken(),null!==this.stream&&(this.pr(),this.stream.close(),this.stream=null),this.state=t,await this.listener.Ci(e)}pr(){}auth(){this.state=1;const t=this.Tr(this.ir),e=this.ir;this.credentialsProvider.getToken().then((t=>{this.ir===e&&this.Er(t)}),(e=>{t((()=>{const t=new Hs(zs.UNKNOWN,"Fetching auth token failed: "+e.message);return this.Ir(t)}))}))}Er(t){const e=this.Tr(this.ir);this.stream=this.Ar(t),this.stream.Si((()=>{e((()=>(this.state=2,this.cr=this.Oe.enqueueAfterDelay(this.nr,1e4,(()=>(this.hr()&&(this.state=3),Promise.resolve()))),this.listener.Si())))})),this.stream.Ci((t=>{e((()=>this.Ir(t)))})),this.stream.onMessage((t=>{e((()=>this.onMessage(t)))}))}lr(){this.state=5,this.ar.Xi((async()=>{this.state=0,this.start()}))}Ir(t){return Vs("PersistentStream",`close with error: ${t}`),this.stream=null,this.close(4,t)}Tr(t){return e=>{this.Oe.enqueueAndForget((()=>this.ir===t?e():(Vs("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class zu extends Gu{constructor(t,e,n,s,r){super(t,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",e,n,r),this.N=s}Ar(t){return this.sr.ji("Listen",t)}onMessage(t){this.ar.reset();const e=function(t,e){let n;if("targetChange"in e){e.targetChange;const s=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:js()}(e.targetChange.targetChangeType||"NO_CHANGE"),r=e.targetChange.targetIds||[],i=function(t,e){return t.D?(Ks(void 0===e||"string"==typeof e),wr.fromBase64String(e||"")):(Ks(void 0===e||e instanceof Uint8Array),wr.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(t){const e=void 0===t.code?zs.UNKNOWN:fo(t.code);return new Hs(e,t.message||"")}(o);n=new Lo(s,r,i,a||null)}else if("documentChange"in e){e.documentChange;const s=e.documentChange;s.document,s.document.name,s.document.updateTime;const r=Qo(t,s.document.name),i=$o(s.document.updateTime),o=new $r({mapValue:{fields:s.document.fields}}),a=zr.newFoundDocument(r,i,o),c=s.targetIds||[],u=s.removedTargetIds||[];n=new ko(c,u,a.key,a)}else if("documentDelete"in e){e.documentDelete;const s=e.documentDelete;s.document;const r=Qo(t,s.document),i=s.readTime?$o(s.readTime):cr.min(),o=zr.newNoDocument(r,i),a=s.removedTargetIds||[];n=new ko([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const s=e.documentRemove;s.document;const r=Qo(t,s.document),i=s.removedTargetIds||[];n=new ko([],i,r,null)}else{if(!("filter"in e))return js();{e.filter;const t=e.filter;t.targetId;const s=t.count||0,r=new co(s),i=t.targetId;n=new Ro(i,r)}}return n}(this.N,t),n=function(t){if(!("targetChange"in t))return cr.min();const e=t.targetChange;return e.targetIds&&e.targetIds.length?cr.min():e.readTime?$o(e.readTime):cr.min()}(t);return this.listener.Rr(e,n)}br(t){const e={};e.database=Xo(this.N),e.addTarget=function(t,e){let n;const s=e.target;return n=Xr(s)?{documents:sa(t,s)}:{query:ra(t,s)},n.targetId=e.targetId,e.resumeToken.approximateByteSize()>0?n.resumeToken=jo(t,e.resumeToken):e.snapshotVersion.compareTo(cr.min())>0&&(n.readTime=Bo(t,e.snapshotVersion.toTimestamp())),n}(this.N,t);const n=function(t,e){const n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return js()}}(0,e.purpose);return null==n?null:{"goog-listen-tags":n}}(this.N,t);n&&(e.labels=n),this.mr(e)}Pr(t){const e={};e.database=Xo(this.N),e.removeTarget=t,this.mr(e)}}class Hu extends Gu{constructor(t,e,n,s,r){super(t,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",e,n,r),this.N=s,this.vr=!1}get Vr(){return this.vr}start(){this.vr=!1,this.lastStreamToken=void 0,super.start()}pr(){this.vr&&this.Sr([])}Ar(t){return this.sr.ji("Write",t)}onMessage(t){if(Ks(!!t.streamToken),this.lastStreamToken=t.streamToken,this.vr){this.ar.reset();const e=function(t,e){return t&&t.length>0?(Ks(void 0!==e),t.map((t=>function(t,e){let n=t.updateTime?$o(t.updateTime):$o(e);return n.isEqual(cr.min())&&(n=$o(e)),new zi(n,t.transformResults||[])}(t,e)))):[]}(t.writeResults,t.commitTime),n=$o(t.commitTime);return this.listener.Dr(n,e)}return Ks(!t.writeResults||0===t.writeResults.length),this.vr=!0,this.listener.Cr()}Nr(){const t={};t.database=Xo(this.N),this.mr(t)}Sr(t){const e={streamToken:this.lastStreamToken,writes:t.map((t=>ea(this.N,t)))};this.mr(e)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Qu extends class{}{constructor(t,e,n){super(),this.credentials=t,this.sr=e,this.N=n,this.kr=!1}$r(){if(this.kr)throw new Hs(zs.FAILED_PRECONDITION,"The client has already been terminated.")}Li(t,e,n){return this.$r(),this.credentials.getToken().then((s=>this.sr.Li(t,e,n,s))).catch((t=>{throw"FirebaseError"===t.name?(t.code===zs.UNAUTHENTICATED&&this.credentials.invalidateToken(),t):new Hs(zs.UNKNOWN,t.toString())}))}Ki(t,e,n){return this.$r(),this.credentials.getToken().then((s=>this.sr.Ki(t,e,n,s))).catch((t=>{throw"FirebaseError"===t.name?(t.code===zs.UNAUTHENTICATED&&this.credentials.invalidateToken(),t):new Hs(zs.UNKNOWN,t.toString())}))}terminate(){this.kr=!0}}class Wu{constructor(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.Or=0,this.Fr=null,this.Mr=!0}Lr(){0===this.Or&&(this.Br("Unknown"),this.Fr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this.Fr=null,this.Ur("Backend didn't respond within 10 seconds."),this.Br("Offline"),Promise.resolve()))))}qr(t){"Online"===this.state?this.Br("Unknown"):(this.Or++,this.Or>=1&&(this.Kr(),this.Ur(`Connection failed 1 times. Most recent error: ${t.toString()}`),this.Br("Offline")))}set(t){this.Kr(),this.Or=0,"Online"===t&&(this.Mr=!1),this.Br(t)}Br(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))}Ur(t){const e=`Could not reach Cloud Firestore backend. ${t}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.Mr?(Us(e),this.Mr=!1):Vs("OnlineStateTracker",e)}Kr(){null!==this.Fr&&(this.Fr.cancel(),this.Fr=null)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Yu{constructor(t,e,n,s,r){this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.jr=[],this.Qr=new Map,this.Wr=new Set,this.Gr=[],this.zr=r,this.zr.Ti((t=>{n.enqueueAndForget((async()=>{ih(this)&&(Vs("RemoteStore","Restarting streams for network reachability change."),await async function(t){const e=Gs(t);e.Wr.add(4),await Ju(e),e.Hr.set("Unknown"),e.Wr.delete(4),await Xu(e)}(this))}))})),this.Hr=new Wu(n,s)}}async function Xu(t){if(ih(t))for(const e of t.Gr)await e(!0)}async function Ju(t){for(const e of t.Gr)await e(!1)}function Zu(t,e){const n=Gs(t);n.Qr.has(e.targetId)||(n.Qr.set(e.targetId,e),rh(n)?sh(n):Eh(n).hr()&&eh(n,e))}function th(t,e){const n=Gs(t),s=Eh(n);n.Qr.delete(e),s.hr()&&nh(n,e),0===n.Qr.size&&(s.hr()?s.wr():ih(n)&&n.Hr.set("Unknown"))}function eh(t,e){t.Jr.Y(e.targetId),Eh(t).br(e)}function nh(t,e){t.Jr.Y(e),Eh(t).Pr(e)}function sh(t){t.Jr=new Mo({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),Tt:e=>t.Qr.get(e)||null}),Eh(t).start(),t.Hr.Lr()}function rh(t){return ih(t)&&!Eh(t).ur()&&t.Qr.size>0}function ih(t){return 0===Gs(t).Wr.size}function oh(t){t.Jr=void 0}async function ah(t){t.Qr.forEach(((e,n)=>{eh(t,e)}))}async function ch(t,e){oh(t),rh(t)?(t.Hr.qr(e),sh(t)):t.Hr.set("Unknown")}async function uh(t,e,n){if(t.Hr.set("Online"),e instanceof Lo&&2===e.state&&e.cause)try{await async function(t,e){const n=e.cause;for(const s of e.targetIds)t.Qr.has(s)&&(await t.remoteSyncer.rejectListen(s,n),t.Qr.delete(s),t.Jr.removeTarget(s))}(t,e)}catch(n){Vs("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),n),await hh(t,n)}else if(e instanceof ko?t.Jr.rt(e):e instanceof Ro?t.Jr.ft(e):t.Jr.at(e),!n.isEqual(cr.min()))try{const e=await au(t.localStore);n.compareTo(e)>=0&&await function(t,e){const n=t.Jr._t(e);return n.targetChanges.forEach(((n,s)=>{if(n.resumeToken.approximateByteSize()>0){const r=t.Qr.get(s);r&&t.Qr.set(s,r.withResumeToken(n.resumeToken,e))}})),n.targetMismatches.forEach((e=>{const n=t.Qr.get(e);if(!n)return;t.Qr.set(e,n.withResumeToken(wr.EMPTY_BYTE_STRING,n.snapshotVersion)),nh(t,e);const s=new tc(n.target,e,1,n.sequenceNumber);eh(t,s)})),t.remoteSyncer.applyRemoteEvent(n)}(t,n)}catch(e){Vs("RemoteStore","Failed to raise snapshot:",e),await hh(t,e)}}async function hh(t,e,n){if(!Ga(e))throw e;t.Wr.add(1),await Ju(t),t.Hr.set("Offline"),n||(n=()=>au(t.localStore)),t.asyncQueue.enqueueRetryable((async()=>{Vs("RemoteStore","Retrying IndexedDB access"),await n(),t.Wr.delete(1),await Xu(t)}))}function lh(t,e){return e().catch((n=>hh(t,n,e)))}async function dh(t){const e=Gs(t),n=Ih(e);let s=e.jr.length>0?e.jr[e.jr.length-1].batchId:-1;for(;fh(e);)try{const t=await uu(e.localStore,s);if(null===t){0===e.jr.length&&n.wr();break}s=t.batchId,gh(e,t)}catch(t){await hh(e,t)}mh(e)&&ph(e)}function fh(t){return ih(t)&&t.jr.length<10}function gh(t,e){t.jr.push(e);const n=Ih(t);n.hr()&&n.Vr&&n.Sr(e.mutations)}function mh(t){return ih(t)&&!Ih(t).ur()&&t.jr.length>0}function ph(t){Ih(t).start()}async function yh(t){Ih(t).Nr()}async function wh(t){const e=Ih(t);for(const n of t.jr)e.Sr(n.mutations)}async function vh(t,e,n){const s=t.jr.shift(),r=Za.from(s,e,n);await lh(t,(()=>t.remoteSyncer.applySuccessfulWrite(r))),await dh(t)}async function bh(t,e){e&&Ih(t).Vr&&await async function(t,e){if(lo(n=e.code)&&n!==zs.ABORTED){const n=t.jr.shift();Ih(t).dr(),await lh(t,(()=>t.remoteSyncer.rejectFailedWrite(n.batchId,e))),await dh(t)}var n}(t,e),mh(t)&&ph(t)}async function Th(t,e){const n=Gs(t);e?(n.Wr.delete(2),await Xu(n)):e||(n.Wr.add(2),await Ju(n),n.Hr.set("Unknown"))}function Eh(t){return t.Yr||(t.Yr=function(t,e,n){const s=Gs(t);return s.$r(),new zu(e,s.sr,s.credentials,s.N,n)}(t.datastore,t.asyncQueue,{Si:ah.bind(null,t),Ci:ch.bind(null,t),Rr:uh.bind(null,t)}),t.Gr.push((async e=>{e?(t.Yr.dr(),rh(t)?sh(t):t.Hr.set("Unknown")):(await t.Yr.stop(),oh(t))}))),t.Yr}function Ih(t){return t.Xr||(t.Xr=function(t,e,n){const s=Gs(t);return s.$r(),new Hu(e,s.sr,s.credentials,s.N,n)}(t.datastore,t.asyncQueue,{Si:yh.bind(null,t),Ci:bh.bind(null,t),Cr:wh.bind(null,t),Dr:vh.bind(null,t)}),t.Gr.push((async e=>{e?(t.Xr.dr(),await dh(t)):(await t.Xr.stop(),t.jr.length>0&&(Vs("RemoteStore",`Stopping write stream with ${t.jr.length} pending writes`),t.jr=[]))}))),t.Xr +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class Sh{constructor(t,e,n,s,r){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=s,this.removalCallback=r,this.deferred=new Qs,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((t=>{}))}static createAndSchedule(t,e,n,s,r){const i=Date.now()+n,o=new Sh(t,e,i,s,r);return o.start(n),o}start(t){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new Hs(zs.CANCELLED,"Operation cancelled"+(t?": "+t:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then((t=>this.deferred.resolve(t)))):Promise.resolve()))}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function _h(t,e){if(Us("AsyncQueue",`${e}: ${t}`),Ga(t))return new Hs(zs.UNAVAILABLE,`${e}: ${t}`);throw t} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Nh{constructor(t){this.comparator=t?(e,n)=>t(e,n)||xr.comparator(e.key,n.key):(t,e)=>xr.comparator(t.key,e.key),this.keyedMap=Eo(),this.sortedSet=new go(this.comparator)}static emptySet(t){return new Nh(t.comparator)}has(t){return null!=this.keyedMap.get(t)}get(t){return this.keyedMap.get(t)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(t){const e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1}get size(){return this.sortedSet.size}forEach(t){this.sortedSet.inorderTraversal(((e,n)=>(t(e),!1)))}add(t){const e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))}delete(t){const e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this}isEqual(t){if(!(t instanceof Nh))return!1;if(this.size!==t.size)return!1;const e=this.sortedSet.getIterator(),n=t.sortedSet.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(!t.isEqual(s))return!1}return!0}toString(){const t=[];return this.forEach((e=>{t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"}copy(t,e){const n=new Nh;return n.comparator=this.comparator,n.keyedMap=t,n.sortedSet=e,n}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ah{constructor(){this.Zr=new go(xr.comparator)}track(t){const e=t.doc.key,n=this.Zr.get(e);n?0!==t.type&&3===n.type?this.Zr=this.Zr.insert(e,t):3===t.type&&1!==n.type?this.Zr=this.Zr.insert(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.Zr=this.Zr.insert(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.Zr=this.Zr.insert(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.Zr=this.Zr.remove(e):1===t.type&&2===n.type?this.Zr=this.Zr.insert(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.Zr=this.Zr.insert(e,{type:2,doc:t.doc}):js():this.Zr=this.Zr.insert(e,t)}eo(){const t=[];return this.Zr.inorderTraversal(((e,n)=>{t.push(n)})),t}}class Dh{constructor(t,e,n,s,r,i,o,a){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=s,this.mutatedKeys=r,this.fromCache=i,this.syncStateChanged=o,this.excludesMetadataChanges=a}static fromInitialDocuments(t,e,n,s){const r=[];return e.forEach((t=>{r.push({type:0,doc:t})})),new Dh(t,e,Nh.emptySet(e),r,n,s,!0,!1)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&Si(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;const e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(let t=0;t_i(t)),Si),this.onlineState="Unknown",this.so=new Set}}async function kh(t,e){const n=Gs(t),s=e.query;let r=!1,i=n.queries.get(s);if(i||(r=!0,i=new xh),r)try{i.no=await n.onListen(s)}catch(t){const n=_h(t,`Initialization of query '${Ni(e.query)}' failed`);return void e.onError(n)}n.queries.set(s,i),i.listeners.push(e),e.io(n.onlineState),i.no&&e.ro(i.no)&&Mh(n)}async function Rh(t,e){const n=Gs(t),s=e.query;let r=!1;const i=n.queries.get(s);if(i){const t=i.listeners.indexOf(e);t>=0&&(i.listeners.splice(t,1),r=0===i.listeners.length)}if(r)return n.queries.delete(s),n.onUnlisten(s)}function Lh(t,e){const n=Gs(t);let s=!1;for(const t of e){const e=t.query,r=n.queries.get(e);if(r){for(const e of r.listeners)e.ro(t)&&(s=!0);r.no=t}}s&&Mh(n)}function Oh(t,e,n){const s=Gs(t),r=s.queries.get(e);if(r)for(const t of r.listeners)t.onError(n);s.queries.delete(e)}function Mh(t){t.so.forEach((t=>{t.next()}))}class Fh{constructor(t,e,n){this.query=t,this.oo=e,this.co=!1,this.ao=null,this.onlineState="Unknown",this.options=n||{}}ro(t){if(!this.options.includeMetadataChanges){const e=[];for(const n of t.docChanges)3!==n.type&&e.push(n);t=new Dh(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}let e=!1;return this.co?this.uo(t)&&(this.oo.next(t),e=!0):this.ho(t,this.onlineState)&&(this.lo(t),e=!0),this.ao=t,e}onError(t){this.oo.error(t)}io(t){this.onlineState=t;let e=!1;return this.ao&&!this.co&&this.ho(this.ao,t)&&(this.lo(this.ao),e=!0),e}ho(t,e){if(!t.fromCache)return!0;const n="Offline"!==e;return!(this.options.fo&&n||t.docs.isEmpty()&&"Offline"!==e)}uo(t){if(t.docChanges.length>0)return!0;const e=this.ao&&this.ao.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!e)&&!0===this.options.includeMetadataChanges}lo(t){t=Dh.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.co=!0,this.oo.next(t)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ph{constructor(t,e){this.payload=t,this.byteLength=e}wo(){return"metadata"in this.payload}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Vh{constructor(t){this.N=t}zn(t){return Qo(this.N,t)}Hn(t){return t.metadata.exists?ta(this.N,t.document,!1):zr.newNoDocument(this.zn(t.metadata.name),this.Jn(t.metadata.readTime))}Jn(t){return $o(t)}}class Uh{constructor(t,e,n){this._o=t,this.localStore=e,this.N=n,this.queries=[],this.documents=[],this.progress=qh(t)}mo(t){this.progress.bytesLoaded+=t.byteLength;let e=this.progress.documentsLoaded;return t.payload.namedQuery?this.queries.push(t.payload.namedQuery):t.payload.documentMetadata?(this.documents.push({metadata:t.payload.documentMetadata}),t.payload.documentMetadata.exists||++e):t.payload.document&&(this.documents[this.documents.length-1].document=t.payload.document,++e),e!==this.progress.documentsLoaded?(this.progress.documentsLoaded=e,Object.assign({},this.progress)):null}yo(t){const e=new Map,n=new Vh(this.N);for(const s of t)if(s.metadata.queries){const t=n.zn(s.metadata.name);for(const n of s.metadata.queries){const s=(e.get(n)||No()).add(t);e.set(n,s)}}return e}async complete(){const t=await async function(t,e,n,s){const r=Gs(t);let i=No(),o=bo(),a=So();for(const t of n){const n=e.zn(t.metadata.name);t.document&&(i=i.add(n)),o=o.insert(n,e.Hn(t)),a=a.insert(n,e.Jn(t.metadata.readTime))}const c=r.jn.newChangeBuffer({trackRemovals:!0}),u=await hu(r,function(t){return Ei(mi(fr.fromString(`__bundle__/docs/${t}`)))}(s));return r.persistence.runTransaction("Apply bundle documents","readwrite",(t=>cu(t,c,o,cr.min(),a).next((e=>(c.apply(t),e))).next((e=>r.ze.removeMatchingKeysForTargetId(t,u.targetId).next((()=>r.ze.addMatchingKeys(t,i,u.targetId))).next((()=>r.Qn.vn(t,e))).next((()=>e))))))}(this.localStore,new Vh(this.N),this.documents,this._o.id),e=this.yo(this.documents);for(const t of this.queries)await mu(this.localStore,t,e.get(t.name));return this.progress.taskState="Success",new tu(Object.assign({},this.progress),t)}}function qh(t){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Bh{constructor(t){this.key=t}}class jh{constructor(t){this.key=t}}class Kh{constructor(t,e){this.query=t,this.po=e,this.To=null,this.current=!1,this.Eo=No(),this.mutatedKeys=No(),this.Io=Di(t),this.Ao=new Nh(this.Io)}get Ro(){return this.po}bo(t,e){const n=e?e.Po:new Ah,s=e?e.Ao:this.Ao;let r=e?e.mutatedKeys:this.mutatedKeys,i=s,o=!1;const a=pi(this.query)&&s.size===this.query.limit?s.last():null,c=yi(this.query)&&s.size===this.query.limit?s.first():null;if(t.inorderTraversal(((t,e)=>{const u=s.get(t),h=Ai(this.query,e)?e:null,l=!!u&&this.mutatedKeys.has(u.key),d=!!h&&(h.hasLocalMutations||this.mutatedKeys.has(h.key)&&h.hasCommittedMutations);let f=!1;u&&h?u.data.isEqual(h.data)?l!==d&&(n.track({type:3,doc:h}),f=!0):this.vo(u,h)||(n.track({type:2,doc:h}),f=!0,(a&&this.Io(h,a)>0||c&&this.Io(h,c)<0)&&(o=!0)):!u&&h?(n.track({type:0,doc:h}),f=!0):u&&!h&&(n.track({type:1,doc:u}),f=!0,(a||c)&&(o=!0)),f&&(h?(i=i.add(h),r=d?r.add(t):r.delete(t)):(i=i.delete(t),r=r.delete(t)))})),pi(this.query)||yi(this.query))for(;i.size>this.query.limit;){const t=pi(this.query)?i.last():i.first();i=i.delete(t.key),r=r.delete(t.key),n.track({type:1,doc:t})}return{Ao:i,Po:n,Ln:o,mutatedKeys:r}}vo(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations}applyChanges(t,e,n){const s=this.Ao;this.Ao=t.Ao,this.mutatedKeys=t.mutatedKeys;const r=t.Po.eo();r.sort(((t,e)=>function(t,e){const n=t=>{switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return js()}};return n(t)-n(e)}(t.type,e.type)||this.Io(t.doc,e.doc))),this.Vo(n);const i=e?this.So():[],o=0===this.Eo.size&&this.current?1:0,a=o!==this.To;return this.To=o,0!==r.length||a?{snapshot:new Dh(this.query,t.Ao,s,r,t.mutatedKeys,0===o,a,!1),Do:i}:{Do:i}}io(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({Ao:this.Ao,Po:new Ah,mutatedKeys:this.mutatedKeys,Ln:!1},!1)):{Do:[]}}Co(t){return!this.po.has(t)&&!!this.Ao.has(t)&&!this.Ao.get(t).hasLocalMutations}Vo(t){t&&(t.addedDocuments.forEach((t=>this.po=this.po.add(t))),t.modifiedDocuments.forEach((t=>{})),t.removedDocuments.forEach((t=>this.po=this.po.delete(t))),this.current=t.current)}So(){if(!this.current)return[];const t=this.Eo;this.Eo=No(),this.Ao.forEach((t=>{this.Co(t.key)&&(this.Eo=this.Eo.add(t.key))}));const e=[];return t.forEach((t=>{this.Eo.has(t)||e.push(new jh(t))})),this.Eo.forEach((n=>{t.has(n)||e.push(new Bh(n))})),e}No(t){this.po=t.Gn,this.Eo=No();const e=this.bo(t.documents);return this.applyChanges(e,!0)}xo(){return Dh.fromInitialDocuments(this.query,this.Ao,this.mutatedKeys,0===this.To)}}class $h{constructor(t,e,n){this.query=t,this.targetId=e,this.view=n}}class Gh{constructor(t){this.key=t,this.ko=!1}}class zh{constructor(t,e,n,s,r,i){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=s,this.currentUser=r,this.maxConcurrentLimboResolutions=i,this.$o={},this.Oo=new qc((t=>_i(t)),Si),this.Fo=new Map,this.Mo=new Set,this.Lo=new go(xr.comparator),this.Bo=new Map,this.Uo=new yu,this.qo={},this.Ko=new Map,this.jo=Dc.ie(),this.onlineState="Unknown",this.Qo=void 0}get isPrimaryClient(){return!0===this.Qo}}async function Hh(t,e){const n=vl(t);let s,r;const i=n.Oo.get(e);if(i)s=i.targetId,n.sharedClientState.addLocalQueryTarget(s),r=i.view.xo();else{const t=await hu(n.localStore,Ei(e)),i=n.sharedClientState.addLocalQueryTarget(t.targetId);s=t.targetId,r=await Qh(n,e,s,"current"===i),n.isPrimaryClient&&Zu(n.remoteStore,t)}return r}async function Qh(t,e,n,s){t.Wo=(e,n,s)=>async function(t,e,n,s){let r=e.view.bo(n);r.Ln&&(r=await du(t.localStore,e.query,!1).then((({documents:t})=>e.view.bo(t,r))));const i=s&&s.targetChanges.get(e.targetId),o=e.view.applyChanges(r,t.isPrimaryClient,i);return il(t,e.targetId,o.Do),o.snapshot}(t,e,n,s);const r=await du(t.localStore,e,!0),i=new Kh(e,r.Gn),o=i.bo(r.documents),a=Co.createSynthesizedTargetChangeForCurrentChange(n,s&&"Offline"!==t.onlineState),c=i.applyChanges(o,t.isPrimaryClient,a);il(t,n,c.Do);const u=new $h(e,n,i);return t.Oo.set(e,u),t.Fo.has(n)?t.Fo.get(n).push(e):t.Fo.set(n,[e]),c.snapshot}async function Wh(t,e){const n=Gs(t),s=n.Oo.get(e),r=n.Fo.get(s.targetId);if(r.length>1)return n.Fo.set(s.targetId,r.filter((t=>!Si(t,e)))),void n.Oo.delete(e);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(s.targetId),n.sharedClientState.isActiveQueryTarget(s.targetId)||await lu(n.localStore,s.targetId,!1).then((()=>{n.sharedClientState.clearQueryState(s.targetId),th(n.remoteStore,s.targetId),sl(n,s.targetId)})).catch(Lc)):(sl(n,s.targetId),await lu(n.localStore,s.targetId,!0))}async function Yh(t,e){const n=Gs(t);try{const t=await function(t,e){const n=Gs(t),s=e.snapshotVersion;let r=n.Un;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(t=>{const i=n.jn.newChangeBuffer({trackRemovals:!0});r=n.Un;const o=[];e.targetChanges.forEach(((e,i)=>{const a=r.get(i);if(!a)return;o.push(n.ze.removeMatchingKeys(t,e.removedDocuments,i).next((()=>n.ze.addMatchingKeys(t,e.addedDocuments,i))));const c=e.resumeToken;if(c.approximateByteSize()>0){const u=a.withResumeToken(c,s).withSequenceNumber(t.currentSequenceNumber);r=r.insert(i,u),function(t,e,n){return Ks(e.resumeToken.approximateByteSize()>0),0===t.resumeToken.approximateByteSize()||e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(a,u,e)&&o.push(n.ze.updateTargetData(t,u))}}));let a=bo();if(e.documentUpdates.forEach(((s,r)=>{e.resolvedLimboDocuments.has(s)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(t,s))})),o.push(cu(t,i,e.documentUpdates,s,void 0).next((t=>{a=t}))),!s.isEqual(cr.min())){const e=n.ze.getLastRemoteSnapshotVersion(t).next((e=>n.ze.setTargetsMetadata(t,t.currentSequenceNumber,s)));o.push(e)}return qa.waitFor(o).next((()=>i.apply(t))).next((()=>n.Qn.vn(t,a))).next((()=>a))})).then((t=>(n.Un=r,t)))}(n.localStore,e);e.targetChanges.forEach(((t,e)=>{const s=n.Bo.get(e);s&&(Ks(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1),t.addedDocuments.size>0?s.ko=!0:t.modifiedDocuments.size>0?Ks(s.ko):t.removedDocuments.size>0&&(Ks(s.ko),s.ko=!1))})),await cl(n,t,e)}catch(t){await Lc(t)}}function Xh(t,e,n){const s=Gs(t);if(s.isPrimaryClient&&0===n||!s.isPrimaryClient&&1===n){const t=[];s.Oo.forEach(((n,s)=>{const r=s.view.io(e);r.snapshot&&t.push(r.snapshot)})),function(t,e){const n=Gs(t);n.onlineState=e;let s=!1;n.queries.forEach(((t,n)=>{for(const t of n.listeners)t.io(e)&&(s=!0)})),s&&Mh(n)}(s.eventManager,e),t.length&&s.$o.Rr(t),s.onlineState=e,s.isPrimaryClient&&s.sharedClientState.setOnlineState(e)}}async function Jh(t,e,n){const s=Gs(t);s.sharedClientState.updateQueryState(e,"rejected",n);const r=s.Bo.get(e),i=r&&r.key;if(i){let t=new go(xr.comparator);t=t.insert(i,zr.newNoDocument(i,cr.min()));const n=No().add(i),r=new xo(cr.min(),new Map,new yo(rr),t,n);await Yh(s,r),s.Lo=s.Lo.remove(i),s.Bo.delete(e),al(s)}else await lu(s.localStore,e,!1).then((()=>sl(s,e,n))).catch(Lc)}async function Zh(t,e){const n=Gs(t),s=e.batch.batchId;try{const t=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(t=>{const s=e.batch.keys(),r=n.jn.newChangeBuffer({trackRemovals:!0});return function(t,e,n,s){const r=n.batch,i=r.keys();let o=qa.resolve();return i.forEach((t=>{o=o.next((()=>s.getEntry(e,t))).next((e=>{const i=n.docVersions.get(t);Ks(null!==i),e.version.compareTo(i)<0&&(r.applyToRemoteDocument(e,n),e.isValidDocument()&&s.addEntry(e,n.commitVersion))}))})),o.next((()=>t.In.removeMutationBatch(e,r)))}(n,t,e,r).next((()=>r.apply(t))).next((()=>n.In.performConsistencyCheck(t))).next((()=>n.Qn.Pn(t,s)))}))}(n.localStore,e);nl(n,s,null),el(n,s),n.sharedClientState.updateMutationState(s,"acknowledged"),await cl(n,t)}catch(t){await Lc(t)}}async function tl(t,e,n){const s=Gs(t);try{const t=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(t=>{let s;return n.In.lookupMutationBatch(t,e).next((e=>(Ks(null!==e),s=e.keys(),n.In.removeMutationBatch(t,e)))).next((()=>n.In.performConsistencyCheck(t))).next((()=>n.Qn.Pn(t,s)))}))}(s.localStore,e);nl(s,e,n),el(s,e),s.sharedClientState.updateMutationState(e,"rejected",n),await cl(s,t)}catch(t){await Lc(t)}}function el(t,e){(t.Ko.get(e)||[]).forEach((t=>{t.resolve()})),t.Ko.delete(e)}function nl(t,e,n){const s=Gs(t);let r=s.qo[s.currentUser.toKey()];if(r){const t=r.get(e);t&&(n?t.reject(n):t.resolve(),r=r.remove(e)),s.qo[s.currentUser.toKey()]=r}}function sl(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const s of t.Fo.get(e))t.Oo.delete(s),n&&t.$o.Go(s,n);t.Fo.delete(e),t.isPrimaryClient&&t.Uo.cs(e).forEach((e=>{t.Uo.containsKey(e)||rl(t,e)}))}function rl(t,e){t.Mo.delete(e.path.canonicalString());const n=t.Lo.get(e);null!==n&&(th(t.remoteStore,n),t.Lo=t.Lo.remove(e),t.Bo.delete(n),al(t))}function il(t,e,n){for(const s of n)s instanceof Bh?(t.Uo.addReference(s.key,e),ol(t,s)):s instanceof jh?(Vs("SyncEngine","Document no longer in limbo: "+s.key),t.Uo.removeReference(s.key,e),t.Uo.containsKey(s.key)||rl(t,s.key)):js()}function ol(t,e){const n=e.key,s=n.path.canonicalString();t.Lo.get(n)||t.Mo.has(s)||(Vs("SyncEngine","New document in limbo: "+n),t.Mo.add(s),al(t))}function al(t){for(;t.Mo.size>0&&t.Lo.size{o.push(s.Wo(a,e,n).then((t=>{if(t){s.isPrimaryClient&&s.sharedClientState.updateQueryState(a.targetId,t.fromCache?"not-current":"current"),r.push(t);const e=nu.kn(a.targetId,t);i.push(e)}})))})),await Promise.all(o),s.$o.Rr(r),await async function(t,e){const n=Gs(t);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(t=>qa.forEach(e,(e=>qa.forEach(e.Nn,(s=>n.persistence.referenceDelegate.addReference(t,e.targetId,s))).next((()=>qa.forEach(e.xn,(s=>n.persistence.referenceDelegate.removeReference(t,e.targetId,s)))))))))}catch(t){if(!Ga(t))throw t;Vs("LocalStore","Failed to update sequence numbers: "+t)}for(const t of e){const e=t.targetId;if(!t.fromCache){const t=n.Un.get(e),s=t.snapshotVersion,r=t.withLastLimboFreeSnapshotVersion(s);n.Un=n.Un.insert(e,r)}}}(s.localStore,i))}async function ul(t,e){const n=Gs(t);if(!n.currentUser.isEqual(e)){Vs("SyncEngine","User change. New user:",e.toKey());const t=await ou(n.localStore,e);n.currentUser=e,function(t,e){t.Ko.forEach((t=>{t.forEach((t=>{t.reject(new Hs(zs.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.Ko.clear()}(n),n.sharedClientState.handleUserChange(e,t.removedBatchIds,t.addedBatchIds),await cl(n,t.Wn)}}function hl(t,e){const n=Gs(t),s=n.Bo.get(e);if(s&&s.ko)return No().add(s.key);{let t=No();const s=n.Fo.get(e);if(!s)return t;for(const e of s){const s=n.Oo.get(e);t=t.unionWith(s.view.Ro)}return t}}async function ll(t,e){const n=Gs(t),s=await du(n.localStore,e.query,!0),r=e.view.No(s);return n.isPrimaryClient&&il(n,e.targetId,r.Do),r}async function dl(t){const e=Gs(t);return gu(e.localStore).then((t=>cl(e,t)))}async function fl(t,e,n,s){const r=Gs(t),i=await function(t,e){const n=Gs(t),s=Gs(n.In);return n.persistence.runTransaction("Lookup mutation documents","readonly",(t=>s.Xt(t,e).next((e=>e?n.Qn.Pn(t,e):qa.resolve(null)))))}(r.localStore,e);null!==i?("pending"===n?await dh(r.remoteStore):"acknowledged"===n||"rejected"===n?(nl(r,e,s||null),el(r,e),function(t,e){Gs(Gs(t).In).te(e)}(r.localStore,e)):js(),await cl(r,i)):Vs("SyncEngine","Cannot apply mutation batch with id: "+e)}async function gl(t,e,n){const s=Gs(t),r=[],i=[];for(const t of e){let e;const n=s.Fo.get(t);if(n&&0!==n.length){e=await hu(s.localStore,Ei(n[0]));for(const t of n){const e=s.Oo.get(t),n=await ll(s,e);n.snapshot&&i.push(n.snapshot)}}else{const n=await fu(s.localStore,t);e=await hu(s.localStore,n),await Qh(s,ml(n),t,!1)}r.push(e)}return s.$o.Rr(i),r}function ml(t){return gi(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function pl(t){const e=Gs(t);return Gs(Gs(e.localStore).persistence).pn()}async function yl(t,e,n,s){const r=Gs(t);if(r.Qo)Vs("SyncEngine","Ignoring unexpected query state notification.");else if(r.Fo.has(e))switch(n){case"current":case"not-current":{const t=await gu(r.localStore),s=xo.createSynthesizedRemoteEventForCurrentChange(e,"current"===n);await cl(r,t,s);break}case"rejected":await lu(r.localStore,e,!0),sl(r,e,s);break;default:js()}}async function wl(t,e,n){const s=vl(t);if(s.Qo){for(const t of e){if(s.Fo.has(t)){Vs("SyncEngine","Adding an already active target "+t);continue}const e=await fu(s.localStore,t),n=await hu(s.localStore,e);await Qh(s,ml(e),n.targetId,!1),Zu(s.remoteStore,n)}for(const t of n)s.Fo.has(t)&&await lu(s.localStore,t,!1).then((()=>{th(s.remoteStore,t),sl(s,t)})).catch(Lc)}}function vl(t){const e=Gs(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=Yh.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=hl.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=Jh.bind(null,e),e.$o.Rr=Lh.bind(null,e.eventManager),e.$o.Go=Oh.bind(null,e.eventManager),e}function bl(t){const e=Gs(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=Zh.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=tl.bind(null,e),e}class Tl{constructor(){this.synchronizeTabs=!1}async initialize(t){this.N=Ku(t.databaseInfo.databaseId),this.sharedClientState=this.Ho(t),this.persistence=this.Jo(t),await this.persistence.start(),this.gcScheduler=this.Yo(t),this.localStore=this.Xo(t)}Yo(t){return null}Xo(t){return iu(this.persistence,new su,t.initialUser,this.N)}Jo(t){return new Iu(_u.Ns,this.N)}Ho(t){return new Mu}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class El extends Tl{constructor(t,e,n){super(),this.Zo=t,this.cacheSizeBytes=e,this.forceOwnership=n,this.synchronizeTabs=!1}async initialize(t){await super.initialize(t),await async function(t){const e=Gs(t);return e.persistence.runTransaction("Synchronize last document change read time","readonly",(t=>function(t){const e=Gc(t);let n=cr.min();return e.Kt({index:Da.readTimeIndex,reverse:!0},((t,e,s)=>{e.readTime&&(n=ic(e.readTime)),s.done()})).next((()=>n))}(t))).then((t=>{e.Kn=t}))}(this.localStore),await this.Zo.initialize(this,t),await bl(this.Zo.syncEngine),await dh(this.Zo.remoteStore),await this.persistence.nn((()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(this.localStore),Promise.resolve())))}Xo(t){return iu(this.persistence,new su,t.initialUser,this.N)}Yo(t){const e=this.persistence.referenceDelegate.garbageCollector;return new Fc(e,t.asyncQueue)}Jo(t){const e=Zc(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?bc.withCacheSize(this.cacheSizeBytes):bc.DEFAULT;return new Yc(this.synchronizeTabs,e,t.clientId,n,t.asyncQueue,Bu(),ju(),this.N,this.sharedClientState,!!this.forceOwnership)}Ho(t){return new Mu}}class Il extends El{constructor(t,e){super(t,e,!1),this.Zo=t,this.cacheSizeBytes=e,this.synchronizeTabs=!0}async initialize(t){await super.initialize(t);const e=this.Zo.syncEngine;this.sharedClientState instanceof Ou&&(this.sharedClientState.syncEngine={_i:fl.bind(null,e),mi:yl.bind(null,e),gi:wl.bind(null,e),pn:pl.bind(null,e),wi:dl.bind(null,e)},await this.sharedClientState.start()),await this.persistence.nn((async t=>{await async function(t,e){const n=Gs(t);if(vl(n),bl(n),!0===e&&!0!==n.Qo){const t=n.sharedClientState.getAllActiveQueryTargets(),e=await gl(n,t.toArray());n.Qo=!0,await Th(n.remoteStore,!0);for(const t of e)Zu(n.remoteStore,t)}else if(!1===e&&!1!==n.Qo){const t=[];let e=Promise.resolve();n.Fo.forEach(((s,r)=>{n.sharedClientState.isLocalQueryTarget(r)?t.push(r):e=e.then((()=>(sl(n,r),lu(n.localStore,r,!0)))),th(n.remoteStore,r)})),await e,await gl(n,t),function(t){const e=Gs(t);e.Bo.forEach(((t,n)=>{th(e.remoteStore,n)})),e.Uo.us(),e.Bo=new Map,e.Lo=new go(xr.comparator)}(n),n.Qo=!1,await Th(n.remoteStore,!1)}}(this.Zo.syncEngine,t),this.gcScheduler&&(t&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):t||this.gcScheduler.stop())}))}Ho(t){const e=Bu();if(!Ou.bt(e))throw new Hs(zs.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const n=Zc(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey);return new Ou(e,t.asyncQueue,n,t.clientId,t.initialUser)}}class Sl{async initialize(t,e){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(e),this.remoteStore=this.createRemoteStore(e),this.eventManager=this.createEventManager(e),this.syncEngine=this.createSyncEngine(e,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=t=>Xh(this.syncEngine,t,1),this.remoteStore.remoteSyncer.handleCredentialChange=ul.bind(null,this.syncEngine),await Th(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return new Ch}createDatastore(t){const e=Ku(t.databaseInfo.databaseId),n=(s=t.databaseInfo,new qu(s));var s;return function(t,e,n){return new Qu(t,e,n)}(t.credentials,n,e)}createRemoteStore(t){var e,n,s,r,i;return e=this.localStore,n=this.datastore,s=t.asyncQueue,r=t=>Xh(this.syncEngine,t,0),i=Pu.bt()?new Pu:new Fu,new Yu(e,n,s,r,i)}createSyncEngine(t,e){return function(t,e,n,s,r,i,o){const a=new zh(t,e,n,s,r,i);return o&&(a.Qo=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)}terminate(){return async function(t){const e=Gs(t);Vs("RemoteStore","RemoteStore shutting down."),e.Wr.add(5),await Ju(e),e.zr.shutdown(),e.Hr.set("Unknown")}(this.remoteStore)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function _l(t,e=10240){let n=0;return{async read(){if(n{this.muted||t(e)}),0)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Al{constructor(t,e){this.nc=t,this.N=e,this.metadata=new Qs,this.buffer=new Uint8Array,this.sc=new TextDecoder("utf-8"),this.ic().then((t=>{t&&t.wo()?this.metadata.resolve(t.payload.metadata):this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\n ${JSON.stringify(null==t?void 0:t.payload)}`))}),(t=>this.metadata.reject(t)))}close(){return this.nc.cancel()}async getMetadata(){return this.metadata.promise}async zo(){return await this.getMetadata(),this.ic()}async ic(){const t=await this.rc();if(null===t)return null;const e=this.sc.decode(t),n=Number(e);isNaN(n)&&this.oc(`length string (${e}) is not valid number`);const s=await this.cc(n);return new Ph(JSON.parse(s),t.length+n)}ac(){return this.buffer.findIndex((t=>t==="{".charCodeAt(0)))}async rc(){for(;this.ac()<0&&!await this.uc(););if(0===this.buffer.length)return null;const t=this.ac();t<0&&this.oc("Reached the end of bundle when a length string is expected.");const e=this.buffer.slice(0,t);return this.buffer=this.buffer.slice(t),e}async cc(t){for(;this.buffer.length0)throw new Hs(zs.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");const e=await async function(t,e){const n=Gs(t),s=Xo(n.N)+"/documents",r={documents:e.map((t=>Ho(n.N,t)))},i=await n.Ki("BatchGetDocuments",s,r),o=new Map;i.forEach((t=>{const e=function(t,e){return"found"in e?function(t,e){Ks(!!e.found),e.found.name,e.found.updateTime;const n=Qo(t,e.found.name),s=$o(e.found.updateTime),r=new $r({mapValue:{fields:e.found.fields}});return zr.newFoundDocument(n,s,r)}(t,e):"missing"in e?function(t,e){Ks(!!e.missing),Ks(!!e.readTime);const n=Qo(t,e.missing),s=$o(e.readTime);return zr.newNoDocument(n,s)}(t,e):js()}(n.N,t);o.set(e.key.toString(),e)}));const a=[];return e.forEach((t=>{const e=o.get(t.toString());Ks(!!e),a.push(e)})),a}(this.datastore,t);return e.forEach((t=>this.recordVersion(t))),e}set(t,e){this.write(e.toMutation(t,this.precondition(t))),this.writtenDocs.add(t.toString())}update(t,e){try{this.write(e.toMutation(t,this.preconditionForUpdate(t)))}catch(t){this.lastWriteError=t}this.writtenDocs.add(t.toString())}delete(t){this.write(new oo(t,this.precondition(t))),this.writtenDocs.add(t.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;const t=this.readVersions;this.mutations.forEach((e=>{t.delete(e.key.toString())})),t.forEach(((t,e)=>{const n=xr.fromPath(e);this.mutations.push(new ao(n,this.precondition(n)))})),await async function(t,e){const n=Gs(t),s=Xo(n.N)+"/documents",r={writes:e.map((t=>ea(n.N,t)))};await n.Li("Commit",s,r)}(this.datastore,this.mutations),this.committed=!0}recordVersion(t){let e;if(t.isFoundDocument())e=t.version;else{if(!t.isNoDocument())throw js();e=cr.min()}const n=this.readVersions.get(t.key.toString());if(n){if(!e.isEqual(n))throw new Hs(zs.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(t.key.toString(),e)}precondition(t){const e=this.readVersions.get(t.toString());return!this.writtenDocs.has(t.toString())&&e?Hi.updateTime(e):Hi.none()}preconditionForUpdate(t){const e=this.readVersions.get(t.toString());if(!this.writtenDocs.has(t.toString())&&e){if(e.isEqual(cr.min()))throw new Hs(zs.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return Hi.updateTime(e)}return Hi.exists(!0)}write(t){this.ensureCommitNotCalled(),this.mutations.push(t)}ensureCommitNotCalled(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xl{constructor(t,e,n,s){this.asyncQueue=t,this.datastore=e,this.updateFunction=n,this.deferred=s,this.hc=5,this.ar=new $u(this.asyncQueue,"transaction_retry")}run(){this.hc-=1,this.lc()}lc(){this.ar.Xi((async()=>{const t=new Dl(this.datastore),e=this.fc(t);e&&e.then((e=>{this.asyncQueue.enqueueAndForget((()=>t.commit().then((()=>{this.deferred.resolve(e)})).catch((t=>{this.dc(t)}))))})).catch((t=>{this.dc(t)}))}))}fc(t){try{const e=this.updateFunction(t);return!Nr(e)&&e.catch&&e.then?e:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.deferred.reject(t),null}}dc(t){this.hc>0&&this.wc(t)?(this.hc-=1,this.asyncQueue.enqueueAndForget((()=>(this.lc(),Promise.resolve())))):this.deferred.reject(t)}wc(t){if("FirebaseError"===t.name){const e=t.code;return"aborted"===e||"failed-precondition"===e||!lo(e)}return!1}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Cl{constructor(t,e,n){this.credentials=t,this.asyncQueue=e,this.databaseInfo=n,this.user=Ls.UNAUTHENTICATED,this.clientId=sr.I(),this.credentialListener=()=>Promise.resolve(),this.credentials.start(e,(async t=>{Vs("FirestoreClient","Received user=",t.uid),await this.credentialListener(t),this.user=t}))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.credentialListener=t}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new Hs(zs.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const t=new Qs;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this.onlineComponents&&await this.onlineComponents.terminate(),this.offlineComponents&&await this.offlineComponents.terminate(),this.credentials.shutdown(),t.resolve()}catch(e){const n=_h(e,"Failed to shutdown persistence");t.reject(n)}})),t.promise}}async function kl(t,e){t.asyncQueue.verifyOperationInProgress(),Vs("FirestoreClient","Initializing OfflineComponentProvider");const n=await t.getConfiguration();await e.initialize(n);let s=n.initialUser;t.setCredentialChangeListener((async t=>{s.isEqual(t)||(await ou(e.localStore,t),s=t)})),e.persistence.setDatabaseDeletedListener((()=>t.terminate())),t.offlineComponents=e}async function Rl(t,e){t.asyncQueue.verifyOperationInProgress();const n=await Ll(t);Vs("FirestoreClient","Initializing OnlineComponentProvider");const s=await t.getConfiguration();await e.initialize(n,s),t.setCredentialChangeListener((t=>async function(t,e){const n=Gs(t);n.asyncQueue.verifyOperationInProgress(),Vs("RemoteStore","RemoteStore received new credentials");const s=ih(n);n.Wr.add(3),await Ju(n),s&&n.Hr.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Wr.delete(3),await Xu(n)}(e.remoteStore,t))),t.onlineComponents=e}async function Ll(t){return t.offlineComponents||(Vs("FirestoreClient","Using default OfflineComponentProvider"),await kl(t,new Tl)),t.offlineComponents}async function Ol(t){return t.onlineComponents||(Vs("FirestoreClient","Using default OnlineComponentProvider"),await Rl(t,new Sl)),t.onlineComponents}function Ml(t){return Ll(t).then((t=>t.persistence))}function Fl(t){return Ll(t).then((t=>t.localStore))}function Pl(t){return Ol(t).then((t=>t.remoteStore))}function Vl(t){return Ol(t).then((t=>t.syncEngine))}async function Ul(t){const e=await Ol(t),n=e.eventManager;return n.onListen=Hh.bind(null,e.syncEngine),n.onUnlisten=Wh.bind(null,e.syncEngine),n}function ql(t,e,n={}){const s=new Qs;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,s,r){const i=new Nl({next:i=>{e.enqueueAndForget((()=>Rh(t,o)));const a=i.docs.has(n);!a&&i.fromCache?r.reject(new Hs(zs.UNAVAILABLE,"Failed to get document because the client is offline.")):a&&i.fromCache&&s&&"server"===s.source?r.reject(new Hs(zs.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):r.resolve(i)},error:t=>r.reject(t)}),o=new Fh(mi(n.path),i,{includeMetadataChanges:!0,fo:!0});return kh(t,o)}(await Ul(t),t.asyncQueue,e,n,s))),s.promise}function Bl(t,e,n={}){const s=new Qs;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,s,r){const i=new Nl({next:n=>{e.enqueueAndForget((()=>Rh(t,o))),n.fromCache&&"server"===s.source?r.reject(new Hs(zs.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):r.resolve(n)},error:t=>r.reject(t)}),o=new Fh(n,i,{includeMetadataChanges:!0,fo:!0});return kh(t,o)}(await Ul(t),t.asyncQueue,e,n,s))),s.promise}function jl(t,e,n,s){const r=function(t,e){let n;return n="string"==typeof t?(new TextEncoder).encode(t):t,function(t,e){return new Al(t,e)}(function(t,e){if(t instanceof Uint8Array)return _l(t,e);if(t instanceof ArrayBuffer)return _l(new Uint8Array(t),e);if(t instanceof ReadableStream)return t.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}(n),e)}(n,Ku(e));t.asyncQueue.enqueueAndForget((async()=>{!function(t,e,n){const s=Gs(t);(async function(t,e,n){try{const s=await e.getMetadata();if(await function(t,e){const n=Gs(t),s=$o(e.createTime);return n.persistence.runTransaction("hasNewerBundle","readonly",(t=>n.Je.getBundleMetadata(t,e.id))).then((t=>!!t&&t.createTime.compareTo(s)>=0))}(t.localStore,s))return await e.close(),void n._completeWith(function(t){return{taskState:"Success",documentsLoaded:t.totalDocuments,bytesLoaded:t.totalBytes,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}}(s));n._updateProgress(qh(s));const r=new Uh(s,t.localStore,e.N);let i=await e.zo();for(;i;){const t=await r.mo(i);t&&n._updateProgress(t),i=await e.zo()}const o=await r.complete();await cl(t,o.En,void 0),await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Save bundle","readwrite",(t=>n.Je.saveBundleMetadata(t,e)))}(t.localStore,s),n._completeWith(o.progress)}catch(t){qs("SyncEngine",`Loading bundle failed with ${t}`),n._failWith(t)}})(s,e,n).then((()=>{s.sharedClientState.notifyBundleLoaded()}))}(await Vl(t),r,s)}))}class Kl{constructor(t,e,n,s,r,i,o,a){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=s,this.ssl=r,this.forceLongPolling=i,this.autoDetectLongPolling=o,this.useFetchStreams=a}}class $l{constructor(t,e){this.projectId=t,this.database=e||"(default)"}get isDefaultDatabase(){return"(default)"===this.database}isEqual(t){return t instanceof $l&&t.projectId===this.projectId&&t.database===this.database}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Gl=new Map; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function zl(t,e,n){if(!n)throw new Hs(zs.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function Hl(t,e,n,s){if(!0===e&&!0===s)throw new Hs(zs.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function Ql(t){if(!xr.isDocumentKey(t))throw new Hs(zs.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function Wl(t){if(xr.isDocumentKey(t))throw new Hs(zs.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function Yl(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";{const e=function(t){return t.constructor?t.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return"function"==typeof t?"a function":js()}function Xl(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new Hs(zs.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Yl(t);throw new Hs(zs.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function Jl(t,e){if(e<=0)throw new Hs(zs.INVALID_ARGUMENT,`Function ${t}() requires a positive number, but it was: ${e}.`)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Zl{constructor(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new Hs(zs.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=null===(e=t.ssl)||void 0===e||e;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new Hs(zs.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.useFetchStreams=!!t.useFetchStreams,Hl("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class td{constructor(t,e){this._credentials=e,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Zl({}),this._settingsFrozen=!1,t instanceof $l?this._databaseId=t:(this._app=t,this._databaseId=function(t){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new Hs(zs.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new $l(t.options.projectId)}(t))}get app(){if(!this._app)throw new Hs(zs.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return void 0!==this._terminateTask}_setSettings(t){if(this._settingsFrozen)throw new Hs(zs.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Zl(t),void 0!==t.credentials&&(this._credentials=function(t){if(!t)return new Ys;switch(t.type){case"gapi":const e=t.client;return Ks(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new tr(e,t.sessionIndex||"0",t.iamToken||null);case"provider":return t.client;default:throw new Hs(zs.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const e=Gl.get(t);e&&(Vs("ComponentProvider","Removing Datastore"),Gl.delete(t),e.terminate())}(this),Promise.resolve()}}function ed(t,e,n,s={}){var r;const i=(t=Xl(t,td))._getSettings();if("firestore.googleapis.com"!==i.host&&i.host!==e&&qs("Host has been set in both settings() and useEmulator(), emulator host will be used"),t._setSettings(Object.assign(Object.assign({},i),{host:`${e}:${n}`,ssl:!1})),s.mockUserToken){let e,n;if("string"==typeof s.mockUserToken)e=s.mockUserToken,n=Ls.MOCK_USER;else{e= +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=e||"demo-project",s=t.iat||0,r=t.sub||t.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:s,exp:s+3600,auth_time:s,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}}},t);return[u(JSON.stringify({alg:"none",type:"JWT"})),u(JSON.stringify(i)),""].join(".")}(s.mockUserToken,null===(r=t._app)||void 0===r?void 0:r.options.projectId);const i=s.mockUserToken.sub||s.mockUserToken.user_id;if(!i)throw new Hs(zs.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Ls(i)}t._credentials=new Xs(new Ws(e,n))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class nd{constructor(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new rd(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new nd(this.firestore,t,this._key)}}class sd{constructor(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}withConverter(t){return new sd(this.firestore,t,this._query)}}class rd extends sd{constructor(t,e,n){super(t,e,mi(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new nd(this.firestore,null,new xr(t))}withConverter(t){return new rd(this.firestore,t,this._path)}}function id(t,e,...n){if(t=g(t),zl("collection","path",e),t instanceof td){const s=fr.fromString(e,...n);return Wl(s),new rd(t,null,s)}{if(!(t instanceof nd||t instanceof rd))throw new Hs(zs.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(fr.fromString(e,...n));return Wl(s),new rd(t.firestore,null,s)}}function od(t,e){if(t=Xl(t,td),zl("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new Hs(zs.INVALID_ARGUMENT,`Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new sd(t,null,function(t){return new fi(fr.emptyPath(),t)}(e))}function ad(t,e,...n){if(t=g(t),1===arguments.length&&(e=sr.I()),zl("doc","path",e),t instanceof td){const s=fr.fromString(e,...n);return Ql(s),new nd(t,null,new xr(s))}{if(!(t instanceof nd||t instanceof rd))throw new Hs(zs.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(fr.fromString(e,...n));return Ql(s),new nd(t.firestore,t instanceof rd?t.converter:null,new xr(s))}}function cd(t,e){return t=g(t),e=g(e),(t instanceof nd||t instanceof rd)&&(e instanceof nd||e instanceof rd)&&t.firestore===e.firestore&&t.path===e.path&&t.converter===e.converter}function ud(t,e){return t=g(t),e=g(e),t instanceof sd&&e instanceof sd&&t.firestore===e.firestore&&Si(t._query,e._query)&&t.converter===e.converter +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class hd{constructor(){this._c=Promise.resolve(),this.mc=[],this.gc=!1,this.yc=[],this.Tc=null,this.Ec=!1,this.Ic=!1,this.Ac=[],this.ar=new $u(this,"async_queue_retry"),this.Rc=()=>{const t=ju();t&&Vs("AsyncQueue","Visibility state changed to "+t.visibilityState),this.ar.tr()};const t=ju();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.Rc)}get isShuttingDown(){return this.gc}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.bc(),this.Pc(t)}enterRestrictedMode(t){if(!this.gc){this.gc=!0,this.Ic=t||!1;const e=ju();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Rc)}}enqueue(t){if(this.bc(),this.gc)return new Promise((()=>{}));const e=new Qs;return this.Pc((()=>this.gc&&this.Ic?Promise.resolve():(t().then(e.resolve,e.reject),e.promise))).then((()=>e.promise))}enqueueRetryable(t){this.enqueueAndForget((()=>(this.mc.push(t),this.vc())))}async vc(){if(0!==this.mc.length){try{await this.mc[0](),this.mc.shift(),this.ar.reset()}catch(t){if(!Ga(t))throw t;Vs("AsyncQueue","Operation failed with retryable error: "+t)}this.mc.length>0&&this.ar.Xi((()=>this.vc()))}}Pc(t){const e=this._c.then((()=>(this.Ec=!0,t().catch((t=>{this.Tc=t,this.Ec=!1;const e=function(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}(t);throw Us("INTERNAL UNHANDLED ERROR: ",e),t})).then((t=>(this.Ec=!1,t))))));return this._c=e,e}enqueueAfterDelay(t,e,n){this.bc(),this.Ac.indexOf(t)>-1&&(e=0);const s=Sh.createAndSchedule(this,t,e,n,(t=>this.Vc(t)));return this.yc.push(s),s}bc(){this.Tc&&js()}verifyOperationInProgress(){}async Sc(){let t;do{t=this._c,await t}while(t!==this._c)}Dc(t){for(const e of this.yc)if(e.timerId===t)return!0;return!1}Cc(t){return this.Sc().then((()=>{this.yc.sort(((t,e)=>t.targetTimeMs-e.targetTimeMs));for(const e of this.yc)if(e.skipDelay(),"all"!==t&&e.timerId===t)break;return this.Sc()}))}Nc(t){this.Ac.push(t)}Vc(t){const e=this.yc.indexOf(t);this.yc.splice(e,1)}}function ld(t){return function(t,e){if("object"!=typeof t||null===t)return!1;const n=t;for(const t of["next","error","complete"])if(t in n&&"function"==typeof n[t])return!0;return!1}(t)}class dd{constructor(){this._progressObserver={},this._taskCompletionResolver=new Qs,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}onProgress(t,e,n){this._progressObserver={next:t,error:e,complete:n}}catch(t){return this._taskCompletionResolver.promise.catch(t)}then(t,e){return this._taskCompletionResolver.promise.then(t,e)}_completeWith(t){this._updateProgress(t),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(t)}_failWith(t){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(t),this._taskCompletionResolver.reject(t)}_updateProgress(t){this._lastProgress=t,this._progressObserver.next&&this._progressObserver.next(t)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const fd=-1;class gd extends td{constructor(t,e){super(t,e),this.type="firestore",this._queue=new hd,this._persistenceKey="name"in t?t.name:"[DEFAULT]"}_terminate(){return this._firestoreClient||wd(this),this._firestoreClient.terminate()}}function md(t,e){const n=i._getProvider(t,"firestore");if(n.isInitialized()){const t=n.getImmediate();if(d(n.getOptions(),e))return t;throw new Hs(zs.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(void 0!==e.cacheSizeBytes&&-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new Hs(zs.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return n.initialize({options:e})}function pd(t=i.getApp()){return i._getProvider(t,"firestore").getImmediate()}function yd(t){return t._firestoreClient||wd(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function wd(t){var e;const n=t._freezeSettings(),s=function(t,e,n,s){return new Kl(t,e,n,s.host,s.ssl,s.experimentalForceLongPolling,s.experimentalAutoDetectLongPolling,s.useFetchStreams)}(t._databaseId,(null===(e=t._app)||void 0===e?void 0:e.options.appId)||"",t._persistenceKey,n);t._firestoreClient=new Cl(t._credentials,t._queue,s)}function vd(t,e){xd(t=Xl(t,gd));const n=yd(t),s=t._freezeSettings(),r=new Sl;return Td(n,r,new El(r,s.cacheSizeBytes,null==e?void 0:e.forceOwnership))}function bd(t){xd(t=Xl(t,gd));const e=yd(t),n=t._freezeSettings(),s=new Sl;return Td(e,s,new Il(s,n.cacheSizeBytes))}function Td(t,e,n){const s=new Qs;return t.asyncQueue.enqueue((async()=>{try{await kl(t,n),await Rl(t,e),s.resolve()}catch(t){if(!function(t){return"FirebaseError"===t.name?t.code===zs.FAILED_PRECONDITION||t.code===zs.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||(22===t.code||20===t.code||11===t.code)}(t))throw t;console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+t),s.reject(t)}})).then((()=>s.promise))}function Ed(t){if(t._initialized&&!t._terminated)throw new Hs(zs.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");const e=new Qs;return t._queue.enqueueAndForgetEvenWhileRestricted((async()=>{try{await async function(t){if(!ja.bt())return Promise.resolve();const e=t+"main";await ja.delete(e)}(Zc(t._databaseId,t._persistenceKey)),e.resolve()}catch(t){e.reject(t)}})),e.promise}function Id(t){return function(t){const e=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e){const n=Gs(t);ih(n.remoteStore)||Vs("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");try{const t=await function(t){const e=Gs(t);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(t=>e.In.getHighestUnacknowledgedBatchId(t)))}(n.localStore);if(-1===t)return void e.resolve();const s=n.Ko.get(t)||[];s.push(e),n.Ko.set(t,s)}catch(t){const n=_h(t,"Initialization of waitForPendingWrites() operation failed");e.reject(n)}}(await Vl(t),e))),e.promise}(yd(t=Xl(t,gd)))}function Sd(t){return function(t){return t.asyncQueue.enqueue((async()=>{const e=await Ml(t),n=await Pl(t);return e.setNetworkEnabled(!0),function(t){const e=Gs(t);return e.Wr.delete(0),Xu(e)}(n)}))}(yd(t=Xl(t,gd)))}function _d(t){return function(t){return t.asyncQueue.enqueue((async()=>{const e=await Ml(t),n=await Pl(t);return e.setNetworkEnabled(!1),async function(t){const e=Gs(t);e.Wr.add(0),await Ju(e),e.Hr.set("Offline")}(n)}))}(yd(t=Xl(t,gd)))}function Nd(t){return i._removeServiceInstance(t.app,"firestore"),t._delete()}function Ad(t,e){const n=yd(t=Xl(t,gd)),s=new dd;return jl(n,t._databaseId,e,s),s}function Dd(t,e){return function(t,e){return t.asyncQueue.enqueue((async()=>function(t,e){const n=Gs(t);return n.persistence.runTransaction("Get named query","readonly",(t=>n.Je.getNamedQuery(t,e)))}(await Fl(t),e)))}(yd(t=Xl(t,gd)),e).then((e=>e?new sd(t,null,e.query):null))}function xd(t){if(t._initialized||t._terminated)throw new Hs(zs.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.")} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Cd{constructor(...t){for(let e=0;e90)throw new Hs(zs.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new Hs(zs.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}get latitude(){return this._lat}get longitude(){return this._long}isEqual(t){return this._lat===t._lat&&this._long===t._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(t){return rr(this._lat,t._lat)||rr(this._long,t._long)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Md=/^__.*__$/;class Fd{constructor(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}toMutation(t,e){return null!==this.fieldMask?new no(t,this.data,this.fieldMask,e,this.fieldTransforms):new eo(t,this.data,e,this.fieldTransforms)}}class Pd{constructor(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}toMutation(t,e){return new no(t,this.data,this.fieldMask,e,this.fieldTransforms)}}function Vd(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw js()}}class Ud{constructor(t,e,n,s,r,i){this.settings=t,this.databaseId=e,this.N=n,this.ignoreUndefinedProperties=s,void 0===r&&this.xc(),this.fieldTransforms=r||[],this.fieldMask=i||[]}get path(){return this.settings.path}get kc(){return this.settings.kc}$c(t){return new Ud(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.N,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Oc(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),s=this.$c({path:n,Fc:!1});return s.Mc(t),s}Lc(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),s=this.$c({path:n,Fc:!1});return s.xc(),s}Bc(t){return this.$c({path:void 0,Fc:!0})}Uc(t){return of(t,this.settings.methodName,this.settings.qc||!1,this.path,this.settings.Kc)}contains(t){return void 0!==this.fieldMask.find((e=>t.isPrefixOf(e)))||void 0!==this.fieldTransforms.find((e=>t.isPrefixOf(e.field)))}xc(){if(this.path)for(let t=0;tc.covers(t.field)))}else c=null,u=o.fieldTransforms;return new Fd(new $r(a),c,u)}class Kd extends Ld{_toFieldTransform(t){if(2!==t.kc)throw 1===t.kc?t.Uc(`${this._methodName}() can only appear at the top level of your update data`):t.Uc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return t.fieldMask.push(t.path),null}isEqual(t){return t instanceof Kd}}function $d(t,e,n){return new Ud({kc:3,Kc:e.settings.Kc,methodName:t._methodName,Fc:n},e.databaseId,e.N,e.ignoreUndefinedProperties)}class Gd extends Ld{_toFieldTransform(t){return new Gi(t.path,new Pi)}isEqual(t){return t instanceof Gd}}class zd extends Ld{constructor(t,e){super(t),this.Qc=e}_toFieldTransform(t){const e=$d(this,t,!0),n=this.Qc.map((t=>Jd(t,e))),s=new Vi(n);return new Gi(t.path,s)}isEqual(t){return this===t}}class Hd extends Ld{constructor(t,e){super(t),this.Qc=e}_toFieldTransform(t){const e=$d(this,t,!0),n=this.Qc.map((t=>Jd(t,e))),s=new qi(n);return new Gi(t.path,s)}isEqual(t){return this===t}}class Qd extends Ld{constructor(t,e){super(t),this.Wc=e}_toFieldTransform(t){const e=new ji(t.N,Ri(t.N,this.Wc));return new Gi(t.path,e)}isEqual(t){return this===t}}function Wd(t,e,n,s){const r=t.jc(1,e,n);ef("Data must be an object, but it was:",r,s);const i=[],o=$r.empty();hr(s,((t,s)=>{const a=rf(e,t,n);s=g(s);const c=r.Lc(a);if(s instanceof Kd)i.push(a);else{const t=Jd(s,c);null!=t&&(i.push(a),o.set(a,t))}}));const a=new pr(i);return new Pd(o,a,r.fieldTransforms)}function Yd(t,e,n,s,r,i){const o=t.jc(1,e,n),a=[nf(e,s,n)],c=[r];if(i.length%2!=0)throw new Hs(zs.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let t=0;t=0;--t)if(!af(u,a[t])){const e=a[t];let n=c[t];n=g(n);const s=o.Lc(e);if(n instanceof Kd)u.push(e);else{const t=Jd(n,s);null!=t&&(u.push(e),h.set(e,t))}}const l=new pr(u);return new Pd(h,l,o.fieldTransforms)}function Xd(t,e,n,s=!1){return Jd(n,t.jc(s?4:3,e))}function Jd(t,e){if(tf(t=g(t)))return ef("Unsupported field value:",e,t),Zd(t,e);if(t instanceof Ld)return function(t,e){if(!Vd(e.kc))throw e.Uc(`${t._methodName}() can only be used with update() and set()`);if(!e.path)throw e.Uc(`${t._methodName}() is not currently supported inside arrays`);const n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.Fc&&4!==e.kc)throw e.Uc("Nested arrays are not supported");return function(t,e){const n=[];let s=0;for(const r of t){let t=Jd(r,e.Bc(s));null==t&&(t={nullValue:"NULL_VALUE"}),n.push(t),s++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=g(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return Ri(e.N,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){const n=ar.fromDate(t);return{timestampValue:Bo(e.N,n)}}if(t instanceof ar){const n=new ar(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:Bo(e.N,n)}}if(t instanceof Od)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof Rd)return{bytesValue:jo(e.N,t._byteString)};if(t instanceof nd){const n=e.databaseId,s=t.firestore._databaseId;if(!s.isEqual(n))throw e.Uc(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:Go(t.firestore._databaseId||e.databaseId,t._key.path)}}throw e.Uc(`Unsupported field value: ${Yl(t)}`)}(t,e)}function Zd(t,e){const n={};return lr(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):hr(t,((t,s)=>{const r=Jd(s,e.Oc(t));null!=r&&(n[t]=r)})),{mapValue:{fields:n}}}function tf(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof ar||t instanceof Od||t instanceof Rd||t instanceof nd||t instanceof Ld)}function ef(t,e,n){if(!tf(n)||!function(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){const s=Yl(n);throw"an object"===s?e.Uc(t+" a custom object"):e.Uc(t+" "+s)}}function nf(t,e,n){if((e=g(e))instanceof Cd)return e._internalPath;if("string"==typeof e)return rf(t,e);throw of("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}const sf=new RegExp("[~\\*/\\[\\]]");function rf(t,e,n){if(e.search(sf)>=0)throw of(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Cd(...e.split("."))._internalPath}catch(s){throw of(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function of(t,e,n,s,r){const i=s&&!s.isEmpty(),o=void 0!==r;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(i||o)&&(c+=" (found",i&&(c+=` in field ${s}`),o&&(c+=` in document ${r}`),c+=")"),new Hs(zs.INVALID_ARGUMENT,a+t+c)}function af(t,e){return t.some((t=>t.isEqual(e)))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class cf{constructor(t,e,n,s,r){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=s,this._converter=r}get id(){return this._key.path.lastSegment()}get ref(){return new nd(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const t=new uf(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}get(t){if(this._document){const e=this._document.data.field(hf("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}}}class uf extends cf{data(){return super.data()}}function hf(t,e){return"string"==typeof e?rf(t,e):e instanceof Cd?e._internalPath:e._delegate._internalPath} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class lf{constructor(t,e){this.hasPendingWrites=t,this.fromCache=e}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class df extends cf{constructor(t,e,n,s,r,i){super(t,e,n,s,i),this._firestore=t,this._firestoreImpl=t,this.metadata=r}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const e=new ff(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,e={}){if(this._document){const n=this._document.data.field(hf("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}}}class ff extends df{data(t={}){return super.data(t)}}class gf{constructor(t,e,n,s){this._firestore=t,this._userDataWriter=e,this._snapshot=s,this.metadata=new lf(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const t=[];return this.forEach((e=>t.push(e))),t}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(t,e){this._snapshot.docs.forEach((n=>{t.call(e,new ff(this._firestore,this._userDataWriter,n.key,n,new lf(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(t={}){const e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new Hs(zs.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){let e=0;return t._snapshot.docChanges.map((n=>({type:"added",doc:new ff(t._firestore,t._userDataWriter,n.doc.key,n.doc,new lf(t._snapshot.mutatedKeys.has(n.doc.key),t._snapshot.fromCache),t.query.converter),oldIndex:-1,newIndex:e++})))}{let n=t._snapshot.oldDocs;return t._snapshot.docChanges.filter((t=>e||3!==t.type)).map((e=>{const s=new ff(t._firestore,t._userDataWriter,e.doc.key,e.doc,new lf(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter);let r=-1,i=-1;return 0!==e.type&&(r=n.indexOf(e.doc.key),n=n.delete(e.doc.key)),1!==e.type&&(n=n.add(e.doc),i=n.indexOf(e.doc.key)),{type:mf(e.type),doc:s,oldIndex:r,newIndex:i}}))}}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges}}function mf(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return js()}}function pf(t,e){return t instanceof df&&e instanceof df?t._firestore===e._firestore&&t._key.isEqual(e._key)&&(null===t._document?null===e._document:t._document.isEqual(e._document))&&t._converter===e._converter:t instanceof gf&&e instanceof gf&&t._firestore===e._firestore&&ud(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._snapshot.isEqual(e._snapshot)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function yf(t){if(yi(t)&&0===t.explicitOrderBy.length)throw new Hs(zs.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class wf{}function vf(t,...e){for(const n of e)t=n._apply(t);return t}class bf extends wf{constructor(t,e,n){super(),this.Gc=t,this.zc=e,this.Hc=n,this.type="where"}_apply(t){const e=Bd(t.firestore),n=function(t,e,n,s,r,i,o){let a;if(r.isKeyField()){if("array-contains"===i||"array-contains-any"===i)throw new Hs(zs.INVALID_ARGUMENT,`Invalid Query. You can't perform '${i}' queries on FieldPath.documentId().`);if("in"===i||"not-in"===i){Mf(o,i);const e=[];for(const n of o)e.push(Of(s,t,n));a={arrayValue:{values:e}}}else a=Of(s,t,o)}else"in"!==i&&"not-in"!==i&&"array-contains-any"!==i||Mf(o,i),a=Xd(n,"where",o,"in"===i||"not-in"===i);const c=Jr.create(r,i,a);return function(t,e){if(e.v()){const n=vi(t);if(null!==n&&!n.isEqual(e.field))throw new Hs(zs.INVALID_ARGUMENT,`Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);const s=wi(t);null!==s&&Ff(t,e.field,s)}const n=function(t,e){for(const n of t.filters)if(e.indexOf(n.op)>=0)return n.op;return null}(t,function(t){switch(t){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(null!==n)throw n===e.op?new Hs(zs.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new Hs(zs.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}(t,c),c}(t._query,0,e,t.firestore._databaseId,this.Gc,this.zc,this.Hc);return new sd(t.firestore,t.converter,function(t,e){const n=t.filters.concat([e]);return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}(t._query,n))}}function Tf(t,e,n){const s=e,r=hf("where",t);return new bf(r,s,n)}class Ef extends wf{constructor(t,e){super(),this.Gc=t,this.Jc=e,this.type="orderBy"}_apply(t){const e=function(t,e,n){if(null!==t.startAt)throw new Hs(zs.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new Hs(zs.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");const s=new ui(e,n);return function(t,e){if(null===wi(t)){const n=vi(t);null!==n&&Ff(t,n,e.field)}}(t,s),s}(t._query,this.Gc,this.Jc);return new sd(t.firestore,t.converter,function(t,e){const n=t.explicitOrderBy.concat([e]);return new fi(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(t._query,e))}}function If(t,e="asc"){const n=e,s=hf("orderBy",t);return new Ef(s,n)}class Sf extends wf{constructor(t,e,n){super(),this.type=t,this.Yc=e,this.Xc=n}_apply(t){return new sd(t.firestore,t.converter,Ii(t._query,this.Yc,this.Xc))}}function _f(t){return Jl("limit",t),new Sf("limit",t,"F")}function Nf(t){return Jl("limitToLast",t),new Sf("limitToLast",t,"L")}class Af extends wf{constructor(t,e,n){super(),this.type=t,this.Zc=e,this.ta=n}_apply(t){const e=Lf(t,this.type,this.Zc,this.ta);return new sd(t.firestore,t.converter,function(t,e){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,e,t.endAt)}(t._query,e))}}function Df(...t){return new Af("startAt",t,!0)}function xf(...t){return new Af("startAfter",t,!1)}class Cf extends wf{constructor(t,e,n){super(),this.type=t,this.Zc=e,this.ta=n}_apply(t){const e=Lf(t,this.type,this.Zc,this.ta);return new sd(t.firestore,t.converter,function(t,e){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,e)}(t._query,e))}}function kf(...t){return new Cf("endBefore",t,!0)}function Rf(...t){return new Cf("endAt",t,!1)}function Lf(t,e,n,s){if(n[0]=g(n[0]),n[0]instanceof cf)return function(t,e,n,s,r){if(!s)throw new Hs(zs.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${n}().`);const i=[];for(const n of Ti(t))if(n.field.isKeyField())i.push(Pr(e,s.key));else{const t=s.data.field(n.field);if(Ir(t))throw new Hs(zs.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+n.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===t){const t=n.field.canonicalString();throw new Hs(zs.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`)}i.push(t)}return new ai(i,r)}(t._query,t.firestore._databaseId,e,n[0]._document,s);{const r=Bd(t.firestore);return function(t,e,n,s,r,i){const o=t.explicitOrderBy;if(r.length>o.length)throw new Hs(zs.INVALID_ARGUMENT,`Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);const a=[];for(let i=0;i10)throw new Hs(zs.INVALID_ARGUMENT,`Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`)}function Ff(t,e,n){if(!n.isEqual(e))throw new Hs(zs.INVALID_ARGUMENT,`Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Pf{convertValue(t,e="none"){switch(Cr(t)){case 0:return null;case 1:return t.booleanValue;case 2:return Tr(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(Er(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw js()}}convertObject(t,e){const n={};return hr(t.fields,((t,s)=>{n[t]=this.convertValue(s,e)})),n}convertGeoPoint(t){return new Od(Tr(t.latitude),Tr(t.longitude))}convertArray(t,e){return(t.values||[]).map((t=>this.convertValue(t,e)))}convertServerTimestamp(t,e){switch(e){case"previous":const n=Sr(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(_r(t));default:return null}}convertTimestamp(t){const e=br(t);return new ar(e.seconds,e.nanos)}convertDocumentKey(t,e){const n=fr.fromString(t);Ks(pa(n));const s=new $l(n.get(1),n.get(3)),r=new xr(n.popFirst(5));return s.isEqual(e)||Us(`Document ${r} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`),r}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Vf(t,e,n){let s;return s=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,s}class Uf extends Pf{constructor(t){super(),this.firestore=t}convertBytes(t){return new Rd(t)}convertReference(t){const e=this.convertDocumentKey(t,this.firestore._databaseId);return new nd(this.firestore,null,e)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qf{constructor(t,e){this._firestore=t,this._commitHandler=e,this._mutations=[],this._committed=!1,this._dataReader=Bd(t)}set(t,e,n){this._verifyNotCommitted();const s=Bf(t,this._firestore),r=Vf(s.converter,e,n),i=jd(this._dataReader,"WriteBatch.set",s._key,r,null!==s.converter,n);return this._mutations.push(i.toMutation(s._key,Hi.none())),this}update(t,e,n,...s){this._verifyNotCommitted();const r=Bf(t,this._firestore);let i;return i="string"==typeof(e=g(e))||e instanceof Cd?Yd(this._dataReader,"WriteBatch.update",r._key,e,n,s):Wd(this._dataReader,"WriteBatch.update",r._key,e),this._mutations.push(i.toMutation(r._key,Hi.exists(!0))),this}delete(t){this._verifyNotCommitted();const e=Bf(t,this._firestore);return this._mutations=this._mutations.concat(new oo(e._key,Hi.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new Hs(zs.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function Bf(t,e){if((t=g(t)).firestore!==e)throw new Hs(zs.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function jf(t){t=Xl(t,nd);const e=Xl(t.firestore,gd);return ql(yd(e),t._key).then((n=>ng(e,t,n)))}class Kf extends Pf{constructor(t){super(),this.firestore=t}convertBytes(t){return new Rd(t)}convertReference(t){const e=this.convertDocumentKey(t,this.firestore._databaseId);return new nd(this.firestore,null,e)}}function $f(t){t=Xl(t,nd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){try{const s=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("read document","readonly",(t=>n.Qn.An(t,e)))}(t,e);s.isFoundDocument()?n.resolve(s):s.isNoDocument()?n.resolve(null):n.reject(new Hs(zs.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"))}catch(t){const s=_h(t,`Failed to get document '${e} from cache`);n.reject(s)}}(await Fl(t),e,n))),n.promise}(n,t._key).then((n=>new df(e,s,t._key,n,new lf(null!==n&&n.hasLocalMutations,!0),t.converter)))}function Gf(t){t=Xl(t,nd);const e=Xl(t.firestore,gd);return ql(yd(e),t._key,{source:"server"}).then((n=>ng(e,t,n)))}function zf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return yf(t._query),Bl(n,t._query).then((n=>new gf(e,s,t,n)))}function Hf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){try{const s=await du(t,e,!0),r=new Kh(e,s.Gn),i=r.bo(s.documents),o=r.applyChanges(i,!1);n.resolve(o.snapshot)}catch(t){const s=_h(t,`Failed to execute query '${e} against cache`);n.reject(s)}}(await Fl(t),e,n))),n.promise}(n,t._query).then((n=>new gf(e,s,t,n)))}function Qf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return Bl(n,t._query,{source:"server"}).then((n=>new gf(e,s,t,n)))}function Wf(t,e,n){t=Xl(t,nd);const s=Xl(t.firestore,gd),r=Vf(t.converter,e,n);return eg(s,[jd(Bd(s),"setDoc",t._key,r,null!==t.converter,n).toMutation(t._key,Hi.none())])}function Yf(t,e,n,...s){t=Xl(t,nd);const r=Xl(t.firestore,gd),i=Bd(r);let o;return o="string"==typeof(e=g(e))||e instanceof Cd?Yd(i,"updateDoc",t._key,e,n,s):Wd(i,"updateDoc",t._key,e),eg(r,[o.toMutation(t._key,Hi.exists(!0))])}function Xf(t){return eg(Xl(t.firestore,gd),[new oo(t._key,Hi.none())])}function Jf(t,e){const n=Xl(t.firestore,gd),s=ad(t),r=Vf(t.converter,e);return eg(n,[jd(Bd(t.firestore),"addDoc",s._key,r,null!==t.converter,{}).toMutation(s._key,Hi.exists(!1))]).then((()=>s))}function Zf(t,...e){var n,s,r;t=g(t);let i={includeMetadataChanges:!1},o=0;"object"!=typeof e[o]||ld(e[o])||(i=e[o],o++);const a={includeMetadataChanges:i.includeMetadataChanges};if(ld(e[o])){const t=e[o];e[o]=null===(n=t.next)||void 0===n?void 0:n.bind(t),e[o+1]=null===(s=t.error)||void 0===s?void 0:s.bind(t),e[o+2]=null===(r=t.complete)||void 0===r?void 0:r.bind(t)}let c,u,h;if(t instanceof nd)u=Xl(t.firestore,gd),h=mi(t._key.path),c={next:n=>{e[o]&&e[o](ng(u,t,n))},error:e[o+1],complete:e[o+2]};else{const n=Xl(t,sd);u=Xl(n.firestore,gd),h=n._query;const s=new Kf(u);c={next:t=>{e[o]&&e[o](new gf(u,s,n,t))},error:e[o+1],complete:e[o+2]},yf(t._query)}return function(t,e,n,s){const r=new Nl(s),i=new Fh(e,r,n);return t.asyncQueue.enqueueAndForget((async()=>kh(await Ul(t),i))),()=>{r.ec(),t.asyncQueue.enqueueAndForget((async()=>Rh(await Ul(t),i)))}}(yd(u),h,a,c)}function tg(t,e){return function(t,e){const n=new Nl(e);return t.asyncQueue.enqueueAndForget((async()=>function(t,e){Gs(t).so.add(e),e.next()}(await Ul(t),n))),()=>{n.ec(),t.asyncQueue.enqueueAndForget((async()=>function(t,e){Gs(t).so.delete(e)}(await Ul(t),n)))}}(yd(t=Xl(t,gd)),ld(e)?e:{next:e})}function eg(t,e){return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){const s=bl(t);try{const t=await function(t,e){const n=Gs(t),s=ar.now(),r=e.reduce(((t,e)=>t.add(e.key)),No());let i;return n.persistence.runTransaction("Locally write mutations","readwrite",(t=>n.Qn.Pn(t,r).next((r=>{i=r;const o=[];for(const t of e){const e=Ji(t,i.get(t.key));null!=e&&o.push(new no(t.key,e,Gr(e.value.mapValue),Hi.exists(!0)))}return n.In.addMutationBatch(t,s,o,e)})))).then((t=>(t.applyToLocalDocumentSet(i),{batchId:t.batchId,changes:i})))}(s.localStore,e);s.sharedClientState.addPendingMutation(t.batchId),function(t,e,n){let s=t.qo[t.currentUser.toKey()];s||(s=new go(rr)),s=s.insert(e,n),t.qo[t.currentUser.toKey()]=s}(s,t.batchId,n),await cl(s,t.changes),await dh(s.remoteStore)}catch(t){const e=_h(t,"Failed to persist write");n.reject(e)}}(await Vl(t),e,n))),n.promise}(yd(t),e)}function ng(t,e,n){const s=n.docs.get(e._key),r=new Kf(t);return new df(t,r,e._key,s,new lf(n.hasPendingWrites,n.fromCache),e.converter)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class sg extends class{constructor(t,e){this._firestore=t,this._transaction=e,this._dataReader=Bd(t)}get(t){const e=Bf(t,this._firestore),n=new Uf(this._firestore);return this._transaction.lookup([e._key]).then((t=>{if(!t||1!==t.length)return js();const s=t[0];if(s.isFoundDocument())return new cf(this._firestore,n,s.key,s,e.converter);if(s.isNoDocument())return new cf(this._firestore,n,e._key,null,e.converter);throw js()}))}set(t,e,n){const s=Bf(t,this._firestore),r=Vf(s.converter,e,n),i=jd(this._dataReader,"Transaction.set",s._key,r,null!==s.converter,n);return this._transaction.set(s._key,i),this}update(t,e,n,...s){const r=Bf(t,this._firestore);let i;return i="string"==typeof(e=g(e))||e instanceof Cd?Yd(this._dataReader,"Transaction.update",r._key,e,n,s):Wd(this._dataReader,"Transaction.update",r._key,e),this._transaction.update(r._key,i),this}delete(t){const e=Bf(t,this._firestore);return this._transaction.delete(e._key),this}}{constructor(t,e){super(t,e),this._firestore=t}get(t){const e=Bf(t,this._firestore),n=new Kf(this._firestore);return super.get(t).then((t=>new df(this._firestore,n,e._key,t._document,new lf(!1,!1),e.converter)))}}function rg(t,e){return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>{const s=await function(t){return Ol(t).then((t=>t.datastore))}(t);new xl(t.asyncQueue,s,e,n).run()})),n.promise}(yd(t=Xl(t,gd)),(n=>e(new sg(t,n))))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ig(){return new Kd("deleteField")}function og(){return new Gd("serverTimestamp")}function ag(...t){return new zd("arrayUnion",t)}function cg(...t){return new Hd("arrayRemove",t)}function ug(t){return new Qd("increment",t)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function hg(t){return yd(t=Xl(t,gd)),new qf(t,(e=>eg(t,e)))}!function(t,e=!0){!function(t){Os=t}(i.SDK_VERSION),i._registerComponent(new m("firestore",((t,{options:n})=>{const s=t.getProvider("app").getImmediate(),r=new gd(s,new Js(t.getProvider("auth-internal")));return n=Object.assign({useFetchStreams:e},n),r._setSettings(n),r}),"PUBLIC")),i.registerVersion(Rs,"3.2.1",t),i.registerVersion(Rs,"3.2.1","esm2017")}()})); \ No newline at end of file diff --git a/frontend-dist/firebase-firestore.e8a6c520.js b/frontend-dist/firebase-firestore.e8a6c520.js new file mode 100644 index 0000000000..bcb0c1170e --- /dev/null +++ b/frontend-dist/firebase-firestore.e8a6c520.js @@ -0,0 +1,2039 @@ +(()=>{var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function e(t,e,n,s){Object.defineProperty(t,e,{get:n,set:s,enumerable:!0,configurable:!0})}var n=t.parcelRequire94c2;n.register("bHEKI",(function(s,r){e(s.exports,"setLogLevel",(()=>Ps)),e(s.exports,"_logWarn",(()=>qs)),e(s.exports,"_debugAssert",(()=>$s)),e(s.exports,"FirestoreError",(()=>zs)),e(s.exports,"_EmptyCredentialsProvider",(()=>Ys)),e(s.exports,"Timestamp",(()=>ar)),e(s.exports,"_FieldPath",(()=>mr)),e(s.exports,"_isBase64Available",(()=>yr)),e(s.exports,"_DocumentKey",(()=>xr)),e(s.exports,"_DatabaseId",(()=>$l)),e(s.exports,"_validateIsNotUsedTogether",(()=>zl)),e(s.exports,"_cast",(()=>Xl)),e(s.exports,"connectFirestoreEmulator",(()=>ed)),e(s.exports,"DocumentReference",(()=>nd)),e(s.exports,"CollectionReference",(()=>rd)),e(s.exports,"Query",(()=>sd)),e(s.exports,"collection",(()=>id)),e(s.exports,"collectionGroup",(()=>od)),e(s.exports,"doc",(()=>ad)),e(s.exports,"refEqual",(()=>cd)),e(s.exports,"queryEqual",(()=>ud)),e(s.exports,"LoadBundleTask",(()=>dd)),e(s.exports,"CACHE_SIZE_UNLIMITED",(()=>fd)),e(s.exports,"Firestore",(()=>gd)),e(s.exports,"initializeFirestore",(()=>md)),e(s.exports,"getFirestore",(()=>pd)),e(s.exports,"ensureFirestoreConfigured",(()=>yd)),e(s.exports,"enableIndexedDbPersistence",(()=>vd)),e(s.exports,"enableMultiTabIndexedDbPersistence",(()=>bd)),e(s.exports,"clearIndexedDbPersistence",(()=>Td)),e(s.exports,"waitForPendingWrites",(()=>Id)),e(s.exports,"enableNetwork",(()=>Sd)),e(s.exports,"disableNetwork",(()=>_d)),e(s.exports,"terminate",(()=>Nd)),e(s.exports,"loadBundle",(()=>Ad)),e(s.exports,"namedQuery",(()=>Dd)),e(s.exports,"FieldPath",(()=>Cd)),e(s.exports,"documentId",(()=>kd)),e(s.exports,"Bytes",(()=>Rd)),e(s.exports,"FieldValue",(()=>Ld)),e(s.exports,"GeoPoint",(()=>Od)),e(s.exports,"SnapshotMetadata",(()=>lf)),e(s.exports,"DocumentSnapshot",(()=>df)),e(s.exports,"QueryDocumentSnapshot",(()=>ff)),e(s.exports,"QuerySnapshot",(()=>gf)),e(s.exports,"snapshotEqual",(()=>pf)),e(s.exports,"QueryConstraint",(()=>wf)),e(s.exports,"query",(()=>vf)),e(s.exports,"where",(()=>Ef)),e(s.exports,"orderBy",(()=>If)),e(s.exports,"limit",(()=>_f)),e(s.exports,"limitToLast",(()=>Nf)),e(s.exports,"startAt",(()=>Df)),e(s.exports,"startAfter",(()=>xf)),e(s.exports,"endBefore",(()=>kf)),e(s.exports,"endAt",(()=>Rf)),e(s.exports,"AbstractUserDataWriter",(()=>Pf)),e(s.exports,"WriteBatch",(()=>qf)),e(s.exports,"getDoc",(()=>jf)),e(s.exports,"getDocFromCache",(()=>$f)),e(s.exports,"getDocFromServer",(()=>Gf)),e(s.exports,"getDocs",(()=>Hf)),e(s.exports,"getDocsFromCache",(()=>zf)),e(s.exports,"getDocsFromServer",(()=>Qf)),e(s.exports,"setDoc",(()=>Wf)),e(s.exports,"executeWrite",(()=>eg)),e(s.exports,"updateDoc",(()=>Yf)),e(s.exports,"deleteDoc",(()=>Xf)),e(s.exports,"addDoc",(()=>Jf)),e(s.exports,"onSnapshot",(()=>Zf)),e(s.exports,"onSnapshotsInSync",(()=>tg)),e(s.exports,"Transaction",(()=>sg)),e(s.exports,"runTransaction",(()=>rg)),e(s.exports,"deleteField",(()=>ig)),e(s.exports,"serverTimestamp",(()=>og)),e(s.exports,"arrayUnion",(()=>ag)),e(s.exports,"arrayRemove",(()=>cg)),e(s.exports,"increment",(()=>ug)),e(s.exports,"writeBatch",(()=>hg));var i=n("krEeT"),o=n("5AlFU"); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const a=function(t){const e=[];let n=0;for(let s=0;s>6|192,e[n++]=63&r|128):55296==(64512&r)&&s+1>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128)}return e},c={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let e=0;e>2,h=(3&r)<<4|o>>4;let l=(15&o)<<2|c>>6,d=63&c;a||(d=64,i||(l=64)),s.push(n[u],n[h],n[l],n[d])}return s.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(a(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let n=0,s=0;for(;n191&&r<224){const i=t[n++];e[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){const i=((7&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536;e[s++]=String.fromCharCode(55296+(i>>10)),e[s++]=String.fromCharCode(56320+(1023&i))}else{const i=t[n++],o=t[n++];e[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&o)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let e=0;e>4;if(s.push(c),64!==o){const t=i<<4&240|o>>2;if(s.push(t),64!==a){const t=o<<6&192|a;s.push(t)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},u=function(t){return function(t){const e=a(t);return c.encodeByteArray(e,!0)}(t).replace(/\./g,"")}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function h(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function l(){return!function(){try{return"[object process]"===Object.prototype.toString.call(t.process)}catch(t){return!1}}()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function d(t,e){if(t===e)return!0;const n=Object.keys(t),s=Object.keys(e);for(const r of n){if(!s.includes(r))return!1;const n=t[r],i=e[r];if(f(n)&&f(i)){if(!d(n,i))return!1}else if(n!==i)return!1}for(const t of s)if(!n.includes(t))return!1;return!0}function f(t){return null!==t&&"object"==typeof t} +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function g(t){return t&&t._delegate?t._delegate:t}class m{constructor(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var p,y;(y=p||(p={}))[y.DEBUG=0]="DEBUG",y[y.VERBOSE=1]="VERBOSE",y[y.INFO=2]="INFO",y[y.WARN=3]="WARN",y[y.ERROR=4]="ERROR",y[y.SILENT=5]="SILENT";const w={debug:p.DEBUG,verbose:p.VERBOSE,info:p.INFO,warn:p.WARN,error:p.ERROR,silent:p.SILENT},v=p.INFO,b={[p.DEBUG]:"log",[p.VERBOSE]:"log",[p.INFO]:"info",[p.WARN]:"warn",[p.ERROR]:"error"},E=(t,e,...n)=>{if(e>>0),C=0;function k(t,e,n){return t.call.apply(t.bind,arguments)}function R(t,e,n){if(!t)throw Error();if(2e?1:0}t:{var z=_.navigator;if(z){var Q=z.userAgent;if(Q){K=Q;break t}}K=""}function W(t,e,n){for(const s in t)e.call(n,t[s],s,t)}function Y(t){const e={};for(const n in t)e[n]=t[n];return e}var X="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function J(t,e){let n,s;for(let e=1;eparseFloat(ut)){tt=String(lt);break t}}tt=ut}var dt,ft={};function gt(){return function(t){var e=ft;return Object.prototype.hasOwnProperty.call(e,9)?e[9]:e[9]=t(9)}((function(){let t=0;const e=$(String(tt)).split("."),n=$("9").split("."),s=Math.max(e.length,n.length);for(let o=0;0==t&&o>>0);function Ut(t){return"function"==typeof t?t:(t[Vt]||(t[Vt]=function(e){return t.handleEvent(e)}),t[Vt])}function qt(){F.call(this),this.i=new _t(this),this.P=this,this.I=null}function Bt(t,e){var n,s=t.I;if(s)for(n=[];s;s=s.I)n.push(s);if(t=t.P,s=e.type||e,"string"==typeof e)e=new wt(e,t);else if(e instanceof wt)e.target=e.target||t;else{var r=e;J(e=new wt(s,t),r)}if(r=!0,n)for(var i=n.length-1;0<=i;i--){var o=e.g=n[i];r=jt(o,s,!0,e)&&r}if(r=jt(o=e.g=t,s,!0,e)&&r,r=jt(o,s,!1,e)&&r,n)for(i=0;inew zt),(t=>t.reset()));class zt{constructor(){this.next=this.g=this.h=null}set(t,e){this.h=t,this.g=e,this.next=null}reset(){this.next=this.g=this.h=null}}function Qt(t){_.setTimeout((()=>{throw t}),0)}function Wt(t,e){Gt||function(){var t=_.Promise.resolve(void 0);Gt=function(){t.then(Jt)}}(),Yt||(Gt(),Yt=!0),Xt.add(t,e)}var Yt=!1,Xt=new class{constructor(){this.h=this.g=null}add(t,e){const n=Ht.get();n.set(t,e),this.h?this.h.next=n:this.g=n,this.h=n}};function Jt(){for(var t;t=$t();){try{t.h.call(t.g)}catch(t){Qt(t)}var e=Ht;e.j(t),100>e.h&&(e.h++,t.next=e.g,e.g=t)}Yt=!1}function Zt(t,e){qt.call(this),this.h=t||1,this.g=e||_,this.j=L(this.kb,this),this.l=Date.now()}function te(t){t.da=!1,t.S&&(t.g.clearTimeout(t.S),t.S=null)}function ee(t,e,n){if("function"==typeof t)n&&(t=L(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=L(t.handleEvent,t)}return 2147483647{t.g=null,t.i&&(t.i=!1,ne(t))}),t.j);const e=t.h;t.h=null,t.m.apply(null,e)}M(Zt,qt),(T=Zt.prototype).da=!1,T.S=null,T.kb=function(){if(this.da){var t=Date.now()-this.l;0s.length)){var r=s[1];if(Array.isArray(r)&&!(1>r.length)){var i=r[0];if("noop"!=i&&"stop"!=i&&"close"!=i)for(var o=1;oe.length?Le:(e=e.substr(s,n),t.C=s+n,e))}function Ue(t){t.Y=Date.now()+t.P,qe(t,t.P)}function qe(t,e){if(null!=t.B)throw Error("WatchDog timer not null");t.B=we(L(t.eb,t),e)}function Be(t){t.B&&(_.clearTimeout(t.B),t.B=null)}function je(t){0==t.l.G||t.I||ds(t.l,t)}function Ke(t){Be(t);var e=t.L;e&&"function"==typeof e.na&&e.na(),t.L=null,te(t.W),ae(t.V),t.g&&(e=t.g,t.g=null,e.abort(),e.na())}function $e(t,e){try{var n=t.l;if(0!=n.G&&(n.g==t||In(n.i,t)))if(n.I=t.N,!t.J&&In(n.i,t)&&3==n.G){try{var s=n.Ca.g.parse(e)}catch(t){s=null}if(Array.isArray(s)&&3==s.length){var r=s;if(0==r[0]){t:if(!n.u){if(n.g){if(!(n.g.F+3e3r[2]&&n.N&&0==n.A&&!n.v&&(n.v=we(L(n.ab,n),6e3));if(1>=Tn(n.i)&&n.ka){try{n.ka()}catch(t){}n.ka=void 0}}else gs(n,11)}else if((t.J||n.g==t)&&ls(n),!j(e))for(r=n.Ca.g.parse(e),e=0;eh)&&(3!=h||it||this.g&&(this.h.h||this.g.ga()||Wn(this.g)))){this.I||4!=h||7==e||ge(8==e||0>=l?3:2),Be(this);var n=this.g.ba();this.N=n;e:if(Fe(this)){var s=Wn(this.g);t="";var r=s.length,i=4==Qn(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){Ke(this),je(this);var o="";break e}this.h.i=new _.TextDecoder}for(e=0;ee)throw Error("Bad port number "+e);t.m=e}else t.m=null}function en(t,e,n){e instanceof fn?(t.h=e,function(t,e){e&&!t.j&&(gn(t),t.i=null,t.g.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(mn(this,e),yn(this,n,t))}),t)),t.j=e}(t.h,t.g)):(n||(e=on(e,ln)),t.h=new fn(e,t.g))}function nn(t,e,n){t.h.set(e,n)}function sn(t){return nn(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function rn(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function on(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,an),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function an(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Ye.prototype.toString=function(){var t=[],e=this.j;e&&t.push(on(e,cn,!0),":");var n=this.i;return(n||"file"==e)&&(t.push("//"),(e=this.s)&&t.push(on(e,cn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&t.push(":",String(n))),(n=this.l)&&(this.i&&"/"!=n.charAt(0)&&t.push("/"),t.push(on(n,"/"==n.charAt(0)?hn:un,!0))),(n=this.h.toString())&&t.push("?",n),(n=this.o)&&t.push("#",on(n,dn)),t.join("")};var cn=/[#\/\?@]/g,un=/[#\?:]/g,hn=/[#\?]/g,ln=/[#\?@]/g,dn=/#/g;function fn(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function gn(t){t.g||(t.g=new He,t.h=0,t.i&&function(t,e){if(t){t=t.split("&");for(var n=0;n2*t.i&&ze(t)))}function pn(t,e){return gn(t),e=wn(t,e),Qe(t.g.h,e)}function yn(t,e,n){mn(t,e),0=t.j}function Tn(t){return t.h?1:t.g?t.g.size:0}function In(t,e){return t.h?t.h==e:!!t.g&&t.g.has(e)}function Sn(t,e){t.g?t.g.add(e):t.h=e}function _n(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}function Nn(t){if(null!=t.h)return t.i.concat(t.h.D);if(null!=t.g&&0!==t.g.size){let e=t.i;for(const n of t.g.values())e=e.concat(n.D);return e}return B(t.i)}function An(){}function Dn(){this.g=new An}function xn(t,e,n){const s=n||"";try{Ge(t,(function(t,n){let r=t;D(t)&&(r=Kt(t)),e.push(s+n+"="+encodeURIComponent(r))}))}catch(t){throw e.push(s+"type="+encodeURIComponent("_badmap")),t}}function Cn(t,e,n,s,r){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,r(s)}catch(t){}}function kn(t){this.l=t.$b||null,this.j=t.ib||!1}function Rn(t,e){qt.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=Ln,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}vn.prototype.cancel=function(){if(this.i=Nn(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const t of this.g.values())t.cancel();this.g.clear()}},An.prototype.stringify=function(t){return _.JSON.stringify(t,void 0)},An.prototype.parse=function(t){return _.JSON.parse(t,void 0)},M(kn,Ee),kn.prototype.g=function(){return new Rn(this.l,this.j)},kn.prototype.i=function(t){return function(){return t}}({}),M(Rn,qt);var Ln=0;function On(t){t.j.read().then(t.Sa.bind(t)).catch(t.ha.bind(t))}function Mn(t){t.readyState=4,t.l=null,t.j=null,t.A=null,Fn(t)}function Fn(t){t.onreadystatechange&&t.onreadystatechange.call(t)}(T=Rn.prototype).open=function(t,e){if(this.readyState!=Ln)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,Fn(this)},T.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||_).fetch(new Request(this.B,e)).then(this.Va.bind(this),this.ha.bind(this))},T.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,Mn(this)),this.readyState=Ln},T.Va=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,Fn(this)),this.g&&(this.readyState=3,Fn(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(void 0!==_.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;On(this)}else t.text().then(this.Ua.bind(this),this.ha.bind(this))},T.Sa=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?Mn(this):Fn(this),3==this.readyState&&On(this)}},T.Ua=function(t){this.g&&(this.response=this.responseText=t,Mn(this))},T.Ta=function(t){this.g&&(this.response=t,Mn(this))},T.ha=function(){this.g&&Mn(this)},T.setRequestHeader=function(t,e){this.v.append(t,e)},T.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},T.getAllResponseHeaders=function(){if(!this.h)return"";const t=[],e=this.h.entries();for(var n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(Rn.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}});var Pn=_.JSON.parse;function Vn(t){qt.call(this),this.headers=new He,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=Un,this.K=this.L=!1}M(Vn,qt);var Un="",qn=/^https?$/i,Bn=["POST","PUT"];function jn(t){return"content-type"==t.toLowerCase()}function Kn(t,e){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=e,t.m=5,$n(t),Hn(t)}function $n(t){t.D||(t.D=!0,Bt(t,"complete"),Bt(t,"error"))}function Gn(t){if(t.h&&void 0!==S&&(!t.C[1]||4!=Qn(t)||2!=t.ba()))if(t.v&&4==Qn(t))ee(t.Fa,0,t);else if(Bt(t,"readystatechange"),4==Qn(t)){t.h=!1;try{const a=t.ba();t:switch(a){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break t;default:e=!1}var n;if(!(n=e)){var s;if(s=0===a){var r=String(t.H).match(We)[1]||null;if(!r&&_.self&&_.self.location){var i=_.self.location.protocol;r=i.substr(0,i.length-1)}s=!qn.test(r?r.toLowerCase():"")}n=s}if(n)Bt(t,"complete"),Bt(t,"success");else{t.m=6;try{var o=2n)e=Math.max(0,r[o].h-100),i=!1;else try{xn(a,t,"req"+n+"_")}catch(t){s&&s(a)}}if(i){s=t.join("&");break t}}}return t=t.l.splice(0,n),e.D=t,s}function as(t){t.g||t.u||(t.Y=1,Wt(t.Ga,t),t.A=0)}function cs(t){return!(t.g||t.u||3<=t.A)&&(t.Y++,t.u=we(L(t.Ga,t),fs(t,t.A)),t.A++,!0)}function us(t){null!=t.B&&(_.clearTimeout(t.B),t.B=null)}function hs(t){t.g=new xe(t,t.h,"rpc",t.Y),null===t.o&&(t.g.H=t.s),t.g.O=0;var e=Xe(t.oa);nn(e,"RID","rpc"),nn(e,"SID",t.J),nn(e,"CI",t.N?"0":"1"),nn(e,"AID",t.U),is(t,e),nn(e,"TYPE","xmlhttp"),t.o&&t.s&&Yn(e,t.o,t.s),t.K&&t.g.setTimeout(t.K);var n=t.g;t=t.la,n.K=1,n.v=sn(Xe(e)),n.s=null,n.U=!0,Me(n,t)}function ls(t){null!=t.v&&(_.clearTimeout(t.v),t.v=null)}function ds(t,e){var n=null;if(t.g==e){ls(t),us(t),t.g=null;var s=2}else{if(!In(t.i,e))return;n=e.D,_n(t.i,e),s=1}if(t.I=e.N,0!=t.G)if(e.i)if(1==s){n=e.s?e.s.length:0,e=Date.now()-e.F;var r=t.C;Bt(s=de(),new ye(s,n,e,r)),ss(t)}else as(t);else if(3==(r=e.o)||0==r&&0=t.i.j-(t.m?1:0)||(t.m?(t.l=e.D.concat(t.l),0):1==t.G||2==t.G||t.C>=(t.Xa?0:t.Ya)||(t.m=we(L(t.Ha,t,e),fs(t,t.C)),t.C++,0)))}(t,e)||2==s&&cs(t)))switch(n&&0e?null:"string"==typeof t?t.charAt(e):t[e]}(r.T()),n=_.FormData&&t instanceof _.FormData,!(0<=V(Bn,e))||s||n||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),r.forEach((function(t,e){this.g.setRequestHeader(e,t)}),this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{zn(this),0=this.O)){var t=2*this.O;this.h.info("BP detection timer enabled: "+t),this.B=we(L(this.bb,this),t)}},T.bb=function(){this.B&&(this.B=null,this.h.info("BP detection timeout reached."),this.h.info("Buffering proxy detected and switch to long-polling!"),this.N=!1,this.L=!0,pe(10),ts(this),hs(this))},T.ab=function(){null!=this.v&&(this.v=null,ts(this),cs(this),pe(19))},T.jb=function(t){t?(this.h.info("Successfully pinged google.com"),pe(2)):(this.h.info("Failed to ping google.com"),pe(1))},(T=ws.prototype).xa=function(){},T.wa=function(){},T.va=function(){},T.ua=function(){},T.Oa=function(){},vs.prototype.g=function(t,e){return new bs(t,e)},M(bs,qt),bs.prototype.m=function(){this.g.j=this.j,this.A&&(this.g.H=!0);var t=this.g,e=this.l,n=this.h||void 0;t.Wa&&(t.h.info("Origin Trials enabled."),Wt(L(t.hb,t,e))),pe(0),t.W=e,t.aa=n||{},t.N=t.X,t.F=ps(t,null,t.W),ss(t)},bs.prototype.close=function(){Zn(this.g)},bs.prototype.u=function(t){if("string"==typeof t){var e={};e.__data__=t,ns(this.g,e)}else this.v?((e={}).__data__=Kt(t),ns(this.g,e)):ns(this.g,t)},bs.prototype.M=function(){this.g.j=null,delete this.j,Zn(this.g),delete this.g,bs.Z.M.call(this)},M(Es,Ne),M(Ts,Ae),M(Is,ws),Is.prototype.xa=function(){Bt(this.g,"a")},Is.prototype.wa=function(t){Bt(this.g,new Es(t))},Is.prototype.va=function(t){Bt(this.g,new Ts(t))},Is.prototype.ua=function(){Bt(this.g,"b")},vs.prototype.createWebChannel=vs.prototype.g,bs.prototype.send=bs.prototype.u,bs.prototype.open=bs.prototype.m,bs.prototype.close=bs.prototype.close,ve.NO_ERROR=0,ve.TIMEOUT=8,ve.HTTP_ERROR=6,be.COMPLETE="complete",Ie.EventType=_e,_e.OPEN="a",_e.CLOSE="b",_e.ERROR="c",_e.MESSAGE="d",qt.prototype.listen=qt.prototype.N,Vn.prototype.listenOnce=Vn.prototype.O,Vn.prototype.getLastError=Vn.prototype.La,Vn.prototype.getLastErrorCode=Vn.prototype.Da,Vn.prototype.getStatus=Vn.prototype.ba,Vn.prototype.getResponseJson=Vn.prototype.Qa,Vn.prototype.getResponseText=Vn.prototype.ga,Vn.prototype.send=Vn.prototype.ea;var Ss=ve,_s=be,Ns=he,As=10,Ds=11,xs=kn,Cs=Ie,ks=Vn;const Rs="@firebase/firestore"; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ls{constructor(t){this.uid=t}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(t){return t.uid===this.uid}}Ls.UNAUTHENTICATED=new Ls(null),Ls.GOOGLE_CREDENTIALS=new Ls("google-credentials-uid"),Ls.FIRST_PARTY=new Ls("first-party-uid"),Ls.MOCK_USER=new Ls("mock-user"); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +let Os="9.3.0"; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Ms=new class{constructor(t){this.name=t,this._logLevel=v,this._logHandler=E,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in p))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?w[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,p.DEBUG,...t),this._logHandler(this,p.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,p.VERBOSE,...t),this._logHandler(this,p.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,p.INFO,...t),this._logHandler(this,p.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,p.WARN,...t),this._logHandler(this,p.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,p.ERROR,...t),this._logHandler(this,p.ERROR,...t)}}("@firebase/firestore");function Fs(){return Ms.logLevel}function Ps(t){Ms.setLogLevel(t)}function Vs(t,...e){if(Ms.logLevel<=p.DEBUG){const n=e.map(Bs);Ms.debug(`Firestore (${Os}): ${t}`,...n)}}function Us(t,...e){if(Ms.logLevel<=p.ERROR){const n=e.map(Bs);Ms.error(`Firestore (${Os}): ${t}`,...n)}}function qs(t,...e){if(Ms.logLevel<=p.WARN){const n=e.map(Bs);Ms.warn(`Firestore (${Os}): ${t}`,...n)}}function Bs(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var e} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function js(t="Unexpected state"){const e=`FIRESTORE (${Os}) INTERNAL ASSERTION FAILED: `+t;throw Us(e),new Error(e)}function Ks(t,e){t||js()}function $s(t,e){t||js()}function Gs(t,e){return t} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Hs={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class zs extends Error{constructor(t,e){super(e),this.code=t,this.message=e,this.name="FirebaseError",this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Qs{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ws{constructor(t,e){this.user=e,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization=`Bearer ${t}`}}class Ys{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,e){t.enqueueRetryable((()=>e(Ls.UNAUTHENTICATED)))}shutdown(){}}class Xs{constructor(t){this.token=t,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(t,e){this.changeListener=e,t.enqueueRetryable((()=>e(this.token.user)))}shutdown(){this.changeListener=null}}class Js{constructor(t){this.t=t,this.currentUser=Ls.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(t,e){let n=this.i;const s=t=>this.i!==n?(n=this.i,e(t)):Promise.resolve();let r=new Qs;this.o=()=>{this.i++,this.currentUser=this.u(),r.resolve(),r=new Qs,t.enqueueRetryable((()=>s(this.currentUser)))};const i=()=>{const e=r;t.enqueueRetryable((async()=>{await e.promise,await s(this.currentUser)}))},o=t=>{Vs("FirebaseCredentialsProvider","Auth detected"),this.auth=t,this.auth.addAuthTokenListener(this.o),i()};this.t.onInit((t=>o(t))),setTimeout((()=>{if(!this.auth){const t=this.t.getImmediate({optional:!0});t?o(t):(Vs("FirebaseCredentialsProvider","Auth not yet detected"),r.resolve(),r=new Qs)}}),0),i()}getToken(){const t=this.i,e=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(e).then((e=>this.i!==t?(Vs("FirebaseCredentialsProvider","getToken aborted due to token change."),this.getToken()):e?(Ks("string"==typeof e.accessToken),new Ws(e.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const t=this.auth&&this.auth.getUid();return Ks(null===t||"string"==typeof t),new Ls(t)}}class Zs{constructor(t,e,n){this.h=t,this.l=e,this.m=n,this.type="FirstParty",this.user=Ls.FIRST_PARTY}get authHeaders(){const t={"X-Goog-AuthUser":this.l},e=this.h.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),this.m&&(t["X-Goog-Iam-Authorization-Token"]=this.m),t}}class tr{constructor(t,e,n){this.h=t,this.l=e,this.m=n}getToken(){return Promise.resolve(new Zs(this.h,this.l,this.m))}start(t,e){t.enqueueRetryable((()=>e(Ls.FIRST_PARTY)))}shutdown(){}invalidateToken(){}} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class er{constructor(t,e){this.previousValue=t,e&&(e.sequenceNumberHandler=t=>this.g(t),this.p=t=>e.writeSequenceNumber(t))}g(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this.p&&this.p(t),t}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function nr(t){const e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(let e=0;ee?1:0}function ir(t,e,n){return t.length===e.length&&t.every(((t,s)=>n(t,e[s])))}function or(t){return t+"\0"} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ar{constructor(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}static now(){return ar.fromMillis(Date.now())}static fromDate(t){return ar.fromMillis(t.getTime())}static fromMillis(t){const e=Math.floor(t/1e3),n=Math.floor(1e6*(t-1e3*e));return new ar(e,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(t){return this.seconds===t.seconds?rr(this.nanoseconds,t.nanoseconds):rr(this.seconds,t.seconds)}isEqual(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class cr{constructor(t){this.timestamp=t}static fromTimestamp(t){return new cr(t)}static min(){return new cr(new ar(0,0))}compareTo(t){return this.timestamp._compareTo(t.timestamp)}isEqual(t){return this.timestamp.isEqual(t.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ur(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function hr(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function lr(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class dr{constructor(t,e,n){void 0===e?e=0:e>t.length&&js(),void 0===n?n=t.length-e:n>t.length-e&&js(),this.segments=t,this.offset=e,this.len=n}get length(){return this.len}isEqual(t){return 0===dr.comparator(this,t)}child(t){const e=this.segments.slice(this.offset,this.limit());return t instanceof dr?t.forEach((t=>{e.push(t)})):e.push(t),this.construct(e)}limit(){return this.offset+this.length}popFirst(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(t){return this.segments[this.offset+t]}isEmpty(){return 0===this.length}isPrefixOf(t){if(t.lengthr)return 1}return t.lengthe.length?1:0}}class fr extends dr{construct(t,e,n){return new fr(t,e,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...t){const e=[];for(const n of t){if(n.indexOf("//")>=0)throw new zs(Hs.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);e.push(...n.split("/").filter((t=>t.length>0)))}return new fr(e)}static emptyPath(){return new fr([])}}const gr=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class mr extends dr{construct(t,e,n){return new mr(t,e,n)}static isValidIdentifier(t){return gr.test(t)}canonicalString(){return this.toArray().map((t=>(t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),mr.isValidIdentifier(t)||(t="`"+t+"`"),t))).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new mr(["__name__"])}static fromServerFormat(t){const e=[];let n="",s=0;const r=()=>{if(0===n.length)throw new zs(Hs.INVALID_ARGUMENT,`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);e.push(n),n=""};let i=!1;for(;st.isEqual(e)))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function yr(){return"undefined"!=typeof atob} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class wr{constructor(t){this.binaryString=t}static fromBase64String(t){const e=atob(t);return new wr(e)}static fromUint8Array(t){const e=function(t){let e="";for(let n=0;n=Number.MIN_SAFE_INTEGER} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xr{constructor(t){this.path=t}static fromPath(t){return new xr(fr.fromString(t))}static fromName(t){return new xr(fr.fromString(t).popFirst(5))}hasCollectionId(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t}isEqual(t){return null!==t&&0===fr.comparator(this.path,t.path)}toString(){return this.path.toString()}static comparator(t,e){return fr.comparator(t.path,e.path)}static isDocumentKey(t){return t.length%2==0}static fromSegments(t){return new xr(new fr(t.slice()))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Cr(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?Ir(t)?4:10:js()}function kr(t,e){const n=Cr(t);if(n!==Cr(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return _r(t).isEqual(_r(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;const n=br(t.timestampValue),s=br(e.timestampValue);return n.seconds===s.seconds&&n.nanos===s.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return Tr(t.bytesValue).isEqual(Tr(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return Er(t.geoPointValue.latitude)===Er(e.geoPointValue.latitude)&&Er(t.geoPointValue.longitude)===Er(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return Er(t.integerValue)===Er(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){const n=Er(t.doubleValue),s=Er(e.doubleValue);return n===s?Ar(n)===Ar(s):isNaN(n)&&isNaN(s)}return!1}(t,e);case 9:return ir(t.arrayValue.values||[],e.arrayValue.values||[],kr);case 10:return function(t,e){const n=t.mapValue.fields||{},s=e.mapValue.fields||{};if(ur(n)!==ur(s))return!1;for(const t in n)if(n.hasOwnProperty(t)&&(void 0===s[t]||!kr(n[t],s[t])))return!1;return!0}(t,e);default:return js()}}function Rr(t,e){return void 0!==(t.values||[]).find((t=>kr(t,e)))}function Lr(t,e){const n=Cr(t),s=Cr(e);if(n!==s)return rr(n,s);switch(n){case 0:return 0;case 1:return rr(t.booleanValue,e.booleanValue);case 2:return function(t,e){const n=Er(t.integerValue||t.doubleValue),s=Er(e.integerValue||e.doubleValue);return ns?1:n===s?0:isNaN(n)?isNaN(s)?0:-1:1}(t,e);case 3:return Or(t.timestampValue,e.timestampValue);case 4:return Or(_r(t),_r(e));case 5:return rr(t.stringValue,e.stringValue);case 6:return function(t,e){const n=Tr(t),s=Tr(e);return n.compareTo(s)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){const n=t.split("/"),s=e.split("/");for(let t=0;te.mapValue.fields[t]=Kr(n))),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Kr(t.arrayValue.values[n]);return e}return Object.assign({},t)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class $r{constructor(t){this.value=t}static empty(){return new $r({mapValue:{}})}field(t){if(t.isEmpty())return this.value;{let e=this.value;for(let n=0;n{if(!e.isImmediateParentOf(r)){const t=this.getFieldsMap(e);this.applyChanges(t,n,s),n={},s=[],e=r.popLast()}t?n[r.lastSegment()]=Kr(t):s.push(r.lastSegment())}));const r=this.getFieldsMap(e);this.applyChanges(r,n,s)}delete(t){const e=this.field(t.popLast());jr(e)&&e.mapValue.fields&&delete e.mapValue.fields[t.lastSegment()]}isEqual(t){return kr(this.value,t.value)}getFieldsMap(t){let e=this.value;e.mapValue.fields||(e.mapValue={fields:{}});for(let n=0;nt[e]=n));for(const e of n)delete t[e]}clone(){return new $r(Kr(this.value))}}function Gr(t){const e=[];return hr(t.fields,((t,n)=>{const s=new mr([t]);if(jr(n)){const t=Gr(n.mapValue).fields;if(0===t.length)e.push(s);else for(const n of t)e.push(s.child(n))}else e.push(s)})),new pr(e) +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class Hr{constructor(t,e,n,s,r){this.key=t,this.documentType=e,this.version=n,this.data=s,this.documentState=r}static newInvalidDocument(t){return new Hr(t,0,cr.min(),$r.empty(),0)}static newFoundDocument(t,e,n){return new Hr(t,1,e,n,0)}static newNoDocument(t,e){return new Hr(t,2,e,$r.empty(),0)}static newUnknownDocument(t,e){return new Hr(t,3,e,$r.empty(),2)}convertToFoundDocument(t,e){return this.version=t,this.documentType=1,this.data=e,this.documentState=0,this}convertToNoDocument(t){return this.version=t,this.documentType=2,this.data=$r.empty(),this.documentState=0,this}convertToUnknownDocument(t){return this.version=t,this.documentType=3,this.data=$r.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(t){return t instanceof Hr&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)}clone(){return new Hr(this.key,this.documentType,this.version,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class zr{constructor(t,e=null,n=[],s=[],r=null,i=null,o=null){this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=s,this.limit=r,this.startAt=i,this.endAt=o,this.A=null}}function Qr(t,e=null,n=[],s=[],r=null,i=null,o=null){return new zr(t,e,n,s,r,i,o)}function Wr(t){const e=Gs(t);if(null===e.A){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map((t=>function(t){return t.field.canonicalString()+t.op.toString()+Mr(t.value)}(t))).join(","),t+="|ob:",t+=e.orderBy.map((t=>function(t){return t.field.canonicalString()+t.dir}(t))).join(","),Nr(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=ci(e.startAt)),e.endAt&&(t+="|ub:",t+=ci(e.endAt)),e.A=t}return e.A}function Yr(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n":return t>0;case">=":return t>=0;default:return js()}}v(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}}class Zr extends Jr{constructor(t,e,n){super(t,e,n),this.key=xr.fromName(n.referenceValue)}matches(t){const e=xr.comparator(t.key,this.key);return this.P(e)}}class ti extends Jr{constructor(t,e){super(t,"in",e),this.keys=ni("in",e)}matches(t){return this.keys.some((e=>e.isEqual(t.key)))}}class ei extends Jr{constructor(t,e){super(t,"not-in",e),this.keys=ni("not-in",e)}matches(t){return!this.keys.some((e=>e.isEqual(t.key)))}}function ni(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((t=>xr.fromName(t.referenceValue)))}class si extends Jr{constructor(t,e){super(t,"array-contains",e)}matches(t){const e=t.data.field(this.field);return Ur(e)&&Rr(e.arrayValue,this.value)}}class ri extends Jr{constructor(t,e){super(t,"in",e)}matches(t){const e=t.data.field(this.field);return null!==e&&Rr(this.value.arrayValue,e)}}class ii extends Jr{constructor(t,e){super(t,"not-in",e)}matches(t){if(Rr(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const e=t.data.field(this.field);return null!==e&&!Rr(this.value.arrayValue,e)}}class oi extends Jr{constructor(t,e){super(t,"array-contains-any",e)}matches(t){const e=t.data.field(this.field);return!(!Ur(e)||!e.arrayValue.values)&&e.arrayValue.values.some((t=>Rr(this.value.arrayValue,t)))}}class ai{constructor(t,e){this.position=t,this.before=e}}function ci(t){return`${t.before?"b":"a"}:${t.position.map((t=>Mr(t))).join(",")}`}class ui{constructor(t,e="asc"){this.field=t,this.dir=e}}function hi(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function li(t,e,n){let s=0;for(let r=0;r0?t.explicitOrderBy[0].field:null}function vi(t){for(const e of t.filters)if(e.v())return e.field;return null}function bi(t){return null!==t.collectionGroup}function Ei(t){const e=Gs(t);if(null===e.V){e.V=[];const t=vi(e),n=wi(e);if(null!==t&&null===n)t.isKeyField()||e.V.push(new ui(t)),e.V.push(new ui(mr.keyField(),"asc"));else{let t=!1;for(const n of e.explicitOrderBy)e.V.push(n),n.field.isKeyField()&&(t=!0);if(!t){const t=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.V.push(new ui(mr.keyField(),t))}}}return e.V}function Ti(t){const e=Gs(t);if(!e.S)if("F"===e.limitType)e.S=Qr(e.path,e.collectionGroup,Ei(e),e.filters,e.limit,e.startAt,e.endAt);else{const t=[];for(const n of Ei(e)){const e="desc"===n.dir?"asc":"desc";t.push(new ui(n.field,e))}const n=e.endAt?new ai(e.endAt.position,!e.endAt.before):null,s=e.startAt?new ai(e.startAt.position,!e.startAt.before):null;e.S=Qr(e.path,e.collectionGroup,t,e.filters,e.limit,n,s)}return e.S}function Ii(t,e,n){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function Si(t,e){return Yr(Ti(t),Ti(e))&&t.limitType===e.limitType}function _i(t){return`${Wr(Ti(t))}|lt:${t.limitType}`}function Ni(t){return`Query(target=${function(t){let e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=`, filters: [${t.filters.map((t=>{var e;return`${(e=t).field.canonicalString()} ${e.op} ${Mr(e.value)}`})).join(", ")}]`),Nr(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=`, orderBy: [${t.orderBy.map((t=>function(t){return`${t.field.canonicalString()} (${t.dir})`}(t))).join(", ")}]`),t.startAt&&(e+=", startAt: "+ci(t.startAt)),t.endAt&&(e+=", endAt: "+ci(t.endAt)),`Target(${e})`}(Ti(t))}; limitType=${t.limitType})`}function Ai(t,e){return e.isFoundDocument()&&function(t,e){const n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):xr.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(const n of t.explicitOrderBy)if(!n.field.isKeyField()&&null===e.data.field(n.field))return!1;return!0}(t,e)&&function(t,e){for(const n of t.filters)if(!n.matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!li(t.startAt,Ei(t),e))&&(!t.endAt||!li(t.endAt,Ei(t),e))}(t,e)}function Di(t){return(e,n)=>{let s=!1;for(const r of Ei(t)){const t=xi(r,e,n);if(0!==t)return t;s=s||r.field.isKeyField()}return 0}}function xi(t,e,n){const s=t.field.isKeyField()?xr.comparator(e.key,n.key):function(t,e,n){const s=e.data.field(t),r=n.data.field(t);return null!==s&&null!==r?Lr(s,r):js()}(t.field,e,n);switch(t.dir){case"asc":return s;case"desc":return-1*s;default:return js()}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Ci(t,e){if(t.D){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Ar(e)?"-0":e}}function ki(t){return{integerValue:""+t}}function Ri(t,e){return Dr(e)?ki(e):Ci(t,e)} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Li{constructor(){this._=void 0}}function Oi(t,e,n){return t instanceof Pi?function(t,e){const n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof Vi?Ui(t,e):t instanceof qi?Bi(t,e):function(t,e){const n=Fi(t,e),s=Ki(n)+Ki(t.C);return Vr(n)&&Vr(t.C)?ki(s):Ci(t.N,s)}(t,e)}function Mi(t,e,n){return t instanceof Vi?Ui(t,e):t instanceof qi?Bi(t,e):n}function Fi(t,e){var n;return t instanceof ji?Vr(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null}class Pi extends Li{}class Vi extends Li{constructor(t){super(),this.elements=t}}function Ui(t,e){const n=$i(e);for(const e of t.elements)n.some((t=>kr(t,e)))||n.push(e);return{arrayValue:{values:n}}}class qi extends Li{constructor(t){super(),this.elements=t}}function Bi(t,e){let n=$i(e);for(const e of t.elements)n=n.filter((t=>!kr(t,e)));return{arrayValue:{values:n}}}class ji extends Li{constructor(t,e){super(),this.N=t,this.C=e}}function Ki(t){return Er(t.integerValue||t.doubleValue)}function $i(t){return Ur(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Gi{constructor(t,e){this.field=t,this.transform=e}}class Hi{constructor(t,e){this.version=t,this.transformResults=e}}class zi{constructor(t,e){this.updateTime=t,this.exists=e}static none(){return new zi}static exists(t){return new zi(void 0,t)}static updateTime(t){return new zi(t)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function Qi(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}class Wi{}function Yi(t,e,n){t instanceof eo?function(t,e,n){const s=t.value.clone(),r=ro(t.fieldTransforms,e,n.transformResults);s.setAll(r),e.convertToFoundDocument(n.version,s).setHasCommittedMutations()}(t,e,n):t instanceof no?function(t,e,n){if(!Qi(t.precondition,e))return void e.convertToUnknownDocument(n.version);const s=ro(t.fieldTransforms,e,n.transformResults),r=e.data;r.setAll(so(t)),r.setAll(s),e.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function Xi(t,e,n){t instanceof eo?function(t,e,n){if(!Qi(t.precondition,e))return;const s=t.value.clone(),r=io(t.fieldTransforms,n,e);s.setAll(r),e.convertToFoundDocument(to(e),s).setHasLocalMutations()}(t,e,n):t instanceof no?function(t,e,n){if(!Qi(t.precondition,e))return;const s=io(t.fieldTransforms,n,e),r=e.data;r.setAll(so(t)),r.setAll(s),e.convertToFoundDocument(to(e),r).setHasLocalMutations()}(t,e,n):function(t,e){Qi(t.precondition,e)&&e.convertToNoDocument(cr.min())}(t,e)}function Ji(t,e){let n=null;for(const s of t.fieldTransforms){const t=e.data.field(s.field),r=Fi(s.transform,t||null);null!=r&&(null==n&&(n=$r.empty()),n.set(s.field,r))}return n||null}function Zi(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&ir(t,e,((t,e)=>function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof Vi&&e instanceof Vi||t instanceof qi&&e instanceof qi?ir(t.elements,e.elements,kr):t instanceof ji&&e instanceof ji?kr(t.C,e.C):t instanceof Pi&&e instanceof Pi}(t.transform,e.transform)}(t,e)))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}function to(t){return t.isFoundDocument()?t.version:cr.min()}class eo extends Wi{constructor(t,e,n,s=[]){super(),this.key=t,this.value=e,this.precondition=n,this.fieldTransforms=s,this.type=0}}class no extends Wi{constructor(t,e,n,s,r=[]){super(),this.key=t,this.data=e,this.fieldMask=n,this.precondition=s,this.fieldTransforms=r,this.type=1}}function so(t){const e=new Map;return t.fieldMask.fields.forEach((n=>{if(!n.isEmpty()){const s=t.data.field(n);e.set(n,s)}})),e}function ro(t,e,n){const s=new Map;Ks(t.length===n.length);for(let r=0;r0&&(e=e.right)}return null}indexOf(t){let e=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(t,n.key);if(0===s)return e+n.left.size;s<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(t){return this.root.inorderTraversal(t)}forEach(t){this.inorderTraversal(((e,n)=>(t(e,n),!1)))}toString(){const t=[];return this.inorderTraversal(((e,n)=>(t.push(`${e}:${n}`),!1))),`{${t.join(", ")}}`}reverseTraversal(t){return this.root.reverseTraversal(t)}getIterator(){return new mo(this.root,null,this.comparator,!1)}getIteratorFrom(t){return new mo(this.root,t,this.comparator,!1)}getReverseIterator(){return new mo(this.root,null,this.comparator,!0)}getReverseIteratorFrom(t){return new mo(this.root,t,this.comparator,!0)}}class mo{constructor(t,e,n,s){this.isReverse=s,this.nodeStack=[];let r=1;for(;!t.isEmpty();)if(r=e?n(t.key,e):1,s&&(r*=-1),r<0)t=this.isReverse?t.left:t.right;else{if(0===r){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}getNext(){let t=this.nodeStack.pop();const e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}}}class po{constructor(t,e,n,s,r){this.key=t,this.value=e,this.color=null!=n?n:po.RED,this.left=null!=s?s:po.EMPTY,this.right=null!=r?r:po.EMPTY,this.size=this.left.size+1+this.right.size}copy(t,e,n,s,r){return new po(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=s?s:this.left,null!=r?r:this.right)}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(t,e,n){let s=this;const r=n(t,s.key);return s=r<0?s.copy(null,null,null,s.left.insert(t,e,n),null):0===r?s.copy(null,e,null,null,null):s.copy(null,null,null,null,s.right.insert(t,e,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return po.EMPTY;let t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()}remove(t,e){let n,s=this;if(e(t,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(t,e),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),0===e(t,s.key)){if(s.right.isEmpty())return po.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(t,e))}return s.fixUp()}isRed(){return this.color}fixUp(){let t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t}moveRedLeft(){let t=this.colorFlip();return t.right.left.isRed()&&(t=t.copy(null,null,null,null,t.right.rotateRight()),t=t.rotateLeft(),t=t.colorFlip()),t}moveRedRight(){let t=this.colorFlip();return t.left.left.isRed()&&(t=t.rotateRight(),t=t.colorFlip()),t}rotateLeft(){const t=this.copy(null,null,po.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight(){const t=this.copy(null,null,po.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip(){const t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)}checkMaxDepth(){const t=this.check();return Math.pow(2,t)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw js();if(this.right.isRed())throw js();const t=this.left.check();if(t!==this.right.check())throw js();return t+(this.isRed()?0:1)}}po.EMPTY=null,po.RED=!0,po.BLACK=!1,po.EMPTY=new class{constructor(){this.size=0}get key(){throw js()}get value(){throw js()}get color(){throw js()}get left(){throw js()}get right(){throw js()}copy(t,e,n,s,r){return this}insert(t,e,n){return new po(t,e)}remove(t,e){return this}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class yo{constructor(t){this.comparator=t,this.data=new go(this.comparator)}has(t){return null!==this.data.get(t)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(t){return this.data.indexOf(t)}forEach(t){this.data.inorderTraversal(((e,n)=>(t(e),!1)))}forEachInRange(t,e){const n=this.data.getIteratorFrom(t[0]);for(;n.hasNext();){const s=n.getNext();if(this.comparator(s.key,t[1])>=0)return;e(s.key)}}forEachWhile(t,e){let n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return}firstAfterOrEqual(t){const e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null}getIterator(){return new wo(this.data.getIterator())}getIteratorFrom(t){return new wo(this.data.getIteratorFrom(t))}add(t){return this.copy(this.data.remove(t).insert(t,!0))}delete(t){return this.has(t)?this.copy(this.data.remove(t)):this}isEmpty(){return this.data.isEmpty()}unionWith(t){let e=this;return e.size{e=e.add(t)})),e}isEqual(t){if(!(t instanceof yo))return!1;if(this.size!==t.size)return!1;const e=this.data.getIterator(),n=t.data.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(0!==this.comparator(t,s))return!1}return!0}toArray(){const t=[];return this.forEach((e=>{t.push(e)})),t}toString(){const t=[];return this.forEach((e=>t.push(e))),"SortedSet("+t.toString()+")"}copy(t){const e=new yo(this.comparator);return e.data=t,e}}class wo{constructor(t){this.iter=t}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const vo=new go(xr.comparator);function bo(){return vo}const Eo=new go(xr.comparator);function To(){return Eo}const Io=new go(xr.comparator);function So(){return Io}const _o=new yo(xr.comparator);function No(...t){let e=_o;for(const n of t)e=e.add(n);return e}const Ao=new yo(rr);function Do(){return Ao} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xo{constructor(t,e,n,s,r){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=s,this.resolvedLimboDocuments=r}static createSynthesizedRemoteEventForCurrentChange(t,e){const n=new Map;return n.set(t,Co.createSynthesizedTargetChangeForCurrentChange(t,e)),new xo(cr.min(),n,Do(),bo(),No())}}class Co{constructor(t,e,n,s,r){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=s,this.removedDocuments=r}static createSynthesizedTargetChangeForCurrentChange(t,e){return new Co(wr.EMPTY_BYTE_STRING,e,No(),No(),No())}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ko{constructor(t,e,n,s){this.k=t,this.removedTargetIds=e,this.key=n,this.$=s}}class Ro{constructor(t,e){this.targetId=t,this.O=e}}class Lo{constructor(t,e,n=wr.EMPTY_BYTE_STRING,s=null){this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=s}}class Oo{constructor(){this.F=0,this.M=Po(),this.L=wr.EMPTY_BYTE_STRING,this.B=!1,this.U=!0}get current(){return this.B}get resumeToken(){return this.L}get q(){return 0!==this.F}get K(){return this.U}j(t){t.approximateByteSize()>0&&(this.U=!0,this.L=t)}W(){let t=No(),e=No(),n=No();return this.M.forEach(((s,r)=>{switch(r){case 0:t=t.add(s);break;case 2:e=e.add(s);break;case 1:n=n.add(s);break;default:js()}})),new Co(this.L,this.B,t,e,n)}G(){this.U=!1,this.M=Po()}H(t,e){this.U=!0,this.M=this.M.insert(t,e)}J(t){this.U=!0,this.M=this.M.remove(t)}Y(){this.F+=1}X(){this.F-=1}Z(){this.U=!0,this.B=!0}}class Mo{constructor(t){this.tt=t,this.et=new Map,this.nt=bo(),this.st=Fo(),this.it=new yo(rr)}rt(t){for(const e of t.k)t.$&&t.$.isFoundDocument()?this.ot(e,t.$):this.ct(e,t.key,t.$);for(const e of t.removedTargetIds)this.ct(e,t.key,t.$)}at(t){this.forEachTarget(t,(e=>{const n=this.ut(e);switch(t.state){case 0:this.ht(e)&&n.j(t.resumeToken);break;case 1:n.X(),n.q||n.G(),n.j(t.resumeToken);break;case 2:n.X(),n.q||this.removeTarget(e);break;case 3:this.ht(e)&&(n.Z(),n.j(t.resumeToken));break;case 4:this.ht(e)&&(this.lt(e),n.j(t.resumeToken));break;default:js()}}))}forEachTarget(t,e){t.targetIds.length>0?t.targetIds.forEach(e):this.et.forEach(((t,n)=>{this.ht(n)&&e(n)}))}ft(t){const e=t.targetId,n=t.O.count,s=this.dt(e);if(s){const t=s.target;if(Xr(t))if(0===n){const n=new xr(t.path);this.ct(e,n,Hr.newNoDocument(n,cr.min()))}else Ks(1===n);else this.wt(e)!==n&&(this.lt(e),this.it=this.it.add(e))}}_t(t){const e=new Map;this.et.forEach(((n,s)=>{const r=this.dt(s);if(r){if(n.current&&Xr(r.target)){const e=new xr(r.target.path);null!==this.nt.get(e)||this.gt(s,e)||this.ct(s,e,Hr.newNoDocument(e,t))}n.K&&(e.set(s,n.W()),n.G())}}));let n=No();this.st.forEach(((t,e)=>{let s=!0;e.forEachWhile((t=>{const e=this.dt(t);return!e||2===e.purpose||(s=!1,!1)})),s&&(n=n.add(t))}));const s=new xo(t,e,this.it,this.nt,n);return this.nt=bo(),this.st=Fo(),this.it=new yo(rr),s}ot(t,e){if(!this.ht(t))return;const n=this.gt(t,e.key)?2:0;this.ut(t).H(e.key,n),this.nt=this.nt.insert(e.key,e),this.st=this.st.insert(e.key,this.yt(e.key).add(t))}ct(t,e,n){if(!this.ht(t))return;const s=this.ut(t);this.gt(t,e)?s.H(e,1):s.J(e),this.st=this.st.insert(e,this.yt(e).delete(t)),n&&(this.nt=this.nt.insert(e,n))}removeTarget(t){this.et.delete(t)}wt(t){const e=this.ut(t).W();return this.tt.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size}Y(t){this.ut(t).Y()}ut(t){let e=this.et.get(t);return e||(e=new Oo,this.et.set(t,e)),e}yt(t){let e=this.st.get(t);return e||(e=new yo(rr),this.st=this.st.insert(t,e)),e}ht(t){const e=null!==this.dt(t);return e||Vs("WatchChangeAggregator","Detected inactive target",t),e}dt(t){const e=this.et.get(t);return e&&e.q?null:this.tt.Tt(t)}lt(t){this.et.set(t,new Oo),this.tt.getRemoteKeysForTarget(t).forEach((e=>{this.ct(t,e,null)}))}gt(t,e){return this.tt.getRemoteKeysForTarget(t).has(e)}}function Fo(){return new go(xr.comparator)}function Po(){return new go(xr.comparator)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Vo={asc:"ASCENDING",desc:"DESCENDING"},Uo={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"};class qo{constructor(t,e){this.databaseId=t,this.D=e}}function Bo(t,e){return t.D?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function jo(t,e){return t.D?e.toBase64():e.toUint8Array()}function Ko(t,e){return Bo(t,e.toTimestamp())}function $o(t){return Ks(!!t),cr.fromTimestamp(function(t){const e=br(t);return new ar(e.seconds,e.nanos)}(t))}function Go(t,e){return function(t){return new fr(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).canonicalString()}function Ho(t){const e=fr.fromString(t);return Ks(pa(e)),e}function zo(t,e){return Go(t.databaseId,e.path)}function Qo(t,e){const n=Ho(e);if(n.get(1)!==t.databaseId.projectId)throw new zs(Hs.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new zs(Hs.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new xr(Jo(n))}function Wo(t,e){return Go(t.databaseId,e)}function Yo(t){const e=Ho(t);return 4===e.length?fr.emptyPath():Jo(e)}function Xo(t){return new fr(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Jo(t){return Ks(t.length>4&&"documents"===t.get(4)),t.popFirst(5)}function Zo(t,e,n){return{name:zo(t,e),fields:n.value.mapValue.fields}}function ta(t,e,n){const s=Qo(t,e.name),r=$o(e.updateTime),i=new $r({mapValue:{fields:e.fields}}),o=Hr.newFoundDocument(s,r,i);return n&&o.setHasCommittedMutations(),n?o.setHasCommittedMutations():o}function ea(t,e){let n;if(e instanceof eo)n={update:Zo(t,e.key,e.value)};else if(e instanceof oo)n={delete:zo(t,e.key)};else if(e instanceof no)n={update:Zo(t,e.key,e.data),updateMask:ma(e.fieldMask)};else{if(!(e instanceof ao))return js();n={verify:zo(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map((t=>function(t,e){const n=e.transform;if(n instanceof Pi)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof Vi)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof qi)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof ji)return{fieldPath:e.field.canonicalString(),increment:n.C};throw js()}(0,t)))),e.precondition.isNone||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:Ko(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:js()}(t,e.precondition)),n}function na(t,e){const n=e.currentDocument?function(t){return void 0!==t.updateTime?zi.updateTime($o(t.updateTime)):void 0!==t.exists?zi.exists(t.exists):zi.none()}(e.currentDocument):zi.none(),s=e.updateTransforms?e.updateTransforms.map((e=>function(t,e){let n=null;if("setToServerValue"in e)Ks("REQUEST_TIME"===e.setToServerValue),n=new Pi;else if("appendMissingElements"in e){const t=e.appendMissingElements.values||[];n=new Vi(t)}else if("removeAllFromArray"in e){const t=e.removeAllFromArray.values||[];n=new qi(t)}else"increment"in e?n=new ji(t,e.increment):js();const s=mr.fromServerFormat(e.fieldPath);return new Gi(s,n)}(t,e))):[];if(e.update){e.update.name;const r=Qo(t,e.update.name),i=new $r({mapValue:{fields:e.update.fields}});if(e.updateMask){const t=function(t){const e=t.fieldPaths||[];return new pr(e.map((t=>mr.fromServerFormat(t))))}(e.updateMask);return new no(r,i,t,n,s)}return new eo(r,i,n,s)}if(e.delete){const s=Qo(t,e.delete);return new oo(s,n)}if(e.verify){const s=Qo(t,e.verify);return new ao(s,n)}return js()}function sa(t,e){return{documents:[Wo(t,e.path)]}}function ra(t,e){const n={structuredQuery:{}},s=e.path;null!==e.collectionGroup?(n.parent=Wo(t,s),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Wo(t,s.popLast()),n.structuredQuery.from=[{collectionId:s.lastSegment()}]);const r=function(t){if(0===t.length)return;const e=t.map((t=>function(t){if("=="===t.op){if(Br(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NAN"}};if(qr(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(Br(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NOT_NAN"}};if(qr(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:la(t.field),op:ha(t.op),value:t.value}}}(t)));return 1===e.length?e[0]:{compositeFilter:{op:"AND",filters:e}}}(e.filters);r&&(n.structuredQuery.where=r);const i=function(t){if(0!==t.length)return t.map((t=>function(t){return{field:la(t.field),direction:ua(t.dir)}}(t)))}(e.orderBy);i&&(n.structuredQuery.orderBy=i);const o=function(t,e){return t.D||Nr(e)?e:{value:e}}(t,e.limit);return null!==o&&(n.structuredQuery.limit=o),e.startAt&&(n.structuredQuery.startAt=aa(e.startAt)),e.endAt&&(n.structuredQuery.endAt=aa(e.endAt)),n}function ia(t){let e=Yo(t.parent);const n=t.structuredQuery,s=n.from?n.from.length:0;let r=null;if(s>0){Ks(1===s);const t=n.from[0];t.allDescendants?r=t.collectionId:e=e.child(t.collectionId)}let i=[];n.where&&(i=oa(n.where));let o=[];n.orderBy&&(o=n.orderBy.map((t=>function(t){return new ui(da(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t))));let a=null;n.limit&&(a=function(t){let e;return e="object"==typeof t?t.value:t,Nr(e)?null:e}(n.limit));let c=null;n.startAt&&(c=ca(n.startAt));let u=null;return n.endAt&&(u=ca(n.endAt)),gi(e,r,o,i,a,"F",c,u)}function oa(t){return t?void 0!==t.unaryFilter?[ga(t)]:void 0!==t.fieldFilter?[fa(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((t=>oa(t))).reduce(((t,e)=>t.concat(e))):js():[]}function aa(t){return{before:t.before,values:t.position}}function ca(t){const e=!!t.before,n=t.values||[];return new ai(n,e)}function ua(t){return Vo[t]}function ha(t){return Uo[t]}function la(t){return{fieldPath:t.canonicalString()}}function da(t){return mr.fromServerFormat(t.fieldPath)}function fa(t){return Jr.create(da(t.fieldFilter.field),function(t){switch(t){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return js()}}(t.fieldFilter.op),t.fieldFilter.value)}function ga(t){switch(t.unaryFilter.op){case"IS_NAN":const e=da(t.unaryFilter.field);return Jr.create(e,"==",{doubleValue:NaN});case"IS_NULL":const n=da(t.unaryFilter.field);return Jr.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=da(t.unaryFilter.field);return Jr.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const r=da(t.unaryFilter.field);return Jr.create(r,"!=",{nullValue:"NULL_VALUE"});default:return js()}}function ma(t){const e=[];return t.fields.forEach((t=>e.push(t.canonicalString()))),{fieldPaths:e}}function pa(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ya(t){let e="";for(let n=0;n0&&(e=va(e)),e=wa(t.get(n),e);return va(e)}function wa(t,e){let n=e;const s=t.length;for(let e=0;e=2),2===e)return Ks(""===t.charAt(0)&&""===t.charAt(1)),fr.emptyPath();const n=e-2,s=[];let r="";for(let i=0;in)&&js(),t.charAt(e+1)){case"":const n=t.substring(i,e);let o;0===r.length?o=n:(r+=n,o=r,r=""),s.push(o);break;case"":r+=t.substring(i,e),r+="\0";break;case"":r+=t.substring(i,e+1);break;default:js()}i=e+2}return new fr(s)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ea{constructor(t,e){this.seconds=t,this.nanoseconds=e}}class Ta{constructor(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n}}Ta.store="owner",Ta.key="owner";class Ia{constructor(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n}}Ia.store="mutationQueues",Ia.keyPath="userId";class Sa{constructor(t,e,n,s,r){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=s,this.mutations=r}}Sa.store="mutations",Sa.keyPath="batchId",Sa.userMutationsIndex="userMutationsIndex",Sa.userMutationsKeyPath=["userId","batchId"];class _a{constructor(){}static prefixForUser(t){return[t]}static prefixForPath(t,e){return[t,ya(e)]}static key(t,e,n){return[t,ya(e),n]}}_a.store="documentMutations",_a.PLACEHOLDER=new _a;class Na{constructor(t,e){this.path=t,this.readTime=e}}class Aa{constructor(t,e){this.path=t,this.version=e}}class Da{constructor(t,e,n,s,r,i){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=s,this.readTime=r,this.parentPath=i}}Da.store="remoteDocuments",Da.readTimeIndex="readTimeIndex",Da.readTimeIndexPath="readTime",Da.collectionReadTimeIndex="collectionReadTimeIndex",Da.collectionReadTimeIndexPath=["parentPath","readTime"];class xa{constructor(t){this.byteSize=t}}xa.store="remoteDocumentGlobal",xa.key="remoteDocumentGlobalKey";class Ca{constructor(t,e,n,s,r,i,o){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=s,this.lastListenSequenceNumber=r,this.lastLimboFreeSnapshotVersion=i,this.query=o}}Ca.store="targets",Ca.keyPath="targetId",Ca.queryTargetsIndexName="queryTargetsIndex",Ca.queryTargetsKeyPath=["canonicalId","targetId"];class ka{constructor(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n}}ka.store="targetDocuments",ka.keyPath=["targetId","path"],ka.documentTargetsIndex="documentTargetsIndex",ka.documentTargetsKeyPath=["path","targetId"];class Ra{constructor(t,e,n,s){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=s}}Ra.key="targetGlobalKey",Ra.store="targetGlobal";class La{constructor(t,e){this.collectionId=t,this.parent=e}}La.store="collectionParents",La.keyPath=["collectionId","parent"];class Oa{constructor(t,e,n,s){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=s}}Oa.store="clientMetadata",Oa.keyPath="clientId";class Ma{constructor(t,e,n){this.bundleId=t,this.createTime=e,this.version=n}}Ma.store="bundles",Ma.keyPath="bundleId";class Fa{constructor(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n}}Fa.store="namedQueries",Fa.keyPath="name";const Pa=[Ia.store,Sa.store,_a.store,Da.store,Ca.store,Ta.store,Ra.store,ka.store,Oa.store,xa.store,La.store,Ma.store,Fa.store],Va="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class Ua{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(t){this.onCommittedListeners.push(t)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((t=>t()))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qa{constructor(t){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)}),(t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)}))}catch(t){return this.next(void 0,t)}next(t,e){return this.callbackAttached&&js(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(e,this.error):this.wrapSuccess(t,this.result):new qa(((n,s)=>{this.nextCallback=e=>{this.wrapSuccess(t,e).next(n,s)},this.catchCallback=t=>{this.wrapFailure(e,t).next(n,s)}}))}toPromise(){return new Promise(((t,e)=>{this.next(t,e)}))}wrapUserFunction(t){try{const e=t();return e instanceof qa?e:qa.resolve(e)}catch(t){return qa.reject(t)}}wrapSuccess(t,e){return t?this.wrapUserFunction((()=>t(e))):qa.resolve(e)}wrapFailure(t,e){return t?this.wrapUserFunction((()=>t(e))):qa.reject(e)}static resolve(t){return new qa(((e,n)=>{e(t)}))}static reject(t){return new qa(((e,n)=>{n(t)}))}static waitFor(t){return new qa(((e,n)=>{let s=0,r=0,i=!1;t.forEach((t=>{++s,t.next((()=>{++r,i&&r===s&&e()}),(t=>n(t)))})),i=!0,r===s&&e()}))}static or(t){let e=qa.resolve(!1);for(const n of t)e=e.next((t=>t?qa.resolve(t):n()));return e}static forEach(t,e){const n=[];return t.forEach(((t,s)=>{n.push(e.call(this,t,s))})),this.waitFor(n)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ba{constructor(t,e){this.action=t,this.transaction=e,this.aborted=!1,this.Et=new Qs,this.transaction.oncomplete=()=>{this.Et.resolve()},this.transaction.onabort=()=>{e.error?this.Et.reject(new $a(t,e.error)):this.Et.resolve()},this.transaction.onerror=e=>{const n=Wa(e.target.error);this.Et.reject(new $a(t,n))}}static open(t,e,n,s){try{return new Ba(e,t.transaction(s,n))}catch(t){throw new $a(e,t)}}get It(){return this.Et.promise}abort(t){t&&this.Et.reject(t),this.aborted||(Vs("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}store(t){const e=this.transaction.objectStore(t);return new Ha(e)}}class ja{constructor(t,e,n){this.name=t,this.version=e,this.At=n,12.2===ja.Rt(h())&&Us("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}static delete(t){return Vs("SimpleDb","Removing database:",t),za(window.indexedDB.deleteDatabase(t)).toPromise()}static bt(){if("object"!=typeof indexedDB)return!1;if(ja.Pt())return!0;const t=h(),e=ja.Rt(t),n=00||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0||n||r)}static Pt(){var t;return void 0!==o&&"YES"===(void 0===(t={})?void 0:t.Vt)}static St(t,e){return t.store(e)}static Rt(t){const e=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=e?e[1].split("_").slice(0,2).join("."):"-1";return Number(n)}static vt(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}async Dt(t){return this.db||(Vs("SimpleDb","Opening database:",this.name),this.db=await new Promise(((e,n)=>{const s=indexedDB.open(this.name,this.version);s.onsuccess=t=>{const n=t.target.result;e(n)},s.onblocked=()=>{n(new $a(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},s.onerror=e=>{const s=e.target.error;"VersionError"===s.name?n(new zs(Hs.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):"InvalidStateError"===s.name?n(new zs(Hs.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+s)):n(new $a(t,s))},s.onupgradeneeded=t=>{Vs("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',t.oldVersion);const e=t.target.result;this.At.Ct(e,s.transaction,t.oldVersion,this.version).next((()=>{Vs("SimpleDb","Database upgrade to version "+this.version+" complete")}))}}))),this.Nt&&(this.db.onversionchange=t=>this.Nt(t)),this.db}xt(t){this.Nt=t,this.db&&(this.db.onversionchange=e=>t(e))}async runTransaction(t,e,n,s){const r="readonly"===e;let i=0;for(;;){++i;try{this.db=await this.Dt(t);const e=Ba.open(this.db,t,r?"readonly":"readwrite",n),i=s(e).catch((t=>(e.abort(t),qa.reject(t)))).toPromise();return i.catch((()=>{})),await e.It,i}catch(t){const e="FirebaseError"!==t.name&&i<3;if(Vs("SimpleDb","Transaction failed with error:",t.message,"Retrying:",e),this.close(),!e)return Promise.reject(t)}}}close(){this.db&&this.db.close(),this.db=void 0}}class Ka{constructor(t){this.kt=t,this.$t=!1,this.Ot=null}get isDone(){return this.$t}get Ft(){return this.Ot}set cursor(t){this.kt=t}done(){this.$t=!0}Mt(t){this.Ot=t}delete(){return za(this.kt.delete())}}class $a extends zs{constructor(t,e){super(Hs.UNAVAILABLE,`IndexedDB transaction '${t}' failed: ${e}`),this.name="IndexedDbTransactionError"}}function Ga(t){return"IndexedDbTransactionError"===t.name}class Ha{constructor(t){this.store=t}put(t,e){let n;return void 0!==e?(Vs("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(Vs("SimpleDb","PUT",this.store.name,"",t),n=this.store.put(t)),za(n)}add(t){return Vs("SimpleDb","ADD",this.store.name,t,t),za(this.store.add(t))}get(t){return za(this.store.get(t)).next((e=>(void 0===e&&(e=null),Vs("SimpleDb","GET",this.store.name,t,e),e)))}delete(t){return Vs("SimpleDb","DELETE",this.store.name,t),za(this.store.delete(t))}count(){return Vs("SimpleDb","COUNT",this.store.name),za(this.store.count())}Lt(t,e){const n=this.cursor(this.options(t,e)),s=[];return this.Bt(n,((t,e)=>{s.push(e)})).next((()=>s))}Ut(t,e){Vs("SimpleDb","DELETE ALL",this.store.name);const n=this.options(t,e);n.qt=!1;const s=this.cursor(n);return this.Bt(s,((t,e,n)=>n.delete()))}Kt(t,e){let n;e?n=t:(n={},e=t);const s=this.cursor(n);return this.Bt(s,e)}jt(t){const e=this.cursor({});return new qa(((n,s)=>{e.onerror=t=>{const e=Wa(t.target.error);s(e)},e.onsuccess=e=>{const s=e.target.result;s?t(s.primaryKey,s.value).next((t=>{t?s.continue():n()})):n()}}))}Bt(t,e){const n=[];return new qa(((s,r)=>{t.onerror=t=>{r(t.target.error)},t.onsuccess=t=>{const r=t.target.result;if(!r)return void s();const i=new Ka(r),o=e(r.primaryKey,r.value,i);if(o instanceof qa){const t=o.catch((t=>(i.done(),qa.reject(t))));n.push(t)}i.isDone?s():null===i.Ft?r.continue():r.continue(i.Ft)}})).next((()=>qa.waitFor(n)))}options(t,e){let n;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}}cursor(t){let e="next";if(t.reverse&&(e="prev"),t.index){const n=this.store.index(t.index);return t.qt?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)}}function za(t){return new qa(((e,n)=>{t.onsuccess=t=>{const n=t.target.result;e(n)},t.onerror=t=>{const e=Wa(t.target.error);n(e)}}))}let Qa=!1;function Wa(t){const e=ja.Rt(h());if(e>=12.2&&e<13){const e="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(e)>=0){const t=new zs("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return Qa||(Qa=!0,setTimeout((()=>{throw t}),0)),t}}return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ya extends Ua{constructor(t,e){super(),this.Qt=t,this.currentSequenceNumber=e}}function Xa(t,e){const n=Gs(t);return ja.St(n.Qt,e)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ja{constructor(t,e,n,s){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=s}applyToRemoteDocument(t,e){const n=e.mutationResults;for(let e=0;e{const n=t.get(e.key),s=n;this.applyToLocalView(s),n.isValidDocument()||s.convertToNoDocument(cr.min())}))}keys(){return this.mutations.reduce(((t,e)=>t.add(e.key)),No())}isEqual(t){return this.batchId===t.batchId&&ir(this.mutations,t.mutations,((t,e)=>Zi(t,e)))&&ir(this.baseMutations,t.baseMutations,((t,e)=>Zi(t,e)))}}class Za{constructor(t,e,n,s){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.docVersions=s}static from(t,e,n){Ks(t.mutations.length===n.length);let s=So();const r=t.mutations;for(let t=0;tna(t.Wt,e)));for(let t=0;tna(t.Wt,e))),r=ar.fromMillis(e.localWriteTimeMs);return new Ja(e.batchId,r,n,s)}function uc(t){const e=ac(t.readTime),n=void 0!==t.lastLimboFreeSnapshotVersion?ac(t.lastLimboFreeSnapshotVersion):cr.min();let s;var r;return void 0!==t.query.documents?(Ks(1===(r=t.query).documents.length),s=Ti(mi(Yo(r.documents[0])))):s=function(t){return Ti(ia(t))}(t.query),new tc(s,t.targetId,0,t.lastListenSequenceNumber,e,n,wr.fromBase64String(t.resumeToken))}function hc(t,e){const n=oc(e.snapshotVersion),s=oc(e.lastLimboFreeSnapshotVersion);let r;r=Xr(e.target)?sa(t.Wt,e.target):ra(t.Wt,e.target);const i=e.resumeToken.toBase64();return new Ca(e.targetId,Wr(e.target),n,i,e.sequenceNumber,s,r)}function lc(t){const e=ia({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?Ii(e,e.limit,"L"):e} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class dc{getBundleMetadata(t,e){return fc(t).get(e).next((t=>{if(t)return{id:(e=t).bundleId,createTime:ac(e.createTime),version:e.version};var e}))}saveBundleMetadata(t,e){var n;return fc(t).put({bundleId:(n=e).id,createTime:oc($o(n.createTime)),version:n.version})}getNamedQuery(t,e){return gc(t).get(e).next((t=>{if(t)return{name:(e=t).name,query:lc(e.bundledQuery),readTime:ac(e.readTime)};var e}))}saveNamedQuery(t,e){return gc(t).put(function(t){return{name:t.name,readTime:oc($o(t.readTime)),bundledQuery:t.bundledQuery}}(e))}}function fc(t){return Xa(t,Ma.store)}function gc(t){return Xa(t,Fa.store)} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class mc{constructor(){this.Gt=new pc}addToCollectionParentIndex(t,e){return this.Gt.add(e),qa.resolve()}getCollectionParents(t,e){return qa.resolve(this.Gt.getEntries(e))}}class pc{constructor(){this.index={}}add(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e]||new yo(fr.comparator),r=!s.has(n);return this.index[e]=s.add(n),r}has(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e];return s&&s.has(n)}getEntries(t){return(this.index[t]||new yo(fr.comparator)).toArray()}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class yc{constructor(){this.zt=new pc}addToCollectionParentIndex(t,e){if(!this.zt.has(e)){const n=e.lastSegment(),s=e.popLast();t.addOnCommittedListener((()=>{this.zt.add(e)}));const r={collectionId:n,parent:ya(s)};return wc(t).put(r)}return qa.resolve()}getCollectionParents(t,e){const n=[],s=IDBKeyRange.bound([e,""],[or(e),""],!1,!0);return wc(t).Lt(s).next((t=>{for(const s of t){if(s.collectionId!==e)break;n.push(ba(s.parent))}return n}))}}function wc(t){return Xa(t,La.store)} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const vc={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0};class bc{constructor(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}static withCacheSize(t){return new bc(t,bc.DEFAULT_COLLECTION_PERCENTILE,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Ec(t,e,n){const s=t.store(Sa.store),r=t.store(_a.store),i=[],o=IDBKeyRange.only(n.batchId);let a=0;const c=s.Kt({range:o},((t,e,n)=>(a++,n.delete())));i.push(c.next((()=>{Ks(1===a)})));const u=[];for(const t of n.mutations){const s=_a.key(e,t.key.path,n.batchId);i.push(r.delete(s)),u.push(t.key)}return qa.waitFor(i).next((()=>u))}function Tc(t){if(!t)return 0;let e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw js();e=t.noDocument}return JSON.stringify(e).length} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */bc.DEFAULT_COLLECTION_PERCENTILE=10,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,bc.DEFAULT=new bc(41943040,bc.DEFAULT_COLLECTION_PERCENTILE,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),bc.DISABLED=new bc(-1,0,0);class Ic{constructor(t,e,n,s){this.userId=t,this.N=e,this.Ht=n,this.referenceDelegate=s,this.Jt={}}static Yt(t,e,n,s){Ks(""!==t.uid);const r=t.isAuthenticated()?t.uid:"";return new Ic(r,e,n,s)}checkEmpty(t){let e=!0;const n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return _c(t).Kt({index:Sa.userMutationsIndex,range:n},((t,n,s)=>{e=!1,s.done()})).next((()=>e))}addMutationBatch(t,e,n,s){const r=Nc(t),i=_c(t);return i.add({}).next((o=>{Ks("number"==typeof o);const a=new Ja(o,e,n,s),c=function(t,e,n){const s=n.baseMutations.map((e=>ea(t.Wt,e))),r=n.mutations.map((e=>ea(t.Wt,e)));return new Sa(e,n.batchId,n.localWriteTime.toMillis(),s,r)}(this.N,this.userId,a),u=[];let h=new yo(((t,e)=>rr(t.canonicalString(),e.canonicalString())));for(const t of s){const e=_a.key(this.userId,t.key.path,o);h=h.add(t.key.path.popLast()),u.push(i.put(c)),u.push(r.put(e,_a.PLACEHOLDER))}return h.forEach((e=>{u.push(this.Ht.addToCollectionParentIndex(t,e))})),t.addOnCommittedListener((()=>{this.Jt[o]=a.keys()})),qa.waitFor(u).next((()=>a))}))}lookupMutationBatch(t,e){return _c(t).get(e).next((t=>t?(Ks(t.userId===this.userId),cc(this.N,t)):null))}Xt(t,e){return this.Jt[e]?qa.resolve(this.Jt[e]):this.lookupMutationBatch(t,e).next((t=>{if(t){const n=t.keys();return this.Jt[e]=n,n}return null}))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,s=IDBKeyRange.lowerBound([this.userId,n]);let r=null;return _c(t).Kt({index:Sa.userMutationsIndex,range:s},((t,e,s)=>{e.userId===this.userId&&(Ks(e.batchId>=n),r=cc(this.N,e)),s.done()})).next((()=>r))}getHighestUnacknowledgedBatchId(t){const e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let n=-1;return _c(t).Kt({index:Sa.userMutationsIndex,range:e,reverse:!0},((t,e,s)=>{n=e.batchId,s.done()})).next((()=>n))}getAllMutationBatches(t){const e=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return _c(t).Lt(Sa.userMutationsIndex,e).next((t=>t.map((t=>cc(this.N,t)))))}getAllMutationBatchesAffectingDocumentKey(t,e){const n=_a.prefixForPath(this.userId,e.path),s=IDBKeyRange.lowerBound(n),r=[];return Nc(t).Kt({range:s},((n,s,i)=>{const[o,a,c]=n,u=ba(a);if(o===this.userId&&e.path.isEqual(u))return _c(t).get(c).next((t=>{if(!t)throw js();Ks(t.userId===this.userId),r.push(cc(this.N,t))}));i.done()})).next((()=>r))}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new yo(rr);const s=[];return e.forEach((e=>{const r=_a.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=Nc(t).Kt({range:i},((t,s,r)=>{const[i,o,a]=t,c=ba(o);i===this.userId&&e.path.isEqual(c)?n=n.add(a):r.done()}));s.push(o)})),qa.waitFor(s).next((()=>this.Zt(t,n)))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,s=n.length+1,r=_a.prefixForPath(this.userId,n),i=IDBKeyRange.lowerBound(r);let o=new yo(rr);return Nc(t).Kt({range:i},((t,e,r)=>{const[i,a,c]=t,u=ba(a);i===this.userId&&n.isPrefixOf(u)?u.length===s&&(o=o.add(c)):r.done()})).next((()=>this.Zt(t,o)))}Zt(t,e){const n=[],s=[];return e.forEach((e=>{s.push(_c(t).get(e).next((t=>{if(null===t)throw js();Ks(t.userId===this.userId),n.push(cc(this.N,t))})))})),qa.waitFor(s).next((()=>n))}removeMutationBatch(t,e){return Ec(t.Qt,this.userId,e).next((n=>(t.addOnCommittedListener((()=>{this.te(e.batchId)})),qa.forEach(n,(e=>this.referenceDelegate.markPotentiallyOrphaned(t,e))))))}te(t){delete this.Jt[t]}performConsistencyCheck(t){return this.checkEmpty(t).next((e=>{if(!e)return qa.resolve();const n=IDBKeyRange.lowerBound(_a.prefixForUser(this.userId)),s=[];return Nc(t).Kt({range:n},((t,e,n)=>{if(t[0]===this.userId){const e=ba(t[1]);s.push(e)}else n.done()})).next((()=>{Ks(0===s.length)}))}))}containsKey(t,e){return Sc(t,this.userId,e)}ee(t){return Ac(t).get(this.userId).next((t=>t||new Ia(this.userId,-1,"")))}}function Sc(t,e,n){const s=_a.prefixForPath(e,n.path),r=s[1],i=IDBKeyRange.lowerBound(s);let o=!1;return Nc(t).Kt({range:i,qt:!0},((t,n,s)=>{const[i,a,c]=t;i===e&&a===r&&(o=!0),s.done()})).next((()=>o))}function _c(t){return Xa(t,Sa.store)}function Nc(t){return Xa(t,_a.store)}function Ac(t){return Xa(t,Ia.store)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Dc{constructor(t){this.ne=t}next(){return this.ne+=2,this.ne}static se(){return new Dc(0)}static ie(){return new Dc(-1)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xc{constructor(t,e){this.referenceDelegate=t,this.N=e}allocateTargetId(t){return this.re(t).next((e=>{const n=new Dc(e.highestTargetId);return e.highestTargetId=n.next(),this.oe(t,e).next((()=>e.highestTargetId))}))}getLastRemoteSnapshotVersion(t){return this.re(t).next((t=>cr.fromTimestamp(new ar(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))))}getHighestSequenceNumber(t){return this.re(t).next((t=>t.highestListenSequenceNumber))}setTargetsMetadata(t,e,n){return this.re(t).next((s=>(s.highestListenSequenceNumber=e,n&&(s.lastRemoteSnapshotVersion=n.toTimestamp()),e>s.highestListenSequenceNumber&&(s.highestListenSequenceNumber=e),this.oe(t,s))))}addTargetData(t,e){return this.ce(t,e).next((()=>this.re(t).next((n=>(n.targetCount+=1,this.ae(e,n),this.oe(t,n))))))}updateTargetData(t,e){return this.ce(t,e)}removeTargetData(t,e){return this.removeMatchingKeysForTargetId(t,e.targetId).next((()=>Cc(t).delete(e.targetId))).next((()=>this.re(t))).next((e=>(Ks(e.targetCount>0),e.targetCount-=1,this.oe(t,e))))}removeTargets(t,e,n){let s=0;const r=[];return Cc(t).Kt(((i,o)=>{const a=uc(o);a.sequenceNumber<=e&&null===n.get(a.targetId)&&(s++,r.push(this.removeTargetData(t,a)))})).next((()=>qa.waitFor(r))).next((()=>s))}forEachTarget(t,e){return Cc(t).Kt(((t,n)=>{const s=uc(n);e(s)}))}re(t){return kc(t).get(Ra.key).next((t=>(Ks(null!==t),t)))}oe(t,e){return kc(t).put(Ra.key,e)}ce(t,e){return Cc(t).put(hc(this.N,e))}ae(t,e){let n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n}getTargetCount(t){return this.re(t).next((t=>t.targetCount))}getTargetData(t,e){const n=Wr(e),s=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]);let r=null;return Cc(t).Kt({range:s,index:Ca.queryTargetsIndexName},((t,n,s)=>{const i=uc(n);Yr(e,i.target)&&(r=i,s.done())})).next((()=>r))}addMatchingKeys(t,e,n){const s=[],r=Rc(t);return e.forEach((e=>{const i=ya(e.path);s.push(r.put(new ka(n,i))),s.push(this.referenceDelegate.addReference(t,n,e))})),qa.waitFor(s)}removeMatchingKeys(t,e,n){const s=Rc(t);return qa.forEach(e,(e=>{const r=ya(e.path);return qa.waitFor([s.delete([n,r]),this.referenceDelegate.removeReference(t,n,e)])}))}removeMatchingKeysForTargetId(t,e){const n=Rc(t),s=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(s)}getMatchingKeysForTargetId(t,e){const n=IDBKeyRange.bound([e],[e+1],!1,!0),s=Rc(t);let r=No();return s.Kt({range:n,qt:!0},((t,e,n)=>{const s=ba(t[1]),i=new xr(s);r=r.add(i)})).next((()=>r))}containsKey(t,e){const n=ya(e.path),s=IDBKeyRange.bound([n],[or(n)],!1,!0);let r=0;return Rc(t).Kt({index:ka.documentTargetsIndex,qt:!0,range:s},(([t,e],n,s)=>{0!==t&&(r++,s.done())})).next((()=>r>0))}Tt(t,e){return Cc(t).get(e).next((t=>t?uc(t):null))}}function Cc(t){return Xa(t,Ca.store)}function kc(t){return Xa(t,Ra.store)}function Rc(t){return Xa(t,ka.store)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */async function Lc(t){if(t.code!==Hs.FAILED_PRECONDITION||t.message!==Va)throw t;Vs("LocalStore","Unexpectedly lost primary lease")} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Oc([t,e],[n,s]){const r=rr(t,n);return 0===r?rr(e,s):r}class Mc{constructor(t){this.ue=t,this.buffer=new yo(Oc),this.he=0}le(){return++this.he}fe(t){const e=[t,this.le()];if(this.buffer.size{this.we=null,this.de=!0;try{await t.collectGarbage(this.garbageCollector)}catch(t){Ga(t)?Vs("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",t):await Lc(t)}await this._e(t)}))}}class Pc{constructor(t,e){this.me=t,this.params=e}calculateTargetCount(t,e){return this.me.ge(t).next((t=>Math.floor(e/100*t)))}nthSequenceNumber(t,e){if(0===e)return qa.resolve(er.T);const n=new Mc(e);return this.me.forEachTarget(t,(t=>n.fe(t.sequenceNumber))).next((()=>this.me.ye(t,(t=>n.fe(t))))).next((()=>n.maxValue))}removeTargets(t,e,n){return this.me.removeTargets(t,e,n)}removeOrphanedDocuments(t,e){return this.me.removeOrphanedDocuments(t,e)}collect(t,e){return-1===this.params.cacheSizeCollectionThreshold?(Vs("LruGarbageCollector","Garbage collection skipped; disabled"),qa.resolve(vc)):this.getCacheSize(t).next((n=>n(e>this.params.maximumSequenceNumbersToCollect?(Vs("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`),s=this.params.maximumSequenceNumbersToCollect):s=e,i=Date.now(),this.nthSequenceNumber(t,s)))).next((s=>(n=s,o=Date.now(),this.removeTargets(t,n,e)))).next((e=>(r=e,a=Date.now(),this.removeOrphanedDocuments(t,n)))).next((t=>(c=Date.now(),Fs()<=p.DEBUG&&Vs("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${i-u}ms\n\tDetermined least recently used ${s} in `+(o-i)+"ms\n"+`\tRemoved ${r} targets in `+(a-o)+"ms\n"+`\tRemoved ${t} documents in `+(c-a)+"ms\n"+`Total Duration: ${c-u}ms`),qa.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:r,documentsRemoved:t}))))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Vc{constructor(t,e){this.db=t,this.garbageCollector=function(t,e){return new Pc(t,e)}(this,e)}ge(t){const e=this.Te(t);return this.db.getTargetCache().getTargetCount(t).next((t=>e.next((e=>t+e))))}Te(t){let e=0;return this.ye(t,(t=>{e++})).next((()=>e))}forEachTarget(t,e){return this.db.getTargetCache().forEachTarget(t,e)}ye(t,e){return this.Ee(t,((t,n)=>e(n)))}addReference(t,e,n){return Uc(t,n)}removeReference(t,e,n){return Uc(t,n)}removeTargets(t,e,n){return this.db.getTargetCache().removeTargets(t,e,n)}markPotentiallyOrphaned(t,e){return Uc(t,e)}Ie(t,e){return function(t,e){let n=!1;return Ac(t).jt((s=>Sc(t,s,e).next((t=>(t&&(n=!0),qa.resolve(!t)))))).next((()=>n))}(t,e)}removeOrphanedDocuments(t,e){const n=this.db.getRemoteDocumentCache().newChangeBuffer(),s=[];let r=0;return this.Ee(t,((i,o)=>{if(o<=e){const e=this.Ie(t,i).next((e=>{if(!e)return r++,n.getEntry(t,i).next((()=>(n.removeEntry(i),Rc(t).delete([0,ya(i.path)]))))}));s.push(e)}})).next((()=>qa.waitFor(s))).next((()=>n.apply(t))).next((()=>r))}removeTarget(t,e){const n=e.withSequenceNumber(t.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(t,n)}updateLimboDocument(t,e){return Uc(t,e)}Ee(t,e){const n=Rc(t);let s,r=er.T;return n.Kt({index:ka.documentTargetsIndex},(([t,n],{path:i,sequenceNumber:o})=>{0===t?(r!==er.T&&e(new xr(ba(s)),r),r=o,s=i):r=er.T})).next((()=>{r!==er.T&&e(new xr(ba(s)),r)}))}getCacheSize(t){return this.db.getRemoteDocumentCache().getSize(t)}}function Uc(t,e){return Rc(t).put(function(t,e){return new ka(0,ya(t.path),e)}(e,t.currentSequenceNumber))} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qc{constructor(t,e){this.mapKeyFn=t,this.equalsFn=e,this.inner={}}get(t){const e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(const[e,s]of n)if(this.equalsFn(e,t))return s}has(t){return void 0!==this.get(t)}set(t,e){const n=this.mapKeyFn(t),s=this.inner[n];if(void 0!==s){for(let n=0;n{for(const[e,s]of n)t(e,s)}))}isEmpty(){return lr(this.inner)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Bc{constructor(){this.changes=new qc((t=>t.toString()),((t,e)=>t.isEqual(e))),this.changesApplied=!1}getReadTime(t){const e=this.changes.get(t);return e?e.readTime:cr.min()}addEntry(t,e){this.assertNotApplied(),this.changes.set(t.key,{document:t,readTime:e})}removeEntry(t,e=null){this.assertNotApplied(),this.changes.set(t,{document:Hr.newInvalidDocument(t),readTime:e})}getEntry(t,e){this.assertNotApplied();const n=this.changes.get(e);return void 0!==n?qa.resolve(n.document):this.getFromCache(t,e)}getEntries(t,e){return this.getAllFromCache(t,e)}apply(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)}assertNotApplied(){}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class jc{constructor(t,e){this.N=t,this.Ht=e}addEntry(t,e,n){return Gc(t).put(Hc(e),n)}removeEntry(t,e){const n=Gc(t),s=Hc(e);return n.delete(s)}updateMetadata(t,e){return this.getMetadata(t).next((n=>(n.byteSize+=e,this.Ae(t,n))))}getEntry(t,e){return Gc(t).get(Hc(e)).next((t=>this.Re(e,t)))}be(t,e){return Gc(t).get(Hc(e)).next((t=>({document:this.Re(e,t),size:Tc(t)})))}getEntries(t,e){let n=bo();return this.Pe(t,e,((t,e)=>{const s=this.Re(t,e);n=n.insert(t,s)})).next((()=>n))}ve(t,e){let n=bo(),s=new go(xr.comparator);return this.Pe(t,e,((t,e)=>{const r=this.Re(t,e);n=n.insert(t,r),s=s.insert(t,Tc(e))})).next((()=>({documents:n,Ve:s})))}Pe(t,e,n){if(e.isEmpty())return qa.resolve();const s=IDBKeyRange.bound(e.first().path.toArray(),e.last().path.toArray()),r=e.getIterator();let i=r.getNext();return Gc(t).Kt({range:s},((t,e,s)=>{const o=xr.fromSegments(t);for(;i&&xr.comparator(i,o)<0;)n(i,null),i=r.getNext();i&&i.isEqual(o)&&(n(i,e),i=r.hasNext()?r.getNext():null),i?s.Mt(i.path.toArray()):s.done()})).next((()=>{for(;i;)n(i,null),i=r.hasNext()?r.getNext():null}))}getDocumentsMatchingQuery(t,e,n){let s=bo();const r=e.path.length+1,i={};if(n.isEqual(cr.min())){const t=e.path.toArray();i.range=IDBKeyRange.lowerBound(t)}else{const t=e.path.toArray(),s=rc(n);i.range=IDBKeyRange.lowerBound([t,s],!0),i.index=Da.collectionReadTimeIndex}return Gc(t).Kt(i,((t,n,i)=>{if(t.length!==r)return;const o=nc(this.N,n);e.path.isPrefixOf(o.key.path)?Ai(e,o)&&(s=s.insert(o.key,o)):i.done()})).next((()=>s))}newChangeBuffer(t){return new Kc(this,!!t&&t.trackRemovals)}getSize(t){return this.getMetadata(t).next((t=>t.byteSize))}getMetadata(t){return $c(t).get(xa.key).next((t=>(Ks(!!t),t)))}Ae(t,e){return $c(t).put(xa.key,e)}Re(t,e){if(e){const t=nc(this.N,e);if(!t.isNoDocument()||!t.version.isEqual(cr.min()))return t}return Hr.newInvalidDocument(t)}}class Kc extends Bc{constructor(t,e){super(),this.Se=t,this.trackRemovals=e,this.De=new qc((t=>t.toString()),((t,e)=>t.isEqual(e)))}applyChanges(t){const e=[];let n=0,s=new yo(((t,e)=>rr(t.canonicalString(),e.canonicalString())));return this.changes.forEach(((r,i)=>{const o=this.De.get(r);if(i.document.isValidDocument()){const a=sc(this.Se.N,i.document,this.getReadTime(r));s=s.add(r.path.popLast());const c=Tc(a);n+=c-o,e.push(this.Se.addEntry(t,r,a))}else if(n-=o,this.trackRemovals){const n=sc(this.Se.N,Hr.newNoDocument(r,cr.min()),this.getReadTime(r));e.push(this.Se.addEntry(t,r,n))}else e.push(this.Se.removeEntry(t,r))})),s.forEach((n=>{e.push(this.Se.Ht.addToCollectionParentIndex(t,n))})),e.push(this.Se.updateMetadata(t,n)),qa.waitFor(e)}getFromCache(t,e){return this.Se.be(t,e).next((t=>(this.De.set(e,t.size),t.document)))}getAllFromCache(t,e){return this.Se.ve(t,e).next((({documents:t,Ve:e})=>(e.forEach(((t,e)=>{this.De.set(t,e)})),t)))}}function $c(t){return Xa(t,xa.store)}function Gc(t){return Xa(t,Da.store)}function Hc(t){return t.path.toArray()} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class zc{constructor(t){this.N=t}Ct(t,e,n,s){Ks(n=0&&s<=11);const r=new Ba("createOrUpgrade",e);n<1&&s>=1&&(function(t){t.createObjectStore(Ta.store)}(t),function(t){t.createObjectStore(Ia.store,{keyPath:Ia.keyPath}),t.createObjectStore(Sa.store,{keyPath:Sa.keyPath,autoIncrement:!0}).createIndex(Sa.userMutationsIndex,Sa.userMutationsKeyPath,{unique:!0}),t.createObjectStore(_a.store)}(t),Qc(t),function(t){t.createObjectStore(Da.store)}(t));let i=qa.resolve();return n<3&&s>=3&&(0!==n&&(function(t){t.deleteObjectStore(ka.store),t.deleteObjectStore(Ca.store),t.deleteObjectStore(Ra.store)}(t),Qc(t)),i=i.next((()=>function(t){const e=t.store(Ra.store),n=new Ra(0,0,cr.min().toTimestamp(),0);return e.put(Ra.key,n)}(r)))),n<4&&s>=4&&(0!==n&&(i=i.next((()=>function(t,e){return e.store(Sa.store).Lt().next((n=>{t.deleteObjectStore(Sa.store),t.createObjectStore(Sa.store,{keyPath:Sa.keyPath,autoIncrement:!0}).createIndex(Sa.userMutationsIndex,Sa.userMutationsKeyPath,{unique:!0});const s=e.store(Sa.store),r=n.map((t=>s.put(t)));return qa.waitFor(r)}))}(t,r)))),i=i.next((()=>{!function(t){t.createObjectStore(Oa.store,{keyPath:Oa.keyPath})}(t)}))),n<5&&s>=5&&(i=i.next((()=>this.Ce(r)))),n<6&&s>=6&&(i=i.next((()=>(function(t){t.createObjectStore(xa.store)}(t),this.Ne(r))))),n<7&&s>=7&&(i=i.next((()=>this.xe(r)))),n<8&&s>=8&&(i=i.next((()=>this.ke(t,r)))),n<9&&s>=9&&(i=i.next((()=>{!function(t){t.objectStoreNames.contains("remoteDocumentChanges")&&t.deleteObjectStore("remoteDocumentChanges")}(t),function(t){const e=t.objectStore(Da.store);e.createIndex(Da.readTimeIndex,Da.readTimeIndexPath,{unique:!1}),e.createIndex(Da.collectionReadTimeIndex,Da.collectionReadTimeIndexPath,{unique:!1})}(e)}))),n<10&&s>=10&&(i=i.next((()=>this.$e(r)))),n<11&&s>=11&&(i=i.next((()=>{!function(t){t.createObjectStore(Ma.store,{keyPath:Ma.keyPath})}(t),function(t){t.createObjectStore(Fa.store,{keyPath:Fa.keyPath})}(t)}))),i}Ne(t){let e=0;return t.store(Da.store).Kt(((t,n)=>{e+=Tc(n)})).next((()=>{const n=new xa(e);return t.store(xa.store).put(xa.key,n)}))}Ce(t){const e=t.store(Ia.store),n=t.store(Sa.store);return e.Lt().next((e=>qa.forEach(e,(e=>{const s=IDBKeyRange.bound([e.userId,-1],[e.userId,e.lastAcknowledgedBatchId]);return n.Lt(Sa.userMutationsIndex,s).next((n=>qa.forEach(n,(n=>{Ks(n.userId===e.userId);const s=cc(this.N,n);return Ec(t,e.userId,s).next((()=>{}))}))))}))))}xe(t){const e=t.store(ka.store),n=t.store(Da.store);return t.store(Ra.store).get(Ra.key).next((t=>{const s=[];return n.Kt(((n,r)=>{const i=new fr(n),o=function(t){return[0,ya(t)]}(i);s.push(e.get(o).next((n=>n?qa.resolve():(n=>e.put(new ka(0,ya(n),t.highestListenSequenceNumber)))(i))))})).next((()=>qa.waitFor(s)))}))}ke(t,e){t.createObjectStore(La.store,{keyPath:La.keyPath});const n=e.store(La.store),s=new pc,r=t=>{if(s.add(t)){const e=t.lastSegment(),s=t.popLast();return n.put({collectionId:e,parent:ya(s)})}};return e.store(Da.store).Kt({qt:!0},((t,e)=>{const n=new fr(t);return r(n.popLast())})).next((()=>e.store(_a.store).Kt({qt:!0},(([t,e,n],s)=>{const i=ba(e);return r(i.popLast())}))))}$e(t){const e=t.store(Ca.store);return e.Kt(((t,n)=>{const s=uc(n),r=hc(this.N,s);return e.put(r)}))}}function Qc(t){t.createObjectStore(ka.store,{keyPath:ka.keyPath}).createIndex(ka.documentTargetsIndex,ka.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(Ca.store,{keyPath:Ca.keyPath}).createIndex(Ca.queryTargetsIndexName,Ca.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(Ra.store)}const Wc="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";class Yc{constructor(t,e,n,s,r,i,o,a,c,u){if(this.allowTabSynchronization=t,this.persistenceKey=e,this.clientId=n,this.Oe=r,this.window=i,this.document=o,this.Fe=c,this.Me=u,this.Le=null,this.Be=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Ue=null,this.inForeground=!1,this.qe=null,this.Ke=null,this.je=Number.NEGATIVE_INFINITY,this.Qe=t=>Promise.resolve(),!Yc.bt())throw new zs(Hs.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new Vc(this,s),this.We=e+"main",this.N=new ec(a),this.Ge=new ja(this.We,11,new zc(this.N)),this.ze=new xc(this.referenceDelegate,this.N),this.Ht=new yc,this.He=function(t,e){return new jc(t,e)}(this.N,this.Ht),this.Je=new dc,this.window&&this.window.localStorage?this.Ye=this.window.localStorage:(this.Ye=null,!1===u&&Us("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.Xe().then((()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new zs(Hs.FAILED_PRECONDITION,Wc);return this.Ze(),this.tn(),this.en(),this.runTransaction("getHighestListenSequenceNumber","readonly",(t=>this.ze.getHighestSequenceNumber(t)))})).then((t=>{this.Le=new er(t,this.Fe)})).then((()=>{this.Be=!0})).catch((t=>(this.Ge&&this.Ge.close(),Promise.reject(t))))}nn(t){return this.Qe=async e=>{if(this.started)return t(e)},t(this.isPrimary)}setDatabaseDeletedListener(t){this.Ge.xt((async e=>{null===e.newVersion&&await t()}))}setNetworkEnabled(t){this.networkEnabled!==t&&(this.networkEnabled=t,this.Oe.enqueueAndForget((async()=>{this.started&&await this.Xe()})))}Xe(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(t=>Jc(t).put(new Oa(this.clientId,Date.now(),this.networkEnabled,this.inForeground)).next((()=>{if(this.isPrimary)return this.sn(t).next((t=>{t||(this.isPrimary=!1,this.Oe.enqueueRetryable((()=>this.Qe(!1))))}))})).next((()=>this.rn(t))).next((e=>this.isPrimary&&!e?this.on(t).next((()=>!1)):!!e&&this.cn(t).next((()=>!0)))))).catch((t=>{if(Ga(t))return Vs("IndexedDbPersistence","Failed to extend owner lease: ",t),this.isPrimary;if(!this.allowTabSynchronization)throw t;return Vs("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1})).then((t=>{this.isPrimary!==t&&this.Oe.enqueueRetryable((()=>this.Qe(t))),this.isPrimary=t}))}sn(t){return Xc(t).get(Ta.key).next((t=>qa.resolve(this.an(t))))}un(t){return Jc(t).delete(this.clientId)}async hn(){if(this.isPrimary&&!this.ln(this.je,18e5)){this.je=Date.now();const t=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(t=>{const e=Xa(t,Oa.store);return e.Lt().next((t=>{const n=this.fn(t,18e5),s=t.filter((t=>-1===n.indexOf(t)));return qa.forEach(s,(t=>e.delete(t.clientId))).next((()=>s))}))})).catch((()=>[]));if(this.Ye)for(const e of t)this.Ye.removeItem(this.dn(e.clientId))}}en(){this.Ke=this.Oe.enqueueAfterDelay("client_metadata_refresh",4e3,(()=>this.Xe().then((()=>this.hn())).then((()=>this.en()))))}an(t){return!!t&&t.ownerId===this.clientId}rn(t){return this.Me?qa.resolve(!0):Xc(t).get(Ta.key).next((e=>{if(null!==e&&this.ln(e.leaseTimestampMs,5e3)&&!this.wn(e.ownerId)){if(this.an(e)&&this.networkEnabled)return!0;if(!this.an(e)){if(!e.allowTabSynchronization)throw new zs(Hs.FAILED_PRECONDITION,Wc);return!1}}return!(!this.networkEnabled||!this.inForeground)||Jc(t).Lt().next((t=>void 0===this.fn(t,5e3).find((t=>{if(this.clientId!==t.clientId){const e=!this.networkEnabled&&t.networkEnabled,n=!this.inForeground&&t.inForeground,s=this.networkEnabled===t.networkEnabled;if(e||n&&s)return!0}return!1}))))})).next((t=>(this.isPrimary!==t&&Vs("IndexedDbPersistence",`Client ${t?"is":"is not"} eligible for a primary lease.`),t)))}async shutdown(){this.Be=!1,this._n(),this.Ke&&(this.Ke.cancel(),this.Ke=null),this.mn(),this.gn(),await this.Ge.runTransaction("shutdown","readwrite",[Ta.store,Oa.store],(t=>{const e=new Ya(t,er.T);return this.on(e).next((()=>this.un(e)))})),this.Ge.close(),this.yn()}fn(t,e){return t.filter((t=>this.ln(t.updateTimeMs,e)&&!this.wn(t.clientId)))}pn(){return this.runTransaction("getActiveClients","readonly",(t=>Jc(t).Lt().next((t=>this.fn(t,18e5).map((t=>t.clientId))))))}get started(){return this.Be}getMutationQueue(t){return Ic.Yt(t,this.N,this.Ht,this.referenceDelegate)}getTargetCache(){return this.ze}getRemoteDocumentCache(){return this.He}getIndexManager(){return this.Ht}getBundleCache(){return this.Je}runTransaction(t,e,n){Vs("IndexedDbPersistence","Starting transaction:",t);const s="readonly"===e?"readonly":"readwrite";let r;return this.Ge.runTransaction(t,s,Pa,(s=>(r=new Ya(s,this.Le?this.Le.next():er.T),"readwrite-primary"===e?this.sn(r).next((t=>!!t||this.rn(r))).next((e=>{if(!e)throw Us(`Failed to obtain primary lease for action '${t}'.`),this.isPrimary=!1,this.Oe.enqueueRetryable((()=>this.Qe(!1))),new zs(Hs.FAILED_PRECONDITION,Va);return n(r)})).next((t=>this.cn(r).next((()=>t)))):this.Tn(r).next((()=>n(r)))))).then((t=>(r.raiseOnCommittedEvent(),t)))}Tn(t){return Xc(t).get(Ta.key).next((t=>{if(null!==t&&this.ln(t.leaseTimestampMs,5e3)&&!this.wn(t.ownerId)&&!this.an(t)&&!(this.Me||this.allowTabSynchronization&&t.allowTabSynchronization))throw new zs(Hs.FAILED_PRECONDITION,Wc)}))}cn(t){const e=new Ta(this.clientId,this.allowTabSynchronization,Date.now());return Xc(t).put(Ta.key,e)}static bt(){return ja.bt()}on(t){const e=Xc(t);return e.get(Ta.key).next((t=>this.an(t)?(Vs("IndexedDbPersistence","Releasing primary lease."),e.delete(Ta.key)):qa.resolve()))}ln(t,e){const n=Date.now();return!(tn&&(Us(`Detected an update time that is in the future: ${t} > ${n}`),1))}Ze(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.qe=()=>{this.Oe.enqueueAndForget((()=>(this.inForeground="visible"===this.document.visibilityState,this.Xe())))},this.document.addEventListener("visibilitychange",this.qe),this.inForeground="visible"===this.document.visibilityState)}mn(){this.qe&&(this.document.removeEventListener("visibilitychange",this.qe),this.qe=null)}tn(){var t;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.Ue=()=>{this._n(),l()&&navigator.appVersion.match("Version/14")&&this.Oe.enterRestrictedMode(!0),this.Oe.enqueueAndForget((()=>this.shutdown()))},this.window.addEventListener("pagehide",this.Ue))}gn(){this.Ue&&(this.window.removeEventListener("pagehide",this.Ue),this.Ue=null)}wn(t){var e;try{const n=null!==(null===(e=this.Ye)||void 0===e?void 0:e.getItem(this.dn(t)));return Vs("IndexedDbPersistence",`Client '${t}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(t){return Us("IndexedDbPersistence","Failed to get zombied client id.",t),!1}}_n(){if(this.Ye)try{this.Ye.setItem(this.dn(this.clientId),String(Date.now()))}catch(t){Us("Failed to set zombie client id.",t)}}yn(){if(this.Ye)try{this.Ye.removeItem(this.dn(this.clientId))}catch(t){}}dn(t){return`firestore_zombie_${this.persistenceKey}_${t}`}}function Xc(t){return Xa(t,Ta.store)}function Jc(t){return Xa(t,Oa.store)}function Zc(t,e){let n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/" +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class tu{constructor(t,e){this.progress=t,this.En=e}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class eu{constructor(t,e,n){this.He=t,this.In=e,this.Ht=n}An(t,e){return this.In.getAllMutationBatchesAffectingDocumentKey(t,e).next((n=>this.Rn(t,e,n)))}Rn(t,e,n){return this.He.getEntry(t,e).next((t=>{for(const e of n)e.applyToLocalView(t);return t}))}bn(t,e){t.forEach(((t,n)=>{for(const t of e)t.applyToLocalView(n)}))}Pn(t,e){return this.He.getEntries(t,e).next((e=>this.vn(t,e).next((()=>e))))}vn(t,e){return this.In.getAllMutationBatchesAffectingDocumentKeys(t,e).next((t=>this.bn(e,t)))}getDocumentsMatchingQuery(t,e,n){return function(t){return xr.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Vn(t,e.path):bi(e)?this.Sn(t,e,n):this.Dn(t,e,n)}Vn(t,e){return this.An(t,new xr(e)).next((t=>{let e=To();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e}))}Sn(t,e,n){const s=e.collectionGroup;let r=To();return this.Ht.getCollectionParents(t,s).next((i=>qa.forEach(i,(i=>{const o=function(t,e){return new fi(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,i.child(s));return this.Dn(t,o,n).next((t=>{t.forEach(((t,e)=>{r=r.insert(t,e)}))}))})).next((()=>r))))}Dn(t,e,n){let s,r;return this.He.getDocumentsMatchingQuery(t,e,n).next((n=>(s=n,this.In.getAllMutationBatchesAffectingQuery(t,e)))).next((e=>(r=e,this.Cn(t,r,s).next((t=>{s=t;for(const t of r)for(const e of t.mutations){const n=e.key;let r=s.get(n);null==r&&(r=Hr.newInvalidDocument(n),s=s.insert(n,r)),Xi(e,r,t.localWriteTime),r.isFoundDocument()||(s=s.remove(n))}}))))).next((()=>(s.forEach(((t,n)=>{Ai(e,n)||(s=s.remove(t))})),s)))}Cn(t,e,n){let s=No();for(const t of e)for(const e of t.mutations)e instanceof no&&null===n.get(e.key)&&(s=s.add(e.key));let r=n;return this.He.getEntries(t,s).next((t=>(t.forEach(((t,e)=>{e.isFoundDocument()&&(r=r.insert(t,e))})),r)))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class nu{constructor(t,e,n,s){this.targetId=t,this.fromCache=e,this.Nn=n,this.xn=s}static kn(t,e){let n=No(),s=No();for(const t of e.docChanges)switch(t.type){case 0:n=n.add(t.doc.key);break;case 1:s=s.add(t.doc.key)}return new nu(t,e.fromCache,n,s)}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class su{$n(t){this.On=t}getDocumentsMatchingQuery(t,e,n,s){return function(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}(e)||n.isEqual(cr.min())?this.Fn(t,e):this.On.Pn(t,s).next((r=>{const i=this.Mn(e,r);return(pi(e)||yi(e))&&this.Ln(e.limitType,i,s,n)?this.Fn(t,e):(Fs()<=p.DEBUG&&Vs("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),Ni(e)),this.On.getDocumentsMatchingQuery(t,e,n).next((t=>(i.forEach((e=>{t=t.insert(e.key,e)})),t))))}))}Mn(t,e){let n=new yo(Di(t));return e.forEach(((e,s)=>{Ai(t,s)&&(n=n.add(s))})),n}Ln(t,e,n,s){if(n.size!==e.size)return!0;const r="F"===t?e.last():e.first();return!!r&&(r.hasPendingWrites||r.version.compareTo(s)>0)}Fn(t,e){return Fs()<=p.DEBUG&&Vs("QueryEngine","Using full collection scan to execute query:",Ni(e)),this.On.getDocumentsMatchingQuery(t,e,cr.min())}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ru{constructor(t,e,n,s){this.persistence=t,this.Bn=e,this.N=s,this.Un=new go(rr),this.qn=new qc((t=>Wr(t)),Yr),this.Kn=cr.min(),this.In=t.getMutationQueue(n),this.jn=t.getRemoteDocumentCache(),this.ze=t.getTargetCache(),this.Qn=new eu(this.jn,this.In,this.persistence.getIndexManager()),this.Je=t.getBundleCache(),this.Bn.$n(this.Qn)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(e=>t.collect(e,this.Un)))}}function iu(t,e,n,s){return new ru(t,e,n,s)}async function ou(t,e){const n=Gs(t);let s=n.In,r=n.Qn;const i=await n.persistence.runTransaction("Handle user change","readonly",(t=>{let i;return n.In.getAllMutationBatches(t).next((o=>(i=o,s=n.persistence.getMutationQueue(e),r=new eu(n.jn,s,n.persistence.getIndexManager()),s.getAllMutationBatches(t)))).next((e=>{const n=[],s=[];let o=No();for(const t of i){n.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}for(const t of e){s.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}return r.Pn(t,o).next((t=>({Wn:t,removedBatchIds:n,addedBatchIds:s})))}))}));return n.In=s,n.Qn=r,n.Bn.$n(n.Qn),i}function au(t){const e=Gs(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(t=>e.ze.getLastRemoteSnapshotVersion(t)))}function cu(t,e,n,s,r){let i=No();return n.forEach((t=>i=i.add(t))),e.getEntries(t,i).next((t=>{let i=bo();return n.forEach(((n,o)=>{const a=t.get(n),c=(null==r?void 0:r.get(n))||s;o.isNoDocument()&&o.version.isEqual(cr.min())?(e.removeEntry(n,c),i=i.insert(n,o)):!a.isValidDocument()||o.version.compareTo(a.version)>0||0===o.version.compareTo(a.version)&&a.hasPendingWrites?(e.addEntry(o,c),i=i.insert(n,o)):Vs("LocalStore","Ignoring outdated watch update for ",n,". Current version:",a.version," Watch version:",o.version)})),i}))}function uu(t,e){const n=Gs(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(t=>(void 0===e&&(e=-1),n.In.getNextMutationBatchAfterBatchId(t,e))))}function hu(t,e){const n=Gs(t);return n.persistence.runTransaction("Allocate target","readwrite",(t=>{let s;return n.ze.getTargetData(t,e).next((r=>r?(s=r,qa.resolve(s)):n.ze.allocateTargetId(t).next((r=>(s=new tc(e,r,0,t.currentSequenceNumber),n.ze.addTargetData(t,s).next((()=>s)))))))})).then((t=>{const s=n.Un.get(t.targetId);return(null===s||t.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(n.Un=n.Un.insert(t.targetId,t),n.qn.set(e,t.targetId)),t}))}async function lu(t,e,n){const s=Gs(t),r=s.Un.get(e),i=n?"readwrite":"readwrite-primary";try{n||await s.persistence.runTransaction("Release target",i,(t=>s.persistence.referenceDelegate.removeTarget(t,r)))}catch(t){if(!Ga(t))throw t;Vs("LocalStore",`Failed to update sequence numbers for target ${e}: ${t}`)}s.Un=s.Un.remove(e),s.qn.delete(r.target)}function du(t,e,n){const s=Gs(t);let r=cr.min(),i=No();return s.persistence.runTransaction("Execute query","readonly",(t=>function(t,e,n){const s=Gs(t),r=s.qn.get(n);return void 0!==r?qa.resolve(s.Un.get(r)):s.ze.getTargetData(e,n)}(s,t,Ti(e)).next((e=>{if(e)return r=e.lastLimboFreeSnapshotVersion,s.ze.getMatchingKeysForTargetId(t,e.targetId).next((t=>{i=t}))})).next((()=>s.Bn.getDocumentsMatchingQuery(t,e,n?r:cr.min(),n?i:No()))).next((t=>({documents:t,Gn:i})))))}function fu(t,e){const n=Gs(t),s=Gs(n.ze),r=n.Un.get(e);return r?Promise.resolve(r.target):n.persistence.runTransaction("Get target data","readonly",(t=>s.Tt(t,e).next((t=>t?t.target:null))))}function gu(t){const e=Gs(t);return e.persistence.runTransaction("Get new document changes","readonly",(t=>function(t,e,n){const s=Gs(t);let r=bo(),i=rc(n);const o=Gc(e),a=IDBKeyRange.lowerBound(i,!0);return o.Kt({index:Da.readTimeIndex,range:a},((t,e)=>{const n=nc(s.N,e);r=r.insert(n.key,n),i=e.readTime})).next((()=>({En:r,readTime:ic(i)})))}(e.jn,t,e.Kn))).then((({En:t,readTime:n})=>(e.Kn=n,t)))}async function mu(t,e,n=No()){const s=await hu(t,Ti(lc(e.bundledQuery))),r=Gs(t);return r.persistence.runTransaction("Save named query","readwrite",(t=>{const i=$o(e.readTime);if(s.snapshotVersion.compareTo(i)>=0)return r.Je.saveNamedQuery(t,e);const o=s.withResumeToken(wr.EMPTY_BYTE_STRING,i);return r.Un=r.Un.insert(o.targetId,o),r.ze.updateTargetData(t,o).next((()=>r.ze.removeMatchingKeysForTargetId(t,s.targetId))).next((()=>r.ze.addMatchingKeys(t,n,s.targetId))).next((()=>r.Je.saveNamedQuery(t,e)))}))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class pu{constructor(t){this.N=t,this.Yn=new Map,this.Xn=new Map}getBundleMetadata(t,e){return qa.resolve(this.Yn.get(e))}saveBundleMetadata(t,e){var n;return this.Yn.set(e.id,{id:(n=e).id,version:n.version,createTime:$o(n.createTime)}),qa.resolve()}getNamedQuery(t,e){return qa.resolve(this.Xn.get(e))}saveNamedQuery(t,e){return this.Xn.set(e.name,function(t){return{name:t.name,query:lc(t.bundledQuery),readTime:$o(t.readTime)}}(e)),qa.resolve()}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class yu{constructor(){this.Zn=new yo(wu.ts),this.es=new yo(wu.ns)}isEmpty(){return this.Zn.isEmpty()}addReference(t,e){const n=new wu(t,e);this.Zn=this.Zn.add(n),this.es=this.es.add(n)}ss(t,e){t.forEach((t=>this.addReference(t,e)))}removeReference(t,e){this.rs(new wu(t,e))}os(t,e){t.forEach((t=>this.removeReference(t,e)))}cs(t){const e=new xr(new fr([])),n=new wu(e,t),s=new wu(e,t+1),r=[];return this.es.forEachInRange([n,s],(t=>{this.rs(t),r.push(t.key)})),r}us(){this.Zn.forEach((t=>this.rs(t)))}rs(t){this.Zn=this.Zn.delete(t),this.es=this.es.delete(t)}hs(t){const e=new xr(new fr([])),n=new wu(e,t),s=new wu(e,t+1);let r=No();return this.es.forEachInRange([n,s],(t=>{r=r.add(t.key)})),r}containsKey(t){const e=new wu(t,0),n=this.Zn.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)}}class wu{constructor(t,e){this.key=t,this.ls=e}static ts(t,e){return xr.comparator(t.key,e.key)||rr(t.ls,e.ls)}static ns(t,e){return rr(t.ls,e.ls)||xr.comparator(t.key,e.key)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class vu{constructor(t,e){this.Ht=t,this.referenceDelegate=e,this.In=[],this.fs=1,this.ds=new yo(wu.ts)}checkEmpty(t){return qa.resolve(0===this.In.length)}addMutationBatch(t,e,n,s){const r=this.fs;this.fs++,this.In.length>0&&this.In[this.In.length-1];const i=new Ja(r,e,n,s);this.In.push(i);for(const e of s)this.ds=this.ds.add(new wu(e.key,r)),this.Ht.addToCollectionParentIndex(t,e.key.path.popLast());return qa.resolve(i)}lookupMutationBatch(t,e){return qa.resolve(this.ws(e))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,s=this._s(n),r=s<0?0:s;return qa.resolve(this.In.length>r?this.In[r]:null)}getHighestUnacknowledgedBatchId(){return qa.resolve(0===this.In.length?-1:this.fs-1)}getAllMutationBatches(t){return qa.resolve(this.In.slice())}getAllMutationBatchesAffectingDocumentKey(t,e){const n=new wu(e,0),s=new wu(e,Number.POSITIVE_INFINITY),r=[];return this.ds.forEachInRange([n,s],(t=>{const e=this.ws(t.ls);r.push(e)})),qa.resolve(r)}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new yo(rr);return e.forEach((t=>{const e=new wu(t,0),s=new wu(t,Number.POSITIVE_INFINITY);this.ds.forEachInRange([e,s],(t=>{n=n.add(t.ls)}))})),qa.resolve(this.gs(n))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,s=n.length+1;let r=n;xr.isDocumentKey(r)||(r=r.child(""));const i=new wu(new xr(r),0);let o=new yo(rr);return this.ds.forEachWhile((t=>{const e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===s&&(o=o.add(t.ls)),!0)}),i),qa.resolve(this.gs(o))}gs(t){const e=[];return t.forEach((t=>{const n=this.ws(t);null!==n&&e.push(n)})),e}removeMutationBatch(t,e){Ks(0===this.ys(e.batchId,"removed")),this.In.shift();let n=this.ds;return qa.forEach(e.mutations,(s=>{const r=new wu(s.key,e.batchId);return n=n.delete(r),this.referenceDelegate.markPotentiallyOrphaned(t,s.key)})).next((()=>{this.ds=n}))}te(t){}containsKey(t,e){const n=new wu(e,0),s=this.ds.firstAfterOrEqual(n);return qa.resolve(e.isEqual(s&&s.key))}performConsistencyCheck(t){return this.In.length,qa.resolve()}ys(t,e){return this._s(t)}_s(t){return 0===this.In.length?0:t-this.In[0].batchId}ws(t){const e=this._s(t);return e<0||e>=this.In.length?null:this.In[e]}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class bu{constructor(t,e){this.Ht=t,this.ps=e,this.docs=new go(xr.comparator),this.size=0}addEntry(t,e,n){const s=e.key,r=this.docs.get(s),i=r?r.size:0,o=this.ps(e);return this.docs=this.docs.insert(s,{document:e.clone(),size:o,readTime:n}),this.size+=o-i,this.Ht.addToCollectionParentIndex(t,s.path.popLast())}removeEntry(t){const e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)}getEntry(t,e){const n=this.docs.get(e);return qa.resolve(n?n.document.clone():Hr.newInvalidDocument(e))}getEntries(t,e){let n=bo();return e.forEach((t=>{const e=this.docs.get(t);n=n.insert(t,e?e.document.clone():Hr.newInvalidDocument(t))})),qa.resolve(n)}getDocumentsMatchingQuery(t,e,n){let s=bo();const r=new xr(e.path.child("")),i=this.docs.getIteratorFrom(r);for(;i.hasNext();){const{key:t,value:{document:r,readTime:o}}=i.getNext();if(!e.path.isPrefixOf(t.path))break;o.compareTo(n)<=0||Ai(e,r)&&(s=s.insert(r.key,r.clone()))}return qa.resolve(s)}Ts(t,e){return qa.forEach(this.docs,(t=>e(t)))}newChangeBuffer(t){return new Eu(this)}getSize(t){return qa.resolve(this.size)}}class Eu extends Bc{constructor(t){super(),this.Se=t}applyChanges(t){const e=[];return this.changes.forEach(((n,s)=>{s.document.isValidDocument()?e.push(this.Se.addEntry(t,s.document,this.getReadTime(n))):this.Se.removeEntry(n)})),qa.waitFor(e)}getFromCache(t,e){return this.Se.getEntry(t,e)}getAllFromCache(t,e){return this.Se.getEntries(t,e)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Tu{constructor(t){this.persistence=t,this.Es=new qc((t=>Wr(t)),Yr),this.lastRemoteSnapshotVersion=cr.min(),this.highestTargetId=0,this.Is=0,this.As=new yu,this.targetCount=0,this.Rs=Dc.se()}forEachTarget(t,e){return this.Es.forEach(((t,n)=>e(n))),qa.resolve()}getLastRemoteSnapshotVersion(t){return qa.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(t){return qa.resolve(this.Is)}allocateTargetId(t){return this.highestTargetId=this.Rs.next(),qa.resolve(this.highestTargetId)}setTargetsMetadata(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.Is&&(this.Is=e),qa.resolve()}ce(t){this.Es.set(t.target,t);const e=t.targetId;e>this.highestTargetId&&(this.Rs=new Dc(e),this.highestTargetId=e),t.sequenceNumber>this.Is&&(this.Is=t.sequenceNumber)}addTargetData(t,e){return this.ce(e),this.targetCount+=1,qa.resolve()}updateTargetData(t,e){return this.ce(e),qa.resolve()}removeTargetData(t,e){return this.Es.delete(e.target),this.As.cs(e.targetId),this.targetCount-=1,qa.resolve()}removeTargets(t,e,n){let s=0;const r=[];return this.Es.forEach(((i,o)=>{o.sequenceNumber<=e&&null===n.get(o.targetId)&&(this.Es.delete(i),r.push(this.removeMatchingKeysForTargetId(t,o.targetId)),s++)})),qa.waitFor(r).next((()=>s))}getTargetCount(t){return qa.resolve(this.targetCount)}getTargetData(t,e){const n=this.Es.get(e)||null;return qa.resolve(n)}addMatchingKeys(t,e,n){return this.As.ss(e,n),qa.resolve()}removeMatchingKeys(t,e,n){this.As.os(e,n);const s=this.persistence.referenceDelegate,r=[];return s&&e.forEach((e=>{r.push(s.markPotentiallyOrphaned(t,e))})),qa.waitFor(r)}removeMatchingKeysForTargetId(t,e){return this.As.cs(e),qa.resolve()}getMatchingKeysForTargetId(t,e){const n=this.As.hs(e);return qa.resolve(n)}containsKey(t,e){return qa.resolve(this.As.containsKey(e))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Iu{constructor(t,e){this.bs={},this.Le=new er(0),this.Be=!1,this.Be=!0,this.referenceDelegate=t(this),this.ze=new Tu(this),this.Ht=new mc,this.He=function(t,e){return new bu(t,e)}(this.Ht,(t=>this.referenceDelegate.Ps(t))),this.N=new ec(e),this.Je=new pu(this.N)}start(){return Promise.resolve()}shutdown(){return this.Be=!1,Promise.resolve()}get started(){return this.Be}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(){return this.Ht}getMutationQueue(t){let e=this.bs[t.toKey()];return e||(e=new vu(this.Ht,this.referenceDelegate),this.bs[t.toKey()]=e),e}getTargetCache(){return this.ze}getRemoteDocumentCache(){return this.He}getBundleCache(){return this.Je}runTransaction(t,e,n){Vs("MemoryPersistence","Starting transaction:",t);const s=new Su(this.Le.next());return this.referenceDelegate.vs(),n(s).next((t=>this.referenceDelegate.Vs(s).next((()=>t)))).toPromise().then((t=>(s.raiseOnCommittedEvent(),t)))}Ss(t,e){return qa.or(Object.values(this.bs).map((n=>()=>n.containsKey(t,e))))}}class Su extends Ua{constructor(t){super(),this.currentSequenceNumber=t}}class _u{constructor(t){this.persistence=t,this.Ds=new yu,this.Cs=null}static Ns(t){return new _u(t)}get xs(){if(this.Cs)return this.Cs;throw js()}addReference(t,e,n){return this.Ds.addReference(n,e),this.xs.delete(n.toString()),qa.resolve()}removeReference(t,e,n){return this.Ds.removeReference(n,e),this.xs.add(n.toString()),qa.resolve()}markPotentiallyOrphaned(t,e){return this.xs.add(e.toString()),qa.resolve()}removeTarget(t,e){this.Ds.cs(e.targetId).forEach((t=>this.xs.add(t.toString())));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(t,e.targetId).next((t=>{t.forEach((t=>this.xs.add(t.toString())))})).next((()=>n.removeTargetData(t,e)))}vs(){this.Cs=new Set}Vs(t){const e=this.persistence.getRemoteDocumentCache().newChangeBuffer();return qa.forEach(this.xs,(n=>{const s=xr.fromPath(n);return this.ks(t,s).next((t=>{t||e.removeEntry(s)}))})).next((()=>(this.Cs=null,e.apply(t))))}updateLimboDocument(t,e){return this.ks(t,e).next((t=>{t?this.xs.delete(e.toString()):this.xs.add(e.toString())}))}Ps(t){return 0}ks(t,e){return qa.or([()=>qa.resolve(this.Ds.containsKey(e)),()=>this.persistence.getTargetCache().containsKey(t,e),()=>this.persistence.Ss(t,e)])}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Nu(t,e){return`firestore_clients_${t}_${e}`}function Au(t,e,n){let s=`firestore_mutations_${t}_${n}`;return e.isAuthenticated()&&(s+=`_${e.uid}`),s}function Du(t,e){return`firestore_targets_${t}_${e}`}class xu{constructor(t,e,n,s){this.user=t,this.batchId=e,this.state=n,this.error=s}static $s(t,e,n){const s=JSON.parse(n);let r,i="object"==typeof s&&-1!==["pending","acknowledged","rejected"].indexOf(s.state)&&(void 0===s.error||"object"==typeof s.error);return i&&s.error&&(i="string"==typeof s.error.message&&"string"==typeof s.error.code,i&&(r=new zs(s.error.code,s.error.message))),i?new xu(t,e,s.state,r):(Us("SharedClientState",`Failed to parse mutation state for ID '${e}': ${n}`),null)}Os(){const t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)}}class Cu{constructor(t,e,n){this.targetId=t,this.state=e,this.error=n}static $s(t,e){const n=JSON.parse(e);let s,r="object"==typeof n&&-1!==["not-current","current","rejected"].indexOf(n.state)&&(void 0===n.error||"object"==typeof n.error);return r&&n.error&&(r="string"==typeof n.error.message&&"string"==typeof n.error.code,r&&(s=new zs(n.error.code,n.error.message))),r?new Cu(t,n.state,s):(Us("SharedClientState",`Failed to parse target state for ID '${t}': ${e}`),null)}Os(){const t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)}}class ku{constructor(t,e){this.clientId=t,this.activeTargetIds=e}static $s(t,e){const n=JSON.parse(e);let s="object"==typeof n&&n.activeTargetIds instanceof Array,r=Do();for(let t=0;s&&tthis.shutdown())),this.started=!0}writeSequenceNumber(t){this.setItem(this.Qs,JSON.stringify(t))}getAllActiveQueryTargets(){return this.ti(this.qs)}isActiveQueryTarget(t){let e=!1;return this.qs.forEach(((n,s)=>{s.activeTargetIds.has(t)&&(e=!0)})),e}addPendingMutation(t){this.ei(t,"pending")}updateMutationState(t,e,n){this.ei(t,e,n),this.ni(t)}addLocalQueryTarget(t){let e="not-current";if(this.isActiveQueryTarget(t)){const n=this.storage.getItem(Du(this.persistenceKey,t));if(n){const s=Cu.$s(t,n);s&&(e=s.state)}}return this.si.Fs(t),this.Ys(),e}removeLocalQueryTarget(t){this.si.Ms(t),this.Ys()}isLocalQueryTarget(t){return this.si.activeTargetIds.has(t)}clearQueryState(t){this.removeItem(Du(this.persistenceKey,t))}updateQueryState(t,e,n){this.ii(t,e,n)}handleUserChange(t,e,n){e.forEach((t=>{this.ni(t)})),this.currentUser=t,n.forEach((t=>{this.addPendingMutation(t)}))}setOnlineState(t){this.ri(t)}notifyBundleLoaded(){this.oi()}shutdown(){this.started&&(this.window.removeEventListener("storage",this.Bs),this.removeItem(this.js),this.started=!1)}getItem(t){const e=this.storage.getItem(t);return Vs("SharedClientState","READ",t,e),e}setItem(t,e){Vs("SharedClientState","SET",t,e),this.storage.setItem(t,e)}removeItem(t){Vs("SharedClientState","REMOVE",t),this.storage.removeItem(t)}Us(t){const e=t;if(e.storageArea===this.storage){if(Vs("SharedClientState","EVENT",e.key,e.newValue),e.key===this.js)return void Us("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Oe.enqueueRetryable((async()=>{if(this.started){if(null!==e.key)if(this.Ws.test(e.key)){if(null==e.newValue){const t=this.ci(e.key);return this.ai(t,null)}{const t=this.ui(e.key,e.newValue);if(t)return this.ai(t.clientId,t)}}else if(this.Gs.test(e.key)){if(null!==e.newValue){const t=this.hi(e.key,e.newValue);if(t)return this.li(t)}}else if(this.zs.test(e.key)){if(null!==e.newValue){const t=this.fi(e.key,e.newValue);if(t)return this.di(t)}}else if(e.key===this.Hs){if(null!==e.newValue){const t=this.Xs(e.newValue);if(t)return this.Zs(t)}}else if(e.key===this.Qs){const t=function(t){let e=er.T;if(null!=t)try{const n=JSON.parse(t);Ks("number"==typeof n),e=n}catch(t){Us("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(e.newValue);t!==er.T&&this.sequenceNumberHandler(t)}else if(e.key===this.Js)return this.syncEngine.wi()}else this.Ks.push(e)}))}}get si(){return this.qs.get(this.Ls)}Ys(){this.setItem(this.js,this.si.Os())}ei(t,e,n){const s=new xu(this.currentUser,t,e,n),r=Au(this.persistenceKey,this.currentUser,t);this.setItem(r,s.Os())}ni(t){const e=Au(this.persistenceKey,this.currentUser,t);this.removeItem(e)}ri(t){const e={clientId:this.Ls,onlineState:t};this.storage.setItem(this.Hs,JSON.stringify(e))}ii(t,e,n){const s=Du(this.persistenceKey,t),r=new Cu(t,e,n);this.setItem(s,r.Os())}oi(){this.setItem(this.Js,"value-not-used")}ci(t){const e=this.Ws.exec(t);return e?e[1]:null}ui(t,e){const n=this.ci(t);return ku.$s(n,e)}hi(t,e){const n=this.Gs.exec(t),s=Number(n[1]),r=void 0!==n[2]?n[2]:null;return xu.$s(new Ls(r),s,e)}fi(t,e){const n=this.zs.exec(t),s=Number(n[1]);return Cu.$s(s,e)}Xs(t){return Ru.$s(t)}async li(t){if(t.user.uid===this.currentUser.uid)return this.syncEngine._i(t.batchId,t.state,t.error);Vs("SharedClientState",`Ignoring mutation for non-active user ${t.user.uid}`)}di(t){return this.syncEngine.mi(t.targetId,t.state,t.error)}ai(t,e){const n=e?this.qs.insert(t,e):this.qs.remove(t),s=this.ti(this.qs),r=this.ti(n),i=[],o=[];return r.forEach((t=>{s.has(t)||i.push(t)})),s.forEach((t=>{r.has(t)||o.push(t)})),this.syncEngine.gi(i,o).then((()=>{this.qs=n}))}Zs(t){this.qs.get(t.clientId)&&this.onlineStateHandler(t.onlineState)}ti(t){let e=Do();return t.forEach(((t,n)=>{e=e.unionWith(n.activeTargetIds)})),e}}class Mu{constructor(){this.yi=new Lu,this.pi={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,e,n){}addLocalQueryTarget(t){return this.yi.Fs(t),this.pi[t]||"not-current"}updateQueryState(t,e,n){this.pi[t]=e}removeLocalQueryTarget(t){this.yi.Ms(t)}isLocalQueryTarget(t){return this.yi.activeTargetIds.has(t)}clearQueryState(t){delete this.pi[t]}getAllActiveQueryTargets(){return this.yi.activeTargetIds}isActiveQueryTarget(t){return this.yi.activeTargetIds.has(t)}start(){return this.yi=new Lu,Promise.resolve()}handleUserChange(t,e,n){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Fu{Ti(t){}shutdown(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Pu{constructor(){this.Ei=()=>this.Ii(),this.Ai=()=>this.Ri(),this.bi=[],this.Pi()}Ti(t){this.bi.push(t)}shutdown(){window.removeEventListener("online",this.Ei),window.removeEventListener("offline",this.Ai)}Pi(){window.addEventListener("online",this.Ei),window.addEventListener("offline",this.Ai)}Ii(){Vs("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const t of this.bi)t(0)}Ri(){Vs("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const t of this.bi)t(1)}static bt(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Vu={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Uu{constructor(t){this.vi=t.vi,this.Vi=t.Vi}Si(t){this.Di=t}Ci(t){this.Ni=t}onMessage(t){this.xi=t}close(){this.Vi()}send(t){this.vi(t)}ki(){this.Di()}$i(t){this.Ni(t)}Oi(t){this.xi(t)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qu extends class{constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const e=t.ssl?"https":"http";this.Fi=e+"://"+t.host,this.Mi="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}Li(t,e,n,s){const r=this.Bi(t,e);Vs("RestConnection","Sending: ",r,n);const i={};return this.Ui(i,s),this.qi(t,r,i,n).then((t=>(Vs("RestConnection","Received: ",t),t)),(e=>{throw qs("RestConnection",`${t} failed with error: `,e,"url: ",r,"request:",n),e}))}Ki(t,e,n,s){return this.Li(t,e,n,s)}Ui(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/"+Os,t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e)for(const n in e.authHeaders)e.authHeaders.hasOwnProperty(n)&&(t[n]=e.authHeaders[n])}Bi(t,e){const n=Vu[t];return`${this.Fi}/v1/${e}:${n}`}}{constructor(t){super(t),this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams}qi(t,e,n,s){return new Promise(((r,i)=>{const o=new ks;o.listenOnce(_s.COMPLETE,(()=>{try{switch(o.getLastErrorCode()){case Ss.NO_ERROR:const e=o.getResponseJson();Vs("Connection","XHR received:",JSON.stringify(e)),r(e);break;case Ss.TIMEOUT:Vs("Connection",'RPC "'+t+'" timed out'),i(new zs(Hs.DEADLINE_EXCEEDED,"Request time out"));break;case Ss.HTTP_ERROR:const n=o.getStatus();if(Vs("Connection",'RPC "'+t+'" failed with status:',n,"response text:",o.getResponseText()),n>0){const t=o.getResponseJson().error;if(t&&t.status&&t.message){const e=function(t){const e=t.toLowerCase().replace(/_/g,"-");return Object.values(Hs).indexOf(e)>=0?e:Hs.UNKNOWN}(t.status);i(new zs(e,t.message))}else i(new zs(Hs.UNKNOWN,"Server responded with status "+o.getStatus()))}else i(new zs(Hs.UNAVAILABLE,"Connection failed."));break;default:js()}}finally{Vs("Connection",'RPC "'+t+'" completed.')}}));const a=JSON.stringify(s);o.send(e,"POST",a,n,15)}))}ji(t,e){const n=[this.Fi,"/","google.firestore.v1.Firestore","/",t,"/channel"],s=new vs,r=de(),i={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(i.xmlHttpFactory=new xs({})),this.Ui(i.initMessageHeaders,e),"undefined"!=typeof window&&(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(h())||"object"==typeof navigator&&"ReactNative"===navigator.product||h().indexOf("Electron/")>=0||function(){const t=h();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}()||h().indexOf("MSAppHost/")>=0||function(){const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}()||(i.httpHeadersOverwriteParam="$httpHeaders");const o=n.join("");Vs("Connection","Creating WebChannel: "+o,i);const a=s.createWebChannel(o,i);let c=!1,u=!1;const l=new Uu({vi:t=>{u?Vs("Connection","Not sending because WebChannel is closed:",t):(c||(Vs("Connection","Opening WebChannel transport."),a.open(),c=!0),Vs("Connection","WebChannel sending:",t),a.send(t))},Vi:()=>a.close()}),d=(t,e,n)=>{t.listen(e,(t=>{try{n(t)}catch(t){setTimeout((()=>{throw t}),0)}}))};return d(a,Cs.EventType.OPEN,(()=>{u||Vs("Connection","WebChannel transport opened.")})),d(a,Cs.EventType.CLOSE,(()=>{u||(u=!0,Vs("Connection","WebChannel transport closed"),l.$i())})),d(a,Cs.EventType.ERROR,(t=>{u||(u=!0,qs("Connection","WebChannel transport errored:",t),l.$i(new zs(Hs.UNAVAILABLE,"The operation could not be completed")))})),d(a,Cs.EventType.MESSAGE,(t=>{var e;if(!u){const n=t.data[0];Ks(!!n);const s=n,r=s.error||(null===(e=s[0])||void 0===e?void 0:e.error);if(r){Vs("Connection","WebChannel received error:",r);const t=r.status;let e=function(t){const e=uo[t];if(void 0!==e)return fo(e)}(t),n=r.message;void 0===e&&(e=Hs.INTERNAL,n="Unknown error status: "+t+" with message "+r.message),u=!0,l.$i(new zs(e,n)),a.close()}else Vs("Connection","WebChannel received:",n),l.Oi(n)}})),d(r,Ns.STAT_EVENT,(t=>{t.stat===As?Vs("Connection","Detected buffering proxy"):t.stat===Ds&&Vs("Connection","Detected no buffering proxy")})),setTimeout((()=>{l.ki()}),0),l}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Bu(){return"undefined"!=typeof window?window:null}function ju(){return"undefined"!=typeof document?document:null} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Ku(t){return new qo(t,!0)}class $u{constructor(t,e,n=1e3,s=1.5,r=6e4){this.Oe=t,this.timerId=e,this.Qi=n,this.Wi=s,this.Gi=r,this.zi=0,this.Hi=null,this.Ji=Date.now(),this.reset()}reset(){this.zi=0}Yi(){this.zi=this.Gi}Xi(t){this.cancel();const e=Math.floor(this.zi+this.Zi()),n=Math.max(0,Date.now()-this.Ji),s=Math.max(0,e-n);s>0&&Vs("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.zi} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),this.Hi=this.Oe.enqueueAfterDelay(this.timerId,s,(()=>(this.Ji=Date.now(),t()))),this.zi*=this.Wi,this.zithis.Gi&&(this.zi=this.Gi)}tr(){null!==this.Hi&&(this.Hi.skipDelay(),this.Hi=null)}cancel(){null!==this.Hi&&(this.Hi.cancel(),this.Hi=null)}Zi(){return(Math.random()-.5)*this.zi}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Gu{constructor(t,e,n,s,r,i,o){this.Oe=t,this.er=n,this.nr=s,this.sr=r,this.credentialsProvider=i,this.listener=o,this.state=0,this.ir=0,this.rr=null,this.cr=null,this.stream=null,this.ar=new $u(t,e)}ur(){return 1===this.state||5===this.state||this.hr()}hr(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.lr()}async stop(){this.ur()&&await this.close(0)}dr(){this.state=0,this.ar.reset()}wr(){this.hr()&&null===this.rr&&(this.rr=this.Oe.enqueueAfterDelay(this.er,6e4,(()=>this._r())))}mr(t){this.gr(),this.stream.send(t)}async _r(){if(this.hr())return this.close(0)}gr(){this.rr&&(this.rr.cancel(),this.rr=null)}yr(){this.cr&&(this.cr.cancel(),this.cr=null)}async close(t,e){this.gr(),this.yr(),this.ar.cancel(),this.ir++,4!==t?this.ar.reset():e&&e.code===Hs.RESOURCE_EXHAUSTED?(Us(e.toString()),Us("Using maximum backoff delay to prevent overloading the backend."),this.ar.Yi()):e&&e.code===Hs.UNAUTHENTICATED&&3!==this.state&&this.credentialsProvider.invalidateToken(),null!==this.stream&&(this.pr(),this.stream.close(),this.stream=null),this.state=t,await this.listener.Ci(e)}pr(){}auth(){this.state=1;const t=this.Tr(this.ir),e=this.ir;this.credentialsProvider.getToken().then((t=>{this.ir===e&&this.Er(t)}),(e=>{t((()=>{const t=new zs(Hs.UNKNOWN,"Fetching auth token failed: "+e.message);return this.Ir(t)}))}))}Er(t){const e=this.Tr(this.ir);this.stream=this.Ar(t),this.stream.Si((()=>{e((()=>(this.state=2,this.cr=this.Oe.enqueueAfterDelay(this.nr,1e4,(()=>(this.hr()&&(this.state=3),Promise.resolve()))),this.listener.Si())))})),this.stream.Ci((t=>{e((()=>this.Ir(t)))})),this.stream.onMessage((t=>{e((()=>this.onMessage(t)))}))}lr(){this.state=5,this.ar.Xi((async()=>{this.state=0,this.start()}))}Ir(t){return Vs("PersistentStream",`close with error: ${t}`),this.stream=null,this.close(4,t)}Tr(t){return e=>{this.Oe.enqueueAndForget((()=>this.ir===t?e():(Vs("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class Hu extends Gu{constructor(t,e,n,s,r){super(t,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",e,n,r),this.N=s}Ar(t){return this.sr.ji("Listen",t)}onMessage(t){this.ar.reset();const e=function(t,e){let n;if("targetChange"in e){e.targetChange;const s=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:js()}(e.targetChange.targetChangeType||"NO_CHANGE"),r=e.targetChange.targetIds||[],i=function(t,e){return t.D?(Ks(void 0===e||"string"==typeof e),wr.fromBase64String(e||"")):(Ks(void 0===e||e instanceof Uint8Array),wr.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(t){const e=void 0===t.code?Hs.UNKNOWN:fo(t.code);return new zs(e,t.message||"")}(o);n=new Lo(s,r,i,a||null)}else if("documentChange"in e){e.documentChange;const s=e.documentChange;s.document,s.document.name,s.document.updateTime;const r=Qo(t,s.document.name),i=$o(s.document.updateTime),o=new $r({mapValue:{fields:s.document.fields}}),a=Hr.newFoundDocument(r,i,o),c=s.targetIds||[],u=s.removedTargetIds||[];n=new ko(c,u,a.key,a)}else if("documentDelete"in e){e.documentDelete;const s=e.documentDelete;s.document;const r=Qo(t,s.document),i=s.readTime?$o(s.readTime):cr.min(),o=Hr.newNoDocument(r,i),a=s.removedTargetIds||[];n=new ko([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const s=e.documentRemove;s.document;const r=Qo(t,s.document),i=s.removedTargetIds||[];n=new ko([],i,r,null)}else{if(!("filter"in e))return js();{e.filter;const t=e.filter;t.targetId;const s=t.count||0,r=new co(s),i=t.targetId;n=new Ro(i,r)}}return n}(this.N,t),n=function(t){if(!("targetChange"in t))return cr.min();const e=t.targetChange;return e.targetIds&&e.targetIds.length?cr.min():e.readTime?$o(e.readTime):cr.min()}(t);return this.listener.Rr(e,n)}br(t){const e={};e.database=Xo(this.N),e.addTarget=function(t,e){let n;const s=e.target;return n=Xr(s)?{documents:sa(t,s)}:{query:ra(t,s)},n.targetId=e.targetId,e.resumeToken.approximateByteSize()>0?n.resumeToken=jo(t,e.resumeToken):e.snapshotVersion.compareTo(cr.min())>0&&(n.readTime=Bo(t,e.snapshotVersion.toTimestamp())),n}(this.N,t);const n=function(t,e){const n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return js()}}(0,e.purpose);return null==n?null:{"goog-listen-tags":n}}(this.N,t);n&&(e.labels=n),this.mr(e)}Pr(t){const e={};e.database=Xo(this.N),e.removeTarget=t,this.mr(e)}}class zu extends Gu{constructor(t,e,n,s,r){super(t,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",e,n,r),this.N=s,this.vr=!1}get Vr(){return this.vr}start(){this.vr=!1,this.lastStreamToken=void 0,super.start()}pr(){this.vr&&this.Sr([])}Ar(t){return this.sr.ji("Write",t)}onMessage(t){if(Ks(!!t.streamToken),this.lastStreamToken=t.streamToken,this.vr){this.ar.reset();const e=function(t,e){return t&&t.length>0?(Ks(void 0!==e),t.map((t=>function(t,e){let n=t.updateTime?$o(t.updateTime):$o(e);return n.isEqual(cr.min())&&(n=$o(e)),new Hi(n,t.transformResults||[])}(t,e)))):[]}(t.writeResults,t.commitTime),n=$o(t.commitTime);return this.listener.Dr(n,e)}return Ks(!t.writeResults||0===t.writeResults.length),this.vr=!0,this.listener.Cr()}Nr(){const t={};t.database=Xo(this.N),this.mr(t)}Sr(t){const e={streamToken:this.lastStreamToken,writes:t.map((t=>ea(this.N,t)))};this.mr(e)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Qu extends class{}{constructor(t,e,n){super(),this.credentials=t,this.sr=e,this.N=n,this.kr=!1}$r(){if(this.kr)throw new zs(Hs.FAILED_PRECONDITION,"The client has already been terminated.")}Li(t,e,n){return this.$r(),this.credentials.getToken().then((s=>this.sr.Li(t,e,n,s))).catch((t=>{throw"FirebaseError"===t.name?(t.code===Hs.UNAUTHENTICATED&&this.credentials.invalidateToken(),t):new zs(Hs.UNKNOWN,t.toString())}))}Ki(t,e,n){return this.$r(),this.credentials.getToken().then((s=>this.sr.Ki(t,e,n,s))).catch((t=>{throw"FirebaseError"===t.name?(t.code===Hs.UNAUTHENTICATED&&this.credentials.invalidateToken(),t):new zs(Hs.UNKNOWN,t.toString())}))}terminate(){this.kr=!0}}class Wu{constructor(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.Or=0,this.Fr=null,this.Mr=!0}Lr(){0===this.Or&&(this.Br("Unknown"),this.Fr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this.Fr=null,this.Ur("Backend didn't respond within 10 seconds."),this.Br("Offline"),Promise.resolve()))))}qr(t){"Online"===this.state?this.Br("Unknown"):(this.Or++,this.Or>=1&&(this.Kr(),this.Ur(`Connection failed 1 times. Most recent error: ${t.toString()}`),this.Br("Offline")))}set(t){this.Kr(),this.Or=0,"Online"===t&&(this.Mr=!1),this.Br(t)}Br(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))}Ur(t){const e=`Could not reach Cloud Firestore backend. ${t}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.Mr?(Us(e),this.Mr=!1):Vs("OnlineStateTracker",e)}Kr(){null!==this.Fr&&(this.Fr.cancel(),this.Fr=null)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Yu{constructor(t,e,n,s,r){this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.jr=[],this.Qr=new Map,this.Wr=new Set,this.Gr=[],this.zr=r,this.zr.Ti((t=>{n.enqueueAndForget((async()=>{ih(this)&&(Vs("RemoteStore","Restarting streams for network reachability change."),await async function(t){const e=Gs(t);e.Wr.add(4),await Ju(e),e.Hr.set("Unknown"),e.Wr.delete(4),await Xu(e)}(this))}))})),this.Hr=new Wu(n,s)}}async function Xu(t){if(ih(t))for(const e of t.Gr)await e(!0)}async function Ju(t){for(const e of t.Gr)await e(!1)}function Zu(t,e){const n=Gs(t);n.Qr.has(e.targetId)||(n.Qr.set(e.targetId,e),rh(n)?sh(n):Th(n).hr()&&eh(n,e))}function th(t,e){const n=Gs(t),s=Th(n);n.Qr.delete(e),s.hr()&&nh(n,e),0===n.Qr.size&&(s.hr()?s.wr():ih(n)&&n.Hr.set("Unknown"))}function eh(t,e){t.Jr.Y(e.targetId),Th(t).br(e)}function nh(t,e){t.Jr.Y(e),Th(t).Pr(e)}function sh(t){t.Jr=new Mo({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),Tt:e=>t.Qr.get(e)||null}),Th(t).start(),t.Hr.Lr()}function rh(t){return ih(t)&&!Th(t).ur()&&t.Qr.size>0}function ih(t){return 0===Gs(t).Wr.size}function oh(t){t.Jr=void 0}async function ah(t){t.Qr.forEach(((e,n)=>{eh(t,e)}))}async function ch(t,e){oh(t),rh(t)?(t.Hr.qr(e),sh(t)):t.Hr.set("Unknown")}async function uh(t,e,n){if(t.Hr.set("Online"),e instanceof Lo&&2===e.state&&e.cause)try{await async function(t,e){const n=e.cause;for(const s of e.targetIds)t.Qr.has(s)&&(await t.remoteSyncer.rejectListen(s,n),t.Qr.delete(s),t.Jr.removeTarget(s))}(t,e)}catch(n){Vs("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),n),await hh(t,n)}else if(e instanceof ko?t.Jr.rt(e):e instanceof Ro?t.Jr.ft(e):t.Jr.at(e),!n.isEqual(cr.min()))try{const e=await au(t.localStore);n.compareTo(e)>=0&&await function(t,e){const n=t.Jr._t(e);return n.targetChanges.forEach(((n,s)=>{if(n.resumeToken.approximateByteSize()>0){const r=t.Qr.get(s);r&&t.Qr.set(s,r.withResumeToken(n.resumeToken,e))}})),n.targetMismatches.forEach((e=>{const n=t.Qr.get(e);if(!n)return;t.Qr.set(e,n.withResumeToken(wr.EMPTY_BYTE_STRING,n.snapshotVersion)),nh(t,e);const s=new tc(n.target,e,1,n.sequenceNumber);eh(t,s)})),t.remoteSyncer.applyRemoteEvent(n)}(t,n)}catch(e){Vs("RemoteStore","Failed to raise snapshot:",e),await hh(t,e)}}async function hh(t,e,n){if(!Ga(e))throw e;t.Wr.add(1),await Ju(t),t.Hr.set("Offline"),n||(n=()=>au(t.localStore)),t.asyncQueue.enqueueRetryable((async()=>{Vs("RemoteStore","Retrying IndexedDB access"),await n(),t.Wr.delete(1),await Xu(t)}))}function lh(t,e){return e().catch((n=>hh(t,n,e)))}async function dh(t){const e=Gs(t),n=Ih(e);let s=e.jr.length>0?e.jr[e.jr.length-1].batchId:-1;for(;fh(e);)try{const t=await uu(e.localStore,s);if(null===t){0===e.jr.length&&n.wr();break}s=t.batchId,gh(e,t)}catch(t){await hh(e,t)}mh(e)&&ph(e)}function fh(t){return ih(t)&&t.jr.length<10}function gh(t,e){t.jr.push(e);const n=Ih(t);n.hr()&&n.Vr&&n.Sr(e.mutations)}function mh(t){return ih(t)&&!Ih(t).ur()&&t.jr.length>0}function ph(t){Ih(t).start()}async function yh(t){Ih(t).Nr()}async function wh(t){const e=Ih(t);for(const n of t.jr)e.Sr(n.mutations)}async function vh(t,e,n){const s=t.jr.shift(),r=Za.from(s,e,n);await lh(t,(()=>t.remoteSyncer.applySuccessfulWrite(r))),await dh(t)}async function bh(t,e){e&&Ih(t).Vr&&await async function(t,e){if(lo(n=e.code)&&n!==Hs.ABORTED){const n=t.jr.shift();Ih(t).dr(),await lh(t,(()=>t.remoteSyncer.rejectFailedWrite(n.batchId,e))),await dh(t)}var n}(t,e),mh(t)&&ph(t)}async function Eh(t,e){const n=Gs(t);e?(n.Wr.delete(2),await Xu(n)):e||(n.Wr.add(2),await Ju(n),n.Hr.set("Unknown"))}function Th(t){return t.Yr||(t.Yr=function(t,e,n){const s=Gs(t);return s.$r(),new Hu(e,s.sr,s.credentials,s.N,n)}(t.datastore,t.asyncQueue,{Si:ah.bind(null,t),Ci:ch.bind(null,t),Rr:uh.bind(null,t)}),t.Gr.push((async e=>{e?(t.Yr.dr(),rh(t)?sh(t):t.Hr.set("Unknown")):(await t.Yr.stop(),oh(t))}))),t.Yr}function Ih(t){return t.Xr||(t.Xr=function(t,e,n){const s=Gs(t);return s.$r(),new zu(e,s.sr,s.credentials,s.N,n)}(t.datastore,t.asyncQueue,{Si:yh.bind(null,t),Ci:bh.bind(null,t),Cr:wh.bind(null,t),Dr:vh.bind(null,t)}),t.Gr.push((async e=>{e?(t.Xr.dr(),await dh(t)):(await t.Xr.stop(),t.jr.length>0&&(Vs("RemoteStore",`Stopping write stream with ${t.jr.length} pending writes`),t.jr=[]))}))),t.Xr +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class Sh{constructor(t,e,n,s,r){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=s,this.removalCallback=r,this.deferred=new Qs,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((t=>{}))}static createAndSchedule(t,e,n,s,r){const i=Date.now()+n,o=new Sh(t,e,i,s,r);return o.start(n),o}start(t){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new zs(Hs.CANCELLED,"Operation cancelled"+(t?": "+t:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then((t=>this.deferred.resolve(t)))):Promise.resolve()))}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function _h(t,e){if(Us("AsyncQueue",`${e}: ${t}`),Ga(t))return new zs(Hs.UNAVAILABLE,`${e}: ${t}`);throw t} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Nh{constructor(t){this.comparator=t?(e,n)=>t(e,n)||xr.comparator(e.key,n.key):(t,e)=>xr.comparator(t.key,e.key),this.keyedMap=To(),this.sortedSet=new go(this.comparator)}static emptySet(t){return new Nh(t.comparator)}has(t){return null!=this.keyedMap.get(t)}get(t){return this.keyedMap.get(t)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(t){const e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1}get size(){return this.sortedSet.size}forEach(t){this.sortedSet.inorderTraversal(((e,n)=>(t(e),!1)))}add(t){const e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))}delete(t){const e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this}isEqual(t){if(!(t instanceof Nh))return!1;if(this.size!==t.size)return!1;const e=this.sortedSet.getIterator(),n=t.sortedSet.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(!t.isEqual(s))return!1}return!0}toString(){const t=[];return this.forEach((e=>{t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"}copy(t,e){const n=new Nh;return n.comparator=this.comparator,n.keyedMap=t,n.sortedSet=e,n}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ah{constructor(){this.Zr=new go(xr.comparator)}track(t){const e=t.doc.key,n=this.Zr.get(e);n?0!==t.type&&3===n.type?this.Zr=this.Zr.insert(e,t):3===t.type&&1!==n.type?this.Zr=this.Zr.insert(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.Zr=this.Zr.insert(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.Zr=this.Zr.insert(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.Zr=this.Zr.remove(e):1===t.type&&2===n.type?this.Zr=this.Zr.insert(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.Zr=this.Zr.insert(e,{type:2,doc:t.doc}):js():this.Zr=this.Zr.insert(e,t)}eo(){const t=[];return this.Zr.inorderTraversal(((e,n)=>{t.push(n)})),t}}class Dh{constructor(t,e,n,s,r,i,o,a){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=s,this.mutatedKeys=r,this.fromCache=i,this.syncStateChanged=o,this.excludesMetadataChanges=a}static fromInitialDocuments(t,e,n,s){const r=[];return e.forEach((t=>{r.push({type:0,doc:t})})),new Dh(t,e,Nh.emptySet(e),r,n,s,!0,!1)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&Si(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;const e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(let t=0;t_i(t)),Si),this.onlineState="Unknown",this.so=new Set}}async function kh(t,e){const n=Gs(t),s=e.query;let r=!1,i=n.queries.get(s);if(i||(r=!0,i=new xh),r)try{i.no=await n.onListen(s)}catch(t){const n=_h(t,`Initialization of query '${Ni(e.query)}' failed`);return void e.onError(n)}n.queries.set(s,i),i.listeners.push(e),e.io(n.onlineState),i.no&&e.ro(i.no)&&Mh(n)}async function Rh(t,e){const n=Gs(t),s=e.query;let r=!1;const i=n.queries.get(s);if(i){const t=i.listeners.indexOf(e);t>=0&&(i.listeners.splice(t,1),r=0===i.listeners.length)}if(r)return n.queries.delete(s),n.onUnlisten(s)}function Lh(t,e){const n=Gs(t);let s=!1;for(const t of e){const e=t.query,r=n.queries.get(e);if(r){for(const e of r.listeners)e.ro(t)&&(s=!0);r.no=t}}s&&Mh(n)}function Oh(t,e,n){const s=Gs(t),r=s.queries.get(e);if(r)for(const t of r.listeners)t.onError(n);s.queries.delete(e)}function Mh(t){t.so.forEach((t=>{t.next()}))}class Fh{constructor(t,e,n){this.query=t,this.oo=e,this.co=!1,this.ao=null,this.onlineState="Unknown",this.options=n||{}}ro(t){if(!this.options.includeMetadataChanges){const e=[];for(const n of t.docChanges)3!==n.type&&e.push(n);t=new Dh(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}let e=!1;return this.co?this.uo(t)&&(this.oo.next(t),e=!0):this.ho(t,this.onlineState)&&(this.lo(t),e=!0),this.ao=t,e}onError(t){this.oo.error(t)}io(t){this.onlineState=t;let e=!1;return this.ao&&!this.co&&this.ho(this.ao,t)&&(this.lo(this.ao),e=!0),e}ho(t,e){if(!t.fromCache)return!0;const n="Offline"!==e;return!(this.options.fo&&n||t.docs.isEmpty()&&"Offline"!==e)}uo(t){if(t.docChanges.length>0)return!0;const e=this.ao&&this.ao.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!e)&&!0===this.options.includeMetadataChanges}lo(t){t=Dh.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.co=!0,this.oo.next(t)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ph{constructor(t,e){this.payload=t,this.byteLength=e}wo(){return"metadata"in this.payload}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Vh{constructor(t){this.N=t}zn(t){return Qo(this.N,t)}Hn(t){return t.metadata.exists?ta(this.N,t.document,!1):Hr.newNoDocument(this.zn(t.metadata.name),this.Jn(t.metadata.readTime))}Jn(t){return $o(t)}}class Uh{constructor(t,e,n){this._o=t,this.localStore=e,this.N=n,this.queries=[],this.documents=[],this.progress=qh(t)}mo(t){this.progress.bytesLoaded+=t.byteLength;let e=this.progress.documentsLoaded;return t.payload.namedQuery?this.queries.push(t.payload.namedQuery):t.payload.documentMetadata?(this.documents.push({metadata:t.payload.documentMetadata}),t.payload.documentMetadata.exists||++e):t.payload.document&&(this.documents[this.documents.length-1].document=t.payload.document,++e),e!==this.progress.documentsLoaded?(this.progress.documentsLoaded=e,Object.assign({},this.progress)):null}yo(t){const e=new Map,n=new Vh(this.N);for(const s of t)if(s.metadata.queries){const t=n.zn(s.metadata.name);for(const n of s.metadata.queries){const s=(e.get(n)||No()).add(t);e.set(n,s)}}return e}async complete(){const t=await async function(t,e,n,s){const r=Gs(t);let i=No(),o=bo(),a=So();for(const t of n){const n=e.zn(t.metadata.name);t.document&&(i=i.add(n)),o=o.insert(n,e.Hn(t)),a=a.insert(n,e.Jn(t.metadata.readTime))}const c=r.jn.newChangeBuffer({trackRemovals:!0}),u=await hu(r,function(t){return Ti(mi(fr.fromString(`__bundle__/docs/${t}`)))}(s));return r.persistence.runTransaction("Apply bundle documents","readwrite",(t=>cu(t,c,o,cr.min(),a).next((e=>(c.apply(t),e))).next((e=>r.ze.removeMatchingKeysForTargetId(t,u.targetId).next((()=>r.ze.addMatchingKeys(t,i,u.targetId))).next((()=>r.Qn.vn(t,e))).next((()=>e))))))}(this.localStore,new Vh(this.N),this.documents,this._o.id),e=this.yo(this.documents);for(const t of this.queries)await mu(this.localStore,t,e.get(t.name));return this.progress.taskState="Success",new tu(Object.assign({},this.progress),t)}}function qh(t){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Bh{constructor(t){this.key=t}}class jh{constructor(t){this.key=t}}class Kh{constructor(t,e){this.query=t,this.po=e,this.To=null,this.current=!1,this.Eo=No(),this.mutatedKeys=No(),this.Io=Di(t),this.Ao=new Nh(this.Io)}get Ro(){return this.po}bo(t,e){const n=e?e.Po:new Ah,s=e?e.Ao:this.Ao;let r=e?e.mutatedKeys:this.mutatedKeys,i=s,o=!1;const a=pi(this.query)&&s.size===this.query.limit?s.last():null,c=yi(this.query)&&s.size===this.query.limit?s.first():null;if(t.inorderTraversal(((t,e)=>{const u=s.get(t),h=Ai(this.query,e)?e:null,l=!!u&&this.mutatedKeys.has(u.key),d=!!h&&(h.hasLocalMutations||this.mutatedKeys.has(h.key)&&h.hasCommittedMutations);let f=!1;u&&h?u.data.isEqual(h.data)?l!==d&&(n.track({type:3,doc:h}),f=!0):this.vo(u,h)||(n.track({type:2,doc:h}),f=!0,(a&&this.Io(h,a)>0||c&&this.Io(h,c)<0)&&(o=!0)):!u&&h?(n.track({type:0,doc:h}),f=!0):u&&!h&&(n.track({type:1,doc:u}),f=!0,(a||c)&&(o=!0)),f&&(h?(i=i.add(h),r=d?r.add(t):r.delete(t)):(i=i.delete(t),r=r.delete(t)))})),pi(this.query)||yi(this.query))for(;i.size>this.query.limit;){const t=pi(this.query)?i.last():i.first();i=i.delete(t.key),r=r.delete(t.key),n.track({type:1,doc:t})}return{Ao:i,Po:n,Ln:o,mutatedKeys:r}}vo(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations}applyChanges(t,e,n){const s=this.Ao;this.Ao=t.Ao,this.mutatedKeys=t.mutatedKeys;const r=t.Po.eo();r.sort(((t,e)=>function(t,e){const n=t=>{switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return js()}};return n(t)-n(e)}(t.type,e.type)||this.Io(t.doc,e.doc))),this.Vo(n);const i=e?this.So():[],o=0===this.Eo.size&&this.current?1:0,a=o!==this.To;return this.To=o,0!==r.length||a?{snapshot:new Dh(this.query,t.Ao,s,r,t.mutatedKeys,0===o,a,!1),Do:i}:{Do:i}}io(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({Ao:this.Ao,Po:new Ah,mutatedKeys:this.mutatedKeys,Ln:!1},!1)):{Do:[]}}Co(t){return!this.po.has(t)&&!!this.Ao.has(t)&&!this.Ao.get(t).hasLocalMutations}Vo(t){t&&(t.addedDocuments.forEach((t=>this.po=this.po.add(t))),t.modifiedDocuments.forEach((t=>{})),t.removedDocuments.forEach((t=>this.po=this.po.delete(t))),this.current=t.current)}So(){if(!this.current)return[];const t=this.Eo;this.Eo=No(),this.Ao.forEach((t=>{this.Co(t.key)&&(this.Eo=this.Eo.add(t.key))}));const e=[];return t.forEach((t=>{this.Eo.has(t)||e.push(new jh(t))})),this.Eo.forEach((n=>{t.has(n)||e.push(new Bh(n))})),e}No(t){this.po=t.Gn,this.Eo=No();const e=this.bo(t.documents);return this.applyChanges(e,!0)}xo(){return Dh.fromInitialDocuments(this.query,this.Ao,this.mutatedKeys,0===this.To)}}class $h{constructor(t,e,n){this.query=t,this.targetId=e,this.view=n}}class Gh{constructor(t){this.key=t,this.ko=!1}}class Hh{constructor(t,e,n,s,r,i){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=s,this.currentUser=r,this.maxConcurrentLimboResolutions=i,this.$o={},this.Oo=new qc((t=>_i(t)),Si),this.Fo=new Map,this.Mo=new Set,this.Lo=new go(xr.comparator),this.Bo=new Map,this.Uo=new yu,this.qo={},this.Ko=new Map,this.jo=Dc.ie(),this.onlineState="Unknown",this.Qo=void 0}get isPrimaryClient(){return!0===this.Qo}}async function zh(t,e){const n=vl(t);let s,r;const i=n.Oo.get(e);if(i)s=i.targetId,n.sharedClientState.addLocalQueryTarget(s),r=i.view.xo();else{const t=await hu(n.localStore,Ti(e)),i=n.sharedClientState.addLocalQueryTarget(t.targetId);s=t.targetId,r=await Qh(n,e,s,"current"===i),n.isPrimaryClient&&Zu(n.remoteStore,t)}return r}async function Qh(t,e,n,s){t.Wo=(e,n,s)=>async function(t,e,n,s){let r=e.view.bo(n);r.Ln&&(r=await du(t.localStore,e.query,!1).then((({documents:t})=>e.view.bo(t,r))));const i=s&&s.targetChanges.get(e.targetId),o=e.view.applyChanges(r,t.isPrimaryClient,i);return il(t,e.targetId,o.Do),o.snapshot}(t,e,n,s);const r=await du(t.localStore,e,!0),i=new Kh(e,r.Gn),o=i.bo(r.documents),a=Co.createSynthesizedTargetChangeForCurrentChange(n,s&&"Offline"!==t.onlineState),c=i.applyChanges(o,t.isPrimaryClient,a);il(t,n,c.Do);const u=new $h(e,n,i);return t.Oo.set(e,u),t.Fo.has(n)?t.Fo.get(n).push(e):t.Fo.set(n,[e]),c.snapshot}async function Wh(t,e){const n=Gs(t),s=n.Oo.get(e),r=n.Fo.get(s.targetId);if(r.length>1)return n.Fo.set(s.targetId,r.filter((t=>!Si(t,e)))),void n.Oo.delete(e);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(s.targetId),n.sharedClientState.isActiveQueryTarget(s.targetId)||await lu(n.localStore,s.targetId,!1).then((()=>{n.sharedClientState.clearQueryState(s.targetId),th(n.remoteStore,s.targetId),sl(n,s.targetId)})).catch(Lc)):(sl(n,s.targetId),await lu(n.localStore,s.targetId,!0))}async function Yh(t,e){const n=Gs(t);try{const t=await function(t,e){const n=Gs(t),s=e.snapshotVersion;let r=n.Un;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(t=>{const i=n.jn.newChangeBuffer({trackRemovals:!0});r=n.Un;const o=[];e.targetChanges.forEach(((e,i)=>{const a=r.get(i);if(!a)return;o.push(n.ze.removeMatchingKeys(t,e.removedDocuments,i).next((()=>n.ze.addMatchingKeys(t,e.addedDocuments,i))));const c=e.resumeToken;if(c.approximateByteSize()>0){const u=a.withResumeToken(c,s).withSequenceNumber(t.currentSequenceNumber);r=r.insert(i,u),function(t,e,n){return Ks(e.resumeToken.approximateByteSize()>0),0===t.resumeToken.approximateByteSize()||e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(a,u,e)&&o.push(n.ze.updateTargetData(t,u))}}));let a=bo();if(e.documentUpdates.forEach(((s,r)=>{e.resolvedLimboDocuments.has(s)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(t,s))})),o.push(cu(t,i,e.documentUpdates,s,void 0).next((t=>{a=t}))),!s.isEqual(cr.min())){const e=n.ze.getLastRemoteSnapshotVersion(t).next((e=>n.ze.setTargetsMetadata(t,t.currentSequenceNumber,s)));o.push(e)}return qa.waitFor(o).next((()=>i.apply(t))).next((()=>n.Qn.vn(t,a))).next((()=>a))})).then((t=>(n.Un=r,t)))}(n.localStore,e);e.targetChanges.forEach(((t,e)=>{const s=n.Bo.get(e);s&&(Ks(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1),t.addedDocuments.size>0?s.ko=!0:t.modifiedDocuments.size>0?Ks(s.ko):t.removedDocuments.size>0&&(Ks(s.ko),s.ko=!1))})),await cl(n,t,e)}catch(t){await Lc(t)}}function Xh(t,e,n){const s=Gs(t);if(s.isPrimaryClient&&0===n||!s.isPrimaryClient&&1===n){const t=[];s.Oo.forEach(((n,s)=>{const r=s.view.io(e);r.snapshot&&t.push(r.snapshot)})),function(t,e){const n=Gs(t);n.onlineState=e;let s=!1;n.queries.forEach(((t,n)=>{for(const t of n.listeners)t.io(e)&&(s=!0)})),s&&Mh(n)}(s.eventManager,e),t.length&&s.$o.Rr(t),s.onlineState=e,s.isPrimaryClient&&s.sharedClientState.setOnlineState(e)}}async function Jh(t,e,n){const s=Gs(t);s.sharedClientState.updateQueryState(e,"rejected",n);const r=s.Bo.get(e),i=r&&r.key;if(i){let t=new go(xr.comparator);t=t.insert(i,Hr.newNoDocument(i,cr.min()));const n=No().add(i),r=new xo(cr.min(),new Map,new yo(rr),t,n);await Yh(s,r),s.Lo=s.Lo.remove(i),s.Bo.delete(e),al(s)}else await lu(s.localStore,e,!1).then((()=>sl(s,e,n))).catch(Lc)}async function Zh(t,e){const n=Gs(t),s=e.batch.batchId;try{const t=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(t=>{const s=e.batch.keys(),r=n.jn.newChangeBuffer({trackRemovals:!0});return function(t,e,n,s){const r=n.batch,i=r.keys();let o=qa.resolve();return i.forEach((t=>{o=o.next((()=>s.getEntry(e,t))).next((e=>{const i=n.docVersions.get(t);Ks(null!==i),e.version.compareTo(i)<0&&(r.applyToRemoteDocument(e,n),e.isValidDocument()&&s.addEntry(e,n.commitVersion))}))})),o.next((()=>t.In.removeMutationBatch(e,r)))}(n,t,e,r).next((()=>r.apply(t))).next((()=>n.In.performConsistencyCheck(t))).next((()=>n.Qn.Pn(t,s)))}))}(n.localStore,e);nl(n,s,null),el(n,s),n.sharedClientState.updateMutationState(s,"acknowledged"),await cl(n,t)}catch(t){await Lc(t)}}async function tl(t,e,n){const s=Gs(t);try{const t=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(t=>{let s;return n.In.lookupMutationBatch(t,e).next((e=>(Ks(null!==e),s=e.keys(),n.In.removeMutationBatch(t,e)))).next((()=>n.In.performConsistencyCheck(t))).next((()=>n.Qn.Pn(t,s)))}))}(s.localStore,e);nl(s,e,n),el(s,e),s.sharedClientState.updateMutationState(e,"rejected",n),await cl(s,t)}catch(t){await Lc(t)}}function el(t,e){(t.Ko.get(e)||[]).forEach((t=>{t.resolve()})),t.Ko.delete(e)}function nl(t,e,n){const s=Gs(t);let r=s.qo[s.currentUser.toKey()];if(r){const t=r.get(e);t&&(n?t.reject(n):t.resolve(),r=r.remove(e)),s.qo[s.currentUser.toKey()]=r}}function sl(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const s of t.Fo.get(e))t.Oo.delete(s),n&&t.$o.Go(s,n);t.Fo.delete(e),t.isPrimaryClient&&t.Uo.cs(e).forEach((e=>{t.Uo.containsKey(e)||rl(t,e)}))}function rl(t,e){t.Mo.delete(e.path.canonicalString());const n=t.Lo.get(e);null!==n&&(th(t.remoteStore,n),t.Lo=t.Lo.remove(e),t.Bo.delete(n),al(t))}function il(t,e,n){for(const s of n)s instanceof Bh?(t.Uo.addReference(s.key,e),ol(t,s)):s instanceof jh?(Vs("SyncEngine","Document no longer in limbo: "+s.key),t.Uo.removeReference(s.key,e),t.Uo.containsKey(s.key)||rl(t,s.key)):js()}function ol(t,e){const n=e.key,s=n.path.canonicalString();t.Lo.get(n)||t.Mo.has(s)||(Vs("SyncEngine","New document in limbo: "+n),t.Mo.add(s),al(t))}function al(t){for(;t.Mo.size>0&&t.Lo.size{o.push(s.Wo(a,e,n).then((t=>{if(t){s.isPrimaryClient&&s.sharedClientState.updateQueryState(a.targetId,t.fromCache?"not-current":"current"),r.push(t);const e=nu.kn(a.targetId,t);i.push(e)}})))})),await Promise.all(o),s.$o.Rr(r),await async function(t,e){const n=Gs(t);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(t=>qa.forEach(e,(e=>qa.forEach(e.Nn,(s=>n.persistence.referenceDelegate.addReference(t,e.targetId,s))).next((()=>qa.forEach(e.xn,(s=>n.persistence.referenceDelegate.removeReference(t,e.targetId,s)))))))))}catch(t){if(!Ga(t))throw t;Vs("LocalStore","Failed to update sequence numbers: "+t)}for(const t of e){const e=t.targetId;if(!t.fromCache){const t=n.Un.get(e),s=t.snapshotVersion,r=t.withLastLimboFreeSnapshotVersion(s);n.Un=n.Un.insert(e,r)}}}(s.localStore,i))}async function ul(t,e){const n=Gs(t);if(!n.currentUser.isEqual(e)){Vs("SyncEngine","User change. New user:",e.toKey());const t=await ou(n.localStore,e);n.currentUser=e,function(t,e){t.Ko.forEach((t=>{t.forEach((t=>{t.reject(new zs(Hs.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.Ko.clear()}(n),n.sharedClientState.handleUserChange(e,t.removedBatchIds,t.addedBatchIds),await cl(n,t.Wn)}}function hl(t,e){const n=Gs(t),s=n.Bo.get(e);if(s&&s.ko)return No().add(s.key);{let t=No();const s=n.Fo.get(e);if(!s)return t;for(const e of s){const s=n.Oo.get(e);t=t.unionWith(s.view.Ro)}return t}}async function ll(t,e){const n=Gs(t),s=await du(n.localStore,e.query,!0),r=e.view.No(s);return n.isPrimaryClient&&il(n,e.targetId,r.Do),r}async function dl(t){const e=Gs(t);return gu(e.localStore).then((t=>cl(e,t)))}async function fl(t,e,n,s){const r=Gs(t),i=await function(t,e){const n=Gs(t),s=Gs(n.In);return n.persistence.runTransaction("Lookup mutation documents","readonly",(t=>s.Xt(t,e).next((e=>e?n.Qn.Pn(t,e):qa.resolve(null)))))}(r.localStore,e);null!==i?("pending"===n?await dh(r.remoteStore):"acknowledged"===n||"rejected"===n?(nl(r,e,s||null),el(r,e),function(t,e){Gs(Gs(t).In).te(e)}(r.localStore,e)):js(),await cl(r,i)):Vs("SyncEngine","Cannot apply mutation batch with id: "+e)}async function gl(t,e,n){const s=Gs(t),r=[],i=[];for(const t of e){let e;const n=s.Fo.get(t);if(n&&0!==n.length){e=await hu(s.localStore,Ti(n[0]));for(const t of n){const e=s.Oo.get(t),n=await ll(s,e);n.snapshot&&i.push(n.snapshot)}}else{const n=await fu(s.localStore,t);e=await hu(s.localStore,n),await Qh(s,ml(n),t,!1)}r.push(e)}return s.$o.Rr(i),r}function ml(t){return gi(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function pl(t){const e=Gs(t);return Gs(Gs(e.localStore).persistence).pn()}async function yl(t,e,n,s){const r=Gs(t);if(r.Qo)Vs("SyncEngine","Ignoring unexpected query state notification.");else if(r.Fo.has(e))switch(n){case"current":case"not-current":{const t=await gu(r.localStore),s=xo.createSynthesizedRemoteEventForCurrentChange(e,"current"===n);await cl(r,t,s);break}case"rejected":await lu(r.localStore,e,!0),sl(r,e,s);break;default:js()}}async function wl(t,e,n){const s=vl(t);if(s.Qo){for(const t of e){if(s.Fo.has(t)){Vs("SyncEngine","Adding an already active target "+t);continue}const e=await fu(s.localStore,t),n=await hu(s.localStore,e);await Qh(s,ml(e),n.targetId,!1),Zu(s.remoteStore,n)}for(const t of n)s.Fo.has(t)&&await lu(s.localStore,t,!1).then((()=>{th(s.remoteStore,t),sl(s,t)})).catch(Lc)}}function vl(t){const e=Gs(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=Yh.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=hl.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=Jh.bind(null,e),e.$o.Rr=Lh.bind(null,e.eventManager),e.$o.Go=Oh.bind(null,e.eventManager),e}function bl(t){const e=Gs(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=Zh.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=tl.bind(null,e),e}class El{constructor(){this.synchronizeTabs=!1}async initialize(t){this.N=Ku(t.databaseInfo.databaseId),this.sharedClientState=this.Ho(t),this.persistence=this.Jo(t),await this.persistence.start(),this.gcScheduler=this.Yo(t),this.localStore=this.Xo(t)}Yo(t){return null}Xo(t){return iu(this.persistence,new su,t.initialUser,this.N)}Jo(t){return new Iu(_u.Ns,this.N)}Ho(t){return new Mu}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class Tl extends El{constructor(t,e,n){super(),this.Zo=t,this.cacheSizeBytes=e,this.forceOwnership=n,this.synchronizeTabs=!1}async initialize(t){await super.initialize(t),await async function(t){const e=Gs(t);return e.persistence.runTransaction("Synchronize last document change read time","readonly",(t=>function(t){const e=Gc(t);let n=cr.min();return e.Kt({index:Da.readTimeIndex,reverse:!0},((t,e,s)=>{e.readTime&&(n=ic(e.readTime)),s.done()})).next((()=>n))}(t))).then((t=>{e.Kn=t}))}(this.localStore),await this.Zo.initialize(this,t),await bl(this.Zo.syncEngine),await dh(this.Zo.remoteStore),await this.persistence.nn((()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(this.localStore),Promise.resolve())))}Xo(t){return iu(this.persistence,new su,t.initialUser,this.N)}Yo(t){const e=this.persistence.referenceDelegate.garbageCollector;return new Fc(e,t.asyncQueue)}Jo(t){const e=Zc(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?bc.withCacheSize(this.cacheSizeBytes):bc.DEFAULT;return new Yc(this.synchronizeTabs,e,t.clientId,n,t.asyncQueue,Bu(),ju(),this.N,this.sharedClientState,!!this.forceOwnership)}Ho(t){return new Mu}}class Il extends Tl{constructor(t,e){super(t,e,!1),this.Zo=t,this.cacheSizeBytes=e,this.synchronizeTabs=!0}async initialize(t){await super.initialize(t);const e=this.Zo.syncEngine;this.sharedClientState instanceof Ou&&(this.sharedClientState.syncEngine={_i:fl.bind(null,e),mi:yl.bind(null,e),gi:wl.bind(null,e),pn:pl.bind(null,e),wi:dl.bind(null,e)},await this.sharedClientState.start()),await this.persistence.nn((async t=>{await async function(t,e){const n=Gs(t);if(vl(n),bl(n),!0===e&&!0!==n.Qo){const t=n.sharedClientState.getAllActiveQueryTargets(),e=await gl(n,t.toArray());n.Qo=!0,await Eh(n.remoteStore,!0);for(const t of e)Zu(n.remoteStore,t)}else if(!1===e&&!1!==n.Qo){const t=[];let e=Promise.resolve();n.Fo.forEach(((s,r)=>{n.sharedClientState.isLocalQueryTarget(r)?t.push(r):e=e.then((()=>(sl(n,r),lu(n.localStore,r,!0)))),th(n.remoteStore,r)})),await e,await gl(n,t),function(t){const e=Gs(t);e.Bo.forEach(((t,n)=>{th(e.remoteStore,n)})),e.Uo.us(),e.Bo=new Map,e.Lo=new go(xr.comparator)}(n),n.Qo=!1,await Eh(n.remoteStore,!1)}}(this.Zo.syncEngine,t),this.gcScheduler&&(t&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):t||this.gcScheduler.stop())}))}Ho(t){const e=Bu();if(!Ou.bt(e))throw new zs(Hs.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const n=Zc(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey);return new Ou(e,t.asyncQueue,n,t.clientId,t.initialUser)}}class Sl{async initialize(t,e){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(e),this.remoteStore=this.createRemoteStore(e),this.eventManager=this.createEventManager(e),this.syncEngine=this.createSyncEngine(e,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=t=>Xh(this.syncEngine,t,1),this.remoteStore.remoteSyncer.handleCredentialChange=ul.bind(null,this.syncEngine),await Eh(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return new Ch}createDatastore(t){const e=Ku(t.databaseInfo.databaseId),n=(s=t.databaseInfo,new qu(s));var s;return function(t,e,n){return new Qu(t,e,n)}(t.credentials,n,e)}createRemoteStore(t){var e,n,s,r,i;return e=this.localStore,n=this.datastore,s=t.asyncQueue,r=t=>Xh(this.syncEngine,t,0),i=Pu.bt()?new Pu:new Fu,new Yu(e,n,s,r,i)}createSyncEngine(t,e){return function(t,e,n,s,r,i,o){const a=new Hh(t,e,n,s,r,i);return o&&(a.Qo=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)}terminate(){return async function(t){const e=Gs(t);Vs("RemoteStore","RemoteStore shutting down."),e.Wr.add(5),await Ju(e),e.zr.shutdown(),e.Hr.set("Unknown")}(this.remoteStore)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function _l(t,e=10240){let n=0;return{async read(){if(n{this.muted||t(e)}),0)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Al{constructor(t,e){this.nc=t,this.N=e,this.metadata=new Qs,this.buffer=new Uint8Array,this.sc=new TextDecoder("utf-8"),this.ic().then((t=>{t&&t.wo()?this.metadata.resolve(t.payload.metadata):this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\n ${JSON.stringify(null==t?void 0:t.payload)}`))}),(t=>this.metadata.reject(t)))}close(){return this.nc.cancel()}async getMetadata(){return this.metadata.promise}async zo(){return await this.getMetadata(),this.ic()}async ic(){const t=await this.rc();if(null===t)return null;const e=this.sc.decode(t),n=Number(e);isNaN(n)&&this.oc(`length string (${e}) is not valid number`);const s=await this.cc(n);return new Ph(JSON.parse(s),t.length+n)}ac(){return this.buffer.findIndex((t=>t==="{".charCodeAt(0)))}async rc(){for(;this.ac()<0&&!await this.uc(););if(0===this.buffer.length)return null;const t=this.ac();t<0&&this.oc("Reached the end of bundle when a length string is expected.");const e=this.buffer.slice(0,t);return this.buffer=this.buffer.slice(t),e}async cc(t){for(;this.buffer.length0)throw new zs(Hs.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");const e=await async function(t,e){const n=Gs(t),s=Xo(n.N)+"/documents",r={documents:e.map((t=>zo(n.N,t)))},i=await n.Ki("BatchGetDocuments",s,r),o=new Map;i.forEach((t=>{const e=function(t,e){return"found"in e?function(t,e){Ks(!!e.found),e.found.name,e.found.updateTime;const n=Qo(t,e.found.name),s=$o(e.found.updateTime),r=new $r({mapValue:{fields:e.found.fields}});return Hr.newFoundDocument(n,s,r)}(t,e):"missing"in e?function(t,e){Ks(!!e.missing),Ks(!!e.readTime);const n=Qo(t,e.missing),s=$o(e.readTime);return Hr.newNoDocument(n,s)}(t,e):js()}(n.N,t);o.set(e.key.toString(),e)}));const a=[];return e.forEach((t=>{const e=o.get(t.toString());Ks(!!e),a.push(e)})),a}(this.datastore,t);return e.forEach((t=>this.recordVersion(t))),e}set(t,e){this.write(e.toMutation(t,this.precondition(t))),this.writtenDocs.add(t.toString())}update(t,e){try{this.write(e.toMutation(t,this.preconditionForUpdate(t)))}catch(t){this.lastWriteError=t}this.writtenDocs.add(t.toString())}delete(t){this.write(new oo(t,this.precondition(t))),this.writtenDocs.add(t.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;const t=this.readVersions;this.mutations.forEach((e=>{t.delete(e.key.toString())})),t.forEach(((t,e)=>{const n=xr.fromPath(e);this.mutations.push(new ao(n,this.precondition(n)))})),await async function(t,e){const n=Gs(t),s=Xo(n.N)+"/documents",r={writes:e.map((t=>ea(n.N,t)))};await n.Li("Commit",s,r)}(this.datastore,this.mutations),this.committed=!0}recordVersion(t){let e;if(t.isFoundDocument())e=t.version;else{if(!t.isNoDocument())throw js();e=cr.min()}const n=this.readVersions.get(t.key.toString());if(n){if(!e.isEqual(n))throw new zs(Hs.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(t.key.toString(),e)}precondition(t){const e=this.readVersions.get(t.toString());return!this.writtenDocs.has(t.toString())&&e?zi.updateTime(e):zi.none()}preconditionForUpdate(t){const e=this.readVersions.get(t.toString());if(!this.writtenDocs.has(t.toString())&&e){if(e.isEqual(cr.min()))throw new zs(Hs.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return zi.updateTime(e)}return zi.exists(!0)}write(t){this.ensureCommitNotCalled(),this.mutations.push(t)}ensureCommitNotCalled(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xl{constructor(t,e,n,s){this.asyncQueue=t,this.datastore=e,this.updateFunction=n,this.deferred=s,this.hc=5,this.ar=new $u(this.asyncQueue,"transaction_retry")}run(){this.hc-=1,this.lc()}lc(){this.ar.Xi((async()=>{const t=new Dl(this.datastore),e=this.fc(t);e&&e.then((e=>{this.asyncQueue.enqueueAndForget((()=>t.commit().then((()=>{this.deferred.resolve(e)})).catch((t=>{this.dc(t)}))))})).catch((t=>{this.dc(t)}))}))}fc(t){try{const e=this.updateFunction(t);return!Nr(e)&&e.catch&&e.then?e:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.deferred.reject(t),null}}dc(t){this.hc>0&&this.wc(t)?(this.hc-=1,this.asyncQueue.enqueueAndForget((()=>(this.lc(),Promise.resolve())))):this.deferred.reject(t)}wc(t){if("FirebaseError"===t.name){const e=t.code;return"aborted"===e||"failed-precondition"===e||!lo(e)}return!1}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Cl{constructor(t,e,n){this.credentials=t,this.asyncQueue=e,this.databaseInfo=n,this.user=Ls.UNAUTHENTICATED,this.clientId=sr.I(),this.credentialListener=()=>Promise.resolve(),this.credentials.start(e,(async t=>{Vs("FirestoreClient","Received user=",t.uid),await this.credentialListener(t),this.user=t}))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.credentialListener=t}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new zs(Hs.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const t=new Qs;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this.onlineComponents&&await this.onlineComponents.terminate(),this.offlineComponents&&await this.offlineComponents.terminate(),this.credentials.shutdown(),t.resolve()}catch(e){const n=_h(e,"Failed to shutdown persistence");t.reject(n)}})),t.promise}}async function kl(t,e){t.asyncQueue.verifyOperationInProgress(),Vs("FirestoreClient","Initializing OfflineComponentProvider");const n=await t.getConfiguration();await e.initialize(n);let s=n.initialUser;t.setCredentialChangeListener((async t=>{s.isEqual(t)||(await ou(e.localStore,t),s=t)})),e.persistence.setDatabaseDeletedListener((()=>t.terminate())),t.offlineComponents=e}async function Rl(t,e){t.asyncQueue.verifyOperationInProgress();const n=await Ll(t);Vs("FirestoreClient","Initializing OnlineComponentProvider");const s=await t.getConfiguration();await e.initialize(n,s),t.setCredentialChangeListener((t=>async function(t,e){const n=Gs(t);n.asyncQueue.verifyOperationInProgress(),Vs("RemoteStore","RemoteStore received new credentials");const s=ih(n);n.Wr.add(3),await Ju(n),s&&n.Hr.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Wr.delete(3),await Xu(n)}(e.remoteStore,t))),t.onlineComponents=e}async function Ll(t){return t.offlineComponents||(Vs("FirestoreClient","Using default OfflineComponentProvider"),await kl(t,new El)),t.offlineComponents}async function Ol(t){return t.onlineComponents||(Vs("FirestoreClient","Using default OnlineComponentProvider"),await Rl(t,new Sl)),t.onlineComponents}function Ml(t){return Ll(t).then((t=>t.persistence))}function Fl(t){return Ll(t).then((t=>t.localStore))}function Pl(t){return Ol(t).then((t=>t.remoteStore))}function Vl(t){return Ol(t).then((t=>t.syncEngine))}async function Ul(t){const e=await Ol(t),n=e.eventManager;return n.onListen=zh.bind(null,e.syncEngine),n.onUnlisten=Wh.bind(null,e.syncEngine),n}function ql(t,e,n={}){const s=new Qs;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,s,r){const i=new Nl({next:i=>{e.enqueueAndForget((()=>Rh(t,o)));const a=i.docs.has(n);!a&&i.fromCache?r.reject(new zs(Hs.UNAVAILABLE,"Failed to get document because the client is offline.")):a&&i.fromCache&&s&&"server"===s.source?r.reject(new zs(Hs.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):r.resolve(i)},error:t=>r.reject(t)}),o=new Fh(mi(n.path),i,{includeMetadataChanges:!0,fo:!0});return kh(t,o)}(await Ul(t),t.asyncQueue,e,n,s))),s.promise}function Bl(t,e,n={}){const s=new Qs;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,s,r){const i=new Nl({next:n=>{e.enqueueAndForget((()=>Rh(t,o))),n.fromCache&&"server"===s.source?r.reject(new zs(Hs.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):r.resolve(n)},error:t=>r.reject(t)}),o=new Fh(n,i,{includeMetadataChanges:!0,fo:!0});return kh(t,o)}(await Ul(t),t.asyncQueue,e,n,s))),s.promise}function jl(t,e,n,s){const r=function(t,e){let n;return n="string"==typeof t?(new TextEncoder).encode(t):t,function(t,e){return new Al(t,e)}(function(t,e){if(t instanceof Uint8Array)return _l(t,e);if(t instanceof ArrayBuffer)return _l(new Uint8Array(t),e);if(t instanceof ReadableStream)return t.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}(n),e)}(n,Ku(e));t.asyncQueue.enqueueAndForget((async()=>{!function(t,e,n){const s=Gs(t);(async function(t,e,n){try{const s=await e.getMetadata();if(await function(t,e){const n=Gs(t),s=$o(e.createTime);return n.persistence.runTransaction("hasNewerBundle","readonly",(t=>n.Je.getBundleMetadata(t,e.id))).then((t=>!!t&&t.createTime.compareTo(s)>=0))}(t.localStore,s))return await e.close(),void n._completeWith(function(t){return{taskState:"Success",documentsLoaded:t.totalDocuments,bytesLoaded:t.totalBytes,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}}(s));n._updateProgress(qh(s));const r=new Uh(s,t.localStore,e.N);let i=await e.zo();for(;i;){const t=await r.mo(i);t&&n._updateProgress(t),i=await e.zo()}const o=await r.complete();await cl(t,o.En,void 0),await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Save bundle","readwrite",(t=>n.Je.saveBundleMetadata(t,e)))}(t.localStore,s),n._completeWith(o.progress)}catch(t){qs("SyncEngine",`Loading bundle failed with ${t}`),n._failWith(t)}})(s,e,n).then((()=>{s.sharedClientState.notifyBundleLoaded()}))}(await Vl(t),r,s)}))}class Kl{constructor(t,e,n,s,r,i,o,a){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=s,this.ssl=r,this.forceLongPolling=i,this.autoDetectLongPolling=o,this.useFetchStreams=a}}class $l{constructor(t,e){this.projectId=t,this.database=e||"(default)"}get isDefaultDatabase(){return"(default)"===this.database}isEqual(t){return t instanceof $l&&t.projectId===this.projectId&&t.database===this.database}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Gl=new Map; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Hl(t,e,n){if(!n)throw new zs(Hs.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function zl(t,e,n,s){if(!0===e&&!0===s)throw new zs(Hs.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function Ql(t){if(!xr.isDocumentKey(t))throw new zs(Hs.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function Wl(t){if(xr.isDocumentKey(t))throw new zs(Hs.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function Yl(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";{const e=function(t){return t.constructor?t.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return"function"==typeof t?"a function":js()}function Xl(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new zs(Hs.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Yl(t);throw new zs(Hs.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function Jl(t,e){if(e<=0)throw new zs(Hs.INVALID_ARGUMENT,`Function ${t}() requires a positive number, but it was: ${e}.`)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Zl{constructor(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new zs(Hs.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=null===(e=t.ssl)||void 0===e||e;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new zs(Hs.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.useFetchStreams=!!t.useFetchStreams,zl("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class td{constructor(t,e){this._credentials=e,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Zl({}),this._settingsFrozen=!1,t instanceof $l?this._databaseId=t:(this._app=t,this._databaseId=function(t){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new zs(Hs.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new $l(t.options.projectId)}(t))}get app(){if(!this._app)throw new zs(Hs.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return void 0!==this._terminateTask}_setSettings(t){if(this._settingsFrozen)throw new zs(Hs.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Zl(t),void 0!==t.credentials&&(this._credentials=function(t){if(!t)return new Ys;switch(t.type){case"gapi":const e=t.client;return Ks(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new tr(e,t.sessionIndex||"0",t.iamToken||null);case"provider":return t.client;default:throw new zs(Hs.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const e=Gl.get(t);e&&(Vs("ComponentProvider","Removing Datastore"),Gl.delete(t),e.terminate())}(this),Promise.resolve()}}function ed(t,e,n,s={}){var r;const i=(t=Xl(t,td))._getSettings();if("firestore.googleapis.com"!==i.host&&i.host!==e&&qs("Host has been set in both settings() and useEmulator(), emulator host will be used"),t._setSettings(Object.assign(Object.assign({},i),{host:`${e}:${n}`,ssl:!1})),s.mockUserToken){let e,n;if("string"==typeof s.mockUserToken)e=s.mockUserToken,n=Ls.MOCK_USER;else{e= +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=e||"demo-project",s=t.iat||0,r=t.sub||t.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:s,exp:s+3600,auth_time:s,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}}},t);return[u(JSON.stringify({alg:"none",type:"JWT"})),u(JSON.stringify(i)),""].join(".")}(s.mockUserToken,null===(r=t._app)||void 0===r?void 0:r.options.projectId);const i=s.mockUserToken.sub||s.mockUserToken.user_id;if(!i)throw new zs(Hs.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Ls(i)}t._credentials=new Xs(new Ws(e,n))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class nd{constructor(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new rd(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new nd(this.firestore,t,this._key)}}class sd{constructor(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}withConverter(t){return new sd(this.firestore,t,this._query)}}class rd extends sd{constructor(t,e,n){super(t,e,mi(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new nd(this.firestore,null,new xr(t))}withConverter(t){return new rd(this.firestore,t,this._path)}}function id(t,e,...n){if(t=g(t),Hl("collection","path",e),t instanceof td){const s=fr.fromString(e,...n);return Wl(s),new rd(t,null,s)}{if(!(t instanceof nd||t instanceof rd))throw new zs(Hs.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(fr.fromString(e,...n));return Wl(s),new rd(t.firestore,null,s)}}function od(t,e){if(t=Xl(t,td),Hl("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new zs(Hs.INVALID_ARGUMENT,`Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new sd(t,null,function(t){return new fi(fr.emptyPath(),t)}(e))}function ad(t,e,...n){if(t=g(t),1===arguments.length&&(e=sr.I()),Hl("doc","path",e),t instanceof td){const s=fr.fromString(e,...n);return Ql(s),new nd(t,null,new xr(s))}{if(!(t instanceof nd||t instanceof rd))throw new zs(Hs.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(fr.fromString(e,...n));return Ql(s),new nd(t.firestore,t instanceof rd?t.converter:null,new xr(s))}}function cd(t,e){return t=g(t),e=g(e),(t instanceof nd||t instanceof rd)&&(e instanceof nd||e instanceof rd)&&t.firestore===e.firestore&&t.path===e.path&&t.converter===e.converter}function ud(t,e){return t=g(t),e=g(e),t instanceof sd&&e instanceof sd&&t.firestore===e.firestore&&Si(t._query,e._query)&&t.converter===e.converter +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class hd{constructor(){this._c=Promise.resolve(),this.mc=[],this.gc=!1,this.yc=[],this.Tc=null,this.Ec=!1,this.Ic=!1,this.Ac=[],this.ar=new $u(this,"async_queue_retry"),this.Rc=()=>{const t=ju();t&&Vs("AsyncQueue","Visibility state changed to "+t.visibilityState),this.ar.tr()};const t=ju();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.Rc)}get isShuttingDown(){return this.gc}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.bc(),this.Pc(t)}enterRestrictedMode(t){if(!this.gc){this.gc=!0,this.Ic=t||!1;const e=ju();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Rc)}}enqueue(t){if(this.bc(),this.gc)return new Promise((()=>{}));const e=new Qs;return this.Pc((()=>this.gc&&this.Ic?Promise.resolve():(t().then(e.resolve,e.reject),e.promise))).then((()=>e.promise))}enqueueRetryable(t){this.enqueueAndForget((()=>(this.mc.push(t),this.vc())))}async vc(){if(0!==this.mc.length){try{await this.mc[0](),this.mc.shift(),this.ar.reset()}catch(t){if(!Ga(t))throw t;Vs("AsyncQueue","Operation failed with retryable error: "+t)}this.mc.length>0&&this.ar.Xi((()=>this.vc()))}}Pc(t){const e=this._c.then((()=>(this.Ec=!0,t().catch((t=>{this.Tc=t,this.Ec=!1;const e=function(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}(t);throw Us("INTERNAL UNHANDLED ERROR: ",e),t})).then((t=>(this.Ec=!1,t))))));return this._c=e,e}enqueueAfterDelay(t,e,n){this.bc(),this.Ac.indexOf(t)>-1&&(e=0);const s=Sh.createAndSchedule(this,t,e,n,(t=>this.Vc(t)));return this.yc.push(s),s}bc(){this.Tc&&js()}verifyOperationInProgress(){}async Sc(){let t;do{t=this._c,await t}while(t!==this._c)}Dc(t){for(const e of this.yc)if(e.timerId===t)return!0;return!1}Cc(t){return this.Sc().then((()=>{this.yc.sort(((t,e)=>t.targetTimeMs-e.targetTimeMs));for(const e of this.yc)if(e.skipDelay(),"all"!==t&&e.timerId===t)break;return this.Sc()}))}Nc(t){this.Ac.push(t)}Vc(t){const e=this.yc.indexOf(t);this.yc.splice(e,1)}}function ld(t){return function(t,e){if("object"!=typeof t||null===t)return!1;const n=t;for(const t of["next","error","complete"])if(t in n&&"function"==typeof n[t])return!0;return!1}(t)}class dd{constructor(){this._progressObserver={},this._taskCompletionResolver=new Qs,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}onProgress(t,e,n){this._progressObserver={next:t,error:e,complete:n}}catch(t){return this._taskCompletionResolver.promise.catch(t)}then(t,e){return this._taskCompletionResolver.promise.then(t,e)}_completeWith(t){this._updateProgress(t),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(t)}_failWith(t){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(t),this._taskCompletionResolver.reject(t)}_updateProgress(t){this._lastProgress=t,this._progressObserver.next&&this._progressObserver.next(t)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const fd=-1;class gd extends td{constructor(t,e){super(t,e),this.type="firestore",this._queue=new hd,this._persistenceKey="name"in t?t.name:"[DEFAULT]"}_terminate(){return this._firestoreClient||wd(this),this._firestoreClient.terminate()}}function md(t,e){const n=i._getProvider(t,"firestore");if(n.isInitialized()){const t=n.getImmediate();if(d(n.getOptions(),e))return t;throw new zs(Hs.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(void 0!==e.cacheSizeBytes&&-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new zs(Hs.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return n.initialize({options:e})}function pd(t=i.getApp()){return i._getProvider(t,"firestore").getImmediate()}function yd(t){return t._firestoreClient||wd(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function wd(t){var e;const n=t._freezeSettings(),s=function(t,e,n,s){return new Kl(t,e,n,s.host,s.ssl,s.experimentalForceLongPolling,s.experimentalAutoDetectLongPolling,s.useFetchStreams)}(t._databaseId,(null===(e=t._app)||void 0===e?void 0:e.options.appId)||"",t._persistenceKey,n);t._firestoreClient=new Cl(t._credentials,t._queue,s)}function vd(t,e){xd(t=Xl(t,gd));const n=yd(t),s=t._freezeSettings(),r=new Sl;return Ed(n,r,new Tl(r,s.cacheSizeBytes,null==e?void 0:e.forceOwnership))}function bd(t){xd(t=Xl(t,gd));const e=yd(t),n=t._freezeSettings(),s=new Sl;return Ed(e,s,new Il(s,n.cacheSizeBytes))}function Ed(t,e,n){const s=new Qs;return t.asyncQueue.enqueue((async()=>{try{await kl(t,n),await Rl(t,e),s.resolve()}catch(t){if(!function(t){return"FirebaseError"===t.name?t.code===Hs.FAILED_PRECONDITION||t.code===Hs.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||(22===t.code||20===t.code||11===t.code)}(t))throw t;console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+t),s.reject(t)}})).then((()=>s.promise))}function Td(t){if(t._initialized&&!t._terminated)throw new zs(Hs.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");const e=new Qs;return t._queue.enqueueAndForgetEvenWhileRestricted((async()=>{try{await async function(t){if(!ja.bt())return Promise.resolve();const e=t+"main";await ja.delete(e)}(Zc(t._databaseId,t._persistenceKey)),e.resolve()}catch(t){e.reject(t)}})),e.promise}function Id(t){return function(t){const e=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e){const n=Gs(t);ih(n.remoteStore)||Vs("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");try{const t=await function(t){const e=Gs(t);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(t=>e.In.getHighestUnacknowledgedBatchId(t)))}(n.localStore);if(-1===t)return void e.resolve();const s=n.Ko.get(t)||[];s.push(e),n.Ko.set(t,s)}catch(t){const n=_h(t,"Initialization of waitForPendingWrites() operation failed");e.reject(n)}}(await Vl(t),e))),e.promise}(yd(t=Xl(t,gd)))}function Sd(t){return function(t){return t.asyncQueue.enqueue((async()=>{const e=await Ml(t),n=await Pl(t);return e.setNetworkEnabled(!0),function(t){const e=Gs(t);return e.Wr.delete(0),Xu(e)}(n)}))}(yd(t=Xl(t,gd)))}function _d(t){return function(t){return t.asyncQueue.enqueue((async()=>{const e=await Ml(t),n=await Pl(t);return e.setNetworkEnabled(!1),async function(t){const e=Gs(t);e.Wr.add(0),await Ju(e),e.Hr.set("Offline")}(n)}))}(yd(t=Xl(t,gd)))}function Nd(t){return i._removeServiceInstance(t.app,"firestore"),t._delete()}function Ad(t,e){const n=yd(t=Xl(t,gd)),s=new dd;return jl(n,t._databaseId,e,s),s}function Dd(t,e){return function(t,e){return t.asyncQueue.enqueue((async()=>function(t,e){const n=Gs(t);return n.persistence.runTransaction("Get named query","readonly",(t=>n.Je.getNamedQuery(t,e)))}(await Fl(t),e)))}(yd(t=Xl(t,gd)),e).then((e=>e?new sd(t,null,e.query):null))}function xd(t){if(t._initialized||t._terminated)throw new zs(Hs.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.")} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Cd{constructor(...t){for(let e=0;e90)throw new zs(Hs.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new zs(Hs.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}get latitude(){return this._lat}get longitude(){return this._long}isEqual(t){return this._lat===t._lat&&this._long===t._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(t){return rr(this._lat,t._lat)||rr(this._long,t._long)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Md=/^__.*__$/;class Fd{constructor(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}toMutation(t,e){return null!==this.fieldMask?new no(t,this.data,this.fieldMask,e,this.fieldTransforms):new eo(t,this.data,e,this.fieldTransforms)}}class Pd{constructor(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}toMutation(t,e){return new no(t,this.data,this.fieldMask,e,this.fieldTransforms)}}function Vd(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw js()}}class Ud{constructor(t,e,n,s,r,i){this.settings=t,this.databaseId=e,this.N=n,this.ignoreUndefinedProperties=s,void 0===r&&this.xc(),this.fieldTransforms=r||[],this.fieldMask=i||[]}get path(){return this.settings.path}get kc(){return this.settings.kc}$c(t){return new Ud(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.N,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Oc(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),s=this.$c({path:n,Fc:!1});return s.Mc(t),s}Lc(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),s=this.$c({path:n,Fc:!1});return s.xc(),s}Bc(t){return this.$c({path:void 0,Fc:!0})}Uc(t){return of(t,this.settings.methodName,this.settings.qc||!1,this.path,this.settings.Kc)}contains(t){return void 0!==this.fieldMask.find((e=>t.isPrefixOf(e)))||void 0!==this.fieldTransforms.find((e=>t.isPrefixOf(e.field)))}xc(){if(this.path)for(let t=0;tc.covers(t.field)))}else c=null,u=o.fieldTransforms;return new Fd(new $r(a),c,u)}class Kd extends Ld{_toFieldTransform(t){if(2!==t.kc)throw 1===t.kc?t.Uc(`${this._methodName}() can only appear at the top level of your update data`):t.Uc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return t.fieldMask.push(t.path),null}isEqual(t){return t instanceof Kd}}function $d(t,e,n){return new Ud({kc:3,Kc:e.settings.Kc,methodName:t._methodName,Fc:n},e.databaseId,e.N,e.ignoreUndefinedProperties)}class Gd extends Ld{_toFieldTransform(t){return new Gi(t.path,new Pi)}isEqual(t){return t instanceof Gd}}class Hd extends Ld{constructor(t,e){super(t),this.Qc=e}_toFieldTransform(t){const e=$d(this,t,!0),n=this.Qc.map((t=>Jd(t,e))),s=new Vi(n);return new Gi(t.path,s)}isEqual(t){return this===t}}class zd extends Ld{constructor(t,e){super(t),this.Qc=e}_toFieldTransform(t){const e=$d(this,t,!0),n=this.Qc.map((t=>Jd(t,e))),s=new qi(n);return new Gi(t.path,s)}isEqual(t){return this===t}}class Qd extends Ld{constructor(t,e){super(t),this.Wc=e}_toFieldTransform(t){const e=new ji(t.N,Ri(t.N,this.Wc));return new Gi(t.path,e)}isEqual(t){return this===t}}function Wd(t,e,n,s){const r=t.jc(1,e,n);ef("Data must be an object, but it was:",r,s);const i=[],o=$r.empty();hr(s,((t,s)=>{const a=rf(e,t,n);s=g(s);const c=r.Lc(a);if(s instanceof Kd)i.push(a);else{const t=Jd(s,c);null!=t&&(i.push(a),o.set(a,t))}}));const a=new pr(i);return new Pd(o,a,r.fieldTransforms)}function Yd(t,e,n,s,r,i){const o=t.jc(1,e,n),a=[nf(e,s,n)],c=[r];if(i.length%2!=0)throw new zs(Hs.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let t=0;t=0;--t)if(!af(u,a[t])){const e=a[t];let n=c[t];n=g(n);const s=o.Lc(e);if(n instanceof Kd)u.push(e);else{const t=Jd(n,s);null!=t&&(u.push(e),h.set(e,t))}}const l=new pr(u);return new Pd(h,l,o.fieldTransforms)}function Xd(t,e,n,s=!1){return Jd(n,t.jc(s?4:3,e))}function Jd(t,e){if(tf(t=g(t)))return ef("Unsupported field value:",e,t),Zd(t,e);if(t instanceof Ld)return function(t,e){if(!Vd(e.kc))throw e.Uc(`${t._methodName}() can only be used with update() and set()`);if(!e.path)throw e.Uc(`${t._methodName}() is not currently supported inside arrays`);const n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.Fc&&4!==e.kc)throw e.Uc("Nested arrays are not supported");return function(t,e){const n=[];let s=0;for(const r of t){let t=Jd(r,e.Bc(s));null==t&&(t={nullValue:"NULL_VALUE"}),n.push(t),s++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=g(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return Ri(e.N,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){const n=ar.fromDate(t);return{timestampValue:Bo(e.N,n)}}if(t instanceof ar){const n=new ar(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:Bo(e.N,n)}}if(t instanceof Od)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof Rd)return{bytesValue:jo(e.N,t._byteString)};if(t instanceof nd){const n=e.databaseId,s=t.firestore._databaseId;if(!s.isEqual(n))throw e.Uc(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:Go(t.firestore._databaseId||e.databaseId,t._key.path)}}throw e.Uc(`Unsupported field value: ${Yl(t)}`)}(t,e)}function Zd(t,e){const n={};return lr(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):hr(t,((t,s)=>{const r=Jd(s,e.Oc(t));null!=r&&(n[t]=r)})),{mapValue:{fields:n}}}function tf(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof ar||t instanceof Od||t instanceof Rd||t instanceof nd||t instanceof Ld)}function ef(t,e,n){if(!tf(n)||!function(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){const s=Yl(n);throw"an object"===s?e.Uc(t+" a custom object"):e.Uc(t+" "+s)}}function nf(t,e,n){if((e=g(e))instanceof Cd)return e._internalPath;if("string"==typeof e)return rf(t,e);throw of("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}const sf=new RegExp("[~\\*/\\[\\]]");function rf(t,e,n){if(e.search(sf)>=0)throw of(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Cd(...e.split("."))._internalPath}catch(s){throw of(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function of(t,e,n,s,r){const i=s&&!s.isEmpty(),o=void 0!==r;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(i||o)&&(c+=" (found",i&&(c+=` in field ${s}`),o&&(c+=` in document ${r}`),c+=")"),new zs(Hs.INVALID_ARGUMENT,a+t+c)}function af(t,e){return t.some((t=>t.isEqual(e)))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class cf{constructor(t,e,n,s,r){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=s,this._converter=r}get id(){return this._key.path.lastSegment()}get ref(){return new nd(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const t=new uf(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}get(t){if(this._document){const e=this._document.data.field(hf("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}}}class uf extends cf{data(){return super.data()}}function hf(t,e){return"string"==typeof e?rf(t,e):e instanceof Cd?e._internalPath:e._delegate._internalPath} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class lf{constructor(t,e){this.hasPendingWrites=t,this.fromCache=e}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class df extends cf{constructor(t,e,n,s,r,i){super(t,e,n,s,i),this._firestore=t,this._firestoreImpl=t,this.metadata=r}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const e=new ff(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,e={}){if(this._document){const n=this._document.data.field(hf("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}}}class ff extends df{data(t={}){return super.data(t)}}class gf{constructor(t,e,n,s){this._firestore=t,this._userDataWriter=e,this._snapshot=s,this.metadata=new lf(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const t=[];return this.forEach((e=>t.push(e))),t}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(t,e){this._snapshot.docs.forEach((n=>{t.call(e,new ff(this._firestore,this._userDataWriter,n.key,n,new lf(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(t={}){const e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new zs(Hs.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){let e=0;return t._snapshot.docChanges.map((n=>({type:"added",doc:new ff(t._firestore,t._userDataWriter,n.doc.key,n.doc,new lf(t._snapshot.mutatedKeys.has(n.doc.key),t._snapshot.fromCache),t.query.converter),oldIndex:-1,newIndex:e++})))}{let n=t._snapshot.oldDocs;return t._snapshot.docChanges.filter((t=>e||3!==t.type)).map((e=>{const s=new ff(t._firestore,t._userDataWriter,e.doc.key,e.doc,new lf(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter);let r=-1,i=-1;return 0!==e.type&&(r=n.indexOf(e.doc.key),n=n.delete(e.doc.key)),1!==e.type&&(n=n.add(e.doc),i=n.indexOf(e.doc.key)),{type:mf(e.type),doc:s,oldIndex:r,newIndex:i}}))}}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges}}function mf(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return js()}}function pf(t,e){return t instanceof df&&e instanceof df?t._firestore===e._firestore&&t._key.isEqual(e._key)&&(null===t._document?null===e._document:t._document.isEqual(e._document))&&t._converter===e._converter:t instanceof gf&&e instanceof gf&&t._firestore===e._firestore&&ud(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._snapshot.isEqual(e._snapshot)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function yf(t){if(yi(t)&&0===t.explicitOrderBy.length)throw new zs(Hs.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class wf{}function vf(t,...e){for(const n of e)t=n._apply(t);return t}class bf extends wf{constructor(t,e,n){super(),this.Gc=t,this.zc=e,this.Hc=n,this.type="where"}_apply(t){const e=Bd(t.firestore),n=function(t,e,n,s,r,i,o){let a;if(r.isKeyField()){if("array-contains"===i||"array-contains-any"===i)throw new zs(Hs.INVALID_ARGUMENT,`Invalid Query. You can't perform '${i}' queries on FieldPath.documentId().`);if("in"===i||"not-in"===i){Mf(o,i);const e=[];for(const n of o)e.push(Of(s,t,n));a={arrayValue:{values:e}}}else a=Of(s,t,o)}else"in"!==i&&"not-in"!==i&&"array-contains-any"!==i||Mf(o,i),a=Xd(n,"where",o,"in"===i||"not-in"===i);const c=Jr.create(r,i,a);return function(t,e){if(e.v()){const n=vi(t);if(null!==n&&!n.isEqual(e.field))throw new zs(Hs.INVALID_ARGUMENT,`Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);const s=wi(t);null!==s&&Ff(t,e.field,s)}const n=function(t,e){for(const n of t.filters)if(e.indexOf(n.op)>=0)return n.op;return null}(t,function(t){switch(t){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(null!==n)throw n===e.op?new zs(Hs.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new zs(Hs.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}(t,c),c}(t._query,0,e,t.firestore._databaseId,this.Gc,this.zc,this.Hc);return new sd(t.firestore,t.converter,function(t,e){const n=t.filters.concat([e]);return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}(t._query,n))}}function Ef(t,e,n){const s=e,r=hf("where",t);return new bf(r,s,n)}class Tf extends wf{constructor(t,e){super(),this.Gc=t,this.Jc=e,this.type="orderBy"}_apply(t){const e=function(t,e,n){if(null!==t.startAt)throw new zs(Hs.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new zs(Hs.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");const s=new ui(e,n);return function(t,e){if(null===wi(t)){const n=vi(t);null!==n&&Ff(t,n,e.field)}}(t,s),s}(t._query,this.Gc,this.Jc);return new sd(t.firestore,t.converter,function(t,e){const n=t.explicitOrderBy.concat([e]);return new fi(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(t._query,e))}}function If(t,e="asc"){const n=e,s=hf("orderBy",t);return new Tf(s,n)}class Sf extends wf{constructor(t,e,n){super(),this.type=t,this.Yc=e,this.Xc=n}_apply(t){return new sd(t.firestore,t.converter,Ii(t._query,this.Yc,this.Xc))}}function _f(t){return Jl("limit",t),new Sf("limit",t,"F")}function Nf(t){return Jl("limitToLast",t),new Sf("limitToLast",t,"L")}class Af extends wf{constructor(t,e,n){super(),this.type=t,this.Zc=e,this.ta=n}_apply(t){const e=Lf(t,this.type,this.Zc,this.ta);return new sd(t.firestore,t.converter,function(t,e){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,e,t.endAt)}(t._query,e))}}function Df(...t){return new Af("startAt",t,!0)}function xf(...t){return new Af("startAfter",t,!1)}class Cf extends wf{constructor(t,e,n){super(),this.type=t,this.Zc=e,this.ta=n}_apply(t){const e=Lf(t,this.type,this.Zc,this.ta);return new sd(t.firestore,t.converter,function(t,e){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,e)}(t._query,e))}}function kf(...t){return new Cf("endBefore",t,!0)}function Rf(...t){return new Cf("endAt",t,!1)}function Lf(t,e,n,s){if(n[0]=g(n[0]),n[0]instanceof cf)return function(t,e,n,s,r){if(!s)throw new zs(Hs.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${n}().`);const i=[];for(const n of Ei(t))if(n.field.isKeyField())i.push(Pr(e,s.key));else{const t=s.data.field(n.field);if(Ir(t))throw new zs(Hs.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+n.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===t){const t=n.field.canonicalString();throw new zs(Hs.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`)}i.push(t)}return new ai(i,r)}(t._query,t.firestore._databaseId,e,n[0]._document,s);{const r=Bd(t.firestore);return function(t,e,n,s,r,i){const o=t.explicitOrderBy;if(r.length>o.length)throw new zs(Hs.INVALID_ARGUMENT,`Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);const a=[];for(let i=0;i10)throw new zs(Hs.INVALID_ARGUMENT,`Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`)}function Ff(t,e,n){if(!n.isEqual(e))throw new zs(Hs.INVALID_ARGUMENT,`Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Pf{convertValue(t,e="none"){switch(Cr(t)){case 0:return null;case 1:return t.booleanValue;case 2:return Er(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(Tr(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw js()}}convertObject(t,e){const n={};return hr(t.fields,((t,s)=>{n[t]=this.convertValue(s,e)})),n}convertGeoPoint(t){return new Od(Er(t.latitude),Er(t.longitude))}convertArray(t,e){return(t.values||[]).map((t=>this.convertValue(t,e)))}convertServerTimestamp(t,e){switch(e){case"previous":const n=Sr(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(_r(t));default:return null}}convertTimestamp(t){const e=br(t);return new ar(e.seconds,e.nanos)}convertDocumentKey(t,e){const n=fr.fromString(t);Ks(pa(n));const s=new $l(n.get(1),n.get(3)),r=new xr(n.popFirst(5));return s.isEqual(e)||Us(`Document ${r} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`),r}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Vf(t,e,n){let s;return s=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,s}class Uf extends Pf{constructor(t){super(),this.firestore=t}convertBytes(t){return new Rd(t)}convertReference(t){const e=this.convertDocumentKey(t,this.firestore._databaseId);return new nd(this.firestore,null,e)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qf{constructor(t,e){this._firestore=t,this._commitHandler=e,this._mutations=[],this._committed=!1,this._dataReader=Bd(t)}set(t,e,n){this._verifyNotCommitted();const s=Bf(t,this._firestore),r=Vf(s.converter,e,n),i=jd(this._dataReader,"WriteBatch.set",s._key,r,null!==s.converter,n);return this._mutations.push(i.toMutation(s._key,zi.none())),this}update(t,e,n,...s){this._verifyNotCommitted();const r=Bf(t,this._firestore);let i;return i="string"==typeof(e=g(e))||e instanceof Cd?Yd(this._dataReader,"WriteBatch.update",r._key,e,n,s):Wd(this._dataReader,"WriteBatch.update",r._key,e),this._mutations.push(i.toMutation(r._key,zi.exists(!0))),this}delete(t){this._verifyNotCommitted();const e=Bf(t,this._firestore);return this._mutations=this._mutations.concat(new oo(e._key,zi.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new zs(Hs.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function Bf(t,e){if((t=g(t)).firestore!==e)throw new zs(Hs.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function jf(t){t=Xl(t,nd);const e=Xl(t.firestore,gd);return ql(yd(e),t._key).then((n=>ng(e,t,n)))}class Kf extends Pf{constructor(t){super(),this.firestore=t}convertBytes(t){return new Rd(t)}convertReference(t){const e=this.convertDocumentKey(t,this.firestore._databaseId);return new nd(this.firestore,null,e)}}function $f(t){t=Xl(t,nd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){try{const s=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("read document","readonly",(t=>n.Qn.An(t,e)))}(t,e);s.isFoundDocument()?n.resolve(s):s.isNoDocument()?n.resolve(null):n.reject(new zs(Hs.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"))}catch(t){const s=_h(t,`Failed to get document '${e} from cache`);n.reject(s)}}(await Fl(t),e,n))),n.promise}(n,t._key).then((n=>new df(e,s,t._key,n,new lf(null!==n&&n.hasLocalMutations,!0),t.converter)))}function Gf(t){t=Xl(t,nd);const e=Xl(t.firestore,gd);return ql(yd(e),t._key,{source:"server"}).then((n=>ng(e,t,n)))}function Hf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return yf(t._query),Bl(n,t._query).then((n=>new gf(e,s,t,n)))}function zf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){try{const s=await du(t,e,!0),r=new Kh(e,s.Gn),i=r.bo(s.documents),o=r.applyChanges(i,!1);n.resolve(o.snapshot)}catch(t){const s=_h(t,`Failed to execute query '${e} against cache`);n.reject(s)}}(await Fl(t),e,n))),n.promise}(n,t._query).then((n=>new gf(e,s,t,n)))}function Qf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return Bl(n,t._query,{source:"server"}).then((n=>new gf(e,s,t,n)))}function Wf(t,e,n){t=Xl(t,nd);const s=Xl(t.firestore,gd),r=Vf(t.converter,e,n);return eg(s,[jd(Bd(s),"setDoc",t._key,r,null!==t.converter,n).toMutation(t._key,zi.none())])}function Yf(t,e,n,...s){t=Xl(t,nd);const r=Xl(t.firestore,gd),i=Bd(r);let o;return o="string"==typeof(e=g(e))||e instanceof Cd?Yd(i,"updateDoc",t._key,e,n,s):Wd(i,"updateDoc",t._key,e),eg(r,[o.toMutation(t._key,zi.exists(!0))])}function Xf(t){return eg(Xl(t.firestore,gd),[new oo(t._key,zi.none())])}function Jf(t,e){const n=Xl(t.firestore,gd),s=ad(t),r=Vf(t.converter,e);return eg(n,[jd(Bd(t.firestore),"addDoc",s._key,r,null!==t.converter,{}).toMutation(s._key,zi.exists(!1))]).then((()=>s))}function Zf(t,...e){var n,s,r;t=g(t);let i={includeMetadataChanges:!1},o=0;"object"!=typeof e[o]||ld(e[o])||(i=e[o],o++);const a={includeMetadataChanges:i.includeMetadataChanges};if(ld(e[o])){const t=e[o];e[o]=null===(n=t.next)||void 0===n?void 0:n.bind(t),e[o+1]=null===(s=t.error)||void 0===s?void 0:s.bind(t),e[o+2]=null===(r=t.complete)||void 0===r?void 0:r.bind(t)}let c,u,h;if(t instanceof nd)u=Xl(t.firestore,gd),h=mi(t._key.path),c={next:n=>{e[o]&&e[o](ng(u,t,n))},error:e[o+1],complete:e[o+2]};else{const n=Xl(t,sd);u=Xl(n.firestore,gd),h=n._query;const s=new Kf(u);c={next:t=>{e[o]&&e[o](new gf(u,s,n,t))},error:e[o+1],complete:e[o+2]},yf(t._query)}return function(t,e,n,s){const r=new Nl(s),i=new Fh(e,r,n);return t.asyncQueue.enqueueAndForget((async()=>kh(await Ul(t),i))),()=>{r.ec(),t.asyncQueue.enqueueAndForget((async()=>Rh(await Ul(t),i)))}}(yd(u),h,a,c)}function tg(t,e){return function(t,e){const n=new Nl(e);return t.asyncQueue.enqueueAndForget((async()=>function(t,e){Gs(t).so.add(e),e.next()}(await Ul(t),n))),()=>{n.ec(),t.asyncQueue.enqueueAndForget((async()=>function(t,e){Gs(t).so.delete(e)}(await Ul(t),n)))}}(yd(t=Xl(t,gd)),ld(e)?e:{next:e})}function eg(t,e){return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){const s=bl(t);try{const t=await function(t,e){const n=Gs(t),s=ar.now(),r=e.reduce(((t,e)=>t.add(e.key)),No());let i;return n.persistence.runTransaction("Locally write mutations","readwrite",(t=>n.Qn.Pn(t,r).next((r=>{i=r;const o=[];for(const t of e){const e=Ji(t,i.get(t.key));null!=e&&o.push(new no(t.key,e,Gr(e.value.mapValue),zi.exists(!0)))}return n.In.addMutationBatch(t,s,o,e)})))).then((t=>(t.applyToLocalDocumentSet(i),{batchId:t.batchId,changes:i})))}(s.localStore,e);s.sharedClientState.addPendingMutation(t.batchId),function(t,e,n){let s=t.qo[t.currentUser.toKey()];s||(s=new go(rr)),s=s.insert(e,n),t.qo[t.currentUser.toKey()]=s}(s,t.batchId,n),await cl(s,t.changes),await dh(s.remoteStore)}catch(t){const e=_h(t,"Failed to persist write");n.reject(e)}}(await Vl(t),e,n))),n.promise}(yd(t),e)}function ng(t,e,n){const s=n.docs.get(e._key),r=new Kf(t);return new df(t,r,e._key,s,new lf(n.hasPendingWrites,n.fromCache),e.converter)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class sg extends class{constructor(t,e){this._firestore=t,this._transaction=e,this._dataReader=Bd(t)}get(t){const e=Bf(t,this._firestore),n=new Uf(this._firestore);return this._transaction.lookup([e._key]).then((t=>{if(!t||1!==t.length)return js();const s=t[0];if(s.isFoundDocument())return new cf(this._firestore,n,s.key,s,e.converter);if(s.isNoDocument())return new cf(this._firestore,n,e._key,null,e.converter);throw js()}))}set(t,e,n){const s=Bf(t,this._firestore),r=Vf(s.converter,e,n),i=jd(this._dataReader,"Transaction.set",s._key,r,null!==s.converter,n);return this._transaction.set(s._key,i),this}update(t,e,n,...s){const r=Bf(t,this._firestore);let i;return i="string"==typeof(e=g(e))||e instanceof Cd?Yd(this._dataReader,"Transaction.update",r._key,e,n,s):Wd(this._dataReader,"Transaction.update",r._key,e),this._transaction.update(r._key,i),this}delete(t){const e=Bf(t,this._firestore);return this._transaction.delete(e._key),this}}{constructor(t,e){super(t,e),this._firestore=t}get(t){const e=Bf(t,this._firestore),n=new Kf(this._firestore);return super.get(t).then((t=>new df(this._firestore,n,e._key,t._document,new lf(!1,!1),e.converter)))}}function rg(t,e){return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>{const s=await function(t){return Ol(t).then((t=>t.datastore))}(t);new xl(t.asyncQueue,s,e,n).run()})),n.promise}(yd(t=Xl(t,gd)),(n=>e(new sg(t,n))))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ig(){return new Kd("deleteField")}function og(){return new Gd("serverTimestamp")}function ag(...t){return new Hd("arrayUnion",t)}function cg(...t){return new zd("arrayRemove",t)}function ug(t){return new Qd("increment",t)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function hg(t){return yd(t=Xl(t,gd)),new qf(t,(e=>eg(t,e)))}!function(t,e=!0){!function(t){Os=t}(i.SDK_VERSION),i._registerComponent(new m("firestore",((t,{options:n})=>{const s=t.getProvider("app").getImmediate(),r=new gd(s,new Js(t.getProvider("auth-internal")));return n=Object.assign({useFetchStreams:e},n),r._setSettings(n),r}),"PUBLIC")),i.registerVersion(Rs,"3.2.1",t),i.registerVersion(Rs,"3.2.1","esm2017")}()}))})(); \ No newline at end of file diff --git a/frontend-dist/help-circle-outline.a023036a.svg b/frontend-dist/help-circle-outline.a023036a.svg new file mode 100644 index 0000000000..17ce1e0bc9 --- /dev/null +++ b/frontend-dist/help-circle-outline.a023036a.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/index.1a7d4001.js b/frontend-dist/index.1a7d4001.js new file mode 100644 index 0000000000..678f21633b --- /dev/null +++ b/frontend-dist/index.1a7d4001.js @@ -0,0 +1,39 @@ +var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},t={},o={},n=e.parcelRequire94c2;null==n&&((n=function(e){if(e in t)return t[e].exports;if(e in o){var n=o[e];delete o[e];var r={id:e,exports:{}};return t[e]=r,n.call(r.exports,r,r.exports),r.exports}var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){o[e]=t},e.parcelRequire94c2=n);var r=n("fBBKY");n("8aCbc");var a,s,l,i,c={};a=c,s="Welcome",l=()=>j,i=e=>j=e,Object.defineProperty(a,s,{get:l,set:i,enumerable:!0,configurable:!0}),n("9lAXI");r=n("fBBKY"),r=n("fBBKY");var d=n("5Kx1V");const u=async()=>{let e=await fetch("https://api.github.com/repos/fonsp/Pluto.jl/releases",{method:"GET",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer"});return(await e.json()).reverse()};n("9lAXI");r=n("fBBKY");var p=n("85ulz");r=n("fBBKY");const h=e=>{const t=`${e}\n`.replace("\r\n","\n"),o=t.indexOf("### A Pluto.jl notebook ###"),n=t.match(/# ... ........-....-....-....-............/g)?.length;let r=t.indexOf("# ╔═╡ Cell order:")+17+1;for(let e=1;e<=n;e++)r=t.indexOf("\n",r+1)+1;return t.slice(o,r)},f=async e=>{let t;if(console.log(e),(e?.path??e?.composedPath()).filter((e=>e?.classList?.contains(".cm-editor")))?.length>0)return;switch(e.type){case"paste":t=h(e.clipboardData.getData("text/plain"));break;case"dragstart":return void(e.dataTransfer.dropEffect="move");case"dragover":return void e.preventDefault();case"drop":e.preventDefault(),t=e.dataTransfer.types.includes("Files")?await(n=e.dataTransfer.files[0],new Promise(((e,t)=>{const{name:o,type:r}=n,a=new FileReader;a.onerror=()=>t("Failed to read file!"),a.onloadstart=()=>{},a.onprogress=({loaded:e,total:t})=>{},a.onload=()=>{},a.onloadend=({target:{result:t}})=>e({file:t,name:o,type:r}),a.readAsText(n)}))).then((({file:e})=>e)):h(await(o=e.dataTransfer.items[0],new Promise(((e,t)=>{try{o.getAsString((t=>{console.log(t),e(t)}))}catch(e){t(e)}}))))}var o,n;if(!t)return;document.body.classList.add("loading");const r=await fetch("./notebookupload",{method:"POST",body:t});if(r.ok)window.location.href=k(await r.text());else{let e=await r.blob();window.location.href=URL.createObjectURL(e)}},m=()=>(r.useEffect((()=>(document.addEventListener("paste",f),document.addEventListener("drop",f),document.addEventListener("dragstart",f),document.addEventListener("dragover",f),()=>{document.removeEventListener("paste",f),document.removeEventListener("drop",f),document.removeEventListener("dragstart",f),document.removeEventListener("dragover",f)}))),r.html``),g=e=>e.toLowerCase().normalize("NFD").replace(/[^a-z1-9]/g,""),b=({client:e,connected:t,CustomPicker:o,show_samples:n})=>{const a=o??{text:"Open from file",placeholder:"Enter path or URL..."};return r.html`

New session:

+ <${m} /> +
    + ${n&&r.html`
  • Open a sample notebook
  • `} +
  • Create a new notebook
  • +
  • + ${a.text}: + <${p.FilePicker} + key=${a.placeholder} + client=${e} + value="" + on_submit=${async e=>{const t=await(async e=>{try{const t=new URL(e);if(!["http:","https:","ftp:","ftps:"].includes(t.protocol))throw"Not a web URL";if("gist.github.com"===t.host){console.log("Gist URL detected");const e=t.pathname.substring(1).split("/")[1],o=await(await fetch(`https://api.github.com/gists/${e}`,{headers:{Accept:"application/vnd.github.v3+json"}}).then((e=>e.ok?e:Promise.reject(e)))).json();console.log(o);const n=Object.values(o.files),r=n.find((e=>g("#file-"+e.filename)===g(t.hash)));return null!=r?{type:"url",path_or_url:r.raw_url}:{type:"url",path_or_url:n[0].raw_url}}return"github.com"===t.host&&t.searchParams.set("raw","true"),{type:"url",path_or_url:t.href}}catch(t){return'"'===e[e.length-1]&&'"'===e[0]&&(e=e.slice(1,-1)),{type:"path",path_or_url:e}}})(e);"path"===t.type?(document.body.classList.add("loading"),window.location.href=_(t.path_or_url)):confirm("Are you sure? This will download and run the file at\n\n"+t.path_or_url)&&(document.body.classList.add("loading"),window.location.href=w(t.path_or_url))}} + button_label="Open" + placeholder=${a.placeholder} + /> +
  • +
`},_=e=>"open?"+new URLSearchParams({path:e}).toString(),w=e=>"open?"+new URLSearchParams({url:e}).toString(),k=e=>"edit?id="+e;var v=n("9lAXI"),y=(r=n("fBBKY"),r=n("fBBKY"),n("inK2Y"));const $=(e,t=null)=>({transitioning:!1,notebook_id:t,path:e}),L=(e,t)=>e.split(/\/|\\/).slice(-t).join("/"),P=({client:e,connected:t,remote_notebooks:o,CustomRecent:n})=>{const[a,s]=r.useState(null),l=r.useRef(a);l.current=a;const i=(e,t)=>{s((o=>o.map((o=>o.path==e?{...o,...t}:o))))};r.useEffect((()=>{null!=e&&t&&e.send("get_all_notebooks",{},{}).then((({message:e})=>{const t=e.notebooks.map((e=>$(e.path,e.notebook_id))),o=E(),n=[...v.default.sortBy(t,[e=>v.default.findIndex([...o,...t],(t=>t.path===e.path))]),...v.default.differenceBy(o,t,(e=>e.path))];s(n),document.body.classList.remove("loading")}))}),[null!=e&&t]),r.useEffect((()=>{const e=o;if(null!=l.current){const t=[],o=l.current.map((o=>{let n=null;if(n=o.notebook_id?e.find((e=>e.notebook_id==o.notebook_id)):e.find((e=>e.path==o.path)),null==n)return $(o.path);{const e=$(n.path,n.notebook_id);return t.push(n),e}})),n=e.filter((e=>!t.includes(e))).map((e=>$(e.path,e.notebook_id)));s([...n,...o])}}),[o]);r.useEffect((()=>{document.body.classList.toggle("nosessions",!(null==a||a.length>0))}),[a]);const c=a?.map((e=>e.path));let d=null==a?r.html`
  • Loading...
  • `:a.map((t=>{const o=null!=t.notebook_id;return r.html`
  • + + {o||(document.body.classList.add("loading"),i(t.path,{transitioning:!0}))}} + >${((e,t)=>{let o=1;for(const n of t)if(n!==e)for(;L(e,o)===L(n,o);)o++;return L(e,o)})(t.path,c)} +
  • `}));return null==n?r.html` +

    Recent sessions:

    +
      + ${d} +
    + `:r.html`<${n} cl=${y.cl} combined=${a} client=${e} recents=${d} />`},E=()=>{const e=localStorage.getItem("recent notebooks"),t=null!=e?JSON.parse(e):[];return(t instanceof Array?t:[]).map((e=>$(e)))},j=()=>{const[e,t]=r.useState(null),[o,n]=r.useState(!1),[a,s]=r.useState({show_samples:!0,CustomPicker:null,CustomRecent:null}),l=r.useRef({});r.useEffect((()=>{const e=n;d.create_pluto_connection({on_unrequested_update:({message:e,type:o})=>{"notebook_list"===o&&t(e.notebooks)},on_connection_status:e,on_reconnect:()=>!0}).then((async e=>{Object.assign(l.current,e),n(!0);try{const{default:t}=await import(e.session_options.server.injected_javascript_data_url),{custom_recent:o,custom_filepicker:n,show_samples:a=!0}=t({client:e,editor:void 0,imports:{preact:r}});s((e=>({...e,CustomRecent:o,CustomPicker:n,show_samples:a})))}catch(e){}(e=>{u().then((t=>{const o=e.version_info.pluto,n=t[t.length-1].tag_name;console.log(`Pluto version ${o}`);const r=t.findIndex((e=>e.tag_name===o));-1!==r&&t.slice(r+1).filter((e=>e.body.toLowerCase().includes("recommended update"))).length>0&&(console.log(`Newer version ${n} is available`),e.version_info.dismiss_update_notification||alert("A new version of Pluto.jl is available! 🎉\n\n You have "+o+", the latest is "+n+'.\n\nYou can update Pluto.jl using the julia package manager:\n import Pkg; Pkg.update("Pluto")\nAfterwards, exit Pluto.jl and restart julia.'))})).catch((()=>{}))})(e),e.send("completepath",{query:""},{})}))}),[]);const{show_samples:i,CustomRecent:c,CustomPicker:p}=a;return r.html` + <${b} client=${l.current} connected=${o} CustomPicker=${p} show_samples=${i} /> +
    + <${P} client=${l.current} connected=${o} remote_notebooks=${e} CustomRecent=${c} /> + `};r.render(r.html`<${c.Welcome} />`,document.querySelector("main")); \ No newline at end of file diff --git a/frontend-dist/index.755a8767.css b/frontend-dist/index.755a8767.css new file mode 100644 index 0000000000..7c62839265 --- /dev/null +++ b/frontend-dist/index.755a8767.css @@ -0,0 +1 @@ +*{box-sizing:border-box}#title{display:block;margin-top:34vh;text-align:center;width:100%}body.error #title{margin-top:10vh}#title h1,#title h2{border-bottom:2px solid var(--rule-color);color:var(--pluto-output-h-color);font-family:Vollkorn,serif;font-size:2em;font-style:italic;font-weight:500;letter-spacing:.08em;margin:0}#title h2{font-size:1.4em}#title img{filter:var(--image-filters);height:1.2em;margin-bottom:-.27em;margin-left:.1em}body{background:var(--main-bg-color);margin:0;min-height:100%;position:absolute;width:100%}main{color:var(--index-text-color);font-family:Roboto Mono,monospace;margin:20vh auto 0;text-align:left;width:15em}body.error main{font-size:14px;margin-top:5vh;max-width:40em;padding:.5em;width:unset}p{color:var(--index-clickable-text-color)}ul{list-style:none;padding-left:.5em}li{margin-bottom:.9em;white-space:nowrap}a{color:inherit;color:var(--index-clickable-text-color)}pluto-filepicker{display:flex;flex-direction:row;margin-top:.3rem}pluto-filepicker .cm-editor{background:none;border:2px solid var(--nav-filepicker-border-color);border-radius:3px;border-bottom-right-radius:0;border-right:none;border-top-right-radius:0;color:var(--nav-filepicker-color);display:inline-block;font-family:Roboto Mono,monospace;font-size:.75rem;font-style:normal;font-weight:500;height:calc(1rem + 12px);letter-spacing:1px;width:100%}pluto-filepicker .cm-scroller{scrollbar-width:none}pluto-filepicker .cm-scroller::-webkit-scrollbar{display:none}pluto-filepicker button{background:var(--footer-filepicker-focus-color);border:2px solid var(--nav-filepicker-focus-color);border-radius:3px;border-bottom-left-radius:0;border-top-left-radius:0;color:var(--white);cursor:pointer;font-family:Roboto Mono,monospace;font-size:.75rem;font-weight:600;margin:0}pluto-filepicker button:disabled{cursor:not-allowed;opacity:.7}.cm-editor .cm-tooltip{border:1px solid var(--cm-editor-tooltip-border-color);border-radius:4px;box-shadow:3px 3px 4px rgb(0 0 0/20%)}.cm-tooltip-autocomplete{box-sizing:content-box;max-height:320px;z-index:100}.cm-tooltip.cm-completionInfo.cm-completionInfo-right:empty{display:none}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li{border-radius:3px;height:16px;line-height:16px;margin-bottom:unset;overflow-y:hidden}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li[aria-selected]{background:var(--cm-editor-li-aria-selected-bg-color);color:var(--cm-editor-li-aria-selected-color)}.cm-editor .cm-completionIcon{opacity:1;transform:translateY(-1.5px);width:1em}.cm-completionIcon:before{color:transparent;content:"⚫";margin-right:.5em;opacity:1}.cm-tooltip.cm-tooltip-autocomplete{background:var(--autocomplete-menu-bg-color);margin-left:-1.5em;padding:0}.cm-tooltip-autocomplete li.file.new:before{content:"👉 "}.cm-tooltip-autocomplete li.file:before{content:"📄 "}.cm-tooltip-autocomplete li.dir:before{content:"📁 "}.cm-tooltip-autocomplete>ul{padding:0}.cm-editor .cm-tooltip-autocomplete .cm-completionLabel{font-family:JuliaMono,Menlo,Roboto Mono,Lucida Sans Typewriter,Source Code Pro,monospace!important;font-size:.75rem;font-variant-ligatures:none}body.nosessions ul#new~*{display:none}#recent{margin-bottom:8em}#recent>li.recent{opacity:.8}#recent button{background:none;border:none;color:var(--ui-button-color);cursor:pointer;margin:0 .2em 0 0;opacity:.6;padding:1px}#recent button>span:after{background-size:17px 17px;content:" ";display:block;height:17px;margin-bottom:-3px;width:17px}#recent li.running button>span:after{background-image:url(close-circle.d0f6eac6.svg);filter:var(--image-filters)}#recent li.recent button>span:after{background-image:url(caret-forward-circle-outline.d0bf2b34.svg);filter:var(--image-filters)}#recent li.transitioning button>span:after{background-image:url(ellipsis-horizontal-outline.abb6e818.svg);filter:var(--image-filters)}loading-bar{background-color:var(--loading-grad-color-1);display:none;height:6px;position:fixed;top:0;width:100vw}body.loading loading-bar{animation:load 16s ease-in-out;display:block}@keyframes load{0%{right:100vw}20%{right:30vw}to{right:0}} \ No newline at end of file diff --git a/frontend-dist/index.html b/frontend-dist/index.html new file mode 100644 index 0000000000..80ca2b0eb1 --- /dev/null +++ b/frontend-dist/index.html @@ -0,0 +1 @@ +⚡ Pluto.jl ⚡

    welcome to

    New session:

    \ No newline at end of file diff --git a/frontend-dist/juliamono.1bf58d39.css b/frontend-dist/juliamono.1bf58d39.css new file mode 100644 index 0000000000..3803d5957e --- /dev/null +++ b/frontend-dist/juliamono.1bf58d39.css @@ -0,0 +1 @@ +@font-face{font-display:swap;font-family:JuliaMono;font-weight:400;src:url(JuliaMono-RegularLatin.d51844a8.woff2) format("woff2");unicode-range:U+00-7f}@font-face{font-display:swap;font-family:JuliaMono;font-weight:700;src:url(JuliaMono-BoldLatin.a78b1eda.woff2) format("woff2");unicode-range:U+00-7f}@font-face{font-display:swap;font-family:JuliaMono;font-weight:400;src:url(JuliaMono-Regular.de4da299.woff2) format("woff2")}@font-face{font-display:swap;font-family:JuliaMono;font-weight:700;src:url(JuliaMono-Bold.68f7f035.woff2) format("woff2")}@font-face{font-display:swap;font-family:JuliaMono;font-style:italic;font-weight:400;src:url(JuliaMono-RegularItalic.963ec4f3.woff2) format("woff2")} \ No newline at end of file diff --git a/frontend-dist/lato-all-400-italic.c29c8c6c.woff b/frontend-dist/lato-all-400-italic.c29c8c6c.woff new file mode 100644 index 0000000000..6131624555 Binary files /dev/null and b/frontend-dist/lato-all-400-italic.c29c8c6c.woff differ diff --git a/frontend-dist/lato-all-400-normal.a1a68bdf.woff b/frontend-dist/lato-all-400-normal.a1a68bdf.woff new file mode 100644 index 0000000000..1f1fd49a12 Binary files /dev/null and b/frontend-dist/lato-all-400-normal.a1a68bdf.woff differ diff --git a/frontend-dist/lato-latin-400-italic.6edbc86c.woff2 b/frontend-dist/lato-latin-400-italic.6edbc86c.woff2 new file mode 100644 index 0000000000..3246c1286f Binary files /dev/null and b/frontend-dist/lato-latin-400-italic.6edbc86c.woff2 differ diff --git a/frontend-dist/lato-latin-400-normal.77db3602.woff2 b/frontend-dist/lato-latin-400-normal.77db3602.woff2 new file mode 100644 index 0000000000..6904b6649f Binary files /dev/null and b/frontend-dist/lato-latin-400-normal.77db3602.woff2 differ diff --git a/frontend-dist/lato-latin-ext-400-italic.336aaf51.woff2 b/frontend-dist/lato-latin-ext-400-italic.336aaf51.woff2 new file mode 100644 index 0000000000..69af6c080d Binary files /dev/null and b/frontend-dist/lato-latin-ext-400-italic.336aaf51.woff2 differ diff --git a/frontend-dist/lato-latin-ext-400-normal.e1ce8ad3.woff2 b/frontend-dist/lato-latin-ext-400-normal.e1ce8ad3.woff2 new file mode 100644 index 0000000000..0a0ee5eaed Binary files /dev/null and b/frontend-dist/lato-latin-ext-400-normal.e1ce8ad3.woff2 differ diff --git a/frontend-dist/logo.004c1d7c.svg b/frontend-dist/logo.004c1d7c.svg new file mode 100644 index 0000000000..cec701dc07 --- /dev/null +++ b/frontend-dist/logo.004c1d7c.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/mic-off-outline.251c22b7.svg b/frontend-dist/mic-off-outline.251c22b7.svg new file mode 100644 index 0000000000..5ff2a050d0 --- /dev/null +++ b/frontend-dist/mic-off-outline.251c22b7.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/mic-outline.e10eafe2.svg b/frontend-dist/mic-outline.e10eafe2.svg new file mode 100644 index 0000000000..96d55c507f --- /dev/null +++ b/frontend-dist/mic-outline.e10eafe2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/parcel-manifest.json b/frontend-dist/parcel-manifest.json new file mode 100644 index 0000000000..92c8b06a94 --- /dev/null +++ b/frontend-dist/parcel-manifest.json @@ -0,0 +1 @@ +{"editor.html":"./editor.html","img/favicon-16x16.png":"./favicon-16x16.347d2855.png","img/favicon-32x32.png":"./favicon-32x32.8789add4.png","img/favicon-96x96.png":"./favicon-96x96.48689391.png","img/logo.svg":"./logo.004c1d7c.svg","img/favicon_unsaturated.svg":"./favicon_unsaturated.d1387b25.svg","juliamono.css":"./juliamono.1bf58d39.css",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/cormullion/juliamono@0.043/webfonts/JuliaMono-RegularLatin.woff2":"./JuliaMono-RegularLatin.d51844a8.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/cormullion/juliamono@0.043/webfonts/JuliaMono-BoldLatin.woff2":"./JuliaMono-BoldLatin.a78b1eda.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/cormullion/juliamono@0.043/webfonts/JuliaMono-Regular.woff2":"./JuliaMono-Regular.de4da299.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/cormullion/juliamono@0.043/webfonts/JuliaMono-Bold.woff2":"./JuliaMono-Bold.68f7f035.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/cormullion/juliamono@0.043/webfonts/JuliaMono-RegularItalic.woff2":"./JuliaMono-RegularItalic.963ec4f3.woff2","vollkorn.css":"./vollkorn.3e0cbfce.css",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-SemiBold.woff2":"./Vollkorn-SemiBold.8072eb6c.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-SemiBoldItalic.woff2":"./Vollkorn-SemiBoldItalic.5c3cd265.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-Bold.woff2":"./Vollkorn-Bold.6e1feb70.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-BoldItalic.woff2":"./Vollkorn-BoldItalic.a48ab300.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-Black.woff2":"./Vollkorn-Black.0ebdfbf5.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-BlackItalic.woff2":"./Vollkorn-BlackItalic.4095acfe.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/lodash@4.17.20/lodash.min.js":"./editor.38d394c2.js",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@observablehq/stdlib@3.3.1/dist/stdlib.js":"./editor.38d394c2.js",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/iframe-resizer@4.2.11/js/iframeResizer.min.js":"./editor.90ede145.js",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/ansi_up@5.0.1/ansi_up.min.js":"./editor.dedc49a3.js",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/iframe-resizer@4.2.11/js/iframeResizer.contentWindow.min.js":"./editor.6386bd9d.js","editor.css":"./editor.cdad0619.css",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-ext-500-normal.woff2":"./roboto-mono-cyrillic-ext-500-normal.d362a132.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-all-500-normal.woff":"./roboto-mono-all-500-normal.cc559149.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-500-normal.woff2":"./roboto-mono-cyrillic-500-normal.8ed3add8.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-greek-500-normal.woff2":"./roboto-mono-greek-500-normal.dd57b097.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-vietnamese-500-normal.woff2":"./roboto-mono-vietnamese-500-normal.1320bb60.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-ext-500-normal.woff2":"./roboto-mono-latin-ext-500-normal.415f7d14.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-500-normal.woff2":"./roboto-mono-latin-500-normal.98ad1d4e.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-ext-700-normal.woff2":"./roboto-mono-cyrillic-ext-700-normal.5c7aabac.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-all-700-normal.woff":"./roboto-mono-all-700-normal.393c796d.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-700-normal.woff2":"./roboto-mono-cyrillic-700-normal.5e6410cf.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-greek-700-normal.woff2":"./roboto-mono-greek-700-normal.b101f80c.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-vietnamese-700-normal.woff2":"./roboto-mono-vietnamese-700-normal.edb1435b.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-ext-700-normal.woff2":"./roboto-mono-latin-ext-700-normal.c497b002.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-700-normal.woff2":"./roboto-mono-latin-700-normal.447ac127.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-400-normal.woff2":"./alegreya-sans-cyrillic-ext-400-normal.5f5cc2ef.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-400-normal.woff":"./alegreya-sans-all-400-normal.a91dc265.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-400-normal.woff2":"./alegreya-sans-cyrillic-400-normal.ab3d1dcc.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-400-normal.woff2":"./alegreya-sans-greek-ext-400-normal.b82a0aea.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-400-normal.woff2":"./alegreya-sans-greek-400-normal.4e5a8597.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-400-normal.woff2":"./alegreya-sans-vietnamese-400-normal.bdc8a622.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-400-normal.woff2":"./alegreya-sans-latin-ext-400-normal.1c1602b0.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-400-normal.woff2":"./alegreya-sans-latin-400-normal.62b57001.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-500-normal.woff2":"./alegreya-sans-cyrillic-ext-500-normal.0e6ee102.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-500-normal.woff":"./alegreya-sans-all-500-normal.5db27a5b.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-500-normal.woff2":"./alegreya-sans-cyrillic-500-normal.8a029e9d.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-500-normal.woff2":"./alegreya-sans-greek-ext-500-normal.00f2c6f3.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-500-normal.woff2":"./alegreya-sans-greek-500-normal.54a6041f.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-500-normal.woff2":"./alegreya-sans-vietnamese-500-normal.97e250df.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-500-normal.woff2":"./alegreya-sans-latin-ext-500-normal.637067c1.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-500-normal.woff2":"./alegreya-sans-latin-500-normal.4428c984.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-700-normal.woff2":"./alegreya-sans-cyrillic-ext-700-normal.2e02b08f.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-700-normal.woff":"./alegreya-sans-all-700-normal.29d7dfa9.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-700-normal.woff2":"./alegreya-sans-cyrillic-700-normal.5a5aa5e3.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-700-normal.woff2":"./alegreya-sans-greek-ext-700-normal.ca9ee8e1.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-700-normal.woff2":"./alegreya-sans-greek-700-normal.452fc62e.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-700-normal.woff2":"./alegreya-sans-vietnamese-700-normal.59390763.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-700-normal.woff2":"./alegreya-sans-latin-ext-700-normal.b5306f41.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-700-normal.woff2":"./alegreya-sans-latin-700-normal.96e2fcc9.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-400-italic.woff2":"./alegreya-sans-cyrillic-ext-400-italic.7c2a4a40.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-400-italic.woff":"./alegreya-sans-all-400-italic.f87bfe89.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-400-italic.woff2":"./alegreya-sans-cyrillic-400-italic.8c81649c.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-400-italic.woff2":"./alegreya-sans-greek-ext-400-italic.550f5118.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-400-italic.woff2":"./alegreya-sans-greek-400-italic.1b909c63.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-400-italic.woff2":"./alegreya-sans-vietnamese-400-italic.d08e8dff.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-400-italic.woff2":"./alegreya-sans-latin-ext-400-italic.b9ce632b.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-400-italic.woff2":"./alegreya-sans-latin-400-italic.ec56f658.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-500-italic.woff2":"./alegreya-sans-cyrillic-ext-500-italic.78248b65.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-500-italic.woff":"./alegreya-sans-all-500-italic.8917c3da.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-500-italic.woff2":"./alegreya-sans-cyrillic-500-italic.a40f95be.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-500-italic.woff2":"./alegreya-sans-greek-ext-500-italic.8b2e952b.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-500-italic.woff2":"./alegreya-sans-greek-500-italic.19d09eea.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-500-italic.woff2":"./alegreya-sans-vietnamese-500-italic.3ff20df8.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-500-italic.woff2":"./alegreya-sans-latin-ext-500-italic.d15c8f11.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-500-italic.woff2":"./alegreya-sans-latin-500-italic.6d8350bf.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-700-italic.woff2":"./alegreya-sans-cyrillic-ext-700-italic.69b0617e.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-700-italic.woff":"./alegreya-sans-all-700-italic.a6d70e05.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-700-italic.woff2":"./alegreya-sans-cyrillic-700-italic.c4ef17a2.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-700-italic.woff2":"./alegreya-sans-greek-ext-700-italic.a1ccc0c2.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-700-italic.woff2":"./alegreya-sans-greek-700-italic.5aef27cf.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-700-italic.woff2":"./alegreya-sans-vietnamese-700-italic.7de0cccc.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-700-italic.woff2":"./alegreya-sans-latin-ext-700-italic.733aea09.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-700-italic.woff2":"./alegreya-sans-latin-700-italic.abc64c8a.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-latin-ext-400-normal.woff2":"./lato-latin-ext-400-normal.e1ce8ad3.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-all-400-normal.woff":"./lato-all-400-normal.a1a68bdf.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-latin-400-normal.woff2":"./lato-latin-400-normal.77db3602.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-latin-ext-400-italic.woff2":"./lato-latin-ext-400-italic.336aaf51.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-all-400-italic.woff":"./lato-all-400-italic.c29c8c6c.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-latin-400-italic.woff2":"./lato-latin-400-italic.6edbc86c.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/radio-button-on-outline.svg":"./radio-button-on-outline.778acac1.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/stop-circle-outline.svg":"./stop-circle-outline.6623356d.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/shapes-outline.svg":"./shapes-outline.76567c1b.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/close-outline.svg":"./close-outline.9c22a232.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/mic-outline.svg":"./mic-outline.e10eafe2.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/mic-off-outline.svg":"./mic-off-outline.251c22b7.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-undo-outline.svg":"./arrow-undo-outline.d8c99108.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/sync-circle-outline.svg":"./sync-circle-outline.65b15d76.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/checkmark-outline.svg":"./checkmark-outline.4fb8c646.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/eye-outline.svg":"./eye-outline.6e6e0f7c.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/eye-off-outline.svg":"./eye-off-outline.a37e03db.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/add-outline.svg":"./add-outline.e3c93c35.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/document-text-outline.svg":"./document-text-outline.8d1e2333.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/bandage-outline.svg":"./bandage-outline.37f88b63.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/caret-forward-circle-outline.svg":"./caret-forward-circle-outline.d0bf2b34.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/ban-outline.svg":"./ban-outline.c97da9b4.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/close-circle-outline.svg":"./close-circle-outline.4baeedb9.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/ellipsis-horizontal-circle-outline.svg":"./ellipsis-horizontal-circle-outline.6279ed30.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/time-outline.svg":"./time-outline.7c1877f0.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/sync-outline.svg":"./sync-outline.9a1bd27b.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/cloud-offline-outline.svg":"./cloud-offline-outline.ac2eade9.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/cloud-download-outline.svg":"./cloud-download-outline.8c1ff9bb.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/chatbox-ellipses-outline.svg":"./chatbox-ellipses-outline.4334a3a4.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-redo-circle-outline.svg":"./arrow-redo-circle-outline.dfa899f4.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/chevron-forward-circle-outline.svg":"./chevron-forward-circle-outline.babf2a99.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/chevron-down-outline.svg":"./chevron-down-outline.1efaf1cc.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-back-outline.svg":"./arrow-back-outline.9ae1bed8.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-forward-outline.svg":"./arrow-forward-outline.f5f68f5c.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-ext-400-normal.woff2":"./roboto-mono-cyrillic-ext-400-normal.dcb520ee.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-all-400-normal.woff":"./roboto-mono-all-400-normal.364ec368.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-400-normal.woff2":"./roboto-mono-cyrillic-400-normal.638e826e.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-greek-400-normal.woff2":"./roboto-mono-greek-400-normal.dd843e41.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-vietnamese-400-normal.woff2":"./roboto-mono-vietnamese-400-normal.306e7635.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-ext-400-normal.woff2":"./roboto-mono-latin-ext-400-normal.d9409874.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-400-normal.woff2":"./roboto-mono-latin-400-normal.cf1eee5f.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-ext-400-italic.woff2":"./roboto-mono-cyrillic-ext-400-italic.db052448.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-all-400-italic.woff":"./roboto-mono-all-400-italic.31a14f53.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-400-italic.woff2":"./roboto-mono-cyrillic-400-italic.e399ed93.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-greek-400-italic.woff2":"./roboto-mono-greek-400-italic.6f7e0b2f.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-vietnamese-400-italic.woff2":"./roboto-mono-vietnamese-400-italic.d8e0a32a.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-ext-400-italic.woff2":"./roboto-mono-latin-ext-400-italic.aaa9a959.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-400-italic.woff2":"./roboto-mono-latin-400-italic.ef82d48f.woff2","hide-ui.css":"./editor.9fb5a9e0.css","binder.css":"./editor.52fc68a2.css",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/copy-outline.svg":"./copy-outline.0f561529.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/download-outline.svg":"./download-outline.523a74d8.svg","treeview.css":"./editor.7ec7b213.css",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/caret-down-outline.svg":"./caret-down-outline.4253a2fe.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/caret-forward-outline.svg":"./caret-forward-outline.348a84b6.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/ellipsis-vertical.svg":"./ellipsis-vertical.a30e7430.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/ellipsis-horizontal.svg":"./ellipsis-horizontal.c9a6cc29.svg","highlightjs.css":"./editor.e82e08bd.css","editor.js":"./editor.b7ef9a13.js",".parcel-cache/.net/https/www.gstatic.com/firebasejs/9.3.0/firebase-app.js":"./firebase-app.341f693c.js",".parcel-cache/.net/https/www.gstatic.com/firebasejs/9.3.0/firebase-firestore.js":"./firebase-firestore.e8a6c520.js",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-up-circle-outline.svg":"./arrow-up-circle-outline.3f146ffe.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/help-circle-outline.svg":"./help-circle-outline.a023036a.svg",".parcel-cache/.net/https/unpkg.com/vmsg@0.4.0/vmsg.wasm":"./vmsg.56bb9389.wasm","warn_old_browsers.js":"./editor.b9f0ac7b.js","index.html":"./index.html","index.css":"./index.755a8767.css",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/close-circle.svg":"./close-circle.d0f6eac6.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/ellipsis-horizontal-outline.svg":"./ellipsis-horizontal-outline.abb6e818.svg","index.js":"./index.1a7d4001.js","error.jl.html":"./error.jl.html","sample.html":"./sample.html"} \ No newline at end of file diff --git a/frontend-dist/radio-button-on-outline.778acac1.svg b/frontend-dist/radio-button-on-outline.778acac1.svg new file mode 100644 index 0000000000..061b534687 --- /dev/null +++ b/frontend-dist/radio-button-on-outline.778acac1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/roboto-mono-all-400-italic.31a14f53.woff b/frontend-dist/roboto-mono-all-400-italic.31a14f53.woff new file mode 100644 index 0000000000..723ffe83fc Binary files /dev/null and b/frontend-dist/roboto-mono-all-400-italic.31a14f53.woff differ diff --git a/frontend-dist/roboto-mono-all-400-normal.364ec368.woff b/frontend-dist/roboto-mono-all-400-normal.364ec368.woff new file mode 100644 index 0000000000..379f9ae197 Binary files /dev/null and b/frontend-dist/roboto-mono-all-400-normal.364ec368.woff differ diff --git a/frontend-dist/roboto-mono-all-500-normal.cc559149.woff b/frontend-dist/roboto-mono-all-500-normal.cc559149.woff new file mode 100644 index 0000000000..6fc0cbe59e Binary files /dev/null and b/frontend-dist/roboto-mono-all-500-normal.cc559149.woff differ diff --git a/frontend-dist/roboto-mono-all-700-normal.393c796d.woff b/frontend-dist/roboto-mono-all-700-normal.393c796d.woff new file mode 100644 index 0000000000..bd2a43d0aa Binary files /dev/null and b/frontend-dist/roboto-mono-all-700-normal.393c796d.woff differ diff --git a/frontend-dist/roboto-mono-cyrillic-400-italic.e399ed93.woff2 b/frontend-dist/roboto-mono-cyrillic-400-italic.e399ed93.woff2 new file mode 100644 index 0000000000..8695ed91d2 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-400-italic.e399ed93.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-400-normal.638e826e.woff2 b/frontend-dist/roboto-mono-cyrillic-400-normal.638e826e.woff2 new file mode 100644 index 0000000000..68b8a8dc8c Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-400-normal.638e826e.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-500-normal.8ed3add8.woff2 b/frontend-dist/roboto-mono-cyrillic-500-normal.8ed3add8.woff2 new file mode 100644 index 0000000000..c307876e05 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-500-normal.8ed3add8.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-700-normal.5e6410cf.woff2 b/frontend-dist/roboto-mono-cyrillic-700-normal.5e6410cf.woff2 new file mode 100644 index 0000000000..1967932dfe Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-700-normal.5e6410cf.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-ext-400-italic.db052448.woff2 b/frontend-dist/roboto-mono-cyrillic-ext-400-italic.db052448.woff2 new file mode 100644 index 0000000000..85a9f5b370 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-ext-400-italic.db052448.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-ext-400-normal.dcb520ee.woff2 b/frontend-dist/roboto-mono-cyrillic-ext-400-normal.dcb520ee.woff2 new file mode 100644 index 0000000000..1630ec9c56 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-ext-400-normal.dcb520ee.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-ext-500-normal.d362a132.woff2 b/frontend-dist/roboto-mono-cyrillic-ext-500-normal.d362a132.woff2 new file mode 100644 index 0000000000..b34eed9747 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-ext-500-normal.d362a132.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-ext-700-normal.5c7aabac.woff2 b/frontend-dist/roboto-mono-cyrillic-ext-700-normal.5c7aabac.woff2 new file mode 100644 index 0000000000..a89f2e8413 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-ext-700-normal.5c7aabac.woff2 differ diff --git a/frontend-dist/roboto-mono-greek-400-italic.6f7e0b2f.woff2 b/frontend-dist/roboto-mono-greek-400-italic.6f7e0b2f.woff2 new file mode 100644 index 0000000000..7bab226ca5 Binary files /dev/null and b/frontend-dist/roboto-mono-greek-400-italic.6f7e0b2f.woff2 differ diff --git a/frontend-dist/roboto-mono-greek-400-normal.dd843e41.woff2 b/frontend-dist/roboto-mono-greek-400-normal.dd843e41.woff2 new file mode 100644 index 0000000000..466f9ec13f Binary files /dev/null and b/frontend-dist/roboto-mono-greek-400-normal.dd843e41.woff2 differ diff --git a/frontend-dist/roboto-mono-greek-500-normal.dd57b097.woff2 b/frontend-dist/roboto-mono-greek-500-normal.dd57b097.woff2 new file mode 100644 index 0000000000..72f600238f Binary files /dev/null and b/frontend-dist/roboto-mono-greek-500-normal.dd57b097.woff2 differ diff --git a/frontend-dist/roboto-mono-greek-700-normal.b101f80c.woff2 b/frontend-dist/roboto-mono-greek-700-normal.b101f80c.woff2 new file mode 100644 index 0000000000..9ab1293a88 Binary files /dev/null and b/frontend-dist/roboto-mono-greek-700-normal.b101f80c.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-400-italic.ef82d48f.woff2 b/frontend-dist/roboto-mono-latin-400-italic.ef82d48f.woff2 new file mode 100644 index 0000000000..721ca2e93a Binary files /dev/null and b/frontend-dist/roboto-mono-latin-400-italic.ef82d48f.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-400-normal.cf1eee5f.woff2 b/frontend-dist/roboto-mono-latin-400-normal.cf1eee5f.woff2 new file mode 100644 index 0000000000..ed384d22fd Binary files /dev/null and b/frontend-dist/roboto-mono-latin-400-normal.cf1eee5f.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-500-normal.98ad1d4e.woff2 b/frontend-dist/roboto-mono-latin-500-normal.98ad1d4e.woff2 new file mode 100644 index 0000000000..01b58ed2c5 Binary files /dev/null and b/frontend-dist/roboto-mono-latin-500-normal.98ad1d4e.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-700-normal.447ac127.woff2 b/frontend-dist/roboto-mono-latin-700-normal.447ac127.woff2 new file mode 100644 index 0000000000..c89a6eb38c Binary files /dev/null and b/frontend-dist/roboto-mono-latin-700-normal.447ac127.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-ext-400-italic.aaa9a959.woff2 b/frontend-dist/roboto-mono-latin-ext-400-italic.aaa9a959.woff2 new file mode 100644 index 0000000000..9831c28b9e Binary files /dev/null and b/frontend-dist/roboto-mono-latin-ext-400-italic.aaa9a959.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-ext-400-normal.d9409874.woff2 b/frontend-dist/roboto-mono-latin-ext-400-normal.d9409874.woff2 new file mode 100644 index 0000000000..d4f9a09cca Binary files /dev/null and b/frontend-dist/roboto-mono-latin-ext-400-normal.d9409874.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-ext-500-normal.415f7d14.woff2 b/frontend-dist/roboto-mono-latin-ext-500-normal.415f7d14.woff2 new file mode 100644 index 0000000000..77a97cf73e Binary files /dev/null and b/frontend-dist/roboto-mono-latin-ext-500-normal.415f7d14.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-ext-700-normal.c497b002.woff2 b/frontend-dist/roboto-mono-latin-ext-700-normal.c497b002.woff2 new file mode 100644 index 0000000000..9b733dd3cc Binary files /dev/null and b/frontend-dist/roboto-mono-latin-ext-700-normal.c497b002.woff2 differ diff --git a/frontend-dist/roboto-mono-vietnamese-400-italic.d8e0a32a.woff2 b/frontend-dist/roboto-mono-vietnamese-400-italic.d8e0a32a.woff2 new file mode 100644 index 0000000000..2ec55df09d Binary files /dev/null and b/frontend-dist/roboto-mono-vietnamese-400-italic.d8e0a32a.woff2 differ diff --git a/frontend-dist/roboto-mono-vietnamese-400-normal.306e7635.woff2 b/frontend-dist/roboto-mono-vietnamese-400-normal.306e7635.woff2 new file mode 100644 index 0000000000..2cf6dfc420 Binary files /dev/null and b/frontend-dist/roboto-mono-vietnamese-400-normal.306e7635.woff2 differ diff --git a/frontend-dist/roboto-mono-vietnamese-500-normal.1320bb60.woff2 b/frontend-dist/roboto-mono-vietnamese-500-normal.1320bb60.woff2 new file mode 100644 index 0000000000..3ab766e250 Binary files /dev/null and b/frontend-dist/roboto-mono-vietnamese-500-normal.1320bb60.woff2 differ diff --git a/frontend-dist/roboto-mono-vietnamese-700-normal.edb1435b.woff2 b/frontend-dist/roboto-mono-vietnamese-700-normal.edb1435b.woff2 new file mode 100644 index 0000000000..12357bd521 Binary files /dev/null and b/frontend-dist/roboto-mono-vietnamese-700-normal.edb1435b.woff2 differ diff --git a/frontend-dist/sample.html b/frontend-dist/sample.html new file mode 100644 index 0000000000..67124642ca --- /dev/null +++ b/frontend-dist/sample.html @@ -0,0 +1 @@ +⚡ Pluto.jl ⚡

    welcome to

    Samples:


    \ No newline at end of file diff --git a/frontend-dist/shapes-outline.76567c1b.svg b/frontend-dist/shapes-outline.76567c1b.svg new file mode 100644 index 0000000000..3b115ca667 --- /dev/null +++ b/frontend-dist/shapes-outline.76567c1b.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/stop-circle-outline.6623356d.svg b/frontend-dist/stop-circle-outline.6623356d.svg new file mode 100644 index 0000000000..30addb7f98 --- /dev/null +++ b/frontend-dist/stop-circle-outline.6623356d.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/sync-circle-outline.65b15d76.svg b/frontend-dist/sync-circle-outline.65b15d76.svg new file mode 100644 index 0000000000..3b41a36e9b --- /dev/null +++ b/frontend-dist/sync-circle-outline.65b15d76.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/sync-outline.9a1bd27b.svg b/frontend-dist/sync-outline.9a1bd27b.svg new file mode 100644 index 0000000000..9f69e76f35 --- /dev/null +++ b/frontend-dist/sync-outline.9a1bd27b.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/time-outline.7c1877f0.svg b/frontend-dist/time-outline.7c1877f0.svg new file mode 100644 index 0000000000..b4d1371332 --- /dev/null +++ b/frontend-dist/time-outline.7c1877f0.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/vmsg.56bb9389.wasm b/frontend-dist/vmsg.56bb9389.wasm new file mode 100644 index 0000000000..224bcc7fd1 Binary files /dev/null and b/frontend-dist/vmsg.56bb9389.wasm differ diff --git a/frontend-dist/vollkorn.3e0cbfce.css b/frontend-dist/vollkorn.3e0cbfce.css new file mode 100644 index 0000000000..83907db83a --- /dev/null +++ b/frontend-dist/vollkorn.3e0cbfce.css @@ -0,0 +1 @@ +@font-face{font-display:swap;font-family:Vollkorn;font-weight:600;src:url(Vollkorn-SemiBold.8072eb6c.woff2) format("woff2")}@font-face{font-display:swap;font-family:Vollkorn;font-style:italic;font-weight:600;src:url(Vollkorn-SemiBoldItalic.5c3cd265.woff2) format("woff2")}@font-face{font-display:swap;font-family:Vollkorn;font-weight:700;src:url(Vollkorn-Bold.6e1feb70.woff2) format("woff2")}@font-face{font-display:swap;font-family:Vollkorn;font-style:italic;font-weight:700;src:url(Vollkorn-BoldItalic.a48ab300.woff2) format("woff2")}@font-face{font-display:swap;font-family:Vollkorn;font-weight:900;src:url(Vollkorn-Black.0ebdfbf5.woff2) format("woff2")}@font-face{font-display:swap;font-family:Vollkorn;font-style:italic;font-weight:900;src:url(Vollkorn-BlackItalic.4095acfe.woff2) format("woff2")} \ No newline at end of file