diff --git a/.env b/.env index 9e0a6370..28d7cc41 100644 --- a/.env +++ b/.env @@ -1,6 +1,12 @@ # VITE_BASE44_APP_BASE_URL=http://localhost:3000 -VITE_BASE44_APP_BASE_URL= +VITE_BASE44_APP_BASE_URL=https://agro.pkc-dev.org/api VITE_BASE44_APP_ID=probindo.com VITE_BASE44_FUNCTIONS_VERSION=v1 -VITE_BASE44_API_URL=http://10.0.2.2:5173 #http://localhost:5173 -VITE_BASE44_SERVER_URL=https://api.base44.io \ No newline at end of file +#VITE_BASE44_API_URL=http://10.0.2.2:5173 #http://localhost:5173 +# VITE_BASE44_API_URL=https://agro.pkc-dev.org/api/ +# VITE_BASE44_SERVER_URL=https://api.base44.io +VITE_BASE44_API_URL=https://agro.pkc-dev.org +VITE_BASE44_SERVER_URL=https://agro.pkc-dev.org +BASE44_BACKEND_URL=https://agro.pkc-dev.org +API_EMAIL=irwan.l.cahyono@gmail.com, +API_PASSWORD=Asalada123 \ No newline at end of file diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml index 74dd639e..b2c751a3 100644 --- a/android/.idea/misc.xml +++ b/android/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/bugreport-sdk_gphone64_arm64-BE4B.251210.005-2026-03-06-09-42-33.zip b/bugreport-sdk_gphone64_arm64-BE4B.251210.005-2026-03-06-09-42-33.zip new file mode 100644 index 00000000..d2b76eae Binary files /dev/null and b/bugreport-sdk_gphone64_arm64-BE4B.251210.005-2026-03-06-09-42-33.zip differ diff --git a/dist/assets/index-Bzz_IyVK.css b/dist/assets/index-Bzz_IyVK.css deleted file mode 100644 index 01e0d42f..00000000 --- a/dist/assets/index-Bzz_IyVK.css +++ /dev/null @@ -1 +0,0 @@ -.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::-moz-selection{background:transparent}.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{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{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;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;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-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: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+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YM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gWupwc6uBUphquXgf+/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;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;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;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}}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 0 0% 3.9%;--card: 0 0% 100%;--card-foreground: 0 0% 3.9%;--popover: 0 0% 100%;--popover-foreground: 0 0% 3.9%;--primary: 0 0% 9%;--primary-foreground: 0 0% 98%;--secondary: 0 0% 96.1%;--secondary-foreground: 0 0% 9%;--muted: 0 0% 96.1%;--muted-foreground: 0 0% 45.1%;--accent: 0 0% 96.1%;--accent-foreground: 0 0% 9%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 0 0% 89.8%;--input: 0 0% 89.8%;--ring: 0 0% 3.9%;--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%;--radius: .5rem;--sidebar-background: 0 0% 98%;--sidebar-foreground: 240 5.3% 26.1%;--sidebar-primary: 240 5.9% 10%;--sidebar-primary-foreground: 0 0% 98%;--sidebar-accent: 240 4.8% 95.9%;--sidebar-accent-foreground: 240 5.9% 10%;--sidebar-border: 220 13% 91%;--sidebar-ring: 217.2 91.2% 59.8%}.dark{--background: 0 0% 3.9%;--foreground: 0 0% 98%;--card: 0 0% 3.9%;--card-foreground: 0 0% 98%;--popover: 0 0% 3.9%;--popover-foreground: 0 0% 98%;--primary: 0 0% 98%;--primary-foreground: 0 0% 9%;--secondary: 0 0% 14.9%;--secondary-foreground: 0 0% 98%;--muted: 0 0% 14.9%;--muted-foreground: 0 0% 63.9%;--accent: 0 0% 14.9%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 0% 98%;--border: 0 0% 14.9%;--input: 0 0% 14.9%;--ring: 0 0% 83.1%;--chart-1: 220 70% 50%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%;--sidebar-background: 240 5.9% 10%;--sidebar-foreground: 240 4.8% 95.9%;--sidebar-primary: 224.3 76.3% 48%;--sidebar-primary-foreground: 0 0% 100%;--sidebar-accent: 240 3.7% 15.9%;--sidebar-accent-foreground: 240 4.8% 95.9%;--sidebar-border: 240 3.7% 15.9%;--sidebar-ring: 217.2 91.2% 59.8%}*{border-color:hsl(var(--border));outline-color:hsl(var(--ring) / .5)}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-bottom-12{bottom:-3rem}.-bottom-4{bottom:-1rem}.-left-12{left:-3rem}.-right-12{right:-3rem}.-right-4{right:-1rem}.-top-12{top:-3rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[1000\]{z-index:1000}.z-\[100\]{z-index:100}.z-\[1\]{z-index:1}.col-span-2{grid-column:span 2 / span 2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-ml-4{margin-left:-1rem}.-mt-4{margin-top:-1rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-72{height:18rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[1px\]{height:1px}.h-\[250px\]{height:250px}.h-\[300px\]{height:300px}.h-\[350px\]{height:350px}.h-\[400px\]{height:400px}.h-\[500px\]{height:500px}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-60{max-height:15rem}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[90vh\]{max-height:90vh}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-0{width:0px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[100px\]{width:100px}.w-\[1px\]{width:1px}.w-auto{width:auto}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-10{min-width:2.5rem}.min-w-5{min-width:1.25rem}.min-w-8{min-width:2rem}.min-w-9{min-width:2.25rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-px{--tw-translate-x: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-px{--tw-translate-x: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\[1\.5px\]{border-width:1.5px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-100{--tw-border-opacity: 1;border-color:rgb(254 243 199 / var(--tw-border-opacity, 1))}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-blue-100{--tw-border-opacity: 1;border-color:rgb(219 234 254 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-emerald-100{--tw-border-opacity: 1;border-color:rgb(209 250 229 / var(--tw-border-opacity, 1))}.border-emerald-200{--tw-border-opacity: 1;border-color:rgb(167 243 208 / var(--tw-border-opacity, 1))}.border-emerald-600{--tw-border-opacity: 1;border-color:rgb(5 150 105 / var(--tw-border-opacity, 1))}.border-indigo-200{--tw-border-opacity: 1;border-color:rgb(199 210 254 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-rose-100{--tw-border-opacity: 1;border-color:rgb(255 228 230 / var(--tw-border-opacity, 1))}.border-rose-200{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity, 1))}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-l-transparent{border-left-color:transparent}.border-t-slate-800{--tw-border-opacity: 1;border-top-color:rgb(30 41 59 / var(--tw-border-opacity, 1))}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-emerald-100{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-foreground{background-color:hsl(var(--foreground))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-rose-100{--tw-bg-opacity: 1;background-color:rgb(255 228 230 / var(--tw-bg-opacity, 1))}.bg-rose-50{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity, 1))}.bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/95{background-color:#fffffff2}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-blue-50{--tw-gradient-from: #eff6ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 246 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-emerald-100{--tw-gradient-from: #d1fae5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(209 250 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-emerald-50{--tw-gradient-from: #ecfdf5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(236 253 245 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-emerald-500{--tw-gradient-from: #10b981 var(--tw-gradient-from-position);--tw-gradient-to: rgb(16 185 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-50{--tw-gradient-from: #eef2ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(238 242 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-50{--tw-gradient-from: #f8fafc var(--tw-gradient-from-position);--tw-gradient-to: rgb(248 250 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.to-emerald-200{--tw-gradient-to: #a7f3d0 var(--tw-gradient-to-position)}.to-emerald-600{--tw-gradient-to: #059669 var(--tw-gradient-to-position)}.to-indigo-600{--tw-gradient-to: #4f46e5 var(--tw-gradient-to-position)}.to-slate-100{--tw-gradient-to: #f1f5f9 var(--tw-gradient-to-position)}.to-slate-50{--tw-gradient-to: #f8fafc var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-primary{fill:hsl(var(--primary))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-rose-600{--tw-text-opacity: 1;color:rgb(225 29 72 / var(--tw-text-opacity, 1))}.text-rose-700{--tw-text-opacity: 1;color:rgb(190 18 60 / var(--tw-text-opacity, 1))}.text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-emerald-500\/25{--tw-shadow-color: rgb(16 185 129 / .25);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-ring{--tw-ring-color: hsl(var(--ring))}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-1000{animation-duration:1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{animation-timing-function:linear}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-width:1px}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-emerald-700:hover{--tw-bg-opacity: 1;background-color:rgb(4 120 87 / var(--tw-bg-opacity, 1))}.hover\:bg-indigo-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(var(--sidebar-accent-foreground))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-primary:focus{background-color:hsl(var(--primary))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-primary-foreground:focus{color:hsl(var(--primary-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group:hover .group-hover\:text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.has-\[\:disabled\]\:opacity-50:has(:disabled){opacity:.5}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:bg-accent\/50[aria-selected=true]{background-color:hsl(var(--accent) / .5)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:accordion-up .2s ease-out}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:accordion-down .2s ease-out}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[active\]\:bg-accent\/50[data-active]{background-color:hsl(var(--accent) / .5)}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=active\]\:bg-blue-50[data-state=active]{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.data-\[state\=active\]\:bg-emerald-50[data-state=active]{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.data-\[state\=active\]\:bg-indigo-50[data-state=active]{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=on\]\:bg-accent[data-state=on],.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:hsl(var(--accent) / .5)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-blue-700[data-state=active]{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.data-\[state\=active\]\:text-emerald-700[data-state=active]{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=active\]\:text-indigo-700[data-state=active]{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=on\]\:text-accent-foreground[data-state=on],.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-],.data-\[state\=open\]\:animate-in[data-state=open],.data-\[state\=visible\]\:animate-in[data-state=visible]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-],.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[state\=hidden\]\:animate-out[data-state=hidden],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity: 0}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-],.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open],.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale: .9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: 13rem}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: -13rem}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: 13rem}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: -13rem}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed],.data-\[state\=closed\]\:slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180,.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer[data-variant=inset]~.peer-data-\[variant\=inset\]\:min-h-\[calc\(100svh-theme\(spacing\.4\)\)\]{min-height:calc(100svh - 1rem)}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}@media(min-width:640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:top-auto{top:auto}.sm\:mt-0{margin-top:0}.sm\:flex{display:flex}.sm\:max-w-sm{max-width:24rem}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:justify-end{justify-content:flex-end}.sm\:gap-2\.5{gap:.625rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media(min-width:768px){.md\:absolute{position:absolute}.md\:block{display:block}.md\:flex{display:flex}.md\:w-40{width:10rem}.md\:w-48{width:12rem}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:max-w-\[420px\]{max-width:420px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:p-6{padding:1.5rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}@media(min-width:1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:ml-64{margin-left:16rem}.lg\:hidden{display:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:pt-0{padding-top:0}}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-md:has(>.day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-md:has(>.day-range-start){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:hsl(var(--accent))}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:has([aria-selected]):first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:has([aria-selected]):last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\.day-outside\)\]\:bg-accent\/50:has([aria-selected].day-outside){background-color:hsl(var(--accent) / .5)}.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:h-3\.5>svg{height:.875rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:w-3\.5>svg{width:.875rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize} diff --git a/dist/index.html b/dist/index.html index 5aad13af..ae33c301 100644 --- a/dist/index.html +++ b/dist/index.html @@ -2,12 +2,13 @@ + - + Agro Monev - - + +
diff --git a/index.html b/index.html index 1f761bc8..34a8e295 100644 --- a/index.html +++ b/index.html @@ -2,8 +2,9 @@ + - + Agro Monev diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 00000000..f4702997 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,13 @@ +App/build +App/Pods +App/output +App/App/public +DerivedData +xcuserdata + +# Cordova plugins for Capacitor +capacitor-cordova-ios-plugins + +# Generated Config files +App/App/capacitor.config.json +App/App/config.xml diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj new file mode 100644 index 00000000..72d88a00 --- /dev/null +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -0,0 +1,396 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 60; + objects = { + +/* Begin PBXBuildFile section */ + 2FAD9763203C412B000D30F8 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 2FAD9762203C412B000D30F8 /* config.xml */; }; + 4D22ABE92AF431CB00220026 /* CapApp-SPM in Frameworks */ = {isa = PBXBuildFile; productRef = 4D22ABE82AF431CB00220026 /* CapApp-SPM */; }; + 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */ = {isa = PBXBuildFile; fileRef = 50379B222058CBB4000EE86E /* capacitor.config.json */; }; + 504EC3081FED79650016851F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504EC3071FED79650016851F /* AppDelegate.swift */; }; + 504EC30D1FED79650016851F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30B1FED79650016851F /* Main.storyboard */; }; + 504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; }; + 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; }; + 50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = ""; }; + 50379B222058CBB4000EE86E /* capacitor.config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = capacitor.config.json; sourceTree = ""; }; + 504EC3041FED79650016851F /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 504EC3071FED79650016851F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 504EC30C1FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 504EC30E1FED79650016851F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = ""; }; + 958DCC722DB07C7200EA8C5F /* debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = debug.xcconfig; path = ../debug.xcconfig; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 504EC3011FED79650016851F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4D22ABE92AF431CB00220026 /* CapApp-SPM in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 504EC2FB1FED79650016851F = { + isa = PBXGroup; + children = ( + 958DCC722DB07C7200EA8C5F /* debug.xcconfig */, + 504EC3061FED79650016851F /* App */, + 504EC3051FED79650016851F /* Products */, + ); + sourceTree = ""; + }; + 504EC3051FED79650016851F /* Products */ = { + isa = PBXGroup; + children = ( + 504EC3041FED79650016851F /* App.app */, + ); + name = Products; + sourceTree = ""; + }; + 504EC3061FED79650016851F /* App */ = { + isa = PBXGroup; + children = ( + 50379B222058CBB4000EE86E /* capacitor.config.json */, + 504EC3071FED79650016851F /* AppDelegate.swift */, + 504EC30B1FED79650016851F /* Main.storyboard */, + 504EC30E1FED79650016851F /* Assets.xcassets */, + 504EC3101FED79650016851F /* LaunchScreen.storyboard */, + 504EC3131FED79650016851F /* Info.plist */, + 2FAD9762203C412B000D30F8 /* config.xml */, + 50B271D01FEDC1A000F3C39B /* public */, + ); + path = App; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 504EC3031FED79650016851F /* App */ = { + isa = PBXNativeTarget; + buildConfigurationList = 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */; + buildPhases = ( + 504EC3001FED79650016851F /* Sources */, + 504EC3011FED79650016851F /* Frameworks */, + 504EC3021FED79650016851F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = App; + packageProductDependencies = ( + 4D22ABE82AF431CB00220026 /* CapApp-SPM */, + ); + productName = App; + productReference = 504EC3041FED79650016851F /* App.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 504EC2FC1FED79650016851F /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 2630; + TargetAttributes = { + 504EC3031FED79650016851F = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 504EC2FB1FED79650016851F; + packageReferences = ( + D4C12C0A2AAA248700AAC8A2 /* XCLocalSwiftPackageReference "CapApp-SPM" */, + ); + productRefGroup = 504EC3051FED79650016851F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 504EC3031FED79650016851F /* App */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 504EC3021FED79650016851F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */, + 50B271D11FEDC1A000F3C39B /* public in Resources */, + 504EC30F1FED79650016851F /* Assets.xcassets in Resources */, + 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */, + 504EC30D1FED79650016851F /* Main.storyboard in Resources */, + 2FAD9763203C412B000D30F8 /* config.xml in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 504EC3001FED79650016851F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 504EC3081FED79650016851F /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 504EC30B1FED79650016851F /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 504EC30C1FED79650016851F /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 504EC3101FED79650016851F /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 504EC3111FED79650016851F /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 504EC3141FED79650016851F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 958DCC722DB07C7200EA8C5F /* debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Apple Development: fauzgabriel@gmail.com (S9YS6CQC54)"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 66BB96MXJ2; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 504EC3151FED79650016851F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Apple Development: fauzgabriel@gmail.com (S9YS6CQC54)"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 66BB96MXJ2; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 504EC3171FED79650016851F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 958DCC722DB07C7200EA8C5F /* debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 66BB96MXJ2; + INFOPLIST_FILE = App/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; + PRODUCT_BUNDLE_IDENTIFIER = probindo.com; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 504EC3181FED79650016851F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 66BB96MXJ2; + INFOPLIST_FILE = App/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = probindo.com; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 504EC3141FED79650016851F /* Debug */, + 504EC3151FED79650016851F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 504EC3171FED79650016851F /* Debug */, + 504EC3181FED79650016851F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + D4C12C0A2AAA248700AAC8A2 /* XCLocalSwiftPackageReference "CapApp-SPM" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = "CapApp-SPM"; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 4D22ABE82AF431CB00220026 /* CapApp-SPM */ = { + isa = XCSwiftPackageProductDependency; + package = D4C12C0A2AAA248700AAC8A2 /* XCLocalSwiftPackageReference "CapApp-SPM" */; + productName = "CapApp-SPM"; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 504EC2FC1FED79650016851F /* Project object */; +} diff --git a/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..6f253908 --- /dev/null +++ b/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,15 @@ +{ + "originHash" : "86d4bf9206c1a1d9044981136d7d984c78a2575416f7eee132e225c8f96df091", + "pins" : [ + { + "identity" : "capacitor-swift-pm", + "kind" : "remoteSourceControl", + "location" : "https://github.com/ionic-team/capacitor-swift-pm.git", + "state" : { + "revision" : "1f324fe7bdbdc8c5cc28bea48a231545a8c2e823", + "version" : "8.1.0" + } + } + ], + "version" : 3 +} diff --git a/ios/App/App/AppDelegate.swift b/ios/App/App/AppDelegate.swift new file mode 100644 index 00000000..c3cd83b5 --- /dev/null +++ b/ios/App/App/AppDelegate.swift @@ -0,0 +1,49 @@ +import UIKit +import Capacitor + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { + // Called when the app was launched with a url. Feel free to add additional processing here, + // but if you want the App API to support tracking app url opens, make sure to keep this call + return ApplicationDelegateProxy.shared.application(app, open: url, options: options) + } + + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + // Called when the app was launched with an activity, including Universal Links. + // Feel free to add additional processing here, but if you want the App API to support + // tracking app url opens, make sure to keep this call + return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler) + } + +} diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png new file mode 100644 index 00000000..adf6ba01 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..9b7d382d --- /dev/null +++ b/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "AppIcon-512@2x.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/App/App/Assets.xcassets/Contents.json b/ios/App/App/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/ios/App/App/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json b/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json new file mode 100644 index 00000000..d7d96a67 --- /dev/null +++ b/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "splash-2732x2732-2.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "splash-2732x2732-1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "splash-2732x2732.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png new file mode 100644 index 00000000..33ea6c97 Binary files /dev/null and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png differ diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png new file mode 100644 index 00000000..33ea6c97 Binary files /dev/null and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png differ diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png new file mode 100644 index 00000000..33ea6c97 Binary files /dev/null and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png differ diff --git a/ios/App/App/Base.lproj/LaunchScreen.storyboard b/ios/App/App/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..e7ae5d78 --- /dev/null +++ b/ios/App/App/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/App/App/Base.lproj/Main.storyboard b/ios/App/App/Base.lproj/Main.storyboard new file mode 100644 index 00000000..b44df7be --- /dev/null +++ b/ios/App/App/Base.lproj/Main.storyboard @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ios/App/App/Info.plist b/ios/App/App/Info.plist new file mode 100644 index 00000000..92848210 --- /dev/null +++ b/ios/App/App/Info.plist @@ -0,0 +1,55 @@ + + + + + CAPACITOR_DEBUG + $(CAPACITOR_DEBUG) + CFBundleDevelopmentRegion + en + CFBundleDisplayName + agroforesty + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + NSLocationWhenInUseUsageDescription + Applikasi membuatuhkan akses GPS + NSLocationAlwaysAndWhenInUseUsageDescription + Aplikasi membuatuhkan GPS untuk pemetaan lahan + + diff --git a/ios/App/CapApp-SPM/.gitignore b/ios/App/CapApp-SPM/.gitignore new file mode 100644 index 00000000..3b298120 --- /dev/null +++ b/ios/App/CapApp-SPM/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/ios/App/CapApp-SPM/Package.swift b/ios/App/CapApp-SPM/Package.swift new file mode 100644 index 00000000..880cb246 --- /dev/null +++ b/ios/App/CapApp-SPM/Package.swift @@ -0,0 +1,25 @@ +// swift-tools-version: 5.9 +import PackageDescription + +// DO NOT MODIFY THIS FILE - managed by Capacitor CLI commands +let package = Package( + name: "CapApp-SPM", + platforms: [.iOS(.v15)], + products: [ + .library( + name: "CapApp-SPM", + targets: ["CapApp-SPM"]) + ], + dependencies: [ + .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.1.0") + ], + targets: [ + .target( + name: "CapApp-SPM", + dependencies: [ + .product(name: "Capacitor", package: "capacitor-swift-pm"), + .product(name: "Cordova", package: "capacitor-swift-pm") + ] + ) + ] +) diff --git a/ios/App/CapApp-SPM/README.md b/ios/App/CapApp-SPM/README.md new file mode 100644 index 00000000..5e22a2f8 --- /dev/null +++ b/ios/App/CapApp-SPM/README.md @@ -0,0 +1,5 @@ +# CapApp-SPM + +This SPM is used to host SPM dependencies for you Capacitor project + +Do not modify the contents of it or there may be unintended consequences. diff --git a/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift b/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift new file mode 100644 index 00000000..945afec8 --- /dev/null +++ b/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift @@ -0,0 +1 @@ +public let isCapacitorApp = true diff --git a/ios/debug.xcconfig b/ios/debug.xcconfig new file mode 100644 index 00000000..53ce18de --- /dev/null +++ b/ios/debug.xcconfig @@ -0,0 +1 @@ +CAPACITOR_DEBUG = true diff --git a/jsconfig.json b/jsconfig.json index f4deca8a..f9ba9280 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -16,6 +16,6 @@ "resolveJsonModule": true, "types": [] }, - "include": ["src/components/**/*.js", "src/pages/**/*.jsx", "src/Layout.jsx", "src/api/Client.js", "src/components/common/offlineStorage.jsx"], + "include": ["src/components/**/*.js", "src/pages/**/*.jsx", "src/Layout.jsx", "src/api/Client.js", "src/components/common/offlineStorage.jsx", "src/pages/Login.jsx"], "exclude": ["node_modules", "dist", "src/vite-plugins", "src/components/ui", "src/api", "src/lib"] } \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index f769e84c..ac5b60c1 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -393,6 +393,30 @@ "tslib": "^2.1.0" } }, + "node_modules/@capacitor/ios": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-8.1.0.tgz", + "integrity": "sha512-wPaQ8ayL0UY+SxydZbrmfzPs8TryZVEB6hrL/XBnXxQtb6rpEmIy/3GIltPwM+/T4m/IuaSDZOToWK65ruC00g==", + "license": "MIT", + "peerDependencies": { + "@capacitor/core": "^8.1.0" + } + }, + "node_modules/@emotion/is-prop-valid": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.4.0.tgz", + "integrity": "sha512-QgD4fyscGcbbKwJmqNvUMSE02OsHUa+lAWKdEUIJKgqe5IwRSKd7+KhibEWdaKwgjLj0DRSHA9biAIqGBk05lw==", + "license": "MIT", + "dependencies": { + "@emotion/memoize": "^0.9.0" + } + }, + "node_modules/@emotion/memoize": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", + "license": "MIT" + }, "node_modules/@esbuild/darwin-arm64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", @@ -2841,15 +2865,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/quill": { - "version": "1.3.10", - "resolved": "https://registry.npmjs.org/@types/quill/-/quill-1.3.10.tgz", - "integrity": "sha512-IhW3fPW+bkt9MLNlycw8u8fWb7oO7W5URC9MfZYHBlA24rex9rs23D5DETChu1zvgVdc5ka64ICjJOgQMr6Shw==", - "license": "MIT", - "dependencies": { - "parchment": "^1.1.2" - } - }, "node_modules/@types/raf": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.3.tgz", @@ -3408,6 +3423,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.0", @@ -3439,6 +3455,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", @@ -3621,15 +3638,6 @@ "url": "https://polar.sh/cva" } }, - "node_modules/clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -3996,26 +4004,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/deep-equal": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.2.tgz", - "integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==", - "license": "MIT", - "dependencies": { - "is-arguments": "^1.1.1", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.5.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -4027,6 +4015,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", @@ -4053,6 +4042,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", @@ -4109,6 +4099,17 @@ "integrity": "sha512-5EeoQpJvMKHe6zWt/FSIIuRa3CWlZeIl6zKXt+Lz7BU6RoRRLgX9dZEynRfXrkLcldKYCBiz7xekTEylnie1Ug==", "license": "Apache-2.0" }, + "node_modules/dexie-react-hooks": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dexie-react-hooks/-/dexie-react-hooks-4.2.0.tgz", + "integrity": "sha512-u7KqTX9JpBQK8+tEyA9X0yMGXlSCsbm5AU64N6gjvGk/IutYDpLBInMYEAEC83s3qhIvryFS+W+sqLZUBEvePQ==", + "license": "Apache-2.0", + "peerDependencies": { + "@types/react": ">=16", + "dexie": ">=4.2.0-alpha.1 <5.0.0", + "react": ">=16" + } + }, "node_modules/didyoumean": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", @@ -4691,6 +4692,12 @@ "node": ">=0.10.0" } }, + "node_modules/eventemitter2": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "integrity": "sha512-K7J4xq5xAD5jHsGM5ReWXRTFa3JRGofHiMcVgQ8PRwgWxzjHpMWCIzsmyf60+mh8KLsqYPcjUMa0AC4hd6lPyQ==", + "license": "MIT" + }, "node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -4711,10 +4718,10 @@ "license": "MIT" }, "node_modules/fast-diff": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz", - "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==", - "license": "Apache-2.0" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.0.1.tgz", + "integrity": "sha512-anEzYJ8VOA5iAMjDOVMTVMrUOXveDTMMk5x0E4p0nJ3VPoIOolF51AqYyE+UD0QIyggUwqppqH7XVA9lF3fdaQ==", + "license": "Apache 2.0" }, "node_modules/fast-equals": { "version": "5.4.0", @@ -5025,6 +5032,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5228,6 +5236,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" @@ -5459,22 +5468,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/is-arguments": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", - "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-array-buffer": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", @@ -5610,6 +5603,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -5794,6 +5788,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -6844,9 +6839,9 @@ } }, "node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "license": "BlueOak-1.0.0", "dependencies": { "brace-expansion": "^5.0.2" @@ -7031,26 +7026,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-is": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", - "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -7228,12 +7208,6 @@ "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==", "license": "(MIT AND Zlib)" }, - "node_modules/parchment": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz", - "integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==", - "license": "BSD-3-Clause" - }, "node_modules/parse-entities": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", @@ -7639,38 +7613,28 @@ ], "license": "MIT" }, - "node_modules/quill": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz", - "integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==", + "node_modules/quilljs": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/quilljs/-/quilljs-0.18.1.tgz", + "integrity": "sha512-VKaO7GNehgnH4LlFPx5ZAl+KFDoRVtboY0I6UUbYXUsPHP8kR80Tg/CFEYqrqrpCOGQr4OQ5Tjm813gV1DUyQw==", "license": "BSD-3-Clause", "dependencies": { - "clone": "^2.1.1", - "deep-equal": "^1.0.1", - "eventemitter3": "^2.0.3", - "extend": "^3.0.2", - "parchment": "^1.1.4", - "quill-delta": "^3.6.2" - } - }, - "node_modules/quill-delta": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz", - "integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==", - "license": "MIT", - "dependencies": { - "deep-equal": "^1.0.1", - "extend": "^3.0.2", - "fast-diff": "1.1.2" + "eventemitter2": "~0.4.13", + "lodash": "~2.4.1", + "rich-text": "~1.0.2" }, "engines": { "node": ">=0.10" } }, - "node_modules/quill/node_modules/eventemitter3": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz", - "integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==", + "node_modules/quilljs/node_modules/lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha512-Kak1hi6/hYHGVPmdyiZijoQyz5x2iGVzs6w9GYB/HiXEtylY7tIoYEROMjvM1d9nXJqPOrG2MNPMn01bJ+S0Rw==", + "engines": [ + "node", + "rhino" + ], "license": "MIT" }, "node_modules/raf": { @@ -7809,18 +7773,18 @@ } }, "node_modules/react-quill": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/react-quill/-/react-quill-2.0.0.tgz", - "integrity": "sha512-4qQtv1FtCfLgoD3PXAur5RyxuUbPXQGOHgTlFie3jtxp43mXDtzCKaOgQ3mLyZfi1PUlyjycfivKelFhy13QUg==", + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/react-quill/-/react-quill-0.0.2.tgz", + "integrity": "sha512-PeiHXZ63Sumh41OdovBQExXJH7B4UsJpyCW8CtRvXrNBa2RJXdciaJvTeb0x6pYQfqkoCYPT5EbUvEr0Z1tohg==", "license": "MIT", "dependencies": { - "@types/quill": "^1.3.10", - "lodash": "^4.17.4", - "quill": "^1.3.7" + "quilljs": "^0.18.1" + }, + "engines": { + "node": ">= 0.8.x" }, "peerDependencies": { - "react": "^16 || ^17 || ^18", - "react-dom": "^16 || ^17 || ^18" + "react": ">=0.11.0" } }, "node_modules/react-redux": { @@ -8113,6 +8077,7 @@ "version": "1.5.4", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", @@ -8204,6 +8169,18 @@ "node": ">= 0.8.15" } }, + "node_modules/rich-text": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/rich-text/-/rich-text-1.0.3.tgz", + "integrity": "sha512-L+Mi0fBH4/TBGH68XZqUXdUr5Ze+ViYkrKuwEvCpeyB1Blbp4CLO4LyYleutTNybujCMQfcmivaNrE3YLrEUgg==", + "license": "MIT", + "dependencies": { + "fast-diff": "~1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/rimraf": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", @@ -8396,6 +8373,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", @@ -8413,6 +8391,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", diff --git a/node_modules/.vite/deps/@base44_sdk.js b/node_modules/.vite/deps/@base44_sdk.js deleted file mode 100644 index b1f77e69..00000000 --- a/node_modules/.vite/deps/@base44_sdk.js +++ /dev/null @@ -1,5060 +0,0 @@ -import { - Base44Error, - createAxiosClient, - generateUuid -} from "./chunk-CJARZ5TB.js"; -import { - __commonJS, - __export, - __toESM -} from "./chunk-WOOG5QLI.js"; - -// node_modules/ms/index.js -var require_ms = __commonJS({ - "node_modules/ms/index.js"(exports, module) { - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse2(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) - ); - }; - function parse2(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); - } - } -}); - -// node_modules/debug/src/common.js -var require_common = __commonJS({ - "node_modules/debug/src/common.js"(exports, module) { - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms(); - createDebug.destroy = destroy; - Object.keys(env).forEach((key) => { - createDebug[key] = env[key]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug2(...args) { - if (!debug2.enabled) { - return; - } - const self2 = debug2; - const curr = Number(/* @__PURE__ */ new Date()); - const ms = curr - (prevTime || curr); - self2.diff = ms; - self2.prev = prevTime; - self2.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val = args[index]; - match = formatter.call(self2, val); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug2.namespace = namespace; - debug2.useColors = createDebug.useColors(); - debug2.color = createDebug.selectColor(namespace); - debug2.extend = extend; - debug2.destroy = createDebug.destroy; - Object.defineProperty(debug2, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; - } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug2); - } - return debug2; - } - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); - for (const ns of split) { - if (ns[0] === "-") { - createDebug.skips.push(ns.slice(1)); - } else { - createDebug.names.push(ns); - } - } - } - function matchesTemplate(search, template) { - let searchIndex = 0; - let templateIndex = 0; - let starIndex = -1; - let matchIndex = 0; - while (searchIndex < search.length) { - if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { - if (template[templateIndex] === "*") { - starIndex = templateIndex; - matchIndex = searchIndex; - templateIndex++; - } else { - searchIndex++; - templateIndex++; - } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; - } - } - while (templateIndex < template.length && template[templateIndex] === "*") { - templateIndex++; - } - return templateIndex === template.length; - } - function disable() { - const namespaces = [ - ...createDebug.names, - ...createDebug.skips.map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; - } - function enabled(name) { - for (const skip of createDebug.skips) { - if (matchesTemplate(name, skip)) { - return false; - } - } - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } - } - return false; - } - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - createDebug.enable(createDebug.load()); - return createDebug; - } - module.exports = setup; - } -}); - -// node_modules/debug/src/browser.js -var require_browser = __commonJS({ - "node_modules/debug/src/browser.js"(exports, module) { - exports.formatArgs = formatArgs; - exports.save = save; - exports.load = load; - exports.useColors = useColors; - exports.storage = localstorage(); - exports.destroy = /* @__PURE__ */ (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - }; - })(); - exports.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; - } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - let m; - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 - typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker - typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff); - if (!this.useColors) { - return; - } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); - } - exports.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem("debug", namespaces); - } else { - exports.storage.removeItem("debug"); - } - } catch (error) { - } - } - function load() { - let r; - try { - r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG"); - } catch (error) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error) { - } - } - module.exports = require_common()(exports); - var { formatters } = module.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error) { - return "[UnexpectedJSONParseError]: " + error.message; - } - }; - } -}); - -// node_modules/@base44/sdk/dist/modules/entities.js -function createEntitiesModule(config) { - const { axios, appId, getSocket } = config; - return new Proxy({}, { - get(target, entityName) { - if (typeof entityName !== "string" || entityName === "then" || entityName.startsWith("_")) { - return void 0; - } - return createEntityHandler(axios, appId, entityName, getSocket); - } - }); -} -function parseRealtimeMessage(dataStr) { - var _a; - try { - const parsed = JSON.parse(dataStr); - return { - type: parsed.type, - data: parsed.data, - id: parsed.id || ((_a = parsed.data) === null || _a === void 0 ? void 0 : _a.id), - timestamp: parsed.timestamp || (/* @__PURE__ */ new Date()).toISOString() - }; - } catch (error) { - console.warn("[Base44 SDK] Failed to parse realtime message:", error); - return null; - } -} -function createEntityHandler(axios, appId, entityName, getSocket) { - const baseURL = `/apps/${appId}/entities/${entityName}`; - return { - // List entities with optional pagination and sorting - async list(sort, limit, skip, fields) { - const params = {}; - if (sort) - params.sort = sort; - if (limit) - params.limit = limit; - if (skip) - params.skip = skip; - if (fields) - params.fields = Array.isArray(fields) ? fields.join(",") : fields; - return axios.get(baseURL, { params }); - }, - // Filter entities based on query - async filter(query, sort, limit, skip, fields) { - const params = { - q: JSON.stringify(query) - }; - if (sort) - params.sort = sort; - if (limit) - params.limit = limit; - if (skip) - params.skip = skip; - if (fields) - params.fields = Array.isArray(fields) ? fields.join(",") : fields; - return axios.get(baseURL, { params }); - }, - // Get entity by ID - async get(id) { - return axios.get(`${baseURL}/${id}`); - }, - // Create new entity - async create(data) { - return axios.post(baseURL, data); - }, - // Update entity by ID - async update(id, data) { - return axios.put(`${baseURL}/${id}`, data); - }, - // Delete entity by ID - async delete(id) { - return axios.delete(`${baseURL}/${id}`); - }, - // Delete multiple entities based on query - async deleteMany(query) { - return axios.delete(baseURL, { data: query }); - }, - // Create multiple entities in a single request - async bulkCreate(data) { - return axios.post(`${baseURL}/bulk`, data); - }, - // Import entities from a file - async importEntities(file) { - const formData = new FormData(); - formData.append("file", file, file.name); - return axios.post(`${baseURL}/import`, formData, { - headers: { - "Content-Type": "multipart/form-data" - } - }); - }, - // Subscribe to realtime updates - subscribe(callback) { - const room = `entities:${appId}:${entityName}`; - const socket = getSocket(); - const unsubscribe = socket.subscribeToRoom(room, { - update_model: (msg) => { - const event = parseRealtimeMessage(msg.data); - if (!event) { - return; - } - try { - callback(event); - } catch (error) { - console.error("[Base44 SDK] Subscription callback error:", error); - } - } - }); - return unsubscribe; - } - }; -} - -// node_modules/@base44/sdk/dist/modules/custom-integrations.js -function createCustomIntegrationsModule(axios, appId) { - return { - async call(slug, operationId, params) { - if (!(slug === null || slug === void 0 ? void 0 : slug.trim())) { - throw new Error("Integration slug is required and cannot be empty"); - } - if (!(operationId === null || operationId === void 0 ? void 0 : operationId.trim())) { - throw new Error("Operation ID is required and cannot be empty"); - } - const { pathParams, queryParams, ...rest } = params !== null && params !== void 0 ? params : {}; - const body = { - ...rest, - ...pathParams && { path_params: pathParams }, - ...queryParams && { query_params: queryParams } - }; - const response = await axios.post(`/apps/${appId}/integrations/custom/${slug}/${operationId}`, body); - return response; - } - }; -} - -// node_modules/@base44/sdk/dist/modules/integrations.js -function createIntegrationsModule(axios, appId) { - const customModule = createCustomIntegrationsModule(axios, appId); - return new Proxy({}, { - get(target, packageName) { - if (typeof packageName !== "string" || packageName === "then" || packageName.startsWith("_")) { - return void 0; - } - if (packageName === "custom") { - return customModule; - } - return new Proxy({}, { - get(target2, endpointName) { - if (typeof endpointName !== "string" || endpointName === "then" || endpointName.startsWith("_")) { - return void 0; - } - return async (data) => { - if (typeof data === "string") { - throw new Error(`Integration ${endpointName} must receive an object with named parameters, received: ${data}`); - } - let formData; - let contentType; - if (data instanceof FormData || data && Object.values(data).some((value2) => value2 instanceof File)) { - formData = new FormData(); - Object.keys(data).forEach((key) => { - if (data[key] instanceof File) { - formData.append(key, data[key], data[key].name); - } else if (typeof data[key] === "object" && data[key] !== null) { - formData.append(key, JSON.stringify(data[key])); - } else { - formData.append(key, data[key]); - } - }); - contentType = "multipart/form-data"; - } else { - formData = data; - contentType = "application/json"; - } - if (packageName === "Core") { - return axios.post(`/apps/${appId}/integration-endpoints/Core/${endpointName}`, formData || data, { headers: { "Content-Type": contentType } }); - } - return axios.post(`/apps/${appId}/integration-endpoints/installable/${packageName}/integration-endpoints/${endpointName}`, formData || data, { headers: { "Content-Type": contentType } }); - }; - } - }); - } - }); -} - -// node_modules/@base44/sdk/dist/modules/auth.js -function createAuthModule(axios, functionsAxiosClient, appId, options) { - return { - // Get current user information - async me() { - return axios.get(`/apps/${appId}/entities/User/me`); - }, - // Update current user data - async updateMe(data) { - return axios.put(`/apps/${appId}/entities/User/me`, data); - }, - // Redirects the user to the app's login page - redirectToLogin(nextUrl) { - if (typeof window === "undefined") { - throw new Error("Login method can only be used in a browser environment"); - } - const redirectUrl = nextUrl ? new URL(nextUrl, window.location.origin).toString() : window.location.href; - const loginUrl = `${options.appBaseUrl}/login?from_url=${encodeURIComponent(redirectUrl)}`; - window.location.href = loginUrl; - }, - // Redirects the user to a provider's login page - loginWithProvider(provider, fromUrl = "/") { - const redirectUrl = new URL(fromUrl, window.location.origin).toString(); - const providerPath = provider === "google" ? "" : `/${provider}`; - const loginUrl = `${options.appBaseUrl}/api/apps/auth${providerPath}/login?app_id=${appId}&from_url=${encodeURIComponent(redirectUrl)}`; - window.location.href = loginUrl; - }, - // Logout the current user - logout(redirectUrl) { - delete axios.defaults.headers.common["Authorization"]; - if (typeof window !== "undefined") { - if (window.localStorage) { - try { - window.localStorage.removeItem("base44_access_token"); - window.localStorage.removeItem("token"); - } catch (e) { - console.error("Failed to remove token from localStorage:", e); - } - } - const fromUrl = redirectUrl || window.location.href; - const logoutUrl = `${options.appBaseUrl}/api/apps/auth/logout?from_url=${encodeURIComponent(fromUrl)}`; - window.location.href = logoutUrl; - } - }, - // Set authentication token - setToken(token, saveToStorage = true) { - if (!token) - return; - axios.defaults.headers.common["Authorization"] = `Bearer ${token}`; - functionsAxiosClient.defaults.headers.common["Authorization"] = `Bearer ${token}`; - if (saveToStorage && typeof window !== "undefined" && window.localStorage) { - try { - window.localStorage.setItem("base44_access_token", token); - window.localStorage.setItem("token", token); - } catch (e) { - console.error("Failed to save token to localStorage:", e); - } - } - }, - // Login using username and password - async loginViaEmailPassword(email, password, turnstileToken) { - var _a; - try { - const response = await axios.post(`/apps/${appId}/auth/login`, { - email, - password, - ...turnstileToken && { turnstile_token: turnstileToken } - }); - const { access_token, user } = response; - if (access_token) { - this.setToken(access_token); - } - return { - access_token, - user - }; - } catch (error) { - if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) { - await this.logout(); - } - throw error; - } - }, - // Verify if the current token is valid - async isAuthenticated() { - try { - await this.me(); - return true; - } catch (error) { - return false; - } - }, - // Invite a user to the app - inviteUser(userEmail, role) { - return axios.post(`/apps/${appId}/users/invite-user`, { - user_email: userEmail, - role - }); - }, - // Register a new user account - register(payload) { - return axios.post(`/apps/${appId}/auth/register`, payload); - }, - // Verify an OTP (One-time password) code - verifyOtp({ email, otpCode }) { - return axios.post(`/apps/${appId}/auth/verify-otp`, { - email, - otp_code: otpCode - }); - }, - // Resend an OTP code to the user's email - resendOtp(email) { - return axios.post(`/apps/${appId}/auth/resend-otp`, { email }); - }, - // Request a password reset - resetPasswordRequest(email) { - return axios.post(`/apps/${appId}/auth/reset-password-request`, { - email - }); - }, - // Reset password using a reset token - resetPassword({ resetToken, newPassword }) { - return axios.post(`/apps/${appId}/auth/reset-password`, { - reset_token: resetToken, - new_password: newPassword - }); - }, - // Change the user's password - changePassword({ userId, currentPassword, newPassword }) { - return axios.post(`/apps/${appId}/auth/change-password`, { - user_id: userId, - current_password: currentPassword, - new_password: newPassword - }); - } - }; -} - -// node_modules/@base44/sdk/dist/modules/sso.js -function createSsoModule(axios, appId, userToken) { - return { - // Get SSO access token for a specific user - async getAccessToken(userid) { - const url2 = `/apps/${appId}/auth/sso/accesstoken/${userid}`; - const headers = {}; - if (userToken) { - headers["on-behalf-of"] = `Bearer ${userToken}`; - } - return axios.get(url2, { headers }); - } - }; -} - -// node_modules/@base44/sdk/dist/modules/connectors.js -function createConnectorsModule(axios, appId) { - return { - // Retrieve an OAuth access token for a specific external integration type - // @ts-expect-error Return type mismatch with interface - implementation returns object, interface expects string - async getAccessToken(integrationType) { - if (!integrationType || typeof integrationType !== "string") { - throw new Error("Integration type is required and must be a string"); - } - const response = await axios.get(`/apps/${appId}/external-auth/tokens/${integrationType}`); - return response.access_token; - } - }; -} - -// node_modules/@base44/sdk/dist/utils/auth-utils.js -function getAccessToken(options = {}) { - const { storageKey = "base44_access_token", paramName = "access_token", saveToStorage = true, removeFromUrl = true } = options; - let token = null; - if (typeof window !== "undefined" && window.location) { - try { - const urlParams = new URLSearchParams(window.location.search); - token = urlParams.get(paramName); - if (token) { - if (saveToStorage) { - saveAccessToken(token, { storageKey }); - } - if (removeFromUrl) { - urlParams.delete(paramName); - const newUrl = `${window.location.pathname}${urlParams.toString() ? `?${urlParams.toString()}` : ""}${window.location.hash}`; - window.history.replaceState({}, document.title, newUrl); - } - return token; - } - } catch (e) { - console.error("Error retrieving token from URL:", e); - } - } - if (typeof window !== "undefined" && window.localStorage) { - try { - token = window.localStorage.getItem(storageKey); - return token; - } catch (e) { - console.error("Error retrieving token from local storage:", e); - } - } - return null; -} -function saveAccessToken(token, options) { - const { storageKey = "base44_access_token" } = options; - if (typeof window === "undefined" || !window.localStorage || !token) { - return false; - } - try { - window.localStorage.setItem(storageKey, token); - window.localStorage.setItem("token", token); - return true; - } catch (e) { - console.error("Error saving token to local storage:", e); - return false; - } -} -function removeAccessToken(options) { - const { storageKey = "base44_access_token" } = options; - if (typeof window === "undefined" || !window.localStorage) { - return false; - } - try { - window.localStorage.removeItem(storageKey); - return true; - } catch (e) { - console.error("Error removing token from local storage:", e); - return false; - } -} -function getLoginUrl(nextUrl, options) { - const { serverUrl, appId, loginPath = "/login" } = options; - if (!serverUrl || !appId) { - throw new Error("serverUrl and appId are required to construct login URL"); - } - const encodedRedirectUrl = encodeURIComponent(nextUrl || (typeof window !== "undefined" ? window.location.href : "")); - return `${serverUrl}${loginPath}?from_url=${encodedRedirectUrl}&app_id=${appId}`; -} - -// node_modules/@base44/sdk/dist/modules/functions.js -function createFunctionsModule(axios, appId) { - return { - // Invoke a custom backend function by name - async invoke(functionName, data) { - if (typeof data === "string") { - throw new Error(`Function ${functionName} must receive an object with named parameters, received: ${data}`); - } - let formData; - let contentType; - if (data instanceof FormData || data && Object.values(data).some((value2) => value2 instanceof File)) { - formData = new FormData(); - Object.keys(data).forEach((key) => { - if (data[key] instanceof File) { - formData.append(key, data[key], data[key].name); - } else if (typeof data[key] === "object" && data[key] !== null) { - formData.append(key, JSON.stringify(data[key])); - } else { - formData.append(key, data[key]); - } - }); - contentType = "multipart/form-data"; - } else { - formData = data; - contentType = "application/json"; - } - return axios.post(`/apps/${appId}/functions/${functionName}`, formData || data, { headers: { "Content-Type": contentType } }); - } - }; -} - -// node_modules/@base44/sdk/dist/modules/agents.js -function createAgentsModule({ axios, getSocket, appId, serverUrl, token }) { - const baseURL = `/apps/${appId}/agents`; - const currentConversations = {}; - const getConversations = () => { - return axios.get(`${baseURL}/conversations`); - }; - const getConversation = (conversationId) => { - return axios.get(`${baseURL}/conversations/${conversationId}`); - }; - const listConversations = (filterParams) => { - return axios.get(`${baseURL}/conversations`, { - params: filterParams - }); - }; - const createConversation = (conversation) => { - return axios.post(`${baseURL}/conversations`, conversation); - }; - const addMessage = async (conversation, message) => { - return axios.post(`${baseURL}/conversations/v2/${conversation.id}/messages`, message); - }; - const subscribeToConversation = (conversationId, onUpdate) => { - const room = `/agent-conversations/${conversationId}`; - const socket = getSocket(); - const conversationPromise = getConversation(conversationId).then((conv) => { - currentConversations[conversationId] = conv; - return conv; - }); - return socket.subscribeToRoom(room, { - connect: () => { - }, - update_model: async ({ data: jsonStr }) => { - const data = JSON.parse(jsonStr); - if (data._message) { - await conversationPromise; - const message = data._message; - const currentConversation = currentConversations[conversationId]; - if (currentConversation) { - const messages = currentConversation.messages || []; - const existingIndex = messages.findIndex((m) => m.id === message.id); - const updatedMessages = existingIndex !== -1 ? messages.map((m, i) => i === existingIndex ? message : m) : [...messages, message]; - currentConversations[conversationId] = { - ...currentConversation, - messages: updatedMessages - }; - onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(currentConversations[conversationId]); - } - } - } - }); - }; - const getWhatsAppConnectURL = (agentName) => { - const baseUrl = `${serverUrl}/api/apps/${appId}/agents/${encodeURIComponent(agentName)}/whatsapp`; - const accessToken = token !== null && token !== void 0 ? token : getAccessToken(); - if (accessToken) { - return `${baseUrl}?token=${accessToken}`; - } else { - return baseUrl; - } - }; - return { - getConversations, - getConversation, - listConversations, - createConversation, - addMessage, - subscribeToConversation, - getWhatsAppConnectURL - }; -} - -// node_modules/@base44/sdk/dist/modules/app-logs.js -function createAppLogsModule(axios, appId) { - const baseURL = `/app-logs/${appId}`; - return { - // Log user activity in the app - async logUserInApp(pageName) { - await axios.post(`${baseURL}/log-user-in-app/${pageName}`); - }, - // Fetch app logs with optional parameters - async fetchLogs(params = {}) { - const response = await axios.get(baseURL, { params }); - return response; - }, - // Get app statistics - async getStats(params = {}) { - const response = await axios.get(`${baseURL}/stats`, { params }); - return response; - } - }; -} - -// node_modules/@base44/sdk/dist/modules/users.js -function createUsersModule(axios, appId) { - return { - /** - * Invite a user to the application - * @param {string} user_email - User's email address - * @param {'user'|'admin'} role - User's role (user or admin) - * @returns {Promise} - */ - async inviteUser(user_email, role) { - if (role !== "user" && role !== "admin") { - throw new Error(`Invalid role: "${role}". Role must be either "user" or "admin".`); - } - const response = await axios.post(`/apps/${appId}/runtime/users/invite-user`, { user_email, role }); - return response; - } - }; -} - -// node_modules/engine.io-parser/build/esm/commons.js -var PACKET_TYPES = /* @__PURE__ */ Object.create(null); -PACKET_TYPES["open"] = "0"; -PACKET_TYPES["close"] = "1"; -PACKET_TYPES["ping"] = "2"; -PACKET_TYPES["pong"] = "3"; -PACKET_TYPES["message"] = "4"; -PACKET_TYPES["upgrade"] = "5"; -PACKET_TYPES["noop"] = "6"; -var PACKET_TYPES_REVERSE = /* @__PURE__ */ Object.create(null); -Object.keys(PACKET_TYPES).forEach((key) => { - PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key; -}); -var ERROR_PACKET = { type: "error", data: "parser error" }; - -// node_modules/engine.io-parser/build/esm/encodePacket.browser.js -var withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]"; -var withNativeArrayBuffer = typeof ArrayBuffer === "function"; -var isView = (obj) => { - return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj && obj.buffer instanceof ArrayBuffer; -}; -var encodePacket = ({ type, data }, supportsBinary, callback) => { - if (withNativeBlob && data instanceof Blob) { - if (supportsBinary) { - return callback(data); - } else { - return encodeBlobAsBase64(data, callback); - } - } else if (withNativeArrayBuffer && (data instanceof ArrayBuffer || isView(data))) { - if (supportsBinary) { - return callback(data); - } else { - return encodeBlobAsBase64(new Blob([data]), callback); - } - } - return callback(PACKET_TYPES[type] + (data || "")); -}; -var encodeBlobAsBase64 = (data, callback) => { - const fileReader = new FileReader(); - fileReader.onload = function() { - const content = fileReader.result.split(",")[1]; - callback("b" + (content || "")); - }; - return fileReader.readAsDataURL(data); -}; -function toArray(data) { - if (data instanceof Uint8Array) { - return data; - } else if (data instanceof ArrayBuffer) { - return new Uint8Array(data); - } else { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength); - } -} -var TEXT_ENCODER; -function encodePacketToBinary(packet, callback) { - if (withNativeBlob && packet.data instanceof Blob) { - return packet.data.arrayBuffer().then(toArray).then(callback); - } else if (withNativeArrayBuffer && (packet.data instanceof ArrayBuffer || isView(packet.data))) { - return callback(toArray(packet.data)); - } - encodePacket(packet, false, (encoded) => { - if (!TEXT_ENCODER) { - TEXT_ENCODER = new TextEncoder(); - } - callback(TEXT_ENCODER.encode(encoded)); - }); -} - -// node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js -var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256); -for (let i = 0; i < chars.length; i++) { - lookup[chars.charCodeAt(i)] = i; -} -var decode = (base64) => { - let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4; - if (base64[base64.length - 1] === "=") { - bufferLength--; - if (base64[base64.length - 2] === "=") { - bufferLength--; - } - } - const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer); - for (i = 0; i < len; i += 4) { - encoded1 = lookup[base64.charCodeAt(i)]; - encoded2 = lookup[base64.charCodeAt(i + 1)]; - encoded3 = lookup[base64.charCodeAt(i + 2)]; - encoded4 = lookup[base64.charCodeAt(i + 3)]; - bytes[p++] = encoded1 << 2 | encoded2 >> 4; - bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2; - bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63; - } - return arraybuffer; -}; - -// node_modules/engine.io-parser/build/esm/decodePacket.browser.js -var withNativeArrayBuffer2 = typeof ArrayBuffer === "function"; -var decodePacket = (encodedPacket, binaryType) => { - if (typeof encodedPacket !== "string") { - return { - type: "message", - data: mapBinary(encodedPacket, binaryType) - }; - } - const type = encodedPacket.charAt(0); - if (type === "b") { - return { - type: "message", - data: decodeBase64Packet(encodedPacket.substring(1), binaryType) - }; - } - const packetType = PACKET_TYPES_REVERSE[type]; - if (!packetType) { - return ERROR_PACKET; - } - return encodedPacket.length > 1 ? { - type: PACKET_TYPES_REVERSE[type], - data: encodedPacket.substring(1) - } : { - type: PACKET_TYPES_REVERSE[type] - }; -}; -var decodeBase64Packet = (data, binaryType) => { - if (withNativeArrayBuffer2) { - const decoded = decode(data); - return mapBinary(decoded, binaryType); - } else { - return { base64: true, data }; - } -}; -var mapBinary = (data, binaryType) => { - switch (binaryType) { - case "blob": - if (data instanceof Blob) { - return data; - } else { - return new Blob([data]); - } - case "arraybuffer": - default: - if (data instanceof ArrayBuffer) { - return data; - } else { - return data.buffer; - } - } -}; - -// node_modules/engine.io-parser/build/esm/index.js -var SEPARATOR = String.fromCharCode(30); -var encodePayload = (packets, callback) => { - const length = packets.length; - const encodedPackets = new Array(length); - let count = 0; - packets.forEach((packet, i) => { - encodePacket(packet, false, (encodedPacket) => { - encodedPackets[i] = encodedPacket; - if (++count === length) { - callback(encodedPackets.join(SEPARATOR)); - } - }); - }); -}; -var decodePayload = (encodedPayload, binaryType) => { - const encodedPackets = encodedPayload.split(SEPARATOR); - const packets = []; - for (let i = 0; i < encodedPackets.length; i++) { - const decodedPacket = decodePacket(encodedPackets[i], binaryType); - packets.push(decodedPacket); - if (decodedPacket.type === "error") { - break; - } - } - return packets; -}; -function createPacketEncoderStream() { - return new TransformStream({ - transform(packet, controller) { - encodePacketToBinary(packet, (encodedPacket) => { - const payloadLength = encodedPacket.length; - let header; - if (payloadLength < 126) { - header = new Uint8Array(1); - new DataView(header.buffer).setUint8(0, payloadLength); - } else if (payloadLength < 65536) { - header = new Uint8Array(3); - const view = new DataView(header.buffer); - view.setUint8(0, 126); - view.setUint16(1, payloadLength); - } else { - header = new Uint8Array(9); - const view = new DataView(header.buffer); - view.setUint8(0, 127); - view.setBigUint64(1, BigInt(payloadLength)); - } - if (packet.data && typeof packet.data !== "string") { - header[0] |= 128; - } - controller.enqueue(header); - controller.enqueue(encodedPacket); - }); - } - }); -} -var TEXT_DECODER; -function totalLength(chunks) { - return chunks.reduce((acc, chunk) => acc + chunk.length, 0); -} -function concatChunks(chunks, size) { - if (chunks[0].length === size) { - return chunks.shift(); - } - const buffer = new Uint8Array(size); - let j = 0; - for (let i = 0; i < size; i++) { - buffer[i] = chunks[0][j++]; - if (j === chunks[0].length) { - chunks.shift(); - j = 0; - } - } - if (chunks.length && j < chunks[0].length) { - chunks[0] = chunks[0].slice(j); - } - return buffer; -} -function createPacketDecoderStream(maxPayload, binaryType) { - if (!TEXT_DECODER) { - TEXT_DECODER = new TextDecoder(); - } - const chunks = []; - let state = 0; - let expectedLength = -1; - let isBinary2 = false; - return new TransformStream({ - transform(chunk, controller) { - chunks.push(chunk); - while (true) { - if (state === 0) { - if (totalLength(chunks) < 1) { - break; - } - const header = concatChunks(chunks, 1); - isBinary2 = (header[0] & 128) === 128; - expectedLength = header[0] & 127; - if (expectedLength < 126) { - state = 3; - } else if (expectedLength === 126) { - state = 1; - } else { - state = 2; - } - } else if (state === 1) { - if (totalLength(chunks) < 2) { - break; - } - const headerArray = concatChunks(chunks, 2); - expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0); - state = 3; - } else if (state === 2) { - if (totalLength(chunks) < 8) { - break; - } - const headerArray = concatChunks(chunks, 8); - const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length); - const n = view.getUint32(0); - if (n > Math.pow(2, 53 - 32) - 1) { - controller.enqueue(ERROR_PACKET); - break; - } - expectedLength = n * Math.pow(2, 32) + view.getUint32(4); - state = 3; - } else { - if (totalLength(chunks) < expectedLength) { - break; - } - const data = concatChunks(chunks, expectedLength); - controller.enqueue(decodePacket(isBinary2 ? data : TEXT_DECODER.decode(data), binaryType)); - state = 0; - } - if (expectedLength === 0 || expectedLength > maxPayload) { - controller.enqueue(ERROR_PACKET); - break; - } - } - } - }); -} -var protocol = 4; - -// node_modules/@socket.io/component-emitter/lib/esm/index.js -function Emitter(obj) { - if (obj) return mixin(obj); -} -function mixin(obj) { - for (var key in Emitter.prototype) { - obj[key] = Emitter.prototype[key]; - } - return obj; -} -Emitter.prototype.on = Emitter.prototype.addEventListener = function(event, fn) { - this._callbacks = this._callbacks || {}; - (this._callbacks["$" + event] = this._callbacks["$" + event] || []).push(fn); - return this; -}; -Emitter.prototype.once = function(event, fn) { - function on2() { - this.off(event, on2); - fn.apply(this, arguments); - } - on2.fn = fn; - this.on(event, on2); - return this; -}; -Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function(event, fn) { - this._callbacks = this._callbacks || {}; - if (0 == arguments.length) { - this._callbacks = {}; - return this; - } - var callbacks = this._callbacks["$" + event]; - if (!callbacks) return this; - if (1 == arguments.length) { - delete this._callbacks["$" + event]; - return this; - } - var cb; - for (var i = 0; i < callbacks.length; i++) { - cb = callbacks[i]; - if (cb === fn || cb.fn === fn) { - callbacks.splice(i, 1); - break; - } - } - if (callbacks.length === 0) { - delete this._callbacks["$" + event]; - } - return this; -}; -Emitter.prototype.emit = function(event) { - this._callbacks = this._callbacks || {}; - var args = new Array(arguments.length - 1), callbacks = this._callbacks["$" + event]; - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - if (callbacks) { - callbacks = callbacks.slice(0); - for (var i = 0, len = callbacks.length; i < len; ++i) { - callbacks[i].apply(this, args); - } - } - return this; -}; -Emitter.prototype.emitReserved = Emitter.prototype.emit; -Emitter.prototype.listeners = function(event) { - this._callbacks = this._callbacks || {}; - return this._callbacks["$" + event] || []; -}; -Emitter.prototype.hasListeners = function(event) { - return !!this.listeners(event).length; -}; - -// node_modules/engine.io-client/build/esm/globals.js -var nextTick = (() => { - const isPromiseAvailable = typeof Promise === "function" && typeof Promise.resolve === "function"; - if (isPromiseAvailable) { - return (cb) => Promise.resolve().then(cb); - } else { - return (cb, setTimeoutFn) => setTimeoutFn(cb, 0); - } -})(); -var globalThisShim = (() => { - if (typeof self !== "undefined") { - return self; - } else if (typeof window !== "undefined") { - return window; - } else { - return Function("return this")(); - } -})(); -var defaultBinaryType = "arraybuffer"; -function createCookieJar() { -} - -// node_modules/engine.io-client/build/esm/util.js -function pick(obj, ...attr) { - return attr.reduce((acc, k) => { - if (obj.hasOwnProperty(k)) { - acc[k] = obj[k]; - } - return acc; - }, {}); -} -var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout; -var NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout; -function installTimerFunctions(obj, opts) { - if (opts.useNativeTimers) { - obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim); - obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim); - } else { - obj.setTimeoutFn = globalThisShim.setTimeout.bind(globalThisShim); - obj.clearTimeoutFn = globalThisShim.clearTimeout.bind(globalThisShim); - } -} -var BASE64_OVERHEAD = 1.33; -function byteLength(obj) { - if (typeof obj === "string") { - return utf8Length(obj); - } - return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD); -} -function utf8Length(str) { - let c = 0, length = 0; - for (let i = 0, l = str.length; i < l; i++) { - c = str.charCodeAt(i); - if (c < 128) { - length += 1; - } else if (c < 2048) { - length += 2; - } else if (c < 55296 || c >= 57344) { - length += 3; - } else { - i++; - length += 4; - } - } - return length; -} -function randomString() { - return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5); -} - -// node_modules/engine.io-client/build/esm/contrib/parseqs.js -function encode(obj) { - let str = ""; - for (let i in obj) { - if (obj.hasOwnProperty(i)) { - if (str.length) - str += "&"; - str += encodeURIComponent(i) + "=" + encodeURIComponent(obj[i]); - } - } - return str; -} -function decode2(qs) { - let qry = {}; - let pairs = qs.split("&"); - for (let i = 0, l = pairs.length; i < l; i++) { - let pair = pairs[i].split("="); - qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); - } - return qry; -} - -// node_modules/engine.io-client/build/esm/transport.js -var TransportError = class extends Error { - constructor(reason, description, context) { - super(reason); - this.description = description; - this.context = context; - this.type = "TransportError"; - } -}; -var Transport = class extends Emitter { - /** - * Transport abstract constructor. - * - * @param {Object} opts - options - * @protected - */ - constructor(opts) { - super(); - this.writable = false; - installTimerFunctions(this, opts); - this.opts = opts; - this.query = opts.query; - this.socket = opts.socket; - this.supportsBinary = !opts.forceBase64; - } - /** - * Emits an error. - * - * @param {String} reason - * @param description - * @param context - the error context - * @return {Transport} for chaining - * @protected - */ - onError(reason, description, context) { - super.emitReserved("error", new TransportError(reason, description, context)); - return this; - } - /** - * Opens the transport. - */ - open() { - this.readyState = "opening"; - this.doOpen(); - return this; - } - /** - * Closes the transport. - */ - close() { - if (this.readyState === "opening" || this.readyState === "open") { - this.doClose(); - this.onClose(); - } - return this; - } - /** - * Sends multiple packets. - * - * @param {Array} packets - */ - send(packets) { - if (this.readyState === "open") { - this.write(packets); - } else { - } - } - /** - * Called upon open - * - * @protected - */ - onOpen() { - this.readyState = "open"; - this.writable = true; - super.emitReserved("open"); - } - /** - * Called with data. - * - * @param {String} data - * @protected - */ - onData(data) { - const packet = decodePacket(data, this.socket.binaryType); - this.onPacket(packet); - } - /** - * Called with a decoded packet. - * - * @protected - */ - onPacket(packet) { - super.emitReserved("packet", packet); - } - /** - * Called upon close. - * - * @protected - */ - onClose(details) { - this.readyState = "closed"; - super.emitReserved("close", details); - } - /** - * Pauses the transport, in order not to lose packets during an upgrade. - * - * @param onPause - */ - pause(onPause) { - } - createUri(schema, query = {}) { - return schema + "://" + this._hostname() + this._port() + this.opts.path + this._query(query); - } - _hostname() { - const hostname = this.opts.hostname; - return hostname.indexOf(":") === -1 ? hostname : "[" + hostname + "]"; - } - _port() { - if (this.opts.port && (this.opts.secure && Number(this.opts.port) !== 443 || !this.opts.secure && Number(this.opts.port) !== 80)) { - return ":" + this.opts.port; - } else { - return ""; - } - } - _query(query) { - const encodedQuery = encode(query); - return encodedQuery.length ? "?" + encodedQuery : ""; - } -}; - -// node_modules/engine.io-client/build/esm/transports/polling.js -var Polling = class extends Transport { - constructor() { - super(...arguments); - this._polling = false; - } - get name() { - return "polling"; - } - /** - * Opens the socket (triggers polling). We write a PING message to determine - * when the transport is open. - * - * @protected - */ - doOpen() { - this._poll(); - } - /** - * Pauses polling. - * - * @param {Function} onPause - callback upon buffers are flushed and transport is paused - * @package - */ - pause(onPause) { - this.readyState = "pausing"; - const pause = () => { - this.readyState = "paused"; - onPause(); - }; - if (this._polling || !this.writable) { - let total = 0; - if (this._polling) { - total++; - this.once("pollComplete", function() { - --total || pause(); - }); - } - if (!this.writable) { - total++; - this.once("drain", function() { - --total || pause(); - }); - } - } else { - pause(); - } - } - /** - * Starts polling cycle. - * - * @private - */ - _poll() { - this._polling = true; - this.doPoll(); - this.emitReserved("poll"); - } - /** - * Overloads onData to detect payloads. - * - * @protected - */ - onData(data) { - const callback = (packet) => { - if ("opening" === this.readyState && packet.type === "open") { - this.onOpen(); - } - if ("close" === packet.type) { - this.onClose({ description: "transport closed by the server" }); - return false; - } - this.onPacket(packet); - }; - decodePayload(data, this.socket.binaryType).forEach(callback); - if ("closed" !== this.readyState) { - this._polling = false; - this.emitReserved("pollComplete"); - if ("open" === this.readyState) { - this._poll(); - } else { - } - } - } - /** - * For polling, send a close packet. - * - * @protected - */ - doClose() { - const close = () => { - this.write([{ type: "close" }]); - }; - if ("open" === this.readyState) { - close(); - } else { - this.once("open", close); - } - } - /** - * Writes a packets payload. - * - * @param {Array} packets - data packets - * @protected - */ - write(packets) { - this.writable = false; - encodePayload(packets, (data) => { - this.doWrite(data, () => { - this.writable = true; - this.emitReserved("drain"); - }); - }); - } - /** - * Generates uri for connection. - * - * @private - */ - uri() { - const schema = this.opts.secure ? "https" : "http"; - const query = this.query || {}; - if (false !== this.opts.timestampRequests) { - query[this.opts.timestampParam] = randomString(); - } - if (!this.supportsBinary && !query.sid) { - query.b64 = 1; - } - return this.createUri(schema, query); - } -}; - -// node_modules/engine.io-client/build/esm/contrib/has-cors.js -var value = false; -try { - value = typeof XMLHttpRequest !== "undefined" && "withCredentials" in new XMLHttpRequest(); -} catch (err) { -} -var hasCORS = value; - -// node_modules/engine.io-client/build/esm/transports/polling-xhr.js -function empty() { -} -var BaseXHR = class extends Polling { - /** - * XHR Polling constructor. - * - * @param {Object} opts - * @package - */ - constructor(opts) { - super(opts); - if (typeof location !== "undefined") { - const isSSL = "https:" === location.protocol; - let port = location.port; - if (!port) { - port = isSSL ? "443" : "80"; - } - this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port !== opts.port; - } - } - /** - * Sends data. - * - * @param {String} data to send. - * @param {Function} called upon flush. - * @private - */ - doWrite(data, fn) { - const req = this.request({ - method: "POST", - data - }); - req.on("success", fn); - req.on("error", (xhrStatus, context) => { - this.onError("xhr post error", xhrStatus, context); - }); - } - /** - * Starts a poll cycle. - * - * @private - */ - doPoll() { - const req = this.request(); - req.on("data", this.onData.bind(this)); - req.on("error", (xhrStatus, context) => { - this.onError("xhr poll error", xhrStatus, context); - }); - this.pollXhr = req; - } -}; -var Request = class _Request extends Emitter { - /** - * Request constructor - * - * @param {Object} options - * @package - */ - constructor(createRequest, uri, opts) { - super(); - this.createRequest = createRequest; - installTimerFunctions(this, opts); - this._opts = opts; - this._method = opts.method || "GET"; - this._uri = uri; - this._data = void 0 !== opts.data ? opts.data : null; - this._create(); - } - /** - * Creates the XHR object and sends the request. - * - * @private - */ - _create() { - var _a; - const opts = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref"); - opts.xdomain = !!this._opts.xd; - const xhr = this._xhr = this.createRequest(opts); - try { - xhr.open(this._method, this._uri, true); - try { - if (this._opts.extraHeaders) { - xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true); - for (let i in this._opts.extraHeaders) { - if (this._opts.extraHeaders.hasOwnProperty(i)) { - xhr.setRequestHeader(i, this._opts.extraHeaders[i]); - } - } - } - } catch (e) { - } - if ("POST" === this._method) { - try { - xhr.setRequestHeader("Content-type", "text/plain;charset=UTF-8"); - } catch (e) { - } - } - try { - xhr.setRequestHeader("Accept", "*/*"); - } catch (e) { - } - (_a = this._opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr); - if ("withCredentials" in xhr) { - xhr.withCredentials = this._opts.withCredentials; - } - if (this._opts.requestTimeout) { - xhr.timeout = this._opts.requestTimeout; - } - xhr.onreadystatechange = () => { - var _a2; - if (xhr.readyState === 3) { - (_a2 = this._opts.cookieJar) === null || _a2 === void 0 ? void 0 : _a2.parseCookies( - // @ts-ignore - xhr.getResponseHeader("set-cookie") - ); - } - if (4 !== xhr.readyState) - return; - if (200 === xhr.status || 1223 === xhr.status) { - this._onLoad(); - } else { - this.setTimeoutFn(() => { - this._onError(typeof xhr.status === "number" ? xhr.status : 0); - }, 0); - } - }; - xhr.send(this._data); - } catch (e) { - this.setTimeoutFn(() => { - this._onError(e); - }, 0); - return; - } - if (typeof document !== "undefined") { - this._index = _Request.requestsCount++; - _Request.requests[this._index] = this; - } - } - /** - * Called upon error. - * - * @private - */ - _onError(err) { - this.emitReserved("error", err, this._xhr); - this._cleanup(true); - } - /** - * Cleans up house. - * - * @private - */ - _cleanup(fromError) { - if ("undefined" === typeof this._xhr || null === this._xhr) { - return; - } - this._xhr.onreadystatechange = empty; - if (fromError) { - try { - this._xhr.abort(); - } catch (e) { - } - } - if (typeof document !== "undefined") { - delete _Request.requests[this._index]; - } - this._xhr = null; - } - /** - * Called upon load. - * - * @private - */ - _onLoad() { - const data = this._xhr.responseText; - if (data !== null) { - this.emitReserved("data", data); - this.emitReserved("success"); - this._cleanup(); - } - } - /** - * Aborts the request. - * - * @package - */ - abort() { - this._cleanup(); - } -}; -Request.requestsCount = 0; -Request.requests = {}; -if (typeof document !== "undefined") { - if (typeof attachEvent === "function") { - attachEvent("onunload", unloadHandler); - } else if (typeof addEventListener === "function") { - const terminationEvent = "onpagehide" in globalThisShim ? "pagehide" : "unload"; - addEventListener(terminationEvent, unloadHandler, false); - } -} -function unloadHandler() { - for (let i in Request.requests) { - if (Request.requests.hasOwnProperty(i)) { - Request.requests[i].abort(); - } - } -} -var hasXHR2 = (function() { - const xhr = newRequest({ - xdomain: false - }); - return xhr && xhr.responseType !== null; -})(); -var XHR = class extends BaseXHR { - constructor(opts) { - super(opts); - const forceBase64 = opts && opts.forceBase64; - this.supportsBinary = hasXHR2 && !forceBase64; - } - request(opts = {}) { - Object.assign(opts, { xd: this.xd }, this.opts); - return new Request(newRequest, this.uri(), opts); - } -}; -function newRequest(opts) { - const xdomain = opts.xdomain; - try { - if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) { - return new XMLHttpRequest(); - } - } catch (e) { - } - if (!xdomain) { - try { - return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP"); - } catch (e) { - } - } -} - -// node_modules/engine.io-client/build/esm/transports/websocket.js -var isReactNative = typeof navigator !== "undefined" && typeof navigator.product === "string" && navigator.product.toLowerCase() === "reactnative"; -var BaseWS = class extends Transport { - get name() { - return "websocket"; - } - doOpen() { - const uri = this.uri(); - const protocols = this.opts.protocols; - const opts = isReactNative ? {} : pick(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity"); - if (this.opts.extraHeaders) { - opts.headers = this.opts.extraHeaders; - } - try { - this.ws = this.createSocket(uri, protocols, opts); - } catch (err) { - return this.emitReserved("error", err); - } - this.ws.binaryType = this.socket.binaryType; - this.addEventListeners(); - } - /** - * Adds event listeners to the socket - * - * @private - */ - addEventListeners() { - this.ws.onopen = () => { - if (this.opts.autoUnref) { - this.ws._socket.unref(); - } - this.onOpen(); - }; - this.ws.onclose = (closeEvent) => this.onClose({ - description: "websocket connection closed", - context: closeEvent - }); - this.ws.onmessage = (ev) => this.onData(ev.data); - this.ws.onerror = (e) => this.onError("websocket error", e); - } - write(packets) { - this.writable = false; - for (let i = 0; i < packets.length; i++) { - const packet = packets[i]; - const lastPacket = i === packets.length - 1; - encodePacket(packet, this.supportsBinary, (data) => { - try { - this.doWrite(packet, data); - } catch (e) { - } - if (lastPacket) { - nextTick(() => { - this.writable = true; - this.emitReserved("drain"); - }, this.setTimeoutFn); - } - }); - } - } - doClose() { - if (typeof this.ws !== "undefined") { - this.ws.onerror = () => { - }; - this.ws.close(); - this.ws = null; - } - } - /** - * Generates uri for connection. - * - * @private - */ - uri() { - const schema = this.opts.secure ? "wss" : "ws"; - const query = this.query || {}; - if (this.opts.timestampRequests) { - query[this.opts.timestampParam] = randomString(); - } - if (!this.supportsBinary) { - query.b64 = 1; - } - return this.createUri(schema, query); - } -}; -var WebSocketCtor = globalThisShim.WebSocket || globalThisShim.MozWebSocket; -var WS = class extends BaseWS { - createSocket(uri, protocols, opts) { - return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols, opts); - } - doWrite(_packet, data) { - this.ws.send(data); - } -}; - -// node_modules/engine.io-client/build/esm/transports/webtransport.js -var WT = class extends Transport { - get name() { - return "webtransport"; - } - doOpen() { - try { - this._transport = new WebTransport(this.createUri("https"), this.opts.transportOptions[this.name]); - } catch (err) { - return this.emitReserved("error", err); - } - this._transport.closed.then(() => { - this.onClose(); - }).catch((err) => { - this.onError("webtransport error", err); - }); - this._transport.ready.then(() => { - this._transport.createBidirectionalStream().then((stream) => { - const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType); - const reader = stream.readable.pipeThrough(decoderStream).getReader(); - const encoderStream = createPacketEncoderStream(); - encoderStream.readable.pipeTo(stream.writable); - this._writer = encoderStream.writable.getWriter(); - const read = () => { - reader.read().then(({ done, value: value2 }) => { - if (done) { - return; - } - this.onPacket(value2); - read(); - }).catch((err) => { - }); - }; - read(); - const packet = { type: "open" }; - if (this.query.sid) { - packet.data = `{"sid":"${this.query.sid}"}`; - } - this._writer.write(packet).then(() => this.onOpen()); - }); - }); - } - write(packets) { - this.writable = false; - for (let i = 0; i < packets.length; i++) { - const packet = packets[i]; - const lastPacket = i === packets.length - 1; - this._writer.write(packet).then(() => { - if (lastPacket) { - nextTick(() => { - this.writable = true; - this.emitReserved("drain"); - }, this.setTimeoutFn); - } - }); - } - } - doClose() { - var _a; - (_a = this._transport) === null || _a === void 0 ? void 0 : _a.close(); - } -}; - -// node_modules/engine.io-client/build/esm/transports/index.js -var transports = { - websocket: WS, - webtransport: WT, - polling: XHR -}; - -// node_modules/engine.io-client/build/esm/contrib/parseuri.js -var re = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; -var parts = [ - "source", - "protocol", - "authority", - "userInfo", - "user", - "password", - "host", - "port", - "relative", - "path", - "directory", - "file", - "query", - "anchor" -]; -function parse(str) { - if (str.length > 8e3) { - throw "URI too long"; - } - const src = str, b = str.indexOf("["), e = str.indexOf("]"); - if (b != -1 && e != -1) { - str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ";") + str.substring(e, str.length); - } - let m = re.exec(str || ""), uri = {}, i = 14; - while (i--) { - uri[parts[i]] = m[i] || ""; - } - if (b != -1 && e != -1) { - uri.source = src; - uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ":"); - uri.authority = uri.authority.replace("[", "").replace("]", "").replace(/;/g, ":"); - uri.ipv6uri = true; - } - uri.pathNames = pathNames(uri, uri["path"]); - uri.queryKey = queryKey(uri, uri["query"]); - return uri; -} -function pathNames(obj, path) { - const regx = /\/{2,9}/g, names = path.replace(regx, "/").split("/"); - if (path.slice(0, 1) == "/" || path.length === 0) { - names.splice(0, 1); - } - if (path.slice(-1) == "/") { - names.splice(names.length - 1, 1); - } - return names; -} -function queryKey(uri, query) { - const data = {}; - query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function($0, $1, $2) { - if ($1) { - data[$1] = $2; - } - }); - return data; -} - -// node_modules/engine.io-client/build/esm/socket.js -var withEventListeners = typeof addEventListener === "function" && typeof removeEventListener === "function"; -var OFFLINE_EVENT_LISTENERS = []; -if (withEventListeners) { - addEventListener("offline", () => { - OFFLINE_EVENT_LISTENERS.forEach((listener) => listener()); - }, false); -} -var SocketWithoutUpgrade = class _SocketWithoutUpgrade extends Emitter { - /** - * Socket constructor. - * - * @param {String|Object} uri - uri or options - * @param {Object} opts - options - */ - constructor(uri, opts) { - super(); - this.binaryType = defaultBinaryType; - this.writeBuffer = []; - this._prevBufferLen = 0; - this._pingInterval = -1; - this._pingTimeout = -1; - this._maxPayload = -1; - this._pingTimeoutTime = Infinity; - if (uri && "object" === typeof uri) { - opts = uri; - uri = null; - } - if (uri) { - const parsedUri = parse(uri); - opts.hostname = parsedUri.host; - opts.secure = parsedUri.protocol === "https" || parsedUri.protocol === "wss"; - opts.port = parsedUri.port; - if (parsedUri.query) - opts.query = parsedUri.query; - } else if (opts.host) { - opts.hostname = parse(opts.host).host; - } - installTimerFunctions(this, opts); - this.secure = null != opts.secure ? opts.secure : typeof location !== "undefined" && "https:" === location.protocol; - if (opts.hostname && !opts.port) { - opts.port = this.secure ? "443" : "80"; - } - this.hostname = opts.hostname || (typeof location !== "undefined" ? location.hostname : "localhost"); - this.port = opts.port || (typeof location !== "undefined" && location.port ? location.port : this.secure ? "443" : "80"); - this.transports = []; - this._transportsByName = {}; - opts.transports.forEach((t) => { - const transportName = t.prototype.name; - this.transports.push(transportName); - this._transportsByName[transportName] = t; - }); - this.opts = Object.assign({ - path: "/engine.io", - agent: false, - withCredentials: false, - upgrade: true, - timestampParam: "t", - rememberUpgrade: false, - addTrailingSlash: true, - rejectUnauthorized: true, - perMessageDeflate: { - threshold: 1024 - }, - transportOptions: {}, - closeOnBeforeunload: false - }, opts); - this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""); - if (typeof this.opts.query === "string") { - this.opts.query = decode2(this.opts.query); - } - if (withEventListeners) { - if (this.opts.closeOnBeforeunload) { - this._beforeunloadEventListener = () => { - if (this.transport) { - this.transport.removeAllListeners(); - this.transport.close(); - } - }; - addEventListener("beforeunload", this._beforeunloadEventListener, false); - } - if (this.hostname !== "localhost") { - this._offlineEventListener = () => { - this._onClose("transport close", { - description: "network connection lost" - }); - }; - OFFLINE_EVENT_LISTENERS.push(this._offlineEventListener); - } - } - if (this.opts.withCredentials) { - this._cookieJar = createCookieJar(); - } - this._open(); - } - /** - * Creates transport of the given type. - * - * @param {String} name - transport name - * @return {Transport} - * @private - */ - createTransport(name) { - const query = Object.assign({}, this.opts.query); - query.EIO = protocol; - query.transport = name; - if (this.id) - query.sid = this.id; - const opts = Object.assign({}, this.opts, { - query, - socket: this, - hostname: this.hostname, - secure: this.secure, - port: this.port - }, this.opts.transportOptions[name]); - return new this._transportsByName[name](opts); - } - /** - * Initializes transport to use and starts probe. - * - * @private - */ - _open() { - if (this.transports.length === 0) { - this.setTimeoutFn(() => { - this.emitReserved("error", "No transports available"); - }, 0); - return; - } - const transportName = this.opts.rememberUpgrade && _SocketWithoutUpgrade.priorWebsocketSuccess && this.transports.indexOf("websocket") !== -1 ? "websocket" : this.transports[0]; - this.readyState = "opening"; - const transport = this.createTransport(transportName); - transport.open(); - this.setTransport(transport); - } - /** - * Sets the current transport. Disables the existing one (if any). - * - * @private - */ - setTransport(transport) { - if (this.transport) { - this.transport.removeAllListeners(); - } - this.transport = transport; - transport.on("drain", this._onDrain.bind(this)).on("packet", this._onPacket.bind(this)).on("error", this._onError.bind(this)).on("close", (reason) => this._onClose("transport close", reason)); - } - /** - * Called when connection is deemed open. - * - * @private - */ - onOpen() { - this.readyState = "open"; - _SocketWithoutUpgrade.priorWebsocketSuccess = "websocket" === this.transport.name; - this.emitReserved("open"); - this.flush(); - } - /** - * Handles a packet. - * - * @private - */ - _onPacket(packet) { - if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) { - this.emitReserved("packet", packet); - this.emitReserved("heartbeat"); - switch (packet.type) { - case "open": - this.onHandshake(JSON.parse(packet.data)); - break; - case "ping": - this._sendPacket("pong"); - this.emitReserved("ping"); - this.emitReserved("pong"); - this._resetPingTimeout(); - break; - case "error": - const err = new Error("server error"); - err.code = packet.data; - this._onError(err); - break; - case "message": - this.emitReserved("data", packet.data); - this.emitReserved("message", packet.data); - break; - } - } else { - } - } - /** - * Called upon handshake completion. - * - * @param {Object} data - handshake obj - * @private - */ - onHandshake(data) { - this.emitReserved("handshake", data); - this.id = data.sid; - this.transport.query.sid = data.sid; - this._pingInterval = data.pingInterval; - this._pingTimeout = data.pingTimeout; - this._maxPayload = data.maxPayload; - this.onOpen(); - if ("closed" === this.readyState) - return; - this._resetPingTimeout(); - } - /** - * Sets and resets ping timeout timer based on server pings. - * - * @private - */ - _resetPingTimeout() { - this.clearTimeoutFn(this._pingTimeoutTimer); - const delay = this._pingInterval + this._pingTimeout; - this._pingTimeoutTime = Date.now() + delay; - this._pingTimeoutTimer = this.setTimeoutFn(() => { - this._onClose("ping timeout"); - }, delay); - if (this.opts.autoUnref) { - this._pingTimeoutTimer.unref(); - } - } - /** - * Called on `drain` event - * - * @private - */ - _onDrain() { - this.writeBuffer.splice(0, this._prevBufferLen); - this._prevBufferLen = 0; - if (0 === this.writeBuffer.length) { - this.emitReserved("drain"); - } else { - this.flush(); - } - } - /** - * Flush write buffers. - * - * @private - */ - flush() { - if ("closed" !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length) { - const packets = this._getWritablePackets(); - this.transport.send(packets); - this._prevBufferLen = packets.length; - this.emitReserved("flush"); - } - } - /** - * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP - * long-polling) - * - * @private - */ - _getWritablePackets() { - const shouldCheckPayloadSize = this._maxPayload && this.transport.name === "polling" && this.writeBuffer.length > 1; - if (!shouldCheckPayloadSize) { - return this.writeBuffer; - } - let payloadSize = 1; - for (let i = 0; i < this.writeBuffer.length; i++) { - const data = this.writeBuffer[i].data; - if (data) { - payloadSize += byteLength(data); - } - if (i > 0 && payloadSize > this._maxPayload) { - return this.writeBuffer.slice(0, i); - } - payloadSize += 2; - } - return this.writeBuffer; - } - /** - * Checks whether the heartbeat timer has expired but the socket has not yet been notified. - * - * Note: this method is private for now because it does not really fit the WebSocket API, but if we put it in the - * `write()` method then the message would not be buffered by the Socket.IO client. - * - * @return {boolean} - * @private - */ - /* private */ - _hasPingExpired() { - if (!this._pingTimeoutTime) - return true; - const hasExpired = Date.now() > this._pingTimeoutTime; - if (hasExpired) { - this._pingTimeoutTime = 0; - nextTick(() => { - this._onClose("ping timeout"); - }, this.setTimeoutFn); - } - return hasExpired; - } - /** - * Sends a message. - * - * @param {String} msg - message. - * @param {Object} options. - * @param {Function} fn - callback function. - * @return {Socket} for chaining. - */ - write(msg, options, fn) { - this._sendPacket("message", msg, options, fn); - return this; - } - /** - * Sends a message. Alias of {@link Socket#write}. - * - * @param {String} msg - message. - * @param {Object} options. - * @param {Function} fn - callback function. - * @return {Socket} for chaining. - */ - send(msg, options, fn) { - this._sendPacket("message", msg, options, fn); - return this; - } - /** - * Sends a packet. - * - * @param {String} type: packet type. - * @param {String} data. - * @param {Object} options. - * @param {Function} fn - callback function. - * @private - */ - _sendPacket(type, data, options, fn) { - if ("function" === typeof data) { - fn = data; - data = void 0; - } - if ("function" === typeof options) { - fn = options; - options = null; - } - if ("closing" === this.readyState || "closed" === this.readyState) { - return; - } - options = options || {}; - options.compress = false !== options.compress; - const packet = { - type, - data, - options - }; - this.emitReserved("packetCreate", packet); - this.writeBuffer.push(packet); - if (fn) - this.once("flush", fn); - this.flush(); - } - /** - * Closes the connection. - */ - close() { - const close = () => { - this._onClose("forced close"); - this.transport.close(); - }; - const cleanupAndClose = () => { - this.off("upgrade", cleanupAndClose); - this.off("upgradeError", cleanupAndClose); - close(); - }; - const waitForUpgrade = () => { - this.once("upgrade", cleanupAndClose); - this.once("upgradeError", cleanupAndClose); - }; - if ("opening" === this.readyState || "open" === this.readyState) { - this.readyState = "closing"; - if (this.writeBuffer.length) { - this.once("drain", () => { - if (this.upgrading) { - waitForUpgrade(); - } else { - close(); - } - }); - } else if (this.upgrading) { - waitForUpgrade(); - } else { - close(); - } - } - return this; - } - /** - * Called upon transport error - * - * @private - */ - _onError(err) { - _SocketWithoutUpgrade.priorWebsocketSuccess = false; - if (this.opts.tryAllTransports && this.transports.length > 1 && this.readyState === "opening") { - this.transports.shift(); - return this._open(); - } - this.emitReserved("error", err); - this._onClose("transport error", err); - } - /** - * Called upon transport close. - * - * @private - */ - _onClose(reason, description) { - if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) { - this.clearTimeoutFn(this._pingTimeoutTimer); - this.transport.removeAllListeners("close"); - this.transport.close(); - this.transport.removeAllListeners(); - if (withEventListeners) { - if (this._beforeunloadEventListener) { - removeEventListener("beforeunload", this._beforeunloadEventListener, false); - } - if (this._offlineEventListener) { - const i = OFFLINE_EVENT_LISTENERS.indexOf(this._offlineEventListener); - if (i !== -1) { - OFFLINE_EVENT_LISTENERS.splice(i, 1); - } - } - } - this.readyState = "closed"; - this.id = null; - this.emitReserved("close", reason, description); - this.writeBuffer = []; - this._prevBufferLen = 0; - } - } -}; -SocketWithoutUpgrade.protocol = protocol; -var SocketWithUpgrade = class extends SocketWithoutUpgrade { - constructor() { - super(...arguments); - this._upgrades = []; - } - onOpen() { - super.onOpen(); - if ("open" === this.readyState && this.opts.upgrade) { - for (let i = 0; i < this._upgrades.length; i++) { - this._probe(this._upgrades[i]); - } - } - } - /** - * Probes a transport. - * - * @param {String} name - transport name - * @private - */ - _probe(name) { - let transport = this.createTransport(name); - let failed = false; - SocketWithoutUpgrade.priorWebsocketSuccess = false; - const onTransportOpen = () => { - if (failed) - return; - transport.send([{ type: "ping", data: "probe" }]); - transport.once("packet", (msg) => { - if (failed) - return; - if ("pong" === msg.type && "probe" === msg.data) { - this.upgrading = true; - this.emitReserved("upgrading", transport); - if (!transport) - return; - SocketWithoutUpgrade.priorWebsocketSuccess = "websocket" === transport.name; - this.transport.pause(() => { - if (failed) - return; - if ("closed" === this.readyState) - return; - cleanup(); - this.setTransport(transport); - transport.send([{ type: "upgrade" }]); - this.emitReserved("upgrade", transport); - transport = null; - this.upgrading = false; - this.flush(); - }); - } else { - const err = new Error("probe error"); - err.transport = transport.name; - this.emitReserved("upgradeError", err); - } - }); - }; - function freezeTransport() { - if (failed) - return; - failed = true; - cleanup(); - transport.close(); - transport = null; - } - const onerror = (err) => { - const error = new Error("probe error: " + err); - error.transport = transport.name; - freezeTransport(); - this.emitReserved("upgradeError", error); - }; - function onTransportClose() { - onerror("transport closed"); - } - function onclose() { - onerror("socket closed"); - } - function onupgrade(to) { - if (transport && to.name !== transport.name) { - freezeTransport(); - } - } - const cleanup = () => { - transport.removeListener("open", onTransportOpen); - transport.removeListener("error", onerror); - transport.removeListener("close", onTransportClose); - this.off("close", onclose); - this.off("upgrading", onupgrade); - }; - transport.once("open", onTransportOpen); - transport.once("error", onerror); - transport.once("close", onTransportClose); - this.once("close", onclose); - this.once("upgrading", onupgrade); - if (this._upgrades.indexOf("webtransport") !== -1 && name !== "webtransport") { - this.setTimeoutFn(() => { - if (!failed) { - transport.open(); - } - }, 200); - } else { - transport.open(); - } - } - onHandshake(data) { - this._upgrades = this._filterUpgrades(data.upgrades); - super.onHandshake(data); - } - /** - * Filters upgrades, returning only those matching client transports. - * - * @param {Array} upgrades - server upgrades - * @private - */ - _filterUpgrades(upgrades) { - const filteredUpgrades = []; - for (let i = 0; i < upgrades.length; i++) { - if (~this.transports.indexOf(upgrades[i])) - filteredUpgrades.push(upgrades[i]); - } - return filteredUpgrades; - } -}; -var Socket = class extends SocketWithUpgrade { - constructor(uri, opts = {}) { - const o = typeof uri === "object" ? uri : opts; - if (!o.transports || o.transports && typeof o.transports[0] === "string") { - o.transports = (o.transports || ["polling", "websocket", "webtransport"]).map((transportName) => transports[transportName]).filter((t) => !!t); - } - super(uri, o); - } -}; - -// node_modules/engine.io-client/build/esm/index.js -var protocol2 = Socket.protocol; - -// node_modules/socket.io-client/build/esm/url.js -function url(uri, path = "", loc) { - let obj = uri; - loc = loc || typeof location !== "undefined" && location; - if (null == uri) - uri = loc.protocol + "//" + loc.host; - if (typeof uri === "string") { - if ("/" === uri.charAt(0)) { - if ("/" === uri.charAt(1)) { - uri = loc.protocol + uri; - } else { - uri = loc.host + uri; - } - } - if (!/^(https?|wss?):\/\//.test(uri)) { - if ("undefined" !== typeof loc) { - uri = loc.protocol + "//" + uri; - } else { - uri = "https://" + uri; - } - } - obj = parse(uri); - } - if (!obj.port) { - if (/^(http|ws)$/.test(obj.protocol)) { - obj.port = "80"; - } else if (/^(http|ws)s$/.test(obj.protocol)) { - obj.port = "443"; - } - } - obj.path = obj.path || "/"; - const ipv6 = obj.host.indexOf(":") !== -1; - const host = ipv6 ? "[" + obj.host + "]" : obj.host; - obj.id = obj.protocol + "://" + host + ":" + obj.port + path; - obj.href = obj.protocol + "://" + host + (loc && loc.port === obj.port ? "" : ":" + obj.port); - return obj; -} - -// node_modules/socket.io-parser/build/esm-debug/index.js -var esm_debug_exports = {}; -__export(esm_debug_exports, { - Decoder: () => Decoder, - Encoder: () => Encoder, - PacketType: () => PacketType, - isPacketValid: () => isPacketValid, - protocol: () => protocol3 -}); - -// node_modules/socket.io-parser/build/esm-debug/is-binary.js -var withNativeArrayBuffer3 = typeof ArrayBuffer === "function"; -var isView2 = (obj) => { - return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer; -}; -var toString = Object.prototype.toString; -var withNativeBlob2 = typeof Blob === "function" || typeof Blob !== "undefined" && toString.call(Blob) === "[object BlobConstructor]"; -var withNativeFile = typeof File === "function" || typeof File !== "undefined" && toString.call(File) === "[object FileConstructor]"; -function isBinary(obj) { - return withNativeArrayBuffer3 && (obj instanceof ArrayBuffer || isView2(obj)) || withNativeBlob2 && obj instanceof Blob || withNativeFile && obj instanceof File; -} -function hasBinary(obj, toJSON) { - if (!obj || typeof obj !== "object") { - return false; - } - if (Array.isArray(obj)) { - for (let i = 0, l = obj.length; i < l; i++) { - if (hasBinary(obj[i])) { - return true; - } - } - return false; - } - if (isBinary(obj)) { - return true; - } - if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) { - return hasBinary(obj.toJSON(), true); - } - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) { - return true; - } - } - return false; -} - -// node_modules/socket.io-parser/build/esm-debug/binary.js -function deconstructPacket(packet) { - const buffers = []; - const packetData = packet.data; - const pack = packet; - pack.data = _deconstructPacket(packetData, buffers); - pack.attachments = buffers.length; - return { packet: pack, buffers }; -} -function _deconstructPacket(data, buffers) { - if (!data) - return data; - if (isBinary(data)) { - const placeholder = { _placeholder: true, num: buffers.length }; - buffers.push(data); - return placeholder; - } else if (Array.isArray(data)) { - const newData = new Array(data.length); - for (let i = 0; i < data.length; i++) { - newData[i] = _deconstructPacket(data[i], buffers); - } - return newData; - } else if (typeof data === "object" && !(data instanceof Date)) { - const newData = {}; - for (const key in data) { - if (Object.prototype.hasOwnProperty.call(data, key)) { - newData[key] = _deconstructPacket(data[key], buffers); - } - } - return newData; - } - return data; -} -function reconstructPacket(packet, buffers) { - packet.data = _reconstructPacket(packet.data, buffers); - delete packet.attachments; - return packet; -} -function _reconstructPacket(data, buffers) { - if (!data) - return data; - if (data && data._placeholder === true) { - const isIndexValid = typeof data.num === "number" && data.num >= 0 && data.num < buffers.length; - if (isIndexValid) { - return buffers[data.num]; - } else { - throw new Error("illegal attachments"); - } - } else if (Array.isArray(data)) { - for (let i = 0; i < data.length; i++) { - data[i] = _reconstructPacket(data[i], buffers); - } - } else if (typeof data === "object") { - for (const key in data) { - if (Object.prototype.hasOwnProperty.call(data, key)) { - data[key] = _reconstructPacket(data[key], buffers); - } - } - } - return data; -} - -// node_modules/socket.io-parser/build/esm-debug/index.js -var import_debug = __toESM(require_browser()); -var debug = (0, import_debug.default)("socket.io-parser"); -var RESERVED_EVENTS = [ - "connect", - // used on the client side - "connect_error", - // used on the client side - "disconnect", - // used on both sides - "disconnecting", - // used on the server side - "newListener", - // used by the Node.js EventEmitter - "removeListener" - // used by the Node.js EventEmitter -]; -var protocol3 = 5; -var PacketType; -(function(PacketType2) { - PacketType2[PacketType2["CONNECT"] = 0] = "CONNECT"; - PacketType2[PacketType2["DISCONNECT"] = 1] = "DISCONNECT"; - PacketType2[PacketType2["EVENT"] = 2] = "EVENT"; - PacketType2[PacketType2["ACK"] = 3] = "ACK"; - PacketType2[PacketType2["CONNECT_ERROR"] = 4] = "CONNECT_ERROR"; - PacketType2[PacketType2["BINARY_EVENT"] = 5] = "BINARY_EVENT"; - PacketType2[PacketType2["BINARY_ACK"] = 6] = "BINARY_ACK"; -})(PacketType || (PacketType = {})); -var Encoder = class { - /** - * Encoder constructor - * - * @param {function} replacer - custom replacer to pass down to JSON.parse - */ - constructor(replacer) { - this.replacer = replacer; - } - /** - * Encode a packet as a single string if non-binary, or as a - * buffer sequence, depending on packet type. - * - * @param {Object} obj - packet object - */ - encode(obj) { - debug("encoding packet %j", obj); - if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) { - if (hasBinary(obj)) { - return this.encodeAsBinary({ - type: obj.type === PacketType.EVENT ? PacketType.BINARY_EVENT : PacketType.BINARY_ACK, - nsp: obj.nsp, - data: obj.data, - id: obj.id - }); - } - } - return [this.encodeAsString(obj)]; - } - /** - * Encode packet as string. - */ - encodeAsString(obj) { - let str = "" + obj.type; - if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) { - str += obj.attachments + "-"; - } - if (obj.nsp && "/" !== obj.nsp) { - str += obj.nsp + ","; - } - if (null != obj.id) { - str += obj.id; - } - if (null != obj.data) { - str += JSON.stringify(obj.data, this.replacer); - } - debug("encoded %j as %s", obj, str); - return str; - } - /** - * Encode packet as 'buffer sequence' by removing blobs, and - * deconstructing packet into object with placeholders and - * a list of buffers. - */ - encodeAsBinary(obj) { - const deconstruction = deconstructPacket(obj); - const pack = this.encodeAsString(deconstruction.packet); - const buffers = deconstruction.buffers; - buffers.unshift(pack); - return buffers; - } -}; -var Decoder = class _Decoder extends Emitter { - /** - * Decoder constructor - * - * @param {function} reviver - custom reviver to pass down to JSON.stringify - */ - constructor(reviver) { - super(); - this.reviver = reviver; - } - /** - * Decodes an encoded packet string into packet JSON. - * - * @param {String} obj - encoded packet - */ - add(obj) { - let packet; - if (typeof obj === "string") { - if (this.reconstructor) { - throw new Error("got plaintext data when reconstructing a packet"); - } - packet = this.decodeString(obj); - const isBinaryEvent = packet.type === PacketType.BINARY_EVENT; - if (isBinaryEvent || packet.type === PacketType.BINARY_ACK) { - packet.type = isBinaryEvent ? PacketType.EVENT : PacketType.ACK; - this.reconstructor = new BinaryReconstructor(packet); - if (packet.attachments === 0) { - super.emitReserved("decoded", packet); - } - } else { - super.emitReserved("decoded", packet); - } - } else if (isBinary(obj) || obj.base64) { - if (!this.reconstructor) { - throw new Error("got binary data when not reconstructing a packet"); - } else { - packet = this.reconstructor.takeBinaryData(obj); - if (packet) { - this.reconstructor = null; - super.emitReserved("decoded", packet); - } - } - } else { - throw new Error("Unknown type: " + obj); - } - } - /** - * Decode a packet String (JSON data) - * - * @param {String} str - * @return {Object} packet - */ - decodeString(str) { - let i = 0; - const p = { - type: Number(str.charAt(0)) - }; - if (PacketType[p.type] === void 0) { - throw new Error("unknown packet type " + p.type); - } - if (p.type === PacketType.BINARY_EVENT || p.type === PacketType.BINARY_ACK) { - const start = i + 1; - while (str.charAt(++i) !== "-" && i != str.length) { - } - const buf = str.substring(start, i); - if (buf != Number(buf) || str.charAt(i) !== "-") { - throw new Error("Illegal attachments"); - } - p.attachments = Number(buf); - } - if ("/" === str.charAt(i + 1)) { - const start = i + 1; - while (++i) { - const c = str.charAt(i); - if ("," === c) - break; - if (i === str.length) - break; - } - p.nsp = str.substring(start, i); - } else { - p.nsp = "/"; - } - const next = str.charAt(i + 1); - if ("" !== next && Number(next) == next) { - const start = i + 1; - while (++i) { - const c = str.charAt(i); - if (null == c || Number(c) != c) { - --i; - break; - } - if (i === str.length) - break; - } - p.id = Number(str.substring(start, i + 1)); - } - if (str.charAt(++i)) { - const payload = this.tryParse(str.substr(i)); - if (_Decoder.isPayloadValid(p.type, payload)) { - p.data = payload; - } else { - throw new Error("invalid payload"); - } - } - debug("decoded %s as %j", str, p); - return p; - } - tryParse(str) { - try { - return JSON.parse(str, this.reviver); - } catch (e) { - return false; - } - } - static isPayloadValid(type, payload) { - switch (type) { - case PacketType.CONNECT: - return isObject(payload); - case PacketType.DISCONNECT: - return payload === void 0; - case PacketType.CONNECT_ERROR: - return typeof payload === "string" || isObject(payload); - case PacketType.EVENT: - case PacketType.BINARY_EVENT: - return Array.isArray(payload) && (typeof payload[0] === "number" || typeof payload[0] === "string" && RESERVED_EVENTS.indexOf(payload[0]) === -1); - case PacketType.ACK: - case PacketType.BINARY_ACK: - return Array.isArray(payload); - } - } - /** - * Deallocates a parser's resources - */ - destroy() { - if (this.reconstructor) { - this.reconstructor.finishedReconstruction(); - this.reconstructor = null; - } - } -}; -var BinaryReconstructor = class { - constructor(packet) { - this.packet = packet; - this.buffers = []; - this.reconPack = packet; - } - /** - * Method to be called when binary data received from connection - * after a BINARY_EVENT packet. - * - * @param {Buffer | ArrayBuffer} binData - the raw binary data received - * @return {null | Object} returns null if more binary data is expected or - * a reconstructed packet object if all buffers have been received. - */ - takeBinaryData(binData) { - this.buffers.push(binData); - if (this.buffers.length === this.reconPack.attachments) { - const packet = reconstructPacket(this.reconPack, this.buffers); - this.finishedReconstruction(); - return packet; - } - return null; - } - /** - * Cleans up binary packet reconstruction variables. - */ - finishedReconstruction() { - this.reconPack = null; - this.buffers = []; - } -}; -function isNamespaceValid(nsp) { - return typeof nsp === "string"; -} -var isInteger = Number.isInteger || function(value2) { - return typeof value2 === "number" && isFinite(value2) && Math.floor(value2) === value2; -}; -function isAckIdValid(id) { - return id === void 0 || isInteger(id); -} -function isObject(value2) { - return Object.prototype.toString.call(value2) === "[object Object]"; -} -function isDataValid(type, payload) { - switch (type) { - case PacketType.CONNECT: - return payload === void 0 || isObject(payload); - case PacketType.DISCONNECT: - return payload === void 0; - case PacketType.EVENT: - return Array.isArray(payload) && (typeof payload[0] === "number" || typeof payload[0] === "string" && RESERVED_EVENTS.indexOf(payload[0]) === -1); - case PacketType.ACK: - return Array.isArray(payload); - case PacketType.CONNECT_ERROR: - return typeof payload === "string" || isObject(payload); - default: - return false; - } -} -function isPacketValid(packet) { - return isNamespaceValid(packet.nsp) && isAckIdValid(packet.id) && isDataValid(packet.type, packet.data); -} - -// node_modules/socket.io-client/build/esm/on.js -function on(obj, ev, fn) { - obj.on(ev, fn); - return function subDestroy() { - obj.off(ev, fn); - }; -} - -// node_modules/socket.io-client/build/esm/socket.js -var RESERVED_EVENTS2 = Object.freeze({ - connect: 1, - connect_error: 1, - disconnect: 1, - disconnecting: 1, - // EventEmitter reserved events: https://nodejs.org/api/events.html#events_event_newlistener - newListener: 1, - removeListener: 1 -}); -var Socket2 = class extends Emitter { - /** - * `Socket` constructor. - */ - constructor(io, nsp, opts) { - super(); - this.connected = false; - this.recovered = false; - this.receiveBuffer = []; - this.sendBuffer = []; - this._queue = []; - this._queueSeq = 0; - this.ids = 0; - this.acks = {}; - this.flags = {}; - this.io = io; - this.nsp = nsp; - if (opts && opts.auth) { - this.auth = opts.auth; - } - this._opts = Object.assign({}, opts); - if (this.io._autoConnect) - this.open(); - } - /** - * Whether the socket is currently disconnected - * - * @example - * const socket = io(); - * - * socket.on("connect", () => { - * console.log(socket.disconnected); // false - * }); - * - * socket.on("disconnect", () => { - * console.log(socket.disconnected); // true - * }); - */ - get disconnected() { - return !this.connected; - } - /** - * Subscribe to open, close and packet events - * - * @private - */ - subEvents() { - if (this.subs) - return; - const io = this.io; - this.subs = [ - on(io, "open", this.onopen.bind(this)), - on(io, "packet", this.onpacket.bind(this)), - on(io, "error", this.onerror.bind(this)), - on(io, "close", this.onclose.bind(this)) - ]; - } - /** - * Whether the Socket will try to reconnect when its Manager connects or reconnects. - * - * @example - * const socket = io(); - * - * console.log(socket.active); // true - * - * socket.on("disconnect", (reason) => { - * if (reason === "io server disconnect") { - * // the disconnection was initiated by the server, you need to manually reconnect - * console.log(socket.active); // false - * } - * // else the socket will automatically try to reconnect - * console.log(socket.active); // true - * }); - */ - get active() { - return !!this.subs; - } - /** - * "Opens" the socket. - * - * @example - * const socket = io({ - * autoConnect: false - * }); - * - * socket.connect(); - */ - connect() { - if (this.connected) - return this; - this.subEvents(); - if (!this.io["_reconnecting"]) - this.io.open(); - if ("open" === this.io._readyState) - this.onopen(); - return this; - } - /** - * Alias for {@link connect()}. - */ - open() { - return this.connect(); - } - /** - * Sends a `message` event. - * - * This method mimics the WebSocket.send() method. - * - * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send - * - * @example - * socket.send("hello"); - * - * // this is equivalent to - * socket.emit("message", "hello"); - * - * @return self - */ - send(...args) { - args.unshift("message"); - this.emit.apply(this, args); - return this; - } - /** - * Override `emit`. - * If the event is in `events`, it's emitted normally. - * - * @example - * socket.emit("hello", "world"); - * - * // all serializable datastructures are supported (no need to call JSON.stringify) - * socket.emit("hello", 1, "2", { 3: ["4"], 5: Uint8Array.from([6]) }); - * - * // with an acknowledgement from the server - * socket.emit("hello", "world", (val) => { - * // ... - * }); - * - * @return self - */ - emit(ev, ...args) { - var _a, _b, _c; - if (RESERVED_EVENTS2.hasOwnProperty(ev)) { - throw new Error('"' + ev.toString() + '" is a reserved event name'); - } - args.unshift(ev); - if (this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) { - this._addToQueue(args); - return this; - } - const packet = { - type: PacketType.EVENT, - data: args - }; - packet.options = {}; - packet.options.compress = this.flags.compress !== false; - if ("function" === typeof args[args.length - 1]) { - const id = this.ids++; - const ack = args.pop(); - this._registerAckCallback(id, ack); - packet.id = id; - } - const isTransportWritable = (_b = (_a = this.io.engine) === null || _a === void 0 ? void 0 : _a.transport) === null || _b === void 0 ? void 0 : _b.writable; - const isConnected = this.connected && !((_c = this.io.engine) === null || _c === void 0 ? void 0 : _c._hasPingExpired()); - const discardPacket = this.flags.volatile && !isTransportWritable; - if (discardPacket) { - } else if (isConnected) { - this.notifyOutgoingListeners(packet); - this.packet(packet); - } else { - this.sendBuffer.push(packet); - } - this.flags = {}; - return this; - } - /** - * @private - */ - _registerAckCallback(id, ack) { - var _a; - const timeout = (_a = this.flags.timeout) !== null && _a !== void 0 ? _a : this._opts.ackTimeout; - if (timeout === void 0) { - this.acks[id] = ack; - return; - } - const timer = this.io.setTimeoutFn(() => { - delete this.acks[id]; - for (let i = 0; i < this.sendBuffer.length; i++) { - if (this.sendBuffer[i].id === id) { - this.sendBuffer.splice(i, 1); - } - } - ack.call(this, new Error("operation has timed out")); - }, timeout); - const fn = (...args) => { - this.io.clearTimeoutFn(timer); - ack.apply(this, args); - }; - fn.withError = true; - this.acks[id] = fn; - } - /** - * Emits an event and waits for an acknowledgement - * - * @example - * // without timeout - * const response = await socket.emitWithAck("hello", "world"); - * - * // with a specific timeout - * try { - * const response = await socket.timeout(1000).emitWithAck("hello", "world"); - * } catch (err) { - * // the server did not acknowledge the event in the given delay - * } - * - * @return a Promise that will be fulfilled when the server acknowledges the event - */ - emitWithAck(ev, ...args) { - return new Promise((resolve, reject) => { - const fn = (arg1, arg2) => { - return arg1 ? reject(arg1) : resolve(arg2); - }; - fn.withError = true; - args.push(fn); - this.emit(ev, ...args); - }); - } - /** - * Add the packet to the queue. - * @param args - * @private - */ - _addToQueue(args) { - let ack; - if (typeof args[args.length - 1] === "function") { - ack = args.pop(); - } - const packet = { - id: this._queueSeq++, - tryCount: 0, - pending: false, - args, - flags: Object.assign({ fromQueue: true }, this.flags) - }; - args.push((err, ...responseArgs) => { - if (packet !== this._queue[0]) { - } - const hasError = err !== null; - if (hasError) { - if (packet.tryCount > this._opts.retries) { - this._queue.shift(); - if (ack) { - ack(err); - } - } - } else { - this._queue.shift(); - if (ack) { - ack(null, ...responseArgs); - } - } - packet.pending = false; - return this._drainQueue(); - }); - this._queue.push(packet); - this._drainQueue(); - } - /** - * Send the first packet of the queue, and wait for an acknowledgement from the server. - * @param force - whether to resend a packet that has not been acknowledged yet - * - * @private - */ - _drainQueue(force = false) { - if (!this.connected || this._queue.length === 0) { - return; - } - const packet = this._queue[0]; - if (packet.pending && !force) { - return; - } - packet.pending = true; - packet.tryCount++; - this.flags = packet.flags; - this.emit.apply(this, packet.args); - } - /** - * Sends a packet. - * - * @param packet - * @private - */ - packet(packet) { - packet.nsp = this.nsp; - this.io._packet(packet); - } - /** - * Called upon engine `open`. - * - * @private - */ - onopen() { - if (typeof this.auth == "function") { - this.auth((data) => { - this._sendConnectPacket(data); - }); - } else { - this._sendConnectPacket(this.auth); - } - } - /** - * Sends a CONNECT packet to initiate the Socket.IO session. - * - * @param data - * @private - */ - _sendConnectPacket(data) { - this.packet({ - type: PacketType.CONNECT, - data: this._pid ? Object.assign({ pid: this._pid, offset: this._lastOffset }, data) : data - }); - } - /** - * Called upon engine or manager `error`. - * - * @param err - * @private - */ - onerror(err) { - if (!this.connected) { - this.emitReserved("connect_error", err); - } - } - /** - * Called upon engine `close`. - * - * @param reason - * @param description - * @private - */ - onclose(reason, description) { - this.connected = false; - delete this.id; - this.emitReserved("disconnect", reason, description); - this._clearAcks(); - } - /** - * Clears the acknowledgement handlers upon disconnection, since the client will never receive an acknowledgement from - * the server. - * - * @private - */ - _clearAcks() { - Object.keys(this.acks).forEach((id) => { - const isBuffered = this.sendBuffer.some((packet) => String(packet.id) === id); - if (!isBuffered) { - const ack = this.acks[id]; - delete this.acks[id]; - if (ack.withError) { - ack.call(this, new Error("socket has been disconnected")); - } - } - }); - } - /** - * Called with socket packet. - * - * @param packet - * @private - */ - onpacket(packet) { - const sameNamespace = packet.nsp === this.nsp; - if (!sameNamespace) - return; - switch (packet.type) { - case PacketType.CONNECT: - if (packet.data && packet.data.sid) { - this.onconnect(packet.data.sid, packet.data.pid); - } else { - this.emitReserved("connect_error", new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)")); - } - break; - case PacketType.EVENT: - case PacketType.BINARY_EVENT: - this.onevent(packet); - break; - case PacketType.ACK: - case PacketType.BINARY_ACK: - this.onack(packet); - break; - case PacketType.DISCONNECT: - this.ondisconnect(); - break; - case PacketType.CONNECT_ERROR: - this.destroy(); - const err = new Error(packet.data.message); - err.data = packet.data.data; - this.emitReserved("connect_error", err); - break; - } - } - /** - * Called upon a server event. - * - * @param packet - * @private - */ - onevent(packet) { - const args = packet.data || []; - if (null != packet.id) { - args.push(this.ack(packet.id)); - } - if (this.connected) { - this.emitEvent(args); - } else { - this.receiveBuffer.push(Object.freeze(args)); - } - } - emitEvent(args) { - if (this._anyListeners && this._anyListeners.length) { - const listeners = this._anyListeners.slice(); - for (const listener of listeners) { - listener.apply(this, args); - } - } - super.emit.apply(this, args); - if (this._pid && args.length && typeof args[args.length - 1] === "string") { - this._lastOffset = args[args.length - 1]; - } - } - /** - * Produces an ack callback to emit with an event. - * - * @private - */ - ack(id) { - const self2 = this; - let sent = false; - return function(...args) { - if (sent) - return; - sent = true; - self2.packet({ - type: PacketType.ACK, - id, - data: args - }); - }; - } - /** - * Called upon a server acknowledgement. - * - * @param packet - * @private - */ - onack(packet) { - const ack = this.acks[packet.id]; - if (typeof ack !== "function") { - return; - } - delete this.acks[packet.id]; - if (ack.withError) { - packet.data.unshift(null); - } - ack.apply(this, packet.data); - } - /** - * Called upon server connect. - * - * @private - */ - onconnect(id, pid) { - this.id = id; - this.recovered = pid && this._pid === pid; - this._pid = pid; - this.connected = true; - this.emitBuffered(); - this._drainQueue(true); - this.emitReserved("connect"); - } - /** - * Emit buffered events (received and emitted). - * - * @private - */ - emitBuffered() { - this.receiveBuffer.forEach((args) => this.emitEvent(args)); - this.receiveBuffer = []; - this.sendBuffer.forEach((packet) => { - this.notifyOutgoingListeners(packet); - this.packet(packet); - }); - this.sendBuffer = []; - } - /** - * Called upon server disconnect. - * - * @private - */ - ondisconnect() { - this.destroy(); - this.onclose("io server disconnect"); - } - /** - * Called upon forced client/server side disconnections, - * this method ensures the manager stops tracking us and - * that reconnections don't get triggered for this. - * - * @private - */ - destroy() { - if (this.subs) { - this.subs.forEach((subDestroy) => subDestroy()); - this.subs = void 0; - } - this.io["_destroy"](this); - } - /** - * Disconnects the socket manually. In that case, the socket will not try to reconnect. - * - * If this is the last active Socket instance of the {@link Manager}, the low-level connection will be closed. - * - * @example - * const socket = io(); - * - * socket.on("disconnect", (reason) => { - * // console.log(reason); prints "io client disconnect" - * }); - * - * socket.disconnect(); - * - * @return self - */ - disconnect() { - if (this.connected) { - this.packet({ type: PacketType.DISCONNECT }); - } - this.destroy(); - if (this.connected) { - this.onclose("io client disconnect"); - } - return this; - } - /** - * Alias for {@link disconnect()}. - * - * @return self - */ - close() { - return this.disconnect(); - } - /** - * Sets the compress flag. - * - * @example - * socket.compress(false).emit("hello"); - * - * @param compress - if `true`, compresses the sending data - * @return self - */ - compress(compress) { - this.flags.compress = compress; - return this; - } - /** - * Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not - * ready to send messages. - * - * @example - * socket.volatile.emit("hello"); // the server may or may not receive it - * - * @returns self - */ - get volatile() { - this.flags.volatile = true; - return this; - } - /** - * Sets a modifier for a subsequent event emission that the callback will be called with an error when the - * given number of milliseconds have elapsed without an acknowledgement from the server: - * - * @example - * socket.timeout(5000).emit("my-event", (err) => { - * if (err) { - * // the server did not acknowledge the event in the given delay - * } - * }); - * - * @returns self - */ - timeout(timeout) { - this.flags.timeout = timeout; - return this; - } - /** - * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the - * callback. - * - * @example - * socket.onAny((event, ...args) => { - * console.log(`got ${event}`); - * }); - * - * @param listener - */ - onAny(listener) { - this._anyListeners = this._anyListeners || []; - this._anyListeners.push(listener); - return this; - } - /** - * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the - * callback. The listener is added to the beginning of the listeners array. - * - * @example - * socket.prependAny((event, ...args) => { - * console.log(`got event ${event}`); - * }); - * - * @param listener - */ - prependAny(listener) { - this._anyListeners = this._anyListeners || []; - this._anyListeners.unshift(listener); - return this; - } - /** - * Removes the listener that will be fired when any event is emitted. - * - * @example - * const catchAllListener = (event, ...args) => { - * console.log(`got event ${event}`); - * } - * - * socket.onAny(catchAllListener); - * - * // remove a specific listener - * socket.offAny(catchAllListener); - * - * // or remove all listeners - * socket.offAny(); - * - * @param listener - */ - offAny(listener) { - if (!this._anyListeners) { - return this; - } - if (listener) { - const listeners = this._anyListeners; - for (let i = 0; i < listeners.length; i++) { - if (listener === listeners[i]) { - listeners.splice(i, 1); - return this; - } - } - } else { - this._anyListeners = []; - } - return this; - } - /** - * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, - * e.g. to remove listeners. - */ - listenersAny() { - return this._anyListeners || []; - } - /** - * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the - * callback. - * - * Note: acknowledgements sent to the server are not included. - * - * @example - * socket.onAnyOutgoing((event, ...args) => { - * console.log(`sent event ${event}`); - * }); - * - * @param listener - */ - onAnyOutgoing(listener) { - this._anyOutgoingListeners = this._anyOutgoingListeners || []; - this._anyOutgoingListeners.push(listener); - return this; - } - /** - * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the - * callback. The listener is added to the beginning of the listeners array. - * - * Note: acknowledgements sent to the server are not included. - * - * @example - * socket.prependAnyOutgoing((event, ...args) => { - * console.log(`sent event ${event}`); - * }); - * - * @param listener - */ - prependAnyOutgoing(listener) { - this._anyOutgoingListeners = this._anyOutgoingListeners || []; - this._anyOutgoingListeners.unshift(listener); - return this; - } - /** - * Removes the listener that will be fired when any event is emitted. - * - * @example - * const catchAllListener = (event, ...args) => { - * console.log(`sent event ${event}`); - * } - * - * socket.onAnyOutgoing(catchAllListener); - * - * // remove a specific listener - * socket.offAnyOutgoing(catchAllListener); - * - * // or remove all listeners - * socket.offAnyOutgoing(); - * - * @param [listener] - the catch-all listener (optional) - */ - offAnyOutgoing(listener) { - if (!this._anyOutgoingListeners) { - return this; - } - if (listener) { - const listeners = this._anyOutgoingListeners; - for (let i = 0; i < listeners.length; i++) { - if (listener === listeners[i]) { - listeners.splice(i, 1); - return this; - } - } - } else { - this._anyOutgoingListeners = []; - } - return this; - } - /** - * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, - * e.g. to remove listeners. - */ - listenersAnyOutgoing() { - return this._anyOutgoingListeners || []; - } - /** - * Notify the listeners for each packet sent - * - * @param packet - * - * @private - */ - notifyOutgoingListeners(packet) { - if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) { - const listeners = this._anyOutgoingListeners.slice(); - for (const listener of listeners) { - listener.apply(this, packet.data); - } - } - } -}; - -// node_modules/socket.io-client/build/esm/contrib/backo2.js -function Backoff(opts) { - opts = opts || {}; - this.ms = opts.min || 100; - this.max = opts.max || 1e4; - this.factor = opts.factor || 2; - this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0; - this.attempts = 0; -} -Backoff.prototype.duration = function() { - var ms = this.ms * Math.pow(this.factor, this.attempts++); - if (this.jitter) { - var rand = Math.random(); - var deviation = Math.floor(rand * this.jitter * ms); - ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation; - } - return Math.min(ms, this.max) | 0; -}; -Backoff.prototype.reset = function() { - this.attempts = 0; -}; -Backoff.prototype.setMin = function(min) { - this.ms = min; -}; -Backoff.prototype.setMax = function(max) { - this.max = max; -}; -Backoff.prototype.setJitter = function(jitter) { - this.jitter = jitter; -}; - -// node_modules/socket.io-client/build/esm/manager.js -var Manager = class extends Emitter { - constructor(uri, opts) { - var _a; - super(); - this.nsps = {}; - this.subs = []; - if (uri && "object" === typeof uri) { - opts = uri; - uri = void 0; - } - opts = opts || {}; - opts.path = opts.path || "/socket.io"; - this.opts = opts; - installTimerFunctions(this, opts); - this.reconnection(opts.reconnection !== false); - this.reconnectionAttempts(opts.reconnectionAttempts || Infinity); - this.reconnectionDelay(opts.reconnectionDelay || 1e3); - this.reconnectionDelayMax(opts.reconnectionDelayMax || 5e3); - this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5); - this.backoff = new Backoff({ - min: this.reconnectionDelay(), - max: this.reconnectionDelayMax(), - jitter: this.randomizationFactor() - }); - this.timeout(null == opts.timeout ? 2e4 : opts.timeout); - this._readyState = "closed"; - this.uri = uri; - const _parser = opts.parser || esm_debug_exports; - this.encoder = new _parser.Encoder(); - this.decoder = new _parser.Decoder(); - this._autoConnect = opts.autoConnect !== false; - if (this._autoConnect) - this.open(); - } - reconnection(v) { - if (!arguments.length) - return this._reconnection; - this._reconnection = !!v; - if (!v) { - this.skipReconnect = true; - } - return this; - } - reconnectionAttempts(v) { - if (v === void 0) - return this._reconnectionAttempts; - this._reconnectionAttempts = v; - return this; - } - reconnectionDelay(v) { - var _a; - if (v === void 0) - return this._reconnectionDelay; - this._reconnectionDelay = v; - (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(v); - return this; - } - randomizationFactor(v) { - var _a; - if (v === void 0) - return this._randomizationFactor; - this._randomizationFactor = v; - (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(v); - return this; - } - reconnectionDelayMax(v) { - var _a; - if (v === void 0) - return this._reconnectionDelayMax; - this._reconnectionDelayMax = v; - (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(v); - return this; - } - timeout(v) { - if (!arguments.length) - return this._timeout; - this._timeout = v; - return this; - } - /** - * Starts trying to reconnect if reconnection is enabled and we have not - * started reconnecting yet - * - * @private - */ - maybeReconnectOnOpen() { - if (!this._reconnecting && this._reconnection && this.backoff.attempts === 0) { - this.reconnect(); - } - } - /** - * Sets the current transport `socket`. - * - * @param {Function} fn - optional, callback - * @return self - * @public - */ - open(fn) { - if (~this._readyState.indexOf("open")) - return this; - this.engine = new Socket(this.uri, this.opts); - const socket = this.engine; - const self2 = this; - this._readyState = "opening"; - this.skipReconnect = false; - const openSubDestroy = on(socket, "open", function() { - self2.onopen(); - fn && fn(); - }); - const onError = (err) => { - this.cleanup(); - this._readyState = "closed"; - this.emitReserved("error", err); - if (fn) { - fn(err); - } else { - this.maybeReconnectOnOpen(); - } - }; - const errorSub = on(socket, "error", onError); - if (false !== this._timeout) { - const timeout = this._timeout; - const timer = this.setTimeoutFn(() => { - openSubDestroy(); - onError(new Error("timeout")); - socket.close(); - }, timeout); - if (this.opts.autoUnref) { - timer.unref(); - } - this.subs.push(() => { - this.clearTimeoutFn(timer); - }); - } - this.subs.push(openSubDestroy); - this.subs.push(errorSub); - return this; - } - /** - * Alias for open() - * - * @return self - * @public - */ - connect(fn) { - return this.open(fn); - } - /** - * Called upon transport open. - * - * @private - */ - onopen() { - this.cleanup(); - this._readyState = "open"; - this.emitReserved("open"); - const socket = this.engine; - this.subs.push( - on(socket, "ping", this.onping.bind(this)), - on(socket, "data", this.ondata.bind(this)), - on(socket, "error", this.onerror.bind(this)), - on(socket, "close", this.onclose.bind(this)), - // @ts-ignore - on(this.decoder, "decoded", this.ondecoded.bind(this)) - ); - } - /** - * Called upon a ping. - * - * @private - */ - onping() { - this.emitReserved("ping"); - } - /** - * Called with data. - * - * @private - */ - ondata(data) { - try { - this.decoder.add(data); - } catch (e) { - this.onclose("parse error", e); - } - } - /** - * Called when parser fully decodes a packet. - * - * @private - */ - ondecoded(packet) { - nextTick(() => { - this.emitReserved("packet", packet); - }, this.setTimeoutFn); - } - /** - * Called upon socket error. - * - * @private - */ - onerror(err) { - this.emitReserved("error", err); - } - /** - * Creates a new socket for the given `nsp`. - * - * @return {Socket} - * @public - */ - socket(nsp, opts) { - let socket = this.nsps[nsp]; - if (!socket) { - socket = new Socket2(this, nsp, opts); - this.nsps[nsp] = socket; - } else if (this._autoConnect && !socket.active) { - socket.connect(); - } - return socket; - } - /** - * Called upon a socket close. - * - * @param socket - * @private - */ - _destroy(socket) { - const nsps = Object.keys(this.nsps); - for (const nsp of nsps) { - const socket2 = this.nsps[nsp]; - if (socket2.active) { - return; - } - } - this._close(); - } - /** - * Writes a packet. - * - * @param packet - * @private - */ - _packet(packet) { - const encodedPackets = this.encoder.encode(packet); - for (let i = 0; i < encodedPackets.length; i++) { - this.engine.write(encodedPackets[i], packet.options); - } - } - /** - * Clean up transport subscriptions and packet buffer. - * - * @private - */ - cleanup() { - this.subs.forEach((subDestroy) => subDestroy()); - this.subs.length = 0; - this.decoder.destroy(); - } - /** - * Close the current socket. - * - * @private - */ - _close() { - this.skipReconnect = true; - this._reconnecting = false; - this.onclose("forced close"); - } - /** - * Alias for close() - * - * @private - */ - disconnect() { - return this._close(); - } - /** - * Called when: - * - * - the low-level engine is closed - * - the parser encountered a badly formatted packet - * - all sockets are disconnected - * - * @private - */ - onclose(reason, description) { - var _a; - this.cleanup(); - (_a = this.engine) === null || _a === void 0 ? void 0 : _a.close(); - this.backoff.reset(); - this._readyState = "closed"; - this.emitReserved("close", reason, description); - if (this._reconnection && !this.skipReconnect) { - this.reconnect(); - } - } - /** - * Attempt a reconnection. - * - * @private - */ - reconnect() { - if (this._reconnecting || this.skipReconnect) - return this; - const self2 = this; - if (this.backoff.attempts >= this._reconnectionAttempts) { - this.backoff.reset(); - this.emitReserved("reconnect_failed"); - this._reconnecting = false; - } else { - const delay = this.backoff.duration(); - this._reconnecting = true; - const timer = this.setTimeoutFn(() => { - if (self2.skipReconnect) - return; - this.emitReserved("reconnect_attempt", self2.backoff.attempts); - if (self2.skipReconnect) - return; - self2.open((err) => { - if (err) { - self2._reconnecting = false; - self2.reconnect(); - this.emitReserved("reconnect_error", err); - } else { - self2.onreconnect(); - } - }); - }, delay); - if (this.opts.autoUnref) { - timer.unref(); - } - this.subs.push(() => { - this.clearTimeoutFn(timer); - }); - } - } - /** - * Called upon successful reconnect. - * - * @private - */ - onreconnect() { - const attempt = this.backoff.attempts; - this._reconnecting = false; - this.backoff.reset(); - this.emitReserved("reconnect", attempt); - } -}; - -// node_modules/socket.io-client/build/esm/index.js -var cache = {}; -function lookup2(uri, opts) { - if (typeof uri === "object") { - opts = uri; - uri = void 0; - } - opts = opts || {}; - const parsed = url(uri, opts.path || "/socket.io"); - const source = parsed.source; - const id = parsed.id; - const path = parsed.path; - const sameNamespace = cache[id] && path in cache[id]["nsps"]; - const newConnection = opts.forceNew || opts["force new connection"] || false === opts.multiplex || sameNamespace; - let io; - if (newConnection) { - io = new Manager(source, opts); - } else { - if (!cache[id]) { - cache[id] = new Manager(source, opts); - } - io = cache[id]; - } - if (parsed.query && !opts.query) { - opts.query = parsed.queryKey; - } - return io.socket(parsed.path, opts); -} -Object.assign(lookup2, { - Manager, - Socket: Socket2, - io: lookup2, - connect: lookup2 -}); - -// node_modules/@base44/sdk/dist/utils/socket-utils.js -function initializeSocket(config, handlers) { - var _a; - const socket = lookup2(config.serverUrl, { - path: config.mountPath, - transports: config.transports, - query: { - app_id: config.appId, - token: (_a = config.token) !== null && _a !== void 0 ? _a : getAccessToken() - } - }); - socket.on("connect", async () => { - var _a2; - console.log("connect", socket.id); - return (_a2 = handlers.connect) === null || _a2 === void 0 ? void 0 : _a2.call(handlers); - }); - socket.on("update_model", async (msg) => { - var _a2; - return (_a2 = handlers.update_model) === null || _a2 === void 0 ? void 0 : _a2.call(handlers, msg); - }); - socket.on("error", async (error) => { - var _a2; - return (_a2 = handlers.error) === null || _a2 === void 0 ? void 0 : _a2.call(handlers, error); - }); - socket.on("connect_error", async (error) => { - var _a2; - console.error("connect_error", error); - return (_a2 = handlers.error) === null || _a2 === void 0 ? void 0 : _a2.call(handlers, error); - }); - return socket; -} -function RoomsSocket({ config }) { - let currentConfig = { ...config }; - const roomsToListeners = {}; - const handlers = { - connect: async () => { - const promises = []; - Object.keys(roomsToListeners).forEach((room) => { - joinRoom(room); - const listeners = getListeners(room); - listeners === null || listeners === void 0 ? void 0 : listeners.forEach(({ connect }) => { - const promise = async () => connect === null || connect === void 0 ? void 0 : connect(); - promises.push(promise()); - }); - }); - await Promise.all(promises); - }, - update_model: async (msg) => { - const listeners = getListeners(msg.room); - const promises = listeners.map((listener) => { - var _a; - return (_a = listener.update_model) === null || _a === void 0 ? void 0 : _a.call(listener, msg); - }); - await Promise.all(promises); - }, - error: async (error) => { - console.error("error", error); - const promises = Object.values(roomsToListeners).flat().map((listener) => { - var _a; - return (_a = listener.error) === null || _a === void 0 ? void 0 : _a.call(listener, error); - }); - await Promise.all(promises); - } - }; - let socket = initializeSocket(config, handlers); - function cleanup() { - disconnect(); - } - function disconnect() { - if (socket) { - socket.disconnect(); - } - } - function updateConfig(config2) { - cleanup(); - currentConfig = { - ...currentConfig, - ...config2 - }; - socket = initializeSocket(currentConfig, handlers); - } - function joinRoom(room) { - socket.emit("join", room); - } - function leaveRoom(room) { - socket.emit("leave", room); - } - async function updateModel(room, data) { - var _a; - const dataStr = JSON.stringify(data); - return (_a = handlers.update_model) === null || _a === void 0 ? void 0 : _a.call(handlers, { room, data: dataStr }); - } - function getListeners(room) { - return roomsToListeners[room]; - } - const subscribeToRoom = (room, handlers2) => { - if (!roomsToListeners[room]) { - joinRoom(room); - roomsToListeners[room] = []; - } - roomsToListeners[room].push(handlers2); - return () => { - var _a, _b; - roomsToListeners[room] = (_b = (_a = roomsToListeners[room]) === null || _a === void 0 ? void 0 : _a.filter((listener) => listener !== handlers2)) !== null && _b !== void 0 ? _b : []; - if (roomsToListeners[room].length === 0) { - leaveRoom(room); - } - }; - }; - return { - socket, - subscribeToRoom, - updateConfig, - updateModel, - disconnect - }; -} - -// node_modules/@base44/sdk/dist/utils/sharedInstance.js -var windowObj = typeof window !== "undefined" ? window : { base44SharedInstances: {} }; -function getSharedInstance(name, factory) { - if (!windowObj.base44SharedInstances) { - windowObj.base44SharedInstances = {}; - } - if (!windowObj.base44SharedInstances[name]) { - windowObj.base44SharedInstances[name] = { - instance: factory() - }; - } - return windowObj.base44SharedInstances[name].instance; -} - -// node_modules/@base44/sdk/dist/modules/analytics.js -var USER_HEARTBEAT_EVENT_NAME = "__user_heartbeat_event__"; -var ANALYTICS_INITIALIZATION_EVENT_NAME = "__initialization_event__"; -var ANALYTICS_SESSION_DURATION_EVENT_NAME = "__session_duration_event__"; -var ANALYTICS_CONFIG_ENABLE_URL_PARAM_KEY = "analytics-enable"; -var ANALYTICS_SESSION_ID_LOCAL_STORAGE_KEY = "base44_analytics_session_id"; -var defaultConfiguration = { - // default to enabled // - enabled: true, - maxQueueSize: 1e3, - throttleTime: 1e3, - batchSize: 30, - heartBeatInterval: 60 * 1e3 -}; -var ANALYTICS_SHARED_STATE_NAME = "analytics"; -var analyticsSharedState = getSharedInstance(ANALYTICS_SHARED_STATE_NAME, () => ({ - requestsQueue: [], - isProcessing: false, - isHeartBeatProcessing: false, - wasInitializationTracked: false, - sessionContext: null, - sessionStartTime: null, - config: { - ...defaultConfiguration, - ...getAnalyticsConfigFromUrlParams() - } -})); -var createAnalyticsModule = ({ axiosClient, serverUrl, appId, userAuthModule }) => { - var _a; - const { maxQueueSize, throttleTime, batchSize } = analyticsSharedState.config; - if (!((_a = analyticsSharedState.config) === null || _a === void 0 ? void 0 : _a.enabled)) { - return { - track: () => { - }, - cleanup: () => { - } - }; - } - let clearHeartBeatProcessor = void 0; - const trackBatchUrl = `${serverUrl}/api/apps/${appId}/analytics/track/batch`; - const batchRequestFallback = async (events) => { - await axiosClient.request({ - method: "POST", - url: `/apps/${appId}/analytics/track/batch`, - data: { events } - }); - }; - const beaconRequest = (events) => { - try { - const beaconPayload = JSON.stringify({ events }); - const blob = new Blob([beaconPayload], { type: "application/json" }); - return typeof navigator === "undefined" || beaconPayload.length > 6e4 || !navigator.sendBeacon(trackBatchUrl, blob); - } catch (_a2) { - return false; - } - }; - const flush = async (eventsData, options = {}) => { - if (eventsData.length === 0) - return; - const sessionContext_ = await getSessionContext(userAuthModule); - const events = eventsData.map(transformEventDataToApiRequestData(sessionContext_)); - try { - if (!options.isBeacon || !beaconRequest(events)) { - await batchRequestFallback(events); - } - } catch (_a2) { - } - }; - const startProcessing = () => { - startAnalyticsProcessor(flush, { - throttleTime, - batchSize - }); - }; - const track = (params) => { - if (analyticsSharedState.requestsQueue.length >= maxQueueSize) { - return; - } - const intrinsicData = getEventIntrinsicData(); - analyticsSharedState.requestsQueue.push({ - ...params, - ...intrinsicData - }); - startProcessing(); - }; - const onDocVisible = () => { - startAnalyticsProcessor(flush, { - throttleTime, - batchSize - }); - clearHeartBeatProcessor = startHeartBeatProcessor(track); - setSessionDurationTimerStart(); - }; - const onDocHidden = () => { - stopAnalyticsProcessor(); - clearHeartBeatProcessor === null || clearHeartBeatProcessor === void 0 ? void 0 : clearHeartBeatProcessor(); - trackSessionDurationEvent(track); - const eventsData = analyticsSharedState.requestsQueue.splice(0); - flush(eventsData, { isBeacon: true }); - }; - const onVisibilityChange = () => { - if (typeof window === "undefined") - return; - if (document.visibilityState === "hidden") { - onDocHidden(); - } else if (document.visibilityState === "visible") { - onDocVisible(); - } - }; - const cleanup = () => { - stopAnalyticsProcessor(); - clearHeartBeatProcessor === null || clearHeartBeatProcessor === void 0 ? void 0 : clearHeartBeatProcessor(); - if (typeof window !== "undefined") { - window.removeEventListener("visibilitychange", onVisibilityChange); - } - }; - startProcessing(); - clearHeartBeatProcessor = startHeartBeatProcessor(track); - trackInitializationEvent(track); - if (typeof window !== "undefined") { - window.addEventListener("visibilitychange", onVisibilityChange); - } - return { - track, - cleanup - }; -}; -function stopAnalyticsProcessor() { - analyticsSharedState.isProcessing = false; -} -async function startAnalyticsProcessor(handleTrack, options) { - if (analyticsSharedState.isProcessing) { - return; - } - analyticsSharedState.isProcessing = true; - const { throttleTime = 1e3, batchSize = 30 } = options !== null && options !== void 0 ? options : {}; - while (analyticsSharedState.isProcessing && analyticsSharedState.requestsQueue.length > 0) { - const requests = analyticsSharedState.requestsQueue.splice(0, batchSize); - requests.length && await handleTrack(requests); - await new Promise((resolve) => setTimeout(resolve, throttleTime)); - } - analyticsSharedState.isProcessing = false; -} -function startHeartBeatProcessor(track) { - var _a; - if (analyticsSharedState.isHeartBeatProcessing || ((_a = analyticsSharedState.config.heartBeatInterval) !== null && _a !== void 0 ? _a : 0) < 10) { - return () => { - }; - } - analyticsSharedState.isHeartBeatProcessing = true; - const interval = setInterval(() => { - track({ eventName: USER_HEARTBEAT_EVENT_NAME }); - }, analyticsSharedState.config.heartBeatInterval); - return () => { - clearInterval(interval); - analyticsSharedState.isHeartBeatProcessing = false; - }; -} -function trackInitializationEvent(track) { - if (typeof window === "undefined" || analyticsSharedState.wasInitializationTracked) { - return; - } - analyticsSharedState.wasInitializationTracked = true; - track({ - eventName: ANALYTICS_INITIALIZATION_EVENT_NAME, - properties: { - referrer: document === null || document === void 0 ? void 0 : document.referrer - } - }); -} -function setSessionDurationTimerStart() { - if (typeof window === "undefined" || analyticsSharedState.sessionStartTime !== null) { - return; - } - analyticsSharedState.sessionStartTime = (/* @__PURE__ */ new Date()).toISOString(); -} -function trackSessionDurationEvent(track) { - if (typeof window === "undefined" || analyticsSharedState.sessionStartTime === null) - return; - const sessionDuration = (/* @__PURE__ */ new Date()).getTime() - new Date(analyticsSharedState.sessionStartTime).getTime(); - analyticsSharedState.sessionStartTime = null; - track({ - eventName: ANALYTICS_SESSION_DURATION_EVENT_NAME, - properties: { sessionDuration } - }); -} -function getEventIntrinsicData() { - return { - timestamp: (/* @__PURE__ */ new Date()).toISOString(), - pageUrl: typeof window !== "undefined" ? window.location.pathname : null - }; -} -function transformEventDataToApiRequestData(sessionContext) { - return (eventData) => ({ - event_name: eventData.eventName, - properties: eventData.properties, - timestamp: eventData.timestamp, - page_url: eventData.pageUrl, - ...sessionContext - }); -} -var sessionContextPromise = null; -async function getSessionContext(userAuthModule) { - if (!analyticsSharedState.sessionContext) { - if (!sessionContextPromise) { - const sessionId = getAnalyticsSessionId(); - sessionContextPromise = userAuthModule.me().then((user) => ({ - user_id: user.id, - session_id: sessionId - })).catch(() => ({ - user_id: null, - session_id: sessionId - })); - } - analyticsSharedState.sessionContext = await sessionContextPromise; - } - return analyticsSharedState.sessionContext; -} -function getAnalyticsConfigFromUrlParams() { - if (typeof window === "undefined") - return void 0; - const urlParams = new URLSearchParams(window.location.search); - const analyticsEnable = urlParams.get(ANALYTICS_CONFIG_ENABLE_URL_PARAM_KEY); - if (analyticsEnable == null || !analyticsEnable.length) - return void 0; - const newUrlParams = new URLSearchParams(window.location.search); - newUrlParams.delete(ANALYTICS_CONFIG_ENABLE_URL_PARAM_KEY); - const newUrl = window.location.pathname + (newUrlParams.toString() ? "?" + newUrlParams.toString() : ""); - window.history.replaceState({}, "", newUrl); - return { enabled: analyticsEnable === "true" }; -} -function getAnalyticsSessionId() { - if (typeof window === "undefined") { - return generateUuid(); - } - try { - const sessionId = localStorage.getItem(ANALYTICS_SESSION_ID_LOCAL_STORAGE_KEY); - if (!sessionId) { - const newSessionId = generateUuid(); - localStorage.setItem(ANALYTICS_SESSION_ID_LOCAL_STORAGE_KEY, newSessionId); - return newSessionId; - } - return sessionId; - } catch (_a) { - return generateUuid(); - } -} - -// node_modules/@base44/sdk/dist/client.js -function createClient(config) { - const { serverUrl = "https://base44.app", appId, token, serviceToken, requiresAuth = false, appBaseUrl, options, functionsVersion, headers: optionalHeaders } = config; - const normalizedAppBaseUrl = typeof appBaseUrl === "string" ? appBaseUrl : ""; - const socketConfig = { - serverUrl, - mountPath: "/ws-user-apps/socket.io/", - transports: ["websocket"], - appId, - token - }; - let socket = null; - const getSocket = () => { - if (!socket) { - socket = RoomsSocket({ - config: socketConfig - }); - } - return socket; - }; - const headers = { - ...optionalHeaders, - "X-App-Id": String(appId) - }; - const functionHeaders = functionsVersion ? { - ...headers, - "Base44-Functions-Version": functionsVersion - } : headers; - const axiosClient = createAxiosClient({ - baseURL: `${serverUrl}/api`, - headers, - token, - onError: options === null || options === void 0 ? void 0 : options.onError - }); - const functionsAxiosClient = createAxiosClient({ - baseURL: `${serverUrl}/api`, - headers: functionHeaders, - token, - interceptResponses: false, - onError: options === null || options === void 0 ? void 0 : options.onError - }); - const serviceRoleAxiosClient = createAxiosClient({ - baseURL: `${serverUrl}/api`, - headers, - token: serviceToken, - onError: options === null || options === void 0 ? void 0 : options.onError - }); - const serviceRoleFunctionsAxiosClient = createAxiosClient({ - baseURL: `${serverUrl}/api`, - headers: functionHeaders, - token: serviceToken, - interceptResponses: false - }); - const userAuthModule = createAuthModule(axiosClient, functionsAxiosClient, appId, { - appBaseUrl: normalizedAppBaseUrl, - serverUrl - }); - const userModules = { - entities: createEntitiesModule({ - axios: axiosClient, - appId, - getSocket - }), - integrations: createIntegrationsModule(axiosClient, appId), - auth: userAuthModule, - functions: createFunctionsModule(functionsAxiosClient, appId), - agents: createAgentsModule({ - axios: axiosClient, - getSocket, - appId, - serverUrl, - token - }), - appLogs: createAppLogsModule(axiosClient, appId), - users: createUsersModule(axiosClient, appId), - analytics: createAnalyticsModule({ - axiosClient, - serverUrl, - appId, - userAuthModule - }), - cleanup: () => { - userModules.analytics.cleanup(); - if (socket) { - socket.disconnect(); - } - } - }; - const serviceRoleModules = { - entities: createEntitiesModule({ - axios: serviceRoleAxiosClient, - appId, - getSocket - }), - integrations: createIntegrationsModule(serviceRoleAxiosClient, appId), - sso: createSsoModule(serviceRoleAxiosClient, appId, token), - connectors: createConnectorsModule(serviceRoleAxiosClient, appId), - functions: createFunctionsModule(serviceRoleFunctionsAxiosClient, appId), - agents: createAgentsModule({ - axios: serviceRoleAxiosClient, - getSocket, - appId, - serverUrl, - token - }), - appLogs: createAppLogsModule(serviceRoleAxiosClient, appId), - cleanup: () => { - if (socket) { - socket.disconnect(); - } - } - }; - if (typeof window !== "undefined") { - const accessToken = token || getAccessToken(); - if (accessToken) { - userModules.auth.setToken(accessToken); - } - } - if (requiresAuth && typeof window !== "undefined") { - setTimeout(async () => { - try { - const isAuthenticated = await userModules.auth.isAuthenticated(); - if (!isAuthenticated) { - userModules.auth.redirectToLogin(window.location.href); - } - } catch (error) { - console.error("Authentication check failed:", error); - userModules.auth.redirectToLogin(window.location.href); - } - }, 0); - } - const client = { - ...userModules, - /** - * Sets a new authentication token for all subsequent requests. - * - * @param newToken - The new authentication token - * - * @example - * ```typescript - * // Update token after login - * const { access_token } = await base44.auth.loginViaEmailPassword( - * 'user@example.com', - * 'password' - * ); - * base44.setToken(access_token); - * ``` - */ - setToken(newToken) { - userModules.auth.setToken(newToken); - if (socket) { - socket.updateConfig({ - token: newToken - }); - } - socketConfig.token = newToken; - }, - /** - * Gets the current client configuration. - * - * @internal - */ - getConfig() { - return { - serverUrl, - appId, - requiresAuth - }; - }, - /** - * Provides access to service role modules. - * - * Service role authentication provides elevated permissions for backend operations. Unlike user authentication, which is scoped to a specific user's permissions, service role authentication has access to the data and operations available to the app's admin. - * - * @throws {Error} When accessed without providing a serviceToken during client creation. - * - * @example - * ```typescript - * const base44 = createClient({ - * appId: 'my-app-id', - * serviceToken: 'service-role-token' - * }); - * - * // Also access a module with elevated permissions - * const allUsers = await base44.asServiceRole.entities.User.list(); - * ``` - */ - get asServiceRole() { - if (!serviceToken) { - throw new Error("Service token is required to use asServiceRole. Please provide a serviceToken when creating the client."); - } - return serviceRoleModules; - } - }; - return client; -} -function createClientFromRequest(request) { - const authHeader = request.headers.get("Authorization"); - const serviceRoleAuthHeader = request.headers.get("Base44-Service-Authorization"); - const appId = request.headers.get("Base44-App-Id"); - const serverUrlHeader = request.headers.get("Base44-Api-Url"); - const functionsVersion = request.headers.get("Base44-Functions-Version"); - const stateHeader = request.headers.get("Base44-State"); - if (!appId) { - throw new Error("Base44-App-Id header is required, but is was not found on the request"); - } - let serviceRoleToken; - let userToken; - if (serviceRoleAuthHeader !== null) { - if (serviceRoleAuthHeader === "" || !serviceRoleAuthHeader.startsWith("Bearer ") || serviceRoleAuthHeader.split(" ").length !== 2) { - throw new Error('Invalid authorization header format. Expected "Bearer "'); - } - serviceRoleToken = serviceRoleAuthHeader.split(" ")[1]; - } - if (authHeader !== null) { - if (authHeader === "" || !authHeader.startsWith("Bearer ") || authHeader.split(" ").length !== 2) { - throw new Error('Invalid authorization header format. Expected "Bearer "'); - } - userToken = authHeader.split(" ")[1]; - } - const additionalHeaders = {}; - if (stateHeader) { - additionalHeaders["Base44-State"] = stateHeader; - } - return createClient({ - serverUrl: serverUrlHeader || "https://base44.app", - appId, - token: userToken, - serviceToken: serviceRoleToken, - functionsVersion: functionsVersion !== null && functionsVersion !== void 0 ? functionsVersion : void 0, - headers: additionalHeaders - }); -} -export { - Base44Error, - createClient, - createClientFromRequest, - getAccessToken, - getLoginUrl, - removeAccessToken, - saveAccessToken -}; -//# sourceMappingURL=@base44_sdk.js.map diff --git a/node_modules/.vite/deps/@base44_sdk.js.map b/node_modules/.vite/deps/@base44_sdk.js.map deleted file mode 100644 index 2bfb2211..00000000 --- a/node_modules/.vite/deps/@base44_sdk.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../ms/index.js", "../../debug/src/common.js", "../../debug/src/browser.js", "../../@base44/sdk/dist/modules/entities.js", "../../@base44/sdk/dist/modules/custom-integrations.js", "../../@base44/sdk/dist/modules/integrations.js", "../../@base44/sdk/dist/modules/auth.js", "../../@base44/sdk/dist/modules/sso.js", "../../@base44/sdk/dist/modules/connectors.js", "../../@base44/sdk/dist/utils/auth-utils.js", "../../@base44/sdk/dist/modules/functions.js", "../../@base44/sdk/dist/modules/agents.js", "../../@base44/sdk/dist/modules/app-logs.js", "../../@base44/sdk/dist/modules/users.js", "../../engine.io-parser/build/esm/commons.js", "../../engine.io-parser/build/esm/encodePacket.browser.js", "../../engine.io-parser/build/esm/contrib/base64-arraybuffer.js", "../../engine.io-parser/build/esm/decodePacket.browser.js", "../../engine.io-parser/build/esm/index.js", "../../@socket.io/component-emitter/lib/esm/index.js", "../../engine.io-client/build/esm/globals.js", "../../engine.io-client/build/esm/util.js", "../../engine.io-client/build/esm/contrib/parseqs.js", "../../engine.io-client/build/esm/transport.js", "../../engine.io-client/build/esm/transports/polling.js", "../../engine.io-client/build/esm/contrib/has-cors.js", "../../engine.io-client/build/esm/transports/polling-xhr.js", "../../engine.io-client/build/esm/transports/websocket.js", "../../engine.io-client/build/esm/transports/webtransport.js", "../../engine.io-client/build/esm/transports/index.js", "../../engine.io-client/build/esm/contrib/parseuri.js", "../../engine.io-client/build/esm/socket.js", "../../engine.io-client/build/esm/index.js", "../../socket.io-client/build/esm/url.js", "../../socket.io-parser/build/esm-debug/index.js", "../../socket.io-parser/build/esm-debug/is-binary.js", "../../socket.io-parser/build/esm-debug/binary.js", "../../socket.io-client/build/esm/on.js", "../../socket.io-client/build/esm/socket.js", "../../socket.io-client/build/esm/contrib/backo2.js", "../../socket.io-client/build/esm/manager.js", "../../socket.io-client/build/esm/index.js", "../../@base44/sdk/dist/utils/socket-utils.js", "../../@base44/sdk/dist/utils/sharedInstance.js", "../../@base44/sdk/dist/modules/analytics.js", "../../@base44/sdk/dist/client.js"], - "sourcesContent": ["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "/**\n * Creates the entities module for the Base44 SDK.\n *\n * @param config - Configuration object containing axios, appId, and getSocket\n * @returns Entities module with dynamic entity access\n * @internal\n */\nexport function createEntitiesModule(config) {\n const { axios, appId, getSocket } = config;\n // Using Proxy to dynamically handle entity names\n return new Proxy({}, {\n get(target, entityName) {\n // Don't create handlers for internal properties\n if (typeof entityName !== \"string\" ||\n entityName === \"then\" ||\n entityName.startsWith(\"_\")) {\n return undefined;\n }\n // Create entity handler\n return createEntityHandler(axios, appId, entityName, getSocket);\n },\n });\n}\n/**\n * Parses the realtime message data and extracts event information.\n * @internal\n */\nfunction parseRealtimeMessage(dataStr) {\n var _a;\n try {\n const parsed = JSON.parse(dataStr);\n return {\n type: parsed.type,\n data: parsed.data,\n id: parsed.id || ((_a = parsed.data) === null || _a === void 0 ? void 0 : _a.id),\n timestamp: parsed.timestamp || new Date().toISOString(),\n };\n }\n catch (error) {\n console.warn(\"[Base44 SDK] Failed to parse realtime message:\", error);\n return null;\n }\n}\n/**\n * Creates a handler for a specific entity.\n *\n * @param axios - Axios instance\n * @param appId - Application ID\n * @param entityName - Entity name\n * @param getSocket - Function to get the socket instance\n * @returns Entity handler with CRUD methods\n * @internal\n */\nfunction createEntityHandler(axios, appId, entityName, getSocket) {\n const baseURL = `/apps/${appId}/entities/${entityName}`;\n return {\n // List entities with optional pagination and sorting\n async list(sort, limit, skip, fields) {\n const params = {};\n if (sort)\n params.sort = sort;\n if (limit)\n params.limit = limit;\n if (skip)\n params.skip = skip;\n if (fields)\n params.fields = Array.isArray(fields) ? fields.join(\",\") : fields;\n return axios.get(baseURL, { params });\n },\n // Filter entities based on query\n async filter(query, sort, limit, skip, fields) {\n const params = {\n q: JSON.stringify(query),\n };\n if (sort)\n params.sort = sort;\n if (limit)\n params.limit = limit;\n if (skip)\n params.skip = skip;\n if (fields)\n params.fields = Array.isArray(fields) ? fields.join(\",\") : fields;\n return axios.get(baseURL, { params });\n },\n // Get entity by ID\n async get(id) {\n return axios.get(`${baseURL}/${id}`);\n },\n // Create new entity\n async create(data) {\n return axios.post(baseURL, data);\n },\n // Update entity by ID\n async update(id, data) {\n return axios.put(`${baseURL}/${id}`, data);\n },\n // Delete entity by ID\n async delete(id) {\n return axios.delete(`${baseURL}/${id}`);\n },\n // Delete multiple entities based on query\n async deleteMany(query) {\n return axios.delete(baseURL, { data: query });\n },\n // Create multiple entities in a single request\n async bulkCreate(data) {\n return axios.post(`${baseURL}/bulk`, data);\n },\n // Import entities from a file\n async importEntities(file) {\n const formData = new FormData();\n formData.append(\"file\", file, file.name);\n return axios.post(`${baseURL}/import`, formData, {\n headers: {\n \"Content-Type\": \"multipart/form-data\",\n },\n });\n },\n // Subscribe to realtime updates\n subscribe(callback) {\n const room = `entities:${appId}:${entityName}`;\n // Get the socket and subscribe to the room\n const socket = getSocket();\n const unsubscribe = socket.subscribeToRoom(room, {\n update_model: (msg) => {\n const event = parseRealtimeMessage(msg.data);\n if (!event) {\n return;\n }\n try {\n callback(event);\n }\n catch (error) {\n console.error(\"[Base44 SDK] Subscription callback error:\", error);\n }\n },\n });\n return unsubscribe;\n },\n };\n}\n", "/**\n * Creates the custom integrations module for the Base44 SDK.\n *\n * @param axios - Axios instance for making HTTP requests\n * @param appId - Application ID\n * @returns Custom integrations module with `call()` method\n * @internal\n */\nexport function createCustomIntegrationsModule(axios, appId) {\n return {\n async call(slug, operationId, params) {\n // Validate required parameters\n if (!(slug === null || slug === void 0 ? void 0 : slug.trim())) {\n throw new Error(\"Integration slug is required and cannot be empty\");\n }\n if (!(operationId === null || operationId === void 0 ? void 0 : operationId.trim())) {\n throw new Error(\"Operation ID is required and cannot be empty\");\n }\n // Convert camelCase to snake_case for Python backend\n const { pathParams, queryParams, ...rest } = params !== null && params !== void 0 ? params : {};\n const body = {\n ...rest,\n ...(pathParams && { path_params: pathParams }),\n ...(queryParams && { query_params: queryParams }),\n };\n // Make the API call\n const response = await axios.post(`/apps/${appId}/integrations/custom/${slug}/${operationId}`, body);\n // The axios interceptor extracts response.data, so we get the payload directly\n return response;\n },\n };\n}\n", "import { createCustomIntegrationsModule } from \"./custom-integrations.js\";\n/**\n * Creates the integrations module for the Base44 SDK.\n *\n * @param axios - Axios instance\n * @param appId - Application ID\n * @returns Integrations module with dynamic access to integration endpoints\n * @internal\n */\nexport function createIntegrationsModule(axios, appId) {\n // Create the custom integrations module once\n const customModule = createCustomIntegrationsModule(axios, appId);\n return new Proxy({}, {\n get(target, packageName) {\n // Skip internal properties\n if (typeof packageName !== \"string\" ||\n packageName === \"then\" ||\n packageName.startsWith(\"_\")) {\n return undefined;\n }\n // Handle 'custom' specially - return the custom integrations module\n if (packageName === \"custom\") {\n return customModule;\n }\n // Create a proxy for integration endpoints\n return new Proxy({}, {\n get(target, endpointName) {\n // Skip internal properties\n if (typeof endpointName !== \"string\" ||\n endpointName === \"then\" ||\n endpointName.startsWith(\"_\")) {\n return undefined;\n }\n // Return a function that calls the integration endpoint\n // This allows: client.integrations.PackageName.EndpointName(data)\n return async (data) => {\n // Validate input\n if (typeof data === \"string\") {\n throw new Error(`Integration ${endpointName} must receive an object with named parameters, received: ${data}`);\n }\n let formData;\n let contentType;\n // Handle file uploads with FormData\n if (data instanceof FormData ||\n (data &&\n Object.values(data).some((value) => value instanceof File))) {\n formData = new FormData();\n Object.keys(data).forEach((key) => {\n if (data[key] instanceof File) {\n formData.append(key, data[key], data[key].name);\n }\n else if (typeof data[key] === \"object\" &&\n data[key] !== null) {\n formData.append(key, JSON.stringify(data[key]));\n }\n else {\n formData.append(key, data[key]);\n }\n });\n contentType = \"multipart/form-data\";\n }\n else {\n formData = data;\n contentType = \"application/json\";\n }\n // For Core package\n if (packageName === \"Core\") {\n return axios.post(`/apps/${appId}/integration-endpoints/Core/${endpointName}`, formData || data, { headers: { \"Content-Type\": contentType } });\n }\n // For other packages\n return axios.post(`/apps/${appId}/integration-endpoints/installable/${packageName}/integration-endpoints/${endpointName}`, formData || data, { headers: { \"Content-Type\": contentType } });\n };\n },\n });\n },\n });\n}\n", "/**\n * Creates the auth module for the Base44 SDK.\n *\n * @param axios - Axios instance for API requests\n * @param functionsAxiosClient - Axios instance for functions API requests\n * @param appId - Application ID\n * @param options - Configuration options including server URLs\n * @returns Auth module with authentication and user management methods\n * @internal\n */\nexport function createAuthModule(axios, functionsAxiosClient, appId, options) {\n return {\n // Get current user information\n async me() {\n return axios.get(`/apps/${appId}/entities/User/me`);\n },\n // Update current user data\n async updateMe(data) {\n return axios.put(`/apps/${appId}/entities/User/me`, data);\n },\n // Redirects the user to the app's login page\n redirectToLogin(nextUrl) {\n // This function only works in a browser environment\n if (typeof window === \"undefined\") {\n throw new Error(\"Login method can only be used in a browser environment\");\n }\n // If nextUrl is not provided, use the current URL\n const redirectUrl = nextUrl\n ? new URL(nextUrl, window.location.origin).toString()\n : window.location.href;\n // Build the login URL\n const loginUrl = `${options.appBaseUrl}/login?from_url=${encodeURIComponent(redirectUrl)}`;\n // Redirect to the login page\n window.location.href = loginUrl;\n },\n // Redirects the user to a provider's login page\n loginWithProvider(provider, fromUrl = \"/\") {\n // Build the full redirect URL\n const redirectUrl = new URL(fromUrl, window.location.origin).toString();\n // Build the provider login URL (google is the default, so no provider path needed)\n const providerPath = provider === \"google\" ? \"\" : `/${provider}`;\n const loginUrl = `${options.appBaseUrl}/api/apps/auth${providerPath}/login?app_id=${appId}&from_url=${encodeURIComponent(redirectUrl)}`;\n // Redirect to the provider login page\n window.location.href = loginUrl;\n },\n // Logout the current user\n logout(redirectUrl) {\n // Remove token from axios headers (always do this)\n delete axios.defaults.headers.common[\"Authorization\"];\n // Only do the rest if in a browser environment\n if (typeof window !== \"undefined\") {\n // Remove token from localStorage\n if (window.localStorage) {\n try {\n window.localStorage.removeItem(\"base44_access_token\");\n // Remove \"token\" that is set by the built-in SDK of platform version 2\n window.localStorage.removeItem(\"token\");\n }\n catch (e) {\n console.error(\"Failed to remove token from localStorage:\", e);\n }\n }\n // Determine the from_url parameter\n const fromUrl = redirectUrl || window.location.href;\n // Redirect to server-side logout endpoint to clear HTTP-only cookies\n const logoutUrl = `${options.appBaseUrl}/api/apps/auth/logout?from_url=${encodeURIComponent(fromUrl)}`;\n window.location.href = logoutUrl;\n }\n },\n // Set authentication token\n setToken(token, saveToStorage = true) {\n if (!token)\n return;\n // handle token change for axios clients\n axios.defaults.headers.common[\"Authorization\"] = `Bearer ${token}`;\n functionsAxiosClient.defaults.headers.common[\"Authorization\"] = `Bearer ${token}`;\n // Save token to localStorage if requested\n if (saveToStorage &&\n typeof window !== \"undefined\" &&\n window.localStorage) {\n try {\n window.localStorage.setItem(\"base44_access_token\", token);\n // Set \"token\" that is set by the built-in SDK of platform version 2\n window.localStorage.setItem(\"token\", token);\n }\n catch (e) {\n console.error(\"Failed to save token to localStorage:\", e);\n }\n }\n },\n // Login using username and password\n async loginViaEmailPassword(email, password, turnstileToken) {\n var _a;\n try {\n const response = await axios.post(`/apps/${appId}/auth/login`, {\n email,\n password,\n ...(turnstileToken && { turnstile_token: turnstileToken }),\n });\n const { access_token, user } = response;\n if (access_token) {\n this.setToken(access_token);\n }\n return {\n access_token,\n user,\n };\n }\n catch (error) {\n // Handle authentication errors and cleanup\n if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {\n await this.logout();\n }\n throw error;\n }\n },\n // Verify if the current token is valid\n async isAuthenticated() {\n try {\n await this.me();\n return true;\n }\n catch (error) {\n return false;\n }\n },\n // Invite a user to the app\n inviteUser(userEmail, role) {\n return axios.post(`/apps/${appId}/users/invite-user`, {\n user_email: userEmail,\n role,\n });\n },\n // Register a new user account\n register(payload) {\n return axios.post(`/apps/${appId}/auth/register`, payload);\n },\n // Verify an OTP (One-time password) code\n verifyOtp({ email, otpCode }) {\n return axios.post(`/apps/${appId}/auth/verify-otp`, {\n email,\n otp_code: otpCode,\n });\n },\n // Resend an OTP code to the user's email\n resendOtp(email) {\n return axios.post(`/apps/${appId}/auth/resend-otp`, { email });\n },\n // Request a password reset\n resetPasswordRequest(email) {\n return axios.post(`/apps/${appId}/auth/reset-password-request`, {\n email,\n });\n },\n // Reset password using a reset token\n resetPassword({ resetToken, newPassword }) {\n return axios.post(`/apps/${appId}/auth/reset-password`, {\n reset_token: resetToken,\n new_password: newPassword,\n });\n },\n // Change the user's password\n changePassword({ userId, currentPassword, newPassword, }) {\n return axios.post(`/apps/${appId}/auth/change-password`, {\n user_id: userId,\n current_password: currentPassword,\n new_password: newPassword,\n });\n },\n };\n}\n", "/**\n * Creates the SSO module for the Base44 SDK.\n *\n * @param axios - Axios instance\n * @param appId - Application ID\n * @param userToken - User authentication token\n * @returns SSO module with authentication methods\n * @internal\n */\nexport function createSsoModule(axios, appId, userToken) {\n return {\n // Get SSO access token for a specific user\n async getAccessToken(userid) {\n const url = `/apps/${appId}/auth/sso/accesstoken/${userid}`;\n // Prepare headers with both tokens if available\n const headers = {};\n if (userToken) {\n headers[\"on-behalf-of\"] = `Bearer ${userToken}`;\n }\n return axios.get(url, { headers });\n },\n };\n}\n", "/**\n * Creates the Connectors module for the Base44 SDK.\n *\n * @param axios - Axios instance (should be service role client)\n * @param appId - Application ID\n * @returns Connectors module with methods to retrieve OAuth tokens\n * @internal\n */\nexport function createConnectorsModule(axios, appId) {\n return {\n // Retrieve an OAuth access token for a specific external integration type\n // @ts-expect-error Return type mismatch with interface - implementation returns object, interface expects string\n async getAccessToken(integrationType) {\n if (!integrationType || typeof integrationType !== \"string\") {\n throw new Error(\"Integration type is required and must be a string\");\n }\n const response = await axios.get(`/apps/${appId}/external-auth/tokens/${integrationType}`);\n // @ts-expect-error\n return response.access_token;\n },\n };\n}\n", "/**\n * Retrieves an access token from URL parameters or local storage.\n *\n * Low-level utility for manually retrieving tokens. In most cases, the Base44 client handles\n * token management automatically. This function is useful for custom authentication flows or when you need direct access to stored tokens. Requires a browser environment and can't be used in the backend.\n *\n * @internal\n *\n * @param options - Configuration options for token retrieval.\n * @returns The access token string if found, null otherwise.\n *\n * @example\n * ```typescript\n * // Get access token from URL or local storage\n * const token = getAccessToken();\n *\n * if (token) {\n * console.log('User is authenticated');\n * } else {\n * console.log('No token found, redirect to login');\n * }\n * ```\n * @example\n * ```typescript\n * // Get access token from custom local storage key\n * const token = getAccessToken({ storageKey: 'my_app_token' });\n * ```\n * @example\n * ```typescript\n * // Get access token from URL but don't save or remove it\n * const token = getAccessToken({\n * saveToStorage: false,\n * removeFromUrl: false\n * });\n * ```\n */\nexport function getAccessToken(options = {}) {\n const { storageKey = \"base44_access_token\", paramName = \"access_token\", saveToStorage = true, removeFromUrl = true, } = options;\n let token = null;\n // Try to get token from URL parameters\n if (typeof window !== \"undefined\" && window.location) {\n try {\n const urlParams = new URLSearchParams(window.location.search);\n token = urlParams.get(paramName);\n // If token found in URL\n if (token) {\n // Save token to local storage if requested\n if (saveToStorage) {\n saveAccessToken(token, { storageKey });\n }\n // Remove token from URL for security if requested\n if (removeFromUrl) {\n urlParams.delete(paramName);\n const newUrl = `${window.location.pathname}${urlParams.toString() ? `?${urlParams.toString()}` : \"\"}${window.location.hash}`;\n window.history.replaceState({}, document.title, newUrl);\n }\n return token;\n }\n }\n catch (e) {\n console.error(\"Error retrieving token from URL:\", e);\n }\n }\n // If no token in URL, try local storage\n if (typeof window !== \"undefined\" && window.localStorage) {\n try {\n token = window.localStorage.getItem(storageKey);\n return token;\n }\n catch (e) {\n console.error(\"Error retrieving token from local storage:\", e);\n }\n }\n return null;\n}\n/**\n * Saves an access token to local storage.\n *\n * Low-level utility for manually saving tokens. In most cases, the Base44 client handles token management automatically. This function is useful for custom authentication flows or managing custom tokens. Requires a browser environment and can't be used in the backend.\n *\n * @internal\n *\n * @param token - The access token string to save.\n * @param options - Configuration options for saving the token.\n * @returns Returns`true` if the token was saved successfully, `false` otherwise.\n *\n * @example\n * ```typescript\n * // Save access token after login\n * const response = await base44.auth.loginViaEmailPassword(email, password);\n * const success = saveAccessToken(response.access_token, {});\n *\n * if (success) {\n * console.log('User is now authenticated');\n * // Token is now available for future page loads\n * }\n * ```\n * @example\n * ```typescript\n * // Save access token to local storage using custom key\n * const success = saveAccessToken(token, {\n * storageKey: `my_custom_token_key`\n * });\n * ```\n */\nexport function saveAccessToken(token, options) {\n const { storageKey = \"base44_access_token\" } = options;\n if (typeof window === \"undefined\" || !window.localStorage || !token) {\n return false;\n }\n try {\n window.localStorage.setItem(storageKey, token);\n // Set \"token\" that is set by the built-in SDK of platform version 2\n window.localStorage.setItem(\"token\", token);\n return true;\n }\n catch (e) {\n console.error(\"Error saving token to local storage:\", e);\n return false;\n }\n}\n/**\n * Removes the access token from local storage.\n *\n * Low-level utility for manually removing tokens from the browser's local storage. In most cases, the Base44 client handles token management automatically. For standard logout flows, use {@linkcode AuthModule.logout | base44.auth.logout()} instead, which handles token removal and redirects automatically. This function is useful for custom authentication flows or when you need to manually remove tokens. Requires a browser environment and can't be used in the backend.\n *\n * @internal\n *\n * @param options - Configuration options for token removal.\n * @returns Returns `true` if the token was removed successfully, `false` otherwise.\n *\n * @example\n * ```typescript\n * // Remove custom token key\n * const success = removeAccessToken({\n * storageKey: 'my_custom_token_key'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Standard logout flow with token removal and redirect\n * base44.auth.logout('/login');\n * ```\n */\nexport function removeAccessToken(options) {\n const { storageKey = \"base44_access_token\" } = options;\n if (typeof window === \"undefined\" || !window.localStorage) {\n return false;\n }\n try {\n window.localStorage.removeItem(storageKey);\n return true;\n }\n catch (e) {\n console.error(\"Error removing token from local storage:\", e);\n return false;\n }\n}\n/**\n * Constructs the absolute URL for the login page with a redirect parameter.\n *\n * Low-level utility for building login URLs. For standard login redirects, use {@linkcode AuthModule.redirectToLogin | base44.auth.redirectToLogin()} instead, which handles this automatically. This function is useful when you need to construct login URLs without a client instance or for custom authentication flows.\n *\n * @internal\n *\n * @param nextUrl - The URL to redirect to after successful login.\n * @param options - Configuration options.\n * @returns The complete login URL with encoded redirect parameters.\n *\n * @example\n * ```typescript\n * // Redirect to login page\n * const loginUrl = getLoginUrl('/dashboard', {\n * serverUrl: 'https://base44.app',\n * appId: 'my-app-123'\n * });\n * window.location.href = loginUrl;\n * // User will be redirected back to /dashboard after login\n * ```\n */\nexport function getLoginUrl(nextUrl, options) {\n const { serverUrl, appId, loginPath = \"/login\" } = options;\n if (!serverUrl || !appId) {\n throw new Error(\"serverUrl and appId are required to construct login URL\");\n }\n const encodedRedirectUrl = encodeURIComponent(nextUrl || (typeof window !== \"undefined\" ? window.location.href : \"\"));\n return `${serverUrl}${loginPath}?from_url=${encodedRedirectUrl}&app_id=${appId}`;\n}\n", "/**\n * Creates the functions module for the Base44 SDK.\n *\n * @param axios - Axios instance\n * @param appId - Application ID\n * @returns Functions module with methods to invoke custom backend functions\n * @internal\n */\nexport function createFunctionsModule(axios, appId) {\n return {\n // Invoke a custom backend function by name\n async invoke(functionName, data) {\n // Validate input\n if (typeof data === \"string\") {\n throw new Error(`Function ${functionName} must receive an object with named parameters, received: ${data}`);\n }\n let formData;\n let contentType;\n // Handle file uploads with FormData\n if (data instanceof FormData ||\n (data && Object.values(data).some((value) => value instanceof File))) {\n formData = new FormData();\n Object.keys(data).forEach((key) => {\n if (data[key] instanceof File) {\n formData.append(key, data[key], data[key].name);\n }\n else if (typeof data[key] === \"object\" && data[key] !== null) {\n formData.append(key, JSON.stringify(data[key]));\n }\n else {\n formData.append(key, data[key]);\n }\n });\n contentType = \"multipart/form-data\";\n }\n else {\n formData = data;\n contentType = \"application/json\";\n }\n return axios.post(`/apps/${appId}/functions/${functionName}`, formData || data, { headers: { \"Content-Type\": contentType } });\n },\n };\n}\n", "import { getAccessToken } from \"../utils/auth-utils.js\";\nexport function createAgentsModule({ axios, getSocket, appId, serverUrl, token, }) {\n const baseURL = `/apps/${appId}/agents`;\n // Track active conversations\n const currentConversations = {};\n const getConversations = () => {\n return axios.get(`${baseURL}/conversations`);\n };\n const getConversation = (conversationId) => {\n return axios.get(`${baseURL}/conversations/${conversationId}`);\n };\n const listConversations = (filterParams) => {\n return axios.get(`${baseURL}/conversations`, {\n params: filterParams,\n });\n };\n const createConversation = (conversation) => {\n return axios.post(`${baseURL}/conversations`, conversation);\n };\n const addMessage = async (conversation, message) => {\n return axios.post(`${baseURL}/conversations/v2/${conversation.id}/messages`, message);\n };\n const subscribeToConversation = (conversationId, onUpdate) => {\n const room = `/agent-conversations/${conversationId}`;\n const socket = getSocket();\n // Store the promise for initial conversation state\n const conversationPromise = getConversation(conversationId).then((conv) => {\n currentConversations[conversationId] = conv;\n return conv;\n });\n return socket.subscribeToRoom(room, {\n connect: () => { },\n update_model: async ({ data: jsonStr }) => {\n const data = JSON.parse(jsonStr);\n if (data._message) {\n // Wait for initial conversation to be loaded\n await conversationPromise;\n const message = data._message;\n // Update shared conversation state\n const currentConversation = currentConversations[conversationId];\n if (currentConversation) {\n const messages = currentConversation.messages || [];\n const existingIndex = messages.findIndex((m) => m.id === message.id);\n const updatedMessages = existingIndex !== -1\n ? messages.map((m, i) => (i === existingIndex ? message : m))\n : [...messages, message];\n currentConversations[conversationId] = {\n ...currentConversation,\n messages: updatedMessages,\n };\n onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(currentConversations[conversationId]);\n }\n }\n },\n });\n };\n const getWhatsAppConnectURL = (agentName) => {\n const baseUrl = `${serverUrl}/api/apps/${appId}/agents/${encodeURIComponent(agentName)}/whatsapp`;\n const accessToken = token !== null && token !== void 0 ? token : getAccessToken();\n if (accessToken) {\n return `${baseUrl}?token=${accessToken}`;\n }\n else {\n // No token - URL will redirect to login automatically\n return baseUrl;\n }\n };\n return {\n getConversations,\n getConversation,\n listConversations,\n createConversation,\n addMessage,\n subscribeToConversation,\n getWhatsAppConnectURL,\n };\n}\n", "/**\n * Creates the app logs module for the Base44 SDK.\n *\n * @param axios - Axios instance\n * @param appId - Application ID\n * @returns App logs module with methods for tracking and analyzing app usage\n * @internal\n */\nexport function createAppLogsModule(axios, appId) {\n const baseURL = `/app-logs/${appId}`;\n return {\n // Log user activity in the app\n async logUserInApp(pageName) {\n await axios.post(`${baseURL}/log-user-in-app/${pageName}`);\n },\n // Fetch app logs with optional parameters\n async fetchLogs(params = {}) {\n const response = await axios.get(baseURL, { params });\n return response;\n },\n // Get app statistics\n async getStats(params = {}) {\n const response = await axios.get(`${baseURL}/stats`, { params });\n return response;\n },\n };\n}\n", "/**\n * Creates the users module for the Base44 SDK\n * @param {AxiosInstance} axios - Axios instance\n * @param {string} appId - Application ID\n * @returns {Object} Users module\n */\nexport function createUsersModule(axios, appId) {\n return {\n /**\n * Invite a user to the application\n * @param {string} user_email - User's email address\n * @param {'user'|'admin'} role - User's role (user or admin)\n * @returns {Promise}\n */\n async inviteUser(user_email, role) {\n if (role !== \"user\" && role !== \"admin\") {\n throw new Error(`Invalid role: \"${role}\". Role must be either \"user\" or \"admin\".`);\n }\n const response = await axios.post(`/apps/${appId}/runtime/users/invite-user`, { user_email, role });\n return response;\n },\n };\n}\n", "const PACKET_TYPES = Object.create(null); // no Map = no polyfill\nPACKET_TYPES[\"open\"] = \"0\";\nPACKET_TYPES[\"close\"] = \"1\";\nPACKET_TYPES[\"ping\"] = \"2\";\nPACKET_TYPES[\"pong\"] = \"3\";\nPACKET_TYPES[\"message\"] = \"4\";\nPACKET_TYPES[\"upgrade\"] = \"5\";\nPACKET_TYPES[\"noop\"] = \"6\";\nconst PACKET_TYPES_REVERSE = Object.create(null);\nObject.keys(PACKET_TYPES).forEach((key) => {\n PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key;\n});\nconst ERROR_PACKET = { type: \"error\", data: \"parser error\" };\nexport { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET };\n", "import { PACKET_TYPES } from \"./commons.js\";\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n Object.prototype.toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\n// ArrayBuffer.isView method is not defined in IE10\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj && obj.buffer instanceof ArrayBuffer;\n};\nconst encodePacket = ({ type, data }, supportsBinary, callback) => {\n if (withNativeBlob && data instanceof Blob) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(data, callback);\n }\n }\n else if (withNativeArrayBuffer &&\n (data instanceof ArrayBuffer || isView(data))) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(new Blob([data]), callback);\n }\n }\n // plain string\n return callback(PACKET_TYPES[type] + (data || \"\"));\n};\nconst encodeBlobAsBase64 = (data, callback) => {\n const fileReader = new FileReader();\n fileReader.onload = function () {\n const content = fileReader.result.split(\",\")[1];\n callback(\"b\" + (content || \"\"));\n };\n return fileReader.readAsDataURL(data);\n};\nfunction toArray(data) {\n if (data instanceof Uint8Array) {\n return data;\n }\n else if (data instanceof ArrayBuffer) {\n return new Uint8Array(data);\n }\n else {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n }\n}\nlet TEXT_ENCODER;\nexport function encodePacketToBinary(packet, callback) {\n if (withNativeBlob && packet.data instanceof Blob) {\n return packet.data.arrayBuffer().then(toArray).then(callback);\n }\n else if (withNativeArrayBuffer &&\n (packet.data instanceof ArrayBuffer || isView(packet.data))) {\n return callback(toArray(packet.data));\n }\n encodePacket(packet, false, (encoded) => {\n if (!TEXT_ENCODER) {\n TEXT_ENCODER = new TextEncoder();\n }\n callback(TEXT_ENCODER.encode(encoded));\n });\n}\nexport { encodePacket };\n", "// imported from https://github.com/socketio/base64-arraybuffer\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport const encode = (arraybuffer) => {\n let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport const decode = (base64) => {\n let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n", "import { ERROR_PACKET, PACKET_TYPES_REVERSE, } from \"./commons.js\";\nimport { decode } from \"./contrib/base64-arraybuffer.js\";\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nexport const decodePacket = (encodedPacket, binaryType) => {\n if (typeof encodedPacket !== \"string\") {\n return {\n type: \"message\",\n data: mapBinary(encodedPacket, binaryType),\n };\n }\n const type = encodedPacket.charAt(0);\n if (type === \"b\") {\n return {\n type: \"message\",\n data: decodeBase64Packet(encodedPacket.substring(1), binaryType),\n };\n }\n const packetType = PACKET_TYPES_REVERSE[type];\n if (!packetType) {\n return ERROR_PACKET;\n }\n return encodedPacket.length > 1\n ? {\n type: PACKET_TYPES_REVERSE[type],\n data: encodedPacket.substring(1),\n }\n : {\n type: PACKET_TYPES_REVERSE[type],\n };\n};\nconst decodeBase64Packet = (data, binaryType) => {\n if (withNativeArrayBuffer) {\n const decoded = decode(data);\n return mapBinary(decoded, binaryType);\n }\n else {\n return { base64: true, data }; // fallback for old browsers\n }\n};\nconst mapBinary = (data, binaryType) => {\n switch (binaryType) {\n case \"blob\":\n if (data instanceof Blob) {\n // from WebSocket + binaryType \"blob\"\n return data;\n }\n else {\n // from HTTP long-polling or WebTransport\n return new Blob([data]);\n }\n case \"arraybuffer\":\n default:\n if (data instanceof ArrayBuffer) {\n // from HTTP long-polling (base64) or WebSocket + binaryType \"arraybuffer\"\n return data;\n }\n else {\n // from WebTransport (Uint8Array)\n return data.buffer;\n }\n }\n};\n", "import { encodePacket, encodePacketToBinary } from \"./encodePacket.js\";\nimport { decodePacket } from \"./decodePacket.js\";\nimport { ERROR_PACKET, } from \"./commons.js\";\nconst SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text\nconst encodePayload = (packets, callback) => {\n // some packets may be added to the array while encoding, so the initial length must be saved\n const length = packets.length;\n const encodedPackets = new Array(length);\n let count = 0;\n packets.forEach((packet, i) => {\n // force base64 encoding for binary packets\n encodePacket(packet, false, (encodedPacket) => {\n encodedPackets[i] = encodedPacket;\n if (++count === length) {\n callback(encodedPackets.join(SEPARATOR));\n }\n });\n });\n};\nconst decodePayload = (encodedPayload, binaryType) => {\n const encodedPackets = encodedPayload.split(SEPARATOR);\n const packets = [];\n for (let i = 0; i < encodedPackets.length; i++) {\n const decodedPacket = decodePacket(encodedPackets[i], binaryType);\n packets.push(decodedPacket);\n if (decodedPacket.type === \"error\") {\n break;\n }\n }\n return packets;\n};\nexport function createPacketEncoderStream() {\n return new TransformStream({\n transform(packet, controller) {\n encodePacketToBinary(packet, (encodedPacket) => {\n const payloadLength = encodedPacket.length;\n let header;\n // inspired by the WebSocket format: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length\n if (payloadLength < 126) {\n header = new Uint8Array(1);\n new DataView(header.buffer).setUint8(0, payloadLength);\n }\n else if (payloadLength < 65536) {\n header = new Uint8Array(3);\n const view = new DataView(header.buffer);\n view.setUint8(0, 126);\n view.setUint16(1, payloadLength);\n }\n else {\n header = new Uint8Array(9);\n const view = new DataView(header.buffer);\n view.setUint8(0, 127);\n view.setBigUint64(1, BigInt(payloadLength));\n }\n // first bit indicates whether the payload is plain text (0) or binary (1)\n if (packet.data && typeof packet.data !== \"string\") {\n header[0] |= 0x80;\n }\n controller.enqueue(header);\n controller.enqueue(encodedPacket);\n });\n },\n });\n}\nlet TEXT_DECODER;\nfunction totalLength(chunks) {\n return chunks.reduce((acc, chunk) => acc + chunk.length, 0);\n}\nfunction concatChunks(chunks, size) {\n if (chunks[0].length === size) {\n return chunks.shift();\n }\n const buffer = new Uint8Array(size);\n let j = 0;\n for (let i = 0; i < size; i++) {\n buffer[i] = chunks[0][j++];\n if (j === chunks[0].length) {\n chunks.shift();\n j = 0;\n }\n }\n if (chunks.length && j < chunks[0].length) {\n chunks[0] = chunks[0].slice(j);\n }\n return buffer;\n}\nexport function createPacketDecoderStream(maxPayload, binaryType) {\n if (!TEXT_DECODER) {\n TEXT_DECODER = new TextDecoder();\n }\n const chunks = [];\n let state = 0 /* State.READ_HEADER */;\n let expectedLength = -1;\n let isBinary = false;\n return new TransformStream({\n transform(chunk, controller) {\n chunks.push(chunk);\n while (true) {\n if (state === 0 /* State.READ_HEADER */) {\n if (totalLength(chunks) < 1) {\n break;\n }\n const header = concatChunks(chunks, 1);\n isBinary = (header[0] & 0x80) === 0x80;\n expectedLength = header[0] & 0x7f;\n if (expectedLength < 126) {\n state = 3 /* State.READ_PAYLOAD */;\n }\n else if (expectedLength === 126) {\n state = 1 /* State.READ_EXTENDED_LENGTH_16 */;\n }\n else {\n state = 2 /* State.READ_EXTENDED_LENGTH_64 */;\n }\n }\n else if (state === 1 /* State.READ_EXTENDED_LENGTH_16 */) {\n if (totalLength(chunks) < 2) {\n break;\n }\n const headerArray = concatChunks(chunks, 2);\n expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0);\n state = 3 /* State.READ_PAYLOAD */;\n }\n else if (state === 2 /* State.READ_EXTENDED_LENGTH_64 */) {\n if (totalLength(chunks) < 8) {\n break;\n }\n const headerArray = concatChunks(chunks, 8);\n const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length);\n const n = view.getUint32(0);\n if (n > Math.pow(2, 53 - 32) - 1) {\n // the maximum safe integer in JavaScript is 2^53 - 1\n controller.enqueue(ERROR_PACKET);\n break;\n }\n expectedLength = n * Math.pow(2, 32) + view.getUint32(4);\n state = 3 /* State.READ_PAYLOAD */;\n }\n else {\n if (totalLength(chunks) < expectedLength) {\n break;\n }\n const data = concatChunks(chunks, expectedLength);\n controller.enqueue(decodePacket(isBinary ? data : TEXT_DECODER.decode(data), binaryType));\n state = 0 /* State.READ_HEADER */;\n }\n if (expectedLength === 0 || expectedLength > maxPayload) {\n controller.enqueue(ERROR_PACKET);\n break;\n }\n }\n },\n });\n}\nexport const protocol = 4;\nexport { encodePacket, encodePayload, decodePacket, decodePayload, };\n", "/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nexport function Emitter(obj) {\n if (obj) return mixin(obj);\n}\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n // Remove event specific arrays for event types that no\n // one is subscribed for to avoid memory leak.\n if (callbacks.length === 0) {\n delete this._callbacks['$' + event];\n }\n\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n\n var args = new Array(arguments.length - 1)\n , callbacks = this._callbacks['$' + event];\n\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n// alias used for reserved events (protected method)\nEmitter.prototype.emitReserved = Emitter.prototype.emit;\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n", "export const nextTick = (() => {\n const isPromiseAvailable = typeof Promise === \"function\" && typeof Promise.resolve === \"function\";\n if (isPromiseAvailable) {\n return (cb) => Promise.resolve().then(cb);\n }\n else {\n return (cb, setTimeoutFn) => setTimeoutFn(cb, 0);\n }\n})();\nexport const globalThisShim = (() => {\n if (typeof self !== \"undefined\") {\n return self;\n }\n else if (typeof window !== \"undefined\") {\n return window;\n }\n else {\n return Function(\"return this\")();\n }\n})();\nexport const defaultBinaryType = \"arraybuffer\";\nexport function createCookieJar() { }\n", "import { globalThisShim as globalThis } from \"./globals.node.js\";\nexport function pick(obj, ...attr) {\n return attr.reduce((acc, k) => {\n if (obj.hasOwnProperty(k)) {\n acc[k] = obj[k];\n }\n return acc;\n }, {});\n}\n// Keep a reference to the real timeout functions so they can be used when overridden\nconst NATIVE_SET_TIMEOUT = globalThis.setTimeout;\nconst NATIVE_CLEAR_TIMEOUT = globalThis.clearTimeout;\nexport function installTimerFunctions(obj, opts) {\n if (opts.useNativeTimers) {\n obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);\n obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);\n }\n else {\n obj.setTimeoutFn = globalThis.setTimeout.bind(globalThis);\n obj.clearTimeoutFn = globalThis.clearTimeout.bind(globalThis);\n }\n}\n// base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)\nconst BASE64_OVERHEAD = 1.33;\n// we could also have used `new Blob([obj]).size`, but it isn't supported in IE9\nexport function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}\nfunction utf8Length(str) {\n let c = 0, length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length;\n}\n/**\n * Generates a random 8-characters string.\n */\nexport function randomString() {\n return (Date.now().toString(36).substring(3) +\n Math.random().toString(36).substring(2, 5));\n}\n", "// imported from https://github.com/galkn/querystring\n/**\n * Compiles a querystring\n * Returns string representation of the object\n *\n * @param {Object}\n * @api private\n */\nexport function encode(obj) {\n let str = '';\n for (let i in obj) {\n if (obj.hasOwnProperty(i)) {\n if (str.length)\n str += '&';\n str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\n }\n }\n return str;\n}\n/**\n * Parses a simple querystring into an object\n *\n * @param {String} qs\n * @api private\n */\nexport function decode(qs) {\n let qry = {};\n let pairs = qs.split('&');\n for (let i = 0, l = pairs.length; i < l; i++) {\n let pair = pairs[i].split('=');\n qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n }\n return qry;\n}\n", "import { decodePacket } from \"engine.io-parser\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions } from \"./util.js\";\nimport { encode } from \"./contrib/parseqs.js\";\nexport class TransportError extends Error {\n constructor(reason, description, context) {\n super(reason);\n this.description = description;\n this.context = context;\n this.type = \"TransportError\";\n }\n}\nexport class Transport extends Emitter {\n /**\n * Transport abstract constructor.\n *\n * @param {Object} opts - options\n * @protected\n */\n constructor(opts) {\n super();\n this.writable = false;\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.query = opts.query;\n this.socket = opts.socket;\n this.supportsBinary = !opts.forceBase64;\n }\n /**\n * Emits an error.\n *\n * @param {String} reason\n * @param description\n * @param context - the error context\n * @return {Transport} for chaining\n * @protected\n */\n onError(reason, description, context) {\n super.emitReserved(\"error\", new TransportError(reason, description, context));\n return this;\n }\n /**\n * Opens the transport.\n */\n open() {\n this.readyState = \"opening\";\n this.doOpen();\n return this;\n }\n /**\n * Closes the transport.\n */\n close() {\n if (this.readyState === \"opening\" || this.readyState === \"open\") {\n this.doClose();\n this.onClose();\n }\n return this;\n }\n /**\n * Sends multiple packets.\n *\n * @param {Array} packets\n */\n send(packets) {\n if (this.readyState === \"open\") {\n this.write(packets);\n }\n else {\n // this might happen if the transport was silently closed in the beforeunload event handler\n }\n }\n /**\n * Called upon open\n *\n * @protected\n */\n onOpen() {\n this.readyState = \"open\";\n this.writable = true;\n super.emitReserved(\"open\");\n }\n /**\n * Called with data.\n *\n * @param {String} data\n * @protected\n */\n onData(data) {\n const packet = decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n }\n /**\n * Called with a decoded packet.\n *\n * @protected\n */\n onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }\n /**\n * Called upon close.\n *\n * @protected\n */\n onClose(details) {\n this.readyState = \"closed\";\n super.emitReserved(\"close\", details);\n }\n /**\n * Pauses the transport, in order not to lose packets during an upgrade.\n *\n * @param onPause\n */\n pause(onPause) { }\n createUri(schema, query = {}) {\n return (schema +\n \"://\" +\n this._hostname() +\n this._port() +\n this.opts.path +\n this._query(query));\n }\n _hostname() {\n const hostname = this.opts.hostname;\n return hostname.indexOf(\":\") === -1 ? hostname : \"[\" + hostname + \"]\";\n }\n _port() {\n if (this.opts.port &&\n ((this.opts.secure && Number(this.opts.port) !== 443) ||\n (!this.opts.secure && Number(this.opts.port) !== 80))) {\n return \":\" + this.opts.port;\n }\n else {\n return \"\";\n }\n }\n _query(query) {\n const encodedQuery = encode(query);\n return encodedQuery.length ? \"?\" + encodedQuery : \"\";\n }\n}\n", "import { Transport } from \"../transport.js\";\nimport { randomString } from \"../util.js\";\nimport { encodePayload, decodePayload } from \"engine.io-parser\";\nexport class Polling extends Transport {\n constructor() {\n super(...arguments);\n this._polling = false;\n }\n get name() {\n return \"polling\";\n }\n /**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @protected\n */\n doOpen() {\n this._poll();\n }\n /**\n * Pauses polling.\n *\n * @param {Function} onPause - callback upon buffers are flushed and transport is paused\n * @package\n */\n pause(onPause) {\n this.readyState = \"pausing\";\n const pause = () => {\n this.readyState = \"paused\";\n onPause();\n };\n if (this._polling || !this.writable) {\n let total = 0;\n if (this._polling) {\n total++;\n this.once(\"pollComplete\", function () {\n --total || pause();\n });\n }\n if (!this.writable) {\n total++;\n this.once(\"drain\", function () {\n --total || pause();\n });\n }\n }\n else {\n pause();\n }\n }\n /**\n * Starts polling cycle.\n *\n * @private\n */\n _poll() {\n this._polling = true;\n this.doPoll();\n this.emitReserved(\"poll\");\n }\n /**\n * Overloads onData to detect payloads.\n *\n * @protected\n */\n onData(data) {\n const callback = (packet) => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this._polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this._poll();\n }\n else {\n }\n }\n }\n /**\n * For polling, send a close packet.\n *\n * @protected\n */\n doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }\n /**\n * Writes a packets payload.\n *\n * @param {Array} packets - data packets\n * @protected\n */\n write(packets) {\n this.writable = false;\n encodePayload(packets, (data) => {\n this.doWrite(data, () => {\n this.writable = true;\n this.emitReserved(\"drain\");\n });\n });\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"https\" : \"http\";\n const query = this.query || {};\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = randomString();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n}\n", "// imported from https://github.com/component/has-cors\nlet value = false;\ntry {\n value = typeof XMLHttpRequest !== 'undefined' &&\n 'withCredentials' in new XMLHttpRequest();\n}\ncatch (err) {\n // if XMLHttp support is disabled in IE then it will throw\n // when trying to create\n}\nexport const hasCORS = value;\n", "import { Polling } from \"./polling.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions, pick } from \"../util.js\";\nimport { globalThisShim as globalThis } from \"../globals.node.js\";\nimport { hasCORS } from \"../contrib/has-cors.js\";\nfunction empty() { }\nexport class BaseXHR extends Polling {\n /**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @package\n */\n constructor(opts) {\n super(opts);\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? \"443\" : \"80\";\n }\n this.xd =\n (typeof location !== \"undefined\" &&\n opts.hostname !== location.hostname) ||\n port !== opts.port;\n }\n }\n /**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @private\n */\n doWrite(data, fn) {\n const req = this.request({\n method: \"POST\",\n data: data,\n });\n req.on(\"success\", fn);\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr post error\", xhrStatus, context);\n });\n }\n /**\n * Starts a poll cycle.\n *\n * @private\n */\n doPoll() {\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr poll error\", xhrStatus, context);\n });\n this.pollXhr = req;\n }\n}\nexport class Request extends Emitter {\n /**\n * Request constructor\n *\n * @param {Object} options\n * @package\n */\n constructor(createRequest, uri, opts) {\n super();\n this.createRequest = createRequest;\n installTimerFunctions(this, opts);\n this._opts = opts;\n this._method = opts.method || \"GET\";\n this._uri = uri;\n this._data = undefined !== opts.data ? opts.data : null;\n this._create();\n }\n /**\n * Creates the XHR object and sends the request.\n *\n * @private\n */\n _create() {\n var _a;\n const opts = pick(this._opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this._opts.xd;\n const xhr = (this._xhr = this.createRequest(opts));\n try {\n xhr.open(this._method, this._uri, true);\n try {\n if (this._opts.extraHeaders) {\n // @ts-ignore\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this._opts.extraHeaders) {\n if (this._opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this._opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this._method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n (_a = this._opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this._opts.withCredentials;\n }\n if (this._opts.requestTimeout) {\n xhr.timeout = this._opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n var _a;\n if (xhr.readyState === 3) {\n (_a = this._opts.cookieJar) === null || _a === void 0 ? void 0 : _a.parseCookies(\n // @ts-ignore\n xhr.getResponseHeader(\"set-cookie\"));\n }\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this._onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this._onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this._data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this._onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this._index = Request.requestsCount++;\n Request.requests[this._index] = this;\n }\n }\n /**\n * Called upon error.\n *\n * @private\n */\n _onError(err) {\n this.emitReserved(\"error\", err, this._xhr);\n this._cleanup(true);\n }\n /**\n * Cleans up house.\n *\n * @private\n */\n _cleanup(fromError) {\n if (\"undefined\" === typeof this._xhr || null === this._xhr) {\n return;\n }\n this._xhr.onreadystatechange = empty;\n if (fromError) {\n try {\n this._xhr.abort();\n }\n catch (e) { }\n }\n if (typeof document !== \"undefined\") {\n delete Request.requests[this._index];\n }\n this._xhr = null;\n }\n /**\n * Called upon load.\n *\n * @private\n */\n _onLoad() {\n const data = this._xhr.responseText;\n if (data !== null) {\n this.emitReserved(\"data\", data);\n this.emitReserved(\"success\");\n this._cleanup();\n }\n }\n /**\n * Aborts the request.\n *\n * @package\n */\n abort() {\n this._cleanup();\n }\n}\nRequest.requestsCount = 0;\nRequest.requests = {};\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\nif (typeof document !== \"undefined\") {\n // @ts-ignore\n if (typeof attachEvent === \"function\") {\n // @ts-ignore\n attachEvent(\"onunload\", unloadHandler);\n }\n else if (typeof addEventListener === \"function\") {\n const terminationEvent = \"onpagehide\" in globalThis ? \"pagehide\" : \"unload\";\n addEventListener(terminationEvent, unloadHandler, false);\n }\n}\nfunction unloadHandler() {\n for (let i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\nconst hasXHR2 = (function () {\n const xhr = newRequest({\n xdomain: false,\n });\n return xhr && xhr.responseType !== null;\n})();\n/**\n * HTTP long-polling based on the built-in `XMLHttpRequest` object.\n *\n * Usage: browser\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest\n */\nexport class XHR extends BaseXHR {\n constructor(opts) {\n super(opts);\n const forceBase64 = opts && opts.forceBase64;\n this.supportsBinary = hasXHR2 && !forceBase64;\n }\n request(opts = {}) {\n Object.assign(opts, { xd: this.xd }, this.opts);\n return new Request(newRequest, this.uri(), opts);\n }\n}\nfunction newRequest(opts) {\n const xdomain = opts.xdomain;\n // XMLHttpRequest can be disabled on IE\n try {\n if (\"undefined\" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n return new XMLHttpRequest();\n }\n }\n catch (e) { }\n if (!xdomain) {\n try {\n return new globalThis[[\"Active\"].concat(\"Object\").join(\"X\")](\"Microsoft.XMLHTTP\");\n }\n catch (e) { }\n }\n}\n", "import { Transport } from \"../transport.js\";\nimport { pick, randomString } from \"../util.js\";\nimport { encodePacket } from \"engine.io-parser\";\nimport { globalThisShim as globalThis, nextTick } from \"../globals.node.js\";\n// detect ReactNative environment\nconst isReactNative = typeof navigator !== \"undefined\" &&\n typeof navigator.product === \"string\" &&\n navigator.product.toLowerCase() === \"reactnative\";\nexport class BaseWS extends Transport {\n get name() {\n return \"websocket\";\n }\n doOpen() {\n const uri = this.uri();\n const protocols = this.opts.protocols;\n // React Native only supports the 'headers' option, and will print a warning if anything else is passed\n const opts = isReactNative\n ? {}\n : pick(this.opts, \"agent\", \"perMessageDeflate\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"localAddress\", \"protocolVersion\", \"origin\", \"maxPayload\", \"family\", \"checkServerIdentity\");\n if (this.opts.extraHeaders) {\n opts.headers = this.opts.extraHeaders;\n }\n try {\n this.ws = this.createSocket(uri, protocols, opts);\n }\n catch (err) {\n return this.emitReserved(\"error\", err);\n }\n this.ws.binaryType = this.socket.binaryType;\n this.addEventListeners();\n }\n /**\n * Adds event listeners to the socket\n *\n * @private\n */\n addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = (closeEvent) => this.onClose({\n description: \"websocket connection closed\",\n context: closeEvent,\n });\n this.ws.onmessage = (ev) => this.onData(ev.data);\n this.ws.onerror = (e) => this.onError(\"websocket error\", e);\n }\n write(packets) {\n this.writable = false;\n // encodePacket efficient as it uses WS framing\n // no need for encodePayload\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n encodePacket(packet, this.supportsBinary, (data) => {\n // Sometimes the websocket has already been closed but the browser didn't\n // have a chance of informing us about it yet, in that case send will\n // throw an error\n try {\n this.doWrite(packet, data);\n }\n catch (e) {\n }\n if (lastPacket) {\n // fake drain\n // defer to next tick to allow Socket to clear writeBuffer\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n if (typeof this.ws !== \"undefined\") {\n this.ws.onerror = () => { };\n this.ws.close();\n this.ws = null;\n }\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n const query = this.query || {};\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = randomString();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n}\nconst WebSocketCtor = globalThis.WebSocket || globalThis.MozWebSocket;\n/**\n * WebSocket transport based on the built-in `WebSocket` object.\n *\n * Usage: browser, Node.js (since v21), Deno, Bun\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\n * @see https://caniuse.com/mdn-api_websocket\n * @see https://nodejs.org/api/globals.html#websocket\n */\nexport class WS extends BaseWS {\n createSocket(uri, protocols, opts) {\n return !isReactNative\n ? protocols\n ? new WebSocketCtor(uri, protocols)\n : new WebSocketCtor(uri)\n : new WebSocketCtor(uri, protocols, opts);\n }\n doWrite(_packet, data) {\n this.ws.send(data);\n }\n}\n", "import { Transport } from \"../transport.js\";\nimport { nextTick } from \"../globals.node.js\";\nimport { createPacketDecoderStream, createPacketEncoderStream, } from \"engine.io-parser\";\n/**\n * WebTransport transport based on the built-in `WebTransport` object.\n *\n * Usage: browser, Node.js (with the `@fails-components/webtransport` package)\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebTransport\n * @see https://caniuse.com/webtransport\n */\nexport class WT extends Transport {\n get name() {\n return \"webtransport\";\n }\n doOpen() {\n try {\n // @ts-ignore\n this._transport = new WebTransport(this.createUri(\"https\"), this.opts.transportOptions[this.name]);\n }\n catch (err) {\n return this.emitReserved(\"error\", err);\n }\n this._transport.closed\n .then(() => {\n this.onClose();\n })\n .catch((err) => {\n this.onError(\"webtransport error\", err);\n });\n // note: we could have used async/await, but that would require some additional polyfills\n this._transport.ready.then(() => {\n this._transport.createBidirectionalStream().then((stream) => {\n const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType);\n const reader = stream.readable.pipeThrough(decoderStream).getReader();\n const encoderStream = createPacketEncoderStream();\n encoderStream.readable.pipeTo(stream.writable);\n this._writer = encoderStream.writable.getWriter();\n const read = () => {\n reader\n .read()\n .then(({ done, value }) => {\n if (done) {\n return;\n }\n this.onPacket(value);\n read();\n })\n .catch((err) => {\n });\n };\n read();\n const packet = { type: \"open\" };\n if (this.query.sid) {\n packet.data = `{\"sid\":\"${this.query.sid}\"}`;\n }\n this._writer.write(packet).then(() => this.onOpen());\n });\n });\n }\n write(packets) {\n this.writable = false;\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n this._writer.write(packet).then(() => {\n if (lastPacket) {\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n var _a;\n (_a = this._transport) === null || _a === void 0 ? void 0 : _a.close();\n }\n}\n", "import { XHR } from \"./polling-xhr.node.js\";\nimport { WS } from \"./websocket.node.js\";\nimport { WT } from \"./webtransport.js\";\nexport const transports = {\n websocket: WS,\n webtransport: WT,\n polling: XHR,\n};\n", "// imported from https://github.com/galkn/parseuri\n/**\n * Parses a URI\n *\n * Note: we could also have used the built-in URL object, but it isn't supported on all platforms.\n *\n * See:\n * - https://developer.mozilla.org/en-US/docs/Web/API/URL\n * - https://caniuse.com/url\n * - https://www.rfc-editor.org/rfc/rfc3986#appendix-B\n *\n * History of the parse() method:\n * - first commit: https://github.com/socketio/socket.io-client/commit/4ee1d5d94b3906a9c052b459f1a818b15f38f91c\n * - export into its own module: https://github.com/socketio/engine.io-client/commit/de2c561e4564efeb78f1bdb1ba39ef81b2822cb3\n * - reimport: https://github.com/socketio/engine.io-client/commit/df32277c3f6d622eec5ed09f493cae3f3391d242\n *\n * @author Steven Levithan (MIT license)\n * @api private\n */\nconst re = /^(?:(?![^:@\\/?#]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@\\/?#]*)(?::([^:@\\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\nconst parts = [\n 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\n];\nexport function parse(str) {\n if (str.length > 8000) {\n throw \"URI too long\";\n }\n const src = str, b = str.indexOf('['), e = str.indexOf(']');\n if (b != -1 && e != -1) {\n str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n }\n let m = re.exec(str || ''), uri = {}, i = 14;\n while (i--) {\n uri[parts[i]] = m[i] || '';\n }\n if (b != -1 && e != -1) {\n uri.source = src;\n uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n uri.ipv6uri = true;\n }\n uri.pathNames = pathNames(uri, uri['path']);\n uri.queryKey = queryKey(uri, uri['query']);\n return uri;\n}\nfunction pathNames(obj, path) {\n const regx = /\\/{2,9}/g, names = path.replace(regx, \"/\").split(\"/\");\n if (path.slice(0, 1) == '/' || path.length === 0) {\n names.splice(0, 1);\n }\n if (path.slice(-1) == '/') {\n names.splice(names.length - 1, 1);\n }\n return names;\n}\nfunction queryKey(uri, query) {\n const data = {};\n query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, $1, $2) {\n if ($1) {\n data[$1] = $2;\n }\n });\n return data;\n}\n", "import { transports as DEFAULT_TRANSPORTS } from \"./transports/index.js\";\nimport { installTimerFunctions, byteLength } from \"./util.js\";\nimport { decode } from \"./contrib/parseqs.js\";\nimport { parse } from \"./contrib/parseuri.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { protocol } from \"engine.io-parser\";\nimport { createCookieJar, defaultBinaryType, nextTick, } from \"./globals.node.js\";\nconst withEventListeners = typeof addEventListener === \"function\" &&\n typeof removeEventListener === \"function\";\nconst OFFLINE_EVENT_LISTENERS = [];\nif (withEventListeners) {\n // within a ServiceWorker, any event handler for the 'offline' event must be added on the initial evaluation of the\n // script, so we create one single event listener here which will forward the event to the socket instances\n addEventListener(\"offline\", () => {\n OFFLINE_EVENT_LISTENERS.forEach((listener) => listener());\n }, false);\n}\n/**\n * This class provides a WebSocket-like interface to connect to an Engine.IO server. The connection will be established\n * with one of the available low-level transports, like HTTP long-polling, WebSocket or WebTransport.\n *\n * This class comes without upgrade mechanism, which means that it will keep the first low-level transport that\n * successfully establishes the connection.\n *\n * In order to allow tree-shaking, there are no transports included, that's why the `transports` option is mandatory.\n *\n * @example\n * import { SocketWithoutUpgrade, WebSocket } from \"engine.io-client\";\n *\n * const socket = new SocketWithoutUpgrade({\n * transports: [WebSocket]\n * });\n *\n * socket.on(\"open\", () => {\n * socket.send(\"hello\");\n * });\n *\n * @see SocketWithUpgrade\n * @see Socket\n */\nexport class SocketWithoutUpgrade extends Emitter {\n /**\n * Socket constructor.\n *\n * @param {String|Object} uri - uri or options\n * @param {Object} opts - options\n */\n constructor(uri, opts) {\n super();\n this.binaryType = defaultBinaryType;\n this.writeBuffer = [];\n this._prevBufferLen = 0;\n this._pingInterval = -1;\n this._pingTimeout = -1;\n this._maxPayload = -1;\n /**\n * The expiration timestamp of the {@link _pingTimeoutTimer} object is tracked, in case the timer is throttled and the\n * callback is not fired on time. This can happen for example when a laptop is suspended or when a phone is locked.\n */\n this._pingTimeoutTime = Infinity;\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = null;\n }\n if (uri) {\n const parsedUri = parse(uri);\n opts.hostname = parsedUri.host;\n opts.secure =\n parsedUri.protocol === \"https\" || parsedUri.protocol === \"wss\";\n opts.port = parsedUri.port;\n if (parsedUri.query)\n opts.query = parsedUri.query;\n }\n else if (opts.host) {\n opts.hostname = parse(opts.host).host;\n }\n installTimerFunctions(this, opts);\n this.secure =\n null != opts.secure\n ? opts.secure\n : typeof location !== \"undefined\" && \"https:\" === location.protocol;\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? \"443\" : \"80\";\n }\n this.hostname =\n opts.hostname ||\n (typeof location !== \"undefined\" ? location.hostname : \"localhost\");\n this.port =\n opts.port ||\n (typeof location !== \"undefined\" && location.port\n ? location.port\n : this.secure\n ? \"443\"\n : \"80\");\n this.transports = [];\n this._transportsByName = {};\n opts.transports.forEach((t) => {\n const transportName = t.prototype.name;\n this.transports.push(transportName);\n this._transportsByName[transportName] = t;\n });\n this.opts = Object.assign({\n path: \"/engine.io\",\n agent: false,\n withCredentials: false,\n upgrade: true,\n timestampParam: \"t\",\n rememberUpgrade: false,\n addTrailingSlash: true,\n rejectUnauthorized: true,\n perMessageDeflate: {\n threshold: 1024,\n },\n transportOptions: {},\n closeOnBeforeunload: false,\n }, opts);\n this.opts.path =\n this.opts.path.replace(/\\/$/, \"\") +\n (this.opts.addTrailingSlash ? \"/\" : \"\");\n if (typeof this.opts.query === \"string\") {\n this.opts.query = decode(this.opts.query);\n }\n if (withEventListeners) {\n if (this.opts.closeOnBeforeunload) {\n // Firefox closes the connection when the \"beforeunload\" event is emitted but not Chrome. This event listener\n // ensures every browser behaves the same (no \"disconnect\" event at the Socket.IO level when the page is\n // closed/reloaded)\n this._beforeunloadEventListener = () => {\n if (this.transport) {\n // silently close the transport\n this.transport.removeAllListeners();\n this.transport.close();\n }\n };\n addEventListener(\"beforeunload\", this._beforeunloadEventListener, false);\n }\n if (this.hostname !== \"localhost\") {\n this._offlineEventListener = () => {\n this._onClose(\"transport close\", {\n description: \"network connection lost\",\n });\n };\n OFFLINE_EVENT_LISTENERS.push(this._offlineEventListener);\n }\n }\n if (this.opts.withCredentials) {\n this._cookieJar = createCookieJar();\n }\n this._open();\n }\n /**\n * Creates transport of the given type.\n *\n * @param {String} name - transport name\n * @return {Transport}\n * @private\n */\n createTransport(name) {\n const query = Object.assign({}, this.opts.query);\n // append engine.io protocol identifier\n query.EIO = protocol;\n // transport name\n query.transport = name;\n // session id if we already have one\n if (this.id)\n query.sid = this.id;\n const opts = Object.assign({}, this.opts, {\n query,\n socket: this,\n hostname: this.hostname,\n secure: this.secure,\n port: this.port,\n }, this.opts.transportOptions[name]);\n return new this._transportsByName[name](opts);\n }\n /**\n * Initializes transport to use and starts probe.\n *\n * @private\n */\n _open() {\n if (this.transports.length === 0) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n const transportName = this.opts.rememberUpgrade &&\n SocketWithoutUpgrade.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1\n ? \"websocket\"\n : this.transports[0];\n this.readyState = \"opening\";\n const transport = this.createTransport(transportName);\n transport.open();\n this.setTransport(transport);\n }\n /**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @private\n */\n setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this._onDrain.bind(this))\n .on(\"packet\", this._onPacket.bind(this))\n .on(\"error\", this._onError.bind(this))\n .on(\"close\", (reason) => this._onClose(\"transport close\", reason));\n }\n /**\n * Called when connection is deemed open.\n *\n * @private\n */\n onOpen() {\n this.readyState = \"open\";\n SocketWithoutUpgrade.priorWebsocketSuccess =\n \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n }\n /**\n * Handles a packet.\n *\n * @private\n */\n _onPacket(packet) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n this.emitReserved(\"packet\", packet);\n // Socket is live - any packet counts\n this.emitReserved(\"heartbeat\");\n switch (packet.type) {\n case \"open\":\n this.onHandshake(JSON.parse(packet.data));\n break;\n case \"ping\":\n this._sendPacket(\"pong\");\n this.emitReserved(\"ping\");\n this.emitReserved(\"pong\");\n this._resetPingTimeout();\n break;\n case \"error\":\n const err = new Error(\"server error\");\n // @ts-ignore\n err.code = packet.data;\n this._onError(err);\n break;\n case \"message\":\n this.emitReserved(\"data\", packet.data);\n this.emitReserved(\"message\", packet.data);\n break;\n }\n }\n else {\n }\n }\n /**\n * Called upon handshake completion.\n *\n * @param {Object} data - handshake obj\n * @private\n */\n onHandshake(data) {\n this.emitReserved(\"handshake\", data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this._pingInterval = data.pingInterval;\n this._pingTimeout = data.pingTimeout;\n this._maxPayload = data.maxPayload;\n this.onOpen();\n // In case open handler closes socket\n if (\"closed\" === this.readyState)\n return;\n this._resetPingTimeout();\n }\n /**\n * Sets and resets ping timeout timer based on server pings.\n *\n * @private\n */\n _resetPingTimeout() {\n this.clearTimeoutFn(this._pingTimeoutTimer);\n const delay = this._pingInterval + this._pingTimeout;\n this._pingTimeoutTime = Date.now() + delay;\n this._pingTimeoutTimer = this.setTimeoutFn(() => {\n this._onClose(\"ping timeout\");\n }, delay);\n if (this.opts.autoUnref) {\n this._pingTimeoutTimer.unref();\n }\n }\n /**\n * Called on `drain` event\n *\n * @private\n */\n _onDrain() {\n this.writeBuffer.splice(0, this._prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this._prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }\n /**\n * Flush write buffers.\n *\n * @private\n */\n flush() {\n if (\"closed\" !== this.readyState &&\n this.transport.writable &&\n !this.upgrading &&\n this.writeBuffer.length) {\n const packets = this._getWritablePackets();\n this.transport.send(packets);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this._prevBufferLen = packets.length;\n this.emitReserved(\"flush\");\n }\n }\n /**\n * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP\n * long-polling)\n *\n * @private\n */\n _getWritablePackets() {\n const shouldCheckPayloadSize = this._maxPayload &&\n this.transport.name === \"polling\" &&\n this.writeBuffer.length > 1;\n if (!shouldCheckPayloadSize) {\n return this.writeBuffer;\n }\n let payloadSize = 1; // first packet type\n for (let i = 0; i < this.writeBuffer.length; i++) {\n const data = this.writeBuffer[i].data;\n if (data) {\n payloadSize += byteLength(data);\n }\n if (i > 0 && payloadSize > this._maxPayload) {\n return this.writeBuffer.slice(0, i);\n }\n payloadSize += 2; // separator + packet type\n }\n return this.writeBuffer;\n }\n /**\n * Checks whether the heartbeat timer has expired but the socket has not yet been notified.\n *\n * Note: this method is private for now because it does not really fit the WebSocket API, but if we put it in the\n * `write()` method then the message would not be buffered by the Socket.IO client.\n *\n * @return {boolean}\n * @private\n */\n /* private */ _hasPingExpired() {\n if (!this._pingTimeoutTime)\n return true;\n const hasExpired = Date.now() > this._pingTimeoutTime;\n if (hasExpired) {\n this._pingTimeoutTime = 0;\n nextTick(() => {\n this._onClose(\"ping timeout\");\n }, this.setTimeoutFn);\n }\n return hasExpired;\n }\n /**\n * Sends a message.\n *\n * @param {String} msg - message.\n * @param {Object} options.\n * @param {Function} fn - callback function.\n * @return {Socket} for chaining.\n */\n write(msg, options, fn) {\n this._sendPacket(\"message\", msg, options, fn);\n return this;\n }\n /**\n * Sends a message. Alias of {@link Socket#write}.\n *\n * @param {String} msg - message.\n * @param {Object} options.\n * @param {Function} fn - callback function.\n * @return {Socket} for chaining.\n */\n send(msg, options, fn) {\n this._sendPacket(\"message\", msg, options, fn);\n return this;\n }\n /**\n * Sends a packet.\n *\n * @param {String} type: packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} fn - callback function.\n * @private\n */\n _sendPacket(type, data, options, fn) {\n if (\"function\" === typeof data) {\n fn = data;\n data = undefined;\n }\n if (\"function\" === typeof options) {\n fn = options;\n options = null;\n }\n if (\"closing\" === this.readyState || \"closed\" === this.readyState) {\n return;\n }\n options = options || {};\n options.compress = false !== options.compress;\n const packet = {\n type: type,\n data: data,\n options: options,\n };\n this.emitReserved(\"packetCreate\", packet);\n this.writeBuffer.push(packet);\n if (fn)\n this.once(\"flush\", fn);\n this.flush();\n }\n /**\n * Closes the connection.\n */\n close() {\n const close = () => {\n this._onClose(\"forced close\");\n this.transport.close();\n };\n const cleanupAndClose = () => {\n this.off(\"upgrade\", cleanupAndClose);\n this.off(\"upgradeError\", cleanupAndClose);\n close();\n };\n const waitForUpgrade = () => {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n this.once(\"upgrade\", cleanupAndClose);\n this.once(\"upgradeError\", cleanupAndClose);\n };\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.readyState = \"closing\";\n if (this.writeBuffer.length) {\n this.once(\"drain\", () => {\n if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n });\n }\n else if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n }\n return this;\n }\n /**\n * Called upon transport error\n *\n * @private\n */\n _onError(err) {\n SocketWithoutUpgrade.priorWebsocketSuccess = false;\n if (this.opts.tryAllTransports &&\n this.transports.length > 1 &&\n this.readyState === \"opening\") {\n this.transports.shift();\n return this._open();\n }\n this.emitReserved(\"error\", err);\n this._onClose(\"transport error\", err);\n }\n /**\n * Called upon transport close.\n *\n * @private\n */\n _onClose(reason, description) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n // clear timers\n this.clearTimeoutFn(this._pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (withEventListeners) {\n if (this._beforeunloadEventListener) {\n removeEventListener(\"beforeunload\", this._beforeunloadEventListener, false);\n }\n if (this._offlineEventListener) {\n const i = OFFLINE_EVENT_LISTENERS.indexOf(this._offlineEventListener);\n if (i !== -1) {\n OFFLINE_EVENT_LISTENERS.splice(i, 1);\n }\n }\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, description);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this._prevBufferLen = 0;\n }\n }\n}\nSocketWithoutUpgrade.protocol = protocol;\n/**\n * This class provides a WebSocket-like interface to connect to an Engine.IO server. The connection will be established\n * with one of the available low-level transports, like HTTP long-polling, WebSocket or WebTransport.\n *\n * This class comes with an upgrade mechanism, which means that once the connection is established with the first\n * low-level transport, it will try to upgrade to a better transport.\n *\n * In order to allow tree-shaking, there are no transports included, that's why the `transports` option is mandatory.\n *\n * @example\n * import { SocketWithUpgrade, WebSocket } from \"engine.io-client\";\n *\n * const socket = new SocketWithUpgrade({\n * transports: [WebSocket]\n * });\n *\n * socket.on(\"open\", () => {\n * socket.send(\"hello\");\n * });\n *\n * @see SocketWithoutUpgrade\n * @see Socket\n */\nexport class SocketWithUpgrade extends SocketWithoutUpgrade {\n constructor() {\n super(...arguments);\n this._upgrades = [];\n }\n onOpen() {\n super.onOpen();\n if (\"open\" === this.readyState && this.opts.upgrade) {\n for (let i = 0; i < this._upgrades.length; i++) {\n this._probe(this._upgrades[i]);\n }\n }\n }\n /**\n * Probes a transport.\n *\n * @param {String} name - transport name\n * @private\n */\n _probe(name) {\n let transport = this.createTransport(name);\n let failed = false;\n SocketWithoutUpgrade.priorWebsocketSuccess = false;\n const onTransportOpen = () => {\n if (failed)\n return;\n transport.send([{ type: \"ping\", data: \"probe\" }]);\n transport.once(\"packet\", (msg) => {\n if (failed)\n return;\n if (\"pong\" === msg.type && \"probe\" === msg.data) {\n this.upgrading = true;\n this.emitReserved(\"upgrading\", transport);\n if (!transport)\n return;\n SocketWithoutUpgrade.priorWebsocketSuccess =\n \"websocket\" === transport.name;\n this.transport.pause(() => {\n if (failed)\n return;\n if (\"closed\" === this.readyState)\n return;\n cleanup();\n this.setTransport(transport);\n transport.send([{ type: \"upgrade\" }]);\n this.emitReserved(\"upgrade\", transport);\n transport = null;\n this.upgrading = false;\n this.flush();\n });\n }\n else {\n const err = new Error(\"probe error\");\n // @ts-ignore\n err.transport = transport.name;\n this.emitReserved(\"upgradeError\", err);\n }\n });\n };\n function freezeTransport() {\n if (failed)\n return;\n // Any callback called by transport should be ignored since now\n failed = true;\n cleanup();\n transport.close();\n transport = null;\n }\n // Handle any error that happens while probing\n const onerror = (err) => {\n const error = new Error(\"probe error: \" + err);\n // @ts-ignore\n error.transport = transport.name;\n freezeTransport();\n this.emitReserved(\"upgradeError\", error);\n };\n function onTransportClose() {\n onerror(\"transport closed\");\n }\n // When the socket is closed while we're probing\n function onclose() {\n onerror(\"socket closed\");\n }\n // When the socket is upgraded while we're probing\n function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n freezeTransport();\n }\n }\n // Remove all listeners on the transport and on self\n const cleanup = () => {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n this.off(\"close\", onclose);\n this.off(\"upgrading\", onupgrade);\n };\n transport.once(\"open\", onTransportOpen);\n transport.once(\"error\", onerror);\n transport.once(\"close\", onTransportClose);\n this.once(\"close\", onclose);\n this.once(\"upgrading\", onupgrade);\n if (this._upgrades.indexOf(\"webtransport\") !== -1 &&\n name !== \"webtransport\") {\n // favor WebTransport\n this.setTimeoutFn(() => {\n if (!failed) {\n transport.open();\n }\n }, 200);\n }\n else {\n transport.open();\n }\n }\n onHandshake(data) {\n this._upgrades = this._filterUpgrades(data.upgrades);\n super.onHandshake(data);\n }\n /**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} upgrades - server upgrades\n * @private\n */\n _filterUpgrades(upgrades) {\n const filteredUpgrades = [];\n for (let i = 0; i < upgrades.length; i++) {\n if (~this.transports.indexOf(upgrades[i]))\n filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n }\n}\n/**\n * This class provides a WebSocket-like interface to connect to an Engine.IO server. The connection will be established\n * with one of the available low-level transports, like HTTP long-polling, WebSocket or WebTransport.\n *\n * This class comes with an upgrade mechanism, which means that once the connection is established with the first\n * low-level transport, it will try to upgrade to a better transport.\n *\n * @example\n * import { Socket } from \"engine.io-client\";\n *\n * const socket = new Socket();\n *\n * socket.on(\"open\", () => {\n * socket.send(\"hello\");\n * });\n *\n * @see SocketWithoutUpgrade\n * @see SocketWithUpgrade\n */\nexport class Socket extends SocketWithUpgrade {\n constructor(uri, opts = {}) {\n const o = typeof uri === \"object\" ? uri : opts;\n if (!o.transports ||\n (o.transports && typeof o.transports[0] === \"string\")) {\n o.transports = (o.transports || [\"polling\", \"websocket\", \"webtransport\"])\n .map((transportName) => DEFAULT_TRANSPORTS[transportName])\n .filter((t) => !!t);\n }\n super(uri, o);\n }\n}\n", "import { Socket } from \"./socket.js\";\nexport { Socket };\nexport { SocketWithoutUpgrade, SocketWithUpgrade, } from \"./socket.js\";\nexport const protocol = Socket.protocol;\nexport { Transport, TransportError } from \"./transport.js\";\nexport { transports } from \"./transports/index.js\";\nexport { installTimerFunctions } from \"./util.js\";\nexport { parse } from \"./contrib/parseuri.js\";\nexport { nextTick } from \"./globals.node.js\";\nexport { Fetch } from \"./transports/polling-fetch.js\";\nexport { XHR as NodeXHR } from \"./transports/polling-xhr.node.js\";\nexport { XHR } from \"./transports/polling-xhr.js\";\nexport { WS as NodeWebSocket } from \"./transports/websocket.node.js\";\nexport { WS as WebSocket } from \"./transports/websocket.js\";\nexport { WT as WebTransport } from \"./transports/webtransport.js\";\n", "import { parse } from \"engine.io-client\";\n/**\n * URL parser.\n *\n * @param uri - url\n * @param path - the request path of the connection\n * @param loc - An object meant to mimic window.location.\n * Defaults to window.location.\n * @public\n */\nexport function url(uri, path = \"\", loc) {\n let obj = uri;\n // default to window.location\n loc = loc || (typeof location !== \"undefined\" && location);\n if (null == uri)\n uri = loc.protocol + \"//\" + loc.host;\n // relative path support\n if (typeof uri === \"string\") {\n if (\"/\" === uri.charAt(0)) {\n if (\"/\" === uri.charAt(1)) {\n uri = loc.protocol + uri;\n }\n else {\n uri = loc.host + uri;\n }\n }\n if (!/^(https?|wss?):\\/\\//.test(uri)) {\n if (\"undefined\" !== typeof loc) {\n uri = loc.protocol + \"//\" + uri;\n }\n else {\n uri = \"https://\" + uri;\n }\n }\n // parse\n obj = parse(uri);\n }\n // make sure we treat `localhost:80` and `localhost` equally\n if (!obj.port) {\n if (/^(http|ws)$/.test(obj.protocol)) {\n obj.port = \"80\";\n }\n else if (/^(http|ws)s$/.test(obj.protocol)) {\n obj.port = \"443\";\n }\n }\n obj.path = obj.path || \"/\";\n const ipv6 = obj.host.indexOf(\":\") !== -1;\n const host = ipv6 ? \"[\" + obj.host + \"]\" : obj.host;\n // define unique id\n obj.id = obj.protocol + \"://\" + host + \":\" + obj.port + path;\n // define href\n obj.href =\n obj.protocol +\n \"://\" +\n host +\n (loc && loc.port === obj.port ? \"\" : \":\" + obj.port);\n return obj;\n}\n", "import { Emitter } from \"@socket.io/component-emitter\";\nimport { deconstructPacket, reconstructPacket } from \"./binary.js\";\nimport { isBinary, hasBinary } from \"./is-binary.js\";\nimport debugModule from \"debug\"; // debug()\nconst debug = debugModule(\"socket.io-parser\"); // debug()\n/**\n * These strings must not be used as event names, as they have a special meaning.\n */\nconst RESERVED_EVENTS = [\n \"connect\", // used on the client side\n \"connect_error\", // used on the client side\n \"disconnect\", // used on both sides\n \"disconnecting\", // used on the server side\n \"newListener\", // used by the Node.js EventEmitter\n \"removeListener\", // used by the Node.js EventEmitter\n];\n/**\n * Protocol version.\n *\n * @public\n */\nexport const protocol = 5;\nexport var PacketType;\n(function (PacketType) {\n PacketType[PacketType[\"CONNECT\"] = 0] = \"CONNECT\";\n PacketType[PacketType[\"DISCONNECT\"] = 1] = \"DISCONNECT\";\n PacketType[PacketType[\"EVENT\"] = 2] = \"EVENT\";\n PacketType[PacketType[\"ACK\"] = 3] = \"ACK\";\n PacketType[PacketType[\"CONNECT_ERROR\"] = 4] = \"CONNECT_ERROR\";\n PacketType[PacketType[\"BINARY_EVENT\"] = 5] = \"BINARY_EVENT\";\n PacketType[PacketType[\"BINARY_ACK\"] = 6] = \"BINARY_ACK\";\n})(PacketType || (PacketType = {}));\n/**\n * A socket.io Encoder instance\n */\nexport class Encoder {\n /**\n * Encoder constructor\n *\n * @param {function} replacer - custom replacer to pass down to JSON.parse\n */\n constructor(replacer) {\n this.replacer = replacer;\n }\n /**\n * Encode a packet as a single string if non-binary, or as a\n * buffer sequence, depending on packet type.\n *\n * @param {Object} obj - packet object\n */\n encode(obj) {\n debug(\"encoding packet %j\", obj);\n if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {\n if (hasBinary(obj)) {\n return this.encodeAsBinary({\n type: obj.type === PacketType.EVENT\n ? PacketType.BINARY_EVENT\n : PacketType.BINARY_ACK,\n nsp: obj.nsp,\n data: obj.data,\n id: obj.id,\n });\n }\n }\n return [this.encodeAsString(obj)];\n }\n /**\n * Encode packet as string.\n */\n encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data, this.replacer);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }\n /**\n * Encode packet as 'buffer sequence' by removing blobs, and\n * deconstructing packet into object with placeholders and\n * a list of buffers.\n */\n encodeAsBinary(obj) {\n const deconstruction = deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // write all the buffers\n }\n}\n/**\n * A socket.io Decoder instance\n *\n * @return {Object} decoder\n */\nexport class Decoder extends Emitter {\n /**\n * Decoder constructor\n *\n * @param {function} reviver - custom reviver to pass down to JSON.stringify\n */\n constructor(reviver) {\n super();\n this.reviver = reviver;\n }\n /**\n * Decodes an encoded packet string into packet JSON.\n *\n * @param {String} obj - encoded packet\n */\n add(obj) {\n let packet;\n if (typeof obj === \"string\") {\n if (this.reconstructor) {\n throw new Error(\"got plaintext data when reconstructing a packet\");\n }\n packet = this.decodeString(obj);\n const isBinaryEvent = packet.type === PacketType.BINARY_EVENT;\n if (isBinaryEvent || packet.type === PacketType.BINARY_ACK) {\n packet.type = isBinaryEvent ? PacketType.EVENT : PacketType.ACK;\n // binary packet's json\n this.reconstructor = new BinaryReconstructor(packet);\n // no attachments, labeled binary but no binary data to follow\n if (packet.attachments === 0) {\n super.emitReserved(\"decoded\", packet);\n }\n }\n else {\n // non-binary full packet\n super.emitReserved(\"decoded\", packet);\n }\n }\n else if (isBinary(obj) || obj.base64) {\n // raw binary data\n if (!this.reconstructor) {\n throw new Error(\"got binary data when not reconstructing a packet\");\n }\n else {\n packet = this.reconstructor.takeBinaryData(obj);\n if (packet) {\n // received final buffer\n this.reconstructor = null;\n super.emitReserved(\"decoded\", packet);\n }\n }\n }\n else {\n throw new Error(\"Unknown type: \" + obj);\n }\n }\n /**\n * Decode a packet String (JSON data)\n *\n * @param {String} str\n * @return {Object} packet\n */\n decodeString(str) {\n let i = 0;\n // look up type\n const p = {\n type: Number(str.charAt(0)),\n };\n if (PacketType[p.type] === undefined) {\n throw new Error(\"unknown packet type \" + p.type);\n }\n // look up attachments if type binary\n if (p.type === PacketType.BINARY_EVENT ||\n p.type === PacketType.BINARY_ACK) {\n const start = i + 1;\n while (str.charAt(++i) !== \"-\" && i != str.length) { }\n const buf = str.substring(start, i);\n if (buf != Number(buf) || str.charAt(i) !== \"-\") {\n throw new Error(\"Illegal attachments\");\n }\n p.attachments = Number(buf);\n }\n // look up namespace (if any)\n if (\"/\" === str.charAt(i + 1)) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (\",\" === c)\n break;\n if (i === str.length)\n break;\n }\n p.nsp = str.substring(start, i);\n }\n else {\n p.nsp = \"/\";\n }\n // look up id\n const next = str.charAt(i + 1);\n if (\"\" !== next && Number(next) == next) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (null == c || Number(c) != c) {\n --i;\n break;\n }\n if (i === str.length)\n break;\n }\n p.id = Number(str.substring(start, i + 1));\n }\n // look up json data\n if (str.charAt(++i)) {\n const payload = this.tryParse(str.substr(i));\n if (Decoder.isPayloadValid(p.type, payload)) {\n p.data = payload;\n }\n else {\n throw new Error(\"invalid payload\");\n }\n }\n debug(\"decoded %s as %j\", str, p);\n return p;\n }\n tryParse(str) {\n try {\n return JSON.parse(str, this.reviver);\n }\n catch (e) {\n return false;\n }\n }\n static isPayloadValid(type, payload) {\n switch (type) {\n case PacketType.CONNECT:\n return isObject(payload);\n case PacketType.DISCONNECT:\n return payload === undefined;\n case PacketType.CONNECT_ERROR:\n return typeof payload === \"string\" || isObject(payload);\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n return (Array.isArray(payload) &&\n (typeof payload[0] === \"number\" ||\n (typeof payload[0] === \"string\" &&\n RESERVED_EVENTS.indexOf(payload[0]) === -1)));\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n return Array.isArray(payload);\n }\n }\n /**\n * Deallocates a parser's resources\n */\n destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n this.reconstructor = null;\n }\n }\n}\n/**\n * A manager of a binary event's 'buffer sequence'. Should\n * be constructed whenever a packet of type BINARY_EVENT is\n * decoded.\n *\n * @param {Object} packet\n * @return {BinaryReconstructor} initialized reconstructor\n */\nclass BinaryReconstructor {\n constructor(packet) {\n this.packet = packet;\n this.buffers = [];\n this.reconPack = packet;\n }\n /**\n * Method to be called when binary data received from connection\n * after a BINARY_EVENT packet.\n *\n * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n * @return {null | Object} returns null if more binary data is expected or\n * a reconstructed packet object if all buffers have been received.\n */\n takeBinaryData(binData) {\n this.buffers.push(binData);\n if (this.buffers.length === this.reconPack.attachments) {\n // done with buffer list\n const packet = reconstructPacket(this.reconPack, this.buffers);\n this.finishedReconstruction();\n return packet;\n }\n return null;\n }\n /**\n * Cleans up binary packet reconstruction variables.\n */\n finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }\n}\nfunction isNamespaceValid(nsp) {\n return typeof nsp === \"string\";\n}\n// see https://caniuse.com/mdn-javascript_builtins_number_isinteger\nconst isInteger = Number.isInteger ||\n function (value) {\n return (typeof value === \"number\" &&\n isFinite(value) &&\n Math.floor(value) === value);\n };\nfunction isAckIdValid(id) {\n return id === undefined || isInteger(id);\n}\n// see https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === \"[object Object]\";\n}\nfunction isDataValid(type, payload) {\n switch (type) {\n case PacketType.CONNECT:\n return payload === undefined || isObject(payload);\n case PacketType.DISCONNECT:\n return payload === undefined;\n case PacketType.EVENT:\n return (Array.isArray(payload) &&\n (typeof payload[0] === \"number\" ||\n (typeof payload[0] === \"string\" &&\n RESERVED_EVENTS.indexOf(payload[0]) === -1)));\n case PacketType.ACK:\n return Array.isArray(payload);\n case PacketType.CONNECT_ERROR:\n return typeof payload === \"string\" || isObject(payload);\n default:\n return false;\n }\n}\nexport function isPacketValid(packet) {\n return (isNamespaceValid(packet.nsp) &&\n isAckIdValid(packet.id) &&\n isDataValid(packet.type, packet.data));\n}\n", "const withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj.buffer instanceof ArrayBuffer;\n};\nconst toString = Object.prototype.toString;\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeFile = typeof File === \"function\" ||\n (typeof File !== \"undefined\" &&\n toString.call(File) === \"[object FileConstructor]\");\n/**\n * Returns true if obj is a Buffer, an ArrayBuffer, a Blob or a File.\n *\n * @private\n */\nexport function isBinary(obj) {\n return ((withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj))) ||\n (withNativeBlob && obj instanceof Blob) ||\n (withNativeFile && obj instanceof File));\n}\nexport function hasBinary(obj, toJSON) {\n if (!obj || typeof obj !== \"object\") {\n return false;\n }\n if (Array.isArray(obj)) {\n for (let i = 0, l = obj.length; i < l; i++) {\n if (hasBinary(obj[i])) {\n return true;\n }\n }\n return false;\n }\n if (isBinary(obj)) {\n return true;\n }\n if (obj.toJSON &&\n typeof obj.toJSON === \"function\" &&\n arguments.length === 1) {\n return hasBinary(obj.toJSON(), true);\n }\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n return true;\n }\n }\n return false;\n}\n", "import { isBinary } from \"./is-binary.js\";\n/**\n * Replaces every Buffer | ArrayBuffer | Blob | File in packet with a numbered placeholder.\n *\n * @param {Object} packet - socket.io event packet\n * @return {Object} with deconstructed packet and list of buffers\n * @public\n */\nexport function deconstructPacket(packet) {\n const buffers = [];\n const packetData = packet.data;\n const pack = packet;\n pack.data = _deconstructPacket(packetData, buffers);\n pack.attachments = buffers.length; // number of binary 'attachments'\n return { packet: pack, buffers: buffers };\n}\nfunction _deconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (isBinary(data)) {\n const placeholder = { _placeholder: true, num: buffers.length };\n buffers.push(data);\n return placeholder;\n }\n else if (Array.isArray(data)) {\n const newData = new Array(data.length);\n for (let i = 0; i < data.length; i++) {\n newData[i] = _deconstructPacket(data[i], buffers);\n }\n return newData;\n }\n else if (typeof data === \"object\" && !(data instanceof Date)) {\n const newData = {};\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n newData[key] = _deconstructPacket(data[key], buffers);\n }\n }\n return newData;\n }\n return data;\n}\n/**\n * Reconstructs a binary packet from its placeholder packet and buffers\n *\n * @param {Object} packet - event packet with placeholders\n * @param {Array} buffers - binary buffers to put in placeholder positions\n * @return {Object} reconstructed packet\n * @public\n */\nexport function reconstructPacket(packet, buffers) {\n packet.data = _reconstructPacket(packet.data, buffers);\n delete packet.attachments; // no longer useful\n return packet;\n}\nfunction _reconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (data && data._placeholder === true) {\n const isIndexValid = typeof data.num === \"number\" &&\n data.num >= 0 &&\n data.num < buffers.length;\n if (isIndexValid) {\n return buffers[data.num]; // appropriate buffer (should be natural order anyway)\n }\n else {\n throw new Error(\"illegal attachments\");\n }\n }\n else if (Array.isArray(data)) {\n for (let i = 0; i < data.length; i++) {\n data[i] = _reconstructPacket(data[i], buffers);\n }\n }\n else if (typeof data === \"object\") {\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n data[key] = _reconstructPacket(data[key], buffers);\n }\n }\n }\n return data;\n}\n", "export function on(obj, ev, fn) {\n obj.on(ev, fn);\n return function subDestroy() {\n obj.off(ev, fn);\n };\n}\n", "import { PacketType } from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\n/**\n * Internal events.\n * These events can't be emitted by the user.\n */\nconst RESERVED_EVENTS = Object.freeze({\n connect: 1,\n connect_error: 1,\n disconnect: 1,\n disconnecting: 1,\n // EventEmitter reserved events: https://nodejs.org/api/events.html#events_event_newlistener\n newListener: 1,\n removeListener: 1,\n});\n/**\n * A Socket is the fundamental class for interacting with the server.\n *\n * A Socket belongs to a certain Namespace (by default /) and uses an underlying {@link Manager} to communicate.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(\"connected\");\n * });\n *\n * // send an event to the server\n * socket.emit(\"foo\", \"bar\");\n *\n * socket.on(\"foobar\", () => {\n * // an event was received from the server\n * });\n *\n * // upon disconnection\n * socket.on(\"disconnect\", (reason) => {\n * console.log(`disconnected due to ${reason}`);\n * });\n */\nexport class Socket extends Emitter {\n /**\n * `Socket` constructor.\n */\n constructor(io, nsp, opts) {\n super();\n /**\n * Whether the socket is currently connected to the server.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.connected); // true\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.connected); // false\n * });\n */\n this.connected = false;\n /**\n * Whether the connection state was recovered after a temporary disconnection. In that case, any missed packets will\n * be transmitted by the server.\n */\n this.recovered = false;\n /**\n * Buffer for packets received before the CONNECT packet\n */\n this.receiveBuffer = [];\n /**\n * Buffer for packets that will be sent once the socket is connected\n */\n this.sendBuffer = [];\n /**\n * The queue of packets to be sent with retry in case of failure.\n *\n * Packets are sent one by one, each waiting for the server acknowledgement, in order to guarantee the delivery order.\n * @private\n */\n this._queue = [];\n /**\n * A sequence to generate the ID of the {@link QueuedPacket}.\n * @private\n */\n this._queueSeq = 0;\n this.ids = 0;\n /**\n * A map containing acknowledgement handlers.\n *\n * The `withError` attribute is used to differentiate handlers that accept an error as first argument:\n *\n * - `socket.emit(\"test\", (err, value) => { ... })` with `ackTimeout` option\n * - `socket.timeout(5000).emit(\"test\", (err, value) => { ... })`\n * - `const value = await socket.emitWithAck(\"test\")`\n *\n * From those that don't:\n *\n * - `socket.emit(\"test\", (value) => { ... });`\n *\n * In the first case, the handlers will be called with an error when:\n *\n * - the timeout is reached\n * - the socket gets disconnected\n *\n * In the second case, the handlers will be simply discarded upon disconnection, since the client will never receive\n * an acknowledgement from the server.\n *\n * @private\n */\n this.acks = {};\n this.flags = {};\n this.io = io;\n this.nsp = nsp;\n if (opts && opts.auth) {\n this.auth = opts.auth;\n }\n this._opts = Object.assign({}, opts);\n if (this.io._autoConnect)\n this.open();\n }\n /**\n * Whether the socket is currently disconnected\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.disconnected); // false\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.disconnected); // true\n * });\n */\n get disconnected() {\n return !this.connected;\n }\n /**\n * Subscribe to open, close and packet events\n *\n * @private\n */\n subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on(io, \"open\", this.onopen.bind(this)),\n on(io, \"packet\", this.onpacket.bind(this)),\n on(io, \"error\", this.onerror.bind(this)),\n on(io, \"close\", this.onclose.bind(this)),\n ];\n }\n /**\n * Whether the Socket will try to reconnect when its Manager connects or reconnects.\n *\n * @example\n * const socket = io();\n *\n * console.log(socket.active); // true\n *\n * socket.on(\"disconnect\", (reason) => {\n * if (reason === \"io server disconnect\") {\n * // the disconnection was initiated by the server, you need to manually reconnect\n * console.log(socket.active); // false\n * }\n * // else the socket will automatically try to reconnect\n * console.log(socket.active); // true\n * });\n */\n get active() {\n return !!this.subs;\n }\n /**\n * \"Opens\" the socket.\n *\n * @example\n * const socket = io({\n * autoConnect: false\n * });\n *\n * socket.connect();\n */\n connect() {\n if (this.connected)\n return this;\n this.subEvents();\n if (!this.io[\"_reconnecting\"])\n this.io.open(); // ensure open\n if (\"open\" === this.io._readyState)\n this.onopen();\n return this;\n }\n /**\n * Alias for {@link connect()}.\n */\n open() {\n return this.connect();\n }\n /**\n * Sends a `message` event.\n *\n * This method mimics the WebSocket.send() method.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send\n *\n * @example\n * socket.send(\"hello\");\n *\n * // this is equivalent to\n * socket.emit(\"message\", \"hello\");\n *\n * @return self\n */\n send(...args) {\n args.unshift(\"message\");\n this.emit.apply(this, args);\n return this;\n }\n /**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @example\n * socket.emit(\"hello\", \"world\");\n *\n * // all serializable datastructures are supported (no need to call JSON.stringify)\n * socket.emit(\"hello\", 1, \"2\", { 3: [\"4\"], 5: Uint8Array.from([6]) });\n *\n * // with an acknowledgement from the server\n * socket.emit(\"hello\", \"world\", (val) => {\n * // ...\n * });\n *\n * @return self\n */\n emit(ev, ...args) {\n var _a, _b, _c;\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev.toString() + '\" is a reserved event name');\n }\n args.unshift(ev);\n if (this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) {\n this._addToQueue(args);\n return this;\n }\n const packet = {\n type: PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n const id = this.ids++;\n const ack = args.pop();\n this._registerAckCallback(id, ack);\n packet.id = id;\n }\n const isTransportWritable = (_b = (_a = this.io.engine) === null || _a === void 0 ? void 0 : _a.transport) === null || _b === void 0 ? void 0 : _b.writable;\n const isConnected = this.connected && !((_c = this.io.engine) === null || _c === void 0 ? void 0 : _c._hasPingExpired());\n const discardPacket = this.flags.volatile && !isTransportWritable;\n if (discardPacket) {\n }\n else if (isConnected) {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }\n /**\n * @private\n */\n _registerAckCallback(id, ack) {\n var _a;\n const timeout = (_a = this.flags.timeout) !== null && _a !== void 0 ? _a : this._opts.ackTimeout;\n if (timeout === undefined) {\n this.acks[id] = ack;\n return;\n }\n // @ts-ignore\n const timer = this.io.setTimeoutFn(() => {\n delete this.acks[id];\n for (let i = 0; i < this.sendBuffer.length; i++) {\n if (this.sendBuffer[i].id === id) {\n this.sendBuffer.splice(i, 1);\n }\n }\n ack.call(this, new Error(\"operation has timed out\"));\n }, timeout);\n const fn = (...args) => {\n // @ts-ignore\n this.io.clearTimeoutFn(timer);\n ack.apply(this, args);\n };\n fn.withError = true;\n this.acks[id] = fn;\n }\n /**\n * Emits an event and waits for an acknowledgement\n *\n * @example\n * // without timeout\n * const response = await socket.emitWithAck(\"hello\", \"world\");\n *\n * // with a specific timeout\n * try {\n * const response = await socket.timeout(1000).emitWithAck(\"hello\", \"world\");\n * } catch (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n *\n * @return a Promise that will be fulfilled when the server acknowledges the event\n */\n emitWithAck(ev, ...args) {\n return new Promise((resolve, reject) => {\n const fn = (arg1, arg2) => {\n return arg1 ? reject(arg1) : resolve(arg2);\n };\n fn.withError = true;\n args.push(fn);\n this.emit(ev, ...args);\n });\n }\n /**\n * Add the packet to the queue.\n * @param args\n * @private\n */\n _addToQueue(args) {\n let ack;\n if (typeof args[args.length - 1] === \"function\") {\n ack = args.pop();\n }\n const packet = {\n id: this._queueSeq++,\n tryCount: 0,\n pending: false,\n args,\n flags: Object.assign({ fromQueue: true }, this.flags),\n };\n args.push((err, ...responseArgs) => {\n if (packet !== this._queue[0]) {\n }\n const hasError = err !== null;\n if (hasError) {\n if (packet.tryCount > this._opts.retries) {\n this._queue.shift();\n if (ack) {\n ack(err);\n }\n }\n }\n else {\n this._queue.shift();\n if (ack) {\n ack(null, ...responseArgs);\n }\n }\n packet.pending = false;\n return this._drainQueue();\n });\n this._queue.push(packet);\n this._drainQueue();\n }\n /**\n * Send the first packet of the queue, and wait for an acknowledgement from the server.\n * @param force - whether to resend a packet that has not been acknowledged yet\n *\n * @private\n */\n _drainQueue(force = false) {\n if (!this.connected || this._queue.length === 0) {\n return;\n }\n const packet = this._queue[0];\n if (packet.pending && !force) {\n return;\n }\n packet.pending = true;\n packet.tryCount++;\n this.flags = packet.flags;\n this.emit.apply(this, packet.args);\n }\n /**\n * Sends a packet.\n *\n * @param packet\n * @private\n */\n packet(packet) {\n packet.nsp = this.nsp;\n this.io._packet(packet);\n }\n /**\n * Called upon engine `open`.\n *\n * @private\n */\n onopen() {\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this._sendConnectPacket(data);\n });\n }\n else {\n this._sendConnectPacket(this.auth);\n }\n }\n /**\n * Sends a CONNECT packet to initiate the Socket.IO session.\n *\n * @param data\n * @private\n */\n _sendConnectPacket(data) {\n this.packet({\n type: PacketType.CONNECT,\n data: this._pid\n ? Object.assign({ pid: this._pid, offset: this._lastOffset }, data)\n : data,\n });\n }\n /**\n * Called upon engine or manager `error`.\n *\n * @param err\n * @private\n */\n onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }\n /**\n * Called upon engine `close`.\n *\n * @param reason\n * @param description\n * @private\n */\n onclose(reason, description) {\n this.connected = false;\n delete this.id;\n this.emitReserved(\"disconnect\", reason, description);\n this._clearAcks();\n }\n /**\n * Clears the acknowledgement handlers upon disconnection, since the client will never receive an acknowledgement from\n * the server.\n *\n * @private\n */\n _clearAcks() {\n Object.keys(this.acks).forEach((id) => {\n const isBuffered = this.sendBuffer.some((packet) => String(packet.id) === id);\n if (!isBuffered) {\n // note: handlers that do not accept an error as first argument are ignored here\n const ack = this.acks[id];\n delete this.acks[id];\n if (ack.withError) {\n ack.call(this, new Error(\"socket has been disconnected\"));\n }\n }\n });\n }\n /**\n * Called with socket packet.\n *\n * @param packet\n * @private\n */\n onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n this.onconnect(packet.data.sid, packet.data.pid);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }\n /**\n * Called upon a server event.\n *\n * @param packet\n * @private\n */\n onevent(packet) {\n const args = packet.data || [];\n if (null != packet.id) {\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }\n emitEvent(args) {\n if (this._anyListeners && this._anyListeners.length) {\n const listeners = this._anyListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, args);\n }\n }\n super.emit.apply(this, args);\n if (this._pid && args.length && typeof args[args.length - 1] === \"string\") {\n this._lastOffset = args[args.length - 1];\n }\n }\n /**\n * Produces an ack callback to emit with an event.\n *\n * @private\n */\n ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n self.packet({\n type: PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }\n /**\n * Called upon a server acknowledgement.\n *\n * @param packet\n * @private\n */\n onack(packet) {\n const ack = this.acks[packet.id];\n if (typeof ack !== \"function\") {\n return;\n }\n delete this.acks[packet.id];\n // @ts-ignore FIXME ack is incorrectly inferred as 'never'\n if (ack.withError) {\n packet.data.unshift(null);\n }\n // @ts-ignore\n ack.apply(this, packet.data);\n }\n /**\n * Called upon server connect.\n *\n * @private\n */\n onconnect(id, pid) {\n this.id = id;\n this.recovered = pid && this._pid === pid;\n this._pid = pid; // defined only if connection state recovery is enabled\n this.connected = true;\n this.emitBuffered();\n this._drainQueue(true);\n this.emitReserved(\"connect\");\n }\n /**\n * Emit buffered events (received and emitted).\n *\n * @private\n */\n emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n });\n this.sendBuffer = [];\n }\n /**\n * Called upon server disconnect.\n *\n * @private\n */\n ondisconnect() {\n this.destroy();\n this.onclose(\"io server disconnect\");\n }\n /**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @private\n */\n destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }\n /**\n * Disconnects the socket manually. In that case, the socket will not try to reconnect.\n *\n * If this is the last active Socket instance of the {@link Manager}, the low-level connection will be closed.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"disconnect\", (reason) => {\n * // console.log(reason); prints \"io client disconnect\"\n * });\n *\n * socket.disconnect();\n *\n * @return self\n */\n disconnect() {\n if (this.connected) {\n this.packet({ type: PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }\n /**\n * Alias for {@link disconnect()}.\n *\n * @return self\n */\n close() {\n return this.disconnect();\n }\n /**\n * Sets the compress flag.\n *\n * @example\n * socket.compress(false).emit(\"hello\");\n *\n * @param compress - if `true`, compresses the sending data\n * @return self\n */\n compress(compress) {\n this.flags.compress = compress;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not\n * ready to send messages.\n *\n * @example\n * socket.volatile.emit(\"hello\"); // the server may or may not receive it\n *\n * @returns self\n */\n get volatile() {\n this.flags.volatile = true;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the callback will be called with an error when the\n * given number of milliseconds have elapsed without an acknowledgement from the server:\n *\n * @example\n * socket.timeout(5000).emit(\"my-event\", (err) => {\n * if (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n * });\n *\n * @returns self\n */\n timeout(timeout) {\n this.flags.timeout = timeout;\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * @example\n * socket.onAny((event, ...args) => {\n * console.log(`got ${event}`);\n * });\n *\n * @param listener\n */\n onAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * @example\n * socket.prependAny((event, ...args) => {\n * console.log(`got event ${event}`);\n * });\n *\n * @param listener\n */\n prependAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`got event ${event}`);\n * }\n *\n * socket.onAny(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAny(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAny();\n *\n * @param listener\n */\n offAny(listener) {\n if (!this._anyListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAny() {\n return this._anyListeners || [];\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.onAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n onAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.prependAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n prependAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`sent event ${event}`);\n * }\n *\n * socket.onAnyOutgoing(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAnyOutgoing(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAnyOutgoing();\n *\n * @param [listener] - the catch-all listener (optional)\n */\n offAnyOutgoing(listener) {\n if (!this._anyOutgoingListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyOutgoingListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyOutgoingListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAnyOutgoing() {\n return this._anyOutgoingListeners || [];\n }\n /**\n * Notify the listeners for each packet sent\n *\n * @param packet\n *\n * @private\n */\n notifyOutgoingListeners(packet) {\n if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {\n const listeners = this._anyOutgoingListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, packet.data);\n }\n }\n }\n}\n", "/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\nexport function Backoff(opts) {\n opts = opts || {};\n this.ms = opts.min || 100;\n this.max = opts.max || 10000;\n this.factor = opts.factor || 2;\n this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n this.attempts = 0;\n}\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\nBackoff.prototype.duration = function () {\n var ms = this.ms * Math.pow(this.factor, this.attempts++);\n if (this.jitter) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.jitter * ms);\n ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;\n }\n return Math.min(ms, this.max) | 0;\n};\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\nBackoff.prototype.reset = function () {\n this.attempts = 0;\n};\n/**\n * Set the minimum duration\n *\n * @api public\n */\nBackoff.prototype.setMin = function (min) {\n this.ms = min;\n};\n/**\n * Set the maximum duration\n *\n * @api public\n */\nBackoff.prototype.setMax = function (max) {\n this.max = max;\n};\n/**\n * Set the jitter\n *\n * @api public\n */\nBackoff.prototype.setJitter = function (jitter) {\n this.jitter = jitter;\n};\n", "import { Socket as Engine, installTimerFunctions, nextTick, } from \"engine.io-client\";\nimport { Socket } from \"./socket.js\";\nimport * as parser from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Backoff } from \"./contrib/backo2.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\nexport class Manager extends Emitter {\n constructor(uri, opts) {\n var _a;\n super();\n this.nsps = {};\n this.subs = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n opts.path = opts.path || \"/socket.io\";\n this.opts = opts;\n installTimerFunctions(this, opts);\n this.reconnection(opts.reconnection !== false);\n this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n this.reconnectionDelay(opts.reconnectionDelay || 1000);\n this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);\n this.backoff = new Backoff({\n min: this.reconnectionDelay(),\n max: this.reconnectionDelayMax(),\n jitter: this.randomizationFactor(),\n });\n this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n this._readyState = \"closed\";\n this.uri = uri;\n const _parser = opts.parser || parser;\n this.encoder = new _parser.Encoder();\n this.decoder = new _parser.Decoder();\n this._autoConnect = opts.autoConnect !== false;\n if (this._autoConnect)\n this.open();\n }\n reconnection(v) {\n if (!arguments.length)\n return this._reconnection;\n this._reconnection = !!v;\n if (!v) {\n this.skipReconnect = true;\n }\n return this;\n }\n reconnectionAttempts(v) {\n if (v === undefined)\n return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n }\n reconnectionDelay(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelay;\n this._reconnectionDelay = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(v);\n return this;\n }\n randomizationFactor(v) {\n var _a;\n if (v === undefined)\n return this._randomizationFactor;\n this._randomizationFactor = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(v);\n return this;\n }\n reconnectionDelayMax(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(v);\n return this;\n }\n timeout(v) {\n if (!arguments.length)\n return this._timeout;\n this._timeout = v;\n return this;\n }\n /**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @private\n */\n maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }\n /**\n * Sets the current transport `socket`.\n *\n * @param {Function} fn - optional, callback\n * @return self\n * @public\n */\n open(fn) {\n if (~this._readyState.indexOf(\"open\"))\n return this;\n this.engine = new Engine(this.uri, this.opts);\n const socket = this.engine;\n const self = this;\n this._readyState = \"opening\";\n this.skipReconnect = false;\n // emit `open`\n const openSubDestroy = on(socket, \"open\", function () {\n self.onopen();\n fn && fn();\n });\n const onError = (err) => {\n this.cleanup();\n this._readyState = \"closed\";\n this.emitReserved(\"error\", err);\n if (fn) {\n fn(err);\n }\n else {\n // Only do this if there is no fn to handle the error\n this.maybeReconnectOnOpen();\n }\n };\n // emit `error`\n const errorSub = on(socket, \"error\", onError);\n if (false !== this._timeout) {\n const timeout = this._timeout;\n // set timer\n const timer = this.setTimeoutFn(() => {\n openSubDestroy();\n onError(new Error(\"timeout\"));\n socket.close();\n }, timeout);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n this.subs.push(openSubDestroy);\n this.subs.push(errorSub);\n return this;\n }\n /**\n * Alias for open()\n *\n * @return self\n * @public\n */\n connect(fn) {\n return this.open(fn);\n }\n /**\n * Called upon transport open.\n *\n * @private\n */\n onopen() {\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on(socket, \"ping\", this.onping.bind(this)), on(socket, \"data\", this.ondata.bind(this)), on(socket, \"error\", this.onerror.bind(this)), on(socket, \"close\", this.onclose.bind(this)), \n // @ts-ignore\n on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }\n /**\n * Called upon a ping.\n *\n * @private\n */\n onping() {\n this.emitReserved(\"ping\");\n }\n /**\n * Called with data.\n *\n * @private\n */\n ondata(data) {\n try {\n this.decoder.add(data);\n }\n catch (e) {\n this.onclose(\"parse error\", e);\n }\n }\n /**\n * Called when parser fully decodes a packet.\n *\n * @private\n */\n ondecoded(packet) {\n // the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a \"parse error\"\n nextTick(() => {\n this.emitReserved(\"packet\", packet);\n }, this.setTimeoutFn);\n }\n /**\n * Called upon socket error.\n *\n * @private\n */\n onerror(err) {\n this.emitReserved(\"error\", err);\n }\n /**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @public\n */\n socket(nsp, opts) {\n let socket = this.nsps[nsp];\n if (!socket) {\n socket = new Socket(this, nsp, opts);\n this.nsps[nsp] = socket;\n }\n else if (this._autoConnect && !socket.active) {\n socket.connect();\n }\n return socket;\n }\n /**\n * Called upon a socket close.\n *\n * @param socket\n * @private\n */\n _destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n return;\n }\n }\n this._close();\n }\n /**\n * Writes a packet.\n *\n * @param packet\n * @private\n */\n _packet(packet) {\n const encodedPackets = this.encoder.encode(packet);\n for (let i = 0; i < encodedPackets.length; i++) {\n this.engine.write(encodedPackets[i], packet.options);\n }\n }\n /**\n * Clean up transport subscriptions and packet buffer.\n *\n * @private\n */\n cleanup() {\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }\n /**\n * Close the current socket.\n *\n * @private\n */\n _close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n }\n /**\n * Alias for close()\n *\n * @private\n */\n disconnect() {\n return this._close();\n }\n /**\n * Called when:\n *\n * - the low-level engine is closed\n * - the parser encountered a badly formatted packet\n * - all sockets are disconnected\n *\n * @private\n */\n onclose(reason, description) {\n var _a;\n this.cleanup();\n (_a = this.engine) === null || _a === void 0 ? void 0 : _a.close();\n this.backoff.reset();\n this._readyState = \"closed\";\n this.emitReserved(\"close\", reason, description);\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n }\n /**\n * Attempt a reconnection.\n *\n * @private\n */\n reconnect() {\n if (this._reconnecting || this.skipReconnect)\n return this;\n const self = this;\n if (this.backoff.attempts >= this._reconnectionAttempts) {\n this.backoff.reset();\n this.emitReserved(\"reconnect_failed\");\n this._reconnecting = false;\n }\n else {\n const delay = this.backoff.duration();\n this._reconnecting = true;\n const timer = this.setTimeoutFn(() => {\n if (self.skipReconnect)\n return;\n this.emitReserved(\"reconnect_attempt\", self.backoff.attempts);\n // check again for the case socket closed in above events\n if (self.skipReconnect)\n return;\n self.open((err) => {\n if (err) {\n self._reconnecting = false;\n self.reconnect();\n this.emitReserved(\"reconnect_error\", err);\n }\n else {\n self.onreconnect();\n }\n });\n }, delay);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n }\n /**\n * Called upon successful reconnect.\n *\n * @private\n */\n onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }\n}\n", "import { url } from \"./url.js\";\nimport { Manager } from \"./manager.js\";\nimport { Socket } from \"./socket.js\";\n/**\n * Managers cache.\n */\nconst cache = {};\nfunction lookup(uri, opts) {\n if (typeof uri === \"object\") {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n const parsed = url(uri, opts.path || \"/socket.io\");\n const source = parsed.source;\n const id = parsed.id;\n const path = parsed.path;\n const sameNamespace = cache[id] && path in cache[id][\"nsps\"];\n const newConnection = opts.forceNew ||\n opts[\"force new connection\"] ||\n false === opts.multiplex ||\n sameNamespace;\n let io;\n if (newConnection) {\n io = new Manager(source, opts);\n }\n else {\n if (!cache[id]) {\n cache[id] = new Manager(source, opts);\n }\n io = cache[id];\n }\n if (parsed.query && !opts.query) {\n opts.query = parsed.queryKey;\n }\n return io.socket(parsed.path, opts);\n}\n// so that \"lookup\" can be used both as a function (e.g. `io(...)`) and as a\n// namespace (e.g. `io.connect(...)`), for backward compatibility\nObject.assign(lookup, {\n Manager,\n Socket,\n io: lookup,\n connect: lookup,\n});\n/**\n * Protocol version.\n *\n * @public\n */\nexport { protocol } from \"socket.io-parser\";\n/**\n * Expose constructors for standalone build.\n *\n * @public\n */\nexport { Manager, Socket, lookup as io, lookup as connect, lookup as default, };\nexport { Fetch, NodeXHR, XHR, NodeWebSocket, WebSocket, WebTransport, } from \"engine.io-client\";\n", "import { io } from \"socket.io-client\";\nimport { getAccessToken } from \"./auth-utils.js\";\nfunction initializeSocket(config, handlers) {\n var _a;\n const socket = io(config.serverUrl, {\n path: config.mountPath,\n transports: config.transports,\n query: {\n app_id: config.appId,\n token: (_a = config.token) !== null && _a !== void 0 ? _a : getAccessToken(),\n },\n });\n socket.on(\"connect\", async () => {\n var _a;\n console.log(\"connect\", socket.id);\n return (_a = handlers.connect) === null || _a === void 0 ? void 0 : _a.call(handlers);\n });\n socket.on(\"update_model\", async (msg) => {\n var _a;\n return (_a = handlers.update_model) === null || _a === void 0 ? void 0 : _a.call(handlers, msg);\n });\n socket.on(\"error\", async (error) => {\n var _a;\n return (_a = handlers.error) === null || _a === void 0 ? void 0 : _a.call(handlers, error);\n });\n socket.on(\"connect_error\", async (error) => {\n var _a;\n console.error(\"connect_error\", error);\n return (_a = handlers.error) === null || _a === void 0 ? void 0 : _a.call(handlers, error);\n });\n return socket;\n}\nexport function RoomsSocket({ config }) {\n let currentConfig = { ...config };\n const roomsToListeners = {};\n const handlers = {\n connect: async () => {\n const promises = [];\n Object.keys(roomsToListeners).forEach((room) => {\n joinRoom(room);\n const listeners = getListeners(room);\n listeners === null || listeners === void 0 ? void 0 : listeners.forEach(({ connect }) => {\n const promise = async () => connect === null || connect === void 0 ? void 0 : connect();\n promises.push(promise());\n });\n });\n await Promise.all(promises);\n },\n update_model: async (msg) => {\n const listeners = getListeners(msg.room);\n const promises = listeners.map((listener) => { var _a; return (_a = listener.update_model) === null || _a === void 0 ? void 0 : _a.call(listener, msg); });\n await Promise.all(promises);\n },\n error: async (error) => {\n console.error(\"error\", error);\n const promises = Object.values(roomsToListeners)\n .flat()\n .map((listener) => { var _a; return (_a = listener.error) === null || _a === void 0 ? void 0 : _a.call(listener, error); });\n await Promise.all(promises);\n },\n };\n let socket = initializeSocket(config, handlers);\n function cleanup() {\n disconnect();\n }\n function disconnect() {\n if (socket) {\n socket.disconnect();\n }\n }\n function updateConfig(config) {\n cleanup();\n currentConfig = {\n ...currentConfig,\n ...config,\n };\n socket = initializeSocket(currentConfig, handlers);\n }\n function joinRoom(room) {\n socket.emit(\"join\", room);\n }\n function leaveRoom(room) {\n socket.emit(\"leave\", room);\n }\n async function updateModel(room, data) {\n var _a;\n const dataStr = JSON.stringify(data);\n return (_a = handlers.update_model) === null || _a === void 0 ? void 0 : _a.call(handlers, { room, data: dataStr });\n }\n function getListeners(room) {\n return roomsToListeners[room];\n }\n const subscribeToRoom = (room, handlers) => {\n if (!roomsToListeners[room]) {\n joinRoom(room);\n roomsToListeners[room] = [];\n }\n roomsToListeners[room].push(handlers);\n return () => {\n var _a, _b;\n roomsToListeners[room] =\n (_b = (_a = roomsToListeners[room]) === null || _a === void 0 ? void 0 : _a.filter((listener) => listener !== handlers)) !== null && _b !== void 0 ? _b : [];\n if (roomsToListeners[room].length === 0) {\n leaveRoom(room);\n }\n };\n };\n return {\n socket,\n subscribeToRoom,\n updateConfig,\n updateModel,\n disconnect,\n };\n}\n", "const windowObj = typeof window !== \"undefined\"\n ? window\n : { base44SharedInstances: {} };\n// Singleton (shared between sdk instances)//\nexport function getSharedInstance(name, factory) {\n if (!windowObj.base44SharedInstances) {\n windowObj.base44SharedInstances = {};\n }\n if (!windowObj.base44SharedInstances[name]) {\n windowObj.base44SharedInstances[name] = {\n instance: factory(),\n };\n }\n return windowObj.base44SharedInstances[name].instance;\n}\n", "import { getSharedInstance } from \"../utils/sharedInstance.js\";\nimport { generateUuid } from \"../utils/common.js\";\nexport const USER_HEARTBEAT_EVENT_NAME = \"__user_heartbeat_event__\";\nexport const ANALYTICS_INITIALIZATION_EVENT_NAME = \"__initialization_event__\";\nexport const ANALYTICS_SESSION_DURATION_EVENT_NAME = \"__session_duration_event__\";\nexport const ANALYTICS_CONFIG_ENABLE_URL_PARAM_KEY = \"analytics-enable\";\nexport const ANALYTICS_SESSION_ID_LOCAL_STORAGE_KEY = \"base44_analytics_session_id\";\nconst defaultConfiguration = {\n // default to enabled //\n enabled: true,\n maxQueueSize: 1000,\n throttleTime: 1000,\n batchSize: 30,\n heartBeatInterval: 60 * 1000,\n};\n///////////////////////////////////////////////\n//// shared queue for analytics events ////\n///////////////////////////////////////////////\nconst ANALYTICS_SHARED_STATE_NAME = \"analytics\";\n// shared state//\nconst analyticsSharedState = getSharedInstance(ANALYTICS_SHARED_STATE_NAME, () => ({\n requestsQueue: [],\n isProcessing: false,\n isHeartBeatProcessing: false,\n wasInitializationTracked: false,\n sessionContext: null,\n sessionStartTime: null,\n config: {\n ...defaultConfiguration,\n ...getAnalyticsConfigFromUrlParams(),\n },\n}));\nexport const createAnalyticsModule = ({ axiosClient, serverUrl, appId, userAuthModule, }) => {\n var _a;\n // prevent overflow of events //\n const { maxQueueSize, throttleTime, batchSize } = analyticsSharedState.config;\n if (!((_a = analyticsSharedState.config) === null || _a === void 0 ? void 0 : _a.enabled)) {\n return {\n track: () => { },\n cleanup: () => { },\n };\n }\n let clearHeartBeatProcessor = undefined;\n const trackBatchUrl = `${serverUrl}/api/apps/${appId}/analytics/track/batch`;\n const batchRequestFallback = async (events) => {\n await axiosClient.request({\n method: \"POST\",\n url: `/apps/${appId}/analytics/track/batch`,\n data: { events },\n });\n };\n // currently disabled, until fully tested //\n const beaconRequest = (events) => {\n try {\n const beaconPayload = JSON.stringify({ events });\n const blob = new Blob([beaconPayload], { type: \"application/json\" });\n return (typeof navigator === \"undefined\" ||\n beaconPayload.length > 60000 ||\n !navigator.sendBeacon(trackBatchUrl, blob));\n }\n catch (_a) {\n return false;\n }\n };\n const flush = async (eventsData, options = {}) => {\n if (eventsData.length === 0)\n return;\n const sessionContext_ = await getSessionContext(userAuthModule);\n const events = eventsData.map(transformEventDataToApiRequestData(sessionContext_));\n try {\n if (!options.isBeacon || !beaconRequest(events)) {\n await batchRequestFallback(events);\n }\n }\n catch (_a) {\n // do nothing\n }\n };\n const startProcessing = () => {\n startAnalyticsProcessor(flush, {\n throttleTime,\n batchSize,\n });\n };\n const track = (params) => {\n if (analyticsSharedState.requestsQueue.length >= maxQueueSize) {\n return;\n }\n const intrinsicData = getEventIntrinsicData();\n analyticsSharedState.requestsQueue.push({\n ...params,\n ...intrinsicData,\n });\n startProcessing();\n };\n const onDocVisible = () => {\n startAnalyticsProcessor(flush, {\n throttleTime,\n batchSize,\n });\n clearHeartBeatProcessor = startHeartBeatProcessor(track);\n setSessionDurationTimerStart();\n };\n const onDocHidden = () => {\n stopAnalyticsProcessor();\n clearHeartBeatProcessor === null || clearHeartBeatProcessor === void 0 ? void 0 : clearHeartBeatProcessor();\n trackSessionDurationEvent(track);\n // flush entire queue on visibility change and hope for the best //\n const eventsData = analyticsSharedState.requestsQueue.splice(0);\n flush(eventsData, { isBeacon: true });\n };\n const onVisibilityChange = () => {\n if (typeof window === \"undefined\")\n return;\n if (document.visibilityState === \"hidden\") {\n onDocHidden();\n }\n else if (document.visibilityState === \"visible\") {\n onDocVisible();\n }\n };\n const cleanup = () => {\n stopAnalyticsProcessor();\n clearHeartBeatProcessor === null || clearHeartBeatProcessor === void 0 ? void 0 : clearHeartBeatProcessor();\n if (typeof window !== \"undefined\") {\n window.removeEventListener(\"visibilitychange\", onVisibilityChange);\n }\n };\n // start the flusing process ///\n startProcessing();\n // start the heart beat processor //\n clearHeartBeatProcessor = startHeartBeatProcessor(track);\n // track the referrer event //\n trackInitializationEvent(track);\n // start the visibility change listener //\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"visibilitychange\", onVisibilityChange);\n }\n return {\n track,\n cleanup,\n };\n};\nfunction stopAnalyticsProcessor() {\n analyticsSharedState.isProcessing = false;\n}\nasync function startAnalyticsProcessor(handleTrack, options) {\n if (analyticsSharedState.isProcessing) {\n // only one instance of the analytics processor can be running at a time //\n return;\n }\n analyticsSharedState.isProcessing = true;\n const { throttleTime = 1000, batchSize = 30 } = options !== null && options !== void 0 ? options : {};\n while (analyticsSharedState.isProcessing &&\n analyticsSharedState.requestsQueue.length > 0) {\n const requests = analyticsSharedState.requestsQueue.splice(0, batchSize);\n requests.length && (await handleTrack(requests));\n await new Promise((resolve) => setTimeout(resolve, throttleTime));\n }\n analyticsSharedState.isProcessing = false;\n}\nfunction startHeartBeatProcessor(track) {\n var _a;\n if (analyticsSharedState.isHeartBeatProcessing ||\n ((_a = analyticsSharedState.config.heartBeatInterval) !== null && _a !== void 0 ? _a : 0) < 10) {\n return () => { };\n }\n analyticsSharedState.isHeartBeatProcessing = true;\n const interval = setInterval(() => {\n track({ eventName: USER_HEARTBEAT_EVENT_NAME });\n }, analyticsSharedState.config.heartBeatInterval);\n return () => {\n clearInterval(interval);\n analyticsSharedState.isHeartBeatProcessing = false;\n };\n}\nfunction trackInitializationEvent(track) {\n if (typeof window === \"undefined\" ||\n analyticsSharedState.wasInitializationTracked) {\n return;\n }\n analyticsSharedState.wasInitializationTracked = true;\n track({\n eventName: ANALYTICS_INITIALIZATION_EVENT_NAME,\n properties: {\n referrer: document === null || document === void 0 ? void 0 : document.referrer,\n },\n });\n}\nfunction setSessionDurationTimerStart() {\n if (typeof window === \"undefined\" ||\n analyticsSharedState.sessionStartTime !== null) {\n return;\n }\n analyticsSharedState.sessionStartTime = new Date().toISOString();\n}\nfunction trackSessionDurationEvent(track) {\n if (typeof window === \"undefined\" ||\n analyticsSharedState.sessionStartTime === null)\n return;\n const sessionDuration = new Date().getTime() -\n new Date(analyticsSharedState.sessionStartTime).getTime();\n analyticsSharedState.sessionStartTime = null;\n track({\n eventName: ANALYTICS_SESSION_DURATION_EVENT_NAME,\n properties: { sessionDuration },\n });\n}\nfunction getEventIntrinsicData() {\n return {\n timestamp: new Date().toISOString(),\n pageUrl: typeof window !== \"undefined\" ? window.location.pathname : null,\n };\n}\nfunction transformEventDataToApiRequestData(sessionContext) {\n return (eventData) => ({\n event_name: eventData.eventName,\n properties: eventData.properties,\n timestamp: eventData.timestamp,\n page_url: eventData.pageUrl,\n ...sessionContext,\n });\n}\nlet sessionContextPromise = null;\nasync function getSessionContext(userAuthModule) {\n if (!analyticsSharedState.sessionContext) {\n if (!sessionContextPromise) {\n const sessionId = getAnalyticsSessionId();\n sessionContextPromise = userAuthModule\n .me()\n .then((user) => ({\n user_id: user.id,\n session_id: sessionId,\n }))\n .catch(() => ({\n user_id: null,\n session_id: sessionId,\n }));\n }\n analyticsSharedState.sessionContext = await sessionContextPromise;\n }\n return analyticsSharedState.sessionContext;\n}\nexport function getAnalyticsConfigFromUrlParams() {\n if (typeof window === \"undefined\")\n return undefined;\n const urlParams = new URLSearchParams(window.location.search);\n const analyticsEnable = urlParams.get(ANALYTICS_CONFIG_ENABLE_URL_PARAM_KEY);\n // if the url param is not set, return undefined //\n if (analyticsEnable == null || !analyticsEnable.length)\n return undefined;\n // remove the url param from the url //\n const newUrlParams = new URLSearchParams(window.location.search);\n newUrlParams.delete(ANALYTICS_CONFIG_ENABLE_URL_PARAM_KEY);\n const newUrl = window.location.pathname +\n (newUrlParams.toString() ? \"?\" + newUrlParams.toString() : \"\");\n window.history.replaceState({}, \"\", newUrl);\n // return the config object //\n return { enabled: analyticsEnable === \"true\" };\n}\nexport function getAnalyticsSessionId() {\n if (typeof window === \"undefined\") {\n return generateUuid();\n }\n try {\n const sessionId = localStorage.getItem(ANALYTICS_SESSION_ID_LOCAL_STORAGE_KEY);\n if (!sessionId) {\n const newSessionId = generateUuid();\n localStorage.setItem(ANALYTICS_SESSION_ID_LOCAL_STORAGE_KEY, newSessionId);\n return newSessionId;\n }\n return sessionId;\n }\n catch (_a) {\n return generateUuid();\n }\n}\n", "import { createAxiosClient } from \"./utils/axios-client.js\";\nimport { createEntitiesModule } from \"./modules/entities.js\";\nimport { createIntegrationsModule } from \"./modules/integrations.js\";\nimport { createAuthModule } from \"./modules/auth.js\";\nimport { createSsoModule } from \"./modules/sso.js\";\nimport { createConnectorsModule } from \"./modules/connectors.js\";\nimport { getAccessToken } from \"./utils/auth-utils.js\";\nimport { createFunctionsModule } from \"./modules/functions.js\";\nimport { createAgentsModule } from \"./modules/agents.js\";\nimport { createAppLogsModule } from \"./modules/app-logs.js\";\nimport { createUsersModule } from \"./modules/users.js\";\nimport { RoomsSocket } from \"./utils/socket-utils.js\";\nimport { createAnalyticsModule } from \"./modules/analytics.js\";\n/**\n * Creates a Base44 client.\n *\n * This is the main entry point for the Base44 SDK. It creates a client that provides access to the SDK's modules, such as {@linkcode EntitiesModule | entities}, {@linkcode AuthModule | auth}, and {@linkcode FunctionsModule | functions}.\n *\n * How you get a client depends on your context:\n * - **Inside a Base44 app:** The client is automatically created and configured for you. Import it from `@/api/base44Client`.\n * - **External app using Base44 as a backend:** Call `createClient()` directly in your code to create and configure the client.\n *\n * The client supports three authentication modes:\n * - **Anonymous**: Access modules without authentication using `base44.moduleName`. Operations are scoped to public data and permissions.\n * - **User authentication**: Access modules with user-level permissions using `base44.moduleName`. Operations are scoped to the authenticated user's data and permissions. Use `base44.auth.loginViaEmailPassword()` or other auth methods to get a token.\n * - **Service role authentication**: Access modules with elevated permissions using `base44.asServiceRole.moduleName`. Operations can access any data available to the app's admin. Only available in Base44-hosted backend functions. Create a client with service role authentication using {@linkcode createClientFromRequest | createClientFromRequest()}.\n *\n * For example, when using the {@linkcode EntitiesModule | entities} module:\n * - **Anonymous**: Can only read public data.\n * - **User authentication**: Can access the current user's data.\n * - **Service role authentication**: Can access all data that admins can access.\n *\n * Most modules are available in all three modes, but with different permission levels. However, some modules are only available in specific authentication modes.\n *\n * @param config - Configuration object for the client.\n * @returns A configured Base44 client instance with access to all SDK modules.\n *\n * @example\n * ```typescript\n * // Create a client for your app\n * import { createClient } from '@base44/sdk';\n *\n * const base44 = createClient({\n * appId: 'my-app-id'\n * });\n *\n * // Use the client to access your data\n * const products = await base44.entities.Products.list();\n * ```\n */\nexport function createClient(config) {\n const { serverUrl = \"https://base44.app\", appId, token, serviceToken, requiresAuth = false, appBaseUrl, options, functionsVersion, headers: optionalHeaders, } = config;\n // Normalize appBaseUrl to always be a string (empty if not provided or invalid)\n const normalizedAppBaseUrl = typeof appBaseUrl === \"string\" ? appBaseUrl : \"\";\n const socketConfig = {\n serverUrl,\n mountPath: \"/ws-user-apps/socket.io/\",\n transports: [\"websocket\"],\n appId,\n token,\n };\n let socket = null;\n const getSocket = () => {\n if (!socket) {\n socket = RoomsSocket({\n config: socketConfig,\n });\n }\n return socket;\n };\n const headers = {\n ...optionalHeaders,\n \"X-App-Id\": String(appId),\n };\n const functionHeaders = functionsVersion\n ? {\n ...headers,\n \"Base44-Functions-Version\": functionsVersion,\n }\n : headers;\n const axiosClient = createAxiosClient({\n baseURL: `${serverUrl}/api`,\n headers,\n token,\n onError: options === null || options === void 0 ? void 0 : options.onError,\n });\n const functionsAxiosClient = createAxiosClient({\n baseURL: `${serverUrl}/api`,\n headers: functionHeaders,\n token,\n interceptResponses: false,\n onError: options === null || options === void 0 ? void 0 : options.onError,\n });\n const serviceRoleAxiosClient = createAxiosClient({\n baseURL: `${serverUrl}/api`,\n headers,\n token: serviceToken,\n onError: options === null || options === void 0 ? void 0 : options.onError,\n });\n const serviceRoleFunctionsAxiosClient = createAxiosClient({\n baseURL: `${serverUrl}/api`,\n headers: functionHeaders,\n token: serviceToken,\n interceptResponses: false,\n });\n const userAuthModule = createAuthModule(axiosClient, functionsAxiosClient, appId, {\n appBaseUrl: normalizedAppBaseUrl,\n serverUrl,\n });\n const userModules = {\n entities: createEntitiesModule({\n axios: axiosClient,\n appId,\n getSocket,\n }),\n integrations: createIntegrationsModule(axiosClient, appId),\n auth: userAuthModule,\n functions: createFunctionsModule(functionsAxiosClient, appId),\n agents: createAgentsModule({\n axios: axiosClient,\n getSocket,\n appId,\n serverUrl,\n token,\n }),\n appLogs: createAppLogsModule(axiosClient, appId),\n users: createUsersModule(axiosClient, appId),\n analytics: createAnalyticsModule({\n axiosClient,\n serverUrl,\n appId,\n userAuthModule,\n }),\n cleanup: () => {\n userModules.analytics.cleanup();\n if (socket) {\n socket.disconnect();\n }\n },\n };\n const serviceRoleModules = {\n entities: createEntitiesModule({\n axios: serviceRoleAxiosClient,\n appId,\n getSocket,\n }),\n integrations: createIntegrationsModule(serviceRoleAxiosClient, appId),\n sso: createSsoModule(serviceRoleAxiosClient, appId, token),\n connectors: createConnectorsModule(serviceRoleAxiosClient, appId),\n functions: createFunctionsModule(serviceRoleFunctionsAxiosClient, appId),\n agents: createAgentsModule({\n axios: serviceRoleAxiosClient,\n getSocket,\n appId,\n serverUrl,\n token,\n }),\n appLogs: createAppLogsModule(serviceRoleAxiosClient, appId),\n cleanup: () => {\n if (socket) {\n socket.disconnect();\n }\n },\n };\n // Always try to get token from localStorage or URL parameters\n if (typeof window !== \"undefined\") {\n // Get token from URL or localStorage\n const accessToken = token || getAccessToken();\n if (accessToken) {\n userModules.auth.setToken(accessToken);\n }\n }\n // If authentication is required, verify token and redirect to login if needed\n if (requiresAuth && typeof window !== \"undefined\") {\n // We perform this check asynchronously to not block client creation\n setTimeout(async () => {\n try {\n const isAuthenticated = await userModules.auth.isAuthenticated();\n if (!isAuthenticated) {\n userModules.auth.redirectToLogin(window.location.href);\n }\n }\n catch (error) {\n console.error(\"Authentication check failed:\", error);\n userModules.auth.redirectToLogin(window.location.href);\n }\n }, 0);\n }\n // Assemble and return the client\n const client = {\n ...userModules,\n /**\n * Sets a new authentication token for all subsequent requests.\n *\n * @param newToken - The new authentication token\n *\n * @example\n * ```typescript\n * // Update token after login\n * const { access_token } = await base44.auth.loginViaEmailPassword(\n * 'user@example.com',\n * 'password'\n * );\n * base44.setToken(access_token);\n * ```\n */\n setToken(newToken) {\n userModules.auth.setToken(newToken);\n if (socket) {\n socket.updateConfig({\n token: newToken,\n });\n }\n socketConfig.token = newToken;\n },\n /**\n * Gets the current client configuration.\n *\n * @internal\n */\n getConfig() {\n return {\n serverUrl,\n appId,\n requiresAuth,\n };\n },\n /**\n * Provides access to service role modules.\n *\n * Service role authentication provides elevated permissions for backend operations. Unlike user authentication, which is scoped to a specific user's permissions, service role authentication has access to the data and operations available to the app's admin.\n *\n * @throws {Error} When accessed without providing a serviceToken during client creation.\n *\n * @example\n * ```typescript\n * const base44 = createClient({\n * appId: 'my-app-id',\n * serviceToken: 'service-role-token'\n * });\n *\n * // Also access a module with elevated permissions\n * const allUsers = await base44.asServiceRole.entities.User.list();\n * ```\n */\n get asServiceRole() {\n if (!serviceToken) {\n throw new Error(\"Service token is required to use asServiceRole. Please provide a serviceToken when creating the client.\");\n }\n return serviceRoleModules;\n },\n };\n return client;\n}\n/**\n * Creates a Base44 client from an HTTP request.\n *\n * This function is designed for use in Base44-hosted backend functions. For frontends and external backends, use {@linkcode createClient | createClient()} instead.\n *\n * When used in a Base44-hosted backend function, `createClientFromRequest()` automatically extracts authentication tokens from the request headers that Base44 injects when forwarding requests. The returned client includes service role access using `base44.asServiceRole`, which provides admin-level permissions.\n *\n * To learn more about the Base44 client, see {@linkcode createClient | createClient()}.\n *\n * @param request - The incoming HTTP request object containing Base44 authentication headers.\n * @returns A configured Base44 client instance with authentication from the incoming request.\n *\n * @example\n * ```typescript\n * // User authentication in backend function\n * import { createClientFromRequest } from 'npm:@base44/sdk';\n *\n * Deno.serve(async (req) => {\n * try {\n * const base44 = createClientFromRequest(req);\n * const user = await base44.auth.me();\n *\n * if (!user) {\n * return Response.json({ error: 'Unauthorized' }, { status: 401 });\n * }\n *\n * // Access user's data\n * const userOrders = await base44.entities.Orders.filter({ userId: user.id });\n * return Response.json({ orders: userOrders });\n * } catch (error) {\n * return Response.json({ error: error.message }, { status: 500 });\n * }\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Service role authentication in backend function\n * import { createClientFromRequest } from 'npm:@base44/sdk';\n *\n * Deno.serve(async (req) => {\n * try {\n * const base44 = createClientFromRequest(req);\n *\n * // Access admin data with service role permissions\n * const recentOrders = await base44.asServiceRole.entities.Orders.list('-created_at', 50);\n *\n * return Response.json({ orders: recentOrders });\n * } catch (error) {\n * return Response.json({ error: error.message }, { status: 500 });\n * }\n * });\n * ```\n *\n */\nexport function createClientFromRequest(request) {\n const authHeader = request.headers.get(\"Authorization\");\n const serviceRoleAuthHeader = request.headers.get(\"Base44-Service-Authorization\");\n const appId = request.headers.get(\"Base44-App-Id\");\n const serverUrlHeader = request.headers.get(\"Base44-Api-Url\");\n const functionsVersion = request.headers.get(\"Base44-Functions-Version\");\n const stateHeader = request.headers.get(\"Base44-State\");\n if (!appId) {\n throw new Error(\"Base44-App-Id header is required, but is was not found on the request\");\n }\n // Validate authorization header formats\n let serviceRoleToken;\n let userToken;\n if (serviceRoleAuthHeader !== null) {\n if (serviceRoleAuthHeader === \"\" ||\n !serviceRoleAuthHeader.startsWith(\"Bearer \") ||\n serviceRoleAuthHeader.split(\" \").length !== 2) {\n throw new Error('Invalid authorization header format. Expected \"Bearer \"');\n }\n serviceRoleToken = serviceRoleAuthHeader.split(\" \")[1];\n }\n if (authHeader !== null) {\n if (authHeader === \"\" ||\n !authHeader.startsWith(\"Bearer \") ||\n authHeader.split(\" \").length !== 2) {\n throw new Error('Invalid authorization header format. Expected \"Bearer \"');\n }\n userToken = authHeader.split(\" \")[1];\n }\n // Prepare additional headers to propagate\n const additionalHeaders = {};\n if (stateHeader) {\n additionalHeaders[\"Base44-State\"] = stateHeader;\n }\n return createClient({\n serverUrl: serverUrlHeader || \"https://base44.app\",\n appId,\n token: userToken,\n serviceToken: serviceRoleToken,\n functionsVersion: functionsVersion !== null && functionsVersion !== void 0 ? functionsVersion : undefined,\n headers: additionalHeaders,\n });\n}\n"], - "mappings": ";;;;;;;;;;;;AAAA;AAAA;AAIA,QAAI,IAAI;AACR,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AAgBZ,WAAO,UAAU,SAAU,KAAK,SAAS;AACvC,gBAAU,WAAW,CAAC;AACtB,UAAI,OAAO,OAAO;AAClB,UAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,eAAOA,OAAM,GAAG;AAAA,MAClB,WAAW,SAAS,YAAY,SAAS,GAAG,GAAG;AAC7C,eAAO,QAAQ,OAAO,QAAQ,GAAG,IAAI,SAAS,GAAG;AAAA,MACnD;AACA,YAAM,IAAI;AAAA,QACR,0DACE,KAAK,UAAU,GAAG;AAAA,MACtB;AAAA,IACF;AAUA,aAASA,OAAM,KAAK;AAClB,YAAM,OAAO,GAAG;AAChB,UAAI,IAAI,SAAS,KAAK;AACpB;AAAA,MACF;AACA,UAAI,QAAQ,mIAAmI;AAAA,QAC7I;AAAA,MACF;AACA,UAAI,CAAC,OAAO;AACV;AAAA,MACF;AACA,UAAI,IAAI,WAAW,MAAM,CAAC,CAAC;AAC3B,UAAI,QAAQ,MAAM,CAAC,KAAK,MAAM,YAAY;AAC1C,cAAQ,MAAM;AAAA,QACZ,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,IAAI;AAAA,QACb,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,IAAI;AAAA,QACb,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,IAAI;AAAA,QACb,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,IAA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ACA,uBAAmB,sBAAsB,MAAM,GAAG,EAAE,CAAC;AAAA,EACzD;AACA,MAAI,eAAe,MAAM;AACrB,QAAI,eAAe,MACf,CAAC,WAAW,WAAW,SAAS,KAChC,WAAW,MAAM,GAAG,EAAE,WAAW,GAAG;AACpC,YAAM,IAAI,MAAM,gEAAgE;AAAA,IACpF;AACA,gBAAY,WAAW,MAAM,GAAG,EAAE,CAAC;AAAA,EACvC;AAEA,QAAM,oBAAoB,CAAC;AAC3B,MAAI,aAAa;AACb,sBAAkB,cAAc,IAAI;AAAA,EACxC;AACA,SAAO,aAAa;AAAA,IAChB,WAAW,mBAAmB;AAAA,IAC9B;AAAA,IACA,OAAO;AAAA,IACP,cAAc;AAAA,IACd,kBAAkB,qBAAqB,QAAQ,qBAAqB,SAAS,mBAAmB;AAAA,IAChG,SAAS;AAAA,EACb,CAAC;AACL;", - "names": ["parse", "debug", "self", "target", "value", "url", "value", "withNativeArrayBuffer", "isBinary", "on", "decode", "_a", "value", "decode", "protocol", "protocol", "withNativeArrayBuffer", "isView", "withNativeBlob", "debugModule", "protocol", "PacketType", "value", "RESERVED_EVENTS", "Socket", "self", "self", "Socket", "socket", "lookup", "Socket", "lookup", "_a", "config", "handlers", "_a"] -} diff --git a/node_modules/.vite/deps/@base44_sdk_dist_utils_axios-client.js b/node_modules/.vite/deps/@base44_sdk_dist_utils_axios-client.js deleted file mode 100644 index af90b82a..00000000 --- a/node_modules/.vite/deps/@base44_sdk_dist_utils_axios-client.js +++ /dev/null @@ -1,9 +0,0 @@ -import { - Base44Error, - createAxiosClient -} from "./chunk-CJARZ5TB.js"; -import "./chunk-WOOG5QLI.js"; -export { - Base44Error, - createAxiosClient -}; diff --git a/node_modules/.vite/deps/@base44_sdk_dist_utils_axios-client.js.map b/node_modules/.vite/deps/@base44_sdk_dist_utils_axios-client.js.map deleted file mode 100644 index 98652118..00000000 --- a/node_modules/.vite/deps/@base44_sdk_dist_utils_axios-client.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": [], - "sourcesContent": [], - "mappings": "", - "names": [] -} diff --git a/node_modules/.vite/deps/@radix-ui_react-dialog.js b/node_modules/.vite/deps/@radix-ui_react-dialog.js index 079cf7f9..5ee29fd1 100644 --- a/node_modules/.vite/deps/@radix-ui_react-dialog.js +++ b/node_modules/.vite/deps/@radix-ui_react-dialog.js @@ -1,4 +1,7 @@ "use client"; +import { + Presence +} from "./chunk-KOYIXRFM.js"; import { Combination_default, DismissableLayer, @@ -6,34 +9,31 @@ import { Portal, hideOthers, useFocusGuards -} from "./chunk-WIKMTAHT.js"; -import { - Presence -} from "./chunk-H4FEHRTE.js"; +} from "./chunk-RQF3JA7X.js"; import { useId -} from "./chunk-DR23R4HS.js"; +} from "./chunk-2KKOOEFD.js"; import { Primitive, composeEventHandlers, createContext2, createContextScope, useControllableState -} from "./chunk-CD6XDNKE.js"; +} from "./chunk-A5QUBX2G.js"; import { composeRefs, useComposedRefs -} from "./chunk-JDYSANEB.js"; -import "./chunk-SXRIVT2P.js"; +} from "./chunk-HKFJJYQE.js"; +import "./chunk-F34GCA6J.js"; import { require_jsx_runtime -} from "./chunk-KBTYAULA.js"; +} from "./chunk-CRNJR6QK.js"; import { require_react -} from "./chunk-QCHXOAYK.js"; +} from "./chunk-ZMLY2J2T.js"; import { __toESM -} from "./chunk-WOOG5QLI.js"; +} from "./chunk-4B2QHNJT.js"; // node_modules/@radix-ui/react-dialog/dist/index.mjs var React2 = __toESM(require_react(), 1); diff --git a/node_modules/.vite/deps/@radix-ui_react-label.js b/node_modules/.vite/deps/@radix-ui_react-label.js index 66e41da2..b3804fce 100644 --- a/node_modules/.vite/deps/@radix-ui_react-label.js +++ b/node_modules/.vite/deps/@radix-ui_react-label.js @@ -1,20 +1,20 @@ "use client"; import { createSlot -} from "./chunk-GTF7DNNX.js"; -import "./chunk-JDYSANEB.js"; +} from "./chunk-REWER3PG.js"; +import "./chunk-HKFJJYQE.js"; import { require_react_dom -} from "./chunk-SXRIVT2P.js"; +} from "./chunk-F34GCA6J.js"; import { require_jsx_runtime -} from "./chunk-KBTYAULA.js"; +} from "./chunk-CRNJR6QK.js"; import { require_react -} from "./chunk-QCHXOAYK.js"; +} from "./chunk-ZMLY2J2T.js"; import { __toESM -} from "./chunk-WOOG5QLI.js"; +} from "./chunk-4B2QHNJT.js"; // node_modules/@radix-ui/react-label/dist/index.mjs var React2 = __toESM(require_react(), 1); diff --git a/node_modules/.vite/deps/@radix-ui_react-progress.js b/node_modules/.vite/deps/@radix-ui_react-progress.js index 71278197..0401d881 100644 --- a/node_modules/.vite/deps/@radix-ui_react-progress.js +++ b/node_modules/.vite/deps/@radix-ui_react-progress.js @@ -1,20 +1,20 @@ "use client"; import { createSlot -} from "./chunk-GTF7DNNX.js"; -import "./chunk-JDYSANEB.js"; +} from "./chunk-REWER3PG.js"; +import "./chunk-HKFJJYQE.js"; import { require_react_dom -} from "./chunk-SXRIVT2P.js"; +} from "./chunk-F34GCA6J.js"; import { require_jsx_runtime -} from "./chunk-KBTYAULA.js"; +} from "./chunk-CRNJR6QK.js"; import { require_react -} from "./chunk-QCHXOAYK.js"; +} from "./chunk-ZMLY2J2T.js"; import { __toESM -} from "./chunk-WOOG5QLI.js"; +} from "./chunk-4B2QHNJT.js"; // node_modules/@radix-ui/react-progress/dist/index.mjs var React3 = __toESM(require_react(), 1); diff --git a/node_modules/.vite/deps/@radix-ui_react-select.js b/node_modules/.vite/deps/@radix-ui_react-select.js index d73e04bf..93cc7d4f 100644 --- a/node_modules/.vite/deps/@radix-ui_react-select.js +++ b/node_modules/.vite/deps/@radix-ui_react-select.js @@ -1,4 +1,12 @@ "use client"; +import { + createCollection, + useDirection +} from "./chunk-AVIXPLZ3.js"; +import { + usePrevious, + useSize +} from "./chunk-U6B3GYRO.js"; import { Combination_default, DismissableLayer, @@ -6,42 +14,34 @@ import { Portal, hideOthers, useFocusGuards -} from "./chunk-WIKMTAHT.js"; -import { - usePrevious, - useSize -} from "./chunk-BSEPHKUN.js"; -import { - createCollection, - useDirection -} from "./chunk-AW4DWX7J.js"; +} from "./chunk-RQF3JA7X.js"; import { useCallbackRef, useId -} from "./chunk-DR23R4HS.js"; +} from "./chunk-2KKOOEFD.js"; import { Primitive, composeEventHandlers, createContextScope, useControllableState, useLayoutEffect2 -} from "./chunk-CD6XDNKE.js"; +} from "./chunk-A5QUBX2G.js"; import { composeRefs, useComposedRefs -} from "./chunk-JDYSANEB.js"; +} from "./chunk-HKFJJYQE.js"; import { require_react_dom -} from "./chunk-SXRIVT2P.js"; +} from "./chunk-F34GCA6J.js"; import { require_jsx_runtime -} from "./chunk-KBTYAULA.js"; +} from "./chunk-CRNJR6QK.js"; import { require_react -} from "./chunk-QCHXOAYK.js"; +} from "./chunk-ZMLY2J2T.js"; import { __toESM -} from "./chunk-WOOG5QLI.js"; +} from "./chunk-4B2QHNJT.js"; // node_modules/@radix-ui/react-select/dist/index.mjs var React6 = __toESM(require_react(), 1); diff --git a/node_modules/.vite/deps/@radix-ui_react-slot.js b/node_modules/.vite/deps/@radix-ui_react-slot.js index 75529a23..f8363420 100644 --- a/node_modules/.vite/deps/@radix-ui_react-slot.js +++ b/node_modules/.vite/deps/@radix-ui_react-slot.js @@ -3,11 +3,11 @@ import { Slottable, createSlot, createSlottable -} from "./chunk-GTF7DNNX.js"; -import "./chunk-JDYSANEB.js"; -import "./chunk-KBTYAULA.js"; -import "./chunk-QCHXOAYK.js"; -import "./chunk-WOOG5QLI.js"; +} from "./chunk-REWER3PG.js"; +import "./chunk-HKFJJYQE.js"; +import "./chunk-CRNJR6QK.js"; +import "./chunk-ZMLY2J2T.js"; +import "./chunk-4B2QHNJT.js"; export { Slot as Root, Slot, diff --git a/node_modules/.vite/deps/@radix-ui_react-switch.js b/node_modules/.vite/deps/@radix-ui_react-switch.js index de294354..afa92a0b 100644 --- a/node_modules/.vite/deps/@radix-ui_react-switch.js +++ b/node_modules/.vite/deps/@radix-ui_react-switch.js @@ -2,26 +2,26 @@ import { usePrevious, useSize -} from "./chunk-BSEPHKUN.js"; +} from "./chunk-U6B3GYRO.js"; import { Primitive, composeEventHandlers, createContextScope, useControllableState -} from "./chunk-CD6XDNKE.js"; +} from "./chunk-A5QUBX2G.js"; import { useComposedRefs -} from "./chunk-JDYSANEB.js"; -import "./chunk-SXRIVT2P.js"; +} from "./chunk-HKFJJYQE.js"; +import "./chunk-F34GCA6J.js"; import { require_jsx_runtime -} from "./chunk-KBTYAULA.js"; +} from "./chunk-CRNJR6QK.js"; import { require_react -} from "./chunk-QCHXOAYK.js"; +} from "./chunk-ZMLY2J2T.js"; import { __toESM -} from "./chunk-WOOG5QLI.js"; +} from "./chunk-4B2QHNJT.js"; // node_modules/@radix-ui/react-switch/dist/index.mjs var React = __toESM(require_react(), 1); diff --git a/node_modules/.vite/deps/@radix-ui_react-tabs.js b/node_modules/.vite/deps/@radix-ui_react-tabs.js index bae88fd2..6e9d1822 100644 --- a/node_modules/.vite/deps/@radix-ui_react-tabs.js +++ b/node_modules/.vite/deps/@radix-ui_react-tabs.js @@ -1,34 +1,34 @@ "use client"; -import { - Presence -} from "./chunk-H4FEHRTE.js"; import { createCollection, useDirection -} from "./chunk-AW4DWX7J.js"; +} from "./chunk-AVIXPLZ3.js"; +import { + Presence +} from "./chunk-KOYIXRFM.js"; import { useCallbackRef, useId -} from "./chunk-DR23R4HS.js"; +} from "./chunk-2KKOOEFD.js"; import { Primitive, composeEventHandlers, createContextScope, useControllableState -} from "./chunk-CD6XDNKE.js"; +} from "./chunk-A5QUBX2G.js"; import { useComposedRefs -} from "./chunk-JDYSANEB.js"; -import "./chunk-SXRIVT2P.js"; +} from "./chunk-HKFJJYQE.js"; +import "./chunk-F34GCA6J.js"; import { require_jsx_runtime -} from "./chunk-KBTYAULA.js"; +} from "./chunk-CRNJR6QK.js"; import { require_react -} from "./chunk-QCHXOAYK.js"; +} from "./chunk-ZMLY2J2T.js"; import { __toESM -} from "./chunk-WOOG5QLI.js"; +} from "./chunk-4B2QHNJT.js"; // node_modules/@radix-ui/react-tabs/dist/index.mjs var React2 = __toESM(require_react(), 1); diff --git a/node_modules/.vite/deps/@tanstack_react-query.js b/node_modules/.vite/deps/@tanstack_react-query.js index 0109b54b..a2387dd5 100644 --- a/node_modules/.vite/deps/@tanstack_react-query.js +++ b/node_modules/.vite/deps/@tanstack_react-query.js @@ -1,9 +1,9 @@ import { require_jsx_runtime -} from "./chunk-KBTYAULA.js"; +} from "./chunk-CRNJR6QK.js"; import { require_react -} from "./chunk-QCHXOAYK.js"; +} from "./chunk-ZMLY2J2T.js"; import { __privateAdd, __privateGet, @@ -11,7 +11,7 @@ import { __privateSet, __privateWrapper, __toESM -} from "./chunk-WOOG5QLI.js"; +} from "./chunk-4B2QHNJT.js"; // node_modules/@tanstack/query-core/build/modern/subscribable.js var Subscribable = class { diff --git a/node_modules/.vite/deps/_metadata.json b/node_modules/.vite/deps/_metadata.json index 08952b8a..e6941242 100644 --- a/node_modules/.vite/deps/_metadata.json +++ b/node_modules/.vite/deps/_metadata.json @@ -1,238 +1,238 @@ { - "hash": "1f9be60d", - "configHash": "31506afd", - "lockfileHash": "027a3aef", - "browserHash": "09026e62", + "hash": "37fba1a2", + "configHash": "1f68771d", + "lockfileHash": "6873f7e2", + "browserHash": "ecf97f45", "optimized": { "react": { "src": "../../react/index.js", "file": "react.js", - "fileHash": "fb8f4549", + "fileHash": "6636532f", "needsInterop": true }, "react-dom": { "src": "../../react-dom/index.js", "file": "react-dom.js", - "fileHash": "d8889d21", + "fileHash": "81deb4ad", "needsInterop": true }, "react/jsx-dev-runtime": { "src": "../../react/jsx-dev-runtime.js", "file": "react_jsx-dev-runtime.js", - "fileHash": "be308676", + "fileHash": "308b14ed", "needsInterop": true }, "react/jsx-runtime": { "src": "../../react/jsx-runtime.js", "file": "react_jsx-runtime.js", - "fileHash": "1b437650", + "fileHash": "27ce6531", "needsInterop": true }, - "react-dom/client": { - "src": "../../react-dom/client.js", - "file": "react-dom_client.js", - "fileHash": "0b32c5fb", - "needsInterop": true - }, - "@tanstack/react-query": { - "src": "../../@tanstack/react-query/build/modern/index.js", - "file": "@tanstack_react-query.js", - "fileHash": "c3cae4c6", + "@emotion/is-prop-valid": { + "src": "../../@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js", + "file": "@emotion_is-prop-valid.js", + "fileHash": "0121a62b", "needsInterop": false }, - "react-router-dom": { - "src": "../../react-router-dom/dist/index.js", - "file": "react-router-dom.js", - "fileHash": "1d0dc616", - "needsInterop": false - }, - "lucide-react": { - "src": "../../lucide-react/dist/esm/lucide-react.js", - "file": "lucide-react.js", - "fileHash": "20d46397", - "needsInterop": false - }, - "framer-motion": { - "src": "../../framer-motion/dist/es/index.mjs", - "file": "framer-motion.js", - "fileHash": "f806cb8e", - "needsInterop": false - }, - "sonner": { - "src": "../../sonner/dist/index.mjs", - "file": "sonner.js", - "fileHash": "72f81728", - "needsInterop": false - }, - "date-fns/locale": { - "src": "../../date-fns/locale.mjs", - "file": "date-fns_locale.js", - "fileHash": "961f2940", - "needsInterop": false - }, - "date-fns": { - "src": "../../date-fns/index.mjs", - "file": "date-fns.js", - "fileHash": "b86dabaa", - "needsInterop": false - }, - "recharts": { - "src": "../../recharts/es6/index.js", - "file": "recharts.js", - "fileHash": "b0bd2148", - "needsInterop": false - }, - "@base44/sdk/dist/utils/axios-client": { - "src": "../../@base44/sdk/dist/utils/axios-client.js", - "file": "@base44_sdk_dist_utils_axios-client.js", - "fileHash": "b85066c3", - "needsInterop": false - }, - "@base44/sdk": { - "src": "../../@base44/sdk/dist/index.js", - "file": "@base44_sdk.js", - "fileHash": "81b96f45", - "needsInterop": false - }, - "sql.js": { - "src": "../../sql.js/dist/sql-wasm-browser.js", - "file": "sql__js.js", - "fileHash": "22971ff8", - "needsInterop": true - }, - "clsx": { - "src": "../../clsx/dist/clsx.mjs", - "file": "clsx.js", - "fileHash": "fd82d21e", - "needsInterop": false - }, - "tailwind-merge": { - "src": "../../tailwind-merge/dist/bundle-mjs.mjs", - "file": "tailwind-merge.js", - "fileHash": "50e69157", - "needsInterop": false - }, - "@radix-ui/react-slot": { - "src": "../../@radix-ui/react-slot/dist/index.mjs", - "file": "@radix-ui_react-slot.js", - "fileHash": "d93f2953", - "needsInterop": false - }, - "class-variance-authority": { - "src": "../../class-variance-authority/dist/index.mjs", - "file": "class-variance-authority.js", - "fileHash": "a4a77514", - "needsInterop": false - }, - "@radix-ui/react-select": { - "src": "../../@radix-ui/react-select/dist/index.mjs", - "file": "@radix-ui_react-select.js", - "fileHash": "657bcaa3", - "needsInterop": false - }, - "@radix-ui/react-tabs": { - "src": "../../@radix-ui/react-tabs/dist/index.mjs", - "file": "@radix-ui_react-tabs.js", - "fileHash": "ee9985b3", + "@radix-ui/react-dialog": { + "src": "../../@radix-ui/react-dialog/dist/index.mjs", + "file": "@radix-ui_react-dialog.js", + "fileHash": "a373afb0", "needsInterop": false }, "@radix-ui/react-label": { "src": "../../@radix-ui/react-label/dist/index.mjs", "file": "@radix-ui_react-label.js", - "fileHash": "88e18468", - "needsInterop": false - }, - "react-leaflet": { - "src": "../../react-leaflet/lib/index.js", - "file": "react-leaflet.js", - "fileHash": "f925c49b", - "needsInterop": false - }, - "leaflet": { - "src": "../../leaflet/dist/leaflet-src.js", - "file": "leaflet.js", - "fileHash": "e294f8c6", - "needsInterop": true - }, - "@radix-ui/react-dialog": { - "src": "../../@radix-ui/react-dialog/dist/index.mjs", - "file": "@radix-ui_react-dialog.js", - "fileHash": "00e3c21e", - "needsInterop": false - }, - "@radix-ui/react-switch": { - "src": "../../@radix-ui/react-switch/dist/index.mjs", - "file": "@radix-ui_react-switch.js", - "fileHash": "7d2e4b39", + "fileHash": "ce1da46c", "needsInterop": false }, "@radix-ui/react-progress": { "src": "../../@radix-ui/react-progress/dist/index.mjs", "file": "@radix-ui_react-progress.js", - "fileHash": "d818f0a0", + "fileHash": "d2e42509", + "needsInterop": false + }, + "@radix-ui/react-select": { + "src": "../../@radix-ui/react-select/dist/index.mjs", + "file": "@radix-ui_react-select.js", + "fileHash": "e238916e", + "needsInterop": false + }, + "@radix-ui/react-slot": { + "src": "../../@radix-ui/react-slot/dist/index.mjs", + "file": "@radix-ui_react-slot.js", + "fileHash": "d06a12a7", + "needsInterop": false + }, + "@radix-ui/react-switch": { + "src": "../../@radix-ui/react-switch/dist/index.mjs", + "file": "@radix-ui_react-switch.js", + "fileHash": "2a0728de", + "needsInterop": false + }, + "@radix-ui/react-tabs": { + "src": "../../@radix-ui/react-tabs/dist/index.mjs", + "file": "@radix-ui_react-tabs.js", + "fileHash": "7d5fbe6d", + "needsInterop": false + }, + "@tanstack/react-query": { + "src": "../../@tanstack/react-query/build/modern/index.js", + "file": "@tanstack_react-query.js", + "fileHash": "9ee660a2", + "needsInterop": false + }, + "axios": { + "src": "../../axios/index.js", + "file": "axios.js", + "fileHash": "b1e1863b", + "needsInterop": false + }, + "class-variance-authority": { + "src": "../../class-variance-authority/dist/index.mjs", + "file": "class-variance-authority.js", + "fileHash": "776d48d2", + "needsInterop": false + }, + "clsx": { + "src": "../../clsx/dist/clsx.mjs", + "file": "clsx.js", + "fileHash": "b0c19004", + "needsInterop": false + }, + "date-fns": { + "src": "../../date-fns/index.mjs", + "file": "date-fns.js", + "fileHash": "a94ea93a", + "needsInterop": false + }, + "date-fns/locale": { + "src": "../../date-fns/locale.mjs", + "file": "date-fns_locale.js", + "fileHash": "9bf30c00", "needsInterop": false }, "dexie": { "src": "../../dexie/import-wrapper.mjs", "file": "dexie.js", - "fileHash": "df50a9c9", + "fileHash": "6d790676", "needsInterop": false }, + "framer-motion": { + "src": "../../framer-motion/dist/es/index.mjs", + "file": "framer-motion.js", + "fileHash": "0625818b", + "needsInterop": false + }, + "leaflet": { + "src": "../../leaflet/dist/leaflet-src.js", + "file": "leaflet.js", + "fileHash": "895a7565", + "needsInterop": true + }, "lodash": { "src": "../../lodash/lodash.js", "file": "lodash.js", - "fileHash": "856214fa", + "fileHash": "516bd72d", "needsInterop": true + }, + "lucide-react": { + "src": "../../lucide-react/dist/esm/lucide-react.js", + "file": "lucide-react.js", + "fileHash": "cf48ef79", + "needsInterop": false + }, + "react-dom/client": { + "src": "../../react-dom/client.js", + "file": "react-dom_client.js", + "fileHash": "1d52c939", + "needsInterop": true + }, + "react-leaflet": { + "src": "../../react-leaflet/lib/index.js", + "file": "react-leaflet.js", + "fileHash": "ae3e0b98", + "needsInterop": false + }, + "react-router-dom": { + "src": "../../react-router-dom/dist/index.js", + "file": "react-router-dom.js", + "fileHash": "725cbca3", + "needsInterop": false + }, + "recharts": { + "src": "../../recharts/es6/index.js", + "file": "recharts.js", + "fileHash": "2bcfad2a", + "needsInterop": false + }, + "sonner": { + "src": "../../sonner/dist/index.mjs", + "file": "sonner.js", + "fileHash": "66259871", + "needsInterop": false + }, + "sql.js": { + "src": "../../sql.js/dist/sql-wasm-browser.js", + "file": "sql__js.js", + "fileHash": "3ad8fefd", + "needsInterop": true + }, + "tailwind-merge": { + "src": "../../tailwind-merge/dist/bundle-mjs.mjs", + "file": "tailwind-merge.js", + "fileHash": "783cb95c", + "needsInterop": false } }, "chunks": { - "chunk-GTF7DNNX": { - "file": "chunk-GTF7DNNX.js" + "chunk-JYG67Z4H": { + "file": "chunk-JYG67Z4H.js" }, - "chunk-WIKMTAHT": { - "file": "chunk-WIKMTAHT.js" - }, - "chunk-BSEPHKUN": { - "file": "chunk-BSEPHKUN.js" - }, - "chunk-H4FEHRTE": { - "file": "chunk-H4FEHRTE.js" - }, - "chunk-AW4DWX7J": { - "file": "chunk-AW4DWX7J.js" - }, - "chunk-DR23R4HS": { - "file": "chunk-DR23R4HS.js" - }, - "chunk-CD6XDNKE": { - "file": "chunk-CD6XDNKE.js" - }, - "chunk-JDYSANEB": { - "file": "chunk-JDYSANEB.js" - }, - "chunk-A73536KP": { - "file": "chunk-A73536KP.js" + "chunk-IIGUYIAY": { + "file": "chunk-IIGUYIAY.js" }, "chunk-U7P2NEEE": { "file": "chunk-U7P2NEEE.js" }, - "chunk-CJARZ5TB": { - "file": "chunk-CJARZ5TB.js" + "chunk-L6UZI7BK": { + "file": "chunk-L6UZI7BK.js" }, - "chunk-SXRIVT2P": { - "file": "chunk-SXRIVT2P.js" + "chunk-REWER3PG": { + "file": "chunk-REWER3PG.js" }, - "chunk-KBTYAULA": { - "file": "chunk-KBTYAULA.js" + "chunk-AVIXPLZ3": { + "file": "chunk-AVIXPLZ3.js" }, - "chunk-QCHXOAYK": { - "file": "chunk-QCHXOAYK.js" + "chunk-U6B3GYRO": { + "file": "chunk-U6B3GYRO.js" }, - "chunk-A55GUTZU": { - "file": "chunk-A55GUTZU.js" + "chunk-KOYIXRFM": { + "file": "chunk-KOYIXRFM.js" }, - "chunk-WOOG5QLI": { - "file": "chunk-WOOG5QLI.js" + "chunk-RQF3JA7X": { + "file": "chunk-RQF3JA7X.js" + }, + "chunk-2KKOOEFD": { + "file": "chunk-2KKOOEFD.js" + }, + "chunk-A5QUBX2G": { + "file": "chunk-A5QUBX2G.js" + }, + "chunk-HKFJJYQE": { + "file": "chunk-HKFJJYQE.js" + }, + "chunk-F34GCA6J": { + "file": "chunk-F34GCA6J.js" + }, + "chunk-CRNJR6QK": { + "file": "chunk-CRNJR6QK.js" + }, + "chunk-ZMLY2J2T": { + "file": "chunk-ZMLY2J2T.js" + }, + "chunk-4B2QHNJT": { + "file": "chunk-4B2QHNJT.js" } } } \ No newline at end of file diff --git a/node_modules/.vite/deps/chunk-A55GUTZU.js b/node_modules/.vite/deps/chunk-A55GUTZU.js deleted file mode 100644 index 861c307b..00000000 --- a/node_modules/.vite/deps/chunk-A55GUTZU.js +++ /dev/null @@ -1,567 +0,0 @@ -// node_modules/date-fns/toDate.mjs -function toDate(argument) { - const argStr = Object.prototype.toString.call(argument); - if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") { - return new argument.constructor(+argument); - } else if (typeof argument === "number" || argStr === "[object Number]" || typeof argument === "string" || argStr === "[object String]") { - return new Date(argument); - } else { - return /* @__PURE__ */ new Date(NaN); - } -} - -// node_modules/date-fns/_lib/defaultOptions.mjs -var defaultOptions = {}; -function getDefaultOptions() { - return defaultOptions; -} -function setDefaultOptions(newOptions) { - defaultOptions = newOptions; -} - -// node_modules/date-fns/startOfWeek.mjs -function startOfWeek(date, options) { - var _a, _b, _c, _d; - const defaultOptions2 = getDefaultOptions(); - const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.weekStartsOn) ?? 0; - const _date = toDate(date); - const day = _date.getDay(); - const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; - _date.setDate(_date.getDate() - diff); - _date.setHours(0, 0, 0, 0); - return _date; -} - -// node_modules/date-fns/isSameWeek.mjs -function isSameWeek(dateLeft, dateRight, options) { - const dateLeftStartOfWeek = startOfWeek(dateLeft, options); - const dateRightStartOfWeek = startOfWeek(dateRight, options); - return +dateLeftStartOfWeek === +dateRightStartOfWeek; -} - -// node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs -var formatDistanceLocale = { - lessThanXSeconds: { - one: "less than a second", - other: "less than {{count}} seconds" - }, - xSeconds: { - one: "1 second", - other: "{{count}} seconds" - }, - halfAMinute: "half a minute", - lessThanXMinutes: { - one: "less than a minute", - other: "less than {{count}} minutes" - }, - xMinutes: { - one: "1 minute", - other: "{{count}} minutes" - }, - aboutXHours: { - one: "about 1 hour", - other: "about {{count}} hours" - }, - xHours: { - one: "1 hour", - other: "{{count}} hours" - }, - xDays: { - one: "1 day", - other: "{{count}} days" - }, - aboutXWeeks: { - one: "about 1 week", - other: "about {{count}} weeks" - }, - xWeeks: { - one: "1 week", - other: "{{count}} weeks" - }, - aboutXMonths: { - one: "about 1 month", - other: "about {{count}} months" - }, - xMonths: { - one: "1 month", - other: "{{count}} months" - }, - aboutXYears: { - one: "about 1 year", - other: "about {{count}} years" - }, - xYears: { - one: "1 year", - other: "{{count}} years" - }, - overXYears: { - one: "over 1 year", - other: "over {{count}} years" - }, - almostXYears: { - one: "almost 1 year", - other: "almost {{count}} years" - } -}; -var formatDistance = (token, count, options) => { - let result; - const tokenValue = formatDistanceLocale[token]; - if (typeof tokenValue === "string") { - result = tokenValue; - } else if (count === 1) { - result = tokenValue.one; - } else { - result = tokenValue.other.replace("{{count}}", count.toString()); - } - if (options == null ? void 0 : options.addSuffix) { - if (options.comparison && options.comparison > 0) { - return "in " + result; - } else { - return result + " ago"; - } - } - return result; -}; - -// node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs -function buildFormatLongFn(args) { - return (options = {}) => { - const width = options.width ? String(options.width) : args.defaultWidth; - const format = args.formats[width] || args.formats[args.defaultWidth]; - return format; - }; -} - -// node_modules/date-fns/locale/en-US/_lib/formatLong.mjs -var dateFormats = { - full: "EEEE, MMMM do, y", - long: "MMMM do, y", - medium: "MMM d, y", - short: "MM/dd/yyyy" -}; -var timeFormats = { - full: "h:mm:ss a zzzz", - long: "h:mm:ss a z", - medium: "h:mm:ss a", - short: "h:mm a" -}; -var dateTimeFormats = { - full: "{{date}} 'at' {{time}}", - long: "{{date}} 'at' {{time}}", - medium: "{{date}}, {{time}}", - short: "{{date}}, {{time}}" -}; -var formatLong = { - date: buildFormatLongFn({ - formats: dateFormats, - defaultWidth: "full" - }), - time: buildFormatLongFn({ - formats: timeFormats, - defaultWidth: "full" - }), - dateTime: buildFormatLongFn({ - formats: dateTimeFormats, - defaultWidth: "full" - }) -}; - -// node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs -var formatRelativeLocale = { - lastWeek: "'last' eeee 'at' p", - yesterday: "'yesterday at' p", - today: "'today at' p", - tomorrow: "'tomorrow at' p", - nextWeek: "eeee 'at' p", - other: "P" -}; -var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token]; - -// node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs -function buildLocalizeFn(args) { - return (value, options) => { - const context = (options == null ? void 0 : options.context) ? String(options.context) : "standalone"; - let valuesArray; - if (context === "formatting" && args.formattingValues) { - const defaultWidth = args.defaultFormattingWidth || args.defaultWidth; - const width = (options == null ? void 0 : options.width) ? String(options.width) : defaultWidth; - valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth]; - } else { - const defaultWidth = args.defaultWidth; - const width = (options == null ? void 0 : options.width) ? String(options.width) : args.defaultWidth; - valuesArray = args.values[width] || args.values[defaultWidth]; - } - const index = args.argumentCallback ? args.argumentCallback(value) : value; - return valuesArray[index]; - }; -} - -// node_modules/date-fns/locale/en-US/_lib/localize.mjs -var eraValues = { - narrow: ["B", "A"], - abbreviated: ["BC", "AD"], - wide: ["Before Christ", "Anno Domini"] -}; -var quarterValues = { - narrow: ["1", "2", "3", "4"], - abbreviated: ["Q1", "Q2", "Q3", "Q4"], - wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] -}; -var monthValues = { - narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], - abbreviated: [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" - ], - wide: [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" - ] -}; -var dayValues = { - narrow: ["S", "M", "T", "W", "T", "F", "S"], - short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], - abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - wide: [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" - ] -}; -var dayPeriodValues = { - narrow: { - am: "a", - pm: "p", - midnight: "mi", - noon: "n", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night" - }, - abbreviated: { - am: "AM", - pm: "PM", - midnight: "midnight", - noon: "noon", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night" - }, - wide: { - am: "a.m.", - pm: "p.m.", - midnight: "midnight", - noon: "noon", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night" - } -}; -var formattingDayPeriodValues = { - narrow: { - am: "a", - pm: "p", - midnight: "mi", - noon: "n", - morning: "in the morning", - afternoon: "in the afternoon", - evening: "in the evening", - night: "at night" - }, - abbreviated: { - am: "AM", - pm: "PM", - midnight: "midnight", - noon: "noon", - morning: "in the morning", - afternoon: "in the afternoon", - evening: "in the evening", - night: "at night" - }, - wide: { - am: "a.m.", - pm: "p.m.", - midnight: "midnight", - noon: "noon", - morning: "in the morning", - afternoon: "in the afternoon", - evening: "in the evening", - night: "at night" - } -}; -var ordinalNumber = (dirtyNumber, _options) => { - const number = Number(dirtyNumber); - const rem100 = number % 100; - if (rem100 > 20 || rem100 < 10) { - switch (rem100 % 10) { - case 1: - return number + "st"; - case 2: - return number + "nd"; - case 3: - return number + "rd"; - } - } - return number + "th"; -}; -var localize = { - ordinalNumber, - era: buildLocalizeFn({ - values: eraValues, - defaultWidth: "wide" - }), - quarter: buildLocalizeFn({ - values: quarterValues, - defaultWidth: "wide", - argumentCallback: (quarter) => quarter - 1 - }), - month: buildLocalizeFn({ - values: monthValues, - defaultWidth: "wide" - }), - day: buildLocalizeFn({ - values: dayValues, - defaultWidth: "wide" - }), - dayPeriod: buildLocalizeFn({ - values: dayPeriodValues, - defaultWidth: "wide", - formattingValues: formattingDayPeriodValues, - defaultFormattingWidth: "wide" - }) -}; - -// node_modules/date-fns/locale/_lib/buildMatchFn.mjs -function buildMatchFn(args) { - return (string, options = {}) => { - const width = options.width; - const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth]; - const matchResult = string.match(matchPattern); - if (!matchResult) { - return null; - } - const matchedString = matchResult[0]; - const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth]; - const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type - findKey(parsePatterns, (pattern) => pattern.test(matchedString)) - ); - let value; - value = args.valueCallback ? args.valueCallback(key) : key; - value = options.valueCallback ? ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type - options.valueCallback(value) - ) : value; - const rest = string.slice(matchedString.length); - return { value, rest }; - }; -} -function findKey(object, predicate) { - for (const key in object) { - if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) { - return key; - } - } - return void 0; -} -function findIndex(array, predicate) { - for (let key = 0; key < array.length; key++) { - if (predicate(array[key])) { - return key; - } - } - return void 0; -} - -// node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs -function buildMatchPatternFn(args) { - return (string, options = {}) => { - const matchResult = string.match(args.matchPattern); - if (!matchResult) return null; - const matchedString = matchResult[0]; - const parseResult = string.match(args.parsePattern); - if (!parseResult) return null; - let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0]; - value = options.valueCallback ? options.valueCallback(value) : value; - const rest = string.slice(matchedString.length); - return { value, rest }; - }; -} - -// node_modules/date-fns/locale/en-US/_lib/match.mjs -var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; -var parseOrdinalNumberPattern = /\d+/i; -var matchEraPatterns = { - narrow: /^(b|a)/i, - abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i, - wide: /^(before christ|before common era|anno domini|common era)/i -}; -var parseEraPatterns = { - any: [/^b/i, /^(a|c)/i] -}; -var matchQuarterPatterns = { - narrow: /^[1234]/i, - abbreviated: /^q[1234]/i, - wide: /^[1234](th|st|nd|rd)? quarter/i -}; -var parseQuarterPatterns = { - any: [/1/i, /2/i, /3/i, /4/i] -}; -var matchMonthPatterns = { - narrow: /^[jfmasond]/i, - abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, - wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i -}; -var parseMonthPatterns = { - narrow: [ - /^j/i, - /^f/i, - /^m/i, - /^a/i, - /^m/i, - /^j/i, - /^j/i, - /^a/i, - /^s/i, - /^o/i, - /^n/i, - /^d/i - ], - any: [ - /^ja/i, - /^f/i, - /^mar/i, - /^ap/i, - /^may/i, - /^jun/i, - /^jul/i, - /^au/i, - /^s/i, - /^o/i, - /^n/i, - /^d/i - ] -}; -var matchDayPatterns = { - narrow: /^[smtwf]/i, - short: /^(su|mo|tu|we|th|fr|sa)/i, - abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i, - wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i -}; -var parseDayPatterns = { - narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i], - any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] -}; -var matchDayPeriodPatterns = { - narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i, - any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i -}; -var parseDayPeriodPatterns = { - any: { - am: /^a/i, - pm: /^p/i, - midnight: /^mi/i, - noon: /^no/i, - morning: /morning/i, - afternoon: /afternoon/i, - evening: /evening/i, - night: /night/i - } -}; -var match = { - ordinalNumber: buildMatchPatternFn({ - matchPattern: matchOrdinalNumberPattern, - parsePattern: parseOrdinalNumberPattern, - valueCallback: (value) => parseInt(value, 10) - }), - era: buildMatchFn({ - matchPatterns: matchEraPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseEraPatterns, - defaultParseWidth: "any" - }), - quarter: buildMatchFn({ - matchPatterns: matchQuarterPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseQuarterPatterns, - defaultParseWidth: "any", - valueCallback: (index) => index + 1 - }), - month: buildMatchFn({ - matchPatterns: matchMonthPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseMonthPatterns, - defaultParseWidth: "any" - }), - day: buildMatchFn({ - matchPatterns: matchDayPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseDayPatterns, - defaultParseWidth: "any" - }), - dayPeriod: buildMatchFn({ - matchPatterns: matchDayPeriodPatterns, - defaultMatchWidth: "any", - parsePatterns: parseDayPeriodPatterns, - defaultParseWidth: "any" - }) -}; - -// node_modules/date-fns/locale/en-US.mjs -var enUS = { - code: "en-US", - formatDistance, - formatLong, - formatRelative, - localize, - match, - options: { - weekStartsOn: 0, - firstWeekContainsDate: 1 - } -}; - -export { - buildFormatLongFn, - buildLocalizeFn, - buildMatchFn, - buildMatchPatternFn, - toDate, - getDefaultOptions, - setDefaultOptions, - startOfWeek, - isSameWeek, - formatDistance, - formatRelative, - localize, - match, - enUS -}; -//# sourceMappingURL=chunk-A55GUTZU.js.map diff --git a/node_modules/.vite/deps/chunk-A55GUTZU.js.map b/node_modules/.vite/deps/chunk-A55GUTZU.js.map deleted file mode 100644 index 084ba6e6..00000000 --- a/node_modules/.vite/deps/chunk-A55GUTZU.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../date-fns/toDate.mjs", "../../date-fns/_lib/defaultOptions.mjs", "../../date-fns/startOfWeek.mjs", "../../date-fns/isSameWeek.mjs", "../../date-fns/locale/en-US/_lib/formatDistance.mjs", "../../date-fns/locale/_lib/buildFormatLongFn.mjs", "../../date-fns/locale/en-US/_lib/formatLong.mjs", "../../date-fns/locale/en-US/_lib/formatRelative.mjs", "../../date-fns/locale/_lib/buildLocalizeFn.mjs", "../../date-fns/locale/en-US/_lib/localize.mjs", "../../date-fns/locale/_lib/buildMatchFn.mjs", "../../date-fns/locale/_lib/buildMatchPatternFn.mjs", "../../date-fns/locale/en-US/_lib/match.mjs", "../../date-fns/locale/en-US.mjs"], - "sourcesContent": ["/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n", "let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n", "import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n", "import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * The {@link isSameWeek} function options.\n */\n\n/**\n * @name isSameWeek\n * @category Week Helpers\n * @summary Are the given dates in the same week (and month and year)?\n *\n * @description\n * Are the given dates in the same week (and month and year)?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The first date to check\n * @param dateRight - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same week (and month and year)\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {\n * weekStartsOn: 1\n * })\n * //=> false\n *\n * @example\n * // Are 1 January 2014 and 1 January 2015 in the same week?\n * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1))\n * //=> false\n */\nexport function isSameWeek(dateLeft, dateRight, options) {\n const dateLeftStartOfWeek = startOfWeek(dateLeft, options);\n const dateRightStartOfWeek = startOfWeek(dateRight, options);\n\n return +dateLeftStartOfWeek === +dateRightStartOfWeek;\n}\n\n// Fallback for modularized imports:\nexport default isSameWeek;\n", "const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n", "export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n", "import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n", "const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n", "/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n", "import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n", "export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n", "export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n", "import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n", "import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n"], - "mappings": ";AAgCO,SAAS,OAAO,UAAU;AAC/B,QAAM,SAAS,OAAO,UAAU,SAAS,KAAK,QAAQ;AAGtD,MACE,oBAAoB,QACnB,OAAO,aAAa,YAAY,WAAW,iBAC5C;AAEA,WAAO,IAAI,SAAS,YAAY,CAAC,QAAQ;AAAA,EAC3C,WACE,OAAO,aAAa,YACpB,WAAW,qBACX,OAAO,aAAa,YACpB,WAAW,mBACX;AAEA,WAAO,IAAI,KAAK,QAAQ;AAAA,EAC1B,OAAO;AAEL,WAAO,oBAAI,KAAK,GAAG;AAAA,EACrB;AACF;;;ACtDA,IAAI,iBAAiB,CAAC;AAEf,SAAS,oBAAoB;AAClC,SAAO;AACT;AAEO,SAAS,kBAAkB,YAAY;AAC5C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,EAED,OAAO,aAAa;AAAA,IAClB,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,mBAAmB;AAAA,EACrB,CAAC;AAAA,EAED,KAAK,aAAa;AAAA,IAChB,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,mBAAmB;AAAA,EACrB,CAAC;AAAA,EAED,WAAW,aAAa;AAAA,IACtB,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,mBAAmB;AAAA,EACrB,CAAC;AACH;;;ACrHO,IAAM,OAAO;AAAA,EAClB,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,IACP,cAAc;AAAA,IACd,uBAAuB;AAAA,EACzB;AACF;", - "names": ["defaultOptions"] -} diff --git a/node_modules/.vite/deps/chunk-A73536KP.js b/node_modules/.vite/deps/chunk-A73536KP.js deleted file mode 100644 index f017211e..00000000 --- a/node_modules/.vite/deps/chunk-A73536KP.js +++ /dev/null @@ -1,9566 +0,0 @@ -import { - __commonJS -} from "./chunk-WOOG5QLI.js"; - -// node_modules/leaflet/dist/leaflet-src.js -var require_leaflet_src = __commonJS({ - "node_modules/leaflet/dist/leaflet-src.js"(exports, module) { - (function(global, factory) { - typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.leaflet = {})); - })(exports, (function(exports2) { - "use strict"; - var version = "1.9.4"; - function extend(dest) { - var i, j, len, src; - for (j = 1, len = arguments.length; j < len; j++) { - src = arguments[j]; - for (i in src) { - dest[i] = src[i]; - } - } - return dest; - } - var create$2 = Object.create || /* @__PURE__ */ (function() { - function F() { - } - return function(proto) { - F.prototype = proto; - return new F(); - }; - })(); - function bind(fn, obj) { - var slice = Array.prototype.slice; - if (fn.bind) { - return fn.bind.apply(fn, slice.call(arguments, 1)); - } - var args = slice.call(arguments, 2); - return function() { - return fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments); - }; - } - var lastId = 0; - function stamp(obj) { - if (!("_leaflet_id" in obj)) { - obj["_leaflet_id"] = ++lastId; - } - return obj._leaflet_id; - } - function throttle(fn, time, context) { - var lock, args, wrapperFn, later; - later = function() { - lock = false; - if (args) { - wrapperFn.apply(context, args); - args = false; - } - }; - wrapperFn = function() { - if (lock) { - args = arguments; - } else { - fn.apply(context, arguments); - setTimeout(later, time); - lock = true; - } - }; - return wrapperFn; - } - function wrapNum(x, range, includeMax) { - var max = range[1], min = range[0], d = max - min; - return x === max && includeMax ? x : ((x - min) % d + d) % d + min; - } - function falseFn() { - return false; - } - function formatNum(num, precision) { - if (precision === false) { - return num; - } - var pow = Math.pow(10, precision === void 0 ? 6 : precision); - return Math.round(num * pow) / pow; - } - function trim(str) { - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ""); - } - function splitWords(str) { - return trim(str).split(/\s+/); - } - function setOptions(obj, options) { - if (!Object.prototype.hasOwnProperty.call(obj, "options")) { - obj.options = obj.options ? create$2(obj.options) : {}; - } - for (var i in options) { - obj.options[i] = options[i]; - } - return obj.options; - } - function getParamString(obj, existingUrl, uppercase) { - var params = []; - for (var i in obj) { - params.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + "=" + encodeURIComponent(obj[i])); - } - return (!existingUrl || existingUrl.indexOf("?") === -1 ? "?" : "&") + params.join("&"); - } - var templateRe = /\{ *([\w_ -]+) *\}/g; - function template(str, data) { - return str.replace(templateRe, function(str2, key) { - var value = data[key]; - if (value === void 0) { - throw new Error("No value provided for variable " + str2); - } else if (typeof value === "function") { - value = value(data); - } - return value; - }); - } - var isArray = Array.isArray || function(obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; - }; - function indexOf(array, el) { - for (var i = 0; i < array.length; i++) { - if (array[i] === el) { - return i; - } - } - return -1; - } - var emptyImageUrl = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="; - function getPrefixed(name) { - return window["webkit" + name] || window["moz" + name] || window["ms" + name]; - } - var lastTime = 0; - function timeoutDefer(fn) { - var time = +/* @__PURE__ */ new Date(), timeToCall = Math.max(0, 16 - (time - lastTime)); - lastTime = time + timeToCall; - return window.setTimeout(fn, timeToCall); - } - var requestFn = window.requestAnimationFrame || getPrefixed("RequestAnimationFrame") || timeoutDefer; - var cancelFn = window.cancelAnimationFrame || getPrefixed("CancelAnimationFrame") || getPrefixed("CancelRequestAnimationFrame") || function(id) { - window.clearTimeout(id); - }; - function requestAnimFrame(fn, context, immediate) { - if (immediate && requestFn === timeoutDefer) { - fn.call(context); - } else { - return requestFn.call(window, bind(fn, context)); - } - } - function cancelAnimFrame(id) { - if (id) { - cancelFn.call(window, id); - } - } - var Util = { - __proto__: null, - extend, - create: create$2, - bind, - get lastId() { - return lastId; - }, - stamp, - throttle, - wrapNum, - falseFn, - formatNum, - trim, - splitWords, - setOptions, - getParamString, - template, - isArray, - indexOf, - emptyImageUrl, - requestFn, - cancelFn, - requestAnimFrame, - cancelAnimFrame - }; - function Class() { - } - Class.extend = function(props) { - var NewClass = function() { - setOptions(this); - if (this.initialize) { - this.initialize.apply(this, arguments); - } - this.callInitHooks(); - }; - var parentProto = NewClass.__super__ = this.prototype; - var proto = create$2(parentProto); - proto.constructor = NewClass; - NewClass.prototype = proto; - for (var i in this) { - if (Object.prototype.hasOwnProperty.call(this, i) && i !== "prototype" && i !== "__super__") { - NewClass[i] = this[i]; - } - } - if (props.statics) { - extend(NewClass, props.statics); - } - if (props.includes) { - checkDeprecatedMixinEvents(props.includes); - extend.apply(null, [proto].concat(props.includes)); - } - extend(proto, props); - delete proto.statics; - delete proto.includes; - if (proto.options) { - proto.options = parentProto.options ? create$2(parentProto.options) : {}; - extend(proto.options, props.options); - } - proto._initHooks = []; - proto.callInitHooks = function() { - if (this._initHooksCalled) { - return; - } - if (parentProto.callInitHooks) { - parentProto.callInitHooks.call(this); - } - this._initHooksCalled = true; - for (var i2 = 0, len = proto._initHooks.length; i2 < len; i2++) { - proto._initHooks[i2].call(this); - } - }; - return NewClass; - }; - Class.include = function(props) { - var parentOptions = this.prototype.options; - extend(this.prototype, props); - if (props.options) { - this.prototype.options = parentOptions; - this.mergeOptions(props.options); - } - return this; - }; - Class.mergeOptions = function(options) { - extend(this.prototype.options, options); - return this; - }; - Class.addInitHook = function(fn) { - var args = Array.prototype.slice.call(arguments, 1); - var init = typeof fn === "function" ? fn : function() { - this[fn].apply(this, args); - }; - this.prototype._initHooks = this.prototype._initHooks || []; - this.prototype._initHooks.push(init); - return this; - }; - function checkDeprecatedMixinEvents(includes) { - if (typeof L === "undefined" || !L || !L.Mixin) { - return; - } - includes = isArray(includes) ? includes : [includes]; - for (var i = 0; i < includes.length; i++) { - if (includes[i] === L.Mixin.Events) { - console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.", new Error().stack); - } - } - } - var Events = { - /* @method on(type: String, fn: Function, context?: Object): this - * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`). - * - * @alternative - * @method on(eventMap: Object): this - * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}` - */ - on: function(types, fn, context) { - if (typeof types === "object") { - for (var type in types) { - this._on(type, types[type], fn); - } - } else { - types = splitWords(types); - for (var i = 0, len = types.length; i < len; i++) { - this._on(types[i], fn, context); - } - } - return this; - }, - /* @method off(type: String, fn?: Function, context?: Object): this - * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener. - * - * @alternative - * @method off(eventMap: Object): this - * Removes a set of type/listener pairs. - * - * @alternative - * @method off: this - * Removes all listeners to all events on the object. This includes implicitly attached events. - */ - off: function(types, fn, context) { - if (!arguments.length) { - delete this._events; - } else if (typeof types === "object") { - for (var type in types) { - this._off(type, types[type], fn); - } - } else { - types = splitWords(types); - var removeAll = arguments.length === 1; - for (var i = 0, len = types.length; i < len; i++) { - if (removeAll) { - this._off(types[i]); - } else { - this._off(types[i], fn, context); - } - } - } - return this; - }, - // attach listener (without syntactic sugar now) - _on: function(type, fn, context, _once) { - if (typeof fn !== "function") { - console.warn("wrong listener type: " + typeof fn); - return; - } - if (this._listens(type, fn, context) !== false) { - return; - } - if (context === this) { - context = void 0; - } - var newListener = { fn, ctx: context }; - if (_once) { - newListener.once = true; - } - this._events = this._events || {}; - this._events[type] = this._events[type] || []; - this._events[type].push(newListener); - }, - _off: function(type, fn, context) { - var listeners, i, len; - if (!this._events) { - return; - } - listeners = this._events[type]; - if (!listeners) { - return; - } - if (arguments.length === 1) { - if (this._firingCount) { - for (i = 0, len = listeners.length; i < len; i++) { - listeners[i].fn = falseFn; - } - } - delete this._events[type]; - return; - } - if (typeof fn !== "function") { - console.warn("wrong listener type: " + typeof fn); - return; - } - var index2 = this._listens(type, fn, context); - if (index2 !== false) { - var listener = listeners[index2]; - if (this._firingCount) { - listener.fn = falseFn; - this._events[type] = listeners = listeners.slice(); - } - listeners.splice(index2, 1); - } - }, - // @method fire(type: String, data?: Object, propagate?: Boolean): this - // Fires an event of the specified type. You can optionally provide a data - // object — the first argument of the listener function will contain its - // properties. The event can optionally be propagated to event parents. - fire: function(type, data, propagate) { - if (!this.listens(type, propagate)) { - return this; - } - var event = extend({}, data, { - type, - target: this, - sourceTarget: data && data.sourceTarget || this - }); - if (this._events) { - var listeners = this._events[type]; - if (listeners) { - this._firingCount = this._firingCount + 1 || 1; - for (var i = 0, len = listeners.length; i < len; i++) { - var l = listeners[i]; - var fn = l.fn; - if (l.once) { - this.off(type, fn, l.ctx); - } - fn.call(l.ctx || this, event); - } - this._firingCount--; - } - } - if (propagate) { - this._propagateEvent(event); - } - return this; - }, - // @method listens(type: String, propagate?: Boolean): Boolean - // @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean - // Returns `true` if a particular event type has any listeners attached to it. - // The verification can optionally be propagated, it will return `true` if parents have the listener attached to it. - listens: function(type, fn, context, propagate) { - if (typeof type !== "string") { - console.warn('"string" type argument expected'); - } - var _fn = fn; - if (typeof fn !== "function") { - propagate = !!fn; - _fn = void 0; - context = void 0; - } - var listeners = this._events && this._events[type]; - if (listeners && listeners.length) { - if (this._listens(type, _fn, context) !== false) { - return true; - } - } - if (propagate) { - for (var id in this._eventParents) { - if (this._eventParents[id].listens(type, fn, context, propagate)) { - return true; - } - } - } - return false; - }, - // returns the index (number) or false - _listens: function(type, fn, context) { - if (!this._events) { - return false; - } - var listeners = this._events[type] || []; - if (!fn) { - return !!listeners.length; - } - if (context === this) { - context = void 0; - } - for (var i = 0, len = listeners.length; i < len; i++) { - if (listeners[i].fn === fn && listeners[i].ctx === context) { - return i; - } - } - return false; - }, - // @method once(…): this - // Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed. - once: function(types, fn, context) { - if (typeof types === "object") { - for (var type in types) { - this._on(type, types[type], fn, true); - } - } else { - types = splitWords(types); - for (var i = 0, len = types.length; i < len; i++) { - this._on(types[i], fn, context, true); - } - } - return this; - }, - // @method addEventParent(obj: Evented): this - // Adds an event parent - an `Evented` that will receive propagated events - addEventParent: function(obj) { - this._eventParents = this._eventParents || {}; - this._eventParents[stamp(obj)] = obj; - return this; - }, - // @method removeEventParent(obj: Evented): this - // Removes an event parent, so it will stop receiving propagated events - removeEventParent: function(obj) { - if (this._eventParents) { - delete this._eventParents[stamp(obj)]; - } - return this; - }, - _propagateEvent: function(e) { - for (var id in this._eventParents) { - this._eventParents[id].fire(e.type, extend({ - layer: e.target, - propagatedFrom: e.target - }, e), true); - } - } - }; - Events.addEventListener = Events.on; - Events.removeEventListener = Events.clearAllEventListeners = Events.off; - Events.addOneTimeEventListener = Events.once; - Events.fireEvent = Events.fire; - Events.hasEventListeners = Events.listens; - var Evented = Class.extend(Events); - function Point(x, y, round) { - this.x = round ? Math.round(x) : x; - this.y = round ? Math.round(y) : y; - } - var trunc = Math.trunc || function(v) { - return v > 0 ? Math.floor(v) : Math.ceil(v); - }; - Point.prototype = { - // @method clone(): Point - // Returns a copy of the current point. - clone: function() { - return new Point(this.x, this.y); - }, - // @method add(otherPoint: Point): Point - // Returns the result of addition of the current and the given points. - add: function(point) { - return this.clone()._add(toPoint(point)); - }, - _add: function(point) { - this.x += point.x; - this.y += point.y; - return this; - }, - // @method subtract(otherPoint: Point): Point - // Returns the result of subtraction of the given point from the current. - subtract: function(point) { - return this.clone()._subtract(toPoint(point)); - }, - _subtract: function(point) { - this.x -= point.x; - this.y -= point.y; - return this; - }, - // @method divideBy(num: Number): Point - // Returns the result of division of the current point by the given number. - divideBy: function(num) { - return this.clone()._divideBy(num); - }, - _divideBy: function(num) { - this.x /= num; - this.y /= num; - return this; - }, - // @method multiplyBy(num: Number): Point - // Returns the result of multiplication of the current point by the given number. - multiplyBy: function(num) { - return this.clone()._multiplyBy(num); - }, - _multiplyBy: function(num) { - this.x *= num; - this.y *= num; - return this; - }, - // @method scaleBy(scale: Point): Point - // Multiply each coordinate of the current point by each coordinate of - // `scale`. In linear algebra terms, multiply the point by the - // [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation) - // defined by `scale`. - scaleBy: function(point) { - return new Point(this.x * point.x, this.y * point.y); - }, - // @method unscaleBy(scale: Point): Point - // Inverse of `scaleBy`. Divide each coordinate of the current point by - // each coordinate of `scale`. - unscaleBy: function(point) { - return new Point(this.x / point.x, this.y / point.y); - }, - // @method round(): Point - // Returns a copy of the current point with rounded coordinates. - round: function() { - return this.clone()._round(); - }, - _round: function() { - this.x = Math.round(this.x); - this.y = Math.round(this.y); - return this; - }, - // @method floor(): Point - // Returns a copy of the current point with floored coordinates (rounded down). - floor: function() { - return this.clone()._floor(); - }, - _floor: function() { - this.x = Math.floor(this.x); - this.y = Math.floor(this.y); - return this; - }, - // @method ceil(): Point - // Returns a copy of the current point with ceiled coordinates (rounded up). - ceil: function() { - return this.clone()._ceil(); - }, - _ceil: function() { - this.x = Math.ceil(this.x); - this.y = Math.ceil(this.y); - return this; - }, - // @method trunc(): Point - // Returns a copy of the current point with truncated coordinates (rounded towards zero). - trunc: function() { - return this.clone()._trunc(); - }, - _trunc: function() { - this.x = trunc(this.x); - this.y = trunc(this.y); - return this; - }, - // @method distanceTo(otherPoint: Point): Number - // Returns the cartesian distance between the current and the given points. - distanceTo: function(point) { - point = toPoint(point); - var x = point.x - this.x, y = point.y - this.y; - return Math.sqrt(x * x + y * y); - }, - // @method equals(otherPoint: Point): Boolean - // Returns `true` if the given point has the same coordinates. - equals: function(point) { - point = toPoint(point); - return point.x === this.x && point.y === this.y; - }, - // @method contains(otherPoint: Point): Boolean - // Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values). - contains: function(point) { - point = toPoint(point); - return Math.abs(point.x) <= Math.abs(this.x) && Math.abs(point.y) <= Math.abs(this.y); - }, - // @method toString(): String - // Returns a string representation of the point for debugging purposes. - toString: function() { - return "Point(" + formatNum(this.x) + ", " + formatNum(this.y) + ")"; - } - }; - function toPoint(x, y, round) { - if (x instanceof Point) { - return x; - } - if (isArray(x)) { - return new Point(x[0], x[1]); - } - if (x === void 0 || x === null) { - return x; - } - if (typeof x === "object" && "x" in x && "y" in x) { - return new Point(x.x, x.y); - } - return new Point(x, y, round); - } - function Bounds(a, b) { - if (!a) { - return; - } - var points = b ? [a, b] : a; - for (var i = 0, len = points.length; i < len; i++) { - this.extend(points[i]); - } - } - Bounds.prototype = { - // @method extend(point: Point): this - // Extends the bounds to contain the given point. - // @alternative - // @method extend(otherBounds: Bounds): this - // Extend the bounds to contain the given bounds - extend: function(obj) { - var min2, max2; - if (!obj) { - return this; - } - if (obj instanceof Point || typeof obj[0] === "number" || "x" in obj) { - min2 = max2 = toPoint(obj); - } else { - obj = toBounds(obj); - min2 = obj.min; - max2 = obj.max; - if (!min2 || !max2) { - return this; - } - } - if (!this.min && !this.max) { - this.min = min2.clone(); - this.max = max2.clone(); - } else { - this.min.x = Math.min(min2.x, this.min.x); - this.max.x = Math.max(max2.x, this.max.x); - this.min.y = Math.min(min2.y, this.min.y); - this.max.y = Math.max(max2.y, this.max.y); - } - return this; - }, - // @method getCenter(round?: Boolean): Point - // Returns the center point of the bounds. - getCenter: function(round) { - return toPoint( - (this.min.x + this.max.x) / 2, - (this.min.y + this.max.y) / 2, - round - ); - }, - // @method getBottomLeft(): Point - // Returns the bottom-left point of the bounds. - getBottomLeft: function() { - return toPoint(this.min.x, this.max.y); - }, - // @method getTopRight(): Point - // Returns the top-right point of the bounds. - getTopRight: function() { - return toPoint(this.max.x, this.min.y); - }, - // @method getTopLeft(): Point - // Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)). - getTopLeft: function() { - return this.min; - }, - // @method getBottomRight(): Point - // Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)). - getBottomRight: function() { - return this.max; - }, - // @method getSize(): Point - // Returns the size of the given bounds - getSize: function() { - return this.max.subtract(this.min); - }, - // @method contains(otherBounds: Bounds): Boolean - // Returns `true` if the rectangle contains the given one. - // @alternative - // @method contains(point: Point): Boolean - // Returns `true` if the rectangle contains the given point. - contains: function(obj) { - var min, max; - if (typeof obj[0] === "number" || obj instanceof Point) { - obj = toPoint(obj); - } else { - obj = toBounds(obj); - } - if (obj instanceof Bounds) { - min = obj.min; - max = obj.max; - } else { - min = max = obj; - } - return min.x >= this.min.x && max.x <= this.max.x && min.y >= this.min.y && max.y <= this.max.y; - }, - // @method intersects(otherBounds: Bounds): Boolean - // Returns `true` if the rectangle intersects the given bounds. Two bounds - // intersect if they have at least one point in common. - intersects: function(bounds) { - bounds = toBounds(bounds); - var min = this.min, max = this.max, min2 = bounds.min, max2 = bounds.max, xIntersects = max2.x >= min.x && min2.x <= max.x, yIntersects = max2.y >= min.y && min2.y <= max.y; - return xIntersects && yIntersects; - }, - // @method overlaps(otherBounds: Bounds): Boolean - // Returns `true` if the rectangle overlaps the given bounds. Two bounds - // overlap if their intersection is an area. - overlaps: function(bounds) { - bounds = toBounds(bounds); - var min = this.min, max = this.max, min2 = bounds.min, max2 = bounds.max, xOverlaps = max2.x > min.x && min2.x < max.x, yOverlaps = max2.y > min.y && min2.y < max.y; - return xOverlaps && yOverlaps; - }, - // @method isValid(): Boolean - // Returns `true` if the bounds are properly initialized. - isValid: function() { - return !!(this.min && this.max); - }, - // @method pad(bufferRatio: Number): Bounds - // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction. - // For example, a ratio of 0.5 extends the bounds by 50% in each direction. - // Negative values will retract the bounds. - pad: function(bufferRatio) { - var min = this.min, max = this.max, heightBuffer = Math.abs(min.x - max.x) * bufferRatio, widthBuffer = Math.abs(min.y - max.y) * bufferRatio; - return toBounds( - toPoint(min.x - heightBuffer, min.y - widthBuffer), - toPoint(max.x + heightBuffer, max.y + widthBuffer) - ); - }, - // @method equals(otherBounds: Bounds): Boolean - // Returns `true` if the rectangle is equivalent to the given bounds. - equals: function(bounds) { - if (!bounds) { - return false; - } - bounds = toBounds(bounds); - return this.min.equals(bounds.getTopLeft()) && this.max.equals(bounds.getBottomRight()); - } - }; - function toBounds(a, b) { - if (!a || a instanceof Bounds) { - return a; - } - return new Bounds(a, b); - } - function LatLngBounds(corner1, corner2) { - if (!corner1) { - return; - } - var latlngs = corner2 ? [corner1, corner2] : corner1; - for (var i = 0, len = latlngs.length; i < len; i++) { - this.extend(latlngs[i]); - } - } - LatLngBounds.prototype = { - // @method extend(latlng: LatLng): this - // Extend the bounds to contain the given point - // @alternative - // @method extend(otherBounds: LatLngBounds): this - // Extend the bounds to contain the given bounds - extend: function(obj) { - var sw = this._southWest, ne = this._northEast, sw2, ne2; - if (obj instanceof LatLng) { - sw2 = obj; - ne2 = obj; - } else if (obj instanceof LatLngBounds) { - sw2 = obj._southWest; - ne2 = obj._northEast; - if (!sw2 || !ne2) { - return this; - } - } else { - return obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this; - } - if (!sw && !ne) { - this._southWest = new LatLng(sw2.lat, sw2.lng); - this._northEast = new LatLng(ne2.lat, ne2.lng); - } else { - sw.lat = Math.min(sw2.lat, sw.lat); - sw.lng = Math.min(sw2.lng, sw.lng); - ne.lat = Math.max(ne2.lat, ne.lat); - ne.lng = Math.max(ne2.lng, ne.lng); - } - return this; - }, - // @method pad(bufferRatio: Number): LatLngBounds - // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction. - // For example, a ratio of 0.5 extends the bounds by 50% in each direction. - // Negative values will retract the bounds. - pad: function(bufferRatio) { - var sw = this._southWest, ne = this._northEast, heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio, widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio; - return new LatLngBounds( - new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer), - new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer) - ); - }, - // @method getCenter(): LatLng - // Returns the center point of the bounds. - getCenter: function() { - return new LatLng( - (this._southWest.lat + this._northEast.lat) / 2, - (this._southWest.lng + this._northEast.lng) / 2 - ); - }, - // @method getSouthWest(): LatLng - // Returns the south-west point of the bounds. - getSouthWest: function() { - return this._southWest; - }, - // @method getNorthEast(): LatLng - // Returns the north-east point of the bounds. - getNorthEast: function() { - return this._northEast; - }, - // @method getNorthWest(): LatLng - // Returns the north-west point of the bounds. - getNorthWest: function() { - return new LatLng(this.getNorth(), this.getWest()); - }, - // @method getSouthEast(): LatLng - // Returns the south-east point of the bounds. - getSouthEast: function() { - return new LatLng(this.getSouth(), this.getEast()); - }, - // @method getWest(): Number - // Returns the west longitude of the bounds - getWest: function() { - return this._southWest.lng; - }, - // @method getSouth(): Number - // Returns the south latitude of the bounds - getSouth: function() { - return this._southWest.lat; - }, - // @method getEast(): Number - // Returns the east longitude of the bounds - getEast: function() { - return this._northEast.lng; - }, - // @method getNorth(): Number - // Returns the north latitude of the bounds - getNorth: function() { - return this._northEast.lat; - }, - // @method contains(otherBounds: LatLngBounds): Boolean - // Returns `true` if the rectangle contains the given one. - // @alternative - // @method contains (latlng: LatLng): Boolean - // Returns `true` if the rectangle contains the given point. - contains: function(obj) { - if (typeof obj[0] === "number" || obj instanceof LatLng || "lat" in obj) { - obj = toLatLng(obj); - } else { - obj = toLatLngBounds(obj); - } - var sw = this._southWest, ne = this._northEast, sw2, ne2; - if (obj instanceof LatLngBounds) { - sw2 = obj.getSouthWest(); - ne2 = obj.getNorthEast(); - } else { - sw2 = ne2 = obj; - } - return sw2.lat >= sw.lat && ne2.lat <= ne.lat && sw2.lng >= sw.lng && ne2.lng <= ne.lng; - }, - // @method intersects(otherBounds: LatLngBounds): Boolean - // Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common. - intersects: function(bounds) { - bounds = toLatLngBounds(bounds); - var sw = this._southWest, ne = this._northEast, sw2 = bounds.getSouthWest(), ne2 = bounds.getNorthEast(), latIntersects = ne2.lat >= sw.lat && sw2.lat <= ne.lat, lngIntersects = ne2.lng >= sw.lng && sw2.lng <= ne.lng; - return latIntersects && lngIntersects; - }, - // @method overlaps(otherBounds: LatLngBounds): Boolean - // Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area. - overlaps: function(bounds) { - bounds = toLatLngBounds(bounds); - var sw = this._southWest, ne = this._northEast, sw2 = bounds.getSouthWest(), ne2 = bounds.getNorthEast(), latOverlaps = ne2.lat > sw.lat && sw2.lat < ne.lat, lngOverlaps = ne2.lng > sw.lng && sw2.lng < ne.lng; - return latOverlaps && lngOverlaps; - }, - // @method toBBoxString(): String - // Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data. - toBBoxString: function() { - return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(","); - }, - // @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean - // Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number. - equals: function(bounds, maxMargin) { - if (!bounds) { - return false; - } - bounds = toLatLngBounds(bounds); - return this._southWest.equals(bounds.getSouthWest(), maxMargin) && this._northEast.equals(bounds.getNorthEast(), maxMargin); - }, - // @method isValid(): Boolean - // Returns `true` if the bounds are properly initialized. - isValid: function() { - return !!(this._southWest && this._northEast); - } - }; - function toLatLngBounds(a, b) { - if (a instanceof LatLngBounds) { - return a; - } - return new LatLngBounds(a, b); - } - function LatLng(lat, lng, alt) { - if (isNaN(lat) || isNaN(lng)) { - throw new Error("Invalid LatLng object: (" + lat + ", " + lng + ")"); - } - this.lat = +lat; - this.lng = +lng; - if (alt !== void 0) { - this.alt = +alt; - } - } - LatLng.prototype = { - // @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean - // Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number. - equals: function(obj, maxMargin) { - if (!obj) { - return false; - } - obj = toLatLng(obj); - var margin = Math.max( - Math.abs(this.lat - obj.lat), - Math.abs(this.lng - obj.lng) - ); - return margin <= (maxMargin === void 0 ? 1e-9 : maxMargin); - }, - // @method toString(): String - // Returns a string representation of the point (for debugging purposes). - toString: function(precision) { - return "LatLng(" + formatNum(this.lat, precision) + ", " + formatNum(this.lng, precision) + ")"; - }, - // @method distanceTo(otherLatLng: LatLng): Number - // Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines). - distanceTo: function(other) { - return Earth.distance(this, toLatLng(other)); - }, - // @method wrap(): LatLng - // Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees. - wrap: function() { - return Earth.wrapLatLng(this); - }, - // @method toBounds(sizeInMeters: Number): LatLngBounds - // Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`. - toBounds: function(sizeInMeters) { - var latAccuracy = 180 * sizeInMeters / 40075017, lngAccuracy = latAccuracy / Math.cos(Math.PI / 180 * this.lat); - return toLatLngBounds( - [this.lat - latAccuracy, this.lng - lngAccuracy], - [this.lat + latAccuracy, this.lng + lngAccuracy] - ); - }, - clone: function() { - return new LatLng(this.lat, this.lng, this.alt); - } - }; - function toLatLng(a, b, c) { - if (a instanceof LatLng) { - return a; - } - if (isArray(a) && typeof a[0] !== "object") { - if (a.length === 3) { - return new LatLng(a[0], a[1], a[2]); - } - if (a.length === 2) { - return new LatLng(a[0], a[1]); - } - return null; - } - if (a === void 0 || a === null) { - return a; - } - if (typeof a === "object" && "lat" in a) { - return new LatLng(a.lat, "lng" in a ? a.lng : a.lon, a.alt); - } - if (b === void 0) { - return null; - } - return new LatLng(a, b, c); - } - var CRS = { - // @method latLngToPoint(latlng: LatLng, zoom: Number): Point - // Projects geographical coordinates into pixel coordinates for a given zoom. - latLngToPoint: function(latlng, zoom2) { - var projectedPoint = this.projection.project(latlng), scale2 = this.scale(zoom2); - return this.transformation._transform(projectedPoint, scale2); - }, - // @method pointToLatLng(point: Point, zoom: Number): LatLng - // The inverse of `latLngToPoint`. Projects pixel coordinates on a given - // zoom into geographical coordinates. - pointToLatLng: function(point, zoom2) { - var scale2 = this.scale(zoom2), untransformedPoint = this.transformation.untransform(point, scale2); - return this.projection.unproject(untransformedPoint); - }, - // @method project(latlng: LatLng): Point - // Projects geographical coordinates into coordinates in units accepted for - // this CRS (e.g. meters for EPSG:3857, for passing it to WMS services). - project: function(latlng) { - return this.projection.project(latlng); - }, - // @method unproject(point: Point): LatLng - // Given a projected coordinate returns the corresponding LatLng. - // The inverse of `project`. - unproject: function(point) { - return this.projection.unproject(point); - }, - // @method scale(zoom: Number): Number - // Returns the scale used when transforming projected coordinates into - // pixel coordinates for a particular zoom. For example, it returns - // `256 * 2^zoom` for Mercator-based CRS. - scale: function(zoom2) { - return 256 * Math.pow(2, zoom2); - }, - // @method zoom(scale: Number): Number - // Inverse of `scale()`, returns the zoom level corresponding to a scale - // factor of `scale`. - zoom: function(scale2) { - return Math.log(scale2 / 256) / Math.LN2; - }, - // @method getProjectedBounds(zoom: Number): Bounds - // Returns the projection's bounds scaled and transformed for the provided `zoom`. - getProjectedBounds: function(zoom2) { - if (this.infinite) { - return null; - } - var b = this.projection.bounds, s = this.scale(zoom2), min = this.transformation.transform(b.min, s), max = this.transformation.transform(b.max, s); - return new Bounds(min, max); - }, - // @method distance(latlng1: LatLng, latlng2: LatLng): Number - // Returns the distance between two geographical coordinates. - // @property code: String - // Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`) - // - // @property wrapLng: Number[] - // An array of two numbers defining whether the longitude (horizontal) coordinate - // axis wraps around a given range and how. Defaults to `[-180, 180]` in most - // geographical CRSs. If `undefined`, the longitude axis does not wrap around. - // - // @property wrapLat: Number[] - // Like `wrapLng`, but for the latitude (vertical) axis. - // wrapLng: [min, max], - // wrapLat: [min, max], - // @property infinite: Boolean - // If true, the coordinate space will be unbounded (infinite in both axes) - infinite: false, - // @method wrapLatLng(latlng: LatLng): LatLng - // Returns a `LatLng` where lat and lng has been wrapped according to the - // CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds. - wrapLatLng: function(latlng) { - var lng = this.wrapLng ? wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng, lat = this.wrapLat ? wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat, alt = latlng.alt; - return new LatLng(lat, lng, alt); - }, - // @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds - // Returns a `LatLngBounds` with the same size as the given one, ensuring - // that its center is within the CRS's bounds. - // Only accepts actual `L.LatLngBounds` instances, not arrays. - wrapLatLngBounds: function(bounds) { - var center = bounds.getCenter(), newCenter = this.wrapLatLng(center), latShift = center.lat - newCenter.lat, lngShift = center.lng - newCenter.lng; - if (latShift === 0 && lngShift === 0) { - return bounds; - } - var sw = bounds.getSouthWest(), ne = bounds.getNorthEast(), newSw = new LatLng(sw.lat - latShift, sw.lng - lngShift), newNe = new LatLng(ne.lat - latShift, ne.lng - lngShift); - return new LatLngBounds(newSw, newNe); - } - }; - var Earth = extend({}, CRS, { - wrapLng: [-180, 180], - // Mean Earth Radius, as recommended for use by - // the International Union of Geodesy and Geophysics, - // see https://rosettacode.org/wiki/Haversine_formula - R: 6371e3, - // distance between two geographical points using spherical law of cosines approximation - distance: function(latlng1, latlng2) { - var rad = Math.PI / 180, lat1 = latlng1.lat * rad, lat2 = latlng2.lat * rad, sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2), sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2), a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon, c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); - return this.R * c; - } - }); - var earthRadius = 6378137; - var SphericalMercator = { - R: earthRadius, - MAX_LATITUDE: 85.0511287798, - project: function(latlng) { - var d = Math.PI / 180, max = this.MAX_LATITUDE, lat = Math.max(Math.min(max, latlng.lat), -max), sin = Math.sin(lat * d); - return new Point( - this.R * latlng.lng * d, - this.R * Math.log((1 + sin) / (1 - sin)) / 2 - ); - }, - unproject: function(point) { - var d = 180 / Math.PI; - return new LatLng( - (2 * Math.atan(Math.exp(point.y / this.R)) - Math.PI / 2) * d, - point.x * d / this.R - ); - }, - bounds: (function() { - var d = earthRadius * Math.PI; - return new Bounds([-d, -d], [d, d]); - })() - }; - function Transformation(a, b, c, d) { - if (isArray(a)) { - this._a = a[0]; - this._b = a[1]; - this._c = a[2]; - this._d = a[3]; - return; - } - this._a = a; - this._b = b; - this._c = c; - this._d = d; - } - Transformation.prototype = { - // @method transform(point: Point, scale?: Number): Point - // Returns a transformed point, optionally multiplied by the given scale. - // Only accepts actual `L.Point` instances, not arrays. - transform: function(point, scale2) { - return this._transform(point.clone(), scale2); - }, - // destructive transform (faster) - _transform: function(point, scale2) { - scale2 = scale2 || 1; - point.x = scale2 * (this._a * point.x + this._b); - point.y = scale2 * (this._c * point.y + this._d); - return point; - }, - // @method untransform(point: Point, scale?: Number): Point - // Returns the reverse transformation of the given point, optionally divided - // by the given scale. Only accepts actual `L.Point` instances, not arrays. - untransform: function(point, scale2) { - scale2 = scale2 || 1; - return new Point( - (point.x / scale2 - this._b) / this._a, - (point.y / scale2 - this._d) / this._c - ); - } - }; - function toTransformation(a, b, c, d) { - return new Transformation(a, b, c, d); - } - var EPSG3857 = extend({}, Earth, { - code: "EPSG:3857", - projection: SphericalMercator, - transformation: (function() { - var scale2 = 0.5 / (Math.PI * SphericalMercator.R); - return toTransformation(scale2, 0.5, -scale2, 0.5); - })() - }); - var EPSG900913 = extend({}, EPSG3857, { - code: "EPSG:900913" - }); - function svgCreate(name) { - return document.createElementNS("http://www.w3.org/2000/svg", name); - } - function pointsToPath(rings, closed) { - var str = "", i, j, len, len2, points, p; - for (i = 0, len = rings.length; i < len; i++) { - points = rings[i]; - for (j = 0, len2 = points.length; j < len2; j++) { - p = points[j]; - str += (j ? "L" : "M") + p.x + " " + p.y; - } - str += closed ? Browser.svg ? "z" : "x" : ""; - } - return str || "M0 0"; - } - var style = document.documentElement.style; - var ie = "ActiveXObject" in window; - var ielt9 = ie && !document.addEventListener; - var edge = "msLaunchUri" in navigator && !("documentMode" in document); - var webkit = userAgentContains("webkit"); - var android = userAgentContains("android"); - var android23 = userAgentContains("android 2") || userAgentContains("android 3"); - var webkitVer = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); - var androidStock = android && userAgentContains("Google") && webkitVer < 537 && !("AudioNode" in window); - var opera = !!window.opera; - var chrome = !edge && userAgentContains("chrome"); - var gecko = userAgentContains("gecko") && !webkit && !opera && !ie; - var safari = !chrome && userAgentContains("safari"); - var phantom = userAgentContains("phantom"); - var opera12 = "OTransition" in style; - var win = navigator.platform.indexOf("Win") === 0; - var ie3d = ie && "transition" in style; - var webkit3d = "WebKitCSSMatrix" in window && "m11" in new window.WebKitCSSMatrix() && !android23; - var gecko3d = "MozPerspective" in style; - var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom; - var mobile = typeof orientation !== "undefined" || userAgentContains("mobile"); - var mobileWebkit = mobile && webkit; - var mobileWebkit3d = mobile && webkit3d; - var msPointer = !window.PointerEvent && window.MSPointerEvent; - var pointer = !!(window.PointerEvent || msPointer); - var touchNative = "ontouchstart" in window || !!window.TouchEvent; - var touch = !window.L_NO_TOUCH && (touchNative || pointer); - var mobileOpera = mobile && opera; - var mobileGecko = mobile && gecko; - var retina = (window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI) > 1; - var passiveEvents = (function() { - var supportsPassiveOption = false; - try { - var opts = Object.defineProperty({}, "passive", { - get: function() { - supportsPassiveOption = true; - } - }); - window.addEventListener("testPassiveEventSupport", falseFn, opts); - window.removeEventListener("testPassiveEventSupport", falseFn, opts); - } catch (e) { - } - return supportsPassiveOption; - })(); - var canvas$1 = (function() { - return !!document.createElement("canvas").getContext; - })(); - var svg$1 = !!(document.createElementNS && svgCreate("svg").createSVGRect); - var inlineSvg = !!svg$1 && (function() { - var div = document.createElement("div"); - div.innerHTML = ""; - return (div.firstChild && div.firstChild.namespaceURI) === "http://www.w3.org/2000/svg"; - })(); - var vml = !svg$1 && (function() { - try { - var div = document.createElement("div"); - div.innerHTML = ''; - var shape = div.firstChild; - shape.style.behavior = "url(#default#VML)"; - return shape && typeof shape.adj === "object"; - } catch (e) { - return false; - } - })(); - var mac = navigator.platform.indexOf("Mac") === 0; - var linux = navigator.platform.indexOf("Linux") === 0; - function userAgentContains(str) { - return navigator.userAgent.toLowerCase().indexOf(str) >= 0; - } - var Browser = { - ie, - ielt9, - edge, - webkit, - android, - android23, - androidStock, - opera, - chrome, - gecko, - safari, - phantom, - opera12, - win, - ie3d, - webkit3d, - gecko3d, - any3d, - mobile, - mobileWebkit, - mobileWebkit3d, - msPointer, - pointer, - touch, - touchNative, - mobileOpera, - mobileGecko, - retina, - passiveEvents, - canvas: canvas$1, - svg: svg$1, - vml, - inlineSvg, - mac, - linux - }; - var POINTER_DOWN = Browser.msPointer ? "MSPointerDown" : "pointerdown"; - var POINTER_MOVE = Browser.msPointer ? "MSPointerMove" : "pointermove"; - var POINTER_UP = Browser.msPointer ? "MSPointerUp" : "pointerup"; - var POINTER_CANCEL = Browser.msPointer ? "MSPointerCancel" : "pointercancel"; - var pEvent = { - touchstart: POINTER_DOWN, - touchmove: POINTER_MOVE, - touchend: POINTER_UP, - touchcancel: POINTER_CANCEL - }; - var handle = { - touchstart: _onPointerStart, - touchmove: _handlePointer, - touchend: _handlePointer, - touchcancel: _handlePointer - }; - var _pointers = {}; - var _pointerDocListener = false; - function addPointerListener(obj, type, handler) { - if (type === "touchstart") { - _addPointerDocListener(); - } - if (!handle[type]) { - console.warn("wrong event specified:", type); - return falseFn; - } - handler = handle[type].bind(this, handler); - obj.addEventListener(pEvent[type], handler, false); - return handler; - } - function removePointerListener(obj, type, handler) { - if (!pEvent[type]) { - console.warn("wrong event specified:", type); - return; - } - obj.removeEventListener(pEvent[type], handler, false); - } - function _globalPointerDown(e) { - _pointers[e.pointerId] = e; - } - function _globalPointerMove(e) { - if (_pointers[e.pointerId]) { - _pointers[e.pointerId] = e; - } - } - function _globalPointerUp(e) { - delete _pointers[e.pointerId]; - } - function _addPointerDocListener() { - if (!_pointerDocListener) { - document.addEventListener(POINTER_DOWN, _globalPointerDown, true); - document.addEventListener(POINTER_MOVE, _globalPointerMove, true); - document.addEventListener(POINTER_UP, _globalPointerUp, true); - document.addEventListener(POINTER_CANCEL, _globalPointerUp, true); - _pointerDocListener = true; - } - } - function _handlePointer(handler, e) { - if (e.pointerType === (e.MSPOINTER_TYPE_MOUSE || "mouse")) { - return; - } - e.touches = []; - for (var i in _pointers) { - e.touches.push(_pointers[i]); - } - e.changedTouches = [e]; - handler(e); - } - function _onPointerStart(handler, e) { - if (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) { - preventDefault(e); - } - _handlePointer(handler, e); - } - function makeDblclick(event) { - var newEvent = {}, prop, i; - for (i in event) { - prop = event[i]; - newEvent[i] = prop && prop.bind ? prop.bind(event) : prop; - } - event = newEvent; - newEvent.type = "dblclick"; - newEvent.detail = 2; - newEvent.isTrusted = false; - newEvent._simulated = true; - return newEvent; - } - var delay = 200; - function addDoubleTapListener(obj, handler) { - obj.addEventListener("dblclick", handler); - var last = 0, detail; - function simDblclick(e) { - if (e.detail !== 1) { - detail = e.detail; - return; - } - if (e.pointerType === "mouse" || e.sourceCapabilities && !e.sourceCapabilities.firesTouchEvents) { - return; - } - var path = getPropagationPath(e); - if (path.some(function(el) { - return el instanceof HTMLLabelElement && el.attributes.for; - }) && !path.some(function(el) { - return el instanceof HTMLInputElement || el instanceof HTMLSelectElement; - })) { - return; - } - var now = Date.now(); - if (now - last <= delay) { - detail++; - if (detail === 2) { - handler(makeDblclick(e)); - } - } else { - detail = 1; - } - last = now; - } - obj.addEventListener("click", simDblclick); - return { - dblclick: handler, - simDblclick - }; - } - function removeDoubleTapListener(obj, handlers) { - obj.removeEventListener("dblclick", handlers.dblclick); - obj.removeEventListener("click", handlers.simDblclick); - } - var TRANSFORM = testProp( - ["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"] - ); - var TRANSITION = testProp( - ["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"] - ); - var TRANSITION_END = TRANSITION === "webkitTransition" || TRANSITION === "OTransition" ? TRANSITION + "End" : "transitionend"; - function get(id) { - return typeof id === "string" ? document.getElementById(id) : id; - } - function getStyle(el, style2) { - var value = el.style[style2] || el.currentStyle && el.currentStyle[style2]; - if ((!value || value === "auto") && document.defaultView) { - var css = document.defaultView.getComputedStyle(el, null); - value = css ? css[style2] : null; - } - return value === "auto" ? null : value; - } - function create$1(tagName, className, container) { - var el = document.createElement(tagName); - el.className = className || ""; - if (container) { - container.appendChild(el); - } - return el; - } - function remove(el) { - var parent = el.parentNode; - if (parent) { - parent.removeChild(el); - } - } - function empty(el) { - while (el.firstChild) { - el.removeChild(el.firstChild); - } - } - function toFront(el) { - var parent = el.parentNode; - if (parent && parent.lastChild !== el) { - parent.appendChild(el); - } - } - function toBack(el) { - var parent = el.parentNode; - if (parent && parent.firstChild !== el) { - parent.insertBefore(el, parent.firstChild); - } - } - function hasClass(el, name) { - if (el.classList !== void 0) { - return el.classList.contains(name); - } - var className = getClass(el); - return className.length > 0 && new RegExp("(^|\\s)" + name + "(\\s|$)").test(className); - } - function addClass(el, name) { - if (el.classList !== void 0) { - var classes = splitWords(name); - for (var i = 0, len = classes.length; i < len; i++) { - el.classList.add(classes[i]); - } - } else if (!hasClass(el, name)) { - var className = getClass(el); - setClass(el, (className ? className + " " : "") + name); - } - } - function removeClass(el, name) { - if (el.classList !== void 0) { - el.classList.remove(name); - } else { - setClass(el, trim((" " + getClass(el) + " ").replace(" " + name + " ", " "))); - } - } - function setClass(el, name) { - if (el.className.baseVal === void 0) { - el.className = name; - } else { - el.className.baseVal = name; - } - } - function getClass(el) { - if (el.correspondingElement) { - el = el.correspondingElement; - } - return el.className.baseVal === void 0 ? el.className : el.className.baseVal; - } - function setOpacity(el, value) { - if ("opacity" in el.style) { - el.style.opacity = value; - } else if ("filter" in el.style) { - _setOpacityIE(el, value); - } - } - function _setOpacityIE(el, value) { - var filter = false, filterName = "DXImageTransform.Microsoft.Alpha"; - try { - filter = el.filters.item(filterName); - } catch (e) { - if (value === 1) { - return; - } - } - value = Math.round(value * 100); - if (filter) { - filter.Enabled = value !== 100; - filter.Opacity = value; - } else { - el.style.filter += " progid:" + filterName + "(opacity=" + value + ")"; - } - } - function testProp(props) { - var style2 = document.documentElement.style; - for (var i = 0; i < props.length; i++) { - if (props[i] in style2) { - return props[i]; - } - } - return false; - } - function setTransform(el, offset, scale2) { - var pos = offset || new Point(0, 0); - el.style[TRANSFORM] = (Browser.ie3d ? "translate(" + pos.x + "px," + pos.y + "px)" : "translate3d(" + pos.x + "px," + pos.y + "px,0)") + (scale2 ? " scale(" + scale2 + ")" : ""); - } - function setPosition(el, point) { - el._leaflet_pos = point; - if (Browser.any3d) { - setTransform(el, point); - } else { - el.style.left = point.x + "px"; - el.style.top = point.y + "px"; - } - } - function getPosition(el) { - return el._leaflet_pos || new Point(0, 0); - } - var disableTextSelection; - var enableTextSelection; - var _userSelect; - if ("onselectstart" in document) { - disableTextSelection = function() { - on(window, "selectstart", preventDefault); - }; - enableTextSelection = function() { - off(window, "selectstart", preventDefault); - }; - } else { - var userSelectProperty = testProp( - ["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"] - ); - disableTextSelection = function() { - if (userSelectProperty) { - var style2 = document.documentElement.style; - _userSelect = style2[userSelectProperty]; - style2[userSelectProperty] = "none"; - } - }; - enableTextSelection = function() { - if (userSelectProperty) { - document.documentElement.style[userSelectProperty] = _userSelect; - _userSelect = void 0; - } - }; - } - function disableImageDrag() { - on(window, "dragstart", preventDefault); - } - function enableImageDrag() { - off(window, "dragstart", preventDefault); - } - var _outlineElement, _outlineStyle; - function preventOutline(element) { - while (element.tabIndex === -1) { - element = element.parentNode; - } - if (!element.style) { - return; - } - restoreOutline(); - _outlineElement = element; - _outlineStyle = element.style.outlineStyle; - element.style.outlineStyle = "none"; - on(window, "keydown", restoreOutline); - } - function restoreOutline() { - if (!_outlineElement) { - return; - } - _outlineElement.style.outlineStyle = _outlineStyle; - _outlineElement = void 0; - _outlineStyle = void 0; - off(window, "keydown", restoreOutline); - } - function getSizedParentNode(element) { - do { - element = element.parentNode; - } while ((!element.offsetWidth || !element.offsetHeight) && element !== document.body); - return element; - } - function getScale(element) { - var rect = element.getBoundingClientRect(); - return { - x: rect.width / element.offsetWidth || 1, - y: rect.height / element.offsetHeight || 1, - boundingClientRect: rect - }; - } - var DomUtil = { - __proto__: null, - TRANSFORM, - TRANSITION, - TRANSITION_END, - get, - getStyle, - create: create$1, - remove, - empty, - toFront, - toBack, - hasClass, - addClass, - removeClass, - setClass, - getClass, - setOpacity, - testProp, - setTransform, - setPosition, - getPosition, - get disableTextSelection() { - return disableTextSelection; - }, - get enableTextSelection() { - return enableTextSelection; - }, - disableImageDrag, - enableImageDrag, - preventOutline, - restoreOutline, - getSizedParentNode, - getScale - }; - function on(obj, types, fn, context) { - if (types && typeof types === "object") { - for (var type in types) { - addOne(obj, type, types[type], fn); - } - } else { - types = splitWords(types); - for (var i = 0, len = types.length; i < len; i++) { - addOne(obj, types[i], fn, context); - } - } - return this; - } - var eventsKey = "_leaflet_events"; - function off(obj, types, fn, context) { - if (arguments.length === 1) { - batchRemove(obj); - delete obj[eventsKey]; - } else if (types && typeof types === "object") { - for (var type in types) { - removeOne(obj, type, types[type], fn); - } - } else { - types = splitWords(types); - if (arguments.length === 2) { - batchRemove(obj, function(type2) { - return indexOf(types, type2) !== -1; - }); - } else { - for (var i = 0, len = types.length; i < len; i++) { - removeOne(obj, types[i], fn, context); - } - } - } - return this; - } - function batchRemove(obj, filterFn) { - for (var id in obj[eventsKey]) { - var type = id.split(/\d/)[0]; - if (!filterFn || filterFn(type)) { - removeOne(obj, type, null, null, id); - } - } - } - var mouseSubst = { - mouseenter: "mouseover", - mouseleave: "mouseout", - wheel: !("onwheel" in window) && "mousewheel" - }; - function addOne(obj, type, fn, context) { - var id = type + stamp(fn) + (context ? "_" + stamp(context) : ""); - if (obj[eventsKey] && obj[eventsKey][id]) { - return this; - } - var handler = function(e) { - return fn.call(context || obj, e || window.event); - }; - var originalHandler = handler; - if (!Browser.touchNative && Browser.pointer && type.indexOf("touch") === 0) { - handler = addPointerListener(obj, type, handler); - } else if (Browser.touch && type === "dblclick") { - handler = addDoubleTapListener(obj, handler); - } else if ("addEventListener" in obj) { - if (type === "touchstart" || type === "touchmove" || type === "wheel" || type === "mousewheel") { - obj.addEventListener(mouseSubst[type] || type, handler, Browser.passiveEvents ? { passive: false } : false); - } else if (type === "mouseenter" || type === "mouseleave") { - handler = function(e) { - e = e || window.event; - if (isExternalTarget(obj, e)) { - originalHandler(e); - } - }; - obj.addEventListener(mouseSubst[type], handler, false); - } else { - obj.addEventListener(type, originalHandler, false); - } - } else { - obj.attachEvent("on" + type, handler); - } - obj[eventsKey] = obj[eventsKey] || {}; - obj[eventsKey][id] = handler; - } - function removeOne(obj, type, fn, context, id) { - id = id || type + stamp(fn) + (context ? "_" + stamp(context) : ""); - var handler = obj[eventsKey] && obj[eventsKey][id]; - if (!handler) { - return this; - } - if (!Browser.touchNative && Browser.pointer && type.indexOf("touch") === 0) { - removePointerListener(obj, type, handler); - } else if (Browser.touch && type === "dblclick") { - removeDoubleTapListener(obj, handler); - } else if ("removeEventListener" in obj) { - obj.removeEventListener(mouseSubst[type] || type, handler, false); - } else { - obj.detachEvent("on" + type, handler); - } - obj[eventsKey][id] = null; - } - function stopPropagation(e) { - if (e.stopPropagation) { - e.stopPropagation(); - } else if (e.originalEvent) { - e.originalEvent._stopped = true; - } else { - e.cancelBubble = true; - } - return this; - } - function disableScrollPropagation(el) { - addOne(el, "wheel", stopPropagation); - return this; - } - function disableClickPropagation(el) { - on(el, "mousedown touchstart dblclick contextmenu", stopPropagation); - el["_leaflet_disable_click"] = true; - return this; - } - function preventDefault(e) { - if (e.preventDefault) { - e.preventDefault(); - } else { - e.returnValue = false; - } - return this; - } - function stop(e) { - preventDefault(e); - stopPropagation(e); - return this; - } - function getPropagationPath(ev) { - if (ev.composedPath) { - return ev.composedPath(); - } - var path = []; - var el = ev.target; - while (el) { - path.push(el); - el = el.parentNode; - } - return path; - } - function getMousePosition(e, container) { - if (!container) { - return new Point(e.clientX, e.clientY); - } - var scale2 = getScale(container), offset = scale2.boundingClientRect; - return new Point( - // offset.left/top values are in page scale (like clientX/Y), - // whereas clientLeft/Top (border width) values are the original values (before CSS scale applies). - (e.clientX - offset.left) / scale2.x - container.clientLeft, - (e.clientY - offset.top) / scale2.y - container.clientTop - ); - } - var wheelPxFactor = Browser.linux && Browser.chrome ? window.devicePixelRatio : Browser.mac ? window.devicePixelRatio * 3 : window.devicePixelRatio > 0 ? 2 * window.devicePixelRatio : 1; - function getWheelDelta(e) { - return Browser.edge ? e.wheelDeltaY / 2 : ( - // Don't trust window-geometry-based delta - e.deltaY && e.deltaMode === 0 ? -e.deltaY / wheelPxFactor : ( - // Pixels - e.deltaY && e.deltaMode === 1 ? -e.deltaY * 20 : ( - // Lines - e.deltaY && e.deltaMode === 2 ? -e.deltaY * 60 : ( - // Pages - e.deltaX || e.deltaZ ? 0 : ( - // Skip horizontal/depth wheel events - e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : ( - // Legacy IE pixels - e.detail && Math.abs(e.detail) < 32765 ? -e.detail * 20 : ( - // Legacy Moz lines - e.detail ? e.detail / -32765 * 60 : ( - // Legacy Moz pages - 0 - ) - ) - ) - ) - ) - ) - ) - ); - } - function isExternalTarget(el, e) { - var related = e.relatedTarget; - if (!related) { - return true; - } - try { - while (related && related !== el) { - related = related.parentNode; - } - } catch (err) { - return false; - } - return related !== el; - } - var DomEvent = { - __proto__: null, - on, - off, - stopPropagation, - disableScrollPropagation, - disableClickPropagation, - preventDefault, - stop, - getPropagationPath, - getMousePosition, - getWheelDelta, - isExternalTarget, - addListener: on, - removeListener: off - }; - var PosAnimation = Evented.extend({ - // @method run(el: HTMLElement, newPos: Point, duration?: Number, easeLinearity?: Number) - // Run an animation of a given element to a new position, optionally setting - // duration in seconds (`0.25` by default) and easing linearity factor (3rd - // argument of the [cubic bezier curve](https://cubic-bezier.com/#0,0,.5,1), - // `0.5` by default). - run: function(el, newPos, duration, easeLinearity) { - this.stop(); - this._el = el; - this._inProgress = true; - this._duration = duration || 0.25; - this._easeOutPower = 1 / Math.max(easeLinearity || 0.5, 0.2); - this._startPos = getPosition(el); - this._offset = newPos.subtract(this._startPos); - this._startTime = +/* @__PURE__ */ new Date(); - this.fire("start"); - this._animate(); - }, - // @method stop() - // Stops the animation (if currently running). - stop: function() { - if (!this._inProgress) { - return; - } - this._step(true); - this._complete(); - }, - _animate: function() { - this._animId = requestAnimFrame(this._animate, this); - this._step(); - }, - _step: function(round) { - var elapsed = +/* @__PURE__ */ new Date() - this._startTime, duration = this._duration * 1e3; - if (elapsed < duration) { - this._runFrame(this._easeOut(elapsed / duration), round); - } else { - this._runFrame(1); - this._complete(); - } - }, - _runFrame: function(progress, round) { - var pos = this._startPos.add(this._offset.multiplyBy(progress)); - if (round) { - pos._round(); - } - setPosition(this._el, pos); - this.fire("step"); - }, - _complete: function() { - cancelAnimFrame(this._animId); - this._inProgress = false; - this.fire("end"); - }, - _easeOut: function(t) { - return 1 - Math.pow(1 - t, this._easeOutPower); - } - }); - var Map = Evented.extend({ - options: { - // @section Map State Options - // @option crs: CRS = L.CRS.EPSG3857 - // The [Coordinate Reference System](#crs) to use. Don't change this if you're not - // sure what it means. - crs: EPSG3857, - // @option center: LatLng = undefined - // Initial geographic center of the map - center: void 0, - // @option zoom: Number = undefined - // Initial map zoom level - zoom: void 0, - // @option minZoom: Number = * - // Minimum zoom level of the map. - // If not specified and at least one `GridLayer` or `TileLayer` is in the map, - // the lowest of their `minZoom` options will be used instead. - minZoom: void 0, - // @option maxZoom: Number = * - // Maximum zoom level of the map. - // If not specified and at least one `GridLayer` or `TileLayer` is in the map, - // the highest of their `maxZoom` options will be used instead. - maxZoom: void 0, - // @option layers: Layer[] = [] - // Array of layers that will be added to the map initially - layers: [], - // @option maxBounds: LatLngBounds = null - // When this option is set, the map restricts the view to the given - // geographical bounds, bouncing the user back if the user tries to pan - // outside the view. To set the restriction dynamically, use - // [`setMaxBounds`](#map-setmaxbounds) method. - maxBounds: void 0, - // @option renderer: Renderer = * - // The default method for drawing vector layers on the map. `L.SVG` - // or `L.Canvas` by default depending on browser support. - renderer: void 0, - // @section Animation Options - // @option zoomAnimation: Boolean = true - // Whether the map zoom animation is enabled. By default it's enabled - // in all browsers that support CSS3 Transitions except Android. - zoomAnimation: true, - // @option zoomAnimationThreshold: Number = 4 - // Won't animate zoom if the zoom difference exceeds this value. - zoomAnimationThreshold: 4, - // @option fadeAnimation: Boolean = true - // Whether the tile fade animation is enabled. By default it's enabled - // in all browsers that support CSS3 Transitions except Android. - fadeAnimation: true, - // @option markerZoomAnimation: Boolean = true - // Whether markers animate their zoom with the zoom animation, if disabled - // they will disappear for the length of the animation. By default it's - // enabled in all browsers that support CSS3 Transitions except Android. - markerZoomAnimation: true, - // @option transform3DLimit: Number = 2^23 - // Defines the maximum size of a CSS translation transform. The default - // value should not be changed unless a web browser positions layers in - // the wrong place after doing a large `panBy`. - transform3DLimit: 8388608, - // Precision limit of a 32-bit float - // @section Interaction Options - // @option zoomSnap: Number = 1 - // Forces the map's zoom level to always be a multiple of this, particularly - // right after a [`fitBounds()`](#map-fitbounds) or a pinch-zoom. - // By default, the zoom level snaps to the nearest integer; lower values - // (e.g. `0.5` or `0.1`) allow for greater granularity. A value of `0` - // means the zoom level will not be snapped after `fitBounds` or a pinch-zoom. - zoomSnap: 1, - // @option zoomDelta: Number = 1 - // Controls how much the map's zoom level will change after a - // [`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+` - // or `-` on the keyboard, or using the [zoom controls](#control-zoom). - // Values smaller than `1` (e.g. `0.5`) allow for greater granularity. - zoomDelta: 1, - // @option trackResize: Boolean = true - // Whether the map automatically handles browser window resize to update itself. - trackResize: true - }, - initialize: function(id, options) { - options = setOptions(this, options); - this._handlers = []; - this._layers = {}; - this._zoomBoundLayers = {}; - this._sizeChanged = true; - this._initContainer(id); - this._initLayout(); - this._onResize = bind(this._onResize, this); - this._initEvents(); - if (options.maxBounds) { - this.setMaxBounds(options.maxBounds); - } - if (options.zoom !== void 0) { - this._zoom = this._limitZoom(options.zoom); - } - if (options.center && options.zoom !== void 0) { - this.setView(toLatLng(options.center), options.zoom, { reset: true }); - } - this.callInitHooks(); - this._zoomAnimated = TRANSITION && Browser.any3d && !Browser.mobileOpera && this.options.zoomAnimation; - if (this._zoomAnimated) { - this._createAnimProxy(); - on(this._proxy, TRANSITION_END, this._catchTransitionEnd, this); - } - this._addLayers(this.options.layers); - }, - // @section Methods for modifying map state - // @method setView(center: LatLng, zoom: Number, options?: Zoom/pan options): this - // Sets the view of the map (geographical center and zoom) with the given - // animation options. - setView: function(center, zoom2, options) { - zoom2 = zoom2 === void 0 ? this._zoom : this._limitZoom(zoom2); - center = this._limitCenter(toLatLng(center), zoom2, this.options.maxBounds); - options = options || {}; - this._stop(); - if (this._loaded && !options.reset && options !== true) { - if (options.animate !== void 0) { - options.zoom = extend({ animate: options.animate }, options.zoom); - options.pan = extend({ animate: options.animate, duration: options.duration }, options.pan); - } - var moved = this._zoom !== zoom2 ? this._tryAnimatedZoom && this._tryAnimatedZoom(center, zoom2, options.zoom) : this._tryAnimatedPan(center, options.pan); - if (moved) { - clearTimeout(this._sizeTimer); - return this; - } - } - this._resetView(center, zoom2, options.pan && options.pan.noMoveStart); - return this; - }, - // @method setZoom(zoom: Number, options?: Zoom/pan options): this - // Sets the zoom of the map. - setZoom: function(zoom2, options) { - if (!this._loaded) { - this._zoom = zoom2; - return this; - } - return this.setView(this.getCenter(), zoom2, { zoom: options }); - }, - // @method zoomIn(delta?: Number, options?: Zoom options): this - // Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default). - zoomIn: function(delta, options) { - delta = delta || (Browser.any3d ? this.options.zoomDelta : 1); - return this.setZoom(this._zoom + delta, options); - }, - // @method zoomOut(delta?: Number, options?: Zoom options): this - // Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default). - zoomOut: function(delta, options) { - delta = delta || (Browser.any3d ? this.options.zoomDelta : 1); - return this.setZoom(this._zoom - delta, options); - }, - // @method setZoomAround(latlng: LatLng, zoom: Number, options: Zoom options): this - // Zooms the map while keeping a specified geographical point on the map - // stationary (e.g. used internally for scroll zoom and double-click zoom). - // @alternative - // @method setZoomAround(offset: Point, zoom: Number, options: Zoom options): this - // Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary. - setZoomAround: function(latlng, zoom2, options) { - var scale2 = this.getZoomScale(zoom2), viewHalf = this.getSize().divideBy(2), containerPoint = latlng instanceof Point ? latlng : this.latLngToContainerPoint(latlng), centerOffset = containerPoint.subtract(viewHalf).multiplyBy(1 - 1 / scale2), newCenter = this.containerPointToLatLng(viewHalf.add(centerOffset)); - return this.setView(newCenter, zoom2, { zoom: options }); - }, - _getBoundsCenterZoom: function(bounds, options) { - options = options || {}; - bounds = bounds.getBounds ? bounds.getBounds() : toLatLngBounds(bounds); - var paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]), paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]), zoom2 = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR)); - zoom2 = typeof options.maxZoom === "number" ? Math.min(options.maxZoom, zoom2) : zoom2; - if (zoom2 === Infinity) { - return { - center: bounds.getCenter(), - zoom: zoom2 - }; - } - var paddingOffset = paddingBR.subtract(paddingTL).divideBy(2), swPoint = this.project(bounds.getSouthWest(), zoom2), nePoint = this.project(bounds.getNorthEast(), zoom2), center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom2); - return { - center, - zoom: zoom2 - }; - }, - // @method fitBounds(bounds: LatLngBounds, options?: fitBounds options): this - // Sets a map view that contains the given geographical bounds with the - // maximum zoom level possible. - fitBounds: function(bounds, options) { - bounds = toLatLngBounds(bounds); - if (!bounds.isValid()) { - throw new Error("Bounds are not valid."); - } - var target = this._getBoundsCenterZoom(bounds, options); - return this.setView(target.center, target.zoom, options); - }, - // @method fitWorld(options?: fitBounds options): this - // Sets a map view that mostly contains the whole world with the maximum - // zoom level possible. - fitWorld: function(options) { - return this.fitBounds([[-90, -180], [90, 180]], options); - }, - // @method panTo(latlng: LatLng, options?: Pan options): this - // Pans the map to a given center. - panTo: function(center, options) { - return this.setView(center, this._zoom, { pan: options }); - }, - // @method panBy(offset: Point, options?: Pan options): this - // Pans the map by a given number of pixels (animated). - panBy: function(offset, options) { - offset = toPoint(offset).round(); - options = options || {}; - if (!offset.x && !offset.y) { - return this.fire("moveend"); - } - if (options.animate !== true && !this.getSize().contains(offset)) { - this._resetView(this.unproject(this.project(this.getCenter()).add(offset)), this.getZoom()); - return this; - } - if (!this._panAnim) { - this._panAnim = new PosAnimation(); - this._panAnim.on({ - "step": this._onPanTransitionStep, - "end": this._onPanTransitionEnd - }, this); - } - if (!options.noMoveStart) { - this.fire("movestart"); - } - if (options.animate !== false) { - addClass(this._mapPane, "leaflet-pan-anim"); - var newPos = this._getMapPanePos().subtract(offset).round(); - this._panAnim.run(this._mapPane, newPos, options.duration || 0.25, options.easeLinearity); - } else { - this._rawPanBy(offset); - this.fire("move").fire("moveend"); - } - return this; - }, - // @method flyTo(latlng: LatLng, zoom?: Number, options?: Zoom/pan options): this - // Sets the view of the map (geographical center and zoom) performing a smooth - // pan-zoom animation. - flyTo: function(targetCenter, targetZoom, options) { - options = options || {}; - if (options.animate === false || !Browser.any3d) { - return this.setView(targetCenter, targetZoom, options); - } - this._stop(); - var from = this.project(this.getCenter()), to = this.project(targetCenter), size = this.getSize(), startZoom = this._zoom; - targetCenter = toLatLng(targetCenter); - targetZoom = targetZoom === void 0 ? startZoom : targetZoom; - var w0 = Math.max(size.x, size.y), w1 = w0 * this.getZoomScale(startZoom, targetZoom), u1 = to.distanceTo(from) || 1, rho = 1.42, rho2 = rho * rho; - function r(i) { - var s1 = i ? -1 : 1, s2 = i ? w1 : w0, t1 = w1 * w1 - w0 * w0 + s1 * rho2 * rho2 * u1 * u1, b1 = 2 * s2 * rho2 * u1, b = t1 / b1, sq = Math.sqrt(b * b + 1) - b; - var log = sq < 1e-9 ? -18 : Math.log(sq); - return log; - } - function sinh(n) { - return (Math.exp(n) - Math.exp(-n)) / 2; - } - function cosh(n) { - return (Math.exp(n) + Math.exp(-n)) / 2; - } - function tanh(n) { - return sinh(n) / cosh(n); - } - var r0 = r(0); - function w(s) { - return w0 * (cosh(r0) / cosh(r0 + rho * s)); - } - function u(s) { - return w0 * (cosh(r0) * tanh(r0 + rho * s) - sinh(r0)) / rho2; - } - function easeOut(t) { - return 1 - Math.pow(1 - t, 1.5); - } - var start = Date.now(), S = (r(1) - r0) / rho, duration = options.duration ? 1e3 * options.duration : 1e3 * S * 0.8; - function frame() { - var t = (Date.now() - start) / duration, s = easeOut(t) * S; - if (t <= 1) { - this._flyToFrame = requestAnimFrame(frame, this); - this._move( - this.unproject(from.add(to.subtract(from).multiplyBy(u(s) / u1)), startZoom), - this.getScaleZoom(w0 / w(s), startZoom), - { flyTo: true } - ); - } else { - this._move(targetCenter, targetZoom)._moveEnd(true); - } - } - this._moveStart(true, options.noMoveStart); - frame.call(this); - return this; - }, - // @method flyToBounds(bounds: LatLngBounds, options?: fitBounds options): this - // Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto), - // but takes a bounds parameter like [`fitBounds`](#map-fitbounds). - flyToBounds: function(bounds, options) { - var target = this._getBoundsCenterZoom(bounds, options); - return this.flyTo(target.center, target.zoom, options); - }, - // @method setMaxBounds(bounds: LatLngBounds): this - // Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option). - setMaxBounds: function(bounds) { - bounds = toLatLngBounds(bounds); - if (this.listens("moveend", this._panInsideMaxBounds)) { - this.off("moveend", this._panInsideMaxBounds); - } - if (!bounds.isValid()) { - this.options.maxBounds = null; - return this; - } - this.options.maxBounds = bounds; - if (this._loaded) { - this._panInsideMaxBounds(); - } - return this.on("moveend", this._panInsideMaxBounds); - }, - // @method setMinZoom(zoom: Number): this - // Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option). - setMinZoom: function(zoom2) { - var oldZoom = this.options.minZoom; - this.options.minZoom = zoom2; - if (this._loaded && oldZoom !== zoom2) { - this.fire("zoomlevelschange"); - if (this.getZoom() < this.options.minZoom) { - return this.setZoom(zoom2); - } - } - return this; - }, - // @method setMaxZoom(zoom: Number): this - // Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option). - setMaxZoom: function(zoom2) { - var oldZoom = this.options.maxZoom; - this.options.maxZoom = zoom2; - if (this._loaded && oldZoom !== zoom2) { - this.fire("zoomlevelschange"); - if (this.getZoom() > this.options.maxZoom) { - return this.setZoom(zoom2); - } - } - return this; - }, - // @method panInsideBounds(bounds: LatLngBounds, options?: Pan options): this - // Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any. - panInsideBounds: function(bounds, options) { - this._enforcingBounds = true; - var center = this.getCenter(), newCenter = this._limitCenter(center, this._zoom, toLatLngBounds(bounds)); - if (!center.equals(newCenter)) { - this.panTo(newCenter, options); - } - this._enforcingBounds = false; - return this; - }, - // @method panInside(latlng: LatLng, options?: padding options): this - // Pans the map the minimum amount to make the `latlng` visible. Use - // padding options to fit the display to more restricted bounds. - // If `latlng` is already within the (optionally padded) display bounds, - // the map will not be panned. - panInside: function(latlng, options) { - options = options || {}; - var paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]), paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]), pixelCenter = this.project(this.getCenter()), pixelPoint = this.project(latlng), pixelBounds = this.getPixelBounds(), paddedBounds = toBounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]), paddedSize = paddedBounds.getSize(); - if (!paddedBounds.contains(pixelPoint)) { - this._enforcingBounds = true; - var centerOffset = pixelPoint.subtract(paddedBounds.getCenter()); - var offset = paddedBounds.extend(pixelPoint).getSize().subtract(paddedSize); - pixelCenter.x += centerOffset.x < 0 ? -offset.x : offset.x; - pixelCenter.y += centerOffset.y < 0 ? -offset.y : offset.y; - this.panTo(this.unproject(pixelCenter), options); - this._enforcingBounds = false; - } - return this; - }, - // @method invalidateSize(options: Zoom/pan options): this - // Checks if the map container size changed and updates the map if so — - // call it after you've changed the map size dynamically, also animating - // pan by default. If `options.pan` is `false`, panning will not occur. - // If `options.debounceMoveend` is `true`, it will delay `moveend` event so - // that it doesn't happen often even if the method is called many - // times in a row. - // @alternative - // @method invalidateSize(animate: Boolean): this - // Checks if the map container size changed and updates the map if so — - // call it after you've changed the map size dynamically, also animating - // pan by default. - invalidateSize: function(options) { - if (!this._loaded) { - return this; - } - options = extend({ - animate: false, - pan: true - }, options === true ? { animate: true } : options); - var oldSize = this.getSize(); - this._sizeChanged = true; - this._lastCenter = null; - var newSize = this.getSize(), oldCenter = oldSize.divideBy(2).round(), newCenter = newSize.divideBy(2).round(), offset = oldCenter.subtract(newCenter); - if (!offset.x && !offset.y) { - return this; - } - if (options.animate && options.pan) { - this.panBy(offset); - } else { - if (options.pan) { - this._rawPanBy(offset); - } - this.fire("move"); - if (options.debounceMoveend) { - clearTimeout(this._sizeTimer); - this._sizeTimer = setTimeout(bind(this.fire, this, "moveend"), 200); - } else { - this.fire("moveend"); - } - } - return this.fire("resize", { - oldSize, - newSize - }); - }, - // @section Methods for modifying map state - // @method stop(): this - // Stops the currently running `panTo` or `flyTo` animation, if any. - stop: function() { - this.setZoom(this._limitZoom(this._zoom)); - if (!this.options.zoomSnap) { - this.fire("viewreset"); - } - return this._stop(); - }, - // @section Geolocation methods - // @method locate(options?: Locate options): this - // Tries to locate the user using the Geolocation API, firing a [`locationfound`](#map-locationfound) - // event with location data on success or a [`locationerror`](#map-locationerror) event on failure, - // and optionally sets the map view to the user's location with respect to - // detection accuracy (or to the world view if geolocation failed). - // Note that, if your page doesn't use HTTPS, this method will fail in - // modern browsers ([Chrome 50 and newer](https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins)) - // See `Locate options` for more details. - locate: function(options) { - options = this._locateOptions = extend({ - timeout: 1e4, - watch: false - // setView: false - // maxZoom: - // maximumAge: 0 - // enableHighAccuracy: false - }, options); - if (!("geolocation" in navigator)) { - this._handleGeolocationError({ - code: 0, - message: "Geolocation not supported." - }); - return this; - } - var onResponse = bind(this._handleGeolocationResponse, this), onError = bind(this._handleGeolocationError, this); - if (options.watch) { - this._locationWatchId = navigator.geolocation.watchPosition(onResponse, onError, options); - } else { - navigator.geolocation.getCurrentPosition(onResponse, onError, options); - } - return this; - }, - // @method stopLocate(): this - // Stops watching location previously initiated by `map.locate({watch: true})` - // and aborts resetting the map view if map.locate was called with - // `{setView: true}`. - stopLocate: function() { - if (navigator.geolocation && navigator.geolocation.clearWatch) { - navigator.geolocation.clearWatch(this._locationWatchId); - } - if (this._locateOptions) { - this._locateOptions.setView = false; - } - return this; - }, - _handleGeolocationError: function(error) { - if (!this._container._leaflet_id) { - return; - } - var c = error.code, message = error.message || (c === 1 ? "permission denied" : c === 2 ? "position unavailable" : "timeout"); - if (this._locateOptions.setView && !this._loaded) { - this.fitWorld(); - } - this.fire("locationerror", { - code: c, - message: "Geolocation error: " + message + "." - }); - }, - _handleGeolocationResponse: function(pos) { - if (!this._container._leaflet_id) { - return; - } - var lat = pos.coords.latitude, lng = pos.coords.longitude, latlng = new LatLng(lat, lng), bounds = latlng.toBounds(pos.coords.accuracy * 2), options = this._locateOptions; - if (options.setView) { - var zoom2 = this.getBoundsZoom(bounds); - this.setView(latlng, options.maxZoom ? Math.min(zoom2, options.maxZoom) : zoom2); - } - var data = { - latlng, - bounds, - timestamp: pos.timestamp - }; - for (var i in pos.coords) { - if (typeof pos.coords[i] === "number") { - data[i] = pos.coords[i]; - } - } - this.fire("locationfound", data); - }, - // TODO Appropriate docs section? - // @section Other Methods - // @method addHandler(name: String, HandlerClass: Function): this - // Adds a new `Handler` to the map, given its name and constructor function. - addHandler: function(name, HandlerClass) { - if (!HandlerClass) { - return this; - } - var handler = this[name] = new HandlerClass(this); - this._handlers.push(handler); - if (this.options[name]) { - handler.enable(); - } - return this; - }, - // @method remove(): this - // Destroys the map and clears all related event listeners. - remove: function() { - this._initEvents(true); - if (this.options.maxBounds) { - this.off("moveend", this._panInsideMaxBounds); - } - if (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 (e) { - this._container._leaflet_id = void 0; - this._containerId = void 0; - } - if (this._locationWatchId !== void 0) { - this.stopLocate(); - } - this._stop(); - remove(this._mapPane); - if (this._clearControlPos) { - this._clearControlPos(); - } - if (this._resizeRequest) { - cancelAnimFrame(this._resizeRequest); - this._resizeRequest = null; - } - this._clearHandlers(); - if (this._loaded) { - this.fire("unload"); - } - var i; - for (i in this._layers) { - this._layers[i].remove(); - } - for (i in this._panes) { - remove(this._panes[i]); - } - this._layers = []; - this._panes = []; - delete this._mapPane; - delete this._renderer; - return this; - }, - // @section Other Methods - // @method createPane(name: String, container?: HTMLElement): HTMLElement - // Creates a new [map pane](#map-pane) with the given name if it doesn't exist already, - // then returns it. The pane is created as a child of `container`, or - // as a child of the main map pane if not set. - createPane: function(name, container) { - var className = "leaflet-pane" + (name ? " leaflet-" + name.replace("Pane", "") + "-pane" : ""), pane = create$1("div", className, container || this._mapPane); - if (name) { - this._panes[name] = pane; - } - return pane; - }, - // @section Methods for Getting Map State - // @method getCenter(): LatLng - // Returns the geographical center of the map view - getCenter: function() { - this._checkIfLoaded(); - if (this._lastCenter && !this._moved()) { - return this._lastCenter.clone(); - } - return this.layerPointToLatLng(this._getCenterLayerPoint()); - }, - // @method getZoom(): Number - // Returns the current zoom level of the map view - getZoom: function() { - return this._zoom; - }, - // @method getBounds(): LatLngBounds - // Returns the geographical bounds visible in the current map view - getBounds: function() { - var bounds = this.getPixelBounds(), sw = this.unproject(bounds.getBottomLeft()), ne = this.unproject(bounds.getTopRight()); - return new LatLngBounds(sw, ne); - }, - // @method getMinZoom(): Number - // Returns the minimum zoom level of the map (if set in the `minZoom` option of the map or of any layers), or `0` by default. - getMinZoom: function() { - return this.options.minZoom === void 0 ? this._layersMinZoom || 0 : this.options.minZoom; - }, - // @method getMaxZoom(): Number - // Returns the maximum zoom level of the map (if set in the `maxZoom` option of the map or of any layers). - getMaxZoom: function() { - return this.options.maxZoom === void 0 ? this._layersMaxZoom === void 0 ? Infinity : this._layersMaxZoom : this.options.maxZoom; - }, - // @method getBoundsZoom(bounds: LatLngBounds, inside?: Boolean, padding?: Point): Number - // Returns the maximum zoom level on which the given bounds fit to the map - // view in its entirety. If `inside` (optional) is set to `true`, the method - // instead returns the minimum zoom level on which the map view fits into - // the given bounds in its entirety. - getBoundsZoom: function(bounds, inside, padding) { - bounds = toLatLngBounds(bounds); - padding = toPoint(padding || [0, 0]); - var zoom2 = this.getZoom() || 0, min = this.getMinZoom(), max = this.getMaxZoom(), nw = bounds.getNorthWest(), se = bounds.getSouthEast(), size = this.getSize().subtract(padding), boundsSize = toBounds(this.project(se, zoom2), this.project(nw, zoom2)).getSize(), snap = Browser.any3d ? this.options.zoomSnap : 1, scalex = size.x / boundsSize.x, scaley = size.y / boundsSize.y, scale2 = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley); - zoom2 = this.getScaleZoom(scale2, zoom2); - if (snap) { - zoom2 = Math.round(zoom2 / (snap / 100)) * (snap / 100); - zoom2 = inside ? Math.ceil(zoom2 / snap) * snap : Math.floor(zoom2 / snap) * snap; - } - return Math.max(min, Math.min(max, zoom2)); - }, - // @method getSize(): Point - // Returns the current size of the map container (in pixels). - getSize: function() { - if (!this._size || this._sizeChanged) { - this._size = new Point( - this._container.clientWidth || 0, - this._container.clientHeight || 0 - ); - this._sizeChanged = false; - } - return this._size.clone(); - }, - // @method getPixelBounds(): Bounds - // Returns the bounds of the current map view in projected pixel - // coordinates (sometimes useful in layer and overlay implementations). - getPixelBounds: function(center, zoom2) { - var topLeftPoint = this._getTopLeftPoint(center, zoom2); - return new Bounds(topLeftPoint, topLeftPoint.add(this.getSize())); - }, - // TODO: Check semantics - isn't the pixel origin the 0,0 coord relative to - // the map pane? "left point of the map layer" can be confusing, specially - // since there can be negative offsets. - // @method getPixelOrigin(): Point - // Returns the projected pixel coordinates of the top left point of - // the map layer (useful in custom layer and overlay implementations). - getPixelOrigin: function() { - this._checkIfLoaded(); - return this._pixelOrigin; - }, - // @method getPixelWorldBounds(zoom?: Number): Bounds - // Returns the world's bounds in pixel coordinates for zoom level `zoom`. - // If `zoom` is omitted, the map's current zoom level is used. - getPixelWorldBounds: function(zoom2) { - return this.options.crs.getProjectedBounds(zoom2 === void 0 ? this.getZoom() : zoom2); - }, - // @section Other Methods - // @method getPane(pane: String|HTMLElement): HTMLElement - // Returns a [map pane](#map-pane), given its name or its HTML element (its identity). - getPane: function(pane) { - return typeof pane === "string" ? this._panes[pane] : pane; - }, - // @method getPanes(): Object - // Returns a plain object containing the names of all [panes](#map-pane) as keys and - // the panes as values. - getPanes: function() { - return this._panes; - }, - // @method getContainer: HTMLElement - // Returns the HTML element that contains the map. - getContainer: function() { - return this._container; - }, - // @section Conversion Methods - // @method getZoomScale(toZoom: Number, fromZoom: Number): Number - // Returns the scale factor to be applied to a map transition from zoom level - // `fromZoom` to `toZoom`. Used internally to help with zoom animations. - getZoomScale: function(toZoom, fromZoom) { - var crs = this.options.crs; - fromZoom = fromZoom === void 0 ? this._zoom : fromZoom; - return crs.scale(toZoom) / crs.scale(fromZoom); - }, - // @method getScaleZoom(scale: Number, fromZoom: Number): Number - // Returns the zoom level that the map would end up at, if it is at `fromZoom` - // level and everything is scaled by a factor of `scale`. Inverse of - // [`getZoomScale`](#map-getZoomScale). - getScaleZoom: function(scale2, fromZoom) { - var crs = this.options.crs; - fromZoom = fromZoom === void 0 ? this._zoom : fromZoom; - var zoom2 = crs.zoom(scale2 * crs.scale(fromZoom)); - return isNaN(zoom2) ? Infinity : zoom2; - }, - // @method project(latlng: LatLng, zoom: Number): Point - // Projects a geographical coordinate `LatLng` according to the projection - // of the map's CRS, then scales it according to `zoom` and the CRS's - // `Transformation`. The result is pixel coordinate relative to - // the CRS origin. - project: function(latlng, zoom2) { - zoom2 = zoom2 === void 0 ? this._zoom : zoom2; - return this.options.crs.latLngToPoint(toLatLng(latlng), zoom2); - }, - // @method unproject(point: Point, zoom: Number): LatLng - // Inverse of [`project`](#map-project). - unproject: function(point, zoom2) { - zoom2 = zoom2 === void 0 ? this._zoom : zoom2; - return this.options.crs.pointToLatLng(toPoint(point), zoom2); - }, - // @method layerPointToLatLng(point: Point): LatLng - // Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin), - // returns the corresponding geographical coordinate (for the current zoom level). - layerPointToLatLng: function(point) { - var projectedPoint = toPoint(point).add(this.getPixelOrigin()); - return this.unproject(projectedPoint); - }, - // @method latLngToLayerPoint(latlng: LatLng): Point - // Given a geographical coordinate, returns the corresponding pixel coordinate - // relative to the [origin pixel](#map-getpixelorigin). - latLngToLayerPoint: function(latlng) { - var projectedPoint = this.project(toLatLng(latlng))._round(); - return projectedPoint._subtract(this.getPixelOrigin()); - }, - // @method wrapLatLng(latlng: LatLng): LatLng - // Returns a `LatLng` where `lat` and `lng` has been wrapped according to the - // map's CRS's `wrapLat` and `wrapLng` properties, if they are outside the - // CRS's bounds. - // By default this means longitude is wrapped around the dateline so its - // value is between -180 and +180 degrees. - wrapLatLng: function(latlng) { - return this.options.crs.wrapLatLng(toLatLng(latlng)); - }, - // @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds - // Returns a `LatLngBounds` with the same size as the given one, ensuring that - // its center is within the CRS's bounds. - // By default this means the center longitude is wrapped around the dateline so its - // value is between -180 and +180 degrees, and the majority of the bounds - // overlaps the CRS's bounds. - wrapLatLngBounds: function(latlng) { - return this.options.crs.wrapLatLngBounds(toLatLngBounds(latlng)); - }, - // @method distance(latlng1: LatLng, latlng2: LatLng): Number - // Returns the distance between two geographical coordinates according to - // the map's CRS. By default this measures distance in meters. - distance: function(latlng1, latlng2) { - return this.options.crs.distance(toLatLng(latlng1), toLatLng(latlng2)); - }, - // @method containerPointToLayerPoint(point: Point): Point - // Given a pixel coordinate relative to the map container, returns the corresponding - // pixel coordinate relative to the [origin pixel](#map-getpixelorigin). - containerPointToLayerPoint: function(point) { - return toPoint(point).subtract(this._getMapPanePos()); - }, - // @method layerPointToContainerPoint(point: Point): Point - // Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin), - // returns the corresponding pixel coordinate relative to the map container. - layerPointToContainerPoint: function(point) { - return toPoint(point).add(this._getMapPanePos()); - }, - // @method containerPointToLatLng(point: Point): LatLng - // Given a pixel coordinate relative to the map container, returns - // the corresponding geographical coordinate (for the current zoom level). - containerPointToLatLng: function(point) { - var layerPoint = this.containerPointToLayerPoint(toPoint(point)); - return this.layerPointToLatLng(layerPoint); - }, - // @method latLngToContainerPoint(latlng: LatLng): Point - // Given a geographical coordinate, returns the corresponding pixel coordinate - // relative to the map container. - latLngToContainerPoint: function(latlng) { - return this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(latlng))); - }, - // @method mouseEventToContainerPoint(ev: MouseEvent): Point - // Given a MouseEvent object, returns the pixel coordinate relative to the - // map container where the event took place. - mouseEventToContainerPoint: function(e) { - return getMousePosition(e, this._container); - }, - // @method mouseEventToLayerPoint(ev: MouseEvent): Point - // Given a MouseEvent object, returns the pixel coordinate relative to - // the [origin pixel](#map-getpixelorigin) where the event took place. - mouseEventToLayerPoint: function(e) { - return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e)); - }, - // @method mouseEventToLatLng(ev: MouseEvent): LatLng - // Given a MouseEvent object, returns geographical coordinate where the - // event took place. - mouseEventToLatLng: function(e) { - return this.layerPointToLatLng(this.mouseEventToLayerPoint(e)); - }, - // map initialization methods - _initContainer: function(id) { - var container = this._container = get(id); - if (!container) { - throw new Error("Map container not found."); - } else if (container._leaflet_id) { - throw new Error("Map container is already initialized."); - } - on(container, "scroll", this._onScroll, this); - this._containerId = stamp(container); - }, - _initLayout: function() { - var container = this._container; - this._fadeAnimated = this.options.fadeAnimation && Browser.any3d; - addClass(container, "leaflet-container" + (Browser.touch ? " leaflet-touch" : "") + (Browser.retina ? " leaflet-retina" : "") + (Browser.ielt9 ? " leaflet-oldie" : "") + (Browser.safari ? " leaflet-safari" : "") + (this._fadeAnimated ? " leaflet-fade-anim" : "")); - var position = getStyle(container, "position"); - if (position !== "absolute" && position !== "relative" && position !== "fixed" && position !== "sticky") { - container.style.position = "relative"; - } - this._initPanes(); - if (this._initControlPos) { - this._initControlPos(); - } - }, - _initPanes: function() { - var panes = this._panes = {}; - this._paneRenderers = {}; - this._mapPane = this.createPane("mapPane", this._container); - setPosition(this._mapPane, new Point(0, 0)); - this.createPane("tilePane"); - this.createPane("overlayPane"); - this.createPane("shadowPane"); - this.createPane("markerPane"); - this.createPane("tooltipPane"); - this.createPane("popupPane"); - if (!this.options.markerZoomAnimation) { - addClass(panes.markerPane, "leaflet-zoom-hide"); - addClass(panes.shadowPane, "leaflet-zoom-hide"); - } - }, - // private methods that modify map state - // @section Map state change events - _resetView: function(center, zoom2, noMoveStart) { - setPosition(this._mapPane, new Point(0, 0)); - var loading = !this._loaded; - this._loaded = true; - zoom2 = this._limitZoom(zoom2); - this.fire("viewprereset"); - var zoomChanged = this._zoom !== zoom2; - this._moveStart(zoomChanged, noMoveStart)._move(center, zoom2)._moveEnd(zoomChanged); - this.fire("viewreset"); - if (loading) { - this.fire("load"); - } - }, - _moveStart: function(zoomChanged, noMoveStart) { - if (zoomChanged) { - this.fire("zoomstart"); - } - if (!noMoveStart) { - this.fire("movestart"); - } - return this; - }, - _move: function(center, zoom2, data, supressEvent) { - if (zoom2 === void 0) { - zoom2 = this._zoom; - } - var zoomChanged = this._zoom !== zoom2; - this._zoom = zoom2; - this._lastCenter = center; - this._pixelOrigin = this._getNewPixelOrigin(center); - if (!supressEvent) { - if (zoomChanged || data && data.pinch) { - this.fire("zoom", data); - } - this.fire("move", data); - } else if (data && data.pinch) { - this.fire("zoom", data); - } - return this; - }, - _moveEnd: function(zoomChanged) { - if (zoomChanged) { - this.fire("zoomend"); - } - return this.fire("moveend"); - }, - _stop: function() { - cancelAnimFrame(this._flyToFrame); - if (this._panAnim) { - this._panAnim.stop(); - } - return this; - }, - _rawPanBy: function(offset) { - setPosition(this._mapPane, this._getMapPanePos().subtract(offset)); - }, - _getZoomSpan: function() { - return this.getMaxZoom() - this.getMinZoom(); - }, - _panInsideMaxBounds: function() { - if (!this._enforcingBounds) { - this.panInsideBounds(this.options.maxBounds); - } - }, - _checkIfLoaded: function() { - if (!this._loaded) { - throw new Error("Set map center and zoom first."); - } - }, - // DOM event handling - // @section Interaction events - _initEvents: function(remove2) { - this._targets = {}; - this._targets[stamp(this._container)] = this; - var onOff = remove2 ? off : on; - onOff(this._container, "click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup", this._handleDOMEvent, this); - if (this.options.trackResize) { - onOff(window, "resize", this._onResize, this); - } - if (Browser.any3d && this.options.transform3DLimit) { - (remove2 ? this.off : this.on).call(this, "moveend", this._onMoveEnd); - } - }, - _onResize: function() { - cancelAnimFrame(this._resizeRequest); - this._resizeRequest = requestAnimFrame( - function() { - this.invalidateSize({ debounceMoveend: true }); - }, - this - ); - }, - _onScroll: function() { - this._container.scrollTop = 0; - this._container.scrollLeft = 0; - }, - _onMoveEnd: function() { - var pos = this._getMapPanePos(); - if (Math.max(Math.abs(pos.x), Math.abs(pos.y)) >= this.options.transform3DLimit) { - this._resetView(this.getCenter(), this.getZoom()); - } - }, - _findEventTargets: function(e, type) { - var targets = [], target, isHover = type === "mouseout" || type === "mouseover", src = e.target || e.srcElement, dragging = false; - while (src) { - target = this._targets[stamp(src)]; - if (target && (type === "click" || type === "preclick") && this._draggableMoved(target)) { - dragging = true; - break; - } - if (target && target.listens(type, true)) { - if (isHover && !isExternalTarget(src, e)) { - break; - } - targets.push(target); - if (isHover) { - break; - } - } - if (src === this._container) { - break; - } - src = src.parentNode; - } - if (!targets.length && !dragging && !isHover && this.listens(type, true)) { - targets = [this]; - } - return targets; - }, - _isClickDisabled: function(el) { - while (el && el !== this._container) { - if (el["_leaflet_disable_click"]) { - return true; - } - el = el.parentNode; - } - }, - _handleDOMEvent: function(e) { - var el = e.target || e.srcElement; - if (!this._loaded || el["_leaflet_disable_events"] || e.type === "click" && this._isClickDisabled(el)) { - return; - } - var type = e.type; - if (type === "mousedown") { - preventOutline(el); - } - this._fireDOMEvent(e, type); - }, - _mouseEvents: ["click", "dblclick", "mouseover", "mouseout", "contextmenu"], - _fireDOMEvent: function(e, type, canvasTargets) { - if (e.type === "click") { - var synth = extend({}, e); - synth.type = "preclick"; - this._fireDOMEvent(synth, synth.type, canvasTargets); - } - var targets = this._findEventTargets(e, type); - if (canvasTargets) { - var filtered = []; - for (var i = 0; i < canvasTargets.length; i++) { - if (canvasTargets[i].listens(type, true)) { - filtered.push(canvasTargets[i]); - } - } - targets = filtered.concat(targets); - } - if (!targets.length) { - return; - } - if (type === "contextmenu") { - preventDefault(e); - } - var target = targets[0]; - var data = { - originalEvent: e - }; - if (e.type !== "keypress" && e.type !== "keydown" && e.type !== "keyup") { - var isMarker = target.getLatLng && (!target._radius || target._radius <= 10); - data.containerPoint = isMarker ? this.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e); - data.layerPoint = this.containerPointToLayerPoint(data.containerPoint); - data.latlng = isMarker ? target.getLatLng() : this.layerPointToLatLng(data.layerPoint); - } - for (i = 0; i < targets.length; i++) { - targets[i].fire(type, data, true); - if (data.originalEvent._stopped || targets[i].options.bubblingMouseEvents === false && indexOf(this._mouseEvents, type) !== -1) { - return; - } - } - }, - _draggableMoved: function(obj) { - obj = obj.dragging && obj.dragging.enabled() ? obj : this; - return obj.dragging && obj.dragging.moved() || this.boxZoom && this.boxZoom.moved(); - }, - _clearHandlers: function() { - for (var i = 0, len = this._handlers.length; i < len; i++) { - this._handlers[i].disable(); - } - }, - // @section Other Methods - // @method whenReady(fn: Function, context?: Object): this - // Runs the given function `fn` when the map gets initialized with - // a view (center and zoom) and at least one layer, or immediately - // if it's already initialized, optionally passing a function context. - whenReady: function(callback, context) { - if (this._loaded) { - callback.call(context || this, { target: this }); - } else { - this.on("load", callback, context); - } - return this; - }, - // private methods for getting map state - _getMapPanePos: function() { - return getPosition(this._mapPane) || new Point(0, 0); - }, - _moved: function() { - var pos = this._getMapPanePos(); - return pos && !pos.equals([0, 0]); - }, - _getTopLeftPoint: function(center, zoom2) { - var pixelOrigin = center && zoom2 !== void 0 ? this._getNewPixelOrigin(center, zoom2) : this.getPixelOrigin(); - return pixelOrigin.subtract(this._getMapPanePos()); - }, - _getNewPixelOrigin: function(center, zoom2) { - var viewHalf = this.getSize()._divideBy(2); - return this.project(center, zoom2)._subtract(viewHalf)._add(this._getMapPanePos())._round(); - }, - _latLngToNewLayerPoint: function(latlng, zoom2, center) { - var topLeft = this._getNewPixelOrigin(center, zoom2); - return this.project(latlng, zoom2)._subtract(topLeft); - }, - _latLngBoundsToNewLayerBounds: function(latLngBounds, zoom2, center) { - var topLeft = this._getNewPixelOrigin(center, zoom2); - return toBounds([ - this.project(latLngBounds.getSouthWest(), zoom2)._subtract(topLeft), - this.project(latLngBounds.getNorthWest(), zoom2)._subtract(topLeft), - this.project(latLngBounds.getSouthEast(), zoom2)._subtract(topLeft), - this.project(latLngBounds.getNorthEast(), zoom2)._subtract(topLeft) - ]); - }, - // layer point of the current center - _getCenterLayerPoint: function() { - return this.containerPointToLayerPoint(this.getSize()._divideBy(2)); - }, - // offset of the specified place to the current center in pixels - _getCenterOffset: function(latlng) { - return this.latLngToLayerPoint(latlng).subtract(this._getCenterLayerPoint()); - }, - // adjust center for view to get inside bounds - _limitCenter: function(center, zoom2, bounds) { - if (!bounds) { - return center; - } - var centerPoint = this.project(center, zoom2), viewHalf = this.getSize().divideBy(2), viewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)), offset = this._getBoundsOffset(viewBounds, bounds, zoom2); - if (Math.abs(offset.x) <= 1 && Math.abs(offset.y) <= 1) { - return center; - } - return this.unproject(centerPoint.add(offset), zoom2); - }, - // adjust offset for view to get inside bounds - _limitOffset: function(offset, bounds) { - if (!bounds) { - return offset; - } - var viewBounds = this.getPixelBounds(), newBounds = new Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset)); - return offset.add(this._getBoundsOffset(newBounds, bounds)); - }, - // returns offset needed for pxBounds to get inside maxBounds at a specified zoom - _getBoundsOffset: function(pxBounds, maxBounds, zoom2) { - var projectedMaxBounds = toBounds( - this.project(maxBounds.getNorthEast(), zoom2), - this.project(maxBounds.getSouthWest(), zoom2) - ), minOffset = projectedMaxBounds.min.subtract(pxBounds.min), maxOffset = projectedMaxBounds.max.subtract(pxBounds.max), dx = this._rebound(minOffset.x, -maxOffset.x), dy = this._rebound(minOffset.y, -maxOffset.y); - return new Point(dx, dy); - }, - _rebound: function(left, right) { - return left + right > 0 ? Math.round(left - right) / 2 : Math.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right)); - }, - _limitZoom: function(zoom2) { - var min = this.getMinZoom(), max = this.getMaxZoom(), snap = Browser.any3d ? this.options.zoomSnap : 1; - if (snap) { - zoom2 = Math.round(zoom2 / snap) * snap; - } - return Math.max(min, Math.min(max, zoom2)); - }, - _onPanTransitionStep: function() { - this.fire("move"); - }, - _onPanTransitionEnd: function() { - removeClass(this._mapPane, "leaflet-pan-anim"); - this.fire("moveend"); - }, - _tryAnimatedPan: function(center, options) { - var offset = this._getCenterOffset(center)._trunc(); - if ((options && options.animate) !== true && !this.getSize().contains(offset)) { - return false; - } - this.panBy(offset, options); - return true; - }, - _createAnimProxy: function() { - var proxy = this._proxy = create$1("div", "leaflet-proxy leaflet-zoom-animated"); - this._panes.mapPane.appendChild(proxy); - this.on("zoomanim", function(e) { - var prop = TRANSFORM, transform = this._proxy.style[prop]; - setTransform(this._proxy, this.project(e.center, e.zoom), this.getZoomScale(e.zoom, 1)); - if (transform === this._proxy.style[prop] && this._animatingZoom) { - this._onZoomTransitionEnd(); - } - }, this); - this.on("load moveend", this._animMoveEnd, this); - this._on("unload", this._destroyAnimProxy, this); - }, - _destroyAnimProxy: function() { - remove(this._proxy); - this.off("load moveend", this._animMoveEnd, this); - delete this._proxy; - }, - _animMoveEnd: function() { - var c = this.getCenter(), z = this.getZoom(); - setTransform(this._proxy, this.project(c, z), this.getZoomScale(z, 1)); - }, - _catchTransitionEnd: function(e) { - if (this._animatingZoom && e.propertyName.indexOf("transform") >= 0) { - this._onZoomTransitionEnd(); - } - }, - _nothingToAnimate: function() { - return !this._container.getElementsByClassName("leaflet-zoom-animated").length; - }, - _tryAnimatedZoom: function(center, zoom2, options) { - if (this._animatingZoom) { - return true; - } - options = options || {}; - if (!this._zoomAnimated || options.animate === false || this._nothingToAnimate() || Math.abs(zoom2 - this._zoom) > this.options.zoomAnimationThreshold) { - return false; - } - var scale2 = this.getZoomScale(zoom2), offset = this._getCenterOffset(center)._divideBy(1 - 1 / scale2); - if (options.animate !== true && !this.getSize().contains(offset)) { - return false; - } - requestAnimFrame(function() { - this._moveStart(true, options.noMoveStart || false)._animateZoom(center, zoom2, true); - }, this); - return true; - }, - _animateZoom: function(center, zoom2, startAnim, noUpdate) { - if (!this._mapPane) { - return; - } - if (startAnim) { - this._animatingZoom = true; - this._animateToCenter = center; - this._animateToZoom = zoom2; - addClass(this._mapPane, "leaflet-zoom-anim"); - } - this.fire("zoomanim", { - center, - zoom: zoom2, - noUpdate - }); - if (!this._tempFireZoomEvent) { - this._tempFireZoomEvent = this._zoom !== this._animateToZoom; - } - this._move(this._animateToCenter, this._animateToZoom, void 0, true); - setTimeout(bind(this._onZoomTransitionEnd, this), 250); - }, - _onZoomTransitionEnd: function() { - if (!this._animatingZoom) { - return; - } - if (this._mapPane) { - removeClass(this._mapPane, "leaflet-zoom-anim"); - } - this._animatingZoom = false; - this._move(this._animateToCenter, this._animateToZoom, void 0, true); - if (this._tempFireZoomEvent) { - this.fire("zoom"); - } - delete this._tempFireZoomEvent; - this.fire("move"); - this._moveEnd(true); - } - }); - function createMap(id, options) { - return new Map(id, options); - } - var Control = Class.extend({ - // @section - // @aka Control Options - options: { - // @option position: String = 'topright' - // The position of the control (one of the map corners). Possible values are `'topleft'`, - // `'topright'`, `'bottomleft'` or `'bottomright'` - position: "topright" - }, - initialize: function(options) { - setOptions(this, options); - }, - /* @section - * Classes extending L.Control will inherit the following methods: - * - * @method getPosition: string - * Returns the position of the control. - */ - getPosition: function() { - return this.options.position; - }, - // @method setPosition(position: string): this - // Sets the position of the control. - setPosition: function(position) { - var map = this._map; - if (map) { - map.removeControl(this); - } - this.options.position = position; - if (map) { - map.addControl(this); - } - return this; - }, - // @method getContainer: HTMLElement - // Returns the HTMLElement that contains the control. - getContainer: function() { - return this._container; - }, - // @method addTo(map: Map): this - // Adds the control to the given map. - addTo: function(map) { - this.remove(); - this._map = map; - var container = this._container = this.onAdd(map), pos = this.getPosition(), corner = map._controlCorners[pos]; - addClass(container, "leaflet-control"); - if (pos.indexOf("bottom") !== -1) { - corner.insertBefore(container, corner.firstChild); - } else { - corner.appendChild(container); - } - this._map.on("unload", this.remove, this); - return this; - }, - // @method remove: this - // Removes the control from the map it is currently active on. - remove: function() { - if (!this._map) { - return this; - } - remove(this._container); - if (this.onRemove) { - this.onRemove(this._map); - } - this._map.off("unload", this.remove, this); - this._map = null; - return this; - }, - _refocusOnMap: function(e) { - if (this._map && e && e.screenX > 0 && e.screenY > 0) { - this._map.getContainer().focus(); - } - } - }); - var control = function(options) { - return new Control(options); - }; - Map.include({ - // @method addControl(control: Control): this - // Adds the given control to the map - addControl: function(control2) { - control2.addTo(this); - return this; - }, - // @method removeControl(control: Control): this - // Removes the given control from the map - removeControl: function(control2) { - control2.remove(); - return this; - }, - _initControlPos: function() { - var corners = this._controlCorners = {}, l = "leaflet-", container = this._controlContainer = create$1("div", l + "control-container", this._container); - function createCorner(vSide, hSide) { - var className = l + vSide + " " + l + hSide; - corners[vSide + hSide] = create$1("div", className, container); - } - createCorner("top", "left"); - createCorner("top", "right"); - createCorner("bottom", "left"); - createCorner("bottom", "right"); - }, - _clearControlPos: function() { - for (var i in this._controlCorners) { - remove(this._controlCorners[i]); - } - remove(this._controlContainer); - delete this._controlCorners; - delete this._controlContainer; - } - }); - var Layers = Control.extend({ - // @section - // @aka Control.Layers options - options: { - // @option collapsed: Boolean = true - // If `true`, the control will be collapsed into an icon and expanded on mouse hover, touch, or keyboard activation. - collapsed: true, - position: "topright", - // @option autoZIndex: Boolean = true - // If `true`, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off. - autoZIndex: true, - // @option hideSingleBase: Boolean = false - // If `true`, the base layers in the control will be hidden when there is only one. - hideSingleBase: false, - // @option sortLayers: Boolean = false - // Whether to sort the layers. When `false`, layers will keep the order - // in which they were added to the control. - sortLayers: false, - // @option sortFunction: Function = * - // A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) - // that will be used for sorting the layers, when `sortLayers` is `true`. - // The function receives both the `L.Layer` instances and their names, as in - // `sortFunction(layerA, layerB, nameA, nameB)`. - // By default, it sorts layers alphabetically by their name. - sortFunction: function(layerA, layerB, nameA, nameB) { - return nameA < nameB ? -1 : nameB < nameA ? 1 : 0; - } - }, - initialize: function(baseLayers, overlays, options) { - setOptions(this, options); - this._layerControlInputs = []; - this._layers = []; - this._lastZIndex = 0; - this._handlingClick = false; - this._preventClick = false; - for (var i in baseLayers) { - this._addLayer(baseLayers[i], i); - } - for (i in overlays) { - this._addLayer(overlays[i], i, true); - } - }, - onAdd: function(map) { - this._initLayout(); - this._update(); - this._map = map; - map.on("zoomend", this._checkDisabledLayers, this); - for (var i = 0; i < this._layers.length; i++) { - this._layers[i].layer.on("add remove", this._onLayerChange, this); - } - return this._container; - }, - addTo: function(map) { - Control.prototype.addTo.call(this, map); - return this._expandIfNotCollapsed(); - }, - onRemove: function() { - this._map.off("zoomend", this._checkDisabledLayers, this); - for (var i = 0; i < this._layers.length; i++) { - this._layers[i].layer.off("add remove", this._onLayerChange, this); - } - }, - // @method addBaseLayer(layer: Layer, name: String): this - // Adds a base layer (radio button entry) with the given name to the control. - addBaseLayer: function(layer, name) { - this._addLayer(layer, name); - return this._map ? this._update() : this; - }, - // @method addOverlay(layer: Layer, name: String): this - // Adds an overlay (checkbox entry) with the given name to the control. - addOverlay: function(layer, name) { - this._addLayer(layer, name, true); - return this._map ? this._update() : this; - }, - // @method removeLayer(layer: Layer): this - // Remove the given layer from the control. - removeLayer: function(layer) { - layer.off("add remove", this._onLayerChange, this); - var obj = this._getLayer(stamp(layer)); - if (obj) { - this._layers.splice(this._layers.indexOf(obj), 1); - } - return this._map ? this._update() : this; - }, - // @method expand(): this - // Expand the control container if collapsed. - expand: function() { - addClass(this._container, "leaflet-control-layers-expanded"); - this._section.style.height = null; - var acceptableHeight = this._map.getSize().y - (this._container.offsetTop + 50); - if (acceptableHeight < this._section.clientHeight) { - addClass(this._section, "leaflet-control-layers-scrollbar"); - this._section.style.height = acceptableHeight + "px"; - } else { - removeClass(this._section, "leaflet-control-layers-scrollbar"); - } - this._checkDisabledLayers(); - return this; - }, - // @method collapse(): this - // Collapse the control container if expanded. - collapse: function() { - removeClass(this._container, "leaflet-control-layers-expanded"); - return this; - }, - _initLayout: function() { - var className = "leaflet-control-layers", container = this._container = create$1("div", className), collapsed = this.options.collapsed; - container.setAttribute("aria-haspopup", true); - disableClickPropagation(container); - disableScrollPropagation(container); - var section = this._section = create$1("section", className + "-list"); - if (collapsed) { - this._map.on("click", this.collapse, this); - on(container, { - mouseenter: this._expandSafely, - mouseleave: this.collapse - }, this); - } - var link = this._layersLink = create$1("a", className + "-toggle", container); - link.href = "#"; - link.title = "Layers"; - link.setAttribute("role", "button"); - on(link, { - keydown: function(e) { - if (e.keyCode === 13) { - this._expandSafely(); - } - }, - // Certain screen readers intercept the key event and instead send a click event - click: function(e) { - preventDefault(e); - this._expandSafely(); - } - }, this); - if (!collapsed) { - this.expand(); - } - this._baseLayersList = create$1("div", className + "-base", section); - this._separator = create$1("div", className + "-separator", section); - this._overlaysList = create$1("div", className + "-overlays", section); - container.appendChild(section); - }, - _getLayer: function(id) { - for (var i = 0; i < this._layers.length; i++) { - if (this._layers[i] && stamp(this._layers[i].layer) === id) { - return this._layers[i]; - } - } - }, - _addLayer: function(layer, name, overlay) { - if (this._map) { - layer.on("add remove", this._onLayerChange, this); - } - this._layers.push({ - layer, - name, - overlay - }); - if (this.options.sortLayers) { - this._layers.sort(bind(function(a, b) { - return this.options.sortFunction(a.layer, b.layer, a.name, b.name); - }, this)); - } - if (this.options.autoZIndex && layer.setZIndex) { - this._lastZIndex++; - layer.setZIndex(this._lastZIndex); - } - this._expandIfNotCollapsed(); - }, - _update: function() { - if (!this._container) { - return this; - } - empty(this._baseLayersList); - empty(this._overlaysList); - this._layerControlInputs = []; - var baseLayersPresent, overlaysPresent, i, obj, baseLayersCount = 0; - for (i = 0; i < this._layers.length; i++) { - obj = this._layers[i]; - this._addItem(obj); - overlaysPresent = overlaysPresent || obj.overlay; - baseLayersPresent = baseLayersPresent || !obj.overlay; - baseLayersCount += !obj.overlay ? 1 : 0; - } - if (this.options.hideSingleBase) { - baseLayersPresent = baseLayersPresent && baseLayersCount > 1; - this._baseLayersList.style.display = baseLayersPresent ? "" : "none"; - } - this._separator.style.display = overlaysPresent && baseLayersPresent ? "" : "none"; - return this; - }, - _onLayerChange: function(e) { - if (!this._handlingClick) { - this._update(); - } - var obj = this._getLayer(stamp(e.target)); - var type = obj.overlay ? e.type === "add" ? "overlayadd" : "overlayremove" : e.type === "add" ? "baselayerchange" : null; - if (type) { - this._map.fire(type, obj); - } - }, - // IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see https://stackoverflow.com/a/119079) - _createRadioElement: function(name, checked) { - var radioHtml = '"; - var radioFragment = document.createElement("div"); - radioFragment.innerHTML = radioHtml; - return radioFragment.firstChild; - }, - _addItem: function(obj) { - var label = document.createElement("label"), checked = this._map.hasLayer(obj.layer), input; - if (obj.overlay) { - input = document.createElement("input"); - input.type = "checkbox"; - input.className = "leaflet-control-layers-selector"; - input.defaultChecked = checked; - } else { - input = this._createRadioElement("leaflet-base-layers_" + stamp(this), checked); - } - this._layerControlInputs.push(input); - input.layerId = stamp(obj.layer); - on(input, "click", this._onInputClick, this); - var name = document.createElement("span"); - name.innerHTML = " " + obj.name; - var holder = document.createElement("span"); - label.appendChild(holder); - holder.appendChild(input); - holder.appendChild(name); - var container = obj.overlay ? this._overlaysList : this._baseLayersList; - container.appendChild(label); - this._checkDisabledLayers(); - return label; - }, - _onInputClick: function() { - if (this._preventClick) { - return; - } - var inputs = this._layerControlInputs, input, layer; - var addedLayers = [], removedLayers = []; - this._handlingClick = true; - for (var i = inputs.length - 1; i >= 0; i--) { - input = inputs[i]; - layer = this._getLayer(input.layerId).layer; - if (input.checked) { - addedLayers.push(layer); - } else if (!input.checked) { - removedLayers.push(layer); - } - } - for (i = 0; i < removedLayers.length; i++) { - if (this._map.hasLayer(removedLayers[i])) { - this._map.removeLayer(removedLayers[i]); - } - } - for (i = 0; i < addedLayers.length; i++) { - if (!this._map.hasLayer(addedLayers[i])) { - this._map.addLayer(addedLayers[i]); - } - } - this._handlingClick = false; - this._refocusOnMap(); - }, - _checkDisabledLayers: function() { - var inputs = this._layerControlInputs, input, layer, zoom2 = this._map.getZoom(); - for (var i = inputs.length - 1; i >= 0; i--) { - input = inputs[i]; - layer = this._getLayer(input.layerId).layer; - input.disabled = layer.options.minZoom !== void 0 && zoom2 < layer.options.minZoom || layer.options.maxZoom !== void 0 && zoom2 > layer.options.maxZoom; - } - }, - _expandIfNotCollapsed: function() { - if (this._map && !this.options.collapsed) { - this.expand(); - } - return this; - }, - _expandSafely: function() { - var section = this._section; - this._preventClick = true; - on(section, "click", preventDefault); - this.expand(); - var that = this; - setTimeout(function() { - off(section, "click", preventDefault); - that._preventClick = false; - }); - } - }); - var layers = function(baseLayers, overlays, options) { - return new Layers(baseLayers, overlays, options); - }; - var Zoom = Control.extend({ - // @section - // @aka Control.Zoom options - options: { - position: "topleft", - // @option zoomInText: String = '' - // The text set on the 'zoom in' button. - zoomInText: '', - // @option zoomInTitle: String = 'Zoom in' - // The title set on the 'zoom in' button. - zoomInTitle: "Zoom in", - // @option zoomOutText: String = '' - // The text set on the 'zoom out' button. - zoomOutText: '', - // @option zoomOutTitle: String = 'Zoom out' - // The title set on the 'zoom out' button. - zoomOutTitle: "Zoom out" - }, - onAdd: function(map) { - var zoomName = "leaflet-control-zoom", container = create$1("div", zoomName + " leaflet-bar"), options = this.options; - this._zoomInButton = this._createButton( - options.zoomInText, - options.zoomInTitle, - zoomName + "-in", - container, - this._zoomIn - ); - this._zoomOutButton = this._createButton( - options.zoomOutText, - options.zoomOutTitle, - zoomName + "-out", - container, - this._zoomOut - ); - this._updateDisabled(); - map.on("zoomend zoomlevelschange", this._updateDisabled, this); - return container; - }, - onRemove: function(map) { - map.off("zoomend zoomlevelschange", this._updateDisabled, this); - }, - disable: function() { - this._disabled = true; - this._updateDisabled(); - return this; - }, - enable: function() { - this._disabled = false; - this._updateDisabled(); - return this; - }, - _zoomIn: function(e) { - if (!this._disabled && this._map._zoom < this._map.getMaxZoom()) { - this._map.zoomIn(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1)); - } - }, - _zoomOut: function(e) { - if (!this._disabled && this._map._zoom > this._map.getMinZoom()) { - this._map.zoomOut(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1)); - } - }, - _createButton: function(html, title, className, container, fn) { - var link = create$1("a", className, container); - link.innerHTML = html; - link.href = "#"; - link.title = title; - link.setAttribute("role", "button"); - link.setAttribute("aria-label", title); - disableClickPropagation(link); - on(link, "click", stop); - on(link, "click", fn, this); - on(link, "click", this._refocusOnMap, this); - return link; - }, - _updateDisabled: function() { - var map = this._map, className = "leaflet-disabled"; - removeClass(this._zoomInButton, className); - removeClass(this._zoomOutButton, className); - this._zoomInButton.setAttribute("aria-disabled", "false"); - this._zoomOutButton.setAttribute("aria-disabled", "false"); - if (this._disabled || map._zoom === map.getMinZoom()) { - addClass(this._zoomOutButton, className); - this._zoomOutButton.setAttribute("aria-disabled", "true"); - } - if (this._disabled || map._zoom === map.getMaxZoom()) { - addClass(this._zoomInButton, className); - this._zoomInButton.setAttribute("aria-disabled", "true"); - } - } - }); - Map.mergeOptions({ - zoomControl: true - }); - Map.addInitHook(function() { - if (this.options.zoomControl) { - this.zoomControl = new Zoom(); - this.addControl(this.zoomControl); - } - }); - var zoom = function(options) { - return new Zoom(options); - }; - var Scale = Control.extend({ - // @section - // @aka Control.Scale options - options: { - position: "bottomleft", - // @option maxWidth: Number = 100 - // Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500). - maxWidth: 100, - // @option metric: Boolean = True - // Whether to show the metric scale line (m/km). - metric: true, - // @option imperial: Boolean = True - // Whether to show the imperial scale line (mi/ft). - imperial: true - // @option updateWhenIdle: Boolean = false - // If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)). - }, - onAdd: function(map) { - var className = "leaflet-control-scale", container = create$1("div", className), options = this.options; - this._addScales(options, className + "-line", container); - map.on(options.updateWhenIdle ? "moveend" : "move", this._update, this); - map.whenReady(this._update, this); - return container; - }, - onRemove: function(map) { - map.off(this.options.updateWhenIdle ? "moveend" : "move", this._update, this); - }, - _addScales: function(options, className, container) { - if (options.metric) { - this._mScale = create$1("div", className, container); - } - if (options.imperial) { - this._iScale = create$1("div", className, container); - } - }, - _update: function() { - var map = this._map, y = map.getSize().y / 2; - var maxMeters = map.distance( - map.containerPointToLatLng([0, y]), - map.containerPointToLatLng([this.options.maxWidth, y]) - ); - this._updateScales(maxMeters); - }, - _updateScales: function(maxMeters) { - if (this.options.metric && maxMeters) { - this._updateMetric(maxMeters); - } - if (this.options.imperial && maxMeters) { - this._updateImperial(maxMeters); - } - }, - _updateMetric: function(maxMeters) { - var meters = this._getRoundNum(maxMeters), label = meters < 1e3 ? meters + " m" : meters / 1e3 + " km"; - this._updateScale(this._mScale, label, meters / maxMeters); - }, - _updateImperial: function(maxMeters) { - var maxFeet = maxMeters * 3.2808399, maxMiles, miles, feet; - if (maxFeet > 5280) { - maxMiles = maxFeet / 5280; - miles = this._getRoundNum(maxMiles); - this._updateScale(this._iScale, miles + " mi", miles / maxMiles); - } else { - feet = this._getRoundNum(maxFeet); - this._updateScale(this._iScale, feet + " ft", feet / maxFeet); - } - }, - _updateScale: function(scale2, text, ratio) { - scale2.style.width = Math.round(this.options.maxWidth * ratio) + "px"; - scale2.innerHTML = text; - }, - _getRoundNum: function(num) { - var pow10 = Math.pow(10, (Math.floor(num) + "").length - 1), d = num / pow10; - d = d >= 10 ? 10 : d >= 5 ? 5 : d >= 3 ? 3 : d >= 2 ? 2 : 1; - return pow10 * d; - } - }); - var scale = function(options) { - return new Scale(options); - }; - var ukrainianFlag = ''; - var Attribution = Control.extend({ - // @section - // @aka Control.Attribution options - options: { - position: "bottomright", - // @option prefix: String|false = 'Leaflet' - // The HTML text shown before the attributions. Pass `false` to disable. - prefix: '' + (Browser.inlineSvg ? ukrainianFlag + " " : "") + "Leaflet" - }, - initialize: function(options) { - setOptions(this, options); - this._attributions = {}; - }, - onAdd: function(map) { - map.attributionControl = this; - this._container = create$1("div", "leaflet-control-attribution"); - disableClickPropagation(this._container); - for (var i in map._layers) { - if (map._layers[i].getAttribution) { - this.addAttribution(map._layers[i].getAttribution()); - } - } - this._update(); - map.on("layeradd", this._addAttribution, this); - return this._container; - }, - onRemove: function(map) { - map.off("layeradd", this._addAttribution, this); - }, - _addAttribution: function(ev) { - if (ev.layer.getAttribution) { - this.addAttribution(ev.layer.getAttribution()); - ev.layer.once("remove", function() { - this.removeAttribution(ev.layer.getAttribution()); - }, this); - } - }, - // @method setPrefix(prefix: String|false): this - // The HTML text shown before the attributions. Pass `false` to disable. - setPrefix: function(prefix) { - this.options.prefix = prefix; - this._update(); - return this; - }, - // @method addAttribution(text: String): this - // Adds an attribution text (e.g. `'© OpenStreetMap contributors'`). - addAttribution: function(text) { - if (!text) { - return this; - } - if (!this._attributions[text]) { - this._attributions[text] = 0; - } - this._attributions[text]++; - this._update(); - return this; - }, - // @method removeAttribution(text: String): this - // Removes an attribution text. - removeAttribution: function(text) { - if (!text) { - return this; - } - if (this._attributions[text]) { - this._attributions[text]--; - this._update(); - } - return this; - }, - _update: function() { - if (!this._map) { - return; - } - var attribs = []; - for (var i in this._attributions) { - if (this._attributions[i]) { - attribs.push(i); - } - } - var prefixAndAttribs = []; - if (this.options.prefix) { - prefixAndAttribs.push(this.options.prefix); - } - if (attribs.length) { - prefixAndAttribs.push(attribs.join(", ")); - } - this._container.innerHTML = prefixAndAttribs.join(' '); - } - }); - Map.mergeOptions({ - attributionControl: true - }); - Map.addInitHook(function() { - if (this.options.attributionControl) { - new Attribution().addTo(this); - } - }); - var attribution = function(options) { - return new Attribution(options); - }; - Control.Layers = Layers; - Control.Zoom = Zoom; - Control.Scale = Scale; - Control.Attribution = Attribution; - control.layers = layers; - control.zoom = zoom; - control.scale = scale; - control.attribution = attribution; - var Handler = Class.extend({ - initialize: function(map) { - this._map = map; - }, - // @method enable(): this - // Enables the handler - enable: function() { - if (this._enabled) { - return this; - } - this._enabled = true; - this.addHooks(); - return this; - }, - // @method disable(): this - // Disables the handler - disable: function() { - if (!this._enabled) { - return this; - } - this._enabled = false; - this.removeHooks(); - return this; - }, - // @method enabled(): Boolean - // Returns `true` if the handler is enabled - enabled: function() { - return !!this._enabled; - } - // @section Extension methods - // Classes inheriting from `Handler` must implement the two following methods: - // @method addHooks() - // Called when the handler is enabled, should add event hooks. - // @method removeHooks() - // Called when the handler is disabled, should remove the event hooks added previously. - }); - Handler.addTo = function(map, name) { - map.addHandler(name, this); - return this; - }; - var Mixin = { Events }; - var START = Browser.touch ? "touchstart mousedown" : "mousedown"; - var Draggable = Evented.extend({ - options: { - // @section - // @aka Draggable options - // @option clickTolerance: Number = 3 - // The max number of pixels a user can shift the mouse pointer during a click - // for it to be considered a valid click (as opposed to a mouse drag). - clickTolerance: 3 - }, - // @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options) - // Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default). - initialize: function(element, dragStartTarget, preventOutline2, options) { - setOptions(this, options); - this._element = element; - this._dragStartTarget = dragStartTarget || element; - this._preventOutline = preventOutline2; - }, - // @method enable() - // Enables the dragging ability - enable: function() { - if (this._enabled) { - return; - } - on(this._dragStartTarget, START, this._onDown, this); - this._enabled = true; - }, - // @method disable() - // Disables the dragging ability - disable: function() { - if (!this._enabled) { - return; - } - if (Draggable._dragging === this) { - this.finishDrag(true); - } - off(this._dragStartTarget, START, this._onDown, this); - this._enabled = false; - this._moved = false; - }, - _onDown: function(e) { - if (!this._enabled) { - return; - } - this._moved = false; - if (hasClass(this._element, "leaflet-zoom-anim")) { - return; - } - if (e.touches && e.touches.length !== 1) { - if (Draggable._dragging === this) { - this.finishDrag(); - } - return; - } - if (Draggable._dragging || e.shiftKey || e.which !== 1 && e.button !== 1 && !e.touches) { - return; - } - Draggable._dragging = this; - if (this._preventOutline) { - preventOutline(this._element); - } - disableImageDrag(); - disableTextSelection(); - if (this._moving) { - return; - } - this.fire("down"); - var first = e.touches ? e.touches[0] : e, sizedParent = getSizedParentNode(this._element); - this._startPoint = new Point(first.clientX, first.clientY); - this._startPos = getPosition(this._element); - this._parentScale = getScale(sizedParent); - var mouseevent = e.type === "mousedown"; - on(document, mouseevent ? "mousemove" : "touchmove", this._onMove, this); - on(document, mouseevent ? "mouseup" : "touchend touchcancel", this._onUp, this); - }, - _onMove: function(e) { - if (!this._enabled) { - return; - } - if (e.touches && e.touches.length > 1) { - this._moved = true; - return; - } - var first = e.touches && e.touches.length === 1 ? e.touches[0] : e, offset = new Point(first.clientX, first.clientY)._subtract(this._startPoint); - if (!offset.x && !offset.y) { - return; - } - if (Math.abs(offset.x) + Math.abs(offset.y) < this.options.clickTolerance) { - return; - } - offset.x /= this._parentScale.x; - offset.y /= this._parentScale.y; - preventDefault(e); - if (!this._moved) { - this.fire("dragstart"); - this._moved = true; - addClass(document.body, "leaflet-dragging"); - this._lastTarget = e.target || e.srcElement; - if (window.SVGElementInstance && this._lastTarget instanceof window.SVGElementInstance) { - this._lastTarget = this._lastTarget.correspondingUseElement; - } - addClass(this._lastTarget, "leaflet-drag-target"); - } - this._newPos = this._startPos.add(offset); - this._moving = true; - this._lastEvent = e; - this._updatePosition(); - }, - _updatePosition: function() { - var e = { originalEvent: this._lastEvent }; - this.fire("predrag", e); - setPosition(this._element, this._newPos); - this.fire("drag", e); - }, - _onUp: function() { - if (!this._enabled) { - return; - } - this.finishDrag(); - }, - finishDrag: function(noInertia) { - removeClass(document.body, "leaflet-dragging"); - if (this._lastTarget) { - removeClass(this._lastTarget, "leaflet-drag-target"); - this._lastTarget = null; - } - off(document, "mousemove touchmove", this._onMove, this); - off(document, "mouseup touchend touchcancel", this._onUp, this); - enableImageDrag(); - enableTextSelection(); - var fireDragend = this._moved && this._moving; - this._moving = false; - Draggable._dragging = false; - if (fireDragend) { - this.fire("dragend", { - noInertia, - distance: this._newPos.distanceTo(this._startPos) - }); - } - } - }); - function clipPolygon(points, bounds, round) { - var clippedPoints, edges = [1, 4, 2, 8], i, j, k, a, b, len, edge2, p; - for (i = 0, len = points.length; i < len; i++) { - points[i]._code = _getBitCode(points[i], bounds); - } - for (k = 0; k < 4; k++) { - edge2 = edges[k]; - clippedPoints = []; - for (i = 0, len = points.length, j = len - 1; i < len; j = i++) { - a = points[i]; - b = points[j]; - if (!(a._code & edge2)) { - if (b._code & edge2) { - p = _getEdgeIntersection(b, a, edge2, bounds, round); - p._code = _getBitCode(p, bounds); - clippedPoints.push(p); - } - clippedPoints.push(a); - } else if (!(b._code & edge2)) { - p = _getEdgeIntersection(b, a, edge2, bounds, round); - p._code = _getBitCode(p, bounds); - clippedPoints.push(p); - } - } - points = clippedPoints; - } - return points; - } - function polygonCenter(latlngs, crs) { - var i, j, p1, p2, f, area, x, y, center; - if (!latlngs || latlngs.length === 0) { - throw new Error("latlngs not passed"); - } - if (!isFlat(latlngs)) { - console.warn("latlngs are not flat! Only the first ring will be used"); - latlngs = latlngs[0]; - } - var centroidLatLng = toLatLng([0, 0]); - var bounds = toLatLngBounds(latlngs); - var areaBounds = bounds.getNorthWest().distanceTo(bounds.getSouthWest()) * bounds.getNorthEast().distanceTo(bounds.getNorthWest()); - if (areaBounds < 1700) { - centroidLatLng = centroid(latlngs); - } - var len = latlngs.length; - var points = []; - for (i = 0; i < len; i++) { - var latlng = toLatLng(latlngs[i]); - points.push(crs.project(toLatLng([latlng.lat - centroidLatLng.lat, latlng.lng - centroidLatLng.lng]))); - } - area = x = y = 0; - for (i = 0, j = len - 1; i < len; j = i++) { - p1 = points[i]; - p2 = points[j]; - f = p1.y * p2.x - p2.y * p1.x; - x += (p1.x + p2.x) * f; - y += (p1.y + p2.y) * f; - area += f * 3; - } - if (area === 0) { - center = points[0]; - } else { - center = [x / area, y / area]; - } - var latlngCenter = crs.unproject(toPoint(center)); - return toLatLng([latlngCenter.lat + centroidLatLng.lat, latlngCenter.lng + centroidLatLng.lng]); - } - function centroid(coords) { - var latSum = 0; - var lngSum = 0; - var len = 0; - for (var i = 0; i < coords.length; i++) { - var latlng = toLatLng(coords[i]); - latSum += latlng.lat; - lngSum += latlng.lng; - len++; - } - return toLatLng([latSum / len, lngSum / len]); - } - var PolyUtil = { - __proto__: null, - clipPolygon, - polygonCenter, - centroid - }; - function simplify(points, tolerance) { - if (!tolerance || !points.length) { - return points.slice(); - } - var sqTolerance = tolerance * tolerance; - points = _reducePoints(points, sqTolerance); - points = _simplifyDP(points, sqTolerance); - return points; - } - function pointToSegmentDistance(p, p1, p2) { - return Math.sqrt(_sqClosestPointOnSegment(p, p1, p2, true)); - } - function closestPointOnSegment(p, p1, p2) { - return _sqClosestPointOnSegment(p, p1, p2); - } - function _simplifyDP(points, sqTolerance) { - var len = points.length, ArrayConstructor = typeof Uint8Array !== "undefined" ? Uint8Array : Array, markers = new ArrayConstructor(len); - markers[0] = markers[len - 1] = 1; - _simplifyDPStep(points, markers, sqTolerance, 0, len - 1); - var i, newPoints = []; - for (i = 0; i < len; i++) { - if (markers[i]) { - newPoints.push(points[i]); - } - } - return newPoints; - } - function _simplifyDPStep(points, markers, sqTolerance, first, last) { - var maxSqDist = 0, index2, i, sqDist; - for (i = first + 1; i <= last - 1; i++) { - sqDist = _sqClosestPointOnSegment(points[i], points[first], points[last], true); - if (sqDist > maxSqDist) { - index2 = i; - maxSqDist = sqDist; - } - } - if (maxSqDist > sqTolerance) { - markers[index2] = 1; - _simplifyDPStep(points, markers, sqTolerance, first, index2); - _simplifyDPStep(points, markers, sqTolerance, index2, last); - } - } - function _reducePoints(points, sqTolerance) { - var reducedPoints = [points[0]]; - for (var i = 1, prev = 0, len = points.length; i < len; i++) { - if (_sqDist(points[i], points[prev]) > sqTolerance) { - reducedPoints.push(points[i]); - prev = i; - } - } - if (prev < len - 1) { - reducedPoints.push(points[len - 1]); - } - return reducedPoints; - } - var _lastCode; - function clipSegment(a, b, bounds, useLastCode, round) { - var codeA = useLastCode ? _lastCode : _getBitCode(a, bounds), codeB = _getBitCode(b, bounds), codeOut, p, newCode; - _lastCode = codeB; - while (true) { - if (!(codeA | codeB)) { - return [a, b]; - } - if (codeA & codeB) { - return false; - } - codeOut = codeA || codeB; - p = _getEdgeIntersection(a, b, codeOut, bounds, round); - newCode = _getBitCode(p, bounds); - if (codeOut === codeA) { - a = p; - codeA = newCode; - } else { - b = p; - codeB = newCode; - } - } - } - function _getEdgeIntersection(a, b, code, bounds, round) { - var dx = b.x - a.x, dy = b.y - a.y, min = bounds.min, max = bounds.max, x, y; - if (code & 8) { - x = a.x + dx * (max.y - a.y) / dy; - y = max.y; - } else if (code & 4) { - x = a.x + dx * (min.y - a.y) / dy; - y = min.y; - } else if (code & 2) { - x = max.x; - y = a.y + dy * (max.x - a.x) / dx; - } else if (code & 1) { - x = min.x; - y = a.y + dy * (min.x - a.x) / dx; - } - return new Point(x, y, round); - } - function _getBitCode(p, bounds) { - var code = 0; - if (p.x < bounds.min.x) { - code |= 1; - } else if (p.x > bounds.max.x) { - code |= 2; - } - if (p.y < bounds.min.y) { - code |= 4; - } else if (p.y > bounds.max.y) { - code |= 8; - } - return code; - } - function _sqDist(p1, p2) { - var dx = p2.x - p1.x, dy = p2.y - p1.y; - return dx * dx + dy * dy; - } - function _sqClosestPointOnSegment(p, p1, p2, sqDist) { - var x = p1.x, y = p1.y, dx = p2.x - x, dy = p2.y - y, dot = dx * dx + dy * dy, t; - if (dot > 0) { - t = ((p.x - x) * dx + (p.y - y) * dy) / dot; - if (t > 1) { - x = p2.x; - y = p2.y; - } else if (t > 0) { - x += dx * t; - y += dy * t; - } - } - dx = p.x - x; - dy = p.y - y; - return sqDist ? dx * dx + dy * dy : new Point(x, y); - } - function isFlat(latlngs) { - return !isArray(latlngs[0]) || typeof latlngs[0][0] !== "object" && typeof latlngs[0][0] !== "undefined"; - } - function _flat(latlngs) { - console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."); - return isFlat(latlngs); - } - function polylineCenter(latlngs, crs) { - var i, halfDist, segDist, dist, p1, p2, ratio, center; - if (!latlngs || latlngs.length === 0) { - throw new Error("latlngs not passed"); - } - if (!isFlat(latlngs)) { - console.warn("latlngs are not flat! Only the first ring will be used"); - latlngs = latlngs[0]; - } - var centroidLatLng = toLatLng([0, 0]); - var bounds = toLatLngBounds(latlngs); - var areaBounds = bounds.getNorthWest().distanceTo(bounds.getSouthWest()) * bounds.getNorthEast().distanceTo(bounds.getNorthWest()); - if (areaBounds < 1700) { - centroidLatLng = centroid(latlngs); - } - var len = latlngs.length; - var points = []; - for (i = 0; i < len; i++) { - var latlng = toLatLng(latlngs[i]); - points.push(crs.project(toLatLng([latlng.lat - centroidLatLng.lat, latlng.lng - centroidLatLng.lng]))); - } - for (i = 0, halfDist = 0; i < len - 1; i++) { - halfDist += points[i].distanceTo(points[i + 1]) / 2; - } - if (halfDist === 0) { - center = points[0]; - } else { - for (i = 0, dist = 0; i < len - 1; i++) { - p1 = points[i]; - p2 = points[i + 1]; - segDist = p1.distanceTo(p2); - dist += segDist; - if (dist > halfDist) { - ratio = (dist - halfDist) / segDist; - center = [ - p2.x - ratio * (p2.x - p1.x), - p2.y - ratio * (p2.y - p1.y) - ]; - break; - } - } - } - var latlngCenter = crs.unproject(toPoint(center)); - return toLatLng([latlngCenter.lat + centroidLatLng.lat, latlngCenter.lng + centroidLatLng.lng]); - } - var LineUtil = { - __proto__: null, - simplify, - pointToSegmentDistance, - closestPointOnSegment, - clipSegment, - _getEdgeIntersection, - _getBitCode, - _sqClosestPointOnSegment, - isFlat, - _flat, - polylineCenter - }; - var LonLat = { - project: function(latlng) { - return new Point(latlng.lng, latlng.lat); - }, - unproject: function(point) { - return new LatLng(point.y, point.x); - }, - bounds: new Bounds([-180, -90], [180, 90]) - }; - var Mercator = { - R: 6378137, - R_MINOR: 6356752314245179e-9, - bounds: new Bounds([-2003750834279e-5, -1549657073972e-5], [2003750834279e-5, 1876465623138e-5]), - project: function(latlng) { - var d = Math.PI / 180, r = this.R, y = latlng.lat * d, tmp = this.R_MINOR / r, e = Math.sqrt(1 - tmp * tmp), con = e * Math.sin(y); - var ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2); - y = -r * Math.log(Math.max(ts, 1e-10)); - return new Point(latlng.lng * d * r, y); - }, - unproject: function(point) { - var d = 180 / Math.PI, r = this.R, tmp = this.R_MINOR / r, e = Math.sqrt(1 - tmp * tmp), ts = Math.exp(-point.y / r), phi = Math.PI / 2 - 2 * Math.atan(ts); - for (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) { - con = e * Math.sin(phi); - con = Math.pow((1 - con) / (1 + con), e / 2); - dphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi; - phi += dphi; - } - return new LatLng(phi * d, point.x * d / r); - } - }; - var index = { - __proto__: null, - LonLat, - Mercator, - SphericalMercator - }; - var EPSG3395 = extend({}, Earth, { - code: "EPSG:3395", - projection: Mercator, - transformation: (function() { - var scale2 = 0.5 / (Math.PI * Mercator.R); - return toTransformation(scale2, 0.5, -scale2, 0.5); - })() - }); - var EPSG4326 = extend({}, Earth, { - code: "EPSG:4326", - projection: LonLat, - transformation: toTransformation(1 / 180, 1, -1 / 180, 0.5) - }); - var Simple = extend({}, CRS, { - projection: LonLat, - transformation: toTransformation(1, 0, -1, 0), - scale: function(zoom2) { - return Math.pow(2, zoom2); - }, - zoom: function(scale2) { - return Math.log(scale2) / Math.LN2; - }, - distance: function(latlng1, latlng2) { - var dx = latlng2.lng - latlng1.lng, dy = latlng2.lat - latlng1.lat; - return Math.sqrt(dx * dx + dy * dy); - }, - infinite: true - }); - CRS.Earth = Earth; - CRS.EPSG3395 = EPSG3395; - CRS.EPSG3857 = EPSG3857; - CRS.EPSG900913 = EPSG900913; - CRS.EPSG4326 = EPSG4326; - CRS.Simple = Simple; - var Layer = Evented.extend({ - // Classes extending `L.Layer` will inherit the following options: - options: { - // @option pane: String = 'overlayPane' - // By default the layer will be added to the map's [overlay pane](#map-overlaypane). Overriding this option will cause the layer to be placed on another pane by default. - pane: "overlayPane", - // @option attribution: String = null - // String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. - attribution: null, - bubblingMouseEvents: true - }, - /* @section - * Classes extending `L.Layer` will inherit the following methods: - * - * @method addTo(map: Map|LayerGroup): this - * Adds the layer to the given map or layer group. - */ - addTo: function(map) { - map.addLayer(this); - return this; - }, - // @method remove: this - // Removes the layer from the map it is currently active on. - remove: function() { - return this.removeFrom(this._map || this._mapToAdd); - }, - // @method removeFrom(map: Map): this - // Removes the layer from the given map - // - // @alternative - // @method removeFrom(group: LayerGroup): this - // Removes the layer from the given `LayerGroup` - removeFrom: function(obj) { - if (obj) { - obj.removeLayer(this); - } - return this; - }, - // @method getPane(name? : String): HTMLElement - // Returns the `HTMLElement` representing the named pane on the map. If `name` is omitted, returns the pane for this layer. - getPane: function(name) { - return this._map.getPane(name ? this.options[name] || name : this.options.pane); - }, - addInteractiveTarget: function(targetEl) { - this._map._targets[stamp(targetEl)] = this; - return this; - }, - removeInteractiveTarget: function(targetEl) { - delete this._map._targets[stamp(targetEl)]; - return this; - }, - // @method getAttribution: String - // Used by the `attribution control`, returns the [attribution option](#gridlayer-attribution). - getAttribution: function() { - return this.options.attribution; - }, - _layerAdd: function(e) { - var map = e.target; - if (!map.hasLayer(this)) { - return; - } - this._map = map; - this._zoomAnimated = map._zoomAnimated; - if (this.getEvents) { - var events = this.getEvents(); - map.on(events, this); - this.once("remove", function() { - map.off(events, this); - }, this); - } - this.onAdd(map); - this.fire("add"); - map.fire("layeradd", { layer: this }); - } - }); - Map.include({ - // @method addLayer(layer: Layer): this - // Adds the given layer to the map - addLayer: function(layer) { - if (!layer._layerAdd) { - throw new Error("The provided object is not a Layer."); - } - var id = stamp(layer); - if (this._layers[id]) { - return this; - } - this._layers[id] = layer; - layer._mapToAdd = this; - if (layer.beforeAdd) { - layer.beforeAdd(this); - } - this.whenReady(layer._layerAdd, layer); - return this; - }, - // @method removeLayer(layer: Layer): this - // Removes the given layer from the map. - removeLayer: function(layer) { - var id = stamp(layer); - if (!this._layers[id]) { - return this; - } - if (this._loaded) { - layer.onRemove(this); - } - delete this._layers[id]; - if (this._loaded) { - this.fire("layerremove", { layer }); - layer.fire("remove"); - } - layer._map = layer._mapToAdd = null; - return this; - }, - // @method hasLayer(layer: Layer): Boolean - // Returns `true` if the given layer is currently added to the map - hasLayer: function(layer) { - return stamp(layer) in this._layers; - }, - /* @method eachLayer(fn: Function, context?: Object): this - * Iterates over the layers of the map, optionally specifying context of the iterator function. - * ``` - * map.eachLayer(function(layer){ - * layer.bindPopup('Hello'); - * }); - * ``` - */ - eachLayer: function(method, context) { - for (var i in this._layers) { - method.call(context, this._layers[i]); - } - return this; - }, - _addLayers: function(layers2) { - layers2 = layers2 ? isArray(layers2) ? layers2 : [layers2] : []; - for (var i = 0, len = layers2.length; i < len; i++) { - this.addLayer(layers2[i]); - } - }, - _addZoomLimit: function(layer) { - if (!isNaN(layer.options.maxZoom) || !isNaN(layer.options.minZoom)) { - this._zoomBoundLayers[stamp(layer)] = layer; - this._updateZoomLevels(); - } - }, - _removeZoomLimit: function(layer) { - var id = stamp(layer); - if (this._zoomBoundLayers[id]) { - delete this._zoomBoundLayers[id]; - this._updateZoomLevels(); - } - }, - _updateZoomLevels: function() { - var minZoom = Infinity, maxZoom = -Infinity, oldZoomSpan = this._getZoomSpan(); - for (var i in this._zoomBoundLayers) { - var options = this._zoomBoundLayers[i].options; - minZoom = options.minZoom === void 0 ? minZoom : Math.min(minZoom, options.minZoom); - maxZoom = options.maxZoom === void 0 ? maxZoom : Math.max(maxZoom, options.maxZoom); - } - this._layersMaxZoom = maxZoom === -Infinity ? void 0 : maxZoom; - this._layersMinZoom = minZoom === Infinity ? void 0 : minZoom; - if (oldZoomSpan !== this._getZoomSpan()) { - this.fire("zoomlevelschange"); - } - if (this.options.maxZoom === void 0 && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom) { - this.setZoom(this._layersMaxZoom); - } - if (this.options.minZoom === void 0 && this._layersMinZoom && this.getZoom() < this._layersMinZoom) { - this.setZoom(this._layersMinZoom); - } - } - }); - var LayerGroup = Layer.extend({ - initialize: function(layers2, options) { - setOptions(this, options); - this._layers = {}; - var i, len; - if (layers2) { - for (i = 0, len = layers2.length; i < len; i++) { - this.addLayer(layers2[i]); - } - } - }, - // @method addLayer(layer: Layer): this - // Adds the given layer to the group. - addLayer: function(layer) { - var id = this.getLayerId(layer); - this._layers[id] = layer; - if (this._map) { - this._map.addLayer(layer); - } - return this; - }, - // @method removeLayer(layer: Layer): this - // Removes the given layer from the group. - // @alternative - // @method removeLayer(id: Number): this - // Removes the layer with the given internal ID from the group. - removeLayer: function(layer) { - var id = layer in this._layers ? layer : this.getLayerId(layer); - if (this._map && this._layers[id]) { - this._map.removeLayer(this._layers[id]); - } - delete this._layers[id]; - return this; - }, - // @method hasLayer(layer: Layer): Boolean - // Returns `true` if the given layer is currently added to the group. - // @alternative - // @method hasLayer(id: Number): Boolean - // Returns `true` if the given internal ID is currently added to the group. - hasLayer: function(layer) { - var layerId = typeof layer === "number" ? layer : this.getLayerId(layer); - return layerId in this._layers; - }, - // @method clearLayers(): this - // Removes all the layers from the group. - clearLayers: function() { - return this.eachLayer(this.removeLayer, this); - }, - // @method invoke(methodName: String, …): this - // Calls `methodName` on every layer contained in this group, passing any - // additional parameters. Has no effect if the layers contained do not - // implement `methodName`. - invoke: function(methodName) { - var args = Array.prototype.slice.call(arguments, 1), i, layer; - for (i in this._layers) { - layer = this._layers[i]; - if (layer[methodName]) { - layer[methodName].apply(layer, args); - } - } - return this; - }, - onAdd: function(map) { - this.eachLayer(map.addLayer, map); - }, - onRemove: function(map) { - this.eachLayer(map.removeLayer, map); - }, - // @method eachLayer(fn: Function, context?: Object): this - // Iterates over the layers of the group, optionally specifying context of the iterator function. - // ```js - // group.eachLayer(function (layer) { - // layer.bindPopup('Hello'); - // }); - // ``` - eachLayer: function(method, context) { - for (var i in this._layers) { - method.call(context, this._layers[i]); - } - return this; - }, - // @method getLayer(id: Number): Layer - // Returns the layer with the given internal ID. - getLayer: function(id) { - return this._layers[id]; - }, - // @method getLayers(): Layer[] - // Returns an array of all the layers added to the group. - getLayers: function() { - var layers2 = []; - this.eachLayer(layers2.push, layers2); - return layers2; - }, - // @method setZIndex(zIndex: Number): this - // Calls `setZIndex` on every layer contained in this group, passing the z-index. - setZIndex: function(zIndex) { - return this.invoke("setZIndex", zIndex); - }, - // @method getLayerId(layer: Layer): Number - // Returns the internal ID for a layer - getLayerId: function(layer) { - return stamp(layer); - } - }); - var layerGroup = function(layers2, options) { - return new LayerGroup(layers2, options); - }; - var FeatureGroup = LayerGroup.extend({ - addLayer: function(layer) { - if (this.hasLayer(layer)) { - return this; - } - layer.addEventParent(this); - LayerGroup.prototype.addLayer.call(this, layer); - return this.fire("layeradd", { layer }); - }, - removeLayer: function(layer) { - if (!this.hasLayer(layer)) { - return this; - } - if (layer in this._layers) { - layer = this._layers[layer]; - } - layer.removeEventParent(this); - LayerGroup.prototype.removeLayer.call(this, layer); - return this.fire("layerremove", { layer }); - }, - // @method setStyle(style: Path options): this - // Sets the given path options to each layer of the group that has a `setStyle` method. - setStyle: function(style2) { - return this.invoke("setStyle", style2); - }, - // @method bringToFront(): this - // Brings the layer group to the top of all other layers - bringToFront: function() { - return this.invoke("bringToFront"); - }, - // @method bringToBack(): this - // Brings the layer group to the back of all other layers - bringToBack: function() { - return this.invoke("bringToBack"); - }, - // @method getBounds(): LatLngBounds - // Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children). - getBounds: function() { - var bounds = new LatLngBounds(); - for (var id in this._layers) { - var layer = this._layers[id]; - bounds.extend(layer.getBounds ? layer.getBounds() : layer.getLatLng()); - } - return bounds; - } - }); - var featureGroup = function(layers2, options) { - return new FeatureGroup(layers2, options); - }; - var Icon = Class.extend({ - /* @section - * @aka Icon options - * - * @option iconUrl: String = null - * **(required)** The URL to the icon image (absolute or relative to your script path). - * - * @option iconRetinaUrl: String = null - * The URL to a retina sized version of the icon image (absolute or relative to your - * script path). Used for Retina screen devices. - * - * @option iconSize: Point = null - * Size of the icon image in pixels. - * - * @option iconAnchor: Point = null - * The coordinates of the "tip" of the icon (relative to its top left corner). The icon - * will be aligned so that this point is at the marker's geographical location. Centered - * by default if size is specified, also can be set in CSS with negative margins. - * - * @option popupAnchor: Point = [0, 0] - * The coordinates of the point from which popups will "open", relative to the icon anchor. - * - * @option tooltipAnchor: Point = [0, 0] - * The coordinates of the point from which tooltips will "open", relative to the icon anchor. - * - * @option shadowUrl: String = null - * The URL to the icon shadow image. If not specified, no shadow image will be created. - * - * @option shadowRetinaUrl: String = null - * - * @option shadowSize: Point = null - * Size of the shadow image in pixels. - * - * @option shadowAnchor: Point = null - * The coordinates of the "tip" of the shadow (relative to its top left corner) (the same - * as iconAnchor if not specified). - * - * @option className: String = '' - * A custom class name to assign to both icon and shadow images. Empty by default. - */ - options: { - popupAnchor: [0, 0], - tooltipAnchor: [0, 0], - // @option crossOrigin: Boolean|String = false - // Whether the crossOrigin attribute will be added to the tiles. - // If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data. - // Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values. - crossOrigin: false - }, - initialize: function(options) { - setOptions(this, options); - }, - // @method createIcon(oldIcon?: HTMLElement): HTMLElement - // Called internally when the icon has to be shown, returns a `` HTML element - // styled according to the options. - createIcon: function(oldIcon) { - return this._createIcon("icon", oldIcon); - }, - // @method createShadow(oldIcon?: HTMLElement): HTMLElement - // As `createIcon`, but for the shadow beneath it. - createShadow: function(oldIcon) { - return this._createIcon("shadow", oldIcon); - }, - _createIcon: function(name, oldIcon) { - var src = this._getIconUrl(name); - if (!src) { - if (name === "icon") { - throw new Error("iconUrl not set in Icon options (see the docs)."); - } - return null; - } - var img = this._createImg(src, oldIcon && oldIcon.tagName === "IMG" ? oldIcon : null); - this._setIconStyles(img, name); - if (this.options.crossOrigin || this.options.crossOrigin === "") { - img.crossOrigin = this.options.crossOrigin === true ? "" : this.options.crossOrigin; - } - return img; - }, - _setIconStyles: function(img, name) { - var options = this.options; - var sizeOption = options[name + "Size"]; - if (typeof sizeOption === "number") { - sizeOption = [sizeOption, sizeOption]; - } - var size = toPoint(sizeOption), anchor = toPoint(name === "shadow" && options.shadowAnchor || options.iconAnchor || size && size.divideBy(2, true)); - img.className = "leaflet-marker-" + name + " " + (options.className || ""); - if (anchor) { - img.style.marginLeft = -anchor.x + "px"; - img.style.marginTop = -anchor.y + "px"; - } - if (size) { - img.style.width = size.x + "px"; - img.style.height = size.y + "px"; - } - }, - _createImg: function(src, el) { - el = el || document.createElement("img"); - el.src = src; - return el; - }, - _getIconUrl: function(name) { - return Browser.retina && this.options[name + "RetinaUrl"] || this.options[name + "Url"]; - } - }); - function icon(options) { - return new Icon(options); - } - var IconDefault = Icon.extend({ - options: { - iconUrl: "marker-icon.png", - iconRetinaUrl: "marker-icon-2x.png", - shadowUrl: "marker-shadow.png", - iconSize: [25, 41], - iconAnchor: [12, 41], - popupAnchor: [1, -34], - tooltipAnchor: [16, -28], - shadowSize: [41, 41] - }, - _getIconUrl: function(name) { - if (typeof IconDefault.imagePath !== "string") { - IconDefault.imagePath = this._detectIconPath(); - } - return (this.options.imagePath || IconDefault.imagePath) + Icon.prototype._getIconUrl.call(this, name); - }, - _stripUrl: function(path) { - var strip = function(str, re, idx) { - var match = re.exec(str); - return match && match[idx]; - }; - path = strip(path, /^url\((['"])?(.+)\1\)$/, 2); - return path && strip(path, /^(.*)marker-icon\.png$/, 1); - }, - _detectIconPath: function() { - var el = create$1("div", "leaflet-default-icon-path", document.body); - var path = getStyle(el, "background-image") || getStyle(el, "backgroundImage"); - document.body.removeChild(el); - path = this._stripUrl(path); - if (path) { - return path; - } - var link = document.querySelector('link[href$="leaflet.css"]'); - if (!link) { - return ""; - } - return link.href.substring(0, link.href.length - "leaflet.css".length - 1); - } - }); - var MarkerDrag = Handler.extend({ - initialize: function(marker2) { - this._marker = marker2; - }, - addHooks: function() { - var icon2 = this._marker._icon; - if (!this._draggable) { - this._draggable = new Draggable(icon2, icon2, true); - } - this._draggable.on({ - dragstart: this._onDragStart, - predrag: this._onPreDrag, - drag: this._onDrag, - dragend: this._onDragEnd - }, this).enable(); - addClass(icon2, "leaflet-marker-draggable"); - }, - removeHooks: function() { - this._draggable.off({ - dragstart: this._onDragStart, - predrag: this._onPreDrag, - drag: this._onDrag, - dragend: this._onDragEnd - }, this).disable(); - if (this._marker._icon) { - removeClass(this._marker._icon, "leaflet-marker-draggable"); - } - }, - moved: function() { - return this._draggable && this._draggable._moved; - }, - _adjustPan: function(e) { - var marker2 = this._marker, map = marker2._map, speed = this._marker.options.autoPanSpeed, padding = this._marker.options.autoPanPadding, iconPos = getPosition(marker2._icon), bounds = map.getPixelBounds(), origin = map.getPixelOrigin(); - var panBounds = toBounds( - bounds.min._subtract(origin).add(padding), - bounds.max._subtract(origin).subtract(padding) - ); - if (!panBounds.contains(iconPos)) { - var movement = toPoint( - (Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) - (Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x), - (Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) - (Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y) - ).multiplyBy(speed); - map.panBy(movement, { animate: false }); - this._draggable._newPos._add(movement); - this._draggable._startPos._add(movement); - setPosition(marker2._icon, this._draggable._newPos); - this._onDrag(e); - this._panRequest = requestAnimFrame(this._adjustPan.bind(this, e)); - } - }, - _onDragStart: function() { - this._oldLatLng = this._marker.getLatLng(); - this._marker.closePopup && this._marker.closePopup(); - this._marker.fire("movestart").fire("dragstart"); - }, - _onPreDrag: function(e) { - if (this._marker.options.autoPan) { - cancelAnimFrame(this._panRequest); - this._panRequest = requestAnimFrame(this._adjustPan.bind(this, e)); - } - }, - _onDrag: function(e) { - var marker2 = this._marker, shadow = marker2._shadow, iconPos = getPosition(marker2._icon), latlng = marker2._map.layerPointToLatLng(iconPos); - if (shadow) { - setPosition(shadow, iconPos); - } - marker2._latlng = latlng; - e.latlng = latlng; - e.oldLatLng = this._oldLatLng; - marker2.fire("move", e).fire("drag", e); - }, - _onDragEnd: function(e) { - cancelAnimFrame(this._panRequest); - delete this._oldLatLng; - this._marker.fire("moveend").fire("dragend", e); - } - }); - var Marker = Layer.extend({ - // @section - // @aka Marker options - options: { - // @option icon: Icon = * - // Icon instance to use for rendering the marker. - // See [Icon documentation](#L.Icon) for details on how to customize the marker icon. - // If not specified, a common instance of `L.Icon.Default` is used. - icon: new IconDefault(), - // Option inherited from "Interactive layer" abstract class - interactive: true, - // @option keyboard: Boolean = true - // Whether the marker can be tabbed to with a keyboard and clicked by pressing enter. - keyboard: true, - // @option title: String = '' - // Text for the browser tooltip that appear on marker hover (no tooltip by default). - // [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled). - title: "", - // @option alt: String = 'Marker' - // Text for the `alt` attribute of the icon image. - // [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled). - alt: "Marker", - // @option zIndexOffset: Number = 0 - // By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like `1000` (or high negative value, respectively). - zIndexOffset: 0, - // @option opacity: Number = 1.0 - // The opacity of the marker. - opacity: 1, - // @option riseOnHover: Boolean = false - // If `true`, the marker will get on top of others when you hover the mouse over it. - riseOnHover: false, - // @option riseOffset: Number = 250 - // The z-index offset used for the `riseOnHover` feature. - riseOffset: 250, - // @option pane: String = 'markerPane' - // `Map pane` where the markers icon will be added. - pane: "markerPane", - // @option shadowPane: String = 'shadowPane' - // `Map pane` where the markers shadow will be added. - shadowPane: "shadowPane", - // @option bubblingMouseEvents: Boolean = false - // When `true`, a mouse event on this marker will trigger the same event on the map - // (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used). - bubblingMouseEvents: false, - // @option autoPanOnFocus: Boolean = true - // When `true`, the map will pan whenever the marker is focused (via - // e.g. pressing `tab` on the keyboard) to ensure the marker is - // visible within the map's bounds - autoPanOnFocus: true, - // @section Draggable marker options - // @option draggable: Boolean = false - // Whether the marker is draggable with mouse/touch or not. - draggable: false, - // @option autoPan: Boolean = false - // Whether to pan the map when dragging this marker near its edge or not. - autoPan: false, - // @option autoPanPadding: Point = Point(50, 50) - // Distance (in pixels to the left/right and to the top/bottom) of the - // map edge to start panning the map. - autoPanPadding: [50, 50], - // @option autoPanSpeed: Number = 10 - // Number of pixels the map should pan by. - autoPanSpeed: 10 - }, - /* @section - * - * In addition to [shared layer methods](#Layer) like `addTo()` and `remove()` and [popup methods](#Popup) like bindPopup() you can also use the following methods: - */ - initialize: function(latlng, options) { - setOptions(this, options); - this._latlng = toLatLng(latlng); - }, - onAdd: function(map) { - this._zoomAnimated = this._zoomAnimated && map.options.markerZoomAnimation; - if (this._zoomAnimated) { - map.on("zoomanim", this._animateZoom, this); - } - this._initIcon(); - this.update(); - }, - onRemove: function(map) { - if (this.dragging && this.dragging.enabled()) { - this.options.draggable = true; - this.dragging.removeHooks(); - } - delete this.dragging; - if (this._zoomAnimated) { - map.off("zoomanim", this._animateZoom, this); - } - this._removeIcon(); - this._removeShadow(); - }, - getEvents: function() { - return { - zoom: this.update, - viewreset: this.update - }; - }, - // @method getLatLng: LatLng - // Returns the current geographical position of the marker. - getLatLng: function() { - return this._latlng; - }, - // @method setLatLng(latlng: LatLng): this - // Changes the marker position to the given point. - setLatLng: function(latlng) { - var oldLatLng = this._latlng; - this._latlng = toLatLng(latlng); - this.update(); - return this.fire("move", { oldLatLng, latlng: this._latlng }); - }, - // @method setZIndexOffset(offset: Number): this - // Changes the [zIndex offset](#marker-zindexoffset) of the marker. - setZIndexOffset: function(offset) { - this.options.zIndexOffset = offset; - return this.update(); - }, - // @method getIcon: Icon - // Returns the current icon used by the marker - getIcon: function() { - return this.options.icon; - }, - // @method setIcon(icon: Icon): this - // Changes the marker icon. - setIcon: function(icon2) { - this.options.icon = icon2; - if (this._map) { - this._initIcon(); - this.update(); - } - if (this._popup) { - this.bindPopup(this._popup, this._popup.options); - } - return this; - }, - getElement: function() { - return this._icon; - }, - update: function() { - if (this._icon && this._map) { - var pos = this._map.latLngToLayerPoint(this._latlng).round(); - this._setPos(pos); - } - return this; - }, - _initIcon: function() { - var options = this.options, classToAdd = "leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide"); - var icon2 = options.icon.createIcon(this._icon), addIcon = false; - if (icon2 !== this._icon) { - if (this._icon) { - this._removeIcon(); - } - addIcon = true; - if (options.title) { - icon2.title = options.title; - } - if (icon2.tagName === "IMG") { - icon2.alt = options.alt || ""; - } - } - addClass(icon2, classToAdd); - if (options.keyboard) { - icon2.tabIndex = "0"; - icon2.setAttribute("role", "button"); - } - this._icon = icon2; - if (options.riseOnHover) { - this.on({ - mouseover: this._bringToFront, - mouseout: this._resetZIndex - }); - } - if (this.options.autoPanOnFocus) { - on(icon2, "focus", this._panOnFocus, this); - } - var newShadow = options.icon.createShadow(this._shadow), addShadow = false; - if (newShadow !== this._shadow) { - this._removeShadow(); - addShadow = true; - } - if (newShadow) { - addClass(newShadow, classToAdd); - newShadow.alt = ""; - } - this._shadow = newShadow; - if (options.opacity < 1) { - this._updateOpacity(); - } - if (addIcon) { - this.getPane().appendChild(this._icon); - } - this._initInteraction(); - if (newShadow && addShadow) { - this.getPane(options.shadowPane).appendChild(this._shadow); - } - }, - _removeIcon: function() { - if (this.options.riseOnHover) { - this.off({ - mouseover: this._bringToFront, - mouseout: this._resetZIndex - }); - } - if (this.options.autoPanOnFocus) { - off(this._icon, "focus", this._panOnFocus, this); - } - remove(this._icon); - this.removeInteractiveTarget(this._icon); - this._icon = null; - }, - _removeShadow: function() { - if (this._shadow) { - remove(this._shadow); - } - this._shadow = null; - }, - _setPos: function(pos) { - if (this._icon) { - setPosition(this._icon, pos); - } - if (this._shadow) { - setPosition(this._shadow, pos); - } - this._zIndex = pos.y + this.options.zIndexOffset; - this._resetZIndex(); - }, - _updateZIndex: function(offset) { - if (this._icon) { - this._icon.style.zIndex = this._zIndex + offset; - } - }, - _animateZoom: function(opt) { - var pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center).round(); - this._setPos(pos); - }, - _initInteraction: function() { - if (!this.options.interactive) { - return; - } - addClass(this._icon, "leaflet-interactive"); - this.addInteractiveTarget(this._icon); - if (MarkerDrag) { - var draggable = this.options.draggable; - if (this.dragging) { - draggable = this.dragging.enabled(); - this.dragging.disable(); - } - this.dragging = new MarkerDrag(this); - if (draggable) { - this.dragging.enable(); - } - } - }, - // @method setOpacity(opacity: Number): this - // Changes the opacity of the marker. - setOpacity: function(opacity) { - this.options.opacity = opacity; - if (this._map) { - this._updateOpacity(); - } - return this; - }, - _updateOpacity: function() { - var opacity = this.options.opacity; - if (this._icon) { - setOpacity(this._icon, opacity); - } - if (this._shadow) { - setOpacity(this._shadow, opacity); - } - }, - _bringToFront: function() { - this._updateZIndex(this.options.riseOffset); - }, - _resetZIndex: function() { - this._updateZIndex(0); - }, - _panOnFocus: function() { - var map = this._map; - if (!map) { - return; - } - var iconOpts = this.options.icon.options; - var size = iconOpts.iconSize ? toPoint(iconOpts.iconSize) : toPoint(0, 0); - var anchor = iconOpts.iconAnchor ? toPoint(iconOpts.iconAnchor) : toPoint(0, 0); - map.panInside(this._latlng, { - paddingTopLeft: anchor, - paddingBottomRight: size.subtract(anchor) - }); - }, - _getPopupAnchor: function() { - return this.options.icon.options.popupAnchor; - }, - _getTooltipAnchor: function() { - return this.options.icon.options.tooltipAnchor; - } - }); - function marker(latlng, options) { - return new Marker(latlng, options); - } - var Path = Layer.extend({ - // @section - // @aka Path options - options: { - // @option stroke: Boolean = true - // Whether to draw stroke along the path. Set it to `false` to disable borders on polygons or circles. - stroke: true, - // @option color: String = '#3388ff' - // Stroke color - color: "#3388ff", - // @option weight: Number = 3 - // Stroke width in pixels - weight: 3, - // @option opacity: Number = 1.0 - // Stroke opacity - opacity: 1, - // @option lineCap: String= 'round' - // A string that defines [shape to be used at the end](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap) of the stroke. - lineCap: "round", - // @option lineJoin: String = 'round' - // A string that defines [shape to be used at the corners](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin) of the stroke. - lineJoin: "round", - // @option dashArray: String = null - // A string that defines the stroke [dash pattern](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility). - dashArray: null, - // @option dashOffset: String = null - // A string that defines the [distance into the dash pattern to start the dash](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility). - dashOffset: null, - // @option fill: Boolean = depends - // Whether to fill the path with color. Set it to `false` to disable filling on polygons or circles. - fill: false, - // @option fillColor: String = * - // Fill color. Defaults to the value of the [`color`](#path-color) option - fillColor: null, - // @option fillOpacity: Number = 0.2 - // Fill opacity. - fillOpacity: 0.2, - // @option fillRule: String = 'evenodd' - // A string that defines [how the inside of a shape](https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule) is determined. - fillRule: "evenodd", - // className: '', - // Option inherited from "Interactive layer" abstract class - interactive: true, - // @option bubblingMouseEvents: Boolean = true - // When `true`, a mouse event on this path will trigger the same event on the map - // (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used). - bubblingMouseEvents: true - }, - beforeAdd: function(map) { - this._renderer = map.getRenderer(this); - }, - onAdd: function() { - this._renderer._initPath(this); - this._reset(); - this._renderer._addPath(this); - }, - onRemove: function() { - this._renderer._removePath(this); - }, - // @method redraw(): this - // Redraws the layer. Sometimes useful after you changed the coordinates that the path uses. - redraw: function() { - if (this._map) { - this._renderer._updatePath(this); - } - return this; - }, - // @method setStyle(style: Path options): this - // Changes the appearance of a Path based on the options in the `Path options` object. - setStyle: function(style2) { - setOptions(this, style2); - if (this._renderer) { - this._renderer._updateStyle(this); - if (this.options.stroke && style2 && Object.prototype.hasOwnProperty.call(style2, "weight")) { - this._updateBounds(); - } - } - return this; - }, - // @method bringToFront(): this - // Brings the layer to the top of all path layers. - bringToFront: function() { - if (this._renderer) { - this._renderer._bringToFront(this); - } - return this; - }, - // @method bringToBack(): this - // Brings the layer to the bottom of all path layers. - bringToBack: function() { - if (this._renderer) { - this._renderer._bringToBack(this); - } - return this; - }, - getElement: function() { - return this._path; - }, - _reset: function() { - this._project(); - this._update(); - }, - _clickTolerance: function() { - return (this.options.stroke ? this.options.weight / 2 : 0) + (this._renderer.options.tolerance || 0); - } - }); - var CircleMarker = Path.extend({ - // @section - // @aka CircleMarker options - options: { - fill: true, - // @option radius: Number = 10 - // Radius of the circle marker, in pixels - radius: 10 - }, - initialize: function(latlng, options) { - setOptions(this, options); - this._latlng = toLatLng(latlng); - this._radius = this.options.radius; - }, - // @method setLatLng(latLng: LatLng): this - // Sets the position of a circle marker to a new location. - setLatLng: function(latlng) { - var oldLatLng = this._latlng; - this._latlng = toLatLng(latlng); - this.redraw(); - return this.fire("move", { oldLatLng, latlng: this._latlng }); - }, - // @method getLatLng(): LatLng - // Returns the current geographical position of the circle marker - getLatLng: function() { - return this._latlng; - }, - // @method setRadius(radius: Number): this - // Sets the radius of a circle marker. Units are in pixels. - setRadius: function(radius) { - this.options.radius = this._radius = radius; - return this.redraw(); - }, - // @method getRadius(): Number - // Returns the current radius of the circle - getRadius: function() { - return this._radius; - }, - setStyle: function(options) { - var radius = options && options.radius || this._radius; - Path.prototype.setStyle.call(this, options); - this.setRadius(radius); - return this; - }, - _project: function() { - this._point = this._map.latLngToLayerPoint(this._latlng); - this._updateBounds(); - }, - _updateBounds: function() { - var r = this._radius, r2 = this._radiusY || r, w = this._clickTolerance(), p = [r + w, r2 + w]; - this._pxBounds = new Bounds(this._point.subtract(p), this._point.add(p)); - }, - _update: function() { - if (this._map) { - this._updatePath(); - } - }, - _updatePath: function() { - this._renderer._updateCircle(this); - }, - _empty: function() { - return this._radius && !this._renderer._bounds.intersects(this._pxBounds); - }, - // Needed by the `Canvas` renderer for interactivity - _containsPoint: function(p) { - return p.distanceTo(this._point) <= this._radius + this._clickTolerance(); - } - }); - function circleMarker(latlng, options) { - return new CircleMarker(latlng, options); - } - var Circle = CircleMarker.extend({ - initialize: function(latlng, options, legacyOptions) { - if (typeof options === "number") { - options = extend({}, legacyOptions, { radius: options }); - } - setOptions(this, options); - this._latlng = toLatLng(latlng); - if (isNaN(this.options.radius)) { - throw new Error("Circle radius cannot be NaN"); - } - this._mRadius = this.options.radius; - }, - // @method setRadius(radius: Number): this - // Sets the radius of a circle. Units are in meters. - setRadius: function(radius) { - this._mRadius = radius; - return this.redraw(); - }, - // @method getRadius(): Number - // Returns the current radius of a circle. Units are in meters. - getRadius: function() { - return this._mRadius; - }, - // @method getBounds(): LatLngBounds - // Returns the `LatLngBounds` of the path. - getBounds: function() { - var half = [this._radius, this._radiusY || this._radius]; - return new LatLngBounds( - this._map.layerPointToLatLng(this._point.subtract(half)), - this._map.layerPointToLatLng(this._point.add(half)) - ); - }, - setStyle: Path.prototype.setStyle, - _project: function() { - var lng = this._latlng.lng, lat = this._latlng.lat, map = this._map, crs = map.options.crs; - if (crs.distance === Earth.distance) { - var d = Math.PI / 180, latR = this._mRadius / Earth.R / d, top = map.project([lat + latR, lng]), bottom = map.project([lat - latR, lng]), p = top.add(bottom).divideBy(2), lat2 = map.unproject(p).lat, lngR = Math.acos((Math.cos(latR * d) - Math.sin(lat * d) * Math.sin(lat2 * d)) / (Math.cos(lat * d) * Math.cos(lat2 * d))) / d; - if (isNaN(lngR) || lngR === 0) { - lngR = latR / Math.cos(Math.PI / 180 * lat); - } - this._point = p.subtract(map.getPixelOrigin()); - this._radius = isNaN(lngR) ? 0 : p.x - map.project([lat2, lng - lngR]).x; - this._radiusY = p.y - top.y; - } else { - var latlng2 = crs.unproject(crs.project(this._latlng).subtract([this._mRadius, 0])); - this._point = map.latLngToLayerPoint(this._latlng); - this._radius = this._point.x - map.latLngToLayerPoint(latlng2).x; - } - this._updateBounds(); - } - }); - function circle(latlng, options, legacyOptions) { - return new Circle(latlng, options, legacyOptions); - } - var Polyline = Path.extend({ - // @section - // @aka Polyline options - options: { - // @option smoothFactor: Number = 1.0 - // How much to simplify the polyline on each zoom level. More means - // better performance and smoother look, and less means more accurate representation. - smoothFactor: 1, - // @option noClip: Boolean = false - // Disable polyline clipping. - noClip: false - }, - initialize: function(latlngs, options) { - setOptions(this, options); - this._setLatLngs(latlngs); - }, - // @method getLatLngs(): LatLng[] - // Returns an array of the points in the path, or nested arrays of points in case of multi-polyline. - getLatLngs: function() { - return this._latlngs; - }, - // @method setLatLngs(latlngs: LatLng[]): this - // Replaces all the points in the polyline with the given array of geographical points. - setLatLngs: function(latlngs) { - this._setLatLngs(latlngs); - return this.redraw(); - }, - // @method isEmpty(): Boolean - // Returns `true` if the Polyline has no LatLngs. - isEmpty: function() { - return !this._latlngs.length; - }, - // @method closestLayerPoint(p: Point): Point - // Returns the point closest to `p` on the Polyline. - closestLayerPoint: function(p) { - var minDistance = Infinity, minPoint = null, closest = _sqClosestPointOnSegment, p1, p2; - for (var j = 0, jLen = this._parts.length; j < jLen; j++) { - var points = this._parts[j]; - for (var i = 1, len = points.length; i < len; i++) { - p1 = points[i - 1]; - p2 = points[i]; - var sqDist = closest(p, p1, p2, true); - if (sqDist < minDistance) { - minDistance = sqDist; - minPoint = closest(p, p1, p2); - } - } - } - if (minPoint) { - minPoint.distance = Math.sqrt(minDistance); - } - return minPoint; - }, - // @method getCenter(): LatLng - // Returns the center ([centroid](https://en.wikipedia.org/wiki/Centroid)) of the polyline. - getCenter: function() { - if (!this._map) { - throw new Error("Must add layer to map before using getCenter()"); - } - return polylineCenter(this._defaultShape(), this._map.options.crs); - }, - // @method getBounds(): LatLngBounds - // Returns the `LatLngBounds` of the path. - getBounds: function() { - return this._bounds; - }, - // @method addLatLng(latlng: LatLng, latlngs?: LatLng[]): this - // Adds a given point to the polyline. By default, adds to the first ring of - // the polyline in case of a multi-polyline, but can be overridden by passing - // a specific ring as a LatLng array (that you can earlier access with [`getLatLngs`](#polyline-getlatlngs)). - addLatLng: function(latlng, latlngs) { - latlngs = latlngs || this._defaultShape(); - latlng = toLatLng(latlng); - latlngs.push(latlng); - this._bounds.extend(latlng); - return this.redraw(); - }, - _setLatLngs: function(latlngs) { - this._bounds = new LatLngBounds(); - this._latlngs = this._convertLatLngs(latlngs); - }, - _defaultShape: function() { - return isFlat(this._latlngs) ? this._latlngs : this._latlngs[0]; - }, - // recursively convert latlngs input into actual LatLng instances; calculate bounds along the way - _convertLatLngs: function(latlngs) { - var result = [], flat = isFlat(latlngs); - for (var i = 0, len = latlngs.length; i < len; i++) { - if (flat) { - result[i] = toLatLng(latlngs[i]); - this._bounds.extend(result[i]); - } else { - result[i] = this._convertLatLngs(latlngs[i]); - } - } - return result; - }, - _project: function() { - var pxBounds = new Bounds(); - this._rings = []; - this._projectLatlngs(this._latlngs, this._rings, pxBounds); - if (this._bounds.isValid() && pxBounds.isValid()) { - this._rawPxBounds = pxBounds; - this._updateBounds(); - } - }, - _updateBounds: function() { - var w = this._clickTolerance(), p = new Point(w, w); - if (!this._rawPxBounds) { - return; - } - this._pxBounds = new Bounds([ - this._rawPxBounds.min.subtract(p), - this._rawPxBounds.max.add(p) - ]); - }, - // recursively turns latlngs into a set of rings with projected coordinates - _projectLatlngs: function(latlngs, result, projectedBounds) { - var flat = latlngs[0] instanceof LatLng, len = latlngs.length, i, ring; - if (flat) { - ring = []; - for (i = 0; i < len; i++) { - ring[i] = this._map.latLngToLayerPoint(latlngs[i]); - projectedBounds.extend(ring[i]); - } - result.push(ring); - } else { - for (i = 0; i < len; i++) { - this._projectLatlngs(latlngs[i], result, projectedBounds); - } - } - }, - // clip polyline by renderer bounds so that we have less to render for performance - _clipPoints: function() { - var bounds = this._renderer._bounds; - this._parts = []; - if (!this._pxBounds || !this._pxBounds.intersects(bounds)) { - return; - } - if (this.options.noClip) { - this._parts = this._rings; - return; - } - var parts = this._parts, i, j, k, len, len2, segment, points; - for (i = 0, k = 0, len = this._rings.length; i < len; i++) { - points = this._rings[i]; - for (j = 0, len2 = points.length; j < len2 - 1; j++) { - segment = clipSegment(points[j], points[j + 1], bounds, j, true); - if (!segment) { - continue; - } - parts[k] = parts[k] || []; - parts[k].push(segment[0]); - if (segment[1] !== points[j + 1] || j === len2 - 2) { - parts[k].push(segment[1]); - k++; - } - } - } - }, - // simplify each clipped part of the polyline for performance - _simplifyPoints: function() { - var parts = this._parts, tolerance = this.options.smoothFactor; - for (var i = 0, len = parts.length; i < len; i++) { - parts[i] = simplify(parts[i], tolerance); - } - }, - _update: function() { - if (!this._map) { - return; - } - this._clipPoints(); - this._simplifyPoints(); - this._updatePath(); - }, - _updatePath: function() { - this._renderer._updatePoly(this); - }, - // Needed by the `Canvas` renderer for interactivity - _containsPoint: function(p, closed) { - var i, j, k, len, len2, part, w = this._clickTolerance(); - if (!this._pxBounds || !this._pxBounds.contains(p)) { - return false; - } - for (i = 0, len = this._parts.length; i < len; i++) { - part = this._parts[i]; - for (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) { - if (!closed && j === 0) { - continue; - } - if (pointToSegmentDistance(p, part[k], part[j]) <= w) { - return true; - } - } - } - return false; - } - }); - function polyline(latlngs, options) { - return new Polyline(latlngs, options); - } - Polyline._flat = _flat; - var Polygon = Polyline.extend({ - options: { - fill: true - }, - isEmpty: function() { - return !this._latlngs.length || !this._latlngs[0].length; - }, - // @method getCenter(): LatLng - // Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the Polygon. - getCenter: function() { - if (!this._map) { - throw new Error("Must add layer to map before using getCenter()"); - } - return polygonCenter(this._defaultShape(), this._map.options.crs); - }, - _convertLatLngs: function(latlngs) { - var result = Polyline.prototype._convertLatLngs.call(this, latlngs), len = result.length; - if (len >= 2 && result[0] instanceof LatLng && result[0].equals(result[len - 1])) { - result.pop(); - } - return result; - }, - _setLatLngs: function(latlngs) { - Polyline.prototype._setLatLngs.call(this, latlngs); - if (isFlat(this._latlngs)) { - this._latlngs = [this._latlngs]; - } - }, - _defaultShape: function() { - return isFlat(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0]; - }, - _clipPoints: function() { - var bounds = this._renderer._bounds, w = this.options.weight, p = new Point(w, w); - bounds = new Bounds(bounds.min.subtract(p), bounds.max.add(p)); - this._parts = []; - if (!this._pxBounds || !this._pxBounds.intersects(bounds)) { - return; - } - if (this.options.noClip) { - this._parts = this._rings; - return; - } - for (var i = 0, len = this._rings.length, clipped; i < len; i++) { - clipped = clipPolygon(this._rings[i], bounds, true); - if (clipped.length) { - this._parts.push(clipped); - } - } - }, - _updatePath: function() { - this._renderer._updatePoly(this, true); - }, - // Needed by the `Canvas` renderer for interactivity - _containsPoint: function(p) { - var inside = false, part, p1, p2, i, j, k, len, len2; - if (!this._pxBounds || !this._pxBounds.contains(p)) { - return false; - } - for (i = 0, len = this._parts.length; i < len; i++) { - part = this._parts[i]; - for (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) { - p1 = part[j]; - p2 = part[k]; - if (p1.y > p.y !== p2.y > p.y && p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x) { - inside = !inside; - } - } - } - return inside || Polyline.prototype._containsPoint.call(this, p, true); - } - }); - function polygon(latlngs, options) { - return new Polygon(latlngs, options); - } - var GeoJSON = FeatureGroup.extend({ - /* @section - * @aka GeoJSON options - * - * @option pointToLayer: Function = * - * A `Function` defining how GeoJSON points spawn Leaflet layers. It is internally - * called when data is added, passing the GeoJSON point feature and its `LatLng`. - * The default is to spawn a default `Marker`: - * ```js - * function(geoJsonPoint, latlng) { - * return L.marker(latlng); - * } - * ``` - * - * @option style: Function = * - * A `Function` defining the `Path options` for styling GeoJSON lines and polygons, - * called internally when data is added. - * The default value is to not override any defaults: - * ```js - * function (geoJsonFeature) { - * return {} - * } - * ``` - * - * @option onEachFeature: Function = * - * A `Function` that will be called once for each created `Feature`, after it has - * been created and styled. Useful for attaching events and popups to features. - * The default is to do nothing with the newly created layers: - * ```js - * function (feature, layer) {} - * ``` - * - * @option filter: Function = * - * A `Function` that will be used to decide whether to include a feature or not. - * The default is to include all features: - * ```js - * function (geoJsonFeature) { - * return true; - * } - * ``` - * Note: dynamically changing the `filter` option will have effect only on newly - * added data. It will _not_ re-evaluate already included features. - * - * @option coordsToLatLng: Function = * - * A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s. - * The default is the `coordsToLatLng` static method. - * - * @option markersInheritOptions: Boolean = false - * Whether default Markers for "Point" type Features inherit from group options. - */ - initialize: function(geojson, options) { - setOptions(this, options); - this._layers = {}; - if (geojson) { - this.addData(geojson); - } - }, - // @method addData( data ): this - // Adds a GeoJSON object to the layer. - addData: function(geojson) { - var features = isArray(geojson) ? geojson : geojson.features, i, len, feature; - if (features) { - for (i = 0, len = features.length; i < len; i++) { - feature = features[i]; - if (feature.geometries || feature.geometry || feature.features || feature.coordinates) { - this.addData(feature); - } - } - return this; - } - var options = this.options; - if (options.filter && !options.filter(geojson)) { - return this; - } - var layer = geometryToLayer(geojson, options); - if (!layer) { - return this; - } - layer.feature = asFeature(geojson); - layer.defaultOptions = layer.options; - this.resetStyle(layer); - if (options.onEachFeature) { - options.onEachFeature(geojson, layer); - } - return this.addLayer(layer); - }, - // @method resetStyle( layer? ): this - // Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events. - // If `layer` is omitted, the style of all features in the current layer is reset. - resetStyle: function(layer) { - if (layer === void 0) { - return this.eachLayer(this.resetStyle, this); - } - layer.options = extend({}, layer.defaultOptions); - this._setLayerStyle(layer, this.options.style); - return this; - }, - // @method setStyle( style ): this - // Changes styles of GeoJSON vector layers with the given style function. - setStyle: function(style2) { - return this.eachLayer(function(layer) { - this._setLayerStyle(layer, style2); - }, this); - }, - _setLayerStyle: function(layer, style2) { - if (layer.setStyle) { - if (typeof style2 === "function") { - style2 = style2(layer.feature); - } - layer.setStyle(style2); - } - } - }); - function geometryToLayer(geojson, options) { - var geometry = geojson.type === "Feature" ? geojson.geometry : geojson, coords = geometry ? geometry.coordinates : null, layers2 = [], pointToLayer = options && options.pointToLayer, _coordsToLatLng = options && options.coordsToLatLng || coordsToLatLng, latlng, latlngs, i, len; - if (!coords && !geometry) { - return null; - } - switch (geometry.type) { - case "Point": - latlng = _coordsToLatLng(coords); - return _pointToLayer(pointToLayer, geojson, latlng, options); - case "MultiPoint": - for (i = 0, len = coords.length; i < len; i++) { - latlng = _coordsToLatLng(coords[i]); - layers2.push(_pointToLayer(pointToLayer, geojson, latlng, options)); - } - return new FeatureGroup(layers2); - case "LineString": - case "MultiLineString": - latlngs = coordsToLatLngs(coords, geometry.type === "LineString" ? 0 : 1, _coordsToLatLng); - return new Polyline(latlngs, options); - case "Polygon": - case "MultiPolygon": - latlngs = coordsToLatLngs(coords, geometry.type === "Polygon" ? 1 : 2, _coordsToLatLng); - return new Polygon(latlngs, options); - case "GeometryCollection": - for (i = 0, len = geometry.geometries.length; i < len; i++) { - var geoLayer = geometryToLayer({ - geometry: geometry.geometries[i], - type: "Feature", - properties: geojson.properties - }, options); - if (geoLayer) { - layers2.push(geoLayer); - } - } - return new FeatureGroup(layers2); - case "FeatureCollection": - for (i = 0, len = geometry.features.length; i < len; i++) { - var featureLayer = geometryToLayer(geometry.features[i], options); - if (featureLayer) { - layers2.push(featureLayer); - } - } - return new FeatureGroup(layers2); - default: - throw new Error("Invalid GeoJSON object."); - } - } - function _pointToLayer(pointToLayerFn, geojson, latlng, options) { - return pointToLayerFn ? pointToLayerFn(geojson, latlng) : new Marker(latlng, options && options.markersInheritOptions && options); - } - function coordsToLatLng(coords) { - return new LatLng(coords[1], coords[0], coords[2]); - } - function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) { - var latlngs = []; - for (var i = 0, len = coords.length, latlng; i < len; i++) { - latlng = levelsDeep ? coordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) : (_coordsToLatLng || coordsToLatLng)(coords[i]); - latlngs.push(latlng); - } - return latlngs; - } - function latLngToCoords(latlng, precision) { - latlng = toLatLng(latlng); - return latlng.alt !== void 0 ? [formatNum(latlng.lng, precision), formatNum(latlng.lat, precision), formatNum(latlng.alt, precision)] : [formatNum(latlng.lng, precision), formatNum(latlng.lat, precision)]; - } - function latLngsToCoords(latlngs, levelsDeep, closed, precision) { - var coords = []; - for (var i = 0, len = latlngs.length; i < len; i++) { - coords.push(levelsDeep ? latLngsToCoords(latlngs[i], isFlat(latlngs[i]) ? 0 : levelsDeep - 1, closed, precision) : latLngToCoords(latlngs[i], precision)); - } - if (!levelsDeep && closed && coords.length > 0) { - coords.push(coords[0].slice()); - } - return coords; - } - function getFeature(layer, newGeometry) { - return layer.feature ? extend({}, layer.feature, { geometry: newGeometry }) : asFeature(newGeometry); - } - function asFeature(geojson) { - if (geojson.type === "Feature" || geojson.type === "FeatureCollection") { - return geojson; - } - return { - type: "Feature", - properties: {}, - geometry: geojson - }; - } - var PointToGeoJSON = { - toGeoJSON: function(precision) { - return getFeature(this, { - type: "Point", - coordinates: latLngToCoords(this.getLatLng(), precision) - }); - } - }; - Marker.include(PointToGeoJSON); - Circle.include(PointToGeoJSON); - CircleMarker.include(PointToGeoJSON); - Polyline.include({ - toGeoJSON: function(precision) { - var multi = !isFlat(this._latlngs); - var coords = latLngsToCoords(this._latlngs, multi ? 1 : 0, false, precision); - return getFeature(this, { - type: (multi ? "Multi" : "") + "LineString", - coordinates: coords - }); - } - }); - Polygon.include({ - toGeoJSON: function(precision) { - var holes = !isFlat(this._latlngs), multi = holes && !isFlat(this._latlngs[0]); - var coords = latLngsToCoords(this._latlngs, multi ? 2 : holes ? 1 : 0, true, precision); - if (!holes) { - coords = [coords]; - } - return getFeature(this, { - type: (multi ? "Multi" : "") + "Polygon", - coordinates: coords - }); - } - }); - LayerGroup.include({ - toMultiPoint: function(precision) { - var coords = []; - this.eachLayer(function(layer) { - coords.push(layer.toGeoJSON(precision).geometry.coordinates); - }); - return getFeature(this, { - type: "MultiPoint", - coordinates: coords - }); - }, - // @method toGeoJSON(precision?: Number|false): Object - // Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`. - // Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the layer group (as a GeoJSON `FeatureCollection`, `GeometryCollection`, or `MultiPoint`). - toGeoJSON: function(precision) { - var type = this.feature && this.feature.geometry && this.feature.geometry.type; - if (type === "MultiPoint") { - return this.toMultiPoint(precision); - } - var isGeometryCollection = type === "GeometryCollection", jsons = []; - this.eachLayer(function(layer) { - if (layer.toGeoJSON) { - var json = layer.toGeoJSON(precision); - if (isGeometryCollection) { - jsons.push(json.geometry); - } else { - var feature = asFeature(json); - if (feature.type === "FeatureCollection") { - jsons.push.apply(jsons, feature.features); - } else { - jsons.push(feature); - } - } - } - }); - if (isGeometryCollection) { - return getFeature(this, { - geometries: jsons, - type: "GeometryCollection" - }); - } - return { - type: "FeatureCollection", - features: jsons - }; - } - }); - function geoJSON(geojson, options) { - return new GeoJSON(geojson, options); - } - var geoJson = geoJSON; - var ImageOverlay = Layer.extend({ - // @section - // @aka ImageOverlay options - options: { - // @option opacity: Number = 1.0 - // The opacity of the image overlay. - opacity: 1, - // @option alt: String = '' - // Text for the `alt` attribute of the image (useful for accessibility). - alt: "", - // @option interactive: Boolean = false - // If `true`, the image overlay will emit [mouse events](#interactive-layer) when clicked or hovered. - interactive: false, - // @option crossOrigin: Boolean|String = false - // Whether the crossOrigin attribute will be added to the image. - // If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data. - // Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values. - crossOrigin: false, - // @option errorOverlayUrl: String = '' - // URL to the overlay image to show in place of the overlay that failed to load. - errorOverlayUrl: "", - // @option zIndex: Number = 1 - // The explicit [zIndex](https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index) of the overlay layer. - zIndex: 1, - // @option className: String = '' - // A custom class name to assign to the image. Empty by default. - className: "" - }, - initialize: function(url, bounds, options) { - this._url = url; - this._bounds = toLatLngBounds(bounds); - setOptions(this, options); - }, - onAdd: function() { - if (!this._image) { - this._initImage(); - if (this.options.opacity < 1) { - this._updateOpacity(); - } - } - if (this.options.interactive) { - addClass(this._image, "leaflet-interactive"); - this.addInteractiveTarget(this._image); - } - this.getPane().appendChild(this._image); - this._reset(); - }, - onRemove: function() { - remove(this._image); - if (this.options.interactive) { - this.removeInteractiveTarget(this._image); - } - }, - // @method setOpacity(opacity: Number): this - // Sets the opacity of the overlay. - setOpacity: function(opacity) { - this.options.opacity = opacity; - if (this._image) { - this._updateOpacity(); - } - return this; - }, - setStyle: function(styleOpts) { - if (styleOpts.opacity) { - this.setOpacity(styleOpts.opacity); - } - return this; - }, - // @method bringToFront(): this - // Brings the layer to the top of all overlays. - bringToFront: function() { - if (this._map) { - toFront(this._image); - } - return this; - }, - // @method bringToBack(): this - // Brings the layer to the bottom of all overlays. - bringToBack: function() { - if (this._map) { - toBack(this._image); - } - return this; - }, - // @method setUrl(url: String): this - // Changes the URL of the image. - setUrl: function(url) { - this._url = url; - if (this._image) { - this._image.src = url; - } - return this; - }, - // @method setBounds(bounds: LatLngBounds): this - // Update the bounds that this ImageOverlay covers - setBounds: function(bounds) { - this._bounds = toLatLngBounds(bounds); - if (this._map) { - this._reset(); - } - return this; - }, - getEvents: function() { - var events = { - zoom: this._reset, - viewreset: this._reset - }; - if (this._zoomAnimated) { - events.zoomanim = this._animateZoom; - } - return events; - }, - // @method setZIndex(value: Number): this - // Changes the [zIndex](#imageoverlay-zindex) of the image overlay. - setZIndex: function(value) { - this.options.zIndex = value; - this._updateZIndex(); - return this; - }, - // @method getBounds(): LatLngBounds - // Get the bounds that this ImageOverlay covers - getBounds: function() { - return this._bounds; - }, - // @method getElement(): HTMLElement - // Returns the instance of [`HTMLImageElement`](https://developer.mozilla.org/docs/Web/API/HTMLImageElement) - // used by this overlay. - getElement: function() { - return this._image; - }, - _initImage: function() { - var wasElementSupplied = this._url.tagName === "IMG"; - var img = this._image = wasElementSupplied ? this._url : create$1("img"); - addClass(img, "leaflet-image-layer"); - if (this._zoomAnimated) { - addClass(img, "leaflet-zoom-animated"); - } - if (this.options.className) { - addClass(img, this.options.className); - } - img.onselectstart = falseFn; - img.onmousemove = falseFn; - img.onload = bind(this.fire, this, "load"); - img.onerror = bind(this._overlayOnError, this, "error"); - if (this.options.crossOrigin || this.options.crossOrigin === "") { - img.crossOrigin = this.options.crossOrigin === true ? "" : this.options.crossOrigin; - } - if (this.options.zIndex) { - this._updateZIndex(); - } - if (wasElementSupplied) { - this._url = img.src; - return; - } - img.src = this._url; - img.alt = this.options.alt; - }, - _animateZoom: function(e) { - var scale2 = this._map.getZoomScale(e.zoom), offset = this._map._latLngBoundsToNewLayerBounds(this._bounds, e.zoom, e.center).min; - setTransform(this._image, offset, scale2); - }, - _reset: function() { - var image = this._image, bounds = new Bounds( - this._map.latLngToLayerPoint(this._bounds.getNorthWest()), - this._map.latLngToLayerPoint(this._bounds.getSouthEast()) - ), size = bounds.getSize(); - setPosition(image, bounds.min); - image.style.width = size.x + "px"; - image.style.height = size.y + "px"; - }, - _updateOpacity: function() { - setOpacity(this._image, this.options.opacity); - }, - _updateZIndex: function() { - if (this._image && this.options.zIndex !== void 0 && this.options.zIndex !== null) { - this._image.style.zIndex = this.options.zIndex; - } - }, - _overlayOnError: function() { - this.fire("error"); - var errorUrl = this.options.errorOverlayUrl; - if (errorUrl && this._url !== errorUrl) { - this._url = errorUrl; - this._image.src = errorUrl; - } - }, - // @method getCenter(): LatLng - // Returns the center of the ImageOverlay. - getCenter: function() { - return this._bounds.getCenter(); - } - }); - var imageOverlay = function(url, bounds, options) { - return new ImageOverlay(url, bounds, options); - }; - var VideoOverlay = ImageOverlay.extend({ - // @section - // @aka VideoOverlay options - options: { - // @option autoplay: Boolean = true - // Whether the video starts playing automatically when loaded. - // On some browsers autoplay will only work with `muted: true` - autoplay: true, - // @option loop: Boolean = true - // Whether the video will loop back to the beginning when played. - loop: true, - // @option keepAspectRatio: Boolean = true - // Whether the video will save aspect ratio after the projection. - // Relevant for supported browsers. See [browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) - keepAspectRatio: true, - // @option muted: Boolean = false - // Whether the video starts on mute when loaded. - muted: false, - // @option playsInline: Boolean = true - // Mobile browsers will play the video right where it is instead of open it up in fullscreen mode. - playsInline: true - }, - _initImage: function() { - var wasElementSupplied = this._url.tagName === "VIDEO"; - var vid = this._image = wasElementSupplied ? this._url : create$1("video"); - addClass(vid, "leaflet-image-layer"); - if (this._zoomAnimated) { - addClass(vid, "leaflet-zoom-animated"); - } - if (this.options.className) { - addClass(vid, this.options.className); - } - vid.onselectstart = falseFn; - vid.onmousemove = falseFn; - vid.onloadeddata = bind(this.fire, this, "load"); - if (wasElementSupplied) { - var sourceElements = vid.getElementsByTagName("source"); - var sources = []; - for (var j = 0; j < sourceElements.length; j++) { - sources.push(sourceElements[j].src); - } - this._url = sourceElements.length > 0 ? sources : [vid.src]; - return; - } - if (!isArray(this._url)) { - this._url = [this._url]; - } - if (!this.options.keepAspectRatio && Object.prototype.hasOwnProperty.call(vid.style, "objectFit")) { - vid.style["objectFit"] = "fill"; - } - vid.autoplay = !!this.options.autoplay; - vid.loop = !!this.options.loop; - vid.muted = !!this.options.muted; - vid.playsInline = !!this.options.playsInline; - for (var i = 0; i < this._url.length; i++) { - var source = create$1("source"); - source.src = this._url[i]; - vid.appendChild(source); - } - } - // @method getElement(): HTMLVideoElement - // Returns the instance of [`HTMLVideoElement`](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement) - // used by this overlay. - }); - function videoOverlay(video, bounds, options) { - return new VideoOverlay(video, bounds, options); - } - var SVGOverlay = ImageOverlay.extend({ - _initImage: function() { - var el = this._image = this._url; - addClass(el, "leaflet-image-layer"); - if (this._zoomAnimated) { - addClass(el, "leaflet-zoom-animated"); - } - if (this.options.className) { - addClass(el, this.options.className); - } - el.onselectstart = falseFn; - el.onmousemove = falseFn; - } - // @method getElement(): SVGElement - // Returns the instance of [`SVGElement`](https://developer.mozilla.org/docs/Web/API/SVGElement) - // used by this overlay. - }); - function svgOverlay(el, bounds, options) { - return new SVGOverlay(el, bounds, options); - } - var DivOverlay = Layer.extend({ - // @section - // @aka DivOverlay options - options: { - // @option interactive: Boolean = false - // If true, the popup/tooltip will listen to the mouse events. - interactive: false, - // @option offset: Point = Point(0, 0) - // The offset of the overlay position. - offset: [0, 0], - // @option className: String = '' - // A custom CSS class name to assign to the overlay. - className: "", - // @option pane: String = undefined - // `Map pane` where the overlay will be added. - pane: void 0, - // @option content: String|HTMLElement|Function = '' - // Sets the HTML content of the overlay while initializing. If a function is passed the source layer will be - // passed to the function. The function should return a `String` or `HTMLElement` to be used in the overlay. - content: "" - }, - initialize: function(options, source) { - if (options && (options instanceof LatLng || isArray(options))) { - this._latlng = toLatLng(options); - setOptions(this, source); - } else { - setOptions(this, options); - this._source = source; - } - if (this.options.content) { - this._content = this.options.content; - } - }, - // @method openOn(map: Map): this - // Adds the overlay to the map. - // Alternative to `map.openPopup(popup)`/`.openTooltip(tooltip)`. - openOn: function(map) { - map = arguments.length ? map : this._source._map; - if (!map.hasLayer(this)) { - map.addLayer(this); - } - return this; - }, - // @method close(): this - // Closes the overlay. - // Alternative to `map.closePopup(popup)`/`.closeTooltip(tooltip)` - // and `layer.closePopup()`/`.closeTooltip()`. - close: function() { - if (this._map) { - this._map.removeLayer(this); - } - return this; - }, - // @method toggle(layer?: Layer): this - // Opens or closes the overlay bound to layer depending on its current state. - // Argument may be omitted only for overlay bound to layer. - // Alternative to `layer.togglePopup()`/`.toggleTooltip()`. - toggle: function(layer) { - if (this._map) { - this.close(); - } else { - if (arguments.length) { - this._source = layer; - } else { - layer = this._source; - } - this._prepareOpen(); - this.openOn(layer._map); - } - return this; - }, - onAdd: function(map) { - this._zoomAnimated = map._zoomAnimated; - if (!this._container) { - this._initLayout(); - } - if (map._fadeAnimated) { - setOpacity(this._container, 0); - } - clearTimeout(this._removeTimeout); - this.getPane().appendChild(this._container); - this.update(); - if (map._fadeAnimated) { - setOpacity(this._container, 1); - } - this.bringToFront(); - if (this.options.interactive) { - addClass(this._container, "leaflet-interactive"); - this.addInteractiveTarget(this._container); - } - }, - onRemove: function(map) { - if (map._fadeAnimated) { - setOpacity(this._container, 0); - this._removeTimeout = setTimeout(bind(remove, void 0, this._container), 200); - } else { - remove(this._container); - } - if (this.options.interactive) { - removeClass(this._container, "leaflet-interactive"); - this.removeInteractiveTarget(this._container); - } - }, - // @namespace DivOverlay - // @method getLatLng: LatLng - // Returns the geographical point of the overlay. - getLatLng: function() { - return this._latlng; - }, - // @method setLatLng(latlng: LatLng): this - // Sets the geographical point where the overlay will open. - setLatLng: function(latlng) { - this._latlng = toLatLng(latlng); - if (this._map) { - this._updatePosition(); - this._adjustPan(); - } - return this; - }, - // @method getContent: String|HTMLElement - // Returns the content of the overlay. - getContent: function() { - return this._content; - }, - // @method setContent(htmlContent: String|HTMLElement|Function): this - // Sets the HTML content of the overlay. If a function is passed the source layer will be passed to the function. - // The function should return a `String` or `HTMLElement` to be used in the overlay. - setContent: function(content) { - this._content = content; - this.update(); - return this; - }, - // @method getElement: String|HTMLElement - // Returns the HTML container of the overlay. - getElement: function() { - return this._container; - }, - // @method update: null - // Updates the overlay content, layout and position. Useful for updating the overlay after something inside changed, e.g. image loaded. - update: function() { - if (!this._map) { - return; - } - this._container.style.visibility = "hidden"; - this._updateContent(); - this._updateLayout(); - this._updatePosition(); - this._container.style.visibility = ""; - this._adjustPan(); - }, - getEvents: function() { - var events = { - zoom: this._updatePosition, - viewreset: this._updatePosition - }; - if (this._zoomAnimated) { - events.zoomanim = this._animateZoom; - } - return events; - }, - // @method isOpen: Boolean - // Returns `true` when the overlay is visible on the map. - isOpen: function() { - return !!this._map && this._map.hasLayer(this); - }, - // @method bringToFront: this - // Brings this overlay in front of other overlays (in the same map pane). - bringToFront: function() { - if (this._map) { - toFront(this._container); - } - return this; - }, - // @method bringToBack: this - // Brings this overlay to the back of other overlays (in the same map pane). - bringToBack: function() { - if (this._map) { - toBack(this._container); - } - return this; - }, - // prepare bound overlay to open: update latlng pos / content source (for FeatureGroup) - _prepareOpen: function(latlng) { - var source = this._source; - if (!source._map) { - return false; - } - if (source instanceof FeatureGroup) { - source = null; - var layers2 = this._source._layers; - for (var id in layers2) { - if (layers2[id]._map) { - source = layers2[id]; - break; - } - } - if (!source) { - return false; - } - this._source = source; - } - if (!latlng) { - if (source.getCenter) { - latlng = source.getCenter(); - } else if (source.getLatLng) { - latlng = source.getLatLng(); - } else if (source.getBounds) { - latlng = source.getBounds().getCenter(); - } else { - throw new Error("Unable to get source layer LatLng."); - } - } - this.setLatLng(latlng); - if (this._map) { - this.update(); - } - return true; - }, - _updateContent: function() { - if (!this._content) { - return; - } - var node = this._contentNode; - var content = typeof this._content === "function" ? this._content(this._source || this) : this._content; - if (typeof content === "string") { - node.innerHTML = content; - } else { - while (node.hasChildNodes()) { - node.removeChild(node.firstChild); - } - node.appendChild(content); - } - this.fire("contentupdate"); - }, - _updatePosition: function() { - if (!this._map) { - return; - } - var pos = this._map.latLngToLayerPoint(this._latlng), offset = toPoint(this.options.offset), anchor = this._getAnchor(); - if (this._zoomAnimated) { - setPosition(this._container, pos.add(anchor)); - } else { - offset = offset.add(pos).add(anchor); - } - var bottom = this._containerBottom = -offset.y, left = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x; - this._container.style.bottom = bottom + "px"; - this._container.style.left = left + "px"; - }, - _getAnchor: function() { - return [0, 0]; - } - }); - Map.include({ - _initOverlay: function(OverlayClass, content, latlng, options) { - var overlay = content; - if (!(overlay instanceof OverlayClass)) { - overlay = new OverlayClass(options).setContent(content); - } - if (latlng) { - overlay.setLatLng(latlng); - } - return overlay; - } - }); - Layer.include({ - _initOverlay: function(OverlayClass, old, content, options) { - var overlay = content; - if (overlay instanceof OverlayClass) { - setOptions(overlay, options); - overlay._source = this; - } else { - overlay = old && !options ? old : new OverlayClass(options, this); - overlay.setContent(content); - } - return overlay; - } - }); - var Popup = DivOverlay.extend({ - // @section - // @aka Popup options - options: { - // @option pane: String = 'popupPane' - // `Map pane` where the popup will be added. - pane: "popupPane", - // @option offset: Point = Point(0, 7) - // The offset of the popup position. - offset: [0, 7], - // @option maxWidth: Number = 300 - // Max width of the popup, in pixels. - maxWidth: 300, - // @option minWidth: Number = 50 - // Min width of the popup, in pixels. - minWidth: 50, - // @option maxHeight: Number = null - // If set, creates a scrollable container of the given height - // inside a popup if its content exceeds it. - // The scrollable container can be styled using the - // `leaflet-popup-scrolled` CSS class selector. - maxHeight: null, - // @option autoPan: Boolean = true - // Set it to `false` if you don't want the map to do panning animation - // to fit the opened popup. - autoPan: true, - // @option autoPanPaddingTopLeft: Point = null - // The margin between the popup and the top left corner of the map - // view after autopanning was performed. - autoPanPaddingTopLeft: null, - // @option autoPanPaddingBottomRight: Point = null - // The margin between the popup and the bottom right corner of the map - // view after autopanning was performed. - autoPanPaddingBottomRight: null, - // @option autoPanPadding: Point = Point(5, 5) - // Equivalent of setting both top left and bottom right autopan padding to the same value. - autoPanPadding: [5, 5], - // @option keepInView: Boolean = false - // Set it to `true` if you want to prevent users from panning the popup - // off of the screen while it is open. - keepInView: false, - // @option closeButton: Boolean = true - // Controls the presence of a close button in the popup. - closeButton: true, - // @option autoClose: Boolean = true - // Set it to `false` if you want to override the default behavior of - // the popup closing when another popup is opened. - autoClose: true, - // @option closeOnEscapeKey: Boolean = true - // Set it to `false` if you want to override the default behavior of - // the ESC key for closing of the popup. - closeOnEscapeKey: true, - // @option closeOnClick: Boolean = * - // Set it if you want to override the default behavior of the popup closing when user clicks - // on the map. Defaults to the map's [`closePopupOnClick`](#map-closepopuponclick) option. - // @option className: String = '' - // A custom CSS class name to assign to the popup. - className: "" - }, - // @namespace Popup - // @method openOn(map: Map): this - // Alternative to `map.openPopup(popup)`. - // Adds the popup to the map and closes the previous one. - openOn: function(map) { - map = arguments.length ? map : this._source._map; - if (!map.hasLayer(this) && map._popup && map._popup.options.autoClose) { - map.removeLayer(map._popup); - } - map._popup = this; - return DivOverlay.prototype.openOn.call(this, map); - }, - onAdd: function(map) { - DivOverlay.prototype.onAdd.call(this, map); - map.fire("popupopen", { popup: this }); - if (this._source) { - this._source.fire("popupopen", { popup: this }, true); - if (!(this._source instanceof Path)) { - this._source.on("preclick", stopPropagation); - } - } - }, - onRemove: function(map) { - DivOverlay.prototype.onRemove.call(this, map); - map.fire("popupclose", { popup: this }); - if (this._source) { - this._source.fire("popupclose", { popup: this }, true); - if (!(this._source instanceof Path)) { - this._source.off("preclick", stopPropagation); - } - } - }, - getEvents: function() { - var events = DivOverlay.prototype.getEvents.call(this); - if (this.options.closeOnClick !== void 0 ? this.options.closeOnClick : this._map.options.closePopupOnClick) { - events.preclick = this.close; - } - if (this.options.keepInView) { - events.moveend = this._adjustPan; - } - return events; - }, - _initLayout: function() { - var prefix = "leaflet-popup", container = this._container = create$1( - "div", - prefix + " " + (this.options.className || "") + " leaflet-zoom-animated" - ); - var wrapper = this._wrapper = create$1("div", prefix + "-content-wrapper", container); - this._contentNode = create$1("div", prefix + "-content", wrapper); - disableClickPropagation(container); - disableScrollPropagation(this._contentNode); - on(container, "contextmenu", stopPropagation); - this._tipContainer = create$1("div", prefix + "-tip-container", container); - this._tip = create$1("div", prefix + "-tip", this._tipContainer); - if (this.options.closeButton) { - var closeButton = this._closeButton = create$1("a", prefix + "-close-button", container); - closeButton.setAttribute("role", "button"); - closeButton.setAttribute("aria-label", "Close popup"); - closeButton.href = "#close"; - closeButton.innerHTML = ''; - on(closeButton, "click", function(ev) { - preventDefault(ev); - this.close(); - }, this); - } - }, - _updateLayout: function() { - var container = this._contentNode, style2 = container.style; - style2.width = ""; - style2.whiteSpace = "nowrap"; - var width = container.offsetWidth; - width = Math.min(width, this.options.maxWidth); - width = Math.max(width, this.options.minWidth); - style2.width = width + 1 + "px"; - style2.whiteSpace = ""; - style2.height = ""; - var height = container.offsetHeight, maxHeight = this.options.maxHeight, scrolledClass = "leaflet-popup-scrolled"; - if (maxHeight && height > maxHeight) { - style2.height = maxHeight + "px"; - addClass(container, scrolledClass); - } else { - removeClass(container, scrolledClass); - } - this._containerWidth = this._container.offsetWidth; - }, - _animateZoom: function(e) { - var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center), anchor = this._getAnchor(); - setPosition(this._container, pos.add(anchor)); - }, - _adjustPan: function() { - if (!this.options.autoPan) { - return; - } - if (this._map._panAnim) { - this._map._panAnim.stop(); - } - if (this._autopanning) { - this._autopanning = false; - return; - } - var map = this._map, marginBottom = parseInt(getStyle(this._container, "marginBottom"), 10) || 0, containerHeight = this._container.offsetHeight + marginBottom, containerWidth = this._containerWidth, layerPos = new Point(this._containerLeft, -containerHeight - this._containerBottom); - layerPos._add(getPosition(this._container)); - var containerPos = map.layerPointToContainerPoint(layerPos), padding = toPoint(this.options.autoPanPadding), paddingTL = toPoint(this.options.autoPanPaddingTopLeft || padding), paddingBR = toPoint(this.options.autoPanPaddingBottomRight || padding), size = map.getSize(), dx = 0, dy = 0; - if (containerPos.x + containerWidth + paddingBR.x > size.x) { - dx = containerPos.x + containerWidth - size.x + paddingBR.x; - } - if (containerPos.x - dx - paddingTL.x < 0) { - dx = containerPos.x - paddingTL.x; - } - if (containerPos.y + containerHeight + paddingBR.y > size.y) { - dy = containerPos.y + containerHeight - size.y + paddingBR.y; - } - if (containerPos.y - dy - paddingTL.y < 0) { - dy = containerPos.y - paddingTL.y; - } - if (dx || dy) { - if (this.options.keepInView) { - this._autopanning = true; - } - map.fire("autopanstart").panBy([dx, dy]); - } - }, - _getAnchor: function() { - return toPoint(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [0, 0]); - } - }); - var popup = function(options, source) { - return new Popup(options, source); - }; - Map.mergeOptions({ - closePopupOnClick: true - }); - Map.include({ - // @method openPopup(popup: Popup): this - // Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability). - // @alternative - // @method openPopup(content: String|HTMLElement, latlng: LatLng, options?: Popup options): this - // Creates a popup with the specified content and options and opens it in the given point on a map. - openPopup: function(popup2, latlng, options) { - this._initOverlay(Popup, popup2, latlng, options).openOn(this); - return this; - }, - // @method closePopup(popup?: Popup): this - // Closes the popup previously opened with [openPopup](#map-openpopup) (or the given one). - closePopup: function(popup2) { - popup2 = arguments.length ? popup2 : this._popup; - if (popup2) { - popup2.close(); - } - return this; - } - }); - Layer.include({ - // @method bindPopup(content: String|HTMLElement|Function|Popup, options?: Popup options): this - // Binds a popup to the layer with the passed `content` and sets up the - // necessary event listeners. If a `Function` is passed it will receive - // the layer as the first argument and should return a `String` or `HTMLElement`. - bindPopup: function(content, options) { - this._popup = this._initOverlay(Popup, this._popup, content, options); - if (!this._popupHandlersAdded) { - this.on({ - click: this._openPopup, - keypress: this._onKeyPress, - remove: this.closePopup, - move: this._movePopup - }); - this._popupHandlersAdded = true; - } - return this; - }, - // @method unbindPopup(): this - // Removes the popup previously bound with `bindPopup`. - unbindPopup: function() { - if (this._popup) { - this.off({ - click: this._openPopup, - keypress: this._onKeyPress, - remove: this.closePopup, - move: this._movePopup - }); - this._popupHandlersAdded = false; - this._popup = null; - } - return this; - }, - // @method openPopup(latlng?: LatLng): this - // Opens the bound popup at the specified `latlng` or at the default popup anchor if no `latlng` is passed. - openPopup: function(latlng) { - if (this._popup) { - if (!(this instanceof FeatureGroup)) { - this._popup._source = this; - } - if (this._popup._prepareOpen(latlng || this._latlng)) { - this._popup.openOn(this._map); - } - } - return this; - }, - // @method closePopup(): this - // Closes the popup bound to this layer if it is open. - closePopup: function() { - if (this._popup) { - this._popup.close(); - } - return this; - }, - // @method togglePopup(): this - // Opens or closes the popup bound to this layer depending on its current state. - togglePopup: function() { - if (this._popup) { - this._popup.toggle(this); - } - return this; - }, - // @method isPopupOpen(): boolean - // Returns `true` if the popup bound to this layer is currently open. - isPopupOpen: function() { - return this._popup ? this._popup.isOpen() : false; - }, - // @method setPopupContent(content: String|HTMLElement|Popup): this - // Sets the content of the popup bound to this layer. - setPopupContent: function(content) { - if (this._popup) { - this._popup.setContent(content); - } - return this; - }, - // @method getPopup(): Popup - // Returns the popup bound to this layer. - getPopup: function() { - return this._popup; - }, - _openPopup: function(e) { - if (!this._popup || !this._map) { - return; - } - stop(e); - var target = e.layer || e.target; - if (this._popup._source === target && !(target instanceof Path)) { - if (this._map.hasLayer(this._popup)) { - this.closePopup(); - } else { - this.openPopup(e.latlng); - } - return; - } - this._popup._source = target; - this.openPopup(e.latlng); - }, - _movePopup: function(e) { - this._popup.setLatLng(e.latlng); - }, - _onKeyPress: function(e) { - if (e.originalEvent.keyCode === 13) { - this._openPopup(e); - } - } - }); - var Tooltip = DivOverlay.extend({ - // @section - // @aka Tooltip options - options: { - // @option pane: String = 'tooltipPane' - // `Map pane` where the tooltip will be added. - pane: "tooltipPane", - // @option offset: Point = Point(0, 0) - // Optional offset of the tooltip position. - offset: [0, 0], - // @option direction: String = 'auto' - // Direction where to open the tooltip. Possible values are: `right`, `left`, - // `top`, `bottom`, `center`, `auto`. - // `auto` will dynamically switch between `right` and `left` according to the tooltip - // position on the map. - direction: "auto", - // @option permanent: Boolean = false - // Whether to open the tooltip permanently or only on mouseover. - permanent: false, - // @option sticky: Boolean = false - // If true, the tooltip will follow the mouse instead of being fixed at the feature center. - sticky: false, - // @option opacity: Number = 0.9 - // Tooltip container opacity. - opacity: 0.9 - }, - onAdd: function(map) { - DivOverlay.prototype.onAdd.call(this, map); - this.setOpacity(this.options.opacity); - map.fire("tooltipopen", { tooltip: this }); - if (this._source) { - this.addEventParent(this._source); - this._source.fire("tooltipopen", { tooltip: this }, true); - } - }, - onRemove: function(map) { - DivOverlay.prototype.onRemove.call(this, map); - map.fire("tooltipclose", { tooltip: this }); - if (this._source) { - this.removeEventParent(this._source); - this._source.fire("tooltipclose", { tooltip: this }, true); - } - }, - getEvents: function() { - var events = DivOverlay.prototype.getEvents.call(this); - if (!this.options.permanent) { - events.preclick = this.close; - } - return events; - }, - _initLayout: function() { - var prefix = "leaflet-tooltip", className = prefix + " " + (this.options.className || "") + " leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide"); - this._contentNode = this._container = create$1("div", className); - this._container.setAttribute("role", "tooltip"); - this._container.setAttribute("id", "leaflet-tooltip-" + stamp(this)); - }, - _updateLayout: function() { - }, - _adjustPan: function() { - }, - _setPosition: function(pos) { - var subX, subY, map = this._map, container = this._container, centerPoint = map.latLngToContainerPoint(map.getCenter()), tooltipPoint = map.layerPointToContainerPoint(pos), direction = this.options.direction, tooltipWidth = container.offsetWidth, tooltipHeight = container.offsetHeight, offset = toPoint(this.options.offset), anchor = this._getAnchor(); - if (direction === "top") { - subX = tooltipWidth / 2; - subY = tooltipHeight; - } else if (direction === "bottom") { - subX = tooltipWidth / 2; - subY = 0; - } else if (direction === "center") { - subX = tooltipWidth / 2; - subY = tooltipHeight / 2; - } else if (direction === "right") { - subX = 0; - subY = tooltipHeight / 2; - } else if (direction === "left") { - subX = tooltipWidth; - subY = tooltipHeight / 2; - } else if (tooltipPoint.x < centerPoint.x) { - direction = "right"; - subX = 0; - subY = tooltipHeight / 2; - } else { - direction = "left"; - subX = tooltipWidth + (offset.x + anchor.x) * 2; - subY = tooltipHeight / 2; - } - pos = pos.subtract(toPoint(subX, subY, true)).add(offset).add(anchor); - removeClass(container, "leaflet-tooltip-right"); - removeClass(container, "leaflet-tooltip-left"); - removeClass(container, "leaflet-tooltip-top"); - removeClass(container, "leaflet-tooltip-bottom"); - addClass(container, "leaflet-tooltip-" + direction); - setPosition(container, pos); - }, - _updatePosition: function() { - var pos = this._map.latLngToLayerPoint(this._latlng); - this._setPosition(pos); - }, - setOpacity: function(opacity) { - this.options.opacity = opacity; - if (this._container) { - setOpacity(this._container, opacity); - } - }, - _animateZoom: function(e) { - var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center); - this._setPosition(pos); - }, - _getAnchor: function() { - return toPoint(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [0, 0]); - } - }); - var tooltip = function(options, source) { - return new Tooltip(options, source); - }; - Map.include({ - // @method openTooltip(tooltip: Tooltip): this - // Opens the specified tooltip. - // @alternative - // @method openTooltip(content: String|HTMLElement, latlng: LatLng, options?: Tooltip options): this - // Creates a tooltip with the specified content and options and open it. - openTooltip: function(tooltip2, latlng, options) { - this._initOverlay(Tooltip, tooltip2, latlng, options).openOn(this); - return this; - }, - // @method closeTooltip(tooltip: Tooltip): this - // Closes the tooltip given as parameter. - closeTooltip: function(tooltip2) { - tooltip2.close(); - return this; - } - }); - Layer.include({ - // @method bindTooltip(content: String|HTMLElement|Function|Tooltip, options?: Tooltip options): this - // Binds a tooltip to the layer with the passed `content` and sets up the - // necessary event listeners. If a `Function` is passed it will receive - // the layer as the first argument and should return a `String` or `HTMLElement`. - bindTooltip: function(content, options) { - if (this._tooltip && this.isTooltipOpen()) { - this.unbindTooltip(); - } - this._tooltip = this._initOverlay(Tooltip, this._tooltip, content, options); - this._initTooltipInteractions(); - if (this._tooltip.options.permanent && this._map && this._map.hasLayer(this)) { - this.openTooltip(); - } - return this; - }, - // @method unbindTooltip(): this - // Removes the tooltip previously bound with `bindTooltip`. - unbindTooltip: function() { - if (this._tooltip) { - this._initTooltipInteractions(true); - this.closeTooltip(); - this._tooltip = null; - } - return this; - }, - _initTooltipInteractions: function(remove2) { - if (!remove2 && this._tooltipHandlersAdded) { - return; - } - var onOff = remove2 ? "off" : "on", events = { - remove: this.closeTooltip, - move: this._moveTooltip - }; - if (!this._tooltip.options.permanent) { - events.mouseover = this._openTooltip; - events.mouseout = this.closeTooltip; - events.click = this._openTooltip; - if (this._map) { - this._addFocusListeners(); - } else { - events.add = this._addFocusListeners; - } - } else { - events.add = this._openTooltip; - } - if (this._tooltip.options.sticky) { - events.mousemove = this._moveTooltip; - } - this[onOff](events); - this._tooltipHandlersAdded = !remove2; - }, - // @method openTooltip(latlng?: LatLng): this - // Opens the bound tooltip at the specified `latlng` or at the default tooltip anchor if no `latlng` is passed. - openTooltip: function(latlng) { - if (this._tooltip) { - if (!(this instanceof FeatureGroup)) { - this._tooltip._source = this; - } - if (this._tooltip._prepareOpen(latlng)) { - this._tooltip.openOn(this._map); - if (this.getElement) { - this._setAriaDescribedByOnLayer(this); - } else if (this.eachLayer) { - this.eachLayer(this._setAriaDescribedByOnLayer, this); - } - } - } - return this; - }, - // @method closeTooltip(): this - // Closes the tooltip bound to this layer if it is open. - closeTooltip: function() { - if (this._tooltip) { - return this._tooltip.close(); - } - }, - // @method toggleTooltip(): this - // Opens or closes the tooltip bound to this layer depending on its current state. - toggleTooltip: function() { - if (this._tooltip) { - this._tooltip.toggle(this); - } - return this; - }, - // @method isTooltipOpen(): boolean - // Returns `true` if the tooltip bound to this layer is currently open. - isTooltipOpen: function() { - return this._tooltip.isOpen(); - }, - // @method setTooltipContent(content: String|HTMLElement|Tooltip): this - // Sets the content of the tooltip bound to this layer. - setTooltipContent: function(content) { - if (this._tooltip) { - this._tooltip.setContent(content); - } - return this; - }, - // @method getTooltip(): Tooltip - // Returns the tooltip bound to this layer. - getTooltip: function() { - return this._tooltip; - }, - _addFocusListeners: function() { - if (this.getElement) { - this._addFocusListenersOnLayer(this); - } else if (this.eachLayer) { - this.eachLayer(this._addFocusListenersOnLayer, this); - } - }, - _addFocusListenersOnLayer: function(layer) { - var el = typeof layer.getElement === "function" && layer.getElement(); - if (el) { - on(el, "focus", function() { - this._tooltip._source = layer; - this.openTooltip(); - }, this); - on(el, "blur", this.closeTooltip, this); - } - }, - _setAriaDescribedByOnLayer: function(layer) { - var el = typeof layer.getElement === "function" && layer.getElement(); - if (el) { - el.setAttribute("aria-describedby", this._tooltip._container.id); - } - }, - _openTooltip: function(e) { - if (!this._tooltip || !this._map) { - return; - } - if (this._map.dragging && this._map.dragging.moving() && !this._openOnceFlag) { - this._openOnceFlag = true; - var that = this; - this._map.once("moveend", function() { - that._openOnceFlag = false; - that._openTooltip(e); - }); - return; - } - this._tooltip._source = e.layer || e.target; - this.openTooltip(this._tooltip.options.sticky ? e.latlng : void 0); - }, - _moveTooltip: function(e) { - var latlng = e.latlng, containerPoint, layerPoint; - if (this._tooltip.options.sticky && e.originalEvent) { - containerPoint = this._map.mouseEventToContainerPoint(e.originalEvent); - layerPoint = this._map.containerPointToLayerPoint(containerPoint); - latlng = this._map.layerPointToLatLng(layerPoint); - } - this._tooltip.setLatLng(latlng); - } - }); - var DivIcon = Icon.extend({ - options: { - // @section - // @aka DivIcon options - iconSize: [12, 12], - // also can be set through CSS - // iconAnchor: (Point), - // popupAnchor: (Point), - // @option html: String|HTMLElement = '' - // Custom HTML code to put inside the div element, empty by default. Alternatively, - // an instance of `HTMLElement`. - html: false, - // @option bgPos: Point = [0, 0] - // Optional relative position of the background, in pixels - bgPos: null, - className: "leaflet-div-icon" - }, - createIcon: function(oldIcon) { - var div = oldIcon && oldIcon.tagName === "DIV" ? oldIcon : document.createElement("div"), options = this.options; - if (options.html instanceof Element) { - empty(div); - div.appendChild(options.html); - } else { - div.innerHTML = options.html !== false ? options.html : ""; - } - if (options.bgPos) { - var bgPos = toPoint(options.bgPos); - div.style.backgroundPosition = -bgPos.x + "px " + -bgPos.y + "px"; - } - this._setIconStyles(div, "icon"); - return div; - }, - createShadow: function() { - return null; - } - }); - function divIcon(options) { - return new DivIcon(options); - } - Icon.Default = IconDefault; - var GridLayer = Layer.extend({ - // @section - // @aka GridLayer options - options: { - // @option tileSize: Number|Point = 256 - // Width and height of tiles in the grid. Use a number if width and height are equal, or `L.point(width, height)` otherwise. - tileSize: 256, - // @option opacity: Number = 1.0 - // Opacity of the tiles. Can be used in the `createTile()` function. - opacity: 1, - // @option updateWhenIdle: Boolean = (depends) - // Load new tiles only when panning ends. - // `true` by default on mobile browsers, in order to avoid too many requests and keep smooth navigation. - // `false` otherwise in order to display new tiles _during_ panning, since it is easy to pan outside the - // [`keepBuffer`](#gridlayer-keepbuffer) option in desktop browsers. - updateWhenIdle: Browser.mobile, - // @option updateWhenZooming: Boolean = true - // By default, a smooth zoom animation (during a [touch zoom](#map-touchzoom) or a [`flyTo()`](#map-flyto)) will update grid layers every integer zoom level. Setting this option to `false` will update the grid layer only when the smooth animation ends. - updateWhenZooming: true, - // @option updateInterval: Number = 200 - // Tiles will not update more than once every `updateInterval` milliseconds when panning. - updateInterval: 200, - // @option zIndex: Number = 1 - // The explicit zIndex of the tile layer. - zIndex: 1, - // @option bounds: LatLngBounds = undefined - // If set, tiles will only be loaded inside the set `LatLngBounds`. - bounds: null, - // @option minZoom: Number = 0 - // The minimum zoom level down to which this layer will be displayed (inclusive). - minZoom: 0, - // @option maxZoom: Number = undefined - // The maximum zoom level up to which this layer will be displayed (inclusive). - maxZoom: void 0, - // @option maxNativeZoom: Number = undefined - // Maximum zoom number the tile source has available. If it is specified, - // the tiles on all zoom levels higher than `maxNativeZoom` will be loaded - // from `maxNativeZoom` level and auto-scaled. - maxNativeZoom: void 0, - // @option minNativeZoom: Number = undefined - // Minimum zoom number the tile source has available. If it is specified, - // the tiles on all zoom levels lower than `minNativeZoom` will be loaded - // from `minNativeZoom` level and auto-scaled. - minNativeZoom: void 0, - // @option noWrap: Boolean = false - // Whether the layer is wrapped around the antimeridian. If `true`, the - // GridLayer will only be displayed once at low zoom levels. Has no - // effect when the [map CRS](#map-crs) doesn't wrap around. Can be used - // in combination with [`bounds`](#gridlayer-bounds) to prevent requesting - // tiles outside the CRS limits. - noWrap: false, - // @option pane: String = 'tilePane' - // `Map pane` where the grid layer will be added. - pane: "tilePane", - // @option className: String = '' - // A custom class name to assign to the tile layer. Empty by default. - className: "", - // @option keepBuffer: Number = 2 - // When panning the map, keep this many rows and columns of tiles before unloading them. - keepBuffer: 2 - }, - initialize: function(options) { - setOptions(this, options); - }, - onAdd: function() { - this._initContainer(); - this._levels = {}; - this._tiles = {}; - this._resetView(); - }, - beforeAdd: function(map) { - map._addZoomLimit(this); - }, - onRemove: function(map) { - this._removeAllTiles(); - remove(this._container); - map._removeZoomLimit(this); - this._container = null; - this._tileZoom = void 0; - }, - // @method bringToFront: this - // Brings the tile layer to the top of all tile layers. - bringToFront: function() { - if (this._map) { - toFront(this._container); - this._setAutoZIndex(Math.max); - } - return this; - }, - // @method bringToBack: this - // Brings the tile layer to the bottom of all tile layers. - bringToBack: function() { - if (this._map) { - toBack(this._container); - this._setAutoZIndex(Math.min); - } - return this; - }, - // @method getContainer: HTMLElement - // Returns the HTML element that contains the tiles for this layer. - getContainer: function() { - return this._container; - }, - // @method setOpacity(opacity: Number): this - // Changes the [opacity](#gridlayer-opacity) of the grid layer. - setOpacity: function(opacity) { - this.options.opacity = opacity; - this._updateOpacity(); - return this; - }, - // @method setZIndex(zIndex: Number): this - // Changes the [zIndex](#gridlayer-zindex) of the grid layer. - setZIndex: function(zIndex) { - this.options.zIndex = zIndex; - this._updateZIndex(); - return this; - }, - // @method isLoading: Boolean - // Returns `true` if any tile in the grid layer has not finished loading. - isLoading: function() { - return this._loading; - }, - // @method redraw: this - // Causes the layer to clear all the tiles and request them again. - redraw: function() { - if (this._map) { - this._removeAllTiles(); - var tileZoom = this._clampZoom(this._map.getZoom()); - if (tileZoom !== this._tileZoom) { - this._tileZoom = tileZoom; - this._updateLevels(); - } - this._update(); - } - return this; - }, - getEvents: function() { - var events = { - viewprereset: this._invalidateAll, - viewreset: this._resetView, - zoom: this._resetView, - moveend: this._onMoveEnd - }; - if (!this.options.updateWhenIdle) { - if (!this._onMove) { - this._onMove = throttle(this._onMoveEnd, this.options.updateInterval, this); - } - events.move = this._onMove; - } - if (this._zoomAnimated) { - events.zoomanim = this._animateZoom; - } - return events; - }, - // @section Extension methods - // Layers extending `GridLayer` shall reimplement the following method. - // @method createTile(coords: Object, done?: Function): HTMLElement - // Called only internally, must be overridden by classes extending `GridLayer`. - // Returns the `HTMLElement` corresponding to the given `coords`. If the `done` callback - // is specified, it must be called when the tile has finished loading and drawing. - createTile: function() { - return document.createElement("div"); - }, - // @section - // @method getTileSize: Point - // Normalizes the [tileSize option](#gridlayer-tilesize) into a point. Used by the `createTile()` method. - getTileSize: function() { - var s = this.options.tileSize; - return s instanceof Point ? s : new Point(s, s); - }, - _updateZIndex: function() { - if (this._container && this.options.zIndex !== void 0 && this.options.zIndex !== null) { - this._container.style.zIndex = this.options.zIndex; - } - }, - _setAutoZIndex: function(compare) { - var layers2 = this.getPane().children, edgeZIndex = -compare(-Infinity, Infinity); - for (var i = 0, len = layers2.length, zIndex; i < len; i++) { - zIndex = layers2[i].style.zIndex; - if (layers2[i] !== this._container && zIndex) { - edgeZIndex = compare(edgeZIndex, +zIndex); - } - } - if (isFinite(edgeZIndex)) { - this.options.zIndex = edgeZIndex + compare(-1, 1); - this._updateZIndex(); - } - }, - _updateOpacity: function() { - if (!this._map) { - return; - } - if (Browser.ielt9) { - return; - } - setOpacity(this._container, this.options.opacity); - var now = +/* @__PURE__ */ new Date(), nextFrame = false, willPrune = false; - for (var key in this._tiles) { - var tile = this._tiles[key]; - if (!tile.current || !tile.loaded) { - continue; - } - var fade = Math.min(1, (now - tile.loaded) / 200); - setOpacity(tile.el, fade); - if (fade < 1) { - nextFrame = true; - } else { - if (tile.active) { - willPrune = true; - } else { - this._onOpaqueTile(tile); - } - tile.active = true; - } - } - if (willPrune && !this._noPrune) { - this._pruneTiles(); - } - if (nextFrame) { - cancelAnimFrame(this._fadeFrame); - this._fadeFrame = requestAnimFrame(this._updateOpacity, this); - } - }, - _onOpaqueTile: falseFn, - _initContainer: function() { - if (this._container) { - return; - } - this._container = create$1("div", "leaflet-layer " + (this.options.className || "")); - this._updateZIndex(); - if (this.options.opacity < 1) { - this._updateOpacity(); - } - this.getPane().appendChild(this._container); - }, - _updateLevels: function() { - var zoom2 = this._tileZoom, maxZoom = this.options.maxZoom; - if (zoom2 === void 0) { - return void 0; - } - for (var z in this._levels) { - z = Number(z); - if (this._levels[z].el.children.length || z === zoom2) { - this._levels[z].el.style.zIndex = maxZoom - Math.abs(zoom2 - z); - this._onUpdateLevel(z); - } else { - remove(this._levels[z].el); - this._removeTilesAtZoom(z); - this._onRemoveLevel(z); - delete this._levels[z]; - } - } - var level = this._levels[zoom2], map = this._map; - if (!level) { - level = this._levels[zoom2] = {}; - level.el = create$1("div", "leaflet-tile-container leaflet-zoom-animated", this._container); - level.el.style.zIndex = maxZoom; - level.origin = map.project(map.unproject(map.getPixelOrigin()), zoom2).round(); - level.zoom = zoom2; - this._setZoomTransform(level, map.getCenter(), map.getZoom()); - falseFn(level.el.offsetWidth); - this._onCreateLevel(level); - } - this._level = level; - return level; - }, - _onUpdateLevel: falseFn, - _onRemoveLevel: falseFn, - _onCreateLevel: falseFn, - _pruneTiles: function() { - if (!this._map) { - return; - } - var key, tile; - var zoom2 = this._map.getZoom(); - if (zoom2 > this.options.maxZoom || zoom2 < this.options.minZoom) { - this._removeAllTiles(); - return; - } - for (key in this._tiles) { - tile = this._tiles[key]; - tile.retain = tile.current; - } - for (key in this._tiles) { - tile = this._tiles[key]; - if (tile.current && !tile.active) { - var coords = tile.coords; - if (!this._retainParent(coords.x, coords.y, coords.z, coords.z - 5)) { - this._retainChildren(coords.x, coords.y, coords.z, coords.z + 2); - } - } - } - for (key in this._tiles) { - if (!this._tiles[key].retain) { - this._removeTile(key); - } - } - }, - _removeTilesAtZoom: function(zoom2) { - for (var key in this._tiles) { - if (this._tiles[key].coords.z !== zoom2) { - continue; - } - this._removeTile(key); - } - }, - _removeAllTiles: function() { - for (var key in this._tiles) { - this._removeTile(key); - } - }, - _invalidateAll: function() { - for (var z in this._levels) { - remove(this._levels[z].el); - this._onRemoveLevel(Number(z)); - delete this._levels[z]; - } - this._removeAllTiles(); - this._tileZoom = void 0; - }, - _retainParent: function(x, y, z, minZoom) { - var x2 = Math.floor(x / 2), y2 = Math.floor(y / 2), z2 = z - 1, coords2 = new Point(+x2, +y2); - coords2.z = +z2; - var key = this._tileCoordsToKey(coords2), tile = this._tiles[key]; - if (tile && tile.active) { - tile.retain = true; - return true; - } else if (tile && tile.loaded) { - tile.retain = true; - } - if (z2 > minZoom) { - return this._retainParent(x2, y2, z2, minZoom); - } - return false; - }, - _retainChildren: function(x, y, z, maxZoom) { - for (var i = 2 * x; i < 2 * x + 2; i++) { - for (var j = 2 * y; j < 2 * y + 2; j++) { - var coords = new Point(i, j); - coords.z = z + 1; - var key = this._tileCoordsToKey(coords), tile = this._tiles[key]; - if (tile && tile.active) { - tile.retain = true; - continue; - } else if (tile && tile.loaded) { - tile.retain = true; - } - if (z + 1 < maxZoom) { - this._retainChildren(i, j, z + 1, maxZoom); - } - } - } - }, - _resetView: function(e) { - var animating = e && (e.pinch || e.flyTo); - this._setView(this._map.getCenter(), this._map.getZoom(), animating, animating); - }, - _animateZoom: function(e) { - this._setView(e.center, e.zoom, true, e.noUpdate); - }, - _clampZoom: function(zoom2) { - var options = this.options; - if (void 0 !== options.minNativeZoom && zoom2 < options.minNativeZoom) { - return options.minNativeZoom; - } - if (void 0 !== options.maxNativeZoom && options.maxNativeZoom < zoom2) { - return options.maxNativeZoom; - } - return zoom2; - }, - _setView: function(center, zoom2, noPrune, noUpdate) { - var tileZoom = Math.round(zoom2); - if (this.options.maxZoom !== void 0 && tileZoom > this.options.maxZoom || this.options.minZoom !== void 0 && tileZoom < this.options.minZoom) { - tileZoom = void 0; - } else { - tileZoom = this._clampZoom(tileZoom); - } - var tileZoomChanged = this.options.updateWhenZooming && tileZoom !== this._tileZoom; - if (!noUpdate || tileZoomChanged) { - this._tileZoom = tileZoom; - if (this._abortLoading) { - this._abortLoading(); - } - this._updateLevels(); - this._resetGrid(); - if (tileZoom !== void 0) { - this._update(center); - } - if (!noPrune) { - this._pruneTiles(); - } - this._noPrune = !!noPrune; - } - this._setZoomTransforms(center, zoom2); - }, - _setZoomTransforms: function(center, zoom2) { - for (var i in this._levels) { - this._setZoomTransform(this._levels[i], center, zoom2); - } - }, - _setZoomTransform: function(level, center, zoom2) { - var scale2 = this._map.getZoomScale(zoom2, level.zoom), translate = level.origin.multiplyBy(scale2).subtract(this._map._getNewPixelOrigin(center, zoom2)).round(); - if (Browser.any3d) { - setTransform(level.el, translate, scale2); - } else { - setPosition(level.el, translate); - } - }, - _resetGrid: function() { - var map = this._map, crs = map.options.crs, tileSize = this._tileSize = this.getTileSize(), tileZoom = this._tileZoom; - var bounds = this._map.getPixelWorldBounds(this._tileZoom); - if (bounds) { - this._globalTileRange = this._pxBoundsToTileRange(bounds); - } - this._wrapX = crs.wrapLng && !this.options.noWrap && [ - Math.floor(map.project([0, crs.wrapLng[0]], tileZoom).x / tileSize.x), - Math.ceil(map.project([0, crs.wrapLng[1]], tileZoom).x / tileSize.y) - ]; - this._wrapY = crs.wrapLat && !this.options.noWrap && [ - Math.floor(map.project([crs.wrapLat[0], 0], tileZoom).y / tileSize.x), - Math.ceil(map.project([crs.wrapLat[1], 0], tileZoom).y / tileSize.y) - ]; - }, - _onMoveEnd: function() { - if (!this._map || this._map._animatingZoom) { - return; - } - this._update(); - }, - _getTiledPixelBounds: function(center) { - var map = this._map, mapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom(), scale2 = map.getZoomScale(mapZoom, this._tileZoom), pixelCenter = map.project(center, this._tileZoom).floor(), halfSize = map.getSize().divideBy(scale2 * 2); - return new Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize)); - }, - // Private method to load tiles in the grid's active zoom level according to map bounds - _update: function(center) { - var map = this._map; - if (!map) { - return; - } - var zoom2 = this._clampZoom(map.getZoom()); - if (center === void 0) { - center = map.getCenter(); - } - if (this._tileZoom === void 0) { - return; - } - var pixelBounds = this._getTiledPixelBounds(center), tileRange = this._pxBoundsToTileRange(pixelBounds), tileCenter = tileRange.getCenter(), queue = [], margin = this.options.keepBuffer, noPruneRange = new Bounds( - tileRange.getBottomLeft().subtract([margin, -margin]), - tileRange.getTopRight().add([margin, -margin]) - ); - if (!(isFinite(tileRange.min.x) && isFinite(tileRange.min.y) && isFinite(tileRange.max.x) && isFinite(tileRange.max.y))) { - throw new Error("Attempted to load an infinite number of tiles"); - } - for (var key in this._tiles) { - var c = this._tiles[key].coords; - if (c.z !== this._tileZoom || !noPruneRange.contains(new Point(c.x, c.y))) { - this._tiles[key].current = false; - } - } - if (Math.abs(zoom2 - this._tileZoom) > 1) { - this._setView(center, zoom2); - return; - } - for (var j = tileRange.min.y; j <= tileRange.max.y; j++) { - for (var i = tileRange.min.x; i <= tileRange.max.x; i++) { - var coords = new Point(i, j); - coords.z = this._tileZoom; - if (!this._isValidTile(coords)) { - continue; - } - var tile = this._tiles[this._tileCoordsToKey(coords)]; - if (tile) { - tile.current = true; - } else { - queue.push(coords); - } - } - } - queue.sort(function(a, b) { - return a.distanceTo(tileCenter) - b.distanceTo(tileCenter); - }); - if (queue.length !== 0) { - if (!this._loading) { - this._loading = true; - this.fire("loading"); - } - var fragment = document.createDocumentFragment(); - for (i = 0; i < queue.length; i++) { - this._addTile(queue[i], fragment); - } - this._level.el.appendChild(fragment); - } - }, - _isValidTile: function(coords) { - var crs = this._map.options.crs; - if (!crs.infinite) { - var bounds = this._globalTileRange; - if (!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x) || !crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y)) { - return false; - } - } - if (!this.options.bounds) { - return true; - } - var tileBounds = this._tileCoordsToBounds(coords); - return toLatLngBounds(this.options.bounds).overlaps(tileBounds); - }, - _keyToBounds: function(key) { - return this._tileCoordsToBounds(this._keyToTileCoords(key)); - }, - _tileCoordsToNwSe: function(coords) { - var map = this._map, tileSize = this.getTileSize(), nwPoint = coords.scaleBy(tileSize), sePoint = nwPoint.add(tileSize), nw = map.unproject(nwPoint, coords.z), se = map.unproject(sePoint, coords.z); - return [nw, se]; - }, - // converts tile coordinates to its geographical bounds - _tileCoordsToBounds: function(coords) { - var bp = this._tileCoordsToNwSe(coords), bounds = new LatLngBounds(bp[0], bp[1]); - if (!this.options.noWrap) { - bounds = this._map.wrapLatLngBounds(bounds); - } - return bounds; - }, - // converts tile coordinates to key for the tile cache - _tileCoordsToKey: function(coords) { - return coords.x + ":" + coords.y + ":" + coords.z; - }, - // converts tile cache key to coordinates - _keyToTileCoords: function(key) { - var k = key.split(":"), coords = new Point(+k[0], +k[1]); - coords.z = +k[2]; - return coords; - }, - _removeTile: function(key) { - var tile = this._tiles[key]; - if (!tile) { - return; - } - remove(tile.el); - delete this._tiles[key]; - this.fire("tileunload", { - tile: tile.el, - coords: this._keyToTileCoords(key) - }); - }, - _initTile: function(tile) { - addClass(tile, "leaflet-tile"); - var tileSize = this.getTileSize(); - tile.style.width = tileSize.x + "px"; - tile.style.height = tileSize.y + "px"; - tile.onselectstart = falseFn; - tile.onmousemove = falseFn; - if (Browser.ielt9 && this.options.opacity < 1) { - setOpacity(tile, this.options.opacity); - } - }, - _addTile: function(coords, container) { - var tilePos = this._getTilePos(coords), key = this._tileCoordsToKey(coords); - var tile = this.createTile(this._wrapCoords(coords), bind(this._tileReady, this, coords)); - this._initTile(tile); - if (this.createTile.length < 2) { - requestAnimFrame(bind(this._tileReady, this, coords, null, tile)); - } - setPosition(tile, tilePos); - this._tiles[key] = { - el: tile, - coords, - current: true - }; - container.appendChild(tile); - this.fire("tileloadstart", { - tile, - coords - }); - }, - _tileReady: function(coords, err, tile) { - if (err) { - this.fire("tileerror", { - error: err, - tile, - coords - }); - } - var key = this._tileCoordsToKey(coords); - tile = this._tiles[key]; - if (!tile) { - return; - } - tile.loaded = +/* @__PURE__ */ new Date(); - if (this._map._fadeAnimated) { - setOpacity(tile.el, 0); - cancelAnimFrame(this._fadeFrame); - this._fadeFrame = requestAnimFrame(this._updateOpacity, this); - } else { - tile.active = true; - this._pruneTiles(); - } - if (!err) { - addClass(tile.el, "leaflet-tile-loaded"); - this.fire("tileload", { - tile: tile.el, - coords - }); - } - if (this._noTilesToLoad()) { - this._loading = false; - this.fire("load"); - if (Browser.ielt9 || !this._map._fadeAnimated) { - requestAnimFrame(this._pruneTiles, this); - } else { - setTimeout(bind(this._pruneTiles, this), 250); - } - } - }, - _getTilePos: function(coords) { - return coords.scaleBy(this.getTileSize()).subtract(this._level.origin); - }, - _wrapCoords: function(coords) { - var newCoords = new Point( - this._wrapX ? wrapNum(coords.x, this._wrapX) : coords.x, - this._wrapY ? wrapNum(coords.y, this._wrapY) : coords.y - ); - newCoords.z = coords.z; - return newCoords; - }, - _pxBoundsToTileRange: function(bounds) { - var tileSize = this.getTileSize(); - return new Bounds( - bounds.min.unscaleBy(tileSize).floor(), - bounds.max.unscaleBy(tileSize).ceil().subtract([1, 1]) - ); - }, - _noTilesToLoad: function() { - for (var key in this._tiles) { - if (!this._tiles[key].loaded) { - return false; - } - } - return true; - } - }); - function gridLayer(options) { - return new GridLayer(options); - } - var TileLayer = GridLayer.extend({ - // @section - // @aka TileLayer options - options: { - // @option minZoom: Number = 0 - // The minimum zoom level down to which this layer will be displayed (inclusive). - minZoom: 0, - // @option maxZoom: Number = 18 - // The maximum zoom level up to which this layer will be displayed (inclusive). - maxZoom: 18, - // @option subdomains: String|String[] = 'abc' - // Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings. - subdomains: "abc", - // @option errorTileUrl: String = '' - // URL to the tile image to show in place of the tile that failed to load. - errorTileUrl: "", - // @option zoomOffset: Number = 0 - // The zoom number used in tile URLs will be offset with this value. - zoomOffset: 0, - // @option tms: Boolean = false - // If `true`, inverses Y axis numbering for tiles (turn this on for [TMS](https://en.wikipedia.org/wiki/Tile_Map_Service) services). - tms: false, - // @option zoomReverse: Boolean = false - // If set to true, the zoom number used in tile URLs will be reversed (`maxZoom - zoom` instead of `zoom`) - zoomReverse: false, - // @option detectRetina: Boolean = false - // If `true` and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution. - detectRetina: false, - // @option crossOrigin: Boolean|String = false - // Whether the crossOrigin attribute will be added to the tiles. - // If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data. - // Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values. - crossOrigin: false, - // @option referrerPolicy: Boolean|String = false - // Whether the referrerPolicy attribute will be added to the tiles. - // If a String is provided, all tiles will have their referrerPolicy attribute set to the String provided. - // This may be needed if your map's rendering context has a strict default but your tile provider expects a valid referrer - // (e.g. to validate an API token). - // Refer to [HTMLImageElement.referrerPolicy](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy) for valid String values. - referrerPolicy: false - }, - initialize: function(url, options) { - this._url = url; - options = setOptions(this, options); - if (options.detectRetina && Browser.retina && options.maxZoom > 0) { - options.tileSize = Math.floor(options.tileSize / 2); - if (!options.zoomReverse) { - options.zoomOffset++; - options.maxZoom = Math.max(options.minZoom, options.maxZoom - 1); - } else { - options.zoomOffset--; - options.minZoom = Math.min(options.maxZoom, options.minZoom + 1); - } - options.minZoom = Math.max(0, options.minZoom); - } else if (!options.zoomReverse) { - options.maxZoom = Math.max(options.minZoom, options.maxZoom); - } else { - options.minZoom = Math.min(options.maxZoom, options.minZoom); - } - if (typeof options.subdomains === "string") { - options.subdomains = options.subdomains.split(""); - } - this.on("tileunload", this._onTileRemove); - }, - // @method setUrl(url: String, noRedraw?: Boolean): this - // Updates the layer's URL template and redraws it (unless `noRedraw` is set to `true`). - // If the URL does not change, the layer will not be redrawn unless - // the noRedraw parameter is set to false. - setUrl: function(url, noRedraw) { - if (this._url === url && noRedraw === void 0) { - noRedraw = true; - } - this._url = url; - if (!noRedraw) { - this.redraw(); - } - return this; - }, - // @method createTile(coords: Object, done?: Function): HTMLElement - // Called only internally, overrides GridLayer's [`createTile()`](#gridlayer-createtile) - // to return an `` HTML element with the appropriate image URL given `coords`. The `done` - // callback is called when the tile has been loaded. - createTile: function(coords, done) { - var tile = document.createElement("img"); - on(tile, "load", bind(this._tileOnLoad, this, done, tile)); - on(tile, "error", bind(this._tileOnError, this, done, tile)); - if (this.options.crossOrigin || this.options.crossOrigin === "") { - tile.crossOrigin = this.options.crossOrigin === true ? "" : this.options.crossOrigin; - } - if (typeof this.options.referrerPolicy === "string") { - tile.referrerPolicy = this.options.referrerPolicy; - } - tile.alt = ""; - tile.src = this.getTileUrl(coords); - return tile; - }, - // @section Extension methods - // @uninheritable - // Layers extending `TileLayer` might reimplement the following method. - // @method getTileUrl(coords: Object): String - // Called only internally, returns the URL for a tile given its coordinates. - // Classes extending `TileLayer` can override this function to provide custom tile URL naming schemes. - getTileUrl: function(coords) { - var data = { - r: Browser.retina ? "@2x" : "", - s: this._getSubdomain(coords), - x: coords.x, - y: coords.y, - z: this._getZoomForUrl() - }; - if (this._map && !this._map.options.crs.infinite) { - var invertedY = this._globalTileRange.max.y - coords.y; - if (this.options.tms) { - data["y"] = invertedY; - } - data["-y"] = invertedY; - } - return template(this._url, extend(data, this.options)); - }, - _tileOnLoad: function(done, tile) { - if (Browser.ielt9) { - setTimeout(bind(done, this, null, tile), 0); - } else { - done(null, tile); - } - }, - _tileOnError: function(done, tile, e) { - var errorUrl = this.options.errorTileUrl; - if (errorUrl && tile.getAttribute("src") !== errorUrl) { - tile.src = errorUrl; - } - done(e, tile); - }, - _onTileRemove: function(e) { - e.tile.onload = null; - }, - _getZoomForUrl: function() { - var zoom2 = this._tileZoom, maxZoom = this.options.maxZoom, zoomReverse = this.options.zoomReverse, zoomOffset = this.options.zoomOffset; - if (zoomReverse) { - zoom2 = maxZoom - zoom2; - } - return zoom2 + zoomOffset; - }, - _getSubdomain: function(tilePoint) { - var index2 = Math.abs(tilePoint.x + tilePoint.y) % this.options.subdomains.length; - return this.options.subdomains[index2]; - }, - // stops loading all tiles in the background layer - _abortLoading: function() { - var i, tile; - for (i in this._tiles) { - if (this._tiles[i].coords.z !== this._tileZoom) { - tile = this._tiles[i].el; - tile.onload = falseFn; - tile.onerror = falseFn; - if (!tile.complete) { - tile.src = emptyImageUrl; - var coords = this._tiles[i].coords; - remove(tile); - delete this._tiles[i]; - this.fire("tileabort", { - tile, - coords - }); - } - } - } - }, - _removeTile: function(key) { - var tile = this._tiles[key]; - if (!tile) { - return; - } - tile.el.setAttribute("src", emptyImageUrl); - return GridLayer.prototype._removeTile.call(this, key); - }, - _tileReady: function(coords, err, tile) { - if (!this._map || tile && tile.getAttribute("src") === emptyImageUrl) { - return; - } - return GridLayer.prototype._tileReady.call(this, coords, err, tile); - } - }); - function tileLayer(url, options) { - return new TileLayer(url, options); - } - var TileLayerWMS = TileLayer.extend({ - // @section - // @aka TileLayer.WMS options - // If any custom options not documented here are used, they will be sent to the - // WMS server as extra parameters in each request URL. This can be useful for - // [non-standard vendor WMS parameters](https://docs.geoserver.org/stable/en/user/services/wms/vendor.html). - defaultWmsParams: { - service: "WMS", - request: "GetMap", - // @option layers: String = '' - // **(required)** Comma-separated list of WMS layers to show. - layers: "", - // @option styles: String = '' - // Comma-separated list of WMS styles. - styles: "", - // @option format: String = 'image/jpeg' - // WMS image format (use `'image/png'` for layers with transparency). - format: "image/jpeg", - // @option transparent: Boolean = false - // If `true`, the WMS service will return images with transparency. - transparent: false, - // @option version: String = '1.1.1' - // Version of the WMS service to use - version: "1.1.1" - }, - options: { - // @option crs: CRS = null - // Coordinate Reference System to use for the WMS requests, defaults to - // map CRS. Don't change this if you're not sure what it means. - crs: null, - // @option uppercase: Boolean = false - // If `true`, WMS request parameter keys will be uppercase. - uppercase: false - }, - initialize: function(url, options) { - this._url = url; - var wmsParams = extend({}, this.defaultWmsParams); - for (var i in options) { - if (!(i in this.options)) { - wmsParams[i] = options[i]; - } - } - options = setOptions(this, options); - var realRetina = options.detectRetina && Browser.retina ? 2 : 1; - var tileSize = this.getTileSize(); - wmsParams.width = tileSize.x * realRetina; - wmsParams.height = tileSize.y * realRetina; - this.wmsParams = wmsParams; - }, - onAdd: function(map) { - this._crs = this.options.crs || map.options.crs; - this._wmsVersion = parseFloat(this.wmsParams.version); - var projectionKey = this._wmsVersion >= 1.3 ? "crs" : "srs"; - this.wmsParams[projectionKey] = this._crs.code; - TileLayer.prototype.onAdd.call(this, map); - }, - getTileUrl: function(coords) { - var tileBounds = this._tileCoordsToNwSe(coords), crs = this._crs, bounds = toBounds(crs.project(tileBounds[0]), crs.project(tileBounds[1])), min = bounds.min, max = bounds.max, bbox = (this._wmsVersion >= 1.3 && this._crs === EPSG4326 ? [min.y, min.x, max.y, max.x] : [min.x, min.y, max.x, max.y]).join(","), url = TileLayer.prototype.getTileUrl.call(this, coords); - return url + getParamString(this.wmsParams, url, this.options.uppercase) + (this.options.uppercase ? "&BBOX=" : "&bbox=") + bbox; - }, - // @method setParams(params: Object, noRedraw?: Boolean): this - // Merges an object with the new parameters and re-requests tiles on the current screen (unless `noRedraw` was set to true). - setParams: function(params, noRedraw) { - extend(this.wmsParams, params); - if (!noRedraw) { - this.redraw(); - } - return this; - } - }); - function tileLayerWMS(url, options) { - return new TileLayerWMS(url, options); - } - TileLayer.WMS = TileLayerWMS; - tileLayer.wms = tileLayerWMS; - var Renderer = Layer.extend({ - // @section - // @aka Renderer options - options: { - // @option padding: Number = 0.1 - // How much to extend the clip area around the map view (relative to its size) - // e.g. 0.1 would be 10% of map view in each direction - padding: 0.1 - }, - initialize: function(options) { - setOptions(this, options); - stamp(this); - this._layers = this._layers || {}; - }, - onAdd: function() { - if (!this._container) { - this._initContainer(); - addClass(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 events = { - viewreset: this._reset, - zoom: this._onZoom, - moveend: this._update, - zoomend: this._onZoomEnd - }; - if (this._zoomAnimated) { - events.zoomanim = this._onAnimZoom; - } - return events; - }, - _onAnimZoom: function(ev) { - this._updateTransform(ev.center, ev.zoom); - }, - _onZoom: function() { - this._updateTransform(this._map.getCenter(), this._map.getZoom()); - }, - _updateTransform: function(center, zoom2) { - var scale2 = this._map.getZoomScale(zoom2, this._zoom), viewHalf = this._map.getSize().multiplyBy(0.5 + this.options.padding), currentCenterPoint = this._map.project(this._center, zoom2), topLeftOffset = viewHalf.multiplyBy(-scale2).add(currentCenterPoint).subtract(this._map._getNewPixelOrigin(center, zoom2)); - if (Browser.any3d) { - setTransform(this._container, topLeftOffset, scale2); - } else { - setPosition(this._container, topLeftOffset); - } - }, - _reset: function() { - this._update(); - this._updateTransform(this._center, this._zoom); - for (var id in this._layers) { - this._layers[id]._reset(); - } - }, - _onZoomEnd: function() { - for (var id in this._layers) { - this._layers[id]._project(); - } - }, - _updatePaths: function() { - for (var id in this._layers) { - this._layers[id]._update(); - } - }, - _update: function() { - var p = this.options.padding, size = this._map.getSize(), min = this._map.containerPointToLayerPoint(size.multiplyBy(-p)).round(); - this._bounds = new Bounds(min, min.add(size.multiplyBy(1 + p * 2)).round()); - this._center = this._map.getCenter(); - this._zoom = this._map.getZoom(); - } - }); - var Canvas = Renderer.extend({ - // @section - // @aka Canvas options - options: { - // @option tolerance: Number = 0 - // How much to extend the click tolerance around a path/object on the map. - tolerance: 0 - }, - getEvents: function() { - var events = Renderer.prototype.getEvents.call(this); - events.viewprereset = this._onViewPreReset; - return events; - }, - _onViewPreReset: function() { - this._postponeUpdatePaths = true; - }, - onAdd: function() { - Renderer.prototype.onAdd.call(this); - this._draw(); - }, - _initContainer: function() { - var container = this._container = document.createElement("canvas"); - on(container, "mousemove", this._onMouseMove, this); - on(container, "click dblclick mousedown mouseup contextmenu", this._onClick, this); - on(container, "mouseout", this._handleMouseOut, this); - container["_leaflet_disable_events"] = true; - this._ctx = container.getContext("2d"); - }, - _destroyContainer: function() { - cancelAnimFrame(this._redrawRequest); - delete this._ctx; - remove(this._container); - off(this._container); - delete this._container; - }, - _updatePaths: function() { - if (this._postponeUpdatePaths) { - return; - } - var layer; - this._redrawBounds = null; - for (var id in this._layers) { - layer = this._layers[id]; - layer._update(); - } - this._redraw(); - }, - _update: function() { - if (this._map._animatingZoom && this._bounds) { - return; - } - Renderer.prototype._update.call(this); - var b = this._bounds, container = this._container, size = b.getSize(), m = Browser.retina ? 2 : 1; - setPosition(container, b.min); - container.width = m * size.x; - container.height = m * size.y; - container.style.width = size.x + "px"; - container.style.height = size.y + "px"; - if (Browser.retina) { - this._ctx.scale(2, 2); - } - this._ctx.translate(-b.min.x, -b.min.y); - this.fire("update"); - }, - _reset: function() { - Renderer.prototype._reset.call(this); - if (this._postponeUpdatePaths) { - this._postponeUpdatePaths = false; - this._updatePaths(); - } - }, - _initPath: function(layer) { - this._updateDashArray(layer); - this._layers[stamp(layer)] = layer; - var order = layer._order = { - layer, - prev: this._drawLast, - next: null - }; - if (this._drawLast) { - this._drawLast.next = order; - } - this._drawLast = order; - this._drawFirst = this._drawFirst || this._drawLast; - }, - _addPath: function(layer) { - this._requestRedraw(layer); - }, - _removePath: function(layer) { - var order = layer._order; - var next = order.next; - var prev = order.prev; - if (next) { - next.prev = prev; - } else { - this._drawLast = prev; - } - if (prev) { - prev.next = next; - } else { - this._drawFirst = next; - } - delete layer._order; - delete this._layers[stamp(layer)]; - this._requestRedraw(layer); - }, - _updatePath: function(layer) { - this._extendRedrawBounds(layer); - layer._project(); - layer._update(); - this._requestRedraw(layer); - }, - _updateStyle: function(layer) { - this._updateDashArray(layer); - this._requestRedraw(layer); - }, - _updateDashArray: function(layer) { - if (typeof layer.options.dashArray === "string") { - var parts = layer.options.dashArray.split(/[, ]+/), dashArray = [], dashValue, i; - for (i = 0; i < parts.length; i++) { - dashValue = Number(parts[i]); - if (isNaN(dashValue)) { - return; - } - dashArray.push(dashValue); - } - layer.options._dashArray = dashArray; - } else { - layer.options._dashArray = layer.options.dashArray; - } - }, - _requestRedraw: function(layer) { - if (!this._map) { - return; - } - this._extendRedrawBounds(layer); - this._redrawRequest = this._redrawRequest || requestAnimFrame(this._redraw, this); - }, - _extendRedrawBounds: function(layer) { - if (layer._pxBounds) { - var padding = (layer.options.weight || 0) + 1; - this._redrawBounds = this._redrawBounds || new Bounds(); - this._redrawBounds.extend(layer._pxBounds.min.subtract([padding, padding])); - this._redrawBounds.extend(layer._pxBounds.max.add([padding, padding])); - } - }, - _redraw: function() { - this._redrawRequest = null; - if (this._redrawBounds) { - this._redrawBounds.min._floor(); - this._redrawBounds.max._ceil(); - } - this._clear(); - this._draw(); - this._redrawBounds = null; - }, - _clear: function() { - var bounds = this._redrawBounds; - if (bounds) { - var size = bounds.getSize(); - this._ctx.clearRect(bounds.min.x, bounds.min.y, size.x, size.y); - } else { - this._ctx.save(); - this._ctx.setTransform(1, 0, 0, 1, 0, 0); - this._ctx.clearRect(0, 0, this._container.width, this._container.height); - this._ctx.restore(); - } - }, - _draw: function() { - var layer, bounds = this._redrawBounds; - this._ctx.save(); - if (bounds) { - var size = bounds.getSize(); - this._ctx.beginPath(); - this._ctx.rect(bounds.min.x, bounds.min.y, size.x, size.y); - this._ctx.clip(); - } - this._drawing = true; - for (var order = this._drawFirst; order; order = order.next) { - layer = order.layer; - if (!bounds || layer._pxBounds && layer._pxBounds.intersects(bounds)) { - layer._updatePath(); - } - } - this._drawing = false; - this._ctx.restore(); - }, - _updatePoly: function(layer, closed) { - if (!this._drawing) { - return; - } - var i, j, len2, p, parts = layer._parts, len = parts.length, ctx = this._ctx; - if (!len) { - return; - } - ctx.beginPath(); - for (i = 0; i < len; i++) { - for (j = 0, len2 = parts[i].length; j < len2; j++) { - p = parts[i][j]; - ctx[j ? "lineTo" : "moveTo"](p.x, p.y); - } - if (closed) { - ctx.closePath(); - } - } - this._fillStroke(ctx, layer); - }, - _updateCircle: function(layer) { - if (!this._drawing || layer._empty()) { - return; - } - var p = layer._point, ctx = this._ctx, r = Math.max(Math.round(layer._radius), 1), s = (Math.max(Math.round(layer._radiusY), 1) || r) / r; - if (s !== 1) { - ctx.save(); - ctx.scale(1, s); - } - ctx.beginPath(); - ctx.arc(p.x, p.y / s, r, 0, Math.PI * 2, false); - if (s !== 1) { - ctx.restore(); - } - this._fillStroke(ctx, layer); - }, - _fillStroke: function(ctx, layer) { - var options = layer.options; - if (options.fill) { - ctx.globalAlpha = options.fillOpacity; - ctx.fillStyle = options.fillColor || options.color; - ctx.fill(options.fillRule || "evenodd"); - } - if (options.stroke && options.weight !== 0) { - if (ctx.setLineDash) { - ctx.setLineDash(layer.options && layer.options._dashArray || []); - } - ctx.globalAlpha = options.opacity; - ctx.lineWidth = options.weight; - ctx.strokeStyle = options.color; - ctx.lineCap = options.lineCap; - ctx.lineJoin = options.lineJoin; - ctx.stroke(); - } - }, - // Canvas obviously doesn't have mouse events for individual drawn objects, - // so we emulate that by calculating what's under the mouse on mousemove/click manually - _onClick: function(e) { - var point = this._map.mouseEventToLayerPoint(e), layer, clickedLayer; - for (var order = this._drawFirst; order; order = order.next) { - layer = order.layer; - if (layer.options.interactive && layer._containsPoint(point)) { - if (!(e.type === "click" || e.type === "preclick") || !this._map._draggableMoved(layer)) { - clickedLayer = layer; - } - } - } - this._fireEvent(clickedLayer ? [clickedLayer] : false, e); - }, - _onMouseMove: function(e) { - if (!this._map || this._map.dragging.moving() || this._map._animatingZoom) { - return; - } - var point = this._map.mouseEventToLayerPoint(e); - this._handleMouseHover(e, point); - }, - _handleMouseOut: function(e) { - var layer = this._hoveredLayer; - if (layer) { - removeClass(this._container, "leaflet-interactive"); - this._fireEvent([layer], e, "mouseout"); - this._hoveredLayer = null; - this._mouseHoverThrottled = false; - } - }, - _handleMouseHover: function(e, point) { - if (this._mouseHoverThrottled) { - return; - } - var layer, candidateHoveredLayer; - for (var order = this._drawFirst; order; order = order.next) { - layer = order.layer; - if (layer.options.interactive && layer._containsPoint(point)) { - candidateHoveredLayer = layer; - } - } - if (candidateHoveredLayer !== this._hoveredLayer) { - this._handleMouseOut(e); - if (candidateHoveredLayer) { - addClass(this._container, "leaflet-interactive"); - this._fireEvent([candidateHoveredLayer], e, "mouseover"); - this._hoveredLayer = candidateHoveredLayer; - } - } - this._fireEvent(this._hoveredLayer ? [this._hoveredLayer] : false, e); - this._mouseHoverThrottled = true; - setTimeout(bind(function() { - this._mouseHoverThrottled = false; - }, this), 32); - }, - _fireEvent: function(layers2, e, type) { - this._map._fireDOMEvent(e, type || e.type, layers2); - }, - _bringToFront: function(layer) { - var order = layer._order; - if (!order) { - return; - } - var next = order.next; - var prev = order.prev; - if (next) { - next.prev = prev; - } else { - return; - } - if (prev) { - prev.next = next; - } else if (next) { - this._drawFirst = next; - } - order.prev = this._drawLast; - this._drawLast.next = order; - order.next = null; - this._drawLast = order; - this._requestRedraw(layer); - }, - _bringToBack: function(layer) { - var order = layer._order; - if (!order) { - return; - } - var next = order.next; - var prev = order.prev; - if (prev) { - prev.next = next; - } else { - return; - } - if (next) { - next.prev = prev; - } else if (prev) { - this._drawLast = prev; - } - order.prev = null; - order.next = this._drawFirst; - this._drawFirst.prev = order; - this._drawFirst = order; - this._requestRedraw(layer); - } - }); - function canvas(options) { - return Browser.canvas ? new Canvas(options) : null; - } - var vmlCreate = (function() { - try { - document.namespaces.add("lvml", "urn:schemas-microsoft-com:vml"); - return function(name) { - return document.createElement("'); - }; - } catch (e) { - } - return function(name) { - return document.createElement("<" + name + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">'); - }; - })(); - var vmlMixin = { - _initContainer: function() { - this._container = create$1("div", "leaflet-vml-container"); - }, - _update: function() { - if (this._map._animatingZoom) { - return; - } - Renderer.prototype._update.call(this); - this.fire("update"); - }, - _initPath: function(layer) { - var container = layer._container = vmlCreate("shape"); - addClass(container, "leaflet-vml-shape " + (this.options.className || "")); - container.coordsize = "1 1"; - layer._path = vmlCreate("path"); - container.appendChild(layer._path); - this._updateStyle(layer); - this._layers[stamp(layer)] = layer; - }, - _addPath: function(layer) { - var container = layer._container; - this._container.appendChild(container); - if (layer.options.interactive) { - layer.addInteractiveTarget(container); - } - }, - _removePath: function(layer) { - var container = layer._container; - remove(container); - layer.removeInteractiveTarget(container); - delete this._layers[stamp(layer)]; - }, - _updateStyle: function(layer) { - var stroke = layer._stroke, fill = layer._fill, options = layer.options, container = layer._container; - container.stroked = !!options.stroke; - container.filled = !!options.fill; - if (options.stroke) { - if (!stroke) { - stroke = layer._stroke = vmlCreate("stroke"); - } - container.appendChild(stroke); - stroke.weight = options.weight + "px"; - stroke.color = options.color; - stroke.opacity = options.opacity; - if (options.dashArray) { - stroke.dashStyle = isArray(options.dashArray) ? options.dashArray.join(" ") : options.dashArray.replace(/( *, *)/g, " "); - } else { - stroke.dashStyle = ""; - } - stroke.endcap = options.lineCap.replace("butt", "flat"); - stroke.joinstyle = options.lineJoin; - } else if (stroke) { - container.removeChild(stroke); - layer._stroke = null; - } - if (options.fill) { - if (!fill) { - fill = layer._fill = vmlCreate("fill"); - } - container.appendChild(fill); - fill.color = options.fillColor || options.color; - fill.opacity = options.fillOpacity; - } else if (fill) { - container.removeChild(fill); - layer._fill = null; - } - }, - _updateCircle: function(layer) { - var p = layer._point.round(), r = Math.round(layer._radius), r2 = Math.round(layer._radiusY || r); - this._setPath(layer, layer._empty() ? "M0 0" : "AL " + p.x + "," + p.y + " " + r + "," + r2 + " 0," + 65535 * 360); - }, - _setPath: function(layer, path) { - layer._path.v = path; - }, - _bringToFront: function(layer) { - toFront(layer._container); - }, - _bringToBack: function(layer) { - toBack(layer._container); - } - }; - var create = Browser.vml ? vmlCreate : svgCreate; - var SVG = Renderer.extend({ - _initContainer: function() { - this._container = create("svg"); - this._container.setAttribute("pointer-events", "none"); - this._rootGroup = create("g"); - this._container.appendChild(this._rootGroup); - }, - _destroyContainer: function() { - remove(this._container); - off(this._container); - delete this._container; - delete this._rootGroup; - delete this._svgSize; - }, - _update: function() { - if (this._map._animatingZoom && this._bounds) { - return; - } - Renderer.prototype._update.call(this); - var b = this._bounds, size = b.getSize(), container = this._container; - if (!this._svgSize || !this._svgSize.equals(size)) { - this._svgSize = size; - container.setAttribute("width", size.x); - container.setAttribute("height", size.y); - } - setPosition(container, b.min); - container.setAttribute("viewBox", [b.min.x, b.min.y, size.x, size.y].join(" ")); - this.fire("update"); - }, - // methods below are called by vector layers implementations - _initPath: function(layer) { - var path = layer._path = create("path"); - if (layer.options.className) { - addClass(path, layer.options.className); - } - if (layer.options.interactive) { - addClass(path, "leaflet-interactive"); - } - this._updateStyle(layer); - this._layers[stamp(layer)] = layer; - }, - _addPath: function(layer) { - if (!this._rootGroup) { - this._initContainer(); - } - this._rootGroup.appendChild(layer._path); - layer.addInteractiveTarget(layer._path); - }, - _removePath: function(layer) { - remove(layer._path); - layer.removeInteractiveTarget(layer._path); - delete this._layers[stamp(layer)]; - }, - _updatePath: function(layer) { - layer._project(); - layer._update(); - }, - _updateStyle: function(layer) { - var path = layer._path, options = layer.options; - if (!path) { - return; - } - if (options.stroke) { - path.setAttribute("stroke", options.color); - path.setAttribute("stroke-opacity", options.opacity); - path.setAttribute("stroke-width", options.weight); - path.setAttribute("stroke-linecap", options.lineCap); - path.setAttribute("stroke-linejoin", options.lineJoin); - if (options.dashArray) { - path.setAttribute("stroke-dasharray", options.dashArray); - } else { - path.removeAttribute("stroke-dasharray"); - } - if (options.dashOffset) { - path.setAttribute("stroke-dashoffset", options.dashOffset); - } else { - path.removeAttribute("stroke-dashoffset"); - } - } else { - path.setAttribute("stroke", "none"); - } - if (options.fill) { - path.setAttribute("fill", options.fillColor || options.color); - path.setAttribute("fill-opacity", options.fillOpacity); - path.setAttribute("fill-rule", options.fillRule || "evenodd"); - } else { - path.setAttribute("fill", "none"); - } - }, - _updatePoly: function(layer, closed) { - this._setPath(layer, pointsToPath(layer._parts, closed)); - }, - _updateCircle: function(layer) { - var p = layer._point, r = Math.max(Math.round(layer._radius), 1), r2 = Math.max(Math.round(layer._radiusY), 1) || r, arc = "a" + r + "," + r2 + " 0 1,0 "; - var d = layer._empty() ? "M0 0" : "M" + (p.x - r) + "," + p.y + arc + r * 2 + ",0 " + arc + -r * 2 + ",0 "; - this._setPath(layer, d); - }, - _setPath: function(layer, path) { - layer._path.setAttribute("d", path); - }, - // SVG does not have the concept of zIndex so we resort to changing the DOM order of elements - _bringToFront: function(layer) { - toFront(layer._path); - }, - _bringToBack: function(layer) { - toBack(layer._path); - } - }); - if (Browser.vml) { - SVG.include(vmlMixin); - } - function svg(options) { - return Browser.svg || Browser.vml ? new SVG(options) : null; - } - Map.include({ - // @namespace Map; @method getRenderer(layer: Path): Renderer - // Returns the instance of `Renderer` that should be used to render the given - // `Path`. It will ensure that the `renderer` options of the map and paths - // are respected, and that the renderers do exist on the map. - getRenderer: function(layer) { - var renderer = layer.options.renderer || this._getPaneRenderer(layer.options.pane) || this.options.renderer || this._renderer; - if (!renderer) { - renderer = this._renderer = this._createRenderer(); - } - if (!this.hasLayer(renderer)) { - this.addLayer(renderer); - } - return renderer; - }, - _getPaneRenderer: function(name) { - if (name === "overlayPane" || name === void 0) { - return false; - } - var renderer = this._paneRenderers[name]; - if (renderer === void 0) { - renderer = this._createRenderer({ pane: name }); - this._paneRenderers[name] = renderer; - } - return renderer; - }, - _createRenderer: function(options) { - return this.options.preferCanvas && canvas(options) || svg(options); - } - }); - var Rectangle = Polygon.extend({ - initialize: function(latLngBounds, options) { - Polygon.prototype.initialize.call(this, this._boundsToLatLngs(latLngBounds), options); - }, - // @method setBounds(latLngBounds: LatLngBounds): this - // Redraws the rectangle with the passed bounds. - setBounds: function(latLngBounds) { - return this.setLatLngs(this._boundsToLatLngs(latLngBounds)); - }, - _boundsToLatLngs: function(latLngBounds) { - latLngBounds = toLatLngBounds(latLngBounds); - return [ - latLngBounds.getSouthWest(), - latLngBounds.getNorthWest(), - latLngBounds.getNorthEast(), - latLngBounds.getSouthEast() - ]; - } - }); - function rectangle(latLngBounds, options) { - return new Rectangle(latLngBounds, options); - } - SVG.create = create; - SVG.pointsToPath = pointsToPath; - GeoJSON.geometryToLayer = geometryToLayer; - GeoJSON.coordsToLatLng = coordsToLatLng; - GeoJSON.coordsToLatLngs = coordsToLatLngs; - GeoJSON.latLngToCoords = latLngToCoords; - GeoJSON.latLngsToCoords = latLngsToCoords; - GeoJSON.getFeature = getFeature; - GeoJSON.asFeature = asFeature; - Map.mergeOptions({ - // @option boxZoom: Boolean = true - // Whether the map can be zoomed to a rectangular area specified by - // dragging the mouse while pressing the shift key. - boxZoom: true - }); - var BoxZoom = Handler.extend({ - initialize: function(map) { - this._map = map; - this._container = map._container; - this._pane = map._panes.overlayPane; - this._resetStateTimeout = 0; - map.on("unload", this._destroy, this); - }, - addHooks: function() { - on(this._container, "mousedown", this._onMouseDown, this); - }, - removeHooks: function() { - off(this._container, "mousedown", this._onMouseDown, this); - }, - moved: function() { - return this._moved; - }, - _destroy: function() { - remove(this._pane); - delete this._pane; - }, - _resetState: function() { - this._resetStateTimeout = 0; - this._moved = false; - }, - _clearDeferredResetState: function() { - if (this._resetStateTimeout !== 0) { - clearTimeout(this._resetStateTimeout); - this._resetStateTimeout = 0; - } - }, - _onMouseDown: function(e) { - if (!e.shiftKey || e.which !== 1 && e.button !== 1) { - return false; - } - this._clearDeferredResetState(); - this._resetState(); - disableTextSelection(); - disableImageDrag(); - this._startPoint = this._map.mouseEventToContainerPoint(e); - on(document, { - contextmenu: stop, - mousemove: this._onMouseMove, - mouseup: this._onMouseUp, - keydown: this._onKeyDown - }, this); - }, - _onMouseMove: function(e) { - if (!this._moved) { - this._moved = true; - this._box = create$1("div", "leaflet-zoom-box", this._container); - addClass(this._container, "leaflet-crosshair"); - this._map.fire("boxzoomstart"); - } - this._point = this._map.mouseEventToContainerPoint(e); - var bounds = new Bounds(this._point, this._startPoint), size = bounds.getSize(); - setPosition(this._box, bounds.min); - this._box.style.width = size.x + "px"; - this._box.style.height = size.y + "px"; - }, - _finish: function() { - if (this._moved) { - remove(this._box); - removeClass(this._container, "leaflet-crosshair"); - } - enableTextSelection(); - enableImageDrag(); - off(document, { - contextmenu: stop, - mousemove: this._onMouseMove, - mouseup: this._onMouseUp, - keydown: this._onKeyDown - }, this); - }, - _onMouseUp: function(e) { - if (e.which !== 1 && e.button !== 1) { - return; - } - this._finish(); - if (!this._moved) { - return; - } - this._clearDeferredResetState(); - this._resetStateTimeout = setTimeout(bind(this._resetState, this), 0); - var bounds = new LatLngBounds( - this._map.containerPointToLatLng(this._startPoint), - this._map.containerPointToLatLng(this._point) - ); - this._map.fitBounds(bounds).fire("boxzoomend", { boxZoomBounds: bounds }); - }, - _onKeyDown: function(e) { - if (e.keyCode === 27) { - this._finish(); - this._clearDeferredResetState(); - this._resetState(); - } - } - }); - Map.addInitHook("addHandler", "boxZoom", BoxZoom); - Map.mergeOptions({ - // @option doubleClickZoom: Boolean|String = true - // Whether the map can be zoomed in by double clicking on it and - // zoomed out by double clicking while holding shift. If passed - // `'center'`, double-click zoom will zoom to the center of the - // view regardless of where the mouse was. - doubleClickZoom: true - }); - var DoubleClickZoom = Handler.extend({ - addHooks: function() { - this._map.on("dblclick", this._onDoubleClick, this); - }, - removeHooks: function() { - this._map.off("dblclick", this._onDoubleClick, this); - }, - _onDoubleClick: function(e) { - var map = this._map, oldZoom = map.getZoom(), delta = map.options.zoomDelta, zoom2 = e.originalEvent.shiftKey ? oldZoom - delta : oldZoom + delta; - if (map.options.doubleClickZoom === "center") { - map.setZoom(zoom2); - } else { - map.setZoomAround(e.containerPoint, zoom2); - } - } - }); - Map.addInitHook("addHandler", "doubleClickZoom", DoubleClickZoom); - Map.mergeOptions({ - // @option dragging: Boolean = true - // Whether the map is draggable with mouse/touch or not. - dragging: true, - // @section Panning Inertia Options - // @option inertia: Boolean = * - // If enabled, panning of the map will have an inertia effect where - // the map builds momentum while dragging and continues moving in - // the same direction for some time. Feels especially nice on touch - // devices. Enabled by default. - inertia: true, - // @option inertiaDeceleration: Number = 3000 - // The rate with which the inertial movement slows down, in pixels/second². - inertiaDeceleration: 3400, - // px/s^2 - // @option inertiaMaxSpeed: Number = Infinity - // Max speed of the inertial movement, in pixels/second. - inertiaMaxSpeed: Infinity, - // px/s - // @option easeLinearity: Number = 0.2 - easeLinearity: 0.2, - // TODO refactor, move to CRS - // @option worldCopyJump: Boolean = false - // With this option enabled, the map tracks when you pan to another "copy" - // of the world and seamlessly jumps to the original one so that all overlays - // like markers and vector layers are still visible. - worldCopyJump: false, - // @option maxBoundsViscosity: Number = 0.0 - // If `maxBounds` is set, this option will control how solid the bounds - // are when dragging the map around. The default value of `0.0` allows the - // user to drag outside the bounds at normal speed, higher values will - // slow down map dragging outside bounds, and `1.0` makes the bounds fully - // solid, preventing the user from dragging outside the bounds. - maxBoundsViscosity: 0 - }); - var Drag = Handler.extend({ - addHooks: function() { - if (!this._draggable) { - var map = this._map; - this._draggable = new Draggable(map._mapPane, map._container); - this._draggable.on({ - dragstart: this._onDragStart, - drag: this._onDrag, - dragend: this._onDragEnd - }, this); - this._draggable.on("predrag", this._onPreDragLimit, this); - if (map.options.worldCopyJump) { - this._draggable.on("predrag", this._onPreDragWrap, this); - map.on("zoomend", this._onZoomEnd, this); - map.whenReady(this._onZoomEnd, this); - } - } - addClass(this._map._container, "leaflet-grab leaflet-touch-drag"); - this._draggable.enable(); - this._positions = []; - this._times = []; - }, - removeHooks: function() { - removeClass(this._map._container, "leaflet-grab"); - removeClass(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 map = this._map; - map._stop(); - if (this._map.options.maxBounds && this._map.options.maxBoundsViscosity) { - var bounds = toLatLngBounds(this._map.options.maxBounds); - this._offsetLimit = toBounds( - this._map.latLngToContainerPoint(bounds.getNorthWest()).multiplyBy(-1), - this._map.latLngToContainerPoint(bounds.getSouthEast()).multiplyBy(-1).add(this._map.getSize()) - ); - this._viscosity = Math.min(1, Math.max(0, this._map.options.maxBoundsViscosity)); - } else { - this._offsetLimit = null; - } - map.fire("movestart").fire("dragstart"); - if (map.options.inertia) { - this._positions = []; - this._times = []; - } - }, - _onDrag: function(e) { - if (this._map.options.inertia) { - var time = this._lastTime = +/* @__PURE__ */ new Date(), pos = this._lastPos = this._draggable._absPos || this._draggable._newPos; - this._positions.push(pos); - this._times.push(time); - this._prunePositions(time); - } - this._map.fire("move", e).fire("drag", e); - }, - _prunePositions: function(time) { - while (this._positions.length > 1 && time - this._times[0] > 50) { - this._positions.shift(); - this._times.shift(); - } - }, - _onZoomEnd: function() { - var pxCenter = this._map.getSize().divideBy(2), pxWorldCenter = this._map.latLngToLayerPoint([0, 0]); - this._initialWorldOffset = pxWorldCenter.subtract(pxCenter).x; - this._worldWidth = this._map.getPixelWorldBounds().getSize().x; - }, - _viscousLimit: function(value, threshold) { - return value - (value - threshold) * this._viscosity; - }, - _onPreDragLimit: function() { - if (!this._viscosity || !this._offsetLimit) { - return; - } - var offset = this._draggable._newPos.subtract(this._draggable._startPos); - var limit = this._offsetLimit; - if (offset.x < limit.min.x) { - offset.x = this._viscousLimit(offset.x, limit.min.x); - } - if (offset.y < limit.min.y) { - offset.y = this._viscousLimit(offset.y, limit.min.y); - } - if (offset.x > limit.max.x) { - offset.x = this._viscousLimit(offset.x, limit.max.x); - } - if (offset.y > limit.max.y) { - offset.y = this._viscousLimit(offset.y, limit.max.y); - } - this._draggable._newPos = this._draggable._startPos.add(offset); - }, - _onPreDragWrap: function() { - var worldWidth = this._worldWidth, halfWidth = Math.round(worldWidth / 2), dx = this._initialWorldOffset, x = this._draggable._newPos.x, newX1 = (x - halfWidth + dx) % worldWidth + halfWidth - dx, newX2 = (x + halfWidth + dx) % worldWidth - halfWidth - dx, newX = Math.abs(newX1 + dx) < Math.abs(newX2 + dx) ? newX1 : newX2; - this._draggable._absPos = this._draggable._newPos.clone(); - this._draggable._newPos.x = newX; - }, - _onDragEnd: function(e) { - var map = this._map, options = map.options, noInertia = !options.inertia || e.noInertia || this._times.length < 2; - map.fire("dragend", e); - if (noInertia) { - map.fire("moveend"); - } else { - this._prunePositions(+/* @__PURE__ */ new Date()); - var direction = this._lastPos.subtract(this._positions[0]), duration = (this._lastTime - this._times[0]) / 1e3, ease = options.easeLinearity, speedVector = direction.multiplyBy(ease / duration), speed = speedVector.distanceTo([0, 0]), limitedSpeed = Math.min(options.inertiaMaxSpeed, speed), limitedSpeedVector = speedVector.multiplyBy(limitedSpeed / speed), decelerationDuration = limitedSpeed / (options.inertiaDeceleration * ease), offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round(); - if (!offset.x && !offset.y) { - map.fire("moveend"); - } else { - offset = map._limitOffset(offset, map.options.maxBounds); - requestAnimFrame(function() { - map.panBy(offset, { - duration: decelerationDuration, - easeLinearity: ease, - noMoveStart: true, - animate: true - }); - }); - } - } - } - }); - Map.addInitHook("addHandler", "dragging", Drag); - Map.mergeOptions({ - // @option keyboard: Boolean = true - // Makes the map focusable and allows users to navigate the map with keyboard - // arrows and `+`/`-` keys. - keyboard: true, - // @option keyboardPanDelta: Number = 80 - // Amount of pixels to pan when pressing an arrow key. - keyboardPanDelta: 80 - }); - var Keyboard = Handler.extend({ - keyCodes: { - left: [37], - right: [39], - down: [40], - up: [38], - zoomIn: [187, 107, 61, 171], - zoomOut: [189, 109, 54, 173] - }, - initialize: function(map) { - this._map = map; - this._setPanDelta(map.options.keyboardPanDelta); - this._setZoomDelta(map.options.zoomDelta); - }, - addHooks: function() { - var container = this._map._container; - if (container.tabIndex <= 0) { - container.tabIndex = "0"; - } - on(container, { - focus: this._onFocus, - blur: this._onBlur, - mousedown: this._onMouseDown - }, this); - this._map.on({ - focus: this._addHooks, - blur: this._removeHooks - }, this); - }, - removeHooks: function() { - this._removeHooks(); - off(this._map._container, { - focus: this._onFocus, - blur: this._onBlur, - mousedown: this._onMouseDown - }, this); - this._map.off({ - focus: this._addHooks, - blur: this._removeHooks - }, this); - }, - _onMouseDown: function() { - if (this._focused) { - return; - } - var body = document.body, docEl = document.documentElement, top = body.scrollTop || docEl.scrollTop, left = body.scrollLeft || docEl.scrollLeft; - this._map._container.focus(); - window.scrollTo(left, top); - }, - _onFocus: function() { - this._focused = true; - this._map.fire("focus"); - }, - _onBlur: function() { - this._focused = false; - this._map.fire("blur"); - }, - _setPanDelta: function(panDelta) { - var keys = this._panKeys = {}, codes = this.keyCodes, i, len; - for (i = 0, len = codes.left.length; i < len; i++) { - keys[codes.left[i]] = [-1 * panDelta, 0]; - } - for (i = 0, len = codes.right.length; i < len; i++) { - keys[codes.right[i]] = [panDelta, 0]; - } - for (i = 0, len = codes.down.length; i < len; i++) { - keys[codes.down[i]] = [0, panDelta]; - } - for (i = 0, len = codes.up.length; i < len; i++) { - keys[codes.up[i]] = [0, -1 * panDelta]; - } - }, - _setZoomDelta: function(zoomDelta) { - var keys = this._zoomKeys = {}, codes = this.keyCodes, i, len; - for (i = 0, len = codes.zoomIn.length; i < len; i++) { - keys[codes.zoomIn[i]] = zoomDelta; - } - for (i = 0, len = codes.zoomOut.length; i < len; i++) { - keys[codes.zoomOut[i]] = -zoomDelta; - } - }, - _addHooks: function() { - on(document, "keydown", this._onKeyDown, this); - }, - _removeHooks: function() { - off(document, "keydown", this._onKeyDown, this); - }, - _onKeyDown: function(e) { - if (e.altKey || e.ctrlKey || e.metaKey) { - return; - } - var key = e.keyCode, map = this._map, offset; - if (key in this._panKeys) { - if (!map._panAnim || !map._panAnim._inProgress) { - offset = this._panKeys[key]; - if (e.shiftKey) { - offset = toPoint(offset).multiplyBy(3); - } - if (map.options.maxBounds) { - offset = map._limitOffset(toPoint(offset), map.options.maxBounds); - } - if (map.options.worldCopyJump) { - var newLatLng = map.wrapLatLng(map.unproject(map.project(map.getCenter()).add(offset))); - map.panTo(newLatLng); - } else { - map.panBy(offset); - } - } - } else if (key in this._zoomKeys) { - map.setZoom(map.getZoom() + (e.shiftKey ? 3 : 1) * this._zoomKeys[key]); - } else if (key === 27 && map._popup && map._popup.options.closeOnEscapeKey) { - map.closePopup(); - } else { - return; - } - stop(e); - } - }); - Map.addInitHook("addHandler", "keyboard", Keyboard); - Map.mergeOptions({ - // @section Mouse wheel options - // @option scrollWheelZoom: Boolean|String = true - // Whether the map can be zoomed by using the mouse wheel. If passed `'center'`, - // it will zoom to the center of the view regardless of where the mouse was. - scrollWheelZoom: true, - // @option wheelDebounceTime: Number = 40 - // Limits the rate at which a wheel can fire (in milliseconds). By default - // user can't zoom via wheel more often than once per 40 ms. - wheelDebounceTime: 40, - // @option wheelPxPerZoomLevel: Number = 60 - // How many scroll pixels (as reported by [L.DomEvent.getWheelDelta](#domevent-getwheeldelta)) - // mean a change of one full zoom level. Smaller values will make wheel-zooming - // faster (and vice versa). - wheelPxPerZoomLevel: 60 - }); - var ScrollWheelZoom = Handler.extend({ - addHooks: function() { - on(this._map._container, "wheel", this._onWheelScroll, this); - this._delta = 0; - }, - removeHooks: function() { - off(this._map._container, "wheel", this._onWheelScroll, this); - }, - _onWheelScroll: function(e) { - var delta = getWheelDelta(e); - var debounce = this._map.options.wheelDebounceTime; - this._delta += delta; - this._lastMousePos = this._map.mouseEventToContainerPoint(e); - if (!this._startTime) { - this._startTime = +/* @__PURE__ */ new Date(); - } - var left = Math.max(debounce - (+/* @__PURE__ */ new Date() - this._startTime), 0); - clearTimeout(this._timer); - this._timer = setTimeout(bind(this._performZoom, this), left); - stop(e); - }, - _performZoom: function() { - var map = this._map, zoom2 = map.getZoom(), snap = this._map.options.zoomSnap || 0; - map._stop(); - var d2 = this._delta / (this._map.options.wheelPxPerZoomLevel * 4), d3 = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(d2)))) / Math.LN2, d4 = snap ? Math.ceil(d3 / snap) * snap : d3, delta = map._limitZoom(zoom2 + (this._delta > 0 ? d4 : -d4)) - zoom2; - this._delta = 0; - this._startTime = null; - if (!delta) { - return; - } - if (map.options.scrollWheelZoom === "center") { - map.setZoom(zoom2 + delta); - } else { - map.setZoomAround(this._lastMousePos, zoom2 + delta); - } - } - }); - Map.addInitHook("addHandler", "scrollWheelZoom", ScrollWheelZoom); - var tapHoldDelay = 600; - Map.mergeOptions({ - // @section Touch interaction options - // @option tapHold: Boolean - // Enables simulation of `contextmenu` event, default is `true` for mobile Safari. - tapHold: Browser.touchNative && Browser.safari && Browser.mobile, - // @option tapTolerance: Number = 15 - // The max number of pixels a user can shift his finger during touch - // for it to be considered a valid tap. - tapTolerance: 15 - }); - var TapHold = Handler.extend({ - addHooks: function() { - on(this._map._container, "touchstart", this._onDown, this); - }, - removeHooks: function() { - off(this._map._container, "touchstart", this._onDown, this); - }, - _onDown: function(e) { - clearTimeout(this._holdTimeout); - if (e.touches.length !== 1) { - return; - } - var first = e.touches[0]; - this._startPos = this._newPos = new Point(first.clientX, first.clientY); - this._holdTimeout = setTimeout(bind(function() { - this._cancel(); - if (!this._isTapValid()) { - return; - } - on(document, "touchend", preventDefault); - on(document, "touchend touchcancel", this._cancelClickPrevent); - this._simulateEvent("contextmenu", first); - }, this), tapHoldDelay); - on(document, "touchend touchcancel contextmenu", this._cancel, this); - on(document, "touchmove", this._onMove, this); - }, - _cancelClickPrevent: function cancelClickPrevent() { - off(document, "touchend", preventDefault); - off(document, "touchend touchcancel", cancelClickPrevent); - }, - _cancel: function() { - clearTimeout(this._holdTimeout); - off(document, "touchend touchcancel contextmenu", this._cancel, this); - off(document, "touchmove", this._onMove, this); - }, - _onMove: function(e) { - var first = e.touches[0]; - this._newPos = new Point(first.clientX, first.clientY); - }, - _isTapValid: function() { - return this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance; - }, - _simulateEvent: function(type, e) { - var simulatedEvent = new MouseEvent(type, { - bubbles: true, - cancelable: true, - view: window, - // detail: 1, - screenX: e.screenX, - screenY: e.screenY, - clientX: e.clientX, - clientY: e.clientY - // button: 2, - // buttons: 2 - }); - simulatedEvent._simulated = true; - e.target.dispatchEvent(simulatedEvent); - } - }); - Map.addInitHook("addHandler", "tapHold", TapHold); - Map.mergeOptions({ - // @section Touch interaction options - // @option touchZoom: Boolean|String = * - // Whether the map can be zoomed by touch-dragging with two fingers. If - // passed `'center'`, it will zoom to the center of the view regardless of - // where the touch events (fingers) were. Enabled for touch-capable web - // browsers. - touchZoom: Browser.touch, - // @option bounceAtZoomLimits: Boolean = true - // Set it to false if you don't want the map to zoom beyond min/max zoom - // and then bounce back when pinch-zooming. - bounceAtZoomLimits: true - }); - var TouchZoom = Handler.extend({ - addHooks: function() { - addClass(this._map._container, "leaflet-touch-zoom"); - on(this._map._container, "touchstart", this._onTouchStart, this); - }, - removeHooks: function() { - removeClass(this._map._container, "leaflet-touch-zoom"); - off(this._map._container, "touchstart", this._onTouchStart, this); - }, - _onTouchStart: function(e) { - var map = this._map; - if (!e.touches || e.touches.length !== 2 || map._animatingZoom || this._zooming) { - return; - } - var p1 = map.mouseEventToContainerPoint(e.touches[0]), p2 = map.mouseEventToContainerPoint(e.touches[1]); - this._centerPoint = map.getSize()._divideBy(2); - this._startLatLng = map.containerPointToLatLng(this._centerPoint); - if (map.options.touchZoom !== "center") { - this._pinchStartLatLng = map.containerPointToLatLng(p1.add(p2)._divideBy(2)); - } - this._startDist = p1.distanceTo(p2); - this._startZoom = map.getZoom(); - this._moved = false; - this._zooming = true; - map._stop(); - on(document, "touchmove", this._onTouchMove, this); - on(document, "touchend touchcancel", this._onTouchEnd, this); - preventDefault(e); - }, - _onTouchMove: function(e) { - if (!e.touches || e.touches.length !== 2 || !this._zooming) { - return; - } - var map = this._map, p1 = map.mouseEventToContainerPoint(e.touches[0]), p2 = map.mouseEventToContainerPoint(e.touches[1]), scale2 = p1.distanceTo(p2) / this._startDist; - this._zoom = map.getScaleZoom(scale2, this._startZoom); - if (!map.options.bounceAtZoomLimits && (this._zoom < map.getMinZoom() && scale2 < 1 || this._zoom > map.getMaxZoom() && scale2 > 1)) { - this._zoom = map._limitZoom(this._zoom); - } - if (map.options.touchZoom === "center") { - this._center = this._startLatLng; - if (scale2 === 1) { - return; - } - } else { - var delta = p1._add(p2)._divideBy(2)._subtract(this._centerPoint); - if (scale2 === 1 && delta.x === 0 && delta.y === 0) { - return; - } - this._center = map.unproject(map.project(this._pinchStartLatLng, this._zoom).subtract(delta), this._zoom); - } - if (!this._moved) { - map._moveStart(true, false); - this._moved = true; - } - cancelAnimFrame(this._animRequest); - var moveFn = bind(map._move, map, this._center, this._zoom, { pinch: true, round: false }, void 0); - this._animRequest = requestAnimFrame(moveFn, this, true); - preventDefault(e); - }, - _onTouchEnd: function() { - if (!this._moved || !this._zooming) { - this._zooming = false; - return; - } - this._zooming = false; - cancelAnimFrame(this._animRequest); - off(document, "touchmove", this._onTouchMove, this); - off(document, "touchend touchcancel", this._onTouchEnd, this); - if (this._map.options.zoomAnimation) { - this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), true, this._map.options.zoomSnap); - } else { - this._map._resetView(this._center, this._map._limitZoom(this._zoom)); - } - } - }); - Map.addInitHook("addHandler", "touchZoom", TouchZoom); - Map.BoxZoom = BoxZoom; - Map.DoubleClickZoom = DoubleClickZoom; - Map.Drag = Drag; - Map.Keyboard = Keyboard; - Map.ScrollWheelZoom = ScrollWheelZoom; - Map.TapHold = TapHold; - Map.TouchZoom = TouchZoom; - exports2.Bounds = Bounds; - exports2.Browser = Browser; - exports2.CRS = CRS; - exports2.Canvas = Canvas; - exports2.Circle = Circle; - exports2.CircleMarker = CircleMarker; - exports2.Class = Class; - exports2.Control = Control; - exports2.DivIcon = DivIcon; - exports2.DivOverlay = DivOverlay; - exports2.DomEvent = DomEvent; - exports2.DomUtil = DomUtil; - exports2.Draggable = Draggable; - exports2.Evented = Evented; - exports2.FeatureGroup = FeatureGroup; - exports2.GeoJSON = GeoJSON; - exports2.GridLayer = GridLayer; - exports2.Handler = Handler; - exports2.Icon = Icon; - exports2.ImageOverlay = ImageOverlay; - exports2.LatLng = LatLng; - exports2.LatLngBounds = LatLngBounds; - exports2.Layer = Layer; - exports2.LayerGroup = LayerGroup; - exports2.LineUtil = LineUtil; - exports2.Map = Map; - exports2.Marker = Marker; - exports2.Mixin = Mixin; - exports2.Path = Path; - exports2.Point = Point; - exports2.PolyUtil = PolyUtil; - exports2.Polygon = Polygon; - exports2.Polyline = Polyline; - exports2.Popup = Popup; - exports2.PosAnimation = PosAnimation; - exports2.Projection = index; - exports2.Rectangle = Rectangle; - exports2.Renderer = Renderer; - exports2.SVG = SVG; - exports2.SVGOverlay = SVGOverlay; - exports2.TileLayer = TileLayer; - exports2.Tooltip = Tooltip; - exports2.Transformation = Transformation; - exports2.Util = Util; - exports2.VideoOverlay = VideoOverlay; - exports2.bind = bind; - exports2.bounds = toBounds; - exports2.canvas = canvas; - exports2.circle = circle; - exports2.circleMarker = circleMarker; - exports2.control = control; - exports2.divIcon = divIcon; - exports2.extend = extend; - exports2.featureGroup = featureGroup; - exports2.geoJSON = geoJSON; - exports2.geoJson = geoJson; - exports2.gridLayer = gridLayer; - exports2.icon = icon; - exports2.imageOverlay = imageOverlay; - exports2.latLng = toLatLng; - exports2.latLngBounds = toLatLngBounds; - exports2.layerGroup = layerGroup; - exports2.map = createMap; - exports2.marker = marker; - exports2.point = toPoint; - exports2.polygon = polygon; - exports2.polyline = polyline; - exports2.popup = popup; - exports2.rectangle = rectangle; - exports2.setOptions = setOptions; - exports2.stamp = stamp; - exports2.svg = svg; - exports2.svgOverlay = svgOverlay; - exports2.tileLayer = tileLayer; - exports2.tooltip = tooltip; - exports2.transformation = toTransformation; - exports2.version = version; - exports2.videoOverlay = videoOverlay; - var oldL = window.L; - exports2.noConflict = function() { - window.L = oldL; - return this; - }; - window.L = exports2; - })); - } -}); - -export { - require_leaflet_src -}; -/*! Bundled license information: - -leaflet/dist/leaflet-src.js: - (* @preserve - * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com - * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - *) -*/ -//# sourceMappingURL=chunk-A73536KP.js.map diff --git a/node_modules/.vite/deps/chunk-A73536KP.js.map b/node_modules/.vite/deps/chunk-A73536KP.js.map deleted file mode 100644 index 342fca7e..00000000 --- a/node_modules/.vite/deps/chunk-A73536KP.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../leaflet/src/core/Util.js", "../../leaflet/src/core/Class.js", "../../leaflet/src/core/Events.js", "../../leaflet/src/geometry/Point.js", "../../leaflet/src/geometry/Bounds.js", "../../leaflet/src/geo/LatLngBounds.js", "../../leaflet/src/geo/LatLng.js", "../../leaflet/src/geo/crs/CRS.js", "../../leaflet/src/geo/crs/CRS.Earth.js", "../../leaflet/src/geo/projection/Projection.SphericalMercator.js", "../../leaflet/src/geometry/Transformation.js", "../../leaflet/src/geo/crs/CRS.EPSG3857.js", "../../leaflet/src/layer/vector/SVG.Util.js", "../../leaflet/src/core/Browser.js", "../../leaflet/src/dom/DomEvent.Pointer.js", "../../leaflet/src/dom/DomEvent.DoubleTap.js", "../../leaflet/src/dom/DomUtil.js", "../../leaflet/src/dom/DomEvent.js", "../../leaflet/src/dom/PosAnimation.js", "../../leaflet/src/map/Map.js", "../../leaflet/src/control/Control.js", "../../leaflet/src/control/Control.Layers.js", "../../leaflet/src/control/Control.Zoom.js", "../../leaflet/src/control/Control.Scale.js", "../../leaflet/src/control/Control.Attribution.js", "../../leaflet/src/control/index.js", "../../leaflet/src/core/Handler.js", "../../leaflet/src/core/index.js", "../../leaflet/src/dom/Draggable.js", "../../leaflet/src/geometry/PolyUtil.js", "../../leaflet/src/geometry/LineUtil.js", "../../leaflet/src/geo/projection/Projection.LonLat.js", "../../leaflet/src/geo/projection/Projection.Mercator.js", "../../leaflet/src/geo/projection/index.js", "../../leaflet/src/geo/crs/CRS.EPSG3395.js", "../../leaflet/src/geo/crs/CRS.EPSG4326.js", "../../leaflet/src/geo/crs/CRS.Simple.js", "../../leaflet/src/geo/crs/index.js", "../../leaflet/src/layer/Layer.js", "../../leaflet/src/layer/LayerGroup.js", "../../leaflet/src/layer/FeatureGroup.js", "../../leaflet/src/layer/marker/Icon.js", "../../leaflet/src/layer/marker/Icon.Default.js", "../../leaflet/src/layer/marker/Marker.Drag.js", "../../leaflet/src/layer/marker/Marker.js", "../../leaflet/src/layer/vector/Path.js", "../../leaflet/src/layer/vector/CircleMarker.js", "../../leaflet/src/layer/vector/Circle.js", "../../leaflet/src/layer/vector/Polyline.js", "../../leaflet/src/layer/vector/Polygon.js", "../../leaflet/src/layer/GeoJSON.js", "../../leaflet/src/layer/ImageOverlay.js", "../../leaflet/src/layer/VideoOverlay.js", "../../leaflet/src/layer/SVGOverlay.js", "../../leaflet/src/layer/DivOverlay.js", "../../leaflet/src/layer/Popup.js", "../../leaflet/src/layer/Tooltip.js", "../../leaflet/src/layer/marker/DivIcon.js", "../../leaflet/src/layer/marker/index.js", "../../leaflet/src/layer/tile/GridLayer.js", "../../leaflet/src/layer/tile/TileLayer.js", "../../leaflet/src/layer/tile/TileLayer.WMS.js", "../../leaflet/src/layer/tile/index.js", "../../leaflet/src/layer/vector/Renderer.js", "../../leaflet/src/layer/vector/Canvas.js", "../../leaflet/src/layer/vector/SVG.VML.js", "../../leaflet/src/layer/vector/SVG.js", "../../leaflet/src/layer/vector/Renderer.getRenderer.js", "../../leaflet/src/layer/vector/Rectangle.js", "../../leaflet/src/layer/vector/index.js", "../../leaflet/src/layer/index.js", "../../leaflet/src/map/handler/Map.BoxZoom.js", "../../leaflet/src/map/handler/Map.DoubleClickZoom.js", "../../leaflet/src/map/handler/Map.Drag.js", "../../leaflet/src/map/handler/Map.Keyboard.js", "../../leaflet/src/map/handler/Map.ScrollWheelZoom.js", "../../leaflet/src/map/handler/Map.TapHold.js", "../../leaflet/src/map/handler/Map.TouchZoom.js", "../../leaflet/src/map/index.js"], - "sourcesContent": ["/*\r\n * @namespace Util\r\n *\r\n * Various utility functions, used by Leaflet internally.\r\n */\r\n\r\n// @function extend(dest: Object, src?: Object): Object\r\n// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\r\nexport function extend(dest) {\r\n\tvar i, j, len, src;\r\n\r\n\tfor (j = 1, len = arguments.length; j < len; j++) {\r\n\t\tsrc = arguments[j];\r\n\t\tfor (i in src) {\r\n\t\t\tdest[i] = src[i];\r\n\t\t}\r\n\t}\r\n\treturn dest;\r\n}\r\n\r\n// @function create(proto: Object, properties?: Object): Object\r\n// Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\r\nexport var create = Object.create || (function () {\r\n\tfunction F() {}\r\n\treturn function (proto) {\r\n\t\tF.prototype = proto;\r\n\t\treturn new F();\r\n\t};\r\n})();\r\n\r\n// @function bind(fn: Function, …): Function\r\n// Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\r\n// Has a `L.bind()` shortcut.\r\nexport function bind(fn, obj) {\r\n\tvar slice = Array.prototype.slice;\r\n\r\n\tif (fn.bind) {\r\n\t\treturn fn.bind.apply(fn, slice.call(arguments, 1));\r\n\t}\r\n\r\n\tvar args = slice.call(arguments, 2);\r\n\r\n\treturn function () {\r\n\t\treturn fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\r\n\t};\r\n}\r\n\r\n// @property lastId: Number\r\n// Last unique ID used by [`stamp()`](#util-stamp)\r\nexport var lastId = 0;\r\n\r\n// @function stamp(obj: Object): Number\r\n// Returns the unique ID of an object, assigning it one if it doesn't have it.\r\nexport function stamp(obj) {\r\n\tif (!('_leaflet_id' in obj)) {\r\n\t\tobj['_leaflet_id'] = ++lastId;\r\n\t}\r\n\treturn obj._leaflet_id;\r\n}\r\n\r\n// @function throttle(fn: Function, time: Number, context: Object): Function\r\n// Returns a function which executes function `fn` with the given scope `context`\r\n// (so that the `this` keyword refers to `context` inside `fn`'s code). The function\r\n// `fn` will be called no more than one time per given amount of `time`. The arguments\r\n// received by the bound function will be any arguments passed when binding the\r\n// function, followed by any arguments passed when invoking the bound function.\r\n// Has an `L.throttle` shortcut.\r\nexport function throttle(fn, time, context) {\r\n\tvar lock, args, wrapperFn, later;\r\n\r\n\tlater = function () {\r\n\t\t// reset lock and call if queued\r\n\t\tlock = false;\r\n\t\tif (args) {\r\n\t\t\twrapperFn.apply(context, args);\r\n\t\t\targs = false;\r\n\t\t}\r\n\t};\r\n\r\n\twrapperFn = function () {\r\n\t\tif (lock) {\r\n\t\t\t// called too soon, queue to call later\r\n\t\t\targs = arguments;\r\n\r\n\t\t} else {\r\n\t\t\t// call and lock until later\r\n\t\t\tfn.apply(context, arguments);\r\n\t\t\tsetTimeout(later, time);\r\n\t\t\tlock = true;\r\n\t\t}\r\n\t};\r\n\r\n\treturn wrapperFn;\r\n}\r\n\r\n// @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number\r\n// Returns the number `num` modulo `range` in such a way so it lies within\r\n// `range[0]` and `range[1]`. The returned value will be always smaller than\r\n// `range[1]` unless `includeMax` is set to `true`.\r\nexport function wrapNum(x, range, includeMax) {\r\n\tvar max = range[1],\r\n\t min = range[0],\r\n\t d = max - min;\r\n\treturn x === max && includeMax ? x : ((x - min) % d + d) % d + min;\r\n}\r\n\r\n// @function falseFn(): Function\r\n// Returns a function which always returns `false`.\r\nexport function falseFn() { return false; }\r\n\r\n// @function formatNum(num: Number, precision?: Number|false): Number\r\n// Returns the number `num` rounded with specified `precision`.\r\n// The default `precision` value is 6 decimal places.\r\n// `false` can be passed to skip any processing (can be useful to avoid round-off errors).\r\nexport function formatNum(num, precision) {\r\n\tif (precision === false) { return num; }\r\n\tvar pow = Math.pow(10, precision === undefined ? 6 : precision);\r\n\treturn Math.round(num * pow) / pow;\r\n}\r\n\r\n// @function trim(str: String): String\r\n// Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)\r\nexport function trim(str) {\r\n\treturn str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\r\n}\r\n\r\n// @function splitWords(str: String): String[]\r\n// Trims and splits the string on whitespace and returns the array of parts.\r\nexport function splitWords(str) {\r\n\treturn trim(str).split(/\\s+/);\r\n}\r\n\r\n// @function setOptions(obj: Object, options: Object): Object\r\n// Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut.\r\nexport function setOptions(obj, options) {\r\n\tif (!Object.prototype.hasOwnProperty.call(obj, 'options')) {\r\n\t\tobj.options = obj.options ? create(obj.options) : {};\r\n\t}\r\n\tfor (var i in options) {\r\n\t\tobj.options[i] = options[i];\r\n\t}\r\n\treturn obj.options;\r\n}\r\n\r\n// @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String\r\n// Converts an object into a parameter URL string, e.g. `{a: \"foo\", b: \"bar\"}`\r\n// translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will\r\n// be appended at the end. If `uppercase` is `true`, the parameter names will\r\n// be uppercased (e.g. `'?A=foo&B=bar'`)\r\nexport function getParamString(obj, existingUrl, uppercase) {\r\n\tvar params = [];\r\n\tfor (var i in obj) {\r\n\t\tparams.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i]));\r\n\t}\r\n\treturn ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');\r\n}\r\n\r\nvar templateRe = /\\{ *([\\w_ -]+) *\\}/g;\r\n\r\n// @function template(str: String, data: Object): String\r\n// Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`\r\n// and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string\r\n// `('Hello foo, bar')`. You can also specify functions instead of strings for\r\n// data values — they will be evaluated passing `data` as an argument.\r\nexport function template(str, data) {\r\n\treturn str.replace(templateRe, function (str, key) {\r\n\t\tvar value = data[key];\r\n\r\n\t\tif (value === undefined) {\r\n\t\t\tthrow new Error('No value provided for variable ' + str);\r\n\r\n\t\t} else if (typeof value === 'function') {\r\n\t\t\tvalue = value(data);\r\n\t\t}\r\n\t\treturn value;\r\n\t});\r\n}\r\n\r\n// @function isArray(obj): Boolean\r\n// Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)\r\nexport var isArray = Array.isArray || function (obj) {\r\n\treturn (Object.prototype.toString.call(obj) === '[object Array]');\r\n};\r\n\r\n// @function indexOf(array: Array, el: Object): Number\r\n// Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\r\nexport function indexOf(array, el) {\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\tif (array[i] === el) { return i; }\r\n\t}\r\n\treturn -1;\r\n}\r\n\r\n// @property emptyImageUrl: String\r\n// Data URI string containing a base64-encoded empty GIF image.\r\n// Used as a hack to free memory from unused images on WebKit-powered\r\n// mobile devices (by setting image `src` to this string).\r\nexport var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';\r\n\r\n// inspired by https://paulirish.com/2011/requestanimationframe-for-smart-animating/\r\n\r\nfunction getPrefixed(name) {\r\n\treturn window['webkit' + name] || window['moz' + name] || window['ms' + name];\r\n}\r\n\r\nvar lastTime = 0;\r\n\r\n// fallback for IE 7-8\r\nfunction timeoutDefer(fn) {\r\n\tvar time = +new Date(),\r\n\t timeToCall = Math.max(0, 16 - (time - lastTime));\r\n\r\n\tlastTime = time + timeToCall;\r\n\treturn window.setTimeout(fn, timeToCall);\r\n}\r\n\r\nexport var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer;\r\nexport var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||\r\n\t\tgetPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };\r\n\r\n// @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number\r\n// Schedules `fn` to be executed when the browser repaints. `fn` is bound to\r\n// `context` if given. When `immediate` is set, `fn` is called immediately if\r\n// the browser doesn't have native support for\r\n// [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame),\r\n// otherwise it's delayed. Returns a request ID that can be used to cancel the request.\r\nexport function requestAnimFrame(fn, context, immediate) {\r\n\tif (immediate && requestFn === timeoutDefer) {\r\n\t\tfn.call(context);\r\n\t} else {\r\n\t\treturn requestFn.call(window, bind(fn, context));\r\n\t}\r\n}\r\n\r\n// @function cancelAnimFrame(id: Number): undefined\r\n// Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame).\r\nexport function cancelAnimFrame(id) {\r\n\tif (id) {\r\n\t\tcancelFn.call(window, id);\r\n\t}\r\n}\r\n", "import * as Util from './Util';\r\n\r\n// @class Class\r\n// @aka L.Class\r\n\r\n// @section\r\n// @uninheritable\r\n\r\n// Thanks to John Resig and Dean Edwards for inspiration!\r\n\r\nexport function Class() {}\r\n\r\nClass.extend = function (props) {\r\n\r\n\t// @function extend(props: Object): Function\r\n\t// [Extends the current class](#class-inheritance) given the properties to be included.\r\n\t// Returns a Javascript function that is a class constructor (to be called with `new`).\r\n\tvar NewClass = function () {\r\n\r\n\t\tUtil.setOptions(this);\r\n\r\n\t\t// call the constructor\r\n\t\tif (this.initialize) {\r\n\t\t\tthis.initialize.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\t// call all constructor hooks\r\n\t\tthis.callInitHooks();\r\n\t};\r\n\r\n\tvar parentProto = NewClass.__super__ = this.prototype;\r\n\r\n\tvar proto = Util.create(parentProto);\r\n\tproto.constructor = NewClass;\r\n\r\n\tNewClass.prototype = proto;\r\n\r\n\t// inherit parent's statics\r\n\tfor (var i in this) {\r\n\t\tif (Object.prototype.hasOwnProperty.call(this, i) && i !== 'prototype' && i !== '__super__') {\r\n\t\t\tNewClass[i] = this[i];\r\n\t\t}\r\n\t}\r\n\r\n\t// mix static properties into the class\r\n\tif (props.statics) {\r\n\t\tUtil.extend(NewClass, props.statics);\r\n\t}\r\n\r\n\t// mix includes into the prototype\r\n\tif (props.includes) {\r\n\t\tcheckDeprecatedMixinEvents(props.includes);\r\n\t\tUtil.extend.apply(null, [proto].concat(props.includes));\r\n\t}\r\n\r\n\t// mix given properties into the prototype\r\n\tUtil.extend(proto, props);\r\n\tdelete proto.statics;\r\n\tdelete proto.includes;\r\n\r\n\t// merge options\r\n\tif (proto.options) {\r\n\t\tproto.options = parentProto.options ? Util.create(parentProto.options) : {};\r\n\t\tUtil.extend(proto.options, props.options);\r\n\t}\r\n\r\n\tproto._initHooks = [];\r\n\r\n\t// add method for calling all hooks\r\n\tproto.callInitHooks = function () {\r\n\r\n\t\tif (this._initHooksCalled) { return; }\r\n\r\n\t\tif (parentProto.callInitHooks) {\r\n\t\t\tparentProto.callInitHooks.call(this);\r\n\t\t}\r\n\r\n\t\tthis._initHooksCalled = true;\r\n\r\n\t\tfor (var i = 0, len = proto._initHooks.length; i < len; i++) {\r\n\t\t\tproto._initHooks[i].call(this);\r\n\t\t}\r\n\t};\r\n\r\n\treturn NewClass;\r\n};\r\n\r\n\r\n// @function include(properties: Object): this\r\n// [Includes a mixin](#class-includes) into the current class.\r\nClass.include = function (props) {\r\n\tvar parentOptions = this.prototype.options;\r\n\tUtil.extend(this.prototype, props);\r\n\tif (props.options) {\r\n\t\tthis.prototype.options = parentOptions;\r\n\t\tthis.mergeOptions(props.options);\r\n\t}\r\n\treturn this;\r\n};\r\n\r\n// @function mergeOptions(options: Object): this\r\n// [Merges `options`](#class-options) into the defaults of the class.\r\nClass.mergeOptions = function (options) {\r\n\tUtil.extend(this.prototype.options, options);\r\n\treturn this;\r\n};\r\n\r\n// @function addInitHook(fn: Function): this\r\n// Adds a [constructor hook](#class-constructor-hooks) to the class.\r\nClass.addInitHook = function (fn) { // (Function) || (String, args...)\r\n\tvar args = Array.prototype.slice.call(arguments, 1);\r\n\r\n\tvar init = typeof fn === 'function' ? fn : function () {\r\n\t\tthis[fn].apply(this, args);\r\n\t};\r\n\r\n\tthis.prototype._initHooks = this.prototype._initHooks || [];\r\n\tthis.prototype._initHooks.push(init);\r\n\treturn this;\r\n};\r\n\r\nfunction checkDeprecatedMixinEvents(includes) {\r\n\t/* global L: true */\r\n\tif (typeof L === 'undefined' || !L || !L.Mixin) { return; }\r\n\r\n\tincludes = Util.isArray(includes) ? includes : [includes];\r\n\r\n\tfor (var i = 0; i < includes.length; i++) {\r\n\t\tif (includes[i] === L.Mixin.Events) {\r\n\t\t\tconsole.warn('Deprecated include of L.Mixin.Events: ' +\r\n\t\t\t\t'this property will be removed in future releases, ' +\r\n\t\t\t\t'please inherit from L.Evented instead.', new Error().stack);\r\n\t\t}\r\n\t}\r\n}\r\n", "import {Class} from './Class';\r\nimport * as Util from './Util';\r\n\r\n/*\r\n * @class Evented\r\n * @aka L.Evented\r\n * @inherits Class\r\n *\r\n * A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event).\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * map.on('click', function(e) {\r\n * \talert(e.latlng);\r\n * } );\r\n * ```\r\n *\r\n * Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:\r\n *\r\n * ```js\r\n * function onClick(e) { ... }\r\n *\r\n * map.on('click', onClick);\r\n * map.off('click', onClick);\r\n * ```\r\n */\r\n\r\nexport var Events = {\r\n\t/* @method on(type: String, fn: Function, context?: Object): this\r\n\t * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).\r\n\t *\r\n\t * @alternative\r\n\t * @method on(eventMap: Object): this\r\n\t * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n\t */\r\n\ton: function (types, fn, context) {\r\n\r\n\t\t// types can be a map of types/handlers\r\n\t\tif (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\t// we don't process space-separated events here for performance;\r\n\t\t\t\t// it's a hot path since Layer uses the on(obj) syntax\r\n\t\t\t\tthis._on(type, types[type], fn);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// types can be a string of space-separated words\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tthis._on(types[i], fn, context);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/* @method off(type: String, fn?: Function, context?: Object): this\r\n\t * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener.\r\n\t *\r\n\t * @alternative\r\n\t * @method off(eventMap: Object): this\r\n\t * Removes a set of type/listener pairs.\r\n\t *\r\n\t * @alternative\r\n\t * @method off: this\r\n\t * Removes all listeners to all events on the object. This includes implicitly attached events.\r\n\t */\r\n\toff: function (types, fn, context) {\r\n\r\n\t\tif (!arguments.length) {\r\n\t\t\t// clear all listeners if called without arguments\r\n\t\t\tdelete this._events;\r\n\r\n\t\t} else if (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\tthis._off(type, types[type], fn);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tvar removeAll = arguments.length === 1;\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tif (removeAll) {\r\n\t\t\t\t\tthis._off(types[i]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._off(types[i], fn, context);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// attach listener (without syntactic sugar now)\r\n\t_on: function (type, fn, context, _once) {\r\n\t\tif (typeof fn !== 'function') {\r\n\t\t\tconsole.warn('wrong listener type: ' + typeof fn);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// check if fn already there\r\n\t\tif (this._listens(type, fn, context) !== false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (context === this) {\r\n\t\t\t// Less memory footprint.\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\r\n\t\tvar newListener = {fn: fn, ctx: context};\r\n\t\tif (_once) {\r\n\t\t\tnewListener.once = true;\r\n\t\t}\r\n\r\n\t\tthis._events = this._events || {};\r\n\t\tthis._events[type] = this._events[type] || [];\r\n\t\tthis._events[type].push(newListener);\r\n\t},\r\n\r\n\t_off: function (type, fn, context) {\r\n\t\tvar listeners,\r\n\t\t i,\r\n\t\t len;\r\n\r\n\t\tif (!this._events) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlisteners = this._events[type];\r\n\t\tif (!listeners) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (arguments.length === 1) { // remove all\r\n\t\t\tif (this._firingCount) {\r\n\t\t\t\t// Set all removed listeners to noop\r\n\t\t\t\t// so they are not called if remove happens in fire\r\n\t\t\t\tfor (i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\t\tlisteners[i].fn = Util.falseFn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// clear all listeners for a type if function isn't specified\r\n\t\t\tdelete this._events[type];\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (typeof fn !== 'function') {\r\n\t\t\tconsole.warn('wrong listener type: ' + typeof fn);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// find fn and remove it\r\n\t\tvar index = this._listens(type, fn, context);\r\n\t\tif (index !== false) {\r\n\t\t\tvar listener = listeners[index];\r\n\t\t\tif (this._firingCount) {\r\n\t\t\t\t// set the removed listener to noop so that's not called if remove happens in fire\r\n\t\t\t\tlistener.fn = Util.falseFn;\r\n\r\n\t\t\t\t/* copy array in case events are being fired */\r\n\t\t\t\tthis._events[type] = listeners = listeners.slice();\r\n\t\t\t}\r\n\t\t\tlisteners.splice(index, 1);\r\n\t\t}\r\n\t},\r\n\r\n\t// @method fire(type: String, data?: Object, propagate?: Boolean): this\r\n\t// Fires an event of the specified type. You can optionally provide a data\r\n\t// object — the first argument of the listener function will contain its\r\n\t// properties. The event can optionally be propagated to event parents.\r\n\tfire: function (type, data, propagate) {\r\n\t\tif (!this.listens(type, propagate)) { return this; }\r\n\r\n\t\tvar event = Util.extend({}, data, {\r\n\t\t\ttype: type,\r\n\t\t\ttarget: this,\r\n\t\t\tsourceTarget: data && data.sourceTarget || this\r\n\t\t});\r\n\r\n\t\tif (this._events) {\r\n\t\t\tvar listeners = this._events[type];\r\n\t\t\tif (listeners) {\r\n\t\t\t\tthis._firingCount = (this._firingCount + 1) || 1;\r\n\t\t\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\t\tvar l = listeners[i];\r\n\t\t\t\t\t// off overwrites l.fn, so we need to copy fn to a var\r\n\t\t\t\t\tvar fn = l.fn;\r\n\t\t\t\t\tif (l.once) {\r\n\t\t\t\t\t\tthis.off(type, fn, l.ctx);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfn.call(l.ctx || this, event);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._firingCount--;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (propagate) {\r\n\t\t\t// propagate the event to parents (set with addEventParent)\r\n\t\t\tthis._propagateEvent(event);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method listens(type: String, propagate?: Boolean): Boolean\r\n\t// @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean\r\n\t// Returns `true` if a particular event type has any listeners attached to it.\r\n\t// The verification can optionally be propagated, it will return `true` if parents have the listener attached to it.\r\n\tlistens: function (type, fn, context, propagate) {\r\n\t\tif (typeof type !== 'string') {\r\n\t\t\tconsole.warn('\"string\" type argument expected');\r\n\t\t}\r\n\r\n\t\t// we don't overwrite the input `fn` value, because we need to use it for propagation\r\n\t\tvar _fn = fn;\r\n\t\tif (typeof fn !== 'function') {\r\n\t\t\tpropagate = !!fn;\r\n\t\t\t_fn = undefined;\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\r\n\t\tvar listeners = this._events && this._events[type];\r\n\t\tif (listeners && listeners.length) {\r\n\t\t\tif (this._listens(type, _fn, context) !== false) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (propagate) {\r\n\t\t\t// also check parents for listeners if event propagates\r\n\t\t\tfor (var id in this._eventParents) {\r\n\t\t\t\tif (this._eventParents[id].listens(type, fn, context, propagate)) { return true; }\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t// returns the index (number) or false\r\n\t_listens: function (type, fn, context) {\r\n\t\tif (!this._events) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar listeners = this._events[type] || [];\r\n\t\tif (!fn) {\r\n\t\t\treturn !!listeners.length;\r\n\t\t}\r\n\r\n\t\tif (context === this) {\r\n\t\t\t// Less memory footprint.\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\tif (listeners[i].fn === fn && listeners[i].ctx === context) {\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t},\r\n\r\n\t// @method once(…): this\r\n\t// Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.\r\n\tonce: function (types, fn, context) {\r\n\r\n\t\t// types can be a map of types/handlers\r\n\t\tif (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\t// we don't process space-separated events here for performance;\r\n\t\t\t\t// it's a hot path since Layer uses the on(obj) syntax\r\n\t\t\t\tthis._on(type, types[type], fn, true);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// types can be a string of space-separated words\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tthis._on(types[i], fn, context, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method addEventParent(obj: Evented): this\r\n\t// Adds an event parent - an `Evented` that will receive propagated events\r\n\taddEventParent: function (obj) {\r\n\t\tthis._eventParents = this._eventParents || {};\r\n\t\tthis._eventParents[Util.stamp(obj)] = obj;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method removeEventParent(obj: Evented): this\r\n\t// Removes an event parent, so it will stop receiving propagated events\r\n\tremoveEventParent: function (obj) {\r\n\t\tif (this._eventParents) {\r\n\t\t\tdelete this._eventParents[Util.stamp(obj)];\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_propagateEvent: function (e) {\r\n\t\tfor (var id in this._eventParents) {\r\n\t\t\tthis._eventParents[id].fire(e.type, Util.extend({\r\n\t\t\t\tlayer: e.target,\r\n\t\t\t\tpropagatedFrom: e.target\r\n\t\t\t}, e), true);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n// aliases; we should ditch those eventually\r\n\r\n// @method addEventListener(…): this\r\n// Alias to [`on(…)`](#evented-on)\r\nEvents.addEventListener = Events.on;\r\n\r\n// @method removeEventListener(…): this\r\n// Alias to [`off(…)`](#evented-off)\r\n\r\n// @method clearAllEventListeners(…): this\r\n// Alias to [`off()`](#evented-off)\r\nEvents.removeEventListener = Events.clearAllEventListeners = Events.off;\r\n\r\n// @method addOneTimeEventListener(…): this\r\n// Alias to [`once(…)`](#evented-once)\r\nEvents.addOneTimeEventListener = Events.once;\r\n\r\n// @method fireEvent(…): this\r\n// Alias to [`fire(…)`](#evented-fire)\r\nEvents.fireEvent = Events.fire;\r\n\r\n// @method hasEventListeners(…): Boolean\r\n// Alias to [`listens(…)`](#evented-listens)\r\nEvents.hasEventListeners = Events.listens;\r\n\r\nexport var Evented = Class.extend(Events);\r\n", "import {isArray, formatNum} from '../core/Util';\r\n\r\n/*\r\n * @class Point\r\n * @aka L.Point\r\n *\r\n * Represents a point with `x` and `y` coordinates in pixels.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var point = L.point(200, 300);\r\n * ```\r\n *\r\n * All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:\r\n *\r\n * ```js\r\n * map.panBy([200, 300]);\r\n * map.panBy(L.point(200, 300));\r\n * ```\r\n *\r\n * Note that `Point` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function Point(x, y, round) {\r\n\t// @property x: Number; The `x` coordinate of the point\r\n\tthis.x = (round ? Math.round(x) : x);\r\n\t// @property y: Number; The `y` coordinate of the point\r\n\tthis.y = (round ? Math.round(y) : y);\r\n}\r\n\r\nvar trunc = Math.trunc || function (v) {\r\n\treturn v > 0 ? Math.floor(v) : Math.ceil(v);\r\n};\r\n\r\nPoint.prototype = {\r\n\r\n\t// @method clone(): Point\r\n\t// Returns a copy of the current point.\r\n\tclone: function () {\r\n\t\treturn new Point(this.x, this.y);\r\n\t},\r\n\r\n\t// @method add(otherPoint: Point): Point\r\n\t// Returns the result of addition of the current and the given points.\r\n\tadd: function (point) {\r\n\t\t// non-destructive, returns a new point\r\n\t\treturn this.clone()._add(toPoint(point));\r\n\t},\r\n\r\n\t_add: function (point) {\r\n\t\t// destructive, used directly for performance in situations where it's safe to modify existing point\r\n\t\tthis.x += point.x;\r\n\t\tthis.y += point.y;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method subtract(otherPoint: Point): Point\r\n\t// Returns the result of subtraction of the given point from the current.\r\n\tsubtract: function (point) {\r\n\t\treturn this.clone()._subtract(toPoint(point));\r\n\t},\r\n\r\n\t_subtract: function (point) {\r\n\t\tthis.x -= point.x;\r\n\t\tthis.y -= point.y;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method divideBy(num: Number): Point\r\n\t// Returns the result of division of the current point by the given number.\r\n\tdivideBy: function (num) {\r\n\t\treturn this.clone()._divideBy(num);\r\n\t},\r\n\r\n\t_divideBy: function (num) {\r\n\t\tthis.x /= num;\r\n\t\tthis.y /= num;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method multiplyBy(num: Number): Point\r\n\t// Returns the result of multiplication of the current point by the given number.\r\n\tmultiplyBy: function (num) {\r\n\t\treturn this.clone()._multiplyBy(num);\r\n\t},\r\n\r\n\t_multiplyBy: function (num) {\r\n\t\tthis.x *= num;\r\n\t\tthis.y *= num;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method scaleBy(scale: Point): Point\r\n\t// Multiply each coordinate of the current point by each coordinate of\r\n\t// `scale`. In linear algebra terms, multiply the point by the\r\n\t// [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation)\r\n\t// defined by `scale`.\r\n\tscaleBy: function (point) {\r\n\t\treturn new Point(this.x * point.x, this.y * point.y);\r\n\t},\r\n\r\n\t// @method unscaleBy(scale: Point): Point\r\n\t// Inverse of `scaleBy`. Divide each coordinate of the current point by\r\n\t// each coordinate of `scale`.\r\n\tunscaleBy: function (point) {\r\n\t\treturn new Point(this.x / point.x, this.y / point.y);\r\n\t},\r\n\r\n\t// @method round(): Point\r\n\t// Returns a copy of the current point with rounded coordinates.\r\n\tround: function () {\r\n\t\treturn this.clone()._round();\r\n\t},\r\n\r\n\t_round: function () {\r\n\t\tthis.x = Math.round(this.x);\r\n\t\tthis.y = Math.round(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method floor(): Point\r\n\t// Returns a copy of the current point with floored coordinates (rounded down).\r\n\tfloor: function () {\r\n\t\treturn this.clone()._floor();\r\n\t},\r\n\r\n\t_floor: function () {\r\n\t\tthis.x = Math.floor(this.x);\r\n\t\tthis.y = Math.floor(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method ceil(): Point\r\n\t// Returns a copy of the current point with ceiled coordinates (rounded up).\r\n\tceil: function () {\r\n\t\treturn this.clone()._ceil();\r\n\t},\r\n\r\n\t_ceil: function () {\r\n\t\tthis.x = Math.ceil(this.x);\r\n\t\tthis.y = Math.ceil(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method trunc(): Point\r\n\t// Returns a copy of the current point with truncated coordinates (rounded towards zero).\r\n\ttrunc: function () {\r\n\t\treturn this.clone()._trunc();\r\n\t},\r\n\r\n\t_trunc: function () {\r\n\t\tthis.x = trunc(this.x);\r\n\t\tthis.y = trunc(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method distanceTo(otherPoint: Point): Number\r\n\t// Returns the cartesian distance between the current and the given points.\r\n\tdistanceTo: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\tvar x = point.x - this.x,\r\n\t\t y = point.y - this.y;\r\n\r\n\t\treturn Math.sqrt(x * x + y * y);\r\n\t},\r\n\r\n\t// @method equals(otherPoint: Point): Boolean\r\n\t// Returns `true` if the given point has the same coordinates.\r\n\tequals: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\treturn point.x === this.x &&\r\n\t\t point.y === this.y;\r\n\t},\r\n\r\n\t// @method contains(otherPoint: Point): Boolean\r\n\t// Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).\r\n\tcontains: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\treturn Math.abs(point.x) <= Math.abs(this.x) &&\r\n\t\t Math.abs(point.y) <= Math.abs(this.y);\r\n\t},\r\n\r\n\t// @method toString(): String\r\n\t// Returns a string representation of the point for debugging purposes.\r\n\ttoString: function () {\r\n\t\treturn 'Point(' +\r\n\t\t formatNum(this.x) + ', ' +\r\n\t\t formatNum(this.y) + ')';\r\n\t}\r\n};\r\n\r\n// @factory L.point(x: Number, y: Number, round?: Boolean)\r\n// Creates a Point object with the given `x` and `y` coordinates. If optional `round` is set to true, rounds the `x` and `y` values.\r\n\r\n// @alternative\r\n// @factory L.point(coords: Number[])\r\n// Expects an array of the form `[x, y]` instead.\r\n\r\n// @alternative\r\n// @factory L.point(coords: Object)\r\n// Expects a plain object of the form `{x: Number, y: Number}` instead.\r\nexport function toPoint(x, y, round) {\r\n\tif (x instanceof Point) {\r\n\t\treturn x;\r\n\t}\r\n\tif (isArray(x)) {\r\n\t\treturn new Point(x[0], x[1]);\r\n\t}\r\n\tif (x === undefined || x === null) {\r\n\t\treturn x;\r\n\t}\r\n\tif (typeof x === 'object' && 'x' in x && 'y' in x) {\r\n\t\treturn new Point(x.x, x.y);\r\n\t}\r\n\treturn new Point(x, y, round);\r\n}\r\n", "import {Point, toPoint} from './Point';\r\n\r\n/*\r\n * @class Bounds\r\n * @aka L.Bounds\r\n *\r\n * Represents a rectangular area in pixel coordinates.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var p1 = L.point(10, 10),\r\n * p2 = L.point(40, 60),\r\n * bounds = L.bounds(p1, p2);\r\n * ```\r\n *\r\n * All Leaflet methods that accept `Bounds` objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:\r\n *\r\n * ```js\r\n * otherBounds.intersects([[10, 10], [40, 60]]);\r\n * ```\r\n *\r\n * Note that `Bounds` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function Bounds(a, b) {\r\n\tif (!a) { return; }\r\n\r\n\tvar points = b ? [a, b] : a;\r\n\r\n\tfor (var i = 0, len = points.length; i < len; i++) {\r\n\t\tthis.extend(points[i]);\r\n\t}\r\n}\r\n\r\nBounds.prototype = {\r\n\t// @method extend(point: Point): this\r\n\t// Extends the bounds to contain the given point.\r\n\r\n\t// @alternative\r\n\t// @method extend(otherBounds: Bounds): this\r\n\t// Extend the bounds to contain the given bounds\r\n\textend: function (obj) {\r\n\t\tvar min2, max2;\r\n\t\tif (!obj) { return this; }\r\n\r\n\t\tif (obj instanceof Point || typeof obj[0] === 'number' || 'x' in obj) {\r\n\t\t\tmin2 = max2 = toPoint(obj);\r\n\t\t} else {\r\n\t\t\tobj = toBounds(obj);\r\n\t\t\tmin2 = obj.min;\r\n\t\t\tmax2 = obj.max;\r\n\r\n\t\t\tif (!min2 || !max2) { return this; }\r\n\t\t}\r\n\r\n\t\t// @property min: Point\r\n\t\t// The top left corner of the rectangle.\r\n\t\t// @property max: Point\r\n\t\t// The bottom right corner of the rectangle.\r\n\t\tif (!this.min && !this.max) {\r\n\t\t\tthis.min = min2.clone();\r\n\t\t\tthis.max = max2.clone();\r\n\t\t} else {\r\n\t\t\tthis.min.x = Math.min(min2.x, this.min.x);\r\n\t\t\tthis.max.x = Math.max(max2.x, this.max.x);\r\n\t\t\tthis.min.y = Math.min(min2.y, this.min.y);\r\n\t\t\tthis.max.y = Math.max(max2.y, this.max.y);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getCenter(round?: Boolean): Point\r\n\t// Returns the center point of the bounds.\r\n\tgetCenter: function (round) {\r\n\t\treturn toPoint(\r\n\t\t (this.min.x + this.max.x) / 2,\r\n\t\t (this.min.y + this.max.y) / 2, round);\r\n\t},\r\n\r\n\t// @method getBottomLeft(): Point\r\n\t// Returns the bottom-left point of the bounds.\r\n\tgetBottomLeft: function () {\r\n\t\treturn toPoint(this.min.x, this.max.y);\r\n\t},\r\n\r\n\t// @method getTopRight(): Point\r\n\t// Returns the top-right point of the bounds.\r\n\tgetTopRight: function () { // -> Point\r\n\t\treturn toPoint(this.max.x, this.min.y);\r\n\t},\r\n\r\n\t// @method getTopLeft(): Point\r\n\t// Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)).\r\n\tgetTopLeft: function () {\r\n\t\treturn this.min; // left, top\r\n\t},\r\n\r\n\t// @method getBottomRight(): Point\r\n\t// Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)).\r\n\tgetBottomRight: function () {\r\n\t\treturn this.max; // right, bottom\r\n\t},\r\n\r\n\t// @method getSize(): Point\r\n\t// Returns the size of the given bounds\r\n\tgetSize: function () {\r\n\t\treturn this.max.subtract(this.min);\r\n\t},\r\n\r\n\t// @method contains(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle contains the given one.\r\n\t// @alternative\r\n\t// @method contains(point: Point): Boolean\r\n\t// Returns `true` if the rectangle contains the given point.\r\n\tcontains: function (obj) {\r\n\t\tvar min, max;\r\n\r\n\t\tif (typeof obj[0] === 'number' || obj instanceof Point) {\r\n\t\t\tobj = toPoint(obj);\r\n\t\t} else {\r\n\t\t\tobj = toBounds(obj);\r\n\t\t}\r\n\r\n\t\tif (obj instanceof Bounds) {\r\n\t\t\tmin = obj.min;\r\n\t\t\tmax = obj.max;\r\n\t\t} else {\r\n\t\t\tmin = max = obj;\r\n\t\t}\r\n\r\n\t\treturn (min.x >= this.min.x) &&\r\n\t\t (max.x <= this.max.x) &&\r\n\t\t (min.y >= this.min.y) &&\r\n\t\t (max.y <= this.max.y);\r\n\t},\r\n\r\n\t// @method intersects(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle intersects the given bounds. Two bounds\r\n\t// intersect if they have at least one point in common.\r\n\tintersects: function (bounds) { // (Bounds) -> Boolean\r\n\t\tbounds = toBounds(bounds);\r\n\r\n\t\tvar min = this.min,\r\n\t\t max = this.max,\r\n\t\t min2 = bounds.min,\r\n\t\t max2 = bounds.max,\r\n\t\t xIntersects = (max2.x >= min.x) && (min2.x <= max.x),\r\n\t\t yIntersects = (max2.y >= min.y) && (min2.y <= max.y);\r\n\r\n\t\treturn xIntersects && yIntersects;\r\n\t},\r\n\r\n\t// @method overlaps(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle overlaps the given bounds. Two bounds\r\n\t// overlap if their intersection is an area.\r\n\toverlaps: function (bounds) { // (Bounds) -> Boolean\r\n\t\tbounds = toBounds(bounds);\r\n\r\n\t\tvar min = this.min,\r\n\t\t max = this.max,\r\n\t\t min2 = bounds.min,\r\n\t\t max2 = bounds.max,\r\n\t\t xOverlaps = (max2.x > min.x) && (min2.x < max.x),\r\n\t\t yOverlaps = (max2.y > min.y) && (min2.y < max.y);\r\n\r\n\t\treturn xOverlaps && yOverlaps;\r\n\t},\r\n\r\n\t// @method isValid(): Boolean\r\n\t// Returns `true` if the bounds are properly initialized.\r\n\tisValid: function () {\r\n\t\treturn !!(this.min && this.max);\r\n\t},\r\n\r\n\r\n\t// @method pad(bufferRatio: Number): Bounds\r\n\t// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.\r\n\t// For example, a ratio of 0.5 extends the bounds by 50% in each direction.\r\n\t// Negative values will retract the bounds.\r\n\tpad: function (bufferRatio) {\r\n\t\tvar min = this.min,\r\n\t\tmax = this.max,\r\n\t\theightBuffer = Math.abs(min.x - max.x) * bufferRatio,\r\n\t\twidthBuffer = Math.abs(min.y - max.y) * bufferRatio;\r\n\r\n\r\n\t\treturn toBounds(\r\n\t\t\ttoPoint(min.x - heightBuffer, min.y - widthBuffer),\r\n\t\t\ttoPoint(max.x + heightBuffer, max.y + widthBuffer));\r\n\t},\r\n\r\n\r\n\t// @method equals(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle is equivalent to the given bounds.\r\n\tequals: function (bounds) {\r\n\t\tif (!bounds) { return false; }\r\n\r\n\t\tbounds = toBounds(bounds);\r\n\r\n\t\treturn this.min.equals(bounds.getTopLeft()) &&\r\n\t\t\tthis.max.equals(bounds.getBottomRight());\r\n\t},\r\n};\r\n\r\n\r\n// @factory L.bounds(corner1: Point, corner2: Point)\r\n// Creates a Bounds object from two corners coordinate pairs.\r\n// @alternative\r\n// @factory L.bounds(points: Point[])\r\n// Creates a Bounds object from the given array of points.\r\nexport function toBounds(a, b) {\r\n\tif (!a || a instanceof Bounds) {\r\n\t\treturn a;\r\n\t}\r\n\treturn new Bounds(a, b);\r\n}\r\n", "import {LatLng, toLatLng} from './LatLng';\r\n\r\n/*\r\n * @class LatLngBounds\r\n * @aka L.LatLngBounds\r\n *\r\n * Represents a rectangular geographical area on a map.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var corner1 = L.latLng(40.712, -74.227),\r\n * corner2 = L.latLng(40.774, -74.125),\r\n * bounds = L.latLngBounds(corner1, corner2);\r\n * ```\r\n *\r\n * All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:\r\n *\r\n * ```js\r\n * map.fitBounds([\r\n * \t[40.712, -74.227],\r\n * \t[40.774, -74.125]\r\n * ]);\r\n * ```\r\n *\r\n * Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range.\r\n *\r\n * Note that `LatLngBounds` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function LatLngBounds(corner1, corner2) { // (LatLng, LatLng) or (LatLng[])\r\n\tif (!corner1) { return; }\r\n\r\n\tvar latlngs = corner2 ? [corner1, corner2] : corner1;\r\n\r\n\tfor (var i = 0, len = latlngs.length; i < len; i++) {\r\n\t\tthis.extend(latlngs[i]);\r\n\t}\r\n}\r\n\r\nLatLngBounds.prototype = {\r\n\r\n\t// @method extend(latlng: LatLng): this\r\n\t// Extend the bounds to contain the given point\r\n\r\n\t// @alternative\r\n\t// @method extend(otherBounds: LatLngBounds): this\r\n\t// Extend the bounds to contain the given bounds\r\n\textend: function (obj) {\r\n\t\tvar sw = this._southWest,\r\n\t\t ne = this._northEast,\r\n\t\t sw2, ne2;\r\n\r\n\t\tif (obj instanceof LatLng) {\r\n\t\t\tsw2 = obj;\r\n\t\t\tne2 = obj;\r\n\r\n\t\t} else if (obj instanceof LatLngBounds) {\r\n\t\t\tsw2 = obj._southWest;\r\n\t\t\tne2 = obj._northEast;\r\n\r\n\t\t\tif (!sw2 || !ne2) { return this; }\r\n\r\n\t\t} else {\r\n\t\t\treturn obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this;\r\n\t\t}\r\n\r\n\t\tif (!sw && !ne) {\r\n\t\t\tthis._southWest = new LatLng(sw2.lat, sw2.lng);\r\n\t\t\tthis._northEast = new LatLng(ne2.lat, ne2.lng);\r\n\t\t} else {\r\n\t\t\tsw.lat = Math.min(sw2.lat, sw.lat);\r\n\t\t\tsw.lng = Math.min(sw2.lng, sw.lng);\r\n\t\t\tne.lat = Math.max(ne2.lat, ne.lat);\r\n\t\t\tne.lng = Math.max(ne2.lng, ne.lng);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method pad(bufferRatio: Number): LatLngBounds\r\n\t// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.\r\n\t// For example, a ratio of 0.5 extends the bounds by 50% in each direction.\r\n\t// Negative values will retract the bounds.\r\n\tpad: function (bufferRatio) {\r\n\t\tvar sw = this._southWest,\r\n\t\t ne = this._northEast,\r\n\t\t heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio,\r\n\t\t widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio;\r\n\r\n\t\treturn new LatLngBounds(\r\n\t\t new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer),\r\n\t\t new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer));\r\n\t},\r\n\r\n\t// @method getCenter(): LatLng\r\n\t// Returns the center point of the bounds.\r\n\tgetCenter: function () {\r\n\t\treturn new LatLng(\r\n\t\t (this._southWest.lat + this._northEast.lat) / 2,\r\n\t\t (this._southWest.lng + this._northEast.lng) / 2);\r\n\t},\r\n\r\n\t// @method getSouthWest(): LatLng\r\n\t// Returns the south-west point of the bounds.\r\n\tgetSouthWest: function () {\r\n\t\treturn this._southWest;\r\n\t},\r\n\r\n\t// @method getNorthEast(): LatLng\r\n\t// Returns the north-east point of the bounds.\r\n\tgetNorthEast: function () {\r\n\t\treturn this._northEast;\r\n\t},\r\n\r\n\t// @method getNorthWest(): LatLng\r\n\t// Returns the north-west point of the bounds.\r\n\tgetNorthWest: function () {\r\n\t\treturn new LatLng(this.getNorth(), this.getWest());\r\n\t},\r\n\r\n\t// @method getSouthEast(): LatLng\r\n\t// Returns the south-east point of the bounds.\r\n\tgetSouthEast: function () {\r\n\t\treturn new LatLng(this.getSouth(), this.getEast());\r\n\t},\r\n\r\n\t// @method getWest(): Number\r\n\t// Returns the west longitude of the bounds\r\n\tgetWest: function () {\r\n\t\treturn this._southWest.lng;\r\n\t},\r\n\r\n\t// @method getSouth(): Number\r\n\t// Returns the south latitude of the bounds\r\n\tgetSouth: function () {\r\n\t\treturn this._southWest.lat;\r\n\t},\r\n\r\n\t// @method getEast(): Number\r\n\t// Returns the east longitude of the bounds\r\n\tgetEast: function () {\r\n\t\treturn this._northEast.lng;\r\n\t},\r\n\r\n\t// @method getNorth(): Number\r\n\t// Returns the north latitude of the bounds\r\n\tgetNorth: function () {\r\n\t\treturn this._northEast.lat;\r\n\t},\r\n\r\n\t// @method contains(otherBounds: LatLngBounds): Boolean\r\n\t// Returns `true` if the rectangle contains the given one.\r\n\r\n\t// @alternative\r\n\t// @method contains (latlng: LatLng): Boolean\r\n\t// Returns `true` if the rectangle contains the given point.\r\n\tcontains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean\r\n\t\tif (typeof obj[0] === 'number' || obj instanceof LatLng || 'lat' in obj) {\r\n\t\t\tobj = toLatLng(obj);\r\n\t\t} else {\r\n\t\t\tobj = toLatLngBounds(obj);\r\n\t\t}\r\n\r\n\t\tvar sw = this._southWest,\r\n\t\t ne = this._northEast,\r\n\t\t sw2, ne2;\r\n\r\n\t\tif (obj instanceof LatLngBounds) {\r\n\t\t\tsw2 = obj.getSouthWest();\r\n\t\t\tne2 = obj.getNorthEast();\r\n\t\t} else {\r\n\t\t\tsw2 = ne2 = obj;\r\n\t\t}\r\n\r\n\t\treturn (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) &&\r\n\t\t (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng);\r\n\t},\r\n\r\n\t// @method intersects(otherBounds: LatLngBounds): Boolean\r\n\t// Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.\r\n\tintersects: function (bounds) {\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\tvar sw = this._southWest,\r\n\t\t ne = this._northEast,\r\n\t\t sw2 = bounds.getSouthWest(),\r\n\t\t ne2 = bounds.getNorthEast(),\r\n\r\n\t\t latIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat),\r\n\t\t lngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng);\r\n\r\n\t\treturn latIntersects && lngIntersects;\r\n\t},\r\n\r\n\t// @method overlaps(otherBounds: LatLngBounds): Boolean\r\n\t// Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.\r\n\toverlaps: function (bounds) {\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\tvar sw = this._southWest,\r\n\t\t ne = this._northEast,\r\n\t\t sw2 = bounds.getSouthWest(),\r\n\t\t ne2 = bounds.getNorthEast(),\r\n\r\n\t\t latOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat),\r\n\t\t lngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng);\r\n\r\n\t\treturn latOverlaps && lngOverlaps;\r\n\t},\r\n\r\n\t// @method toBBoxString(): String\r\n\t// Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.\r\n\ttoBBoxString: function () {\r\n\t\treturn [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(',');\r\n\t},\r\n\r\n\t// @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean\r\n\t// Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number.\r\n\tequals: function (bounds, maxMargin) {\r\n\t\tif (!bounds) { return false; }\r\n\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\treturn this._southWest.equals(bounds.getSouthWest(), maxMargin) &&\r\n\t\t this._northEast.equals(bounds.getNorthEast(), maxMargin);\r\n\t},\r\n\r\n\t// @method isValid(): Boolean\r\n\t// Returns `true` if the bounds are properly initialized.\r\n\tisValid: function () {\r\n\t\treturn !!(this._southWest && this._northEast);\r\n\t}\r\n};\r\n\r\n// TODO International date line?\r\n\r\n// @factory L.latLngBounds(corner1: LatLng, corner2: LatLng)\r\n// Creates a `LatLngBounds` object by defining two diagonally opposite corners of the rectangle.\r\n\r\n// @alternative\r\n// @factory L.latLngBounds(latlngs: LatLng[])\r\n// Creates a `LatLngBounds` object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with [`fitBounds`](#map-fitbounds).\r\nexport function toLatLngBounds(a, b) {\r\n\tif (a instanceof LatLngBounds) {\r\n\t\treturn a;\r\n\t}\r\n\treturn new LatLngBounds(a, b);\r\n}\r\n", "import * as Util from '../core/Util';\r\nimport {Earth} from './crs/CRS.Earth';\r\nimport {toLatLngBounds} from './LatLngBounds';\r\n\r\n/* @class LatLng\r\n * @aka L.LatLng\r\n *\r\n * Represents a geographical point with a certain latitude and longitude.\r\n *\r\n * @example\r\n *\r\n * ```\r\n * var latlng = L.latLng(50.5, 30.5);\r\n * ```\r\n *\r\n * All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:\r\n *\r\n * ```\r\n * map.panTo([50, 30]);\r\n * map.panTo({lon: 30, lat: 50});\r\n * map.panTo({lat: 50, lng: 30});\r\n * map.panTo(L.latLng(50, 30));\r\n * ```\r\n *\r\n * Note that `LatLng` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function LatLng(lat, lng, alt) {\r\n\tif (isNaN(lat) || isNaN(lng)) {\r\n\t\tthrow new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');\r\n\t}\r\n\r\n\t// @property lat: Number\r\n\t// Latitude in degrees\r\n\tthis.lat = +lat;\r\n\r\n\t// @property lng: Number\r\n\t// Longitude in degrees\r\n\tthis.lng = +lng;\r\n\r\n\t// @property alt: Number\r\n\t// Altitude in meters (optional)\r\n\tif (alt !== undefined) {\r\n\t\tthis.alt = +alt;\r\n\t}\r\n}\r\n\r\nLatLng.prototype = {\r\n\t// @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean\r\n\t// Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number.\r\n\tequals: function (obj, maxMargin) {\r\n\t\tif (!obj) { return false; }\r\n\r\n\t\tobj = toLatLng(obj);\r\n\r\n\t\tvar margin = Math.max(\r\n\t\t Math.abs(this.lat - obj.lat),\r\n\t\t Math.abs(this.lng - obj.lng));\r\n\r\n\t\treturn margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin);\r\n\t},\r\n\r\n\t// @method toString(): String\r\n\t// Returns a string representation of the point (for debugging purposes).\r\n\ttoString: function (precision) {\r\n\t\treturn 'LatLng(' +\r\n\t\t Util.formatNum(this.lat, precision) + ', ' +\r\n\t\t Util.formatNum(this.lng, precision) + ')';\r\n\t},\r\n\r\n\t// @method distanceTo(otherLatLng: LatLng): Number\r\n\t// Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines).\r\n\tdistanceTo: function (other) {\r\n\t\treturn Earth.distance(this, toLatLng(other));\r\n\t},\r\n\r\n\t// @method wrap(): LatLng\r\n\t// Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees.\r\n\twrap: function () {\r\n\t\treturn Earth.wrapLatLng(this);\r\n\t},\r\n\r\n\t// @method toBounds(sizeInMeters: Number): LatLngBounds\r\n\t// Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.\r\n\ttoBounds: function (sizeInMeters) {\r\n\t\tvar latAccuracy = 180 * sizeInMeters / 40075017,\r\n\t\t lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat);\r\n\r\n\t\treturn toLatLngBounds(\r\n\t\t [this.lat - latAccuracy, this.lng - lngAccuracy],\r\n\t\t [this.lat + latAccuracy, this.lng + lngAccuracy]);\r\n\t},\r\n\r\n\tclone: function () {\r\n\t\treturn new LatLng(this.lat, this.lng, this.alt);\r\n\t}\r\n};\r\n\r\n\r\n\r\n// @factory L.latLng(latitude: Number, longitude: Number, altitude?: Number): LatLng\r\n// Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).\r\n\r\n// @alternative\r\n// @factory L.latLng(coords: Array): LatLng\r\n// Expects an array of the form `[Number, Number]` or `[Number, Number, Number]` instead.\r\n\r\n// @alternative\r\n// @factory L.latLng(coords: Object): LatLng\r\n// Expects an plain object of the form `{lat: Number, lng: Number}` or `{lat: Number, lng: Number, alt: Number}` instead.\r\n\r\nexport function toLatLng(a, b, c) {\r\n\tif (a instanceof LatLng) {\r\n\t\treturn a;\r\n\t}\r\n\tif (Util.isArray(a) && typeof a[0] !== 'object') {\r\n\t\tif (a.length === 3) {\r\n\t\t\treturn new LatLng(a[0], a[1], a[2]);\r\n\t\t}\r\n\t\tif (a.length === 2) {\r\n\t\t\treturn new LatLng(a[0], a[1]);\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\tif (a === undefined || a === null) {\r\n\t\treturn a;\r\n\t}\r\n\tif (typeof a === 'object' && 'lat' in a) {\r\n\t\treturn new LatLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);\r\n\t}\r\n\tif (b === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\treturn new LatLng(a, b, c);\r\n}\r\n", "\r\nimport {Bounds} from '../../geometry/Bounds';\r\nimport {LatLng} from '../LatLng';\r\nimport {LatLngBounds} from '../LatLngBounds';\r\nimport * as Util from '../../core/Util';\r\n\r\n/*\r\n * @namespace CRS\r\n * @crs L.CRS.Base\r\n * Object that defines coordinate reference systems for projecting\r\n * geographical points into pixel (screen) coordinates and back (and to\r\n * coordinates in other units for [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services). See\r\n * [spatial reference system](https://en.wikipedia.org/wiki/Spatial_reference_system).\r\n *\r\n * Leaflet defines the most usual CRSs by default. If you want to use a\r\n * CRS not defined by default, take a look at the\r\n * [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin.\r\n *\r\n * Note that the CRS instances do not inherit from Leaflet's `Class` object,\r\n * and can't be instantiated. Also, new classes can't inherit from them,\r\n * and methods can't be added to them with the `include` function.\r\n */\r\n\r\nexport var CRS = {\r\n\t// @method latLngToPoint(latlng: LatLng, zoom: Number): Point\r\n\t// Projects geographical coordinates into pixel coordinates for a given zoom.\r\n\tlatLngToPoint: function (latlng, zoom) {\r\n\t\tvar projectedPoint = this.projection.project(latlng),\r\n\t\t scale = this.scale(zoom);\r\n\r\n\t\treturn this.transformation._transform(projectedPoint, scale);\r\n\t},\r\n\r\n\t// @method pointToLatLng(point: Point, zoom: Number): LatLng\r\n\t// The inverse of `latLngToPoint`. Projects pixel coordinates on a given\r\n\t// zoom into geographical coordinates.\r\n\tpointToLatLng: function (point, zoom) {\r\n\t\tvar scale = this.scale(zoom),\r\n\t\t untransformedPoint = this.transformation.untransform(point, scale);\r\n\r\n\t\treturn this.projection.unproject(untransformedPoint);\r\n\t},\r\n\r\n\t// @method project(latlng: LatLng): Point\r\n\t// Projects geographical coordinates into coordinates in units accepted for\r\n\t// this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).\r\n\tproject: function (latlng) {\r\n\t\treturn this.projection.project(latlng);\r\n\t},\r\n\r\n\t// @method unproject(point: Point): LatLng\r\n\t// Given a projected coordinate returns the corresponding LatLng.\r\n\t// The inverse of `project`.\r\n\tunproject: function (point) {\r\n\t\treturn this.projection.unproject(point);\r\n\t},\r\n\r\n\t// @method scale(zoom: Number): Number\r\n\t// Returns the scale used when transforming projected coordinates into\r\n\t// pixel coordinates for a particular zoom. For example, it returns\r\n\t// `256 * 2^zoom` for Mercator-based CRS.\r\n\tscale: function (zoom) {\r\n\t\treturn 256 * Math.pow(2, zoom);\r\n\t},\r\n\r\n\t// @method zoom(scale: Number): Number\r\n\t// Inverse of `scale()`, returns the zoom level corresponding to a scale\r\n\t// factor of `scale`.\r\n\tzoom: function (scale) {\r\n\t\treturn Math.log(scale / 256) / Math.LN2;\r\n\t},\r\n\r\n\t// @method getProjectedBounds(zoom: Number): Bounds\r\n\t// Returns the projection's bounds scaled and transformed for the provided `zoom`.\r\n\tgetProjectedBounds: function (zoom) {\r\n\t\tif (this.infinite) { return null; }\r\n\r\n\t\tvar b = this.projection.bounds,\r\n\t\t s = this.scale(zoom),\r\n\t\t min = this.transformation.transform(b.min, s),\r\n\t\t max = this.transformation.transform(b.max, s);\r\n\r\n\t\treturn new Bounds(min, max);\r\n\t},\r\n\r\n\t// @method distance(latlng1: LatLng, latlng2: LatLng): Number\r\n\t// Returns the distance between two geographical coordinates.\r\n\r\n\t// @property code: String\r\n\t// Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`)\r\n\t//\r\n\t// @property wrapLng: Number[]\r\n\t// An array of two numbers defining whether the longitude (horizontal) coordinate\r\n\t// axis wraps around a given range and how. Defaults to `[-180, 180]` in most\r\n\t// geographical CRSs. If `undefined`, the longitude axis does not wrap around.\r\n\t//\r\n\t// @property wrapLat: Number[]\r\n\t// Like `wrapLng`, but for the latitude (vertical) axis.\r\n\r\n\t// wrapLng: [min, max],\r\n\t// wrapLat: [min, max],\r\n\r\n\t// @property infinite: Boolean\r\n\t// If true, the coordinate space will be unbounded (infinite in both axes)\r\n\tinfinite: false,\r\n\r\n\t// @method wrapLatLng(latlng: LatLng): LatLng\r\n\t// Returns a `LatLng` where lat and lng has been wrapped according to the\r\n\t// CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds.\r\n\twrapLatLng: function (latlng) {\r\n\t\tvar lng = this.wrapLng ? Util.wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng,\r\n\t\t lat = this.wrapLat ? Util.wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat,\r\n\t\t alt = latlng.alt;\r\n\r\n\t\treturn new LatLng(lat, lng, alt);\r\n\t},\r\n\r\n\t// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds\r\n\t// Returns a `LatLngBounds` with the same size as the given one, ensuring\r\n\t// that its center is within the CRS's bounds.\r\n\t// Only accepts actual `L.LatLngBounds` instances, not arrays.\r\n\twrapLatLngBounds: function (bounds) {\r\n\t\tvar center = bounds.getCenter(),\r\n\t\t newCenter = this.wrapLatLng(center),\r\n\t\t latShift = center.lat - newCenter.lat,\r\n\t\t lngShift = center.lng - newCenter.lng;\r\n\r\n\t\tif (latShift === 0 && lngShift === 0) {\r\n\t\t\treturn bounds;\r\n\t\t}\r\n\r\n\t\tvar sw = bounds.getSouthWest(),\r\n\t\t ne = bounds.getNorthEast(),\r\n\t\t newSw = new LatLng(sw.lat - latShift, sw.lng - lngShift),\r\n\t\t newNe = new LatLng(ne.lat - latShift, ne.lng - lngShift);\r\n\r\n\t\treturn new LatLngBounds(newSw, newNe);\r\n\t}\r\n};\r\n", "import {CRS} from './CRS';\nimport * as Util from '../../core/Util';\n\n/*\n * @namespace CRS\n * @crs L.CRS.Earth\n *\n * Serves as the base for CRS that are global such that they cover the earth.\n * Can only be used as the base for other CRS and cannot be used directly,\n * since it does not have a `code`, `projection` or `transformation`. `distance()` returns\n * meters.\n */\n\nexport var Earth = Util.extend({}, CRS, {\n\twrapLng: [-180, 180],\n\n\t// Mean Earth Radius, as recommended for use by\n\t// the International Union of Geodesy and Geophysics,\n\t// see https://rosettacode.org/wiki/Haversine_formula\n\tR: 6371000,\n\n\t// distance between two geographical points using spherical law of cosines approximation\n\tdistance: function (latlng1, latlng2) {\n\t\tvar rad = Math.PI / 180,\n\t\t lat1 = latlng1.lat * rad,\n\t\t lat2 = latlng2.lat * rad,\n\t\t sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2),\n\t\t sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2),\n\t\t a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon,\n\t\t c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t\treturn this.R * c;\n\t}\n});\n", "import {LatLng} from '../LatLng';\r\nimport {Bounds} from '../../geometry/Bounds';\r\nimport {Point} from '../../geometry/Point';\r\n\r\n/*\r\n * @namespace Projection\r\n * @projection L.Projection.SphericalMercator\r\n *\r\n * Spherical Mercator projection — the most common projection for online maps,\r\n * used by almost all free and commercial tile providers. Assumes that Earth is\r\n * a sphere. Used by the `EPSG:3857` CRS.\r\n */\r\n\r\nvar earthRadius = 6378137;\r\n\r\nexport var SphericalMercator = {\r\n\r\n\tR: earthRadius,\r\n\tMAX_LATITUDE: 85.0511287798,\r\n\r\n\tproject: function (latlng) {\r\n\t\tvar d = Math.PI / 180,\r\n\t\t max = this.MAX_LATITUDE,\r\n\t\t lat = Math.max(Math.min(max, latlng.lat), -max),\r\n\t\t sin = Math.sin(lat * d);\r\n\r\n\t\treturn new Point(\r\n\t\t\tthis.R * latlng.lng * d,\r\n\t\t\tthis.R * Math.log((1 + sin) / (1 - sin)) / 2);\r\n\t},\r\n\r\n\tunproject: function (point) {\r\n\t\tvar d = 180 / Math.PI;\r\n\r\n\t\treturn new LatLng(\r\n\t\t\t(2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,\r\n\t\t\tpoint.x * d / this.R);\r\n\t},\r\n\r\n\tbounds: (function () {\r\n\t\tvar d = earthRadius * Math.PI;\r\n\t\treturn new Bounds([-d, -d], [d, d]);\r\n\t})()\r\n};\r\n", "import {Point} from './Point';\r\nimport * as Util from '../core/Util';\r\n\r\n/*\r\n * @class Transformation\r\n * @aka L.Transformation\r\n *\r\n * Represents an affine transformation: a set of coefficients `a`, `b`, `c`, `d`\r\n * for transforming a point of a form `(x, y)` into `(a*x + b, c*y + d)` and doing\r\n * the reverse. Used by Leaflet in its projections code.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var transformation = L.transformation(2, 5, -1, 10),\r\n * \tp = L.point(1, 2),\r\n * \tp2 = transformation.transform(p), // L.point(7, 8)\r\n * \tp3 = transformation.untransform(p2); // L.point(1, 2)\r\n * ```\r\n */\r\n\r\n\r\n// factory new L.Transformation(a: Number, b: Number, c: Number, d: Number)\r\n// Creates a `Transformation` object with the given coefficients.\r\nexport function Transformation(a, b, c, d) {\r\n\tif (Util.isArray(a)) {\r\n\t\t// use array properties\r\n\t\tthis._a = a[0];\r\n\t\tthis._b = a[1];\r\n\t\tthis._c = a[2];\r\n\t\tthis._d = a[3];\r\n\t\treturn;\r\n\t}\r\n\tthis._a = a;\r\n\tthis._b = b;\r\n\tthis._c = c;\r\n\tthis._d = d;\r\n}\r\n\r\nTransformation.prototype = {\r\n\t// @method transform(point: Point, scale?: Number): Point\r\n\t// Returns a transformed point, optionally multiplied by the given scale.\r\n\t// Only accepts actual `L.Point` instances, not arrays.\r\n\ttransform: function (point, scale) { // (Point, Number) -> Point\r\n\t\treturn this._transform(point.clone(), scale);\r\n\t},\r\n\r\n\t// destructive transform (faster)\r\n\t_transform: function (point, scale) {\r\n\t\tscale = scale || 1;\r\n\t\tpoint.x = scale * (this._a * point.x + this._b);\r\n\t\tpoint.y = scale * (this._c * point.y + this._d);\r\n\t\treturn point;\r\n\t},\r\n\r\n\t// @method untransform(point: Point, scale?: Number): Point\r\n\t// Returns the reverse transformation of the given point, optionally divided\r\n\t// by the given scale. Only accepts actual `L.Point` instances, not arrays.\r\n\tuntransform: function (point, scale) {\r\n\t\tscale = scale || 1;\r\n\t\treturn new Point(\r\n\t\t (point.x / scale - this._b) / this._a,\r\n\t\t (point.y / scale - this._d) / this._c);\r\n\t}\r\n};\r\n\r\n// factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r\n\r\n// @factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r\n// Instantiates a Transformation object with the given coefficients.\r\n\r\n// @alternative\r\n// @factory L.transformation(coefficients: Array): Transformation\r\n// Expects an coefficients array of the form\r\n// `[a: Number, b: Number, c: Number, d: Number]`.\r\n\r\nexport function toTransformation(a, b, c, d) {\r\n\treturn new Transformation(a, b, c, d);\r\n}\r\n", "import {Earth} from './CRS.Earth';\r\nimport {SphericalMercator} from '../projection/Projection.SphericalMercator';\r\nimport {toTransformation} from '../../geometry/Transformation';\r\nimport * as Util from '../../core/Util';\r\n\r\n/*\r\n * @namespace CRS\r\n * @crs L.CRS.EPSG3857\r\n *\r\n * The most common CRS for online maps, used by almost all free and commercial\r\n * tile providers. Uses Spherical Mercator projection. Set in by default in\r\n * Map's `crs` option.\r\n */\r\n\r\nexport var EPSG3857 = Util.extend({}, Earth, {\r\n\tcode: 'EPSG:3857',\r\n\tprojection: SphericalMercator,\r\n\r\n\ttransformation: (function () {\r\n\t\tvar scale = 0.5 / (Math.PI * SphericalMercator.R);\r\n\t\treturn toTransformation(scale, 0.5, -scale, 0.5);\r\n\t}())\r\n});\r\n\r\nexport var EPSG900913 = Util.extend({}, EPSG3857, {\r\n\tcode: 'EPSG:900913'\r\n});\r\n", "import Browser from '../../core/Browser';\n\n// @namespace SVG; @section\n// There are several static functions which can be called without instantiating L.SVG:\n\n// @function create(name: String): SVGElement\n// Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement),\n// corresponding to the class name passed. For example, using 'line' will return\n// an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement).\nexport function svgCreate(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\n// @function pointsToPath(rings: Point[], closed: Boolean): String\n// Generates a SVG path string for multiple rings, with each ring turning\n// into \"M..L..L..\" instructions\nexport function pointsToPath(rings, closed) {\n\tvar str = '',\n\ti, j, len, len2, points, p;\n\n\tfor (i = 0, len = rings.length; i < len; i++) {\n\t\tpoints = rings[i];\n\n\t\tfor (j = 0, len2 = points.length; j < len2; j++) {\n\t\t\tp = points[j];\n\t\t\tstr += (j ? 'L' : 'M') + p.x + ' ' + p.y;\n\t\t}\n\n\t\t// closes the ring for polygons; \"x\" is VML syntax\n\t\tstr += closed ? (Browser.svg ? 'z' : 'x') : '';\n\t}\n\n\t// SVG complains about empty path strings\n\treturn str || 'M0 0';\n}\n\n\n\n\n", "import * as Util from './Util';\r\nimport {svgCreate} from '../layer/vector/SVG.Util';\r\n\r\n/*\r\n * @namespace Browser\r\n * @aka L.Browser\r\n *\r\n * A namespace with static properties for browser/feature detection used by Leaflet internally.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * if (L.Browser.ielt9) {\r\n * alert('Upgrade your browser, dude!');\r\n * }\r\n * ```\r\n */\r\n\r\nvar style = document.documentElement.style;\r\n\r\n// @property ie: Boolean; `true` for all Internet Explorer versions (not Edge).\r\nvar ie = 'ActiveXObject' in window;\r\n\r\n// @property ielt9: Boolean; `true` for Internet Explorer versions less than 9.\r\nvar ielt9 = ie && !document.addEventListener;\r\n\r\n// @property edge: Boolean; `true` for the Edge web browser.\r\nvar edge = 'msLaunchUri' in navigator && !('documentMode' in document);\r\n\r\n// @property webkit: Boolean;\r\n// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).\r\nvar webkit = userAgentContains('webkit');\r\n\r\n// @property android: Boolean\r\n// **Deprecated.** `true` for any browser running on an Android platform.\r\nvar android = userAgentContains('android');\r\n\r\n// @property android23: Boolean; **Deprecated.** `true` for browsers running on Android 2 or Android 3.\r\nvar android23 = userAgentContains('android 2') || userAgentContains('android 3');\r\n\r\n/* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */\r\nvar webkitVer = parseInt(/WebKit\\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit\r\n// @property androidStock: Boolean; **Deprecated.** `true` for the Android stock browser (i.e. not Chrome)\r\nvar androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window);\r\n\r\n// @property opera: Boolean; `true` for the Opera browser\r\nvar opera = !!window.opera;\r\n\r\n// @property chrome: Boolean; `true` for the Chrome browser.\r\nvar chrome = !edge && userAgentContains('chrome');\r\n\r\n// @property gecko: Boolean; `true` for gecko-based browsers like Firefox.\r\nvar gecko = userAgentContains('gecko') && !webkit && !opera && !ie;\r\n\r\n// @property safari: Boolean; `true` for the Safari browser.\r\nvar safari = !chrome && userAgentContains('safari');\r\n\r\nvar phantom = userAgentContains('phantom');\r\n\r\n// @property opera12: Boolean\r\n// `true` for the Opera browser supporting CSS transforms (version 12 or later).\r\nvar opera12 = 'OTransition' in style;\r\n\r\n// @property win: Boolean; `true` when the browser is running in a Windows platform\r\nvar win = navigator.platform.indexOf('Win') === 0;\r\n\r\n// @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms.\r\nvar ie3d = ie && ('transition' in style);\r\n\r\n// @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.\r\nvar webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;\r\n\r\n// @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.\r\nvar gecko3d = 'MozPerspective' in style;\r\n\r\n// @property any3d: Boolean\r\n// `true` for all browsers supporting CSS transforms.\r\nvar any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;\r\n\r\n// @property mobile: Boolean; `true` for all browsers running in a mobile device.\r\nvar mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');\r\n\r\n// @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.\r\nvar mobileWebkit = mobile && webkit;\r\n\r\n// @property mobileWebkit3d: Boolean\r\n// `true` for all webkit-based browsers in a mobile device supporting CSS transforms.\r\nvar mobileWebkit3d = mobile && webkit3d;\r\n\r\n// @property msPointer: Boolean\r\n// `true` for browsers implementing the Microsoft touch events model (notably IE10).\r\nvar msPointer = !window.PointerEvent && window.MSPointerEvent;\r\n\r\n// @property pointer: Boolean\r\n// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).\r\nvar pointer = !!(window.PointerEvent || msPointer);\r\n\r\n// @property touchNative: Boolean\r\n// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).\r\n// **This does not necessarily mean** that the browser is running in a computer with\r\n// a touchscreen, it only means that the browser is capable of understanding\r\n// touch events.\r\nvar touchNative = 'ontouchstart' in window || !!window.TouchEvent;\r\n\r\n// @property touch: Boolean\r\n// `true` for all browsers supporting either [touch](#browser-touch) or [pointer](#browser-pointer) events.\r\n// Note: pointer events will be preferred (if available), and processed for all `touch*` listeners.\r\nvar touch = !window.L_NO_TOUCH && (touchNative || pointer);\r\n\r\n// @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device.\r\nvar mobileOpera = mobile && opera;\r\n\r\n// @property mobileGecko: Boolean\r\n// `true` for gecko-based browsers running in a mobile device.\r\nvar mobileGecko = mobile && gecko;\r\n\r\n// @property retina: Boolean\r\n// `true` for browsers on a high-resolution \"retina\" screen or on any screen when browser's display zoom is more than 100%.\r\nvar retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;\r\n\r\n// @property passiveEvents: Boolean\r\n// `true` for browsers that support passive events.\r\nvar passiveEvents = (function () {\r\n\tvar supportsPassiveOption = false;\r\n\ttry {\r\n\t\tvar opts = Object.defineProperty({}, 'passive', {\r\n\t\t\tget: function () { // eslint-disable-line getter-return\r\n\t\t\t\tsupportsPassiveOption = true;\r\n\t\t\t}\r\n\t\t});\r\n\t\twindow.addEventListener('testPassiveEventSupport', Util.falseFn, opts);\r\n\t\twindow.removeEventListener('testPassiveEventSupport', Util.falseFn, opts);\r\n\t} catch (e) {\r\n\t\t// Errors can safely be ignored since this is only a browser support test.\r\n\t}\r\n\treturn supportsPassiveOption;\r\n}());\r\n\r\n// @property canvas: Boolean\r\n// `true` when the browser supports [``](https://developer.mozilla.org/docs/Web/API/Canvas_API).\r\nvar canvas = (function () {\r\n\treturn !!document.createElement('canvas').getContext;\r\n}());\r\n\r\n// @property svg: Boolean\r\n// `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).\r\nvar svg = !!(document.createElementNS && svgCreate('svg').createSVGRect);\r\n\r\nvar inlineSvg = !!svg && (function () {\r\n\tvar div = document.createElement('div');\r\n\tdiv.innerHTML = '';\r\n\treturn (div.firstChild && div.firstChild.namespaceURI) === 'http://www.w3.org/2000/svg';\r\n})();\r\n\r\n// @property vml: Boolean\r\n// `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).\r\nvar vml = !svg && (function () {\r\n\ttry {\r\n\t\tvar div = document.createElement('div');\r\n\t\tdiv.innerHTML = '';\r\n\r\n\t\tvar shape = div.firstChild;\r\n\t\tshape.style.behavior = 'url(#default#VML)';\r\n\r\n\t\treturn shape && (typeof shape.adj === 'object');\r\n\r\n\t} catch (e) {\r\n\t\treturn false;\r\n\t}\r\n}());\r\n\r\n\r\n// @property mac: Boolean; `true` when the browser is running in a Mac platform\r\nvar mac = navigator.platform.indexOf('Mac') === 0;\r\n\r\n// @property mac: Boolean; `true` when the browser is running in a Linux platform\r\nvar linux = navigator.platform.indexOf('Linux') === 0;\r\n\r\nfunction userAgentContains(str) {\r\n\treturn navigator.userAgent.toLowerCase().indexOf(str) >= 0;\r\n}\r\n\r\n\r\nexport default {\r\n\tie: ie,\r\n\tielt9: ielt9,\r\n\tedge: edge,\r\n\twebkit: webkit,\r\n\tandroid: android,\r\n\tandroid23: android23,\r\n\tandroidStock: androidStock,\r\n\topera: opera,\r\n\tchrome: chrome,\r\n\tgecko: gecko,\r\n\tsafari: safari,\r\n\tphantom: phantom,\r\n\topera12: opera12,\r\n\twin: win,\r\n\tie3d: ie3d,\r\n\twebkit3d: webkit3d,\r\n\tgecko3d: gecko3d,\r\n\tany3d: any3d,\r\n\tmobile: mobile,\r\n\tmobileWebkit: mobileWebkit,\r\n\tmobileWebkit3d: mobileWebkit3d,\r\n\tmsPointer: msPointer,\r\n\tpointer: pointer,\r\n\ttouch: touch,\r\n\ttouchNative: touchNative,\r\n\tmobileOpera: mobileOpera,\r\n\tmobileGecko: mobileGecko,\r\n\tretina: retina,\r\n\tpassiveEvents: passiveEvents,\r\n\tcanvas: canvas,\r\n\tsvg: svg,\r\n\tvml: vml,\r\n\tinlineSvg: inlineSvg,\r\n\tmac: mac,\r\n\tlinux: linux\r\n};\r\n", "import * as DomEvent from './DomEvent';\nimport Browser from '../core/Browser';\nimport {falseFn} from '../core/Util';\n\n/*\n * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices.\n */\n\nvar POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown';\nvar POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove';\nvar POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup';\nvar POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel';\nvar pEvent = {\n\ttouchstart : POINTER_DOWN,\n\ttouchmove : POINTER_MOVE,\n\ttouchend : POINTER_UP,\n\ttouchcancel : POINTER_CANCEL\n};\nvar handle = {\n\ttouchstart : _onPointerStart,\n\ttouchmove : _handlePointer,\n\ttouchend : _handlePointer,\n\ttouchcancel : _handlePointer\n};\nvar _pointers = {};\nvar _pointerDocListener = false;\n\n// Provides a touch events wrapper for (ms)pointer events.\n// ref https://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890\n\nexport function addPointerListener(obj, type, handler) {\n\tif (type === 'touchstart') {\n\t\t_addPointerDocListener();\n\t}\n\tif (!handle[type]) {\n\t\tconsole.warn('wrong event specified:', type);\n\t\treturn falseFn;\n\t}\n\thandler = handle[type].bind(this, handler);\n\tobj.addEventListener(pEvent[type], handler, false);\n\treturn handler;\n}\n\nexport function removePointerListener(obj, type, handler) {\n\tif (!pEvent[type]) {\n\t\tconsole.warn('wrong event specified:', type);\n\t\treturn;\n\t}\n\tobj.removeEventListener(pEvent[type], handler, false);\n}\n\nfunction _globalPointerDown(e) {\n\t_pointers[e.pointerId] = e;\n}\n\nfunction _globalPointerMove(e) {\n\tif (_pointers[e.pointerId]) {\n\t\t_pointers[e.pointerId] = e;\n\t}\n}\n\nfunction _globalPointerUp(e) {\n\tdelete _pointers[e.pointerId];\n}\n\nfunction _addPointerDocListener() {\n\t// need to keep track of what pointers and how many are active to provide e.touches emulation\n\tif (!_pointerDocListener) {\n\t\t// we listen document as any drags that end by moving the touch off the screen get fired there\n\t\tdocument.addEventListener(POINTER_DOWN, _globalPointerDown, true);\n\t\tdocument.addEventListener(POINTER_MOVE, _globalPointerMove, true);\n\t\tdocument.addEventListener(POINTER_UP, _globalPointerUp, true);\n\t\tdocument.addEventListener(POINTER_CANCEL, _globalPointerUp, true);\n\n\t\t_pointerDocListener = true;\n\t}\n}\n\nfunction _handlePointer(handler, e) {\n\tif (e.pointerType === (e.MSPOINTER_TYPE_MOUSE || 'mouse')) { return; }\n\n\te.touches = [];\n\tfor (var i in _pointers) {\n\t\te.touches.push(_pointers[i]);\n\t}\n\te.changedTouches = [e];\n\n\thandler(e);\n}\n\nfunction _onPointerStart(handler, e) {\n\t// IE10 specific: MsTouch needs preventDefault. See #2000\n\tif (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) {\n\t\tDomEvent.preventDefault(e);\n\t}\n\t_handlePointer(handler, e);\n}\n", "import * as DomEvent from './DomEvent';\r\n\r\n/*\r\n * Extends the event handling code with double tap support for mobile browsers.\r\n *\r\n * Note: currently most browsers fire native dblclick, with only a few exceptions\r\n * (see https://github.com/Leaflet/Leaflet/issues/7012#issuecomment-595087386)\r\n */\r\n\r\nfunction makeDblclick(event) {\r\n\t// in modern browsers `type` cannot be just overridden:\r\n\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only\r\n\tvar newEvent = {},\r\n\t prop, i;\r\n\tfor (i in event) {\r\n\t\tprop = event[i];\r\n\t\tnewEvent[i] = prop && prop.bind ? prop.bind(event) : prop;\r\n\t}\r\n\tevent = newEvent;\r\n\tnewEvent.type = 'dblclick';\r\n\tnewEvent.detail = 2;\r\n\tnewEvent.isTrusted = false;\r\n\tnewEvent._simulated = true; // for debug purposes\r\n\treturn newEvent;\r\n}\r\n\r\nvar delay = 200;\r\nexport function addDoubleTapListener(obj, handler) {\r\n\t// Most browsers handle double tap natively\r\n\tobj.addEventListener('dblclick', handler);\r\n\r\n\t// On some platforms the browser doesn't fire native dblclicks for touch events.\r\n\t// It seems that in all such cases `detail` property of `click` event is always `1`.\r\n\t// So here we rely on that fact to avoid excessive 'dblclick' simulation when not needed.\r\n\tvar last = 0,\r\n\t detail;\r\n\tfunction simDblclick(e) {\r\n\t\tif (e.detail !== 1) {\r\n\t\t\tdetail = e.detail; // keep in sync to avoid false dblclick in some cases\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (e.pointerType === 'mouse' ||\r\n\t\t\t(e.sourceCapabilities && !e.sourceCapabilities.firesTouchEvents)) {\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// When clicking on an , the browser generates a click on its\r\n\t\t//