diff --git a/Makefile b/Makefile index abb64ee..32e5935 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ SHELL = /bin/bash build: node_modules npm run build +.PHONY: watch +watch: node_modules + npm run watch + .PHONY: test test: node_modules docker-compose run --rm -e BASE_URL=http://webdav test npm run test diff --git a/TODO.md b/TODO.md index c280353..1af9837 100644 --- a/TODO.md +++ b/TODO.md @@ -2,11 +2,11 @@ - [x] Add end-to-end UI testing - [x] Move to TypeScript - [x] Support keyboard navigation whilst overlay is visible +- [x] Maybe a refactor... +- [x] Add eventMap to `Event` object. - Replaced with `typed-event-emitter` - [ ] Add drag and drop tests - [ ] Allow uploading of directories ([#48](https://github.com/dom111/webdav-js/issues/48)) - [ ] Add functionality for copying and moving files and directories - [ ] Add progress bar for file uploads - [ ] ReactJS implementation - [ ] VueJS implementation -- [ ] Maybe a refactor... -- [ ] Add eventMap to `Event` object. diff --git a/assets/css/style-min.css b/assets/css/style-min.css index 46025f1..a3996e6 100644 --- a/assets/css/style-min.css +++ b/assets/css/style-min.css @@ -1,2 +1,2 @@ -.basicLightbox{position:fixed;display:flex;justify-content:center;align-items:center;top:0;left:0;width:100%;height:100vh;background:rgba(0,0,0,.8);opacity:.01;transition:opacity .4s ease;z-index:1000;will-change:opacity}.basicLightbox--visible{opacity:1}.basicLightbox__placeholder{max-width:100%;transform:scale(.9);transition:transform .4s ease;z-index:1;will-change:transform}.basicLightbox__placeholder>img:first-child:last-child,.basicLightbox__placeholder>video:first-child:last-child,.basicLightbox__placeholder>iframe:first-child:last-child{display:block;position:absolute;inset:0;margin:auto;max-width:95%;max-height:95%}.basicLightbox__placeholder>video:first-child:last-child,.basicLightbox__placeholder>iframe:first-child:last-child{pointer-events:auto}.basicLightbox__placeholder>img:first-child:last-child,.basicLightbox__placeholder>video:first-child:last-child{width:auto;height:auto}.basicLightbox--img .basicLightbox__placeholder,.basicLightbox--video .basicLightbox__placeholder,.basicLightbox--iframe .basicLightbox__placeholder{width:100%;height:100%;pointer-events:none}.basicLightbox--visible .basicLightbox__placeholder{transform:scale(1)}code[class*=language-],pre[class*=language-]{color:#000;background:none;text-shadow:0 1px white;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,code[class*=language-] ::-moz-selection{text-shadow:none;background:#b3d4fc}pre[class*=language-]::selection,pre[class*=language-] ::selection,code[class*=language-]::selection,code[class*=language-] ::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#905}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#690}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.function,.token.class-name{color:#dd4a68}.token.regex,.token.important,.token.variable{color:#e90}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.toast__container{bottom:0;max-width:calc(40vw - 1em);position:fixed;left:1em;z-index:1}@media (max-width: 800px){.toast__container{max-width:calc(100vw - 2em)}}.toast{background:#fff linear-gradient(180deg,transparent,transparent 80%,rgba(0,0,0,.1) 100%);border:1px solid rgba(0,0,0,.1);border-radius:.25em;box-shadow:0 0 #0000004d;clear:both;color:#000c;cursor:pointer;float:left;margin:0 0 1em;min-width:10em;opacity:0;padding:1em 2.5em 1em 1em;position:relative;transform:translateY(100%);transition:all .4s}.toast:before{content:none;float:left;font-size:1.5em;line-height:.8em;margin-left:-.1em;min-width:1.5em;padding-right:.25em;text-align:center}.toast button{background:transparent;border:none;color:inherit;cursor:pointer;max-width:1em;overflow:hidden;padding:0;position:absolute;right:1em;top:1em;white-space:nowrap}.toast button:before{content:"\2716 "}.toast--info{background:#4a90e2 linear-gradient(180deg,transparent,transparent 80%,rgba(0,0,0,.1) 100%);color:#fffc}.toast--info:before{content:"\24d8"}.toast--success{background:#55dd6b linear-gradient(180deg,transparent,transparent 80%,rgba(0,0,0,.1) 100%);color:#606060cc}.toast--success:before{content:"\2713"}.toast--warning{background:#edc25e linear-gradient(180deg,transparent,transparent 80%,rgba(0,0,0,.1) 100%);color:#606060cc}.toast--warning:before{content:"\26a0"}.toast--error{background:#e23645 linear-gradient(180deg,transparent,transparent 80%,rgba(0,0,0,.1) 100%);color:#fffc}.toast--error:before{content:"\26a0"}.toast--show{box-shadow:0 0 .5em #0000004d;opacity:1;transform:translateY(0)}.toast--hide{box-shadow:0 0 1em #0000004d;opacity:0;transform:translate(-100%) translateY(0)}html{font-size:16px}html,body,ul{font-family:Helvetica,Arial,sans-serif;margin:0;padding:0}html,body{min-height:100vh}li{list-style:none}a{color:inherit;text-decoration:none}.hidden{display:none!important}.invisible{opacity:0;pointer-events:none;position:absolute}.loading{background:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ibGRzLXNwaW5uZXIiIHdpZHRoPSIxNDNweCIgaGVpZ2h0PSIxNDNweCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIiBzdHlsZT0iYmFja2dyb3VuZDogbm9uZTsiPjxnIHRyYW5zZm9ybT0icm90YXRlKDAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49Ii0wLjkxNjY2NjY2NjY2NjY2NjZzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPjwvcmVjdD48L2c+PGcgdHJhbnNmb3JtPSJyb3RhdGUoMzAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49Ii0wLjgzMzMzMzMzMzMzMzMzMzRzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPjwvcmVjdD48L2c+PGcgdHJhbnNmb3JtPSJyb3RhdGUoNjAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49Ii0wLjc1cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT48L3JlY3Q+PC9nPjxnIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSI+PHJlY3QgeD0iNDgiIHk9IjI0IiByeD0iOS42IiByeT0iNC44IiB3aWR0aD0iNCIgaGVpZ2h0PSIxMiIgZmlsbD0iIzc0YzFmNSI+PGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgdmFsdWVzPSIxOzAiIGtleVRpbWVzPSIwOzEiIGR1cj0iMXMiIGJlZ2luPSItMC42NjY2NjY2NjY2NjY2NjY2cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT48L3JlY3Q+PC9nPjxnIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiPjxyZWN0IHg9IjQ4IiB5PSIyNCIgcng9IjkuNiIgcnk9IjQuOCIgd2lkdGg9IjQiIGhlaWdodD0iMTIiIGZpbGw9IiM3NGMxZjUiPjxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIHZhbHVlcz0iMTswIiBrZXlUaW1lcz0iMDsxIiBkdXI9IjFzIiBiZWdpbj0iLTAuNTgzMzMzMzMzMzMzMzMzNHMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+PC9yZWN0PjwvZz48ZyB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49Ii0wLjVzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPjwvcmVjdD48L2c+PGcgdHJhbnNmb3JtPSJyb3RhdGUoMTgwIDUwIDUwKSI+PHJlY3QgeD0iNDgiIHk9IjI0IiByeD0iOS42IiByeT0iNC44IiB3aWR0aD0iNCIgaGVpZ2h0PSIxMiIgZmlsbD0iIzc0YzFmNSI+PGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgdmFsdWVzPSIxOzAiIGtleVRpbWVzPSIwOzEiIGR1cj0iMXMiIGJlZ2luPSItMC40MTY2NjY2NjY2NjY2NjY3cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT48L3JlY3Q+PC9nPjxnIHRyYW5zZm9ybT0icm90YXRlKDIxMCA1MCA1MCkiPjxyZWN0IHg9IjQ4IiB5PSIyNCIgcng9IjkuNiIgcnk9IjQuOCIgd2lkdGg9IjQiIGhlaWdodD0iMTIiIGZpbGw9IiM3NGMxZjUiPjxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIHZhbHVlcz0iMTswIiBrZXlUaW1lcz0iMDsxIiBkdXI9IjFzIiBiZWdpbj0iLTAuMzMzMzMzMzMzMzMzMzMzM3MiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+PC9yZWN0PjwvZz48ZyB0cmFuc2Zvcm09InJvdGF0ZSgyNDAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49Ii0wLjI1cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT48L3JlY3Q+PC9nPjxnIHRyYW5zZm9ybT0icm90YXRlKDI3MCA1MCA1MCkiPjxyZWN0IHg9IjQ4IiB5PSIyNCIgcng9IjkuNiIgcnk9IjQuOCIgd2lkdGg9IjQiIGhlaWdodD0iMTIiIGZpbGw9IiM3NGMxZjUiPjxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIHZhbHVlcz0iMTswIiBrZXlUaW1lcz0iMDsxIiBkdXI9IjFzIiBiZWdpbj0iLTAuMTY2NjY2NjY2NjY2NjY2NjZzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPjwvcmVjdD48L2c+PGcgdHJhbnNmb3JtPSJyb3RhdGUoMzAwIDUwIDUwKSI+PHJlY3QgeD0iNDgiIHk9IjI0IiByeD0iOS42IiByeT0iNC44IiB3aWR0aD0iNCIgaGVpZ2h0PSIxMiIgZmlsbD0iIzc0YzFmNSI+PGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgdmFsdWVzPSIxOzAiIGtleVRpbWVzPSIwOzEiIGR1cj0iMXMiIGJlZ2luPSItMC4wODMzMzMzMzMzMzMzMzMzM3MiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+PC9yZWN0PjwvZz48ZyB0cmFuc2Zvcm09InJvdGF0ZSgzMzAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49IjBzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPjwvcmVjdD48L2c+PC9zdmc+) center center no-repeat}.loading>*{opacity:.5}.active{background-color:#ffc}main{padding:20px}main ul{border:1px solid #efefef;border-radius:5px;margin:0;padding:0 5px}main ul li{background:none no-repeat left center;border-top:1px solid #eee;cursor:pointer;display:block;overflow:hidden;padding:5px 0 5px 5px}main ul li:hover{background-color:#fafafa}main ul li:first-child{border-top:0}main ul li.active{color:#000}main ul li.loading{background-size:contain}main ul li.loading *{pointer-events:none}main ul li .size{color:#aaa;display:inline-block;margin:0 10px}main ul li .copy,main ul li .move,main ul li .rename,main ul li .delete,main ul li [download]{background:none no-repeat center center;float:right;height:16px;margin:0 5px;overflow:hidden;text-indent:26px;white-space:nowrap;width:16px}main ul li .copy{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ1SURBVBgZBcFNiJVVGADg5z3fmTujY5NZBANBIVkZ2J9IKkZFGKRuglq1KaqVtoqoVbSKFi1LoY2QEVSbcqiFWWJqPxL044wUGESQVqJOKerce7/z9jyRmba++tXTy2YmnyphPaYQIJBBNuPWfls8l1/EfxdeOrJnxxAgMtO2148d2ffC+rWlxMqkkwBkQjp7aeT97xf99cfS5ZPzv6w6umfHElQoXdw+qN3KhX90JYIgG30243G6Muo9tOYa999WfdfOLs92x4UHd3163eG3ti8ViIgVmdkNumKiUIOu0AURFIFmdmZgx4ZZt9w6uazOTO+FAklAQQlKhBKhRCgRShfOnL/i5hUjd64Kz2+6XjfRPQkVIJPaEUJGaH1SQu0YZHHqXBq2sdaGHlg9KWoZQ4VMEjWKlBJRQiAb2RUGlBZa66RCFFAh0RBBCIlENiY6QBTRhyypIROo0MZk0hDITFAKWqhdkkGSQt/oG1ChtZSZJCkBSCCEE79+Yv7UnIuXLxiNR8rwnsomFfpGn2SjAUjQkuPzHzp98XMPb9ngplVrHFr42OX5ubpx1943K7Rxaple+2EopBZkBo2MNL3wnie2P6ovvbtntzp48iMb1232+6n9OyuMx72+Z3Zmwn03Fi3pkz5oyWffnjERKzy29lnw4iPvmDuxG/unKoyXWhu3lsNefPNnr0VKAVpy/tK/Fk5/7afTR72yda83DjxjqpuEqxVGV/u/pwfdDS+vG05nZpE0wLXLqn2Lzzn287s237XF3IndBlEd/fEwvB2ZacPOgzvHo3w8Iu5NuRxAkkhpovug1u5Q5SoGfWurDxzf/eW2/wEnITFm/fHryQAAAABJRU5ErkJggg==)}main ul li .move{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ2SURBVBgZBcFLiJVlGADg5/3+b87cbLyFNBJ4oexGQYqIi6hFQambgohoE0aLUqGCaBcuonWLUFe1CIJolWCLaiK1C0FUREpRBgmWNpqi4XjOnP97e57ITI+8fuLZ6bnJZ0rYhikECGSQzbi1M1cu5UJcvfzqycN7RgCRmXa9+dXJ9w5su6uUWJV0EoBMSIv/LXv/uyvOnx1eP/3zL2u+PLxnCBVKF3cMarfq1D+6EkGQjT6b8TgtLfceuv0mO7ZU37bFmWx3Xn5w/7HVx9/ePSwQESsysxt0xUShBl2hCyIoAs383MCe7fM23jY5Xedm34UCSUBBCUqEEqFEKBFKF/7+d8mGFcvuXhOe37lWN9E9CRUgk9oRQkZofVJC7Rhk8fulNGpjrY08sHlS1DKGCpkkahQpJaKEQDayKwwoLbTWSYUooEKiIYIQEolsTHSAKKIPWVJDJlChjcmkIZCZoBS0ULskgySFvtE3oEJrKTNJUgKQQAj950eMFg5ZPvebU+vW2zH9WGWnCn2jT7LRACRoyY2FI6ZOfeC+p54zuekeSz99YubkQv304YkDFdo4tUwHfxgJqQWZQSMjPX30Lbv3vmDqzBeceMPMylU2b9jg+1/z5Qrjca/vmZ+bsHVd0ZI+6YOWrL7yp6lbNrHrFQD14LyuxcYK42Fr49Zy1ItvzvVapBSgJetXzrv+4zGzR180XDrvOq5d7fSdvyos3+gvzA66m1+7dzSbmUXSACunq4vn9zt9/B23rp5WuwnXFsf+uNBJ/aHITNv3fbZvvJyPR8T9KWcAJImUHh0eq1sXP+zWDi/G1cHc8Oxgy8cvffT1E/8D2iAtJW5RUGAAAAAASUVORK5CYII=)}main ul li .rename{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFUSURBVDjLrZM/SAJxGIZdWwuDlnCplkAEm1zkaIiGFFpyMIwGK5KGoK2lphDKkMDg3LLUSIJsSKhIi+684CokOtTiMizCGuzEU5K3vOEgKvtBDe/2Pc8H3x8NAM1fQlx4H9M3pcOWp6TXWmM8A7j0629v1nraiAVC0IrrwATKIgs5xyG5QiE+Z4iQdoeU2oAsnqCSO1NSTu+D9VhqRLD8nIB8F0Q2MgmJDyipCzjvYJkIfpN2UBLG8MpP4dxvQ3ZzGuyyBQ2H+AnOOCBd9aL6soh81A5hyYSGWyCFvxUcerqI4S+CvYVOFPMHxLAq8I3qdHVY5LbBhJzEsCrwutpRFBlUHy6wO2tEYtWAzLELPN2P03kjfj3luqDycV2F8AgefWbEnVqEHa2IznSD6BdsVDNStB0lfh0FPoQjdx8RrAqGzC0YprSgxzsUMOY2bf37N/6Ud1Vc9yYcH50CAAAAAElFTkSuQmCC)}main ul li .delete{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJdSURBVDjLpZP7S1NhGMf9W7YfogSJboSEUVCY8zJ31trcps6zTI9bLGJpjp1hmkGNxVz4Q6ildtXKXzJNbJRaRmrXoeWx8tJOTWptnrNryre5YCYuI3rh+8vL+/m8PA/PkwIg5X+y5mJWrxfOUBXm91QZM6UluUmthntHqplxUml2lciF6wrmdHriI0Wx3xw2hAediLwZRWRkCPzdDswaSvGqkGCfq8VEUsEyPF1O8Qu3O7A09RbRvjuIttsRbT6HHzebsDjcB4/JgFFlNv9MnkmsEszodIIY7Oaut2OJcSF68Qx8dgv8tmqEL1gQaaARtp5A+N4NzB0lMXxon/uxbI8gIYjB9HytGYuusfiPIQcN71kjgnW6VeFOkgh3XcHLvAwMSDPohOADdYQJdF1FtLMZPmslvhZJk2ahkgRvq4HHUoWHRDqTEDDl2mDkfheiDgt8pw340/EocuClCuFvboQzb0cwIZgki4KhzlaE6w0InipbVzBfqoK/qRH94i0rgokSFeO11iBkp8EdV8cfJo0yD75aE2ZNRvSJ0lZKcBXLaUYmQrCzDT6tDN5SyRqYlWeDLZAg0H4JQ+Jt6M3atNLE10VSwQsN4Z6r0CBwqzXesHmV+BeoyAUri8EyMfi2FowXS5dhd7doo2DVII0V5BAjigP89GEVAtda8b2ehodU4rNaAW+dGfzlFkyo89GTlcrHYCLpKD+V7yeeHNzLjkp24Uu1Ed6G8/F8qjqGRzlbl2H2dzjpMg1KdwsHxOlmJ7GTeZC/nesXbeZ6c9OYnuxUc3fmBuFft/Ff8xMd0s65SXIb/gAAAABJRU5ErkJggg==)}main ul li [download]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKYSURBVBgZBcFNiFZlGADQ87z3zjfjzDiMk5VimERmBmFpKgVRVATRQLRo5aaNhFA7pZW0qV1Ci0BoUVRQtLc2UmQaJVhBVChUhP2YDuow5sz3c7/36Zx46uipF9fNTR4oYQ82oC+QQVZdrb8tX83PY+X6kdPHF4cAAPHMG2dOf/jKnp2lxHymBiAT0tJ/Ix+dW/bvxcHqLz+dXzhzfHEAAG1pYkevbeZ/vqIpJWRlnFXXpbXR2OPb19t/T+tsXZrOeu/1x17+dMOpt58dAJSImM3MptcUbdAUmiCCIlBtnutZ3LvZtrsn17VzM+8BQEkCCkqEEqFEKBFKEy5dW3Pn7Mh9C+Hgw7doJpoXAKCFTNoGEeo4KaFt6GXx69U0rJ1ahx69a1K0pQOANpNEG0WVooTA+ycuWD/J6rCzYbbnnytrPivs2jQ7dfidH/P6ypovfvh7f5uoiKAIiaysrfY9sW+H53bPOvHtX44e2AkAPvhySa1xttSOTCoyE6kUVgcj12504OS5ywD6HSsDlpaHIqq21pzKTBIASSmhSUbj6tih3WpNiUaabhkMBlZuDrWjYfZHNade+24oI2UGlYWJoj8Yef2TP5SgG1d1XCUyk2R6omq7bmw8ZvPchAduLcbJODh7IQ3GnaZMIIWxiJA1ZVZdNzIcdtpuUGtXaw7H4ptLnRTgxurIRLQOLa7X1SEKSUY11fa8+fFFV1duakf98eWZXrPx1fuHM1mzVMCRU6kxoVrz7vcv2Ti9VSiWVv90cO9biimrg6E2Io89ffir5yPiwZQL6Eu2b52d2raJ22dveHLXPvO9LRSW+1vcNtOZ7tFGiMwEAAAPHTr59fY71j0yPzlvqp3T1ZGoVeRYjVXnL/7uysrI/62cRssvlMuuAAAAAElFTkSuQmCC)}main ul li input{border:0;padding:0;font-size:1rem}main ul li.directory:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGrSURBVDjLxZO7ihRBFIa/6u0ZW7GHBUV0UQQTZzd3QdhMQxOfwMRXEANBMNQX0MzAzFAwEzHwARbNFDdwEd31Mj3X7a6uOr9BtzNjYjKBJ6nicP7v3KqcJFaxhBVtZUAK8OHlld2st7Xl3DJPVONP+zEUV4HqL5UDYHr5xvuQAjgl/Qs7TzvOOVAjxjlC+ePSwe6DfbVegLVuT4r14eTr6zvA8xSAoBLzx6pvj4l+DZIezuVkG9fY2H7YRQIMZIBwycmzH1/s3F8AapfIPNF3kQk7+kw9PWBy+IZOdg5Ug3mkAATy/t0usovzGeCUWTjCz0B+Sj0ekfdvkZ3abBv+U4GaCtJ1iEm6ANQJ6fEzrG/engcKw/wXQvEKxSEKQxRGKE7Izt+DSiwBJMUSm71rguMYhQKrBygOIRStf4TiFFRBvbRGKiQLWP29yRSHKBTtfdBmHs0BUpgvtgF4yRFR+NUKi0XZcYjCeCG2smkzLAHkbRBmP0/Uk26O5YnUActBp1GsAI+S5nRJJJal5K1aAMrq0d6Tm9uI6zjyf75dAe6tx/SsWeD//o2/Ab6IH3/h25pOAAAAAElFTkSuQmCC)}main ul li.directory .size,main ul li.directory [download]{display:none}main ul li.file:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAC4SURBVCjPdZFbDsIgEEWnrsMm7oGGfZrohxvU+Iq1TyjU60Bf1pac4Yc5YS4ZAtGWBMk/drQBOVwJlZrWYkLhsB8UV9K0BUrPGy9cWbng2CtEEUmLGppPjRwpbixUKHBiZRS0p+ZGhvs4irNEvWD8heHpbsyDXznPhYFOyTjJc13olIqzZCHBouE0FRMUjA+s1gTjaRgVFpqRwC8mfoXPPEVPS7LbRaJL2y7bOifRCTEli3U7BMWgLzKlW/CuebZPAAAAAElFTkSuQmCC)}main ul li.file.image:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIcSURBVDjLjZO/T1NhFIafc+/trdRaYk1KUEEWjXHRaCSik+E/cDHGzYXB2YHRhMRFY1SYmRgYHZ3VxIRFDYMraMC2hrbQXm7v9+M4UGobiOEk7/adN+9zvnNEVQEQkYvAGBDy/6oBm6rqAVBVeia30jRtGmOctVaPU5qmuri4+AaYAgJVHTKYNsa4drutnU6nr1arpY1GQ6vVqlprdXt7W5eWlvomMv/uw6tSofB4p+NOF0biYtc48tEAhXiuTZzh/s1xyuUyWZbhvWdlZeXt3Nzca14sf6zW6nXf7uzrcfq9s6sLy5+1Xq8fQQKmo1ZCvlAoyo+tXT5tPGO09IckM2zWznH3/AJ3rl5ACInjmGazifceay2VSgWASISSBaz3FIs1RnJlPF18vEG1keDVk1lLFEWICM45wvAfYqTKriqje0lGI01x2qFtuuwkKQ26oEKcCwnDEBFBRA6HfmBw8JWwl3o2ti7j8+u0TUKzcYkrY/n+wyAIEJEjSxEglLyH5r7j+tg8T1oVZr8GzE69JIoiFMiM7zeHYUgQBAMJVBGU77+eYoxhLcvIxnNk6w8xxvDo3hqH+yIieO+HEkQB/qe6bPL5g/cckCkDiBhjOJULhlCGDJIkXX2z+m3GeW4UCnExyxxxHIIOLNLk2WP5AaQXTYDb1tovgHCy8lEUzQS9g1LAO+f2AX+SZudcAjgZOOeJ3jkHJ0zggNpfYEZnU63wHeoAAAAASUVORK5CYII=)}main ul li.file.py:before,main ul li.file.css:before,main ul li.file.js:before,main ul li.file.xml:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHtSURBVDjLjZM9T9tQFIYpQ5eOMBKlW6eWIQipa8RfQKQghEAKqZgKFQgmFn5AWyVDCipVQZC2EqBWlEqdO2RCpAssQBRsx1+1ndix8wFvfW6wcUhQsfTI0j33PD7n+N4uAF2E+/S5RFwG/8Njl24/LyCIOI6j1+v1y0ajgU64cSSTybdBSVAwSMmmacKyLB/DMKBpGkRRZBJBEJBKpXyJl/yABLTBtm1Uq1X2JsrlMnRdhyRJTFCpVEAfSafTTUlQoFs1luxBAkoolUqQZbmtJTYTT/AoHInOfpcwtVtkwcSBgrkDGYph+60oisIq4Xm+VfB0+U/P0Lvj3NwPGfHPTcHMvoyFXwpe7UmQtAqTUCU0D1VVbwTPVk5jY19Fe3ZfQny7CE51WJDXqpjeEUHr45ki9rIqa4dmQiJfMLItGEs/FcQ2ucbRmdnSYy5vYWyLx/w3EaMfLmBaDpMQvuDJ65PY8Dpnz3wpYmLtApzcrIAqmfrEgdZH1grY/a36w6Xz0DKD8ES25/niYS6+wWE8mWfByY8cXmYEJFYLkHUHtVqNQcltAvoLD3v7o/FUHsNvzlnwxfsCEukC/ho3yUHaBN5Buo17Ojtyl+DqrnvQgUtfcC0ZcAdkUeA+ye7eMru9AUGIJPe4zh509UP/AAfNypi8oj/mAAAAAElFTkSuQmCC)}main ul li.file.log:before,main ul li.file.txt:before,main ul li.file.nfo:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADoSURBVBgZBcExblNBGAbA2ceegTRBuIKOgiihSZNTcC5LUHAihNJR0kGKCDcYJY6D3/77MdOinTvzAgCw8ysThIvn/VojIyMjIyPP+bS1sUQIV2s95pBDDvmbP/mdkft83tpYguZq5Jh/OeaYh+yzy8hTHvNlaxNNczm+la9OTlar1UdA/+C2A4trRCnD3jS8BB1obq2Gk6GU6QbQAS4BUaYSQAf4bhhKKTFdAzrAOwAxEUAH+KEM01SY3gM6wBsEAQB0gJ+maZoC3gI6iPYaAIBJsiRmHU0AALOeFC3aK2cWAACUXe7+AwO0lc9eTHYTAAAAAElFTkSuQmCC)}main ul li.file.rb:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIESURBVDjLjZNPTxNBGIexid9CEr8DBr8CHEiMVoomJiQkxBIM3dgIiaIESJTGGpVtyXIzHhoM4SIe9KAnEi4clQtJEczWFrbdP93d7s7u/JwZ7XYJBdnkyRxmfs/MvO9OD4AeDvuuMPoY/f/hKiMR5WKCvlarpRNCwiAI0A02D1mW38QlcUE/DzebTdi2HWEYBhqNBqrVqpBUKhUUCoVI0g5f4gK+wHVdeJ4nRo5lWdB1HbVaTQgcxwHfRFGUvxIuCKYfzmqZyZ2wKIO8fQ3/1Uv4Sy/QWliAO/sU9qMZmFMS3HfvT1xJ1ITOZJ9RpQi6+RH0y2fQb19BP23CVhRo+TysXA71+XkcMIk6fAfHK6tQVfWEoESXngNra0C5DHZJYGMDZiaD35IEi41qOo3vc3MoJ1Ooj92HpmkdQZiVEsHUAzl88hjY3gYIAdbXYQ0MoDo4CH1kBHssvH8jCf3eGKzDXzBNsyNoF/HH7WSJZLPA7i6wtQVnaAhmKoXjxUX8vDkMY3Qcnm6IInJOCS4nEte9QhF+RhInIRMTcFhYvZWCcXcUPmsl7w6H/w+nBFEb5SLc8TTo8jLq7M4m25mHfd8X8PC5AtHrXB5NdmwRrnfCcc4VCEnpA8jREasp6cpZAnrWO+hCGAn+Sa6xAtl84iJhttYSrzcm6OWSCzznNvzp9/4BgwKvG3Zq1eoAAAAASUVORK5CYII=)}main ul li.file.sql:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHVSURBVDjLjZPLaiJBFIZNHmJWCeQdMuT1Mi/gYlARBRUkao+abHUhmhgU0QHtARVxJ0bxhvfGa07Of5Iu21yYFPyLrqrz1f+f6rIRkQ3icca6ZF39RxesU1VnAVyuVqvJdrvd73Y7+ky8Tk6n87cVYgVcoXixWNByuVSaTqc0Ho+p1+sJpNvtksvlUhCb3W7/cf/w+BSLxfapVIqSySRlMhnSdZ2GwyHN53OaTCbU7/cFYBgG4RCPx/MKub27+1ur1Xqj0YjW6zWxCyloNBqUSCSkYDab0WAw+BBJeqLFtQpvGoFqAlAEaZomuc0ocAQnnU7nALiJ3uh8whgnttttarVaVCgUpCAUCgnQhMAJ+gG3CsDZa7xh1mw2ZbFSqYgwgsGgbDQhcIWeAHSIoP1pcGeNarUqgFKpJMLw+/0q72azkYhmPAWIRmM6AGbXc7kc5fN5AXi9XgWACwAguLEAojrfsVGv1yV/sVikcrksAIfDIYUQHEAoPgLwT3GdzWYNdBfXh3xwApDP5zsqtkoBwuHwaSAQ+OV2u//F43GKRCLEc5ROpwVoOngvBXj7jU/wwZPPX72DT7RXgDfIT27QEgvfKea9c3m9FsA5IN94zqbw9M9fAEuW+zzj8uLvAAAAAElFTkSuQmCC)}main ul li.file.html:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJwSURBVDjLjZPdT1JhHMetvyO3/gfLKy+68bLV2qIAq7UyG6IrdRPL5hs2U5FR0MJIAqZlh7BVViI1kkyyiPkCyUtztQYTYbwJE8W+Pc8pjofK1dk+OxfP+X3O83srAVBCIc8eQhmh/B/sJezm4niCsvX19cTm5uZWPp/H3yDnUKvVKr6ELyinwWtra8hkMhzJZBLxeBwrKyusJBwOQ6PRcJJC8K4DJ/dXM04DOswNqNOLybsRo9N6LCy7kUgkEIlEWEE2mwX9iVar/Smhglqd8IREKwya3qhg809gPLgI/XsrOp/IcXVMhqnFSayurv6RElsT6ZCoov5u1fzUVwvcKRdefVuEKRCA3OFHv2MOxtlBdFuaMf/ZhWg0yt4kFAoVCZS3Hd1gkpOwRt9h0LOES3YvamzPcdF7A6rlPrSbpbhP0kmlUmw9YrHYtoDku2T6pEZ/2ICXEQ8kTz+g2TkNceAKKv2nIHachn6qBx1MI5t/Op1mRXzBd31AiRafBp1vZyEcceGCzQ6p24yjEzocGT6LUacS0iExcrkcK6Fsp6AXLRnmFOjyPMIZixPHmAAOGxZQec2OQyo7zpm6cNN6GZ2kK1RAofPAr8GA4oUMrdNNkIw/wPFhDwSjX3Dwlg0CQy96HreiTlcFZsaAjY0NNvh3QUXtHeHcoKMNA7NjqLd8xHmzDzXDRvRO1KHtngTyhzL4SHeooAAnKMxBtUYQbGWa0Dc+AsWzSVy3qkjeItLCFsz4XoNMaRFFAm4SyTXbmQa2YHQSGacR/pAXO+zGFif4JdlHCpShBzstEz+YfJtmt5cnKKWS/1jnAnT1S38AGTynUFUTzJcAAAAASUVORK5CYII=)}main ul li.file.php:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGsSURBVDjLjZNLSwJRFICtFv2AgggS2vQLDFvVpn0Pi4iItm1KItvWJqW1pYsRemyyNILARbZpm0WtrJ0kbmbUlHmr4+t0z60Z7oSSAx935txzvrlPBwA4EPKMEVwE9z+ME/qtOkbgqtVqUqPRaDWbTegE6YdQKBRkJazAjcWapoGu6xayLIMoilAoFKhEEAQIh8OWxCzuQwEmVKtVMAyDtoiqqiBJEhSLRSqoVCqAP+E47keCAvfU5sDQ8MRs/OYNtr1x2PXdwuJShLLljcFlNAW5HA9khLYp0TUhSYMLHm7PLEDS7zyw3ybRqyfg+TyBtwl2sDP1nKWFiUSazFex3tk45sXjL1Aul20CGTs+syVY37igBbwg03eMsfH9gwSsrZ+Doig2QZsdNiZmMkVrKmwc18azHKELyQrOMEHTDJp8HXu1hostG8dY8PiRngdWMEq467ZwbDxwlIR8XrQLcBvn5k9Gpmd8fn/gHlZWT20C/D4k8eTDB3yVFKjX6xSbgD1If8G970Q3QbvbPehAyxL8SibJEdaxo5dikqvS28sInCjp4Tqb4NV3fgPirZ4pD4KS4wAAAABJRU5ErkJggg==)}main ul li .progress{border:1px solid #eee;display:inline-block;float:left;height:7px;margin:2px 0 2px 2px;width:100px}main ul li .progress .meter{background:#0c0;display:block;height:7px;width:0}main ul li .cancel-upload{color:#900;margin:-1px 0 0 5px}.upload{border:1px solid #eee;border-radius:5px;color:#999;font-size:1.5em;font-weight:700;margin:0 20px;padding:10px 0;text-align:center;transition:.5s}.upload .create-directory{color:#22a;font-size:inherit;text-decoration:underline}.is-touch .upload .droppable,.no-drag-drop .upload .droppable{display:none}.upload [type=file]{max-width:100%}.basicLightbox .basicLightbox__placeholder{max-height:95vh;max-width:95vw;overflow:auto;padding:0 1em}.basicLightbox.font .basicLightbox__placeholder,.basicLightbox.text .basicLightbox__placeholder{background:#fff}body:not([data-disable-checkerboard]) .basicLightbox.image img{pointer-events:all}body:not([data-disable-checkerboard]) .basicLightbox.image img:hover{background:#eee url('data:image/svg+xml,');background-size:30px 30px} +@charset "UTF-8";.basicLightbox{position:fixed;display:flex;justify-content:center;align-items:center;top:0;left:0;width:100%;height:100vh;background:rgba(0,0,0,.8);opacity:.01;transition:opacity .4s ease;z-index:1000;will-change:opacity}.basicLightbox--visible{opacity:1}.basicLightbox__placeholder{max-width:100%;transform:scale(.9);transition:transform .4s ease;z-index:1;will-change:transform}.basicLightbox__placeholder>img:first-child:last-child,.basicLightbox__placeholder>video:first-child:last-child,.basicLightbox__placeholder>iframe:first-child:last-child{display:block;position:absolute;inset:0;margin:auto;max-width:95%;max-height:95%}.basicLightbox__placeholder>video:first-child:last-child,.basicLightbox__placeholder>iframe:first-child:last-child{pointer-events:auto}.basicLightbox__placeholder>img:first-child:last-child,.basicLightbox__placeholder>video:first-child:last-child{width:auto;height:auto}.basicLightbox--img .basicLightbox__placeholder,.basicLightbox--video .basicLightbox__placeholder,.basicLightbox--iframe .basicLightbox__placeholder{width:100%;height:100%;pointer-events:none}.basicLightbox--visible .basicLightbox__placeholder{transform:scale(1)}code[class*=language-],pre[class*=language-]{color:#000;background:none;text-shadow:0 1px white;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,code[class*=language-] ::-moz-selection{text-shadow:none;background:#b3d4fc}pre[class*=language-]::selection,pre[class*=language-] ::selection,code[class*=language-]::selection,code[class*=language-] ::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#905}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#690}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.function,.token.class-name{color:#dd4a68}.token.regex,.token.important,.token.variable{color:#e90}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.toast__container{bottom:0;max-width:calc(40vw - 1em);position:fixed;left:1em;z-index:1}@media (max-width: 800px){.toast__container{max-width:calc(100vw - 2em)}}.toast{background:#fff linear-gradient(180deg,transparent,transparent 80%,rgba(0,0,0,.1) 100%);border:1px solid rgba(0,0,0,.1);border-radius:.25em;box-shadow:0 0 #0000004d;clear:both;color:#000c;cursor:pointer;float:left;margin:0 0 1em;min-width:10em;opacity:0;padding:1em 2.5em 1em 1em;position:relative;transform:translateY(100%);transition:all .4s}.toast:before{content:none;float:left;font-size:1.5em;line-height:.8em;margin-left:-.1em;min-width:1.5em;padding-right:.25em;text-align:center}.toast button{background:transparent;border:none;color:inherit;cursor:pointer;max-width:1em;overflow:hidden;padding:0;position:absolute;right:1em;top:1em;white-space:nowrap}.toast button:before{content:"\2716 "}.toast--info{background:#4a90e2 linear-gradient(180deg,transparent,transparent 80%,rgba(0,0,0,.1) 100%);color:#fffc}.toast--info:before{content:"\24d8"}.toast--success{background:#55dd6b linear-gradient(180deg,transparent,transparent 80%,rgba(0,0,0,.1) 100%);color:#606060cc}.toast--success:before{content:"\2713"}.toast--warning{background:#edc25e linear-gradient(180deg,transparent,transparent 80%,rgba(0,0,0,.1) 100%);color:#606060cc}.toast--warning:before{content:"\26a0"}.toast--error{background:#e23645 linear-gradient(180deg,transparent,transparent 80%,rgba(0,0,0,.1) 100%);color:#fffc}.toast--error:before{content:"\26a0"}.toast--show{box-shadow:0 0 .5em #0000004d;opacity:1;transform:translateY(0)}.toast--hide{box-shadow:0 0 1em #0000004d;opacity:0;transform:translate(-100%) translateY(0)}html{font-size:16px}html,body,ul{font-family:Helvetica,Arial,sans-serif;margin:0;padding:0}html,body{min-height:100vh}li{list-style:none}a{color:inherit;text-decoration:none}.hidden{display:none!important}.invisible{opacity:0;pointer-events:none;position:absolute}.loading{background:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ibGRzLXNwaW5uZXIiIHdpZHRoPSIxNDNweCIgaGVpZ2h0PSIxNDNweCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIiBzdHlsZT0iYmFja2dyb3VuZDogbm9uZTsiPjxnIHRyYW5zZm9ybT0icm90YXRlKDAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49Ii0wLjkxNjY2NjY2NjY2NjY2NjZzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPjwvcmVjdD48L2c+PGcgdHJhbnNmb3JtPSJyb3RhdGUoMzAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49Ii0wLjgzMzMzMzMzMzMzMzMzMzRzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPjwvcmVjdD48L2c+PGcgdHJhbnNmb3JtPSJyb3RhdGUoNjAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49Ii0wLjc1cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT48L3JlY3Q+PC9nPjxnIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSI+PHJlY3QgeD0iNDgiIHk9IjI0IiByeD0iOS42IiByeT0iNC44IiB3aWR0aD0iNCIgaGVpZ2h0PSIxMiIgZmlsbD0iIzc0YzFmNSI+PGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgdmFsdWVzPSIxOzAiIGtleVRpbWVzPSIwOzEiIGR1cj0iMXMiIGJlZ2luPSItMC42NjY2NjY2NjY2NjY2NjY2cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT48L3JlY3Q+PC9nPjxnIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiPjxyZWN0IHg9IjQ4IiB5PSIyNCIgcng9IjkuNiIgcnk9IjQuOCIgd2lkdGg9IjQiIGhlaWdodD0iMTIiIGZpbGw9IiM3NGMxZjUiPjxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIHZhbHVlcz0iMTswIiBrZXlUaW1lcz0iMDsxIiBkdXI9IjFzIiBiZWdpbj0iLTAuNTgzMzMzMzMzMzMzMzMzNHMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+PC9yZWN0PjwvZz48ZyB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49Ii0wLjVzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPjwvcmVjdD48L2c+PGcgdHJhbnNmb3JtPSJyb3RhdGUoMTgwIDUwIDUwKSI+PHJlY3QgeD0iNDgiIHk9IjI0IiByeD0iOS42IiByeT0iNC44IiB3aWR0aD0iNCIgaGVpZ2h0PSIxMiIgZmlsbD0iIzc0YzFmNSI+PGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgdmFsdWVzPSIxOzAiIGtleVRpbWVzPSIwOzEiIGR1cj0iMXMiIGJlZ2luPSItMC40MTY2NjY2NjY2NjY2NjY3cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT48L3JlY3Q+PC9nPjxnIHRyYW5zZm9ybT0icm90YXRlKDIxMCA1MCA1MCkiPjxyZWN0IHg9IjQ4IiB5PSIyNCIgcng9IjkuNiIgcnk9IjQuOCIgd2lkdGg9IjQiIGhlaWdodD0iMTIiIGZpbGw9IiM3NGMxZjUiPjxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIHZhbHVlcz0iMTswIiBrZXlUaW1lcz0iMDsxIiBkdXI9IjFzIiBiZWdpbj0iLTAuMzMzMzMzMzMzMzMzMzMzM3MiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+PC9yZWN0PjwvZz48ZyB0cmFuc2Zvcm09InJvdGF0ZSgyNDAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49Ii0wLjI1cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT48L3JlY3Q+PC9nPjxnIHRyYW5zZm9ybT0icm90YXRlKDI3MCA1MCA1MCkiPjxyZWN0IHg9IjQ4IiB5PSIyNCIgcng9IjkuNiIgcnk9IjQuOCIgd2lkdGg9IjQiIGhlaWdodD0iMTIiIGZpbGw9IiM3NGMxZjUiPjxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIHZhbHVlcz0iMTswIiBrZXlUaW1lcz0iMDsxIiBkdXI9IjFzIiBiZWdpbj0iLTAuMTY2NjY2NjY2NjY2NjY2NjZzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPjwvcmVjdD48L2c+PGcgdHJhbnNmb3JtPSJyb3RhdGUoMzAwIDUwIDUwKSI+PHJlY3QgeD0iNDgiIHk9IjI0IiByeD0iOS42IiByeT0iNC44IiB3aWR0aD0iNCIgaGVpZ2h0PSIxMiIgZmlsbD0iIzc0YzFmNSI+PGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgdmFsdWVzPSIxOzAiIGtleVRpbWVzPSIwOzEiIGR1cj0iMXMiIGJlZ2luPSItMC4wODMzMzMzMzMzMzMzMzMzM3MiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+PC9yZWN0PjwvZz48ZyB0cmFuc2Zvcm09InJvdGF0ZSgzMzAgNTAgNTApIj48cmVjdCB4PSI0OCIgeT0iMjQiIHJ4PSI5LjYiIHJ5PSI0LjgiIHdpZHRoPSI0IiBoZWlnaHQ9IjEyIiBmaWxsPSIjNzRjMWY1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49IjBzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPjwvcmVjdD48L2c+PC9zdmc+) center center no-repeat}.loading>*{opacity:.5}.active{background-color:#ffc}main{padding:20px}main ul{border:1px solid #efefef;border-radius:5px;margin:0;padding:0 5px}main ul li{background:none no-repeat left center;border-top:1px solid #eee;cursor:pointer;display:block;overflow:hidden;padding:5px 0 5px 5px}main ul li:hover{background-color:#fafafa}main ul li:first-child{border-top:0}main ul li.active{color:#000}main ul li.loading{background-size:contain}main ul li.loading *{pointer-events:none}main ul li .size{color:#aaa;display:inline-block;margin:0 10px}main ul li .copy,main ul li .move,main ul li .rename,main ul li .delete,main ul li [download]{background:none no-repeat center center;float:right;height:16px;margin:0 5px;overflow:hidden;text-indent:26px;white-space:nowrap;width:16px}main ul li .copy{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ1SURBVBgZBcFNiJVVGADg5z3fmTujY5NZBANBIVkZ2J9IKkZFGKRuglq1KaqVtoqoVbSKFi1LoY2QEVSbcqiFWWJqPxL044wUGESQVqJOKerce7/z9jyRmba++tXTy2YmnyphPaYQIJBBNuPWfls8l1/EfxdeOrJnxxAgMtO2148d2ffC+rWlxMqkkwBkQjp7aeT97xf99cfS5ZPzv6w6umfHElQoXdw+qN3KhX90JYIgG30243G6Muo9tOYa999WfdfOLs92x4UHd3163eG3ti8ViIgVmdkNumKiUIOu0AURFIFmdmZgx4ZZt9w6uazOTO+FAklAQQlKhBKhRCgRShfOnL/i5hUjd64Kz2+6XjfRPQkVIJPaEUJGaH1SQu0YZHHqXBq2sdaGHlg9KWoZQ4VMEjWKlBJRQiAb2RUGlBZa66RCFFAh0RBBCIlENiY6QBTRhyypIROo0MZk0hDITFAKWqhdkkGSQt/oG1ChtZSZJCkBSCCEE79+Yv7UnIuXLxiNR8rwnsomFfpGn2SjAUjQkuPzHzp98XMPb9ngplVrHFr42OX5ubpx1943K7Rxaple+2EopBZkBo2MNL3wnie2P6ovvbtntzp48iMb1232+6n9OyuMx72+Z3Zmwn03Fi3pkz5oyWffnjERKzy29lnw4iPvmDuxG/unKoyXWhu3lsNefPNnr0VKAVpy/tK/Fk5/7afTR72yda83DjxjqpuEqxVGV/u/pwfdDS+vG05nZpE0wLXLqn2Lzzn287s237XF3IndBlEd/fEwvB2ZacPOgzvHo3w8Iu5NuRxAkkhpovug1u5Q5SoGfWurDxzf/eW2/wEnITFm/fHryQAAAABJRU5ErkJggg==)}main ul li .move{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ2SURBVBgZBcFLiJVlGADg5/3+b87cbLyFNBJ4oexGQYqIi6hFQambgohoE0aLUqGCaBcuonWLUFe1CIJolWCLaiK1C0FUREpRBgmWNpqi4XjOnP97e57ITI+8fuLZ6bnJZ0rYhikECGSQzbi1M1cu5UJcvfzqycN7RgCRmXa9+dXJ9w5su6uUWJV0EoBMSIv/LXv/uyvOnx1eP/3zL2u+PLxnCBVKF3cMarfq1D+6EkGQjT6b8TgtLfceuv0mO7ZU37bFmWx3Xn5w/7HVx9/ePSwQESsysxt0xUShBl2hCyIoAs383MCe7fM23jY5Xedm34UCSUBBCUqEEqFEKBFKF/7+d8mGFcvuXhOe37lWN9E9CRUgk9oRQkZofVJC7Rhk8fulNGpjrY08sHlS1DKGCpkkahQpJaKEQDayKwwoLbTWSYUooEKiIYIQEolsTHSAKKIPWVJDJlChjcmkIZCZoBS0ULskgySFvtE3oEJrKTNJUgKQQAj950eMFg5ZPvebU+vW2zH9WGWnCn2jT7LRACRoyY2FI6ZOfeC+p54zuekeSz99YubkQv304YkDFdo4tUwHfxgJqQWZQSMjPX30Lbv3vmDqzBeceMPMylU2b9jg+1/z5Qrjca/vmZ+bsHVd0ZI+6YOWrL7yp6lbNrHrFQD14LyuxcYK42Fr49Zy1ItvzvVapBSgJetXzrv+4zGzR180XDrvOq5d7fSdvyos3+gvzA66m1+7dzSbmUXSACunq4vn9zt9/B23rp5WuwnXFsf+uNBJ/aHITNv3fbZvvJyPR8T9KWcAJImUHh0eq1sXP+zWDi/G1cHc8Oxgy8cvffT1E/8D2iAtJW5RUGAAAAAASUVORK5CYII=)}main ul li .rename{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFUSURBVDjLrZM/SAJxGIZdWwuDlnCplkAEm1zkaIiGFFpyMIwGK5KGoK2lphDKkMDg3LLUSIJsSKhIi+684CokOtTiMizCGuzEU5K3vOEgKvtBDe/2Pc8H3x8NAM1fQlx4H9M3pcOWp6TXWmM8A7j0629v1nraiAVC0IrrwATKIgs5xyG5QiE+Z4iQdoeU2oAsnqCSO1NSTu+D9VhqRLD8nIB8F0Q2MgmJDyipCzjvYJkIfpN2UBLG8MpP4dxvQ3ZzGuyyBQ2H+AnOOCBd9aL6soh81A5hyYSGWyCFvxUcerqI4S+CvYVOFPMHxLAq8I3qdHVY5LbBhJzEsCrwutpRFBlUHy6wO2tEYtWAzLELPN2P03kjfj3luqDycV2F8AgefWbEnVqEHa2IznSD6BdsVDNStB0lfh0FPoQjdx8RrAqGzC0YprSgxzsUMOY2bf37N/6Ud1Vc9yYcH50CAAAAAElFTkSuQmCC)}main ul li .delete{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJdSURBVDjLpZP7S1NhGMf9W7YfogSJboSEUVCY8zJ31trcps6zTI9bLGJpjp1hmkGNxVz4Q6ildtXKXzJNbJRaRmrXoeWx8tJOTWptnrNryre5YCYuI3rh+8vL+/m8PA/PkwIg5X+y5mJWrxfOUBXm91QZM6UluUmthntHqplxUml2lciF6wrmdHriI0Wx3xw2hAediLwZRWRkCPzdDswaSvGqkGCfq8VEUsEyPF1O8Qu3O7A09RbRvjuIttsRbT6HHzebsDjcB4/JgFFlNv9MnkmsEszodIIY7Oaut2OJcSF68Qx8dgv8tmqEL1gQaaARtp5A+N4NzB0lMXxon/uxbI8gIYjB9HytGYuusfiPIQcN71kjgnW6VeFOkgh3XcHLvAwMSDPohOADdYQJdF1FtLMZPmslvhZJk2ahkgRvq4HHUoWHRDqTEDDl2mDkfheiDgt8pw340/EocuClCuFvboQzb0cwIZgki4KhzlaE6w0InipbVzBfqoK/qRH94i0rgokSFeO11iBkp8EdV8cfJo0yD75aE2ZNRvSJ0lZKcBXLaUYmQrCzDT6tDN5SyRqYlWeDLZAg0H4JQ+Jt6M3atNLE10VSwQsN4Z6r0CBwqzXesHmV+BeoyAUri8EyMfi2FowXS5dhd7doo2DVII0V5BAjigP89GEVAtda8b2ehodU4rNaAW+dGfzlFkyo89GTlcrHYCLpKD+V7yeeHNzLjkp24Uu1Ed6G8/F8qjqGRzlbl2H2dzjpMg1KdwsHxOlmJ7GTeZC/nesXbeZ6c9OYnuxUc3fmBuFft/Ff8xMd0s65SXIb/gAAAABJRU5ErkJggg==)}main ul li [download]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKYSURBVBgZBcFNiFZlGADQ87z3zjfjzDiMk5VimERmBmFpKgVRVATRQLRo5aaNhFA7pZW0qV1Ci0BoUVRQtLc2UmQaJVhBVChUhP2YDuow5sz3c7/36Zx46uipF9fNTR4oYQ82oC+QQVZdrb8tX83PY+X6kdPHF4cAAPHMG2dOf/jKnp2lxHymBiAT0tJ/Ix+dW/bvxcHqLz+dXzhzfHEAAG1pYkevbeZ/vqIpJWRlnFXXpbXR2OPb19t/T+tsXZrOeu/1x17+dMOpt58dAJSImM3MptcUbdAUmiCCIlBtnutZ3LvZtrsn17VzM+8BQEkCCkqEEqFEKBFKEy5dW3Pn7Mh9C+Hgw7doJpoXAKCFTNoGEeo4KaFt6GXx69U0rJ1ahx69a1K0pQOANpNEG0WVooTA+ycuWD/J6rCzYbbnnytrPivs2jQ7dfidH/P6ypovfvh7f5uoiKAIiaysrfY9sW+H53bPOvHtX44e2AkAPvhySa1xttSOTCoyE6kUVgcj12504OS5ywD6HSsDlpaHIqq21pzKTBIASSmhSUbj6tih3WpNiUaabhkMBlZuDrWjYfZHNade+24oI2UGlYWJoj8Yef2TP5SgG1d1XCUyk2R6omq7bmw8ZvPchAduLcbJODh7IQ3GnaZMIIWxiJA1ZVZdNzIcdtpuUGtXaw7H4ptLnRTgxurIRLQOLa7X1SEKSUY11fa8+fFFV1duakf98eWZXrPx1fuHM1mzVMCRU6kxoVrz7vcv2Ti9VSiWVv90cO9biimrg6E2Io89ffir5yPiwZQL6Eu2b52d2raJ22dveHLXPvO9LRSW+1vcNtOZ7tFGiMwEAAAPHTr59fY71j0yPzlvqp3T1ZGoVeRYjVXnL/7uysrI/62cRssvlMuuAAAAAElFTkSuQmCC)}main ul li input{border:0;padding:0;font-size:1rem}main ul li.directory:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGrSURBVDjLxZO7ihRBFIa/6u0ZW7GHBUV0UQQTZzd3QdhMQxOfwMRXEANBMNQX0MzAzFAwEzHwARbNFDdwEd31Mj3X7a6uOr9BtzNjYjKBJ6nicP7v3KqcJFaxhBVtZUAK8OHlld2st7Xl3DJPVONP+zEUV4HqL5UDYHr5xvuQAjgl/Qs7TzvOOVAjxjlC+ePSwe6DfbVegLVuT4r14eTr6zvA8xSAoBLzx6pvj4l+DZIezuVkG9fY2H7YRQIMZIBwycmzH1/s3F8AapfIPNF3kQk7+kw9PWBy+IZOdg5Ug3mkAATy/t0usovzGeCUWTjCz0B+Sj0ekfdvkZ3abBv+U4GaCtJ1iEm6ANQJ6fEzrG/engcKw/wXQvEKxSEKQxRGKE7Izt+DSiwBJMUSm71rguMYhQKrBygOIRStf4TiFFRBvbRGKiQLWP29yRSHKBTtfdBmHs0BUpgvtgF4yRFR+NUKi0XZcYjCeCG2smkzLAHkbRBmP0/Uk26O5YnUActBp1GsAI+S5nRJJJal5K1aAMrq0d6Tm9uI6zjyf75dAe6tx/SsWeD//o2/Ab6IH3/h25pOAAAAAElFTkSuQmCC)}main ul li.directory .size,main ul li.directory [download]{display:none}main ul li.file:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAC4SURBVCjPdZFbDsIgEEWnrsMm7oGGfZrohxvU+Iq1TyjU60Bf1pac4Yc5YS4ZAtGWBMk/drQBOVwJlZrWYkLhsB8UV9K0BUrPGy9cWbng2CtEEUmLGppPjRwpbixUKHBiZRS0p+ZGhvs4irNEvWD8heHpbsyDXznPhYFOyTjJc13olIqzZCHBouE0FRMUjA+s1gTjaRgVFpqRwC8mfoXPPEVPS7LbRaJL2y7bOifRCTEli3U7BMWgLzKlW/CuebZPAAAAAElFTkSuQmCC)}main ul li.file.image:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIcSURBVDjLjZO/T1NhFIafc+/trdRaYk1KUEEWjXHRaCSik+E/cDHGzYXB2YHRhMRFY1SYmRgYHZ3VxIRFDYMraMC2hrbQXm7v9+M4UGobiOEk7/adN+9zvnNEVQEQkYvAGBDy/6oBm6rqAVBVeia30jRtGmOctVaPU5qmuri4+AaYAgJVHTKYNsa4drutnU6nr1arpY1GQ6vVqlprdXt7W5eWlvomMv/uw6tSofB4p+NOF0biYtc48tEAhXiuTZzh/s1xyuUyWZbhvWdlZeXt3Nzca14sf6zW6nXf7uzrcfq9s6sLy5+1Xq8fQQKmo1ZCvlAoyo+tXT5tPGO09IckM2zWznH3/AJ3rl5ACInjmGazifceay2VSgWASISSBaz3FIs1RnJlPF18vEG1keDVk1lLFEWICM45wvAfYqTKriqje0lGI01x2qFtuuwkKQ26oEKcCwnDEBFBRA6HfmBw8JWwl3o2ti7j8+u0TUKzcYkrY/n+wyAIEJEjSxEglLyH5r7j+tg8T1oVZr8GzE69JIoiFMiM7zeHYUgQBAMJVBGU77+eYoxhLcvIxnNk6w8xxvDo3hqH+yIieO+HEkQB/qe6bPL5g/cckCkDiBhjOJULhlCGDJIkXX2z+m3GeW4UCnExyxxxHIIOLNLk2WP5AaQXTYDb1tovgHCy8lEUzQS9g1LAO+f2AX+SZudcAjgZOOeJ3jkHJ0zggNpfYEZnU63wHeoAAAAASUVORK5CYII=)}main ul li.file.py:before,main ul li.file.css:before,main ul li.file.js:before,main ul li.file.xml:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHtSURBVDjLjZM9T9tQFIYpQ5eOMBKlW6eWIQipa8RfQKQghEAKqZgKFQgmFn5AWyVDCipVQZC2EqBWlEqdO2RCpAssQBRsx1+1ndix8wFvfW6wcUhQsfTI0j33PD7n+N4uAF2E+/S5RFwG/8Njl24/LyCIOI6j1+v1y0ajgU64cSSTybdBSVAwSMmmacKyLB/DMKBpGkRRZBJBEJBKpXyJl/yABLTBtm1Uq1X2JsrlMnRdhyRJTFCpVEAfSafTTUlQoFs1luxBAkoolUqQZbmtJTYTT/AoHInOfpcwtVtkwcSBgrkDGYph+60oisIq4Xm+VfB0+U/P0Lvj3NwPGfHPTcHMvoyFXwpe7UmQtAqTUCU0D1VVbwTPVk5jY19Fe3ZfQny7CE51WJDXqpjeEUHr45ki9rIqa4dmQiJfMLItGEs/FcQ2ucbRmdnSYy5vYWyLx/w3EaMfLmBaDpMQvuDJ65PY8Dpnz3wpYmLtApzcrIAqmfrEgdZH1grY/a36w6Xz0DKD8ES25/niYS6+wWE8mWfByY8cXmYEJFYLkHUHtVqNQcltAvoLD3v7o/FUHsNvzlnwxfsCEukC/ho3yUHaBN5Buo17Ojtyl+DqrnvQgUtfcC0ZcAdkUeA+ye7eMru9AUGIJPe4zh509UP/AAfNypi8oj/mAAAAAElFTkSuQmCC)}main ul li.file.log:before,main ul li.file.txt:before,main ul li.file.nfo:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADoSURBVBgZBcExblNBGAbA2ceegTRBuIKOgiihSZNTcC5LUHAihNJR0kGKCDcYJY6D3/77MdOinTvzAgCw8ysThIvn/VojIyMjIyPP+bS1sUQIV2s95pBDDvmbP/mdkft83tpYguZq5Jh/OeaYh+yzy8hTHvNlaxNNczm+la9OTlar1UdA/+C2A4trRCnD3jS8BB1obq2Gk6GU6QbQAS4BUaYSQAf4bhhKKTFdAzrAOwAxEUAH+KEM01SY3gM6wBsEAQB0gJ+maZoC3gI6iPYaAIBJsiRmHU0AALOeFC3aK2cWAACUXe7+AwO0lc9eTHYTAAAAAElFTkSuQmCC)}main ul li.file.rb:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIESURBVDjLjZNPTxNBGIexid9CEr8DBr8CHEiMVoomJiQkxBIM3dgIiaIESJTGGpVtyXIzHhoM4SIe9KAnEi4clQtJEczWFrbdP93d7s7u/JwZ7XYJBdnkyRxmfs/MvO9OD4AeDvuuMPoY/f/hKiMR5WKCvlarpRNCwiAI0A02D1mW38QlcUE/DzebTdi2HWEYBhqNBqrVqpBUKhUUCoVI0g5f4gK+wHVdeJ4nRo5lWdB1HbVaTQgcxwHfRFGUvxIuCKYfzmqZyZ2wKIO8fQ3/1Uv4Sy/QWliAO/sU9qMZmFMS3HfvT1xJ1ITOZJ9RpQi6+RH0y2fQb19BP23CVhRo+TysXA71+XkcMIk6fAfHK6tQVfWEoESXngNra0C5DHZJYGMDZiaD35IEi41qOo3vc3MoJ1Ooj92HpmkdQZiVEsHUAzl88hjY3gYIAdbXYQ0MoDo4CH1kBHssvH8jCf3eGKzDXzBNsyNoF/HH7WSJZLPA7i6wtQVnaAhmKoXjxUX8vDkMY3Qcnm6IInJOCS4nEte9QhF+RhInIRMTcFhYvZWCcXcUPmsl7w6H/w+nBFEb5SLc8TTo8jLq7M4m25mHfd8X8PC5AtHrXB5NdmwRrnfCcc4VCEnpA8jREasp6cpZAnrWO+hCGAn+Sa6xAtl84iJhttYSrzcm6OWSCzznNvzp9/4BgwKvG3Zq1eoAAAAASUVORK5CYII=)}main ul li.file.sql:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHVSURBVDjLjZPLaiJBFIZNHmJWCeQdMuT1Mi/gYlARBRUkao+abHUhmhgU0QHtARVxJ0bxhvfGa07Of5Iu21yYFPyLrqrz1f+f6rIRkQ3icca6ZF39RxesU1VnAVyuVqvJdrvd73Y7+ky8Tk6n87cVYgVcoXixWNByuVSaTqc0Ho+p1+sJpNvtksvlUhCb3W7/cf/w+BSLxfapVIqSySRlMhnSdZ2GwyHN53OaTCbU7/cFYBgG4RCPx/MKub27+1ur1Xqj0YjW6zWxCyloNBqUSCSkYDab0WAw+BBJeqLFtQpvGoFqAlAEaZomuc0ocAQnnU7nALiJ3uh8whgnttttarVaVCgUpCAUCgnQhMAJ+gG3CsDZa7xh1mw2ZbFSqYgwgsGgbDQhcIWeAHSIoP1pcGeNarUqgFKpJMLw+/0q72azkYhmPAWIRmM6AGbXc7kc5fN5AXi9XgWACwAguLEAojrfsVGv1yV/sVikcrksAIfDIYUQHEAoPgLwT3GdzWYNdBfXh3xwApDP5zsqtkoBwuHwaSAQ+OV2u//F43GKRCLEc5ROpwVoOngvBXj7jU/wwZPPX72DT7RXgDfIT27QEgvfKea9c3m9FsA5IN94zqbw9M9fAEuW+zzj8uLvAAAAAElFTkSuQmCC)}main ul li.file.html:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJwSURBVDjLjZPdT1JhHMetvyO3/gfLKy+68bLV2qIAq7UyG6IrdRPL5hs2U5FR0MJIAqZlh7BVViI1kkyyiPkCyUtztQYTYbwJE8W+Pc8pjofK1dk+OxfP+X3O83srAVBCIc8eQhmh/B/sJezm4niCsvX19cTm5uZWPp/H3yDnUKvVKr6ELyinwWtra8hkMhzJZBLxeBwrKyusJBwOQ6PRcJJC8K4DJ/dXM04DOswNqNOLybsRo9N6LCy7kUgkEIlEWEE2mwX9iVar/Smhglqd8IREKwya3qhg809gPLgI/XsrOp/IcXVMhqnFSayurv6RElsT6ZCoov5u1fzUVwvcKRdefVuEKRCA3OFHv2MOxtlBdFuaMf/ZhWg0yt4kFAoVCZS3Hd1gkpOwRt9h0LOES3YvamzPcdF7A6rlPrSbpbhP0kmlUmw9YrHYtoDku2T6pEZ/2ICXEQ8kTz+g2TkNceAKKv2nIHachn6qBx1MI5t/Op1mRXzBd31AiRafBp1vZyEcceGCzQ6p24yjEzocGT6LUacS0iExcrkcK6Fsp6AXLRnmFOjyPMIZixPHmAAOGxZQec2OQyo7zpm6cNN6GZ2kK1RAofPAr8GA4oUMrdNNkIw/wPFhDwSjX3Dwlg0CQy96HreiTlcFZsaAjY0NNvh3QUXtHeHcoKMNA7NjqLd8xHmzDzXDRvRO1KHtngTyhzL4SHeooAAnKMxBtUYQbGWa0Dc+AsWzSVy3qkjeItLCFsz4XoNMaRFFAm4SyTXbmQa2YHQSGacR/pAXO+zGFif4JdlHCpShBzstEz+YfJtmt5cnKKWS/1jnAnT1S38AGTynUFUTzJcAAAAASUVORK5CYII=)}main ul li.file.php:before{content:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGsSURBVDjLjZNLSwJRFICtFv2AgggS2vQLDFvVpn0Pi4iItm1KItvWJqW1pYsRemyyNILARbZpm0WtrJ0kbmbUlHmr4+t0z60Z7oSSAx935txzvrlPBwA4EPKMEVwE9z+ME/qtOkbgqtVqUqPRaDWbTegE6YdQKBRkJazAjcWapoGu6xayLIMoilAoFKhEEAQIh8OWxCzuQwEmVKtVMAyDtoiqqiBJEhSLRSqoVCqAP+E47keCAvfU5sDQ8MRs/OYNtr1x2PXdwuJShLLljcFlNAW5HA9khLYp0TUhSYMLHm7PLEDS7zyw3ybRqyfg+TyBtwl2sDP1nKWFiUSazFex3tk45sXjL1Aul20CGTs+syVY37igBbwg03eMsfH9gwSsrZ+Doig2QZsdNiZmMkVrKmwc18azHKELyQrOMEHTDJp8HXu1hostG8dY8PiRngdWMEq467ZwbDxwlIR8XrQLcBvn5k9Gpmd8fn/gHlZWT20C/D4k8eTDB3yVFKjX6xSbgD1If8G970Q3QbvbPehAyxL8SibJEdaxo5dikqvS28sInCjp4Tqb4NV3fgPirZ4pD4KS4wAAAABJRU5ErkJggg==)}main ul li .progress{border:1px solid #eee;display:inline-block;float:left;height:7px;margin:2px 0 2px 2px;width:100px}main ul li .progress .meter{background:#0c0;display:block;height:7px;width:0}main ul li .cancel-upload{color:#900;margin:-1px 0 0 5px}.upload{border:1px solid #eee;border-radius:5px;color:#999;font-size:1.5em;font-weight:700;margin:0 20px;padding:10px 0;text-align:center;transition:.5s}.upload .create-directory{color:#22a;font-size:inherit;text-decoration:underline}.is-touch .upload .droppable,.no-drag-drop .upload .droppable{display:none}.upload [type=file]{max-width:100%}.basicLightbox .basicLightbox__placeholder{max-height:95vh;max-width:95vw;overflow:auto;padding:0 1em}.basicLightbox.font .basicLightbox__placeholder,.basicLightbox.text .basicLightbox__placeholder{background:#fff}body:not([data-disable-checkerboard]) .basicLightbox.image img{pointer-events:all}body:not([data-disable-checkerboard]) .basicLightbox.image img:hover{background:#eee url('data:image/svg+xml,');background-size:30px 30px} /*# sourceMappingURL=webdav.css.map */ diff --git a/assets/css/style.css b/assets/css/style.css index ed56cde..c1577e8 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -1,3 +1,4 @@ +@charset "UTF-8"; .basicLightbox { position: fixed; display: flex; diff --git a/assets/css/webdav.css.map b/assets/css/webdav.css.map new file mode 100644 index 0000000..65914b1 --- /dev/null +++ b/assets/css/webdav.css.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../node_modules/basiclightbox/src/styles/main.scss", "../node_modules/prismjs/themes/prism.css", "../node_modules/melba-toast/dist/Melba.css", "../src/style.scss"], + "sourcesContent": [null, null, null, null], + "mappings": "iBAOA,eAEC,eACA,aACA,uBACA,mBACA,MACA,OACA,WACA,aACA,0BACA,YACA,4BACA,aACA,oBAEA,wBACC,UAGD,4BACC,eACA,oBACA,8BACA,UACA,sBAEA,0KAGC,cACA,sCAMA,cACA,eAGD,mHAEC,oBAGD,gHAEC,WACA,YAIF,qJAGC,WACA,YACA,oBAGD,oDACC,mBC/DF,6CAEC,WACA,gBACA,wBACA,8DACA,cACA,gBACA,gBACA,oBACA,kBACA,iBACA,gBAEA,gBACA,cACA,WAEA,qBACA,kBACA,iBACA,aAGD,4JAEC,iBACA,mBAGD,wIAEC,iBACA,mBAGD,aACC,6CAEC,kBAKF,gDAGC,cAGD,uDAEC,mBAID,iEAGC,mBAGD,yDAIC,cAGD,mBACC,WAGD,iBACC,WAGD,qGAOC,WAGD,0FAMC,WAGD,0FAKC,cAEA,8BAGD,+CAGC,WAGD,kCAEC,cAGD,8CAGC,WAGD,6BAEC,gBAED,cACC,kBAGD,cACC,YC1IgB,kBAAkB,SAAS,2BAA2B,eAAe,SAAS,UAAU,0BAA0B,kBAAkB,6BAA6B,OAAO,wFAAwF,oDAAoD,yBAAyB,WAAW,YAAY,eAAe,0BAA0B,eAAe,oCAAoC,kBAAkB,2BAA2B,mBAAmB,cAAc,aAAa,WAAW,gBAAgB,iBAAiB,kBAAkB,gBAAgB,oBAAoB,kBAAkB,cAAc,uBAAuB,YAAY,cAAc,eAAe,cAAc,0BAA0B,kBAAkB,UAAU,QAAQ,mBAAmB,qBAAqB,kBAAkB,aAAa,2FAA2F,YAAY,oBAAoB,gBAAgB,gBAAgB,2FAA2F,gBAAgB,uBAAuB,gBAAgB,gBAAgB,2FAA2F,gBAAgB,uBAAuB,gBAAgB,cAAc,2FAA2F,YAAY,qBAAqB,gBAAgB,aAAa,8BAA8B,UAAU,wBAAwB,aAAa,6BAA6B,UAAU,yCCK3mD,KACE,eAGF,aAGE,0DAMF,UAEE,iBAGF,GACE,gBAGF,EACE,cACA,qBAIF,QACE,uBAGF,WACE,UACA,oBACA,kBAGF,SACE,+tIAGA,WACE,WAIJ,QACE,sBAIF,kBAGE,QACE,kEAKA,WACE,sCACA,0BACA,eACA,cACA,sCAGA,iBACE,yBAGF,uBACE,aAGF,kBACE,WAGF,mBACE,wBAEA,qBACE,oBAIJ,iBACE,WACA,mCAIF,8FAKE,wCACA,YACA,yBAEA,gBACA,iBACA,mBACA,WAGF,iBACE,ygCAGF,iBACE,ygCAGF,mBACE,qoBAGF,mBACE,y+BAGF,sBACE,qjCAGF,iBACE,mBAEA,eAIA,4BACE,gvBAGF,2DAEE,aAKF,uBACE,4aAIA,6BACE,w4BAQF,0GACE,w0BAOF,iFACE,4eAKF,0BACE,w2BAKF,2BACE,wyBAKF,4BACE,w/BAKF,2BACE,ovBAKN,qBACE,sBACA,qBACA,WACA,gCAEA,YAEA,4BACE,gBACA,cACA,WACA,QAIJ,0BACE,+BAOR,QACE,wCAEA,WACA,gBACA,6CAGA,kBACA,eAEA,0BACE,WACA,kBACA,0BAGF,8DAEE,aAGF,oBACE,eAKF,2CACE,gBACA,eACA,4BAMA,gGACE,gBAIJ,+DACE,mBAEA,qEAEE,wNAEA", + "names": [] +} diff --git a/src/example.generator.js b/build/example.generator.js similarity index 100% rename from src/example.generator.js rename to build/example.generator.js diff --git a/build/examples-branch.sh b/build/examples-branch.sh index e0a82c4..331106d 100644 --- a/build/examples-branch.sh +++ b/build/examples-branch.sh @@ -1,6 +1,6 @@ [ ! -d ./tmp ] && mkdir -p ./tmp; -node src/example.generator.js --cdn --version "$(git rev-parse --abbrev-ref HEAD)" > ./tmp/example-cdn.js; +node build/example.generator.js --cdn --version "$(git rev-parse --abbrev-ref HEAD)" > ./tmp/example-cdn.js; npm run --silent terser -- ./tmp/example-cdn.js -c -m -e > ./tmp/example-cdn-min.js; printf 'javascript:' > ./examples/bookmarklet/source-min.js; diff --git a/build/examples-tag.sh b/build/examples-tag.sh index 1a20be5..6075ecd 100644 --- a/build/examples-tag.sh +++ b/build/examples-tag.sh @@ -2,7 +2,7 @@ VERSION="$1"; -node src/example.generator.js --cdn --version "$VERSION" > ./tmp/example-cdn.js; +node build/example.generator.js --cdn --version "$VERSION" > ./tmp/example-cdn.js; npm run --silent terser -- ./tmp/example-cdn.js -c -m -e > ./tmp/example-cdn-min.js; printf 'javascript:' > ./examples/bookmarklet/source-min.js; diff --git a/build/examples.sh b/build/examples.sh index d1ae963..a5d0ece 100644 --- a/build/examples.sh +++ b/build/examples.sh @@ -1,8 +1,8 @@ [ ! -d ./tmp ] && mkdir -p ./tmp; -node src/example.generator.js > ./tmp/example-local.js; +node build/example.generator.js > ./tmp/example-local.js; npm run --silent terser -- ./tmp/example-local.js -c -m -e > ./tmp/example-local-min.js; -node src/example.generator.js --cdn > ./tmp/example-cdn.js; +node build/example.generator.js --cdn > ./tmp/example-cdn.js; npm run --silent terser -- ./tmp/example-cdn.js -c -m -e > ./tmp/example-cdn-min.js; printf 'javascript:' > ./examples/bookmarklet/source-min.js; diff --git a/esbuild.js b/esbuild.js index e523c93..eb53279 100644 --- a/esbuild.js +++ b/esbuild.js @@ -17,10 +17,18 @@ const { build } = require('esbuild'), from: ['./dist/webdav.js'], to: ['./src/webdav-min.js'], }, + { + from: ['./dist/webdav.js.map'], + to: ['./src/webdav.js.map'], + }, { from: ['./dist/webdav.css'], to: ['./assets/css/style.css', './assets/css/style-min.css'], }, + { + from: ['./dist/webdav.css.map'], + to: ['./assets/css/webdav.css.map'], + }, ], }), ], diff --git a/package-lock.json b/package-lock.json index 54bbadb..e34efde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,29 +1,32 @@ { "name": "webdav-js", - "version": "2.0.0", + "version": "2.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "webdav-js", - "version": "2.0.0", + "version": "2.1.1", "license": "MIT", "dependencies": { + "@dom111/element": "^0.1.0", + "@dom111/typed-event-emitter": "^0.1.0", "basiclightbox": "^5.0.2", - "esbuild-plugin-copy": "^1.3.0", "i18next": "^21.9.1", "i18next-browser-languagedetector": "^6.1.5", "melba-toast": "^2.0.0", - "prismjs": "^1.17.1", - "whatwg-fetch": "^3.0.0" + "prismjs": "^1.17.1" }, "devDependencies": { + "@types/basiclightbox": "^5.0.1", "@types/expect-puppeteer": "^4.4.7", "@types/jest": "^27.4.1", "@types/jest-environment-puppeteer": "^5.0.1", + "@types/prismjs": "^1.26.0", "@types/puppeteer": "^5.4.6", "@xmldom/xmldom": "^0.8.2", "esbuild": "^0.14.38", + "esbuild-plugin-copy": "^1.3.0", "esbuild-sass-plugin": "^2.2.6", "jest": "^27.5.1", "jest-puppeteer": "^6.1.0", @@ -629,6 +632,23 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@dom111/element": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@dom111/element/-/element-0.1.3.tgz", + "integrity": "sha512-pcuG1Kyd/uUgemEH10APYLl99SNfPJ5gKnAUbVTBi/4rp16XfHpOxal17niLTQrpCrGk7twr6dPjJt3JeFdvdQ==", + "dependencies": { + "css-what": "^6.1.0" + } + }, + "node_modules/@dom111/typed-event-emitter": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@dom111/typed-event-emitter/-/typed-event-emitter-0.1.1.tgz", + "integrity": "sha512-LygbsMIxEd12sPDPpAFHSvNLqOHhU/PPQNeXURaEl2CgLcHXsJTP9vNUlopAlHEzXQK1D497JUgok0kTC9sU4Q==", + "dependencies": { + "prettier": "^2.6.2", + "typescript": "^4.6.3" + } + }, "node_modules/@esbuild/linux-loong64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.14.54.tgz", @@ -636,6 +656,7 @@ "cpu": [ "loong64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -993,6 +1014,7 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1005,6 +1027,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, "engines": { "node": ">= 8" } @@ -1013,6 +1036,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1126,14 +1150,20 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.0.tgz", - "integrity": "sha512-v4Vwdko+pgymgS+A2UIaJru93zQd85vIGWObM5ekZNdXCKtDYqATlEYnWgfo86Q6I1Lh0oXnksDnMU1cwmlPDw==", + "version": "7.18.1", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.1.tgz", + "integrity": "sha512-FSdLaZh2UxaMuLp9lixWaHq/golWTRWOnRsAXzDTDSDOQLuZb1nsdCt6pJSPWSEQt2eFZ2YVk3oYhn+1kLMeMA==", "dev": true, "dependencies": { "@babel/types": "^7.3.0" } }, + "node_modules/@types/basiclightbox": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/basiclightbox/-/basiclightbox-5.0.1.tgz", + "integrity": "sha512-77kVrFQyD76bD6uMlYiAAUjZkbO0YrOWT/fYYxHzFtR+CQ32jVhwClCkIbkQJ81uYFaBgJZhyzxKIrd8s85B3A==", + "dev": true + }, "node_modules/@types/expect-puppeteer": { "version": "4.4.7", "resolved": "https://registry.npmjs.org/@types/expect-puppeteer/-/expect-puppeteer-4.4.7.tgz", @@ -1199,9 +1229,9 @@ } }, "node_modules/@types/node": { - "version": "18.7.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.13.tgz", - "integrity": "sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==", + "version": "18.7.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.14.tgz", + "integrity": "sha512-6bbDaETVi8oyIARulOE9qF1/Qdi/23z6emrUh0fNJRUmjznqrixD4MpGDdgOFk5Xb0m2H6Xu42JGdvAxaJR/wA==", "dev": true }, "node_modules/@types/prettier": { @@ -1210,6 +1240,12 @@ "integrity": "sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==", "dev": true }, + "node_modules/@types/prismjs": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.0.tgz", + "integrity": "sha512-ZTaqn/qSqUuAq1YwvOFQfVW1AR/oQJlLSZVustdjwI+GZ8kr0MSHBj0tsXPW1EqHubx50gtBEjbPGsdZwQwCjQ==", + "dev": true + }, "node_modules/@types/puppeteer": { "version": "5.4.6", "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-5.4.6.tgz", @@ -1348,6 +1384,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -1399,6 +1436,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, "engines": { "node": ">=8" } @@ -1577,6 +1615,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -1698,9 +1737,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001383", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001383.tgz", - "integrity": "sha512-swMpEoTp5vDoGBZsYZX7L7nXHe6dsHxi9o6/LKf/f0LukVtnrxly5GVb/fWdCDTqi/yw6Km6tiJ0pmBacm0gbg==", + "version": "1.0.30001387", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001387.tgz", + "integrity": "sha512-fKDH0F1KOJvR+mWSOvhj8lVRr/Q/mc5u5nabU2vi1/sgvlSqEsE8dOq0Hy/BqVbDkCYQPRRHB1WRjW6PGB/7PA==", "dev": true, "funding": [ { @@ -1717,6 +1756,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1830,6 +1870,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -1840,7 +1881,8 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/combined-stream": { "version": "1.0.8", @@ -1908,6 +1950,17 @@ "node": ">= 8" } }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/cssom": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", @@ -2050,6 +2103,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -2079,9 +2133,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.230", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.230.tgz", - "integrity": "sha512-3pwjAK0qHSDN9+YAF4fJknsSruP7mpjdWzUSruIJD/JCH77pEh0SorEyb3xVaKkfwk2tzjOt2D8scJ0KAdfXLA==", + "version": "1.4.239", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.239.tgz", + "integrity": "sha512-XbhfzxPIFzMjJm17T7yUGZEyYh5XuUjrA/FQ7JUy2bEd4qQ7MvFTaKpZ6zXZog1cfVttESo2Lx0ctnf7eQOaAQ==", "dev": true }, "node_modules/emittery": { @@ -2125,6 +2179,7 @@ "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.54.tgz", "integrity": "sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==", + "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -2163,6 +2218,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "android" @@ -2178,6 +2234,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "android" @@ -2193,6 +2250,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "darwin" @@ -2208,6 +2266,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "darwin" @@ -2223,6 +2282,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "freebsd" @@ -2238,6 +2298,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "freebsd" @@ -2253,6 +2314,7 @@ "cpu": [ "ia32" ], + "dev": true, "optional": true, "os": [ "linux" @@ -2268,6 +2330,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -2283,6 +2346,7 @@ "cpu": [ "arm" ], + "dev": true, "optional": true, "os": [ "linux" @@ -2298,6 +2362,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -2313,6 +2378,7 @@ "cpu": [ "mips64el" ], + "dev": true, "optional": true, "os": [ "linux" @@ -2328,6 +2394,7 @@ "cpu": [ "ppc64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -2343,6 +2410,7 @@ "cpu": [ "riscv64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -2358,6 +2426,7 @@ "cpu": [ "s390x" ], + "dev": true, "optional": true, "os": [ "linux" @@ -2373,6 +2442,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "netbsd" @@ -2388,6 +2458,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "openbsd" @@ -2400,6 +2471,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/esbuild-plugin-copy/-/esbuild-plugin-copy-1.3.0.tgz", "integrity": "sha512-LOx1xJOlAaCFMRtokHjsJfEkrosy3RDRa8SUHmn7loo0gwrouBQQwLAmOyMECshf7gSR1cPSRtAHu3KF/kQsyw==", + "dev": true, "dependencies": { "chalk": "^4.1.2", "fs-extra": "^10.0.1", @@ -2427,6 +2499,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "sunos" @@ -2442,6 +2515,7 @@ "cpu": [ "ia32" ], + "dev": true, "optional": true, "os": [ "win32" @@ -2457,6 +2531,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "win32" @@ -2472,6 +2547,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "win32" @@ -2657,6 +2733,7 @@ "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -2684,6 +2761,7 @@ "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -2711,6 +2789,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -2845,6 +2924,7 @@ "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -2943,6 +3023,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -3003,6 +3084,7 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -3021,7 +3103,8 @@ "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true }, "node_modules/has": { "version": "1.0.3", @@ -3039,6 +3122,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -3176,6 +3260,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true, "engines": { "node": ">= 4" } @@ -3285,6 +3370,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -3311,6 +3397,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -3322,6 +3409,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -4233,6 +4321,7 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, "dependencies": { "universalify": "^2.0.0" }, @@ -4418,6 +4507,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, "engines": { "node": ">= 8" } @@ -4426,6 +4516,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -4764,6 +4855,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, "engines": { "node": ">=8" } @@ -4785,6 +4877,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -4826,7 +4919,6 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "dev": true, "bin": { "prettier": "bin-prettier.js" }, @@ -4928,9 +5020,9 @@ } }, "node_modules/puppeteer": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-16.2.0.tgz", - "integrity": "sha512-7Au6iC98rS6WEAD110V4Bxd0iIbqoFtzz9XzkG1BSofidS1VAJ881E1+GFR7Xn2Yea0hbj8n0ErzRyseMp1Ctg==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-17.0.0.tgz", + "integrity": "sha512-T2rdzlPxnPezF218kywFP3O+0YI5/8Kl8riNUicGb+KuMyDTrqRjhSOSDp6coQ1T4QYPBARTFp4EMBepMOzAQA==", "dev": true, "hasInstallScript": true, "peer": true, @@ -4983,6 +5075,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -5115,6 +5208,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -5139,6 +5233,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "funding": [ { "type": "github", @@ -5179,9 +5274,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.54.5", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.54.5.tgz", - "integrity": "sha512-p7DTOzxkUPa/63FU0R3KApkRHwcVZYC0PLnLm5iyZACyp15qSi32x7zVUhRdABAATmkALqgGrjCJAcWvobmhHw==", + "version": "1.54.8", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.54.8.tgz", + "integrity": "sha512-ib4JhLRRgbg6QVy6bsv5uJxnJMTS2soVcCp9Y88Extyy13A8vV0G1fAwujOzmNkFQbR3LvedudAMbtuNRPbQww==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -5289,6 +5384,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, "engines": { "node": ">=8" } @@ -5452,6 +5548,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -5605,6 +5702,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -5816,11 +5914,9 @@ } }, "node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", - "dev": true, - "peer": true, + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", + "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -5844,6 +5940,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true, "engines": { "node": ">= 10.0.0" } @@ -5987,11 +6084,6 @@ "iconv-lite": "0.4.24" } }, - "node_modules/whatwg-fetch": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", - "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==" - }, "node_modules/whatwg-mimetype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", @@ -6622,10 +6714,28 @@ } } }, + "@dom111/element": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@dom111/element/-/element-0.1.3.tgz", + "integrity": "sha512-pcuG1Kyd/uUgemEH10APYLl99SNfPJ5gKnAUbVTBi/4rp16XfHpOxal17niLTQrpCrGk7twr6dPjJt3JeFdvdQ==", + "requires": { + "css-what": "^6.1.0" + } + }, + "@dom111/typed-event-emitter": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@dom111/typed-event-emitter/-/typed-event-emitter-0.1.1.tgz", + "integrity": "sha512-LygbsMIxEd12sPDPpAFHSvNLqOHhU/PPQNeXURaEl2CgLcHXsJTP9vNUlopAlHEzXQK1D497JUgok0kTC9sU4Q==", + "requires": { + "prettier": "^2.6.2", + "typescript": "^4.6.3" + } + }, "@esbuild/linux-loong64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.14.54.tgz", "integrity": "sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==", + "dev": true, "optional": true }, "@hapi/hoek": { @@ -6912,6 +7022,7 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "requires": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -6920,12 +7031,14 @@ "@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true }, "@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -7033,14 +7146,20 @@ } }, "@types/babel__traverse": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.0.tgz", - "integrity": "sha512-v4Vwdko+pgymgS+A2UIaJru93zQd85vIGWObM5ekZNdXCKtDYqATlEYnWgfo86Q6I1Lh0oXnksDnMU1cwmlPDw==", + "version": "7.18.1", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.1.tgz", + "integrity": "sha512-FSdLaZh2UxaMuLp9lixWaHq/golWTRWOnRsAXzDTDSDOQLuZb1nsdCt6pJSPWSEQt2eFZ2YVk3oYhn+1kLMeMA==", "dev": true, "requires": { "@babel/types": "^7.3.0" } }, + "@types/basiclightbox": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/basiclightbox/-/basiclightbox-5.0.1.tgz", + "integrity": "sha512-77kVrFQyD76bD6uMlYiAAUjZkbO0YrOWT/fYYxHzFtR+CQ32jVhwClCkIbkQJ81uYFaBgJZhyzxKIrd8s85B3A==", + "dev": true + }, "@types/expect-puppeteer": { "version": "4.4.7", "resolved": "https://registry.npmjs.org/@types/expect-puppeteer/-/expect-puppeteer-4.4.7.tgz", @@ -7106,9 +7225,9 @@ } }, "@types/node": { - "version": "18.7.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.13.tgz", - "integrity": "sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==", + "version": "18.7.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.14.tgz", + "integrity": "sha512-6bbDaETVi8oyIARulOE9qF1/Qdi/23z6emrUh0fNJRUmjznqrixD4MpGDdgOFk5Xb0m2H6Xu42JGdvAxaJR/wA==", "dev": true }, "@types/prettier": { @@ -7117,6 +7236,12 @@ "integrity": "sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==", "dev": true }, + "@types/prismjs": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.0.tgz", + "integrity": "sha512-ZTaqn/qSqUuAq1YwvOFQfVW1AR/oQJlLSZVustdjwI+GZ8kr0MSHBj0tsXPW1EqHubx50gtBEjbPGsdZwQwCjQ==", + "dev": true + }, "@types/puppeteer": { "version": "5.4.6", "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-5.4.6.tgz", @@ -7227,6 +7352,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -7265,7 +7391,8 @@ "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true }, "asynckit": { "version": "0.4.0", @@ -7403,6 +7530,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "requires": { "fill-range": "^7.0.1" } @@ -7479,15 +7607,16 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001383", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001383.tgz", - "integrity": "sha512-swMpEoTp5vDoGBZsYZX7L7nXHe6dsHxi9o6/LKf/f0LukVtnrxly5GVb/fWdCDTqi/yw6Km6tiJ0pmBacm0gbg==", + "version": "1.0.30001387", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001387.tgz", + "integrity": "sha512-fKDH0F1KOJvR+mWSOvhj8lVRr/Q/mc5u5nabU2vi1/sgvlSqEsE8dOq0Hy/BqVbDkCYQPRRHB1WRjW6PGB/7PA==", "dev": true }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -7574,6 +7703,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "requires": { "color-name": "~1.1.4" } @@ -7581,7 +7711,8 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "combined-stream": { "version": "1.0.8", @@ -7640,6 +7771,11 @@ "which": "^2.0.1" } }, + "css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==" + }, "cssom": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", @@ -7752,6 +7888,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "requires": { "path-type": "^4.0.0" } @@ -7774,9 +7911,9 @@ } }, "electron-to-chromium": { - "version": "1.4.230", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.230.tgz", - "integrity": "sha512-3pwjAK0qHSDN9+YAF4fJknsSruP7mpjdWzUSruIJD/JCH77pEh0SorEyb3xVaKkfwk2tzjOt2D8scJ0KAdfXLA==", + "version": "1.4.239", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.239.tgz", + "integrity": "sha512-XbhfzxPIFzMjJm17T7yUGZEyYh5XuUjrA/FQ7JUy2bEd4qQ7MvFTaKpZ6zXZog1cfVttESo2Lx0ctnf7eQOaAQ==", "dev": true }, "emittery": { @@ -7814,6 +7951,7 @@ "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.54.tgz", "integrity": "sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==", + "dev": true, "requires": { "@esbuild/linux-loong64": "0.14.54", "esbuild-android-64": "0.14.54", @@ -7842,102 +7980,119 @@ "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.54.tgz", "integrity": "sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ==", + "dev": true, "optional": true }, "esbuild-android-arm64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.54.tgz", "integrity": "sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg==", + "dev": true, "optional": true }, "esbuild-darwin-64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.54.tgz", "integrity": "sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug==", + "dev": true, "optional": true }, "esbuild-darwin-arm64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.54.tgz", "integrity": "sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw==", + "dev": true, "optional": true }, "esbuild-freebsd-64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.54.tgz", "integrity": "sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg==", + "dev": true, "optional": true }, "esbuild-freebsd-arm64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.54.tgz", "integrity": "sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q==", + "dev": true, "optional": true }, "esbuild-linux-32": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.54.tgz", "integrity": "sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw==", + "dev": true, "optional": true }, "esbuild-linux-64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.54.tgz", "integrity": "sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg==", + "dev": true, "optional": true }, "esbuild-linux-arm": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.54.tgz", "integrity": "sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw==", + "dev": true, "optional": true }, "esbuild-linux-arm64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.54.tgz", "integrity": "sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig==", + "dev": true, "optional": true }, "esbuild-linux-mips64le": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.54.tgz", "integrity": "sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==", + "dev": true, "optional": true }, "esbuild-linux-ppc64le": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.54.tgz", "integrity": "sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ==", + "dev": true, "optional": true }, "esbuild-linux-riscv64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.54.tgz", "integrity": "sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg==", + "dev": true, "optional": true }, "esbuild-linux-s390x": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.54.tgz", "integrity": "sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA==", + "dev": true, "optional": true }, "esbuild-netbsd-64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.54.tgz", "integrity": "sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w==", + "dev": true, "optional": true }, "esbuild-openbsd-64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.54.tgz", "integrity": "sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw==", + "dev": true, "optional": true }, "esbuild-plugin-copy": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/esbuild-plugin-copy/-/esbuild-plugin-copy-1.3.0.tgz", "integrity": "sha512-LOx1xJOlAaCFMRtokHjsJfEkrosy3RDRa8SUHmn7loo0gwrouBQQwLAmOyMECshf7gSR1cPSRtAHu3KF/kQsyw==", + "dev": true, "requires": { "chalk": "^4.1.2", "fs-extra": "^10.0.1", @@ -7959,24 +8114,28 @@ "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.54.tgz", "integrity": "sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw==", + "dev": true, "optional": true }, "esbuild-windows-32": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.54.tgz", "integrity": "sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w==", + "dev": true, "optional": true }, "esbuild-windows-64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.54.tgz", "integrity": "sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ==", + "dev": true, "optional": true }, "esbuild-windows-arm64": { "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.54.tgz", "integrity": "sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg==", + "dev": true, "optional": true }, "escalade": { @@ -8101,6 +8260,7 @@ "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -8125,6 +8285,7 @@ "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, "requires": { "reusify": "^1.0.4" } @@ -8152,6 +8313,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -8245,6 +8407,7 @@ "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -8312,6 +8475,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -8359,6 +8523,7 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -8371,7 +8536,8 @@ "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true }, "has": { "version": "1.0.3", @@ -8385,7 +8551,8 @@ "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, "homedir-polyfill": { "version": "1.0.3", @@ -8473,7 +8640,8 @@ "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true }, "immutable": { "version": "4.1.0", @@ -8558,7 +8726,8 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true }, "is-fullwidth-code-point": { "version": "3.0.0", @@ -8576,6 +8745,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -8583,7 +8753,8 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "is-plain-object": { "version": "2.0.4", @@ -9295,6 +9466,7 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, "requires": { "graceful-fs": "^4.1.6", "universalify": "^2.0.0" @@ -9443,12 +9615,14 @@ "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true }, "micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, "requires": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -9710,7 +9884,8 @@ "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true }, "pend": { "version": "1.2.0", @@ -9728,7 +9903,8 @@ "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true }, "pirates": { "version": "4.0.5", @@ -9754,8 +9930,7 @@ "prettier": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "dev": true + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" }, "pretty-format": { "version": "27.5.1", @@ -9829,9 +10004,9 @@ "dev": true }, "puppeteer": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-16.2.0.tgz", - "integrity": "sha512-7Au6iC98rS6WEAD110V4Bxd0iIbqoFtzz9XzkG1BSofidS1VAJ881E1+GFR7Xn2Yea0hbj8n0ErzRyseMp1Ctg==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-17.0.0.tgz", + "integrity": "sha512-T2rdzlPxnPezF218kywFP3O+0YI5/8Kl8riNUicGb+KuMyDTrqRjhSOSDp6coQ1T4QYPBARTFp4EMBepMOzAQA==", "dev": true, "peer": true, "requires": { @@ -9867,7 +10042,8 @@ "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true }, "react-is": { "version": "17.0.2", @@ -9958,7 +10134,8 @@ "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true }, "rimraf": { "version": "3.0.2", @@ -9973,6 +10150,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "requires": { "queue-microtask": "^1.2.2" } @@ -9999,9 +10177,9 @@ "dev": true }, "sass": { - "version": "1.54.5", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.54.5.tgz", - "integrity": "sha512-p7DTOzxkUPa/63FU0R3KApkRHwcVZYC0PLnLm5iyZACyp15qSi32x7zVUhRdABAATmkALqgGrjCJAcWvobmhHw==", + "version": "1.54.8", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.54.8.tgz", + "integrity": "sha512-ib4JhLRRgbg6QVy6bsv5uJxnJMTS2soVcCp9Y88Extyy13A8vV0G1fAwujOzmNkFQbR3LvedudAMbtuNRPbQww==", "dev": true, "requires": { "chokidar": ">=3.0.0 <4.0.0", @@ -10083,7 +10261,8 @@ "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true }, "source-map": { "version": "0.6.1", @@ -10202,6 +10381,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -10324,6 +10504,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "requires": { "is-number": "^7.0.0" } @@ -10456,11 +10637,9 @@ } }, "typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", - "dev": true, - "peer": true + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", + "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==" }, "unbzip2-stream": { "version": "1.4.3", @@ -10476,7 +10655,8 @@ "universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true }, "update-browserslist-db": { "version": "1.0.5", @@ -10585,11 +10765,6 @@ "iconv-lite": "0.4.24" } }, - "whatwg-fetch": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", - "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==" - }, "whatwg-mimetype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", diff --git a/package.json b/package.json index fb85568..bed841a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webdav-js", - "version": "2.1.1", + "version": "2.2.0", "description": "WebDAV functionality intended for use as a bookmarklet or to make a simple Apache webserver an interactive WebDAV environment.", "repository": { "type": "git", @@ -30,12 +30,15 @@ "watch": "npm run build:watch" }, "devDependencies": { + "@types/basiclightbox": "^5.0.1", "@types/expect-puppeteer": "^4.4.7", "@types/jest": "^27.4.1", "@types/jest-environment-puppeteer": "^5.0.1", + "@types/prismjs": "^1.26.0", "@types/puppeteer": "^5.4.6", "@xmldom/xmldom": "^0.8.2", "esbuild": "^0.14.38", + "esbuild-plugin-copy": "^1.3.0", "esbuild-sass-plugin": "^2.2.6", "jest": "^27.5.1", "jest-puppeteer": "^6.1.0", @@ -45,12 +48,12 @@ "ts-node": "^10.7.0" }, "dependencies": { + "@dom111/element": "^0.1.0", + "@dom111/typed-event-emitter": "^0.1.0", "basiclightbox": "^5.0.2", - "esbuild-plugin-copy": "^1.3.0", "i18next": "^21.9.1", "i18next-browser-languagedetector": "^6.1.5", - "melba-toast": "^2.0.0", - "prismjs": "^1.17.1", - "whatwg-fetch": "^3.0.0" + "melba-toast": "^3.0.0", + "prismjs": "^1.17.1" } } diff --git a/src/components/Container.ts b/src/components/Container.ts new file mode 100644 index 0000000..48f56b8 --- /dev/null +++ b/src/components/Container.ts @@ -0,0 +1,9 @@ +import Element, { s } from '@dom111/element'; + +export default class Container extends Element { + constructor() { + const template = '
'; + + super(s(template)); + } +} diff --git a/src/components/Footer.ts b/src/components/Footer.ts new file mode 100644 index 0000000..de082b5 --- /dev/null +++ b/src/components/Footer.ts @@ -0,0 +1,97 @@ +import Element, { on, s } from '@dom111/element'; +import DAV from '../lib/DAV'; +import Entry from '../lib/Entry'; +import State from '../lib/State'; +import handleFileUpload from '../lib/handleFileUpload'; +import joinPath from '../lib/joinPath'; +import { success } from 'melba-toast'; +import { t } from 'i18next'; +import trailingSlash from '../lib/trailingSlash'; + +export default class Footer extends Element { + #dav: DAV; + #state: State; + + constructor(dav: DAV, state: State) { + super( + s(``) + ); + + this.#dav = dav; + this.#state = state; + + this.bindEvents(); + } + + private bindEvents(): void { + const input = this.query('input[type="file"]') as HTMLInputElement, + createDirectoryLink = this.query( + '.create-directory' + ) as HTMLAnchorElement; + + on(input, 'change', async (): Promise => { + for (const file of input.files) { + handleFileUpload(this.#dav, this.#state, file); + } + + this.#state.update(); + + input.value = null; + }); + + on( + createDirectoryLink, + 'click', + async (event: MouseEvent): Promise => { + event.preventDefault(); + + const directoryName = prompt('', t('directoryName')); + + if (!directoryName) { + return; + } + + this.handleCreateDirectory( + trailingSlash(joinPath(location.pathname, directoryName)), + directoryName + ); + } + ); + } + + async handleCreateDirectory(fullPath: string, directoryName: string) { + const result = await this.#dav.mkcol(fullPath); + + if (!result) { + return; + } + + success( + t('successfullyCreated', { + interpolation: { + escapeValue: false, + }, + directoryName, + }) + ); + + const collection = this.#state.getCollection(); + + collection.add( + new Entry({ + directory: true, + fullPath, + modified: Date.now(), + collection, + }) + ); + + this.#state.update(); + } +} diff --git a/src/components/Header.ts b/src/components/Header.ts new file mode 100644 index 0000000..3939ab4 --- /dev/null +++ b/src/components/Header.ts @@ -0,0 +1,34 @@ +import Element, { s } from '@dom111/element'; +import State from '../lib/State'; + +const getPath = (state: State): string => decodeURIComponent(state.getPath()); + +export class Header extends Element { + #state: State; + + constructor(state: State) { + super( + s(`
+

${getPath(state)}

+
`) + ); + + this.#state = state; + + this.bindEvents(); + } + + private bindEvents(): void { + this.#state.on('updated', (): void => { + if (this.#state.isDirectory()) { + this.update(); + } + }); + } + + private update(): void { + this.query('h1').innerHTML = getPath(this.#state); + } +} + +export default Header; diff --git a/src/components/Item.ts b/src/components/Item.ts new file mode 100644 index 0000000..9018a42 --- /dev/null +++ b/src/components/Item.ts @@ -0,0 +1,434 @@ +import { BasicLightBox, create } from 'basiclightbox'; +import Element, { + addClass, + emit, + off, + on, + removeClass, + s, +} from '@dom111/element'; +import DAV from '../lib/DAV'; +import Entry from '../lib/Entry'; +import Prism from 'prismjs'; +import State from '../lib/State'; +import joinPath from '../lib/joinPath'; +import previewItems from '../lib/previewItems'; +import { success } from 'melba-toast'; +import { t } from 'i18next'; + +const template = (entry: Entry): string => `
  • + ${entry.title} + + ${entry.displaySize} + + + + + +
  • `; + +export default class Item extends Element { + #dav: DAV; + #entry: Entry; + #state: State; + #templates: { + [key: string]: (entry: Entry, content?: string) => string; + } = Object.freeze({ + video: (entry: Entry): string => + ``, + audio: (entry: Entry): string => + ``, + image: (entry: Entry): string => + `${entry.title}`, + font: (entry: Entry): string => { + const formats = { + eot: 'embedded-opentype', + otf: 'opentype', + ttf: 'truetype', + }, + extension = entry.name.replace(/^.+\.([^.]+)$/, '$1').toLowerCase(), + fontName = entry.fullPath.replace(/\W+/g, '_'), + demoText = `${t('pangram')} 0123456789
    + ${t('alphabet')}`; + + return ` +

    ${entry.title}

    +

    ${demoText}

    +

    ${demoText}

    +

    ${demoText}

    +

    ${demoText}

    `; + }, + text: (entry: Entry, content: string): string => + `
    ${content.replace(
    +        /[<>]/g,
    +        (c: string): string => (c === '<' ? '<' : '>')
    +      )}
    `, + pdf: (entry: Entry): string => + ``, + }); + + constructor(entry: Entry, dav: DAV, state: State) { + super(s(template(entry))); + + this.#dav = dav; + this.#state = state; + this.#entry = entry; + + this.addClass( + ...[ + entry.directory ? 'directory' : 'file', + entry.type ? entry.type : 'unknown', + ] + ); + + if (entry.placeholder) { + this.addClass('loading'); + } + + if (!entry.del) { + this.query('.delete').setAttribute('hidden', ''); + } + + if (!entry.rename) { + this.query('.rename').setAttribute('hidden', ''); + } + + this.bindEvents(); + } + + private bindEvents(): void { + this.on('click', (event: MouseEvent): void => { + if (event.ctrlKey || event.button === 1) { + window.open(this.#entry.fullPath); + + return; + } + + if (event.shiftKey) { + this.download(); + + return; + } + + this.open(); + }); + + const entryUpdatedHandler = (): void => { + this.#entry.off('updated', entryUpdatedHandler); + + this.update(); + }; + + this.#entry.on('updated', entryUpdatedHandler); + + on(this.query('[download]'), 'click', (event: MouseEvent): void => + event.stopPropagation() + ); + + on(this.query('.delete'), 'click', (event: MouseEvent): void => { + event.preventDefault(); + event.stopPropagation(); + + this.del(); + }); + + on(this.query('.rename'), 'click', (event: MouseEvent): void => { + event.stopPropagation(); + event.preventDefault(); + + this.rename(); + }); + + this.on('keydown', (event: KeyboardEvent): void => { + if (['F2', 'Delete', 'Enter'].includes(event.key)) { + event.preventDefault(); + + if (event.key === 'F2' && this.#entry.rename) { + this.rename(); + } + + if (event.key === 'Delete' && this.#entry.del) { + this.del(); + } + + if (event.key === 'Enter' && !this.#entry.directory && event.shiftKey) { + this.download(); + + return; + } + + if (event.key === 'Enter') { + this.open(); + } + } + }); + } + + async del(): Promise { + const entry = this.#entry; + + if (!entry.del) { + throw new TypeError(`'${entry.name}' is read only.`); + } + + this.addClass('loading'); + + if ( + !confirm( + t('deleteConfirmation', { + file: entry.title, + }) + ) + ) { + this.removeClass('loading'); + + return; + } + + const response = await this.#dav.del(entry.fullPath); + + if (!response) { + return; + } + + this.#state.getCollection().remove(this.#entry); + this.element().remove(); + + success( + t('successfullyDeleted', { + interpolation: { + escapeValue: false, + }, + file: entry.title, + }) + ); + } + + download(): void { + if (this.#entry.directory) { + return; + } + + emit(this.query('[download]'), new MouseEvent('click')); + } + + async open(): Promise { + if (this.hasClass('open')) { + return; + } + + this.addClass('open', 'loading'); + + const entry = this.#entry; + + const response = await this.#dav.check(entry.fullPath); + + if (!response) { + this.removeClass('open', 'loading'); + + return; + } + + if (entry.directory) { + this.#state.setPath(entry.fullPath); + this.removeClass('open', 'loading'); + + return; + } + + const launchLightbox = ( + lightboxContent: string, + onShow: ((lightbox: BasicLightBox) => any) | null = null + ): void => { + const close = (): void => lightbox.close(), + keyListener = (event: KeyboardEvent): void => { + if (!['Escape', 'ArrowUp', 'ArrowDown'].includes(event.key)) { + return; + } + + const [previous, next] = previewItems( + this.element(), + 'li:not(.directory):not([data-type="unknown"])' + ); + + close(); + + if (event.key === 'ArrowUp' && previous) { + emit(previous, new MouseEvent('click')); + } + + if (event.key === 'ArrowDown' && next) { + emit(next, new MouseEvent('click')); + } + }, + lightbox = create(lightboxContent, { + className: entry.type, + onShow: (): boolean => { + this.removeClass('loading'); + + on(document, 'keydown', keyListener); + + if (onShow) { + onShow(lightbox); + } + + this.#state.showPath(entry.fullPath); + + this.#state.on('updated', close); + + return true; + }, + onClose: (): boolean => { + off(document, 'keydown', keyListener); + this.#state.off('updated', close); + + this.#state.showPath(entry.path); + + this.removeClass('open'); + + return true; + }, + }); + + lightbox.show(); + }; + + if (['video', 'audio', 'image', 'font', 'pdf'].includes(entry.type)) { + launchLightbox(this.#templates[entry.type](entry)); + + this.removeClass('loading'); + + return; + } + + if (entry.type !== 'text') { + this.removeClass('open', 'loading'); + + this.download(); + + return; + } + + const content = await this.#dav.get(entry.fullPath); + + if (!content) { + this.removeClass('open', 'loading'); + + return; + } + + launchLightbox( + this.#templates.text(entry, content), + (lightbox: BasicLightBox): void => + Prism.highlightAllUnder(lightbox.element()) + ); + + this.removeClass('loading'); + } + + async rename(): Promise { + const entry = this.#entry; + + if (!entry.rename) { + throw new TypeError(`'${entry.name}' cannot be renamed.`); + } + + const node = this.element(), + title = this.query('.title'), + input = this.query('input'), + setInputSize = (): void => { + title.innerText = input.value; + input.style.setProperty('width', `${title.scrollWidth}px`); + }, + save = async (): Promise => { + // don't process if there's no name change + if (input.value !== entry.title) { + this.addClass('loading'); + + unbindListeners(); + + const destinationPath = joinPath(entry.path, input.value), + result = await this.#dav.move( + entry.fullPath, + destinationPath, + entry + ); + + if (!result) { + return; + } + + success( + t('successfullyRenamed', { + interpolation: { + escapeValue: false, + }, + from: entry.title, + to: input.value, + }) + ); + + entry.name = input.value; + } + + revert(); + }, + unbindListeners = (): void => { + off(input, 'blur', blurListener); + off(input, 'keydown', keyDownListener); + off(input, 'input', inputListener); + }, + revert = (): void => { + removeClass(title, 'invisible'); + addClass(input, 'hidden'); + input.value = entry.title; + setInputSize(); + unbindListeners(); + + node.focus(); + }, + blurListener = async (): Promise => { + await save(); + }, + keyDownListener = async (event: KeyboardEvent): Promise => { + event.stopPropagation(); + + if (event.key === 'Enter') { + event.preventDefault(); + + await save(); + } + + if (event.key === 'Escape') { + revert(); + } + }, + inputListener = (): void => { + return setInputSize(); + }; + + addClass(title, 'invisible'); + removeClass(input, 'hidden'); + + input.value = entry.title; + + setInputSize(); + input.removeAttribute('readonly'); + on(input, 'blur', blurListener); + on(input, 'keydown', keyDownListener); + on(input, 'input', inputListener); + input.focus(); + } + + update(): void { + const newItem = new Item(this.#entry, this.#dav, this.#state); + + this.element().replaceWith(newItem.element()); + } +} diff --git a/src/components/List.ts b/src/components/List.ts new file mode 100644 index 0000000..3c7a388 --- /dev/null +++ b/src/components/List.ts @@ -0,0 +1,107 @@ +import Element, { emit, on, s } from '@dom111/element'; +import Collection from '../lib/Collection'; +import DAV from '../lib/DAV'; +import Entry from '../lib/Entry'; +import Item from './Item'; +import State from '../lib/State'; +import previewItems from '../lib/previewItems'; +import supportsFocusWithin from '../lib/supportsFocusWithin'; + +export class List extends Element { + #dav: DAV; + #state: State; + + constructor(dav: DAV, state: State) { + super(s('
      ')); + + this.#dav = dav; + this.#state = state; + + this.load(); + + this.bindEvents(); + } + + private bindEvents(): void { + this.#state.on('updated', (bypassCache: boolean): void => { + if (this.#state.isDirectory()) { + this.load(bypassCache); + + return; + } + + const item = this.query( + `[data-full-path="${this.#state.getPath()}"]` + ); + + if (!item) { + return; + } + + emit(item, new MouseEvent('click')); + }); + + this.#state.on('collection-updated', (): void => this.render()); + + const arrowHandler = (event: KeyboardEvent): void => { + if (!['ArrowUp', 'ArrowDown'].includes(event.key)) { + return; + } + + event.preventDefault(); + event.stopPropagation(); + + const current = this.query( + `li:focus${supportsFocusWithin ? ', li:focus-within' : ''}` + ) as HTMLElement, + [previous, next] = current + ? previewItems(current) + : [ + this.element().firstElementChild as HTMLElement, + this.element().firstElementChild as HTMLElement, + ]; + + if (event.key === 'ArrowUp' && previous) { + previous.focus(); + } + + if (event.key === 'ArrowDown' && next) { + next.focus(); + } + }; + + on(document, 'keydown', arrowHandler); + } + + async load(bypassCache: boolean = false): Promise { + const collection = await this.#dav.list(this.#state.getPath(), bypassCache); + + if (!collection) { + return; + } + + this.update(collection); + } + + private render(): void { + this.addClass('loading'); + + this.empty(); + + this.#state + .getCollection() + .forEach((entry: Entry): void => + this.append(new Item(entry, this.#dav, this.#state)) + ); + + this.removeClass('loading'); + } + + update(collection: Collection): void { + this.#state.setCollection(collection); + + this.render(); + } +} + +export default List; diff --git a/src/components/UI.ts b/src/components/UI.ts new file mode 100644 index 0000000..d959478 --- /dev/null +++ b/src/components/UI.ts @@ -0,0 +1,45 @@ +import supportsEvent, { supportsEvents } from '../lib/supportsEvent'; +import AbstractUI from '../lib/AbstractUI'; +import handleFileUpload from '../lib/handleFileUpload'; + +export class UI extends AbstractUI { + protected bindEvents(): void { + const isTouch = supportsEvent('touchstart'), + supportsDragDrop = supportsEvents('dragstart', 'drop'); + + // DOM events + if (isTouch) { + this.addClass('is-touch'); + } + + if (!supportsDragDrop) { + this.addClass('no-drag-drop'); + } + + if (supportsDragDrop) { + this.onEach(['dragenter', 'dragover'], (event: DragEvent): void => { + event.preventDefault(); + event.stopPropagation(); + + this.addClass('active'); + }); + + this.onEach(['dragleave', 'drop'], (event: DragEvent): void => { + event.preventDefault(); + event.stopPropagation(); + + this.removeClass('active'); + }); + + this.on('drop', async (event: DragEvent): Promise => { + const { files } = event.dataTransfer; + + for (const file of files) { + await handleFileUpload(this.dav(), this.state(), file); + } + }); + } + } +} + +export default UI; diff --git a/src/lib/AbstractUI.ts b/src/lib/AbstractUI.ts new file mode 100644 index 0000000..fc9af9e --- /dev/null +++ b/src/lib/AbstractUI.ts @@ -0,0 +1,29 @@ +import DAV from './DAV'; +import Element from '@dom111/element'; +import State from './State'; + +export abstract class AbstractUI extends Element { + #dav: DAV; + #state: State; + + constructor(container: HTMLElement, dav: DAV, state: State) { + super(container); + + this.#dav = dav; + this.#state = state; + + this.bindEvents(); + } + + protected abstract bindEvents(): void; + + dav(): DAV { + return this.#dav; + } + + state(): State { + return this.#state; + } +} + +export default AbstractUI; diff --git a/src/lib/Collection.ts b/src/lib/Collection.ts new file mode 100644 index 0000000..687b587 --- /dev/null +++ b/src/lib/Collection.ts @@ -0,0 +1,87 @@ +import Entry from './Entry'; +import { EntryObject } from './Response'; +import EventEmitter from '@dom111/typed-event-emitter/EventEmitter'; +import joinPath from './joinPath'; + +type CollectionEvents = { + updated: []; +}; + +type EntryIterator = (entry: Entry, index: number) => T; + +export default class Collection extends EventEmitter { + #path: string; + #entries: Entry[]; + #sortDirectoriesFirst: boolean; + + // don't need to handle equal paths as that's invalid + #sort = (): void => { + this.#entries.sort( + (a, b) => + (this.#sortDirectoriesFirst && this.#sortDirectories(a, b)) || + this.#sortAlphabetically(a, b) + ); + }; + #sortAlphabetically = (a: Entry, b: Entry): number => + a.fullPath < b.fullPath ? -1 : 1; + #sortDirectories = (a: Entry, b: Entry): number => + (b.directory ? 1 : 0) - (a.directory ? 1 : 0); + + constructor(items: EntryObject[], { sortDirectoriesFirst = false } = {}) { + super(); + + this.#sortDirectoriesFirst = sortDirectoriesFirst; + + this.#entries = items.map( + (item: EntryObject): Entry => + new Entry({ + ...item, + collection: this, + }) + ); + + // the first entry is a stub for the directory itself, we can remove that for the root path... + const parent = this.#entries.shift(); + + this.#path = joinPath(parent.fullPath); + + if (parent.fullPath !== '/') { + // ...but change the details for all others. + this.#entries.unshift(parent.createParentEntry()); + } + + this.#sort(); + } + + add(entry: Entry): void { + entry.collection = this; + + this.#entries.push(entry); + + this.#sort(); + + this.emit('updated'); + } + + filter(iterator: EntryIterator): Entry[] { + return this.#entries.filter(iterator); + } + + forEach(iterator: EntryIterator): void { + this.#entries.forEach(iterator); + } + + map(iterator: EntryIterator): any[] { + return this.#entries.map(iterator); + } + + path(): string { + return this.#path; + } + + remove(entry: Entry): void { + this.#entries = this.#entries.filter((item): boolean => item !== entry); + + this.emit('updated'); + } +} diff --git a/src/lib/DAV.ts b/src/lib/DAV.ts index 22f2865..f143367 100644 --- a/src/lib/DAV.ts +++ b/src/lib/DAV.ts @@ -1,26 +1,104 @@ -import EventObject from './EventObject'; +import Collection from './Collection'; +import DAVResponse from './Response'; +import Entry from './Entry'; import HTTP from './HTTP'; -import Response from './DAV/Response'; +import RequestFailure from './HTTP/RequestFailure'; +import { error } from 'melba-toast'; import joinPath from './joinPath'; +import { t } from 'i18next'; import trailingSlash from './trailingSlash'; -import Entry from './DAV/Entry'; type ConstructorOptions = { bypassCheck?: boolean; sortDirectoriesFirst?: boolean; }; -export default class DAV extends EventObject { - #bypassCheck; - #cache; - #http; - #sortDirectoriesFirst; +type CachedRequests = { + GET: string; + PROPFIND: Collection; +}; + +export type RequestCache< + K extends keyof CachedRequests = keyof CachedRequests, + T extends CachedRequests[K] = CachedRequests[K] +> = Map>; + +const emptyCache = (): RequestCache => { + const cache = new Map< + keyof CachedRequests, + Map + >(); + + cache.set('GET', new Map()); + cache.set('PROPFIND', new Map()); + + return cache; +}; - #validDestination = (destination) => { +export default class DAV { + #bypassCheck: boolean; + #cache: RequestCache; + #http: HTTP; + #sortDirectoriesFirst: boolean; + + #getCache = ( + type: K, + uri: string + ): CachedRequests[K] | null => { + const lookup = this.#cache.get(type); + + if (!lookup.has(uri)) { + return null; + } + + return lookup.get(uri) as CachedRequests[K]; + }; + #hasCache = ( + type: K, + uri: string + ): boolean => { + const lookup = this.#cache.get(type); + + return lookup.has(uri); + }; + #setCache = ( + type: K, + uri: string, + value: CachedRequests[K] + ): void | null => { + const lookup = this.#cache.get(type); + + lookup.set(uri, value); + }; + #toastOnFailure = async ( + func: () => Promise + ): Promise => { + try { + return await func(); + } catch (e) { + if (!(e instanceof RequestFailure)) { + throw e; + } + + error( + t('failure', { + interpolation: { + escapeValue: false, + }, + method: e.method(), + url: e.url(), + statusText: e.statusText(), + status: e.status(), + }) + ); + } + }; + #validDestination = (destination: string): string => { const hostname = `${location.protocol}//${location.hostname}${ location.port ? `:${location.port}` : '' }`, hostnameRegExp = new RegExp(`^${hostname}`); + if (!destination.match(hostnameRegExp)) { if (destination.match(/^http/)) { throw new TypeError(`Invalid destination host: '${destination}'.`); @@ -32,97 +110,69 @@ export default class DAV extends EventObject { return destination; }; - #dispatchWithEvents = (func, eventName, ...params) => { - this.trigger(`${eventName}:request`, ...params); - - return func() - .then((response) => { - if (!response) { - this.trigger(`${eventName}:failed`, ...params); - - return response; - } - - this.trigger(`${eventName}:success`, ...params); - - return response; - }) - .catch(() => { - this.trigger(`${eventName}:failed`, ...params); - }); - }; - constructor( { bypassCheck, sortDirectoriesFirst }: ConstructorOptions, - cache = new Map(), + cache: RequestCache = emptyCache(), http = new HTTP() ) { - super(); - this.#bypassCheck = bypassCheck; this.#sortDirectoriesFirst = sortDirectoriesFirst; this.#cache = cache; this.#http = http; - - this.bindEvents(); - } - - bindEvents() { - this.on('cache:invalidate', (path) => { - if (this.#cache.has(path)) { - this.#cache.delete(path); - } - }); } - async check(uri) { + async check(uri): Promise<{ + ok: boolean; + status: number; + }> { if (this.#bypassCheck) { - return { + return Promise.resolve({ ok: true, status: 200, - }; + }); } - return this.#http.HEAD(uri); + return this.#toastOnFailure((): Promise => this.#http.HEAD(uri)); } - async copy(from, to, entry = null) { - return this.#dispatchWithEvents( - () => + async copy(from, to): Promise { + return this.#toastOnFailure( + (): Promise => this.#http.COPY(from, { headers: { Destination: this.#validDestination(to), }, - }), - 'copy', - from, - to, - entry + }) ); } - async del(uri, entry = null) { - return this.#dispatchWithEvents( - () => this.#http.DELETE(uri), - 'delete', - uri, - entry + async del(uri): Promise { + return this.#toastOnFailure( + (): Promise => this.#http.DELETE(uri) ); } - async get(uri) { - return this.#dispatchWithEvents(() => this.#http.GET(uri), 'get', uri); + async get(uri): Promise { + if (!this.#hasCache('GET', uri)) { + const response = await this.#toastOnFailure( + (): Promise => this.#http.GET(uri) + ); + + if (!response || !response.ok) { + return; + } + + this.#setCache('GET', uri, await response.text()); + } + + return this.#getCache('GET', uri); } - async list(uri, bypassCache = false) { + async list(uri, bypassCache = false): Promise { uri = trailingSlash(uri); - if (!bypassCache) { - const cached = await this.#cache.get(uri); - - if (cached) { - return cached; - } + if (!bypassCache && this.#hasCache('PROPFIND', uri)) { + return this.#getCache('PROPFIND', uri); } const check = await this.check(uri); @@ -131,59 +181,51 @@ export default class DAV extends EventObject { return; } - const data = await this.#http.PROPFIND(uri), - response = new Response(await data.text()), + const data = await this.#toastOnFailure( + (): Promise => this.#http.PROPFIND(uri) + ), + response = new DAVResponse(await data.text()), collection = response.collection({ sortDirectoriesFirst: this.#sortDirectoriesFirst, }); - this.#cache.set(uri, collection); + + this.#setCache('PROPFIND', uri, collection); return collection; } - async mkcol(fullPath, directoryName = '', path = '') { - return this.#dispatchWithEvents( - () => this.#http.MKCOL(fullPath), - 'mkcol', - fullPath, - directoryName, - path + async mkcol(fullPath) { + return this.#toastOnFailure( + (): Promise => this.#http.MKCOL(fullPath) ); } - async move(from: string, to: string, entry: Entry) { + async move(from: string, to: string, entry: Entry): Promise { const destination = this.#validDestination(to); - return this.#dispatchWithEvents( - () => + return this.#toastOnFailure( + (): Promise => this.#http.MOVE(from, { headers: { Destination: entry.directory ? trailingSlash(destination) : destination, }, - }), - 'move', - from, - to, - entry + }) ); } - async upload(path, file) { + async upload(path, file): Promise { const targetFile = joinPath(path, file.name); - return this.#dispatchWithEvents( - () => + return this.#toastOnFailure( + (): Promise => this.#http.PUT(targetFile, { headers: { 'Content-Type': file.type, }, body: file, - }), - 'upload', - path, - file + }) ); } } diff --git a/src/lib/DAV/Collection.ts b/src/lib/DAV/Collection.ts deleted file mode 100644 index 04f416f..0000000 --- a/src/lib/DAV/Collection.ts +++ /dev/null @@ -1,160 +0,0 @@ -import Entry from './Entry'; -import EventObject from '../EventObject'; -import joinPath from '../joinPath'; -import trailingSlash from '../trailingSlash'; - -export default class Collection extends EventObject { - #path; - #entries; - #sortDirectoriesFirst; - - // don't need to handle equal paths as that's invalid - #sort = () => - this.#entries.sort( - (a, b) => - (this.#sortDirectoriesFirst && this.#sortDirectories(a, b)) || - this.#sortAlphabetically(a, b) - ); - #sortAlphabetically = (a, b) => (a.fullPath < b.fullPath ? -1 : 1); - #sortDirectories = (a, b) => b.directory - a.directory; - - constructor(items, { sortDirectoriesFirst = false } = {}) { - super(); - - this.#sortDirectoriesFirst = sortDirectoriesFirst; - - this.#entries = items.map( - (item) => - new Entry({ - ...item, - collection: this, - }) - ); - - // the first entry is a stub for the directory itself, we can remove that for the root path... - const parent = this.#entries.shift(); - - this.#path = joinPath(parent.fullPath); - - if (parent.fullPath !== '/') { - // ...but change the details for all others. - this.#entries.unshift(parent.createParentEntry()); - } - - this.#sort(); - - this.bindEvents(); - } - - bindEvents() { - this.on('upload:request', (path, file) => { - if (joinPath(path) === this.#path) { - this.add( - new Entry({ - fullPath: joinPath(path, file.name), - modified: file.lastModifiedDate, - size: file.size, - mimeType: file.type, - placeholder: true, - }) - ); - } - }); - - this.on('upload:success', (path, completedFile) => { - const [completedEntry] = this.filter( - (entry) => entry.fullPath === joinPath(path, completedFile.name) - ); - - if (completedEntry) { - completedEntry.placeholder = false; - } - }); - - this.on('upload:failed', (path, failedFile) => { - const [failedEntry] = this.filter( - (entry) => entry.fullPath === joinPath(path, failedFile.name) - ); - - if (failedEntry) { - this.remove(failedEntry); - } - }); - - this.on('delete:success', (path) => { - const [deletedFile] = this.filter((entry) => entry.fullPath === path); - - if (deletedFile) { - this.remove(deletedFile); - } - }); - - this.on('move:success', (sourceFullPath, destinationFullPath) => { - const [entry] = this.filter((entry) => entry.fullPath === sourceFullPath); - - if (!entry) { - return; - } - - const newEntry = new Entry({ - directory: entry.directory, - fullPath: trailingSlash(destinationFullPath), - modified: entry.modified, - size: entry.size, - mimeType: entry.mimeType, - del: entry.del, - }); - - this.remove(entry); - - if (entry.path === newEntry.path) { - return this.add(newEntry); - } - - this.trigger('cache:invalidate', newEntry.path); - }); - - this.on('mkcol:success', (destination, directoryName, path) => { - if (joinPath(path) === this.#path) { - this.add( - new Entry({ - directory: true, - fullPath: destination, - modified: new Date(), - }) - ); - } - }); - } - - add(entry) { - entry.collection = this; - this.#entries.push(entry); - - this.#sort(); - - this.trigger('collection:update', this); - - return this; - } - - remove(entry) { - this.#entries = this.#entries.filter((item) => item !== entry); - - this.trigger('collection:update', this); - - return this; - } - - map(iterator) { - return this.#entries.map(iterator); - } - - filter(iterator) { - return this.#entries.filter(iterator); - } - - get path() { - return this.#path; - } -} diff --git a/src/lib/DAV/Response.ts b/src/lib/DAV/Response.ts deleted file mode 100644 index 3efb7c5..0000000 --- a/src/lib/DAV/Response.ts +++ /dev/null @@ -1,52 +0,0 @@ -import Collection from './Collection'; - -export default class Response { - #collection; - #document; - #parser; - - #getTag = (doc: Element, tag: string) => doc.getElementsByTagName(tag)[0]; - - #getTagContent = (doc: Element, tag) => { - const node = this.#getTag(doc, tag); - - return node ? node.textContent : ''; - }; - - constructor(rawDocument: string, parser: DOMParser = new DOMParser()) { - this.#parser = parser; - this.#document = parser.parseFromString(rawDocument, 'application/xml'); - } - - collection({ sortDirectoriesFirst = false } = {}) { - if (!this.#collection) { - this.#collection = new Collection( - this.responseToPrimitives( - this.#document.getElementsByTagName('D:response') - ), - { - sortDirectoriesFirst, - } - ); - } - - return this.#collection; - } - - responseToPrimitives(responses: HTMLCollection) { - return Array.from(responses).map((response) => ({ - directory: !!this.#getTag(response, 'D:collection'), - fullPath: this.#getTagContent(response, 'D:href'), - modified: Date.parse( - this.#getTagContent(response, 'lp1:getlastmodified') || - this.#getTagContent(response, 'D:getlastmodified') - ), - size: parseInt( - this.#getTagContent(response, 'lp1:getcontentlength') || - this.#getTagContent(response, 'D:getcontentlength'), - 10 - ), - mimeType: this.#getTagContent(response, 'D:getcontenttype'), - })); - } -} diff --git a/src/lib/DAV/Entry.ts b/src/lib/Entry.ts similarity index 80% rename from src/lib/DAV/Entry.ts rename to src/lib/Entry.ts index b475c55..6376792 100644 --- a/src/lib/DAV/Entry.ts +++ b/src/lib/Entry.ts @@ -1,12 +1,13 @@ import Collection from './Collection'; -import EventObject from '../EventObject'; -import joinPath from '../joinPath'; +import EventEmitter from '@dom111/typed-event-emitter/EventEmitter'; +import joinPath from './joinPath'; +import trailingSlash from './trailingSlash'; type EntryArgs = { directory?: boolean; fullPath?: string; title?: string; - modified?: Date; + modified?: number; size?: number; mimeType?: string; del?: boolean; @@ -15,7 +16,11 @@ type EntryArgs = { collection?: Collection | null; }; -export default class Entry extends EventObject { +type EntryEvents = { + updated: []; +}; + +export default class Entry extends EventEmitter { #del: boolean; #directory: boolean; #displaySize: string; @@ -49,12 +54,15 @@ export default class Entry extends EventObject { const [path, name] = this.getFilename(fullPath); + const modifiedDate = new Date(); + modifiedDate.setTime(modified); + this.#path = path; this.#name = name; this.#directory = directory; this.#fullPath = fullPath; this.#title = title; - this.#modified = modified; + this.#modified = modifiedDate; this.#size = size; this.#mimeType = mimeType; this.#del = del; @@ -65,7 +73,7 @@ export default class Entry extends EventObject { createParentEntry(): Entry { return this.update({ - fullPath: this.path, + fullPath: trailingSlash(this.path), title: '←', del: false, rename: false, @@ -80,11 +88,11 @@ export default class Entry extends EventObject { } update(properties: EntryArgs = {}): Entry { - return new Entry({ + const newEntry = new Entry({ ...{ directory: this.directory, fullPath: this.fullPath, - modified: this.modified, + modified: this.modified.getTime(), size: this.size, mimeType: this.mimeType, del: this.del, @@ -93,6 +101,10 @@ export default class Entry extends EventObject { }, ...properties, }); + + this.emit('replaced', newEntry); + + return newEntry; } get del(): boolean { @@ -104,7 +116,7 @@ export default class Entry extends EventObject { } get displaySize(): string { - if (this.directory) { + if (this.#directory) { return ''; } @@ -156,6 +168,23 @@ export default class Entry extends EventObject { return this.#name; } + set name(name: string) { + this.#name = encodeURIComponent(name); + this.#title = null; + this.#type = null; + this.#fullPath = joinPath(this.#path, this.#name); + + if (this.directory) { + this.#fullPath = trailingSlash(this.#fullPath); + } + + // regenerate these: + this.title; + this.type; + + this.emit('updated'); + } + get path(): string { return this.#path; } @@ -166,8 +195,6 @@ export default class Entry extends EventObject { set placeholder(value: boolean) { this.#placeholder = value; - - this.trigger('entry:update', this); } get rename(): boolean { @@ -198,7 +225,7 @@ export default class Entry extends EventObject { }; for (const [key, value] of Object.entries(types)) { - if (this.name.match(value)) { + if (this.#name.match(value)) { return (this.#type = key); } } diff --git a/src/lib/EventObject.ts b/src/lib/EventObject.ts deleted file mode 100644 index 4507c6d..0000000 --- a/src/lib/EventObject.ts +++ /dev/null @@ -1,45 +0,0 @@ -const events = {}; - -export default class EventObject { - hasEvent(event) { - return event in events; - } - - on(event, listener) { - if (!this.hasEvent(event)) { - events[event] = []; - } - - events[event].push(listener); - } - - off(event, listener = null) { - if (!this.hasEvent(event)) { - return; - } - - if (listener === null) { - return (events[event] = []); - } - - events[event] = events[event].filter( - (eventListener) => eventListener !== listener - ); - } - - trigger(event, ...data) { - if (this.hasEvent(event)) { - let stopped = false; - - events[event].forEach((listener) => { - if (stopped) { - return; - } - - if (listener(...data) === false) { - stopped = true; - } - }); - } - } -} diff --git a/src/lib/HTTP.ts b/src/lib/HTTP.ts index 150951e..68ef685 100644 --- a/src/lib/HTTP.ts +++ b/src/lib/HTTP.ts @@ -1,67 +1,88 @@ -import EventObject from './EventObject'; +import RequestFailure from './HTTP/RequestFailure'; -const defaultParams = { +type HTTPMethods = + | 'CONNECT' + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT' + | 'TRACE'; +type WebDAVMethods = + | HTTPMethods + | 'COPY' + | 'LOCK' + | 'MKCOL' + | 'MOVE' + | 'PROPFIND' + | 'PROPPATCH' + | 'UNLOCK'; +type MethodParams = { + [K in WebDAVMethods]?: RequestInit; +}; + +const defaultParams: MethodParams = { PROPFIND: { headers: { - Depth: 1, + Depth: '1', }, }, }; -const method = ( +const method = async ( method: string, url: RequestInfo, - parameters: RequestInit, - object: HTTP -) => - fetch(url, { - ...(defaultParams[method] || null), + parameters: RequestInit +): Promise => { + const request = new Request(url, { + ...(defaultParams[method] || {}), ...parameters, method, - }).then((response) => { - if (!response.ok) { - object.trigger('error', { - method, - url, - response, - }); + }); - return; - } + const response = await fetch(request); - return response; - }); + if (!response.ok) { + throw new RequestFailure(request, response); + } + + return response; +}; -export default class HTTP extends EventObject { - GET(url: string, parameters: RequestInit = {}) { - return method('GET', url, parameters, this); +export class HTTP { + GET(url: string, parameters: RequestInit = {}): Promise { + return method('GET', url, parameters); } - HEAD(url: string, parameters: RequestInit = {}) { - return method('HEAD', url, parameters, this); + HEAD(url: string, parameters: RequestInit = {}): Promise { + return method('HEAD', url, parameters); } - PUT(url: string, parameters: RequestInit = {}) { - return method('PUT', url, parameters, this); + PUT(url: string, parameters: RequestInit = {}): Promise { + return method('PUT', url, parameters); } - PROPFIND(url: string, parameters: RequestInit = {}) { - return method('PROPFIND', url, parameters, this); + PROPFIND(url: string, parameters: RequestInit = {}): Promise { + return method('PROPFIND', url, parameters); } - DELETE(url: string, parameters: RequestInit = {}) { - return method('DELETE', url, parameters, this); + DELETE(url: string, parameters: RequestInit = {}): Promise { + return method('DELETE', url, parameters); } - MKCOL(url: string, parameters: RequestInit = {}) { - return method('MKCOL', url, parameters, this); + MKCOL(url: string, parameters: RequestInit = {}): Promise { + return method('MKCOL', url, parameters); } - COPY(url: string, parameters: RequestInit = {}) { - return method('COPY', url, parameters, this); + COPY(url: string, parameters: RequestInit = {}): Promise { + return method('COPY', url, parameters); } - MOVE(url: string, parameters: RequestInit = {}) { - return method('MOVE', url, parameters, this); + MOVE(url: string, parameters: RequestInit = {}): Promise { + return method('MOVE', url, parameters); } } + +export default HTTP; diff --git a/src/lib/HTTP/RequestFailure.ts b/src/lib/HTTP/RequestFailure.ts new file mode 100644 index 0000000..53a17b0 --- /dev/null +++ b/src/lib/HTTP/RequestFailure.ts @@ -0,0 +1,37 @@ +export class RequestFailure extends Error { + #request: Request; + #response: Response; + + constructor(request: Request, response: Response) { + super('Request failure'); + + this.#request = request; + this.#response = response; + } + + request(): Request { + return this.#request; + } + + response(): Response { + return this.#response; + } + + method(): string { + return this.#request.method; + } + + url(): string { + return this.#request.url; + } + + statusText(): string { + return this.#response.statusText; + } + + status(): number { + return this.#response.status; + } +} + +export default RequestFailure; diff --git a/src/lib/Response.ts b/src/lib/Response.ts new file mode 100644 index 0000000..a47da4b --- /dev/null +++ b/src/lib/Response.ts @@ -0,0 +1,64 @@ +import Collection from './Collection'; + +export type EntryObject = { + directory: boolean; + fullPath: string; + modified: number; + size?: number; + mimeType?: string; +}; + +const getTag = (doc: Element, tag: string): Element => + doc.getElementsByTagName(tag)[0], + getTagContent = (doc: Element, tag: string): string => { + const node = getTag(doc, tag); + + return node ? node.textContent : ''; + }; + +export class Response { + #collection: Collection; + #document: Document; + #parser: DOMParser; + + constructor(rawDocument: string, parser: DOMParser = new DOMParser()) { + this.#parser = parser; + this.#document = parser.parseFromString(rawDocument, 'application/xml'); + } + + collection({ sortDirectoriesFirst = false } = {}): Collection { + if (!this.#collection) { + this.#collection = new Collection( + this.responseToPrimitives( + this.#document.getElementsByTagName('D:response') + ), + { + sortDirectoriesFirst, + } + ); + } + + return this.#collection; + } + + responseToPrimitives(responses: HTMLCollection): EntryObject[] { + return Array.from(responses).map( + (response): EntryObject => ({ + directory: !!getTag(response, 'D:collection'), + fullPath: getTagContent(response, 'D:href'), + modified: Date.parse( + getTagContent(response, 'lp1:getlastmodified') || + getTagContent(response, 'D:getlastmodified') + ), + size: parseInt( + getTagContent(response, 'lp1:getcontentlength') || + getTagContent(response, 'D:getcontentlength'), + 10 + ), + mimeType: getTagContent(response, 'D:getcontenttype'), + }) + ); + } +} + +export default Response; diff --git a/src/lib/State.ts b/src/lib/State.ts new file mode 100644 index 0000000..d4612cf --- /dev/null +++ b/src/lib/State.ts @@ -0,0 +1,94 @@ +import Collection from './Collection'; +import EventEmitter from '@dom111/typed-event-emitter/EventEmitter'; +import { t } from 'i18next'; +import { on } from '@dom111/element'; + +export class State extends EventEmitter<{ + 'collection-updated': []; + updated: [boolean?]; +}> { + #collection: Collection; + #location: Location; + #history: History; + #document: Document; + #window: Window; + + #collectionUpdatedListener = (): void => this.emit('collection-updated'); + + constructor(document: Document, window: Window) { + super(); + + this.#document = document; + this.#window = window; + this.#location = window.location; + this.#history = window.history; + + this.bindEvents(); + this.setTitle(this.getPath()); + } + + private bindEvents(): void { + on(window, 'popstate', () => this.update()); + } + + getCollection(): Collection { + return this.#collection; + } + + getPath(): string { + return this.#location.pathname; + } + + getTitleForPath(path: string): string { + return t('title', { + interpolation: { + escapeValue: false, + }, + path: decodeURIComponent(path), + }); + } + + isDirectory(): boolean { + return this.getPath().endsWith('/'); + } + + setCollection(collection: Collection): void { + if (this.#collection) { + this.#collection.off('updated', this.#collectionUpdatedListener); + } + + this.#collection = collection; + + collection.on('updated', this.#collectionUpdatedListener); + } + + setPath(path: string): void { + if (this.#location.pathname !== path) { + this.showPath(path); + + this.emit('updated'); + } + } + + private setTitle(path: string): void { + const title = this.getTitleForPath(path); + + if (this.#document.title !== title) { + this.#document.title = title; + } + } + + showPath(path: string): void { + if (this.#location.pathname !== path) { + this.#history.pushState({ path }, this.getTitleForPath(path), path); + + this.setTitle(path); + } + } + + update(bypassCache: boolean = false): void { + this.emit('updated', bypassCache); + } +} + +export default State; diff --git a/src/lib/UI/NativeDOM.ts b/src/lib/UI/NativeDOM.ts deleted file mode 100644 index dc87a60..0000000 --- a/src/lib/UI/NativeDOM.ts +++ /dev/null @@ -1,318 +0,0 @@ -import Container from './NativeDOM/Container'; -import Footer from './NativeDOM/Footer'; -import Melba from 'melba-toast'; -import UI from './UI'; -import i18next from 'i18next'; -import trailingSlash from '../trailingSlash'; - -export default class NativeDOM extends UI { - render(container = new Container(), footer = new Footer()) { - this.container.appendChild(container.element); - this.container.appendChild(footer.element); - - this.bindEvents(); - - this.trigger('go'); - } - - bindEvents(element = this.container) { - const supportsEvent = (eventName) => { - const element = document.createElement('span'); - - element.setAttribute(`on${eventName}`, ''); - - return typeof element[`on${eventName}`] === 'function'; - }, - isTouch = supportsEvent('touchstart'), - supportsDragDrop = supportsEvent('dragstart') && supportsEvent('drop'), - updateTitle = (title) => { - if (document.title !== title) { - document.title = title; - } - }, - updatePath = (path) => { - if (location.pathname !== path) { - history.pushState(history.state, path, path); - } - }; - - // DOM events - if (isTouch) { - this.container.classList.add('is-touch'); - } - - if (!supportsDragDrop) { - this.container.classList.add('no-drag-drop'); - } - - window.addEventListener('popstate', () => { - const url = location.pathname; - - element.dispatchEvent( - new CustomEvent('preview:close', { - bubbles: true, - detail: { - preview: true, - }, - }) - ); - - if (url.endsWith('/')) { - return this.trigger('go'); - } - - const path = url.replace(/[^/]+$/, ''); - - this.trigger('go', path, { - bypassPushState: true, - success: () => - this.container - .querySelector(`main ul li[data-full-path="${url}"]`) - ?.dispatchEvent(new CustomEvent('click')), - }); - - // trigger opening file - }); - - if (supportsDragDrop) { - ['dragenter', 'dragover'].forEach((eventName) => { - element.addEventListener(eventName, (event) => { - event.preventDefault(); - event.stopPropagation(); - - element.classList.add('active'); - }); - }); - - ['dragleave', 'drop'].forEach((eventName) => { - element.addEventListener(eventName, (event) => { - event.preventDefault(); - event.stopPropagation(); - - element.classList.remove('active'); - }); - }); - - element.addEventListener('drop', async (event) => { - const { files } = event.dataTransfer; - - for (const file of files) { - this.trigger('upload', location.pathname, file); - } - }); - } - - // global listeners - this.on('error', ({ method, url, response }) => { - new Melba({ - content: i18next.t('failure', { - interpolation: { - escapeValue: false, - }, - method, - url, - statusText: response.statusText, - status: response.status, - }), - type: 'error', - }); - }); - - // local events - this.on('upload', async (path, file) => { - const collection = await this.dav.list(path), - [existingFile] = collection.filter((entry) => entry.name === file.name); - - if (existingFile) { - // TODO: nicer notification - // TODO: i18m - if ( - !confirm( - i18next.t('overwriteFileConfirmation', { - file: existingFile.title, - }) - ) - ) { - return false; - } - } - - await this.dav.upload(path, file); - }); - - this.on('upload:success', async (path, file) => { - new Melba({ - content: i18next.t('successfullyUploaded', { - interpolation: { - escapeValue: false, - }, - file: file.name, - }), - type: 'success', - hide: 5, - }); - }); - - this.on('move', async (source, destination, entry) => { - await this.dav.move(source, destination, entry); - }); - - this.on('move:success', (source, destination, entry) => { - const [, destinationUrl, destinationFile] = - destination.match(/^(.*)\/([^/]+\/?)$/), - destinationPath = - destinationUrl && - destinationUrl.replace( - `${location.protocol}//${location.hostname}${ - location.port ? `:${location.port}` : '' - }`, - '' - ); - - if (entry.path === destinationPath || entry.directory) { - return new Melba({ - content: i18next.t('successfullyRenamed', { - interpolation: { - escapeValue: false, - }, - from: entry.title, - to: decodeURIComponent(destinationFile), - }), - type: 'success', - hide: 5, - }); - } - - new Melba({ - content: i18next.t('successfullyMoved', { - interpolation: { - escapeValue: false, - }, - from: entry.title, - to: decodeURIComponent(destinationPath), - }), - type: 'success', - hide: 5, - }); - }); - - this.on('delete', async (path, entry) => { - await this.dav.del(path, entry); - }); - - this.on('delete:success', (path, entry) => { - new Melba({ - content: i18next.t('successfullyDeleted', { - interpolation: { - escapeValue: false, - }, - file: entry.title, - }), - type: 'success', - hide: 5, - }); - }); - - this.on('get', async (file, callback) => { - const response = await this.dav.get(file); - - callback(response && (await response.text())); - }); - - this.on('check', async (uri, callback, failure) => { - const response = await this.dav.check(uri); - - if (response && response.ok && callback) { - callback(response); - - return; - } - - if (failure) { - failure(); - } - }); - - this.on('create-directory', async (fullPath, directoryName, path) => { - await this.dav.mkcol(fullPath, directoryName, path); - }); - - this.on('mkcol:success', (fullPath, directoryName) => { - new Melba({ - content: i18next.t('successfullyCreated', { - interpolation: { - escapeValue: false, - }, - directoryName, - }), - type: 'success', - hide: 5, - }); - }); - - this.on( - 'go', - async ( - path = location.pathname, - { - bypassCache = false, - bypassPushState = false, - failure = null, - success = null, - } = {} - ) => { - const prevPath = location.pathname; - - this.trigger('list:update:request', path); - - // TODO: store the collection to allow manipulation - const collection = await this.dav.list(path, bypassCache); - - if (!collection) { - this.trigger('list:update:failed'); - - if (failure) { - failure(); - } - - return; - } - - this.trigger('list:update:success', collection); - - if (!bypassPushState) { - updatePath(path); - } - - updateTitle(`${decodeURIComponent(path)} | WebDAV`); - - if (success) { - success(collection); - } - } - ); - - this.on('preview:opened', (entry) => { - document.body.classList.add('preview-open'); - this.container - .querySelector(`[data-full-path="${entry.fullPath}"]`) - ?.focus(); - - updatePath(entry.fullPath); - updateTitle(`${decodeURIComponent(entry.fullPath)} | WebDAV`); - }); - - this.on('preview:closed', (entry, { preview = false } = {}) => { - if (preview) { - return; - } - - const path = trailingSlash(entry.path); - - document.body.classList.remove('preview-open'); - - updatePath(path); - updateTitle(`${decodeURIComponent(path)} | WebDAV`); - }); - } -} diff --git a/src/lib/UI/NativeDOM/Container.ts b/src/lib/UI/NativeDOM/Container.ts deleted file mode 100644 index 67ac414..0000000 --- a/src/lib/UI/NativeDOM/Container.ts +++ /dev/null @@ -1,14 +0,0 @@ -import Element from './Element'; -import List from './List'; - -export default class Container extends Element { - constructor() { - const template = '
      '; - - super(template); - - const list = new List(); - - this.element.appendChild(list.element); - } -} diff --git a/src/lib/UI/NativeDOM/Element.ts b/src/lib/UI/NativeDOM/Element.ts deleted file mode 100644 index 26ceeba..0000000 --- a/src/lib/UI/NativeDOM/Element.ts +++ /dev/null @@ -1,39 +0,0 @@ -import EventObject from '../../EventObject'; - -export default class Element extends EventObject { - #element; - - constructor(template = null) { - super(); - - if (template !== null) { - this.#element = this.createNodeFromString(template); - } - } - - get element() { - return this.#element; - } - - createNodesFromString(html) { - const container = document.createElement('div'), - fragment = document.createDocumentFragment(); - container.innerHTML = html; - - for (const childNode of container.childNodes) { - fragment.appendChild(childNode); - } - - return fragment; - } - - createNodeFromString(html) { - return this.createNodesFromString(html).firstChild; - } - - emptyNode() { - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - } - } -} diff --git a/src/lib/UI/NativeDOM/Footer.ts b/src/lib/UI/NativeDOM/Footer.ts deleted file mode 100644 index 93ac28e..0000000 --- a/src/lib/UI/NativeDOM/Footer.ts +++ /dev/null @@ -1,53 +0,0 @@ -import Element from './Element'; -import i18next from 'i18next'; -import joinPath from '../../joinPath'; -import trailingSlash from '../../trailingSlash'; - -export default class Footer extends Element { - constructor() { - const template = ``; - - super(template); - - this.bindEvents(); - } - - bindEvents(element = this.element) { - element - .querySelector('input[type="file"]') - .addEventListener('change', async (event) => { - for (const file of event.target.files) { - this.trigger('upload', location.pathname, file); - } - - element.value = null; - }); - - element - .querySelector('.create-directory') - .addEventListener('click', async (event) => { - event.preventDefault(); - - const directoryName = prompt('', i18next.t('directoryName')); - - if (!directoryName) { - return; - } - - this.trigger( - 'create-directory', - trailingSlash(joinPath(location.pathname, directoryName)), - directoryName, - location.pathname - ); - }); - } -} diff --git a/src/lib/UI/NativeDOM/List.ts b/src/lib/UI/NativeDOM/List.ts deleted file mode 100644 index fe00b1c..0000000 --- a/src/lib/UI/NativeDOM/List.ts +++ /dev/null @@ -1,123 +0,0 @@ -import Element from './Element'; -import Item from './List/Item'; -import supportsFocusWithin from '../supportsFocusWithin'; - -export default class List extends Element { - #collection; - #items; - - constructor() { - super('
        '); - - this.bindEvents(); - } - - bindEvents() { - this.on('list:update:request', () => this.loading()); - this.on('list:update:success', (collection) => this.update(collection)); - this.on('list:update:failed', () => this.loading(false)); - - this.on('collection:update', (collection) => { - if (collection === this.#collection) { - this.update(); - } - }); - - this.on('entry:update', (entry) => { - if (entry.collection === this.#collection) { - this.update(); - } - }); - - const arrowHandler = (event) => { - if (!['ArrowUp', 'ArrowDown'].includes(event.key)) { - return; - } - - event.preventDefault(); - event.stopPropagation(); - - const current = this.element.querySelector( - `li:focus${supportsFocusWithin ? ', li:focus-within' : ''}` - ), - isPreview = document.body.classList.contains('preview-open'), - previewItems = [ - ...this.element.querySelectorAll( - 'li:not(.directory):not([data-type="unknown"])' - ), - ], - currentItemIndex = previewItems.indexOf(current), - next = isPreview - ? currentItemIndex > -1 - ? previewItems.slice(currentItemIndex + 1).shift() - : null - : current - ? current.nextElementSibling - : this.element.querySelector('li:first-child'), - previous = isPreview - ? currentItemIndex > -1 - ? previewItems.slice(0, currentItemIndex).pop() - : null - : current - ? current.previousElementSibling - : null; - - if (event.key === 'ArrowUp' && previous) { - previous.focus(); - - if (isPreview) { - this.element.dispatchEvent( - new CustomEvent('preview:close', { - bubbles: true, - detail: { - preview: true, - }, - }) - ); - - previous.dispatchEvent(new CustomEvent('click')); - } - } else if (event.key === 'ArrowDown' && next) { - next.focus(); - - if (isPreview) { - this.element.dispatchEvent( - new CustomEvent('preview:close', { - bubbles: true, - detail: { - preview: true, - }, - }) - ); - - next.dispatchEvent(new CustomEvent('click')); - } - } - }; - - document.addEventListener('keydown', arrowHandler); - this.element.addEventListener('keydown', arrowHandler); - } - - loading(loading = true) { - if (loading) { - return this.element.classList.add('loading'); - } - - this.element.classList.remove('loading'); - } - - update(collection = this.#collection) { - this.emptyNode(); - - this.#items = collection.map((entry) => new Item(entry)); - - [...this.#items.map((item) => item.element)].forEach((element) => - this.element.appendChild(element) - ); - - this.loading(false); - - this.#collection = collection; - } -} diff --git a/src/lib/UI/NativeDOM/List/Item.ts b/src/lib/UI/NativeDOM/List/Item.ts deleted file mode 100644 index 2959251..0000000 --- a/src/lib/UI/NativeDOM/List/Item.ts +++ /dev/null @@ -1,342 +0,0 @@ -import * as BasicLightbox from 'basiclightbox'; -import Element from '../Element'; -import Prism from 'prismjs'; -import i18next from 'i18next'; -import joinPath from '../../../joinPath'; - -export default class Item extends Element { - #base64Encoder; - #entry; - #templates = Object.freeze({ - video: (entry) => - ``, - audio: (entry) => - ``, - image: (entry) => `${entry.title}`, - font: (entry) => { - const formats = { - eot: 'embedded-opentype', - otf: 'opentype', - ttf: 'truetype', - }, - extension = entry.name.replace(/^.+\.([^.]+)$/, '$1').toLowerCase(), - fontName = entry.fullPath.replace(/\W+/g, '_'), - demoText = `${i18next.t('pangram')} 0123456789
        - ${i18next.t('alphabet')}`; - return ` -

        ${entry.title}

        -

        ${demoText}

        -

        ${demoText}

        -

        ${demoText}

        -

        ${demoText}

        `; - }, - text: (entry, content) => - `
        ${content.replace(
        -        /[<>]/g,
        -        (c) => ({ '<': '<', '>': '>' }[c])
        -      )}
        `, - pdf: (entry) => - ``, - }); - - constructor(entry, base64Encoder = btoa) { - super(`
      • - ${entry.title} - - ${entry.displaySize} - - - - - -
      • `); - - this.#base64Encoder = base64Encoder; - this.#entry = entry; - - this.element.classList.add( - ...[ - entry.directory ? 'directory' : 'file', - entry.type ? entry.type : 'unknown', - ] - ); - - if (entry.placeholder) { - this.element.classList.add('loading'); - } - - if (!entry.del) { - this.element.querySelector('.delete').setAttribute('hidden', ''); - } - - if (!entry.rename) { - this.element.querySelector('.rename').setAttribute('hidden', ''); - } - - this.bindEvents(); - } - - bindEvents(element = this.element) { - this.on('entry:update', (entry) => { - if (entry === this.#entry) { - this.update(); - } - }); - - this.on('move:failed', (sourcePath) => { - if (sourcePath === this.#entry.fullPath) { - this.loading(false); - } - }); - - this.on('delete:failed', (sourcePath) => { - if (sourcePath === this.#entry.fullPath) { - this.loading(false); - } - }); - - element.addEventListener('click', () => this.open()); - - element - .querySelector('[download]') - .addEventListener('click', (event) => event.stopPropagation()); - - element.querySelector('.delete').addEventListener('click', (event) => { - event.preventDefault(); - event.stopPropagation(); - - this.del(); - }); - - element.querySelector('.rename').addEventListener('click', (event) => { - event.stopPropagation(); - event.preventDefault(); - - this.rename(); - }); - - element.addEventListener('keydown', (event) => { - if (['F2', 'Delete', 'Enter'].includes(event.key)) { - event.preventDefault(); - - if (event.key === 'F2' && this.#entry.rename) { - this.rename(); - } else if (event.key === 'Delete' && this.#entry.del) { - this.del(); - } else if (event.key === 'Enter' && !this.#entry.directory) { - if (event.shiftKey) { - return this.download(); - } - - this.open(); - } - } - }); - } - - del() { - const entry = this.#entry; - - if (!entry.del) { - throw new TypeError(`'${entry.name}' is read only.`); - } - - this.loading(); - - if ( - !confirm( - i18next.t('deleteConfirm', { - file: entry.title, - }) - ) - ) { - return this.loading(false); - } - - this.trigger('delete', entry.fullPath, entry); - } - - download() { - if (this.#entry.directory) { - return; - } - - this.element - .querySelector('[download]') - .dispatchEvent(new CustomEvent('click')); - } - - loading(loading = true) { - if (loading) { - return this.element.classList.add('loading'); - } - - this.element.classList.remove('loading'); - } - - open() { - const entry = this.#entry; - - this.loading(); - - if (entry.directory) { - return this.trigger('go', entry.fullPath, { - failure: () => this.loading(false), - }); - } - - const launchLightbox = (lightboxContent, onShow = null) => { - const close = () => lightbox.close(), - escapeListener = (event) => { - if (event.key === 'Escape') { - close(); - } - }, - lightbox = BasicLightbox.create(lightboxContent, { - className: entry.type, - onShow: () => { - this.loading(false); - - document.addEventListener('keydown', escapeListener); - document.addEventListener('preview:close', (event: CustomEvent) => { - lightbox.preview = event.detail?.preview; - - close(); - }); - - if (onShow) { - onShow(lightbox); - } - }, - onClose: () => { - document.removeEventListener('keydown', escapeListener); - document.removeEventListener('preview:close', close); - - this.trigger('preview:closed', this.#entry, { - preview: lightbox.preview, - }); - }, - }); - lightbox.show(); - - this.trigger('preview:opened', this.#entry); - }; - - if (['video', 'audio', 'image', 'font', 'pdf'].includes(entry.type)) { - this.trigger( - 'check', - entry.fullPath, - () => { - launchLightbox(this.#templates[entry.type](entry)); - }, - () => this.loading(false) - ); - } else { - this.trigger('get', entry.fullPath, (content) => { - if (!content) { - return this.loading(false); - } - - if (entry.type !== 'text') { - return this.download(); - } - - launchLightbox(this.#templates.text(entry, content), (lightbox) => - Prism.highlightAllUnder(lightbox.element()) - ); - }); - - this.loading(false); - } - - event.preventDefault(); - } - - rename() { - const entry = this.#entry; - - if (!entry.rename) { - throw new TypeError(`'${entry.name}' cannot be renamed.`); - } - - const node = this.element, - title = node.querySelector('.title'), - input = node.querySelector('input'), - setInputSize = () => { - title.innerText = input.value; - input.style.setProperty('width', `${title.scrollWidth}px`); - }, - save = () => { - // don't process if there's no name change - if (input.value !== entry.title) { - this.loading(); - - unbindListeners(); - - return this.trigger( - 'move', - entry.fullPath, - joinPath(entry.path, input.value), - entry - ); - } - - revert(); - }, - unbindListeners = () => { - input.removeEventListener('blur', blurListener); - input.removeEventListener('keydown', keyDownListener); - input.removeEventListener('input', inputListener); - }, - revert = () => { - title.classList.remove('invisible'); - input.classList.add('hidden'); - input.value = entry.title; - setInputSize(); - unbindListeners(); - - return node.focus(); - }, - blurListener = () => { - save(); - }, - keyDownListener = (event) => { - if (event.key === 'Enter') { - event.stopPropagation(); - event.preventDefault(); - - save(); - } else if (event.key === 'Escape') { - revert(); - } - }, - inputListener = () => { - return setInputSize(); - }; - title.classList.add('invisible'); - - input.classList.remove('hidden'); - input.value = entry.title; - setInputSize(); - input.removeAttribute('readonly'); - input.addEventListener('blur', blurListener); - input.addEventListener('keydown', keyDownListener); - input.addEventListener('input', inputListener); - input.focus(); - } - - update() { - if ( - this.#entry.placeholder && - this.element.classList.contains('placeholder') - ) { - this.element.classList.remove('placeholder'); - } - } -} diff --git a/src/lib/UI/UI.ts b/src/lib/UI/UI.ts deleted file mode 100644 index ac3c5f4..0000000 --- a/src/lib/UI/UI.ts +++ /dev/null @@ -1,69 +0,0 @@ -import DAV from '../DAV'; -import EventObject from '../EventObject'; -import LanguageDetector from 'i18next-browser-languagedetector'; -import Unimplemented from '../Unimplemented'; -import de from '../../../translations/de.json'; -import en from '../../../translations/en.json'; -import i18next from 'i18next'; -import pt from '../../../translations/pt.json'; - -type UIOptions = { - bypassCheck?: boolean; - sortDirectoriesFirst?: boolean; -}; - -export default class UI extends EventObject { - #container; - #dav; - #options; - - constructor( - container, - options: UIOptions = {}, - dav = new DAV({ - bypassCheck: options.bypassCheck ?? false, - sortDirectoriesFirst: options.sortDirectoriesFirst ?? false, - }) - ) { - super(); - - if (!(container instanceof HTMLElement)) { - throw new TypeError(`Invalid container element: '${container}'.`); - } - - this.#container = container; - this.#dav = dav; - this.#options = options; - - i18next.use(LanguageDetector).init({ - detection: { - caches: [], - }, - fallbackLng: 'en', - resources: { - de, - en, - pt, - }, - }); - } - - get options() { - // return a clone so these cannot be changed - return { - ...this.#options, - }; - } - - get dav(): DAV { - return this.#dav; - } - - get container() { - return this.#container; - } - - render() { - throw new Unimplemented("'render' must be implemented in the child class."); - } -} diff --git a/src/lib/Unimplemented.ts b/src/lib/Unimplemented.ts deleted file mode 100644 index 989aad4..0000000 --- a/src/lib/Unimplemented.ts +++ /dev/null @@ -1 +0,0 @@ -export default class Unimplemented extends Error {} diff --git a/src/lib/handleFileUpload.ts b/src/lib/handleFileUpload.ts new file mode 100644 index 0000000..e84bd66 --- /dev/null +++ b/src/lib/handleFileUpload.ts @@ -0,0 +1,75 @@ +import DAV from './DAV'; +import Entry from './Entry'; +import State from './State'; +import joinPath from './joinPath'; +import { success } from 'melba-toast'; +import { t } from 'i18next'; + +export const handleFileUpload = async ( + dav: DAV, + state: State, + file: File +): Promise => { + const collection = await dav.list(state.getPath(), true); + + if (!collection) { + return; + } + + state.setCollection(collection); + + const [existingFile] = collection.filter( + (entry: Entry): boolean => entry.name === file.name + ); + + if (existingFile) { + // TODO: nicer notification + if ( + !confirm( + t('overwriteFileConfirmation', { + file: existingFile.title, + }) + ) + ) { + return; + } + + collection.remove(existingFile); + } + + const placeholder = new Entry({ + fullPath: joinPath(state.getPath(), file.name), + modified: Date.now(), + size: file.size, + mimeType: file.type, + placeholder: true, + collection, + }); + + collection.add(placeholder); + + const result = await dav.upload(location.pathname, file); + + if (!result) { + collection.remove(placeholder); + + state.update(); + + return; + } + + placeholder.placeholder = false; + + state.update(); + + success( + t('successfullyUploaded', { + interpolation: { + escapeValue: false, + }, + file: file.name, + }) + ); +}; + +export default handleFileUpload; diff --git a/src/lib/joinPath.ts b/src/lib/joinPath.ts index a22da51..2cbc86c 100644 --- a/src/lib/joinPath.ts +++ b/src/lib/joinPath.ts @@ -1,6 +1,7 @@ -export const trimSlashes = (piece: string) => piece.replace(/^\/+|\/+$/g, ''); +export const trimSlashes = (piece: string): string => + piece.replace(/^\/+|\/+$/g, ''); -export const joinPath = (...pieces: string[]) => +export const joinPath = (...pieces: string[]): string => `/${pieces .map(trimSlashes) .filter((piece) => piece) diff --git a/src/lib/previewItems.ts b/src/lib/previewItems.ts new file mode 100644 index 0000000..e970fc1 --- /dev/null +++ b/src/lib/previewItems.ts @@ -0,0 +1,32 @@ +export const previewItems = ( + currentItem: HTMLElement, + selector: string = 'li' +): [HTMLElement | null, HTMLElement | null] => { + if (!currentItem) { + return [null, null]; + } + + const list = currentItem.parentElement as HTMLElement; + + if (!list) { + return [null, null]; + } + + const previewItems = Array.from(list.querySelectorAll(selector)), + currentIndex = previewItems.indexOf(currentItem); + + if (currentIndex === -1) { + return [null, null]; + } + + const previous = + currentIndex > 0 ? (previewItems[currentIndex - 1] as HTMLElement) : null, + next = + currentIndex < previewItems.length - 1 + ? (previewItems[currentIndex + 1] as HTMLElement) + : null; + + return [previous, next]; +}; + +export default previewItems; diff --git a/src/lib/supportsEvent.ts b/src/lib/supportsEvent.ts new file mode 100644 index 0000000..0a0af32 --- /dev/null +++ b/src/lib/supportsEvent.ts @@ -0,0 +1,16 @@ +const testElement = document.createElement('span'); + +export const supportsEvents = (...eventNames: string[]): boolean => + eventNames.every((eventName) => supportsEvent(eventName)); + +export const supportsEvent = (eventName: string): boolean => { + const attributeName = `on${eventName}`; + + if (!testElement.hasAttribute(attributeName)) { + testElement.setAttribute(attributeName, ''); + } + + return typeof testElement[`on${eventName}`] === 'function'; +}; + +export default supportsEvent; diff --git a/src/lib/UI/supportsFocusWithin.ts b/src/lib/supportsFocusWithin.ts similarity index 56% rename from src/lib/UI/supportsFocusWithin.ts rename to src/lib/supportsFocusWithin.ts index d6fe3e0..4d00581 100644 --- a/src/lib/UI/supportsFocusWithin.ts +++ b/src/lib/supportsFocusWithin.ts @@ -1,4 +1,4 @@ -export default (() => { +export const supportsFocusWithin: boolean = (() => { try { document.querySelector(':focus-within'); @@ -7,3 +7,5 @@ export default (() => { return false; } })(); + +export default supportsFocusWithin; diff --git a/src/lib/trailingSlash.ts b/src/lib/trailingSlash.ts index 5c9d96a..dbb7d83 100644 --- a/src/lib/trailingSlash.ts +++ b/src/lib/trailingSlash.ts @@ -1,4 +1,4 @@ -export const trailingSlash = (text: string) => +export const trailingSlash = (text: string): string => text.endsWith('/') ? text : `${text}/`; export default trailingSlash; diff --git a/assets/scss/style.scss b/src/style.scss similarity index 99% rename from assets/scss/style.scss rename to src/style.scss index 6f7cfe4..690018e 100644 --- a/assets/scss/style.scss +++ b/src/style.scss @@ -1,3 +1,7 @@ +@use '../node_modules/basiclightbox/src/styles/main'; +@use '../node_modules/prismjs/themes/prism.css'; +@use '../node_modules/melba-toast/dist/Melba.css'; + // Mini reset html { font-size: 16px; diff --git a/src/webdav-min.js b/src/webdav-min.js index b9a0c4c..1eb05ff 100644 --- a/src/webdav-min.js +++ b/src/webdav-min.js @@ -1,30 +1,31 @@ -(()=>{var an=Object.create;var Vt=Object.defineProperty,on=Object.defineProperties,sn=Object.getOwnPropertyDescriptor,un=Object.getOwnPropertyDescriptors,ln=Object.getOwnPropertyNames,lr=Object.getOwnPropertySymbols,cn=Object.getPrototypeOf,fr=Object.prototype.hasOwnProperty,fn=Object.prototype.propertyIsEnumerable;var cr=(i,r,e)=>r in i?Vt(i,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[r]=e,ue=(i,r)=>{for(var e in r||(r={}))fr.call(r,e)&&cr(i,e,r[e]);if(lr)for(var e of lr(r))fn.call(r,e)&&cr(i,e,r[e]);return i},Ft=(i,r)=>on(i,un(r));var Ke=(i=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(i,{get:(r,e)=>(typeof require!="undefined"?require:r)[e]}):i)(function(i){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+i+'" is not supported')});var Kt=(i,r)=>()=>(r||i((r={exports:{}}).exports,r),r.exports);var dn=(i,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of ln(r))!fr.call(i,t)&&t!==e&&Vt(i,t,{get:()=>r[t],enumerable:!(n=sn(r,t))||n.enumerable});return i};var Wt=(i,r,e)=>(e=i!=null?an(cn(i)):{},dn(r||!i||!i.__esModule?Vt(e,"default",{value:i,enumerable:!0}):e,i));var dr=(i,r,e)=>{if(!r.has(i))throw TypeError("Cannot "+e)};var b=(i,r,e)=>(dr(i,r,"read from private field"),e?e.call(i):r.get(i)),k=(i,r,e)=>{if(r.has(i))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(i):r.set(i,e)},L=(i,r,e,n)=>(dr(i,r,"write to private field"),n?n.call(i,e):r.set(i,e),e);var F=(i,r,e)=>new Promise((n,t)=>{var a=u=>{try{s(e.next(u))}catch(c){t(c)}},o=u=>{try{s(e.throw(u))}catch(c){t(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((e=e.apply(i,r)).next())});var wr=Kt((br,Zt)=>{(function(i){typeof br=="object"&&typeof Zt<"u"?Zt.exports=i():typeof define=="function"&&define.amd?define([],i):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).basicLightbox=i()})(function(){return function i(r,e,n){function t(s,u){if(!e[s]){if(!r[s]){var c=typeof Ke=="function"&&Ke;if(!u&&c)return c(s,!0);if(a)return a(s,!0);var g=new Error("Cannot find module '"+s+"'");throw g.code="MODULE_NOT_FOUND",g}var l=e[s]={exports:{}};r[s][0].call(l.exports,function(v){return t(r[s][1][v]||v)},l,l.exports,i,r,e,n)}return e[s].exports}for(var a=typeof Ke=="function"&&Ke,o=0;o1&&arguments[1]!==void 0&&arguments[1],u=document.createElement("div");return u.innerHTML=o.trim(),s===!0?u.children:u.firstChild},t=function(o,s){var u=o.children;return u.length===1&&u[0].tagName===s},a=function(o){return(o=o||document.querySelector(".basicLightbox"))!=null&&o.ownerDocument.body.contains(o)===!0};e.visible=a,e.create=function(o,s){var u=function(l,v){var m=n(` -
        +(()=>{var fi=Object.create;var vr=Object.defineProperty,di=Object.defineProperties,hi=Object.getOwnPropertyDescriptor,pi=Object.getOwnPropertyDescriptors,gi=Object.getOwnPropertyNames,Kr=Object.getOwnPropertySymbols,mi=Object.getPrototypeOf,zr=Object.prototype.hasOwnProperty,vi=Object.prototype.propertyIsEnumerable;var Vr=(i,t,e)=>t in i?vr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Me=(i,t)=>{for(var e in t||(t={}))zr.call(t,e)&&Vr(i,e,t[e]);if(Kr)for(var e of Kr(t))vi.call(t,e)&&Vr(i,e,t[e]);return i},Wt=(i,t)=>di(i,pi(t));var ht=(i=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(i,{get:(t,e)=>(typeof require!="undefined"?require:t)[e]}):i)(function(i){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+i+'" is not supported')});var xe=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var yi=(i,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of gi(t))!zr.call(i,r)&&r!==e&&vr(i,r,{get:()=>t[r],enumerable:!(n=hi(t,r))||n.enumerable});return i};var Y=(i,t,e)=>(e=i!=null?fi(mi(i)):{},yi(t||!i||!i.__esModule?vr(e,"default",{value:i,enumerable:!0}):e,i));var Br=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var h=(i,t,e)=>(Br(i,t,"read from private field"),e?e.call(i):t.get(i)),x=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},C=(i,t,e,n)=>(Br(i,t,"write to private field"),n?n.call(i,e):t.set(i,e),e);var T=(i,t,e)=>new Promise((n,r)=>{var a=u=>{try{s(e.next(u))}catch(v){r(v)}},o=u=>{try{s(e.throw(u))}catch(v){r(v)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((e=e.apply(i,t)).next())});var Gt=xe(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.AttributeAction=ce.IgnoreCaseMode=ce.SelectorType=void 0;var bi;(function(i){i.Attribute="attribute",i.Pseudo="pseudo",i.PseudoElement="pseudo-element",i.Tag="tag",i.Universal="universal",i.Adjacent="adjacent",i.Child="child",i.Descendant="descendant",i.Parent="parent",i.Sibling="sibling",i.ColumnCombinator="column-combinator"})(bi=ce.SelectorType||(ce.SelectorType={}));ce.IgnoreCaseMode={Unknown:null,QuirksMode:"quirks",IgnoreCase:!0,CaseSensitive:!1};var wi;(function(i){i.Any="any",i.Element="element",i.End="end",i.Equals="equals",i.Exists="exists",i.Hyphen="hyphen",i.Not="not",i.Start="start"})(wi=ce.AttributeAction||(ce.AttributeAction={}))});var Zr=xe(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.parse=Ye.isTraversal=void 0;var L=Gt(),Wr=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,Ei=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,Si=new Map([[126,L.AttributeAction.Element],[94,L.AttributeAction.Start],[36,L.AttributeAction.End],[42,L.AttributeAction.Any],[33,L.AttributeAction.Not],[124,L.AttributeAction.Hyphen]]),xi=new Set(["has","not","matches","is","where","host","host-context"]);function Jr(i){switch(i.type){case L.SelectorType.Adjacent:case L.SelectorType.Child:case L.SelectorType.Descendant:case L.SelectorType.Parent:case L.SelectorType.Sibling:case L.SelectorType.ColumnCombinator:return!0;default:return!1}}Ye.isTraversal=Jr;var Ci=new Set(["contains","icontains"]);function Pi(i,t,e){var n=parseInt(t,16)-65536;return n!==n||e?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)}function pt(i){return i.replace(Ei,Pi)}function yr(i){return i===39||i===34}function Gr(i){return i===32||i===9||i===10||i===12||i===13}function Oi(i){var t=[],e=Yr(t,"".concat(i),0);if(e0&&e0&&Jr(n[n.length-1]))throw new Error("Did not expect successive traversals.")}function v(_){if(n.length>0&&n[n.length-1].type===L.SelectorType.Descendant){n[n.length-1].type=_;return}u(),n.push({type:_})}function y(_,N){n.push({type:L.SelectorType.Attribute,name:_,action:N,value:r(1),namespace:null,ignoreCase:"quirks"})}function l(){if(n.length&&n[n.length-1].type===L.SelectorType.Descendant&&n.pop(),n.length===0)throw new Error("Empty sub-selector");i.push(n)}if(a(0),t.length===e)return e;e:for(;e{"use strict";var Jt=Qe&&Qe.__spreadArray||function(i,t,e){if(e||arguments.length===2)for(var n=0,r=t.length,a;n ":" > ";case M.SelectorType.Parent:return t===0?"< ":" < ";case M.SelectorType.Sibling:return t===0?"~ ":" ~ ";case M.SelectorType.Adjacent:return t===0?"+ ":" + ";case M.SelectorType.Descendant:return" ";case M.SelectorType.ColumnCombinator:return t===0?"|| ":" || ";case M.SelectorType.Universal:return i.namespace==="*"&&t+10?n+i.slice(e):i}});var sn=xe(Z=>{"use strict";var Ti=Z&&Z.__createBinding||(Object.create?function(i,t,e,n){n===void 0&&(n=e);var r=Object.getOwnPropertyDescriptor(t,e);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(i,n,r)}:function(i,t,e,n){n===void 0&&(n=e),i[n]=t[e]}),Ri=Z&&Z.__exportStar||function(i,t){for(var e in i)e!=="default"&&!Object.prototype.hasOwnProperty.call(t,e)&&Ti(t,i,e)};Object.defineProperty(Z,"__esModule",{value:!0});Z.stringify=Z.parse=Z.isTraversal=void 0;Ri(Gt(),Z);var on=Zr();Object.defineProperty(Z,"isTraversal",{enumerable:!0,get:function(){return on.isTraversal}});Object.defineProperty(Z,"parse",{enumerable:!0,get:function(){return on.parse}});var Fi=an();Object.defineProperty(Z,"stringify",{enumerable:!0,get:function(){return Fi.stringify}})});var Ce=xe(k=>{"use strict";var Yt,Di=k&&k.__classPrivateFieldSet||function(i,t,e,n,r){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?i!==t||!r:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?r.call(i,e):r?r.value=e:t.set(i,e),e},ji=k&&k.__classPrivateFieldGet||function(i,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?i!==t||!n:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(i):n?n.value:t.get(i)};Object.defineProperty(k,"__esModule",{value:!0}),k.Element=k.t=k.s=k.removeClass=k.onEach=k.once=k.on=k.off=k.hasClass=k.h=k.empty=k.emitCustom=k.emit=k.addClass=void 0;var Ni=sn();k.addClass=(i,...t)=>i.classList.add(...t);k.emit=(i,t)=>i.dispatchEvent(t);k.emitCustom=(i,t,...e)=>(0,k.emit)(i,new CustomEvent(t,{detail:e}));k.empty=i=>{for(var t;i.hasChildNodes();)(t=i.firstChild)===null||t===void 0||t.remove()};k.h=(i,...t)=>{let[e]=(0,Ni.parse)(i).map(n=>n.reduce((r,a)=>{var o;return a.type==="tag"?document.createElement(a.name):(a.type==="attribute"&&a.name!=="class"&&r.setAttribute(a.name,(o=a.value)!==null&&o!==void 0?o:""),a.type==="attribute"&&a.name==="class"&&r.classList.add(a.value),r)},document.createElement("div")));return t.forEach(n=>{n instanceof ge&&(n=n.element()),e.append(n)}),e};k.hasClass=(i,t)=>i.classList.contains(t);k.off=(i,t,e,n={})=>i.removeEventListener(t,e,n);k.on=(i,t,e,n={})=>i.addEventListener(t,e,n);k.once=(i,t,e,n={})=>(0,k.on)(i,t,e,Object.assign(Object.assign({},typeof n=="boolean"?{capture:n}:n),{once:!0}));k.onEach=(i,t,e,n={})=>t.forEach(r=>(0,k.on)(i,r,e,n));k.removeClass=(i,...t)=>i.classList.remove(...t);k.s=i=>{let t=document.createElement("div");return t.innerHTML=i,t.firstElementChild};k.t=i=>document.createTextNode(i);var ge=class{constructor(t){Yt.set(this,void 0),Di(this,Yt,t,"f")}static fromSelector(t,...e){return new ge((0,k.h)(t,...e))}static fromString(t){return new ge((0,k.s)(t))}addClass(...t){(0,k.addClass)(this.element(),...t)}append(...t){t.forEach(e=>{e instanceof ge&&(e=e.element()),this.element().append(e)})}element(){return ji(this,Yt,"f")}emit(t){return(0,k.emit)(this.element(),t)}emitCustom(t,...e){return(0,k.emitCustom)(this.element(),t,...e)}empty(){(0,k.empty)(this.element())}hasClass(t){return(0,k.hasClass)(this.element(),t)}on(t,e,n={}){(0,k.on)(this.element(),t,e,n)}off(t,e,n={}){(0,k.off)(this.element(),t,e,n)}once(t,e,n={}){(0,k.once)(this.element(),t,e,n)}onEach(t,e,n={}){(0,k.onEach)(this.element(),t,e,n)}query(t){return this.element().querySelector(t)}queryAll(t){return this.element().querySelectorAll(t)}removeClass(...t){(0,k.removeClass)(this.element(),...t)}};k.Element=ge,Yt=new WeakMap,k.default=ge});var kt=xe((ko,gn)=>{var rr=Object.defineProperty,qi=Object.defineProperties,Ui=Object.getOwnPropertyDescriptor,Hi=Object.getOwnPropertyDescriptors,Ki=Object.getOwnPropertyNames,fn=Object.getOwnPropertySymbols,hn=Object.prototype.hasOwnProperty,Vi=Object.prototype.propertyIsEnumerable,dn=(i,t,e)=>t in i?rr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,qe=(i,t)=>{for(var e in t||={})hn.call(t,e)&&dn(i,e,t[e]);if(fn)for(var e of fn(t))Vi.call(t,e)&&dn(i,e,t[e]);return i},Pt=(i,t)=>qi(i,Hi(t)),zi=(i,t)=>{for(var e in t)rr(i,e,{get:t[e],enumerable:!0})},Bi=(i,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ki(t))!hn.call(i,r)&&r!==e&&rr(i,r,{get:()=>t[r],enumerable:!(n=Ui(t,r))||n.enumerable});return i},Wi=i=>Bi(rr({},"__esModule",{value:!0}),i),pn={};zi(pn,{Melba:()=>nr,default:()=>ra,error:()=>Qi,info:()=>Xi,success:()=>ea,toast:()=>Ot,warning:()=>ta});gn.exports=Wi(pn);var Gi=class{#e={};on(i,t){i in this.#e||(this.#e[i]=[]),this.#e[i].push(t)}once(i,t){let e=(...n)=>{t(...n),this.off(i,e)};this.on(i,e)}off(i,t){if(!(i in this.#e))return;let e=this.#e[i].indexOf(t);e!==-1&&this.#e[i].splice(e,1)}emit(i,...t){i in this.#e&&this.#e[i].forEach(e=>e(...t))}},Ji=Gi,Yi=(()=>{try{return document.querySelector(":focus-within"),!0}catch{return!1}})(),Zi=Yi,I=class extends Ji{constructor(i,{animation:t=I.defaults.animation,animationDuration:e=I.defaults.animationDuration,closeLabel:n=I.defaults.closeLabel,container:r=null,containerClass:a=I.defaults.containerClass,containerElement:o=I.defaults.containerElement,events:s={},hide:u=I.defaults.hide,root:v=I.defaults.root,toastClass:y=I.defaults.toastClass,toastElement:l=I.defaults.toastElement,toastHideClass:m=I.defaults.toastHideClass,toastShowClass:g=I.defaults.toastShowClass,type:E=I.defaults.type}){if(super(),!i)throw new TypeError("'content' cannot be empty.");if(this.animation=t,this.events=s,this.toastHideClass=m,this.toastShowClass=g,r||(r=this.getContainer({containerClass:a,containerElement:o,root:v})),this.container=r,u===!0&&(u=I.defaults.hideDelay),u!==!1&&u<100&&(u*=1e3),this.hideDelay=u,e<100&&(e*=1e3),this.build({closeLabel:n,content:i,toastClass:y,toastElement:l,type:E}),this.hideDelay!==!1&&this.autoHide(e),this.animation){window.requestAnimationFrame(()=>this.show());return}this.autoShow&&this.show()}autoHide(i){if(this.hideDelay)return window.setTimeout(()=>this.hide(),this.hideDelay+(this.animation?i:0))}build({closeLabel:i,content:t,toastClass:e,toastElement:n,type:r}){this.element=document.createElement(n),this.element.setAttribute("title",t),this.element.setAttribute("role","status"),this.element.setAttribute("tabindex","0"),this.element.classList.add(e),this.element.classList.add(`toast--${r}`),this.element.appendChild(this.buildClose(i)),this.element.appendChild(document.createTextNode(t)),this.element.addEventListener("keydown",a=>{a.key==="Escape"&&(a.preventDefault(),this.hide())}),this.container.appendChild(this.element),this.emit("build")}show(){this.element.classList.remove(this.toastHideClass),this.element.classList.add(this.toastShowClass),this.emit("show")}hide(i=!1){if(!i&&this.hasFocus)return;let t=(Zi?":focus-within, ":"")+":focus, :hover";if(!i&&this.element.matches(t)&&this.element.addEventListener("mouseout",()=>{this.hasFocus=!1,this.hideDelay>0&&this.hide()}),this.element.classList.remove(this.toastShowClass),this.element.classList.add(this.toastHideClass),this.emit("hide"),this.animation){let e=()=>this.remove(),n=()=>{a||(this.element.addEventListener("transitionend",()=>e()),a=!0)},r=()=>{this.show(),this.element.removeEventListener("transitionstart",()=>n()),this.element.removeEventListener("transitionend",()=>e()),this.element.removeEventListener("mouseover",()=>r()),this.element.addEventListener("mouseout",()=>this.hide())},a=!1;this.element.addEventListener("mouseover",()=>r()),this.element.addEventListener("transitionstart",()=>n());return}this.remove()}remove(){this.element.parentNode===this.container&&(this.container.removeChild(this.element),this.emit("remove"))}buildClose(i){let t=document.createElement("button");return t.setAttribute("title",i),t.appendChild(document.createTextNode(i)),t.addEventListener("click",()=>this.hide()),t}getContainer({containerClass:i,containerElement:t,root:e}){let n=e.querySelector(`${t}.${i}`);if(n)return n;let r=document.createElement(t);return r.classList.add(i),e.appendChild(r),r}getElement(){return this.element}static settings(i){I.defaults=qe(qe({},I.defaults),i)}},nr=I;nr.defaults={animation:!0,animationDuration:400,autoShow:!0,closeLabel:"Close",containerClass:"toast__container",containerElement:"div",hide:!1,hideDelay:5,root:document.body,toastClass:"toast",toastElement:"div",toastHideClass:"toast--hide",toastShowClass:"toast--show",type:"info"};var Ot=(i,t={})=>new nr(i,Pt(qe({},t),{autoShow:!0})),Qi=(i,t={})=>Ot(i,Pt(qe({},t),{type:"error"})),Xi=(i,t={})=>Ot(i,Pt(qe({},t),{type:"info"})),ea=(i,t={})=>Ot(i,Pt(qe({},t),{type:"success",hide:!0})),ta=(i,t={})=>Ot(i,Pt(qe({},t),{type:"warning"})),ra=nr});var Gn=xe((Wn,Dr)=>{(function(i){typeof Wn=="object"&&typeof Dr<"u"?Dr.exports=i():typeof define=="function"&&define.amd?define([],i):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).basicLightbox=i()})(function(){return function i(t,e,n){function r(s,u){if(!e[s]){if(!t[s]){var v=typeof ht=="function"&&ht;if(!u&&v)return v(s,!0);if(a)return a(s,!0);var y=new Error("Cannot find module '"+s+"'");throw y.code="MODULE_NOT_FOUND",y}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(m){return r(t[s][1][m]||m)},l,l.exports,i,t,e,n)}return e[s].exports}for(var a=typeof ht=="function"&&ht,o=0;o1&&arguments[1]!==void 0&&arguments[1],u=document.createElement("div");return u.innerHTML=o.trim(),s===!0?u.children:u.firstChild},r=function(o,s){var u=o.children;return u.length===1&&u[0].tagName===s},a=function(o){return(o=o||document.querySelector(".basicLightbox"))!=null&&o.ownerDocument.body.contains(o)===!0};e.visible=a,e.create=function(o,s){var u=function(l,m){var g=n(` +
        - `)),x=m.querySelector(".basicLightbox__placeholder");l.forEach(function(p){return x.appendChild(p)});var h=t(x,"IMG"),f=t(x,"VIDEO"),d=t(x,"IFRAME");return h===!0&&m.classList.add("basicLightbox--img"),f===!0&&m.classList.add("basicLightbox--video"),d===!0&&m.classList.add("basicLightbox--iframe"),m}(o=function(l){var v=typeof l=="string",m=l instanceof HTMLElement==1;if(v===!1&&m===!1)throw new Error("Content must be a DOM element/node or string");return v===!0?Array.from(n(l,!0)):l.tagName==="TEMPLATE"?[l.content.cloneNode(!0)]:Array.from(l.children)}(o),s=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if((l=Object.assign({},l)).closable==null&&(l.closable=!0),l.className==null&&(l.className=""),l.onShow==null&&(l.onShow=function(){}),l.onClose==null&&(l.onClose=function(){}),typeof l.closable!="boolean")throw new Error("Property `closable` must be a boolean");if(typeof l.className!="string")throw new Error("Property `className` must be a string");if(typeof l.onShow!="function")throw new Error("Property `onShow` must be a function");if(typeof l.onClose!="function")throw new Error("Property `onClose` must be a function");return l}(s)),c=function(l){return s.onClose(g)!==!1&&function(v,m){return v.classList.remove("basicLightbox--visible"),setTimeout(function(){return a(v)===!1||v.parentElement.removeChild(v),m()},410),!0}(u,function(){if(typeof l=="function")return l(g)})};s.closable===!0&&u.addEventListener("click",function(l){l.target===u&&c()});var g={element:function(){return u},visible:function(){return a(u)},show:function(l){return s.onShow(g)!==!1&&function(v,m){return document.body.appendChild(v),setTimeout(function(){requestAnimationFrame(function(){return v.classList.add("basicLightbox--visible"),m()})},10),!0}(u,function(){if(typeof l=="function")return l(g)})},close:c};return g}},{}]},{},[1])(1)})});var xr=Kt((Ti,Rt)=>{var Sn=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var O=function(i){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,e=0,n={},t={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function h(f){return f instanceof a?new a(f.type,h(f.content),f.alias):Array.isArray(f)?f.map(h):f.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(p){var h=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(p.stack)||[])[1];if(h){var f=document.getElementsByTagName("script");for(var d in f)if(f[d].src==h)return f[d]}return null}},isActive:function(h,f,d){for(var p="no-"+f;h;){var y=h.classList;if(y.contains(f))return!0;if(y.contains(p))return!1;h=h.parentElement}return!!d}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(h,f){var d=t.util.clone(t.languages[h]);for(var p in f)d[p]=f[p];return d},insertBefore:function(h,f,d,p){p=p||t.languages;var y=p[h],w={};for(var E in y)if(y.hasOwnProperty(E)){if(E==f)for(var S in d)d.hasOwnProperty(S)&&(w[S]=d[S]);d.hasOwnProperty(E)||(w[E]=y[E])}var P=p[h];return p[h]=w,t.languages.DFS(t.languages,function(C,N){N===P&&C!=h&&(this[C]=w)}),w},DFS:function h(f,d,p,y){y=y||{};var w=t.util.objId;for(var E in f)if(f.hasOwnProperty(E)){d.call(f,E,f[E],p||E);var S=f[E],P=t.util.type(S);P==="Object"&&!y[w(S)]?(y[w(S)]=!0,h(S,d,null,y)):P==="Array"&&!y[w(S)]&&(y[w(S)]=!0,h(S,d,E,y))}}},plugins:{},highlightAll:function(h,f){t.highlightAllUnder(document,h,f)},highlightAllUnder:function(h,f,d){var p={callback:d,container:h,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};t.hooks.run("before-highlightall",p),p.elements=Array.prototype.slice.apply(p.container.querySelectorAll(p.selector)),t.hooks.run("before-all-elements-highlight",p);for(var y=0,w;w=p.elements[y++];)t.highlightElement(w,f===!0,p.callback)},highlightElement:function(h,f,d){var p=t.util.getLanguage(h),y=t.languages[p];t.util.setLanguage(h,p);var w=h.parentElement;w&&w.nodeName.toLowerCase()==="pre"&&t.util.setLanguage(w,p);var E=h.textContent,S={element:h,language:p,grammar:y,code:E};function P(N){S.highlightedCode=N,t.hooks.run("before-insert",S),S.element.innerHTML=S.highlightedCode,t.hooks.run("after-highlight",S),t.hooks.run("complete",S),d&&d.call(S.element)}if(t.hooks.run("before-sanity-check",S),w=S.element.parentElement,w&&w.nodeName.toLowerCase()==="pre"&&!w.hasAttribute("tabindex")&&w.setAttribute("tabindex","0"),!S.code){t.hooks.run("complete",S),d&&d.call(S.element);return}if(t.hooks.run("before-highlight",S),!S.grammar){P(t.util.encode(S.code));return}if(f&&i.Worker){var C=new Worker(t.filename);C.onmessage=function(N){P(N.data)},C.postMessage(JSON.stringify({language:S.language,code:S.code,immediateClose:!0}))}else P(t.highlight(S.code,S.grammar,S.language))},highlight:function(h,f,d){var p={code:h,grammar:f,language:d};if(t.hooks.run("before-tokenize",p),!p.grammar)throw new Error('The language "'+p.language+'" has no grammar.');return p.tokens=t.tokenize(p.code,p.grammar),t.hooks.run("after-tokenize",p),a.stringify(t.util.encode(p.tokens),p.language)},tokenize:function(h,f){var d=f.rest;if(d){for(var p in d)f[p]=d[p];delete f.rest}var y=new u;return c(y,y.head,h),s(h,y,f,y.head,0),l(y)},hooks:{all:{},add:function(h,f){var d=t.hooks.all;d[h]=d[h]||[],d[h].push(f)},run:function(h,f){var d=t.hooks.all[h];if(!(!d||!d.length))for(var p=0,y;y=d[p++];)y(f)}},Token:a};i.Prism=t;function a(h,f,d,p){this.type=h,this.content=f,this.alias=d,this.length=(p||"").length|0}a.stringify=function h(f,d){if(typeof f=="string")return f;if(Array.isArray(f)){var p="";return f.forEach(function(P){p+=h(P,d)}),p}var y={type:f.type,content:h(f.content,d),tag:"span",classes:["token",f.type],attributes:{},language:d},w=f.alias;w&&(Array.isArray(w)?Array.prototype.push.apply(y.classes,w):y.classes.push(w)),t.hooks.run("wrap",y);var E="";for(var S in y.attributes)E+=" "+S+'="'+(y.attributes[S]||"").replace(/"/g,""")+'"';return"<"+y.tag+' class="'+y.classes.join(" ")+'"'+E+">"+y.content+""};function o(h,f,d,p){h.lastIndex=f;var y=h.exec(d);if(y&&p&&y[1]){var w=y[1].length;y.index+=w,y[0]=y[0].slice(w)}return y}function s(h,f,d,p,y,w){for(var E in d)if(!(!d.hasOwnProperty(E)||!d[E])){var S=d[E];S=Array.isArray(S)?S:[S];for(var P=0;P=w.reach);T+=R.value.length,R=R.next){var q=R.value;if(f.length>h.length)return;if(!(q instanceof a)){var Se=1,I;if(xe){if(I=o(J,T,h,W),!I||I.index>=h.length)break;var je=I.index,Ht=I.index+I[0].length,H=T;for(H+=R.value.length;je>=H;)R=R.next,H+=R.value.length;if(H-=R.value.length,T=H,R.value instanceof a)continue;for(var Oe=R;Oe!==f.tail&&(Hw.reach&&(w.reach=pe);var ge=R.prev;Ne&&(ge=c(f,ge,Ne),T+=Ne.length),g(f,ge,Se);var At=new a(E,N?t.tokenize(re,N):re,se,re);if(R=c(f,ge,At),he&&c(f,R,he),Se>1){var Ee={cause:E+","+P,reach:pe};s(h,f,d,R.prev,T,Ee),w&&Ee.reach>w.reach&&(w.reach=Ee.reach)}}}}}}function u(){var h={value:null,prev:null,next:null},f={value:null,prev:h,next:null};h.next=f,this.head=h,this.tail=f,this.length=0}function c(h,f,d){var p=f.next,y={value:d,prev:f,next:p};return f.next=y,p.prev=y,h.length++,y}function g(h,f,d){for(var p=f.next,y=0;y/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};O.languages.markup.tag.inside["attr-value"].inside.entity=O.languages.markup.entity;O.languages.markup.doctype.inside["internal-subset"].inside=O.languages.markup;O.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))});Object.defineProperty(O.languages.markup.tag,"addInlined",{value:function(r,e){var n={};n["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:O.languages[e]},n.cdata=/^$/i;var t={"included-cdata":{pattern://i,inside:n}};t["language-"+e]={pattern:/[\s\S]+/,inside:O.languages[e]};var a={};a[r]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return r}),"i"),lookbehind:!0,greedy:!0,inside:t},O.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(O.languages.markup.tag,"addAttribute",{value:function(i,r){O.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:O.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});O.languages.html=O.languages.markup;O.languages.mathml=O.languages.markup;O.languages.svg=O.languages.markup;O.languages.xml=O.languages.extend("markup",{});O.languages.ssml=O.languages.xml;O.languages.atom=O.languages.xml;O.languages.rss=O.languages.xml;(function(i){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+r.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var e=i.languages.markup;e&&(e.tag.addInlined("style","css"),e.tag.addAttribute("style","css"))})(O);O.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};O.languages.javascript=O.languages.extend("clike",{"class-name":[O.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});O.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;O.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:O.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:O.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:O.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:O.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:O.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});O.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:O.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});O.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});O.languages.markup&&(O.languages.markup.tag.addInlined("script","javascript"),O.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));O.languages.js=O.languages.javascript;(function(){if(typeof O>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading\u2026",r=function(v,m){return"\u2716 Error "+v+" while fetching file: "+m},e="\u2716 Error: File does not exist or is empty",n={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",a="loading",o="loaded",s="failed",u="pre[data-src]:not(["+t+'="'+o+'"]):not(['+t+'="'+a+'"])';function c(v,m,x){var h=new XMLHttpRequest;h.open("GET",v,!0),h.onreadystatechange=function(){h.readyState==4&&(h.status<400&&h.responseText?m(h.responseText):h.status>=400?x(r(h.status,h.statusText)):x(e))},h.send(null)}function g(v){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(m){var x=Number(m[1]),h=m[2],f=m[3];return h?f?[x,Number(f)]:[x,void 0]:[x,x]}}O.hooks.add("before-highlightall",function(v){v.selector+=", "+u}),O.hooks.add("before-sanity-check",function(v){var m=v.element;if(m.matches(u)){v.code="",m.setAttribute(t,a);var x=m.appendChild(document.createElement("CODE"));x.textContent=i;var h=m.getAttribute("data-src"),f=v.language;if(f==="none"){var d=(/\.(\w+)$/.exec(h)||[,"none"])[1];f=n[d]||d}O.util.setLanguage(x,f),O.util.setLanguage(m,f);var p=O.plugins.autoloader;p&&p.loadLanguages(f),c(h,function(y){m.setAttribute(t,o);var w=g(m.getAttribute("data-range"));if(w){var E=y.split(/\r\n?|\n/g),S=w[0],P=w[1]==null?E.length:w[1];S<0&&(S+=E.length),S=Math.max(0,Math.min(S-1,E.length)),P<0&&(P+=E.length),P=Math.max(0,Math.min(P,E.length)),y=E.slice(S,P).join(` -`),m.hasAttribute("data-start")||m.setAttribute("data-start",String(S+1))}x.textContent=y,O.highlightElement(x)},function(y){m.setAttribute(t,s),x.textContent=y})}}),O.plugins.fileHighlight={highlight:function(m){for(var x=(m||document).querySelectorAll(u),h=0,f;f=x[h++];)O.highlightElement(f)}};var l=!1;O.fileHighlight=function(){l||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),l=!0),O.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var Jr=Kt(ce=>{"use strict";var Ut=ce&&ce.__assign||function(){return Ut=Object.assign||function(i){for(var r,e=1,n=arguments.length;e0&&e.hide()}),this.element.classList.remove(this.toastShowClass),this.element.classList.add(this.toastHideClass),this.trigger("hide"),this.animation){var n=function(){return e.remove()},t=function(){o||(e.element.addEventListener("transitionend",function(){return n()}),o=!0)},a=function(){e.show(),e.element.removeEventListener("transitionstart",function(){return t()}),e.element.removeEventListener("transitionend",function(){return n()}),e.element.removeEventListener("mouseover",function(){return a()}),e.element.addEventListener("mouseout",function(){return e.hide()})},o=!1;this.element.addEventListener("mouseover",function(){return a()}),this.element.addEventListener("transitionstart",function(){return t()});return}this.remove()}},i.prototype.remove=function(){this.element.parentNode===this.container&&(this.container.removeChild(this.element),this.trigger("remove"))},i.prototype.buildClose=function(r){var e=this,n=document.createElement("button");return n.setAttribute("title",r),n.appendChild(document.createTextNode(r)),n.addEventListener("click",function(){return e.hide()}),n},i.prototype.getContainer=function(r){var e=r.containerClass,n=r.containerElement,t=r.root,a=t.querySelector("".concat(n,".").concat(e));if(a)return a;var o=document.createElement(n);return o.classList.add(e),t.appendChild(o),o},i.prototype.on=function(r,e){this.events[r]||(this.events[r]=[]),this.events[r].push(e)},i.prototype.off=function(r,e){if(e===void 0&&(e=null),!e){this.events[r]=[];return}var n=this.events[r].indexOf(e);n===-1&&this.events[r].splice(n,1)},i.prototype.trigger=function(r){for(var e=this,n=[],t=1;t-1});var hr,gr;function We(i){if(typeof i!="string"&&(i=String(i)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(i)||i==="")throw new TypeError('Invalid character in header field name: "'+i+'"');return i.toLowerCase()}function Gt(i){return typeof i!="string"&&(i=String(i)),i}function Yt(i){var r={next:function(){var e=i.shift();return{done:e===void 0,value:e}}};return z.iterable&&(r[Symbol.iterator]=function(){return r}),r}function D(i){this.map={},i instanceof D?i.forEach(function(r,e){this.append(e,r)},this):Array.isArray(i)?i.forEach(function(r){this.append(r[0],r[1])},this):i&&Object.getOwnPropertyNames(i).forEach(function(r){this.append(r,i[r])},this)}D.prototype.append=function(i,r){i=We(i),r=Gt(r);var e=this.map[i];this.map[i]=e?e+", "+r:r};D.prototype.delete=function(i){delete this.map[We(i)]};D.prototype.get=function(i){return i=We(i),this.has(i)?this.map[i]:null};D.prototype.has=function(i){return this.map.hasOwnProperty(We(i))};D.prototype.set=function(i,r){this.map[We(i)]=Gt(r)};D.prototype.forEach=function(i,r){for(var e in this.map)this.map.hasOwnProperty(e)&&i.call(r,this.map[e],e,this)};D.prototype.keys=function(){var i=[];return this.forEach(function(r,e){i.push(e)}),Yt(i)};D.prototype.values=function(){var i=[];return this.forEach(function(r){i.push(r)}),Yt(i)};D.prototype.entries=function(){var i=[];return this.forEach(function(r,e){i.push([e,r])}),Yt(i)};z.iterable&&(D.prototype[Symbol.iterator]=D.prototype.entries);function Jt(i){if(i.bodyUsed)return Promise.reject(new TypeError("Already read"));i.bodyUsed=!0}function mr(i){return new Promise(function(r,e){i.onload=function(){r(i.result)},i.onerror=function(){e(i.error)}})}function pn(i){var r=new FileReader,e=mr(r);return r.readAsArrayBuffer(i),e}function gn(i){var r=new FileReader,e=mr(r);return r.readAsText(i),e}function mn(i){for(var r=new Uint8Array(i),e=new Array(r.length),n=0;n-1?r:i}function Le(i,r){if(!(this instanceof Le))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');r=r||{};var e=r.body;if(i instanceof Le){if(i.bodyUsed)throw new TypeError("Already read");this.url=i.url,this.credentials=i.credentials,r.headers||(this.headers=new D(i.headers)),this.method=i.method,this.mode=i.mode,this.signal=i.signal,!e&&i._bodyInit!=null&&(e=i._bodyInit,i.bodyUsed=!0)}else this.url=String(i);if(this.credentials=r.credentials||this.credentials||"same-origin",(r.headers||!this.headers)&&(this.headers=new D(r.headers)),this.method=yn(r.method||this.method||"GET"),this.mode=r.mode||this.mode||null,this.signal=r.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&e)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(e),(this.method==="GET"||this.method==="HEAD")&&(r.cache==="no-store"||r.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var t=/\?/;this.url+=(t.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Le.prototype.clone=function(){return new Le(this,{body:this._bodyInit})};function bn(i){var r=new FormData;return i.trim().split("&").forEach(function(e){if(e){var n=e.split("="),t=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");r.append(decodeURIComponent(t),decodeURIComponent(a))}}),r}function wn(i){var r=new D,e=i.replace(/\r?\n[\t ]+/g," ");return e.split("\r").map(function(n){return n.indexOf(` -`)===0?n.substr(1,n.length):n}).forEach(function(n){var t=n.split(":"),a=t.shift().trim();if(a){var o=t.join(":").trim();r.append(a,o)}}),r}vr.call(Le.prototype);function ne(i,r){if(!(this instanceof ne))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');r||(r={}),this.type="default",this.status=r.status===void 0?200:r.status,this.ok=this.status>=200&&this.status<300,this.statusText=r.statusText===void 0?"":""+r.statusText,this.headers=new D(r.headers),this.url=r.url||"",this._initBody(i)}vr.call(ne.prototype);ne.prototype.clone=function(){return new ne(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new D(this.headers),url:this.url})};ne.error=function(){var i=new ne(null,{status:0,statusText:""});return i.type="error",i};var xn=[301,302,303,307,308];ne.redirect=function(i,r){if(xn.indexOf(r)===-1)throw new RangeError("Invalid status code");return new ne(null,{status:r,headers:{location:i}})};var ke=_.DOMException;try{new ke}catch{ke=function(r,e){this.message=r,this.name=e;var n=Error(r);this.stack=n.stack},ke.prototype=Object.create(Error.prototype),ke.prototype.constructor=ke}function yr(i,r){return new Promise(function(e,n){var t=new Le(i,r);if(t.signal&&t.signal.aborted)return n(new ke("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var u={status:a.status,statusText:a.statusText,headers:wn(a.getAllResponseHeaders()||"")};u.url="responseURL"in a?a.responseURL:u.headers.get("X-Request-URL");var c="response"in a?a.response:a.responseText;setTimeout(function(){e(new ne(c,u))},0)},a.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){n(new ke("Aborted","AbortError"))},0)};function s(u){try{return u===""&&_.location.href?_.location.href:u}catch{return u}}a.open(t.method,s(t.url),!0),t.credentials==="include"?a.withCredentials=!0:t.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(z.blob?a.responseType="blob":z.arrayBuffer&&t.headers.get("Content-Type")&&t.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),r&&typeof r.headers=="object"&&!(r.headers instanceof D)?Object.getOwnPropertyNames(r.headers).forEach(function(u){a.setRequestHeader(u,Gt(r.headers[u]))}):t.headers.forEach(function(u,c){a.setRequestHeader(c,u)}),t.signal&&(t.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&t.signal.removeEventListener("abort",o)}),a.send(typeof t._bodyInit>"u"?null:t._bodyInit)})}yr.polyfill=!0;_.fetch||(_.fetch=yr,_.Headers=D,_.Request=Le,_.Response=ne);var Pe={},U=class{hasEvent(r){return r in Pe}on(r,e){this.hasEvent(r)||(Pe[r]=[]),Pe[r].push(e)}off(r,e=null){if(!!this.hasEvent(r)){if(e===null)return Pe[r]=[];Pe[r]=Pe[r].filter(n=>n!==e)}}trigger(r,...e){if(this.hasEvent(r)){let n=!1;Pe[r].forEach(t=>{n||t(...e)===!1&&(n=!0)})}}};var Je,X=class extends U{constructor(e=null){super();k(this,Je,void 0);e!==null&&L(this,Je,this.createNodeFromString(e))}get element(){return b(this,Je)}createNodesFromString(e){let n=document.createElement("div"),t=document.createDocumentFragment();n.innerHTML=e;for(let a of n.childNodes)t.appendChild(a);return t}createNodeFromString(e){return this.createNodesFromString(e).firstChild}emptyNode(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild)}};Je=new WeakMap;var qr=Wt(wr());var Hr=Wt(xr());function Q(i){return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Q(i)}function V(i,r){if(!(i instanceof r))throw new TypeError("Cannot call a class as a function")}function Sr(i,r){for(var e=0;ei.length)&&(r=i.length);for(var e=0,n=new Array(r);e1&&arguments[1]!==void 0?arguments[1]:{};V(this,i),this.init(r,e)}return K(i,[{key:"init",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||On,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,n=new Array(e),t=0;t1?n-1:0),a=1;a-1?s.replace(/###/g,"."):s}function t(){return!i||typeof i=="string"}for(var a=typeof r!="string"?[].concat(r):r.split(".");a.length>1;){if(t())return{};var o=n(a.shift());!i[o]&&e&&(i[o]=new e),Object.prototype.hasOwnProperty.call(i,o)?i=i[o]:i={}}return t()?{}:{obj:i,k:n(a.shift())}}function Lr(i,r,e){var n=ir(i,r,Object),t=n.obj,a=n.k;t[a]=e}function Ln(i,r,e,n){var t=ir(i,r,Object),a=t.obj,o=t.k;a[o]=a[o]||[],n&&(a[o]=a[o].concat(e)),n||a[o].push(e)}function Nt(i,r){var e=ir(i,r),n=e.obj,t=e.k;if(!!n)return n[t]}function Pr(i,r,e){var n=Nt(i,e);return n!==void 0?n:Nt(r,e)}function Ur(i,r,e){for(var n in r)n!=="__proto__"&&n!=="constructor"&&(n in i?typeof i[n]=="string"||i[n]instanceof String||typeof r[n]=="string"||r[n]instanceof String?e&&(i[n]=r[n]):Ur(i[n],r[n],e):i[n]=r[n]);return i}function Ie(i){return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Pn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Cn(i){return typeof i=="string"?i.replace(/[&<>"'\/]/g,function(r){return Pn[r]}):i}var $t=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,An=[" ",",","?","!",";"];function Fn(i,r,e){r=r||"",e=e||"";var n=An.filter(function(s){return r.indexOf(s)<0&&e.indexOf(s)<0});if(n.length===0)return!0;var t=new RegExp("(".concat(n.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),a=!t.test(i);if(!a){var o=i.indexOf(e);o>0&&!t.test(i.substring(0,o))&&(a=!0)}return a}function Cr(i,r){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);r&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})),e.push.apply(e,n)}return e}function Tt(i){for(var r=1;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Br(i,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!i){if(i[r])return i[r];for(var n=r.split(e),t=i,a=0;aa+o;)o++,s=n.slice(a,a+o).join(e),u=t[s];if(u===void 0)return;if(u===null)return null;if(r.endsWith(s)){if(typeof u=="string")return u;if(s&&typeof u[s]=="string")return u[s]}var c=n.slice(a+o).join(e);return c?Br(u,c,e):void 0}t=t[n[a]]}return t}}var Tn=function(i){$e(e,i);var r=Rn(e);function e(n){var t,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return V(this,e),t=r.call(this),$t&&ve.call(ee(t)),t.data=n||{},t.options=a,t.options.keySeparator===void 0&&(t.options.keySeparator="."),t.options.ignoreJSONStructure===void 0&&(t.options.ignoreJSONStructure=!0),t}return K(e,[{key:"addNamespaces",value:function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var a=this.options.ns.indexOf(t);a>-1&&this.options.ns.splice(a,1)}},{key:"getResource",value:function(t,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,c=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,g=[t,a];o&&typeof o!="string"&&(g=g.concat(o)),o&&typeof o=="string"&&(g=g.concat(u?o.split(u):o)),t.indexOf(".")>-1&&(g=t.split("."));var l=Nt(this.data,g);return l||!c||typeof o!="string"?l:Br(this.data&&this.data[t]&&this.data[t][a],o,u)}},{key:"addResource",value:function(t,a,o,s){var u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var g=[t,a];o&&(g=g.concat(c?o.split(c):o)),t.indexOf(".")>-1&&(g=t.split("."),s=a,a=g[1]),this.addNamespaces(a),Lr(this.data,g,s),u.silent||this.emit("added",t,a,o,s)}},{key:"addResources",value:function(t,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var u in o)(typeof o[u]=="string"||Object.prototype.toString.apply(o[u])==="[object Array]")&&this.addResource(t,a,u,o[u],{silent:!0});s.silent||this.emit("added",t,a,o)}},{key:"addResourceBundle",value:function(t,a,o,s,u){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},g=[t,a];t.indexOf(".")>-1&&(g=t.split("."),s=o,o=a,a=g[1]),this.addNamespaces(a);var l=Nt(this.data,g)||{};s?Ur(l,o,u):l=Tt(Tt({},l),o),Lr(this.data,g,l),c.silent||this.emit("added",t,a,o)}},{key:"removeResourceBundle",value:function(t,a){this.hasResourceBundle(t,a)&&delete this.data[t][a],this.removeNamespaces(a),this.emit("removed",t,a)}},{key:"hasResourceBundle",value:function(t,a){return this.getResource(t,a)!==void 0}},{key:"getResourceBundle",value:function(t,a){return a||(a=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Tt(Tt({},{}),this.getResource(t,a)):this.getResource(t,a)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function(t){var a=this.getDataByLanguage(t),o=a&&Object.keys(a)||[];return!!o.find(function(s){return a[s]&&Object.keys(a[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),e}(ve),Mr={processors:{},addPostProcessor:function(r){this.processors[r.name]=r},handle:function(r,e,n,t,a){var o=this;return r.forEach(function(s){o.processors[s]&&(e=o.processors[s].process(e,n,t,a))}),e}};function Ar(i,r){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);r&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})),e.push.apply(e,n)}return e}function B(i){for(var r=1;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Fr={},Rr=function(i){$e(e,i);var r=jn(e);function e(n){var t,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return V(this,e),t=r.call(this),$t&&ve.call(ee(t)),kn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,ee(t)),t.options=a,t.options.keySeparator===void 0&&(t.options.keySeparator="."),t.logger=oe.create("translator"),t}return K(e,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;var o=this.resolve(t,a);return o&&o.res!==void 0}},{key:"extractFromKey",value:function(t,a){var o=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");var s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ns||this.options.defaultNS||[],c=o&&t.indexOf(o)>-1,g=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!Fn(t,o,s);if(c&&!g){var l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:u};var v=t.split(o);(o!==s||o===s&&this.options.ns.indexOf(v[0])>-1)&&(u=v.shift()),t=v.join(s)}return typeof u=="string"&&(u=[u]),{key:t,namespaces:u}}},{key:"translate",value:function(t,a,o){var s=this;if(Q(a)!=="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),a||(a={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);var u=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,c=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,g=this.extractFromKey(t[t.length-1],a),l=g.key,v=g.namespaces,m=v[v.length-1],x=a.lng||this.language,h=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(x&&x.toLowerCase()==="cimode"){if(h){var f=a.nsSeparator||this.options.nsSeparator;return u?(d.res="".concat(m).concat(f).concat(l),d):"".concat(m).concat(f).concat(l)}return u?(d.res=l,d):l}var d=this.resolve(t,a),p=d&&d.res,y=d&&d.usedKey||l,w=d&&d.exactUsedKey||l,E=Object.prototype.toString.apply(p),S=["[object Number]","[object Function]","[object RegExp]"],P=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,N=typeof p!="string"&&typeof p!="boolean"&&typeof p!="number";if(C&&p&&N&&S.indexOf(E)<0&&!(typeof P=="string"&&E==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,p,B(B({},a),{},{ns:v})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return u?(d.res=W,d):W}if(c){var xe=E==="[object Array]",se=xe?[]:{},Ve=xe?w:y;for(var J in p)if(Object.prototype.hasOwnProperty.call(p,J)){var R="".concat(Ve).concat(c).concat(J);se[J]=this.translate(R,B(B({},a),{joinArrays:!1,ns:v})),se[J]===R&&(se[J]=p[J])}p=se}}else if(C&&typeof P=="string"&&E==="[object Array]")p=p.join(P),p&&(p=this.extendTranslation(p,t,a,o));else{var T=!1,q=!1,Se=a.count!==void 0&&typeof a.count!="string",I=e.hasDefaultValue(a),Ht=Se?this.pluralResolver.getSuffix(x,a.count,a):"",H=a["defaultValue".concat(Ht)]||a.defaultValue;!this.isValidLookup(p)&&I&&(T=!0,p=H),this.isValidLookup(p)||(q=!0,p=l);var Oe=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,je=Oe&&q?void 0:p,re=I&&H!==p&&this.options.updateMissing;if(q||T||re){if(this.logger.log(re?"updateKey":"missingKey",x,m,l,re?H:p),c){var Ne=this.resolve(l,B(B({},a),{},{keySeparator:!1}));Ne&&Ne.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var he=[],pe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&pe&&pe[0])for(var ge=0;ge1&&arguments[1]!==void 0?arguments[1]:{},s,u,c,g,l;return typeof t=="string"&&(t=[t]),t.forEach(function(v){if(!a.isValidLookup(s)){var m=a.extractFromKey(v,o),x=m.key;u=x;var h=m.namespaces;a.options.fallbackNS&&(h=h.concat(a.options.fallbackNS));var f=o.count!==void 0&&typeof o.count!="string",d=f&&!o.ordinal&&o.count===0&&a.pluralResolver.shouldUseIntlApi(),p=o.context!==void 0&&(typeof o.context=="string"||typeof o.context=="number")&&o.context!=="",y=o.lngs?o.lngs:a.languageUtils.toResolveHierarchy(o.lng||a.language,o.fallbackLng);h.forEach(function(w){a.isValidLookup(s)||(l=w,!Fr["".concat(y[0],"-").concat(w)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(l)&&(Fr["".concat(y[0],"-").concat(w)]=!0,a.logger.warn('key "'.concat(u,'" for languages "').concat(y.join(", "),`" won't get resolved as namespace "`).concat(l,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(function(E){if(!a.isValidLookup(s)){g=E;var S=[x];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(S,x,E,w,o);else{var P;f&&(P=a.pluralResolver.getSuffix(E,o.count,o));var C="".concat(a.options.pluralSeparator,"zero");if(f&&(S.push(x+P),d&&S.push(x+C)),p){var N="".concat(x).concat(a.options.contextSeparator).concat(o.context);S.push(N),f&&(S.push(N+P),d&&S.push(N+C))}}for(var W;W=S.pop();)a.isValidLookup(s)||(c=W,s=a.getResource(E,w,W,o))}}))})}}),{res:s,usedKey:u,exactUsedKey:c,usedLng:g,usedNS:l}}},{key:"isValidLookup",value:function(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}},{key:"getResource",value:function(t,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,a,o,s):this.resourceStore.getResource(t,a,o,s)}}],[{key:"hasDefaultValue",value:function(t){var a="defaultValue";for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&a===o.substring(0,a.length)&&t[o]!==void 0)return!0;return!1}}]),e}(ve);function nr(i){return i.charAt(0).toUpperCase()+i.slice(1)}var _n=function(){function i(r){V(this,i),this.options=r,this.supportedLngs=this.options.supportedLngs||!1,this.logger=oe.create("languageUtils")}return K(i,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var n=e.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(e){if(typeof e=="string"&&e.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],t=e.split("-");return this.options.lowerCaseLng?t=t.map(function(a){return a.toLowerCase()}):t.length===2?(t[0]=t[0].toLowerCase(),t[1]=t[1].toUpperCase(),n.indexOf(t[1].toLowerCase())>-1&&(t[1]=nr(t[1].toLowerCase()))):t.length===3&&(t[0]=t[0].toLowerCase(),t[1].length===2&&(t[1]=t[1].toUpperCase()),t[0]!=="sgn"&&t[2].length===2&&(t[2]=t[2].toUpperCase()),n.indexOf(t[1].toLowerCase())>-1&&(t[1]=nr(t[1].toLowerCase())),n.indexOf(t[2].toLowerCase())>-1&&(t[2]=nr(t[2].toLowerCase()))),t.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var n=this;if(!e)return null;var t;return e.forEach(function(a){if(!t){var o=n.formatLanguageCode(a);(!n.options.supportedLngs||n.isSupportedCode(o))&&(t=o)}}),!t&&this.options.supportedLngs&&e.forEach(function(a){if(!t){var o=n.getLanguagePartFromCode(a);if(n.isSupportedCode(o))return t=o;t=n.options.supportedLngs.find(function(s){if(s.indexOf(o)===0)return s})}}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}},{key:"getFallbackCodes",value:function(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!n)return e.default||[];var t=e[n];return t||(t=e[this.getScriptPartFromCode(n)]),t||(t=e[this.formatLanguageCode(n)]),t||(t=e[this.getLanguagePartFromCode(n)]),t||(t=e.default),t||[]}},{key:"toResolveHierarchy",value:function(e,n){var t=this,a=this.getFallbackCodes(n||this.options.fallbackLng||[],e),o=[],s=function(c){!c||(t.isSupportedCode(c)?o.push(c):t.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof e=="string"&&e.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):typeof e=="string"&&s(this.formatLanguageCode(e)),a.forEach(function(u){o.indexOf(u)<0&&s(t.formatLanguageCode(u))}),o}}]),i}(),$n=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],In={1:function(r){return Number(r>1)},2:function(r){return Number(r!=1)},3:function(r){return 0},4:function(r){return Number(r%10==1&&r%100!=11?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2)},5:function(r){return Number(r==0?0:r==1?1:r==2?2:r%100>=3&&r%100<=10?3:r%100>=11?4:5)},6:function(r){return Number(r==1?0:r>=2&&r<=4?1:2)},7:function(r){return Number(r==1?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2)},8:function(r){return Number(r==1?0:r==2?1:r!=8&&r!=11?2:3)},9:function(r){return Number(r>=2)},10:function(r){return Number(r==1?0:r==2?1:r<7?2:r<11?3:4)},11:function(r){return Number(r==1||r==11?0:r==2||r==12?1:r>2&&r<20?2:3)},12:function(r){return Number(r%10!=1||r%100==11)},13:function(r){return Number(r!==0)},14:function(r){return Number(r==1?0:r==2?1:r==3?2:3)},15:function(r){return Number(r%10==1&&r%100!=11?0:r%10>=2&&(r%100<10||r%100>=20)?1:2)},16:function(r){return Number(r%10==1&&r%100!=11?0:r!==0?1:2)},17:function(r){return Number(r==1||r%10==1&&r%100!=11?0:1)},18:function(r){return Number(r==0?0:r==1?1:2)},19:function(r){return Number(r==1?0:r==0||r%100>1&&r%100<11?1:r%100>10&&r%100<20?2:3)},20:function(r){return Number(r==1?0:r==0||r%100>0&&r%100<20?1:2)},21:function(r){return Number(r%100==1?1:r%100==2?2:r%100==3||r%100==4?3:0)},22:function(r){return Number(r==1?0:r==2?1:(r<0||r>10)&&r%10==0?2:3)}},Un=["v1","v2","v3"],Dr={zero:0,one:1,two:2,few:3,many:4,other:5};function Bn(){var i={};return $n.forEach(function(r){r.lngs.forEach(function(e){i[e]={numbers:r.nr,plurals:In[r.fc]}})}),i}var Mn=function(){function i(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};V(this,i),this.languageUtils=r,this.options=e,this.logger=oe.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Bn()}return K(i,[{key:"addRule",value:function(e,n){this.rules[e]=n}},{key:"getRule",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=this.getRule(e,n);return this.shouldUseIntlApi()?t&&t.resolvedOptions().pluralCategories.length>1:t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,t).map(function(a){return"".concat(n).concat(a)})}},{key:"getSuffixes",value:function(e){var n=this,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.getRule(e,t);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort(function(o,s){return Dr[o]-Dr[s]}).map(function(o){return"".concat(n.options.prepend).concat(o)}):a.numbers.map(function(o){return n.getSuffix(e,o,t)}):[]}},{key:"getSuffix",value:function(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this.getRule(e,t);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(n)):this.getSuffixRetroCompatible(a,n):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,n){var t=this,a=e.noAbs?e.plurals(n):e.plurals(Math.abs(n)),o=e.numbers[a];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));var s=function(){return t.options.prepend&&o.toString()?t.options.prepend+o.toString():o.toString()};return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?"_plural_".concat(o.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?s():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!Un.includes(this.options.compatibilityJSON)}}]),i}();function Tr(i,r){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);r&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})),e.push.apply(e,n)}return e}function te(i){for(var r=1;r0&&arguments[0]!==void 0?arguments[0]:{};V(this,i),this.logger=oe.create("interpolator"),this.options=r,this.format=r.interpolation&&r.interpolation.format||function(e){return e},this.init(r)}return K(i,[{key:"init",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var n=e.interpolation;this.escape=n.escape!==void 0?n.escape:Cn,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?Ie(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?Ie(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?Ie(n.nestingPrefix):n.nestingPrefixEscaped||Ie("$t("),this.nestingSuffix=n.nestingSuffix?Ie(n.nestingSuffix):n.nestingSuffixEscaped||Ie(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(n,"g");var t="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(t,"g")}},{key:"interpolate",value:function(e,n,t,a){var o=this,s,u,c,g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(f){return f.replace(/\$/g,"$$$$")}var v=function(d){if(d.indexOf(o.formatSeparator)<0){var p=Pr(n,g,d);return o.alwaysFormat?o.format(p,void 0,t,te(te(te({},a),n),{},{interpolationkey:d})):p}var y=d.split(o.formatSeparator),w=y.shift().trim(),E=y.join(o.formatSeparator).trim();return o.format(Pr(n,g,w),E,t,te(te(te({},a),n),{},{interpolationkey:w}))};this.resetRegExp();var m=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,x=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,h=[{regex:this.regexpUnescape,safeValue:function(d){return l(d)}},{regex:this.regexp,safeValue:function(d){return o.escapeValue?l(o.escape(d)):l(d)}}];return h.forEach(function(f){for(c=0;s=f.regex.exec(e);){var d=s[1].trim();if(u=v(d),u===void 0)if(typeof m=="function"){var p=m(e,s,a);u=typeof p=="string"?p:""}else if(a&&a.hasOwnProperty(d))u="";else if(x){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(d," for interpolating ").concat(e)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=kr(u));var y=f.safeValue(u);if(e=e.replace(s[0],y),x?(f.regex.lastIndex+=u.length,f.regex.lastIndex-=s[0].length):f.regex.lastIndex=0,c++,c>=o.maxReplaces)break}}),e}},{key:"nest",value:function(e,n){var t=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,u=te({},a);u.applyPostProcessor=!1,delete u.defaultValue;function c(m,x){var h=this.nestingOptionsSeparator;if(m.indexOf(h)<0)return m;var f=m.split(new RegExp("".concat(h,"[ ]*{"))),d="{".concat(f[1]);m=f[0],d=this.interpolate(d,u),d=d.replace(/'/g,'"');try{u=JSON.parse(d),x&&(u=te(te({},x),u))}catch(p){return this.logger.warn("failed parsing options string in nesting for key ".concat(m),p),"".concat(m).concat(h).concat(d)}return delete u.defaultValue,m}for(;o=this.nestingRegexp.exec(e);){var g=[],l=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){var v=o[1].split(this.formatSeparator).map(function(m){return m.trim()});o[1]=v.shift(),g=v,l=!0}if(s=n(c.call(this,o[1].trim(),u),u),s&&o[0]===e&&typeof s!="string")return s;typeof s!="string"&&(s=kr(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(e)),s=""),l&&(s=g.reduce(function(m,x){return t.format(m,x,a.lng,te(te({},a),{},{interpolationkey:o[1].trim()}))},s.trim())),e=e.replace(o[0],s),this.regexp.lastIndex=0}return e}}]),i}();function jr(i,r){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);r&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})),e.push.apply(e,n)}return e}function me(i){for(var r=1;r-1){var n=i.split("(");r=n[0].toLowerCase().trim();var t=n[1].substring(0,n[1].length-1);if(r==="currency"&&t.indexOf(":")<0)e.currency||(e.currency=t.trim());else if(r==="relativetime"&&t.indexOf(":")<0)e.range||(e.range=t.trim());else{var a=t.split(";");a.forEach(function(o){if(!!o){var s=o.split(":"),u=rr(s),c=u[0],g=u.slice(1),l=g.join(":").trim().replace(/^'+|'+$/g,"");e[c.trim()]||(e[c.trim()]=l),l==="false"&&(e[c.trim()]=!1),l==="true"&&(e[c.trim()]=!0),isNaN(l)||(e[c.trim()]=parseInt(l,10))}})}}return{formatName:r,formatOptions:e}}var zn=function(){function i(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};V(this,i),this.logger=oe.create("formatter"),this.options=r,this.formats={number:function(n,t,a){return new Intl.NumberFormat(t,a).format(n)},currency:function(n,t,a){return new Intl.NumberFormat(t,me(me({},a),{},{style:"currency"})).format(n)},datetime:function(n,t,a){return new Intl.DateTimeFormat(t,me({},a)).format(n)},relativetime:function(n,t,a){return new Intl.RelativeTimeFormat(t,me({},a)).format(n,a.range||"day")},list:function(n,t,a){return new Intl.ListFormat(t,me({},a)).format(n)}},this.init(r)}return K(i,[{key:"init",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},t=n.interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}},{key:"add",value:function(e,n){this.formats[e.toLowerCase().trim()]=n}},{key:"format",value:function(e,n,t,a){var o=this,s=n.split(this.formatSeparator),u=s.reduce(function(c,g){var l=Hn(g),v=l.formatName,m=l.formatOptions;if(o.formats[v]){var x=c;try{var h=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},f=h.locale||h.lng||a.locale||a.lng||t;x=o.formats[v](c,f,me(me(me({},m),a),h))}catch(d){o.logger.warn(d)}return x}else o.logger.warn("there was no format function for ".concat(v));return c},e);return u}}]),i}();function Nr(i,r){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);r&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})),e.push.apply(e,n)}return e}function _r(i){for(var r=1;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Wn(i,r){i.pending[r]!==void 0&&(delete i.pending[r],i.pendingCount--)}var Jn=function(i){$e(e,i);var r=Vn(e);function e(n,t,a){var o,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return V(this,e),o=r.call(this),$t&&ve.call(ee(o)),o.backend=n,o.store=t,o.services=a,o.languageUtils=a.languageUtils,o.options=s,o.logger=oe.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(a,s.backend,s),o}return K(e,[{key:"queueLoad",value:function(t,a,o,s){var u=this,c={},g={},l={},v={};return t.forEach(function(m){var x=!0;a.forEach(function(h){var f="".concat(m,"|").concat(h);!o.reload&&u.store.hasResourceBundle(m,h)?u.state[f]=2:u.state[f]<0||(u.state[f]===1?g[f]===void 0&&(g[f]=!0):(u.state[f]=1,x=!1,g[f]===void 0&&(g[f]=!0),c[f]===void 0&&(c[f]=!0),v[h]===void 0&&(v[h]=!0)))}),x||(l[m]=!0)}),(Object.keys(c).length||Object.keys(g).length)&&this.queue.push({pending:g,pendingCount:Object.keys(g).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(c),pending:Object.keys(g),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(v)}}},{key:"loaded",value:function(t,a,o){var s=t.split("|"),u=s[0],c=s[1];a&&this.emit("failedLoading",u,c,a),o&&this.store.addResourceBundle(u,c,o),this.state[t]=a?-1:2;var g={};this.queue.forEach(function(l){Ln(l.loaded,[u],c),Wn(l,t),a&&l.errors.push(a),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(function(v){g[v]||(g[v]={});var m=l.loaded[v];m.length&&m.forEach(function(x){g[v][x]===void 0&&(g[v][x]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",g),this.queue=this.queue.filter(function(l){return!l.done})}},{key:"read",value:function(t,a,o){var s=this,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,g=arguments.length>5?arguments[5]:void 0;if(!t.length)return g(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:a,fcName:o,tried:u,wait:c,callback:g});return}return this.readingCalls++,this.backend[o](t,a,function(l,v){if(s.readingCalls--,s.waitingReads.length>0){var m=s.waitingReads.shift();s.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(l&&v&&u2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof a=="string"&&(a=[a]);var c=this.queueLoad(t,a,s,u);if(!c.toLoad.length)return c.pending.length||u(),null;c.toLoad.forEach(function(g){o.loadOne(g)})}},{key:"load",value:function(t,a,o){this.prepareLoading(t,a,{},o)}},{key:"reload",value:function(t,a,o){this.prepareLoading(t,a,{reload:!0},o)}},{key:"loadOne",value:function(t){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=t.split("|"),u=s[0],c=s[1];this.read(u,c,"read",void 0,void 0,function(g,l){g&&a.logger.warn("".concat(o,"loading namespace ").concat(c," for language ").concat(u," failed"),g),!g&&l&&a.logger.log("".concat(o,"loaded namespace ").concat(c," for language ").concat(u),l),a.loaded(t,g,l)})}},{key:"saveMissing",value:function(t,a,o,s,u){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(a)){this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}o==null||o===""||(this.backend&&this.backend.create&&this.backend.create(t,a,o,s,null,_r(_r({},c),{},{isUpdate:u})),!(!t||!t[0])&&this.store.addResource(t[0],a,o,s))}}]),e}(ve);function Gn(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(r){var e={};if(Q(r[1])==="object"&&(e=r[1]),typeof r[1]=="string"&&(e.defaultValue=r[1]),typeof r[2]=="string"&&(e.tDescription=r[2]),Q(r[2])==="object"||Q(r[3])==="object"){var n=r[3]||r[2];Object.keys(n).forEach(function(t){e[t]=n[t]})}return e},interpolation:{escapeValue:!0,format:function(r,e,n,t){return r},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function $r(i){return typeof i.ns=="string"&&(i.ns=[i.ns]),typeof i.fallbackLng=="string"&&(i.fallbackLng=[i.fallbackLng]),typeof i.fallbackNS=="string"&&(i.fallbackNS=[i.fallbackNS]),i.supportedLngs&&i.supportedLngs.indexOf("cimode")<0&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),i}function Ir(i,r){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);r&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})),e.push.apply(e,n)}return e}function ae(i){for(var r=1;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jt(){}function Xn(i){var r=Object.getOwnPropertyNames(Object.getPrototypeOf(i));r.forEach(function(e){typeof i[e]=="function"&&(i[e]=i[e].bind(i))})}var _t=function(i){$e(e,i);var r=Yn(e);function e(){var n,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(V(this,e),n=r.call(this),$t&&ve.call(ee(n)),n.options=$r(t),n.services={},n.logger=oe,n.modules={external:[]},Xn(ee(n)),a&&!n.isInitialized&&!t.isClone){if(!n.options.initImmediate)return n.init(t,a),Ce(n,ee(n));setTimeout(function(){n.init(t,a)},0)}return n}return K(e,[{key:"init",value:function(){var t=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;typeof a=="function"&&(o=a,a={}),!a.defaultNS&&a.defaultNS!==!1&&a.ns&&(typeof a.ns=="string"?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));var s=Gn();this.options=ae(ae(ae({},s),this.options),$r(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=ae(ae({},s.interpolation),this.options.interpolation)),a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator);function u(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?oe.init(u(this.modules.logger),this.options):oe.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=zn);var g=new _n(this.options);this.store=new Tn(this.options.resources,this.options);var l=this.services;l.logger=oe,l.resourceStore=this.store,l.languageUtils=g,l.pluralResolver=new Mn(g,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(l.formatter=u(c),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new qn(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Jn(u(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(d){for(var p=arguments.length,y=new Array(p>1?p-1:0),w=1;w1?p-1:0),w=1;w0&&v[0]!=="dev"&&(this.options.lng=v[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var m=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];m.forEach(function(d){t[d]=function(){var p;return(p=t.store)[d].apply(p,arguments)}});var x=["addResource","addResources","addResourceBundle","removeResourceBundle"];x.forEach(function(d){t[d]=function(){var p;return(p=t.store)[d].apply(p,arguments),t}});var h=Ye(),f=function(){var p=function(w,E){t.isInitialized&&!t.initializedStoreOnce&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),h.resolve(E),o(w,E)};if(t.languages&&t.options.compatibilityAPI!=="v1"&&!t.isInitialized)return p(null,t.t.bind(t));t.changeLanguage(t.options.lng,p)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),h}},{key:"loadResources",value:function(t){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jt,s=o,u=typeof t=="string"?t:this.language;if(typeof t=="function"&&(s=t),!this.options.resources||this.options.partialBundledLanguages){if(u&&u.toLowerCase()==="cimode")return s();var c=[],g=function(m){if(!!m){var x=a.services.languageUtils.toResolveHierarchy(m);x.forEach(function(h){c.indexOf(h)<0&&c.push(h)})}};if(u)g(u);else{var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.forEach(function(v){return g(v)})}this.options.preload&&this.options.preload.forEach(function(v){return g(v)}),this.services.backendConnector.load(c,this.options.ns,function(v){!v&&!a.resolvedLanguage&&a.language&&a.setResolvedLanguage(a.language),s(v)})}else s(null)}},{key:"reloadResources",value:function(t,a,o){var s=Ye();return t||(t=this.languages),a||(a=this.options.ns),o||(o=jt),this.services.backendConnector.reload(t,a,function(u){s.resolve(),o(u)}),s}},{key:"use",value:function(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Mr.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}},{key:"setResolvedLanguage",value:function(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(var a=0;a-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}}},{key:"changeLanguage",value:function(t,a){var o=this;this.isLanguageChangingTo=t;var s=Ye();this.emit("languageChanging",t);var u=function(v){o.language=v,o.languages=o.services.languageUtils.toResolveHierarchy(v),o.resolvedLanguage=void 0,o.setResolvedLanguage(v)},c=function(v,m){m?(u(m),o.translator.changeLanguage(m),o.isLanguageChangingTo=void 0,o.emit("languageChanged",m),o.logger.log("languageChanged",m)):o.isLanguageChangingTo=void 0,s.resolve(function(){return o.t.apply(o,arguments)}),a&&a(v,function(){return o.t.apply(o,arguments)})},g=function(v){!t&&!v&&o.services.languageDetector&&(v=[]);var m=typeof v=="string"?v:o.services.languageUtils.getBestMatchFromCodes(v);m&&(o.language||u(m),o.translator.language||o.translator.changeLanguage(m),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage(m)),o.loadResources(m,function(x){c(x,m)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?g(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(g):g(t),s}},{key:"getFixedT",value:function(t,a,o){var s=this,u=function c(g,l){var v;if(Q(l)!=="object"){for(var m=arguments.length,x=new Array(m>2?m-2:0),h=2;h1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],u=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var g=function(m,x){var h=a.services.backendConnector.state["".concat(m,"|").concat(x)];return h===-1||h===2};if(o.precheck){var l=o.precheck(this,g);if(l!==void 0)return l}return!!(this.hasResourceBundle(s,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||g(s,t)&&(!u||g(c,t)))}},{key:"loadNamespaces",value:function(t,a){var o=this,s=Ye();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(function(u){o.options.ns.indexOf(u)<0&&o.options.ns.push(u)}),this.loadResources(function(u){s.resolve(),a&&a(u)}),s):(a&&a(),Promise.resolve())}},{key:"loadLanguages",value:function(t,a){var o=Ye();typeof t=="string"&&(t=[t]);var s=this.options.preload||[],u=t.filter(function(c){return s.indexOf(c)<0});return u.length?(this.options.preload=s.concat(u),this.loadResources(function(c){o.resolve(),a&&a(c)}),o):(a&&a(),Promise.resolve())}},{key:"dir",value:function(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";var a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return a.indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var t=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jt,s=ae(ae(ae({},this.options),a),{isClone:!0}),u=new e(s),c=["store","services","language"];return c.forEach(function(g){u[g]=t[g]}),u.services=ae({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new Rr(u.services,u.options),u.translator.on("*",function(g){for(var l=arguments.length,v=new Array(l>1?l-1:0),m=1;m0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new _t(i,r)});var M=_t.createInstance();M.createInstance=_t.createInstance;var da=M.createInstance,ha=M.init,pa=M.loadResources,ga=M.reloadResources,ma=M.use,va=M.changeLanguage,ya=M.getFixedT,ba=M.t,wa=M.exists,xa=M.setDefaultNamespace,Sa=M.hasLoadedNamespace,Oa=M.loadNamespaces,Ea=M.loadLanguages,A=M;var Qn=i=>i.replace(/^\/+|\/+$/g,""),ei=(...i)=>`/${i.map(Qn).filter(r=>r).join("/")}`,$=ei;var It,j,Xe,Ze=class extends X{constructor(e,n=btoa){super(`
      • - ${e.title} + `)),E=g.querySelector(".basicLightbox__placeholder");l.forEach(function(p){return E.appendChild(p)});var d=r(E,"IMG"),c=r(E,"VIDEO"),f=r(E,"IFRAME");return d===!0&&g.classList.add("basicLightbox--img"),c===!0&&g.classList.add("basicLightbox--video"),f===!0&&g.classList.add("basicLightbox--iframe"),g}(o=function(l){var m=typeof l=="string",g=l instanceof HTMLElement==1;if(m===!1&&g===!1)throw new Error("Content must be a DOM element/node or string");return m===!0?Array.from(n(l,!0)):l.tagName==="TEMPLATE"?[l.content.cloneNode(!0)]:Array.from(l.children)}(o),s=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if((l=Object.assign({},l)).closable==null&&(l.closable=!0),l.className==null&&(l.className=""),l.onShow==null&&(l.onShow=function(){}),l.onClose==null&&(l.onClose=function(){}),typeof l.closable!="boolean")throw new Error("Property `closable` must be a boolean");if(typeof l.className!="string")throw new Error("Property `className` must be a string");if(typeof l.onShow!="function")throw new Error("Property `onShow` must be a function");if(typeof l.onClose!="function")throw new Error("Property `onClose` must be a function");return l}(s)),v=function(l){return s.onClose(y)!==!1&&function(m,g){return m.classList.remove("basicLightbox--visible"),setTimeout(function(){return a(m)===!1||m.parentElement.removeChild(m),g()},410),!0}(u,function(){if(typeof l=="function")return l(y)})};s.closable===!0&&u.addEventListener("click",function(l){l.target===u&&v()});var y={element:function(){return u},visible:function(){return a(u)},show:function(l){return s.onShow(y)!==!1&&function(m,g){return document.body.appendChild(m),setTimeout(function(){requestAnimationFrame(function(){return m.classList.add("basicLightbox--visible"),g()})},10),!0}(u,function(){if(typeof l=="function")return l(y)})},close:v};return y}},{}]},{},[1])(1)})});var Jn=xe((Us,dr)=>{var Ga=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var P=function(i){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,e=0,n={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function d(c){return c instanceof a?new a(c.type,d(c.content),c.alias):Array.isArray(c)?c.map(d):c.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(p){var d=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(p.stack)||[])[1];if(d){var c=document.getElementsByTagName("script");for(var f in c)if(c[f].src==d)return c[f]}return null}},isActive:function(d,c,f){for(var p="no-"+c;d;){var b=d.classList;if(b.contains(c))return!0;if(b.contains(p))return!1;d=d.parentElement}return!!f}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(d,c){var f=r.util.clone(r.languages[d]);for(var p in c)f[p]=c[p];return f},insertBefore:function(d,c,f,p){p=p||r.languages;var b=p[d],w={};for(var O in b)if(b.hasOwnProperty(O)){if(O==c)for(var S in f)f.hasOwnProperty(S)&&(w[S]=f[S]);f.hasOwnProperty(O)||(w[O]=b[O])}var A=p[d];return p[d]=w,r.languages.DFS(r.languages,function(R,D){D===A&&R!=d&&(this[R]=w)}),w},DFS:function d(c,f,p,b){b=b||{};var w=r.util.objId;for(var O in c)if(c.hasOwnProperty(O)){f.call(c,O,c[O],p||O);var S=c[O],A=r.util.type(S);A==="Object"&&!b[w(S)]?(b[w(S)]=!0,d(S,f,null,b)):A==="Array"&&!b[w(S)]&&(b[w(S)]=!0,d(S,f,O,b))}}},plugins:{},highlightAll:function(d,c){r.highlightAllUnder(document,d,c)},highlightAllUnder:function(d,c,f){var p={callback:f,container:d,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",p),p.elements=Array.prototype.slice.apply(p.container.querySelectorAll(p.selector)),r.hooks.run("before-all-elements-highlight",p);for(var b=0,w;w=p.elements[b++];)r.highlightElement(w,c===!0,p.callback)},highlightElement:function(d,c,f){var p=r.util.getLanguage(d),b=r.languages[p];r.util.setLanguage(d,p);var w=d.parentElement;w&&w.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(w,p);var O=d.textContent,S={element:d,language:p,grammar:b,code:O};function A(D){S.highlightedCode=D,r.hooks.run("before-insert",S),S.element.innerHTML=S.highlightedCode,r.hooks.run("after-highlight",S),r.hooks.run("complete",S),f&&f.call(S.element)}if(r.hooks.run("before-sanity-check",S),w=S.element.parentElement,w&&w.nodeName.toLowerCase()==="pre"&&!w.hasAttribute("tabindex")&&w.setAttribute("tabindex","0"),!S.code){r.hooks.run("complete",S),f&&f.call(S.element);return}if(r.hooks.run("before-highlight",S),!S.grammar){A(r.util.encode(S.code));return}if(c&&i.Worker){var R=new Worker(r.filename);R.onmessage=function(D){A(D.data)},R.postMessage(JSON.stringify({language:S.language,code:S.code,immediateClose:!0}))}else A(r.highlight(S.code,S.grammar,S.language))},highlight:function(d,c,f){var p={code:d,grammar:c,language:f};if(r.hooks.run("before-tokenize",p),!p.grammar)throw new Error('The language "'+p.language+'" has no grammar.');return p.tokens=r.tokenize(p.code,p.grammar),r.hooks.run("after-tokenize",p),a.stringify(r.util.encode(p.tokens),p.language)},tokenize:function(d,c){var f=c.rest;if(f){for(var p in f)c[p]=f[p];delete c.rest}var b=new u;return v(b,b.head,d),s(d,b,c,b.head,0),l(b)},hooks:{all:{},add:function(d,c){var f=r.hooks.all;f[d]=f[d]||[],f[d].push(c)},run:function(d,c){var f=r.hooks.all[d];if(!(!f||!f.length))for(var p=0,b;b=f[p++];)b(c)}},Token:a};i.Prism=r;function a(d,c,f,p){this.type=d,this.content=c,this.alias=f,this.length=(p||"").length|0}a.stringify=function d(c,f){if(typeof c=="string")return c;if(Array.isArray(c)){var p="";return c.forEach(function(A){p+=d(A,f)}),p}var b={type:c.type,content:d(c.content,f),tag:"span",classes:["token",c.type],attributes:{},language:f},w=c.alias;w&&(Array.isArray(w)?Array.prototype.push.apply(b.classes,w):b.classes.push(w)),r.hooks.run("wrap",b);var O="";for(var S in b.attributes)O+=" "+S+'="'+(b.attributes[S]||"").replace(/"/g,""")+'"';return"<"+b.tag+' class="'+b.classes.join(" ")+'"'+O+">"+b.content+""};function o(d,c,f,p){d.lastIndex=c;var b=d.exec(f);if(b&&p&&b[1]){var w=b[1].length;b.index+=w,b[0]=b[0].slice(w)}return b}function s(d,c,f,p,b,w){for(var O in f)if(!(!f.hasOwnProperty(O)||!f[O])){var S=f[O];S=Array.isArray(S)?S:[S];for(var A=0;A=w.reach);H+=$.value.length,$=$.next){var ee=$.value;if(c.length>d.length)return;if(!(ee instanceof a)){var je=1,K;if(be){if(K=o(N,H,d,X),!K||K.index>=d.length)break;var We=K.index,gr=K.index+K[0].length,z=H;for(z+=$.value.length;We>=z;)$=$.next,z+=$.value.length;if(z-=$.value.length,H=z,$.value instanceof a)continue;for(var Ne=$;Ne!==c.tail&&(zw.reach&&(w.reach=Ee);var Se=$.prev;Ge&&(Se=v(c,Se,Ge),H+=Ge.length),y(c,Se,je);var Bt=new a(O,D?r.tokenize(le,D):le,U,le);if($=v(c,Se,Bt),we&&v(c,$,we),je>1){var $e={cause:O+","+A,reach:Ee};s(d,c,f,$.prev,H,$e),w&&$e.reach>w.reach&&(w.reach=$e.reach)}}}}}}function u(){var d={value:null,prev:null,next:null},c={value:null,prev:d,next:null};d.next=c,this.head=d,this.tail=c,this.length=0}function v(d,c,f){var p=c.next,b={value:f,prev:c,next:p};return c.next=b,p.prev=b,d.length++,b}function y(d,c,f){for(var p=c.next,b=0;b/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};P.languages.markup.tag.inside["attr-value"].inside.entity=P.languages.markup.entity;P.languages.markup.doctype.inside["internal-subset"].inside=P.languages.markup;P.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))});Object.defineProperty(P.languages.markup.tag,"addInlined",{value:function(t,e){var n={};n["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:P.languages[e]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+e]={pattern:/[\s\S]+/,inside:P.languages[e]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:r},P.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(P.languages.markup.tag,"addAttribute",{value:function(i,t){P.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:P.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});P.languages.html=P.languages.markup;P.languages.mathml=P.languages.markup;P.languages.svg=P.languages.markup;P.languages.xml=P.languages.extend("markup",{});P.languages.ssml=P.languages.xml;P.languages.atom=P.languages.xml;P.languages.rss=P.languages.xml;(function(i){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var e=i.languages.markup;e&&(e.tag.addInlined("style","css"),e.tag.addAttribute("style","css"))})(P);P.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};P.languages.javascript=P.languages.extend("clike",{"class-name":[P.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});P.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;P.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:P.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:P.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:P.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:P.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:P.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});P.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:P.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});P.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});P.languages.markup&&(P.languages.markup.tag.addInlined("script","javascript"),P.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));P.languages.js=P.languages.javascript;(function(){if(typeof P>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading\u2026",t=function(m,g){return"\u2716 Error "+m+" while fetching file: "+g},e="\u2716 Error: File does not exist or is empty",n={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",o="loaded",s="failed",u="pre[data-src]:not(["+r+'="'+o+'"]):not(['+r+'="'+a+'"])';function v(m,g,E){var d=new XMLHttpRequest;d.open("GET",m,!0),d.onreadystatechange=function(){d.readyState==4&&(d.status<400&&d.responseText?g(d.responseText):d.status>=400?E(t(d.status,d.statusText)):E(e))},d.send(null)}function y(m){var g=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(g){var E=Number(g[1]),d=g[2],c=g[3];return d?c?[E,Number(c)]:[E,void 0]:[E,E]}}P.hooks.add("before-highlightall",function(m){m.selector+=", "+u}),P.hooks.add("before-sanity-check",function(m){var g=m.element;if(g.matches(u)){m.code="",g.setAttribute(r,a);var E=g.appendChild(document.createElement("CODE"));E.textContent=i;var d=g.getAttribute("data-src"),c=m.language;if(c==="none"){var f=(/\.(\w+)$/.exec(d)||[,"none"])[1];c=n[f]||f}P.util.setLanguage(E,c),P.util.setLanguage(g,c);var p=P.plugins.autoloader;p&&p.loadLanguages(c),v(d,function(b){g.setAttribute(r,o);var w=y(g.getAttribute("data-range"));if(w){var O=b.split(/\r\n?|\n/g),S=w[0],A=w[1]==null?O.length:w[1];S<0&&(S+=O.length),S=Math.max(0,Math.min(S-1,O.length)),A<0&&(A+=O.length),A=Math.max(0,Math.min(A,O.length)),b=O.slice(S,A).join(` +`),g.hasAttribute("data-start")||g.setAttribute("data-start",String(S+1))}E.textContent=b,P.highlightElement(E)},function(b){g.setAttribute(r,s),E.textContent=b})}}),P.plugins.fileHighlight={highlight:function(g){for(var E=(g||document).querySelectorAll(u),d=0,c;c=E[d++];)P.highlightElement(c)}};var l=!1;P.fileHighlight=function(){l||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),l=!0),P.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var Zt=Y(Ce()),gt=class extends Zt.default{constructor(){let t="
        ";super((0,Zt.s)(t))}};var br=class{#e={};on(t,e){t in this.#e||(this.#e[t]=[]),this.#e[t].push(e)}once(t,e){let n=(...r)=>{e(...r),this.off(t,n)};this.on(t,n)}off(t,e){if(!(t in this.#e))return;let n=this.#e[t].indexOf(e);n!==-1&&this.#e[t].splice(n,1)}emit(t,...e){t in this.#e&&this.#e[t].forEach(n=>n(...e))}},Xe=br;var $i=i=>i.replace(/^\/+|\/+$/g,""),Mi=(...i)=>`/${i.map($i).filter(t=>t).join("/")}`,B=Mi;var _i=i=>i.endsWith("/")?i:`${i}/`,Pe=_i;var mt,et,tt,rt,Oe,vt,yt,me,nt,it,bt,at,ke,Ae,wr=class extends Xe{constructor({directory:e=!1,fullPath:n,title:r="",modified:a,size:o=0,mimeType:s="",del:u=!0,rename:v=!0,placeholder:y=!1,collection:l=null}){super();x(this,mt,void 0);x(this,et,void 0);x(this,tt,void 0);x(this,rt,void 0);x(this,Oe,void 0);x(this,vt,void 0);x(this,yt,void 0);x(this,me,void 0);x(this,nt,void 0);x(this,it,void 0);x(this,bt,void 0);x(this,at,void 0);x(this,ke,void 0);x(this,Ae,void 0);let[m,g]=this.getFilename(n),E=new Date;E.setTime(a),C(this,nt,m),C(this,me,g),C(this,et,e),C(this,Oe,n),C(this,ke,r),C(this,yt,E),C(this,at,o),C(this,vt,s),C(this,mt,u),C(this,bt,v),C(this,it,y),this.collection=l}createParentEntry(){return this.update({fullPath:Pe(this.path),title:"←",del:!1,rename:!1})}getFilename(e){let n=B(e).split(/\//),r=n.pop();return[B(...n),r]}update(e={}){let n=new wr(Me({directory:this.directory,fullPath:this.fullPath,modified:this.modified.getTime(),size:this.size,mimeType:this.mimeType,del:this.del,rename:this.rename,collection:this.collection},e));return this.emit("replaced",n),n}get del(){return h(this,mt)}get directory(){return h(this,et)}get displaySize(){return h(this,et)?"":(h(this,tt)||C(this,tt,["bytes","KiB","MiB","GiB","TiB","PiB"].reduce((e,n)=>typeof e=="string"?e:e<1024?`${e.toFixed(2*(n==="bytes"?0:1))} ${n}`:e/1024,h(this,at))),h(this,tt))}get extension(){return this.directory?"":(h(this,rt)||C(this,rt,this.name.split(".").pop()),h(this,rt))}get fullPath(){return h(this,Oe)}get mimeType(){return h(this,vt)}get modified(){return h(this,yt)}get name(){return h(this,me)}set name(e){C(this,me,encodeURIComponent(e)),C(this,ke,null),C(this,Ae,null),C(this,Oe,B(h(this,nt),h(this,me))),this.directory&&C(this,Oe,Pe(h(this,Oe))),this.title,this.type,this.emit("updated")}get path(){return h(this,nt)}get placeholder(){return h(this,it)}set placeholder(e){C(this,it,e)}get rename(){return h(this,bt)}get size(){return h(this,at)}get title(){return h(this,ke)||C(this,ke,decodeURIComponent(h(this,me))),h(this,ke)}get type(){if(!h(this,Ae)){let e={text:/\.(?:te?xt|i?nfo|php|cgi|faq|ini|htaccess|log|md|sql|sfv|conf|sh|pl|pm|py|rb|(?:s?c|sa)ss|js|java|coffee|[sx]?html?|xml)$/i,image:/\.(?:jpe?g|gif|a?png|svg)$/i,video:/\.(?:mp(?:e?g)?4|mov|avi|webm|ogv|mkv)$/i,audio:/\.(?:mp3|wav|ogg|flac|mka)$/i,font:/\.(?:woff2?|eot|[ot]tf)$/i,pdf:/\.pdf$/i};for(let[n,r]of Object.entries(e))if(h(this,me).match(r))return C(this,Ae,n);C(this,Ae,"unknown")}return h(this,Ae)}},ve=wr;mt=new WeakMap,et=new WeakMap,tt=new WeakMap,rt=new WeakMap,Oe=new WeakMap,vt=new WeakMap,yt=new WeakMap,me=new WeakMap,nt=new WeakMap,it=new WeakMap,bt=new WeakMap,at=new WeakMap,ke=new WeakMap,Ae=new WeakMap;var Et,Q,St,xt,Qt,Xt,wt=class extends Xe{constructor(e,{sortDirectoriesFirst:n=!1}={}){super();x(this,Et,void 0);x(this,Q,void 0);x(this,St,void 0);x(this,xt,()=>{h(this,Q).sort((e,n)=>h(this,St)&&h(this,Xt).call(this,e,n)||h(this,Qt).call(this,e,n))});x(this,Qt,(e,n)=>e.fullPath(n.directory?1:0)-(e.directory?1:0));C(this,St,n),C(this,Q,e.map(a=>new ve(Wt(Me({},a),{collection:this}))));let r=h(this,Q).shift();C(this,Et,B(r.fullPath)),r.fullPath!=="/"&&h(this,Q).unshift(r.createParentEntry()),h(this,xt).call(this)}add(e){e.collection=this,h(this,Q).push(e),h(this,xt).call(this),this.emit("updated")}filter(e){return h(this,Q).filter(e)}forEach(e){h(this,Q).forEach(e)}map(e){return h(this,Q).map(e)}path(){return h(this,Et)}remove(e){C(this,Q,h(this,Q).filter(n=>n!==e)),this.emit("updated")}};Et=new WeakMap,Q=new WeakMap,St=new WeakMap,xt=new WeakMap,Qt=new WeakMap,Xt=new WeakMap;var un=(i,t)=>i.getElementsByTagName(t)[0],ot=(i,t)=>{let e=un(i,t);return e?e.textContent:""},st,Ct,er,Er=class{constructor(t,e=new DOMParser){x(this,st,void 0);x(this,Ct,void 0);x(this,er,void 0);C(this,er,e),C(this,Ct,e.parseFromString(t,"application/xml"))}collection({sortDirectoriesFirst:t=!1}={}){return h(this,st)||C(this,st,new wt(this.responseToPrimitives(h(this,Ct).getElementsByTagName("D:response")),{sortDirectoriesFirst:t})),h(this,st)}responseToPrimitives(t){return Array.from(t).map(e=>({directory:!!un(e,"D:collection"),fullPath:ot(e,"D:href"),modified:Date.parse(ot(e,"lp1:getlastmodified")||ot(e,"D:getlastmodified")),size:parseInt(ot(e,"lp1:getcontentlength")||ot(e,"D:getcontentlength"),10),mimeType:ot(e,"D:getcontenttype")}))}};st=new WeakMap,Ct=new WeakMap,er=new WeakMap;var ln=Er;var _e,Ie,Sr=class extends Error{constructor(e,n){super("Request failure");x(this,_e,void 0);x(this,Ie,void 0);C(this,_e,e),C(this,Ie,n)}request(){return h(this,_e)}response(){return h(this,Ie)}method(){return h(this,_e).method}url(){return h(this,_e).url}statusText(){return h(this,Ie).statusText}status(){return h(this,Ie).status}};_e=new WeakMap,Ie=new WeakMap;var tr=Sr;var Ii={PROPFIND:{headers:{Depth:"1"}}},Le=(i,t,e)=>T(void 0,null,function*(){let n=new Request(t,Wt(Me(Me({},Ii[i]||{}),e),{method:i})),r=yield fetch(n);if(!r.ok)throw new tr(n,r);return r}),xr=class{GET(t,e={}){return Le("GET",t,e)}HEAD(t,e={}){return Le("HEAD",t,e)}PUT(t,e={}){return Le("PUT",t,e)}PROPFIND(t,e={}){return Le("PROPFIND",t,e)}DELETE(t,e={}){return Le("DELETE",t,e)}MKCOL(t,e={}){return Le("MKCOL",t,e)}COPY(t,e={}){return Le("COPY",t,e)}MOVE(t,e={}){return Le("MOVE",t,e)}},cn=xr;var Mn=Y(kt());function ie(i){return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(i)}function W(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function mn(i,t){for(var e=0;ei.length)&&(t=i.length);for(var e=0,n=new Array(t);e1&&arguments[1]!==void 0?arguments[1]:{};W(this,i),this.init(t,e)}return G(i,[{key:"init",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||na,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,n=new Array(e),r=0;r1?n-1:0),a=1;a-1?s.replace(/###/g,"."):s}function r(){return!i||typeof i=="string"}for(var a=typeof t!="string"?[].concat(t):t.split(".");a.length>1;){if(r())return{};var o=n(a.shift());!i[o]&&e&&(i[o]=new e),Object.prototype.hasOwnProperty.call(i,o)?i=i[o]:i={}}return r()?{}:{obj:i,k:n(a.shift())}}function wn(i,t,e){var n=Tr(i,t,Object),r=n.obj,a=n.k;r[a]=e}function oa(i,t,e,n){var r=Tr(i,t,Object),a=r.obj,o=r.k;a[o]=a[o]||[],n&&(a[o]=a[o].concat(e)),n||a[o].push(e)}function sr(i,t){var e=Tr(i,t),n=e.obj,r=e.k;if(!!n)return n[r]}function En(i,t,e){var n=sr(i,e);return n!==void 0?n:sr(t,e)}function Dn(i,t,e){for(var n in t)n!=="__proto__"&&n!=="constructor"&&(n in i?typeof i[n]=="string"||i[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?e&&(i[n]=t[n]):Dn(i[n],t[n],e):i[n]=t[n]);return i}function lt(i){return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var sa={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function ua(i){return typeof i=="string"?i.replace(/[&<>"'\/]/g,function(t){return sa[t]}):i}var lr=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,la=[" ",",","?","!",";"];function ca(i,t,e){t=t||"",e=e||"";var n=la.filter(function(s){return t.indexOf(s)<0&&e.indexOf(s)<0});if(n.length===0)return!0;var r=new RegExp("(".concat(n.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),a=!r.test(i);if(!a){var o=i.indexOf(e);o>0&&!r.test(i.substring(0,o))&&(a=!0)}return a}function Sn(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),e.push.apply(e,n)}return e}function ar(i){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jn(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!i){if(i[t])return i[t];for(var n=t.split(e),r=i,a=0;aa+o;)o++,s=n.slice(a,a+o).join(e),u=r[s];if(u===void 0)return;if(u===null)return null;if(t.endsWith(s)){if(typeof u=="string")return u;if(s&&typeof u[s]=="string")return u[s]}var v=n.slice(a+o).join(e);return v?jn(u,v,e):void 0}r=r[n[a]]}return r}}var ha=function(i){ut(e,i);var t=fa(e);function e(n){var r,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return W(this,e),r=t.call(this),lr&&Re.call(ae(r)),r.data=n||{},r.options=a,r.options.keySeparator===void 0&&(r.options.keySeparator="."),r.options.ignoreJSONStructure===void 0&&(r.options.ignoreJSONStructure=!0),r}return G(e,[{key:"addNamespaces",value:function(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}},{key:"removeNamespaces",value:function(r){var a=this.options.ns.indexOf(r);a>-1&&this.options.ns.splice(a,1)}},{key:"getResource",value:function(r,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,v=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,y=[r,a];o&&typeof o!="string"&&(y=y.concat(o)),o&&typeof o=="string"&&(y=y.concat(u?o.split(u):o)),r.indexOf(".")>-1&&(y=r.split("."));var l=sr(this.data,y);return l||!v||typeof o!="string"?l:jn(this.data&&this.data[r]&&this.data[r][a],o,u)}},{key:"addResource",value:function(r,a,o,s){var u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},v=this.options.keySeparator;v===void 0&&(v=".");var y=[r,a];o&&(y=y.concat(v?o.split(v):o)),r.indexOf(".")>-1&&(y=r.split("."),s=a,a=y[1]),this.addNamespaces(a),wn(this.data,y,s),u.silent||this.emit("added",r,a,o,s)}},{key:"addResources",value:function(r,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var u in o)(typeof o[u]=="string"||Object.prototype.toString.apply(o[u])==="[object Array]")&&this.addResource(r,a,u,o[u],{silent:!0});s.silent||this.emit("added",r,a,o)}},{key:"addResourceBundle",value:function(r,a,o,s,u){var v=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},y=[r,a];r.indexOf(".")>-1&&(y=r.split("."),s=o,o=a,a=y[1]),this.addNamespaces(a);var l=sr(this.data,y)||{};s?Dn(l,o,u):l=ar(ar({},l),o),wn(this.data,y,l),v.silent||this.emit("added",r,a,o)}},{key:"removeResourceBundle",value:function(r,a){this.hasResourceBundle(r,a)&&delete this.data[r][a],this.removeNamespaces(a),this.emit("removed",r,a)}},{key:"hasResourceBundle",value:function(r,a){return this.getResource(r,a)!==void 0}},{key:"getResourceBundle",value:function(r,a){return a||(a=this.options.defaultNS),this.options.compatibilityAPI==="v1"?ar(ar({},{}),this.getResource(r,a)):this.getResource(r,a)}},{key:"getDataByLanguage",value:function(r){return this.data[r]}},{key:"hasLanguageSomeTranslations",value:function(r){var a=this.getDataByLanguage(r),o=a&&Object.keys(a)||[];return!!o.find(function(s){return a[s]&&Object.keys(a[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),e}(Re),Nn={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,r,a){var o=this;return t.forEach(function(s){o.processors[s]&&(e=o.processors[s].process(e,n,r,a))}),e}};function xn(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),e.push.apply(e,n)}return e}function V(i){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Cn={},Pn=function(i){ut(e,i);var t=pa(e);function e(n){var r,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return W(this,e),r=t.call(this),lr&&Re.call(ae(r)),aa(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,ae(r)),r.options=a,r.options.keySeparator===void 0&&(r.options.keySeparator="."),r.logger=he.create("translator"),r}return G(e,[{key:"changeLanguage",value:function(r){r&&(this.language=r)}},{key:"exists",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(r==null)return!1;var o=this.resolve(r,a);return o&&o.res!==void 0}},{key:"extractFromKey",value:function(r,a){var o=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");var s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ns||this.options.defaultNS||[],v=o&&r.indexOf(o)>-1,y=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!ca(r,o,s);if(v&&!y){var l=r.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:r,namespaces:u};var m=r.split(o);(o!==s||o===s&&this.options.ns.indexOf(m[0])>-1)&&(u=m.shift()),r=m.join(s)}return typeof u=="string"&&(u=[u]),{key:r,namespaces:u}}},{key:"translate",value:function(r,a,o){var s=this;if(ie(a)!=="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),a||(a={}),r==null)return"";Array.isArray(r)||(r=[String(r)]);var u=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,v=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,y=this.extractFromKey(r[r.length-1],a),l=y.key,m=y.namespaces,g=m[m.length-1],E=a.lng||this.language,d=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(E&&E.toLowerCase()==="cimode"){if(d){var c=a.nsSeparator||this.options.nsSeparator;return u?(f.res="".concat(g).concat(c).concat(l),f):"".concat(g).concat(c).concat(l)}return u?(f.res=l,f):l}var f=this.resolve(r,a),p=f&&f.res,b=f&&f.usedKey||l,w=f&&f.exactUsedKey||l,O=Object.prototype.toString.apply(p),S=["[object Number]","[object Function]","[object RegExp]"],A=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,R=!this.i18nFormat||this.i18nFormat.handleAsObject,D=typeof p!="string"&&typeof p!="boolean"&&typeof p!="number";if(R&&p&&D&&S.indexOf(O)<0&&!(typeof A=="string"&&O==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var X=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,p,V(V({},a),{},{ns:m})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return u?(f.res=X,f):X}if(v){var be=O==="[object Array]",U=be?[]:{},_=be?w:b;for(var N in p)if(Object.prototype.hasOwnProperty.call(p,N)){var $="".concat(_).concat(v).concat(N);U[N]=this.translate($,V(V({},a),{joinArrays:!1,ns:m})),U[N]===$&&(U[N]=p[N])}p=U}}else if(R&&typeof A=="string"&&O==="[object Array]")p=p.join(A),p&&(p=this.extendTranslation(p,r,a,o));else{var H=!1,ee=!1,je=a.count!==void 0&&typeof a.count!="string",K=e.hasDefaultValue(a),gr=je?this.pluralResolver.getSuffix(E,a.count,a):"",z=a["defaultValue".concat(gr)]||a.defaultValue;!this.isValidLookup(p)&&K&&(H=!0,p=z),this.isValidLookup(p)||(ee=!0,p=l);var Ne=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,We=Ne&&ee?void 0:p,le=K&&z!==p&&this.options.updateMissing;if(ee||H||le){if(this.logger.log(le?"updateKey":"missingKey",E,g,l,le?z:p),v){var Ge=this.resolve(l,V(V({},a),{},{keySeparator:!1}));Ge&&Ge.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var we=[],Ee=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Ee&&Ee[0])for(var Se=0;Se1&&arguments[1]!==void 0?arguments[1]:{},s,u,v,y,l;return typeof r=="string"&&(r=[r]),r.forEach(function(m){if(!a.isValidLookup(s)){var g=a.extractFromKey(m,o),E=g.key;u=E;var d=g.namespaces;a.options.fallbackNS&&(d=d.concat(a.options.fallbackNS));var c=o.count!==void 0&&typeof o.count!="string",f=c&&!o.ordinal&&o.count===0&&a.pluralResolver.shouldUseIntlApi(),p=o.context!==void 0&&(typeof o.context=="string"||typeof o.context=="number")&&o.context!=="",b=o.lngs?o.lngs:a.languageUtils.toResolveHierarchy(o.lng||a.language,o.fallbackLng);d.forEach(function(w){a.isValidLookup(s)||(l=w,!Cn["".concat(b[0],"-").concat(w)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(l)&&(Cn["".concat(b[0],"-").concat(w)]=!0,a.logger.warn('key "'.concat(u,'" for languages "').concat(b.join(", "),`" won't get resolved as namespace "`).concat(l,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(function(O){if(!a.isValidLookup(s)){y=O;var S=[E];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(S,E,O,w,o);else{var A;c&&(A=a.pluralResolver.getSuffix(O,o.count,o));var R="".concat(a.options.pluralSeparator,"zero");if(c&&(S.push(E+A),f&&S.push(E+R)),p){var D="".concat(E).concat(a.options.contextSeparator).concat(o.context);S.push(D),c&&(S.push(D+A),f&&S.push(D+R))}}for(var X;X=S.pop();)a.isValidLookup(s)||(v=X,s=a.getResource(O,w,X,o))}}))})}}),{res:s,usedKey:u,exactUsedKey:v,usedLng:y,usedNS:l}}},{key:"isValidLookup",value:function(r){return r!==void 0&&!(!this.options.returnNull&&r===null)&&!(!this.options.returnEmptyString&&r==="")}},{key:"getResource",value:function(r,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(r,a,o,s):this.resourceStore.getResource(r,a,o,s)}}],[{key:"hasDefaultValue",value:function(r){var a="defaultValue";for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o)&&a===o.substring(0,a.length)&&r[o]!==void 0)return!0;return!1}}]),e}(Re);function Lr(i){return i.charAt(0).toUpperCase()+i.slice(1)}var ma=function(){function i(t){W(this,i),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=he.create("languageUtils")}return G(i,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var n=e.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(e){if(typeof e=="string"&&e.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map(function(a){return a.toLowerCase()}):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Lr(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Lr(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Lr(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var n=this;if(!e)return null;var r;return e.forEach(function(a){if(!r){var o=n.formatLanguageCode(a);(!n.options.supportedLngs||n.isSupportedCode(o))&&(r=o)}}),!r&&this.options.supportedLngs&&e.forEach(function(a){if(!r){var o=n.getLanguagePartFromCode(a);if(n.isSupportedCode(o))return r=o;r=n.options.supportedLngs.find(function(s){if(s.indexOf(o)===0)return s})}}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}},{key:"getFallbackCodes",value:function(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!n)return e.default||[];var r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}},{key:"toResolveHierarchy",value:function(e,n){var r=this,a=this.getFallbackCodes(n||this.options.fallbackLng||[],e),o=[],s=function(v){!v||(r.isSupportedCode(v)?o.push(v):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(v)))};return typeof e=="string"&&e.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):typeof e=="string"&&s(this.formatLanguageCode(e)),a.forEach(function(u){o.indexOf(u)<0&&s(r.formatLanguageCode(u))}),o}}]),i}(),va=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ya={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},ba=["v1","v2","v3"],On={zero:0,one:1,two:2,few:3,many:4,other:5};function wa(){var i={};return va.forEach(function(t){t.lngs.forEach(function(e){i[e]={numbers:t.nr,plurals:ya[t.fc]}})}),i}var Ea=function(){function i(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};W(this,i),this.languageUtils=t,this.options=e,this.logger=he.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=wa()}return G(i,[{key:"addRule",value:function(e,n){this.rules[e]=n}},{key:"getRule",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(function(a){return"".concat(n).concat(a)})}},{key:"getSuffixes",value:function(e){var n=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.getRule(e,r);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort(function(o,s){return On[o]-On[s]}).map(function(o){return"".concat(n.options.prepend).concat(o)}):a.numbers.map(function(o){return n.getSuffix(e,o,r)}):[]}},{key:"getSuffix",value:function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this.getRule(e,r);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(n)):this.getSuffixRetroCompatible(a,n):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,n){var r=this,a=e.noAbs?e.plurals(n):e.plurals(Math.abs(n)),o=e.numbers[a];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));var s=function(){return r.options.prepend&&o.toString()?r.options.prepend+o.toString():o.toString()};return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?"_plural_".concat(o.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?s():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!ba.includes(this.options.compatibilityJSON)}}]),i}();function kn(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),e.push.apply(e,n)}return e}function oe(i){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};W(this,i),this.logger=he.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return G(i,[{key:"init",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var n=e.interpolation;this.escape=n.escape!==void 0?n.escape:ua,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?lt(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?lt(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?lt(n.nestingPrefix):n.nestingPrefixEscaped||lt("$t("),this.nestingSuffix=n.nestingSuffix?lt(n.nestingSuffix):n.nestingSuffixEscaped||lt(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(n,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(e,n,r,a){var o=this,s,u,v,y=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(c){return c.replace(/\$/g,"$$$$")}var m=function(f){if(f.indexOf(o.formatSeparator)<0){var p=En(n,y,f);return o.alwaysFormat?o.format(p,void 0,r,oe(oe(oe({},a),n),{},{interpolationkey:f})):p}var b=f.split(o.formatSeparator),w=b.shift().trim(),O=b.join(o.formatSeparator).trim();return o.format(En(n,y,w),O,r,oe(oe(oe({},a),n),{},{interpolationkey:w}))};this.resetRegExp();var g=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,E=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,d=[{regex:this.regexpUnescape,safeValue:function(f){return l(f)}},{regex:this.regexp,safeValue:function(f){return o.escapeValue?l(o.escape(f)):l(f)}}];return d.forEach(function(c){for(v=0;s=c.regex.exec(e);){var f=s[1].trim();if(u=m(f),u===void 0)if(typeof g=="function"){var p=g(e,s,a);u=typeof p=="string"?p:""}else if(a&&a.hasOwnProperty(f))u="";else if(E){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(f," for interpolating ").concat(e)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=bn(u));var b=c.safeValue(u);if(e=e.replace(s[0],b),E?(c.regex.lastIndex+=u.length,c.regex.lastIndex-=s[0].length):c.regex.lastIndex=0,v++,v>=o.maxReplaces)break}}),e}},{key:"nest",value:function(e,n){var r=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,u=oe({},a);u.applyPostProcessor=!1,delete u.defaultValue;function v(g,E){var d=this.nestingOptionsSeparator;if(g.indexOf(d)<0)return g;var c=g.split(new RegExp("".concat(d,"[ ]*{"))),f="{".concat(c[1]);g=c[0],f=this.interpolate(f,u),f=f.replace(/'/g,'"');try{u=JSON.parse(f),E&&(u=oe(oe({},E),u))}catch(p){return this.logger.warn("failed parsing options string in nesting for key ".concat(g),p),"".concat(g).concat(d).concat(f)}return delete u.defaultValue,g}for(;o=this.nestingRegexp.exec(e);){var y=[],l=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){var m=o[1].split(this.formatSeparator).map(function(g){return g.trim()});o[1]=m.shift(),y=m,l=!0}if(s=n(v.call(this,o[1].trim(),u),u),s&&o[0]===e&&typeof s!="string")return s;typeof s!="string"&&(s=bn(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(e)),s=""),l&&(s=y.reduce(function(g,E){return r.format(g,E,a.lng,oe(oe({},a),{},{interpolationkey:o[1].trim()}))},s.trim())),e=e.replace(o[0],s),this.regexp.lastIndex=0}return e}}]),i}();function An(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),e.push.apply(e,n)}return e}function Te(i){for(var t=1;t-1){var n=i.split("(");t=n[0].toLowerCase().trim();var r=n[1].substring(0,n[1].length-1);if(t==="currency"&&r.indexOf(":")<0)e.currency||(e.currency=r.trim());else if(t==="relativetime"&&r.indexOf(":")<0)e.range||(e.range=r.trim());else{var a=r.split(";");a.forEach(function(o){if(!!o){var s=o.split(":"),u=Ar(s),v=u[0],y=u.slice(1),l=y.join(":").trim().replace(/^'+|'+$/g,"");e[v.trim()]||(e[v.trim()]=l),l==="false"&&(e[v.trim()]=!1),l==="true"&&(e[v.trim()]=!0),isNaN(l)||(e[v.trim()]=parseInt(l,10))}})}}return{formatName:t,formatOptions:e}}var Ca=function(){function i(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};W(this,i),this.logger=he.create("formatter"),this.options=t,this.formats={number:function(n,r,a){return new Intl.NumberFormat(r,a).format(n)},currency:function(n,r,a){return new Intl.NumberFormat(r,Te(Te({},a),{},{style:"currency"})).format(n)},datetime:function(n,r,a){return new Intl.DateTimeFormat(r,Te({},a)).format(n)},relativetime:function(n,r,a){return new Intl.RelativeTimeFormat(r,Te({},a)).format(n,a.range||"day")},list:function(n,r,a){return new Intl.ListFormat(r,Te({},a)).format(n)}},this.init(t)}return G(i,[{key:"init",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},r=n.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}},{key:"add",value:function(e,n){this.formats[e.toLowerCase().trim()]=n}},{key:"format",value:function(e,n,r,a){var o=this,s=n.split(this.formatSeparator),u=s.reduce(function(v,y){var l=xa(y),m=l.formatName,g=l.formatOptions;if(o.formats[m]){var E=v;try{var d=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},c=d.locale||d.lng||a.locale||a.lng||r;E=o.formats[m](v,c,Te(Te(Te({},g),a),d))}catch(f){o.logger.warn(f)}return E}else o.logger.warn("there was no format function for ".concat(m));return v},e);return u}}]),i}();function Ln(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),e.push.apply(e,n)}return e}function Tn(i){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ka(i,t){i.pending[t]!==void 0&&(delete i.pending[t],i.pendingCount--)}var Aa=function(i){ut(e,i);var t=Pa(e);function e(n,r,a){var o,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return W(this,e),o=t.call(this),lr&&Re.call(ae(o)),o.backend=n,o.store=r,o.services=a,o.languageUtils=a.languageUtils,o.options=s,o.logger=he.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(a,s.backend,s),o}return G(e,[{key:"queueLoad",value:function(r,a,o,s){var u=this,v={},y={},l={},m={};return r.forEach(function(g){var E=!0;a.forEach(function(d){var c="".concat(g,"|").concat(d);!o.reload&&u.store.hasResourceBundle(g,d)?u.state[c]=2:u.state[c]<0||(u.state[c]===1?y[c]===void 0&&(y[c]=!0):(u.state[c]=1,E=!1,y[c]===void 0&&(y[c]=!0),v[c]===void 0&&(v[c]=!0),m[d]===void 0&&(m[d]=!0)))}),E||(l[g]=!0)}),(Object.keys(v).length||Object.keys(y).length)&&this.queue.push({pending:y,pendingCount:Object.keys(y).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(v),pending:Object.keys(y),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(r,a,o){var s=r.split("|"),u=s[0],v=s[1];a&&this.emit("failedLoading",u,v,a),o&&this.store.addResourceBundle(u,v,o),this.state[r]=a?-1:2;var y={};this.queue.forEach(function(l){oa(l.loaded,[u],v),ka(l,r),a&&l.errors.push(a),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(function(m){y[m]||(y[m]={});var g=l.loaded[m];g.length&&g.forEach(function(E){y[m][E]===void 0&&(y[m][E]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",y),this.queue=this.queue.filter(function(l){return!l.done})}},{key:"read",value:function(r,a,o){var s=this,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,y=arguments.length>5?arguments[5]:void 0;if(!r.length)return y(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:r,ns:a,fcName:o,tried:u,wait:v,callback:y});return}return this.readingCalls++,this.backend[o](r,a,function(l,m){if(s.readingCalls--,s.waitingReads.length>0){var g=s.waitingReads.shift();s.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(l&&m&&u2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();typeof r=="string"&&(r=this.languageUtils.toResolveHierarchy(r)),typeof a=="string"&&(a=[a]);var v=this.queueLoad(r,a,s,u);if(!v.toLoad.length)return v.pending.length||u(),null;v.toLoad.forEach(function(y){o.loadOne(y)})}},{key:"load",value:function(r,a,o){this.prepareLoading(r,a,{},o)}},{key:"reload",value:function(r,a,o){this.prepareLoading(r,a,{reload:!0},o)}},{key:"loadOne",value:function(r){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=r.split("|"),u=s[0],v=s[1];this.read(u,v,"read",void 0,void 0,function(y,l){y&&a.logger.warn("".concat(o,"loading namespace ").concat(v," for language ").concat(u," failed"),y),!y&&l&&a.logger.log("".concat(o,"loaded namespace ").concat(v," for language ").concat(u),l),a.loaded(r,y,l)})}},{key:"saveMissing",value:function(r,a,o,s,u){var v=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(a)){this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}o==null||o===""||(this.backend&&this.backend.create&&this.backend.create(r,a,o,s,null,Tn(Tn({},v),{},{isUpdate:u})),!(!r||!r[0])&&this.store.addResource(r[0],a,o,s))}}]),e}(Re);function La(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if(ie(t[1])==="object"&&(e=t[1]),typeof t[1]=="string"&&(e.defaultValue=t[1]),typeof t[2]=="string"&&(e.tDescription=t[2]),ie(t[2])==="object"||ie(t[3])==="object"){var n=t[3]||t[2];Object.keys(n).forEach(function(r){e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:function(t,e,n,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Rn(i){return typeof i.ns=="string"&&(i.ns=[i.ns]),typeof i.fallbackLng=="string"&&(i.fallbackLng=[i.fallbackLng]),typeof i.fallbackNS=="string"&&(i.fallbackNS=[i.fallbackNS]),i.supportedLngs&&i.supportedLngs.indexOf("cimode")<0&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),i}function Fn(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),e.push.apply(e,n)}return e}function de(i){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function or(){}function Fa(i){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(i));t.forEach(function(e){typeof i[e]=="function"&&(i[e]=i[e].bind(i))})}var ur=function(i){ut(e,i);var t=Ta(e);function e(){var n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(W(this,e),n=t.call(this),lr&&Re.call(ae(n)),n.options=Rn(r),n.services={},n.logger=he,n.modules={external:[]},Fa(ae(n)),a&&!n.isInitialized&&!r.isClone){if(!n.options.initImmediate)return n.init(r,a),Ue(n,ae(n));setTimeout(function(){n.init(r,a)},0)}return n}return G(e,[{key:"init",value:function(){var r=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;typeof a=="function"&&(o=a,a={}),!a.defaultNS&&a.defaultNS!==!1&&a.ns&&(typeof a.ns=="string"?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));var s=La();this.options=de(de(de({},s),this.options),Rn(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=de(de({},s.interpolation),this.options.interpolation)),a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator);function u(f){return f?typeof f=="function"?new f:f:null}if(!this.options.isClone){this.modules.logger?he.init(u(this.modules.logger),this.options):he.init(null,this.options);var v;this.modules.formatter?v=this.modules.formatter:typeof Intl<"u"&&(v=Ca);var y=new ma(this.options);this.store=new ha(this.options.resources,this.options);var l=this.services;l.logger=he,l.resourceStore=this.store,l.languageUtils=y,l.pluralResolver=new Ea(y,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),v&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(l.formatter=u(v),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new Sa(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Aa(u(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(f){for(var p=arguments.length,b=new Array(p>1?p-1:0),w=1;w1?p-1:0),w=1;w0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var g=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];g.forEach(function(f){r[f]=function(){var p;return(p=r.store)[f].apply(p,arguments)}});var E=["addResource","addResources","addResourceBundle","removeResourceBundle"];E.forEach(function(f){r[f]=function(){var p;return(p=r.store)[f].apply(p,arguments),r}});var d=Lt(),c=function(){var p=function(w,O){r.isInitialized&&!r.initializedStoreOnce&&r.logger.warn("init: i18next is already initialized. You should call init just once!"),r.isInitialized=!0,r.options.isClone||r.logger.log("initialized",r.options),r.emit("initialized",r.options),d.resolve(O),o(w,O)};if(r.languages&&r.options.compatibilityAPI!=="v1"&&!r.isInitialized)return p(null,r.t.bind(r));r.changeLanguage(r.options.lng,p)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),d}},{key:"loadResources",value:function(r){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:or,s=o,u=typeof r=="string"?r:this.language;if(typeof r=="function"&&(s=r),!this.options.resources||this.options.partialBundledLanguages){if(u&&u.toLowerCase()==="cimode")return s();var v=[],y=function(g){if(!!g){var E=a.services.languageUtils.toResolveHierarchy(g);E.forEach(function(d){v.indexOf(d)<0&&v.push(d)})}};if(u)y(u);else{var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.forEach(function(m){return y(m)})}this.options.preload&&this.options.preload.forEach(function(m){return y(m)}),this.services.backendConnector.load(v,this.options.ns,function(m){!m&&!a.resolvedLanguage&&a.language&&a.setResolvedLanguage(a.language),s(m)})}else s(null)}},{key:"reloadResources",value:function(r,a,o){var s=Lt();return r||(r=this.languages),a||(a=this.options.ns),o||(o=or),this.services.backendConnector.reload(r,a,function(u){s.resolve(),o(u)}),s}},{key:"use",value:function(r){if(!r)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!r.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return r.type==="backend"&&(this.modules.backend=r),(r.type==="logger"||r.log&&r.warn&&r.error)&&(this.modules.logger=r),r.type==="languageDetector"&&(this.modules.languageDetector=r),r.type==="i18nFormat"&&(this.modules.i18nFormat=r),r.type==="postProcessor"&&Nn.addPostProcessor(r),r.type==="formatter"&&(this.modules.formatter=r),r.type==="3rdParty"&&this.modules.external.push(r),this}},{key:"setResolvedLanguage",value:function(r){if(!(!r||!this.languages)&&!(["cimode","dev"].indexOf(r)>-1))for(var a=0;a-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}}},{key:"changeLanguage",value:function(r,a){var o=this;this.isLanguageChangingTo=r;var s=Lt();this.emit("languageChanging",r);var u=function(m){o.language=m,o.languages=o.services.languageUtils.toResolveHierarchy(m),o.resolvedLanguage=void 0,o.setResolvedLanguage(m)},v=function(m,g){g?(u(g),o.translator.changeLanguage(g),o.isLanguageChangingTo=void 0,o.emit("languageChanged",g),o.logger.log("languageChanged",g)):o.isLanguageChangingTo=void 0,s.resolve(function(){return o.t.apply(o,arguments)}),a&&a(m,function(){return o.t.apply(o,arguments)})},y=function(m){!r&&!m&&o.services.languageDetector&&(m=[]);var g=typeof m=="string"?m:o.services.languageUtils.getBestMatchFromCodes(m);g&&(o.language||u(g),o.translator.language||o.translator.changeLanguage(g),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage(g)),o.loadResources(g,function(E){v(E,g)})};return!r&&this.services.languageDetector&&!this.services.languageDetector.async?y(this.services.languageDetector.detect()):!r&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(y):y(r),s}},{key:"getFixedT",value:function(r,a,o){var s=this,u=function v(y,l){var m;if(ie(l)!=="object"){for(var g=arguments.length,E=new Array(g>2?g-2:0),d=2;d1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],u=this.options?this.options.fallbackLng:!1,v=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var y=function(g,E){var d=a.services.backendConnector.state["".concat(g,"|").concat(E)];return d===-1||d===2};if(o.precheck){var l=o.precheck(this,y);if(l!==void 0)return l}return!!(this.hasResourceBundle(s,r)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||y(s,r)&&(!u||y(v,r)))}},{key:"loadNamespaces",value:function(r,a){var o=this,s=Lt();return this.options.ns?(typeof r=="string"&&(r=[r]),r.forEach(function(u){o.options.ns.indexOf(u)<0&&o.options.ns.push(u)}),this.loadResources(function(u){s.resolve(),a&&a(u)}),s):(a&&a(),Promise.resolve())}},{key:"loadLanguages",value:function(r,a){var o=Lt();typeof r=="string"&&(r=[r]);var s=this.options.preload||[],u=r.filter(function(v){return s.indexOf(v)<0});return u.length?(this.options.preload=s.concat(u),this.loadResources(function(v){o.resolve(),a&&a(v)}),o):(a&&a(),Promise.resolve())}},{key:"dir",value:function(r){if(r||(r=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!r)return"rtl";var a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return a.indexOf(this.services.languageUtils.getLanguagePartFromCode(r))>-1||r.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var r=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:or,s=de(de(de({},this.options),a),{isClone:!0}),u=new e(s),v=["store","services","language"];return v.forEach(function(y){u[y]=r[y]}),u.services=de({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new Pn(u.services,u.options),u.translator.on("*",function(y){for(var l=arguments.length,m=new Array(l>1?l-1:0),g=1;g0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ur(i,t)});var J=ur.createInstance();J.createInstance=ur.createInstance;var us=J.createInstance,ls=J.init,cs=J.loadResources,fs=J.reloadResources,$n=J.use,ds=J.changeLanguage,hs=J.getFixedT,j=J.t,ps=J.exists,gs=J.setDefaultNamespace,ms=J.hasLoadedNamespace,vs=J.loadNamespaces,ys=J.loadLanguages;var Da=()=>{let i=new Map;return i.set("GET",new Map),i.set("PROPFIND",new Map),i},Rt,He,re,Ft,Dt,jt,Nt,se,$t,Tt=class{constructor({bypassCheck:t,sortDirectoriesFirst:e},n=Da(),r=new cn){x(this,Rt,void 0);x(this,He,void 0);x(this,re,void 0);x(this,Ft,void 0);x(this,Dt,(t,e)=>{let n=h(this,He).get(t);return n.has(e)?n.get(e):null});x(this,jt,(t,e)=>h(this,He).get(t).has(e));x(this,Nt,(t,e,n)=>{h(this,He).get(t).set(e,n)});x(this,se,t=>T(this,null,function*(){try{return yield t()}catch(e){if(!(e instanceof tr))throw e;(0,Mn.error)(j("failure",{interpolation:{escapeValue:!1},method:e.method(),url:e.url(),statusText:e.statusText(),status:e.status()}))}}));x(this,$t,t=>{let e=`${location.protocol}//${location.hostname}${location.port?`:${location.port}`:""}`,n=new RegExp(`^${e}`);if(!t.match(n)){if(t.match(/^http/))throw new TypeError(`Invalid destination host: '${t}'.`);return`${e}${t}`}return t});C(this,Rt,t),C(this,Ft,e),C(this,He,n),C(this,re,r)}check(t){return T(this,null,function*(){return h(this,Rt)?Promise.resolve({ok:!0,status:200}):h(this,se).call(this,()=>h(this,re).HEAD(t))})}copy(t,e){return T(this,null,function*(){return h(this,se).call(this,()=>h(this,re).COPY(t,{headers:{Destination:h(this,$t).call(this,e)}}))})}del(t){return T(this,null,function*(){return h(this,se).call(this,()=>h(this,re).DELETE(t))})}get(t){return T(this,null,function*(){if(!h(this,jt).call(this,"GET",t)){let e=yield h(this,se).call(this,()=>h(this,re).GET(t));if(!e||!e.ok)return;h(this,Nt).call(this,"GET",t,yield e.text())}return h(this,Dt).call(this,"GET",t)})}list(t,e=!1){return T(this,null,function*(){if(t=Pe(t),!e&&h(this,jt).call(this,"PROPFIND",t))return h(this,Dt).call(this,"PROPFIND",t);let n=yield this.check(t);if(!n||!n.ok&&n.status!==405)return;let r=yield h(this,se).call(this,()=>h(this,re).PROPFIND(t)),a=new ln(yield r.text()),o=a.collection({sortDirectoriesFirst:h(this,Ft)});return h(this,Nt).call(this,"PROPFIND",t,o),o})}mkcol(t){return T(this,null,function*(){return h(this,se).call(this,()=>h(this,re).MKCOL(t))})}move(t,e,n){return T(this,null,function*(){let r=h(this,$t).call(this,e);return h(this,se).call(this,()=>h(this,re).MOVE(t,{headers:{Destination:n.directory?Pe(r):r}}))})}upload(t,e){return T(this,null,function*(){let n=B(t,e.name);return h(this,se).call(this,()=>h(this,re).PUT(n,{headers:{"Content-Type":e.type},body:e}))})}};Rt=new WeakMap,He=new WeakMap,re=new WeakMap,Ft=new WeakMap,Dt=new WeakMap,jt=new WeakMap,Nt=new WeakMap,se=new WeakMap,$t=new WeakMap;var Ke=Y(Ce());var _n=Y(kt());var ja=(i,t,e)=>T(void 0,null,function*(){let n=yield i.list(t.getPath(),!0);if(!n)return;t.setCollection(n);let[r]=n.filter(s=>s.name===e.name);if(r){if(!confirm(j("overwriteFileConfirmation",{file:r.title})))return;n.remove(r)}let a=new ve({fullPath:B(t.getPath(),e.name),modified:Date.now(),size:e.size,mimeType:e.type,placeholder:!0,collection:n});if(n.add(a),!(yield i.upload(location.pathname,e))){n.remove(a),t.update();return}a.placeholder=!1,t.update(),(0,_n.success)(j("successfullyUploaded",{interpolation:{escapeValue:!1},file:e.name}))}),cr=ja;var In=Y(kt());var ct,Fe,Mt=class extends Ke.default{constructor(e,n){super((0,Ke.s)(``));x(this,ct,void 0);x(this,Fe,void 0);C(this,ct,e),C(this,Fe,n),this.bindEvents()}bindEvents(){let e=this.query('input[type="file"]'),n=this.query(".create-directory");(0,Ke.on)(e,"change",()=>T(this,null,function*(){for(let r of e.files)cr(h(this,ct),h(this,Fe),r);h(this,Fe).update(),e.value=null})),(0,Ke.on)(n,"click",r=>T(this,null,function*(){r.preventDefault();let a=prompt("",j("directoryName"));!a||this.handleCreateDirectory(Pe(B(location.pathname,a)),a)}))}handleCreateDirectory(e,n){return T(this,null,function*(){if(!(yield h(this,ct).mkcol(e)))return;(0,In.success)(j("successfullyCreated",{interpolation:{escapeValue:!1},directoryName:n}));let a=h(this,Fe).getCollection();a.add(new ve({directory:!0,fullPath:e,modified:Date.now(),collection:a})),h(this,Fe).update()})}};ct=new WeakMap,Fe=new WeakMap;var fr=Y(Ce());var qn=i=>decodeURIComponent(i.getPath()),Ve,Rr=class extends fr.default{constructor(e){super((0,fr.s)(`
        +

        ${qn(e)}

        +
        `));x(this,Ve,void 0);C(this,Ve,e),this.bindEvents()}bindEvents(){h(this,Ve).on("updated",()=>{h(this,Ve).isDirectory()&&this.update()})}update(){this.query("h1").innerHTML=qn(h(this,Ve))}};Ve=new WeakMap;var Un=Rr;var Bn=[],Na=Bn.forEach,$a=Bn.slice;function Ma(i){return Na.call($a.call(arguments,1),function(t){if(t)for(var e in t)i[e]===void 0&&(i[e]=t[e])}),i}var Hn=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,_a=function(t,e,n){var r=n||{};r.path=r.path||"/";var a=encodeURIComponent(e),o="".concat(t,"=").concat(a);if(r.maxAge>0){var s=r.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(s))}if(r.domain){if(!Hn.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(r.domain)}if(r.path){if(!Hn.test(r.path))throw new TypeError("option path is invalid");o+="; Path=".concat(r.path)}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite){var u=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},Kn={create:function(t,e,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),r&&(a.domain=r),document.cookie=_a(t,encodeURIComponent(e),a)},read:function(t){for(var e="".concat(t,"="),n=document.cookie.split(";"),r=0;r-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=n.substring(1),a=r.split("&"),o=0;o0){var u=a[o].substring(0,s);u===t.lookupQuerystring&&(e=a[o].substring(s+1))}}}return e}},_t=null,Vn=function(){if(_t!==null)return _t;try{_t=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{_t=!1}return _t},Ua={name:"localStorage",lookup:function(t){var e;if(t.lookupLocalStorage&&Vn()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(e=n)}return e},cacheUserLanguage:function(t,e){e.lookupLocalStorage&&Vn()&&window.localStorage.setItem(e.lookupLocalStorage,t)}},It=null,zn=function(){if(It!==null)return It;try{It=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{It=!1}return It},Ha={name:"sessionStorage",lookup:function(t){var e;if(t.lookupSessionStorage&&zn()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(e=n)}return e},cacheUserLanguage:function(t,e){e.lookupSessionStorage&&zn()&&window.sessionStorage.setItem(e.lookupSessionStorage,t)}},Ka={name:"navigator",lookup:function(t){var e=[];if(typeof navigator<"u"){if(navigator.languages)for(var n=0;n0?e:void 0}},Va={name:"htmlTag",lookup:function(t){var e,n=t.htmlTag||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(e=n.getAttribute("lang")),e}},za={name:"path",lookup:function(t){var e;if(typeof window<"u"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof n[t.lookupFromPathIndex]!="string")return;e=n[t.lookupFromPathIndex].replace("/","")}else e=n[0].replace("/","")}return e}},Ba={name:"subdomain",lookup:function(t){var e=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,n=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!n)return n[e]}};function Wa(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Fr=function(){function i(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};W(this,i),this.type="languageDetector",this.detectors={},this.init(t,e)}return G(i,[{key:"init",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Ma(n,this.options||{},Wa()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Ia),this.addDetector(qa),this.addDetector(Ua),this.addDetector(Ha),this.addDetector(Ka),this.addDetector(Va),this.addDetector(za),this.addDetector(Ba)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var n=this;e||(e=this.options.order);var r=[];return e.forEach(function(a){if(n.detectors[a]){var o=n.detectors[a].lookup(n.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}},{key:"cacheUserLanguage",value:function(e,n){var r=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(function(a){r.detectors[a]&&r.detectors[a].cacheUserLanguage(e,r.options)}))}}]),i}();Fr.type="languageDetector";var De=Y(Ce());var Yn=Y(Gn()),F=Y(Ce()),Zn=Y(Jn());var Ja=(i,t="li")=>{if(!i)return[null,null];let e=i.parentElement;if(!e)return[null,null];let n=Array.from(e.querySelectorAll(t)),r=n.indexOf(i);if(r===-1)return[null,null];let a=r>0?n[r-1]:null,o=r`
      • + ${i.title} - ${e.displaySize} - + ${i.displaySize} + - + - -
      • `);k(this,It,void 0);k(this,j,void 0);k(this,Xe,Object.freeze({video:e=>``,audio:e=>``,image:e=>`${e.title}`,font:e=>{let n={eot:"embedded-opentype",otf:"opentype",ttf:"truetype"},t=e.name.replace(/^.+\.([^.]+)$/,"$1").toLowerCase(),a=e.fullPath.replace(/\W+/g,"_"),o=`${A.t("pangram")} 0123456789
        - ${A.t("alphabet")}`;return` + +`,ye,q,ue,Ut,Nr=class extends F.default{constructor(e,n,r){super((0,F.s)(Ya(e)));x(this,ye,void 0);x(this,q,void 0);x(this,ue,void 0);x(this,Ut,Object.freeze({video:e=>``,audio:e=>``,image:e=>`${e.title}`,font:e=>{let n={eot:"embedded-opentype",otf:"opentype",ttf:"truetype"},r=e.name.replace(/^.+\.([^.]+)$/,"$1").toLowerCase(),a=e.fullPath.replace(/\W+/g,"_"),o=`${j("pangram")} 0123456789
        + ${j("alphabet")}`;return`

        ${e.title}

        ${o}

        ${o}

        ${o}

        -

        ${o}

        `},text:(e,n)=>`
        ${n.replace(/[<>]/g,t=>({"<":"<",">":">"})[t])}
        `,pdf:e=>``}));L(this,It,n),L(this,j,e),this.element.classList.add(e.directory?"directory":"file",e.type?e.type:"unknown"),e.placeholder&&this.element.classList.add("loading"),e.del||this.element.querySelector(".delete").setAttribute("hidden",""),e.rename||this.element.querySelector(".rename").setAttribute("hidden",""),this.bindEvents()}bindEvents(e=this.element){this.on("entry:update",n=>{n===b(this,j)&&this.update()}),this.on("move:failed",n=>{n===b(this,j).fullPath&&this.loading(!1)}),this.on("delete:failed",n=>{n===b(this,j).fullPath&&this.loading(!1)}),e.addEventListener("click",()=>this.open()),e.querySelector("[download]").addEventListener("click",n=>n.stopPropagation()),e.querySelector(".delete").addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.del()}),e.querySelector(".rename").addEventListener("click",n=>{n.stopPropagation(),n.preventDefault(),this.rename()}),e.addEventListener("keydown",n=>{if(["F2","Delete","Enter"].includes(n.key)){if(n.preventDefault(),n.key==="F2"&&b(this,j).rename)this.rename();else if(n.key==="Delete"&&b(this,j).del)this.del();else if(n.key==="Enter"&&!b(this,j).directory){if(n.shiftKey)return this.download();this.open()}}})}del(){let e=b(this,j);if(!e.del)throw new TypeError(`'${e.name}' is read only.`);if(this.loading(),!confirm(A.t("deleteConfirm",{file:e.title})))return this.loading(!1);this.trigger("delete",e.fullPath,e)}download(){b(this,j).directory||this.element.querySelector("[download]").dispatchEvent(new CustomEvent("click"))}loading(e=!0){if(e)return this.element.classList.add("loading");this.element.classList.remove("loading")}open(){let e=b(this,j);if(this.loading(),e.directory)return this.trigger("go",e.fullPath,{failure:()=>this.loading(!1)});let n=(t,a=null)=>{let o=()=>u.close(),s=c=>{c.key==="Escape"&&o()},u=qr.create(t,{className:e.type,onShow:()=>{this.loading(!1),document.addEventListener("keydown",s),document.addEventListener("preview:close",c=>{var g;u.preview=(g=c.detail)==null?void 0:g.preview,o()}),a&&a(u)},onClose:()=>{document.removeEventListener("keydown",s),document.removeEventListener("preview:close",o),this.trigger("preview:closed",b(this,j),{preview:u.preview})}});u.show(),this.trigger("preview:opened",b(this,j))};["video","audio","image","font","pdf"].includes(e.type)?this.trigger("check",e.fullPath,()=>{n(b(this,Xe)[e.type](e))},()=>this.loading(!1)):(this.trigger("get",e.fullPath,t=>{if(!t)return this.loading(!1);if(e.type!=="text")return this.download();n(b(this,Xe).text(e,t),a=>Hr.default.highlightAllUnder(a.element()))}),this.loading(!1)),event.preventDefault()}rename(){let e=b(this,j);if(!e.rename)throw new TypeError(`'${e.name}' cannot be renamed.`);let n=this.element,t=n.querySelector(".title"),a=n.querySelector("input"),o=()=>{t.innerText=a.value,a.style.setProperty("width",`${t.scrollWidth}px`)},s=()=>{if(a.value!==e.title)return this.loading(),u(),this.trigger("move",e.fullPath,$(e.path,a.value),e);c()},u=()=>{a.removeEventListener("blur",g),a.removeEventListener("keydown",l),a.removeEventListener("input",v)},c=()=>(t.classList.remove("invisible"),a.classList.add("hidden"),a.value=e.title,o(),u(),n.focus()),g=()=>{s()},l=m=>{m.key==="Enter"?(m.stopPropagation(),m.preventDefault(),s()):m.key==="Escape"&&c()},v=()=>o();t.classList.add("invisible"),a.classList.remove("hidden"),a.value=e.title,o(),a.removeAttribute("readonly"),a.addEventListener("blur",g),a.addEventListener("keydown",l),a.addEventListener("input",v),a.focus()}update(){b(this,j).placeholder&&this.element.classList.contains("placeholder")&&this.element.classList.remove("placeholder")}};It=new WeakMap,j=new WeakMap,Xe=new WeakMap;var zr=(()=>{try{return document.querySelector(":focus-within"),!0}catch(i){return!1}})();var Ae,et,Qe=class extends X{constructor(){super('
          ');k(this,Ae,void 0);k(this,et,void 0);this.bindEvents()}bindEvents(){this.on("list:update:request",()=>this.loading()),this.on("list:update:success",n=>this.update(n)),this.on("list:update:failed",()=>this.loading(!1)),this.on("collection:update",n=>{n===b(this,Ae)&&this.update()}),this.on("entry:update",n=>{n.collection===b(this,Ae)&&this.update()});let e=n=>{if(!["ArrowUp","ArrowDown"].includes(n.key))return;n.preventDefault(),n.stopPropagation();let t=this.element.querySelector(`li:focus${zr?", li:focus-within":""}`),a=document.body.classList.contains("preview-open"),o=[...this.element.querySelectorAll('li:not(.directory):not([data-type="unknown"])')],s=o.indexOf(t),u=a?s>-1?o.slice(s+1).shift():null:t?t.nextElementSibling:this.element.querySelector("li:first-child"),c=a?s>-1?o.slice(0,s).pop():null:t?t.previousElementSibling:null;n.key==="ArrowUp"&&c?(c.focus(),a&&(this.element.dispatchEvent(new CustomEvent("preview:close",{bubbles:!0,detail:{preview:!0}})),c.dispatchEvent(new CustomEvent("click")))):n.key==="ArrowDown"&&u&&(u.focus(),a&&(this.element.dispatchEvent(new CustomEvent("preview:close",{bubbles:!0,detail:{preview:!0}})),u.dispatchEvent(new CustomEvent("click"))))};document.addEventListener("keydown",e),this.element.addEventListener("keydown",e)}loading(e=!0){if(e)return this.element.classList.add("loading");this.element.classList.remove("loading")}update(e=b(this,Ae)){this.emptyNode(),L(this,et,e.map(n=>new Ze(n))),[...b(this,et).map(n=>n.element)].forEach(n=>this.element.appendChild(n)),this.loading(!1),L(this,Ae,e)}};Ae=new WeakMap,et=new WeakMap;var tt=class extends X{constructor(){let r="
          ";super(r);let e=new Qe;this.element.appendChild(e.element)}};var ti=i=>i.endsWith("/")?i:`${i}/`,le=ti;var rt=class extends X{constructor(){let r=``;super(r),this.bindEvents()}bindEvents(r=this.element){r.querySelector('input[type="file"]').addEventListener("change",e=>F(this,null,function*(){for(let n of e.target.files)this.trigger("upload",location.pathname,n);r.value=null})),r.querySelector(".create-directory").addEventListener("click",e=>F(this,null,function*(){e.preventDefault();let n=prompt("",A.t("directoryName"));!n||this.trigger("create-directory",le($(location.pathname,n)),n,location.pathname)}))}};var Te=Wt(Jr());var ni={PROPFIND:{headers:{Depth:1}}},ye=(i,r,e,n)=>fetch(r,Ft(ue(ue({},ni[i]||null),e),{method:i})).then(t=>{if(!t.ok){n.trigger("error",{method:i,url:r,response:t});return}return t}),nt=class extends U{GET(r,e={}){return ye("GET",r,e,this)}HEAD(r,e={}){return ye("HEAD",r,e,this)}PUT(r,e={}){return ye("PUT",r,e,this)}PROPFIND(r,e={}){return ye("PROPFIND",r,e,this)}DELETE(r,e={}){return ye("DELETE",r,e,this)}MKCOL(r,e={}){return ye("MKCOL",r,e,this)}COPY(r,e={}){return ye("COPY",r,e,this)}MOVE(r,e={}){return ye("MOVE",r,e,this)}};var it,at,Ue,Be,ot,st,ut,Me,lt,qe,ct,He,Fe,Re,ar=class extends U{constructor({directory:e=!1,fullPath:n,title:t="",modified:a,size:o=0,mimeType:s="",del:u=!0,rename:c=!0,placeholder:g=!1,collection:l=null}){super();k(this,it,void 0);k(this,at,void 0);k(this,Ue,void 0);k(this,Be,void 0);k(this,ot,void 0);k(this,st,void 0);k(this,ut,void 0);k(this,Me,void 0);k(this,lt,void 0);k(this,qe,void 0);k(this,ct,void 0);k(this,He,void 0);k(this,Fe,void 0);k(this,Re,void 0);let[v,m]=this.getFilename(n);L(this,lt,v),L(this,Me,m),L(this,at,e),L(this,ot,n),L(this,Fe,t),L(this,ut,a),L(this,He,o),L(this,st,s),L(this,it,u),L(this,ct,c),L(this,qe,g),this.collection=l}createParentEntry(){return this.update({fullPath:this.path,title:"←",del:!1,rename:!1})}getFilename(e){let n=$(e).split(/\//),t=n.pop();return[$(...n),t]}update(e={}){return new ar(ue({directory:this.directory,fullPath:this.fullPath,modified:this.modified,size:this.size,mimeType:this.mimeType,del:this.del,rename:this.rename,collection:this.collection},e))}get del(){return b(this,it)}get directory(){return b(this,at)}get displaySize(){return this.directory?"":(b(this,Ue)||L(this,Ue,["bytes","KiB","MiB","GiB","TiB","PiB"].reduce((e,n)=>typeof e=="string"?e:e<1024?`${e.toFixed(2*(n==="bytes"?0:1))} ${n}`:e/1024,b(this,He))),b(this,Ue))}get extension(){return this.directory?"":(b(this,Be)||L(this,Be,this.name.split(".").pop()),b(this,Be))}get fullPath(){return b(this,ot)}get mimeType(){return b(this,st)}get modified(){return b(this,ut)}get name(){return b(this,Me)}get path(){return b(this,lt)}get placeholder(){return b(this,qe)}set placeholder(e){L(this,qe,e),this.trigger("entry:update",this)}get rename(){return b(this,ct)}get size(){return b(this,He)}get title(){return b(this,Fe)||L(this,Fe,decodeURIComponent(b(this,Me))),b(this,Fe)}get type(){if(!b(this,Re)){let e={text:/\.(?:te?xt|i?nfo|php|cgi|faq|ini|htaccess|log|md|sql|sfv|conf|sh|pl|pm|py|rb|(?:s?c|sa)ss|js|java|coffee|[sx]?html?|xml)$/i,image:/\.(?:jpe?g|gif|a?png|svg)$/i,video:/\.(?:mp(?:e?g)?4|mov|avi|webm|ogv|mkv)$/i,audio:/\.(?:mp3|wav|ogg|flac|mka)$/i,font:/\.(?:woff2?|eot|[ot]tf)$/i,pdf:/\.pdf$/i};for(let[n,t]of Object.entries(e))if(this.name.match(t))return L(this,Re,n);L(this,Re,"unknown")}return b(this,Re)}},be=ar;it=new WeakMap,at=new WeakMap,Ue=new WeakMap,Be=new WeakMap,ot=new WeakMap,st=new WeakMap,ut=new WeakMap,Me=new WeakMap,lt=new WeakMap,qe=new WeakMap,ct=new WeakMap,He=new WeakMap,Fe=new WeakMap,Re=new WeakMap;var De,Y,dt,ht,Bt,Mt,ft=class extends U{constructor(e,{sortDirectoriesFirst:n=!1}={}){super();k(this,De,void 0);k(this,Y,void 0);k(this,dt,void 0);k(this,ht,()=>b(this,Y).sort((e,n)=>b(this,dt)&&b(this,Mt).call(this,e,n)||b(this,Bt).call(this,e,n)));k(this,Bt,(e,n)=>e.fullPathn.directory-e.directory);L(this,dt,n),L(this,Y,e.map(a=>new be(Ft(ue({},a),{collection:this}))));let t=b(this,Y).shift();L(this,De,$(t.fullPath)),t.fullPath!=="/"&&b(this,Y).unshift(t.createParentEntry()),b(this,ht).call(this),this.bindEvents()}bindEvents(){this.on("upload:request",(e,n)=>{$(e)===b(this,De)&&this.add(new be({fullPath:$(e,n.name),modified:n.lastModifiedDate,size:n.size,mimeType:n.type,placeholder:!0}))}),this.on("upload:success",(e,n)=>{let[t]=this.filter(a=>a.fullPath===$(e,n.name));t&&(t.placeholder=!1)}),this.on("upload:failed",(e,n)=>{let[t]=this.filter(a=>a.fullPath===$(e,n.name));t&&this.remove(t)}),this.on("delete:success",e=>{let[n]=this.filter(t=>t.fullPath===e);n&&this.remove(n)}),this.on("move:success",(e,n)=>{let[t]=this.filter(o=>o.fullPath===e);if(!t)return;let a=new be({directory:t.directory,fullPath:le(n),modified:t.modified,size:t.size,mimeType:t.mimeType,del:t.del});if(this.remove(t),t.path===a.path)return this.add(a);this.trigger("cache:invalidate",a.path)}),this.on("mkcol:success",(e,n,t)=>{$(t)===b(this,De)&&this.add(new be({directory:!0,fullPath:e,modified:new Date}))})}add(e){return e.collection=this,b(this,Y).push(e),b(this,ht).call(this),this.trigger("collection:update",this),this}remove(e){return L(this,Y,b(this,Y).filter(n=>n!==e)),this.trigger("collection:update",this),this}map(e){return b(this,Y).map(e)}filter(e){return b(this,Y).filter(e)}get path(){return b(this,De)}};De=new WeakMap,Y=new WeakMap,dt=new WeakMap,ht=new WeakMap,Bt=new WeakMap,Mt=new WeakMap;var ze,gt,qt,mt,fe,pt=class{constructor(r,e=new DOMParser){k(this,ze,void 0);k(this,gt,void 0);k(this,qt,void 0);k(this,mt,(r,e)=>r.getElementsByTagName(e)[0]);k(this,fe,(r,e)=>{let n=b(this,mt).call(this,r,e);return n?n.textContent:""});L(this,qt,e),L(this,gt,e.parseFromString(r,"application/xml"))}collection({sortDirectoriesFirst:r=!1}={}){return b(this,ze)||L(this,ze,new ft(this.responseToPrimitives(b(this,gt).getElementsByTagName("D:response")),{sortDirectoriesFirst:r})),b(this,ze)}responseToPrimitives(r){return Array.from(r).map(e=>({directory:!!b(this,mt).call(this,e,"D:collection"),fullPath:b(this,fe).call(this,e,"D:href"),modified:Date.parse(b(this,fe).call(this,e,"lp1:getlastmodified")||b(this,fe).call(this,e,"D:getlastmodified")),size:parseInt(b(this,fe).call(this,e,"lp1:getcontentlength")||b(this,fe).call(this,e,"D:getcontentlength"),10),mimeType:b(this,fe).call(this,e,"D:getcontenttype")}))}};ze=new WeakMap,gt=new WeakMap,qt=new WeakMap,mt=new WeakMap,fe=new WeakMap;var yt,we,Z,bt,wt,de,vt=class extends U{constructor({bypassCheck:e,sortDirectoriesFirst:n},t=new Map,a=new nt){super();k(this,yt,void 0);k(this,we,void 0);k(this,Z,void 0);k(this,bt,void 0);k(this,wt,e=>{let n=`${location.protocol}//${location.hostname}${location.port?`:${location.port}`:""}`,t=new RegExp(`^${n}`);if(!e.match(t)){if(e.match(/^http/))throw new TypeError(`Invalid destination host: '${e}'.`);return`${n}${e}`}return e});k(this,de,(e,n,...t)=>(this.trigger(`${n}:request`,...t),e().then(a=>a?(this.trigger(`${n}:success`,...t),a):(this.trigger(`${n}:failed`,...t),a)).catch(()=>{this.trigger(`${n}:failed`,...t)})));L(this,yt,e),L(this,bt,n),L(this,we,t),L(this,Z,a),this.bindEvents()}bindEvents(){this.on("cache:invalidate",e=>{b(this,we).has(e)&&b(this,we).delete(e)})}check(e){return F(this,null,function*(){return b(this,yt)?{ok:!0,status:200}:b(this,Z).HEAD(e)})}copy(e,n,t=null){return F(this,null,function*(){return b(this,de).call(this,()=>b(this,Z).COPY(e,{headers:{Destination:b(this,wt).call(this,n)}}),"copy",e,n,t)})}del(e,n=null){return F(this,null,function*(){return b(this,de).call(this,()=>b(this,Z).DELETE(e),"delete",e,n)})}get(e){return F(this,null,function*(){return b(this,de).call(this,()=>b(this,Z).GET(e),"get",e)})}list(e,n=!1){return F(this,null,function*(){if(e=le(e),!n){let u=yield b(this,we).get(e);if(u)return u}let t=yield this.check(e);if(!t||!t.ok&&t.status!==405)return;let a=yield b(this,Z).PROPFIND(e),o=new pt(yield a.text()),s=o.collection({sortDirectoriesFirst:b(this,bt)});return b(this,we).set(e,s),s})}mkcol(e,n="",t=""){return F(this,null,function*(){return b(this,de).call(this,()=>b(this,Z).MKCOL(e),"mkcol",e,n,t)})}move(e,n,t){return F(this,null,function*(){let a=b(this,wt).call(this,n);return b(this,de).call(this,()=>b(this,Z).MOVE(e,{headers:{Destination:t.directory?le(a):a}}),"move",e,n,t)})}upload(e,n){return F(this,null,function*(){let t=$(e,n.name);return b(this,de).call(this,()=>b(this,Z).PUT(t,{headers:{"Content-Type":n.type},body:n}),"upload",e,n)})}};yt=new WeakMap,we=new WeakMap,Z=new WeakMap,bt=new WeakMap,wt=new WeakMap,de=new WeakMap;var Qr=[],ii=Qr.forEach,ai=Qr.slice;function oi(i){return ii.call(ai.call(arguments,1),function(r){if(r)for(var e in r)i[e]===void 0&&(i[e]=r[e])}),i}var Gr=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,si=function(r,e,n){var t=n||{};t.path=t.path||"/";var a=encodeURIComponent(e),o="".concat(r,"=").concat(a);if(t.maxAge>0){var s=t.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(s))}if(t.domain){if(!Gr.test(t.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(t.domain)}if(t.path){if(!Gr.test(t.path))throw new TypeError("option path is invalid");o+="; Path=".concat(t.path)}if(t.expires){if(typeof t.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires=".concat(t.expires.toUTCString())}if(t.httpOnly&&(o+="; HttpOnly"),t.secure&&(o+="; Secure"),t.sameSite){var u=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},Yr={create:function(r,e,n,t){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),t&&(a.domain=t),document.cookie=si(r,encodeURIComponent(e),a)},read:function(r){for(var e="".concat(r,"="),n=document.cookie.split(";"),t=0;t-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var t=n.substring(1),a=t.split("&"),o=0;o0){var u=a[o].substring(0,s);u===r.lookupQuerystring&&(e=a[o].substring(s+1))}}}return e}},xt=null,Zr=function(){if(xt!==null)return xt;try{xt=window!=="undefined"&&window.localStorage!==null;var r="i18next.translate.boo";window.localStorage.setItem(r,"foo"),window.localStorage.removeItem(r)}catch{xt=!1}return xt},ci={name:"localStorage",lookup:function(r){var e;if(r.lookupLocalStorage&&Zr()){var n=window.localStorage.getItem(r.lookupLocalStorage);n&&(e=n)}return e},cacheUserLanguage:function(r,e){e.lookupLocalStorage&&Zr()&&window.localStorage.setItem(e.lookupLocalStorage,r)}},St=null,Xr=function(){if(St!==null)return St;try{St=window!=="undefined"&&window.sessionStorage!==null;var r="i18next.translate.boo";window.sessionStorage.setItem(r,"foo"),window.sessionStorage.removeItem(r)}catch{St=!1}return St},fi={name:"sessionStorage",lookup:function(r){var e;if(r.lookupSessionStorage&&Xr()){var n=window.sessionStorage.getItem(r.lookupSessionStorage);n&&(e=n)}return e},cacheUserLanguage:function(r,e){e.lookupSessionStorage&&Xr()&&window.sessionStorage.setItem(e.lookupSessionStorage,r)}},di={name:"navigator",lookup:function(r){var e=[];if(typeof navigator<"u"){if(navigator.languages)for(var n=0;n0?e:void 0}},hi={name:"htmlTag",lookup:function(r){var e,n=r.htmlTag||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(e=n.getAttribute("lang")),e}},pi={name:"path",lookup:function(r){var e;if(typeof window<"u"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof r.lookupFromPathIndex=="number"){if(typeof n[r.lookupFromPathIndex]!="string")return;e=n[r.lookupFromPathIndex].replace("/","")}else e=n[0].replace("/","")}return e}},gi={name:"subdomain",lookup:function(r){var e=typeof r.lookupFromSubdomainIndex=="number"?r.lookupFromSubdomainIndex+1:1,n=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!n)return n[e]}};function mi(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var or=function(){function i(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};V(this,i),this.type="languageDetector",this.detectors={},this.init(r,e)}return K(i,[{key:"init",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=oi(n,this.options||{},mi()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=t,this.addDetector(ui),this.addDetector(li),this.addDetector(ci),this.addDetector(fi),this.addDetector(di),this.addDetector(hi),this.addDetector(pi),this.addDetector(gi)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var n=this;e||(e=this.options.order);var t=[];return e.forEach(function(a){if(n.detectors[a]){var o=n.detectors[a].lookup(n.options);o&&typeof o=="string"&&(o=[o]),o&&(t=t.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}},{key:"cacheUserLanguage",value:function(e,n){var t=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(function(a){t.detectors[a]&&t.detectors[a].cacheUserLanguage(e,t.options)}))}}]),i}();or.type="languageDetector";var Ot=class extends Error{};var en={translation:{pangram:"\u201EFix, Schwyz!\u201C, qu\xE4kt J\xFCrgen bl\xF6d vom Pa\xDF.",alphabet:"Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz \xC4\xE4 \xD6\xF6 \xDC\xFC \u1E9E\xDF",dropFilesAnywhereToUpload:"Datei/en hineinverschieben um sie hochzuladen",uploadFiles:"Datei/en hochladen",or:"oder",createNewDirectory:"Neuen Ordner erstellen",delete:"L\xF6schen",rename:"Umbenennen",download:"Herunterladen",deleteConfirmation:"Willst du wirklich die Datei '%s' l\xF6schen?",overwriteFileConfimation:"Die Datei '{{file}}' existiert bereits, willst du sie \xFCberschreiben?",failure:"{{method}} {{url}} fehlgeschlagen: {{statusText}} ({{status}})",successfullyUploaded:"'{{file}}' wurde erfolgreich hochgeladen.",successfullyRenamed:"'{{from}}' wurde erfolgreich umbenannt in '{{to}}'.",successfullyMoved:"'{{from}}' wurde erfolgreich verschoben nach '{{to}}'.",successfullyDeleted:"'{{file}}' wurde gel\xF6scht.",successfullyCreated:"'{{directoryName}}' wurde erstellt."}};var tn={translation:{pangram:"The quick brown fox jumps over the lazy dog.",alphabet:"Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz",dropFilesAnywhereToUpload:"Drop files anywhere to upload",uploadFiles:"upload files",or:"or",createNewDirectory:"create new directory",directoryName:"Directory name",delete:"Delete",rename:"Rename",download:"Download",deleteConfirmation:"Are you sure you want to delete '{{file}}'?",overwriteFileConfimation:"A file called '{{file}}' already exists, would you like to overwrite it?",failure:"{{method}} {{url}} failed: {{statusText}} ({{status}})",successfullyUploaded:"'{{file}}' has been successfully uploaded.",successfullyRenamed:"'{{from}}' successfully renamed to '{{to}}'.",successfullyMoved:"'{{from}}' successfully moved to '{{to}}'.",successfullyDeleted:"'{{file}}' has been deleted.",successfullyCreated:"'{{directoryName}}' has been created."}};var rn={translation:{pangram:"Lu\xEDs arg\xFCia \xE0 J\xFAlia que \xABbra\xE7\xF5es, f\xE9, ch\xE1, \xF3xido, p\xF4r, z\xE2ng\xE3o\xBB eram palavras do portugu\xEAs.",alphabet:"Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz \xC1\xE1 \xC2\xE2 \xC3\xE3 \xC0\xE0 \xC7\xE7 \xC9\xE9 \xCA\xEA \xCD\xED \xD3\xF3 \xD4\xF4 \xD5\xF5 \xDA\xFA",dropFilesAnywhereToUpload:"Mova o(s) arquivo(s) interno(s) para carreg\xE1-los",uploadFiles:"Carregar arquivo(s)",or:"ou",createNewDirectory:"Criar uma nova pasta",delete:"Eliminar",rename:"Renomear",download:"Descarregar",deleteConfirmation:'Quer mesmo apagar o arquivo "{{file}}"?',overwriteFileConfimation:'O arquivo "{{file}}" j\xE1 existe, voc\xEA quer sobrescrev\xEA-lo?',failure:"{{method}} {{url}} falhou: {{statusText}} ({{status}})",successfullyUploaded:'"{{file}}" foi carregada com \xEAxito.',successfullyRenamed:'"{{from}}" foi alterado para "{{to}}" com \xEAxito.',successfullyMoved:'"{{from}}" foi transferida com \xEAxito para "{{to}}".',successfullyDeleted:'"{{file}}" foi suprimido.',successfullyCreated:'"{{directoryName}}" foi criada.'}};var kt,Lt,Pt,Et=class extends U{constructor(e,n={},t=new vt({bypassCheck:(a=>(a=n.bypassCheck)!=null?a:!1)(),sortDirectoriesFirst:(o=>(o=n.sortDirectoriesFirst)!=null?o:!1)()})){super();k(this,kt,void 0);k(this,Lt,void 0);k(this,Pt,void 0);if(!(e instanceof HTMLElement))throw new TypeError(`Invalid container element: '${e}'.`);L(this,kt,e),L(this,Lt,t),L(this,Pt,n),A.use(or).init({detection:{caches:[]},fallbackLng:"en",resources:{de:en,en:tn,pt:rn}})}get options(){return ue({},b(this,Pt))}get dav(){return b(this,Lt)}get container(){return b(this,kt)}render(){throw new Ot("'render' must be implemented in the child class.")}};kt=new WeakMap,Lt=new WeakMap,Pt=new WeakMap;var Ct=class extends Et{render(r=new tt,e=new rt){this.container.appendChild(r.element),this.container.appendChild(e.element),this.bindEvents(),this.trigger("go")}bindEvents(r=this.container){let e=s=>{let u=document.createElement("span");return u.setAttribute(`on${s}`,""),typeof u[`on${s}`]=="function"},n=e("touchstart"),t=e("dragstart")&&e("drop"),a=s=>{document.title!==s&&(document.title=s)},o=s=>{location.pathname!==s&&history.pushState(history.state,s,s)};n&&this.container.classList.add("is-touch"),t||this.container.classList.add("no-drag-drop"),window.addEventListener("popstate",()=>{let s=location.pathname;if(r.dispatchEvent(new CustomEvent("preview:close",{bubbles:!0,detail:{preview:!0}})),s.endsWith("/"))return this.trigger("go");let u=s.replace(/[^/]+$/,"");this.trigger("go",u,{bypassPushState:!0,success:()=>{var c;return(c=this.container.querySelector(`main ul li[data-full-path="${s}"]`))==null?void 0:c.dispatchEvent(new CustomEvent("click"))}})}),t&&(["dragenter","dragover"].forEach(s=>{r.addEventListener(s,u=>{u.preventDefault(),u.stopPropagation(),r.classList.add("active")})}),["dragleave","drop"].forEach(s=>{r.addEventListener(s,u=>{u.preventDefault(),u.stopPropagation(),r.classList.remove("active")})}),r.addEventListener("drop",s=>F(this,null,function*(){let{files:u}=s.dataTransfer;for(let c of u)this.trigger("upload",location.pathname,c)}))),this.on("error",({method:s,url:u,response:c})=>{new Te.default({content:A.t("failure",{interpolation:{escapeValue:!1},method:s,url:u,statusText:c.statusText,status:c.status}),type:"error"})}),this.on("upload",(s,u)=>F(this,null,function*(){let c=yield this.dav.list(s),[g]=c.filter(l=>l.name===u.name);if(g&&!confirm(A.t("overwriteFileConfirmation",{file:g.title})))return!1;yield this.dav.upload(s,u)})),this.on("upload:success",(s,u)=>F(this,null,function*(){new Te.default({content:A.t("successfullyUploaded",{interpolation:{escapeValue:!1},file:u.name}),type:"success",hide:5})})),this.on("move",(s,u,c)=>F(this,null,function*(){yield this.dav.move(s,u,c)})),this.on("move:success",(s,u,c)=>{let[,g,l]=u.match(/^(.*)\/([^/]+\/?)$/),v=g&&g.replace(`${location.protocol}//${location.hostname}${location.port?`:${location.port}`:""}`,"");if(c.path===v||c.directory)return new Te.default({content:A.t("successfullyRenamed",{interpolation:{escapeValue:!1},from:c.title,to:decodeURIComponent(l)}),type:"success",hide:5});new Te.default({content:A.t("successfullyMoved",{interpolation:{escapeValue:!1},from:c.title,to:decodeURIComponent(v)}),type:"success",hide:5})}),this.on("delete",(s,u)=>F(this,null,function*(){yield this.dav.del(s,u)})),this.on("delete:success",(s,u)=>{new Te.default({content:A.t("successfullyDeleted",{interpolation:{escapeValue:!1},file:u.title}),type:"success",hide:5})}),this.on("get",(s,u)=>F(this,null,function*(){let c=yield this.dav.get(s);u(c&&(yield c.text()))})),this.on("check",(s,u,c)=>F(this,null,function*(){let g=yield this.dav.check(s);if(g&&g.ok&&u){u(g);return}c&&c()})),this.on("create-directory",(s,u,c)=>F(this,null,function*(){yield this.dav.mkcol(s,u,c)})),this.on("mkcol:success",(s,u)=>{new Te.default({content:A.t("successfullyCreated",{interpolation:{escapeValue:!1},directoryName:u}),type:"success",hide:5})}),this.on("go",(...v)=>F(this,[...v],function*(s=location.pathname,{bypassCache:u=!1,bypassPushState:c=!1,failure:g=null,success:l=null}={}){let m=location.pathname;this.trigger("list:update:request",s);let x=yield this.dav.list(s,u);if(!x){this.trigger("list:update:failed"),g&&g();return}this.trigger("list:update:success",x),c||o(s),a(`${decodeURIComponent(s)} | WebDAV`),l&&l(x)})),this.on("preview:opened",s=>{var u;document.body.classList.add("preview-open"),(u=this.container.querySelector(`[data-full-path="${s.fullPath}"]`))==null||u.focus(),o(s.fullPath),a(`${decodeURIComponent(s.fullPath)} | WebDAV`)}),this.on("preview:closed",(s,{preview:u=!1}={})=>{if(u)return;let c=le(s.path);document.body.classList.remove("preview-open"),o(c),a(`${decodeURIComponent(c)} | WebDAV`)})}};var nn=new Ct(document.body,{bypassCheck:!!document.querySelector("[data-disable-check]"),sortDirectoriesFirst:!!document.querySelector("[data-sort-directories-first]")});document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>nn.render()):nn.render();})(); +

          ${o}

          `},text:(e,n)=>`
          ${n.replace(/[<>]/g,r=>r==="<"?"<":">")}
          `,pdf:e=>``}));C(this,ye,n),C(this,ue,r),C(this,q,e),this.addClass(e.directory?"directory":"file",e.type?e.type:"unknown"),e.placeholder&&this.addClass("loading"),e.del||this.query(".delete").setAttribute("hidden",""),e.rename||this.query(".rename").setAttribute("hidden",""),this.bindEvents()}bindEvents(){this.on("click",n=>{if(n.ctrlKey||n.button===1){window.open(h(this,q).fullPath);return}if(n.shiftKey){this.download();return}this.open()});let e=()=>{h(this,q).off("updated",e),this.update()};h(this,q).on("updated",e),(0,F.on)(this.query("[download]"),"click",n=>n.stopPropagation()),(0,F.on)(this.query(".delete"),"click",n=>{n.preventDefault(),n.stopPropagation(),this.del()}),(0,F.on)(this.query(".rename"),"click",n=>{n.stopPropagation(),n.preventDefault(),this.rename()}),this.on("keydown",n=>{if(["F2","Delete","Enter"].includes(n.key)){if(n.preventDefault(),n.key==="F2"&&h(this,q).rename&&this.rename(),n.key==="Delete"&&h(this,q).del&&this.del(),n.key==="Enter"&&!h(this,q).directory&&n.shiftKey){this.download();return}n.key==="Enter"&&this.open()}})}del(){return T(this,null,function*(){let e=h(this,q);if(!e.del)throw new TypeError(`'${e.name}' is read only.`);if(this.addClass("loading"),!confirm(j("deleteConfirmation",{file:e.title}))){this.removeClass("loading");return}!(yield h(this,ye).del(e.fullPath))||(h(this,ue).getCollection().remove(h(this,q)),this.element().remove(),(0,jr.success)(j("successfullyDeleted",{interpolation:{escapeValue:!1},file:e.title})))})}download(){h(this,q).directory||(0,F.emit)(this.query("[download]"),new MouseEvent("click"))}open(){return T(this,null,function*(){if(this.hasClass("open"))return;this.addClass("open","loading");let e=h(this,q);if(!(yield h(this,ye).check(e.fullPath))){this.removeClass("open","loading");return}if(e.directory){h(this,ue).setPath(e.fullPath),this.removeClass("open","loading");return}let r=(o,s=null)=>{let u=()=>y.close(),v=l=>{if(!["Escape","ArrowUp","ArrowDown"].includes(l.key))return;let[m,g]=hr(this.element(),'li:not(.directory):not([data-type="unknown"])');u(),l.key==="ArrowUp"&&m&&(0,F.emit)(m,new MouseEvent("click")),l.key==="ArrowDown"&&g&&(0,F.emit)(g,new MouseEvent("click"))},y=(0,Yn.create)(o,{className:e.type,onShow:()=>(this.removeClass("loading"),(0,F.on)(document,"keydown",v),s&&s(y),h(this,ue).showPath(e.fullPath),h(this,ue).on("updated",u),!0),onClose:()=>((0,F.off)(document,"keydown",v),h(this,ue).off("updated",u),h(this,ue).showPath(e.path),this.removeClass("open"),!0)});y.show()};if(["video","audio","image","font","pdf"].includes(e.type)){r(h(this,Ut)[e.type](e)),this.removeClass("loading");return}if(e.type!=="text"){this.removeClass("open","loading"),this.download();return}let a=yield h(this,ye).get(e.fullPath);if(!a){this.removeClass("open","loading");return}r(h(this,Ut).text(e,a),o=>Zn.default.highlightAllUnder(o.element())),this.removeClass("loading")})}rename(){return T(this,null,function*(){let e=h(this,q);if(!e.rename)throw new TypeError(`'${e.name}' cannot be renamed.`);let n=this.element(),r=this.query(".title"),a=this.query("input"),o=()=>{r.innerText=a.value,a.style.setProperty("width",`${r.scrollWidth}px`)},s=()=>T(this,null,function*(){if(a.value!==e.title){this.addClass("loading"),u();let g=B(e.path,a.value);if(!(yield h(this,ye).move(e.fullPath,g,e)))return;(0,jr.success)(j("successfullyRenamed",{interpolation:{escapeValue:!1},from:e.title,to:a.value})),e.name=a.value}v()}),u=()=>{(0,F.off)(a,"blur",y),(0,F.off)(a,"keydown",l),(0,F.off)(a,"input",m)},v=()=>{(0,F.removeClass)(r,"invisible"),(0,F.addClass)(a,"hidden"),a.value=e.title,o(),u(),n.focus()},y=()=>T(this,null,function*(){yield s()}),l=g=>T(this,null,function*(){g.stopPropagation(),g.key==="Enter"&&(g.preventDefault(),yield s()),g.key==="Escape"&&v()}),m=()=>o();(0,F.addClass)(r,"invisible"),(0,F.removeClass)(a,"hidden"),a.value=e.title,o(),a.removeAttribute("readonly"),(0,F.on)(a,"blur",y),(0,F.on)(a,"keydown",l),(0,F.on)(a,"input",m),a.focus()})}update(){let e=new Nr(h(this,q),h(this,ye),h(this,ue));this.element().replaceWith(e.element())}},qt=Nr;ye=new WeakMap,q=new WeakMap,ue=new WeakMap,Ut=new WeakMap;var Za=(()=>{try{return document.querySelector(":focus-within"),!0}catch(i){return!1}})(),Qn=Za;var ft,ne,$r=class extends De.default{constructor(e,n){super((0,De.s)('
            '));x(this,ft,void 0);x(this,ne,void 0);C(this,ft,e),C(this,ne,n),this.load(),this.bindEvents()}bindEvents(){h(this,ne).on("updated",n=>{if(h(this,ne).isDirectory()){this.load(n);return}let r=this.query(`[data-full-path="${h(this,ne).getPath()}"]`);!r||(0,De.emit)(r,new MouseEvent("click"))}),h(this,ne).on("collection-updated",()=>this.render()),(0,De.on)(document,"keydown",n=>{if(!["ArrowUp","ArrowDown"].includes(n.key))return;n.preventDefault(),n.stopPropagation();let r=this.query(`li:focus${Qn?", li:focus-within":""}`),[a,o]=r?hr(r):[this.element().firstElementChild,this.element().firstElementChild];n.key==="ArrowUp"&&a&&a.focus(),n.key==="ArrowDown"&&o&&o.focus()})}load(e=!1){return T(this,null,function*(){let n=yield h(this,ft).list(h(this,ne).getPath(),e);!n||this.update(n)})}render(){this.addClass("loading"),this.empty(),h(this,ne).getCollection().forEach(e=>this.append(new qt(e,h(this,ft),h(this,ne)))),this.removeClass("loading")}update(e){h(this,ne).setCollection(e),this.render()}};ft=new WeakMap,ne=new WeakMap;var Xn=$r;var ei=Y(Ce());var ze,Be,Ht,dt,pr,Kt,Mr=class extends Xe{constructor(e,n){super();x(this,ze,void 0);x(this,Be,void 0);x(this,Ht,void 0);x(this,dt,void 0);x(this,pr,void 0);x(this,Kt,()=>this.emit("collection-updated"));C(this,dt,e),C(this,pr,n),C(this,Be,n.location),C(this,Ht,n.history),this.bindEvents(),this.setTitle(this.getPath())}bindEvents(){(0,ei.on)(window,"popstate",()=>this.update())}getCollection(){return h(this,ze)}getPath(){return h(this,Be).pathname}getTitleForPath(e){return j("title",{interpolation:{escapeValue:!1},path:decodeURIComponent(e)})}isDirectory(){return this.getPath().endsWith("/")}setCollection(e){h(this,ze)&&h(this,ze).off("updated",h(this,Kt)),C(this,ze,e),e.on("updated",h(this,Kt))}setPath(e){h(this,Be).pathname!==e&&(this.showPath(e),this.emit("updated"))}setTitle(e){let n=this.getTitleForPath(e);h(this,dt).title!==n&&(h(this,dt).title=n)}showPath(e){h(this,Be).pathname!==e&&(h(this,Ht).pushState({path:e},this.getTitleForPath(e),e),this.setTitle(e))}update(e=!1){this.emit("updated",e)}};ze=new WeakMap,Be=new WeakMap,Ht=new WeakMap,dt=new WeakMap,pr=new WeakMap,Kt=new WeakMap;var ti=Mr;var _r=document.createElement("span"),ri=(...i)=>i.every(t=>ni(t)),ni=i=>{let t=`on${i}`;return _r.hasAttribute(t)||_r.setAttribute(t,""),typeof _r[`on${i}`]=="function"},ii=ni;var ai=Y(Ce());var Vt,zt,Ir=class extends ai.default{constructor(e,n,r){super(e);x(this,Vt,void 0);x(this,zt,void 0);C(this,Vt,n),C(this,zt,r),this.bindEvents()}dav(){return h(this,Vt)}state(){return h(this,zt)}};Vt=new WeakMap,zt=new WeakMap;var oi=Ir;var qr=class extends oi{bindEvents(){let t=ii("touchstart"),e=ri("dragstart","drop");t&&this.addClass("is-touch"),e||this.addClass("no-drag-drop"),e&&(this.onEach(["dragenter","dragover"],n=>{n.preventDefault(),n.stopPropagation(),this.addClass("active")}),this.onEach(["dragleave","drop"],n=>{n.preventDefault(),n.stopPropagation(),this.removeClass("active")}),this.on("drop",n=>T(this,null,function*(){let{files:r}=n.dataTransfer;for(let a of r)yield cr(this.dav(),this.state(),a)})))}},si=qr;var ui={translation:{pangram:"\u201EFix, Schwyz!\u201C, qu\xE4kt J\xFCrgen bl\xF6d vom Pa\xDF.",alphabet:"Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz \xC4\xE4 \xD6\xF6 \xDC\xFC \u1E9E\xDF",dropFilesAnywhereToUpload:"Datei/en hineinverschieben um sie hochzuladen",uploadFiles:"Datei/en hochladen",or:"oder",createNewDirectory:"Neuen Ordner erstellen",delete:"L\xF6schen",rename:"Umbenennen",download:"Herunterladen",deleteConfirmation:"Willst du wirklich die Datei '%s' l\xF6schen?",overwriteFileConfirmation:"Die Datei '{{file}}' existiert bereits, willst du sie \xFCberschreiben?",failure:"{{method}} {{url}} fehlgeschlagen: {{statusText}} ({{status}})",successfullyUploaded:"'{{file}}' wurde erfolgreich hochgeladen.",successfullyRenamed:"'{{from}}' wurde erfolgreich umbenannt in '{{to}}'.",successfullyMoved:"'{{from}}' wurde erfolgreich verschoben nach '{{to}}'.",successfullyDeleted:"'{{file}}' wurde gel\xF6scht.",successfullyCreated:"'{{directoryName}}' wurde erstellt.",title:"{{path}} | WebDAV"}};var li={translation:{pangram:"The quick brown fox jumps over the lazy dog.",alphabet:"Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz",dropFilesAnywhereToUpload:"Drop files anywhere to upload",uploadFiles:"upload files",or:"or",createNewDirectory:"create new directory",directoryName:"Directory name",delete:"Delete",rename:"Rename",download:"Download",deleteConfirmation:"Are you sure you want to delete '{{file}}'?",overwriteFileConfirmation:"A file called '{{file}}' already exists, would you like to overwrite it?",failure:"{{method}} {{url}} failed: {{statusText}} ({{status}})",successfullyUploaded:"'{{file}}' has been successfully uploaded.",successfullyRenamed:"'{{from}}' successfully renamed to '{{to}}'.",successfullyMoved:"'{{from}}' successfully moved to '{{to}}'.",successfullyDeleted:"'{{file}}' has been deleted.",successfullyCreated:"'{{directoryName}}' has been created.",title:"{{path}} | WebDAV"}};var ci={translation:{pangram:"Lu\xEDs arg\xFCia \xE0 J\xFAlia que \xABbra\xE7\xF5es, f\xE9, ch\xE1, \xF3xido, p\xF4r, z\xE2ng\xE3o\xBB eram palavras do portugu\xEAs.",alphabet:"Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz \xC1\xE1 \xC2\xE2 \xC3\xE3 \xC0\xE0 \xC7\xE7 \xC9\xE9 \xCA\xEA \xCD\xED \xD3\xF3 \xD4\xF4 \xD5\xF5 \xDA\xFA",dropFilesAnywhereToUpload:"Mova o(s) arquivo(s) interno(s) para carreg\xE1-los",uploadFiles:"Carregar arquivo(s)",or:"ou",createNewDirectory:"Criar uma nova pasta",delete:"Eliminar",rename:"Renomear",download:"Descarregar",deleteConfirmation:'Quer mesmo apagar o arquivo "{{file}}"?',overwriteFileConfirmation:'O arquivo "{{file}}" j\xE1 existe, voc\xEA quer sobrescrev\xEA-lo?',failure:"{{method}} {{url}} falhou: {{statusText}} ({{status}})",successfullyUploaded:'"{{file}}" foi carregada com \xEAxito.',successfullyRenamed:'"{{from}}" foi alterado para "{{to}}" com \xEAxito.',successfullyMoved:'"{{from}}" foi transferida com \xEAxito para "{{to}}".',successfullyDeleted:'"{{file}}" foi suprimido.',successfullyCreated:'"{{directoryName}}" foi criada.',title:"{{path}} | WebDAV"}};$n(Fr).init({detection:{caches:[]},fallbackLng:"en",resources:{de:ui,en:li,pt:ci}}).then(()=>{let i=new ti(document,window),t=new Tt({bypassCheck:!!document.querySelector("[data-disable-check]"),sortDirectoriesFirst:!!document.querySelector("[data-sort-directories-first]")}),e=new gt,n=new Un(i),r=new Xn(t,i),a=new Mt(t,i),o=new si(document.body,t,i);e.append(n,r),o.append(e,a)});})(); /** * Prism: Lightweight, robust, elegant syntax highlighting * diff --git a/src/webdav.js.map b/src/webdav.js.map new file mode 100644 index 0000000..3a3a6f0 --- /dev/null +++ b/src/webdav.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../node_modules/css-what/lib/commonjs/types.js", "../node_modules/css-what/lib/commonjs/parse.js", "../node_modules/css-what/lib/commonjs/stringify.js", "../node_modules/css-what/lib/commonjs/index.js", "../node_modules/@dom111/element/dist/Element.js", "../node_modules/melba-toast/src/Melba.ts", "../node_modules/melba-toast/node_modules/@dom111/typed-event-emitter/EventEmitter.ts", "../node_modules/melba-toast/src/lib/supportsFocusWithin.ts", "../node_modules/basiclightbox/dist/basicLightbox.min.js", "../node_modules/prismjs/prism.js", "../src/components/Container.ts", "../node_modules/@dom111/typed-event-emitter/EventEmitter.ts", "../src/lib/joinPath.ts", "../src/lib/trailingSlash.ts", "../src/lib/Entry.ts", "../src/lib/Collection.ts", "../src/lib/Response.ts", "../src/lib/HTTP/RequestFailure.ts", "../src/lib/HTTP.ts", "../src/lib/DAV.ts", "../node_modules/@babel/runtime/helpers/esm/typeof.js", "../node_modules/@babel/runtime/helpers/esm/classCallCheck.js", "../node_modules/@babel/runtime/helpers/esm/createClass.js", "../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js", "../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js", "../node_modules/@babel/runtime/helpers/esm/inherits.js", "../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js", "../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js", "../node_modules/@babel/runtime/helpers/esm/defineProperty.js", "../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js", "../node_modules/@babel/runtime/helpers/esm/iterableToArray.js", "../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js", "../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js", "../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js", "../node_modules/@babel/runtime/helpers/esm/toArray.js", "../node_modules/i18next/dist/esm/i18next.js", "../src/components/Footer.ts", "../src/lib/handleFileUpload.ts", "../src/components/Header.ts", "../node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js", "../src/components/List.ts", "../src/components/Item.ts", "../src/lib/previewItems.ts", "../src/lib/supportsFocusWithin.ts", "../src/lib/State.ts", "../src/lib/supportsEvent.ts", "../src/lib/AbstractUI.ts", "../src/components/UI.ts", "../src/webdav.ts"], + "sourcesContent": ["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AttributeAction = exports.IgnoreCaseMode = exports.SelectorType = void 0;\nvar SelectorType;\n(function (SelectorType) {\n SelectorType[\"Attribute\"] = \"attribute\";\n SelectorType[\"Pseudo\"] = \"pseudo\";\n SelectorType[\"PseudoElement\"] = \"pseudo-element\";\n SelectorType[\"Tag\"] = \"tag\";\n SelectorType[\"Universal\"] = \"universal\";\n // Traversals\n SelectorType[\"Adjacent\"] = \"adjacent\";\n SelectorType[\"Child\"] = \"child\";\n SelectorType[\"Descendant\"] = \"descendant\";\n SelectorType[\"Parent\"] = \"parent\";\n SelectorType[\"Sibling\"] = \"sibling\";\n SelectorType[\"ColumnCombinator\"] = \"column-combinator\";\n})(SelectorType = exports.SelectorType || (exports.SelectorType = {}));\n/**\n * Modes for ignore case.\n *\n * This could be updated to an enum, and the object is\n * the current stand-in that will allow code to be updated\n * without big changes.\n */\nexports.IgnoreCaseMode = {\n Unknown: null,\n QuirksMode: \"quirks\",\n IgnoreCase: true,\n CaseSensitive: false,\n};\nvar AttributeAction;\n(function (AttributeAction) {\n AttributeAction[\"Any\"] = \"any\";\n AttributeAction[\"Element\"] = \"element\";\n AttributeAction[\"End\"] = \"end\";\n AttributeAction[\"Equals\"] = \"equals\";\n AttributeAction[\"Exists\"] = \"exists\";\n AttributeAction[\"Hyphen\"] = \"hyphen\";\n AttributeAction[\"Not\"] = \"not\";\n AttributeAction[\"Start\"] = \"start\";\n})(AttributeAction = exports.AttributeAction || (exports.AttributeAction = {}));\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parse = exports.isTraversal = void 0;\nvar types_1 = require(\"./types\");\nvar reName = /^[^\\\\#]?(?:\\\\(?:[\\da-f]{1,6}\\s?|.)|[\\w\\-\\u00b0-\\uFFFF])+/;\nvar reEscape = /\\\\([\\da-f]{1,6}\\s?|(\\s)|.)/gi;\nvar actionTypes = new Map([\n [126 /* Tilde */, types_1.AttributeAction.Element],\n [94 /* Circumflex */, types_1.AttributeAction.Start],\n [36 /* Dollar */, types_1.AttributeAction.End],\n [42 /* Asterisk */, types_1.AttributeAction.Any],\n [33 /* ExclamationMark */, types_1.AttributeAction.Not],\n [124 /* Pipe */, types_1.AttributeAction.Hyphen],\n]);\n// Pseudos, whose data property is parsed as well.\nvar unpackPseudos = new Set([\n \"has\",\n \"not\",\n \"matches\",\n \"is\",\n \"where\",\n \"host\",\n \"host-context\",\n]);\n/**\n * Checks whether a specific selector is a traversal.\n * This is useful eg. in swapping the order of elements that\n * are not traversals.\n *\n * @param selector Selector to check.\n */\nfunction isTraversal(selector) {\n switch (selector.type) {\n case types_1.SelectorType.Adjacent:\n case types_1.SelectorType.Child:\n case types_1.SelectorType.Descendant:\n case types_1.SelectorType.Parent:\n case types_1.SelectorType.Sibling:\n case types_1.SelectorType.ColumnCombinator:\n return true;\n default:\n return false;\n }\n}\nexports.isTraversal = isTraversal;\nvar stripQuotesFromPseudos = new Set([\"contains\", \"icontains\"]);\n// Unescape function taken from https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L152\nfunction funescape(_, escaped, escapedWhitespace) {\n var high = parseInt(escaped, 16) - 0x10000;\n // NaN means non-codepoint\n return high !== high || escapedWhitespace\n ? escaped\n : high < 0\n ? // BMP codepoint\n String.fromCharCode(high + 0x10000)\n : // Supplemental Plane codepoint (surrogate pair)\n String.fromCharCode((high >> 10) | 0xd800, (high & 0x3ff) | 0xdc00);\n}\nfunction unescapeCSS(str) {\n return str.replace(reEscape, funescape);\n}\nfunction isQuote(c) {\n return c === 39 /* SingleQuote */ || c === 34 /* DoubleQuote */;\n}\nfunction isWhitespace(c) {\n return (c === 32 /* Space */ ||\n c === 9 /* Tab */ ||\n c === 10 /* NewLine */ ||\n c === 12 /* FormFeed */ ||\n c === 13 /* CarriageReturn */);\n}\n/**\n * Parses `selector`, optionally with the passed `options`.\n *\n * @param selector Selector to parse.\n * @param options Options for parsing.\n * @returns Returns a two-dimensional array.\n * The first dimension represents selectors separated by commas (eg. `sub1, sub2`),\n * the second contains the relevant tokens for that selector.\n */\nfunction parse(selector) {\n var subselects = [];\n var endIndex = parseSelector(subselects, \"\".concat(selector), 0);\n if (endIndex < selector.length) {\n throw new Error(\"Unmatched selector: \".concat(selector.slice(endIndex)));\n }\n return subselects;\n}\nexports.parse = parse;\nfunction parseSelector(subselects, selector, selectorIndex) {\n var tokens = [];\n function getName(offset) {\n var match = selector.slice(selectorIndex + offset).match(reName);\n if (!match) {\n throw new Error(\"Expected name, found \".concat(selector.slice(selectorIndex)));\n }\n var name = match[0];\n selectorIndex += offset + name.length;\n return unescapeCSS(name);\n }\n function stripWhitespace(offset) {\n selectorIndex += offset;\n while (selectorIndex < selector.length &&\n isWhitespace(selector.charCodeAt(selectorIndex))) {\n selectorIndex++;\n }\n }\n function readValueWithParenthesis() {\n selectorIndex += 1;\n var start = selectorIndex;\n var counter = 1;\n for (; counter > 0 && selectorIndex < selector.length; selectorIndex++) {\n if (selector.charCodeAt(selectorIndex) ===\n 40 /* LeftParenthesis */ &&\n !isEscaped(selectorIndex)) {\n counter++;\n }\n else if (selector.charCodeAt(selectorIndex) ===\n 41 /* RightParenthesis */ &&\n !isEscaped(selectorIndex)) {\n counter--;\n }\n }\n if (counter) {\n throw new Error(\"Parenthesis not matched\");\n }\n return unescapeCSS(selector.slice(start, selectorIndex - 1));\n }\n function isEscaped(pos) {\n var slashCount = 0;\n while (selector.charCodeAt(--pos) === 92 /* BackSlash */)\n slashCount++;\n return (slashCount & 1) === 1;\n }\n function ensureNotTraversal() {\n if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1])) {\n throw new Error(\"Did not expect successive traversals.\");\n }\n }\n function addTraversal(type) {\n if (tokens.length > 0 &&\n tokens[tokens.length - 1].type === types_1.SelectorType.Descendant) {\n tokens[tokens.length - 1].type = type;\n return;\n }\n ensureNotTraversal();\n tokens.push({ type: type });\n }\n function addSpecialAttribute(name, action) {\n tokens.push({\n type: types_1.SelectorType.Attribute,\n name: name,\n action: action,\n value: getName(1),\n namespace: null,\n ignoreCase: \"quirks\",\n });\n }\n /**\n * We have finished parsing the current part of the selector.\n *\n * Remove descendant tokens at the end if they exist,\n * and return the last index, so that parsing can be\n * picked up from here.\n */\n function finalizeSubselector() {\n if (tokens.length &&\n tokens[tokens.length - 1].type === types_1.SelectorType.Descendant) {\n tokens.pop();\n }\n if (tokens.length === 0) {\n throw new Error(\"Empty sub-selector\");\n }\n subselects.push(tokens);\n }\n stripWhitespace(0);\n if (selector.length === selectorIndex) {\n return selectorIndex;\n }\n loop: while (selectorIndex < selector.length) {\n var firstChar = selector.charCodeAt(selectorIndex);\n switch (firstChar) {\n // Whitespace\n case 32 /* Space */:\n case 9 /* Tab */:\n case 10 /* NewLine */:\n case 12 /* FormFeed */:\n case 13 /* CarriageReturn */: {\n if (tokens.length === 0 ||\n tokens[0].type !== types_1.SelectorType.Descendant) {\n ensureNotTraversal();\n tokens.push({ type: types_1.SelectorType.Descendant });\n }\n stripWhitespace(1);\n break;\n }\n // Traversals\n case 62 /* GreaterThan */: {\n addTraversal(types_1.SelectorType.Child);\n stripWhitespace(1);\n break;\n }\n case 60 /* LessThan */: {\n addTraversal(types_1.SelectorType.Parent);\n stripWhitespace(1);\n break;\n }\n case 126 /* Tilde */: {\n addTraversal(types_1.SelectorType.Sibling);\n stripWhitespace(1);\n break;\n }\n case 43 /* Plus */: {\n addTraversal(types_1.SelectorType.Adjacent);\n stripWhitespace(1);\n break;\n }\n // Special attribute selectors: .class, #id\n case 46 /* Period */: {\n addSpecialAttribute(\"class\", types_1.AttributeAction.Element);\n break;\n }\n case 35 /* Hash */: {\n addSpecialAttribute(\"id\", types_1.AttributeAction.Equals);\n break;\n }\n case 91 /* LeftSquareBracket */: {\n stripWhitespace(1);\n // Determine attribute name and namespace\n var name_1 = void 0;\n var namespace = null;\n if (selector.charCodeAt(selectorIndex) === 124 /* Pipe */) {\n // Equivalent to no namespace\n name_1 = getName(1);\n }\n else if (selector.startsWith(\"*|\", selectorIndex)) {\n namespace = \"*\";\n name_1 = getName(2);\n }\n else {\n name_1 = getName(0);\n if (selector.charCodeAt(selectorIndex) === 124 /* Pipe */ &&\n selector.charCodeAt(selectorIndex + 1) !==\n 61 /* Equal */) {\n namespace = name_1;\n name_1 = getName(1);\n }\n }\n stripWhitespace(0);\n // Determine comparison operation\n var action = types_1.AttributeAction.Exists;\n var possibleAction = actionTypes.get(selector.charCodeAt(selectorIndex));\n if (possibleAction) {\n action = possibleAction;\n if (selector.charCodeAt(selectorIndex + 1) !==\n 61 /* Equal */) {\n throw new Error(\"Expected `=`\");\n }\n stripWhitespace(2);\n }\n else if (selector.charCodeAt(selectorIndex) === 61 /* Equal */) {\n action = types_1.AttributeAction.Equals;\n stripWhitespace(1);\n }\n // Determine value\n var value = \"\";\n var ignoreCase = null;\n if (action !== \"exists\") {\n if (isQuote(selector.charCodeAt(selectorIndex))) {\n var quote = selector.charCodeAt(selectorIndex);\n var sectionEnd = selectorIndex + 1;\n while (sectionEnd < selector.length &&\n (selector.charCodeAt(sectionEnd) !== quote ||\n isEscaped(sectionEnd))) {\n sectionEnd += 1;\n }\n if (selector.charCodeAt(sectionEnd) !== quote) {\n throw new Error(\"Attribute value didn't end\");\n }\n value = unescapeCSS(selector.slice(selectorIndex + 1, sectionEnd));\n selectorIndex = sectionEnd + 1;\n }\n else {\n var valueStart = selectorIndex;\n while (selectorIndex < selector.length &&\n ((!isWhitespace(selector.charCodeAt(selectorIndex)) &&\n selector.charCodeAt(selectorIndex) !==\n 93 /* RightSquareBracket */) ||\n isEscaped(selectorIndex))) {\n selectorIndex += 1;\n }\n value = unescapeCSS(selector.slice(valueStart, selectorIndex));\n }\n stripWhitespace(0);\n // See if we have a force ignore flag\n var forceIgnore = selector.charCodeAt(selectorIndex) | 0x20;\n // If the forceIgnore flag is set (either `i` or `s`), use that value\n if (forceIgnore === 115 /* LowerS */) {\n ignoreCase = false;\n stripWhitespace(1);\n }\n else if (forceIgnore === 105 /* LowerI */) {\n ignoreCase = true;\n stripWhitespace(1);\n }\n }\n if (selector.charCodeAt(selectorIndex) !==\n 93 /* RightSquareBracket */) {\n throw new Error(\"Attribute selector didn't terminate\");\n }\n selectorIndex += 1;\n var attributeSelector = {\n type: types_1.SelectorType.Attribute,\n name: name_1,\n action: action,\n value: value,\n namespace: namespace,\n ignoreCase: ignoreCase,\n };\n tokens.push(attributeSelector);\n break;\n }\n case 58 /* Colon */: {\n if (selector.charCodeAt(selectorIndex + 1) === 58 /* Colon */) {\n tokens.push({\n type: types_1.SelectorType.PseudoElement,\n name: getName(2).toLowerCase(),\n data: selector.charCodeAt(selectorIndex) ===\n 40 /* LeftParenthesis */\n ? readValueWithParenthesis()\n : null,\n });\n continue;\n }\n var name_2 = getName(1).toLowerCase();\n var data = null;\n if (selector.charCodeAt(selectorIndex) ===\n 40 /* LeftParenthesis */) {\n if (unpackPseudos.has(name_2)) {\n if (isQuote(selector.charCodeAt(selectorIndex + 1))) {\n throw new Error(\"Pseudo-selector \".concat(name_2, \" cannot be quoted\"));\n }\n data = [];\n selectorIndex = parseSelector(data, selector, selectorIndex + 1);\n if (selector.charCodeAt(selectorIndex) !==\n 41 /* RightParenthesis */) {\n throw new Error(\"Missing closing parenthesis in :\".concat(name_2, \" (\").concat(selector, \")\"));\n }\n selectorIndex += 1;\n }\n else {\n data = readValueWithParenthesis();\n if (stripQuotesFromPseudos.has(name_2)) {\n var quot = data.charCodeAt(0);\n if (quot === data.charCodeAt(data.length - 1) &&\n isQuote(quot)) {\n data = data.slice(1, -1);\n }\n }\n data = unescapeCSS(data);\n }\n }\n tokens.push({ type: types_1.SelectorType.Pseudo, name: name_2, data: data });\n break;\n }\n case 44 /* Comma */: {\n finalizeSubselector();\n tokens = [];\n stripWhitespace(1);\n break;\n }\n default: {\n if (selector.startsWith(\"/*\", selectorIndex)) {\n var endIndex = selector.indexOf(\"*/\", selectorIndex + 2);\n if (endIndex < 0) {\n throw new Error(\"Comment was not terminated\");\n }\n selectorIndex = endIndex + 2;\n // Remove leading whitespace\n if (tokens.length === 0) {\n stripWhitespace(0);\n }\n break;\n }\n var namespace = null;\n var name_3 = void 0;\n if (firstChar === 42 /* Asterisk */) {\n selectorIndex += 1;\n name_3 = \"*\";\n }\n else if (firstChar === 124 /* Pipe */) {\n name_3 = \"\";\n if (selector.charCodeAt(selectorIndex + 1) === 124 /* Pipe */) {\n addTraversal(types_1.SelectorType.ColumnCombinator);\n stripWhitespace(2);\n break;\n }\n }\n else if (reName.test(selector.slice(selectorIndex))) {\n name_3 = getName(0);\n }\n else {\n break loop;\n }\n if (selector.charCodeAt(selectorIndex) === 124 /* Pipe */ &&\n selector.charCodeAt(selectorIndex + 1) !== 124 /* Pipe */) {\n namespace = name_3;\n if (selector.charCodeAt(selectorIndex + 1) ===\n 42 /* Asterisk */) {\n name_3 = \"*\";\n selectorIndex += 2;\n }\n else {\n name_3 = getName(1);\n }\n }\n tokens.push(name_3 === \"*\"\n ? { type: types_1.SelectorType.Universal, namespace: namespace }\n : { type: types_1.SelectorType.Tag, name: name_3, namespace: namespace });\n }\n }\n }\n finalizeSubselector();\n return selectorIndex;\n}\n", "\"use strict\";\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.stringify = void 0;\nvar types_1 = require(\"./types\");\nvar attribValChars = [\"\\\\\", '\"'];\nvar pseudoValChars = __spreadArray(__spreadArray([], attribValChars, true), [\"(\", \")\"], false);\nvar charsToEscapeInAttributeValue = new Set(attribValChars.map(function (c) { return c.charCodeAt(0); }));\nvar charsToEscapeInPseudoValue = new Set(pseudoValChars.map(function (c) { return c.charCodeAt(0); }));\nvar charsToEscapeInName = new Set(__spreadArray(__spreadArray([], pseudoValChars, true), [\n \"~\",\n \"^\",\n \"$\",\n \"*\",\n \"+\",\n \"!\",\n \"|\",\n \":\",\n \"[\",\n \"]\",\n \" \",\n \".\",\n], false).map(function (c) { return c.charCodeAt(0); }));\n/**\n * Turns `selector` back into a string.\n *\n * @param selector Selector to stringify.\n */\nfunction stringify(selector) {\n return selector\n .map(function (token) { return token.map(stringifyToken).join(\"\"); })\n .join(\", \");\n}\nexports.stringify = stringify;\nfunction stringifyToken(token, index, arr) {\n switch (token.type) {\n // Simple types\n case types_1.SelectorType.Child:\n return index === 0 ? \"> \" : \" > \";\n case types_1.SelectorType.Parent:\n return index === 0 ? \"< \" : \" < \";\n case types_1.SelectorType.Sibling:\n return index === 0 ? \"~ \" : \" ~ \";\n case types_1.SelectorType.Adjacent:\n return index === 0 ? \"+ \" : \" + \";\n case types_1.SelectorType.Descendant:\n return \" \";\n case types_1.SelectorType.ColumnCombinator:\n return index === 0 ? \"|| \" : \" || \";\n case types_1.SelectorType.Universal:\n // Return an empty string if the selector isn't needed.\n return token.namespace === \"*\" &&\n index + 1 < arr.length &&\n \"name\" in arr[index + 1]\n ? \"\"\n : \"\".concat(getNamespace(token.namespace), \"*\");\n case types_1.SelectorType.Tag:\n return getNamespacedName(token);\n case types_1.SelectorType.PseudoElement:\n return \"::\".concat(escapeName(token.name, charsToEscapeInName)).concat(token.data === null\n ? \"\"\n : \"(\".concat(escapeName(token.data, charsToEscapeInPseudoValue), \")\"));\n case types_1.SelectorType.Pseudo:\n return \":\".concat(escapeName(token.name, charsToEscapeInName)).concat(token.data === null\n ? \"\"\n : \"(\".concat(typeof token.data === \"string\"\n ? escapeName(token.data, charsToEscapeInPseudoValue)\n : stringify(token.data), \")\"));\n case types_1.SelectorType.Attribute: {\n if (token.name === \"id\" &&\n token.action === types_1.AttributeAction.Equals &&\n token.ignoreCase === \"quirks\" &&\n !token.namespace) {\n return \"#\".concat(escapeName(token.value, charsToEscapeInName));\n }\n if (token.name === \"class\" &&\n token.action === types_1.AttributeAction.Element &&\n token.ignoreCase === \"quirks\" &&\n !token.namespace) {\n return \".\".concat(escapeName(token.value, charsToEscapeInName));\n }\n var name_1 = getNamespacedName(token);\n if (token.action === types_1.AttributeAction.Exists) {\n return \"[\".concat(name_1, \"]\");\n }\n return \"[\".concat(name_1).concat(getActionValue(token.action), \"=\\\"\").concat(escapeName(token.value, charsToEscapeInAttributeValue), \"\\\"\").concat(token.ignoreCase === null ? \"\" : token.ignoreCase ? \" i\" : \" s\", \"]\");\n }\n }\n}\nfunction getActionValue(action) {\n switch (action) {\n case types_1.AttributeAction.Equals:\n return \"\";\n case types_1.AttributeAction.Element:\n return \"~\";\n case types_1.AttributeAction.Start:\n return \"^\";\n case types_1.AttributeAction.End:\n return \"$\";\n case types_1.AttributeAction.Any:\n return \"*\";\n case types_1.AttributeAction.Not:\n return \"!\";\n case types_1.AttributeAction.Hyphen:\n return \"|\";\n case types_1.AttributeAction.Exists:\n throw new Error(\"Shouldn't be here\");\n }\n}\nfunction getNamespacedName(token) {\n return \"\".concat(getNamespace(token.namespace)).concat(escapeName(token.name, charsToEscapeInName));\n}\nfunction getNamespace(namespace) {\n return namespace !== null\n ? \"\".concat(namespace === \"*\"\n ? \"*\"\n : escapeName(namespace, charsToEscapeInName), \"|\")\n : \"\";\n}\nfunction escapeName(str, charsToEscape) {\n var lastIdx = 0;\n var ret = \"\";\n for (var i = 0; i < str.length; i++) {\n if (charsToEscape.has(str.charCodeAt(i))) {\n ret += \"\".concat(str.slice(lastIdx, i), \"\\\\\").concat(str.charAt(i));\n lastIdx = i + 1;\n }\n }\n return ret.length > 0 ? ret + str.slice(lastIdx) : str;\n}\n", "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.stringify = exports.parse = exports.isTraversal = void 0;\n__exportStar(require(\"./types\"), exports);\nvar parse_1 = require(\"./parse\");\nObject.defineProperty(exports, \"isTraversal\", { enumerable: true, get: function () { return parse_1.isTraversal; } });\nObject.defineProperty(exports, \"parse\", { enumerable: true, get: function () { return parse_1.parse; } });\nvar stringify_1 = require(\"./stringify\");\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return stringify_1.stringify; } });\n", "\"use strict\";var e,t=this&&this.__classPrivateFieldSet||function(e,t,s,r,o){if(\"m\"===r)throw new TypeError(\"Private method is not writable\");if(\"a\"===r&&!o)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!o:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===r?o.call(e,s):o?o.value=s:t.set(e,s),s},s=this&&this.__classPrivateFieldGet||function(e,t,s,r){if(\"a\"===s&&!r)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===s?r:\"a\"===s?r.call(e):r?r.value:t.get(e)};Object.defineProperty(exports,\"__esModule\",{value:!0}),exports.Element=exports.t=exports.s=exports.removeClass=exports.onEach=exports.once=exports.on=exports.off=exports.hasClass=exports.h=exports.empty=exports.emitCustom=exports.emit=exports.addClass=void 0;const r=require(\"css-what\");exports.addClass=(e,...t)=>e.classList.add(...t);exports.emit=(e,t)=>e.dispatchEvent(t);exports.emitCustom=(e,t,...s)=>(0,exports.emit)(e,new CustomEvent(t,{detail:s}));exports.empty=e=>{for(var t;e.hasChildNodes();)null===(t=e.firstChild)||void 0===t||t.remove()};exports.h=(e,...t)=>{const[s]=(0,r.parse)(e).map((e=>e.reduce(((e,t)=>{var s;return\"tag\"===t.type?document.createElement(t.name):(\"attribute\"===t.type&&\"class\"!==t.name&&e.setAttribute(t.name,null!==(s=t.value)&&void 0!==s?s:\"\"),\"attribute\"===t.type&&\"class\"===t.name&&e.classList.add(t.value),e)}),document.createElement(\"div\"))));return t.forEach((e=>{e instanceof o&&(e=e.element()),s.append(e)})),s};exports.hasClass=(e,t)=>e.classList.contains(t);exports.off=(e,t,s,r={})=>e.removeEventListener(t,s,r);exports.on=(e,t,s,r={})=>e.addEventListener(t,s,r);exports.once=(e,t,s,r={})=>(0,exports.on)(e,t,s,Object.assign(Object.assign({},\"boolean\"==typeof r?{capture:r}:r),{once:!0}));exports.onEach=(e,t,s,r={})=>t.forEach((t=>(0,exports.on)(e,t,s,r)));exports.removeClass=(e,...t)=>e.classList.remove(...t);exports.s=e=>{const t=document.createElement(\"div\");return t.innerHTML=e,t.firstElementChild};exports.t=e=>document.createTextNode(e);class o{constructor(s){e.set(this,void 0),t(this,e,s,\"f\")}static fromSelector(e,...t){return new o((0,exports.h)(e,...t))}static fromString(e){return new o((0,exports.s)(e))}addClass(...e){(0,exports.addClass)(this.element(),...e)}append(...e){e.forEach((e=>{e instanceof o&&(e=e.element()),this.element().append(e)}))}element(){return s(this,e,\"f\")}emit(e){return(0,exports.emit)(this.element(),e)}emitCustom(e,...t){return(0,exports.emitCustom)(this.element(),e,...t)}empty(){(0,exports.empty)(this.element())}hasClass(e){return(0,exports.hasClass)(this.element(),e)}on(e,t,s={}){(0,exports.on)(this.element(),e,t,s)}off(e,t,s={}){(0,exports.off)(this.element(),e,t,s)}once(e,t,s={}){(0,exports.once)(this.element(),e,t,s)}onEach(e,t,s={}){(0,exports.onEach)(this.element(),e,t,s)}query(e){return this.element().querySelector(e)}queryAll(e){return this.element().querySelectorAll(e)}removeClass(...e){(0,exports.removeClass)(this.element(),...e)}}exports.Element=o,e=new WeakMap,exports.default=o;", "/**\n * Melba - lightweight, accessible, VanillaJS toast library.\n */\nimport EventEmitter from '@dom111/typed-event-emitter/EventEmitter';\nimport supportsFocusWithin from \"./lib/supportsFocusWithin\";\n\ntype MelbaEventMap = {\n build: [];\n hide: [];\n remove: [];\n show: [];\n};\ntype MelbaEventHandler = (\n ...args: MelbaEventMap[K]\n) => void;\ntype MelbaEventContainer = {\n [K in keyof MelbaEventMap]?: MelbaEventHandler[];\n};\ntype MelbaConstructorOptions = MelbaOptions & {\n container?: HTMLElement | null;\n events?: MelbaEventContainer;\n type?: MelbaType;\n};\n\ntype MelbaType = 'error' | 'info' | 'success' | 'warning';\n\nexport type MelbaOptions = {\n animation?: boolean;\n animationDuration?: number;\n autoShow?: boolean;\n containerClass?: string;\n containerElement?: string;\n closeLabel?: string;\n hide?: boolean | number;\n hideDelay?: number;\n root?: HTMLElement | null;\n toastClass?: string;\n toastElement?: string;\n toastHideClass?: string;\n toastShowClass?: string;\n type?: MelbaType;\n};\n\nexport class Melba extends EventEmitter {\n /**\n * #defaults\n *\n * The library's default parameters:\n *\n * - `animation` - Whether or not the element is animated with CSS.\n * - `animationDuration` - The duration of the CSS animation.\n * - `autoShow` - If the toast should be automatically shown when instantiated. Defaults to `true`.\n * - `containerClass` - The `className` applied to the container element.\n * - `containerElement` - The element type used for the container.\n * - `closeLabel` - The text label for the close button.\n * - `hide` - Controls auto-hide behaviour. `false` disables by default, a number controls the time before auto-hiding\n * and `true` will auto-hide after a delay of `hideDelay`.\n * - `hideDelay` - The default auto-hide delay.\n * - `root` - The root element to attach the `containerElement` to.\n * - `toastClass` - The `className` to apply to all toasts.\n * - `toastElement` - The element type used for toasts.\n * - `toastEvents` - The DOM events to expose for toasts.\n * - `toastHideClass` - The `className` applied to the toast to hide.\n * - `toastShowClass` - The `className` applied to the toast to show.\n * - `type` - The type of the toast, this will be added as a `className` like `toast--${type}`.\n *\n * @type {MelbaOptions}\n */\n private static defaults: MelbaOptions = {\n animation: true,\n animationDuration: 400,\n autoShow: true,\n closeLabel: 'Close', // TODO: i18n\n containerClass: 'toast__container',\n containerElement: 'div',\n hide: false,\n hideDelay: 5,\n root: document.body,\n toastClass: 'toast',\n toastElement: 'div',\n toastHideClass: 'toast--hide',\n toastShowClass: 'toast--show',\n type: 'info',\n };\n\n private animation: boolean;\n private autoShow: boolean;\n private container: HTMLElement;\n private element: HTMLElement;\n private events: MelbaEventContainer;\n private hasFocus: boolean;\n private hideDelay: false | number;\n private toastHideClass: string;\n private toastShowClass: string;\n\n /**\n * @param animation {boolean} Optional. Used to override the `defaults`.\n * @param animationDuration {number} Optional. Used to override the `defaults`.\n * @param closeLabel {string} Optional. Used to override the `defaults`.\n * @param container {?HTMLElement} Optional. Specify the container element.\n * @param containerClass {string} Optional. Used to override the `defaults`.\n * @param containerElement {string} Optional. Used to override the `defaults`.\n * @param content {string} Required. The content to show in the toast.\n * @param events {MelbaEventContainer}. An object that contains event reference keys (see calls to `events()`) which\n * contain arrays of callables.\n * @param hide {boolean | number} Optional. Used to override the `defaults`.\n * @param root {HTMLElement} Optional. Used to override the `defaults`.\n * @param toastClass {string} Optional. Used to override the `defaults`.\n * @param toastElement {string} Optional. Used to override the `defaults`.\n * @param toastHideClass {string} Optional. Used to override the `defaults`.\n * @param toastShowClass {string} Optional. Used to override the `defaults`.\n * @param type {string} Optional. Used to override the `defaults`.\n */\n constructor(\n content: string,\n {\n animation = Melba.defaults.animation,\n animationDuration = Melba.defaults.animationDuration,\n closeLabel = Melba.defaults.closeLabel,\n container = null,\n containerClass = Melba.defaults.containerClass,\n containerElement = Melba.defaults.containerElement,\n events = {},\n hide = Melba.defaults.hide,\n root = Melba.defaults.root,\n toastClass = Melba.defaults.toastClass,\n toastElement = Melba.defaults.toastElement,\n toastHideClass = Melba.defaults.toastHideClass,\n toastShowClass = Melba.defaults.toastShowClass,\n type = Melba.defaults.type,\n }: MelbaConstructorOptions\n ) {\n super();\n\n if (!content) {\n throw new TypeError(\"'content' cannot be empty.\");\n }\n\n this.animation = animation;\n this.events = events;\n this.toastHideClass = toastHideClass;\n this.toastShowClass = toastShowClass;\n\n if (!container) {\n container = this.getContainer({ containerClass, containerElement, root });\n }\n\n this.container = container;\n\n if (hide === true) {\n hide = Melba.defaults.hideDelay;\n }\n\n // ensure we store milliseconds\n if (hide !== false && hide < 100) {\n hide *= 1000;\n }\n\n this.hideDelay = hide;\n\n if (animationDuration < 100) {\n animationDuration *= 1000;\n }\n\n this.build({\n closeLabel,\n content,\n toastClass,\n toastElement,\n type,\n });\n\n if (this.hideDelay !== false) {\n this.autoHide(animationDuration);\n }\n\n if (this.animation) {\n window.requestAnimationFrame(() => this.show());\n\n return;\n }\n\n if (this.autoShow) {\n this.show();\n }\n }\n\n private autoHide(animationDuration: number): number {\n if (!this.hideDelay) {\n return;\n }\n\n return window.setTimeout(\n () => this.hide(),\n this.hideDelay + (this.animation ? animationDuration : 0)\n );\n }\n\n private build({\n closeLabel,\n content,\n toastClass,\n toastElement,\n type,\n }: {\n closeLabel: string;\n content: string;\n toastClass: string;\n toastElement: string;\n type: string;\n }): void {\n this.element = document.createElement(toastElement);\n\n this.element.setAttribute('title', content);\n this.element.setAttribute('role', 'status'); // for screen readers\n this.element.setAttribute('tabindex', '0'); // make the toast navigable via keyboard\n this.element.classList.add(toastClass);\n this.element.classList.add(`toast--${type}`);\n this.element.appendChild(this.buildClose(closeLabel));\n this.element.appendChild(document.createTextNode(content));\n\n this.element.addEventListener('keydown', (event) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n\n this.hide();\n }\n });\n\n this.container.appendChild(this.element);\n\n this.emit('build');\n }\n\n show(): void {\n this.element.classList.remove(this.toastHideClass);\n this.element.classList.add(this.toastShowClass);\n\n this.emit('show');\n }\n\n hide(force: boolean = false): void {\n if (!force && this.hasFocus) {\n return;\n }\n\n const focusSelector = (supportsFocusWithin ? ':focus-within, ' : '') + ':focus, :hover';\n\n if (!force && this.element.matches(focusSelector)) {\n this.element.addEventListener('mouseout', () => {\n this.hasFocus = false;\n\n if (this.hideDelay > 0) {\n this.hide();\n }\n });\n }\n\n this.element.classList.remove(this.toastShowClass);\n this.element.classList.add(this.toastHideClass);\n\n this.emit('hide');\n\n // if we're animating there's a chance that the toast could be focused whilst it's disappearing. This prevents a\n // `:hover`ed or `:focus`ed toast from being hidden and removed.\n if (this.animation) {\n const transitionEndHandler = () => this.remove(),\n transitionStartHandler = () => {\n if (bound) {\n return;\n }\n\n this.element.addEventListener('transitionend', () =>\n transitionEndHandler()\n );\n\n bound = true;\n },\n mouseOverHandler = () => {\n this.show();\n\n this.element.removeEventListener('transitionstart', () =>\n transitionStartHandler()\n );\n this.element.removeEventListener('transitionend', () =>\n transitionEndHandler()\n );\n this.element.removeEventListener('mouseover', () =>\n mouseOverHandler()\n );\n this.element.addEventListener('mouseout', () => this.hide());\n };\n\n let bound = false;\n\n this.element.addEventListener('mouseover', () => mouseOverHandler());\n this.element.addEventListener('transitionstart', () =>\n transitionStartHandler()\n );\n\n return;\n }\n\n this.remove();\n }\n\n remove(): void {\n // Safety as `remove` can end up being called multiple times\n if (this.element.parentNode === this.container) {\n this.container.removeChild(this.element);\n\n this.emit('remove');\n }\n }\n\n buildClose(closeLabel): HTMLButtonElement {\n const closeButton = document.createElement('button');\n\n closeButton.setAttribute('title', closeLabel);\n closeButton.appendChild(document.createTextNode(closeLabel));\n closeButton.addEventListener('click', () => this.hide());\n\n return closeButton;\n }\n\n getContainer({\n containerClass,\n containerElement,\n root,\n }: {\n containerClass: string;\n containerElement: string;\n root: HTMLElement;\n }): HTMLElement {\n const existingContainer = root.querySelector(\n `${containerElement}.${containerClass}`\n );\n\n if (existingContainer) {\n return existingContainer as HTMLElement;\n }\n\n const container = document.createElement(containerElement);\n\n container.classList.add(containerClass);\n root.appendChild(container);\n\n return container;\n }\n\n getElement(): HTMLElement {\n return this.element;\n }\n\n /**\n * Used to override the default settings for all instances.\n *\n * @param settings {MelbaOptions} See `defaults` for details.\n */\n static settings(settings: MelbaOptions): void {\n Melba.defaults = {\n ...Melba.defaults,\n ...settings,\n };\n }\n}\n\nexport const toast = (content: string, options: MelbaOptions = {}): Melba =>\n new Melba(content, {\n ...options,\n autoShow: true,\n });\n\nexport const error = (content: string, options: MelbaOptions = {}): Melba =>\n toast(content, {\n ...options,\n type: 'error',\n });\n\nexport const info = (content: string, options: MelbaOptions = {}): Melba =>\n toast(content, {\n ...options,\n type: 'info',\n });\n\nexport const success = (content: string, options: MelbaOptions = {}): Melba =>\n toast(content, {\n ...options,\n type: 'success',\n hide: true,\n });\n\nexport const warning = (content: string, options: MelbaOptions = {}): Melba =>\n toast(content, {\n ...options,\n type: 'warning',\n });\n\nexport default Melba;\n", "export type EventMap = {\n [key: string]: any[];\n};\n\ntype Handler = (...args: A) => void;\n\ntype HandlerStack = {\n [K in keyof E]?: Handler[];\n};\n\nexport interface ITypedEventEmitter<\n T extends EventMap,\n E extends EventMap = T & EventMap\n> {\n on(event: K, handler: Handler): void;\n once(event: K, handler: Handler): void;\n off(event: K, handler: Handler): void;\n emit(event: K, ...args: E[K]): void;\n}\n\nexport class EventEmitter<\n T extends EventMap = EventMap,\n E extends EventMap = T & EventMap\n> implements ITypedEventEmitter\n{\n #handlers: HandlerStack = {};\n\n public on(event: K, handler: Handler): void {\n if (!(event in this.#handlers)) {\n this.#handlers[event] = [];\n }\n\n this.#handlers[event]!.push(handler);\n }\n\n public once(event: K, handler: Handler): void {\n const onceHandler: Handler = (...args) => {\n handler(...args);\n\n this.off(event, onceHandler);\n };\n\n this.on(event, onceHandler);\n }\n\n public off(event: K, handler: Handler): void {\n if (!(event in this.#handlers)) {\n return;\n }\n\n const index = this.#handlers[event]!.indexOf(handler);\n\n if (index === -1) {\n return;\n }\n\n this.#handlers[event]!.splice(index, 1);\n }\n\n public emit(event: K, ...args: E[K]): void {\n if (!(event in this.#handlers)) {\n return;\n }\n\n this.#handlers[event]!.forEach((handler) => handler(...args));\n }\n}\n\nexport default EventEmitter;\n", "export const supportsFocusWithin: boolean = (() => {\n try {\n document.querySelector(':focus-within');\n\n return true;\n } catch (e) {\n return false;\n }\n})();\n\nexport default supportsFocusWithin;\n", "!function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).basicLightbox=e()}}((function(){return function e(n,t,o){function r(c,u){if(!t[c]){if(!n[c]){var s=\"function\"==typeof require&&require;if(!u&&s)return s(c,!0);if(i)return i(c,!0);var a=new Error(\"Cannot find module '\"+c+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var l=t[c]={exports:{}};n[c][0].call(l.exports,(function(e){return r(n[c][1][e]||e)}),l,l.exports,e,n,t,o)}return t[c].exports}for(var i=\"function\"==typeof require&&require,c=0;c1&&void 0!==arguments[1]&&arguments[1],t=document.createElement(\"div\");return t.innerHTML=e.trim(),!0===n?t.children:t.firstChild},r=function(e,n){var t=e.children;return 1===t.length&&t[0].tagName===n},i=function(e){return null!=(e=e||document.querySelector(\".basicLightbox\"))&&!0===e.ownerDocument.body.contains(e)};t.visible=i;t.create=function(e,n){var t=function(e,n){var t=o('\\n\\t\\t
            \\n\\t\\t\\t
            \\n\\t\\t
            \\n\\t')),i=t.querySelector(\".basicLightbox__placeholder\");e.forEach((function(e){return i.appendChild(e)}));var c=r(i,\"IMG\"),u=r(i,\"VIDEO\"),s=r(i,\"IFRAME\");return!0===c&&t.classList.add(\"basicLightbox--img\"),!0===u&&t.classList.add(\"basicLightbox--video\"),!0===s&&t.classList.add(\"basicLightbox--iframe\"),t}(e=function(e){var n=\"string\"==typeof e,t=e instanceof HTMLElement==1;if(!1===n&&!1===t)throw new Error(\"Content must be a DOM element/node or string\");return!0===n?Array.from(o(e,!0)):\"TEMPLATE\"===e.tagName?[e.content.cloneNode(!0)]:Array.from(e.children)}(e),n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null==(e=Object.assign({},e)).closable&&(e.closable=!0),null==e.className&&(e.className=\"\"),null==e.onShow&&(e.onShow=function(){}),null==e.onClose&&(e.onClose=function(){}),\"boolean\"!=typeof e.closable)throw new Error(\"Property `closable` must be a boolean\");if(\"string\"!=typeof e.className)throw new Error(\"Property `className` must be a string\");if(\"function\"!=typeof e.onShow)throw new Error(\"Property `onShow` must be a function\");if(\"function\"!=typeof e.onClose)throw new Error(\"Property `onClose` must be a function\");return e}(n)),c=function(e){return!1!==n.onClose(u)&&function(e,n){return e.classList.remove(\"basicLightbox--visible\"),setTimeout((function(){return!1===i(e)||e.parentElement.removeChild(e),n()}),410),!0}(t,(function(){if(\"function\"==typeof e)return e(u)}))};!0===n.closable&&t.addEventListener(\"click\",(function(e){e.target===t&&c()}));var u={element:function(){return t},visible:function(){return i(t)},show:function(e){return!1!==n.onShow(u)&&function(e,n){return document.body.appendChild(e),setTimeout((function(){requestAnimationFrame((function(){return e.classList.add(\"basicLightbox--visible\"),n()}))}),10),!0}(t,(function(){if(\"function\"==typeof e)return e(u)}))},close:c};return u}},{}]},{},[1])(1)}));", "\n/* **********************************************\n Begin prism-core.js\n********************************************** */\n\n/// \n\nvar _self = (typeof window !== 'undefined')\n\t? window // if in browser\n\t: (\n\t\t(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)\n\t\t\t? self // if in worker\n\t\t\t: {} // if in node js\n\t);\n\n/**\n * Prism: Lightweight, robust, elegant syntax highlighting\n *\n * @license MIT \n * @author Lea Verou \n * @namespace\n * @public\n */\nvar Prism = (function (_self) {\n\n\t// Private helper vars\n\tvar lang = /(?:^|\\s)lang(?:uage)?-([\\w-]+)(?=\\s|$)/i;\n\tvar uniqueId = 0;\n\n\t// The grammar object for plaintext\n\tvar plainTextGrammar = {};\n\n\n\tvar _ = {\n\t\t/**\n\t\t * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the\n\t\t * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load\n\t\t * additional languages or plugins yourself.\n\t\t *\n\t\t * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.\n\t\t *\n\t\t * You obviously have to change this value before the automatic highlighting started. To do this, you can add an\n\t\t * empty Prism object into the global scope before loading the Prism script like this:\n\t\t *\n\t\t * ```js\n\t\t * window.Prism = window.Prism || {};\n\t\t * Prism.manual = true;\n\t\t * // add a new