From 3cdbf21177d7dd009f390218c2ab236f8d214b2e Mon Sep 17 00:00:00 2001 From: YaroslavYarynych Date: Wed, 6 Mar 2024 18:46:49 +0000 Subject: [PATCH] deploy: 89df35f9159ea576f75356c46c32009d46303150 --- .nojekyll | 0 assets/index-BNlI8KJ3.css | 1 + assets/index-C_CDIW2l.js | 1919 +++++++++++++++++++++++++++++++++++++ index.html | 14 + marker.png | Bin 0 -> 782 bytes vite.svg | 1 + 6 files changed, 1935 insertions(+) create mode 100644 .nojekyll create mode 100644 assets/index-BNlI8KJ3.css create mode 100644 assets/index-C_CDIW2l.js create mode 100644 index.html create mode 100644 marker.png create mode 100644 vite.svg diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/assets/index-BNlI8KJ3.css b/assets/index-BNlI8KJ3.css new file mode 100644 index 0000000..8328165 --- /dev/null +++ b/assets/index-BNlI8KJ3.css @@ -0,0 +1 @@ +.leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{-webkit-transition:-webkit-transform .3s ease-out,opacity .3s ease-in;-moz-transition:-moz-transform .3s ease-out,opacity .3s ease-in;-o-transition:-o-transform .3s ease-out,opacity .3s ease-in;transition:transform .3s ease-out,opacity .3s ease-in}.leaflet-cluster-spider-leg{-webkit-transition:-webkit-stroke-dashoffset .3s ease-out,-webkit-stroke-opacity .3s ease-in;-moz-transition:-moz-stroke-dashoffset .3s ease-out,-moz-stroke-opacity .3s ease-in;-o-transition:-o-stroke-dashoffset .3s ease-out,-o-stroke-opacity .3s ease-in;transition:stroke-dashoffset .3s ease-out,stroke-opacity .3s ease-in}.marker-cluster-small{background-color:#b5e28c99}.marker-cluster-small div{background-color:#6ecc3999}.marker-cluster-medium{background-color:#f1d35799}.marker-cluster-medium div{background-color:#f0c20c99}.marker-cluster-large{background-color:#fd9c7399}.marker-cluster-large div{background-color:#f1801799}.leaflet-oldie .marker-cluster-small{background-color:#b5e28c}.leaflet-oldie .marker-cluster-small div{background-color:#6ecc39}.leaflet-oldie .marker-cluster-medium{background-color:#f1d357}.leaflet-oldie .marker-cluster-medium div{background-color:#f0c20c}.leaflet-oldie .marker-cluster-large{background-color:#fd9c73}.leaflet-oldie .marker-cluster-large div{background-color:#f18017}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{width:30px;height:30px;margin-left:5px;margin-top:5px;text-align:center;border-radius:15px;font:12px Helvetica Neue,Arial,Helvetica,sans-serif}.marker-cluster span{line-height:30px}.home{width:100%;position:relative}.leaflet-container{height:100vh;width:100%;z-index:0}.button{position:absolute;top:80px;left:10px;z-index:100;width:fit-content;padding:10px;outline:none;border:none;border-radius:3px;font-size:16px;font-weight:600;cursor:pointer;background-color:#ffffff4d;transition:all .4s}.button:hover{background-color:#fffc}.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}html,body{width:100%;height:100%}*{padding:0;margin:0;box-sizing:border-box} diff --git a/assets/index-C_CDIW2l.js b/assets/index-C_CDIW2l.js new file mode 100644 index 0000000..b2fab07 --- /dev/null +++ b/assets/index-C_CDIW2l.js @@ -0,0 +1,1919 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _l(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}),n}var zv={exports:{}},gl={},bv={exports:{}},ut={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ta=Symbol.for("react.element"),dP=Symbol.for("react.portal"),pP=Symbol.for("react.fragment"),mP=Symbol.for("react.strict_mode"),_P=Symbol.for("react.profiler"),gP=Symbol.for("react.provider"),vP=Symbol.for("react.context"),yP=Symbol.for("react.forward_ref"),wP=Symbol.for("react.suspense"),EP=Symbol.for("react.memo"),TP=Symbol.for("react.lazy"),T_=Symbol.iterator;function PP(e){return e===null||typeof e!="object"?null:(e=T_&&e[T_]||e["@@iterator"],typeof e=="function"?e:null)}var Bv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Fv=Object.assign,Uv={};function po(e,t,n){this.props=e,this.context=t,this.refs=Uv,this.updater=n||Bv}po.prototype.isReactComponent={};po.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};po.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $v(){}$v.prototype=po.prototype;function ud(e,t,n){this.props=e,this.context=t,this.refs=Uv,this.updater=n||Bv}var ld=ud.prototype=new $v;ld.constructor=ud;Fv(ld,po.prototype);ld.isPureReactComponent=!0;var P_=Array.isArray,jv=Object.prototype.hasOwnProperty,cd={current:null},Hv={key:!0,ref:!0,__self:!0,__source:!0};function Zv(e,t,n){var i,o={},s=null,a=null;if(t!=null)for(i in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(s=""+t.key),t)jv.call(t,i)&&!Hv.hasOwnProperty(i)&&(o[i]=t[i]);var c=arguments.length-2;if(c===1)o.children=n;else if(1>>1,ht=k[Q];if(0>>1;Qo(pt,z))tto(Ae,pt)?(k[Q]=Ae,k[tt]=z,Q=tt):(k[Q]=pt,k[yt]=z,Q=yt);else if(tto(Ae,z))k[Q]=Ae,k[tt]=z,Q=tt;else break t}}return Y}function o(k,Y){var z=k.sortIndex-Y.sortIndex;return z!==0?z:k.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var h=[],d=[],m=1,_=null,v=3,y=!1,C=!1,S=!1,R=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(k){for(var Y=n(d);Y!==null;){if(Y.callback===null)i(d);else if(Y.startTime<=k)i(d),Y.sortIndex=Y.expirationTime,t(h,Y);else break;Y=n(d)}}function x(k){if(S=!1,P(k),!C)if(n(h)!==null)C=!0,ne(V);else{var Y=n(d);Y!==null&&On(x,Y.startTime-k)}}function V(k,Y){C=!1,S&&(S=!1,E(Z),Z=-1),y=!0;var z=v;try{for(P(Y),_=n(h);_!==null&&(!(_.expirationTime>Y)||k&&!Et());){var Q=_.callback;if(typeof Q=="function"){_.callback=null,v=_.priorityLevel;var ht=Q(_.expirationTime<=Y);Y=e.unstable_now(),typeof ht=="function"?_.callback=ht:_===n(h)&&i(h),P(Y)}else i(h);_=n(h)}if(_!==null)var Ht=!0;else{var yt=n(d);yt!==null&&On(x,yt.startTime-Y),Ht=!1}return Ht}finally{_=null,v=z,y=!1}}var F=!1,j=null,Z=-1,wt=5,it=-1;function Et(){return!(e.unstable_now()-itk||125Q?(k.sortIndex=z,t(d,k),n(h)===null&&k===n(d)&&(S?(E(Z),Z=-1):S=!0,On(x,z-Q))):(k.sortIndex=ht,t(h,k),C||y||(C=!0,ne(V))),k},e.unstable_shouldYield=Et,e.unstable_wrapCallback=function(k){var Y=v;return function(){var z=v;v=Y;try{return k.apply(this,arguments)}finally{v=z}}}})(Kv);qv.exports=Kv;var DP=qv.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Qv=at,Ue=DP;function N(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vh=Object.prototype.hasOwnProperty,NP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,C_={},I_={};function VP(e){return Vh.call(I_,e)?!0:Vh.call(C_,e)?!1:NP.test(e)?I_[e]=!0:(C_[e]=!0,!1)}function zP(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function bP(e,t,n,i){if(t===null||typeof t>"u"||zP(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Le(e,t,n,i,o,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var he={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){he[e]=new Le(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];he[t]=new Le(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){he[e]=new Le(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){he[e]=new Le(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){he[e]=new Le(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){he[e]=new Le(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){he[e]=new Le(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){he[e]=new Le(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){he[e]=new Le(e,5,!1,e.toLowerCase(),null,!1,!1)});var fd=/[\-:]([a-z])/g;function dd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(fd,dd);he[t]=new Le(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fd,dd);he[t]=new Le(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fd,dd);he[t]=new Le(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){he[e]=new Le(e,1,!1,e.toLowerCase(),null,!1,!1)});he.xlinkHref=new Le("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){he[e]=new Le(e,1,!1,e.toLowerCase(),null,!0,!0)});function pd(e,t,n,i){var o=he.hasOwnProperty(t)?he[t]:null;(o!==null?o.type!==0:i||!(2c||o[a]!==s[c]){var h=` +`+o[a].replace(" at new "," at ");return e.displayName&&h.includes("")&&(h=h.replace("",e.displayName)),h}while(1<=a&&0<=c);break}}}finally{Kc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Xo(e):""}function BP(e){switch(e.tag){case 5:return Xo(e.type);case 16:return Xo("Lazy");case 13:return Xo("Suspense");case 19:return Xo("SuspenseList");case 0:case 2:case 15:return e=Qc(e.type,!1),e;case 11:return e=Qc(e.type.render,!1),e;case 1:return e=Qc(e.type,!0),e;default:return""}}function Fh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case xr:return"Fragment";case Ar:return"Portal";case zh:return"Profiler";case md:return"StrictMode";case bh:return"Suspense";case Bh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Jv:return(e.displayName||"Context")+".Consumer";case Yv:return(e._context.displayName||"Context")+".Provider";case _d:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gd:return t=e.displayName||null,t!==null?t:Fh(e.type)||"Memo";case ni:t=e._payload,e=e._init;try{return Fh(e(t))}catch{}}return null}function FP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Fh(t);case 8:return t===md?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ei(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ey(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function UP(e){var t=ey(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){i=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(a){i=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ua(e){e._valueTracker||(e._valueTracker=UP(e))}function ny(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=ey(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Au(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Uh(e,t){var n=t.checked;return Ot({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function A_(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=Ei(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function iy(e,t){t=t.checked,t!=null&&pd(e,"checked",t,!1)}function $h(e,t){iy(e,t);var n=Ei(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?jh(e,t.type,n):t.hasOwnProperty("defaultValue")&&jh(e,t.type,Ei(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function x_(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function jh(e,t,n){(t!=="number"||Au(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yo=Array.isArray;function $r(e,t,n,i){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=$a.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ts(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ss={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$P=["Webkit","ms","Moz","O"];Object.keys(ss).forEach(function(e){$P.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ss[t]=ss[e]})});function ay(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ss.hasOwnProperty(e)&&ss[e]?(""+t).trim():t+"px"}function uy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,o=ay(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,o):e[n]=o}}var jP=Ot({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Wh(e,t){if(t){if(jP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function Gh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var qh=null;function vd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kh=null,jr=null,Hr=null;function M_(e){if(e=ia(e)){if(typeof Kh!="function")throw Error(N(280));var t=e.stateNode;t&&(t=Tl(t),Kh(e.stateNode,e.type,t))}}function ly(e){jr?Hr?Hr.push(e):Hr=[e]:jr=e}function cy(){if(jr){var e=jr,t=Hr;if(Hr=jr=null,M_(e),t)for(e=0;e>>=0,e===0?32:31-(tS(e)/eS|0)|0}var ja=64,Ha=4194304;function Jo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Mu(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,o=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var c=a&~o;c!==0?i=Jo(c):(s&=a,s!==0&&(i=Jo(s)))}else a=n&~o,a!==0?i=Jo(a):s!==0&&(i=Jo(s));if(i===0)return 0;if(t!==0&&t!==i&&!(t&o)&&(o=i&-i,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(i&4&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function ea(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ln(t),e[t]=n}function oS(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=us),U_=" ",$_=!1;function ky(e,t){switch(e){case"keyup":return OS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ry(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kr=!1;function NS(e,t){switch(e){case"compositionend":return Ry(t);case"keypress":return t.which!==32?null:($_=!0,U_);case"textInput":return e=t.data,e===U_&&$_?null:e;default:return null}}function VS(e,t){if(kr)return e==="compositionend"||!Id&&ky(e,t)?(e=Ay(),du=Pd=si=null,kr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=W_(n)}}function Ny(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ny(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vy(){for(var e=window,t=Au();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Au(e.document)}return t}function Ld(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ZS(e){var t=Vy(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ny(n.ownerDocument.documentElement,n)){if(i!==null&&Ld(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(i.start,o);i=i.end===void 0?s:Math.min(i.end,o),!e.extend&&s>i&&(o=i,i=s,s=o),o=G_(n,s);var a=G_(n,i);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>i?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Rr=null,ef=null,cs=null,nf=!1;function q_(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;nf||Rr==null||Rr!==Au(i)||(i=Rr,"selectionStart"in i&&Ld(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),cs&&As(cs,i)||(cs=i,i=Nu(ef,"onSelect"),0Dr||(e.current=lf[Dr],lf[Dr]=null,Dr--)}function Pt(e,t){Dr++,lf[Dr]=e.current,e.current=t}var Ti={},we=Ai(Ti),Oe=Ai(!1),tr=Ti;function Jr(e,t){var n=e.type.contextTypes;if(!n)return Ti;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function De(e){return e=e.childContextTypes,e!=null}function zu(){Lt(Oe),Lt(we)}function eg(e,t,n){if(we.current!==Ti)throw Error(N(168));Pt(we,t),Pt(Oe,n)}function Zy(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var o in i)if(!(o in t))throw Error(N(108,FP(e)||"Unknown",o));return Ot({},n,i)}function bu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ti,tr=we.current,Pt(we,e),Pt(Oe,Oe.current),!0}function ng(e,t,n){var i=e.stateNode;if(!i)throw Error(N(169));n?(e=Zy(e,t,tr),i.__reactInternalMemoizedMergedChildContext=e,Lt(Oe),Lt(we),Pt(we,e)):Lt(Oe),Pt(Oe,n)}var Bn=null,Pl=!1,ch=!1;function Wy(e){Bn===null?Bn=[e]:Bn.push(e)}function iC(e){Pl=!0,Wy(e)}function xi(){if(!ch&&Bn!==null){ch=!0;var e=0,t=gt;try{var n=Bn;for(gt=1;e>=a,o-=a,Fn=1<<32-ln(t)+o|n<Z?(wt=j,j=null):wt=j.sibling;var it=v(E,j,P[Z],x);if(it===null){j===null&&(j=wt);break}e&&j&&it.alternate===null&&t(E,j),w=s(it,w,Z),F===null?V=it:F.sibling=it,F=it,j=wt}if(Z===P.length)return n(E,j),At&&Fi(E,Z),V;if(j===null){for(;ZZ?(wt=j,j=null):wt=j.sibling;var Et=v(E,j,it.value,x);if(Et===null){j===null&&(j=wt);break}e&&j&&Et.alternate===null&&t(E,j),w=s(Et,w,Z),F===null?V=Et:F.sibling=Et,F=Et,j=wt}if(it.done)return n(E,j),At&&Fi(E,Z),V;if(j===null){for(;!it.done;Z++,it=P.next())it=_(E,it.value,x),it!==null&&(w=s(it,w,Z),F===null?V=it:F.sibling=it,F=it);return At&&Fi(E,Z),V}for(j=i(E,j);!it.done;Z++,it=P.next())it=y(j,E,Z,it.value,x),it!==null&&(e&&it.alternate!==null&&j.delete(it.key===null?Z:it.key),w=s(it,w,Z),F===null?V=it:F.sibling=it,F=it);return e&&j.forEach(function(Kt){return t(E,Kt)}),At&&Fi(E,Z),V}function R(E,w,P,x){if(typeof P=="object"&&P!==null&&P.type===xr&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case Fa:t:{for(var V=P.key,F=w;F!==null;){if(F.key===V){if(V=P.type,V===xr){if(F.tag===7){n(E,F.sibling),w=o(F,P.props.children),w.return=E,E=w;break t}}else if(F.elementType===V||typeof V=="object"&&V!==null&&V.$$typeof===ni&&lg(V)===F.type){n(E,F.sibling),w=o(F,P.props),w.ref=Zo(E,F,P),w.return=E,E=w;break t}n(E,F);break}else t(E,F);F=F.sibling}P.type===xr?(w=Yi(P.props.children,E.mode,x,P.key),w.return=E,E=w):(x=Eu(P.type,P.key,P.props,null,E.mode,x),x.ref=Zo(E,w,P),x.return=E,E=x)}return a(E);case Ar:t:{for(F=P.key;w!==null;){if(w.key===F)if(w.tag===4&&w.stateNode.containerInfo===P.containerInfo&&w.stateNode.implementation===P.implementation){n(E,w.sibling),w=o(w,P.children||[]),w.return=E,E=w;break t}else{n(E,w);break}else t(E,w);w=w.sibling}w=vh(P,E.mode,x),w.return=E,E=w}return a(E);case ni:return F=P._init,R(E,w,F(P._payload),x)}if(Yo(P))return C(E,w,P,x);if(Fo(P))return S(E,w,P,x);Xa(E,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,w!==null&&w.tag===6?(n(E,w.sibling),w=o(w,P),w.return=E,E=w):(n(E,w),w=gh(P,E.mode,x),w.return=E,E=w),a(E)):n(E,w)}return R}var eo=t0(!0),e0=t0(!1),ra={},In=Ai(ra),Ms=Ai(ra),Os=Ai(ra);function Wi(e){if(e===ra)throw Error(N(174));return e}function Vd(e,t){switch(Pt(Os,t),Pt(Ms,e),Pt(In,ra),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Zh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Zh(t,e)}Lt(In),Pt(In,t)}function no(){Lt(In),Lt(Ms),Lt(Os)}function n0(e){Wi(Os.current);var t=Wi(In.current),n=Zh(t,e.type);t!==n&&(Pt(Ms,e),Pt(In,n))}function zd(e){Ms.current===e&&(Lt(In),Lt(Ms))}var Rt=Ai(0);function Hu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var hh=[];function bd(){for(var e=0;en?n:4,e(!0);var i=fh.transition;fh.transition={};try{e(!1),t()}finally{gt=n,fh.transition=i}}function v0(){return en().memoizedState}function aC(e,t,n){var i=mi(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},y0(e))w0(t,n);else if(n=Qy(e,t,n,i),n!==null){var o=Ce();cn(n,e,i,o),E0(n,t,i)}}function uC(e,t,n){var i=mi(e),o={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(y0(e))w0(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,c=s(a,n);if(o.hasEagerState=!0,o.eagerState=c,fn(c,a)){var h=t.interleaved;h===null?(o.next=o,Dd(t)):(o.next=h.next,h.next=o),t.interleaved=o;return}}catch{}finally{}n=Qy(e,t,o,i),n!==null&&(o=Ce(),cn(n,e,i,o),E0(n,t,i))}}function y0(e){var t=e.alternate;return e===Mt||t!==null&&t===Mt}function w0(e,t){hs=Zu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function E0(e,t,n){if(n&4194240){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,wd(e,n)}}var Wu={readContext:tn,useCallback:fe,useContext:fe,useEffect:fe,useImperativeHandle:fe,useInsertionEffect:fe,useLayoutEffect:fe,useMemo:fe,useReducer:fe,useRef:fe,useState:fe,useDebugValue:fe,useDeferredValue:fe,useTransition:fe,useMutableSource:fe,useSyncExternalStore:fe,useId:fe,unstable_isNewReconciler:!1},lC={readContext:tn,useCallback:function(e,t){return yn().memoizedState=[e,t===void 0?null:t],e},useContext:tn,useEffect:hg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,gu(4194308,4,d0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gu(4194308,4,e,t)},useInsertionEffect:function(e,t){return gu(4,2,e,t)},useMemo:function(e,t){var n=yn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=yn();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=aC.bind(null,Mt,e),[i.memoizedState,e]},useRef:function(e){var t=yn();return e={current:e},t.memoizedState=e},useState:cg,useDebugValue:jd,useDeferredValue:function(e){return yn().memoizedState=e},useTransition:function(){var e=cg(!1),t=e[0];return e=sC.bind(null,e[1]),yn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Mt,o=yn();if(At){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),Jt===null)throw Error(N(349));nr&30||o0(i,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,hg(a0.bind(null,i,s,e),[e]),i.flags|=2048,Vs(9,s0.bind(null,i,s,n,t),void 0,null),n},useId:function(){var e=yn(),t=Jt.identifierPrefix;if(At){var n=Un,i=Fn;n=(i&~(1<<32-ln(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ds++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=a.createElement(n,{is:i.is}):(e=a.createElement(n),n==="select"&&(a=e,i.multiple?a.multiple=!0:i.size&&(a.size=i.size))):e=a.createElementNS(e,n),e[En]=t,e[Rs]=i,k0(e,t,!1,!1),t.stateNode=e;t:{switch(a=Gh(n,i),n){case"dialog":Ct("cancel",e),Ct("close",e),o=i;break;case"iframe":case"object":case"embed":Ct("load",e),o=i;break;case"video":case"audio":for(o=0;oro&&(t.flags|=128,i=!0,Wo(s,!1),t.lanes=4194304)}else{if(!i)if(e=Hu(a),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Wo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!At)return de(t),null}else 2*bt()-s.renderingStartTime>ro&&n!==1073741824&&(t.flags|=128,i=!0,Wo(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=bt(),t.sibling=null,n=Rt.current,Pt(Rt,i?n&1|2:n&1),t):(de(t),null);case 22:case 23:return Kd(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Ve&1073741824&&(de(t),t.subtreeFlags&6&&(t.flags|=8192)):de(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function gC(e,t){switch(xd(t),t.tag){case 1:return De(t.type)&&zu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return no(),Lt(Oe),Lt(we),bd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return zd(t),null;case 13:if(Lt(Rt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));to()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lt(Rt),null;case 4:return no(),null;case 10:return Od(t.type._context),null;case 22:case 23:return Kd(),null;case 24:return null;default:return null}}var Ja=!1,_e=!1,vC=typeof WeakSet=="function"?WeakSet:Set,$=null;function br(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){Nt(e,t,i)}else n.current=null}function Ef(e,t,n){try{n()}catch(i){Nt(e,t,i)}}var wg=!1;function yC(e,t){if(rf=Ou,e=Vy(),Ld(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else t:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var o=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var a=0,c=-1,h=-1,d=0,m=0,_=e,v=null;e:for(;;){for(var y;_!==n||o!==0&&_.nodeType!==3||(c=a+o),_!==s||i!==0&&_.nodeType!==3||(h=a+i),_.nodeType===3&&(a+=_.nodeValue.length),(y=_.firstChild)!==null;)v=_,_=y;for(;;){if(_===e)break e;if(v===n&&++d===o&&(c=a),v===s&&++m===i&&(h=a),(y=_.nextSibling)!==null)break;_=v,v=_.parentNode}_=y}n=c===-1||h===-1?null:{start:c,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(of={focusedElem:e,selectionRange:n},Ou=!1,$=t;$!==null;)if(t=$,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$=e;else for(;$!==null;){t=$;try{var C=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var S=C.memoizedProps,R=C.memoizedState,E=t.stateNode,w=E.getSnapshotBeforeUpdate(t.elementType===t.type?S:sn(t.type,S),R);E.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var P=t.stateNode.containerInfo;P.nodeType===1?P.textContent="":P.nodeType===9&&P.documentElement&&P.removeChild(P.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(x){Nt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,$=e;break}$=t.return}return C=wg,wg=!1,C}function fs(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var o=i=i.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&Ef(t,n,s)}o=o.next}while(o!==i)}}function Il(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function Tf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function O0(e){var t=e.alternate;t!==null&&(e.alternate=null,O0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[En],delete t[Rs],delete t[uf],delete t[eC],delete t[nC])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function D0(e){return e.tag===5||e.tag===3||e.tag===4}function Eg(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||D0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pf(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vu));else if(i!==4&&(e=e.child,e!==null))for(Pf(e,t,n),e=e.sibling;e!==null;)Pf(e,t,n),e=e.sibling}function Sf(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Sf(e,t,n),e=e.sibling;e!==null;)Sf(e,t,n),e=e.sibling}var re=null,an=!1;function ei(e,t,n){for(n=n.child;n!==null;)N0(e,t,n),n=n.sibling}function N0(e,t,n){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(vl,n)}catch{}switch(n.tag){case 5:_e||br(n,t);case 6:var i=re,o=an;re=null,ei(e,t,n),re=i,an=o,re!==null&&(an?(e=re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):re.removeChild(n.stateNode));break;case 18:re!==null&&(an?(e=re,n=n.stateNode,e.nodeType===8?lh(e.parentNode,n):e.nodeType===1&&lh(e,n),Is(e)):lh(re,n.stateNode));break;case 4:i=re,o=an,re=n.stateNode.containerInfo,an=!0,ei(e,t,n),re=i,an=o;break;case 0:case 11:case 14:case 15:if(!_e&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){o=i=i.next;do{var s=o,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&Ef(n,t,a),o=o.next}while(o!==i)}ei(e,t,n);break;case 1:if(!_e&&(br(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(c){Nt(n,t,c)}ei(e,t,n);break;case 21:ei(e,t,n);break;case 22:n.mode&1?(_e=(i=_e)||n.memoizedState!==null,ei(e,t,n),_e=i):ei(e,t,n);break;default:ei(e,t,n)}}function Tg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new vC),t.forEach(function(i){var o=AC.bind(null,e,i);n.has(i)||(n.add(i),i.then(o,o))})}}function on(e,t){var n=t.deletions;if(n!==null)for(var i=0;io&&(o=a),i&=~s}if(i=o,i=bt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*EC(i/1960))-i,10e?16:e,ai===null)var i=!1;else{if(e=ai,ai=null,Ku=0,dt&6)throw Error(N(331));var o=dt;for(dt|=4,$=e.current;$!==null;){var s=$,a=s.child;if($.flags&16){var c=s.deletions;if(c!==null){for(var h=0;hbt()-Gd?Xi(e,0):Wd|=n),Ne(e,t)}function j0(e,t){t===0&&(e.mode&1?(t=Ha,Ha<<=1,!(Ha&130023424)&&(Ha=4194304)):t=1);var n=Ce();e=Wn(e,t),e!==null&&(ea(e,t,n),Ne(e,n))}function LC(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),j0(e,n)}function AC(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(N(314))}i!==null&&i.delete(t),j0(e,n)}var H0;H0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Oe.current)Me=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Me=!1,mC(e,t,n);Me=!!(e.flags&131072)}else Me=!1,At&&t.flags&1048576&&Gy(t,Fu,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;vu(e,t),e=t.pendingProps;var o=Jr(t,we.current);Wr(t,n),o=Fd(null,t,i,e,o,n);var s=Ud();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,De(i)?(s=!0,bu(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Nd(t),o.updater=Sl,t.stateNode=o,o._reactInternals=t,pf(t,i,e,n),t=gf(null,t,i,!0,s,n)):(t.tag=0,At&&s&&Ad(t),Pe(null,t,o,n),t=t.child),t;case 16:i=t.elementType;t:{switch(vu(e,t),e=t.pendingProps,o=i._init,i=o(i._payload),t.type=i,o=t.tag=kC(i),e=sn(i,e),o){case 0:t=_f(null,t,i,e,n);break t;case 1:t=gg(null,t,i,e,n);break t;case 11:t=mg(null,t,i,e,n);break t;case 14:t=_g(null,t,i,sn(i.type,e),n);break t}throw Error(N(306,i,""))}return t;case 0:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:sn(i,o),_f(e,t,i,o,n);case 1:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:sn(i,o),gg(e,t,i,o,n);case 3:t:{if(L0(t),e===null)throw Error(N(387));i=t.pendingProps,s=t.memoizedState,o=s.element,Xy(e,t),ju(t,i,null,n);var a=t.memoizedState;if(i=a.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=io(Error(N(423)),t),t=vg(e,t,i,n,o);break t}else if(i!==o){o=io(Error(N(424)),t),t=vg(e,t,i,n,o);break t}else for(ze=fi(t.stateNode.containerInfo.firstChild),Be=t,At=!0,un=null,n=e0(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(to(),i===o){t=Gn(e,t,n);break t}Pe(e,t,i,n)}t=t.child}return t;case 5:return n0(t),e===null&&hf(t),i=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,a=o.children,sf(i,o)?a=null:s!==null&&sf(i,s)&&(t.flags|=32),I0(e,t),Pe(e,t,a,n),t.child;case 6:return e===null&&hf(t),null;case 13:return A0(e,t,n);case 4:return Vd(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=eo(t,null,i,n):Pe(e,t,i,n),t.child;case 11:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:sn(i,o),mg(e,t,i,o,n);case 7:return Pe(e,t,t.pendingProps,n),t.child;case 8:return Pe(e,t,t.pendingProps.children,n),t.child;case 12:return Pe(e,t,t.pendingProps.children,n),t.child;case 10:t:{if(i=t.type._context,o=t.pendingProps,s=t.memoizedProps,a=o.value,Pt(Uu,i._currentValue),i._currentValue=a,s!==null)if(fn(s.value,a)){if(s.children===o.children&&!Oe.current){t=Gn(e,t,n);break t}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var c=s.dependencies;if(c!==null){a=s.child;for(var h=c.firstContext;h!==null;){if(h.context===i){if(s.tag===1){h=jn(-1,n&-n),h.tag=2;var d=s.updateQueue;if(d!==null){d=d.shared;var m=d.pending;m===null?h.next=h:(h.next=m.next,m.next=h),d.pending=h}}s.lanes|=n,h=s.alternate,h!==null&&(h.lanes|=n),ff(s.return,n,t),c.lanes|=n;break}h=h.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(N(341));a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),ff(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}Pe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps.children,Wr(t,n),o=tn(o),i=i(o),t.flags|=1,Pe(e,t,i,n),t.child;case 14:return i=t.type,o=sn(i,t.pendingProps),o=sn(i.type,o),_g(e,t,i,o,n);case 15:return S0(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:sn(i,o),vu(e,t),t.tag=1,De(i)?(e=!0,bu(t)):e=!1,Wr(t,n),Jy(t,i,o),pf(t,i,o,n),gf(null,t,i,!0,e,n);case 19:return x0(e,t,n);case 22:return C0(e,t,n)}throw Error(N(156,t.tag))};function Z0(e,t){return gy(e,t)}function xC(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ye(e,t,n,i){return new xC(e,t,n,i)}function Xd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function kC(e){if(typeof e=="function")return Xd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_d)return 11;if(e===gd)return 14}return 2}function _i(e,t){var n=e.alternate;return n===null?(n=Ye(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Eu(e,t,n,i,o,s){var a=2;if(i=e,typeof e=="function")Xd(e)&&(a=1);else if(typeof e=="string")a=5;else t:switch(e){case xr:return Yi(n.children,o,s,t);case md:a=8,o|=8;break;case zh:return e=Ye(12,n,t,o|2),e.elementType=zh,e.lanes=s,e;case bh:return e=Ye(13,n,t,o),e.elementType=bh,e.lanes=s,e;case Bh:return e=Ye(19,n,t,o),e.elementType=Bh,e.lanes=s,e;case ty:return Al(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yv:a=10;break t;case Jv:a=9;break t;case _d:a=11;break t;case gd:a=14;break t;case ni:a=16,i=null;break t}throw Error(N(130,e==null?e:typeof e,""))}return t=Ye(a,n,t,o),t.elementType=e,t.type=i,t.lanes=s,t}function Yi(e,t,n,i){return e=Ye(7,e,i,t),e.lanes=n,e}function Al(e,t,n,i){return e=Ye(22,e,i,t),e.elementType=ty,e.lanes=n,e.stateNode={isHidden:!1},e}function gh(e,t,n){return e=Ye(6,e,null,t),e.lanes=n,e}function vh(e,t,n){return t=Ye(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function RC(e,t,n,i,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yc(0),this.expirationTimes=Yc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yc(0),this.identifierPrefix=i,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Yd(e,t,n,i,o,s,a,c,h){return e=new RC(e,t,n,c,h),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ye(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Nd(s),e}function MC(e,t,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(K0)}catch(e){console.error(e)}}K0(),Gv.exports=je;var Q0=Gv.exports,kg=Q0;Nh.createRoot=kg.createRoot,Nh.hydrateRoot=kg.hydrateRoot;function np(e,t){const n=at.useRef(t);at.useEffect(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}function zC(e,t,n){t.center!==n.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==n.radius&&e.setRadius(t.radius)}const X0=1;function Y0(e){return Object.freeze({__version:X0,map:e})}function J0(e,t){return Object.freeze({...e,...t})}const ip=at.createContext(null),rp=ip.Provider;function go(){const e=at.useContext(ip);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function op(e){function t(n,i){const{instance:o,context:s}=e(n).current;return at.useImperativeHandle(i,()=>o),n.children==null?null:Lu.createElement(rp,{value:s},n.children)}return at.forwardRef(t)}function tw(e){function t(n,i){const[o,s]=at.useState(!1),{instance:a}=e(n,s).current;at.useImperativeHandle(i,()=>a),at.useEffect(function(){o&&a.update()},[a,o,n.children]);const c=a._contentNode;return c?Q0.createPortal(n.children,c):null}return at.forwardRef(t)}function sp(e){function t(n,i){const{instance:o}=e(n).current;return at.useImperativeHandle(i,()=>o),null}return at.forwardRef(t)}function ew(e){return function(n){const i=go(),o=e(n,i),{instance:s}=o.current,a=at.useRef(n.position),{position:c}=n;return at.useEffect(function(){return s.addTo(i.map),function(){s.remove()}},[i.map,s]),at.useEffect(function(){c!=null&&c!==a.current&&(s.setPosition(c),a.current=c)},[s,c]),o}}function Ol(e,t){const n=at.useRef();at.useEffect(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}function oa(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function nw(e,t){return function(i,o){const s=go(),a=e(oa(i,s),s);return np(s.map,i.attribution),Ol(a.current,i.eventHandlers),t(a.current,s,i,o),a}}var xf={exports:{}};/* @preserve + * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com + * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade + */(function(e,t){(function(n,i){i(t)})(wi,function(n){var i="1.9.4";function o(r){var u,l,f,p;for(l=1,f=arguments.length;l"u"||!L||!L.Mixin)){r=P(r)?r:[r];for(var u=0;u0?Math.floor(r):Math.ceil(r)};k.prototype={clone:function(){return new k(this.x,this.y)},add:function(r){return this.clone()._add(z(r))},_add:function(r){return this.x+=r.x,this.y+=r.y,this},subtract:function(r){return this.clone()._subtract(z(r))},_subtract:function(r){return this.x-=r.x,this.y-=r.y,this},divideBy:function(r){return this.clone()._divideBy(r)},_divideBy:function(r){return this.x/=r,this.y/=r,this},multiplyBy:function(r){return this.clone()._multiplyBy(r)},_multiplyBy:function(r){return this.x*=r,this.y*=r,this},scaleBy:function(r){return new k(this.x*r.x,this.y*r.y)},unscaleBy:function(r){return new k(this.x/r.x,this.y/r.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Y(this.x),this.y=Y(this.y),this},distanceTo:function(r){r=z(r);var u=r.x-this.x,l=r.y-this.y;return Math.sqrt(u*u+l*l)},equals:function(r){return r=z(r),r.x===this.x&&r.y===this.y},contains:function(r){return r=z(r),Math.abs(r.x)<=Math.abs(this.x)&&Math.abs(r.y)<=Math.abs(this.y)},toString:function(){return"Point("+v(this.x)+", "+v(this.y)+")"}};function z(r,u,l){return r instanceof k?r:P(r)?new k(r[0],r[1]):r==null?r:typeof r=="object"&&"x"in r&&"y"in r?new k(r.x,r.y):new k(r,u,l)}function Q(r,u){if(r)for(var l=u?[r,u]:r,f=0,p=l.length;f=this.min.x&&l.x<=this.max.x&&u.y>=this.min.y&&l.y<=this.max.y},intersects:function(r){r=ht(r);var u=this.min,l=this.max,f=r.min,p=r.max,g=p.x>=u.x&&f.x<=l.x,T=p.y>=u.y&&f.y<=l.y;return g&&T},overlaps:function(r){r=ht(r);var u=this.min,l=this.max,f=r.min,p=r.max,g=p.x>u.x&&f.xu.y&&f.y=u.lat&&p.lat<=l.lat&&f.lng>=u.lng&&p.lng<=l.lng},intersects:function(r){r=yt(r);var u=this._southWest,l=this._northEast,f=r.getSouthWest(),p=r.getNorthEast(),g=p.lat>=u.lat&&f.lat<=l.lat,T=p.lng>=u.lng&&f.lng<=l.lng;return g&&T},overlaps:function(r){r=yt(r);var u=this._southWest,l=this._northEast,f=r.getSouthWest(),p=r.getNorthEast(),g=p.lat>u.lat&&f.latu.lng&&f.lng1,eT=function(){var r=!1;try{var u=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("testPassiveEventSupport",_,u),window.removeEventListener("testPassiveEventSupport",_,u)}catch{}return r}(),nT=function(){return!!document.createElement("canvas").getContext}(),wc=!!(document.createElementNS&&dm("svg").createSVGRect),iT=!!wc&&function(){var r=document.createElement("div");return r.innerHTML="",(r.firstChild&&r.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),rT=!wc&&function(){try{var r=document.createElement("div");r.innerHTML='';var u=r.firstChild;return u.style.behavior="url(#default#VML)",u&&typeof u.adj=="object"}catch{return!1}}(),oT=navigator.platform.indexOf("Mac")===0,sT=navigator.platform.indexOf("Linux")===0;function pn(r){return navigator.userAgent.toLowerCase().indexOf(r)>=0}var W={ie:wa,ielt9:jE,edge:mm,webkit:gc,android:_m,android23:gm,androidStock:ZE,opera:vc,chrome:vm,gecko:ym,safari:WE,phantom:wm,opera12:Em,win:GE,ie3d:Tm,webkit3d:yc,gecko3d:Pm,any3d:qE,mobile:Lo,mobileWebkit:KE,mobileWebkit3d:QE,msPointer:Sm,pointer:Cm,touch:XE,touchNative:Im,mobileOpera:YE,mobileGecko:JE,retina:tT,passiveEvents:eT,canvas:nT,svg:wc,vml:rT,inlineSvg:iT,mac:oT,linux:sT},Lm=W.msPointer?"MSPointerDown":"pointerdown",Am=W.msPointer?"MSPointerMove":"pointermove",xm=W.msPointer?"MSPointerUp":"pointerup",km=W.msPointer?"MSPointerCancel":"pointercancel",Ec={touchstart:Lm,touchmove:Am,touchend:xm,touchcancel:km},Rm={touchstart:fT,touchmove:Ea,touchend:Ea,touchcancel:Ea},pr={},Mm=!1;function aT(r,u,l){return u==="touchstart"&&hT(),Rm[u]?(l=Rm[u].bind(this,l),r.addEventListener(Ec[u],l,!1),l):(console.warn("wrong event specified:",u),_)}function uT(r,u,l){if(!Ec[u]){console.warn("wrong event specified:",u);return}r.removeEventListener(Ec[u],l,!1)}function lT(r){pr[r.pointerId]=r}function cT(r){pr[r.pointerId]&&(pr[r.pointerId]=r)}function Om(r){delete pr[r.pointerId]}function hT(){Mm||(document.addEventListener(Lm,lT,!0),document.addEventListener(Am,cT,!0),document.addEventListener(xm,Om,!0),document.addEventListener(km,Om,!0),Mm=!0)}function Ea(r,u){if(u.pointerType!==(u.MSPOINTER_TYPE_MOUSE||"mouse")){u.touches=[];for(var l in pr)u.touches.push(pr[l]);u.changedTouches=[u],r(u)}}function fT(r,u){u.MSPOINTER_TYPE_TOUCH&&u.pointerType===u.MSPOINTER_TYPE_TOUCH&&ie(u),Ea(r,u)}function dT(r){var u={},l,f;for(f in r)l=r[f],u[f]=l&&l.bind?l.bind(r):l;return r=u,u.type="dblclick",u.detail=2,u.isTrusted=!1,u._simulated=!0,u}var pT=200;function mT(r,u){r.addEventListener("dblclick",u);var l=0,f;function p(g){if(g.detail!==1){f=g.detail;return}if(!(g.pointerType==="mouse"||g.sourceCapabilities&&!g.sourceCapabilities.firesTouchEvents)){var T=bm(g);if(!(T.some(function(A){return A instanceof HTMLLabelElement&&A.attributes.for})&&!T.some(function(A){return A instanceof HTMLInputElement||A instanceof HTMLSelectElement}))){var I=Date.now();I-l<=pT?(f++,f===2&&u(dT(g))):f=1,l=I}}}return r.addEventListener("click",p),{dblclick:u,simDblclick:p}}function _T(r,u){r.removeEventListener("dblclick",u.dblclick),r.removeEventListener("click",u.simDblclick)}var Tc=Sa(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Ao=Sa(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Dm=Ao==="webkitTransition"||Ao==="OTransition"?Ao+"End":"transitionend";function Nm(r){return typeof r=="string"?document.getElementById(r):r}function xo(r,u){var l=r.style[u]||r.currentStyle&&r.currentStyle[u];if((!l||l==="auto")&&document.defaultView){var f=document.defaultView.getComputedStyle(r,null);l=f?f[u]:null}return l==="auto"?null:l}function mt(r,u,l){var f=document.createElement(r);return f.className=u||"",l&&l.appendChild(f),f}function kt(r){var u=r.parentNode;u&&u.removeChild(r)}function Ta(r){for(;r.firstChild;)r.removeChild(r.firstChild)}function mr(r){var u=r.parentNode;u&&u.lastChild!==r&&u.appendChild(r)}function _r(r){var u=r.parentNode;u&&u.firstChild!==r&&u.insertBefore(r,u.firstChild)}function Pc(r,u){if(r.classList!==void 0)return r.classList.contains(u);var l=Pa(r);return l.length>0&&new RegExp("(^|\\s)"+u+"(\\s|$)").test(l)}function rt(r,u){if(r.classList!==void 0)for(var l=C(u),f=0,p=l.length;f0?2*window.devicePixelRatio:1;function Fm(r){return W.edge?r.wheelDeltaY/2:r.deltaY&&r.deltaMode===0?-r.deltaY/yT:r.deltaY&&r.deltaMode===1?-r.deltaY*20:r.deltaY&&r.deltaMode===2?-r.deltaY*60:r.deltaX||r.deltaZ?0:r.wheelDelta?(r.wheelDeltaY||r.wheelDelta)/2:r.detail&&Math.abs(r.detail)<32765?-r.detail*20:r.detail?r.detail/-32765*60:0}function Nc(r,u){var l=u.relatedTarget;if(!l)return!0;try{for(;l&&l!==r;)l=l.parentNode}catch{return!1}return l!==r}var wT={__proto__:null,on:et,off:Tt,stopPropagation:zi,disableScrollPropagation:Dc,disableClickPropagation:Oo,preventDefault:ie,stop:bi,getPropagationPath:bm,getMousePosition:Bm,getWheelDelta:Fm,isExternalTarget:Nc,addListener:et,removeListener:Tt},Um=On.extend({run:function(r,u,l,f){this.stop(),this._el=r,this._inProgress=!0,this._duration=l||.25,this._easeOutPower=1/Math.max(f||.5,.2),this._startPos=Vi(r),this._offset=u.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Et(this._animate,this),this._step()},_step:function(r){var u=+new Date-this._startTime,l=this._duration*1e3;uthis.options.maxZoom)?this.setZoom(r):this},panInsideBounds:function(r,u){this._enforcingBounds=!0;var l=this.getCenter(),f=this._limitCenter(l,this._zoom,yt(r));return l.equals(f)||this.panTo(f,u),this._enforcingBounds=!1,this},panInside:function(r,u){u=u||{};var l=z(u.paddingTopLeft||u.padding||[0,0]),f=z(u.paddingBottomRight||u.padding||[0,0]),p=this.project(this.getCenter()),g=this.project(r),T=this.getPixelBounds(),I=ht([T.min.add(l),T.max.subtract(f)]),A=I.getSize();if(!I.contains(g)){this._enforcingBounds=!0;var O=g.subtract(I.getCenter()),U=I.extend(g).getSize().subtract(A);p.x+=O.x<0?-U.x:U.x,p.y+=O.y<0?-U.y:U.y,this.panTo(this.unproject(p),u),this._enforcingBounds=!1}return this},invalidateSize:function(r){if(!this._loaded)return this;r=o({animate:!1,pan:!0},r===!0?{animate:!0}:r);var u=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var l=this.getSize(),f=u.divideBy(2).round(),p=l.divideBy(2).round(),g=f.subtract(p);return!g.x&&!g.y?this:(r.animate&&r.pan?this.panBy(g):(r.pan&&this._rawPanBy(g),this.fire("move"),r.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:u,newSize:l}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(r){if(r=this._locateOptions=o({timeout:1e4,watch:!1},r),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var u=a(this._handleGeolocationResponse,this),l=a(this._handleGeolocationError,this);return r.watch?this._locationWatchId=navigator.geolocation.watchPosition(u,l,r):navigator.geolocation.getCurrentPosition(u,l,r),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(r){if(this._container._leaflet_id){var u=r.code,l=r.message||(u===1?"permission denied":u===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:u,message:"Geolocation error: "+l+"."})}},_handleGeolocationResponse:function(r){if(this._container._leaflet_id){var u=r.coords.latitude,l=r.coords.longitude,f=new pt(u,l),p=f.toBounds(r.coords.accuracy*2),g=this._locateOptions;if(g.setView){var T=this.getBoundsZoom(p);this.setView(f,g.maxZoom?Math.min(T,g.maxZoom):T)}var I={latlng:f,bounds:p,timestamp:r.timestamp};for(var A in r.coords)typeof r.coords[A]=="number"&&(I[A]=r.coords[A]);this.fire("locationfound",I)}},addHandler:function(r,u){if(!u)return this;var l=this[r]=new u(this);return this._handlers.push(l),this.options[r]&&l.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),kt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Kt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var r;for(r in this._layers)this._layers[r].remove();for(r in this._panes)kt(this._panes[r]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(r,u){var l="leaflet-pane"+(r?" leaflet-"+r.replace("Pane","")+"-pane":""),f=mt("div",l,u||this._mapPane);return r&&(this._panes[r]=f),f},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var r=this.getPixelBounds(),u=this.unproject(r.getBottomLeft()),l=this.unproject(r.getTopRight());return new Ht(u,l)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(r,u,l){r=yt(r),l=z(l||[0,0]);var f=this.getZoom()||0,p=this.getMinZoom(),g=this.getMaxZoom(),T=r.getNorthWest(),I=r.getSouthEast(),A=this.getSize().subtract(l),O=ht(this.project(I,f),this.project(T,f)).getSize(),U=W.any3d?this.options.zoomSnap:1,q=A.x/O.x,ot=A.y/O.y,Te=u?Math.max(q,ot):Math.min(q,ot);return f=this.getScaleZoom(Te,f),U&&(f=Math.round(f/(U/100))*(U/100),f=u?Math.ceil(f/U)*U:Math.floor(f/U)*U),Math.max(p,Math.min(g,f))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new k(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(r,u){var l=this._getTopLeftPoint(r,u);return new Q(l,l.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(r){return this.options.crs.getProjectedBounds(r===void 0?this.getZoom():r)},getPane:function(r){return typeof r=="string"?this._panes[r]:r},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(r,u){var l=this.options.crs;return u=u===void 0?this._zoom:u,l.scale(r)/l.scale(u)},getScaleZoom:function(r,u){var l=this.options.crs;u=u===void 0?this._zoom:u;var f=l.zoom(r*l.scale(u));return isNaN(f)?1/0:f},project:function(r,u){return u=u===void 0?this._zoom:u,this.options.crs.latLngToPoint(tt(r),u)},unproject:function(r,u){return u=u===void 0?this._zoom:u,this.options.crs.pointToLatLng(z(r),u)},layerPointToLatLng:function(r){var u=z(r).add(this.getPixelOrigin());return this.unproject(u)},latLngToLayerPoint:function(r){var u=this.project(tt(r))._round();return u._subtract(this.getPixelOrigin())},wrapLatLng:function(r){return this.options.crs.wrapLatLng(tt(r))},wrapLatLngBounds:function(r){return this.options.crs.wrapLatLngBounds(yt(r))},distance:function(r,u){return this.options.crs.distance(tt(r),tt(u))},containerPointToLayerPoint:function(r){return z(r).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(r){return z(r).add(this._getMapPanePos())},containerPointToLatLng:function(r){var u=this.containerPointToLayerPoint(z(r));return this.layerPointToLatLng(u)},latLngToContainerPoint:function(r){return this.layerPointToContainerPoint(this.latLngToLayerPoint(tt(r)))},mouseEventToContainerPoint:function(r){return Bm(r,this._container)},mouseEventToLayerPoint:function(r){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(r))},mouseEventToLatLng:function(r){return this.layerPointToLatLng(this.mouseEventToLayerPoint(r))},_initContainer:function(r){var u=this._container=Nm(r);if(u){if(u._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");et(u,"scroll",this._onScroll,this),this._containerId=h(u)},_initLayout:function(){var r=this._container;this._fadeAnimated=this.options.fadeAnimation&&W.any3d,rt(r,"leaflet-container"+(W.touch?" leaflet-touch":"")+(W.retina?" leaflet-retina":"")+(W.ielt9?" leaflet-oldie":"")+(W.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var u=xo(r,"position");u!=="absolute"&&u!=="relative"&&u!=="fixed"&&u!=="sticky"&&(r.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var r=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Bt(this._mapPane,new k(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(rt(r.markerPane,"leaflet-zoom-hide"),rt(r.shadowPane,"leaflet-zoom-hide"))},_resetView:function(r,u,l){Bt(this._mapPane,new k(0,0));var f=!this._loaded;this._loaded=!0,u=this._limitZoom(u),this.fire("viewprereset");var p=this._zoom!==u;this._moveStart(p,l)._move(r,u)._moveEnd(p),this.fire("viewreset"),f&&this.fire("load")},_moveStart:function(r,u){return r&&this.fire("zoomstart"),u||this.fire("movestart"),this},_move:function(r,u,l,f){u===void 0&&(u=this._zoom);var p=this._zoom!==u;return this._zoom=u,this._lastCenter=r,this._pixelOrigin=this._getNewPixelOrigin(r),f?l&&l.pinch&&this.fire("zoom",l):((p||l&&l.pinch)&&this.fire("zoom",l),this.fire("move",l)),this},_moveEnd:function(r){return r&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Kt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(r){Bt(this._mapPane,this._getMapPanePos().subtract(r))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(r){this._targets={},this._targets[h(this._container)]=this;var u=r?Tt:et;u(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&u(window,"resize",this._onResize,this),W.any3d&&this.options.transform3DLimit&&(r?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Kt(this._resizeRequest),this._resizeRequest=Et(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var r=this._getMapPanePos();Math.max(Math.abs(r.x),Math.abs(r.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(r,u){for(var l=[],f,p=u==="mouseout"||u==="mouseover",g=r.target||r.srcElement,T=!1;g;){if(f=this._targets[h(g)],f&&(u==="click"||u==="preclick")&&this._draggableMoved(f)){T=!0;break}if(f&&f.listens(u,!0)&&(p&&!Nc(g,r)||(l.push(f),p))||g===this._container)break;g=g.parentNode}return!l.length&&!T&&!p&&this.listens(u,!0)&&(l=[this]),l},_isClickDisabled:function(r){for(;r&&r!==this._container;){if(r._leaflet_disable_click)return!0;r=r.parentNode}},_handleDOMEvent:function(r){var u=r.target||r.srcElement;if(!(!this._loaded||u._leaflet_disable_events||r.type==="click"&&this._isClickDisabled(u))){var l=r.type;l==="mousedown"&&xc(u),this._fireDOMEvent(r,l)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(r,u,l){if(r.type==="click"){var f=o({},r);f.type="preclick",this._fireDOMEvent(f,f.type,l)}var p=this._findEventTargets(r,u);if(l){for(var g=[],T=0;T0?Math.round(r-u)/2:Math.max(0,Math.ceil(r))-Math.max(0,Math.floor(u))},_limitZoom:function(r){var u=this.getMinZoom(),l=this.getMaxZoom(),f=W.any3d?this.options.zoomSnap:1;return f&&(r=Math.round(r/f)*f),Math.max(u,Math.min(l,r))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){zt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(r,u){var l=this._getCenterOffset(r)._trunc();return(u&&u.animate)!==!0&&!this.getSize().contains(l)?!1:(this.panBy(l,u),!0)},_createAnimProxy:function(){var r=this._proxy=mt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(r),this.on("zoomanim",function(u){var l=Tc,f=this._proxy.style[l];Ni(this._proxy,this.project(u.center,u.zoom),this.getZoomScale(u.zoom,1)),f===this._proxy.style[l]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){kt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var r=this.getCenter(),u=this.getZoom();Ni(this._proxy,this.project(r,u),this.getZoomScale(u,1))},_catchTransitionEnd:function(r){this._animatingZoom&&r.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(r,u,l){if(this._animatingZoom)return!0;if(l=l||{},!this._zoomAnimated||l.animate===!1||this._nothingToAnimate()||Math.abs(u-this._zoom)>this.options.zoomAnimationThreshold)return!1;var f=this.getZoomScale(u),p=this._getCenterOffset(r)._divideBy(1-1/f);return l.animate!==!0&&!this.getSize().contains(p)?!1:(Et(function(){this._moveStart(!0,l.noMoveStart||!1)._animateZoom(r,u,!0)},this),!0)},_animateZoom:function(r,u,l,f){this._mapPane&&(l&&(this._animatingZoom=!0,this._animateToCenter=r,this._animateToZoom=u,rt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:r,zoom:u,noUpdate:f}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&zt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function ET(r,u){return new lt(r,u)}var nn=Ze.extend({options:{position:"topright"},initialize:function(r){S(this,r)},getPosition:function(){return this.options.position},setPosition:function(r){var u=this._map;return u&&u.removeControl(this),this.options.position=r,u&&u.addControl(this),this},getContainer:function(){return this._container},addTo:function(r){this.remove(),this._map=r;var u=this._container=this.onAdd(r),l=this.getPosition(),f=r._controlCorners[l];return rt(u,"leaflet-control"),l.indexOf("bottom")!==-1?f.insertBefore(u,f.firstChild):f.appendChild(u),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(kt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(r){this._map&&r&&r.screenX>0&&r.screenY>0&&this._map.getContainer().focus()}}),Do=function(r){return new nn(r)};lt.include({addControl:function(r){return r.addTo(this),this},removeControl:function(r){return r.remove(),this},_initControlPos:function(){var r=this._controlCorners={},u="leaflet-",l=this._controlContainer=mt("div",u+"control-container",this._container);function f(p,g){var T=u+p+" "+u+g;r[p+g]=mt("div",T,l)}f("top","left"),f("top","right"),f("bottom","left"),f("bottom","right")},_clearControlPos:function(){for(var r in this._controlCorners)kt(this._controlCorners[r]);kt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var $m=nn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(r,u,l,f){return l1,this._baseLayersList.style.display=r?"":"none"),this._separator.style.display=u&&r?"":"none",this},_onLayerChange:function(r){this._handlingClick||this._update();var u=this._getLayer(h(r.target)),l=u.overlay?r.type==="add"?"overlayadd":"overlayremove":r.type==="add"?"baselayerchange":null;l&&this._map.fire(l,u)},_createRadioElement:function(r,u){var l='",f=document.createElement("div");return f.innerHTML=l,f.firstChild},_addItem:function(r){var u=document.createElement("label"),l=this._map.hasLayer(r.layer),f;r.overlay?(f=document.createElement("input"),f.type="checkbox",f.className="leaflet-control-layers-selector",f.defaultChecked=l):f=this._createRadioElement("leaflet-base-layers_"+h(this),l),this._layerControlInputs.push(f),f.layerId=h(r.layer),et(f,"click",this._onInputClick,this);var p=document.createElement("span");p.innerHTML=" "+r.name;var g=document.createElement("span");u.appendChild(g),g.appendChild(f),g.appendChild(p);var T=r.overlay?this._overlaysList:this._baseLayersList;return T.appendChild(u),this._checkDisabledLayers(),u},_onInputClick:function(){if(!this._preventClick){var r=this._layerControlInputs,u,l,f=[],p=[];this._handlingClick=!0;for(var g=r.length-1;g>=0;g--)u=r[g],l=this._getLayer(u.layerId).layer,u.checked?f.push(l):u.checked||p.push(l);for(g=0;g=0;p--)u=r[p],l=this._getLayer(u.layerId).layer,u.disabled=l.options.minZoom!==void 0&&fl.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var r=this._section;this._preventClick=!0,et(r,"click",ie),this.expand();var u=this;setTimeout(function(){Tt(r,"click",ie),u._preventClick=!1})}}),TT=function(r,u,l){return new $m(r,u,l)},Vc=nn.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(r){var u="leaflet-control-zoom",l=mt("div",u+" leaflet-bar"),f=this.options;return this._zoomInButton=this._createButton(f.zoomInText,f.zoomInTitle,u+"-in",l,this._zoomIn),this._zoomOutButton=this._createButton(f.zoomOutText,f.zoomOutTitle,u+"-out",l,this._zoomOut),this._updateDisabled(),r.on("zoomend zoomlevelschange",this._updateDisabled,this),l},onRemove:function(r){r.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(r){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(r.shiftKey?3:1))},_createButton:function(r,u,l,f,p){var g=mt("a",l,f);return g.innerHTML=r,g.href="#",g.title=u,g.setAttribute("role","button"),g.setAttribute("aria-label",u),Oo(g),et(g,"click",bi),et(g,"click",p,this),et(g,"click",this._refocusOnMap,this),g},_updateDisabled:function(){var r=this._map,u="leaflet-disabled";zt(this._zoomInButton,u),zt(this._zoomOutButton,u),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||r._zoom===r.getMinZoom())&&(rt(this._zoomOutButton,u),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||r._zoom===r.getMaxZoom())&&(rt(this._zoomInButton,u),this._zoomInButton.setAttribute("aria-disabled","true"))}});lt.mergeOptions({zoomControl:!0}),lt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Vc,this.addControl(this.zoomControl))});var PT=function(r){return new Vc(r)},jm=nn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(r){var u="leaflet-control-scale",l=mt("div",u),f=this.options;return this._addScales(f,u+"-line",l),r.on(f.updateWhenIdle?"moveend":"move",this._update,this),r.whenReady(this._update,this),l},onRemove:function(r){r.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(r,u,l){r.metric&&(this._mScale=mt("div",u,l)),r.imperial&&(this._iScale=mt("div",u,l))},_update:function(){var r=this._map,u=r.getSize().y/2,l=r.distance(r.containerPointToLatLng([0,u]),r.containerPointToLatLng([this.options.maxWidth,u]));this._updateScales(l)},_updateScales:function(r){this.options.metric&&r&&this._updateMetric(r),this.options.imperial&&r&&this._updateImperial(r)},_updateMetric:function(r){var u=this._getRoundNum(r),l=u<1e3?u+" m":u/1e3+" km";this._updateScale(this._mScale,l,u/r)},_updateImperial:function(r){var u=r*3.2808399,l,f,p;u>5280?(l=u/5280,f=this._getRoundNum(l),this._updateScale(this._iScale,f+" mi",f/l)):(p=this._getRoundNum(u),this._updateScale(this._iScale,p+" ft",p/u))},_updateScale:function(r,u,l){r.style.width=Math.round(this.options.maxWidth*l)+"px",r.innerHTML=u},_getRoundNum:function(r){var u=Math.pow(10,(Math.floor(r)+"").length-1),l=r/u;return l=l>=10?10:l>=5?5:l>=3?3:l>=2?2:1,u*l}}),ST=function(r){return new jm(r)},CT='',zc=nn.extend({options:{position:"bottomright",prefix:''+(W.inlineSvg?CT+" ":"")+"Leaflet"},initialize:function(r){S(this,r),this._attributions={}},onAdd:function(r){r.attributionControl=this,this._container=mt("div","leaflet-control-attribution"),Oo(this._container);for(var u in r._layers)r._layers[u].getAttribution&&this.addAttribution(r._layers[u].getAttribution());return this._update(),r.on("layeradd",this._addAttribution,this),this._container},onRemove:function(r){r.off("layeradd",this._addAttribution,this)},_addAttribution:function(r){r.layer.getAttribution&&(this.addAttribution(r.layer.getAttribution()),r.layer.once("remove",function(){this.removeAttribution(r.layer.getAttribution())},this))},setPrefix:function(r){return this.options.prefix=r,this._update(),this},addAttribution:function(r){return r?(this._attributions[r]||(this._attributions[r]=0),this._attributions[r]++,this._update(),this):this},removeAttribution:function(r){return r?(this._attributions[r]&&(this._attributions[r]--,this._update()),this):this},_update:function(){if(this._map){var r=[];for(var u in this._attributions)this._attributions[u]&&r.push(u);var l=[];this.options.prefix&&l.push(this.options.prefix),r.length&&l.push(r.join(", ")),this._container.innerHTML=l.join(' ')}}});lt.mergeOptions({attributionControl:!0}),lt.addInitHook(function(){this.options.attributionControl&&new zc().addTo(this)});var IT=function(r){return new zc(r)};nn.Layers=$m,nn.Zoom=Vc,nn.Scale=jm,nn.Attribution=zc,Do.layers=TT,Do.zoom=PT,Do.scale=ST,Do.attribution=IT;var _n=Ze.extend({initialize:function(r){this._map=r},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});_n.addTo=function(r,u){return r.addHandler(u,this),this};var LT={Events:ne},Hm=W.touch?"touchstart mousedown":"mousedown",Jn=On.extend({options:{clickTolerance:3},initialize:function(r,u,l,f){S(this,f),this._element=r,this._dragStartTarget=u||r,this._preventOutline=l},enable:function(){this._enabled||(et(this._dragStartTarget,Hm,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Jn._dragging===this&&this.finishDrag(!0),Tt(this._dragStartTarget,Hm,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(r){if(this._enabled&&(this._moved=!1,!Pc(this._element,"leaflet-zoom-anim"))){if(r.touches&&r.touches.length!==1){Jn._dragging===this&&this.finishDrag();return}if(!(Jn._dragging||r.shiftKey||r.which!==1&&r.button!==1&&!r.touches)&&(Jn._dragging=this,this._preventOutline&&xc(this._element),Ic(),ko(),!this._moving)){this.fire("down");var u=r.touches?r.touches[0]:r,l=Vm(this._element);this._startPoint=new k(u.clientX,u.clientY),this._startPos=Vi(this._element),this._parentScale=kc(l);var f=r.type==="mousedown";et(document,f?"mousemove":"touchmove",this._onMove,this),et(document,f?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(r){if(this._enabled){if(r.touches&&r.touches.length>1){this._moved=!0;return}var u=r.touches&&r.touches.length===1?r.touches[0]:r,l=new k(u.clientX,u.clientY)._subtract(this._startPoint);!l.x&&!l.y||Math.abs(l.x)+Math.abs(l.y)g&&(T=I,g=A);g>l&&(u[T]=1,Bc(r,u,l,f,T),Bc(r,u,l,T,p))}function RT(r,u){for(var l=[r[0]],f=1,p=0,g=r.length;fu&&(l.push(r[f]),p=f);return pu.max.x&&(l|=2),r.yu.max.y&&(l|=8),l}function MT(r,u){var l=u.x-r.x,f=u.y-r.y;return l*l+f*f}function No(r,u,l,f){var p=u.x,g=u.y,T=l.x-p,I=l.y-g,A=T*T+I*I,O;return A>0&&(O=((r.x-p)*T+(r.y-g)*I)/A,O>1?(p=l.x,g=l.y):O>0&&(p+=T*O,g+=I*O)),T=r.x-p,I=r.y-g,f?T*T+I*I:new k(p,g)}function Ge(r){return!P(r[0])||typeof r[0][0]!="object"&&typeof r[0][0]<"u"}function Xm(r){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ge(r)}function Ym(r,u){var l,f,p,g,T,I,A,O;if(!r||r.length===0)throw new Error("latlngs not passed");Ge(r)||(console.warn("latlngs are not flat! Only the first ring will be used"),r=r[0]);var U=tt([0,0]),q=yt(r),ot=q.getNorthWest().distanceTo(q.getSouthWest())*q.getNorthEast().distanceTo(q.getNorthWest());ot<1700&&(U=bc(r));var Te=r.length,Qt=[];for(l=0;lf){A=(g-f)/p,O=[I.x-A*(I.x-T.x),I.y-A*(I.y-T.y)];break}var xe=u.unproject(z(O));return tt([xe.lat+U.lat,xe.lng+U.lng])}var OT={__proto__:null,simplify:Gm,pointToSegmentDistance:qm,closestPointOnSegment:xT,clipSegment:Qm,_getEdgeIntersection:La,_getBitCode:Bi,_sqClosestPointOnSegment:No,isFlat:Ge,_flat:Xm,polylineCenter:Ym},Fc={project:function(r){return new k(r.lng,r.lat)},unproject:function(r){return new pt(r.y,r.x)},bounds:new Q([-180,-90],[180,90])},Uc={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Q([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(r){var u=Math.PI/180,l=this.R,f=r.lat*u,p=this.R_MINOR/l,g=Math.sqrt(1-p*p),T=g*Math.sin(f),I=Math.tan(Math.PI/4-f/2)/Math.pow((1-T)/(1+T),g/2);return f=-l*Math.log(Math.max(I,1e-10)),new k(r.lng*u*l,f)},unproject:function(r){for(var u=180/Math.PI,l=this.R,f=this.R_MINOR/l,p=Math.sqrt(1-f*f),g=Math.exp(-r.y/l),T=Math.PI/2-2*Math.atan(g),I=0,A=.1,O;I<15&&Math.abs(A)>1e-7;I++)O=p*Math.sin(T),O=Math.pow((1-O)/(1+O),p/2),A=Math.PI/2-2*Math.atan(g*O)-T,T+=A;return new pt(T*u,r.x*u/l)}},DT={__proto__:null,LonLat:Fc,Mercator:Uc,SphericalMercator:dc},NT=o({},Yn,{code:"EPSG:3395",projection:Uc,transformation:function(){var r=.5/(Math.PI*Uc.R);return Io(r,.5,-r,.5)}()}),Jm=o({},Yn,{code:"EPSG:4326",projection:Fc,transformation:Io(1/180,1,-1/180,.5)}),VT=o({},Ae,{projection:Fc,transformation:Io(1,0,-1,0),scale:function(r){return Math.pow(2,r)},zoom:function(r){return Math.log(r)/Math.LN2},distance:function(r,u){var l=u.lng-r.lng,f=u.lat-r.lat;return Math.sqrt(l*l+f*f)},infinite:!0});Ae.Earth=Yn,Ae.EPSG3395=NT,Ae.EPSG3857=mc,Ae.EPSG900913=$E,Ae.EPSG4326=Jm,Ae.Simple=VT;var rn=On.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(r){return r.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(r){return r&&r.removeLayer(this),this},getPane:function(r){return this._map.getPane(r?this.options[r]||r:this.options.pane)},addInteractiveTarget:function(r){return this._map._targets[h(r)]=this,this},removeInteractiveTarget:function(r){return delete this._map._targets[h(r)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(r){var u=r.target;if(u.hasLayer(this)){if(this._map=u,this._zoomAnimated=u._zoomAnimated,this.getEvents){var l=this.getEvents();u.on(l,this),this.once("remove",function(){u.off(l,this)},this)}this.onAdd(u),this.fire("add"),u.fire("layeradd",{layer:this})}}});lt.include({addLayer:function(r){if(!r._layerAdd)throw new Error("The provided object is not a Layer.");var u=h(r);return this._layers[u]?this:(this._layers[u]=r,r._mapToAdd=this,r.beforeAdd&&r.beforeAdd(this),this.whenReady(r._layerAdd,r),this)},removeLayer:function(r){var u=h(r);return this._layers[u]?(this._loaded&&r.onRemove(this),delete this._layers[u],this._loaded&&(this.fire("layerremove",{layer:r}),r.fire("remove")),r._map=r._mapToAdd=null,this):this},hasLayer:function(r){return h(r)in this._layers},eachLayer:function(r,u){for(var l in this._layers)r.call(u,this._layers[l]);return this},_addLayers:function(r){r=r?P(r)?r:[r]:[];for(var u=0,l=r.length;uthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&u[0]instanceof pt&&u[0].equals(u[l-1])&&u.pop(),u},_setLatLngs:function(r){Nn.prototype._setLatLngs.call(this,r),Ge(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ge(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var r=this._renderer._bounds,u=this.options.weight,l=new k(u,u);if(r=new Q(r.min.subtract(l),r.max.add(l)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(r))){if(this.options.noClip){this._parts=this._rings;return}for(var f=0,p=this._rings.length,g;fr.y!=p.y>r.y&&r.x<(p.x-f.x)*(r.y-f.y)/(p.y-f.y)+f.x&&(u=!u);return u||Nn.prototype._containsPoint.call(this,r,!0)}});function HT(r,u){return new yr(r,u)}var Vn=Dn.extend({initialize:function(r,u){S(this,u),this._layers={},r&&this.addData(r)},addData:function(r){var u=P(r)?r:r.features,l,f,p;if(u){for(l=0,f=u.length;l0&&p.push(p[0].slice()),p}function wr(r,u){return r.feature?o({},r.feature,{geometry:u}):Oa(u)}function Oa(r){return r.type==="Feature"||r.type==="FeatureCollection"?r:{type:"Feature",properties:{},geometry:r}}var Zc={toGeoJSON:function(r){return wr(this,{type:"Point",coordinates:Hc(this.getLatLng(),r)})}};Aa.include(Zc),$c.include(Zc),xa.include(Zc),Nn.include({toGeoJSON:function(r){var u=!Ge(this._latlngs),l=Ma(this._latlngs,u?1:0,!1,r);return wr(this,{type:(u?"Multi":"")+"LineString",coordinates:l})}}),yr.include({toGeoJSON:function(r){var u=!Ge(this._latlngs),l=u&&!Ge(this._latlngs[0]),f=Ma(this._latlngs,l?2:u?1:0,!0,r);return u||(f=[f]),wr(this,{type:(l?"Multi":"")+"Polygon",coordinates:f})}}),gr.include({toMultiPoint:function(r){var u=[];return this.eachLayer(function(l){u.push(l.toGeoJSON(r).geometry.coordinates)}),wr(this,{type:"MultiPoint",coordinates:u})},toGeoJSON:function(r){var u=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(u==="MultiPoint")return this.toMultiPoint(r);var l=u==="GeometryCollection",f=[];return this.eachLayer(function(p){if(p.toGeoJSON){var g=p.toGeoJSON(r);if(l)f.push(g.geometry);else{var T=Oa(g);T.type==="FeatureCollection"?f.push.apply(f,T.features):f.push(T)}}}),l?wr(this,{geometries:f,type:"GeometryCollection"}):{type:"FeatureCollection",features:f}}});function n_(r,u){return new Vn(r,u)}var ZT=n_,Da=rn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(r,u,l){this._url=r,this._bounds=yt(u),S(this,l)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(rt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){kt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(r){return this.options.opacity=r,this._image&&this._updateOpacity(),this},setStyle:function(r){return r.opacity&&this.setOpacity(r.opacity),this},bringToFront:function(){return this._map&&mr(this._image),this},bringToBack:function(){return this._map&&_r(this._image),this},setUrl:function(r){return this._url=r,this._image&&(this._image.src=r),this},setBounds:function(r){return this._bounds=yt(r),this._map&&this._reset(),this},getEvents:function(){var r={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(r.zoomanim=this._animateZoom),r},setZIndex:function(r){return this.options.zIndex=r,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var r=this._url.tagName==="IMG",u=this._image=r?this._url:mt("img");if(rt(u,"leaflet-image-layer"),this._zoomAnimated&&rt(u,"leaflet-zoom-animated"),this.options.className&&rt(u,this.options.className),u.onselectstart=_,u.onmousemove=_,u.onload=a(this.fire,this,"load"),u.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(u.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),r){this._url=u.src;return}u.src=this._url,u.alt=this.options.alt},_animateZoom:function(r){var u=this._map.getZoomScale(r.zoom),l=this._map._latLngBoundsToNewLayerBounds(this._bounds,r.zoom,r.center).min;Ni(this._image,l,u)},_reset:function(){var r=this._image,u=new Q(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),l=u.getSize();Bt(r,u.min),r.style.width=l.x+"px",r.style.height=l.y+"px"},_updateOpacity:function(){We(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var r=this.options.errorOverlayUrl;r&&this._url!==r&&(this._url=r,this._image.src=r)},getCenter:function(){return this._bounds.getCenter()}}),WT=function(r,u,l){return new Da(r,u,l)},i_=Da.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var r=this._url.tagName==="VIDEO",u=this._image=r?this._url:mt("video");if(rt(u,"leaflet-image-layer"),this._zoomAnimated&&rt(u,"leaflet-zoom-animated"),this.options.className&&rt(u,this.options.className),u.onselectstart=_,u.onmousemove=_,u.onloadeddata=a(this.fire,this,"load"),r){for(var l=u.getElementsByTagName("source"),f=[],p=0;p0?f:[u.src];return}P(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(u.style,"objectFit")&&(u.style.objectFit="fill"),u.autoplay=!!this.options.autoplay,u.loop=!!this.options.loop,u.muted=!!this.options.muted,u.playsInline=!!this.options.playsInline;for(var g=0;gp?(u.height=p+"px",rt(r,g)):zt(r,g),this._containerWidth=this._container.offsetWidth},_animateZoom:function(r){var u=this._map._latLngToNewLayerPoint(this._latlng,r.zoom,r.center),l=this._getAnchor();Bt(this._container,u.add(l))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var r=this._map,u=parseInt(xo(this._container,"marginBottom"),10)||0,l=this._container.offsetHeight+u,f=this._containerWidth,p=new k(this._containerLeft,-l-this._containerBottom);p._add(Vi(this._container));var g=r.layerPointToContainerPoint(p),T=z(this.options.autoPanPadding),I=z(this.options.autoPanPaddingTopLeft||T),A=z(this.options.autoPanPaddingBottomRight||T),O=r.getSize(),U=0,q=0;g.x+f+A.x>O.x&&(U=g.x+f-O.x+A.x),g.x-U-I.x<0&&(U=g.x-I.x),g.y+l+A.y>O.y&&(q=g.y+l-O.y+A.y),g.y-q-I.y<0&&(q=g.y-I.y),(U||q)&&(this.options.keepInView&&(this._autopanning=!0),r.fire("autopanstart").panBy([U,q]))}},_getAnchor:function(){return z(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),KT=function(r,u){return new Na(r,u)};lt.mergeOptions({closePopupOnClick:!0}),lt.include({openPopup:function(r,u,l){return this._initOverlay(Na,r,u,l).openOn(this),this},closePopup:function(r){return r=arguments.length?r:this._popup,r&&r.close(),this}}),rn.include({bindPopup:function(r,u){return this._popup=this._initOverlay(Na,this._popup,r,u),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(r){return this._popup&&(this instanceof Dn||(this._popup._source=this),this._popup._prepareOpen(r||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(r){return this._popup&&this._popup.setContent(r),this},getPopup:function(){return this._popup},_openPopup:function(r){if(!(!this._popup||!this._map)){bi(r);var u=r.layer||r.target;if(this._popup._source===u&&!(u instanceof ti)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(r.latlng);return}this._popup._source=u,this.openPopup(r.latlng)}},_movePopup:function(r){this._popup.setLatLng(r.latlng)},_onKeyPress:function(r){r.originalEvent.keyCode===13&&this._openPopup(r)}});var Va=gn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(r){gn.prototype.onAdd.call(this,r),this.setOpacity(this.options.opacity),r.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(r){gn.prototype.onRemove.call(this,r),r.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var r=gn.prototype.getEvents.call(this);return this.options.permanent||(r.preclick=this.close),r},_initLayout:function(){var r="leaflet-tooltip",u=r+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=mt("div",u),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+h(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(r){var u,l,f=this._map,p=this._container,g=f.latLngToContainerPoint(f.getCenter()),T=f.layerPointToContainerPoint(r),I=this.options.direction,A=p.offsetWidth,O=p.offsetHeight,U=z(this.options.offset),q=this._getAnchor();I==="top"?(u=A/2,l=O):I==="bottom"?(u=A/2,l=0):I==="center"?(u=A/2,l=O/2):I==="right"?(u=0,l=O/2):I==="left"?(u=A,l=O/2):T.xthis.options.maxZoom||lf?this._retainParent(p,g,T,f):!1)},_retainChildren:function(r,u,l,f){for(var p=2*r;p<2*r+2;p++)for(var g=2*u;g<2*u+2;g++){var T=new k(p,g);T.z=l+1;var I=this._tileCoordsToKey(T),A=this._tiles[I];if(A&&A.active){A.retain=!0;continue}else A&&A.loaded&&(A.retain=!0);l+1this.options.maxZoom||this.options.minZoom!==void 0&&p1){this._setView(r,l);return}for(var q=p.min.y;q<=p.max.y;q++)for(var ot=p.min.x;ot<=p.max.x;ot++){var Te=new k(ot,q);if(Te.z=this._tileZoom,!!this._isValidTile(Te)){var Qt=this._tiles[this._tileCoordsToKey(Te)];Qt?Qt.current=!0:T.push(Te)}}if(T.sort(function(xe,Tr){return xe.distanceTo(g)-Tr.distanceTo(g)}),T.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var qe=document.createDocumentFragment();for(ot=0;otl.max.x)||!u.wrapLat&&(r.yl.max.y))return!1}if(!this.options.bounds)return!0;var f=this._tileCoordsToBounds(r);return yt(this.options.bounds).overlaps(f)},_keyToBounds:function(r){return this._tileCoordsToBounds(this._keyToTileCoords(r))},_tileCoordsToNwSe:function(r){var u=this._map,l=this.getTileSize(),f=r.scaleBy(l),p=f.add(l),g=u.unproject(f,r.z),T=u.unproject(p,r.z);return[g,T]},_tileCoordsToBounds:function(r){var u=this._tileCoordsToNwSe(r),l=new Ht(u[0],u[1]);return this.options.noWrap||(l=this._map.wrapLatLngBounds(l)),l},_tileCoordsToKey:function(r){return r.x+":"+r.y+":"+r.z},_keyToTileCoords:function(r){var u=r.split(":"),l=new k(+u[0],+u[1]);return l.z=+u[2],l},_removeTile:function(r){var u=this._tiles[r];u&&(kt(u.el),delete this._tiles[r],this.fire("tileunload",{tile:u.el,coords:this._keyToTileCoords(r)}))},_initTile:function(r){rt(r,"leaflet-tile");var u=this.getTileSize();r.style.width=u.x+"px",r.style.height=u.y+"px",r.onselectstart=_,r.onmousemove=_,W.ielt9&&this.options.opacity<1&&We(r,this.options.opacity)},_addTile:function(r,u){var l=this._getTilePos(r),f=this._tileCoordsToKey(r),p=this.createTile(this._wrapCoords(r),a(this._tileReady,this,r));this._initTile(p),this.createTile.length<2&&Et(a(this._tileReady,this,r,null,p)),Bt(p,l),this._tiles[f]={el:p,coords:r,current:!0},u.appendChild(p),this.fire("tileloadstart",{tile:p,coords:r})},_tileReady:function(r,u,l){u&&this.fire("tileerror",{error:u,tile:l,coords:r});var f=this._tileCoordsToKey(r);l=this._tiles[f],l&&(l.loaded=+new Date,this._map._fadeAnimated?(We(l.el,0),Kt(this._fadeFrame),this._fadeFrame=Et(this._updateOpacity,this)):(l.active=!0,this._pruneTiles()),u||(rt(l.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:l.el,coords:r})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),W.ielt9||!this._map._fadeAnimated?Et(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(r){return r.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(r){var u=new k(this._wrapX?m(r.x,this._wrapX):r.x,this._wrapY?m(r.y,this._wrapY):r.y);return u.z=r.z,u},_pxBoundsToTileRange:function(r){var u=this.getTileSize();return new Q(r.min.unscaleBy(u).floor(),r.max.unscaleBy(u).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var r in this._tiles)if(!this._tiles[r].loaded)return!1;return!0}});function YT(r){return new zo(r)}var Er=zo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(r,u){this._url=r,u=S(this,u),u.detectRetina&&W.retina&&u.maxZoom>0?(u.tileSize=Math.floor(u.tileSize/2),u.zoomReverse?(u.zoomOffset--,u.minZoom=Math.min(u.maxZoom,u.minZoom+1)):(u.zoomOffset++,u.maxZoom=Math.max(u.minZoom,u.maxZoom-1)),u.minZoom=Math.max(0,u.minZoom)):u.zoomReverse?u.minZoom=Math.min(u.maxZoom,u.minZoom):u.maxZoom=Math.max(u.minZoom,u.maxZoom),typeof u.subdomains=="string"&&(u.subdomains=u.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(r,u){return this._url===r&&u===void 0&&(u=!0),this._url=r,u||this.redraw(),this},createTile:function(r,u){var l=document.createElement("img");return et(l,"load",a(this._tileOnLoad,this,u,l)),et(l,"error",a(this._tileOnError,this,u,l)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(l.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(l.referrerPolicy=this.options.referrerPolicy),l.alt="",l.src=this.getTileUrl(r),l},getTileUrl:function(r){var u={r:W.retina?"@2x":"",s:this._getSubdomain(r),x:r.x,y:r.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var l=this._globalTileRange.max.y-r.y;this.options.tms&&(u.y=l),u["-y"]=l}return w(this._url,o(u,this.options))},_tileOnLoad:function(r,u){W.ielt9?setTimeout(a(r,this,null,u),0):r(null,u)},_tileOnError:function(r,u,l){var f=this.options.errorTileUrl;f&&u.getAttribute("src")!==f&&(u.src=f),r(l,u)},_onTileRemove:function(r){r.tile.onload=null},_getZoomForUrl:function(){var r=this._tileZoom,u=this.options.maxZoom,l=this.options.zoomReverse,f=this.options.zoomOffset;return l&&(r=u-r),r+f},_getSubdomain:function(r){var u=Math.abs(r.x+r.y)%this.options.subdomains.length;return this.options.subdomains[u]},_abortLoading:function(){var r,u;for(r in this._tiles)if(this._tiles[r].coords.z!==this._tileZoom&&(u=this._tiles[r].el,u.onload=_,u.onerror=_,!u.complete)){u.src=V;var l=this._tiles[r].coords;kt(u),delete this._tiles[r],this.fire("tileabort",{tile:u,coords:l})}},_removeTile:function(r){var u=this._tiles[r];if(u)return u.el.setAttribute("src",V),zo.prototype._removeTile.call(this,r)},_tileReady:function(r,u,l){if(!(!this._map||l&&l.getAttribute("src")===V))return zo.prototype._tileReady.call(this,r,u,l)}});function s_(r,u){return new Er(r,u)}var a_=Er.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(r,u){this._url=r;var l=o({},this.defaultWmsParams);for(var f in u)f in this.options||(l[f]=u[f]);u=S(this,u);var p=u.detectRetina&&W.retina?2:1,g=this.getTileSize();l.width=g.x*p,l.height=g.y*p,this.wmsParams=l},onAdd:function(r){this._crs=this.options.crs||r.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var u=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[u]=this._crs.code,Er.prototype.onAdd.call(this,r)},getTileUrl:function(r){var u=this._tileCoordsToNwSe(r),l=this._crs,f=ht(l.project(u[0]),l.project(u[1])),p=f.min,g=f.max,T=(this._wmsVersion>=1.3&&this._crs===Jm?[p.y,p.x,g.y,g.x]:[p.x,p.y,g.x,g.y]).join(","),I=Er.prototype.getTileUrl.call(this,r);return I+R(this.wmsParams,I,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+T},setParams:function(r,u){return o(this.wmsParams,r),u||this.redraw(),this}});function JT(r,u){return new a_(r,u)}Er.WMS=a_,s_.wms=JT;var zn=rn.extend({options:{padding:.1},initialize:function(r){S(this,r),h(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),rt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var r={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(r.zoomanim=this._onAnimZoom),r},_onAnimZoom:function(r){this._updateTransform(r.center,r.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(r,u){var l=this._map.getZoomScale(u,this._zoom),f=this._map.getSize().multiplyBy(.5+this.options.padding),p=this._map.project(this._center,u),g=f.multiplyBy(-l).add(p).subtract(this._map._getNewPixelOrigin(r,u));W.any3d?Ni(this._container,g,l):Bt(this._container,g)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var r in this._layers)this._layers[r]._reset()},_onZoomEnd:function(){for(var r in this._layers)this._layers[r]._project()},_updatePaths:function(){for(var r in this._layers)this._layers[r]._update()},_update:function(){var r=this.options.padding,u=this._map.getSize(),l=this._map.containerPointToLayerPoint(u.multiplyBy(-r)).round();this._bounds=new Q(l,l.add(u.multiplyBy(1+r*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),u_=zn.extend({options:{tolerance:0},getEvents:function(){var r=zn.prototype.getEvents.call(this);return r.viewprereset=this._onViewPreReset,r},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){zn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var r=this._container=document.createElement("canvas");et(r,"mousemove",this._onMouseMove,this),et(r,"click dblclick mousedown mouseup contextmenu",this._onClick,this),et(r,"mouseout",this._handleMouseOut,this),r._leaflet_disable_events=!0,this._ctx=r.getContext("2d")},_destroyContainer:function(){Kt(this._redrawRequest),delete this._ctx,kt(this._container),Tt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var r;this._redrawBounds=null;for(var u in this._layers)r=this._layers[u],r._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){zn.prototype._update.call(this);var r=this._bounds,u=this._container,l=r.getSize(),f=W.retina?2:1;Bt(u,r.min),u.width=f*l.x,u.height=f*l.y,u.style.width=l.x+"px",u.style.height=l.y+"px",W.retina&&this._ctx.scale(2,2),this._ctx.translate(-r.min.x,-r.min.y),this.fire("update")}},_reset:function(){zn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(r){this._updateDashArray(r),this._layers[h(r)]=r;var u=r._order={layer:r,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=u),this._drawLast=u,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(r){this._requestRedraw(r)},_removePath:function(r){var u=r._order,l=u.next,f=u.prev;l?l.prev=f:this._drawLast=f,f?f.next=l:this._drawFirst=l,delete r._order,delete this._layers[h(r)],this._requestRedraw(r)},_updatePath:function(r){this._extendRedrawBounds(r),r._project(),r._update(),this._requestRedraw(r)},_updateStyle:function(r){this._updateDashArray(r),this._requestRedraw(r)},_updateDashArray:function(r){if(typeof r.options.dashArray=="string"){var u=r.options.dashArray.split(/[, ]+/),l=[],f,p;for(p=0;p')}}catch{}return function(r){return document.createElement("<"+r+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),tP={_initContainer:function(){this._container=mt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(zn.prototype._update.call(this),this.fire("update"))},_initPath:function(r){var u=r._container=bo("shape");rt(u,"leaflet-vml-shape "+(this.options.className||"")),u.coordsize="1 1",r._path=bo("path"),u.appendChild(r._path),this._updateStyle(r),this._layers[h(r)]=r},_addPath:function(r){var u=r._container;this._container.appendChild(u),r.options.interactive&&r.addInteractiveTarget(u)},_removePath:function(r){var u=r._container;kt(u),r.removeInteractiveTarget(u),delete this._layers[h(r)]},_updateStyle:function(r){var u=r._stroke,l=r._fill,f=r.options,p=r._container;p.stroked=!!f.stroke,p.filled=!!f.fill,f.stroke?(u||(u=r._stroke=bo("stroke")),p.appendChild(u),u.weight=f.weight+"px",u.color=f.color,u.opacity=f.opacity,f.dashArray?u.dashStyle=P(f.dashArray)?f.dashArray.join(" "):f.dashArray.replace(/( *, *)/g," "):u.dashStyle="",u.endcap=f.lineCap.replace("butt","flat"),u.joinstyle=f.lineJoin):u&&(p.removeChild(u),r._stroke=null),f.fill?(l||(l=r._fill=bo("fill")),p.appendChild(l),l.color=f.fillColor||f.color,l.opacity=f.fillOpacity):l&&(p.removeChild(l),r._fill=null)},_updateCircle:function(r){var u=r._point.round(),l=Math.round(r._radius),f=Math.round(r._radiusY||l);this._setPath(r,r._empty()?"M0 0":"AL "+u.x+","+u.y+" "+l+","+f+" 0,"+65535*360)},_setPath:function(r,u){r._path.v=u},_bringToFront:function(r){mr(r._container)},_bringToBack:function(r){_r(r._container)}},za=W.vml?bo:dm,Bo=zn.extend({_initContainer:function(){this._container=za("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=za("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){kt(this._container),Tt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){zn.prototype._update.call(this);var r=this._bounds,u=r.getSize(),l=this._container;(!this._svgSize||!this._svgSize.equals(u))&&(this._svgSize=u,l.setAttribute("width",u.x),l.setAttribute("height",u.y)),Bt(l,r.min),l.setAttribute("viewBox",[r.min.x,r.min.y,u.x,u.y].join(" ")),this.fire("update")}},_initPath:function(r){var u=r._path=za("path");r.options.className&&rt(u,r.options.className),r.options.interactive&&rt(u,"leaflet-interactive"),this._updateStyle(r),this._layers[h(r)]=r},_addPath:function(r){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(r._path),r.addInteractiveTarget(r._path)},_removePath:function(r){kt(r._path),r.removeInteractiveTarget(r._path),delete this._layers[h(r)]},_updatePath:function(r){r._project(),r._update()},_updateStyle:function(r){var u=r._path,l=r.options;u&&(l.stroke?(u.setAttribute("stroke",l.color),u.setAttribute("stroke-opacity",l.opacity),u.setAttribute("stroke-width",l.weight),u.setAttribute("stroke-linecap",l.lineCap),u.setAttribute("stroke-linejoin",l.lineJoin),l.dashArray?u.setAttribute("stroke-dasharray",l.dashArray):u.removeAttribute("stroke-dasharray"),l.dashOffset?u.setAttribute("stroke-dashoffset",l.dashOffset):u.removeAttribute("stroke-dashoffset")):u.setAttribute("stroke","none"),l.fill?(u.setAttribute("fill",l.fillColor||l.color),u.setAttribute("fill-opacity",l.fillOpacity),u.setAttribute("fill-rule",l.fillRule||"evenodd")):u.setAttribute("fill","none"))},_updatePoly:function(r,u){this._setPath(r,pm(r._parts,u))},_updateCircle:function(r){var u=r._point,l=Math.max(Math.round(r._radius),1),f=Math.max(Math.round(r._radiusY),1)||l,p="a"+l+","+f+" 0 1,0 ",g=r._empty()?"M0 0":"M"+(u.x-l)+","+u.y+p+l*2+",0 "+p+-l*2+",0 ";this._setPath(r,g)},_setPath:function(r,u){r._path.setAttribute("d",u)},_bringToFront:function(r){mr(r._path)},_bringToBack:function(r){_r(r._path)}});W.vml&&Bo.include(tP);function c_(r){return W.svg||W.vml?new Bo(r):null}lt.include({getRenderer:function(r){var u=r.options.renderer||this._getPaneRenderer(r.options.pane)||this.options.renderer||this._renderer;return u||(u=this._renderer=this._createRenderer()),this.hasLayer(u)||this.addLayer(u),u},_getPaneRenderer:function(r){if(r==="overlayPane"||r===void 0)return!1;var u=this._paneRenderers[r];return u===void 0&&(u=this._createRenderer({pane:r}),this._paneRenderers[r]=u),u},_createRenderer:function(r){return this.options.preferCanvas&&l_(r)||c_(r)}});var h_=yr.extend({initialize:function(r,u){yr.prototype.initialize.call(this,this._boundsToLatLngs(r),u)},setBounds:function(r){return this.setLatLngs(this._boundsToLatLngs(r))},_boundsToLatLngs:function(r){return r=yt(r),[r.getSouthWest(),r.getNorthWest(),r.getNorthEast(),r.getSouthEast()]}});function eP(r,u){return new h_(r,u)}Bo.create=za,Bo.pointsToPath=pm,Vn.geometryToLayer=ka,Vn.coordsToLatLng=jc,Vn.coordsToLatLngs=Ra,Vn.latLngToCoords=Hc,Vn.latLngsToCoords=Ma,Vn.getFeature=wr,Vn.asFeature=Oa,lt.mergeOptions({boxZoom:!0});var f_=_n.extend({initialize:function(r){this._map=r,this._container=r._container,this._pane=r._panes.overlayPane,this._resetStateTimeout=0,r.on("unload",this._destroy,this)},addHooks:function(){et(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Tt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){kt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(r){if(!r.shiftKey||r.which!==1&&r.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ko(),Ic(),this._startPoint=this._map.mouseEventToContainerPoint(r),et(document,{contextmenu:bi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(r){this._moved||(this._moved=!0,this._box=mt("div","leaflet-zoom-box",this._container),rt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(r);var u=new Q(this._point,this._startPoint),l=u.getSize();Bt(this._box,u.min),this._box.style.width=l.x+"px",this._box.style.height=l.y+"px"},_finish:function(){this._moved&&(kt(this._box),zt(this._container,"leaflet-crosshair")),Ro(),Lc(),Tt(document,{contextmenu:bi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(r){if(!(r.which!==1&&r.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var u=new Ht(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(u).fire("boxzoomend",{boxZoomBounds:u})}},_onKeyDown:function(r){r.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});lt.addInitHook("addHandler","boxZoom",f_),lt.mergeOptions({doubleClickZoom:!0});var d_=_n.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(r){var u=this._map,l=u.getZoom(),f=u.options.zoomDelta,p=r.originalEvent.shiftKey?l-f:l+f;u.options.doubleClickZoom==="center"?u.setZoom(p):u.setZoomAround(r.containerPoint,p)}});lt.addInitHook("addHandler","doubleClickZoom",d_),lt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var p_=_n.extend({addHooks:function(){if(!this._draggable){var r=this._map;this._draggable=new Jn(r._mapPane,r._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),r.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),r.on("zoomend",this._onZoomEnd,this),r.whenReady(this._onZoomEnd,this))}rt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){zt(this._map._container,"leaflet-grab"),zt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var r=this._map;if(r._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var u=yt(this._map.options.maxBounds);this._offsetLimit=ht(this._map.latLngToContainerPoint(u.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(u.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;r.fire("movestart").fire("dragstart"),r.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(r){if(this._map.options.inertia){var u=this._lastTime=+new Date,l=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(l),this._times.push(u),this._prunePositions(u)}this._map.fire("move",r).fire("drag",r)},_prunePositions:function(r){for(;this._positions.length>1&&r-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var r=this._map.getSize().divideBy(2),u=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=u.subtract(r).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(r,u){return r-(r-u)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var r=this._draggable._newPos.subtract(this._draggable._startPos),u=this._offsetLimit;r.xu.max.x&&(r.x=this._viscousLimit(r.x,u.max.x)),r.y>u.max.y&&(r.y=this._viscousLimit(r.y,u.max.y)),this._draggable._newPos=this._draggable._startPos.add(r)}},_onPreDragWrap:function(){var r=this._worldWidth,u=Math.round(r/2),l=this._initialWorldOffset,f=this._draggable._newPos.x,p=(f-u+l)%r+u-l,g=(f+u+l)%r-u-l,T=Math.abs(p+l)0?g:-g))-u;this._delta=0,this._startTime=null,T&&(r.options.scrollWheelZoom==="center"?r.setZoom(u+T):r.setZoomAround(this._lastMousePos,u+T))}});lt.addInitHook("addHandler","scrollWheelZoom",__);var nP=600;lt.mergeOptions({tapHold:W.touchNative&&W.safari&&W.mobile,tapTolerance:15});var g_=_n.extend({addHooks:function(){et(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Tt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(r){if(clearTimeout(this._holdTimeout),r.touches.length===1){var u=r.touches[0];this._startPos=this._newPos=new k(u.clientX,u.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(et(document,"touchend",ie),et(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",u))},this),nP),et(document,"touchend touchcancel contextmenu",this._cancel,this),et(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function r(){Tt(document,"touchend",ie),Tt(document,"touchend touchcancel",r)},_cancel:function(){clearTimeout(this._holdTimeout),Tt(document,"touchend touchcancel contextmenu",this._cancel,this),Tt(document,"touchmove",this._onMove,this)},_onMove:function(r){var u=r.touches[0];this._newPos=new k(u.clientX,u.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(r,u){var l=new MouseEvent(r,{bubbles:!0,cancelable:!0,view:window,screenX:u.screenX,screenY:u.screenY,clientX:u.clientX,clientY:u.clientY});l._simulated=!0,u.target.dispatchEvent(l)}});lt.addInitHook("addHandler","tapHold",g_),lt.mergeOptions({touchZoom:W.touch,bounceAtZoomLimits:!0});var v_=_n.extend({addHooks:function(){rt(this._map._container,"leaflet-touch-zoom"),et(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){zt(this._map._container,"leaflet-touch-zoom"),Tt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(r){var u=this._map;if(!(!r.touches||r.touches.length!==2||u._animatingZoom||this._zooming)){var l=u.mouseEventToContainerPoint(r.touches[0]),f=u.mouseEventToContainerPoint(r.touches[1]);this._centerPoint=u.getSize()._divideBy(2),this._startLatLng=u.containerPointToLatLng(this._centerPoint),u.options.touchZoom!=="center"&&(this._pinchStartLatLng=u.containerPointToLatLng(l.add(f)._divideBy(2))),this._startDist=l.distanceTo(f),this._startZoom=u.getZoom(),this._moved=!1,this._zooming=!0,u._stop(),et(document,"touchmove",this._onTouchMove,this),et(document,"touchend touchcancel",this._onTouchEnd,this),ie(r)}},_onTouchMove:function(r){if(!(!r.touches||r.touches.length!==2||!this._zooming)){var u=this._map,l=u.mouseEventToContainerPoint(r.touches[0]),f=u.mouseEventToContainerPoint(r.touches[1]),p=l.distanceTo(f)/this._startDist;if(this._zoom=u.getScaleZoom(p,this._startZoom),!u.options.bounceAtZoomLimits&&(this._zoomu.getMaxZoom()&&p>1)&&(this._zoom=u._limitZoom(this._zoom)),u.options.touchZoom==="center"){if(this._center=this._startLatLng,p===1)return}else{var g=l._add(f)._divideBy(2)._subtract(this._centerPoint);if(p===1&&g.x===0&&g.y===0)return;this._center=u.unproject(u.project(this._pinchStartLatLng,this._zoom).subtract(g),this._zoom)}this._moved||(u._moveStart(!0,!1),this._moved=!0),Kt(this._animRequest);var T=a(u._move,u,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Et(T,this,!0),ie(r)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Kt(this._animRequest),Tt(document,"touchmove",this._onTouchMove,this),Tt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});lt.addInitHook("addHandler","touchZoom",v_),lt.BoxZoom=f_,lt.DoubleClickZoom=d_,lt.Drag=p_,lt.Keyboard=m_,lt.ScrollWheelZoom=__,lt.TapHold=g_,lt.TouchZoom=v_,n.Bounds=Q,n.Browser=W,n.CRS=Ae,n.Canvas=u_,n.Circle=$c,n.CircleMarker=xa,n.Class=Ze,n.Control=nn,n.DivIcon=o_,n.DivOverlay=gn,n.DomEvent=wT,n.DomUtil=vT,n.Draggable=Jn,n.Evented=On,n.FeatureGroup=Dn,n.GeoJSON=Vn,n.GridLayer=zo,n.Handler=_n,n.Icon=vr,n.ImageOverlay=Da,n.LatLng=pt,n.LatLngBounds=Ht,n.Layer=rn,n.LayerGroup=gr,n.LineUtil=OT,n.Map=lt,n.Marker=Aa,n.Mixin=LT,n.Path=ti,n.Point=k,n.PolyUtil=AT,n.Polygon=yr,n.Polyline=Nn,n.Popup=Na,n.PosAnimation=Um,n.Projection=DT,n.Rectangle=h_,n.Renderer=zn,n.SVG=Bo,n.SVGOverlay=r_,n.TileLayer=Er,n.Tooltip=Va,n.Transformation=pc,n.Util=Di,n.VideoOverlay=i_,n.bind=a,n.bounds=ht,n.canvas=l_,n.circle=$T,n.circleMarker=UT,n.control=Do,n.divIcon=XT,n.extend=o,n.featureGroup=bT,n.geoJSON=n_,n.geoJson=ZT,n.gridLayer=YT,n.icon=BT,n.imageOverlay=WT,n.latLng=tt,n.latLngBounds=yt,n.layerGroup=zT,n.map=ET,n.marker=FT,n.point=z,n.polygon=HT,n.polyline=jT,n.popup=KT,n.rectangle=eP,n.setOptions=S,n.stamp=h,n.svg=c_,n.svgOverlay=qT,n.tileLayer=s_,n.tooltip=QT,n.transformation=Io,n.version=i,n.videoOverlay=GT;var iP=window.L;n.noConflict=function(){return window.L=iP,this},window.L=n})})(xf,xf.exports);var ki=xf.exports;function iw(e){return e.split(" ").filter(Boolean)}function rw(e,t){iw(t).forEach(n=>{ki.DomUtil.addClass(e,n)})}function ow(e,t){iw(t).forEach(n=>{ki.DomUtil.removeClass(e,n)})}function bC(e,t,n){e!=null&&n!==t&&(t!=null&&t.length>0&&ow(e,t),n!=null&&n.length>0&&rw(e,n))}function Dl(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function vo(e,t){return t==null?function(i,o){const s=at.useRef();return s.current||(s.current=e(i,o)),s}:function(i,o){const s=at.useRef();s.current||(s.current=e(i,o));const a=at.useRef(i),{instance:c}=s.current;return at.useEffect(function(){a.current!==i&&(t(c,i,a.current),a.current=i)},[c,i,o]),s}}function ap(e,t){at.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var s;(s=t.layerContainer)==null||s.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function up(e){return function(n){const i=go(),o=e(oa(n,i),i);return np(i.map,n.attribution),Ol(o.current,n.eventHandlers),ap(o.current,i),o}}function sw(e,t){const n=at.useRef();at.useEffect(function(){if(t.pathOptions!==n.current){const o=t.pathOptions??{};e.instance.setStyle(o),n.current=o}},[e,t])}function aw(e){return function(n){const i=go(),o=e(oa(n,i),i);return Ol(o.current,n.eventHandlers),ap(o.current,i),sw(o.current,n),o}}function BC(e){function t(o,s){return Dl(e(o),s)}const n=vo(t),i=ew(n);return sp(i)}function uw(e,t){const n=vo(e,t),i=up(n);return op(i)}function FC(e,t){const n=vo(e),i=nw(n,t);return tw(i)}function UC(e,t){const n=vo(e,t),i=aw(n);return op(i)}function lw(e,t){const n=vo(e,t),i=up(n);return sp(i)}function cw(e,t,n){const{opacity:i,zIndex:o}=t;i!=null&&i!==n.opacity&&e.setOpacity(i),o!=null&&o!==n.zIndex&&e.setZIndex(o)}function $C(e,t,n){t.bounds instanceof ki.LatLngBounds&&t.bounds!==n.bounds&&e.setBounds(t.bounds),t.opacity!=null&&t.opacity!==n.opacity&&e.setOpacity(t.opacity),t.zIndex!=null&&t.zIndex!==n.zIndex&&e.setZIndex(t.zIndex)}const jC=Object.freeze(Object.defineProperty({__proto__:null,CONTEXT_VERSION:X0,LeafletContext:ip,LeafletProvider:rp,addClassName:rw,createContainerComponent:op,createControlComponent:BC,createControlHook:ew,createDivOverlayComponent:tw,createDivOverlayHook:nw,createElementHook:vo,createElementObject:Dl,createLayerComponent:uw,createLayerHook:up,createLeafComponent:sp,createLeafletContext:Y0,createOverlayComponent:FC,createPathComponent:UC,createPathHook:aw,createTileLayerComponent:lw,extendContext:J0,removeClassName:ow,updateCircle:zC,updateClassName:bC,updateGridLayer:cw,updateMediaOverlay:$C,useAttribution:np,useEventHandlers:Ol,useLayerLifecycle:ap,useLeafletContext:go,usePathOptions:sw,withPane:oa},Symbol.toStringTag,{value:"Module"}));function HC(){return go().map}function ZC(e,t){const n=HC();return at.useEffect(function(){return n.on(e,t),function(){n.off(e,t)}},[n,e,t]),n}function kf(){return kf=Object.assign||function(e){for(var t=1;t(y==null?void 0:y.map)??null,[y]);const S=at.useCallback(E=>{if(E!==null&&y===null){const w=new ki.Map(E,m);n!=null&&d!=null?w.setView(n,d):e!=null&&w.fitBounds(e,t),h!=null&&w.whenReady(h),C(Y0(w))}},[]);at.useEffect(()=>()=>{y==null||y.map.remove()},[y]);const R=y?Lu.createElement(rp,{value:y},i):a??null;return Lu.createElement("div",kf({},v,{ref:S}),R)}const GC=at.forwardRef(WC),qC=uw(function({position:t,...n},i){const o=new ki.Marker(t,n);return Dl(o,J0(i,{overlayContainer:o}))},function(t,n,i){n.position!==i.position&&t.setLatLng(n.position),n.icon!=null&&n.icon!==i.icon&&t.setIcon(n.icon),n.zIndexOffset!=null&&n.zIndexOffset!==i.zIndexOffset&&t.setZIndexOffset(n.zIndexOffset),n.opacity!=null&&n.opacity!==i.opacity&&t.setOpacity(n.opacity),t.dragging!=null&&n.draggable!==i.draggable&&(n.draggable===!0?t.dragging.enable():t.dragging.disable())}),KC=lw(function({url:t,...n},i){const o=new ki.TileLayer(t,oa(n,i));return Dl(o,i)},function(t,n,i){cw(t,n,i);const{url:o}=n;o!=null&&o!==i.url&&t.setUrl(o)});var hw={};const QC=_l(jC);var Rg={exports:{}};(function(e,t){(function(n,i){i(t)})(wi,function(n){var i=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(s){L.Util.setOptions(this,s),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var a=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,a?this._withAnimation:this._noAnimation),this._markerCluster=a?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(s){if(s instanceof L.LayerGroup)return this.addLayers([s]);if(!s.getLatLng)return this._nonPointGroup.addLayer(s),this.fire("layeradd",{layer:s}),this;if(!this._map)return this._needsClustering.push(s),this.fire("layeradd",{layer:s}),this;if(this.hasLayer(s))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(s,this._maxZoom),this.fire("layeradd",{layer:s}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var a=s,c=this._zoom;if(s.__parent)for(;a.__parent._zoom>=c;)a=a.__parent;return this._currentShownBounds.contains(a.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(s,a):this._animationAddLayerNonAnimated(s,a)),this},removeLayer:function(s){return s instanceof L.LayerGroup?this.removeLayers([s]):s.getLatLng?this._map?s.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(s)),this._removeLayer(s,!0),this.fire("layerremove",{layer:s}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),s.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(s)&&(this._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,s)&&this.hasLayer(s)&&this._needsRemoving.push({layer:s,latlng:s._latlng}),this.fire("layerremove",{layer:s}),this):(this._nonPointGroup.removeLayer(s),this.fire("layerremove",{layer:s}),this)},addLayers:function(s,a){if(!L.Util.isArray(s))return this.addLayer(s);var c=this._featureGroup,h=this._nonPointGroup,d=this.options.chunkedLoading,m=this.options.chunkInterval,_=this.options.chunkProgress,v=s.length,y=0,C=!0,S;if(this._map){var R=new Date().getTime(),E=L.bind(function(){var P=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();ym)break}if(S=s[y],S instanceof L.LayerGroup){C&&(s=s.slice(),C=!1),this._extractNonGroupLayers(S,s),v=s.length;continue}if(!S.getLatLng){h.addLayer(S),a||this.fire("layeradd",{layer:S});continue}if(!this.hasLayer(S)&&(this._addLayer(S,this._maxZoom),a||this.fire("layeradd",{layer:S}),S.__parent&&S.__parent.getChildCount()===2)){var V=S.__parent.getAllChildMarkers(),F=V[0]===S?V[1]:V[0];c.removeLayer(F)}}_&&_(y,v,new Date().getTime()-R),y===v?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(E,this.options.chunkDelay)},this);E()}else for(var w=this._needsClustering;y=0;a--)s.extend(this._needsClustering[a].getLatLng());return s.extend(this._nonPointGroup.getBounds()),s},eachLayer:function(s,a){var c=this._needsClustering.slice(),h=this._needsRemoving,d,m,_;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(c),m=c.length-1;m>=0;m--){for(d=!0,_=h.length-1;_>=0;_--)if(h[_].layer===c[m]){d=!1;break}d&&s.call(a,c[m])}this._nonPointGroup.eachLayer(s,a)},getLayers:function(){var s=[];return this.eachLayer(function(a){s.push(a)}),s},getLayer:function(s){var a=null;return s=parseInt(s,10),this.eachLayer(function(c){L.stamp(c)===s&&(a=c)}),a},hasLayer:function(s){if(!s)return!1;var a,c=this._needsClustering;for(a=c.length-1;a>=0;a--)if(c[a]===s)return!0;for(c=this._needsRemoving,a=c.length-1;a>=0;a--)if(c[a].layer===s)return!1;return!!(s.__parent&&s.__parent._group===this)||this._nonPointGroup.hasLayer(s)},zoomToShowLayer:function(s,a){var c=this._map;typeof a!="function"&&(a=function(){});var h=function(){(c.hasLayer(s)||c.hasLayer(s.__parent))&&!this._inZoomAnimation&&(this._map.off("moveend",h,this),this.off("animationend",h,this),c.hasLayer(s)?a():s.__parent._icon&&(this.once("spiderfied",a,this),s.__parent.spiderfy()))};s._icon&&this._map.getBounds().contains(s.getLatLng())?a():s.__parent._zoom=0;c--)if(s[c]===a)return s.splice(c,1),!0},_removeFromGridUnclustered:function(s,a){for(var c=this._map,h=this._gridUnclustered,d=Math.floor(this._map.getMinZoom());a>=d&&h[a].removeObject(s,c.project(s.getLatLng(),a));a--);},_childMarkerDragStart:function(s){s.target.__dragStart=s.target._latlng},_childMarkerMoved:function(s){if(!this._ignoreMove&&!s.target.__dragStart){var a=s.target._popup&&s.target._popup.isOpen();this._moveChild(s.target,s.oldLatLng,s.latlng),a&&s.target.openPopup()}},_moveChild:function(s,a,c){s._latlng=a,this.removeLayer(s),s._latlng=c,this.addLayer(s)},_childMarkerDragEnd:function(s){var a=s.target.__dragStart;delete s.target.__dragStart,a&&this._moveChild(s.target,a,s.target._latlng)},_removeLayer:function(s,a,c){var h=this._gridClusters,d=this._gridUnclustered,m=this._featureGroup,_=this._map,v=Math.floor(this._map.getMinZoom());a&&this._removeFromGridUnclustered(s,this._maxZoom);var y=s.__parent,C=y._markers,S;for(this._arraySplice(C,s);y&&(y._childCount--,y._boundsNeedUpdate=!0,!(y._zoom"+a+"",className:"marker-cluster"+c,iconSize:new L.Point(40,40)})},_bindEvents:function(){var s=this._map,a=this.options.spiderfyOnMaxZoom,c=this.options.showCoverageOnHover,h=this.options.zoomToBoundsOnClick,d=this.options.spiderfyOnEveryZoom;(a||h||d)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),c&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),s.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(s){var a=s.layer,c=a;if(!(s.type==="clusterkeypress"&&s.originalEvent&&s.originalEvent.keyCode!==13)){for(;c._childClusters.length===1;)c=c._childClusters[0];c._zoom===this._maxZoom&&c._childCount===a._childCount&&this.options.spiderfyOnMaxZoom?a.spiderfy():this.options.zoomToBoundsOnClick&&a.zoomToBounds(),this.options.spiderfyOnEveryZoom&&a.spiderfy(),s.originalEvent&&s.originalEvent.keyCode===13&&this._map._container.focus()}},_showCoverage:function(s){var a=this._map;this._inZoomAnimation||(this._shownPolygon&&a.removeLayer(this._shownPolygon),s.layer.getChildCount()>2&&s.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(s.layer.getConvexHull(),this.options.polygonOptions),a.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var s=this.options.spiderfyOnMaxZoom,a=this.options.showCoverageOnHover,c=this.options.zoomToBoundsOnClick,h=this.options.spiderfyOnEveryZoom,d=this._map;(s||c||h)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),a&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),d.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var s=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,s),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),s),this._currentShownBounds=s}},_generateInitialClusters:function(){var s=Math.ceil(this._map.getMaxZoom()),a=Math.floor(this._map.getMinZoom()),c=this.options.maxClusterRadius,h=c;typeof c!="function"&&(h=function(){return c}),this.options.disableClusteringAtZoom!==null&&(s=this.options.disableClusteringAtZoom-1),this._maxZoom=s,this._gridClusters={},this._gridUnclustered={};for(var d=s;d>=a;d--)this._gridClusters[d]=new L.DistanceGrid(h(d)),this._gridUnclustered[d]=new L.DistanceGrid(h(d));this._topClusterLevel=new this._markerCluster(this,a-1)},_addLayer:function(s,a){var c=this._gridClusters,h=this._gridUnclustered,d=Math.floor(this._map.getMinZoom()),m,_;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(s),s.on(this._childMarkerEventHandlers,this);a>=d;a--){m=this._map.project(s.getLatLng(),a);var v=c[a].getNearObject(m);if(v){v._addChild(s),s.__parent=v;return}if(v=h[a].getNearObject(m),v){var y=v.__parent;y&&this._removeLayer(v,!1);var C=new this._markerCluster(this,a,v,s);c[a].addObject(C,this._map.project(C._cLatLng,a)),v.__parent=C,s.__parent=C;var S=C;for(_=a-1;_>y._zoom;_--)S=new this._markerCluster(this,_,S),c[_].addObject(S,this._map.project(v.getLatLng(),_));y._addChild(S),this._removeFromGridUnclustered(v,a);return}h[a].addObject(s,m)}this._topClusterLevel._addChild(s),s.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(s){s instanceof L.MarkerCluster&&s._iconNeedsUpdate&&s._updateIcon()})},_enqueue:function(s){this._queue.push(s),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var s=0;ss?(this._animationStart(),this._animationZoomOut(this._zoom,s)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(L.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(s){var a=this._maxLat;return a!==void 0&&(s.getNorth()>=a&&(s._northEast.lat=1/0),s.getSouth()<=-a&&(s._southWest.lat=-1/0)),s},_animationAddLayerNonAnimated:function(s,a){if(a===s)this._featureGroup.addLayer(s);else if(a._childCount===2){a._addToMap();var c=a.getAllChildMarkers();this._featureGroup.removeLayer(c[0]),this._featureGroup.removeLayer(c[1])}else a._updateIcon()},_extractNonGroupLayers:function(s,a){var c=s.getLayers(),h=0,d;for(a=a||[];h=0;m--)C=y[m],c.contains(C._latlng)||h.removeLayer(C)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(c,a),h.eachLayer(function(_){!(_ instanceof L.MarkerCluster)&&_._icon&&_.clusterShow()}),this._topClusterLevel._recursively(c,s,a,function(_){_._recursivelyRestoreChildPositions(a)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(c,s,d,function(_){h.removeLayer(_),_.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(s,a){this._animationZoomOutSingle(this._topClusterLevel,s-1,a),this._topClusterLevel._recursivelyAddChildrenToMap(null,a,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),s,this._getExpandedVisibleBounds())},_animationAddLayer:function(s,a){var c=this,h=this._featureGroup;h.addLayer(s),a!==s&&(a._childCount>2?(a._updateIcon(),this._forceLayout(),this._animationStart(),s._setPos(this._map.latLngToLayerPoint(a.getLatLng())),s.clusterHide(),this._enqueue(function(){h.removeLayer(s),s.clusterShow(),c._animationEnd()})):(this._forceLayout(),c._animationStart(),c._animationZoomOutSingle(a,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(s,a,c){var h=this._getExpandedVisibleBounds(),d=Math.floor(this._map.getMinZoom());s._recursivelyAnimateChildrenInAndAddSelfToMap(h,d,a+1,c);var m=this;this._forceLayout(),s._recursivelyBecomeVisible(h,c),this._enqueue(function(){if(s._childCount===1){var _=s._markers[0];this._ignoreMove=!0,_.setLatLng(_.getLatLng()),this._ignoreMove=!1,_.clusterShow&&_.clusterShow()}else s._recursively(h,c,d,function(v){v._recursivelyRemoveChildrenFromMap(h,d,a+1)});m._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(s){return new L.MarkerClusterGroup(s)};var o=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(s,a,c,h){L.Marker.prototype.initialize.call(this,c?c._cLatLng||c.getLatLng():new L.LatLng(0,0),{icon:this,pane:s.options.clusterPane}),this._group=s,this._zoom=a,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,c&&this._addChild(c),h&&this._addChild(h)},getAllChildMarkers:function(s,a){s=s||[];for(var c=this._childClusters.length-1;c>=0;c--)this._childClusters[c].getAllChildMarkers(s,a);for(var h=this._markers.length-1;h>=0;h--)a&&this._markers[h].__dragStart||s.push(this._markers[h]);return s},getChildCount:function(){return this._childCount},zoomToBounds:function(s){for(var a=this._childClusters.slice(),c=this._group._map,h=c.getBoundsZoom(this._bounds),d=this._zoom+1,m=c.getZoom(),_;a.length>0&&h>d;){d++;var v=[];for(_=0;_d?this._group._map.setView(this._latlng,d):h<=m?this._group._map.setView(this._latlng,m+1):this._group._map.fitBounds(this._bounds,s)},getBounds:function(){var s=new L.LatLngBounds;return s.extend(this._bounds),s},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(s,a){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(s),s instanceof L.MarkerCluster?(a||(this._childClusters.push(s),s.__parent=this),this._childCount+=s._childCount):(a||this._markers.push(s),this._childCount++),this.__parent&&this.__parent._addChild(s,!0)},_setClusterCenter:function(s){this._cLatLng||(this._cLatLng=s._cLatLng||s._latlng)},_resetBounds:function(){var s=this._bounds;s._southWest&&(s._southWest.lat=1/0,s._southWest.lng=1/0),s._northEast&&(s._northEast.lat=-1/0,s._northEast.lng=-1/0)},_recalculateBounds:function(){var s=this._markers,a=this._childClusters,c=0,h=0,d=this._childCount,m,_,v,y;if(d!==0){for(this._resetBounds(),m=0;m=0;m--)_=d[m],_._icon&&(_._setPos(a),_.clusterHide())},function(h){var d=h._childClusters,m,_;for(m=d.length-1;m>=0;m--)_=d[m],_._icon&&(_._setPos(a),_.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(s,a,c,h){this._recursively(s,h,a,function(d){d._recursivelyAnimateChildrenIn(s,d._group._map.latLngToLayerPoint(d.getLatLng()).round(),c),d._isSingleParent()&&c-1===h?(d.clusterShow(),d._recursivelyRemoveChildrenFromMap(s,a,c)):d.clusterHide(),d._addToMap()})},_recursivelyBecomeVisible:function(s,a){this._recursively(s,this._group._map.getMinZoom(),a,null,function(c){c.clusterShow()})},_recursivelyAddChildrenToMap:function(s,a,c){this._recursively(c,this._group._map.getMinZoom()-1,a,function(h){if(a!==h._zoom)for(var d=h._markers.length-1;d>=0;d--){var m=h._markers[d];c.contains(m._latlng)&&(s&&(m._backupLatlng=m.getLatLng(),m.setLatLng(s),m.clusterHide&&m.clusterHide()),h._group._featureGroup.addLayer(m))}},function(h){h._addToMap(s)})},_recursivelyRestoreChildPositions:function(s){for(var a=this._markers.length-1;a>=0;a--){var c=this._markers[a];c._backupLatlng&&(c.setLatLng(c._backupLatlng),delete c._backupLatlng)}if(s-1===this._zoom)for(var h=this._childClusters.length-1;h>=0;h--)this._childClusters[h]._restorePosition();else for(var d=this._childClusters.length-1;d>=0;d--)this._childClusters[d]._recursivelyRestoreChildPositions(s)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(s,a,c,h){var d,m;this._recursively(s,a-1,c-1,function(_){for(m=_._markers.length-1;m>=0;m--)d=_._markers[m],(!h||!h.contains(d._latlng))&&(_._group._featureGroup.removeLayer(d),d.clusterShow&&d.clusterShow())},function(_){for(m=_._childClusters.length-1;m>=0;m--)d=_._childClusters[m],(!h||!h.contains(d._latlng))&&(_._group._featureGroup.removeLayer(d),d.clusterShow&&d.clusterShow())})},_recursively:function(s,a,c,h,d){var m=this._childClusters,_=this._zoom,v,y;if(a<=_&&(h&&h(this),d&&_===c&&d(this)),_=0;v--)y=m[v],y._boundsNeedUpdate&&y._recalculateBounds(),s.intersects(y._bounds)&&y._recursively(s,a,c,h,d)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var s=this.options.opacity;return this.setOpacity(0),this.options.opacity=s,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(s){this._cellSize=s,this._sqCellSize=s*s,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(s,a){var c=this._getCoord(a.x),h=this._getCoord(a.y),d=this._grid,m=d[h]=d[h]||{},_=m[c]=m[c]||[],v=L.Util.stamp(s);this._objectPoint[v]=a,_.push(s)},updateObject:function(s,a){this.removeObject(s),this.addObject(s,a)},removeObject:function(s,a){var c=this._getCoord(a.x),h=this._getCoord(a.y),d=this._grid,m=d[h]=d[h]||{},_=m[c]=m[c]||[],v,y;for(delete this._objectPoint[L.Util.stamp(s)],v=0,y=_.length;v=0;m--){if(_=a[m],v=this.getDistant(_,s),v>0)d.push(_);else continue;v>c&&(c=v,h=_)}return{maxPoint:h,newPoints:d}},buildConvexHull:function(s,a){var c=[],h=this.findMostDistantPointFromBaseLine(s,a);return h.maxPoint?(c=c.concat(this.buildConvexHull([s[0],h.maxPoint],h.newPoints)),c=c.concat(this.buildConvexHull([h.maxPoint,s[1]],h.newPoints)),c):[s[0]]},getConvexHull:function(s){var a=!1,c=!1,h=!1,d=!1,m=null,_=null,v=null,y=null,C=null,S=null,R;for(R=s.length-1;R>=0;R--){var E=s[R];(a===!1||E.lat>a)&&(m=E,a=E.lat),(c===!1||E.lath)&&(v=E,h=E.lng),(d===!1||E.lng=0;h--)c=s[h].getLatLng(),a.push(c);return L.QuickHull.getConvexHull(a)}}),L.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var s=this.getAllChildMarkers(null,!0),a=this._group,c=a._map,h=c.latLngToLayerPoint(this._latlng),d;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?d=this._group.options.spiderfyShapePositions(s.length,h):s.length>=this._circleSpiralSwitchover?d=this._generatePointsSpiral(s.length,h):(h.y+=10,d=this._generatePointsCircle(s.length,h)),this._animationSpiderfy(s,d)}},unspiderfy:function(s){this._group._inZoomAnimation||(this._animationUnspiderfy(s),this._group._spiderfied=null)},_generatePointsCircle:function(s,a){var c=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+s),h=c/this._2PI,d=this._2PI/s,m=[],_,v;for(h=Math.max(h,35),m.length=s,_=0;_=0;y--)y=0;m--)d=h[m],c.removeLayer(d),d._preSpiderfyLatlng&&(d.setLatLng(d._preSpiderfyLatlng),delete d._preSpiderfyLatlng),d.setZIndexOffset&&d.setZIndexOffset(0),d._spiderLeg&&(a.removeLayer(d._spiderLeg),delete d._spiderLeg);s.fire("unspiderfied",{cluster:this,markers:h}),s._ignoreMove=!1,s._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(s,a){var c=this._group,h=c._map,d=c._featureGroup,m=this._group.options.spiderLegPolylineOptions,_,v,y,C;for(c._ignoreMove=!0,_=0;_=0;R--)V=d.layerPointToLatLng(a[R]),E=s[R],E._preSpiderfyLatlng=E._latlng,E.setLatLng(V),E.clusterShow&&E.clusterShow(),y&&(w=E._spiderLeg,P=w._path,P.style.strokeDashoffset=0,w.setStyle({opacity:S}));this.setOpacity(.3),h._ignoreMove=!1,setTimeout(function(){h._animationEnd(),h.fire("spiderfied",{cluster:c,markers:s})},200)},_animationUnspiderfy:function(s){var a=this,c=this._group,h=c._map,d=c._featureGroup,m=s?h._latLngToNewLayerPoint(this._latlng,s.zoom,s.center):h.latLngToLayerPoint(this._latlng),_=this.getAllChildMarkers(null,!0),v=L.Path.SVG,y,C,S,R,E,w;for(c._ignoreMove=!0,c._animationStart(),this.setOpacity(1),C=_.length-1;C>=0;C--)y=_[C],y._preSpiderfyLatlng&&(y.closePopup(),y.setLatLng(y._preSpiderfyLatlng),delete y._preSpiderfyLatlng,w=!0,y._setPos&&(y._setPos(m),w=!1),y.clusterHide&&(y.clusterHide(),w=!1),w&&d.removeLayer(y),v&&(S=y._spiderLeg,R=S._path,E=R.getTotalLength()+.1,R.style.strokeDashoffset=E,S.setStyle({opacity:0})));c._ignoreMove=!1,setTimeout(function(){var P=0;for(C=_.length-1;C>=0;C--)y=_[C],y._spiderLeg&&P++;for(C=_.length-1;C>=0;C--)y=_[C],y._spiderLeg&&(y.clusterShow&&y.clusterShow(),y.setZIndexOffset&&y.setZIndexOffset(0),P>1&&d.removeLayer(y),h.removeLayer(y._spiderLeg),delete y._spiderLeg);c._animationEnd(),c.fire("unspiderfied",{cluster:a,markers:_})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(s){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(s))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(s){this._spiderfied&&this._spiderfied.unspiderfy(s)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(s){s._spiderLeg&&(this._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow(),s.setZIndexOffset&&s.setZIndexOffset(0),this._map.removeLayer(s._spiderLeg),delete s._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(s){return s?s instanceof L.MarkerClusterGroup?s=s._topClusterLevel.getAllChildMarkers():s instanceof L.LayerGroup?s=s._layers:s instanceof L.MarkerCluster?s=s.getAllChildMarkers():s instanceof L.Marker&&(s=[s]):s=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(s),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(s),this},_flagParentsIconsNeedUpdate:function(s){var a,c;for(a in s)for(c=s[a].__parent;c;)c._iconNeedsUpdate=!0,c=c.__parent},_refreshSingleMarkerModeMarkers:function(s){var a,c;for(a in s)c=s[a],this.hasLayer(c)&&c.setIcon(this._overrideMarkerIcon(c))}}),L.Marker.include({refreshIconOptions:function(s,a){var c=this.options.icon;return L.setOptions(c,s),this.setIcon(c),a&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),n.MarkerClusterGroup=i,n.MarkerCluster=o,Object.defineProperty(n,"__esModule",{value:!0})})})(Rg,Rg.exports);const XC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",YC=Object.freeze(Object.defineProperty({__proto__:null,default:XC},Symbol.toStringTag,{value:"Module"})),JC=_l(YC),tI="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",eI=Object.freeze(Object.defineProperty({__proto__:null,default:tI},Symbol.toStringTag,{value:"Module"})),nI=_l(eI),iI="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",rI=Object.freeze(Object.defineProperty({__proto__:null,default:iI},Symbol.toStringTag,{value:"Module"})),oI=_l(rI);var Fr=wi&&wi.__assign||function(){return Fr=Object.assign||function(e){for(var t,n=1,i=arguments.length;n>6|192,t[n++]=o&63|128):(o&64512)===55296&&i+1>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=o&63|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=o&63|128)}return t},dI=function(e){const t=[];let n=0,i=0;for(;n191&&o<224){const s=e[n++];t[i++]=String.fromCharCode((o&31)<<6|s&63)}else if(o>239&&o<365){const s=e[n++],a=e[n++],c=e[n++],h=((o&7)<<18|(s&63)<<12|(a&63)<<6|c&63)-65536;t[i++]=String.fromCharCode(55296+(h>>10)),t[i++]=String.fromCharCode(56320+(h&1023))}else{const s=e[n++],a=e[n++];t[i++]=String.fromCharCode((o&15)<<12|(s&63)<<6|a&63)}}return t.join("")},dw={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let o=0;o>2,_=(s&3)<<4|c>>4;let v=(c&15)<<2|d>>6,y=d&63;h||(y=64,a||(v=64)),i.push(n[m],n[_],n[v],n[y])}return i.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(fw(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):dI(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let o=0;o>4;if(i.push(v),d!==64){const y=c<<4&240|d>>2;if(i.push(y),_!==64){const C=d<<6&192|_;i.push(C)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class pI extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const mI=function(e){const t=fw(e);return dw.encodeByteArray(t,!0)},Yu=function(e){return mI(e).replace(/\./g,"")},_I=function(e){try{return dw.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function gI(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const vI=()=>gI().__FIREBASE_DEFAULTS__,yI=()=>{if(typeof process>"u"||typeof Mg>"u")return;const e=Mg.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},wI=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&_I(e[1]);return t&&JSON.parse(t)},cp=()=>{try{return vI()||yI()||wI()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},EI=e=>{var t,n;return(n=(t=cp())===null||t===void 0?void 0:t.emulatorHosts)===null||n===void 0?void 0:n[e]},TI=e=>{const t=EI(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const i=parseInt(t.substring(n+1),10);return t[0]==="["?[t.substring(1,n-1),i]:[t.substring(0,n),i]},pw=()=>{var e;return(e=cp())===null||e===void 0?void 0:e.config};/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class PI{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,i)=>{n?this.reject(n):this.resolve(i),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,i))}}}/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function SI(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},i=t||"demo-project",o=e.iat||0,s=e.sub||e.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const a=Object.assign({iss:`https://securetoken.google.com/${i}`,aud:i,iat:o,exp:o+3600,auth_time:o,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},e);return[Yu(JSON.stringify(n)),Yu(JSON.stringify(a)),""].join(".")}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Ju(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function CI(){var e;const t=(e=cp())===null||e===void 0?void 0:e.forceEnvironment;if(t==="node")return!0;if(t==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function II(){return!CI()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function mw(){try{return typeof indexedDB=="object"}catch{return!1}}function LI(){return new Promise((e,t)=>{try{let n=!0;const i="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(i);o.onsuccess=()=>{o.result.close(),n||self.indexedDB.deleteDatabase(i),e(!0)},o.onupgradeneeded=()=>{n=!1},o.onerror=()=>{var s;t(((s=o.error)===null||s===void 0?void 0:s.message)||"")}}catch(n){t(n)}})}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const AI="FirebaseError";class yo extends Error{constructor(t,n,i){super(n),this.code=t,this.customData=i,this.name=AI,Object.setPrototypeOf(this,yo.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,_w.prototype.create)}}class _w{constructor(t,n,i){this.service=t,this.serviceName=n,this.errors=i}create(t,...n){const i=n[0]||{},o=`${this.service}/${t}`,s=this.errors[t],a=s?xI(s,i):"Error",c=`${this.serviceName}: ${a} (${o}).`;return new yo(o,c,i)}}function xI(e,t){return e.replace(kI,(n,i)=>{const o=t[i];return o!=null?String(o):`<${i}?>`})}const kI=/\{\$([^}]+)}/g;function Mf(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);for(const o of n){if(!i.includes(o))return!1;const s=e[o],a=t[o];if(Og(s)&&Og(a)){if(!Mf(s,a))return!1}else if(s!==a)return!1}for(const o of i)if(!n.includes(o))return!1;return!0}function Og(e){return e!==null&&typeof e=="object"}/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Pi(e){return e&&e._delegate?e._delegate:e}class bs{constructor(t,n,i){this.name=t,this.instanceFactory=n,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const $i="[DEFAULT]";/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class RI{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const i=new PI;if(this.instancesDeferred.set(n,i),this.isInitialized(n)||this.shouldAutoInitialize())try{const o=this.getOrInitializeService({instanceIdentifier:n});o&&i.resolve(o)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(t){var n;const i=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),o=(n=t==null?void 0:t.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(s){if(o)return null;throw s}else{if(o)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(OI(t))try{this.getOrInitializeService({instanceIdentifier:$i})}catch{}for(const[n,i]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(n);try{const s=this.getOrInitializeService({instanceIdentifier:o});i.resolve(s)}catch{}}}}clearInstance(t=$i){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=$i){return this.instances.has(t)}getOptions(t=$i){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,i=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const o=this.getOrInitializeService({instanceIdentifier:i,options:n});for(const[s,a]of this.instancesDeferred.entries()){const c=this.normalizeInstanceIdentifier(s);i===c&&a.resolve(o)}return o}onInit(t,n){var i;const o=this.normalizeInstanceIdentifier(n),s=(i=this.onInitCallbacks.get(o))!==null&&i!==void 0?i:new Set;s.add(t),this.onInitCallbacks.set(o,s);const a=this.instances.get(o);return a&&t(a,o),()=>{s.delete(t)}}invokeOnInitCallbacks(t,n){const i=this.onInitCallbacks.get(n);if(i)for(const o of i)try{o(t,n)}catch{}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let i=this.instances.get(t);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:MI(t),options:n}),this.instances.set(t,i),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(i,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,i)}catch{}return i||null}normalizeInstanceIdentifier(t=$i){return this.component?this.component.multipleInstances?t:$i:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function MI(e){return e===$i?void 0:e}function OI(e){return e.instantiationMode==="EAGER"}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class DI{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new RI(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var ft;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(ft||(ft={}));const NI={debug:ft.DEBUG,verbose:ft.VERBOSE,info:ft.INFO,warn:ft.WARN,error:ft.ERROR,silent:ft.SILENT},VI=ft.INFO,zI={[ft.DEBUG]:"log",[ft.VERBOSE]:"log",[ft.INFO]:"info",[ft.WARN]:"warn",[ft.ERROR]:"error"},bI=(e,t,...n)=>{if(tt.some(n=>e instanceof n);let Dg,Ng;function FI(){return Dg||(Dg=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function UI(){return Ng||(Ng=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const vw=new WeakMap,Of=new WeakMap,yw=new WeakMap,yh=new WeakMap,hp=new WeakMap;function $I(e){const t=new Promise((n,i)=>{const o=()=>{e.removeEventListener("success",s),e.removeEventListener("error",a)},s=()=>{n(gi(e.result)),o()},a=()=>{i(e.error),o()};e.addEventListener("success",s),e.addEventListener("error",a)});return t.then(n=>{n instanceof IDBCursor&&vw.set(n,e)}).catch(()=>{}),hp.set(t,e),t}function jI(e){if(Of.has(e))return;const t=new Promise((n,i)=>{const o=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",a),e.removeEventListener("abort",a)},s=()=>{n(),o()},a=()=>{i(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",s),e.addEventListener("error",a),e.addEventListener("abort",a)});Of.set(e,t)}let Df={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Of.get(e);if(t==="objectStoreNames")return e.objectStoreNames||yw.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return gi(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function HI(e){Df=e(Df)}function ZI(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const i=e.call(wh(this),t,...n);return yw.set(i,t.sort?t.sort():[t]),gi(i)}:UI().includes(e)?function(...t){return e.apply(wh(this),t),gi(vw.get(this))}:function(...t){return gi(e.apply(wh(this),t))}}function WI(e){return typeof e=="function"?ZI(e):(e instanceof IDBTransaction&&jI(e),BI(e,FI())?new Proxy(e,Df):e)}function gi(e){if(e instanceof IDBRequest)return $I(e);if(yh.has(e))return yh.get(e);const t=WI(e);return t!==e&&(yh.set(e,t),hp.set(t,e)),t}const wh=e=>hp.get(e);function GI(e,t,{blocked:n,upgrade:i,blocking:o,terminated:s}={}){const a=indexedDB.open(e,t),c=gi(a);return i&&a.addEventListener("upgradeneeded",h=>{i(gi(a.result),h.oldVersion,h.newVersion,gi(a.transaction),h)}),n&&a.addEventListener("blocked",h=>n(h.oldVersion,h.newVersion,h)),c.then(h=>{s&&h.addEventListener("close",()=>s()),o&&h.addEventListener("versionchange",d=>o(d.oldVersion,d.newVersion,d))}).catch(()=>{}),c}const qI=["get","getKey","getAll","getAllKeys","count"],KI=["put","add","delete","clear"],Eh=new Map;function Vg(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Eh.get(t))return Eh.get(t);const n=t.replace(/FromIndex$/,""),i=t!==n,o=KI.includes(n);if(!(n in(i?IDBIndex:IDBObjectStore).prototype)||!(o||qI.includes(n)))return;const s=async function(a,...c){const h=this.transaction(a,o?"readwrite":"readonly");let d=h.store;return i&&(d=d.index(c.shift())),(await Promise.all([d[n](...c),o&&h.done]))[0]};return Eh.set(t,s),s}HI(e=>({...e,get:(t,n,i)=>Vg(t,n)||e.get(t,n,i),has:(t,n)=>!!Vg(t,n)||e.has(t,n)}));/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class QI{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(XI(n)){const i=n.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(n=>n).join(" ")}}function XI(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const Nf="@firebase/app",zg="0.9.28";/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const or=new gw("@firebase/app"),YI="@firebase/app-compat",JI="@firebase/analytics-compat",tL="@firebase/analytics",eL="@firebase/app-check-compat",nL="@firebase/app-check",iL="@firebase/auth",rL="@firebase/auth-compat",oL="@firebase/database",sL="@firebase/database-compat",aL="@firebase/functions",uL="@firebase/functions-compat",lL="@firebase/installations",cL="@firebase/installations-compat",hL="@firebase/messaging",fL="@firebase/messaging-compat",dL="@firebase/performance",pL="@firebase/performance-compat",mL="@firebase/remote-config",_L="@firebase/remote-config-compat",gL="@firebase/storage",vL="@firebase/storage-compat",yL="@firebase/firestore",wL="@firebase/firestore-compat",EL="firebase",TL="10.8.1";/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Vf="[DEFAULT]",PL={[Nf]:"fire-core",[YI]:"fire-core-compat",[tL]:"fire-analytics",[JI]:"fire-analytics-compat",[nL]:"fire-app-check",[eL]:"fire-app-check-compat",[iL]:"fire-auth",[rL]:"fire-auth-compat",[oL]:"fire-rtdb",[sL]:"fire-rtdb-compat",[aL]:"fire-fn",[uL]:"fire-fn-compat",[lL]:"fire-iid",[cL]:"fire-iid-compat",[hL]:"fire-fcm",[fL]:"fire-fcm-compat",[dL]:"fire-perf",[pL]:"fire-perf-compat",[mL]:"fire-rc",[_L]:"fire-rc-compat",[gL]:"fire-gcs",[vL]:"fire-gcs-compat",[yL]:"fire-fst",[wL]:"fire-fst-compat","fire-js":"fire-js",[EL]:"fire-js-all"};/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const tl=new Map,zf=new Map;function SL(e,t){try{e.container.addComponent(t)}catch(n){or.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function el(e){const t=e.name;if(zf.has(t))return or.debug(`There were multiple attempts to register component ${t}.`),!1;zf.set(t,e);for(const n of tl.values())SL(n,e);return!0}function CL(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const IL={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},vi=new _w("app","Firebase",IL);/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class LL{constructor(t,n,i){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new bs("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw vi.create("app-deleted",{appName:this._name})}}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const AL=TL;function ww(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const i=Object.assign({name:Vf,automaticDataCollectionEnabled:!1},t),o=i.name;if(typeof o!="string"||!o)throw vi.create("bad-app-name",{appName:String(o)});if(n||(n=pw()),!n)throw vi.create("no-options");const s=tl.get(o);if(s){if(Mf(n,s.options)&&Mf(i,s.config))return s;throw vi.create("duplicate-app",{appName:o})}const a=new DI(o);for(const h of zf.values())a.addComponent(h);const c=new LL(n,i,a);return tl.set(o,c),c}function xL(e=Vf){const t=tl.get(e);if(!t&&e===Vf&&pw())return ww();if(!t)throw vi.create("no-app",{appName:e});return t}function qr(e,t,n){var i;let o=(i=PL[e])!==null&&i!==void 0?i:e;n&&(o+=`-${n}`);const s=o.match(/\s|\//),a=t.match(/\s|\//);if(s||a){const c=[`Unable to register library "${o}" with version "${t}":`];s&&c.push(`library name "${o}" contains illegal characters (whitespace or "/")`),s&&a&&c.push("and"),a&&c.push(`version name "${t}" contains illegal characters (whitespace or "/")`),or.warn(c.join(" "));return}el(new bs(`${o}-version`,()=>({library:o,version:t}),"VERSION"))}/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const kL="firebase-heartbeat-database",RL=1,Bs="firebase-heartbeat-store";let Th=null;function Ew(){return Th||(Th=GI(kL,RL,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Bs)}catch(n){console.warn(n)}}}}).catch(e=>{throw vi.create("idb-open",{originalErrorMessage:e.message})})),Th}async function ML(e){try{const n=(await Ew()).transaction(Bs),i=await n.objectStore(Bs).get(Tw(e));return await n.done,i}catch(t){if(t instanceof yo)or.warn(t.message);else{const n=vi.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});or.warn(n.message)}}}async function bg(e,t){try{const i=(await Ew()).transaction(Bs,"readwrite");await i.objectStore(Bs).put(t,Tw(e)),await i.done}catch(n){if(n instanceof yo)or.warn(n.message);else{const i=vi.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});or.warn(i.message)}}}function Tw(e){return`${e.name}!${e.options.appId}`}/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const OL=1024,DL=30*24*60*60*1e3;class NL{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new zL(n),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}async triggerHeartbeat(){var t,n;const o=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=Bg();if(!(((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(a=>a.date===s)))return this._heartbeatsCache.heartbeats.push({date:s,agent:o}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(a=>{const c=new Date(a.date).valueOf();return Date.now()-c<=DL}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var t;if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Bg(),{heartbeatsToSend:i,unsentEntries:o}=VL(this._heartbeatsCache.heartbeats),s=Yu(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=n,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}}function Bg(){return new Date().toISOString().substring(0,10)}function VL(e,t=OL){const n=[];let i=e.slice();for(const o of e){const s=n.find(a=>a.agent===o.agent);if(s){if(s.dates.push(o.date),Fg(n)>t){s.dates.pop();break}}else if(n.push({agent:o.agent,dates:[o.date]}),Fg(n)>t){n.pop();break}i=i.slice(1)}return{heartbeatsToSend:n,unsentEntries:i}}class zL{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return mw()?LI().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await ML(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){var n;if(await this._canUseIndexedDBPromise){const o=await this.read();return bg(this.app,{lastSentHeartbeatDate:(n=t.lastSentHeartbeatDate)!==null&&n!==void 0?n:o.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){var n;if(await this._canUseIndexedDBPromise){const o=await this.read();return bg(this.app,{lastSentHeartbeatDate:(n=t.lastSentHeartbeatDate)!==null&&n!==void 0?n:o.lastSentHeartbeatDate,heartbeats:[...o.heartbeats,...t.heartbeats]})}else return}}function Fg(e){return Yu(JSON.stringify({version:2,heartbeats:e})).length}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function bL(e){el(new bs("platform-logger",t=>new QI(t),"PRIVATE")),el(new bs("heartbeat",t=>new NL(t),"PRIVATE")),qr(Nf,zg,e),qr(Nf,zg,"esm2017"),qr("fire-js","")}bL("");var BL=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},B,fp=fp||{},X=BL||self;function Nl(e){var t=typeof e;return t=t!="object"?t:e?Array.isArray(e)?"array":t:"null",t=="array"||t=="object"&&typeof e.length=="number"}function sa(e){var t=typeof e;return t=="object"&&e!=null||t=="function"}function FL(e){return Object.prototype.hasOwnProperty.call(e,Ph)&&e[Ph]||(e[Ph]=++UL)}var Ph="closure_uid_"+(1e9*Math.random()>>>0),UL=0;function $L(e,t,n){return e.call.apply(e.bind,arguments)}function jL(e,t,n){if(!e)throw Error();if(2{};X.addEventListener("test",n,t),X.removeEventListener("test",n,t)}catch{}return e}();function Fs(e){return/^[\s\xa0]*$/.test(e)}function Vl(){var e=X.navigator;return e&&(e=e.userAgent)?e:""}function Tn(e){return Vl().indexOf(e)!=-1}function pp(e){return pp[" "](e),e}pp[" "]=function(){};function WL(e,t){var n=bA;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}var GL=Tn("Opera"),oo=Tn("Trident")||Tn("MSIE"),Sw=Tn("Edge"),bf=Sw||oo,Cw=Tn("Gecko")&&!(Vl().toLowerCase().indexOf("webkit")!=-1&&!Tn("Edge"))&&!(Tn("Trident")||Tn("MSIE"))&&!Tn("Edge"),qL=Vl().toLowerCase().indexOf("webkit")!=-1&&!Tn("Edge");function Iw(){var e=X.document;return e?e.documentMode:void 0}var Bf;t:{var Sh="",Ch=function(){var e=Vl();if(Cw)return/rv:([^\);]+)(\)|;)/.exec(e);if(Sw)return/Edge\/([\d\.]+)/.exec(e);if(oo)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e);if(qL)return/WebKit\/(\S+)/.exec(e);if(GL)return/(?:Version)[ \/]?(\S+)/.exec(e)}();if(Ch&&(Sh=Ch?Ch[1]:""),oo){var Ih=Iw();if(Ih!=null&&Ih>parseFloat(Sh)){Bf=String(Ih);break t}}Bf=Sh}var Ff;if(X.document&&oo){var $g=Iw();Ff=$g||parseInt(Bf,10)||void 0}else Ff=void 0;var KL=Ff;function Us(e,t){if(ye.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,i=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(Cw){t:{try{pp(t.nodeName);var o=!0;break t}catch{}o=!1}o||(t=null)}}else n=="mouseover"?t=e.fromElement:n=="mouseout"&&(t=e.toElement);this.relatedTarget=t,i?(this.clientX=i.clientX!==void 0?i.clientX:i.pageX,this.clientY=i.clientY!==void 0?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.screenY||0):(this.clientX=e.clientX!==void 0?e.clientX:e.pageX,this.clientY=e.clientY!==void 0?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=typeof e.pointerType=="string"?e.pointerType:QL[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&Us.$.h.call(this)}}ee(Us,ye);var QL={2:"touch",3:"pen",4:"mouse"};Us.prototype.h=function(){Us.$.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var aa="closure_listenable_"+(1e6*Math.random()|0),XL=0;function YL(e,t,n,i,o){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!i,this.la=o,this.key=++XL,this.fa=this.ia=!1}function zl(e){e.fa=!0,e.listener=null,e.proxy=null,e.src=null,e.la=null}function mp(e,t,n){for(const i in e)t.call(n,e[i],i,e)}function JL(e,t){for(const n in e)t.call(void 0,e[n],n,e)}function Lw(e){const t={};for(const n in e)t[n]=e[n];return t}const jg="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Aw(e,t){let n,i;for(let o=1;o>>0);function yp(e){return typeof e=="function"?e:(e[Ah]||(e[Ah]=function(t){return e.handleEvent(t)}),e[Ah])}function te(){Ri.call(this),this.i=new bl(this),this.S=this,this.J=null}ee(te,Ri);te.prototype[aa]=!0;te.prototype.removeEventListener=function(e,t,n,i){Mw(this,e,t,n,i)};function le(e,t){var n,i=e.J;if(i)for(n=[];i;i=i.J)n.push(i);if(e=e.S,i=t.type||t,typeof t=="string")t=new ye(t,e);else if(t instanceof ye)t.target=t.target||e;else{var o=t;t=new ye(i,e),Aw(t,o)}if(o=!0,n)for(var s=n.length-1;0<=s;s--){var a=t.g=n[s];o=iu(a,i,!0,t)&&o}if(a=t.g=e,o=iu(a,i,!0,t)&&o,o=iu(a,i,!1,t)&&o,n)for(s=0;snew oA,e=>e.reset());class oA{constructor(){this.next=this.g=this.h=null}set(t,n){this.h=t,this.g=n,this.next=null}reset(){this.next=this.g=this.h=null}}function sA(e){var t=1;e=e.split(":");const n=[];for(;0{throw e},0)}let $s,js=!1,Ep=new rA,Nw=()=>{const e=X.Promise.resolve(void 0);$s=()=>{e.then(uA)}};var uA=()=>{for(var e;e=iA();){try{e.h.call(e.g)}catch(n){aA(n)}var t=Dw;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}js=!1};function Bl(e,t){te.call(this),this.h=e||1,this.g=t||X,this.j=ve(this.qb,this),this.l=Date.now()}ee(Bl,te);B=Bl.prototype;B.ga=!1;B.T=null;B.qb=function(){if(this.ga){var e=Date.now()-this.l;0{e.g=null,e.i&&(e.i=!1,Vw(e))},e.j);const t=e.h;e.h=null,e.m.apply(null,t)}class lA extends Ri{constructor(t,n){super(),this.m=t,this.j=n,this.h=null,this.i=!1,this.g=null}l(t){this.h=arguments,this.g?this.i=!0:Vw(this)}N(){super.N(),this.g&&(X.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Hs(e){Ri.call(this),this.h=e,this.g={}}ee(Hs,Ri);var Hg=[];function zw(e,t,n,i){Array.isArray(n)||(n&&(Hg[0]=n.toString()),n=Hg);for(var o=0;oi.length)){var o=i[1];if(Array.isArray(o)&&!(1>o.length)){var s=o[0];if(s!="noop"&&s!="stop"&&s!="close")for(var a=1;am)&&(m!=3||bf||this.g&&(this.h.h||this.g.ja()||Qg(this.g)))){this.J||m!=4||t==7||(t==8||0>=_?Zs(3):Zs(2)),Hl(this);var n=this.g.da();this.ca=n;e:if(Gw(this)){var i=Qg(this.g);e="";var o=i.length,s=Pn(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Gi(this),ms(this);var a="";break e}this.h.i=new X.TextDecoder}for(t=0;tt.length?Hf:(t=t.slice(i,i+n),e.o=i+n,t)))}B.cancel=function(){this.J=!0,Gi(this)};function ha(e){e.Y=Date.now()+e.P,Kw(e,e.P)}function Kw(e,t){if(e.C!=null)throw Error("WatchDog timer not null");e.C=ua(ve(e.lb,e),t)}function Hl(e){e.C&&(X.clearTimeout(e.C),e.C=null)}B.lb=function(){this.C=null;const e=Date.now();0<=e-this.Y?(fA(this.j,this.B),this.L!=2&&(Zs(),Se(17)),Gi(this),this.s=2,ms(this)):Kw(this,this.Y-e)};function ms(e){e.l.H==0||e.J||g1(e.l,e)}function Gi(e){Hl(e);var t=e.M;t&&typeof t.sa=="function"&&t.sa(),e.M=null,Tp(e.V),bw(e.U),e.g&&(t=e.g,e.g=null,t.abort(),t.sa())}function Wf(e,t){try{var n=e.l;if(n.H!=0&&(n.g==e||Gf(n.i,e))){if(!e.K&&Gf(n.i,e)&&n.H==3){try{var i=n.Ja.g.parse(t)}catch{i=null}if(Array.isArray(i)&&i.length==3){var o=i;if(o[0]==0){t:if(!n.u){if(n.g)if(n.g.G+3e3o[2]&&n.G&&n.A==0&&!n.v&&(n.v=ua(ve(n.ib,n),6e3));if(1>=i1(n.i)&&n.oa){try{n.oa()}catch{}n.oa=void 0}}else qi(n,11)}else if((e.K||n.g==e)&&rl(n),!Fs(t))for(o=n.Ja.g.parse(t),t=0;tt)throw Error("Bad port number "+t);e.m=t}else e.m=null}function Gg(e,t,n){t instanceof Ws?(e.i=t,SA(e.i,e.h)):(n||(t=ns(t,TA)),e.i=new Ws(t,e.h))}function It(e,t,n){e.i.set(t,n)}function Zl(e){return It(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function es(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function ns(e,t,n){return typeof e=="string"?(e=encodeURI(e).replace(t,yA),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function yA(e){return e=e.charCodeAt(0),"%"+(e>>4&15).toString(16)+(e&15).toString(16)}var qg=/[#\/\?@]/g,wA=/[#\?:]/g,EA=/[#\?]/g,TA=/[#\?@]/g,PA=/#/g;function Ws(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function Mi(e){e.g||(e.g=new Map,e.h=0,e.i&&vA(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}B=Ws.prototype;B.add=function(e,t){Mi(this),this.i=null,e=wo(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this};function Yw(e,t){Mi(e),t=wo(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function Jw(e,t){return Mi(e),t=wo(e,t),e.g.has(t)}B.forEach=function(e,t){Mi(this),this.g.forEach(function(n,i){n.forEach(function(o){e.call(t,o,i,this)},this)},this)};B.ta=function(){Mi(this);const e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[];for(let i=0;i=e.j:!1}function i1(e){return e.h?1:e.g?e.g.size:0}function Gf(e,t){return e.h?e.h==t:e.g?e.g.has(t):!1}function Lp(e,t){e.g?e.g.add(t):e.h=t}function r1(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}e1.prototype.cancel=function(){if(this.i=o1(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const e of this.g.values())e.cancel();this.g.clear()}};function o1(e){if(e.h!=null)return e.i.concat(e.h.F);if(e.g!=null&&e.g.size!==0){let t=e.i;for(const n of e.g.values())t=t.concat(n.F);return t}return dp(e.i)}var LA=class{stringify(e){return X.JSON.stringify(e,void 0)}parse(e){return X.JSON.parse(e,void 0)}};function AA(){this.g=new LA}function xA(e,t,n){const i=n||"";try{Qw(e,function(o,s){let a=o;sa(o)&&(a=wp(o)),t.push(i+s+"="+encodeURIComponent(a))})}catch(o){throw t.push(i+"type="+encodeURIComponent("_badmap")),o}}function kA(e,t){const n=new Fl;if(X.Image){const i=new Image;i.onload=nu(ru,n,i,"TestLoadImage: loaded",!0,t),i.onerror=nu(ru,n,i,"TestLoadImage: error",!1,t),i.onabort=nu(ru,n,i,"TestLoadImage: abort",!1,t),i.ontimeout=nu(ru,n,i,"TestLoadImage: timeout",!1,t),X.setTimeout(function(){i.ontimeout&&i.ontimeout()},1e4),i.src=e}else t(!1)}function ru(e,t,n,i,o){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,o(i)}catch{}}function Wl(e){this.l=e.ec||null,this.j=e.ob||!1}ee(Wl,Sp);Wl.prototype.g=function(){return new Gl(this.l,this.j)};Wl.prototype.i=function(e){return function(){return e}}({});function Gl(e,t){te.call(this),this.F=e,this.u=t,this.m=void 0,this.readyState=Ap,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}ee(Gl,te);var Ap=0;B=Gl.prototype;B.open=function(e,t){if(this.readyState!=Ap)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,Gs(this)};B.send=function(e){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.F||X).fetch(new Request(this.B,t)).then(this.$a.bind(this),this.ka.bind(this))};B.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,fa(this)),this.readyState=Ap};B.$a=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,Gs(this)),this.g&&(this.readyState=3,Gs(this),this.g)))if(this.responseType==="arraybuffer")e.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if(typeof X.ReadableStream<"u"&&"body"in e){if(this.j=e.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;s1(this)}else e.text().then(this.Za.bind(this),this.ka.bind(this))};function s1(e){e.j.read().then(e.Xa.bind(e)).catch(e.ka.bind(e))}B.Xa=function(e){if(this.g){if(this.u&&e.value)this.response.push(e.value);else if(!this.u){var t=e.value?e.value:new Uint8Array(0);(t=this.A.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?fa(this):Gs(this),this.readyState==3&&s1(this)}};B.Za=function(e){this.g&&(this.response=this.responseText=e,fa(this))};B.Ya=function(e){this.g&&(this.response=e,fa(this))};B.ka=function(){this.g&&fa(this)};function fa(e){e.readyState=4,e.l=null,e.j=null,e.A=null,Gs(e)}B.setRequestHeader=function(e,t){this.v.append(e,t)};B.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""};B.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join(`\r +`)};function Gs(e){e.onreadystatechange&&e.onreadystatechange.call(e)}Object.defineProperty(Gl.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(e){this.m=e?"include":"same-origin"}});var RA=X.JSON.parse;function Vt(e){te.call(this),this.headers=new Map,this.u=e||null,this.h=!1,this.C=this.g=null,this.I="",this.m=0,this.j="",this.l=this.G=this.v=this.F=!1,this.B=0,this.A=null,this.K=a1,this.L=this.M=!1}ee(Vt,te);var a1="",MA=/^https?$/i,OA=["POST","PUT"];B=Vt.prototype;B.Oa=function(e){this.M=e};B.ha=function(e,t,n,i){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+e);t=t?t.toUpperCase():"GET",this.I=e,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():jf.g(),this.C=this.u?Wg(this.u):Wg(jf),this.g.onreadystatechange=ve(this.La,this);try{this.G=!0,this.g.open(t,String(e),!0),this.G=!1}catch(s){Kg(this,s);return}if(e=n||"",n=new Map(this.headers),i)if(Object.getPrototypeOf(i)===Object.prototype)for(var o in i)n.set(o,i[o]);else if(typeof i.keys=="function"&&typeof i.get=="function")for(const s of i.keys())n.set(s,i.get(s));else throw Error("Unknown input type for opt_headers: "+String(i));i=Array.from(n.keys()).find(s=>s.toLowerCase()=="content-type"),o=X.FormData&&e instanceof X.FormData,!(0<=Pw(OA,t))||i||o||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[s,a]of n)this.g.setRequestHeader(s,a);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{c1(this),0{}:null;e.g=null,e.C=null,t||le(e,"ready");try{n.onreadystatechange=i}catch{}}}function c1(e){e.g&&e.L&&(e.g.ontimeout=null),e.A&&(X.clearTimeout(e.A),e.A=null)}B.isActive=function(){return!!this.g};function Pn(e){return e.g?e.g.readyState:0}B.da=function(){try{return 2=e.i.j-(e.m?1:0)?!1:e.m?(e.j=t.F.concat(e.j),!0):e.H==1||e.H==2||e.C>=(e.cb?0:e.eb)?!1:(e.m=ua(ve(e.Na,e,t),v1(e,e.C)),e.C++,!0)}B.Na=function(e){if(this.m)if(this.m=null,this.H==1){if(!e){this.W=Math.floor(1e5*Math.random()),e=this.W++;const o=new ca(this,this.l,e);let s=this.s;if(this.U&&(s?(s=Lw(s),Aw(s,this.U)):s=this.U),this.o!==null||this.O||(o.I=s,s=null),this.P)t:{for(var t=0,n=0;nd)s=Math.max(0,o[h].g-100),c=!1;else try{xA(m,a,"req"+d+"_")}catch{i&&i(m)}}if(c){i=a.join("&");break t}}}return e=e.j.splice(0,n),t.F=e,i}function m1(e){if(!e.g&&!e.u){e.ba=1;var t=e.Ma;$s||Nw(),js||($s(),js=!0),Ep.add(t,e),e.A=0}}function Rp(e){return e.g||e.u||3<=e.A?!1:(e.ba++,e.u=ua(ve(e.Ma,e),v1(e,e.A)),e.A++,!0)}B.Ma=function(){if(this.u=null,_1(this),this.ca&&!(this.M||this.g==null||0>=this.S)){var e=2*this.S;this.l.info("BP detection timer enabled: "+e),this.B=ua(ve(this.jb,this),e)}};B.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,Se(10),Kl(this),_1(this))};function Mp(e){e.B!=null&&(X.clearTimeout(e.B),e.B=null)}function _1(e){e.g=new ca(e,e.l,"rpc",e.ba),e.o===null&&(e.g.I=e.s),e.g.O=0;var t=qn(e.wa);It(t,"RID","rpc"),It(t,"SID",e.K),It(t,"AID",e.V),It(t,"CI",e.G?"0":"1"),!e.G&&e.qa&&It(t,"TO",e.qa),It(t,"TYPE","xmlhttp"),da(e,t),e.o&&e.s&&xp(t,e.o,e.s),e.L&&e.g.setTimeout(e.L);var n=e.g;e=e.pa,n.L=1,n.A=Zl(qn(t)),n.u=null,n.S=!0,Ww(n,e)}B.ib=function(){this.v!=null&&(this.v=null,Kl(this),Rp(this),Se(19))};function rl(e){e.v!=null&&(X.clearTimeout(e.v),e.v=null)}function g1(e,t){var n=null;if(e.g==t){rl(e),Mp(e),e.g=null;var i=2}else if(Gf(e.i,t))n=t.F,r1(e.i,t),i=1;else return;if(e.H!=0){if(t.i)if(i==1){n=t.u?t.u.length:0,t=Date.now()-t.G;var o=e.C;i=Ul(),le(i,new Uw(i,n)),Ql(e)}else m1(e);else if(o=t.s,o==3||o==0&&0o;++o)i[o]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(o=0;16>o;++o)i[o]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],o=e.g[2];var s=e.g[3],a=t+(s^n&(o^s))+i[0]+3614090360&4294967295;t=n+(a<<7&4294967295|a>>>25),a=s+(o^t&(n^o))+i[1]+3905402710&4294967295,s=t+(a<<12&4294967295|a>>>20),a=o+(n^s&(t^n))+i[2]+606105819&4294967295,o=s+(a<<17&4294967295|a>>>15),a=n+(t^o&(s^t))+i[3]+3250441966&4294967295,n=o+(a<<22&4294967295|a>>>10),a=t+(s^n&(o^s))+i[4]+4118548399&4294967295,t=n+(a<<7&4294967295|a>>>25),a=s+(o^t&(n^o))+i[5]+1200080426&4294967295,s=t+(a<<12&4294967295|a>>>20),a=o+(n^s&(t^n))+i[6]+2821735955&4294967295,o=s+(a<<17&4294967295|a>>>15),a=n+(t^o&(s^t))+i[7]+4249261313&4294967295,n=o+(a<<22&4294967295|a>>>10),a=t+(s^n&(o^s))+i[8]+1770035416&4294967295,t=n+(a<<7&4294967295|a>>>25),a=s+(o^t&(n^o))+i[9]+2336552879&4294967295,s=t+(a<<12&4294967295|a>>>20),a=o+(n^s&(t^n))+i[10]+4294925233&4294967295,o=s+(a<<17&4294967295|a>>>15),a=n+(t^o&(s^t))+i[11]+2304563134&4294967295,n=o+(a<<22&4294967295|a>>>10),a=t+(s^n&(o^s))+i[12]+1804603682&4294967295,t=n+(a<<7&4294967295|a>>>25),a=s+(o^t&(n^o))+i[13]+4254626195&4294967295,s=t+(a<<12&4294967295|a>>>20),a=o+(n^s&(t^n))+i[14]+2792965006&4294967295,o=s+(a<<17&4294967295|a>>>15),a=n+(t^o&(s^t))+i[15]+1236535329&4294967295,n=o+(a<<22&4294967295|a>>>10),a=t+(o^s&(n^o))+i[1]+4129170786&4294967295,t=n+(a<<5&4294967295|a>>>27),a=s+(n^o&(t^n))+i[6]+3225465664&4294967295,s=t+(a<<9&4294967295|a>>>23),a=o+(t^n&(s^t))+i[11]+643717713&4294967295,o=s+(a<<14&4294967295|a>>>18),a=n+(s^t&(o^s))+i[0]+3921069994&4294967295,n=o+(a<<20&4294967295|a>>>12),a=t+(o^s&(n^o))+i[5]+3593408605&4294967295,t=n+(a<<5&4294967295|a>>>27),a=s+(n^o&(t^n))+i[10]+38016083&4294967295,s=t+(a<<9&4294967295|a>>>23),a=o+(t^n&(s^t))+i[15]+3634488961&4294967295,o=s+(a<<14&4294967295|a>>>18),a=n+(s^t&(o^s))+i[4]+3889429448&4294967295,n=o+(a<<20&4294967295|a>>>12),a=t+(o^s&(n^o))+i[9]+568446438&4294967295,t=n+(a<<5&4294967295|a>>>27),a=s+(n^o&(t^n))+i[14]+3275163606&4294967295,s=t+(a<<9&4294967295|a>>>23),a=o+(t^n&(s^t))+i[3]+4107603335&4294967295,o=s+(a<<14&4294967295|a>>>18),a=n+(s^t&(o^s))+i[8]+1163531501&4294967295,n=o+(a<<20&4294967295|a>>>12),a=t+(o^s&(n^o))+i[13]+2850285829&4294967295,t=n+(a<<5&4294967295|a>>>27),a=s+(n^o&(t^n))+i[2]+4243563512&4294967295,s=t+(a<<9&4294967295|a>>>23),a=o+(t^n&(s^t))+i[7]+1735328473&4294967295,o=s+(a<<14&4294967295|a>>>18),a=n+(s^t&(o^s))+i[12]+2368359562&4294967295,n=o+(a<<20&4294967295|a>>>12),a=t+(n^o^s)+i[5]+4294588738&4294967295,t=n+(a<<4&4294967295|a>>>28),a=s+(t^n^o)+i[8]+2272392833&4294967295,s=t+(a<<11&4294967295|a>>>21),a=o+(s^t^n)+i[11]+1839030562&4294967295,o=s+(a<<16&4294967295|a>>>16),a=n+(o^s^t)+i[14]+4259657740&4294967295,n=o+(a<<23&4294967295|a>>>9),a=t+(n^o^s)+i[1]+2763975236&4294967295,t=n+(a<<4&4294967295|a>>>28),a=s+(t^n^o)+i[4]+1272893353&4294967295,s=t+(a<<11&4294967295|a>>>21),a=o+(s^t^n)+i[7]+4139469664&4294967295,o=s+(a<<16&4294967295|a>>>16),a=n+(o^s^t)+i[10]+3200236656&4294967295,n=o+(a<<23&4294967295|a>>>9),a=t+(n^o^s)+i[13]+681279174&4294967295,t=n+(a<<4&4294967295|a>>>28),a=s+(t^n^o)+i[0]+3936430074&4294967295,s=t+(a<<11&4294967295|a>>>21),a=o+(s^t^n)+i[3]+3572445317&4294967295,o=s+(a<<16&4294967295|a>>>16),a=n+(o^s^t)+i[6]+76029189&4294967295,n=o+(a<<23&4294967295|a>>>9),a=t+(n^o^s)+i[9]+3654602809&4294967295,t=n+(a<<4&4294967295|a>>>28),a=s+(t^n^o)+i[12]+3873151461&4294967295,s=t+(a<<11&4294967295|a>>>21),a=o+(s^t^n)+i[15]+530742520&4294967295,o=s+(a<<16&4294967295|a>>>16),a=n+(o^s^t)+i[2]+3299628645&4294967295,n=o+(a<<23&4294967295|a>>>9),a=t+(o^(n|~s))+i[0]+4096336452&4294967295,t=n+(a<<6&4294967295|a>>>26),a=s+(n^(t|~o))+i[7]+1126891415&4294967295,s=t+(a<<10&4294967295|a>>>22),a=o+(t^(s|~n))+i[14]+2878612391&4294967295,o=s+(a<<15&4294967295|a>>>17),a=n+(s^(o|~t))+i[5]+4237533241&4294967295,n=o+(a<<21&4294967295|a>>>11),a=t+(o^(n|~s))+i[12]+1700485571&4294967295,t=n+(a<<6&4294967295|a>>>26),a=s+(n^(t|~o))+i[3]+2399980690&4294967295,s=t+(a<<10&4294967295|a>>>22),a=o+(t^(s|~n))+i[10]+4293915773&4294967295,o=s+(a<<15&4294967295|a>>>17),a=n+(s^(o|~t))+i[1]+2240044497&4294967295,n=o+(a<<21&4294967295|a>>>11),a=t+(o^(n|~s))+i[8]+1873313359&4294967295,t=n+(a<<6&4294967295|a>>>26),a=s+(n^(t|~o))+i[15]+4264355552&4294967295,s=t+(a<<10&4294967295|a>>>22),a=o+(t^(s|~n))+i[6]+2734768916&4294967295,o=s+(a<<15&4294967295|a>>>17),a=n+(s^(o|~t))+i[13]+1309151649&4294967295,n=o+(a<<21&4294967295|a>>>11),a=t+(o^(n|~s))+i[4]+4149444226&4294967295,t=n+(a<<6&4294967295|a>>>26),a=s+(n^(t|~o))+i[11]+3174756917&4294967295,s=t+(a<<10&4294967295|a>>>22),a=o+(t^(s|~n))+i[2]+718787259&4294967295,o=s+(a<<15&4294967295|a>>>17),a=n+(s^(o|~t))+i[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(o+(a<<21&4294967295|a>>>11))&4294967295,e.g[2]=e.g[2]+o&4294967295,e.g[3]=e.g[3]+s&4294967295}dn.prototype.j=function(e,t){t===void 0&&(t=e.length);for(var n=t-this.blockSize,i=this.m,o=this.h,s=0;sthis.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;tt;++t)for(var i=0;32>i;i+=8)e[n++]=this.g[t]>>>i&255;return e};function vt(e,t){this.h=t;for(var n=[],i=!0,o=e.length-1;0<=o;o--){var s=e[o]|0;i&&s==t||(n[o]=s,i=!1)}this.g=n}var bA={};function Op(e){return-128<=e&&128>e?WL(e,function(t){return new vt([t|0],0>t?-1:0)}):new vt([e|0],0>e?-1:0)}function Sn(e){if(isNaN(e)||!isFinite(e))return Kr;if(0>e)return se(Sn(-e));for(var t=[],n=1,i=0;e>=n;i++)t[i]=e/n|0,n*=qf;return new vt(t,0)}function C1(e,t){if(e.length==0)throw Error("number format error: empty string");if(t=t||10,2>t||36s?(s=Sn(Math.pow(t,s)),i=i.R(s).add(Sn(a))):(i=i.R(n),i=i.add(Sn(a)))}return i}var qf=4294967296,Kr=Op(0),Kf=Op(1),Yg=Op(16777216);B=vt.prototype;B.ea=function(){if(Xe(this))return-se(this).ea();for(var e=0,t=1,n=0;ne||36>>0).toString(e);if(n=o,$n(n))return s+i;for(;6>s.length;)s="0"+s;i=s+i}};B.D=function(e){return 0>e?0:e>>16)+(this.D(o)>>>16)+(e.D(o)>>>16);i=a>>>16,s&=65535,a&=65535,n[o]=a<<16|s}return new vt(n,n[n.length-1]&-2147483648?-1:0)};function sl(e,t){return e.add(se(t))}B.R=function(e){if($n(this)||$n(e))return Kr;if(Xe(this))return Xe(e)?se(this).R(se(e)):se(se(this).R(e));if(Xe(e))return se(this.R(se(e)));if(0>this.X(Yg)&&0>e.X(Yg))return Sn(this.ea()*e.ea());for(var t=this.g.length+e.g.length,n=[],i=0;i<2*t;i++)n[i]=0;for(i=0;i>>16,a=this.D(i)&65535,c=e.D(o)>>>16,h=e.D(o)&65535;n[2*i+2*o]+=a*h,ou(n,2*i+2*o),n[2*i+2*o+1]+=s*h,ou(n,2*i+2*o+1),n[2*i+2*o+1]+=a*c,ou(n,2*i+2*o+1),n[2*i+2*o+2]+=s*c,ou(n,2*i+2*o+2)}for(i=0;i>>16,e[t]&=65535,t++}function Ko(e,t){this.g=e,this.h=t}function al(e,t){if($n(t))throw Error("division by zero");if($n(e))return new Ko(Kr,Kr);if(Xe(e))return t=al(se(e),t),new Ko(se(t.g),se(t.h));if(Xe(t))return t=al(e,se(t)),new Ko(se(t.g),t.h);if(30=i.X(e);)n=Jg(n),i=Jg(i);var o=Sr(n,1),s=Sr(i,1);for(i=Sr(i,2),n=Sr(n,2);!$n(i);){var a=s.add(i);0>=a.X(e)&&(o=o.add(n),s=a),i=Sr(i,1),n=Sr(n,1)}return t=sl(e,o.R(t)),new Ko(o,t)}for(o=Kr;0<=e.X(t);){for(n=Math.max(1,Math.floor(e.ea()/t.ea())),i=Math.ceil(Math.log(n)/Math.LN2),i=48>=i?1:Math.pow(2,i-48),s=Sn(n),a=s.R(t);Xe(a)||0>>31;return new vt(n,e.h)}function Sr(e,t){var n=t>>5;t%=32;for(var i=e.g.length-n,o=[],s=0;s>>t|e.D(s+n+1)<<32-t:e.D(s+n);return new vt(o,e.h)}ol.prototype.createWebChannel=ol.prototype.g;$e.prototype.send=$e.prototype.u;$e.prototype.open=$e.prototype.m;$e.prototype.close=$e.prototype.close;$l.NO_ERROR=0;$l.TIMEOUT=8;$l.HTTP_ERROR=6;$w.COMPLETE="complete";jw.EventType=la;la.OPEN="a";la.CLOSE="b";la.ERROR="c";la.MESSAGE="d";te.prototype.listen=te.prototype.O;Vt.prototype.listenOnce=Vt.prototype.P;Vt.prototype.getLastError=Vt.prototype.Sa;Vt.prototype.getLastErrorCode=Vt.prototype.Ia;Vt.prototype.getStatus=Vt.prototype.da;Vt.prototype.getResponseJson=Vt.prototype.Wa;Vt.prototype.getResponseText=Vt.prototype.ja;Vt.prototype.send=Vt.prototype.ha;Vt.prototype.setWithCredentials=Vt.prototype.Oa;dn.prototype.digest=dn.prototype.l;dn.prototype.reset=dn.prototype.reset;dn.prototype.update=dn.prototype.j;vt.prototype.add=vt.prototype.add;vt.prototype.multiply=vt.prototype.R;vt.prototype.modulo=vt.prototype.gb;vt.prototype.compare=vt.prototype.X;vt.prototype.toNumber=vt.prototype.ea;vt.prototype.toString=vt.prototype.toString;vt.prototype.getBits=vt.prototype.D;vt.fromNumber=Sn;vt.fromString=C1;var BA=function(){return new ol},FA=function(){return Ul()},kh=$l,UA=$w,$A=hr,tv={xb:0,Ab:1,Bb:2,Ub:3,Zb:4,Wb:5,Xb:6,Vb:7,Tb:8,Yb:9,PROXY:10,NOPROXY:11,Rb:12,Nb:13,Ob:14,Mb:15,Pb:16,Qb:17,tb:18,sb:19,ub:20},su=jw,jA=Vt,HA=dn,Qr=vt;const ev="@firebase/firestore";/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class me{constructor(t){this.uid=t}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(t){return t.uid===this.uid}}me.UNAUTHENTICATED=new me(null),me.GOOGLE_CREDENTIALS=new me("google-credentials-uid"),me.FIRST_PARTY=new me("first-party-uid"),me.MOCK_USER=new me("mock-user");/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */let To="10.8.1";/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const sr=new gw("@firebase/firestore");function Qo(){return sr.logLevel}function b(e,...t){if(sr.logLevel<=ft.DEBUG){const n=t.map(Dp);sr.debug(`Firestore (${To}): ${e}`,...n)}}function kn(e,...t){if(sr.logLevel<=ft.ERROR){const n=t.map(Dp);sr.error(`Firestore (${To}): ${e}`,...n)}}function so(e,...t){if(sr.logLevel<=ft.WARN){const n=t.map(Dp);sr.warn(`Firestore (${To}): ${e}`,...n)}}function Dp(e){if(typeof e=="string")return e;try{/** +* @license +* Copyright 2020 Google LLC +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/return function(n){return JSON.stringify(n)}(e)}catch{return e}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function K(e="Unexpected state"){const t=`FIRESTORE (${To}) INTERNAL ASSERTION FAILED: `+e;throw kn(t),new Error(t)}function St(e,t){e||K()}function nt(e,t){return e}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const D={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class H extends yo{constructor(t,n){super(t,n),this.code=t,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ln{constructor(){this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class I1{constructor(t,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${t}`)}}class ZA{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,n){t.enqueueRetryable(()=>n(me.UNAUTHENTICATED))}shutdown(){}}class WA{constructor(t){this.token=t,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(t,n){this.changeListener=n,t.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class GA{constructor(t){this.t=t,this.currentUser=me.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(t,n){let i=this.i;const o=h=>this.i!==i?(i=this.i,n(h)):Promise.resolve();let s=new Ln;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new Ln,t.enqueueRetryable(()=>o(this.currentUser))};const a=()=>{const h=s;t.enqueueRetryable(async()=>{await h.promise,await o(this.currentUser)})},c=h=>{b("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=h,this.auth.addAuthTokenListener(this.o),a()};this.t.onInit(h=>c(h)),setTimeout(()=>{if(!this.auth){const h=this.t.getImmediate({optional:!0});h?c(h):(b("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new Ln)}},0),a()}getToken(){const t=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(i=>this.i!==t?(b("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):i?(St(typeof i.accessToken=="string"),new I1(i.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const t=this.auth&&this.auth.getUid();return St(t===null||typeof t=="string"),new me(t)}}class qA{constructor(t,n,i){this.l=t,this.h=n,this.P=i,this.type="FirstParty",this.user=me.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const t=this.T();return t&&this.I.set("Authorization",t),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class KA{constructor(t,n,i){this.l=t,this.h=n,this.P=i}getToken(){return Promise.resolve(new qA(this.l,this.h,this.P))}start(t,n){t.enqueueRetryable(()=>n(me.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class QA{constructor(t){this.value=t,this.type="AppCheck",this.headers=new Map,t&&t.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class XA{constructor(t){this.A=t,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(t,n){const i=s=>{s.error!=null&&b("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${s.error.message}`);const a=s.token!==this.R;return this.R=s.token,b("FirebaseAppCheckTokenProvider",`Received ${a?"new":"existing"} token.`),a?n(s.token):Promise.resolve()};this.o=s=>{t.enqueueRetryable(()=>i(s))};const o=s=>{b("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.appCheck.addTokenListener(this.o)};this.A.onInit(s=>o(s)),setTimeout(()=>{if(!this.appCheck){const s=this.A.getImmediate({optional:!0});s?o(s):b("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const t=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(t).then(n=>n?(St(typeof n.token=="string"),this.R=n.token,new QA(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function YA(e){const t=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&typeof t.getRandomValues=="function")t.getRandomValues(n);else for(let i=0;it?1:0}function ao(e,t,n){return e.length===t.length&&e.every((i,o)=>n(i,t[o]))}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qt{constructor(t,n){if(this.seconds=t,this.nanoseconds=n,n<0)throw new H(D.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new H(D.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(t<-62135596800)throw new H(D.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new H(D.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}static now(){return qt.fromMillis(Date.now())}static fromDate(t){return qt.fromMillis(t.getTime())}static fromMillis(t){const n=Math.floor(t/1e3),i=Math.floor(1e6*(t-1e3*n));return new qt(n,i)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(t){return this.seconds===t.seconds?_t(this.nanoseconds,t.nanoseconds):_t(this.seconds,t.seconds)}isEqual(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class J{constructor(t){this.timestamp=t}static fromTimestamp(t){return new J(t)}static min(){return new J(new qt(0,0))}static max(){return new J(new qt(253402300799,999999999))}compareTo(t){return this.timestamp._compareTo(t.timestamp)}isEqual(t){return this.timestamp.isEqual(t.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qs{constructor(t,n,i){n===void 0?n=0:n>t.length&&K(),i===void 0?i=t.length-n:i>t.length-n&&K(),this.segments=t,this.offset=n,this.len=i}get length(){return this.len}isEqual(t){return qs.comparator(this,t)===0}child(t){const n=this.segments.slice(this.offset,this.limit());return t instanceof qs?t.forEach(i=>{n.push(i)}):n.push(t),this.construct(n)}limit(){return this.offset+this.length}popFirst(t){return t=t===void 0?1:t,this.construct(this.segments,this.offset+t,this.length-t)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(t){return this.segments[this.offset+t]}isEmpty(){return this.length===0}isPrefixOf(t){if(t.lengtha)return 1}return t.lengthn.length?1:0}}class xt extends qs{construct(t,n,i){return new xt(t,n,i)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...t){const n=[];for(const i of t){if(i.indexOf("//")>=0)throw new H(D.INVALID_ARGUMENT,`Invalid segment (${i}). Paths must not contain // in them.`);n.push(...i.split("/").filter(o=>o.length>0))}return new xt(n)}static emptyPath(){return new xt([])}}const JA=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class ae extends qs{construct(t,n,i){return new ae(t,n,i)}static isValidIdentifier(t){return JA.test(t)}canonicalString(){return this.toArray().map(t=>(t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),ae.isValidIdentifier(t)||(t="`"+t+"`"),t)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)==="__name__"}static keyField(){return new ae(["__name__"])}static fromServerFormat(t){const n=[];let i="",o=0;const s=()=>{if(i.length===0)throw new H(D.INVALID_ARGUMENT,`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(i),i=""};let a=!1;for(;o=2&&this.path.get(this.path.length-2)===t}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(t){return t!==null&&xt.comparator(this.path,t.path)===0}toString(){return this.path.toString()}static comparator(t,n){return xt.comparator(t.path,n.path)}static isDocumentKey(t){return t.length%2==0}static fromSegments(t){return new G(new xt(t.slice()))}}function tx(e,t){const n=e.toTimestamp().seconds,i=e.toTimestamp().nanoseconds+1,o=J.fromTimestamp(i===1e9?new qt(n+1,0):new qt(n,i));return new Si(o,G.empty(),t)}function ex(e){return new Si(e.readTime,e.key,-1)}class Si{constructor(t,n,i){this.readTime=t,this.documentKey=n,this.largestBatchId=i}static min(){return new Si(J.min(),G.empty(),-1)}static max(){return new Si(J.max(),G.empty(),-1)}}function nx(e,t){let n=e.readTime.compareTo(t.readTime);return n!==0?n:(n=G.comparator(e.documentKey,t.documentKey),n!==0?n:_t(e.largestBatchId,t.largestBatchId))}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const ix="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class rx{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(t){this.onCommittedListeners.push(t)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(t=>t())}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */async function pa(e){if(e.code!==D.FAILED_PRECONDITION||e.message!==ix)throw e;b("LocalStore","Unexpectedly lost primary lease")}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class M{constructor(t){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(t){return this.next(void 0,t)}next(t,n){return this.callbackAttached&&K(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(t,this.result):new M((i,o)=>{this.nextCallback=s=>{this.wrapSuccess(t,s).next(i,o)},this.catchCallback=s=>{this.wrapFailure(n,s).next(i,o)}})}toPromise(){return new Promise((t,n)=>{this.next(t,n)})}wrapUserFunction(t){try{const n=t();return n instanceof M?n:M.resolve(n)}catch(n){return M.reject(n)}}wrapSuccess(t,n){return t?this.wrapUserFunction(()=>t(n)):M.resolve(n)}wrapFailure(t,n){return t?this.wrapUserFunction(()=>t(n)):M.reject(n)}static resolve(t){return new M((n,i)=>{n(t)})}static reject(t){return new M((n,i)=>{i(t)})}static waitFor(t){return new M((n,i)=>{let o=0,s=0,a=!1;t.forEach(c=>{++o,c.next(()=>{++s,a&&s===o&&n()},h=>i(h))}),a=!0,s===o&&n()})}static or(t){let n=M.resolve(!1);for(const i of t)n=n.next(o=>o?M.resolve(o):i());return n}static forEach(t,n){const i=[];return t.forEach((o,s)=>{i.push(n.call(this,o,s))}),this.waitFor(i)}static mapArray(t,n){return new M((i,o)=>{const s=t.length,a=new Array(s);let c=0;for(let h=0;h{a[d]=m,++c,c===s&&i(a)},m=>o(m))}})}static doWhile(t,n){return new M((i,o)=>{const s=()=>{t()===!0?n().next(()=>{s()},o):i()};s()})}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Np{constructor(t,n){this.action=t,this.transaction=n,this.aborted=!1,this.V=new Ln,this.transaction.oncomplete=()=>{this.V.resolve()},this.transaction.onabort=()=>{n.error?this.V.reject(new _s(t,n.error)):this.V.resolve()},this.transaction.onerror=i=>{const o=Vp(i.target.error);this.V.reject(new _s(t,o))}}static open(t,n,i,o){try{return new Np(n,t.transaction(o,i))}catch(s){throw new _s(n,s)}}get m(){return this.V.promise}abort(t){t&&this.V.reject(t),this.aborted||(b("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}g(){const t=this.transaction;this.aborted||typeof t.commit!="function"||t.commit()}store(t){const n=this.transaction.objectStore(t);return new sx(n)}}class Ki{constructor(t,n,i){this.name=t,this.version=n,this.p=i,Ki.S(Ju())===12.2&&kn("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}static delete(t){return b("SimpleDb","Removing database:",t),ji(window.indexedDB.deleteDatabase(t)).toPromise()}static D(){if(!mw())return!1;if(Ki.C())return!0;const t=Ju(),n=Ki.S(t),i=00||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0||i||s)}static C(){var t;return typeof process<"u"&&((t=process.__PRIVATE_env)===null||t===void 0?void 0:t.F)==="YES"}static M(t,n){return t.store(n)}static S(t){const n=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),i=n?n[1].split("_").slice(0,2).join("."):"-1";return Number(i)}static v(t){const n=t.match(/Android ([\d.]+)/i),i=n?n[1].split(".").slice(0,2).join("."):"-1";return Number(i)}async O(t){return this.db||(b("SimpleDb","Opening database:",this.name),this.db=await new Promise((n,i)=>{const o=indexedDB.open(this.name,this.version);o.onsuccess=s=>{const a=s.target.result;n(a)},o.onblocked=()=>{i(new _s(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},o.onerror=s=>{const a=s.target.error;a.name==="VersionError"?i(new H(D.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):a.name==="InvalidStateError"?i(new H(D.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+a)):i(new _s(t,a))},o.onupgradeneeded=s=>{b("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',s.oldVersion);const a=s.target.result;this.p.N(a,o.transaction,s.oldVersion,this.version).next(()=>{b("SimpleDb","Database upgrade to version "+this.version+" complete")})}})),this.B&&(this.db.onversionchange=n=>this.B(n)),this.db}L(t){this.B=t,this.db&&(this.db.onversionchange=n=>t(n))}async runTransaction(t,n,i,o){const s=n==="readonly";let a=0;for(;;){++a;try{this.db=await this.O(t);const c=Np.open(this.db,t,s?"readonly":"readwrite",i),h=o(c).next(d=>(c.g(),d)).catch(d=>(c.abort(d),M.reject(d))).toPromise();return h.catch(()=>{}),await c.m,h}catch(c){const h=c,d=h.name!=="FirebaseError"&&a<3;if(b("SimpleDb","Transaction failed with error:",h.message,"Retrying:",d),this.close(),!d)return Promise.reject(h)}}}close(){this.db&&this.db.close(),this.db=void 0}}class ox{constructor(t){this.k=t,this.q=!1,this.K=null}get isDone(){return this.q}get $(){return this.K}set cursor(t){this.k=t}done(){this.q=!0}U(t){this.K=t}delete(){return ji(this.k.delete())}}class _s extends H{constructor(t,n){super(D.UNAVAILABLE,`IndexedDB transaction '${t}' failed: ${n}`),this.name="IndexedDbTransactionError"}}function ma(e){return e.name==="IndexedDbTransactionError"}class sx{constructor(t){this.store=t}put(t,n){let i;return n!==void 0?(b("SimpleDb","PUT",this.store.name,t,n),i=this.store.put(n,t)):(b("SimpleDb","PUT",this.store.name,"",t),i=this.store.put(t)),ji(i)}add(t){return b("SimpleDb","ADD",this.store.name,t,t),ji(this.store.add(t))}get(t){return ji(this.store.get(t)).next(n=>(n===void 0&&(n=null),b("SimpleDb","GET",this.store.name,t,n),n))}delete(t){return b("SimpleDb","DELETE",this.store.name,t),ji(this.store.delete(t))}count(){return b("SimpleDb","COUNT",this.store.name),ji(this.store.count())}W(t,n){const i=this.options(t,n),o=i.index?this.store.index(i.index):this.store;if(typeof o.getAll=="function"){const s=o.getAll(i.range);return new M((a,c)=>{s.onerror=h=>{c(h.target.error)},s.onsuccess=h=>{a(h.target.result)}})}{const s=this.cursor(i),a=[];return this.G(s,(c,h)=>{a.push(h)}).next(()=>a)}}j(t,n){const i=this.store.getAll(t,n===null?void 0:n);return new M((o,s)=>{i.onerror=a=>{s(a.target.error)},i.onsuccess=a=>{o(a.target.result)}})}H(t,n){b("SimpleDb","DELETE ALL",this.store.name);const i=this.options(t,n);i.J=!1;const o=this.cursor(i);return this.G(o,(s,a,c)=>c.delete())}Y(t,n){let i;n?i=t:(i={},n=t);const o=this.cursor(i);return this.G(o,n)}Z(t){const n=this.cursor({});return new M((i,o)=>{n.onerror=s=>{const a=Vp(s.target.error);o(a)},n.onsuccess=s=>{const a=s.target.result;a?t(a.primaryKey,a.value).next(c=>{c?a.continue():i()}):i()}})}G(t,n){const i=[];return new M((o,s)=>{t.onerror=a=>{s(a.target.error)},t.onsuccess=a=>{const c=a.target.result;if(!c)return void o();const h=new ox(c),d=n(c.primaryKey,c.value,h);if(d instanceof M){const m=d.catch(_=>(h.done(),M.reject(_)));i.push(m)}h.isDone?o():h.$===null?c.continue():c.continue(h.$)}}).next(()=>M.waitFor(i))}options(t,n){let i;return t!==void 0&&(typeof t=="string"?i=t:n=t),{index:i,range:n}}cursor(t){let n="next";if(t.reverse&&(n="prev"),t.index){const i=this.store.index(t.index);return t.J?i.openKeyCursor(t.range,n):i.openCursor(t.range,n)}return this.store.openCursor(t.range,n)}}function ji(e){return new M((t,n)=>{e.onsuccess=i=>{const o=i.target.result;t(o)},e.onerror=i=>{const o=Vp(i.target.error);n(o)}})}let nv=!1;function Vp(e){const t=Ki.S(Ju());if(t>=12.2&&t<13){const n="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(n)>=0){const i=new H("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${n}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return nv||(nv=!0,setTimeout(()=>{throw i},0)),i}}return e}/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class zp{constructor(t,n){this.previousValue=t,n&&(n.sequenceNumberHandler=i=>this.se(i),this.oe=i=>n.writeSequenceNumber(i))}se(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this.oe&&this.oe(t),t}}zp._e=-1;function Xl(e){return e==null}function ul(e){return e===0&&1/e==-1/0}function ax(e){return typeof e=="number"&&Number.isInteger(e)&&!ul(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function iv(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function fr(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function A1(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Dt{constructor(t,n){this.comparator=t,this.root=n||oe.EMPTY}insert(t,n){return new Dt(this.comparator,this.root.insert(t,n,this.comparator).copy(null,null,oe.BLACK,null,null))}remove(t){return new Dt(this.comparator,this.root.remove(t,this.comparator).copy(null,null,oe.BLACK,null,null))}get(t){let n=this.root;for(;!n.isEmpty();){const i=this.comparator(t,n.key);if(i===0)return n.value;i<0?n=n.left:i>0&&(n=n.right)}return null}indexOf(t){let n=0,i=this.root;for(;!i.isEmpty();){const o=this.comparator(t,i.key);if(o===0)return n+i.left.size;o<0?i=i.left:(n+=i.left.size+1,i=i.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(t){return this.root.inorderTraversal(t)}forEach(t){this.inorderTraversal((n,i)=>(t(n,i),!1))}toString(){const t=[];return this.inorderTraversal((n,i)=>(t.push(`${n}:${i}`),!1)),`{${t.join(", ")}}`}reverseTraversal(t){return this.root.reverseTraversal(t)}getIterator(){return new au(this.root,null,this.comparator,!1)}getIteratorFrom(t){return new au(this.root,t,this.comparator,!1)}getReverseIterator(){return new au(this.root,null,this.comparator,!0)}getReverseIteratorFrom(t){return new au(this.root,t,this.comparator,!0)}}class au{constructor(t,n,i,o){this.isReverse=o,this.nodeStack=[];let s=1;for(;!t.isEmpty();)if(s=n?i(t.key,n):1,n&&o&&(s*=-1),s<0)t=this.isReverse?t.left:t.right;else{if(s===0){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}getNext(){let t=this.nodeStack.pop();const n={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}}}class oe{constructor(t,n,i,o,s){this.key=t,this.value=n,this.color=i??oe.RED,this.left=o??oe.EMPTY,this.right=s??oe.EMPTY,this.size=this.left.size+1+this.right.size}copy(t,n,i,o,s){return new oe(t??this.key,n??this.value,i??this.color,o??this.left,s??this.right)}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(t,n,i){let o=this;const s=i(t,o.key);return o=s<0?o.copy(null,null,null,o.left.insert(t,n,i),null):s===0?o.copy(null,n,null,null,null):o.copy(null,null,null,null,o.right.insert(t,n,i)),o.fixUp()}removeMin(){if(this.left.isEmpty())return oe.EMPTY;let t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()}remove(t,n){let i,o=this;if(n(t,o.key)<0)o.left.isEmpty()||o.left.isRed()||o.left.left.isRed()||(o=o.moveRedLeft()),o=o.copy(null,null,null,o.left.remove(t,n),null);else{if(o.left.isRed()&&(o=o.rotateRight()),o.right.isEmpty()||o.right.isRed()||o.right.left.isRed()||(o=o.moveRedRight()),n(t,o.key)===0){if(o.right.isEmpty())return oe.EMPTY;i=o.right.min(),o=o.copy(i.key,i.value,null,null,o.right.removeMin())}o=o.copy(null,null,null,null,o.right.remove(t,n))}return o.fixUp()}isRed(){return this.color}fixUp(){let t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t}moveRedLeft(){let t=this.colorFlip();return t.right.left.isRed()&&(t=t.copy(null,null,null,null,t.right.rotateRight()),t=t.rotateLeft(),t=t.colorFlip()),t}moveRedRight(){let t=this.colorFlip();return t.left.left.isRed()&&(t=t.rotateRight(),t=t.colorFlip()),t}rotateLeft(){const t=this.copy(null,null,oe.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight(){const t=this.copy(null,null,oe.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip(){const t=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,n)}checkMaxDepth(){const t=this.check();return Math.pow(2,t)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw K();const t=this.left.check();if(t!==this.right.check())throw K();return t+(this.isRed()?0:1)}}oe.EMPTY=null,oe.RED=!0,oe.BLACK=!1;oe.EMPTY=new class{constructor(){this.size=0}get key(){throw K()}get value(){throw K()}get color(){throw K()}get left(){throw K()}get right(){throw K()}copy(t,n,i,o,s){return this}insert(t,n,i){return new oe(t,n)}remove(t,n){return this}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ce{constructor(t){this.comparator=t,this.data=new Dt(this.comparator)}has(t){return this.data.get(t)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(t){return this.data.indexOf(t)}forEach(t){this.data.inorderTraversal((n,i)=>(t(n),!1))}forEachInRange(t,n){const i=this.data.getIteratorFrom(t[0]);for(;i.hasNext();){const o=i.getNext();if(this.comparator(o.key,t[1])>=0)return;n(o.key)}}forEachWhile(t,n){let i;for(i=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();i.hasNext();)if(!t(i.getNext().key))return}firstAfterOrEqual(t){const n=this.data.getIteratorFrom(t);return n.hasNext()?n.getNext().key:null}getIterator(){return new rv(this.data.getIterator())}getIteratorFrom(t){return new rv(this.data.getIteratorFrom(t))}add(t){return this.copy(this.data.remove(t).insert(t,!0))}delete(t){return this.has(t)?this.copy(this.data.remove(t)):this}isEmpty(){return this.data.isEmpty()}unionWith(t){let n=this;return n.size{n=n.add(i)}),n}isEqual(t){if(!(t instanceof ce)||this.size!==t.size)return!1;const n=this.data.getIterator(),i=t.data.getIterator();for(;n.hasNext();){const o=n.getNext().key,s=i.getNext().key;if(this.comparator(o,s)!==0)return!1}return!0}toArray(){const t=[];return this.forEach(n=>{t.push(n)}),t}toString(){const t=[];return this.forEach(n=>t.push(n)),"SortedSet("+t.toString()+")"}copy(t){const n=new ce(this.comparator);return n.data=t,n}}class rv{constructor(t){this.iter=t}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class be{constructor(t){this.fields=t,t.sort(ae.comparator)}static empty(){return new be([])}unionWith(t){let n=new ce(ae.comparator);for(const i of this.fields)n=n.add(i);for(const i of t)n=n.add(i);return new be(n.toArray())}covers(t){for(const n of this.fields)if(n.isPrefixOf(t))return!0;return!1}isEqual(t){return ao(this.fields,t.fields,(n,i)=>n.isEqual(i))}}/** + * @license + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class x1 extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ee{constructor(t){this.binaryString=t}static fromBase64String(t){const n=function(o){try{return atob(o)}catch(s){throw typeof DOMException<"u"&&s instanceof DOMException?new x1("Invalid base64 string: "+s):s}}(t);return new Ee(n)}static fromUint8Array(t){const n=function(o){let s="";for(let a=0;atRn(n,t))!==void 0}function uo(e,t){if(e===t)return 0;const n=ur(e),i=ur(t);if(n!==i)return _t(n,i);switch(n){case 0:case 9007199254740991:return 0;case 1:return _t(e.booleanValue,t.booleanValue);case 2:return function(s,a){const c=$t(s.integerValue||s.doubleValue),h=$t(a.integerValue||a.doubleValue);return ch?1:c===h?0:isNaN(c)?isNaN(h)?0:-1:1}(e,t);case 3:return ov(e.timestampValue,t.timestampValue);case 4:return ov(Ks(e),Ks(t));case 5:return _t(e.stringValue,t.stringValue);case 6:return function(s,a){const c=ar(s),h=ar(a);return c.compareTo(h)}(e.bytesValue,t.bytesValue);case 7:return function(s,a){const c=s.split("/"),h=a.split("/");for(let d=0;dt.mapValue.fields[n]=gs(i)),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=gs(e.arrayValue.values[n]);return t}return Object.assign({},e)}function cx(e){return(((e.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Re{constructor(t){this.value=t}static empty(){return new Re({mapValue:{}})}field(t){if(t.isEmpty())return this.value;{let n=this.value;for(let i=0;i{if(!n.isImmediateParentOf(c)){const h=this.getFieldsMap(n);this.applyChanges(h,i,o),i={},o=[],n=c.popLast()}a?i[c.lastSegment()]=gs(a):o.push(c.lastSegment())});const s=this.getFieldsMap(n);this.applyChanges(s,i,o)}delete(t){const n=this.field(t.popLast());Tu(n)&&n.mapValue.fields&&delete n.mapValue.fields[t.lastSegment()]}isEqual(t){return Rn(this.value,t.value)}getFieldsMap(t){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let i=0;it[o]=s);for(const o of i)delete t[o]}clone(){return new Re(gs(this.value))}}function k1(e){const t=[];return fr(e.fields,(n,i)=>{const o=new ae([n]);if(Tu(i)){const s=k1(i.mapValue).fields;if(s.length===0)t.push(o);else for(const a of s)t.push(o.child(a))}else t.push(o)}),new be(t)}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ge{constructor(t,n,i,o,s,a,c){this.key=t,this.documentType=n,this.version=i,this.readTime=o,this.createTime=s,this.data=a,this.documentState=c}static newInvalidDocument(t){return new ge(t,0,J.min(),J.min(),J.min(),Re.empty(),0)}static newFoundDocument(t,n,i,o){return new ge(t,1,n,J.min(),i,o,0)}static newNoDocument(t,n){return new ge(t,2,n,J.min(),J.min(),Re.empty(),0)}static newUnknownDocument(t,n){return new ge(t,3,n,J.min(),J.min(),Re.empty(),2)}convertToFoundDocument(t,n){return!this.createTime.isEqual(J.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=t),this.version=t,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(t){return this.version=t,this.documentType=2,this.data=Re.empty(),this.documentState=0,this}convertToUnknownDocument(t){return this.version=t,this.documentType=3,this.data=Re.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=J.min(),this}setReadTime(t){return this.readTime=t,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(t){return t instanceof ge&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)}mutableCopy(){return new ge(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ll{constructor(t,n){this.position=t,this.inclusive=n}}function uv(e,t,n){let i=0;for(let o=0;o":return t>0;case">=":return t>=0;default:return K()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Mn extends R1{constructor(t,n){super(),this.filters=t,this.op=n,this.ue=null}static create(t,n){return new Mn(t,n)}matches(t){return M1(this)?this.filters.find(n=>!n.matches(t))===void 0:this.filters.find(n=>n.matches(t))!==void 0}getFlattenedFilters(){return this.ue!==null||(this.ue=this.filters.reduce((t,n)=>t.concat(n.getFlattenedFilters()),[])),this.ue}getFilters(){return Object.assign([],this.filters)}}function M1(e){return e.op==="and"}function O1(e){return fx(e)&&M1(e)}function fx(e){for(const t of e.filters)if(t instanceof Mn)return!1;return!0}function Yf(e){if(e instanceof Wt)return e.field.canonicalString()+e.op.toString()+lo(e.value);if(O1(e))return e.filters.map(t=>Yf(t)).join(",");{const t=e.filters.map(n=>Yf(n)).join(",");return`${e.op}(${t})`}}function D1(e,t){return e instanceof Wt?function(i,o){return o instanceof Wt&&i.op===o.op&&i.field.isEqual(o.field)&&Rn(i.value,o.value)}(e,t):e instanceof Mn?function(i,o){return o instanceof Mn&&i.op===o.op&&i.filters.length===o.filters.length?i.filters.reduce((s,a,c)=>s&&D1(a,o.filters[c]),!0):!1}(e,t):void K()}function N1(e){return e instanceof Wt?function(n){return`${n.field.canonicalString()} ${n.op} ${lo(n.value)}`}(e):e instanceof Mn?function(n){return n.op.toString()+" {"+n.getFilters().map(N1).join(" ,")+"}"}(e):"Filter"}class dx extends Wt{constructor(t,n,i){super(t,n,i),this.key=G.fromName(i.referenceValue)}matches(t){const n=G.comparator(t.key,this.key);return this.matchesComparison(n)}}class px extends Wt{constructor(t,n){super(t,"in",n),this.keys=V1("in",n)}matches(t){return this.keys.some(n=>n.isEqual(t.key))}}class mx extends Wt{constructor(t,n){super(t,"not-in",n),this.keys=V1("not-in",n)}matches(t){return!this.keys.some(n=>n.isEqual(t.key))}}function V1(e,t){var n;return(((n=t.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(i=>G.fromName(i.referenceValue))}class _x extends Wt{constructor(t,n){super(t,"array-contains",n)}matches(t){const n=t.data.field(this.field);return Fp(n)&&Xs(n.arrayValue,this.value)}}class gx extends Wt{constructor(t,n){super(t,"in",n)}matches(t){const n=t.data.field(this.field);return n!==null&&Xs(this.value.arrayValue,n)}}class vx extends Wt{constructor(t,n){super(t,"not-in",n)}matches(t){if(Xs(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=t.data.field(this.field);return n!==null&&!Xs(this.value.arrayValue,n)}}class yx extends Wt{constructor(t,n){super(t,"array-contains-any",n)}matches(t){const n=t.data.field(this.field);return!(!Fp(n)||!n.arrayValue.values)&&n.arrayValue.values.some(i=>Xs(this.value.arrayValue,i))}}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class wx{constructor(t,n=null,i=[],o=[],s=null,a=null,c=null){this.path=t,this.collectionGroup=n,this.orderBy=i,this.filters=o,this.limit=s,this.startAt=a,this.endAt=c,this.ce=null}}function cv(e,t=null,n=[],i=[],o=null,s=null,a=null){return new wx(e,t,n,i,o,s,a)}function Up(e){const t=nt(e);if(t.ce===null){let n=t.path.canonicalString();t.collectionGroup!==null&&(n+="|cg:"+t.collectionGroup),n+="|f:",n+=t.filters.map(i=>Yf(i)).join(","),n+="|ob:",n+=t.orderBy.map(i=>function(s){return s.field.canonicalString()+s.dir}(i)).join(","),Xl(t.limit)||(n+="|l:",n+=t.limit),t.startAt&&(n+="|lb:",n+=t.startAt.inclusive?"b:":"a:",n+=t.startAt.position.map(i=>lo(i)).join(",")),t.endAt&&(n+="|ub:",n+=t.endAt.inclusive?"a:":"b:",n+=t.endAt.position.map(i=>lo(i)).join(",")),t.ce=n}return t.ce}function $p(e,t){if(e.limit!==t.limit||e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";(function(a){let c=new ce(ae.comparator);return a.filters.forEach(h=>{h.getFlattenedFilters().forEach(d=>{d.isInequality()&&(c=c.add(d.field))})}),c})(t).forEach(s=>{n.has(s.canonicalString())||s.isKeyField()||t.le.push(new cl(s,i))}),n.has(ae.keyField().canonicalString())||t.le.push(new cl(ae.keyField(),i))}return t.le}function An(e){const t=nt(e);return t.he||(t.he=Px(t,vs(e))),t.he}function Px(e,t){if(e.limitType==="F")return cv(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(o=>{const s=o.dir==="desc"?"asc":"desc";return new cl(o.field,s)});const n=e.endAt?new ll(e.endAt.position,e.endAt.inclusive):null,i=e.startAt?new ll(e.startAt.position,e.startAt.inclusive):null;return cv(e.path,e.collectionGroup,t,e.filters,e.limit,n,i)}}function td(e,t,n){return new Yl(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Jl(e,t){return $p(An(e),An(t))&&e.limitType===t.limitType}function z1(e){return`${Up(An(e))}|lt:${e.limitType}`}function Cr(e){return`Query(target=${function(n){let i=n.path.canonicalString();return n.collectionGroup!==null&&(i+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(i+=`, filters: [${n.filters.map(o=>N1(o)).join(", ")}]`),Xl(n.limit)||(i+=", limit: "+n.limit),n.orderBy.length>0&&(i+=`, orderBy: [${n.orderBy.map(o=>function(a){return`${a.field.canonicalString()} (${a.dir})`}(o)).join(", ")}]`),n.startAt&&(i+=", startAt: ",i+=n.startAt.inclusive?"b:":"a:",i+=n.startAt.position.map(o=>lo(o)).join(",")),n.endAt&&(i+=", endAt: ",i+=n.endAt.inclusive?"a:":"b:",i+=n.endAt.position.map(o=>lo(o)).join(",")),`Target(${i})`}(An(e))}; limitType=${e.limitType})`}function tc(e,t){return t.isFoundDocument()&&function(i,o){const s=o.key.path;return i.collectionGroup!==null?o.key.hasCollectionId(i.collectionGroup)&&i.path.isPrefixOf(s):G.isDocumentKey(i.path)?i.path.isEqual(s):i.path.isImmediateParentOf(s)}(e,t)&&function(i,o){for(const s of vs(i))if(!s.field.isKeyField()&&o.data.field(s.field)===null)return!1;return!0}(e,t)&&function(i,o){for(const s of i.filters)if(!s.matches(o))return!1;return!0}(e,t)&&function(i,o){return!(i.startAt&&!function(a,c,h){const d=uv(a,c,h);return a.inclusive?d<=0:d<0}(i.startAt,vs(i),o)||i.endAt&&!function(a,c,h){const d=uv(a,c,h);return a.inclusive?d>=0:d>0}(i.endAt,vs(i),o))}(e,t)}function Sx(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function b1(e){return(t,n)=>{let i=!1;for(const o of vs(e)){const s=Cx(o,t,n);if(s!==0)return s;i=i||o.field.isKeyField()}return 0}}function Cx(e,t,n){const i=e.field.isKeyField()?G.comparator(t.key,n.key):function(s,a,c){const h=a.data.field(s),d=c.data.field(s);return h!==null&&d!==null?uo(h,d):K()}(e.field,t,n);switch(e.dir){case"asc":return i;case"desc":return-1*i;default:return K()}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Po{constructor(t,n){this.mapKeyFn=t,this.equalsFn=n,this.inner={},this.innerSize=0}get(t){const n=this.mapKeyFn(t),i=this.inner[n];if(i!==void 0){for(const[o,s]of i)if(this.equalsFn(o,t))return s}}has(t){return this.get(t)!==void 0}set(t,n){const i=this.mapKeyFn(t),o=this.inner[i];if(o===void 0)return this.inner[i]=[[t,n]],void this.innerSize++;for(let s=0;s{for(const[o,s]of i)t(o,s)})}isEmpty(){return A1(this.inner)}size(){return this.innerSize}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Ix=new Dt(G.comparator);function Kn(){return Ix}const B1=new Dt(G.comparator);function is(...e){let t=B1;for(const n of e)t=t.insert(n.key,n);return t}function F1(e){let t=B1;return e.forEach((n,i)=>t=t.insert(n,i.overlayedDocument)),t}function Qi(){return ys()}function U1(){return ys()}function ys(){return new Po(e=>e.toString(),(e,t)=>e.isEqual(t))}const Lx=new Dt(G.comparator),Ax=new ce(G.comparator);function st(...e){let t=Ax;for(const n of e)t=t.add(n);return t}const xx=new ce(_t);function kx(){return xx}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function $1(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ul(t)?"-0":t}}function j1(e){return{integerValue:""+e}}function Rx(e,t){return ax(t)?j1(t):$1(e,t)}/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ec{constructor(){this._=void 0}}function Mx(e,t,n){return e instanceof hl?function(o,s){const a={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:o.seconds,nanos:o.nanoseconds}}}};return s&&bp(s)&&(s=Bp(s)),s&&(a.fields.__previous_value__=s),{mapValue:a}}(n,t):e instanceof Ys?Z1(e,t):e instanceof Js?W1(e,t):function(o,s){const a=H1(o,s),c=fv(a)+fv(o.Ie);return Xf(a)&&Xf(o.Ie)?j1(c):$1(o.serializer,c)}(e,t)}function Ox(e,t,n){return e instanceof Ys?Z1(e,t):e instanceof Js?W1(e,t):n}function H1(e,t){return e instanceof fl?function(i){return Xf(i)||function(s){return!!s&&"doubleValue"in s}(i)}(t)?t:{integerValue:0}:null}class hl extends ec{}class Ys extends ec{constructor(t){super(),this.elements=t}}function Z1(e,t){const n=G1(t);for(const i of e.elements)n.some(o=>Rn(o,i))||n.push(i);return{arrayValue:{values:n}}}class Js extends ec{constructor(t){super(),this.elements=t}}function W1(e,t){let n=G1(t);for(const i of e.elements)n=n.filter(o=>!Rn(o,i));return{arrayValue:{values:n}}}class fl extends ec{constructor(t,n){super(),this.serializer=t,this.Ie=n}}function fv(e){return $t(e.integerValue||e.doubleValue)}function G1(e){return Fp(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}function Dx(e,t){return e.field.isEqual(t.field)&&function(i,o){return i instanceof Ys&&o instanceof Ys||i instanceof Js&&o instanceof Js?ao(i.elements,o.elements,Rn):i instanceof fl&&o instanceof fl?Rn(i.Ie,o.Ie):i instanceof hl&&o instanceof hl}(e.transform,t.transform)}class Nx{constructor(t,n){this.version=t,this.transformResults=n}}class hn{constructor(t,n){this.updateTime=t,this.exists=n}static none(){return new hn}static exists(t){return new hn(void 0,t)}static updateTime(t){return new hn(t)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function Pu(e,t){return e.updateTime!==void 0?t.isFoundDocument()&&t.version.isEqual(e.updateTime):e.exists===void 0||e.exists===t.isFoundDocument()}class nc{}function q1(e,t){if(!e.hasLocalMutations||t&&t.fields.length===0)return null;if(t===null)return e.isNoDocument()?new Hp(e.key,hn.none()):new _a(e.key,e.data,hn.none());{const n=e.data,i=Re.empty();let o=new ce(ae.comparator);for(let s of t.fields)if(!o.has(s)){let a=n.field(s);a===null&&s.length>1&&(s=s.popLast(),a=n.field(s)),a===null?i.delete(s):i.set(s,a),o=o.add(s)}return new Oi(e.key,i,new be(o.toArray()),hn.none())}}function Vx(e,t,n){e instanceof _a?function(o,s,a){const c=o.value.clone(),h=pv(o.fieldTransforms,s,a.transformResults);c.setAll(h),s.convertToFoundDocument(a.version,c).setHasCommittedMutations()}(e,t,n):e instanceof Oi?function(o,s,a){if(!Pu(o.precondition,s))return void s.convertToUnknownDocument(a.version);const c=pv(o.fieldTransforms,s,a.transformResults),h=s.data;h.setAll(K1(o)),h.setAll(c),s.convertToFoundDocument(a.version,h).setHasCommittedMutations()}(e,t,n):function(o,s,a){s.convertToNoDocument(a.version).setHasCommittedMutations()}(0,t,n)}function ws(e,t,n,i){return e instanceof _a?function(s,a,c,h){if(!Pu(s.precondition,a))return c;const d=s.value.clone(),m=mv(s.fieldTransforms,h,a);return d.setAll(m),a.convertToFoundDocument(a.version,d).setHasLocalMutations(),null}(e,t,n,i):e instanceof Oi?function(s,a,c,h){if(!Pu(s.precondition,a))return c;const d=mv(s.fieldTransforms,h,a),m=a.data;return m.setAll(K1(s)),m.setAll(d),a.convertToFoundDocument(a.version,m).setHasLocalMutations(),c===null?null:c.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(_=>_.field))}(e,t,n,i):function(s,a,c){return Pu(s.precondition,a)?(a.convertToNoDocument(a.version).setHasLocalMutations(),null):c}(e,t,n)}function zx(e,t){let n=null;for(const i of e.fieldTransforms){const o=t.data.field(i.field),s=H1(i.transform,o||null);s!=null&&(n===null&&(n=Re.empty()),n.set(i.field,s))}return n||null}function dv(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(i,o){return i===void 0&&o===void 0||!(!i||!o)&&ao(i,o,(s,a)=>Dx(s,a))}(e.fieldTransforms,t.fieldTransforms)&&(e.type===0?e.value.isEqual(t.value):e.type!==1||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class _a extends nc{constructor(t,n,i,o=[]){super(),this.key=t,this.value=n,this.precondition=i,this.fieldTransforms=o,this.type=0}getFieldMask(){return null}}class Oi extends nc{constructor(t,n,i,o,s=[]){super(),this.key=t,this.data=n,this.fieldMask=i,this.precondition=o,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function K1(e){const t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const i=e.data.field(n);t.set(n,i)}}),t}function pv(e,t,n){const i=new Map;St(e.length===n.length);for(let o=0;o{const s=t.get(o.key),a=s.overlayedDocument;let c=this.applyToLocalView(a,s.mutatedFields);c=n.has(o.key)?null:c;const h=q1(a,c);h!==null&&i.set(o.key,h),a.isValidDocument()||a.convertToNoDocument(J.min())}),i}keys(){return this.mutations.reduce((t,n)=>t.add(n.key),st())}isEqual(t){return this.batchId===t.batchId&&ao(this.mutations,t.mutations,(n,i)=>dv(n,i))&&ao(this.baseMutations,t.baseMutations,(n,i)=>dv(n,i))}}class Zp{constructor(t,n,i,o){this.batch=t,this.commitVersion=n,this.mutationResults=i,this.docVersions=o}static from(t,n,i){St(t.mutations.length===i.length);let o=function(){return Lx}();const s=t.mutations;for(let a=0;a=8)throw new rs(`Invalid padding: ${n}`);if(i<0)throw new rs(`Invalid hash count: ${i}`);if(t.length>0&&this.hashCount===0)throw new rs(`Invalid hash count: ${i}`);if(t.length===0&&n!==0)throw new rs(`Invalid padding when bitmap length is 0: ${n}`);this.Te=8*t.length-n,this.Ee=Qr.fromNumber(this.Te)}de(t,n,i){let o=t.add(n.multiply(Qr.fromNumber(i)));return o.compare(Hx)===1&&(o=new Qr([o.getBits(0),o.getBits(1)],0)),o.modulo(this.Ee).toNumber()}Ae(t){return(this.bitmap[Math.floor(t/8)]&1<a.insert(c)),a}insert(t){if(this.Te===0)return;const n=_v(t),[i,o]=gv(n);for(let s=0;s0&&(this.Se=!0,this.ye=t)}ve(){let t=st(),n=st(),i=st();return this.pe.forEach((o,s)=>{switch(s){case 0:t=t.add(o);break;case 2:n=n.add(o);break;case 1:i=i.add(o);break;default:K()}}),new ga(this.ye,this.we,t,n,i)}Fe(){this.Se=!1,this.pe=wv()}Me(t,n){this.Se=!0,this.pe=this.pe.insert(t,n)}xe(t){this.Se=!0,this.pe=this.pe.remove(t)}Oe(){this.ge+=1}Ne(){this.ge-=1,St(this.ge>=0)}Be(){this.Se=!0,this.we=!0}}class Zx{constructor(t){this.Le=t,this.ke=new Map,this.qe=Kn(),this.Qe=yv(),this.Ke=new Dt(_t)}$e(t){for(const n of t.Ve)t.me&&t.me.isFoundDocument()?this.Ue(n,t.me):this.We(n,t.key,t.me);for(const n of t.removedTargetIds)this.We(n,t.key,t.me)}Ge(t){this.forEachTarget(t,n=>{const i=this.ze(n);switch(t.state){case 0:this.je(n)&&i.Ce(t.resumeToken);break;case 1:i.Ne(),i.be||i.Fe(),i.Ce(t.resumeToken);break;case 2:i.Ne(),i.be||this.removeTarget(n);break;case 3:this.je(n)&&(i.Be(),i.Ce(t.resumeToken));break;case 4:this.je(n)&&(this.He(n),i.Ce(t.resumeToken));break;default:K()}})}forEachTarget(t,n){t.targetIds.length>0?t.targetIds.forEach(n):this.ke.forEach((i,o)=>{this.je(o)&&n(o)})}Je(t){const n=t.targetId,i=t.fe.count,o=this.Ye(n);if(o){const s=o.target;if(Jf(s))if(i===0){const a=new G(s.path);this.We(n,a,ge.newNoDocument(a,J.min()))}else St(i===1);else{const a=this.Ze(n);if(a!==i){const c=this.Xe(t),h=c?this.et(c,t,a):1;if(h!==0){this.He(n);const d=h===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ke=this.Ke.insert(n,d)}}}}}Xe(t){const n=t.fe.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:i="",padding:o=0},hashCount:s=0}=n;let a,c;try{a=ar(i).toUint8Array()}catch(h){if(h instanceof x1)return so("Decoding the base64 bloom filter in existence filter failed ("+h.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw h}try{c=new Wp(a,o,s)}catch(h){return so(h instanceof rs?"BloomFilter error: ":"Applying bloom filter failed: ",h),null}return c.Te===0?null:c}et(t,n,i){return n.fe.count===i-this.rt(t,n.targetId)?0:2}rt(t,n){const i=this.Le.getRemoteKeysForTarget(n);let o=0;return i.forEach(s=>{const a=this.Le.nt(),c=`projects/${a.projectId}/databases/${a.database}/documents/${s.path.canonicalString()}`;t.mightContain(c)||(this.We(n,s,null),o++)}),o}it(t){const n=new Map;this.ke.forEach((s,a)=>{const c=this.Ye(a);if(c){if(s.current&&Jf(c.target)){const h=new G(c.target.path);this.qe.get(h)!==null||this.st(a,h)||this.We(a,h,ge.newNoDocument(h,t))}s.De&&(n.set(a,s.ve()),s.Fe())}});let i=st();this.Qe.forEach((s,a)=>{let c=!0;a.forEachWhile(h=>{const d=this.Ye(h);return!d||d.purpose==="TargetPurposeLimboResolution"||(c=!1,!1)}),c&&(i=i.add(s))}),this.qe.forEach((s,a)=>a.setReadTime(t));const o=new ic(t,n,this.Ke,this.qe,i);return this.qe=Kn(),this.Qe=yv(),this.Ke=new Dt(_t),o}Ue(t,n){if(!this.je(t))return;const i=this.st(t,n.key)?2:0;this.ze(t).Me(n.key,i),this.qe=this.qe.insert(n.key,n),this.Qe=this.Qe.insert(n.key,this.ot(n.key).add(t))}We(t,n,i){if(!this.je(t))return;const o=this.ze(t);this.st(t,n)?o.Me(n,1):o.xe(n),this.Qe=this.Qe.insert(n,this.ot(n).delete(t)),i&&(this.qe=this.qe.insert(n,i))}removeTarget(t){this.ke.delete(t)}Ze(t){const n=this.ze(t).ve();return this.Le.getRemoteKeysForTarget(t).size+n.addedDocuments.size-n.removedDocuments.size}Oe(t){this.ze(t).Oe()}ze(t){let n=this.ke.get(t);return n||(n=new vv,this.ke.set(t,n)),n}ot(t){let n=this.Qe.get(t);return n||(n=new ce(_t),this.Qe=this.Qe.insert(t,n)),n}je(t){const n=this.Ye(t)!==null;return n||b("WatchChangeAggregator","Detected inactive target",t),n}Ye(t){const n=this.ke.get(t);return n&&n.be?null:this.Le._t(t)}He(t){this.ke.set(t,new vv),this.Le.getRemoteKeysForTarget(t).forEach(n=>{this.We(t,n,null)})}st(t,n){return this.Le.getRemoteKeysForTarget(t).has(n)}}function yv(){return new Dt(G.comparator)}function wv(){return new Dt(G.comparator)}const Wx={asc:"ASCENDING",desc:"DESCENDING"},Gx={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},qx={and:"AND",or:"OR"};class Kx{constructor(t,n){this.databaseId=t,this.useProto3Json=n}}function ed(e,t){return e.useProto3Json||Xl(t)?t:{value:t}}function dl(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function J1(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function Qx(e,t){return dl(e,t.toTimestamp())}function xn(e){return St(!!e),J.fromTimestamp(function(n){const i=Ci(n);return new qt(i.seconds,i.nanos)}(e))}function Gp(e,t){return nd(e,t).canonicalString()}function nd(e,t){const n=function(o){return new xt(["projects",o.projectId,"databases",o.database])}(e).child("documents");return t===void 0?n:n.child(t)}function tE(e){const t=xt.fromString(e);return St(oE(t)),t}function id(e,t){return Gp(e.databaseId,t.path)}function Rh(e,t){const n=tE(t);if(n.get(1)!==e.databaseId.projectId)throw new H(D.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new H(D.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new G(nE(n))}function eE(e,t){return Gp(e.databaseId,t)}function Xx(e){const t=tE(e);return t.length===4?xt.emptyPath():nE(t)}function rd(e){return new xt(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function nE(e){return St(e.length>4&&e.get(4)==="documents"),e.popFirst(5)}function Ev(e,t,n){return{name:id(e,t),fields:n.value.mapValue.fields}}function Yx(e,t){let n;if("targetChange"in t){t.targetChange;const i=function(d){return d==="NO_CHANGE"?0:d==="ADD"?1:d==="REMOVE"?2:d==="CURRENT"?3:d==="RESET"?4:K()}(t.targetChange.targetChangeType||"NO_CHANGE"),o=t.targetChange.targetIds||[],s=function(d,m){return d.useProto3Json?(St(m===void 0||typeof m=="string"),Ee.fromBase64String(m||"")):(St(m===void 0||m instanceof Uint8Array),Ee.fromUint8Array(m||new Uint8Array))}(e,t.targetChange.resumeToken),a=t.targetChange.cause,c=a&&function(d){const m=d.code===void 0?D.UNKNOWN:Q1(d.code);return new H(m,d.message||"")}(a);n=new Y1(i,o,s,c||null)}else if("documentChange"in t){t.documentChange;const i=t.documentChange;i.document,i.document.name,i.document.updateTime;const o=Rh(e,i.document.name),s=xn(i.document.updateTime),a=i.document.createTime?xn(i.document.createTime):J.min(),c=new Re({mapValue:{fields:i.document.fields}}),h=ge.newFoundDocument(o,s,a,c),d=i.targetIds||[],m=i.removedTargetIds||[];n=new Su(d,m,h.key,h)}else if("documentDelete"in t){t.documentDelete;const i=t.documentDelete;i.document;const o=Rh(e,i.document),s=i.readTime?xn(i.readTime):J.min(),a=ge.newNoDocument(o,s),c=i.removedTargetIds||[];n=new Su([],c,a.key,a)}else if("documentRemove"in t){t.documentRemove;const i=t.documentRemove;i.document;const o=Rh(e,i.document),s=i.removedTargetIds||[];n=new Su([],s,o,null)}else{if(!("filter"in t))return K();{t.filter;const i=t.filter;i.targetId;const{count:o=0,unchangedNames:s}=i,a=new Ux(o,s),c=i.targetId;n=new X1(c,a)}}return n}function Jx(e,t){let n;if(t instanceof _a)n={update:Ev(e,t.key,t.value)};else if(t instanceof Hp)n={delete:id(e,t.key)};else if(t instanceof Oi)n={update:Ev(e,t.key,t.data),updateMask:uk(t.fieldMask)};else{if(!(t instanceof bx))return K();n={verify:id(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(i=>function(s,a){const c=a.transform;if(c instanceof hl)return{fieldPath:a.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(c instanceof Ys)return{fieldPath:a.field.canonicalString(),appendMissingElements:{values:c.elements}};if(c instanceof Js)return{fieldPath:a.field.canonicalString(),removeAllFromArray:{values:c.elements}};if(c instanceof fl)return{fieldPath:a.field.canonicalString(),increment:c.Ie};throw K()}(0,i))),t.precondition.isNone||(n.currentDocument=function(o,s){return s.updateTime!==void 0?{updateTime:Qx(o,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:K()}(e,t.precondition)),n}function tk(e,t){return e&&e.length>0?(St(t!==void 0),e.map(n=>function(o,s){let a=o.updateTime?xn(o.updateTime):xn(s);return a.isEqual(J.min())&&(a=xn(s)),new Nx(a,o.transformResults||[])}(n,t))):[]}function ek(e,t){return{documents:[eE(e,t.path)]}}function nk(e,t){const n={structuredQuery:{}},i=t.path;let o;t.collectionGroup!==null?(o=i,n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(o=i.popLast(),n.structuredQuery.from=[{collectionId:i.lastSegment()}]),n.parent=eE(e,o);const s=function(d){if(d.length!==0)return rE(Mn.create(d,"and"))}(t.filters);s&&(n.structuredQuery.where=s);const a=function(d){if(d.length!==0)return d.map(m=>function(v){return{field:Ir(v.field),direction:ok(v.dir)}}(m))}(t.orderBy);a&&(n.structuredQuery.orderBy=a);const c=ed(e,t.limit);return c!==null&&(n.structuredQuery.limit=c),t.startAt&&(n.structuredQuery.startAt=function(d){return{before:d.inclusive,values:d.position}}(t.startAt)),t.endAt&&(n.structuredQuery.endAt=function(d){return{before:!d.inclusive,values:d.position}}(t.endAt)),{ut:n,parent:o}}function ik(e){let t=Xx(e.parent);const n=e.structuredQuery,i=n.from?n.from.length:0;let o=null;if(i>0){St(i===1);const m=n.from[0];m.allDescendants?o=m.collectionId:t=t.child(m.collectionId)}let s=[];n.where&&(s=function(_){const v=iE(_);return v instanceof Mn&&O1(v)?v.getFilters():[v]}(n.where));let a=[];n.orderBy&&(a=function(_){return _.map(v=>function(C){return new cl(Lr(C.field),function(R){switch(R){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(C.direction))}(v))}(n.orderBy));let c=null;n.limit&&(c=function(_){let v;return v=typeof _=="object"?_.value:_,Xl(v)?null:v}(n.limit));let h=null;n.startAt&&(h=function(_){const v=!!_.before,y=_.values||[];return new ll(y,v)}(n.startAt));let d=null;return n.endAt&&(d=function(_){const v=!_.before,y=_.values||[];return new ll(y,v)}(n.endAt)),Ex(t,o,a,s,c,"F",h,d)}function rk(e,t){const n=function(o){switch(o){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return K()}}(t.purpose);return n==null?null:{"goog-listen-tags":n}}function iE(e){return e.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const i=Lr(n.unaryFilter.field);return Wt.create(i,"==",{doubleValue:NaN});case"IS_NULL":const o=Lr(n.unaryFilter.field);return Wt.create(o,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=Lr(n.unaryFilter.field);return Wt.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const a=Lr(n.unaryFilter.field);return Wt.create(a,"!=",{nullValue:"NULL_VALUE"});default:return K()}}(e):e.fieldFilter!==void 0?function(n){return Wt.create(Lr(n.fieldFilter.field),function(o){switch(o){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return K()}}(n.fieldFilter.op),n.fieldFilter.value)}(e):e.compositeFilter!==void 0?function(n){return Mn.create(n.compositeFilter.filters.map(i=>iE(i)),function(o){switch(o){case"AND":return"and";case"OR":return"or";default:return K()}}(n.compositeFilter.op))}(e):K()}function ok(e){return Wx[e]}function sk(e){return Gx[e]}function ak(e){return qx[e]}function Ir(e){return{fieldPath:e.canonicalString()}}function Lr(e){return ae.fromServerFormat(e.fieldPath)}function rE(e){return e instanceof Wt?function(n){if(n.op==="=="){if(av(n.value))return{unaryFilter:{field:Ir(n.field),op:"IS_NAN"}};if(sv(n.value))return{unaryFilter:{field:Ir(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(av(n.value))return{unaryFilter:{field:Ir(n.field),op:"IS_NOT_NAN"}};if(sv(n.value))return{unaryFilter:{field:Ir(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Ir(n.field),op:sk(n.op),value:n.value}}}(e):e instanceof Mn?function(n){const i=n.getFilters().map(o=>rE(o));return i.length===1?i[0]:{compositeFilter:{op:ak(n.op),filters:i}}}(e):K()}function uk(e){const t=[];return e.fields.forEach(n=>t.push(n.canonicalString())),{fieldPaths:t}}function oE(e){return e.length>=4&&e.get(0)==="projects"&&e.get(2)==="databases"}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ui{constructor(t,n,i,o,s=J.min(),a=J.min(),c=Ee.EMPTY_BYTE_STRING,h=null){this.target=t,this.targetId=n,this.purpose=i,this.sequenceNumber=o,this.snapshotVersion=s,this.lastLimboFreeSnapshotVersion=a,this.resumeToken=c,this.expectedCount=h}withSequenceNumber(t){return new ui(this.target,this.targetId,this.purpose,t,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(t,n){return new ui(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,t,null)}withExpectedCount(t){return new ui(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,t)}withLastLimboFreeSnapshotVersion(t){return new ui(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,t,this.resumeToken,this.expectedCount)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class lk{constructor(t){this.ct=t}}function ck(e){const t=ik({parent:e.parent,structuredQuery:e.structuredQuery});return e.limitType==="LAST"?td(t,t.limit,"L"):t}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class hk{constructor(){this._n=new fk}addToCollectionParentIndex(t,n){return this._n.add(n),M.resolve()}getCollectionParents(t,n){return M.resolve(this._n.getEntries(n))}addFieldIndex(t,n){return M.resolve()}deleteFieldIndex(t,n){return M.resolve()}deleteAllFieldIndexes(t){return M.resolve()}createTargetIndexes(t,n){return M.resolve()}getDocumentsMatchingTarget(t,n){return M.resolve(null)}getIndexType(t,n){return M.resolve(0)}getFieldIndexes(t,n){return M.resolve([])}getNextCollectionGroupToUpdate(t){return M.resolve(null)}getMinOffset(t,n){return M.resolve(Si.min())}getMinOffsetFromCollectionGroup(t,n){return M.resolve(Si.min())}updateCollectionGroup(t,n,i){return M.resolve()}updateIndexEntries(t,n){return M.resolve()}}class fk{constructor(){this.index={}}add(t){const n=t.lastSegment(),i=t.popLast(),o=this.index[n]||new ce(xt.comparator),s=!o.has(i);return this.index[n]=o.add(i),s}has(t){const n=t.lastSegment(),i=t.popLast(),o=this.index[n];return o&&o.has(i)}getEntries(t){return(this.index[t]||new ce(xt.comparator)).toArray()}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class co{constructor(t){this.On=t}next(){return this.On+=2,this.On}static Nn(){return new co(0)}static Bn(){return new co(-1)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class dk{constructor(){this.changes=new Po(t=>t.toString(),(t,n)=>t.isEqual(n)),this.changesApplied=!1}addEntry(t){this.assertNotApplied(),this.changes.set(t.key,t)}removeEntry(t,n){this.assertNotApplied(),this.changes.set(t,ge.newInvalidDocument(t).setReadTime(n))}getEntry(t,n){this.assertNotApplied();const i=this.changes.get(n);return i!==void 0?M.resolve(i):this.getFromCache(t,n)}getEntries(t,n){return this.getAllFromCache(t,n)}apply(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)}assertNotApplied(){}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *//** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class pk{constructor(t,n){this.overlayedDocument=t,this.mutatedFields=n}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class mk{constructor(t,n,i,o){this.remoteDocumentCache=t,this.mutationQueue=n,this.documentOverlayCache=i,this.indexManager=o}getDocument(t,n){let i=null;return this.documentOverlayCache.getOverlay(t,n).next(o=>(i=o,this.remoteDocumentCache.getEntry(t,n))).next(o=>(i!==null&&ws(i.mutation,o,be.empty(),qt.now()),o))}getDocuments(t,n){return this.remoteDocumentCache.getEntries(t,n).next(i=>this.getLocalViewOfDocuments(t,i,st()).next(()=>i))}getLocalViewOfDocuments(t,n,i=st()){const o=Qi();return this.populateOverlays(t,o,n).next(()=>this.computeViews(t,n,o,i).next(s=>{let a=is();return s.forEach((c,h)=>{a=a.insert(c,h.overlayedDocument)}),a}))}getOverlayedDocuments(t,n){const i=Qi();return this.populateOverlays(t,i,n).next(()=>this.computeViews(t,n,i,st()))}populateOverlays(t,n,i){const o=[];return i.forEach(s=>{n.has(s)||o.push(s)}),this.documentOverlayCache.getOverlays(t,o).next(s=>{s.forEach((a,c)=>{n.set(a,c)})})}computeViews(t,n,i,o){let s=Kn();const a=ys(),c=function(){return ys()}();return n.forEach((h,d)=>{const m=i.get(d.key);o.has(d.key)&&(m===void 0||m.mutation instanceof Oi)?s=s.insert(d.key,d):m!==void 0?(a.set(d.key,m.mutation.getFieldMask()),ws(m.mutation,d,m.mutation.getFieldMask(),qt.now())):a.set(d.key,be.empty())}),this.recalculateAndSaveOverlays(t,s).next(h=>(h.forEach((d,m)=>a.set(d,m)),n.forEach((d,m)=>{var _;return c.set(d,new pk(m,(_=a.get(d))!==null&&_!==void 0?_:null))}),c))}recalculateAndSaveOverlays(t,n){const i=ys();let o=new Dt((a,c)=>a-c),s=st();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(t,n).next(a=>{for(const c of a)c.keys().forEach(h=>{const d=n.get(h);if(d===null)return;let m=i.get(h)||be.empty();m=c.applyToLocalView(d,m),i.set(h,m);const _=(o.get(c.batchId)||st()).add(h);o=o.insert(c.batchId,_)})}).next(()=>{const a=[],c=o.getReverseIterator();for(;c.hasNext();){const h=c.getNext(),d=h.key,m=h.value,_=U1();m.forEach(v=>{if(!s.has(v)){const y=q1(n.get(v),i.get(v));y!==null&&_.set(v,y),s=s.add(v)}}),a.push(this.documentOverlayCache.saveOverlays(t,d,_))}return M.waitFor(a)}).next(()=>i)}recalculateAndSaveOverlaysForDocumentKeys(t,n){return this.remoteDocumentCache.getEntries(t,n).next(i=>this.recalculateAndSaveOverlays(t,i))}getDocumentsMatchingQuery(t,n,i,o){return function(a){return G.isDocumentKey(a.path)&&a.collectionGroup===null&&a.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(t,n.path):Tx(n)?this.getDocumentsMatchingCollectionGroupQuery(t,n,i,o):this.getDocumentsMatchingCollectionQuery(t,n,i,o)}getNextDocuments(t,n,i,o){return this.remoteDocumentCache.getAllFromCollectionGroup(t,n,i,o).next(s=>{const a=o-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(t,n,i.largestBatchId,o-s.size):M.resolve(Qi());let c=-1,h=s;return a.next(d=>M.forEach(d,(m,_)=>(c<_.largestBatchId&&(c=_.largestBatchId),s.get(m)?M.resolve():this.remoteDocumentCache.getEntry(t,m).next(v=>{h=h.insert(m,v)}))).next(()=>this.populateOverlays(t,d,s)).next(()=>this.computeViews(t,h,d,st())).next(m=>({batchId:c,changes:F1(m)})))})}getDocumentsMatchingDocumentQuery(t,n){return this.getDocument(t,new G(n)).next(i=>{let o=is();return i.isFoundDocument()&&(o=o.insert(i.key,i)),o})}getDocumentsMatchingCollectionGroupQuery(t,n,i,o){const s=n.collectionGroup;let a=is();return this.indexManager.getCollectionParents(t,s).next(c=>M.forEach(c,h=>{const d=function(_,v){return new Yl(v,null,_.explicitOrderBy.slice(),_.filters.slice(),_.limit,_.limitType,_.startAt,_.endAt)}(n,h.child(s));return this.getDocumentsMatchingCollectionQuery(t,d,i,o).next(m=>{m.forEach((_,v)=>{a=a.insert(_,v)})})}).next(()=>a))}getDocumentsMatchingCollectionQuery(t,n,i,o){let s;return this.documentOverlayCache.getOverlaysForCollection(t,n.path,i.largestBatchId).next(a=>(s=a,this.remoteDocumentCache.getDocumentsMatchingQuery(t,n,i,s,o))).next(a=>{s.forEach((h,d)=>{const m=d.getKey();a.get(m)===null&&(a=a.insert(m,ge.newInvalidDocument(m)))});let c=is();return a.forEach((h,d)=>{const m=s.get(h);m!==void 0&&ws(m.mutation,d,be.empty(),qt.now()),tc(n,d)&&(c=c.insert(h,d))}),c})}}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class _k{constructor(t){this.serializer=t,this.cr=new Map,this.lr=new Map}getBundleMetadata(t,n){return M.resolve(this.cr.get(n))}saveBundleMetadata(t,n){return this.cr.set(n.id,function(o){return{id:o.id,version:o.version,createTime:xn(o.createTime)}}(n)),M.resolve()}getNamedQuery(t,n){return M.resolve(this.lr.get(n))}saveNamedQuery(t,n){return this.lr.set(n.name,function(o){return{name:o.name,query:ck(o.bundledQuery),readTime:xn(o.readTime)}}(n)),M.resolve()}}/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class gk{constructor(){this.overlays=new Dt(G.comparator),this.hr=new Map}getOverlay(t,n){return M.resolve(this.overlays.get(n))}getOverlays(t,n){const i=Qi();return M.forEach(n,o=>this.getOverlay(t,o).next(s=>{s!==null&&i.set(o,s)})).next(()=>i)}saveOverlays(t,n,i){return i.forEach((o,s)=>{this.ht(t,n,s)}),M.resolve()}removeOverlaysForBatchId(t,n,i){const o=this.hr.get(i);return o!==void 0&&(o.forEach(s=>this.overlays=this.overlays.remove(s)),this.hr.delete(i)),M.resolve()}getOverlaysForCollection(t,n,i){const o=Qi(),s=n.length+1,a=new G(n.child("")),c=this.overlays.getIteratorFrom(a);for(;c.hasNext();){const h=c.getNext().value,d=h.getKey();if(!n.isPrefixOf(d.path))break;d.path.length===s&&h.largestBatchId>i&&o.set(h.getKey(),h)}return M.resolve(o)}getOverlaysForCollectionGroup(t,n,i,o){let s=new Dt((d,m)=>d-m);const a=this.overlays.getIterator();for(;a.hasNext();){const d=a.getNext().value;if(d.getKey().getCollectionGroup()===n&&d.largestBatchId>i){let m=s.get(d.largestBatchId);m===null&&(m=Qi(),s=s.insert(d.largestBatchId,m)),m.set(d.getKey(),d)}}const c=Qi(),h=s.getIterator();for(;h.hasNext()&&(h.getNext().value.forEach((d,m)=>c.set(d,m)),!(c.size()>=o)););return M.resolve(c)}ht(t,n,i){const o=this.overlays.get(i.key);if(o!==null){const a=this.hr.get(o.largestBatchId).delete(i.key);this.hr.set(o.largestBatchId,a)}this.overlays=this.overlays.insert(i.key,new Fx(n,i));let s=this.hr.get(n);s===void 0&&(s=st(),this.hr.set(n,s)),this.hr.set(n,s.add(i.key))}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qp{constructor(){this.Pr=new ce(Xt.Ir),this.Tr=new ce(Xt.Er)}isEmpty(){return this.Pr.isEmpty()}addReference(t,n){const i=new Xt(t,n);this.Pr=this.Pr.add(i),this.Tr=this.Tr.add(i)}dr(t,n){t.forEach(i=>this.addReference(i,n))}removeReference(t,n){this.Ar(new Xt(t,n))}Rr(t,n){t.forEach(i=>this.removeReference(i,n))}Vr(t){const n=new G(new xt([])),i=new Xt(n,t),o=new Xt(n,t+1),s=[];return this.Tr.forEachInRange([i,o],a=>{this.Ar(a),s.push(a.key)}),s}mr(){this.Pr.forEach(t=>this.Ar(t))}Ar(t){this.Pr=this.Pr.delete(t),this.Tr=this.Tr.delete(t)}gr(t){const n=new G(new xt([])),i=new Xt(n,t),o=new Xt(n,t+1);let s=st();return this.Tr.forEachInRange([i,o],a=>{s=s.add(a.key)}),s}containsKey(t){const n=new Xt(t,0),i=this.Pr.firstAfterOrEqual(n);return i!==null&&t.isEqual(i.key)}}class Xt{constructor(t,n){this.key=t,this.pr=n}static Ir(t,n){return G.comparator(t.key,n.key)||_t(t.pr,n.pr)}static Er(t,n){return _t(t.pr,n.pr)||G.comparator(t.key,n.key)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class vk{constructor(t,n){this.indexManager=t,this.referenceDelegate=n,this.mutationQueue=[],this.yr=1,this.wr=new ce(Xt.Ir)}checkEmpty(t){return M.resolve(this.mutationQueue.length===0)}addMutationBatch(t,n,i,o){const s=this.yr;this.yr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const a=new Bx(s,n,i,o);this.mutationQueue.push(a);for(const c of o)this.wr=this.wr.add(new Xt(c.key,s)),this.indexManager.addToCollectionParentIndex(t,c.key.path.popLast());return M.resolve(a)}lookupMutationBatch(t,n){return M.resolve(this.Sr(n))}getNextMutationBatchAfterBatchId(t,n){const i=n+1,o=this.br(i),s=o<0?0:o;return M.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return M.resolve(this.mutationQueue.length===0?-1:this.yr-1)}getAllMutationBatches(t){return M.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(t,n){const i=new Xt(n,0),o=new Xt(n,Number.POSITIVE_INFINITY),s=[];return this.wr.forEachInRange([i,o],a=>{const c=this.Sr(a.pr);s.push(c)}),M.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(t,n){let i=new ce(_t);return n.forEach(o=>{const s=new Xt(o,0),a=new Xt(o,Number.POSITIVE_INFINITY);this.wr.forEachInRange([s,a],c=>{i=i.add(c.pr)})}),M.resolve(this.Dr(i))}getAllMutationBatchesAffectingQuery(t,n){const i=n.path,o=i.length+1;let s=i;G.isDocumentKey(s)||(s=s.child(""));const a=new Xt(new G(s),0);let c=new ce(_t);return this.wr.forEachWhile(h=>{const d=h.key.path;return!!i.isPrefixOf(d)&&(d.length===o&&(c=c.add(h.pr)),!0)},a),M.resolve(this.Dr(c))}Dr(t){const n=[];return t.forEach(i=>{const o=this.Sr(i);o!==null&&n.push(o)}),n}removeMutationBatch(t,n){St(this.Cr(n.batchId,"removed")===0),this.mutationQueue.shift();let i=this.wr;return M.forEach(n.mutations,o=>{const s=new Xt(o.key,n.batchId);return i=i.delete(s),this.referenceDelegate.markPotentiallyOrphaned(t,o.key)}).next(()=>{this.wr=i})}Mn(t){}containsKey(t,n){const i=new Xt(n,0),o=this.wr.firstAfterOrEqual(i);return M.resolve(n.isEqual(o&&o.key))}performConsistencyCheck(t){return this.mutationQueue.length,M.resolve()}Cr(t,n){return this.br(t)}br(t){return this.mutationQueue.length===0?0:t-this.mutationQueue[0].batchId}Sr(t){const n=this.br(t);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class yk{constructor(t){this.vr=t,this.docs=function(){return new Dt(G.comparator)}(),this.size=0}setIndexManager(t){this.indexManager=t}addEntry(t,n){const i=n.key,o=this.docs.get(i),s=o?o.size:0,a=this.vr(n);return this.docs=this.docs.insert(i,{document:n.mutableCopy(),size:a}),this.size+=a-s,this.indexManager.addToCollectionParentIndex(t,i.path.popLast())}removeEntry(t){const n=this.docs.get(t);n&&(this.docs=this.docs.remove(t),this.size-=n.size)}getEntry(t,n){const i=this.docs.get(n);return M.resolve(i?i.document.mutableCopy():ge.newInvalidDocument(n))}getEntries(t,n){let i=Kn();return n.forEach(o=>{const s=this.docs.get(o);i=i.insert(o,s?s.document.mutableCopy():ge.newInvalidDocument(o))}),M.resolve(i)}getDocumentsMatchingQuery(t,n,i,o){let s=Kn();const a=n.path,c=new G(a.child("")),h=this.docs.getIteratorFrom(c);for(;h.hasNext();){const{key:d,value:{document:m}}=h.getNext();if(!a.isPrefixOf(d.path))break;d.path.length>a.length+1||nx(ex(m),i)<=0||(o.has(m.key)||tc(n,m))&&(s=s.insert(m.key,m.mutableCopy()))}return M.resolve(s)}getAllFromCollectionGroup(t,n,i,o){K()}Fr(t,n){return M.forEach(this.docs,i=>n(i))}newChangeBuffer(t){return new wk(this)}getSize(t){return M.resolve(this.size)}}class wk extends dk{constructor(t){super(),this.ar=t}applyChanges(t){const n=[];return this.changes.forEach((i,o)=>{o.isValidDocument()?n.push(this.ar.addEntry(t,o)):this.ar.removeEntry(i)}),M.waitFor(n)}getFromCache(t,n){return this.ar.getEntry(t,n)}getAllFromCache(t,n){return this.ar.getEntries(t,n)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ek{constructor(t){this.persistence=t,this.Mr=new Po(n=>Up(n),$p),this.lastRemoteSnapshotVersion=J.min(),this.highestTargetId=0,this.Or=0,this.Nr=new qp,this.targetCount=0,this.Br=co.Nn()}forEachTarget(t,n){return this.Mr.forEach((i,o)=>n(o)),M.resolve()}getLastRemoteSnapshotVersion(t){return M.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(t){return M.resolve(this.Or)}allocateTargetId(t){return this.highestTargetId=this.Br.next(),M.resolve(this.highestTargetId)}setTargetsMetadata(t,n,i){return i&&(this.lastRemoteSnapshotVersion=i),n>this.Or&&(this.Or=n),M.resolve()}qn(t){this.Mr.set(t.target,t);const n=t.targetId;n>this.highestTargetId&&(this.Br=new co(n),this.highestTargetId=n),t.sequenceNumber>this.Or&&(this.Or=t.sequenceNumber)}addTargetData(t,n){return this.qn(n),this.targetCount+=1,M.resolve()}updateTargetData(t,n){return this.qn(n),M.resolve()}removeTargetData(t,n){return this.Mr.delete(n.target),this.Nr.Vr(n.targetId),this.targetCount-=1,M.resolve()}removeTargets(t,n,i){let o=0;const s=[];return this.Mr.forEach((a,c)=>{c.sequenceNumber<=n&&i.get(c.targetId)===null&&(this.Mr.delete(a),s.push(this.removeMatchingKeysForTargetId(t,c.targetId)),o++)}),M.waitFor(s).next(()=>o)}getTargetCount(t){return M.resolve(this.targetCount)}getTargetData(t,n){const i=this.Mr.get(n)||null;return M.resolve(i)}addMatchingKeys(t,n,i){return this.Nr.dr(n,i),M.resolve()}removeMatchingKeys(t,n,i){this.Nr.Rr(n,i);const o=this.persistence.referenceDelegate,s=[];return o&&n.forEach(a=>{s.push(o.markPotentiallyOrphaned(t,a))}),M.waitFor(s)}removeMatchingKeysForTargetId(t,n){return this.Nr.Vr(n),M.resolve()}getMatchingKeysForTargetId(t,n){const i=this.Nr.gr(n);return M.resolve(i)}containsKey(t,n){return M.resolve(this.Nr.containsKey(n))}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Tk{constructor(t,n){this.Lr={},this.overlays={},this.kr=new zp(0),this.qr=!1,this.qr=!0,this.referenceDelegate=t(this),this.Qr=new Ek(this),this.indexManager=new hk,this.remoteDocumentCache=function(o){return new yk(o)}(i=>this.referenceDelegate.Kr(i)),this.serializer=new lk(n),this.$r=new _k(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.qr=!1,Promise.resolve()}get started(){return this.qr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(t){return this.indexManager}getDocumentOverlayCache(t){let n=this.overlays[t.toKey()];return n||(n=new gk,this.overlays[t.toKey()]=n),n}getMutationQueue(t,n){let i=this.Lr[t.toKey()];return i||(i=new vk(n,this.referenceDelegate),this.Lr[t.toKey()]=i),i}getTargetCache(){return this.Qr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.$r}runTransaction(t,n,i){b("MemoryPersistence","Starting transaction:",t);const o=new Pk(this.kr.next());return this.referenceDelegate.Ur(),i(o).next(s=>this.referenceDelegate.Wr(o).next(()=>s)).toPromise().then(s=>(o.raiseOnCommittedEvent(),s))}Gr(t,n){return M.or(Object.values(this.Lr).map(i=>()=>i.containsKey(t,n)))}}class Pk extends rx{constructor(t){super(),this.currentSequenceNumber=t}}class Kp{constructor(t){this.persistence=t,this.zr=new qp,this.jr=null}static Hr(t){return new Kp(t)}get Jr(){if(this.jr)return this.jr;throw K()}addReference(t,n,i){return this.zr.addReference(i,n),this.Jr.delete(i.toString()),M.resolve()}removeReference(t,n,i){return this.zr.removeReference(i,n),this.Jr.add(i.toString()),M.resolve()}markPotentiallyOrphaned(t,n){return this.Jr.add(n.toString()),M.resolve()}removeTarget(t,n){this.zr.Vr(n.targetId).forEach(o=>this.Jr.add(o.toString()));const i=this.persistence.getTargetCache();return i.getMatchingKeysForTargetId(t,n.targetId).next(o=>{o.forEach(s=>this.Jr.add(s.toString()))}).next(()=>i.removeTargetData(t,n))}Ur(){this.jr=new Set}Wr(t){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return M.forEach(this.Jr,i=>{const o=G.fromPath(i);return this.Yr(t,o).next(s=>{s||n.removeEntry(o,J.min())})}).next(()=>(this.jr=null,n.apply(t)))}updateLimboDocument(t,n){return this.Yr(t,n).next(i=>{i?this.Jr.delete(n.toString()):this.Jr.add(n.toString())})}Kr(t){return 0}Yr(t,n){return M.or([()=>M.resolve(this.zr.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(t,n),()=>this.persistence.Gr(t,n)])}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Qp{constructor(t,n,i,o){this.targetId=t,this.fromCache=n,this.qi=i,this.Qi=o}static Ki(t,n){let i=st(),o=st();for(const s of n.docChanges)switch(s.type){case 0:i=i.add(s.doc.key);break;case 1:o=o.add(s.doc.key)}return new Qp(t,n.fromCache,i,o)}}/** + * @license + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Sk{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(t){this._documentReadCount+=t}}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ck{constructor(){this.$i=!1,this.Ui=!1,this.Wi=100,this.Gi=function(){return II()?8:Ki.v(Ju())>0?6:4}()}initialize(t,n){this.zi=t,this.indexManager=n,this.$i=!0}getDocumentsMatchingQuery(t,n,i,o){const s={result:null};return this.ji(t,n).next(a=>{s.result=a}).next(()=>{if(!s.result)return this.Hi(t,n,o,i).next(a=>{s.result=a})}).next(()=>{if(s.result)return;const a=new Sk;return this.Ji(t,n,a).next(c=>{if(s.result=c,this.Ui)return this.Yi(t,n,a,c.size)})}).next(()=>s.result)}Yi(t,n,i,o){return i.documentReadCountthis.Gi*o?(Qo()<=ft.DEBUG&&b("QueryEngine","The SDK decides to create cache indexes for query:",Cr(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(t,An(n))):M.resolve())}ji(t,n){if(hv(n))return M.resolve(null);let i=An(n);return this.indexManager.getIndexType(t,i).next(o=>o===0?null:(n.limit!==null&&o===1&&(n=td(n,null,"F"),i=An(n)),this.indexManager.getDocumentsMatchingTarget(t,i).next(s=>{const a=st(...s);return this.zi.getDocuments(t,a).next(c=>this.indexManager.getMinOffset(t,i).next(h=>{const d=this.Zi(n,c);return this.Xi(n,d,a,h.readTime)?this.ji(t,td(n,null,"F")):this.es(t,d,n,h)}))})))}Hi(t,n,i,o){return hv(n)||o.isEqual(J.min())?M.resolve(null):this.zi.getDocuments(t,i).next(s=>{const a=this.Zi(n,s);return this.Xi(n,a,i,o)?M.resolve(null):(Qo()<=ft.DEBUG&&b("QueryEngine","Re-using previous result from %s to execute query: %s",o.toString(),Cr(n)),this.es(t,a,n,tx(o,-1)).next(c=>c))})}Zi(t,n){let i=new ce(b1(t));return n.forEach((o,s)=>{tc(t,s)&&(i=i.add(s))}),i}Xi(t,n,i,o){if(t.limit===null)return!1;if(i.size!==n.size)return!0;const s=t.limitType==="F"?n.last():n.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(o)>0)}Ji(t,n,i){return Qo()<=ft.DEBUG&&b("QueryEngine","Using full collection scan to execute query:",Cr(n)),this.zi.getDocumentsMatchingQuery(t,n,Si.min(),i)}es(t,n,i,o){return this.zi.getDocumentsMatchingQuery(t,i,o).next(s=>(n.forEach(a=>{s=s.insert(a.key,a)}),s))}}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ik{constructor(t,n,i,o){this.persistence=t,this.ts=n,this.serializer=o,this.ns=new Dt(_t),this.rs=new Po(s=>Up(s),$p),this.ss=new Map,this.os=t.getRemoteDocumentCache(),this.Qr=t.getTargetCache(),this.$r=t.getBundleCache(),this._s(i)}_s(t){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(t),this.indexManager=this.persistence.getIndexManager(t),this.mutationQueue=this.persistence.getMutationQueue(t,this.indexManager),this.localDocuments=new mk(this.os,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.os.setIndexManager(this.indexManager),this.ts.initialize(this.localDocuments,this.indexManager)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>t.collect(n,this.ns))}}function Lk(e,t,n,i){return new Ik(e,t,n,i)}async function sE(e,t){const n=nt(e);return await n.persistence.runTransaction("Handle user change","readonly",i=>{let o;return n.mutationQueue.getAllMutationBatches(i).next(s=>(o=s,n._s(t),n.mutationQueue.getAllMutationBatches(i))).next(s=>{const a=[],c=[];let h=st();for(const d of o){a.push(d.batchId);for(const m of d.mutations)h=h.add(m.key)}for(const d of s){c.push(d.batchId);for(const m of d.mutations)h=h.add(m.key)}return n.localDocuments.getDocuments(i,h).next(d=>({us:d,removedBatchIds:a,addedBatchIds:c}))})})}function Ak(e,t){const n=nt(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",i=>{const o=t.batch.keys(),s=n.os.newChangeBuffer({trackRemovals:!0});return function(c,h,d,m){const _=d.batch,v=_.keys();let y=M.resolve();return v.forEach(C=>{y=y.next(()=>m.getEntry(h,C)).next(S=>{const R=d.docVersions.get(C);St(R!==null),S.version.compareTo(R)<0&&(_.applyToRemoteDocument(S,d),S.isValidDocument()&&(S.setReadTime(d.commitVersion),m.addEntry(S)))})}),y.next(()=>c.mutationQueue.removeMutationBatch(h,_))}(n,i,t,s).next(()=>s.apply(i)).next(()=>n.mutationQueue.performConsistencyCheck(i)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(i,o,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(i,function(c){let h=st();for(let d=0;d0&&(h=h.add(c.batch.mutations[d].key));return h}(t))).next(()=>n.localDocuments.getDocuments(i,o))})}function aE(e){const t=nt(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",n=>t.Qr.getLastRemoteSnapshotVersion(n))}function xk(e,t){const n=nt(e),i=t.snapshotVersion;let o=n.ns;return n.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const a=n.os.newChangeBuffer({trackRemovals:!0});o=n.ns;const c=[];t.targetChanges.forEach((m,_)=>{const v=o.get(_);if(!v)return;c.push(n.Qr.removeMatchingKeys(s,m.removedDocuments,_).next(()=>n.Qr.addMatchingKeys(s,m.addedDocuments,_)));let y=v.withSequenceNumber(s.currentSequenceNumber);t.targetMismatches.get(_)!==null?y=y.withResumeToken(Ee.EMPTY_BYTE_STRING,J.min()).withLastLimboFreeSnapshotVersion(J.min()):m.resumeToken.approximateByteSize()>0&&(y=y.withResumeToken(m.resumeToken,i)),o=o.insert(_,y),function(S,R,E){return S.resumeToken.approximateByteSize()===0||R.snapshotVersion.toMicroseconds()-S.snapshotVersion.toMicroseconds()>=3e8?!0:E.addedDocuments.size+E.modifiedDocuments.size+E.removedDocuments.size>0}(v,y,m)&&c.push(n.Qr.updateTargetData(s,y))});let h=Kn(),d=st();if(t.documentUpdates.forEach(m=>{t.resolvedLimboDocuments.has(m)&&c.push(n.persistence.referenceDelegate.updateLimboDocument(s,m))}),c.push(kk(s,a,t.documentUpdates).next(m=>{h=m.cs,d=m.ls})),!i.isEqual(J.min())){const m=n.Qr.getLastRemoteSnapshotVersion(s).next(_=>n.Qr.setTargetsMetadata(s,s.currentSequenceNumber,i));c.push(m)}return M.waitFor(c).next(()=>a.apply(s)).next(()=>n.localDocuments.getLocalViewOfDocuments(s,h,d)).next(()=>h)}).then(s=>(n.ns=o,s))}function kk(e,t,n){let i=st(),o=st();return n.forEach(s=>i=i.add(s)),t.getEntries(e,i).next(s=>{let a=Kn();return n.forEach((c,h)=>{const d=s.get(c);h.isFoundDocument()!==d.isFoundDocument()&&(o=o.add(c)),h.isNoDocument()&&h.version.isEqual(J.min())?(t.removeEntry(c,h.readTime),a=a.insert(c,h)):!d.isValidDocument()||h.version.compareTo(d.version)>0||h.version.compareTo(d.version)===0&&d.hasPendingWrites?(t.addEntry(h),a=a.insert(c,h)):b("LocalStore","Ignoring outdated watch update for ",c,". Current version:",d.version," Watch version:",h.version)}),{cs:a,ls:o}})}function Rk(e,t){const n=nt(e);return n.persistence.runTransaction("Get next mutation batch","readonly",i=>(t===void 0&&(t=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(i,t)))}function Mk(e,t){const n=nt(e);return n.persistence.runTransaction("Allocate target","readwrite",i=>{let o;return n.Qr.getTargetData(i,t).next(s=>s?(o=s,M.resolve(o)):n.Qr.allocateTargetId(i).next(a=>(o=new ui(t,a,"TargetPurposeListen",i.currentSequenceNumber),n.Qr.addTargetData(i,o).next(()=>o))))}).then(i=>{const o=n.ns.get(i.targetId);return(o===null||i.snapshotVersion.compareTo(o.snapshotVersion)>0)&&(n.ns=n.ns.insert(i.targetId,i),n.rs.set(t,i.targetId)),i})}async function od(e,t,n){const i=nt(e),o=i.ns.get(t),s=n?"readwrite":"readwrite-primary";try{n||await i.persistence.runTransaction("Release target",s,a=>i.persistence.referenceDelegate.removeTarget(a,o))}catch(a){if(!ma(a))throw a;b("LocalStore",`Failed to update sequence numbers for target ${t}: ${a}`)}i.ns=i.ns.remove(t),i.rs.delete(o.target)}function Tv(e,t,n){const i=nt(e);let o=J.min(),s=st();return i.persistence.runTransaction("Execute query","readwrite",a=>function(h,d,m){const _=nt(h),v=_.rs.get(m);return v!==void 0?M.resolve(_.ns.get(v)):_.Qr.getTargetData(d,m)}(i,a,An(t)).next(c=>{if(c)return o=c.lastLimboFreeSnapshotVersion,i.Qr.getMatchingKeysForTargetId(a,c.targetId).next(h=>{s=h})}).next(()=>i.ts.getDocumentsMatchingQuery(a,t,n?o:J.min(),n?s:st())).next(c=>(Ok(i,Sx(t),c),{documents:c,hs:s})))}function Ok(e,t,n){let i=e.ss.get(t)||J.min();n.forEach((o,s)=>{s.readTime.compareTo(i)>0&&(i=s.readTime)}),e.ss.set(t,i)}class Pv{constructor(){this.activeTargetIds=kx()}As(t){this.activeTargetIds=this.activeTargetIds.add(t)}Rs(t){this.activeTargetIds=this.activeTargetIds.delete(t)}ds(){const t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)}}class Dk{constructor(){this.no=new Pv,this.ro={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,n,i){}addLocalQueryTarget(t){return this.no.As(t),this.ro[t]||"not-current"}updateQueryState(t,n,i){this.ro[t]=n}removeLocalQueryTarget(t){this.no.Rs(t)}isLocalQueryTarget(t){return this.no.activeTargetIds.has(t)}clearQueryState(t){delete this.ro[t]}getAllActiveQueryTargets(){return this.no.activeTargetIds}isActiveQueryTarget(t){return this.no.activeTargetIds.has(t)}start(){return this.no=new Pv,Promise.resolve()}handleUserChange(t,n,i){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(t){}}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Nk{io(t){}shutdown(){}}/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Sv{constructor(){this.so=()=>this.oo(),this._o=()=>this.ao(),this.uo=[],this.co()}io(t){this.uo.push(t)}shutdown(){window.removeEventListener("online",this.so),window.removeEventListener("offline",this._o)}co(){window.addEventListener("online",this.so),window.addEventListener("offline",this._o)}oo(){b("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const t of this.uo)t(0)}ao(){b("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const t of this.uo)t(1)}static D(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/** + * @license + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */let lu=null;function Mh(){return lu===null?lu=function(){return 268435456+Math.round(2147483648*Math.random())}():lu++,"0x"+lu.toString(16)}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Vk={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class zk{constructor(t){this.lo=t.lo,this.ho=t.ho}Po(t){this.Io=t}To(t){this.Eo=t}onMessage(t){this.Ao=t}close(){this.ho()}send(t){this.lo(t)}Ro(){this.Io()}Vo(t){this.Eo(t)}mo(t){this.Ao(t)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const pe="WebChannelConnection";class bk extends class{constructor(n){this.databaseInfo=n,this.databaseId=n.databaseId;const i=n.ssl?"https":"http",o=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.fo=i+"://"+n.host,this.po=`projects/${o}/databases/${s}`,this.yo=this.databaseId.database==="(default)"?`project_id=${o}`:`project_id=${o}&database_id=${s}`}get wo(){return!1}So(n,i,o,s,a){const c=Mh(),h=this.bo(n,i.toUriEncodedString());b("RestConnection",`Sending RPC '${n}' ${c}:`,h,o);const d={"google-cloud-resource-prefix":this.po,"x-goog-request-params":this.yo};return this.Do(d,s,a),this.Co(n,h,d,o).then(m=>(b("RestConnection",`Received RPC '${n}' ${c}: `,m),m),m=>{throw so("RestConnection",`RPC '${n}' ${c} failed with error: `,m,"url: ",h,"request:",o),m})}vo(n,i,o,s,a,c){return this.So(n,i,o,s,a)}Do(n,i,o){n["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+To}(),n["Content-Type"]="text/plain",this.databaseInfo.appId&&(n["X-Firebase-GMPID"]=this.databaseInfo.appId),i&&i.headers.forEach((s,a)=>n[a]=s),o&&o.headers.forEach((s,a)=>n[a]=s)}bo(n,i){const o=Vk[n];return`${this.fo}/v1/${i}:${o}`}terminate(){}}{constructor(t){super(t),this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams,this.longPollingOptions=t.longPollingOptions}Co(t,n,i,o){const s=Mh();return new Promise((a,c)=>{const h=new jA;h.setWithCredentials(!0),h.listenOnce(UA.COMPLETE,()=>{try{switch(h.getLastErrorCode()){case kh.NO_ERROR:const m=h.getResponseJson();b(pe,`XHR for RPC '${t}' ${s} received:`,JSON.stringify(m)),a(m);break;case kh.TIMEOUT:b(pe,`RPC '${t}' ${s} timed out`),c(new H(D.DEADLINE_EXCEEDED,"Request time out"));break;case kh.HTTP_ERROR:const _=h.getStatus();if(b(pe,`RPC '${t}' ${s} failed with status:`,_,"response text:",h.getResponseText()),_>0){let v=h.getResponseJson();Array.isArray(v)&&(v=v[0]);const y=v==null?void 0:v.error;if(y&&y.status&&y.message){const C=function(R){const E=R.toLowerCase().replace(/_/g,"-");return Object.values(D).indexOf(E)>=0?E:D.UNKNOWN}(y.status);c(new H(C,y.message))}else c(new H(D.UNKNOWN,"Server responded with status "+h.getStatus()))}else c(new H(D.UNAVAILABLE,"Connection failed."));break;default:K()}}finally{b(pe,`RPC '${t}' ${s} completed.`)}});const d=JSON.stringify(o);b(pe,`RPC '${t}' ${s} sending request:`,o),h.send(n,"POST",d,i,15)})}Fo(t,n,i){const o=Mh(),s=[this.fo,"/","google.firestore.v1.Firestore","/",t,"/channel"],a=BA(),c=FA(),h={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},d=this.longPollingOptions.timeoutSeconds;d!==void 0&&(h.longPollingTimeout=Math.round(1e3*d)),this.useFetchStreams&&(h.useFetchStreams=!0),this.Do(h.initMessageHeaders,n,i),h.encodeInitMessageHeaders=!0;const m=s.join("");b(pe,`Creating RPC '${t}' stream ${o}: ${m}`,h);const _=a.createWebChannel(m,h);let v=!1,y=!1;const C=new zk({lo:R=>{y?b(pe,`Not sending because RPC '${t}' stream ${o} is closed:`,R):(v||(b(pe,`Opening RPC '${t}' stream ${o} transport.`),_.open(),v=!0),b(pe,`RPC '${t}' stream ${o} sending:`,R),_.send(R))},ho:()=>_.close()}),S=(R,E,w)=>{R.listen(E,P=>{try{w(P)}catch(x){setTimeout(()=>{throw x},0)}})};return S(_,su.EventType.OPEN,()=>{y||b(pe,`RPC '${t}' stream ${o} transport opened.`)}),S(_,su.EventType.CLOSE,()=>{y||(y=!0,b(pe,`RPC '${t}' stream ${o} transport closed`),C.Vo())}),S(_,su.EventType.ERROR,R=>{y||(y=!0,so(pe,`RPC '${t}' stream ${o} transport errored:`,R),C.Vo(new H(D.UNAVAILABLE,"The operation could not be completed")))}),S(_,su.EventType.MESSAGE,R=>{var E;if(!y){const w=R.data[0];St(!!w);const P=w,x=P.error||((E=P[0])===null||E===void 0?void 0:E.error);if(x){b(pe,`RPC '${t}' stream ${o} received error:`,x);const V=x.status;let F=function(wt){const it=Ut[wt];if(it!==void 0)return Q1(it)}(V),j=x.message;F===void 0&&(F=D.INTERNAL,j="Unknown error status: "+V+" with message "+x.message),y=!0,C.Vo(new H(F,j)),_.close()}else b(pe,`RPC '${t}' stream ${o} received:`,w),C.mo(w)}}),S(c,$A.STAT_EVENT,R=>{R.stat===tv.PROXY?b(pe,`RPC '${t}' stream ${o} detected buffering proxy`):R.stat===tv.NOPROXY&&b(pe,`RPC '${t}' stream ${o} detected no buffering proxy`)}),setTimeout(()=>{C.Ro()},0),C}}function Oh(){return typeof document<"u"?document:null}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function rc(e){return new Kx(e,!0)}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class uE{constructor(t,n,i=1e3,o=1.5,s=6e4){this.oi=t,this.timerId=n,this.Mo=i,this.xo=o,this.Oo=s,this.No=0,this.Bo=null,this.Lo=Date.now(),this.reset()}reset(){this.No=0}ko(){this.No=this.Oo}qo(t){this.cancel();const n=Math.floor(this.No+this.Qo()),i=Math.max(0,Date.now()-this.Lo),o=Math.max(0,n-i);o>0&&b("ExponentialBackoff",`Backing off for ${o} ms (base delay: ${this.No} ms, delay with jitter: ${n} ms, last attempt: ${i} ms ago)`),this.Bo=this.oi.enqueueAfterDelay(this.timerId,o,()=>(this.Lo=Date.now(),t())),this.No*=this.xo,this.Nothis.Oo&&(this.No=this.Oo)}Ko(){this.Bo!==null&&(this.Bo.skipDelay(),this.Bo=null)}cancel(){this.Bo!==null&&(this.Bo.cancel(),this.Bo=null)}Qo(){return(Math.random()-.5)*this.No}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class lE{constructor(t,n,i,o,s,a,c,h){this.oi=t,this.$o=i,this.Uo=o,this.connection=s,this.authCredentialsProvider=a,this.appCheckCredentialsProvider=c,this.listener=h,this.state=0,this.Wo=0,this.Go=null,this.zo=null,this.stream=null,this.jo=new uE(t,n)}Ho(){return this.state===1||this.state===5||this.Jo()}Jo(){return this.state===2||this.state===3}start(){this.state!==4?this.auth():this.Yo()}async stop(){this.Ho()&&await this.close(0)}Zo(){this.state=0,this.jo.reset()}Xo(){this.Jo()&&this.Go===null&&(this.Go=this.oi.enqueueAfterDelay(this.$o,6e4,()=>this.e_()))}t_(t){this.n_(),this.stream.send(t)}async e_(){if(this.Jo())return this.close(0)}n_(){this.Go&&(this.Go.cancel(),this.Go=null)}r_(){this.zo&&(this.zo.cancel(),this.zo=null)}async close(t,n){this.n_(),this.r_(),this.jo.cancel(),this.Wo++,t!==4?this.jo.reset():n&&n.code===D.RESOURCE_EXHAUSTED?(kn(n.toString()),kn("Using maximum backoff delay to prevent overloading the backend."),this.jo.ko()):n&&n.code===D.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.i_(),this.stream.close(),this.stream=null),this.state=t,await this.listener.To(n)}i_(){}auth(){this.state=1;const t=this.s_(this.Wo),n=this.Wo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([i,o])=>{this.Wo===n&&this.o_(i,o)},i=>{t(()=>{const o=new H(D.UNKNOWN,"Fetching auth token failed: "+i.message);return this.__(o)})})}o_(t,n){const i=this.s_(this.Wo);this.stream=this.a_(t,n),this.stream.Po(()=>{i(()=>(this.state=2,this.zo=this.oi.enqueueAfterDelay(this.Uo,1e4,()=>(this.Jo()&&(this.state=3),Promise.resolve())),this.listener.Po()))}),this.stream.To(o=>{i(()=>this.__(o))}),this.stream.onMessage(o=>{i(()=>this.onMessage(o))})}Yo(){this.state=5,this.jo.qo(async()=>{this.state=0,this.start()})}__(t){return b("PersistentStream",`close with error: ${t}`),this.stream=null,this.close(4,t)}s_(t){return n=>{this.oi.enqueueAndForget(()=>this.Wo===t?n():(b("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class Bk extends lE{constructor(t,n,i,o,s,a){super(t,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,i,o,a),this.serializer=s}a_(t,n){return this.connection.Fo("Listen",t,n)}onMessage(t){this.jo.reset();const n=Yx(this.serializer,t),i=function(s){if(!("targetChange"in s))return J.min();const a=s.targetChange;return a.targetIds&&a.targetIds.length?J.min():a.readTime?xn(a.readTime):J.min()}(t);return this.listener.u_(n,i)}c_(t){const n={};n.database=rd(this.serializer),n.addTarget=function(s,a){let c;const h=a.target;if(c=Jf(h)?{documents:ek(s,h)}:{query:nk(s,h).ut},c.targetId=a.targetId,a.resumeToken.approximateByteSize()>0){c.resumeToken=J1(s,a.resumeToken);const d=ed(s,a.expectedCount);d!==null&&(c.expectedCount=d)}else if(a.snapshotVersion.compareTo(J.min())>0){c.readTime=dl(s,a.snapshotVersion.toTimestamp());const d=ed(s,a.expectedCount);d!==null&&(c.expectedCount=d)}return c}(this.serializer,t);const i=rk(this.serializer,t);i&&(n.labels=i),this.t_(n)}l_(t){const n={};n.database=rd(this.serializer),n.removeTarget=t,this.t_(n)}}class Fk extends lE{constructor(t,n,i,o,s,a){super(t,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,i,o,a),this.serializer=s,this.h_=!1}get P_(){return this.h_}start(){this.h_=!1,this.lastStreamToken=void 0,super.start()}i_(){this.h_&&this.I_([])}a_(t,n){return this.connection.Fo("Write",t,n)}onMessage(t){if(St(!!t.streamToken),this.lastStreamToken=t.streamToken,this.h_){this.jo.reset();const n=tk(t.writeResults,t.commitTime),i=xn(t.commitTime);return this.listener.T_(i,n)}return St(!t.writeResults||t.writeResults.length===0),this.h_=!0,this.listener.E_()}d_(){const t={};t.database=rd(this.serializer),this.t_(t)}I_(t){const n={streamToken:this.lastStreamToken,writes:t.map(i=>Jx(this.serializer,i))};this.t_(n)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Uk extends class{}{constructor(t,n,i,o){super(),this.authCredentials=t,this.appCheckCredentials=n,this.connection=i,this.serializer=o,this.A_=!1}R_(){if(this.A_)throw new H(D.FAILED_PRECONDITION,"The client has already been terminated.")}So(t,n,i,o){return this.R_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,a])=>this.connection.So(t,nd(n,i),o,s,a)).catch(s=>{throw s.name==="FirebaseError"?(s.code===D.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new H(D.UNKNOWN,s.toString())})}vo(t,n,i,o,s){return this.R_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([a,c])=>this.connection.vo(t,nd(n,i),o,a,c,s)).catch(a=>{throw a.name==="FirebaseError"?(a.code===D.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),a):new H(D.UNKNOWN,a.toString())})}terminate(){this.A_=!0,this.connection.terminate()}}class $k{constructor(t,n){this.asyncQueue=t,this.onlineStateHandler=n,this.state="Unknown",this.m_=0,this.f_=null,this.g_=!0}p_(){this.m_===0&&(this.y_("Unknown"),this.f_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.f_=null,this.w_("Backend didn't respond within 10 seconds."),this.y_("Offline"),Promise.resolve())))}S_(t){this.state==="Online"?this.y_("Unknown"):(this.m_++,this.m_>=1&&(this.b_(),this.w_(`Connection failed 1 times. Most recent error: ${t.toString()}`),this.y_("Offline")))}set(t){this.b_(),this.m_=0,t==="Online"&&(this.g_=!1),this.y_(t)}y_(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))}w_(t){const n=`Could not reach Cloud Firestore backend. ${t} +This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.g_?(kn(n),this.g_=!1):b("OnlineStateTracker",n)}b_(){this.f_!==null&&(this.f_.cancel(),this.f_=null)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class jk{constructor(t,n,i,o,s){this.localStore=t,this.datastore=n,this.asyncQueue=i,this.remoteSyncer={},this.D_=[],this.C_=new Map,this.v_=new Set,this.F_=[],this.M_=s,this.M_.io(a=>{i.enqueueAndForget(async()=>{dr(this)&&(b("RemoteStore","Restarting streams for network reachability change."),await async function(h){const d=nt(h);d.v_.add(4),await va(d),d.x_.set("Unknown"),d.v_.delete(4),await oc(d)}(this))})}),this.x_=new $k(i,o)}}async function oc(e){if(dr(e))for(const t of e.F_)await t(!0)}async function va(e){for(const t of e.F_)await t(!1)}function cE(e,t){const n=nt(e);n.C_.has(t.targetId)||(n.C_.set(t.targetId,t),Jp(n)?Yp(n):So(n).Jo()&&Xp(n,t))}function hE(e,t){const n=nt(e),i=So(n);n.C_.delete(t),i.Jo()&&fE(n,t),n.C_.size===0&&(i.Jo()?i.Xo():dr(n)&&n.x_.set("Unknown"))}function Xp(e,t){if(e.O_.Oe(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(J.min())>0){const n=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(n)}So(e).c_(t)}function fE(e,t){e.O_.Oe(t),So(e).l_(t)}function Yp(e){e.O_=new Zx({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),_t:t=>e.C_.get(t)||null,nt:()=>e.datastore.serializer.databaseId}),So(e).start(),e.x_.p_()}function Jp(e){return dr(e)&&!So(e).Ho()&&e.C_.size>0}function dr(e){return nt(e).v_.size===0}function dE(e){e.O_=void 0}async function Hk(e){e.C_.forEach((t,n)=>{Xp(e,t)})}async function Zk(e,t){dE(e),Jp(e)?(e.x_.S_(t),Yp(e)):e.x_.set("Unknown")}async function Wk(e,t,n){if(e.x_.set("Online"),t instanceof Y1&&t.state===2&&t.cause)try{await async function(o,s){const a=s.cause;for(const c of s.targetIds)o.C_.has(c)&&(await o.remoteSyncer.rejectListen(c,a),o.C_.delete(c),o.O_.removeTarget(c))}(e,t)}catch(i){b("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),i),await pl(e,i)}else if(t instanceof Su?e.O_.$e(t):t instanceof X1?e.O_.Je(t):e.O_.Ge(t),!n.isEqual(J.min()))try{const i=await aE(e.localStore);n.compareTo(i)>=0&&await function(s,a){const c=s.O_.it(a);return c.targetChanges.forEach((h,d)=>{if(h.resumeToken.approximateByteSize()>0){const m=s.C_.get(d);m&&s.C_.set(d,m.withResumeToken(h.resumeToken,a))}}),c.targetMismatches.forEach((h,d)=>{const m=s.C_.get(h);if(!m)return;s.C_.set(h,m.withResumeToken(Ee.EMPTY_BYTE_STRING,m.snapshotVersion)),fE(s,h);const _=new ui(m.target,h,d,m.sequenceNumber);Xp(s,_)}),s.remoteSyncer.applyRemoteEvent(c)}(e,n)}catch(i){b("RemoteStore","Failed to raise snapshot:",i),await pl(e,i)}}async function pl(e,t,n){if(!ma(t))throw t;e.v_.add(1),await va(e),e.x_.set("Offline"),n||(n=()=>aE(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{b("RemoteStore","Retrying IndexedDB access"),await n(),e.v_.delete(1),await oc(e)})}function pE(e,t){return t().catch(n=>pl(e,n,t))}async function sc(e){const t=nt(e),n=Ii(t);let i=t.D_.length>0?t.D_[t.D_.length-1].batchId:-1;for(;Gk(t);)try{const o=await Rk(t.localStore,i);if(o===null){t.D_.length===0&&n.Xo();break}i=o.batchId,qk(t,o)}catch(o){await pl(t,o)}mE(t)&&_E(t)}function Gk(e){return dr(e)&&e.D_.length<10}function qk(e,t){e.D_.push(t);const n=Ii(e);n.Jo()&&n.P_&&n.I_(t.mutations)}function mE(e){return dr(e)&&!Ii(e).Ho()&&e.D_.length>0}function _E(e){Ii(e).start()}async function Kk(e){Ii(e).d_()}async function Qk(e){const t=Ii(e);for(const n of e.D_)t.I_(n.mutations)}async function Xk(e,t,n){const i=e.D_.shift(),o=Zp.from(i,t,n);await pE(e,()=>e.remoteSyncer.applySuccessfulWrite(o)),await sc(e)}async function Yk(e,t){t&&Ii(e).P_&&await async function(i,o){if(function(a){return $x(a)&&a!==D.ABORTED}(o.code)){const s=i.D_.shift();Ii(i).Zo(),await pE(i,()=>i.remoteSyncer.rejectFailedWrite(s.batchId,o)),await sc(i)}}(e,t),mE(e)&&_E(e)}async function Cv(e,t){const n=nt(e);n.asyncQueue.verifyOperationInProgress(),b("RemoteStore","RemoteStore received new credentials");const i=dr(n);n.v_.add(3),await va(n),i&&n.x_.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.v_.delete(3),await oc(n)}async function Jk(e,t){const n=nt(e);t?(n.v_.delete(2),await oc(n)):t||(n.v_.add(2),await va(n),n.x_.set("Unknown"))}function So(e){return e.N_||(e.N_=function(n,i,o){const s=nt(n);return s.R_(),new Bk(i,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,o)}(e.datastore,e.asyncQueue,{Po:Hk.bind(null,e),To:Zk.bind(null,e),u_:Wk.bind(null,e)}),e.F_.push(async t=>{t?(e.N_.Zo(),Jp(e)?Yp(e):e.x_.set("Unknown")):(await e.N_.stop(),dE(e))})),e.N_}function Ii(e){return e.B_||(e.B_=function(n,i,o){const s=nt(n);return s.R_(),new Fk(i,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,o)}(e.datastore,e.asyncQueue,{Po:Kk.bind(null,e),To:Yk.bind(null,e),E_:Qk.bind(null,e),T_:Xk.bind(null,e)}),e.F_.push(async t=>{t?(e.B_.Zo(),await sc(e)):(await e.B_.stop(),e.D_.length>0&&(b("RemoteStore",`Stopping write stream with ${e.D_.length} pending writes`),e.D_=[]))})),e.B_}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class tm{constructor(t,n,i,o,s){this.asyncQueue=t,this.timerId=n,this.targetTimeMs=i,this.op=o,this.removalCallback=s,this.deferred=new Ln,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(a=>{})}get promise(){return this.deferred.promise}static createAndSchedule(t,n,i,o,s){const a=Date.now()+i,c=new tm(t,n,a,o,s);return c.start(i),c}start(t){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new H(D.CANCELLED,"Operation cancelled"+(t?": "+t:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(t=>this.deferred.resolve(t))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function em(e,t){if(kn("AsyncQueue",`${t}: ${e}`),ma(e))return new H(D.UNAVAILABLE,`${t}: ${e}`);throw e}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Xr{constructor(t){this.comparator=t?(n,i)=>t(n,i)||G.comparator(n.key,i.key):(n,i)=>G.comparator(n.key,i.key),this.keyedMap=is(),this.sortedSet=new Dt(this.comparator)}static emptySet(t){return new Xr(t.comparator)}has(t){return this.keyedMap.get(t)!=null}get(t){return this.keyedMap.get(t)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(t){const n=this.keyedMap.get(t);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(t){this.sortedSet.inorderTraversal((n,i)=>(t(n),!1))}add(t){const n=this.delete(t.key);return n.copy(n.keyedMap.insert(t.key,t),n.sortedSet.insert(t,null))}delete(t){const n=this.get(t);return n?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(n)):this}isEqual(t){if(!(t instanceof Xr)||this.size!==t.size)return!1;const n=this.sortedSet.getIterator(),i=t.sortedSet.getIterator();for(;n.hasNext();){const o=n.getNext().key,s=i.getNext().key;if(!o.isEqual(s))return!1}return!0}toString(){const t=[];return this.forEach(n=>{t.push(n.toString())}),t.length===0?"DocumentSet ()":`DocumentSet ( + `+t.join(` +`)+` +)`}copy(t,n){const i=new Xr;return i.comparator=this.comparator,i.keyedMap=t,i.sortedSet=n,i}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Iv{constructor(){this.L_=new Dt(G.comparator)}track(t){const n=t.doc.key,i=this.L_.get(n);i?t.type!==0&&i.type===3?this.L_=this.L_.insert(n,t):t.type===3&&i.type!==1?this.L_=this.L_.insert(n,{type:i.type,doc:t.doc}):t.type===2&&i.type===2?this.L_=this.L_.insert(n,{type:2,doc:t.doc}):t.type===2&&i.type===0?this.L_=this.L_.insert(n,{type:0,doc:t.doc}):t.type===1&&i.type===0?this.L_=this.L_.remove(n):t.type===1&&i.type===2?this.L_=this.L_.insert(n,{type:1,doc:i.doc}):t.type===0&&i.type===1?this.L_=this.L_.insert(n,{type:2,doc:t.doc}):K():this.L_=this.L_.insert(n,t)}k_(){const t=[];return this.L_.inorderTraversal((n,i)=>{t.push(i)}),t}}class ho{constructor(t,n,i,o,s,a,c,h,d){this.query=t,this.docs=n,this.oldDocs=i,this.docChanges=o,this.mutatedKeys=s,this.fromCache=a,this.syncStateChanged=c,this.excludesMetadataChanges=h,this.hasCachedResults=d}static fromInitialDocuments(t,n,i,o,s){const a=[];return n.forEach(c=>{a.push({type:0,doc:c})}),new ho(t,n,Xr.emptySet(n),a,i,o,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(t){if(!(this.fromCache===t.fromCache&&this.hasCachedResults===t.hasCachedResults&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&Jl(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;const n=this.docChanges,i=t.docChanges;if(n.length!==i.length)return!1;for(let o=0;oz1(t),Jl),this.onlineState="Unknown",this.K_=new Set}}async function gE(e,t){const n=nt(e),i=t.query;let o=!1,s=n.queries.get(i);if(s||(o=!0,s=new tR),o)try{s.q_=await n.onListen(i)}catch(a){const c=em(a,`Initialization of query '${Cr(t.query)}' failed`);return void t.onError(c)}n.queries.set(i,s),s.Q_.push(t),t.U_(n.onlineState),s.q_&&t.W_(s.q_)&&nm(n)}async function vE(e,t){const n=nt(e),i=t.query;let o=!1;const s=n.queries.get(i);if(s){const a=s.Q_.indexOf(t);a>=0&&(s.Q_.splice(a,1),o=s.Q_.length===0)}if(o)return n.queries.delete(i),n.onUnlisten(i)}function nR(e,t){const n=nt(e);let i=!1;for(const o of t){const s=o.query,a=n.queries.get(s);if(a){for(const c of a.Q_)c.W_(o)&&(i=!0);a.q_=o}}i&&nm(n)}function iR(e,t,n){const i=nt(e),o=i.queries.get(t);if(o)for(const s of o.Q_)s.onError(n);i.queries.delete(t)}function nm(e){e.K_.forEach(t=>{t.next()})}class yE{constructor(t,n,i){this.query=t,this.G_=n,this.z_=!1,this.j_=null,this.onlineState="Unknown",this.options=i||{}}W_(t){if(!this.options.includeMetadataChanges){const i=[];for(const o of t.docChanges)o.type!==3&&i.push(o);t=new ho(t.query,t.docs,t.oldDocs,i,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0,t.hasCachedResults)}let n=!1;return this.z_?this.H_(t)&&(this.G_.next(t),n=!0):this.J_(t,this.onlineState)&&(this.Y_(t),n=!0),this.j_=t,n}onError(t){this.G_.error(t)}U_(t){this.onlineState=t;let n=!1;return this.j_&&!this.z_&&this.J_(this.j_,t)&&(this.Y_(this.j_),n=!0),n}J_(t,n){if(!t.fromCache)return!0;const i=n!=="Offline";return(!this.options.Z_||!i)&&(!t.docs.isEmpty()||t.hasCachedResults||n==="Offline")}H_(t){if(t.docChanges.length>0)return!0;const n=this.j_&&this.j_.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}Y_(t){t=ho.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache,t.hasCachedResults),this.z_=!0,this.G_.next(t)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class wE{constructor(t){this.key=t}}class EE{constructor(t){this.key=t}}class rR{constructor(t,n){this.query=t,this.oa=n,this._a=null,this.hasCachedResults=!1,this.current=!1,this.aa=st(),this.mutatedKeys=st(),this.ua=b1(t),this.ca=new Xr(this.ua)}get la(){return this.oa}ha(t,n){const i=n?n.Pa:new Iv,o=n?n.ca:this.ca;let s=n?n.mutatedKeys:this.mutatedKeys,a=o,c=!1;const h=this.query.limitType==="F"&&o.size===this.query.limit?o.last():null,d=this.query.limitType==="L"&&o.size===this.query.limit?o.first():null;if(t.inorderTraversal((m,_)=>{const v=o.get(m),y=tc(this.query,_)?_:null,C=!!v&&this.mutatedKeys.has(v.key),S=!!y&&(y.hasLocalMutations||this.mutatedKeys.has(y.key)&&y.hasCommittedMutations);let R=!1;v&&y?v.data.isEqual(y.data)?C!==S&&(i.track({type:3,doc:y}),R=!0):this.Ia(v,y)||(i.track({type:2,doc:y}),R=!0,(h&&this.ua(y,h)>0||d&&this.ua(y,d)<0)&&(c=!0)):!v&&y?(i.track({type:0,doc:y}),R=!0):v&&!y&&(i.track({type:1,doc:v}),R=!0,(h||d)&&(c=!0)),R&&(y?(a=a.add(y),s=S?s.add(m):s.delete(m)):(a=a.delete(m),s=s.delete(m)))}),this.query.limit!==null)for(;a.size>this.query.limit;){const m=this.query.limitType==="F"?a.last():a.first();a=a.delete(m.key),s=s.delete(m.key),i.track({type:1,doc:m})}return{ca:a,Pa:i,Xi:c,mutatedKeys:s}}Ia(t,n){return t.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(t,n,i,o){const s=this.ca;this.ca=t.ca,this.mutatedKeys=t.mutatedKeys;const a=t.Pa.k_();a.sort((m,_)=>function(y,C){const S=R=>{switch(R){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return K()}};return S(y)-S(C)}(m.type,_.type)||this.ua(m.doc,_.doc)),this.Ta(i),o=o!=null&&o;const c=n&&!o?this.Ea():[],h=this.aa.size===0&&this.current&&!o?1:0,d=h!==this._a;return this._a=h,a.length!==0||d?{snapshot:new ho(this.query,t.ca,s,a,t.mutatedKeys,h===0,d,!1,!!i&&i.resumeToken.approximateByteSize()>0),da:c}:{da:c}}U_(t){return this.current&&t==="Offline"?(this.current=!1,this.applyChanges({ca:this.ca,Pa:new Iv,mutatedKeys:this.mutatedKeys,Xi:!1},!1)):{da:[]}}Aa(t){return!this.oa.has(t)&&!!this.ca.has(t)&&!this.ca.get(t).hasLocalMutations}Ta(t){t&&(t.addedDocuments.forEach(n=>this.oa=this.oa.add(n)),t.modifiedDocuments.forEach(n=>{}),t.removedDocuments.forEach(n=>this.oa=this.oa.delete(n)),this.current=t.current)}Ea(){if(!this.current)return[];const t=this.aa;this.aa=st(),this.ca.forEach(i=>{this.Aa(i.key)&&(this.aa=this.aa.add(i.key))});const n=[];return t.forEach(i=>{this.aa.has(i)||n.push(new EE(i))}),this.aa.forEach(i=>{t.has(i)||n.push(new wE(i))}),n}Ra(t){this.oa=t.hs,this.aa=st();const n=this.ha(t.documents);return this.applyChanges(n,!0)}Va(){return ho.fromInitialDocuments(this.query,this.ca,this.mutatedKeys,this._a===0,this.hasCachedResults)}}class oR{constructor(t,n,i){this.query=t,this.targetId=n,this.view=i}}class sR{constructor(t){this.key=t,this.ma=!1}}class aR{constructor(t,n,i,o,s,a){this.localStore=t,this.remoteStore=n,this.eventManager=i,this.sharedClientState=o,this.currentUser=s,this.maxConcurrentLimboResolutions=a,this.fa={},this.ga=new Po(c=>z1(c),Jl),this.pa=new Map,this.ya=new Set,this.wa=new Dt(G.comparator),this.Sa=new Map,this.ba=new qp,this.Da={},this.Ca=new Map,this.va=co.Bn(),this.onlineState="Unknown",this.Fa=void 0}get isPrimaryClient(){return this.Fa===!0}}async function uR(e,t){const n=vR(e);let i,o;const s=n.ga.get(t);if(s)i=s.targetId,n.sharedClientState.addLocalQueryTarget(i),o=s.view.Va();else{const a=await Mk(n.localStore,An(t)),c=n.sharedClientState.addLocalQueryTarget(a.targetId);i=a.targetId,o=await lR(n,t,i,c==="current",a.resumeToken),n.isPrimaryClient&&cE(n.remoteStore,a)}return o}async function lR(e,t,n,i,o){e.Ma=(_,v,y)=>async function(S,R,E,w){let P=R.view.ha(E);P.Xi&&(P=await Tv(S.localStore,R.query,!1).then(({documents:j})=>R.view.ha(j,P)));const x=w&&w.targetChanges.get(R.targetId),V=w&&w.targetMismatches.get(R.targetId)!=null,F=R.view.applyChanges(P,S.isPrimaryClient,x,V);return Av(S,R.targetId,F.da),F.snapshot}(e,_,v,y);const s=await Tv(e.localStore,t,!0),a=new rR(t,s.hs),c=a.ha(s.documents),h=ga.createSynthesizedTargetChangeForCurrentChange(n,i&&e.onlineState!=="Offline",o),d=a.applyChanges(c,e.isPrimaryClient,h);Av(e,n,d.da);const m=new oR(t,n,a);return e.ga.set(t,m),e.pa.has(n)?e.pa.get(n).push(t):e.pa.set(n,[t]),d.snapshot}async function cR(e,t){const n=nt(e),i=n.ga.get(t),o=n.pa.get(i.targetId);if(o.length>1)return n.pa.set(i.targetId,o.filter(s=>!Jl(s,t))),void n.ga.delete(t);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(i.targetId),n.sharedClientState.isActiveQueryTarget(i.targetId)||await od(n.localStore,i.targetId,!1).then(()=>{n.sharedClientState.clearQueryState(i.targetId),hE(n.remoteStore,i.targetId),sd(n,i.targetId)}).catch(pa)):(sd(n,i.targetId),await od(n.localStore,i.targetId,!0))}async function hR(e,t,n){const i=yR(e);try{const o=await function(a,c){const h=nt(a),d=qt.now(),m=c.reduce((y,C)=>y.add(C.key),st());let _,v;return h.persistence.runTransaction("Locally write mutations","readwrite",y=>{let C=Kn(),S=st();return h.os.getEntries(y,m).next(R=>{C=R,C.forEach((E,w)=>{w.isValidDocument()||(S=S.add(E))})}).next(()=>h.localDocuments.getOverlayedDocuments(y,C)).next(R=>{_=R;const E=[];for(const w of c){const P=zx(w,_.get(w.key).overlayedDocument);P!=null&&E.push(new Oi(w.key,P,k1(P.value.mapValue),hn.exists(!0)))}return h.mutationQueue.addMutationBatch(y,d,E,c)}).next(R=>{v=R;const E=R.applyToLocalDocumentSet(_,S);return h.documentOverlayCache.saveOverlays(y,R.batchId,E)})}).then(()=>({batchId:v.batchId,changes:F1(_)}))}(i.localStore,t);i.sharedClientState.addPendingMutation(o.batchId),function(a,c,h){let d=a.Da[a.currentUser.toKey()];d||(d=new Dt(_t)),d=d.insert(c,h),a.Da[a.currentUser.toKey()]=d}(i,o.batchId,n),await ya(i,o.changes),await sc(i.remoteStore)}catch(o){const s=em(o,"Failed to persist write");n.reject(s)}}async function TE(e,t){const n=nt(e);try{const i=await xk(n.localStore,t);t.targetChanges.forEach((o,s)=>{const a=n.Sa.get(s);a&&(St(o.addedDocuments.size+o.modifiedDocuments.size+o.removedDocuments.size<=1),o.addedDocuments.size>0?a.ma=!0:o.modifiedDocuments.size>0?St(a.ma):o.removedDocuments.size>0&&(St(a.ma),a.ma=!1))}),await ya(n,i,t)}catch(i){await pa(i)}}function Lv(e,t,n){const i=nt(e);if(i.isPrimaryClient&&n===0||!i.isPrimaryClient&&n===1){const o=[];i.ga.forEach((s,a)=>{const c=a.view.U_(t);c.snapshot&&o.push(c.snapshot)}),function(a,c){const h=nt(a);h.onlineState=c;let d=!1;h.queries.forEach((m,_)=>{for(const v of _.Q_)v.U_(c)&&(d=!0)}),d&&nm(h)}(i.eventManager,t),o.length&&i.fa.u_(o),i.onlineState=t,i.isPrimaryClient&&i.sharedClientState.setOnlineState(t)}}async function fR(e,t,n){const i=nt(e);i.sharedClientState.updateQueryState(t,"rejected",n);const o=i.Sa.get(t),s=o&&o.key;if(s){let a=new Dt(G.comparator);a=a.insert(s,ge.newNoDocument(s,J.min()));const c=st().add(s),h=new ic(J.min(),new Map,new Dt(_t),a,c);await TE(i,h),i.wa=i.wa.remove(s),i.Sa.delete(t),im(i)}else await od(i.localStore,t,!1).then(()=>sd(i,t,n)).catch(pa)}async function dR(e,t){const n=nt(e),i=t.batch.batchId;try{const o=await Ak(n.localStore,t);SE(n,i,null),PE(n,i),n.sharedClientState.updateMutationState(i,"acknowledged"),await ya(n,o)}catch(o){await pa(o)}}async function pR(e,t,n){const i=nt(e);try{const o=await function(a,c){const h=nt(a);return h.persistence.runTransaction("Reject batch","readwrite-primary",d=>{let m;return h.mutationQueue.lookupMutationBatch(d,c).next(_=>(St(_!==null),m=_.keys(),h.mutationQueue.removeMutationBatch(d,_))).next(()=>h.mutationQueue.performConsistencyCheck(d)).next(()=>h.documentOverlayCache.removeOverlaysForBatchId(d,m,c)).next(()=>h.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(d,m)).next(()=>h.localDocuments.getDocuments(d,m))})}(i.localStore,t);SE(i,t,n),PE(i,t),i.sharedClientState.updateMutationState(t,"rejected",n),await ya(i,o)}catch(o){await pa(o)}}function PE(e,t){(e.Ca.get(t)||[]).forEach(n=>{n.resolve()}),e.Ca.delete(t)}function SE(e,t,n){const i=nt(e);let o=i.Da[i.currentUser.toKey()];if(o){const s=o.get(t);s&&(n?s.reject(n):s.resolve(),o=o.remove(t)),i.Da[i.currentUser.toKey()]=o}}function sd(e,t,n=null){e.sharedClientState.removeLocalQueryTarget(t);for(const i of e.pa.get(t))e.ga.delete(i),n&&e.fa.xa(i,n);e.pa.delete(t),e.isPrimaryClient&&e.ba.Vr(t).forEach(i=>{e.ba.containsKey(i)||CE(e,i)})}function CE(e,t){e.ya.delete(t.path.canonicalString());const n=e.wa.get(t);n!==null&&(hE(e.remoteStore,n),e.wa=e.wa.remove(t),e.Sa.delete(n),im(e))}function Av(e,t,n){for(const i of n)i instanceof wE?(e.ba.addReference(i.key,t),mR(e,i)):i instanceof EE?(b("SyncEngine","Document no longer in limbo: "+i.key),e.ba.removeReference(i.key,t),e.ba.containsKey(i.key)||CE(e,i.key)):K()}function mR(e,t){const n=t.key,i=n.path.canonicalString();e.wa.get(n)||e.ya.has(i)||(b("SyncEngine","New document in limbo: "+n),e.ya.add(i),im(e))}function im(e){for(;e.ya.size>0&&e.wa.size{a.push(i.Ma(h,t,n).then(d=>{if((d||n)&&i.isPrimaryClient&&i.sharedClientState.updateQueryState(h.targetId,d!=null&&d.fromCache?"not-current":"current"),d){o.push(d);const m=Qp.Ki(h.targetId,d);s.push(m)}}))}),await Promise.all(a),i.fa.u_(o),await async function(h,d){const m=nt(h);try{await m.persistence.runTransaction("notifyLocalViewChanges","readwrite",_=>M.forEach(d,v=>M.forEach(v.qi,y=>m.persistence.referenceDelegate.addReference(_,v.targetId,y)).next(()=>M.forEach(v.Qi,y=>m.persistence.referenceDelegate.removeReference(_,v.targetId,y)))))}catch(_){if(!ma(_))throw _;b("LocalStore","Failed to update sequence numbers: "+_)}for(const _ of d){const v=_.targetId;if(!_.fromCache){const y=m.ns.get(v),C=y.snapshotVersion,S=y.withLastLimboFreeSnapshotVersion(C);m.ns=m.ns.insert(v,S)}}}(i.localStore,s))}async function _R(e,t){const n=nt(e);if(!n.currentUser.isEqual(t)){b("SyncEngine","User change. New user:",t.toKey());const i=await sE(n.localStore,t);n.currentUser=t,function(s,a){s.Ca.forEach(c=>{c.forEach(h=>{h.reject(new H(D.CANCELLED,a))})}),s.Ca.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(t,i.removedBatchIds,i.addedBatchIds),await ya(n,i.us)}}function gR(e,t){const n=nt(e),i=n.Sa.get(t);if(i&&i.ma)return st().add(i.key);{let o=st();const s=n.pa.get(t);if(!s)return o;for(const a of s){const c=n.ga.get(a);o=o.unionWith(c.view.la)}return o}}function vR(e){const t=nt(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=TE.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=gR.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=fR.bind(null,t),t.fa.u_=nR.bind(null,t.eventManager),t.fa.xa=iR.bind(null,t.eventManager),t}function yR(e){const t=nt(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=dR.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=pR.bind(null,t),t}class xv{constructor(){this.synchronizeTabs=!1}async initialize(t){this.serializer=rc(t.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(t),this.persistence=this.createPersistence(t),await this.persistence.start(),this.localStore=this.createLocalStore(t),this.gcScheduler=this.createGarbageCollectionScheduler(t,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(t,this.localStore)}createGarbageCollectionScheduler(t,n){return null}createIndexBackfillerScheduler(t,n){return null}createLocalStore(t){return Lk(this.persistence,new Ck,t.initialUser,this.serializer)}createPersistence(t){return new Tk(Kp.Hr,this.serializer)}createSharedClientState(t){return new Dk}async terminate(){var t,n;(t=this.gcScheduler)===null||t===void 0||t.stop(),(n=this.indexBackfillerScheduler)===null||n===void 0||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class wR{async initialize(t,n){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=i=>Lv(this.syncEngine,i,1),this.remoteStore.remoteSyncer.handleCredentialChange=_R.bind(null,this.syncEngine),await Jk(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return function(){return new eR}()}createDatastore(t){const n=rc(t.databaseInfo.databaseId),i=function(s){return new bk(s)}(t.databaseInfo);return function(s,a,c,h){return new Uk(s,a,c,h)}(t.authCredentials,t.appCheckCredentials,i,n)}createRemoteStore(t){return function(i,o,s,a,c){return new jk(i,o,s,a,c)}(this.localStore,this.datastore,t.asyncQueue,n=>Lv(this.syncEngine,n,0),function(){return Sv.D()?new Sv:new Nk}())}createSyncEngine(t,n){return function(o,s,a,c,h,d,m){const _=new aR(o,s,a,c,h,d);return m&&(_.Fa=!0),_}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,n)}async terminate(){var t;await async function(i){const o=nt(i);b("RemoteStore","RemoteStore shutting down."),o.v_.add(5),await va(o),o.M_.shutdown(),o.x_.set("Unknown")}(this.remoteStore),(t=this.datastore)===null||t===void 0||t.terminate()}}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *//** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class IE{constructor(t){this.observer=t,this.muted=!1}next(t){this.observer.next&&this.Ba(this.observer.next,t)}error(t){this.observer.error?this.Ba(this.observer.error,t):kn("Uncaught Error in snapshot listener:",t.toString())}La(){this.muted=!0}Ba(t,n){this.muted||setTimeout(()=>{this.muted||t(n)},0)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ER{constructor(t,n,i,o){this.authCredentials=t,this.appCheckCredentials=n,this.asyncQueue=i,this.databaseInfo=o,this.user=me.UNAUTHENTICATED,this.clientId=L1.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(i,async s=>{b("FirestoreClient","Received user=",s.uid),await this.authCredentialListener(s),this.user=s}),this.appCheckCredentials.start(i,s=>(b("FirestoreClient","Received new app check token=",s),this.appCheckCredentialListener(s,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.authCredentialListener=t}setAppCheckTokenChangeListener(t){this.appCheckCredentialListener=t}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new H(D.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const t=new Ln;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),t.resolve()}catch(n){const i=em(n,"Failed to shutdown persistence");t.reject(i)}}),t.promise}}async function Dh(e,t){e.asyncQueue.verifyOperationInProgress(),b("FirestoreClient","Initializing OfflineComponentProvider");const n=e.configuration;await t.initialize(n);let i=n.initialUser;e.setCredentialChangeListener(async o=>{i.isEqual(o)||(await sE(t.localStore,o),i=o)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function kv(e,t){e.asyncQueue.verifyOperationInProgress();const n=await PR(e);b("FirestoreClient","Initializing OnlineComponentProvider"),await t.initialize(n,e.configuration),e.setCredentialChangeListener(i=>Cv(t.remoteStore,i)),e.setAppCheckTokenChangeListener((i,o)=>Cv(t.remoteStore,o)),e._onlineComponents=t}function TR(e){return e.name==="FirebaseError"?e.code===D.FAILED_PRECONDITION||e.code===D.UNIMPLEMENTED:!(typeof DOMException<"u"&&e instanceof DOMException)||e.code===22||e.code===20||e.code===11}async function PR(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){b("FirestoreClient","Using user provided OfflineComponentProvider");try{await Dh(e,e._uninitializedComponentsProvider._offline)}catch(t){const n=t;if(!TR(n))throw n;so("Error using user provided cache. Falling back to memory cache: "+n),await Dh(e,new xv)}}else b("FirestoreClient","Using default OfflineComponentProvider"),await Dh(e,new xv);return e._offlineComponents}async function LE(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(b("FirestoreClient","Using user provided OnlineComponentProvider"),await kv(e,e._uninitializedComponentsProvider._online)):(b("FirestoreClient","Using default OnlineComponentProvider"),await kv(e,new wR))),e._onlineComponents}function SR(e){return LE(e).then(t=>t.syncEngine)}async function AE(e){const t=await LE(e),n=t.eventManager;return n.onListen=uR.bind(null,t.syncEngine),n.onUnlisten=cR.bind(null,t.syncEngine),n}function CR(e,t,n={}){const i=new Ln;return e.asyncQueue.enqueueAndForget(async()=>function(s,a,c,h,d){const m=new IE({next:v=>{a.enqueueAndForget(()=>vE(s,_));const y=v.docs.has(c);!y&&v.fromCache?d.reject(new H(D.UNAVAILABLE,"Failed to get document because the client is offline.")):y&&v.fromCache&&h&&h.source==="server"?d.reject(new H(D.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):d.resolve(v)},error:v=>d.reject(v)}),_=new yE(jp(c.path),m,{includeMetadataChanges:!0,Z_:!0});return gE(s,_)}(await AE(e),e.asyncQueue,t,n,i)),i.promise}function IR(e,t,n={}){const i=new Ln;return e.asyncQueue.enqueueAndForget(async()=>function(s,a,c,h,d){const m=new IE({next:v=>{a.enqueueAndForget(()=>vE(s,_)),v.fromCache&&h.source==="server"?d.reject(new H(D.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):d.resolve(v)},error:v=>d.reject(v)}),_=new yE(c,m,{includeMetadataChanges:!0,Z_:!0});return gE(s,_)}(await AE(e),e.asyncQueue,t,n,i)),i.promise}/** + * @license + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function xE(e){const t={};return e.timeoutSeconds!==void 0&&(t.timeoutSeconds=e.timeoutSeconds),t}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Rv=new Map;/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function kE(e,t,n){if(!n)throw new H(D.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function LR(e,t,n,i){if(t===!0&&i===!0)throw new H(D.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)}function Mv(e){if(!G.isDocumentKey(e))throw new H(D.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function Ov(e){if(G.isDocumentKey(e))throw new H(D.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function rm(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return""+e;if(typeof e=="object"){if(e instanceof Array)return"an array";{const t=function(i){return i.constructor?i.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return typeof e=="function"?"a function":K()}function Qn(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new H(D.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=rm(e);throw new H(D.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Dv{constructor(t){var n,i;if(t.host===void 0){if(t.ssl!==void 0)throw new H(D.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=(n=t.ssl)===null||n===void 0||n;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,this.localCache=t.localCache,t.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(t.cacheSizeBytes!==-1&&t.cacheSizeBytes<1048576)throw new H(D.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}LR("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:t.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=xE((i=t.experimentalLongPollingOptions)!==null&&i!==void 0?i:{}),function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new H(D.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new H(D.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new H(D.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!t.useFetchStreams}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&function(i,o){return i.timeoutSeconds===o.timeoutSeconds}(this.experimentalLongPollingOptions,t.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}}class ac{constructor(t,n,i,o){this._authCredentials=t,this._appCheckCredentials=n,this._databaseId=i,this._app=o,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Dv({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new H(D.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!==void 0}_setSettings(t){if(this._settingsFrozen)throw new H(D.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Dv(t),t.credentials!==void 0&&(this._authCredentials=function(i){if(!i)return new ZA;switch(i.type){case"firstParty":return new KA(i.sessionIndex||"0",i.iamToken||null,i.authTokenFactory||null);case"provider":return i.client;default:throw new H(D.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const i=Rv.get(n);i&&(b("ComponentProvider","Removing Datastore"),Rv.delete(n),i.terminate())}(this),Promise.resolve()}}function AR(e,t,n,i={}){var o;const s=(e=Qn(e,ac))._getSettings(),a=`${t}:${n}`;if(s.host!=="firestore.googleapis.com"&&s.host!==a&&so("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),e._setSettings(Object.assign(Object.assign({},s),{host:a,ssl:!1})),i.mockUserToken){let c,h;if(typeof i.mockUserToken=="string")c=i.mockUserToken,h=me.MOCK_USER;else{c=SI(i.mockUserToken,(o=e._app)===null||o===void 0?void 0:o.options.projectId);const d=i.mockUserToken.sub||i.mockUserToken.user_id;if(!d)throw new H(D.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");h=new me(d)}e._authCredentials=new WA(new I1(c,h))}}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class uc{constructor(t,n,i){this.converter=n,this._query=i,this.type="query",this.firestore=t}withConverter(t){return new uc(this.firestore,t,this._query)}}class Fe{constructor(t,n,i){this.converter=n,this._key=i,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new yi(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new Fe(this.firestore,t,this._key)}}class yi extends uc{constructor(t,n,i){super(t,n,jp(i)),this._path=i,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new Fe(this.firestore,null,new G(t))}withConverter(t){return new yi(this.firestore,t,this._path)}}function xR(e,t,...n){if(e=Pi(e),kE("collection","path",t),e instanceof ac){const i=xt.fromString(t,...n);return Ov(i),new yi(e,null,i)}{if(!(e instanceof Fe||e instanceof yi))throw new H(D.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=e._path.child(xt.fromString(t,...n));return Ov(i),new yi(e.firestore,null,i)}}function Cu(e,t,...n){if(e=Pi(e),arguments.length===1&&(t=L1.newId()),kE("doc","path",t),e instanceof ac){const i=xt.fromString(t,...n);return Mv(i),new Fe(e,null,new G(i))}{if(!(e instanceof Fe||e instanceof yi))throw new H(D.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=e._path.child(xt.fromString(t,...n));return Mv(i),new Fe(e.firestore,e instanceof yi?e.converter:null,new G(i))}}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class kR{constructor(){this.Xa=Promise.resolve(),this.eu=[],this.tu=!1,this.nu=[],this.ru=null,this.iu=!1,this.su=!1,this.ou=[],this.jo=new uE(this,"async_queue_retry"),this._u=()=>{const n=Oh();n&&b("AsyncQueue","Visibility state changed to "+n.visibilityState),this.jo.Ko()};const t=Oh();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this._u)}get isShuttingDown(){return this.tu}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.au(),this.uu(t)}enterRestrictedMode(t){if(!this.tu){this.tu=!0,this.su=t||!1;const n=Oh();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this._u)}}enqueue(t){if(this.au(),this.tu)return new Promise(()=>{});const n=new Ln;return this.uu(()=>this.tu&&this.su?Promise.resolve():(t().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(t){this.enqueueAndForget(()=>(this.eu.push(t),this.cu()))}async cu(){if(this.eu.length!==0){try{await this.eu[0](),this.eu.shift(),this.jo.reset()}catch(t){if(!ma(t))throw t;b("AsyncQueue","Operation failed with retryable error: "+t)}this.eu.length>0&&this.jo.qo(()=>this.cu())}}uu(t){const n=this.Xa.then(()=>(this.iu=!0,t().catch(i=>{this.ru=i,this.iu=!1;const o=function(a){let c=a.message||"";return a.stack&&(c=a.stack.includes(a.message)?a.stack:a.message+` +`+a.stack),c}(i);throw kn("INTERNAL UNHANDLED ERROR: ",o),i}).then(i=>(this.iu=!1,i))));return this.Xa=n,n}enqueueAfterDelay(t,n,i){this.au(),this.ou.indexOf(t)>-1&&(n=0);const o=tm.createAndSchedule(this,t,n,i,s=>this.lu(s));return this.nu.push(o),o}au(){this.ru&&K()}verifyOperationInProgress(){}async hu(){let t;do t=this.Xa,await t;while(t!==this.Xa)}Pu(t){for(const n of this.nu)if(n.timerId===t)return!0;return!1}Iu(t){return this.hu().then(()=>{this.nu.sort((n,i)=>n.targetTimeMs-i.targetTimeMs);for(const n of this.nu)if(n.skipDelay(),t!=="all"&&n.timerId===t)break;return this.hu()})}Tu(t){this.ou.push(t)}lu(t){const n=this.nu.indexOf(t);this.nu.splice(n,1)}}class Co extends ac{constructor(t,n,i,o){super(t,n,i,o),this.type="firestore",this._queue=function(){return new kR}(),this._persistenceKey=(o==null?void 0:o.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||RE(this),this._firestoreClient.terminate()}}function RR(e,t){const n=typeof e=="object"?e:xL(),i=typeof e=="string"?e:t||"(default)",o=CL(n,"firestore").getImmediate({identifier:i});if(!o._initialized){const s=TI("firestore");s&&AR(o,...s)}return o}function om(e){return e._firestoreClient||RE(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function RE(e){var t,n,i;const o=e._freezeSettings(),s=function(c,h,d,m){return new lx(c,h,d,m.host,m.ssl,m.experimentalForceLongPolling,m.experimentalAutoDetectLongPolling,xE(m.experimentalLongPollingOptions),m.useFetchStreams)}(e._databaseId,((t=e._app)===null||t===void 0?void 0:t.options.appId)||"",e._persistenceKey,o);e._firestoreClient=new ER(e._authCredentials,e._appCheckCredentials,e._queue,s),!((n=o.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((i=o.localCache)===null||i===void 0)&&i._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:o.localCache.kind,_offline:o.localCache._offlineComponentProvider,_online:o.localCache._onlineComponentProvider})}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class fo{constructor(t){this._byteString=t}static fromBase64String(t){try{return new fo(Ee.fromBase64String(t))}catch(n){throw new H(D.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(t){return new fo(Ee.fromUint8Array(t))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(t){return this._byteString.isEqual(t._byteString)}}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class lc{constructor(...t){for(let n=0;n90)throw new H(D.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(n)||n<-180||n>180)throw new H(D.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=t,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(t){return this._lat===t._lat&&this._long===t._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(t){return _t(this._lat,t._lat)||_t(this._long,t._long)}}/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const MR=/^__.*__$/;class OR{constructor(t,n,i){this.data=t,this.fieldMask=n,this.fieldTransforms=i}toMutation(t,n){return this.fieldMask!==null?new Oi(t,this.data,this.fieldMask,n,this.fieldTransforms):new _a(t,this.data,n,this.fieldTransforms)}}class ME{constructor(t,n,i){this.data=t,this.fieldMask=n,this.fieldTransforms=i}toMutation(t,n){return new Oi(t,this.data,this.fieldMask,n,this.fieldTransforms)}}function OE(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw K()}}class um{constructor(t,n,i,o,s,a){this.settings=t,this.databaseId=n,this.serializer=i,this.ignoreUndefinedProperties=o,s===void 0&&this.Eu(),this.fieldTransforms=s||[],this.fieldMask=a||[]}get path(){return this.settings.path}get du(){return this.settings.du}Au(t){return new um(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Ru(t){var n;const i=(n=this.path)===null||n===void 0?void 0:n.child(t),o=this.Au({path:i,Vu:!1});return o.mu(t),o}fu(t){var n;const i=(n=this.path)===null||n===void 0?void 0:n.child(t),o=this.Au({path:i,Vu:!1});return o.Eu(),o}gu(t){return this.Au({path:void 0,Vu:!0})}pu(t){return ml(t,this.settings.methodName,this.settings.yu||!1,this.path,this.settings.wu)}contains(t){return this.fieldMask.find(n=>t.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>t.isPrefixOf(n.field))!==void 0}Eu(){if(this.path)for(let t=0;th.covers(_.field))}else h=null,d=a.fieldTransforms;return new OR(new Re(c),h,d)}class cc extends sm{_toFieldTransform(t){if(t.du!==2)throw t.du===1?t.pu(`${this._methodName}() can only appear at the top level of your update data`):t.pu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return t.fieldMask.push(t.path),null}isEqual(t){return t instanceof cc}}function VR(e,t,n,i){const o=e.Su(1,t,n);lm("Data must be an object, but it was:",o,i);const s=[],a=Re.empty();fr(i,(h,d)=>{const m=cm(t,h,n);d=Pi(d);const _=o.fu(m);if(d instanceof cc)s.push(m);else{const v=hc(d,_);v!=null&&(s.push(m),a.set(m,v))}});const c=new be(s);return new ME(a,c,o.fieldTransforms)}function zR(e,t,n,i,o,s){const a=e.Su(1,t,n),c=[ad(t,i,n)],h=[o];if(s.length%2!=0)throw new H(D.INVALID_ARGUMENT,`Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let v=0;v=0;--v)if(!zE(d,c[v])){const y=c[v];let C=h[v];C=Pi(C);const S=a.fu(y);if(C instanceof cc)d.push(y);else{const R=hc(C,S);R!=null&&(d.push(y),m.set(y,R))}}const _=new be(d);return new ME(m,_,a.fieldTransforms)}function hc(e,t){if(VE(e=Pi(e)))return lm("Unsupported field value:",t,e),NE(e,t);if(e instanceof sm)return function(i,o){if(!OE(o.du))throw o.pu(`${i._methodName}() can only be used with update() and set()`);if(!o.path)throw o.pu(`${i._methodName}() is not currently supported inside arrays`);const s=i._toFieldTransform(o);s&&o.fieldTransforms.push(s)}(e,t),null;if(e===void 0&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.Vu&&t.du!==4)throw t.pu("Nested arrays are not supported");return function(i,o){const s=[];let a=0;for(const c of i){let h=hc(c,o.gu(a));h==null&&(h={nullValue:"NULL_VALUE"}),s.push(h),a++}return{arrayValue:{values:s}}}(e,t)}return function(i,o){if((i=Pi(i))===null)return{nullValue:"NULL_VALUE"};if(typeof i=="number")return Rx(o.serializer,i);if(typeof i=="boolean")return{booleanValue:i};if(typeof i=="string")return{stringValue:i};if(i instanceof Date){const s=qt.fromDate(i);return{timestampValue:dl(o.serializer,s)}}if(i instanceof qt){const s=new qt(i.seconds,1e3*Math.floor(i.nanoseconds/1e3));return{timestampValue:dl(o.serializer,s)}}if(i instanceof am)return{geoPointValue:{latitude:i.latitude,longitude:i.longitude}};if(i instanceof fo)return{bytesValue:J1(o.serializer,i._byteString)};if(i instanceof Fe){const s=o.databaseId,a=i.firestore._databaseId;if(!a.isEqual(s))throw o.pu(`Document reference is for database ${a.projectId}/${a.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:Gp(i.firestore._databaseId||o.databaseId,i._key.path)}}throw o.pu(`Unsupported field value: ${rm(i)}`)}(e,t)}function NE(e,t){const n={};return A1(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):fr(e,(i,o)=>{const s=hc(o,t.Ru(i));s!=null&&(n[i]=s)}),{mapValue:{fields:n}}}function VE(e){return!(typeof e!="object"||e===null||e instanceof Array||e instanceof Date||e instanceof qt||e instanceof am||e instanceof fo||e instanceof Fe||e instanceof sm)}function lm(e,t,n){if(!VE(n)||!function(o){return typeof o=="object"&&o!==null&&(Object.getPrototypeOf(o)===Object.prototype||Object.getPrototypeOf(o)===null)}(n)){const i=rm(n);throw i==="an object"?t.pu(e+" a custom object"):t.pu(e+" "+i)}}function ad(e,t,n){if((t=Pi(t))instanceof lc)return t._internalPath;if(typeof t=="string")return cm(e,t);throw ml("Field path arguments must be of type string or ",e,!1,void 0,n)}const bR=new RegExp("[~\\*/\\[\\]]");function cm(e,t,n){if(t.search(bR)>=0)throw ml(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,n);try{return new lc(...t.split("."))._internalPath}catch{throw ml(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,n)}}function ml(e,t,n,i,o){const s=i&&!i.isEmpty(),a=o!==void 0;let c=`Function ${t}() called with invalid data`;n&&(c+=" (via `toFirestore()`)"),c+=". ";let h="";return(s||a)&&(h+=" (found",s&&(h+=` in field ${i}`),a&&(h+=` in document ${o}`),h+=")"),new H(D.INVALID_ARGUMENT,c+e+h)}function zE(e,t){return e.some(n=>n.isEqual(t))}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class bE{constructor(t,n,i,o,s){this._firestore=t,this._userDataWriter=n,this._key=i,this._document=o,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new Fe(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const t=new BR(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}get(t){if(this._document){const n=this._document.data.field(BE("DocumentSnapshot.get",t));if(n!==null)return this._userDataWriter.convertValue(n)}}}class BR extends bE{data(){return super.data()}}function BE(e,t){return typeof t=="string"?cm(e,t):t instanceof lc?t._internalPath:t._delegate._internalPath}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function FR(e){if(e.limitType==="L"&&e.explicitOrderBy.length===0)throw new H(D.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class UR{convertValue(t,n="none"){switch(ur(t)){case 0:return null;case 1:return t.booleanValue;case 2:return $t(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,n);case 5:return t.stringValue;case 6:return this.convertBytes(ar(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,n);case 10:return this.convertObject(t.mapValue,n);default:throw K()}}convertObject(t,n){return this.convertObjectMap(t.fields,n)}convertObjectMap(t,n="none"){const i={};return fr(t,(o,s)=>{i[o]=this.convertValue(s,n)}),i}convertGeoPoint(t){return new am($t(t.latitude),$t(t.longitude))}convertArray(t,n){return(t.values||[]).map(i=>this.convertValue(i,n))}convertServerTimestamp(t,n){switch(n){case"previous":const i=Bp(t);return i==null?null:this.convertValue(i,n);case"estimate":return this.convertTimestamp(Ks(t));default:return null}}convertTimestamp(t){const n=Ci(t);return new qt(n.seconds,n.nanos)}convertDocumentKey(t,n){const i=xt.fromString(t);St(oE(i));const o=new Qs(i.get(1),i.get(3)),s=new G(i.popFirst(5));return o.isEqual(n)||kn(`Document ${s} contains a document reference within a different database (${o.projectId}/${o.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),s}}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function $R(e,t,n){let i;return i=e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t,i}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class os{constructor(t,n){this.hasPendingWrites=t,this.fromCache=n}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class FE extends bE{constructor(t,n,i,o,s,a){super(t,n,i,o,a),this._firestore=t,this._firestoreImpl=t,this.metadata=s}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const n=new Iu(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,n={}){if(this._document){const i=this._document.data.field(BE("DocumentSnapshot.get",t));if(i!==null)return this._userDataWriter.convertValue(i,n.serverTimestamps)}}}class Iu extends FE{data(t={}){return super.data(t)}}class jR{constructor(t,n,i,o){this._firestore=t,this._userDataWriter=n,this._snapshot=o,this.metadata=new os(o.hasPendingWrites,o.fromCache),this.query=i}get docs(){const t=[];return this.forEach(n=>t.push(n)),t}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(t,n){this._snapshot.docs.forEach(i=>{t.call(n,new Iu(this._firestore,this._userDataWriter,i.key,i,new os(this._snapshot.mutatedKeys.has(i.key),this._snapshot.fromCache),this.query.converter))})}docChanges(t={}){const n=!!t.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new H(D.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(o,s){if(o._snapshot.oldDocs.isEmpty()){let a=0;return o._snapshot.docChanges.map(c=>{const h=new Iu(o._firestore,o._userDataWriter,c.doc.key,c.doc,new os(o._snapshot.mutatedKeys.has(c.doc.key),o._snapshot.fromCache),o.query.converter);return c.doc,{type:"added",doc:h,oldIndex:-1,newIndex:a++}})}{let a=o._snapshot.oldDocs;return o._snapshot.docChanges.filter(c=>s||c.type!==3).map(c=>{const h=new Iu(o._firestore,o._userDataWriter,c.doc.key,c.doc,new os(o._snapshot.mutatedKeys.has(c.doc.key),o._snapshot.fromCache),o.query.converter);let d=-1,m=-1;return c.type!==0&&(d=a.indexOf(c.doc.key),a=a.delete(c.doc.key)),c.type!==1&&(a=a.add(c.doc),m=a.indexOf(c.doc.key)),{type:HR(c.type),doc:h,oldIndex:d,newIndex:m}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}}function HR(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return K()}}/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ZR(e){e=Qn(e,Fe);const t=Qn(e.firestore,Co);return CR(om(t),e._key).then(n=>KR(t,e,n))}class UE extends UR{constructor(t){super(),this.firestore=t}convertBytes(t){return new fo(t)}convertReference(t){const n=this.convertDocumentKey(t,this.firestore._databaseId);return new Fe(this.firestore,null,n)}}function WR(e){e=Qn(e,uc);const t=Qn(e.firestore,Co),n=om(t),i=new UE(t);return FR(e._query),IR(n,e._query).then(o=>new jR(t,i,e,o))}function GR(e,t,n,...i){e=Qn(e,Fe);const o=Qn(e.firestore,Co),s=DE(o);let a;return a=typeof(t=Pi(t))=="string"||t instanceof lc?zR(s,"updateDoc",e._key,t,n,i):VR(s,"updateDoc",e._key,t),hm(o,[a.toMutation(e._key,hn.exists(!0))])}function Nv(e){return hm(Qn(e.firestore,Co),[new Hp(e._key,hn.none())])}function qR(e,t){const n=Qn(e.firestore,Co),i=Cu(e),o=$R(e.converter,t);return hm(n,[NR(DE(e.firestore),"addDoc",i._key,o,e.converter!==null,{}).toMutation(i._key,hn.exists(!1))]).then(()=>i)}function hm(e,t){return function(i,o){const s=new Ln;return i.asyncQueue.enqueueAndForget(async()=>hR(await SR(i),o,s)),s.promise}(om(e),t)}function KR(e,t,n){const i=n.docs.get(t._key),o=new UE(e);return new FE(e,o,t._key,i,new os(n.hasPendingWrites,n.fromCache),t.converter)}(function(t,n=!0){(function(o){To=o})(AL),el(new bs("firestore",(i,{instanceIdentifier:o,options:s})=>{const a=i.getProvider("app").getImmediate(),c=new Co(new GA(i.getProvider("auth-internal")),new XA(i.getProvider("app-check-internal")),function(d,m){if(!Object.prototype.hasOwnProperty.apply(d.options,["projectId"]))throw new H(D.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Qs(d.options.projectId,m)}(a,o),a);return s=Object.assign({useFetchStreams:n},s),c._setSettings(s),c},"PUBLIC").setMultipleInstances(!0)),qr(ev,"4.4.3",t),qr(ev,"4.4.3","esm2017")})();var QR="firebase",XR="10.8.1";/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */qr(QR,XR,"app");const YR={apiKey:"AIzaSyDhhbpzbw290uqc0JFqbBZav8bKPZCuTo8",authDomain:"viso-test-task-e1a5c.firebaseapp.com",projectId:"viso-test-task-e1a5c",storageBucket:"viso-test-task-e1a5c.appspot.com",messagingSenderId:"254855654009",appId:"1:254855654009:web:0e89a09d934adbfd8242a8",measurementId:"G-824SE11PXZ"},JR=ww(YR),Vv=RR(JR),tM=({addMarker:e})=>(ZC("click",t=>{const n=new Date;e({id:"",location:[t.latlng.lat,t.latlng.lng],date:n.toISOString()})}),null),eM=()=>{const[e,t]=at.useState([]),n=xR(Vv,"markers");at.useEffect(()=>{let h=[];WR(n).then(d=>{d.forEach(m=>{h.push({...m.data(),id:m.id})}),t([...h])})},[]);const i=async h=>{try{const d=await qR(n,h);t(m=>[...m,{...h,id:d.id}])}catch(d){console.log(d)}},o=async h=>{try{await Nv(Cu(n,h)),t(d=>d.filter(m=>m.id!==h))}catch(d){console.log(d)}},s=async(h,d,m)=>{try{const _=Cu(Vv,"markers",h),v=await ZR(_);if(v.exists()){const C={...v.data(),location:[d,m]};await GR(_,C),t(S=>S.map(R=>R.id===h?{...R,location:[d,m]}:R))}else throw new Error("Error in marker`s updating ")}catch(_){console.log(_)}},a=()=>{e.forEach(h=>Nv(Cu(n,h.id))),t([])},c=new ki.Icon({iconUrl:"https://img.icons8.com/ios-filled/50/F9BC00/marker.png",iconSize:[40,40]});return wn.jsxs("div",{className:"home",children:[wn.jsx("button",{className:"button",onClick:()=>a(),children:"Delete all"}),wn.jsxs(GC,{center:[49.8397,24.0297],zoom:10,scrollWheelZoom:!0,children:[wn.jsx(KC,{attribution:'© OpenStreetMap contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),wn.jsxs(fI,{children:[e.map(h=>wn.jsx(qC,{icon:c,position:h.location,draggable:!0,eventHandlers:{dragend:d=>{s(h.id,d.target._latlng.lat,d.target._latlng.lng)},click:()=>o(h.id)}},Math.floor(Math.random()*1e4))),wn.jsx(tM,{addMarker:i})]})]})]})},nM=()=>wn.jsx(eM,{});Nh.createRoot(document.getElementById("root")).render(wn.jsx(Lu.StrictMode,{children:wn.jsx(nM,{})})); diff --git a/index.html b/index.html new file mode 100644 index 0000000..d97199d --- /dev/null +++ b/index.html @@ -0,0 +1,14 @@ + + + + + + + Viso Test task + + + + +
+ + diff --git a/marker.png b/marker.png new file mode 100644 index 0000000000000000000000000000000000000000..427c3e272278625965b25f0919ba7716400dd622 GIT binary patch literal 782 zcmV+p1M&QcP)WDTq20U=SfqL^J;W#2X^;e+T4aohKCW7=WW1 z$$Q0gxn?jitz!t?;7=@aNfE!S0tbL@K|E!~_FdNrD!xH37CFyE_sc2?-q`~*bQSy6 zkD%|f09&?%86&~L}!%Q1TOiAOLWE7gWzJa476F{z^g2UIncsN=qhN)}i1~ zI=NA|e0Dyjf2FxGsaPwPH`>!*6 z8T~1u(<@nki?@<3$oYq^e3^Oxuqw6F6kT4|1^|F!F=hwOPe3d^)568lQ&2iq_Nubi zW>hkok2@a$e6G~Bd!Wk};RM zLBLEE$#Y{ad8c~5OJye_tiJ@BjpiAg3CPqvufA=szXhGy<6|e_O8@`> M07*qoM6N<$f-Y25g#Z8m literal 0 HcmV?d00001 diff --git a/vite.svg b/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file