From 52a48cb6b4f0818dc1e358d3923197ad32c17fe2 Mon Sep 17 00:00:00 2001 From: Nick Cassab Date: Wed, 20 Nov 2024 11:41:31 -0500 Subject: [PATCH] Added ability to view csv files --- asset-manifest.json | 12 +- index.html | 2 +- static/css/main.db143a6a.css | 2 + static/css/main.db143a6a.css.map | 1 + static/js/main.b4e09789.js | 224 +++++++++++++++++++++++++ static/js/main.b4e09789.js.LICENSE.txt | 78 +++++++++ static/js/main.b4e09789.js.map | 1 + 7 files changed, 313 insertions(+), 7 deletions(-) create mode 100644 static/css/main.db143a6a.css create mode 100644 static/css/main.db143a6a.css.map create mode 100644 static/js/main.b4e09789.js create mode 100644 static/js/main.b4e09789.js.LICENSE.txt create mode 100644 static/js/main.b4e09789.js.map diff --git a/asset-manifest.json b/asset-manifest.json index aca944e4..f1452828 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,15 +1,15 @@ { "files": { - "main.css": "/UBEMViewer/static/css/main.fd669a23.css", - "main.js": "/UBEMViewer/static/js/main.d0bc06f9.js", + "main.css": "/UBEMViewer/static/css/main.db143a6a.css", + "main.js": "/UBEMViewer/static/js/main.b4e09789.js", "static/js/453.1b384830.chunk.js": "/UBEMViewer/static/js/453.1b384830.chunk.js", "index.html": "/UBEMViewer/index.html", - "main.fd669a23.css.map": "/UBEMViewer/static/css/main.fd669a23.css.map", - "main.d0bc06f9.js.map": "/UBEMViewer/static/js/main.d0bc06f9.js.map", + "main.db143a6a.css.map": "/UBEMViewer/static/css/main.db143a6a.css.map", + "main.b4e09789.js.map": "/UBEMViewer/static/js/main.b4e09789.js.map", "453.1b384830.chunk.js.map": "/UBEMViewer/static/js/453.1b384830.chunk.js.map" }, "entrypoints": [ - "static/css/main.fd669a23.css", - "static/js/main.d0bc06f9.js" + "static/css/main.db143a6a.css", + "static/js/main.b4e09789.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index a494307a..0866814c 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Urbano Viewer
\ No newline at end of file +Urbano Viewer
\ No newline at end of file diff --git a/static/css/main.db143a6a.css b/static/css/main.db143a6a.css new file mode 100644 index 00000000..5b622145 --- /dev/null +++ b/static/css/main.db143a6a.css @@ -0,0 +1,2 @@ +#root,body,html{height:100%;margin:0;overflow:hidden}.map-container{bottom:0;height:100%;overflow:hidden;position:absolute;top:0;width:100%}.mapboxgl-ctrl-geocoder{border:1px solid #ccc;box-shadow:none!important}.App{text-align:center}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion:no-preference){.App-logo{animation:App-logo-spin 20s linear infinite}}.App-header{align-items:center;background-color:#282c34;color:#fff;display:flex;flex-direction:column;font-size:calc(10px + 2vmin);justify-content:center;min-height:100vh}.App-link{color:#61dafb}@keyframes App-logo-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.bounding-box{background-color:#ffffff80;border:2px dashed #000}.card{background:#fff;border-radius:8px;box-shadow:0 4px 8px #0000001a;margin:10px;padding:20px}.custom-h5{font-size:16px;margin-bottom:10px}.dropdown{border:1px solid #ccc;border-radius:4px;margin-bottom:10px;padding:8px;width:100%}.legend{display:flex;flex-direction:column}.legend-item2{align-items:center;display:flex;margin-bottom:5px}.color-swatch2{height:20px;margin-right:10px;width:20px}.value-input{border:1px solid #ccc;border-radius:4px;margin-left:10px;padding:5px;width:60px}.chart-area{height:100%;width:100%}.bounding-box{background-color:#0074d91a;border:2px dashed #0074d9;pointer-events:none;position:absolute;z-index:1000}.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom,.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-left,.mapboxgl-ctrl-right,.mapboxgl-ctrl-top,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top{left:50%;top:0;transform:translateX(-50%)}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-right{right:0;top:50%;transform:translateY(-50%)}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl-bottom{bottom:0;left:50%;transform:translateX(-50%)}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-left{left:0;top:50%;transform:translateY(-50%)}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.mapboxgl-ctrl-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-bottom .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.mapboxgl-ctrl-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:initial;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:initial}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath d='m10.5 16 4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='m14 5 1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 0 1 3.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 0 0-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 0 0 4.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 0 1-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 0 1 .3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 0 1-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:initial;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 0 1 3.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 0 0-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 0 0 4.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 0 1-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 0 1 .3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 0 1-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 0 1 3.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 0 0-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 0 0 4.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 0 1-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 0 1 .3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 0 1-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;box-sizing:initial;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid #0000;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:initial;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid #0000;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid #0000;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:#000000b3;color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-ctrl-geocoder,.mapboxgl-ctrl-geocoder *,.mapboxgl-ctrl-geocoder :after,.mapboxgl-ctrl-geocoder :before{box-sizing:border-box}.mapboxgl-ctrl-geocoder{background-color:#fff;border-radius:4px;font-family:Open Sans,-apple-system,BlinkMacSystemFont,Helvetica Neue,Arial,Helvetica,sans-serif;font-size:18px;line-height:24px;min-width:240px;position:relative;transition:width .25s,min-width .25s;width:100%;z-index:1}.mapboxgl-ctrl-geocoder--input{background-color:initial;border:0;color:#404040;color:#000000bf;font:inherit;height:50px;margin:0;overflow:hidden;padding:6px 45px;text-overflow:ellipsis;white-space:nowrap;width:100%}.mapboxgl-ctrl-geocoder--input::-ms-clear{display:none}.mapboxgl-ctrl-geocoder--input:focus{box-shadow:none;color:#404040;color:#000000bf;outline:0;outline:thin dotted}.mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--pin-right>*{display:none;position:absolute;right:8px;top:7px;z-index:2}.mapboxgl-ctrl-geocoder,.mapboxgl-ctrl-geocoder .suggestions{box-shadow:0 0 10px 2px #0000001a}.mapboxgl-ctrl-geocoder.mapboxgl-ctrl-geocoder--collapsed{min-width:50px;transition:width .25s,min-width .25s;width:50px}.mapboxgl-ctrl-geocoder .suggestions{background-color:#fff;border-radius:4px;font-size:15px;left:0;list-style:none;margin:0;overflow:hidden;padding:0;position:absolute;top:110%;top:calc(100% + 6px);width:100%;z-index:1000}.mapboxgl-ctrl-bottom-left .suggestions,.mapboxgl-ctrl-bottom-right .suggestions{bottom:100%;top:auto}.mapboxgl-ctrl-geocoder .suggestions>li>a{color:#404040;cursor:default;display:block;padding:6px 12px}.mapboxgl-ctrl-geocoder .suggestions>.active>a,.mapboxgl-ctrl-geocoder .suggestions>li>a:hover{background-color:#f3f3f3;color:#404040;cursor:pointer;text-decoration:none}.mapboxgl-ctrl-geocoder--suggestion-title{font-weight:700}.mapboxgl-ctrl-geocoder--suggestion-address,.mapboxgl-ctrl-geocoder--suggestion-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mapboxgl-ctrl-geocoder--icon{speak:none;fill:#757575;display:inline-block;top:15px;vertical-align:middle}.mapboxgl-ctrl-geocoder--icon-search{height:23px;left:12px;position:absolute;top:13px;width:23px}.mapboxgl-ctrl-geocoder--button{background:#fff;border:none;cursor:pointer;line-height:1;margin:0;padding:0}.mapboxgl-ctrl-geocoder--icon-close{height:20px;margin-right:3px;margin-top:8px;width:20px}.mapboxgl-ctrl-geocoder--button:hover .mapboxgl-ctrl-geocoder--icon-close{fill:#909090}.mapboxgl-ctrl-geocoder--icon-geolocate{height:22px;margin-right:3px;margin-top:6px;width:22px}.mapboxgl-ctrl-geocoder--icon-loading{animation:rotate .8s cubic-bezier(.45,.05,.55,.95) infinite;height:26px;margin-right:0;margin-top:5px;width:26px}.mapboxgl-ctrl-geocoder--powered-by{display:block;float:left;font-size:13px;padding:6px 12px 9px}.mapboxgl-ctrl-geocoder--powered-by a{color:#909090}.mapboxgl-ctrl-geocoder--powered-by a:not(:hover){text-decoration:none}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@media screen and (min-width:640px){.mapboxgl-ctrl-geocoder.mapboxgl-ctrl-geocoder--collapsed{min-width:36px;width:36px}.mapboxgl-ctrl-geocoder{font-size:15px;line-height:20px;max-width:360px;width:33.3333%}.mapboxgl-ctrl-geocoder .suggestions{font-size:13px}.mapboxgl-ctrl-geocoder--icon{top:8px}.mapboxgl-ctrl-geocoder--icon-close{height:16px;margin-right:0;margin-top:3px;width:16px}.mapboxgl-ctrl-geocoder--icon-geolocate{height:18px;margin-right:0;margin-top:2px;width:18px}.mapboxgl-ctrl-geocoder--icon-search{height:20px;left:7px;width:20px}.mapboxgl-ctrl-geocoder--input{height:36px;padding:6px 35px}.mapboxgl-ctrl-geocoder--icon-loading{height:26px;margin-right:-5px;margin-top:-2px;width:26px}.mapbox-gl-geocoder--error{color:#909090;font-size:16px;padding:6px 12px;text-align:center}.mapboxgl-ctrl-geocoder--powered-by{font-size:11px!important}} +/*# sourceMappingURL=main.db143a6a.css.map*/ \ No newline at end of file diff --git a/static/css/main.db143a6a.css.map b/static/css/main.db143a6a.css.map new file mode 100644 index 00000000..f27273bf --- /dev/null +++ b/static/css/main.db143a6a.css.map @@ -0,0 +1 @@ +{"version":3,"file":"static/css/main.db143a6a.css","mappings":"AAEA,gBACE,WAAY,CACZ,QAAS,CACT,eACF,CAEA,eAGE,QAAS,CAET,WAAY,CACZ,eAAgB,CALhB,iBAAkB,CAClB,KAAM,CAEN,UAGF,CAGA,wBAEE,qBAAsB,CADtB,yBAEF,CCrBA,KACE,iBACF,CAEA,UACE,aAAc,CACd,mBACF,CAEA,8CACE,UACE,2CACF,CACF,CAEA,YAKE,kBAAmB,CAJnB,wBAAyB,CAOzB,UAAY,CALZ,YAAa,CACb,qBAAsB,CAGtB,4BAA6B,CAD7B,sBAAuB,CAJvB,gBAOF,CAEA,UACE,aACF,CAEA,yBACE,GACE,sBACF,CACA,GACE,uBACF,CACF,CAEA,cAGE,0BAA0C,CAD1C,sBAGF,CAIA,MACE,eAAiB,CACjB,iBAAkB,CAClB,8BAAwC,CAExC,WAAY,CADZ,YAEF,CAEA,WACE,cAAe,CACf,kBACF,CAEA,UAIE,qBAAsB,CADtB,iBAAkB,CAElB,kBAAmB,CAHnB,WAAY,CADZ,UAKF,CAEA,QACE,YAAa,CACb,qBACF,CAEA,cAEE,kBAAmB,CADnB,YAAa,CAEb,iBACF,CAEA,eAEE,WAAY,CACZ,iBAAkB,CAFlB,UAGF,CAEA,aAKE,qBAAsB,CADtB,iBAAkB,CADlB,gBAAiB,CADjB,WAAY,CADZ,UAKF,CAGA,YAEE,WAAY,CADZ,UAEF,CAEA,cAEE,0BAAwC,CADxC,yBAA0B,CAG1B,mBAAoB,CADpB,iBAAkB,CAElB,YACF,CC1GA,cAAyG,wCAAuC,CAAlI,wDAAwD,CAAC,eAAe,CAAC,iBAA0D,CAAC,iBAAiB,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,kCAAkC,WAAW,CAAC,UAAU,CAAC,iBAAiB,uBAAuB,CAAC,kGAAkG,WAAW,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,uEAAuE,cAAc,CAAC,gHAAgH,eAAe,CAAC,6HAA6H,wBAAwB,CAAC,uHAAuH,uBAAuB,CAAC,6KAA6K,iBAAiB,CAAC,0LAA0L,mBAAmB,CAAC,iBAAiB,CAAC,SAAS,CAAC,wBAAwB,MAAM,CAAC,KAAK,CAAC,mBAAmB,QAAQ,CAAC,KAAK,CAAC,0BAA0B,CAAC,yBAAyB,OAAO,CAAC,KAAK,CAAC,qBAAqB,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC,4BAA4B,QAAQ,CAAC,OAAO,CAAC,sBAAsB,QAAQ,CAAC,QAAQ,CAAC,0BAA0B,CAAC,2BAA2B,QAAQ,CAAC,MAAM,CAAC,oBAAoB,MAAM,CAAC,OAAO,CAAC,0BAA0B,CAAC,eAAe,UAAU,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,uCAAuC,UAAU,CAAC,oBAAoB,CAAC,kCAAkC,UAAU,CAAC,aAAa,CAAC,wCAAwC,WAAW,CAAC,oBAAoB,CAAC,+EAA+E,WAAW,CAAC,oBAAoB,CAAC,qCAAqC,UAAU,CAAC,aAAa,CAAC,6EAA6E,UAAU,CAAC,oBAAoB,CAAC,qBAAqB,eAAe,CAAC,iBAAiB,CAAC,iCAAiC,8BAAmC,CAAC,kCAAkC,iCAAiC,+BAA+B,CAAC,CAAC,4BAA4B,wBAA4B,CAAC,QAAQ,CAAC,qBAAqB,CAAC,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,YAAY,CAAC,eAAe,CAAC,SAAS,CAAC,UAAU,CAAC,mCAAmC,yBAAyB,CAAC,0CAA0C,uBAAuB,CAAC,2BAA2B,CAAC,aAAa,CAAC,WAAW,CAAC,UAAU,CAAC,kCAAkC,oBAAoB,wBAA4B,CAAC,mCAAmC,+BAA+B,CAAC,CAAC,qEAAqE,8BAA8B,CAAC,+BAA+B,kBAAkB,CAAC,mDAAmD,WAAW,CAAC,wCAAwC,yBAAyB,CAAC,uCAAuC,yBAAyB,CAAC,uCAAuC,qBAAqB,CAAC,2CAA2C,0BAA8B,CAAC,gDAAgD,8BAA8B,CAAC,sDAAsD,eAAe,CAAC,iEAAiE,sPAAkrB,iEAAiE,wVAAmjC,oGAA0V,sPAAmgC,iEAAmE,wVAA68C,4CAA+D,iEAA2b,wOAAyoB,iEAA0C,0UAAk4C,ufAAwuD,gEAA2G,2aAAgxC,mCAAge,qfAAwuD,yfAAuyD,4CAAqB,mEAA2oG,oaAA0/M,gEAAyE,2aAAie,CAAC,iEAAyB,uOAAqgB,mCAAgC,gEAAW,uOAA+T,4GAAwG,yNAAwP,oEAAkF,sZAA08B,4EAAsE,ucAAuf,kGAAmI,yZAAqhB,CAAC,uGAAuG,yZAA2f,sGAA0G,sXAAwf,4GAAoK,sXAAmgB,mGAA0E,0CAAoE,mCAAwC,kEAAoB,sZAAsjB,4EAA8C,ucAA2iB,kGAAiG,yZAAsf,igBAAyN,y3mBCCnnnC,iHAIE,qBACF,CAEA,wBAKE,qBAAsB,CAItB,iBAAkB,CANlB,gGAA2G,CAF3G,cAAe,CACf,gBAAiB,CAKjB,eAAgB,CAHhB,iBAAkB,CAMlB,oCAAsC,CAJtC,UAAW,CAEX,SAGF,CAEA,+BAIE,wBAA6B,CAD7B,QAAS,CAIT,aAAc,CACd,eAA0B,CAP1B,YAAa,CAKb,WAAY,CADZ,QAAS,CAOT,eAAgB,CAHhB,gBAAiB,CACjB,sBAAuB,CACvB,kBAAmB,CATnB,UAWF,CAEA,0CACE,YACF,CAEA,qCAIE,eAAgB,CAHhB,aAAc,CACd,eAA0B,CAC1B,SAAU,CAEV,mBACF,CAEA,6DAKE,YAAa,CAHb,iBAAkB,CAClB,SAAU,CACV,OAAQ,CAHR,SAKF,CAEA,6DAEE,iCACF,CAGA,0DAEE,cAAe,CACf,oCAAsC,CAFtC,UAGF,CAGA,qCACE,qBAAsB,CACtB,iBAAkB,CAWlB,cAAe,CAVf,MAAO,CACP,eAAgB,CAChB,QAAS,CAOT,eAAgB,CANhB,SAAU,CACV,iBAAkB,CAElB,QAAS,CACT,oBAAqB,CAFrB,UAAW,CAGX,YAGF,CAEA,iFAGE,WAAY,CADZ,QAEF,CAEA,0CAIE,aAAc,CAHd,cAAe,CACf,aAAc,CACd,gBAEF,CAEA,+FAGE,wBAAyB,CADzB,aAAc,CAGd,cAAe,CADf,oBAEF,CAEA,0CACE,eACF,CAEA,sFAGE,eAAgB,CADhB,sBAAuB,CAEvB,kBACF,CAGA,8BAGE,UAAW,CACX,YAAa,CAHb,oBAAqB,CAIrB,QAAS,CAHT,qBAIF,CAEA,qCAKE,WAAY,CAFZ,SAAU,CAFV,iBAAkB,CAClB,QAAS,CAET,UAEF,CAEA,gCAKE,eAAgB,CAFhB,WAAY,CACZ,cAAe,CAEf,aAAc,CAJd,QAAS,CADT,SAMF,CAEA,oCAEE,WAAY,CAEZ,gBAAiB,CADjB,cAAe,CAFf,UAIF,CAEA,0EACE,YACF,CAEA,wCAEE,WAAY,CAEZ,gBAAiB,CADjB,cAAe,CAFf,UAIF,CAEA,sCAOE,2DAAoE,CALpE,WAAY,CAEZ,cAAiB,CADjB,cAAe,CAFf,UAOF,CAEA,oCACE,aAAc,CACd,UAAW,CAGX,cAAe,CADf,oBAEF,CAEA,sCACE,aACF,CAEA,kDACE,oBACF,CAcA,kBACE,GAEE,mBACF,CACA,GAEE,uBACF,CACF,CAGA,oCAEE,0DAEE,cAAe,CADf,UAEF,CAEA,wBAEE,cAAe,CACf,gBAAiB,CACjB,eAAgB,CAHhB,cAIF,CACA,qCACE,cACF,CAEA,8BACE,OACF,CAEA,oCAEE,WAAY,CAEZ,cAAe,CADf,cAAe,CAFf,UAIF,CAEA,wCAEE,WAAY,CAEZ,cAAe,CADf,cAAe,CAFf,UAIF,CAEA,qCAGE,WAAY,CAFZ,QAAS,CACT,UAEF,CAEA,+BACE,WAAY,CACZ,gBACF,CAEA,sCAEE,WAAY,CAEZ,iBAAkB,CADlB,eAAgB,CAFhB,UAIF,CAEA,2BACE,aAAa,CAEb,cAAe,CADf,gBAAiB,CAEjB,iBACF,CAEA,oCACE,wBACF,CACF","sources":["index.css","App.css","../node_modules/mapbox-gl/dist/mapbox-gl.css","../node_modules/@mapbox/mapbox-gl-geocoder/dist/mapbox-gl-geocoder.css"],"sourcesContent":["/* index.css */\n\nhtml, body, #root {\n height: 100%;\n margin: 0;\n overflow: hidden;\n}\n\n.map-container {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n/* Override the default shadow of the Mapbox Geocoder container */\n.mapboxgl-ctrl-geocoder {\n box-shadow: none !important;\n border: 1px solid #ccc;\n}\n",".App {\r\n text-align: center;\r\n}\r\n\r\n.App-logo {\r\n height: 40vmin;\r\n pointer-events: none;\r\n}\r\n\r\n@media (prefers-reduced-motion: no-preference) {\r\n .App-logo {\r\n animation: App-logo-spin infinite 20s linear;\r\n }\r\n}\r\n\r\n.App-header {\r\n background-color: #282c34;\r\n min-height: 100vh;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n font-size: calc(10px + 2vmin);\r\n color: white;\r\n}\r\n\r\n.App-link {\r\n color: #61dafb;\r\n}\r\n\r\n@keyframes App-logo-spin {\r\n from {\r\n transform: rotate(0deg);\r\n }\r\n to {\r\n transform: rotate(360deg);\r\n }\r\n}\r\n\r\n.bounding-box {\r\n position: absolute;\r\n border: 2px dashed #000;\r\n background-color: rgba(255, 255, 255, 0.5);\r\n pointer-events: none;\r\n}\r\n\r\n/* legendcard css */\r\n\r\n.card {\r\n background: white;\r\n border-radius: 8px;\r\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\r\n padding: 20px;\r\n margin: 10px;\r\n}\r\n\r\n.custom-h5 {\r\n font-size: 16px;\r\n margin-bottom: 10px;\r\n}\r\n\r\n.dropdown {\r\n width: 100%;\r\n padding: 8px;\r\n border-radius: 4px;\r\n border: 1px solid #ccc;\r\n margin-bottom: 10px;\r\n}\r\n\r\n.legend {\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.legend-item2 {\r\n display: flex;\r\n align-items: center;\r\n margin-bottom: 5px;\r\n}\r\n\r\n.color-swatch2 {\r\n width: 20px;\r\n height: 20px;\r\n margin-right: 10px;\r\n}\r\n\r\n.value-input {\r\n width: 60px;\r\n padding: 5px;\r\n margin-left: 10px;\r\n border-radius: 4px;\r\n border: 1px solid #ccc;\r\n}\r\n\r\n/* App.css */\r\n.chart-area {\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.bounding-box {\r\n border: 2px dashed #0074D9;\r\n background-color: rgba(0, 116, 217, 0.1);\r\n position: absolute;\r\n pointer-events: none;\r\n z-index: 1000; /* Ensure it appears on top of the map */\r\n}\r\n",".mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom,.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-left,.mapboxgl-ctrl-right,.mapboxgl-ctrl-top,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top{left:50%;top:0;transform:translateX(-50%)}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-right{right:0;top:50%;transform:translateY(-50%)}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl-bottom{bottom:0;left:50%;transform:translateX(-50%)}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-left{left:0;top:50%;transform:translateY(-50%)}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.mapboxgl-ctrl-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-bottom .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.mapboxgl-ctrl-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E\")}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:\"\";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:\"\";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}","/* Basics */\n.mapboxgl-ctrl-geocoder,\n.mapboxgl-ctrl-geocoder *,\n.mapboxgl-ctrl-geocoder *:after,\n.mapboxgl-ctrl-geocoder *:before {\n box-sizing: border-box;\n}\n\n.mapboxgl-ctrl-geocoder {\n font-size: 18px;\n line-height: 24px;\n font-family: \"Open Sans\", -apple-system, BlinkMacSystemFont, \"Helvetica Neue\", Arial, Helvetica, sans-serif;\n position: relative;\n background-color: #fff;\n width: 100%;\n min-width: 240px;\n z-index: 1;\n border-radius: 4px;\n transition: width .25s, min-width .25s;\n}\n\n.mapboxgl-ctrl-geocoder--input {\n font: inherit;\n width: 100%;\n border: 0;\n background-color: transparent;\n margin: 0;\n height: 50px;\n color: #404040; /* fallback */\n color: rgba(0, 0, 0, 0.75);\n padding: 6px 45px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.mapboxgl-ctrl-geocoder--input::-ms-clear {\n display: none; /* hide input clear button in IE */\n}\n\n.mapboxgl-ctrl-geocoder--input:focus {\n color: #404040; /* fallback */\n color: rgba(0, 0, 0, 0.75);\n outline: 0;\n box-shadow: none;\n outline: thin dotted;\n}\n\n.mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--pin-right > * {\n z-index: 2;\n position: absolute;\n right: 8px;\n top: 7px;\n display: none;\n}\n\n.mapboxgl-ctrl-geocoder,\n.mapboxgl-ctrl-geocoder .suggestions {\n box-shadow: 0 0 10px 2px rgba(0,0,0,.1);\n}\n\n/* Collapsed */\n.mapboxgl-ctrl-geocoder.mapboxgl-ctrl-geocoder--collapsed {\n width: 50px;\n min-width: 50px;\n transition: width .25s, min-width .25s;\n}\n\n/* Suggestions */\n.mapboxgl-ctrl-geocoder .suggestions {\n background-color: #fff;\n border-radius: 4px;\n left: 0;\n list-style: none;\n margin: 0;\n padding: 0;\n position: absolute;\n width: 100%;\n top: 110%; /* fallback */\n top: calc(100% + 6px);\n z-index: 1000;\n overflow: hidden;\n font-size: 15px;\n}\n\n.mapboxgl-ctrl-bottom-left .suggestions,\n.mapboxgl-ctrl-bottom-right .suggestions {\n top: auto;\n bottom: 100%;\n}\n\n.mapboxgl-ctrl-geocoder .suggestions > li > a {\n cursor: default;\n display: block;\n padding: 6px 12px;\n color: #404040;\n}\n\n.mapboxgl-ctrl-geocoder .suggestions > .active > a,\n.mapboxgl-ctrl-geocoder .suggestions > li > a:hover {\n color: #404040;\n background-color: #f3f3f3;\n text-decoration: none;\n cursor: pointer;\n}\n\n.mapboxgl-ctrl-geocoder--suggestion-title {\n font-weight: bold;\n}\n\n.mapboxgl-ctrl-geocoder--suggestion-title,\n.mapboxgl-ctrl-geocoder--suggestion-address {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n\n/* Icons */\n.mapboxgl-ctrl-geocoder--icon {\n display: inline-block;\n vertical-align: middle;\n speak: none;\n fill: #757575;\n top: 15px;\n}\n\n.mapboxgl-ctrl-geocoder--icon-search {\n position: absolute;\n top: 13px;\n left: 12px;\n width: 23px;\n height: 23px;\n}\n\n.mapboxgl-ctrl-geocoder--button {\n padding: 0;\n margin: 0;\n border: none;\n cursor: pointer;\n background: #fff;\n line-height: 1;\n}\n\n.mapboxgl-ctrl-geocoder--icon-close {\n width: 20px;\n height: 20px;\n margin-top: 8px;\n margin-right: 3px;\n}\n\n.mapboxgl-ctrl-geocoder--button:hover .mapboxgl-ctrl-geocoder--icon-close {\n fill: #909090;\n}\n\n.mapboxgl-ctrl-geocoder--icon-geolocate {\n width: 22px;\n height: 22px;\n margin-top: 6px;\n margin-right: 3px;\n}\n\n.mapboxgl-ctrl-geocoder--icon-loading {\n width: 26px;\n height: 26px;\n margin-top: 5px;\n margin-right: 0px;\n -moz-animation: rotate 0.8s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95);\n -webkit-animation: rotate 0.8s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95);\n animation: rotate 0.8s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95);\n}\n\n.mapboxgl-ctrl-geocoder--powered-by {\n display: block;\n float: left;\n padding: 6px 12px;\n padding-bottom: 9px;\n font-size: 13px;\n}\n\n.mapboxgl-ctrl-geocoder--powered-by a {\n color: #909090;\n}\n\n.mapboxgl-ctrl-geocoder--powered-by a:not(:hover) {\n text-decoration: none; \n}\n\n/* Animation */\n@-webkit-keyframes rotate {\n from {\n -webkit-transform: rotate(0);\n transform: rotate(0);\n }\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes rotate {\n from {\n -webkit-transform: rotate(0);\n transform: rotate(0);\n }\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n/* Media queries*/\n@media screen and (min-width: 640px) {\n\n .mapboxgl-ctrl-geocoder.mapboxgl-ctrl-geocoder--collapsed {\n width: 36px;\n min-width: 36px;\n }\n\n .mapboxgl-ctrl-geocoder {\n width: 33.3333%;\n font-size: 15px;\n line-height: 20px;\n max-width: 360px;\n }\n .mapboxgl-ctrl-geocoder .suggestions {\n font-size: 13px;\n }\n\n .mapboxgl-ctrl-geocoder--icon {\n top: 8px;\n }\n\n .mapboxgl-ctrl-geocoder--icon-close {\n width: 16px;\n height: 16px;\n margin-top: 3px;\n margin-right: 0;\n }\n\n .mapboxgl-ctrl-geocoder--icon-geolocate {\n width: 18px;\n height: 18px;\n margin-top: 2px;\n margin-right: 0;\n }\n\n .mapboxgl-ctrl-geocoder--icon-search {\n left: 7px;\n width: 20px;\n height: 20px;\n }\n\n .mapboxgl-ctrl-geocoder--input {\n height: 36px;\n padding: 6px 35px;\n }\n\n .mapboxgl-ctrl-geocoder--icon-loading {\n width: 26px;\n height: 26px;\n margin-top: -2px;\n margin-right: -5px;\n }\n\n .mapbox-gl-geocoder--error{\n color:#909090;\n padding: 6px 12px;\n font-size: 16px;\n text-align: center;\n }\n\n .mapboxgl-ctrl-geocoder--powered-by {\n font-size: 11px !important;\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/static/js/main.b4e09789.js b/static/js/main.b4e09789.js new file mode 100644 index 00000000..4947afb4 --- /dev/null +++ b/static/js/main.b4e09789.js @@ -0,0 +1,224 @@ +/*! For license information please see main.b4e09789.js.LICENSE.txt */ +(()=>{var e={3803:(e,t,n)=>{"use strict";n.d(t,{A:()=>ie});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?u(x,--y):0,g--,10===v&&(g=1,m--),v}function M(){return v=y<_?u(x,y++):0,g++,10===v&&(g=1,m++),v}function A(){return u(x,y)}function E(){return y}function T(e,t){return h(x,e,t)}function C(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function k(e){return m=g=1,_=d(x=e),y=0,[]}function I(e){return x="",e}function P(e){return s(T(y-1,z(91===e?e+2:40===e?e+1:e)))}function R(e){for(;(v=A())&&v<33;)M();return C(e)>2||C(v)>3?"":" "}function L(e,t){for(;--t&&M()&&!(v<48||v>102||v>57&&v<65||v>70&&v<97););return T(e,E()+(t<6&&32==A()&&32==M()))}function z(e){for(;M();)switch(v){case e:return y;case 34:case 39:34!==e&&39!==e&&z(v);break;case 40:41===e&&z(e);break;case 92:M()}return y}function D(e,t){for(;M()&&e+v!==57&&(e+v!==84||47!==A()););return"/*"+T(t,y-1)+"*"+o(47===e?e:M())}function O(e){for(;!C(A());)M();return T(e,y)}var F="-ms-",B="-moz-",N="-webkit-",j="comm",V="rule",U="decl",$="@keyframes";function G(e,t){for(var n="",r=f(e),i=0;i0&&d(B)-_&&p(v>32?X(B+";",r,n,_-1):X(l(B," ","")+";",r,n,_-2),f);break;case 59:B+=";";default:if(p(F=Z(B,t,n,m,g,i,h,k,I=[],z=[],_),a),123===C)if(0===g)H(B,t,F,F,I,a,_,h,z);else switch(99===y&&110===u(B,3)?100:y){case 100:case 108:case 109:case 115:H(e,F,F,r&&p(Z(e,F,F,0,0,i,h,k,i,I=[],_),z),i,z,_,h,r?I:z);break;default:H(B,F,F,F,[""],z,0,h,z)}}m=g=v=0,b=T=1,k=B="",_=s;break;case 58:_=1+d(B),v=x;default:if(b<1)if(123==C)--b;else if(125==C&&0==b++&&125==S())continue;switch(B+=o(C),C*b){case 38:T=g>0?1:(B+="\f",-1);break;case 44:h[m++]=(d(B)-1)*T,T=1;break;case 64:45===A()&&(B+=P(M())),y=A(),g=_=d(k=B+=O(E())),C++;break;case 45:45===x&&2==d(B)&&(b=0)}}return a}function Z(e,t,n,r,o,a,c,u,d,p,m){for(var g=o-1,_=0===o?a:[""],y=f(_),v=0,x=0,w=0;v0?_[S]+" "+M:l(M,/&\f/g,_[S])))&&(d[w++]=A);return b(e,t,n,0===o?V:u,d,p,m)}function Y(e,t,n){return b(e,t,n,j,o(v),h(e,2,-2),0)}function X(e,t,n,r){return b(e,t,n,U,h(e,0,r),h(e,r+1,-1),r)}var K=function(e,t,n){for(var r=0,i=0;r=i,i=A(),38===r&&12===i&&(t[n]=1),!C(i);)M();return T(e,y)},J=function(e,t){return I(function(e,t){var n=-1,r=44;do{switch(C(r)){case 0:38===r&&12===A()&&(t[n]=1),e[n]+=K(y-1,t,n);break;case 2:e[n]+=P(r);break;case 4:if(44===r){e[++n]=58===A()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=o(r)}}while(r=M());return e}(k(e),t))},Q=new WeakMap,ee=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Q.get(n))&&!r){Q.set(e,!0);for(var i=[],o=J(t,i),a=n.props,s=0,l=0;s6)switch(u(e,t+1)){case 109:if(45!==u(e,t+4))break;case 102:return l(e,/(.+:)(.+)-([^]+)/,"$1"+N+"$2-$3$1"+B+(108==u(e,t+3)?"$3":"$2-$3"))+e;case 115:return~c(e,"stretch")?ne(l(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==u(e,t+1))break;case 6444:switch(u(e,d(e)-3-(~c(e,"!important")&&10))){case 107:return l(e,":",":"+N)+e;case 101:return l(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+N+(45===u(e,14)?"inline-":"")+"box$3$1"+N+"$2$3$1"+F+"$2box$3")+e}break;case 5936:switch(u(e,t+11)){case 114:return N+e+F+l(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return N+e+F+l(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return N+e+F+l(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return N+e+F+e+e}return e}var re=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case U:e.return=ne(e.value,e.length);break;case $:return G([w(e,{value:l(e.value,"@","@"+N)})],r);case V:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return G([w(e,{props:[l(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return G([w(e,{props:[l(t,/:(plac\w+)/,":"+N+"input-$1")]}),w(e,{props:[l(t,/:(plac\w+)/,":-moz-$1")]}),w(e,{props:[l(t,/:(plac\w+)/,F+"input-$1")]})],r)}return""}))}}],ie=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i,o,a=e.stylisPlugins||re,s={},l=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n{"use strict";function r(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{A:()=>r})},4575:(e,t,n)=>{"use strict";n.d(t,{C:()=>a,T:()=>l,w:()=>s});var r=n(5043),i=n(3803),o=(n(6598),n(9436),r.createContext("undefined"!==typeof HTMLElement?(0,i.A)({key:"css"}):null)),a=o.Provider,s=function(e){return(0,r.forwardRef)((function(t,n){var i=(0,r.useContext)(o);return e(t,i,n)}))},l=r.createContext({})},3290:(e,t,n)=>{"use strict";n.d(t,{AH:()=>c,i7:()=>u,mL:()=>l});var r=n(4575),i=n(5043),o=n(1722),a=n(9436),s=n(6598),l=(n(3803),n(219),(0,r.w)((function(e,t){var n=e.styles,l=(0,s.J)([n],void 0,i.useContext(r.T)),c=i.useRef();return(0,a.i)((function(){var e=t.key+"-global",n=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),r=!1,i=document.querySelector('style[data-emotion="'+e+" "+l.name+'"]');return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),null!==i&&(r=!0,i.setAttribute("data-emotion",e),n.hydrate([i])),c.current=[n,r],function(){n.flush()}}),[t]),(0,a.i)((function(){var e=c.current,n=e[0];if(e[1])e[1]=!1;else{if(void 0!==l.next&&(0,o.sk)(t,l.next,!0),n.tags.length){var r=n.tags[n.tags.length-1].nextElementSibling;n.before=r,n.flush()}t.insert("",l,n,!1)}}),[t,l.name]),null})));function c(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";n.d(t,{J:()=>g});var r={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i=n(918),o=!1,a=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(e){return 45===e.charCodeAt(1)},c=function(e){return null!=e&&"boolean"!==typeof e},u=(0,i.A)((function(e){return l(e)?e:e.replace(a,"-$&").toLowerCase()})),h=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(s,(function(e,t,n){return p={name:t,styles:n,next:p},t}))}return 1===r[e]||l(e)||"number"!==typeof t||0===t?t:t+"px"},d="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function f(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var i=n;if(1===i.anim)return p={name:i.name,styles:i.styles,next:p},i.name;var a=n;if(void 0!==a.styles){var s=a.next;if(void 0!==s)for(;void 0!==s;)p={name:s.name,styles:s.styles,next:p},s=s.next;return a.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+l;return{name:c,styles:i,next:p}}},5903:(e,t,n)=>{"use strict";n.d(t,{A:()=>_});var r=n(8168),i=n(5043),o=n(918),a=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,s=(0,o.A)((function(e){return a.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),l=n(4575),c=n(1722),u=n(6598),h=n(9436),d=s,f=function(e){return"theme"!==e},p=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?d:f},m=function(e,t,n){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!==typeof r&&n&&(r=e.__emotion_forwardProp),r},g=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return(0,c.SF)(t,n,r),(0,h.s)((function(){return(0,c.sk)(t,n,r)})),null},_=function e(t,n){var o,a,s=t.__emotion_real===t,h=s&&t.__emotion_base||t;void 0!==n&&(o=n.label,a=n.target);var d=m(t,n,s),f=d||p(h),_=!f("as");return function(){var y=arguments,v=s&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&v.push("label:"+o+";"),null==y[0]||void 0===y[0].raw)v.push.apply(v,y);else{v.push(y[0][0]);for(var x=y.length,b=1;b{"use strict";var r;n.d(t,{i:()=>s,s:()=>a});var i=n(5043),o=!!(r||(r=n.t(i,2))).useInsertionEffect&&(r||(r=n.t(i,2))).useInsertionEffect,a=o||function(e){return e()},s=o||i.useLayoutEffect},1722:(e,t,n)=>{"use strict";n.d(t,{Rk:()=>r,SF:()=>i,sk:()=>o});function r(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")})),r}var i=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},o=function(e,t,n){i(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}},6366:(e,t,n)=>{"use strict";var r=n(8313),i=n(49),o="value",a="\n ",s={};function l(e){var t=Array.isArray(e);return function(n){var r,i=c(s.plainArray,n);if(i)return i;if(t&&n.length!==e.length)return"an array with "+e.length+" items";for(var o=0;oe.length?t:e}))}},s.equal=function(e){return function(t){if(t!==e)return JSON.stringify(e)}},s.oneOf=function(){var e=(Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments)).map((function(e){return s.equal(e)}));return s.oneOfType.apply(this,e)},s.range=function(e){var t=e[0],n=e[1];return function(e){if(c(s.number,e)||en)return"number between "+t+" & "+n+" (inclusive)"}},s.any=function(){},s.boolean=function(e){if("boolean"!==typeof e)return"boolean"},s.number=function(e){if("number"!==typeof e)return"number"},s.plainArray=function(e){if(!Array.isArray(e))return"array"},s.plainObject=function(e){if(!r(e))return"object"},s.string=function(e){if("string"!==typeof e)return"string"},s.func=function(e){if("function"!==typeof e)return"function"},s.validate=c,s.processMessage=u,e.exports=s},5609:(e,t,n)=>{"use strict";var r=n(9452).Ak;function i(e){this.origin=e.origin||"https://api.mapbox.com",this.endpoint="events/v2",this.access_token=e.accessToken,this.version="0.3.0",this.pluginSessionID=this.generateSessionID(),this.sessionIncrementer=0,this.userAgent=this.getUserAgent(),this.options=e,this.send=this.send.bind(this),this.countries=e.countries?e.countries.split(","):null,this.types=e.types?e.types.split(","):null,this.bbox=e.bbox?e.bbox:null,this.language=e.language?e.language.split(","):null,this.limit=e.limit?+e.limit:null,this.locale=navigator.language||null,this.enableEventLogging=this.shouldEnableLogging(e),this.eventQueue=new Array,this.flushInterval=e.flushInterval||1e3,this.maxQueueSize=e.maxQueueSize||100,this.timer=this.flushInterval?setTimeout(this.flush.bind(this),this.flushInterval):null,this.lastSentInput="",this.lastSentIndex=0}i.prototype={select:function(e,t){var n=this.getEventPayload("search.select",t,{selectedFeature:e});if(n&&(n.resultIndex!==this.lastSentIndex||n.queryString!==this.lastSentInput)&&-1!=n.resultIndex)return this.lastSentIndex=n.resultIndex,this.lastSentInput=n.queryString,this.push(n)},start:function(e){var t=this.getEventPayload("search.start",e);if(t)return this.push(t)},keyevent:function(e,t){if(e.key&&!e.metaKey&&-1===[9,27,37,39,13,38,40].indexOf(e.keyCode)){var n=this.getEventPayload("search.keystroke",t,{key:e.key});if(n)return this.push(n)}},send:function(e,t){if(!this.enableEventLogging)return t?t():void 0;var n=this.getRequestOptions(e);this.request(n,function(e){return e?this.handleError(e,t):t?t():void 0}.bind(this))},getRequestOptions:function(e){return Array.isArray(e)||(e=[e]),{method:"POST",host:this.origin,path:this.endpoint+"?access_token="+this.access_token,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}},getEventPayload:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("search.select"===e&&!n.selectedFeature||"search.keystroke"===e&&!n.key)return null;var r;if(t.options.proximity)if("object"===typeof t.options.proximity)r=[t.options.proximity.longitude,t.options.proximity.latitude];else if("ip"===t.options.proximity){var i=t._headers?t._headers["ip-proximity"]:null;r=i&&"string"===typeof i?i.split(",").map(parseFloat):[999,999]}else r=t.options.proximity;else r=null;var o=t._map?t._map.getZoom():void 0,a={event:e,version:this.getEventSchemaVersion(e),created:+new Date,sessionIdentifier:this.getSessionId(),country:this.countries,userAgent:this.userAgent,language:this.language,bbox:this.bbox,types:this.types,endpoint:"mapbox.places",autocomplete:t.options.autocomplete,fuzzyMatch:t.options.fuzzyMatch,proximity:r,limit:t.options.limit,routing:t.options.routing,worldview:t.options.worldview,mapZoom:o,keyboardLocale:this.locale};if("search.select"===e?a.queryString=t.inputString:"search.select"!=e&&t._inputEl?a.queryString=t._inputEl.value:a.queryString=t.inputString,["search.keystroke","search.select"].includes(e)&&(a.path="geocoding/v5/mapbox.places"),"search.keystroke"===e&&n.key)a.lastAction=n.key;else if("search.select"===e&&n.selectedFeature){var s=n.selectedFeature,l=this.getSelectedIndex(s,t);if(a.resultIndex=l,a.resultPlaceName=s.place_name,a.resultId=s.id,s.properties&&(a.resultMapboxId=s.properties.mapbox_id),t._typeahead){var c=t._typeahead.data;c&&c.length>0&&(a.suggestionIds=this.getSuggestionIds(c),a.suggestionNames=this.getSuggestionNames(c),a.suggestionTypes=this.getSuggestionTypes(c),a.suggestionSources=this.getSuggestionSources(c))}}return this.validatePayload(a)?a:null},request:function(e,t){var n=new XMLHttpRequest;for(var r in n.onreadystatechange=function(){if(4==this.readyState)return 204==this.status?t(null):t(this.statusText)},n.open(e.method,e.host+"/"+e.path,!0),e.headers){var i=e.headers[r];n.setRequestHeader(r,i)}n.send(e.body)},handleError:function(e,t){if(t)return t(e)},generateSessionID:function(){return r()},getSessionId:function(){return this.pluginSessionID+"."+this.sessionIncrementer},getUserAgent:function(){return"mapbox-gl-geocoder."+this.version+"."+navigator.userAgent},getSelectedIndex:function(e,t){if(t._typeahead){var n=t._typeahead.data,r=e.id;return n.map((function(e){return e.id})).indexOf(r)}},getSuggestionIds:function(e){return e.map((function(e){return e.properties?e.properties.mapbox_id||"":e.id||""}))},getSuggestionNames:function(e){return e.map((function(e){return e.place_name||""}))},getSuggestionTypes:function(e){return e.map((function(e){return e.place_type&&Array.isArray(e.place_type)&&e.place_type[0]||""}))},getSuggestionSources:function(e){return e.map((function(e){return e._source||""}))},getEventSchemaVersion:function(e){return["search.keystroke","search.select"].includes(e)?"2.2":"2.0"},validatePayload:function(e){if(!e||!e.event)return!1;var t=e.event;return"search.start"===t?this.objectHasRequiredProps(e,["event","created","sessionIdentifier","queryString"]):"search.keystroke"===t?this.objectHasRequiredProps(e,["event","created","sessionIdentifier","queryString","lastAction"]):"search.select"!==t||this.objectHasRequiredProps(e,["event","created","sessionIdentifier","queryString","resultIndex","path","suggestionIds"])},objectHasRequiredProps:function(e,t){return t.every((function(t){return"queryString"===t?"string"===typeof e[t]&&e[t].length>0:void 0!==e[t]}))},shouldEnableLogging:function(e){return!1!==e.enableEventLogging&&(!e.origin||"https://api.mapbox.com"===e.origin)},flush:function(){this.eventQueue.length>0&&(this.send(this.eventQueue),this.eventQueue=new Array),this.timer&&clearTimeout(this.timer),this.flushInterval&&(this.timer=setTimeout(this.flush.bind(this),this.flushInterval))},push:function(e,t){this.eventQueue.push(e),(this.eventQueue.length>=this.maxQueueSize||t)&&this.flush()},remove:function(){this.flush()}},e.exports=i},438:e=>{e.exports={fr:{name:"France",bbox:[[-4.59235,41.380007],[9.560016,51.148506]]},us:{name:"United States",bbox:[[-171.791111,18.91619],[-66.96466,71.357764]]},ru:{name:"Russia",bbox:[[19.66064,41.151416],[190.10042,81.2504]]},ca:{name:"Canada",bbox:[[-140.99778,41.675105],[-52.648099,83.23324]]}}},792:e=>{function t(){}t.prototype={isSupport:function(){return Boolean(window.navigator.geolocation)},getCurrentPosition:function(){const e={enableHighAccuracy:!0};return new Promise((function(t,n){window.navigator.geolocation.getCurrentPosition(t,n,e)}))}},e.exports=t},4066:(e,t,n)=>{"use strict";var r=n(7053),i=n(446),o=n(49),a=n(7284).EventEmitter,s=n(438),l=n(7050),c=n(4012),u=n(5609),h=n(6397),d=n(3058),f=n(792),p=n(7651);const m=0,g=1,_=2;function y(e){this._eventEmitter=new a,this.options=o({},this.options,e),this.inputString="",this.fresh=!0,this.lastSelected=null,this.geolocation=new f}y.prototype={options:{zoom:16,flyTo:!0,trackProximity:!0,minLength:2,reverseGeocode:!1,flipCoordinates:!1,limit:5,origin:"https://api.mapbox.com",enableEventLogging:!0,marker:!0,mapboxgl:null,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,enableGeolocation:!1,addressAccuracy:"street",getItemValue:function(e){return e.place_name},render:function(e){var t=e.place_name.split(",");return'
'+t[0]+'
'+t.splice(1,t.length).join(",")+"
"}},_headers:{},addTo:function(e){function t(e,t){if(!document.body.contains(t))throw new Error("Element provided to #addTo() exists, but is not in the DOM");const n=e.onAdd();t.appendChild(n)}if(e._controlContainer)e.addControl(this);else if(e instanceof HTMLElement)t(this,e);else{if("string"!=typeof e)throw new Error("Error: addTo must be a mapbox-gl-js map, an html element, or a CSS selector query for a single html element");{const n=document.querySelectorAll(e);if(0===n.length)throw new Error("Element ",e,"not found.");if(n.length>1)throw new Error("Geocoder can only be added to a single html element");t(this,n[0])}}},onAdd:function(e){if(e&&"string"!=typeof e&&(this._map=e),this.setLanguage(),this.options.localGeocoderOnly||(this.geocoderService=c(l({accessToken:this.options.accessToken,origin:this.options.origin}))),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode");this.eventManager=new u(this.options),this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this),this._geolocateUser=this._geolocateUser.bind(this);var t=this.container=document.createElement("div");t.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl";var n=this.createIcon("search",'');this._inputEl=document.createElement("input"),this._inputEl.type="text",this._inputEl.className="mapboxgl-ctrl-geocoder--input",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener("mouseenter",this._unCollapse),this.container.addEventListener("mouseleave",this._collapse),this._inputEl.addEventListener("focus",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener("blur",this._onBlur),this._inputEl.addEventListener("keydown",i(this._onKeyDown,200)),this._inputEl.addEventListener("paste",this._onPaste),this._inputEl.addEventListener("change",this._onChange),this.container.addEventListener("mouseenter",this._showButton),this.container.addEventListener("mouseleave",this._hideButton),this._inputEl.addEventListener("keyup",function(e){this.eventManager.keyevent(e,this)}.bind(this));var o=document.createElement("div");o.classList.add("mapboxgl-ctrl-geocoder--pin-right"),this._clearEl=document.createElement("button"),this._clearEl.setAttribute("aria-label","Clear"),this._clearEl.addEventListener("click",this.clear),this._clearEl.className="mapboxgl-ctrl-geocoder--button";var a=this.createIcon("close",'');if(this._clearEl.appendChild(a),this._loadingEl=this.createIcon("loading",''),o.appendChild(this._clearEl),o.appendChild(this._loadingEl),t.appendChild(n),t.appendChild(this._inputEl),t.appendChild(o),this.options.enableGeolocation&&this.geolocation.isSupport()){this._geolocateEl=document.createElement("button"),this._geolocateEl.setAttribute("aria-label","Geolocate"),this._geolocateEl.addEventListener("click",this._geolocateUser),this._geolocateEl.className="mapboxgl-ctrl-geocoder--button";var s=this.createIcon("geolocate",'');this._geolocateEl.appendChild(s),o.appendChild(this._geolocateEl),this._showGeolocateButton()}var h=this._typeahead=new r(this._inputEl,[],{filter:!1,minLength:this.options.minLength,limit:this.options.limit});this.setRenderFunction(this.options.render),h.getItemValue=this.options.getItemValue;var d=h.list.draw,f=this._footerNode=function(){var e=document.createElement("div");return e.className="mapboxgl-ctrl-geocoder--powered-by",e.innerHTML='Powered by Mapbox',e}();return h.list.draw=function(){d.call(this),f.addEventListener("mousedown",function(){this.selectingListItem=!0}.bind(this)),f.addEventListener("mouseup",function(){this.selectingListItem=!1}.bind(this)),this.element.appendChild(f)},this.mapMarker=null,this._handleMarker=this._handleMarker.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on("moveend",this._updateProximity)),this._mapboxgl=this.options.mapboxgl,!this._mapboxgl&&this.options.marker&&(console.error("No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl."),this.options.marker=!1)),t},_geolocateUser:function(){this._hideGeolocateButton(),this._showLoadingIcon(),this.geolocation.getCurrentPosition().then(function(e){this._hideLoadingIcon();const t={geometry:{type:"Point",coordinates:[e.coords.longitude,e.coords.latitude]}};this._handleMarker(t),this._fly(t),this._typeahead.clear(),this._typeahead.selected=!0,this.lastSelected=JSON.stringify(t),this._showClearButton(),this.fresh=!1;const n={limit:1,language:[this.options.language],query:t.geometry.coordinates,types:["address"]};if(this.options.localGeocoderOnly){const e=t.geometry.coordinates[0]+","+t.geometry.coordinates[1];this._setInputValue(e),this._eventEmitter.emit("result",{result:t})}else this.geocoderService.reverseGeocode(n).send().then(function(e){const n=e.body.features[0];if(n){const e=p.transformFeatureToGeolocationText(n,this.options.addressAccuracy);this._setInputValue(e),n.user_coordinates=t.geometry.coordinates,this._eventEmitter.emit("result",{result:n})}else this._eventEmitter.emit("result",{result:{user_coordinates:t.geometry.coordinates}})}.bind(this))}.bind(this)).catch(function(e){1===e.code?this._renderUserDeniedGeolocationError():this._renderLocationError(),this._hideLoadingIcon(),this._showGeolocateButton(),this._hideAttribution()}.bind(this))},createIcon:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("class","mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-"+e),n.setAttribute("viewBox","0 0 18 18"),n.setAttribute("xml:space","preserve"),n.setAttribute("width",18),n.setAttribute("height",18),n.innerHTML=t,n},onRemove:function(){return this.container.parentNode.removeChild(this.container),this.options.trackProximity&&this._map&&this._map.off("moveend",this._updateProximity),this._removeMarker(),this._map=null,this},_setInputValue:function(e){this._inputEl.value=e,setTimeout(function(){this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0)}.bind(this),1)},_onPaste:function(e){var t=(e.clipboardData||window.clipboardData).getData("text");t.length>=this.options.minLength&&this._geocode(t)},_onKeyDown:function(e){var t=27,n=9;if(e.keyCode===t&&this.options.clearAndBlurOnEsc)return this._clear(e),this._inputEl.blur();var r=e.target&&e.target.shadowRoot?e.target.shadowRoot.activeElement:e.target;if(!(r?r.value:""))return this.fresh=!0,e.keyCode!==n&&this.clear(e),this._showGeolocateButton(),this._hideClearButton();this._hideGeolocateButton(),e.metaKey||-1!==[n,t,37,39,13,38,40].indexOf(e.keyCode)||r.value.length>=this.options.minLength&&this._geocode(r.value)},_showButton:function(){this._typeahead.selected&&this._showClearButton()},_hideButton:function(){this._typeahead.selected&&this._hideClearButton()},_showClearButton:function(){this._clearEl.style.display="block"},_hideClearButton:function(){this._clearEl.style.display="none"},_showGeolocateButton:function(){this._geolocateEl&&this.geolocation.isSupport()&&(this._geolocateEl.style.display="block")},_hideGeolocateButton:function(){this._geolocateEl&&(this._geolocateEl.style.display="none")},_showLoadingIcon:function(){this._loadingEl.style.display="block"},_hideLoadingIcon:function(){this._loadingEl.style.display="none"},_showAttribution:function(){this._footerNode.style.display="block"},_hideAttribution:function(){this._footerNode.style.display="none"},_onBlur:function(e){this.options.clearOnBlur&&this._clearOnBlur(e),this.options.collapsed&&this._collapse()},_onChange:function(){var e=this._typeahead.selected;e&&JSON.stringify(e)!==this.lastSelected&&(this._hideClearButton(),this.options.flyTo&&this._fly(e),this.options.marker&&this._mapboxgl&&this._handleMarker(e),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(e),this._eventEmitter.emit("result",{result:e}),this.eventManager.select(e,this))},_fly:function(e){var t;if(e.properties&&s[e.properties.short_code])t=o({},this.options.flyTo),this._map&&this._map.fitBounds(s[e.properties.short_code].bbox,t);else if(e.bbox){var n=e.bbox;t=o({},this.options.flyTo),this._map&&this._map.fitBounds([[n[0],n[1]],[n[2],n[3]]],t)}else{var r={zoom:this.options.zoom};t=o({},r,this.options.flyTo),e.center?t.center=e.center:e.geometry&&e.geometry.type&&"Point"===e.geometry.type&&e.geometry.coordinates&&(t.center=e.geometry.coordinates),this._map&&this._map.flyTo(t)}},_requestType:function(e,t){return e.localGeocoderOnly?g:e.reverseGeocode&&p.REVERSE_GEOCODE_COORD_RGX.test(t)?_:m},_setupConfig:function(e,t){const n=/[\s,]+/;var r=this,i=["bbox","limit","proximity","countries","types","language","reverseMode","mode","autocomplete","fuzzyMatch","routing","worldview"].reduce((function(e,t){if(void 0===r.options[t]||null===r.options[t])return e;["countries","types","language"].indexOf(t)>-1?e[t]=r.options[t].split(n):e[t]=r.options[t];const i="number"===typeof r.options[t].longitude&&"number"===typeof r.options[t].latitude;if("proximity"===t&&i){const n=r.options[t].longitude,i=r.options[t].latitude;e[t]=[n,i]}return e}),{});switch(e){case _:var a=t.split(n).map((function(e){return parseFloat(e,10)}));r.options.flipCoordinates||a.reverse(),!i.types||i.types[0],i=o(i,{query:a,limit:1}),["proximity","autocomplete","fuzzyMatch","bbox"].forEach((function(e){e in i&&delete i[e]}));break;case m:{const e=t.trim();/^(-?\d{1,3}(\.\d{0,256})?)[, ]+(-?\d{1,3}(\.\d{0,256})?)?$/.test(e)&&(t=t.replace(/,/g," ")),i=o(i,{query:t})}}return i.session_token=this.eventManager.getSessionId(),i},_geocode:function(e){this.inputString=e,this._showLoadingIcon(),this._eventEmitter.emit("loading",{query:e});const t=this._requestType(this.options,e),n=this._setupConfig(t,e);var r;switch(t){case g:r=Promise.resolve();break;case m:r=this.geocoderService.forwardGeocode(n).send();break;case _:r=this.geocoderService.reverseGeocode(n).send()}var i=this.options.localGeocoder&&this.options.localGeocoder(e)||[],o=[],a=null;return r.catch(function(e){a=e}.bind(this)).then(function(t){this._hideLoadingIcon();var r={};return t?"200"==t.statusCode&&((r=t.body).request=t.request,r.headers=t.headers,this._headers=t.headers):r={type:"FeatureCollection",features:[]},r.config=n,this.fresh&&(this.eventManager.start(this),this.fresh=!1),r.features&&r.features.length&&r.features.map((function(e){e._source="mapbox"})),r.features=r.features?i.concat(r.features):i,this.options.externalGeocoder?(o=this.options.externalGeocoder(e,r.features)||Promise.resolve([])).then((function(e){return r.features=r.features?e.concat(r.features):e,r}),(function(){return r})):r}.bind(this)).then(function(e){if(a)throw a;this.options.filter&&e.features.length&&(e.features=e.features.filter(this.options.filter)),e.features.length?(this._showClearButton(),this._hideGeolocateButton(),this._showAttribution(),this._eventEmitter.emit("results",e),this._typeahead.update(e.features)):(this._hideClearButton(),this._hideAttribution(),this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit("results",e))}.bind(this)).catch(function(e){this._hideLoadingIcon(),this._hideAttribution(),i.length&&this.options.localGeocoder||o.length&&this.options.externalGeocoder?(this._showClearButton(),this._hideGeolocateButton(),this._typeahead.update(i)):(this._hideClearButton(),this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit("results",{features:i}),this._eventEmitter.emit("error",{error:e})}.bind(this)),r},_clear:function(e){e&&e.preventDefault(),this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this.eventManager.sessionIncrementer++,this._onChange(),this._hideClearButton(),this._showGeolocateButton(),this._removeMarker(),this.lastSelected=null,this._eventEmitter.emit("clear"),this.fresh=!0},clear:function(e){this._clear(e),this._inputEl.focus()},_clearOnBlur:function(e){e.relatedTarget&&this._clear(e)},_onQueryResult:function(e){var t=e.body;if(t.features.length){var n=t.features[0];this._typeahead.selected=n,this._inputEl.value=n.place_name,this._onChange()}},_updateProximity:function(){if(this._map&&this.options.trackProximity)if(this._map.getZoom()>9){var e=this._map.getCenter().wrap();this.setProximity({longitude:e.lng,latitude:e.lat},!1)}else this.setProximity(null,!1)},_collapse:function(){this._inputEl.value||this._inputEl===document.activeElement||this.container.classList.add("mapboxgl-ctrl-geocoder--collapsed")},_unCollapse:function(){this.container.classList.remove("mapboxgl-ctrl-geocoder--collapsed")},query:function(e){return this._geocode(e).then(this._onQueryResult),this},_renderError:function(){this._renderMessage("
There was an error reaching the server
")},_renderLocationError:function(){this._renderMessage("
A location error has occurred
")},_renderNoResults:function(){this._renderMessage("
No results found
")},_renderUserDeniedGeolocationError:function(){this._renderMessage("
Geolocation permission denied
")},_renderMessage:function(e){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(e)},_getPlaceholderText:function(){if(this.options.placeholder)return this.options.placeholder;if(this.options.language){var e=this.options.language.split(",")[0],t=d.language(e),n=h.placeholder[t];if(n)return n}return"Search"},setInput:function(e,t){return void 0===t&&(t=!1),this._inputEl.value=e,this._typeahead.selected=null,this._typeahead.clear(),e.length>=this.options.minLength&&(t?this._geocode(e):this._onChange()),this},setProximity:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.options.proximity=e,t&&(this.options.trackProximity=!1),this},getProximity:function(){return this.options.proximity},setRenderFunction:function(e){return e&&"function"==typeof e&&(this._typeahead.render=e),this},getRenderFunction:function(){return this._typeahead.render},setLanguage:function(e){var t=navigator.language||navigator.userLanguage||navigator.browserLanguage;return this.options.language=e||this.options.language||t,this},getLanguage:function(){return this.options.language},getZoom:function(){return this.options.zoom},setZoom:function(e){return this.options.zoom=e,this},getFlyTo:function(){return this.options.flyTo},setFlyTo:function(e){return this.options.flyTo=e,this},getPlaceholder:function(){return this.options.placeholder},setPlaceholder:function(e){return this.options.placeholder=e||this._getPlaceholderText(),this._inputEl.placeholder=this.options.placeholder,this._inputEl.setAttribute("aria-label",this.options.placeholder),this},getBbox:function(){return this.options.bbox},setBbox:function(e){return this.options.bbox=e,this},getCountries:function(){return this.options.countries},setCountries:function(e){return this.options.countries=e,this},getTypes:function(){return this.options.types},setTypes:function(e){return this.options.types=e,this},getMinLength:function(){return this.options.minLength},setMinLength:function(e){return this.options.minLength=e,this._typeahead&&(this._typeahead.options.minLength=e),this},getLimit:function(){return this.options.limit},setLimit:function(e){return this.options.limit=e,this._typeahead&&(this._typeahead.options.limit=e),this},getFilter:function(){return this.options.filter},setFilter:function(e){return this.options.filter=e,this},setOrigin:function(e){return this.options.origin=e,this.geocoderService=c(l({accessToken:this.options.accessToken,origin:this.options.origin})),this},getOrigin:function(){return this.options.origin},setAccessToken:function(e){return this.options.accessToken=e,this.geocoderService=c(l({accessToken:this.options.accessToken,origin:this.options.origin})),this},setAutocomplete:function(e){return this.options.autocomplete=e,this},getAutocomplete:function(){return this.options.autocomplete},setFuzzyMatch:function(e){return this.options.fuzzyMatch=e,this},getFuzzyMatch:function(){return this.options.fuzzyMatch},setRouting:function(e){return this.options.routing=e,this},getRouting:function(){return this.options.routing},setWorldview:function(e){return this.options.worldview=e,this},getWorldview:function(){return this.options.worldview},_handleMarker:function(e){if(this._map){this._removeMarker();var t=o({},{color:"#4668F2"},this.options.marker);return this.mapMarker=new this._mapboxgl.Marker(t),e.center?this.mapMarker.setLngLat(e.center).addTo(this._map):e.geometry&&e.geometry.type&&"Point"===e.geometry.type&&e.geometry.coordinates&&this.mapMarker.setLngLat(e.geometry.coordinates).addTo(this._map),this}},_removeMarker:function(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)},on:function(e,t){return this._eventEmitter.on(e,t),this},off:function(e,t){return this._eventEmitter.removeListener(e,t),this.eventManager.remove(),this}},e.exports=y},6397:e=>{"use strict";e.exports={placeholder:{de:"Suche",it:"Ricerca",en:"Search",nl:"Zoeken",fr:"Chercher",ca:"Cerca",he:"\u05dc\u05d7\u05e4\u05e9",ja:"\u30b5\u30fc\u30c1",lv:"Mekl\u0113t",pt:"Procurar",sr:"\u041f\u0440\u0435\u0442\u0440\u0430\u0433\u0430",zh:"\u641c\u7d22",cs:"Vyhled\xe1v\xe1n\xed",hu:"Keres\xe9s",ka:"\u10eb\u10d8\u10d4\u10d1\u10d0",nb:"S\xf8ke",sk:"Vyh\u013ead\xe1vanie",th:"\u0e04\u0e49\u0e19\u0e2b\u0e32",fi:"Hae",is:"Leita",ko:"\uc218\uc0c9",pl:"Szukaj",sl:"Iskanje",fa:"\u062c\u0633\u062a\u062c\u0648",ru:"\u041f\u043e\u0438\u0441\u043a"}}},7651:e=>{function t(e){const t=e.address||"",n=e.text||"",r=e.place_name||"",i={address:r.split(",")[0],houseNumber:t,street:n,placeName:r};return e.context.forEach((function(e){const t=e.id.split(".")[0];i[t]=e.text})),i}e.exports={transformFeatureToGeolocationText:function(e,n){const r=t(e),i=["address","street","place","country"];if("function"===typeof n)return n(r);const o=i.indexOf(n);return(-1===o?i:i.slice(o)).reduce((function(e,t){return r[t]?(""!==e&&(e+=", "),e+r[t]):e}),"")},getAddressInfo:t,REVERSE_GEOCODE_COORD_RGX:/^[ ]*(-?\d{1,3}(\.\d{0,256})?)[, ]+(-?\d{1,3}(\.\d{0,256})?)[ ]*$/}},7050:(e,t,n)=>{"use strict";var r=n(6537);e.exports=r},6537:(e,t,n)=>{"use strict";var r=n(3465),i=n(4690);function o(e){i.call(this,e)}o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.prototype.sendRequest=r.browserSend,o.prototype.abortRequest=r.browserAbort,e.exports=function(e){return new o(e)}},3465:(e,t,n)=>{"use strict";var r=n(6238),i=n(7227),o=n(3487),a=n(3104),s={};function l(e){var t=e.total,n=e.loaded;return{total:t,transferred:n,percent:100*n/t}}function c(e,t){return new Promise((function(n,r){t.onprogress=function(t){e.emitter.emit(o.EVENT_PROGRESS_DOWNLOAD,l(t))};var a=e.file;a&&(t.upload.onprogress=function(t){e.emitter.emit(o.EVENT_PROGRESS_UPLOAD,l(t))}),t.onerror=function(e){r(e)},t.onabort=function(){var t=new i({request:e,type:o.ERROR_REQUEST_ABORTED});r(t)},t.onload=function(){if(delete s[e.id],t.status<200||t.status>=400){var o=new i({request:e,body:t.response,statusCode:t.status});r(o)}else n(t)};var c=e.body;"string"===typeof c?t.send(c):c?t.send(JSON.stringify(c)):a?t.send(a):t.send(),s[e.id]=t})).then((function(t){return function(e,t){return new r(e,{body:t.response,headers:a(t.getAllResponseHeaders()),statusCode:t.status})}(e,t)}))}function u(e,t){var n=e.url(t),r=new window.XMLHttpRequest;return r.open(e.method,n),Object.keys(e.headers).forEach((function(t){r.setRequestHeader(t,e.headers[t])})),r}e.exports={browserAbort:function(e){var t=s[e.id];t&&(t.abort(),delete s[e.id])},sendRequestXhr:c,browserSend:function(e){return Promise.resolve().then((function(){var t=u(e,e.client.accessToken);return c(e,t)}))},createRequestXhr:u}},4690:(e,t,n)=>{"use strict";var r=n(9229),i=n(3868),o=n(3487);function a(e){if(!e||!e.accessToken)throw new Error("Cannot create a client without an access token");r(e.accessToken),this.accessToken=e.accessToken,this.origin=e.origin||o.API_ORIGIN}a.prototype.createRequest=function(e){return new i(this,e)},e.exports=a},7227:(e,t,n)=>{"use strict";var r=n(3487);e.exports=function(e){var t,n=e.type||r.ERROR_HTTP;if(e.body)try{t=JSON.parse(e.body)}catch(o){t=e.body}else t=null;var i=e.message||null;i||("string"===typeof t?i=t:t&&"string"===typeof t.message?i=t.message:n===r.ERROR_REQUEST_ABORTED&&(i="Request aborted")),this.message=i,this.type=n,this.statusCode=e.statusCode||null,this.request=e.request,this.body=t}},3868:(e,t,n)=>{"use strict";var r=n(9229),i=n(49),o=n(7283),a=n(5141),s=n(3487),l=1;function c(e,t){if(!e)throw new Error("MapiRequest requires a client");if(!t||!t.path||!t.method)throw new Error("MapiRequest requires an options object with path and method properties");var n={};t.body&&(n["content-type"]="application/json");var r=i(n,t.headers),a=Object.keys(r).reduce((function(e,t){return e[t.toLowerCase()]=r[t],e}),{});this.id=l++,this._options=t,this.emitter=new o,this.client=e,this.response=null,this.error=null,this.sent=!1,this.aborted=!1,this.path=t.path,this.method=t.method,this.origin=t.origin||e.origin,this.query=t.query||{},this.params=t.params||{},this.body=t.body||null,this.file=t.file||null,this.encoding=t.encoding||"utf8",this.sendFileAs=t.sendFileAs||null,this.headers=a}c.prototype.url=function(e){var t=a.prependOrigin(this.path,this.origin);t=a.appendQueryObject(t,this.query);var n=this.params,o=null==e?this.client.accessToken:e;if(o){t=a.appendQueryParam(t,"access_token",o);var s=r(o).user;n=i({ownerId:s},n)}return t=a.interpolateRouteParams(t,n),t},c.prototype.send=function(){var e=this;if(e.sent)throw new Error("This request has already been sent. Check the response and error properties. Create a new request with clone().");return e.sent=!0,e.client.sendRequest(e).then((function(t){return e.response=t,e.emitter.emit(s.EVENT_RESPONSE,t),t}),(function(t){throw e.error=t,e.emitter.emit(s.EVENT_ERROR,t),t}))},c.prototype.abort=function(){this._nextPageRequest&&(this._nextPageRequest.abort(),delete this._nextPageRequest),this.response||this.error||this.aborted||(this.aborted=!0,this.client.abortRequest(this))},c.prototype.eachPage=function(e){var t=this;function n(n){e(null,n,(function(){delete t._nextPageRequest;var e=n.nextPage();e&&(t._nextPageRequest=e,i(e))}))}function r(t){e(t,null,(function(){}))}function i(e){e.send().then(n,r)}i(this)},c.prototype.clone=function(){return this._extend()},c.prototype._extend=function(e){var t=i(this._options,e);return new c(this.client,t)},e.exports=c},6238:(e,t,n)=>{"use strict";var r=n(7484);function i(e,t){this.request=e,this.headers=t.headers,this.rawBody=t.body,this.statusCode=t.statusCode;try{this.body=JSON.parse(t.body||"{}")}catch(n){this.body=t.body}this.links=r(this.headers.link)}i.prototype.hasNextPage=function(){return!!this.links.next},i.prototype.nextPage=function(){return this.hasNextPage()?this.request._extend({path:this.links.next.url}):null},e.exports=i},3487:e=>{"use strict";e.exports={API_ORIGIN:"https://api.mapbox.com",EVENT_PROGRESS_DOWNLOAD:"downloadProgress",EVENT_PROGRESS_UPLOAD:"uploadProgress",EVENT_ERROR:"error",EVENT_RESPONSE:"response",ERROR_HTTP:"HttpError",ERROR_REQUEST_ABORTED:"RequestAbortedError"}},3104:e=>{"use strict";e.exports=function(e){var t={};return e?(e.trim().split(/[\r|\n]+/).forEach((function(e){var n=function(e){var t=e.indexOf(":");return{name:e.substring(0,t).trim().toLowerCase(),value:e.substring(t+1).trim()}}(e);t[n.name]=n.value})),t):t}},7484:e=>{"use strict";e.exports=function(e){return e?e.split(/,\s*]*)>(.*)/);if(!t)return null;var n=t[1],r=t[2].split(";"),i=null,o=r.reduce((function(e,t){var n=function(e){var t=e.match(/\s*(.+)\s*=\s*"?([^"]+)"?/);return t?{key:t[1],value:t[2]}:null}(t);return n?"rel"===n.key?(i||(i=n.value),e):(e[n.key]=n.value,e):e}),{});return i?{url:n,rel:i,params:o}:null}(t);return n?(n.rel.split(/\s+/).forEach((function(t){e[t]||(e[t]={url:n.url,params:n.params})})),e):e}),{}):{}}},5141:e=>{"use strict";function t(e){return Array.isArray(e)?e.map(encodeURIComponent).join(","):encodeURIComponent(String(e))}function n(e,n,r){if(!1===r||null===r)return e;var i=/\?/.test(e)?"&":"?",o=encodeURIComponent(n);return void 0!==r&&""!==r&&!0!==r&&(o+="="+t(r)),""+e+i+o}e.exports={appendQueryObject:function(e,t){if(!t)return e;var r=e;return Object.keys(t).forEach((function(e){var i=t[e];void 0!==i&&(Array.isArray(i)&&(i=i.filter((function(e){return null!==e&&void 0!==e})).join(",")),r=n(r,e,i))})),r},appendQueryParam:n,prependOrigin:function(e,t){if(!t)return e;if("http"===e.slice(0,4))return e;var n="/"===e[0]?"":"/";return""+t.replace(/\/$/,"")+n+e},interpolateRouteParams:function(e,n){return n?e.replace(/\/:([a-zA-Z0-9]+)/g,(function(e,r){var i=n[r];if(void 0===i)throw new Error("Unspecified route parameter "+r);return"/"+t(i)})):e}}},4012:(e,t,n)=>{"use strict";var r=n(49),i=n(5217),o=n(7594),a=n(2522),s=n(682),l={},c=["country","region","postcode","district","place","locality","neighborhood","address","poi","poi.landmark"];l.forwardGeocode=function(e){i.assertShape({query:i.required(i.string),mode:i.oneOf("mapbox.places","mapbox.places-permanent"),countries:i.arrayOf(i.string),proximity:i.oneOf(i.coordinates,"ip"),types:i.arrayOf(i.oneOf(c)),autocomplete:i.boolean,bbox:i.arrayOf(i.number),limit:i.number,language:i.arrayOf(i.string),routing:i.boolean,fuzzyMatch:i.boolean,worldview:i.string,session_token:i.string})(e),e.mode=e.mode||"mapbox.places";var t=a(r({country:e.countries},o(e,["proximity","types","autocomplete","bbox","limit","language","routing","fuzzyMatch","worldview","session_token"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:o(e,["mode","query"]),query:t})},l.reverseGeocode=function(e){i.assertShape({query:i.required(i.coordinates),mode:i.oneOf("mapbox.places","mapbox.places-permanent"),countries:i.arrayOf(i.string),types:i.arrayOf(i.oneOf(c)),bbox:i.arrayOf(i.number),limit:i.number,language:i.arrayOf(i.string),reverseMode:i.oneOf("distance","score"),routing:i.boolean,worldview:i.string,session_token:i.string})(e),e.mode=e.mode||"mapbox.places";var t=a(r({country:e.countries},o(e,["country","types","bbox","limit","language","reverseMode","routing","worldview","session_token"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:o(e,["mode","query"]),query:t})},e.exports=s(l)},682:(e,t,n)=>{"use strict";var r=n(4690),i=n(6537);e.exports=function(e){return function(t){var n;n=r.prototype.isPrototypeOf(t)?t:i(t);var o=Object.create(e);return o.client=n,o}}},743:e=>{"use strict";e.exports=function(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=t(r,e[r]),n}),{})}},7594:e=>{"use strict";e.exports=function(e,t){var n=function(e,n){return-1!==t.indexOf(e)&&void 0!==n};return"function"===typeof t&&(n=t),Object.keys(e).filter((function(t){return n(t,e[t])})).reduce((function(t,n){return t[n]=e[n],t}),{})}},2522:(e,t,n)=>{"use strict";var r=n(743);e.exports=function(e){return r(e,(function(e,t){return"boolean"===typeof t?JSON.stringify(t):t}))}},5217:(e,t,n)=>{"use strict";var r=n(49),i=n(6366);e.exports=r(i,{file:function(e){if("undefined"!==typeof window){if(e instanceof n.g.Blob||e instanceof n.g.ArrayBuffer)return;return"Blob or ArrayBuffer"}if("string"!==typeof e&&void 0===e.pipe)return"Filename or Readable stream"},date:function(e){var t="date";if("boolean"===typeof e)return t;try{var n=new Date(e);if(n.getTime&&isNaN(n.getTime()))return t}catch(r){return t}},coordinates:function(e){return i.tuple(i.number,i.number)(e)},assertShape:function(e,t){return i.assert(i.strictShape(e),t)}})},9229:(e,t,n)=>{"use strict";var r=n(2511),i={};function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e){if(i[e])return i[e];var t=e.split("."),n=t[0],a=t[1];if(!a)throw new Error("Invalid token");var s=function(e){try{return JSON.parse(r.decode(e))}catch(t){throw new Error("Invalid token")}}(a),l={usage:n,user:s.u};return o(s,"a")&&(l.authorization=s.a),o(s,"exp")&&(l.expires=1e3*s.exp),o(s,"iat")&&(l.created=1e3*s.iat),o(s,"scopes")&&(l.scopes=s.scopes),o(s,"client")&&(l.client=s.client),o(s,"ll")&&(l.lastLogin=s.ll),o(s,"iu")&&(l.impersonator=s.iu),i[e]=l,l}},4802:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var i=r(n(39)),o=n(579);t.A=(0,i.default)((0,o.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close")},6061:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var i=r(n(39)),o=n(579);t.A=(0,i.default)((0,o.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator")},2462:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var i=r(n(39)),o=n(579);t.A=(0,i.default)((0,o.jsx)("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z"}),"Layers")},8082:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var i=r(n(39)),o=n(579);t.A=(0,i.default)((0,o.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert")},2577:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var i=r(n(39)),o=n(579);t.A=(0,i.default)((0,o.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings")},5624:(e,t,n)=>{"use strict";var r=n(4994);t.A=void 0;var i=r(n(39)),o=n(579);t.A=(0,i.default)([(0,o.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"},"0"),(0,o.jsx)("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2z"},"1")],"ZoomIn")},39:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(1100)},8206:(e,t,n)=>{"use strict";n.d(t,{b:()=>i});n(5043);var r=n(3654);n(579);function i(e){return(0,r.b)(e)}},7470:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"}},3623:(e,t,n)=>{"use strict";n.d(t,{A:()=>N});var r=n(8168),i=n(8587),o=n(7868),a=n(9172),s=n(7758),l=n(8812),c=n(8280);var u=n(7266);const h={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},f={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},p={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"};var g=n(7470);const _={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},y={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},v=["mode","contrastThreshold","tonalOffset"],x={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:h.white,default:h.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},b={text:{primary:h.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:h.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function w(e,t,n,r){const i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,u.a)(e.main,i):"dark"===t&&(e.dark=(0,u.e$)(e.main,o)))}function S(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:s=.2}=e,l=(0,i.A)(e,v),c=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:g.A[200],light:g.A[50],dark:g.A[400]}:{main:g.A[700],light:g.A[400],dark:g.A[800]}}(t),S=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:f[200],light:f[50],dark:f[400]}:{main:f[500],light:f[300],dark:f[700]}}(t),M=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:p[500],light:p[300],dark:p[700]}:{main:p[700],light:p[400],dark:p[800]}}(t),A=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:_[400],light:_[300],dark:_[700]}:{main:_[700],light:_[500],dark:_[900]}}(t),E=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:y[400],light:y[300],dark:y[700]}:{main:y[800],light:y[500],dark:y[900]}}(t),T=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m[400],light:m[300],dark:m[700]}:{main:"#ed6c02",light:m[500],dark:m[900]}}(t);function C(e){return(0,u.eM)(e,b.text.primary)>=n?b.text.primary:x.text.primary}const k=e=>{let{color:t,name:n,mainShade:i=500,lightShade:a=300,darkShade:l=700}=e;if(t=(0,r.A)({},t),!t.main&&t[i]&&(t.main=t[i]),!t.hasOwnProperty("main"))throw new Error((0,o.A)(11,n?` (${n})`:"",i));if("string"!==typeof t.main)throw new Error((0,o.A)(12,n?` (${n})`:"",JSON.stringify(t.main)));return w(t,"light",a,s),w(t,"dark",l,s),t.contrastText||(t.contrastText=C(t.main)),t},I={dark:b,light:x};return(0,a.A)((0,r.A)({common:(0,r.A)({},h),mode:t,primary:k({color:c,name:"primary"}),secondary:k({color:S,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:k({color:M,name:"error"}),warning:k({color:T,name:"warning"}),info:k({color:A,name:"info"}),success:k({color:E,name:"success"}),grey:d,contrastThreshold:n,getContrastText:C,augmentColor:k,tonalOffset:s},I[t]),l)}const M=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];const A={textTransform:"uppercase"},E='"Roboto", "Helvetica", "Arial", sans-serif';function T(e,t){const n="function"===typeof t?t(e):t,{fontFamily:o=E,fontSize:s=14,fontWeightLight:l=300,fontWeightRegular:c=400,fontWeightMedium:u=500,fontWeightBold:h=700,htmlFontSize:d=16,allVariants:f,pxToRem:p}=n,m=(0,i.A)(n,M);const g=s/14,_=p||(e=>e/d*g+"rem"),y=(e,t,n,i,a)=>{return(0,r.A)({fontFamily:o,fontWeight:e,fontSize:_(t),lineHeight:n},o===E?{letterSpacing:(s=i/t,Math.round(1e5*s)/1e5)+"em"}:{},a,f);var s},v={h1:y(l,96,1.167,-1.5),h2:y(l,60,1.2,-.5),h3:y(c,48,1.167,0),h4:y(c,34,1.235,.25),h5:y(c,24,1.334,0),h6:y(u,20,1.6,.15),subtitle1:y(c,16,1.75,.15),subtitle2:y(u,14,1.57,.1),body1:y(c,16,1.5,.15),body2:y(c,14,1.43,.15),button:y(u,14,1.75,.4,A),caption:y(c,12,1.66,.4),overline:y(c,12,2.66,1,A),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,a.A)((0,r.A)({htmlFontSize:d,pxToRem:_,fontFamily:o,fontSize:s,fontWeightLight:l,fontWeightRegular:c,fontWeightMedium:u,fontWeightBold:h},v),m,{clone:!1})}function C(){return[`${arguments.length<=0?void 0:arguments[0]}px ${arguments.length<=1?void 0:arguments[1]}px ${arguments.length<=2?void 0:arguments[2]}px ${arguments.length<=3?void 0:arguments[3]}px rgba(0,0,0,0.2)`,`${arguments.length<=4?void 0:arguments[4]}px ${arguments.length<=5?void 0:arguments[5]}px ${arguments.length<=6?void 0:arguments[6]}px ${arguments.length<=7?void 0:arguments[7]}px rgba(0,0,0,0.14)`,`${arguments.length<=8?void 0:arguments[8]}px ${arguments.length<=9?void 0:arguments[9]}px ${arguments.length<=10?void 0:arguments[10]}px ${arguments.length<=11?void 0:arguments[11]}px rgba(0,0,0,0.12)`].join(",")}const k=["none",C(0,2,1,-1,0,1,1,0,0,1,3,0),C(0,3,1,-2,0,2,2,0,0,1,5,0),C(0,3,3,-2,0,3,4,0,0,1,8,0),C(0,2,4,-1,0,4,5,0,0,1,10,0),C(0,3,5,-1,0,5,8,0,0,1,14,0),C(0,3,5,-1,0,6,10,0,0,1,18,0),C(0,4,5,-2,0,7,10,1,0,2,16,1),C(0,5,5,-3,0,8,10,1,0,3,14,2),C(0,5,6,-3,0,9,12,1,0,3,16,2),C(0,6,6,-3,0,10,14,1,0,4,18,3),C(0,6,7,-4,0,11,15,1,0,4,20,3),C(0,7,8,-4,0,12,17,2,0,5,22,4),C(0,7,8,-4,0,13,19,2,0,5,24,4),C(0,7,9,-4,0,14,21,2,0,5,26,4),C(0,8,9,-5,0,15,22,2,0,6,28,5),C(0,8,10,-5,0,16,24,2,0,6,30,5),C(0,8,11,-5,0,17,26,2,0,6,32,5),C(0,9,11,-5,0,18,28,2,0,7,34,6),C(0,9,12,-6,0,19,29,2,0,7,36,6),C(0,10,13,-6,0,20,31,3,0,8,38,7),C(0,10,13,-6,0,21,33,3,0,8,40,7),C(0,10,14,-6,0,22,35,3,0,8,42,7),C(0,11,14,-7,0,23,36,3,0,9,44,8),C(0,11,15,-7,0,24,38,3,0,9,46,8)],I=["duration","easing","delay"],P={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},R={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function L(e){return`${Math.round(e)}ms`}function z(e){if(!e)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function D(e){const t=(0,r.A)({},P,e.easing),n=(0,r.A)({},R,e.duration);return(0,r.A)({getAutoHeightDuration:z,create:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{duration:o=n.standard,easing:a=t.easeInOut,delay:s=0}=r;(0,i.A)(r,I);return(Array.isArray(e)?e:[e]).map((e=>`${e} ${"string"===typeof o?o:L(o)} ${a} ${"string"===typeof s?s:L(s)}`)).join(",")}},e,{easing:t,duration:n})}const O={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},F=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function B(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{mixins:t={},palette:n={},transitions:u={},typography:h={}}=e,d=(0,i.A)(e,F);if(e.vars)throw new Error((0,o.A)(18));const f=S(n),p=(0,c.A)(e);let m=(0,a.A)(p,{mixins:(g=p.breakpoints,_=t,(0,r.A)({toolbar:{minHeight:56,[g.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[g.up("sm")]:{minHeight:64}}},_)),palette:f,shadows:k.slice(),typography:T(f,h),transitions:D(u),zIndex:(0,r.A)({},O)});var g,_;m=(0,a.A)(m,d);for(var y=arguments.length,v=new Array(y>1?y-1:0),x=1;x(0,a.A)(e,t)),m),m.unstable_sxConfig=(0,r.A)({},s.A,null==d?void 0:d.unstable_sxConfig),m.unstable_sx=function(e){return(0,l.A)({sx:e,theme:this})},m}const N=B},5170:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=(0,n(3623).A)()},3375:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r="$$material"},1475:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(7123);const i=e=>(0,r.A)(e)&&"classes"!==e},7123:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}},4535:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>s});var r=n(8052),i=n(5170),o=n(3375),a=n(1475);const s=(0,r.Ay)({themeId:o.A,defaultTheme:i.A,rootShouldForwardProp:a.A})},6803:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(7598).A},9662:(e,t,n)=>{"use strict";n.d(t,{A:()=>v});var r=n(8168),i=n(5043),o=n(8587),a=n(8387),s=n(8610),l=n(6803),c=n(8206),u=n(4535),h=n(2532),d=n(2372);function f(e){return(0,d.Ay)("MuiSvgIcon",e)}(0,h.A)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var p=n(579);const m=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],g=(0,u.Ay)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${(0,l.A)(n.color)}`],t[`fontSize${(0,l.A)(n.fontSize)}`]]}})((e=>{let{theme:t,ownerState:n}=e;var r,i,o,a,s,l,c,u,h,d,f,p,m;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:n.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(r=t.transitions)||null==(i=r.create)?void 0:i.call(r,"fill",{duration:null==(o=t.transitions)||null==(o=o.duration)?void 0:o.shorter}),fontSize:{inherit:"inherit",small:(null==(a=t.typography)||null==(s=a.pxToRem)?void 0:s.call(a,20))||"1.25rem",medium:(null==(l=t.typography)||null==(c=l.pxToRem)?void 0:c.call(l,24))||"1.5rem",large:(null==(u=t.typography)||null==(h=u.pxToRem)?void 0:h.call(u,35))||"2.1875rem"}[n.fontSize],color:null!=(d=null==(f=(t.vars||t).palette)||null==(f=f[n.color])?void 0:f.main)?d:{action:null==(p=(t.vars||t).palette)||null==(p=p.action)?void 0:p.active,disabled:null==(m=(t.vars||t).palette)||null==(m=m.action)?void 0:m.disabled,inherit:void 0}[n.color]}})),_=i.forwardRef((function(e,t){const n=(0,c.b)({props:e,name:"MuiSvgIcon"}),{children:u,className:h,color:d="inherit",component:_="svg",fontSize:y="medium",htmlColor:v,inheritViewBox:x=!1,titleAccess:b,viewBox:w="0 0 24 24"}=n,S=(0,o.A)(n,m),M=i.isValidElement(u)&&"svg"===u.type,A=(0,r.A)({},n,{color:d,component:_,fontSize:y,instanceFontSize:e.fontSize,inheritViewBox:x,viewBox:w,hasSvgAsChild:M}),E={};x||(E.viewBox=w);const T=(e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root","inherit"!==t&&`color${(0,l.A)(t)}`,`fontSize${(0,l.A)(n)}`]};return(0,s.A)(i,f,r)})(A);return(0,p.jsxs)(g,(0,r.A)({as:_,className:(0,a.A)(T.root,h),focusable:"false",color:v,"aria-hidden":!b||void 0,role:b?"img":void 0,ref:t},E,S,M&&u.props,{ownerState:A,children:[M?u.props.children:u,b?(0,p.jsx)("title",{children:b}):null]}))}));_.muiName="SvgIcon";const y=_;function v(e,t){function n(n,i){return(0,p.jsx)(y,(0,r.A)({"data-testid":`${t}Icon`,ref:i},n,{children:e}))}return n.muiName=y.muiName,i.memo(i.forwardRef(n))}},950:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(3468).A},1100:(e,t,n)=>{"use strict";n.r(t),n.d(t,{capitalize:()=>i.A,createChainedFunction:()=>o,createSvgIcon:()=>a.A,debounce:()=>s.A,deprecatedPropType:()=>l,isMuiElement:()=>c.A,ownerDocument:()=>u.A,ownerWindow:()=>h.A,requirePropFactory:()=>d,setRef:()=>f,unstable_ClassNameGenerator:()=>b,unstable_useEnhancedEffect:()=>p.A,unstable_useId:()=>m,unsupportedProp:()=>g,useControlled:()=>_.A,useEventCallback:()=>y.A,useForkRef:()=>v.A,useIsFocusVisible:()=>x.A});var r=n(9386),i=n(6803);const o=n(2456).A;var a=n(9662),s=n(950);const l=function(e,t){return()=>null};var c=n(7328),u=n(2427),h=n(6078);n(8168);const d=function(e,t){return()=>null};const f=n(6564).A;var p=n(5013);const m=n(5844).A;const g=function(e,t,n,r,i){return null};var _=n(4516),y=n(3319),v=n(5849),x=n(7844);const b={configure:e=>{r.A.configure(e)}}},7328:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(5043);const i=function(e,t){var n,i;return r.isValidElement(e)&&-1!==t.indexOf(null!=(n=e.type.muiName)?n:null==(i=e.type)||null==(i=i._payload)||null==(i=i.value)?void 0:i.muiName)}},2427:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(1668).A},6078:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(3940).A},4516:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(1052).A},5013:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(4440).A},3319:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(1782).A},5849:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(3462).A},7844:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(9640).A},869:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(5043);var r=n(3290),i=n(579);function o(e){const{styles:t,defaultTheme:n={}}=e,o="function"===typeof t?e=>{return t(void 0===(r=e)||null===r||0===Object.keys(r).length?n:e);var r}:t;return(0,i.jsx)(r.mL,{styles:o})}},8131:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GlobalStyles:()=>u.A,StyledEngineProvider:()=>c,ThemeContext:()=>o.T,css:()=>i.AH,default:()=>h,internal_processStyles:()=>d,keyframes:()=>i.i7});var r=n(5903),i=n(3290),o=n(4575),a=(n(5043),n(3803)),s=n(579);let l;function c(e){const{injectFirst:t,children:n}=e;return t&&l?(0,s.jsx)(o.C,{value:l,children:n}):n}"object"===typeof document&&(l=(0,a.A)({key:"css",prepend:!0}));var u=n(869);function h(e,t){return(0,r.A)(e,t)}const d=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}},7266:(e,t,n)=>{"use strict";var r=n(4994);t.X4=f,t.e$=p,t.tL=g,t.eM=function(e,t){const n=d(e),r=d(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},t.a=m;var i=r(n(457)),o=r(n(6531));function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return(0,o.default)(e,t,n)}function s(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map((e=>e+e))),n?`rgb${4===n.length?"a":""}(${n.map(((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3)).join(", ")})`:""}function l(e){if(e.type)return e;if("#"===e.charAt(0))return l(s(e));const t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error((0,i.default)(9,e));let r,o=e.substring(t+1,e.length-1);if("color"===n){if(o=o.split(" "),r=o.shift(),4===o.length&&"/"===o[3].charAt(0)&&(o[3]=o[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(r))throw new Error((0,i.default)(10,r))}else o=o.split(",");return o=o.map((e=>parseFloat(e))),{type:n,values:o,colorSpace:r}}const c=e=>{const t=l(e);return t.values.slice(0,3).map(((e,n)=>-1!==t.type.indexOf("hsl")&&0!==n?`${e}%`:e)).join(" ")};function u(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return-1!==t.indexOf("rgb")?r=r.map(((e,t)=>t<3?parseInt(e,10):e)):-1!==t.indexOf("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=-1!==t.indexOf("color")?`${n} ${r.join(" ")}`:`${r.join(", ")}`,`${t}(${r})`}function h(e){e=l(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)};let s="rgb";const c=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",c.push(t[3])),u({type:s,values:c})}function d(e){let t="hsl"===(e=l(e)).type||"hsla"===e.type?l(h(e)).values:e.values;return t=t.map((t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4))),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function f(e,t){return e=l(e),t=a(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,u(e)}function p(e,t){if(e=l(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return u(e)}function m(e,t){if(e=l(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return u(e)}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return d(e)>.5?p(e,t):m(e,t)}},8052:(e,t,n)=>{"use strict";var r=n(4994);t.Ay=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t,defaultTheme:n=m,rootShouldForwardProp:r=p,slotShouldForwardProp:l=p}=e,u=e=>(0,c.default)((0,i.default)({},e,{theme:_((0,i.default)({},e,{defaultTheme:n,themeId:t}))}));return u.__mui_systemSx=!0,function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,a.internal_processStyles)(e,(e=>e.filter((e=>!(null!=e&&e.__mui_systemSx)))));const{name:h,slot:f,skipVariantsResolver:m,skipSx:x,overridesResolver:b=y(g(f))}=c,w=(0,o.default)(c,d),S=void 0!==m?m:f&&"Root"!==f&&"root"!==f||!1,M=x||!1;let A=p;"Root"===f||"root"===f?A=r:f?A=l:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(A=void 0);const E=(0,a.default)(e,(0,i.default)({shouldForwardProp:A,label:undefined},w)),T=e=>"function"===typeof e&&e.__emotion_real!==e||(0,s.isPlainObject)(e)?r=>v(e,(0,i.default)({},r,{theme:_({theme:r.theme,defaultTheme:n,themeId:t})})):e,C=function(r){let o=T(r);for(var a=arguments.length,s=new Array(a>1?a-1:0),l=1;l{const r=_((0,i.default)({},e,{defaultTheme:n,themeId:t}));if(!r.components||!r.components[h]||!r.components[h].styleOverrides)return null;const o=r.components[h].styleOverrides,a={};return Object.entries(o).forEach((t=>{let[n,o]=t;a[n]=v(o,(0,i.default)({},e,{theme:r}))})),b(e,a)})),h&&!S&&c.push((e=>{var r;const o=_((0,i.default)({},e,{defaultTheme:n,themeId:t}));return v({variants:null==o||null==(r=o.components)||null==(r=r[h])?void 0:r.variants},(0,i.default)({},e,{theme:o}))})),M||c.push(u);const d=c.length-s.length;if(Array.isArray(r)&&d>0){const e=new Array(d).fill("");o=[...r,...e],o.raw=[...r.raw,...e]}const f=E(o,...c);return e.muiName&&(f.muiName=e.muiName),f};return E.withConfig&&(C.withConfig=E.withConfig),C}};var i=r(n(4634)),o=r(n(4893)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(n(8131)),s=n(9482),l=(r(n(7918)),r(n(3382)),r(n(4989))),c=r(n(3234));const u=["ownerState"],h=["variants"],d=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const m=(0,l.default)(),g=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function _(e){let{defaultTheme:t,theme:n,themeId:r}=e;return i=n,0===Object.keys(i).length?t:n[r]||n;var i}function y(e){return e?(t,n)=>n[e]:null}function v(e,t){let{ownerState:n}=t,r=(0,o.default)(t,u);const a="function"===typeof e?e((0,i.default)({ownerState:n},r)):e;if(Array.isArray(a))return a.flatMap((e=>v(e,(0,i.default)({ownerState:n},r))));if(a&&"object"===typeof a&&Array.isArray(a.variants)){const{variants:e=[]}=a;let t=(0,o.default)(a,h);return e.forEach((e=>{let o=!0;"function"===typeof e.props?o=e.props((0,i.default)({ownerState:n},r,n)):Object.keys(e.props).forEach((t=>{(null==n?void 0:n[t])!==e.props[t]&&r[t]!==e.props[t]&&(o=!1)})),o&&(Array.isArray(t)||(t=[t]),t.push("function"===typeof e.style?e.style((0,i.default)({ownerState:n},r,n)):e.style))})),t}return a}},3654:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,b:()=>s});var r=n(5043),i=n(3030),o=n(579);const a=r.createContext(void 0);function s(e){let{props:t,name:n}=e;return function(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const o=t.components[n];return o.defaultProps?(0,i.A)(o.defaultProps,r):o.styleOverrides||o.variants?r:(0,i.A)(o,r)}({props:t,name:n,theme:{components:r.useContext(a)}})}const l=function(e){let{value:t,children:n}=e;return(0,o.jsx)(a.Provider,{value:t,children:n})}},9751:(e,t,n)=>{"use strict";n.d(t,{EU:()=>a,NI:()=>o,vf:()=>s,zu:()=>r});const r={xs:0,sm:600,md:900,lg:1200,xl:1536},i={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${r[e]}px)`};function o(e,t,n){const o=e.theme||{};if(Array.isArray(t)){const e=o.breakpoints||i;return t.reduce(((r,i,o)=>(r[e.up(e.keys[o])]=n(t[o]),r)),{})}if("object"===typeof t){const e=o.breakpoints||i;return Object.keys(t).reduce(((i,o)=>{if(-1!==Object.keys(e.values||r).indexOf(o)){i[e.up(o)]=n(t[o],o)}else{const e=o;i[e]=t[e]}return i}),{})}return n(t)}function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;return(null==(t=e.keys)?void 0:t.reduce(((t,n)=>(t[e.up(n)]={},t)),{}))||{}}function s(e,t){return e.reduce(((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}},9703:(e,t,n)=>{"use strict";function r(e,t){const n=this;if(n.vars&&"function"===typeof n.getColorSchemeSelector){const r=n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)");return{[r]:t}}return n.palette.mode===e?t:{}}n.d(t,{A:()=>r})},4853:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(8587),i=n(8168);const o=["values","unit","step"],a=e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>(0,i.A)({},e,{[t.key]:t.val})),{})};function s(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:s=5}=e,l=(0,r.A)(e,o),c=a(t),u=Object.keys(c);function h(e){return`@media (min-width:${"number"===typeof t[e]?t[e]:e}${n})`}function d(e){return`@media (max-width:${("number"===typeof t[e]?t[e]:e)-s/100}${n})`}function f(e,r){const i=u.indexOf(r);return`@media (min-width:${"number"===typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==i&&"number"===typeof t[u[i]]?t[u[i]]:r)-s/100}${n})`}return(0,i.A)({keys:u,values:c,up:h,down:d,between:f,only:function(e){return u.indexOf(e)+1{"use strict";n.d(t,{A:()=>f});var r=n(8168),i=n(8587),o=n(9172),a=n(4853);const s={borderRadius:4};var l=n(8604);var c=n(8812),u=n(7758),h=n(9703);const d=["breakpoints","palette","spacing","shape"];const f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{breakpoints:t={},palette:n={},spacing:f,shape:p={}}=e,m=(0,i.A)(e,d),g=(0,a.A)(t),_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;const t=(0,l.LX)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r{const n=t(e);return"number"===typeof n?`${n}px`:n})).join(" ")};return n.mui=!0,n}(f);let y=(0,o.A)({breakpoints:g,direction:"ltr",components:{},palette:(0,r.A)({mode:"light"},n),spacing:_,shape:(0,r.A)({},s,p)},m);y.applyStyles=h.A;for(var v=arguments.length,x=new Array(v>1?v-1:0),b=1;b(0,o.A)(e,t)),y),y.unstable_sxConfig=(0,r.A)({},u.A,null==m?void 0:m.unstable_sxConfig),y.unstable_sx=function(e){return(0,c.A)({sx:e,theme:this})},y}},4989:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A,private_createBreakpoints:()=>i.A,unstable_applyStyles:()=>o.A});var r=n(8280),i=n(4853),o=n(9703)},3815:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(9172);const i=function(e,t){return t?(0,r.A)(e,t,{clone:!1}):e}},8604:(e,t,n)=>{"use strict";n.d(t,{LX:()=>p,MA:()=>f,_W:()=>m,Lc:()=>y,Ms:()=>v});var r=n(9751),i=n(7162),o=n(3815);const a={m:"margin",p:"padding"},s={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},l={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},c=function(e){const t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}((e=>{if(e.length>2){if(!l[e])return[e];e=l[e]}const[t,n]=e.split(""),r=a[t],i=s[n]||"";return Array.isArray(i)?i.map((e=>r+e)):[r+i]})),u=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],h=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],d=[...u,...h];function f(e,t,n,r){var o;const a=null!=(o=(0,i.Yn)(e,t,!1))?o:n;return"number"===typeof a?e=>"string"===typeof e?e:a*e:Array.isArray(a)?e=>"string"===typeof e?e:a[e]:"function"===typeof a?a:()=>{}}function p(e){return f(e,"spacing",8)}function m(e,t){if("string"===typeof t||null==t)return t;const n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:`-${n}`}function g(e,t,n,i){if(-1===t.indexOf(n))return null;const o=function(e,t){return n=>e.reduce(((e,r)=>(e[r]=m(t,n),e)),{})}(c(n),i),a=e[n];return(0,r.NI)(e,a,o)}function _(e,t){const n=p(e.theme);return Object.keys(e).map((r=>g(e,t,r,n))).reduce(o.A,{})}function y(e){return _(e,u)}function v(e){return _(e,h)}function x(e){return _(e,d)}y.propTypes={},y.filterProps=u,v.propTypes={},v.filterProps=h,x.propTypes={},x.filterProps=d},7162:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>s,BO:()=>a,Yn:()=>o});var r=n(7598),i=n(9751);function o(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&n){const n=`vars.${t}`.split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),e);if(null!=n)return n}return t.split(".").reduce(((e,t)=>e&&null!=e[t]?e[t]:null),e)}function a(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;return r="function"===typeof e?e(n):Array.isArray(e)?e[n]||i:o(e,n)||i,t&&(r=t(r,i,e)),r}const s=function(e){const{prop:t,cssProperty:n=e.prop,themeKey:s,transform:l}=e,c=e=>{if(null==e[t])return null;const c=e[t],u=o(e.theme,s)||{};return(0,i.NI)(e,c,(e=>{let i=a(u,l,e);return e===i&&"string"===typeof e&&(i=a(u,l,`${t}${"default"===e?"":(0,r.A)(e)}`,e)),!1===n?i:{[n]:i}}))};return c.propTypes={},c.filterProps=[t],c}},7758:(e,t,n)=>{"use strict";n.d(t,{A:()=>z});var r=n(8604),i=n(7162),o=n(3815);const a=function(){for(var e=arguments.length,t=new Array(e),n=0;n(t.filterProps.forEach((n=>{e[n]=t})),e)),{}),i=e=>Object.keys(e).reduce(((t,n)=>r[n]?(0,o.A)(t,r[n](e)):t),{});return i.propTypes={},i.filterProps=t.reduce(((e,t)=>e.concat(t.filterProps)),[]),i};var s=n(9751);function l(e){return"number"!==typeof e?e:`${e}px solid`}function c(e,t){return(0,i.Ay)({prop:e,themeKey:"borders",transform:t})}const u=c("border",l),h=c("borderTop",l),d=c("borderRight",l),f=c("borderBottom",l),p=c("borderLeft",l),m=c("borderColor"),g=c("borderTopColor"),_=c("borderRightColor"),y=c("borderBottomColor"),v=c("borderLeftColor"),x=c("outline",l),b=c("outlineColor"),w=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=(0,r.MA)(e.theme,"shape.borderRadius",4,"borderRadius"),n=e=>({borderRadius:(0,r._W)(t,e)});return(0,s.NI)(e,e.borderRadius,n)}return null};w.propTypes={},w.filterProps=["borderRadius"];a(u,h,d,f,p,m,g,_,y,v,w,x,b);const S=e=>{if(void 0!==e.gap&&null!==e.gap){const t=(0,r.MA)(e.theme,"spacing",8,"gap"),n=e=>({gap:(0,r._W)(t,e)});return(0,s.NI)(e,e.gap,n)}return null};S.propTypes={},S.filterProps=["gap"];const M=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=(0,r.MA)(e.theme,"spacing",8,"columnGap"),n=e=>({columnGap:(0,r._W)(t,e)});return(0,s.NI)(e,e.columnGap,n)}return null};M.propTypes={},M.filterProps=["columnGap"];const A=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=(0,r.MA)(e.theme,"spacing",8,"rowGap"),n=e=>({rowGap:(0,r._W)(t,e)});return(0,s.NI)(e,e.rowGap,n)}return null};A.propTypes={},A.filterProps=["rowGap"];a(S,M,A,(0,i.Ay)({prop:"gridColumn"}),(0,i.Ay)({prop:"gridRow"}),(0,i.Ay)({prop:"gridAutoFlow"}),(0,i.Ay)({prop:"gridAutoColumns"}),(0,i.Ay)({prop:"gridAutoRows"}),(0,i.Ay)({prop:"gridTemplateColumns"}),(0,i.Ay)({prop:"gridTemplateRows"}),(0,i.Ay)({prop:"gridTemplateAreas"}),(0,i.Ay)({prop:"gridArea"}));function E(e,t){return"grey"===t?t:e}a((0,i.Ay)({prop:"color",themeKey:"palette",transform:E}),(0,i.Ay)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:E}),(0,i.Ay)({prop:"backgroundColor",themeKey:"palette",transform:E}));function T(e){return e<=1&&0!==e?100*e+"%":e}const C=(0,i.Ay)({prop:"width",transform:T}),k=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var n,r;const i=(null==(n=e.theme)||null==(n=n.breakpoints)||null==(n=n.values)?void 0:n[t])||s.zu[t];return i?"px"!==(null==(r=e.theme)||null==(r=r.breakpoints)?void 0:r.unit)?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:T(t)}};return(0,s.NI)(e,e.maxWidth,t)}return null};k.filterProps=["maxWidth"];const I=(0,i.Ay)({prop:"minWidth",transform:T}),P=(0,i.Ay)({prop:"height",transform:T}),R=(0,i.Ay)({prop:"maxHeight",transform:T}),L=(0,i.Ay)({prop:"minHeight",transform:T}),z=((0,i.Ay)({prop:"size",cssProperty:"width",transform:T}),(0,i.Ay)({prop:"size",cssProperty:"height",transform:T}),a(C,k,I,P,R,L,(0,i.Ay)({prop:"boxSizing"})),{border:{themeKey:"borders",transform:l},borderTop:{themeKey:"borders",transform:l},borderRight:{themeKey:"borders",transform:l},borderBottom:{themeKey:"borders",transform:l},borderLeft:{themeKey:"borders",transform:l},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:l},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:w},color:{themeKey:"palette",transform:E},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:E},backgroundColor:{themeKey:"palette",transform:E},p:{style:r.Ms},pt:{style:r.Ms},pr:{style:r.Ms},pb:{style:r.Ms},pl:{style:r.Ms},px:{style:r.Ms},py:{style:r.Ms},padding:{style:r.Ms},paddingTop:{style:r.Ms},paddingRight:{style:r.Ms},paddingBottom:{style:r.Ms},paddingLeft:{style:r.Ms},paddingX:{style:r.Ms},paddingY:{style:r.Ms},paddingInline:{style:r.Ms},paddingInlineStart:{style:r.Ms},paddingInlineEnd:{style:r.Ms},paddingBlock:{style:r.Ms},paddingBlockStart:{style:r.Ms},paddingBlockEnd:{style:r.Ms},m:{style:r.Lc},mt:{style:r.Lc},mr:{style:r.Lc},mb:{style:r.Lc},ml:{style:r.Lc},mx:{style:r.Lc},my:{style:r.Lc},margin:{style:r.Lc},marginTop:{style:r.Lc},marginRight:{style:r.Lc},marginBottom:{style:r.Lc},marginLeft:{style:r.Lc},marginX:{style:r.Lc},marginY:{style:r.Lc},marginInline:{style:r.Lc},marginInlineStart:{style:r.Lc},marginInlineEnd:{style:r.Lc},marginBlock:{style:r.Lc},marginBlockStart:{style:r.Lc},marginBlockEnd:{style:r.Lc},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:S},rowGap:{style:A},columnGap:{style:M},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:T},maxWidth:{style:k},minWidth:{transform:T},height:{transform:T},maxHeight:{transform:T},minHeight:{transform:T},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}})},8698:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(8168),i=n(8587),o=n(9172),a=n(7758);const s=["sx"],l=e=>{var t,n;const r={systemProps:{},otherProps:{}},i=null!=(t=null==e||null==(n=e.theme)?void 0:n.unstable_sxConfig)?t:a.A;return Object.keys(e).forEach((t=>{i[t]?r.systemProps[t]=e[t]:r.otherProps[t]=e[t]})),r};function c(e){const{sx:t}=e,n=(0,i.A)(e,s),{systemProps:a,otherProps:c}=l(n);let u;return u=Array.isArray(t)?[a,...t]:"function"===typeof t?function(){const e=t(...arguments);return(0,o.Q)(e)?(0,r.A)({},a,e):a}:(0,r.A)({},a,t),(0,r.A)({},c,{sx:u})}},3234:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A,extendSxProp:()=>i.A,unstable_createStyleFunctionSx:()=>r.k,unstable_defaultSxConfig:()=>o.A});var r=n(8812),i=n(8698),o=n(7758)},8812:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,k:()=>l});var r=n(7598),i=n(3815),o=n(7162),a=n(9751),s=n(7758);function l(){function e(e,t,n,i){const s={[e]:t,theme:n},l=i[e];if(!l)return{[e]:t};const{cssProperty:c=e,themeKey:u,transform:h,style:d}=l;if(null==t)return null;if("typography"===u&&"inherit"===t)return{[e]:t};const f=(0,o.Yn)(n,u)||{};if(d)return d(s);return(0,a.NI)(s,t,(t=>{let n=(0,o.BO)(f,h,t);return t===n&&"string"===typeof t&&(n=(0,o.BO)(f,h,`${e}${"default"===t?"":(0,r.A)(t)}`,t)),!1===c?n:{[c]:n}}))}return function t(n){var r;const{sx:o,theme:l={}}=n||{};if(!o)return null;const c=null!=(r=l.unstable_sxConfig)?r:s.A;function u(n){let r=n;if("function"===typeof n)r=n(l);else if("object"!==typeof n)return n;if(!r)return null;const o=(0,a.EU)(l.breakpoints),s=Object.keys(o);let u=o;return Object.keys(r).forEach((n=>{const o=(s=r[n],h=l,"function"===typeof s?s(h):s);var s,h;if(null!==o&&void 0!==o)if("object"===typeof o)if(c[n])u=(0,i.A)(u,e(n,o,l,c));else{const e=(0,a.NI)({theme:l},o,(e=>({[n]:e})));!function(){for(var e=arguments.length,t=new Array(e),n=0;ne.concat(Object.keys(t))),[]),i=new Set(r);return t.every((e=>i.size===Object.keys(e).length))}(e,o)?u=(0,i.A)(u,e):u[n]=t({sx:o,theme:l})}else u=(0,i.A)(u,e(n,o,l,c))})),(0,a.vf)(s,u)}return Array.isArray(o)?o.map(u):u(o)}}const c=l();c.filterProps=["sx"];const u=c},9386:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});const r=e=>e,i=(()=>{let e=r;return{configure(t){e=t},generate:t=>e(t),reset(){e=r}}})()},7598:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(7868);function i(e){if("string"!==typeof e)throw new Error((0,r.A)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},7918:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A});var r=n(7598)},1188:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MIN_SAFE_INTEGER,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.max(t,Math.min(e,n))}},6531:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A});var r=n(1188)},8610:(e,t,n)=>{"use strict";function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const r={};return Object.keys(e).forEach((i=>{r[i]=e[i].reduce(((e,r)=>{if(r){const i=t(r);""!==i&&e.push(i),n&&n[r]&&e.push(n[r])}return e}),[]).join(" ")})),r}n.d(t,{A:()=>r})},2456:(e,t,n)=>{"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;nnull==t?e:function(){for(var n=arguments.length,r=new Array(n),i=0;i{}))}n.d(t,{A:()=>r})},3468:(e,t,n)=>{"use strict";function r(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;o{e.apply(this,i)}),n)}return r.clear=()=>{clearTimeout(t)},r}n.d(t,{A:()=>r})},9172:(e,t,n)=>{"use strict";n.d(t,{A:()=>a,Q:()=>i});var r=n(8168);function i(e){if("object"!==typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function o(e){if(!i(e))return e;const t={};return Object.keys(e).forEach((n=>{t[n]=o(e[n])})),t}function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0};const s=n.clone?(0,r.A)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((r=>{i(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&i(e[r])?s[r]=a(e[r],t[r],n):n.clone?s[r]=i(t[r])?o(t[r]):t[r]:s[r]=t[r]})),s}},9482:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A,isPlainObject:()=>r.Q});var r=n(9172)},7868:(e,t,n)=>{"use strict";function r(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;nr})},457:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A});var r=n(7868)},2372:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>o});var r=n(9386);const i={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function o(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const o=i[t];return o?`${n}-${o}`:`${r.A.generate(e)}-${t}`}},2532:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2372);function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const i={};return t.forEach((t=>{i[t]=(0,r.Ay)(e,t,n)})),i}},3382:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l,getFunctionName:()=>o});var r=n(2086);const i=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function o(e){const t=`${e}`.match(i);return t&&t[1]||""}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.displayName||e.name||o(e)||t}function s(e,t,n){const r=a(t);return e.displayName||(""!==r?`${n}(${r})`:n)}function l(e){if(null!=e){if("string"===typeof e)return e;if("function"===typeof e)return a(e,"Component");if("object"===typeof e)switch(e.$$typeof){case r.ForwardRef:return s(e,e.render,"ForwardRef");case r.Memo:return s(e,e.type,"memo");default:return}}}},1668:(e,t,n)=>{"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{A:()=>r})},3940:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(1668);function i(e){return(0,r.A)(e).defaultView||window}},3030:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(8168);function i(e,t){const n=(0,r.A)({},t);return Object.keys(e).forEach((o=>{if(o.toString().match(/^(components|slots)$/))n[o]=(0,r.A)({},e[o],n[o]);else if(o.toString().match(/^(componentsProps|slotProps)$/)){const a=e[o]||{},s=t[o];n[o]={},s&&Object.keys(s)?a&&Object.keys(a)?(n[o]=(0,r.A)({},s),Object.keys(a).forEach((e=>{n[o][e]=i(a[e],s[e])}))):n[o]=s:n[o]=a}else void 0===n[o]&&(n[o]=e[o])})),n}},6564:(e,t,n)=>{"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,{A:()=>r})},1052:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(5043);function i(e){let{controlled:t,default:n,name:i,state:o="value"}=e;const{current:a}=r.useRef(void 0!==t),[s,l]=r.useState(n);return[a?t:s,r.useCallback((e=>{a||l(e)}),[])]}},4440:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(5043);const i="undefined"!==typeof window?r.useLayoutEffect:r.useEffect},1782:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(5043),i=n(4440);const o=function(e){const t=r.useRef(e);return(0,i.A)((()=>{t.current=e})),r.useRef((function(){return(0,t.current)(...arguments)})).current}},3462:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(5043),i=n(6564);function o(){for(var e=arguments.length,t=new Array(e),n=0;nt.every((e=>null==e))?null:e=>{t.forEach((t=>{(0,i.A)(t,e)}))}),t)}},5844:(e,t,n)=>{"use strict";var r;n.d(t,{A:()=>s});var i=n(5043);let o=0;const a=(r||(r=n.t(i,2)))["useId".toString()];function s(e){if(void 0!==a){const t=a();return null!=e?e:t}return function(e){const[t,n]=i.useState(e),r=e||t;return i.useEffect((()=>{null==t&&(o+=1,n(`mui-${o}`))}),[t]),r}(e)}},9640:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(5043),i=n(9303);let o=!0,a=!1;const s=new i.E,l={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function u(){o=!1}function h(){"hidden"===this.visibilityState&&a&&(o=!0)}function d(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(n){}return o||function(e){const{type:t,tagName:n}=e;return!("INPUT"!==n||!l[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function f(){const e=r.useCallback((e=>{var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("touchstart",u,!0),t.addEventListener("visibilitychange",h,!0))}),[]),t=r.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!d(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(a=!0,s.start(100,(()=>{a=!1})),t.current=!1,!0)},ref:e}}},9303:(e,t,n)=>{"use strict";n.d(t,{E:()=>a,A:()=>s});var r=n(5043);const i={};const o=[];class a{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new a}start(e,t){this.clear(),this.currentId=setTimeout((()=>{this.currentId=null,t()}),e)}}function s(){const e=function(e,t){const n=r.useRef(i);return n.current===i&&(n.current=e(t)),n}(a.create).current;var t;return t=e.disposeEffect,r.useEffect(t,o),e}},2511:function(e,t,n){var r;e=n.nmd(e),function(){var i=t,o=(e&&e.exports,"object"==typeof n.g&&n.g);o.global!==o&&o.window;var a=function(e){this.message=e};(a.prototype=new Error).name="InvalidCharacterError";var s=function(e){throw new a(e)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,u={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var t,n,r,i,o=e.length%3,a="",c=-1,u=e.length-o;++c>18&63)+l.charAt(i>>12&63)+l.charAt(i>>6&63)+l.charAt(63&i);return 2==o?(t=e.charCodeAt(c)<<8,n=e.charCodeAt(++c),a+=l.charAt((i=t+n)>>10)+l.charAt(i>>4&63)+l.charAt(i<<2&63)+"="):1==o&&(i=e.charCodeAt(c),a+=l.charAt(i>>2)+l.charAt(i<<4&63)+"=="),a},decode:function(e){var t=(e=String(e).replace(c,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,o="",a=-1;++a>(-2*i&6)));return o},version:"0.1.0"};void 0===(r=function(){return u}.call(t,n,t,e))||(e.exports=r)}()},7283:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!==typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i{"use strict";var t,n="object"===typeof Reflect?Reflect:null,r=n&&"function"===typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"===typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"===typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"===typeof e.on&&m(e,"error",t,n)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,o,a,c;if(s(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"===typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"===typeof l)r(l,this,t);else{var c=l.length,u=p(l,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},5944:e=>{!function(){var t={};e.exports=t,t.simpleFilter=function(e,n){return n.filter((function(n){return t.test(e,n)}))},t.test=function(e,n){return null!==t.match(e,n)},t.match=function(e,t,n){n=n||{};var r,i=0,o=[],a=t.length,s=0,l=0,c=n.pre||"",u=n.post||"",h=n.caseSensitive&&t||t.toLowerCase();e=n.caseSensitive&&e||e.toLowerCase();for(var d=0;d{"use strict";var r=n(3763),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var a=u(n);h&&(a=a.concat(h(n)));for(var s=l(t),m=l(n),g=0;g{"use strict";var n="function"===typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,_=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,v=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function b(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case h:case o:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case c:case d:case g:case m:case l:return e;default:return t}}case i:return t}}}function w(e){return b(e)===h}t.AsyncMode=u,t.ConcurrentMode=h,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=d,t.Fragment=o,t.Lazy=g,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return w(e)||b(e)===u},t.isConcurrentMode=w,t.isContextConsumer=function(e){return b(e)===c},t.isContextProvider=function(e){return b(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===o},t.isLazy=function(e){return b(e)===g},t.isMemo=function(e){return b(e)===m},t.isPortal=function(e){return b(e)===i},t.isProfiler=function(e){return b(e)===s},t.isStrictMode=function(e){return b(e)===a},t.isSuspense=function(e){return b(e)===f},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===o||e===h||e===s||e===a||e===f||e===p||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===y||e.$$typeof===v||e.$$typeof===x||e.$$typeof===_)},t.typeOf=b},3763:(e,t,n)=>{"use strict";e.exports=n(4983)},8313:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var n;return"[object Object]"===t.call(e)&&(null===(n=Object.getPrototypeOf(e))||n===Object.getPrototypeOf({}))}},446:(e,t,n)=>{var r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),h=Object.prototype.toString,d=Math.max,f=Math.min,p=function(){return u.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=o.test(e);return n||a.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,a,s,l,c=0,u=!1,h=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,o=i;return r=i=void 0,c=t,a=e.apply(o,n)}function v(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=o}function x(){var e=p();if(v(e))return b(e);s=setTimeout(x,function(e){var n=t-(e-l);return h?f(n,o-(e-c)):n}(e))}function b(e){return s=void 0,_&&r?y(e):(r=i=void 0,a)}function w(){var e=p(),n=v(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(x,t),u?y(e):a}(l);if(h)return s=setTimeout(x,t),y(l)}return void 0===s&&(s=setTimeout(x,t)),a}return t=g(t)||0,m(n)&&(u=!!n.leading,o=(h="maxWait"in n)?d(g(n.maxWait)||0,t):o,_="trailing"in n?!!n.trailing:_),w.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=i=s=void 0},w.flush=function(){return void 0===s?a:b(p())},w}},3536:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=16,c=32,u=64,h=128,d=256,f=1/0,p=9007199254740991,m=NaN,g=4294967295,_=[["ary",h],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",c],["partialRight",u],["rearg",d]],y="[object Arguments]",v="[object Array]",x="[object Boolean]",b="[object Date]",w="[object Error]",S="[object Function]",M="[object GeneratorFunction]",A="[object Map]",E="[object Number]",T="[object Object]",C="[object Promise]",k="[object RegExp]",I="[object Set]",P="[object String]",R="[object Symbol]",L="[object WeakMap]",z="[object ArrayBuffer]",D="[object DataView]",O="[object Float32Array]",F="[object Float64Array]",B="[object Int8Array]",N="[object Int16Array]",j="[object Int32Array]",V="[object Uint8Array]",U="[object Uint8ClampedArray]",$="[object Uint16Array]",G="[object Uint32Array]",q=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,X=RegExp(Z.source),K=RegExp(Y.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),ae=/^\s+/,se=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,he=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,_e=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,xe=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,Me="\\ud800-\\udfff",Ae="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",ke="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="['\u2019]",Re="["+Me+"]",Le="["+Ie+"]",ze="["+Ae+"]",De="\\d+",Oe="["+Ee+"]",Fe="["+Te+"]",Be="[^"+Me+Ie+De+Ee+Te+Ce+"]",Ne="\\ud83c[\\udffb-\\udfff]",je="[^"+Me+"]",Ve="(?:\\ud83c[\\udde6-\\uddff]){2}",Ue="[\\ud800-\\udbff][\\udc00-\\udfff]",$e="["+Ce+"]",Ge="\\u200d",qe="(?:"+Fe+"|"+Be+")",We="(?:"+$e+"|"+Be+")",He="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ze="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+ze+"|"+Ne+")"+"?",Xe="["+ke+"]?",Ke=Xe+Ye+("(?:"+Ge+"(?:"+[je,Ve,Ue].join("|")+")"+Xe+Ye+")*"),Je="(?:"+[Oe,Ve,Ue].join("|")+")"+Ke,Qe="(?:"+[je+ze+"?",ze,Ve,Ue,Re].join("|")+")",et=RegExp(Pe,"g"),tt=RegExp(ze,"g"),nt=RegExp(Ne+"(?="+Ne+")|"+Qe+Ke,"g"),rt=RegExp([$e+"?"+Fe+"+"+He+"(?="+[Le,$e,"$"].join("|")+")",We+"+"+Ze+"(?="+[Le,$e+qe,"$"].join("|")+")",$e+"?"+qe+"+"+He,$e+"+"+Ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",De,Je].join("|"),"g"),it=RegExp("["+Ge+Me+Ae+ke+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,at=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],st=-1,lt={};lt[O]=lt[F]=lt[B]=lt[N]=lt[j]=lt[V]=lt[U]=lt[$]=lt[G]=!0,lt[y]=lt[v]=lt[z]=lt[x]=lt[D]=lt[b]=lt[w]=lt[S]=lt[A]=lt[E]=lt[T]=lt[k]=lt[I]=lt[P]=lt[L]=!1;var ct={};ct[y]=ct[v]=ct[z]=ct[D]=ct[x]=ct[b]=ct[O]=ct[F]=ct[B]=ct[N]=ct[j]=ct[A]=ct[E]=ct[T]=ct[k]=ct[I]=ct[P]=ct[R]=ct[V]=ct[U]=ct[$]=ct[G]=!0,ct[w]=ct[S]=ct[L]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ht=parseFloat,dt=parseInt,ft="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,pt="object"==typeof self&&self&&self.Object===Object&&self,mt=ft||pt||Function("return this")(),gt=t&&!t.nodeType&&t,_t=gt&&e&&!e.nodeType&&e,yt=_t&&_t.exports===gt,vt=yt&&ft.process,xt=function(){try{var e=_t&&_t.require&&_t.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(t){}}(),bt=xt&&xt.isArrayBuffer,wt=xt&&xt.isDate,St=xt&&xt.isMap,Mt=xt&&xt.isRegExp,At=xt&&xt.isSet,Et=xt&&xt.isTypedArray;function Tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ct(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function zt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function rn(e,t){for(var n=e.length;n--&&$t(t,e[n],0)>-1;);return n}var on=Zt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),an=Zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+ut[e]}function ln(e){return it.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function hn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var yn=function e(t){var n=(t=null==t?mt:yn.defaults(mt.Object(),t,yn.pick(mt,at))).Array,r=t.Date,se=t.Error,Me=t.Function,Ae=t.Math,Ee=t.Object,Te=t.RegExp,Ce=t.String,ke=t.TypeError,Ie=n.prototype,Pe=Me.prototype,Re=Ee.prototype,Le=t["__core-js_shared__"],ze=Pe.toString,De=Re.hasOwnProperty,Oe=0,Fe=function(){var e=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Be=Re.toString,Ne=ze.call(Ee),je=mt._,Ve=Te("^"+ze.call(De).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=yt?t.Buffer:i,$e=t.Symbol,Ge=t.Uint8Array,qe=Ue?Ue.allocUnsafe:i,We=un(Ee.getPrototypeOf,Ee),He=Ee.create,Ze=Re.propertyIsEnumerable,Ye=Ie.splice,Xe=$e?$e.isConcatSpreadable:i,Ke=$e?$e.iterator:i,Je=$e?$e.toStringTag:i,Qe=function(){try{var e=ho(Ee,"defineProperty");return e({},"",{}),e}catch(t){}}(),nt=t.clearTimeout!==mt.clearTimeout&&t.clearTimeout,it=r&&r.now!==mt.Date.now&&r.now,ut=t.setTimeout!==mt.setTimeout&&t.setTimeout,ft=Ae.ceil,pt=Ae.floor,gt=Ee.getOwnPropertySymbols,_t=Ue?Ue.isBuffer:i,vt=t.isFinite,xt=Ie.join,jt=un(Ee.keys,Ee),Zt=Ae.max,vn=Ae.min,xn=r.now,bn=t.parseInt,wn=Ae.random,Sn=Ie.reverse,Mn=ho(t,"DataView"),An=ho(t,"Map"),En=ho(t,"Promise"),Tn=ho(t,"Set"),Cn=ho(t,"WeakMap"),kn=ho(Ee,"create"),In=Cn&&new Cn,Pn={},Rn=Bo(Mn),Ln=Bo(An),zn=Bo(En),Dn=Bo(Tn),On=Bo(Cn),Fn=$e?$e.prototype:i,Bn=Fn?Fn.valueOf:i,Nn=Fn?Fn.toString:i;function jn(e){if(ts(e)&&!Ga(e)&&!(e instanceof Gn)){if(e instanceof $n)return e;if(De.call(e,"__wrapped__"))return No(e)}return new $n(e)}var Vn=function(){function e(){}return function(t){if(!es(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Un(){}function $n(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function lr(e,t,n,r,o,a){var s,l=1&t,c=2&t,u=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!es(e))return e;var h=Ga(e);if(h){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return ki(e,s)}else{var d=mo(e),f=d==S||d==M;if(Za(e))return Si(e,l);if(d==T||d==y||f&&!o){if(s=c||f?{}:_o(e),!l)return c?function(e,t){return Ii(e,po(e),t)}(e,function(e,t){return e&&Ii(t,Rs(t),e)}(s,e)):function(e,t){return Ii(e,fo(e),t)}(e,ir(s,e))}else{if(!ct[d])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case z:return Mi(e);case x:case b:return new r(+e);case D:return function(e,t){var n=t?Mi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case O:case F:case B:case N:case j:case V:case U:case $:case G:return Ai(e,n);case A:return new r;case E:case P:return new r(e);case k:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case I:return new r;case R:return i=e,Bn?Ee(Bn.call(i)):{}}var i}(e,d,l)}}a||(a=new Yn);var p=a.get(e);if(p)return p;a.set(e,s),as(e)?e.forEach((function(r){s.add(lr(r,t,n,r,e,a))})):ns(e)&&e.forEach((function(r,i){s.set(i,lr(r,t,n,i,e,a))}));var m=h?i:(u?c?io:ro:c?Rs:Ps)(e);return kt(m||e,(function(r,i){m&&(r=e[i=r]),tr(s,i,lr(r,t,n,i,e,a))})),s}function cr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ee(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function ur(e,t,n){if("function"!=typeof e)throw new ke(o);return Po((function(){e.apply(i,n)}),t)}function hr(e,t,n,r){var i=-1,o=Lt,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Dt(t,Qt(n))),r?(o=zt,a=!1):t.length>=200&&(o=tn,a=!1,t=new Zn(t));e:for(;++i-1},Wn.prototype.set=function(e,t){var n=this.__data__,r=nr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(An||Wn),string:new qn}},Hn.prototype.delete=function(e){var t=co(this,e).delete(e);return this.size-=t?1:0,t},Hn.prototype.get=function(e){return co(this,e).get(e)},Hn.prototype.has=function(e){return co(this,e).has(e)},Hn.prototype.set=function(e,t){var n=co(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Zn.prototype.add=Zn.prototype.push=function(e){return this.__data__.set(e,a),this},Zn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!An||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Hn(r)}return n.set(e,t),this.size=n.size,this};var dr=Li(xr),fr=Li(br,!0);function pr(e,t){var n=!0;return dr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function mr(e,t,n){for(var r=-1,o=e.length;++r0&&n(s)?t>1?_r(s,t-1,n,r,i):Ot(i,s):r||(i[i.length]=s)}return i}var yr=zi(),vr=zi(!0);function xr(e,t){return e&&yr(e,t,Ps)}function br(e,t){return e&&vr(e,t,Ps)}function wr(e,t){return Rt(t,(function(t){return Ka(e[t])}))}function Sr(e,t){for(var n=0,r=(t=vi(t,e)).length;null!=e&&nt}function Tr(e,t){return null!=e&&De.call(e,t)}function Cr(e,t){return null!=e&&t in Ee(e)}function kr(e,t,r){for(var o=r?zt:Lt,a=e[0].length,s=e.length,l=s,c=n(s),u=1/0,h=[];l--;){var d=e[l];l&&t&&(d=Dt(d,Qt(t))),u=vn(d.length,u),c[l]=!r&&(t||a>=120&&d.length>=120)?new Zn(l&&d):i}d=e[0];var f=-1,p=c[0];e:for(;++f=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&Ye.call(s,l,1),Ye.call(e,l,1);return e}function Hr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;vo(i)?Ye.call(e,i,1):hi(e,i)}}return e}function Zr(e,t){return e+pt(wn()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>p)return n;do{t%2&&(n+=e),(t=pt(t/2))&&(e+=e)}while(t);return n}function Xr(e,t){return Ro(To(e,t,rl),e+"")}function Kr(e){return Kn(js(e))}function Jr(e,t){var n=js(e);return Do(n,sr(t,0,n.length))}function Qr(e,t,n,r){if(!es(e))return e;for(var o=-1,a=(t=vi(t,e)).length,s=a-1,l=e;null!=l&&++oo?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=n(o);++i>>1,a=e[o];null!==a&&!ls(a)&&(n?a<=t:a=200){var c=t?null:Yi(e);if(c)return dn(c);a=!1,i=tn,l=new Zn}else l=t?[]:s;e:for(;++r=r?e:ri(e,t,n)}var wi=nt||function(e){return mt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var n=e.length,r=qe?qe(n):new e.constructor(n);return e.copy(r),r}function Mi(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function Ai(e,t){var n=t?Mi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ei(e,t){if(e!==t){var n=e!==i,r=null===e,o=e===e,a=ls(e),s=t!==i,l=null===t,c=t===t,u=ls(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||r&&s&&c||!n&&c||!o)return 1;if(!r&&!a&&!u&&e1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&xo(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=Ee(t);++r-1?o[a?t[s]:s]:i}}function Ni(e){return no((function(t){var n=t.length,r=n,a=$n.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new ke(o);if(a&&!l&&"wrapper"==ao(s))var l=new $n([],!0)}for(r=l?r:n;++r1&&x.reverse(),f&&ul))return!1;var u=a.get(e),h=a.get(t);if(u&&h)return u==t&&h==e;var d=-1,f=!0,p=2&n?new Zn:i;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return kt(_,(function(n){var r="_."+n[0];t&n[1]&&!Lt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(ue):[]}(r),n)))}function zo(e){var t=0,n=0;return function(){var r=xn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Do(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,oa(e,n)}));function da(e){var t=jn(e);return t.__chain__=!0,t}function fa(e,t){return t(e)}var pa=no((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ar(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Gn&&vo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fa,args:[o],thisArg:i}),new $n(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var ma=Pi((function(e,t,n){De.call(e,n)?++e[n]:or(e,n,1)}));var ga=Bi($o),_a=Bi(Go);function ya(e,t){return(Ga(e)?kt:dr)(e,lo(t,3))}function va(e,t){return(Ga(e)?It:fr)(e,lo(t,3))}var xa=Pi((function(e,t,n){De.call(e,n)?e[n].push(t):or(e,n,[t])}));var ba=Xr((function(e,t,r){var i=-1,o="function"==typeof t,a=Wa(e)?n(e.length):[];return dr(e,(function(e){a[++i]=o?Tt(t,e,r):Ir(e,t,r)})),a})),wa=Pi((function(e,t,n){or(e,n,t)}));function Sa(e,t){return(Ga(e)?Dt:Nr)(e,lo(t,3))}var Ma=Pi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Aa=Xr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&xo(e,t[0],t[1])?t=[]:n>2&&xo(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,_r(t,1),[])})),Ea=it||function(){return mt.Date.now()};function Ta(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Ki(e,h,i,i,i,i,t)}function Ca(e,t){var n;if("function"!=typeof t)throw new ke(o);return e=ps(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var ka=Xr((function(e,t,n){var r=1;if(n.length){var i=hn(n,so(ka));r|=c}return Ki(e,r,t,n,i)})),Ia=Xr((function(e,t,n){var r=3;if(n.length){var i=hn(n,so(Ia));r|=c}return Ki(t,r,e,n,i)}));function Pa(e,t,n){var r,a,s,l,c,u,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new ke(o);function m(t){var n=r,o=a;return r=a=i,h=t,l=e.apply(o,n)}function g(e){var n=e-u;return u===i||n>=t||n<0||f&&e-h>=s}function _(){var e=Ea();if(g(e))return y(e);c=Po(_,function(e){var n=t-(e-u);return f?vn(n,s-(e-h)):n}(e))}function y(e){return c=i,p&&r?m(e):(r=a=i,l)}function v(){var e=Ea(),n=g(e);if(r=arguments,a=this,u=e,n){if(c===i)return function(e){return h=e,c=Po(_,t),d?m(e):l}(u);if(f)return wi(c),c=Po(_,t),m(u)}return c===i&&(c=Po(_,t)),l}return t=gs(t)||0,es(n)&&(d=!!n.leading,s=(f="maxWait"in n)?Zt(gs(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),v.cancel=function(){c!==i&&wi(c),h=0,r=u=a=c=i},v.flush=function(){return c===i?l:y(Ea())},v}var Ra=Xr((function(e,t){return ur(e,1,t)})),La=Xr((function(e,t,n){return ur(e,gs(t)||0,n)}));function za(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ke(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(za.Cache||Hn),n}function Da(e){if("function"!=typeof e)throw new ke(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}za.Cache=Hn;var Oa=xi((function(e,t){var n=(t=1==t.length&&Ga(t[0])?Dt(t[0],Qt(lo())):Dt(_r(t,1),Qt(lo()))).length;return Xr((function(r){for(var i=-1,o=vn(r.length,n);++i=t})),$a=Pr(function(){return arguments}())?Pr:function(e){return ts(e)&&De.call(e,"callee")&&!Ze.call(e,"callee")},Ga=n.isArray,qa=bt?Qt(bt):function(e){return ts(e)&&Ar(e)==z};function Wa(e){return null!=e&&Qa(e.length)&&!Ka(e)}function Ha(e){return ts(e)&&Wa(e)}var Za=_t||gl,Ya=wt?Qt(wt):function(e){return ts(e)&&Ar(e)==b};function Xa(e){if(!ts(e))return!1;var t=Ar(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!is(e)}function Ka(e){if(!es(e))return!1;var t=Ar(e);return t==S||t==M||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ja(e){return"number"==typeof e&&e==ps(e)}function Qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=p}function es(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ts(e){return null!=e&&"object"==typeof e}var ns=St?Qt(St):function(e){return ts(e)&&mo(e)==A};function rs(e){return"number"==typeof e||ts(e)&&Ar(e)==E}function is(e){if(!ts(e)||Ar(e)!=T)return!1;var t=We(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ze.call(n)==Ne}var os=Mt?Qt(Mt):function(e){return ts(e)&&Ar(e)==k};var as=At?Qt(At):function(e){return ts(e)&&mo(e)==I};function ss(e){return"string"==typeof e||!Ga(e)&&ts(e)&&Ar(e)==P}function ls(e){return"symbol"==typeof e||ts(e)&&Ar(e)==R}var cs=Et?Qt(Et):function(e){return ts(e)&&Qa(e.length)&&!!lt[Ar(e)]};var us=Wi(Br),hs=Wi((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Wa(e))return ss(e)?mn(e):ki(e);if(Ke&&e[Ke])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ke]());var t=mo(e);return(t==A?cn:t==I?dn:js)(e)}function fs(e){return e?(e=gs(e))===f||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0}function ps(e){var t=fs(e),n=t%1;return t===t?n?t-n:t:0}function ms(e){return e?sr(ps(e),0,g):0}function gs(e){if("number"==typeof e)return e;if(ls(e))return m;if(es(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=es(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var n=_e.test(e);return n||ve.test(e)?dt(e.slice(2),n?2:8):ge.test(e)?m:+e}function _s(e){return Ii(e,Rs(e))}function ys(e){return null==e?"":ci(e)}var vs=Ri((function(e,t){if(Mo(t)||Wa(t))Ii(t,Ps(t),e);else for(var n in t)De.call(t,n)&&tr(e,n,t[n])})),xs=Ri((function(e,t){Ii(t,Rs(t),e)})),bs=Ri((function(e,t,n,r){Ii(t,Rs(t),e,r)})),ws=Ri((function(e,t,n,r){Ii(t,Ps(t),e,r)})),Ss=no(ar);var Ms=Xr((function(e,t){e=Ee(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&xo(t[0],t[1],o)&&(r=1);++n1),t})),Ii(e,io(e),n),r&&(n=lr(n,7,eo));for(var i=t.length;i--;)hi(n,t[i]);return n}));var Os=no((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return Ts(e,n)}))}(e,t)}));function Fs(e,t){if(null==e)return{};var n=Dt(io(e),(function(e){return[e]}));return t=lo(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var Bs=Xi(Ps),Ns=Xi(Rs);function js(e){return null==e?[]:en(e,Ps(e))}var Vs=Oi((function(e,t,n){return t=t.toLowerCase(),e+(n?Us(t):t)}));function Us(e){return Xs(ys(e).toLowerCase())}function $s(e){return(e=ys(e))&&e.replace(be,on).replace(tt,"")}var Gs=Oi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),qs=Oi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ws=Di("toLowerCase");var Hs=Oi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Zs=Oi((function(e,t,n){return e+(n?" ":"")+Xs(t)}));var Ys=Oi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Xs=Di("toUpperCase");function Ks(e,t,n){return e=ys(e),(t=n?i:t)===i?function(e){return ot.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(he)||[]}(e):e.match(t)||[]}var Js=Xr((function(e,t){try{return Tt(e,i,t)}catch(n){return Xa(n)?n:new se(n)}})),Qs=no((function(e,t){return kt(t,(function(t){t=Fo(t),or(e,t,ka(e[t],e))})),e}));function el(e){return function(){return e}}var tl=Ni(),nl=Ni(!0);function rl(e){return e}function il(e){return Dr("function"==typeof e?e:lr(e,1))}var ol=Xr((function(e,t){return function(n){return Ir(n,e,t)}})),al=Xr((function(e,t){return function(n){return Ir(e,n,t)}}));function sl(e,t,n){var r=Ps(t),i=wr(t,r);null!=n||es(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=wr(t,Ps(t)));var o=!(es(n)&&"chain"in n)||!!n.chain,a=Ka(e);return kt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=ki(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Ot([this.value()],arguments))})})),e}function ll(){}var cl=$i(Dt),ul=$i(Pt),hl=$i(Nt);function dl(e){return bo(e)?Ht(Fo(e)):function(e){return function(t){return Sr(t,e)}}(e)}var fl=qi(),pl=qi(!0);function ml(){return[]}function gl(){return!1}var _l=Ui((function(e,t){return e+t}),0),yl=Zi("ceil"),vl=Ui((function(e,t){return e/t}),1),xl=Zi("floor");var bl=Ui((function(e,t){return e*t}),1),wl=Zi("round"),Sl=Ui((function(e,t){return e-t}),0);return jn.after=function(e,t){if("function"!=typeof t)throw new ke(o);return e=ps(e),function(){if(--e<1)return t.apply(this,arguments)}},jn.ary=Ta,jn.assign=vs,jn.assignIn=xs,jn.assignInWith=bs,jn.assignWith=ws,jn.at=Ss,jn.before=Ca,jn.bind=ka,jn.bindAll=Qs,jn.bindKey=Ia,jn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ga(e)?e:[e]},jn.chain=da,jn.chunk=function(e,t,r){t=(r?xo(e,t,r):t===i)?1:Zt(ps(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=n(ft(o/t));ao?0:o+n),(r=r===i||r>o?o:ps(r))<0&&(r+=o),r=n>r?0:ms(r);n>>0)?(e=ys(e))&&("string"==typeof t||null!=t&&!os(t))&&!(t=ci(t))&&ln(e)?bi(mn(e),0,n):e.split(t,n):[]},jn.spread=function(e,t){if("function"!=typeof e)throw new ke(o);return t=null==t?0:Zt(ps(t),0),Xr((function(n){var r=n[t],i=bi(n,0,t);return r&&Ot(i,r),Tt(e,this,i)}))},jn.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},jn.take=function(e,t,n){return e&&e.length?ri(e,0,(t=n||t===i?1:ps(t))<0?0:t):[]},jn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ri(e,(t=r-(t=n||t===i?1:ps(t)))<0?0:t,r):[]},jn.takeRightWhile=function(e,t){return e&&e.length?fi(e,lo(t,3),!1,!0):[]},jn.takeWhile=function(e,t){return e&&e.length?fi(e,lo(t,3)):[]},jn.tap=function(e,t){return t(e),e},jn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new ke(o);return es(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Pa(e,t,{leading:r,maxWait:t,trailing:i})},jn.thru=fa,jn.toArray=ds,jn.toPairs=Bs,jn.toPairsIn=Ns,jn.toPath=function(e){return Ga(e)?Dt(e,Fo):ls(e)?[e]:ki(Oo(ys(e)))},jn.toPlainObject=_s,jn.transform=function(e,t,n){var r=Ga(e),i=r||Za(e)||cs(e);if(t=lo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:es(e)&&Ka(o)?Vn(We(e)):{}}return(i?kt:xr)(e,(function(e,r,i){return t(n,e,r,i)})),n},jn.unary=function(e){return Ta(e,1)},jn.union=ta,jn.unionBy=na,jn.unionWith=ra,jn.uniq=function(e){return e&&e.length?ui(e):[]},jn.uniqBy=function(e,t){return e&&e.length?ui(e,lo(t,2)):[]},jn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ui(e,i,t):[]},jn.unset=function(e,t){return null==e||hi(e,t)},jn.unzip=ia,jn.unzipWith=oa,jn.update=function(e,t,n){return null==e?e:di(e,t,yi(n))},jn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:di(e,t,yi(n),r)},jn.values=js,jn.valuesIn=function(e){return null==e?[]:en(e,Rs(e))},jn.without=aa,jn.words=Ks,jn.wrap=function(e,t){return Fa(yi(t),e)},jn.xor=sa,jn.xorBy=la,jn.xorWith=ca,jn.zip=ua,jn.zipObject=function(e,t){return gi(e||[],t||[],tr)},jn.zipObjectDeep=function(e,t){return gi(e||[],t||[],Qr)},jn.zipWith=ha,jn.entries=Bs,jn.entriesIn=Ns,jn.extend=xs,jn.extendWith=bs,sl(jn,jn),jn.add=_l,jn.attempt=Js,jn.camelCase=Vs,jn.capitalize=Us,jn.ceil=yl,jn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=gs(n))===n?n:0),t!==i&&(t=(t=gs(t))===t?t:0),sr(gs(e),t,n)},jn.clone=function(e){return lr(e,4)},jn.cloneDeep=function(e){return lr(e,5)},jn.cloneDeepWith=function(e,t){return lr(e,5,t="function"==typeof t?t:i)},jn.cloneWith=function(e,t){return lr(e,4,t="function"==typeof t?t:i)},jn.conformsTo=function(e,t){return null==t||cr(e,t,Ps(t))},jn.deburr=$s,jn.defaultTo=function(e,t){return null==e||e!==e?t:e},jn.divide=vl,jn.endsWith=function(e,t,n){e=ys(e),t=ci(t);var r=e.length,o=n=n===i?r:sr(ps(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},jn.eq=ja,jn.escape=function(e){return(e=ys(e))&&K.test(e)?e.replace(Y,an):e},jn.escapeRegExp=function(e){return(e=ys(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},jn.every=function(e,t,n){var r=Ga(e)?Pt:pr;return n&&xo(e,t,n)&&(t=i),r(e,lo(t,3))},jn.find=ga,jn.findIndex=$o,jn.findKey=function(e,t){return Vt(e,lo(t,3),xr)},jn.findLast=_a,jn.findLastIndex=Go,jn.findLastKey=function(e,t){return Vt(e,lo(t,3),br)},jn.floor=xl,jn.forEach=ya,jn.forEachRight=va,jn.forIn=function(e,t){return null==e?e:yr(e,lo(t,3),Rs)},jn.forInRight=function(e,t){return null==e?e:vr(e,lo(t,3),Rs)},jn.forOwn=function(e,t){return e&&xr(e,lo(t,3))},jn.forOwnRight=function(e,t){return e&&br(e,lo(t,3))},jn.get=Es,jn.gt=Va,jn.gte=Ua,jn.has=function(e,t){return null!=e&&go(e,t,Tr)},jn.hasIn=Ts,jn.head=Wo,jn.identity=rl,jn.includes=function(e,t,n,r){e=Wa(e)?e:js(e),n=n&&!r?ps(n):0;var i=e.length;return n<0&&(n=Zt(i+n,0)),ss(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&$t(e,t,n)>-1},jn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ps(n);return i<0&&(i=Zt(r+i,0)),$t(e,t,i)},jn.inRange=function(e,t,n){return t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n){return e>=vn(t,n)&&e=-9007199254740991&&e<=p},jn.isSet=as,jn.isString=ss,jn.isSymbol=ls,jn.isTypedArray=cs,jn.isUndefined=function(e){return e===i},jn.isWeakMap=function(e){return ts(e)&&mo(e)==L},jn.isWeakSet=function(e){return ts(e)&&"[object WeakSet]"==Ar(e)},jn.join=function(e,t){return null==e?"":xt.call(e,t)},jn.kebabCase=Gs,jn.last=Xo,jn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ps(n))<0?Zt(r+o,0):vn(o,r-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Ut(e,qt,o,!0)},jn.lowerCase=qs,jn.lowerFirst=Ws,jn.lt=us,jn.lte=hs,jn.max=function(e){return e&&e.length?mr(e,rl,Er):i},jn.maxBy=function(e,t){return e&&e.length?mr(e,lo(t,2),Er):i},jn.mean=function(e){return Wt(e,rl)},jn.meanBy=function(e,t){return Wt(e,lo(t,2))},jn.min=function(e){return e&&e.length?mr(e,rl,Br):i},jn.minBy=function(e,t){return e&&e.length?mr(e,lo(t,2),Br):i},jn.stubArray=ml,jn.stubFalse=gl,jn.stubObject=function(){return{}},jn.stubString=function(){return""},jn.stubTrue=function(){return!0},jn.multiply=bl,jn.nth=function(e,t){return e&&e.length?$r(e,ps(t)):i},jn.noConflict=function(){return mt._===this&&(mt._=je),this},jn.noop=ll,jn.now=Ea,jn.pad=function(e,t,n){e=ys(e);var r=(t=ps(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Gi(pt(i),n)+e+Gi(ft(i),n)},jn.padEnd=function(e,t,n){e=ys(e);var r=(t=ps(t))?pn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=wn();return vn(e+o*(t-e+ht("1e-"+((o+"").length-1))),t)}return Zr(e,t)},jn.reduce=function(e,t,n){var r=Ga(e)?Ft:Yt,i=arguments.length<3;return r(e,lo(t,4),n,i,dr)},jn.reduceRight=function(e,t,n){var r=Ga(e)?Bt:Yt,i=arguments.length<3;return r(e,lo(t,4),n,i,fr)},jn.repeat=function(e,t,n){return t=(n?xo(e,t,n):t===i)?1:ps(t),Yr(ys(e),t)},jn.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},jn.result=function(e,t,n){var r=-1,o=(t=vi(t,e)).length;for(o||(o=1,e=i);++rp)return[];var n=g,r=vn(e,g);t=lo(t),e-=g;for(var i=Kt(r,t);++n=a)return e;var l=n-pn(r);if(l<1)return r;var c=s?bi(s,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(s&&(l+=c.length-l),os(o)){if(e.slice(l).search(o)){var u,h=c;for(o.global||(o=Te(o.source,ys(me.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===i?l:d)}}else if(e.indexOf(ci(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+r},jn.unescape=function(e){return(e=ys(e))&&X.test(e)?e.replace(Z,_n):e},jn.uniqueId=function(e){var t=++Oe;return ys(e)+t},jn.upperCase=Ys,jn.upperFirst=Xs,jn.each=ya,jn.eachRight=va,jn.first=Wo,sl(jn,function(){var e={};return xr(jn,(function(t,n){De.call(jn.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),jn.VERSION="4.17.21",kt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){jn[e].placeholder=jn})),kt(["drop","take"],(function(e,t){Gn.prototype[e]=function(n){n=n===i?1:Zt(ps(n),0);var r=this.__filtered__&&!t?new Gn(this):this.clone();return r.__filtered__?r.__takeCount__=vn(n,r.__takeCount__):r.__views__.push({size:vn(n,g),type:e+(r.__dir__<0?"Right":"")}),r},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),kt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:lo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),kt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),kt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(rl)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Xr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Ir(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Da(lo(e)))},Gn.prototype.slice=function(e,t){e=ps(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Gn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=ps(t))<0?n.dropRight(-t):n.take(t-e)),n)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(g)},xr(Gn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=jn[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(jn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,l=t instanceof Gn,c=s[0],u=l||Ga(t),h=function(e){var t=o.apply(jn,Ot([e],s));return r&&d?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,f=!!this.__actions__.length,p=a&&!d,m=l&&!f;if(!a&&u){t=m?t:new Gn(this);var g=e.apply(t,s);return g.__actions__.push({func:fa,args:[h],thisArg:i}),new $n(g,d)}return p&&m?e.apply(this,s):(g=this.thru(h),p?r?g.value()[0]:g.value():g)})})),kt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ie[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);jn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ga(i)?i:[],e)}return this[n]((function(n){return t.apply(Ga(n)?n:[],e)}))}})),xr(Gn.prototype,(function(e,t){var n=jn[t];if(n){var r=n.name+"";De.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}})),Pn[ji(i,2).name]=[{name:"wrapper",func:i}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=ki(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ki(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ki(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ga(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},jn.prototype.plant=function(e){for(var t,n=this;n instanceof Un;){var r=No(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},jn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:fa,args:[ea],thisArg:i}),new $n(t,this.__chain__)}return this.thru(ea)},jn.prototype.toJSON=jn.prototype.valueOf=jn.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},jn.prototype.first=jn.prototype.head,Ke&&(jn.prototype[Ke]=function(){return this}),jn}();mt._=yn,(r=function(){return yn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},879:function(e){e.exports=function(){"use strict";var e,t,n;function r(r,i){if(e)if(t){var o="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",a={};e(a),n=i(a),"undefined"!==typeof window&&window&&window.URL&&window.URL.createObjectURL&&(n.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=i;else e=i}return r(["exports"],(function(e){function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,r={},i={};function o(){if(n)return i;n=1,Object.defineProperty(i,"__esModule",{value:!0}),i.setMatrixArrayType=function(e){i.ARRAY_TYPE=t=e},i.toRadian=function(e){return e*o},i.equals=function(t,n){return Math.abs(t-n)<=e*Math.max(1,Math.abs(t),Math.abs(n))},i.RANDOM=i.ARRAY_TYPE=i.EPSILON=void 0;var e=1e-6;i.EPSILON=e;var t="undefined"!=typeof Float32Array?Float32Array:Array;i.ARRAY_TYPE=t;var r=Math.random;i.RANDOM=r;var o=Math.PI/180;return Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)}),i}var a,s={};function l(){if(a)return s;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}a=1,Object.defineProperty(s,"__esModule",{value:!0}),s.create=function(){var e=new t.ARRAY_TYPE(4);return t.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},s.clone=function(e){var n=new t.ARRAY_TYPE(4);return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n},s.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},s.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},s.fromValues=function(e,n,r,i){var o=new t.ARRAY_TYPE(4);return o[0]=e,o[1]=n,o[2]=r,o[3]=i,o},s.set=function(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e},s.transpose=function(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},s.invert=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*o-i*r;return a?(e[0]=o*(a=1/a),e[1]=-r*a,e[2]=-i*a,e[3]=n*a,e):null},s.adjoint=function(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e},s.determinant=function(e){return e[0]*e[3]-e[2]*e[1]},s.multiply=r,s.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*s,e[1]=i*l+a*s,e[2]=r*-s+o*l,e[3]=i*-s+a*l,e},s.scale=function(e,t,n){var r=t[1],i=t[2],o=t[3],a=n[0],s=n[1];return e[0]=t[0]*a,e[1]=r*a,e[2]=i*s,e[3]=o*s,e},s.fromRotation=function(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=-n,e[3]=r,e},s.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e},s.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},s.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},s.LDU=function(e,t,n,r){return e[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-e[2]*n[1],[e,t,n]},s.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e},s.subtract=i,s.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},s.equals=function(e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],l=n[1],c=n[2],u=n[3];return Math.abs(r-s)<=t.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=t.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-c)<=t.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(a-u)<=t.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))},s.multiplyScalar=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e},s.multiplyScalarAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e},s.sub=s.mul=void 0;var t=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=n(void 0);if(r&&r.has(t))return r.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=o?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(o());function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function r(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1],c=n[2],u=n[3];return e[0]=r*s+o*l,e[1]=i*s+a*l,e[2]=r*c+o*u,e[3]=i*c+a*u,e}function i(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}return s.mul=r,s.sub=i,s}var c,u={};function h(){if(c)return u;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}c=1,Object.defineProperty(u,"__esModule",{value:!0}),u.create=function(){var e=new t.ARRAY_TYPE(6);return t.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e},u.clone=function(e){var n=new t.ARRAY_TYPE(6);return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n},u.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},u.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},u.fromValues=function(e,n,r,i,o,a){var s=new t.ARRAY_TYPE(6);return s[0]=e,s[1]=n,s[2]=r,s[3]=i,s[4]=o,s[5]=a,s},u.set=function(e,t,n,r,i,o,a){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=a,e},u.invert=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=n*o-r*i;return l?(e[0]=o*(l=1/l),e[1]=-r*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-o*a)*l,e[5]=(r*a-n*s)*l,e):null},u.determinant=function(e){return e[0]*e[3]-e[1]*e[2]},u.multiply=r,u.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=Math.sin(n),u=Math.cos(n);return e[0]=r*u+o*c,e[1]=i*u+a*c,e[2]=r*-c+o*u,e[3]=i*-c+a*u,e[4]=s,e[5]=l,e},u.scale=function(e,t,n){var r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=n[0],c=n[1];return e[0]=t[0]*l,e[1]=r*l,e[2]=i*c,e[3]=o*c,e[4]=a,e[5]=s,e},u.translate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=n[0],u=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=r*c+o*u+s,e[5]=i*c+a*u+l,e},u.fromRotation=function(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=-n,e[3]=r,e[4]=0,e[5]=0,e},u.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e},u.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e},u.str=function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"},u.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],1)},u.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e},u.subtract=i,u.multiplyScalar=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e},u.multiplyScalarAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e},u.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]},u.equals=function(e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=n[0],u=n[1],h=n[2],d=n[3],f=n[4],p=n[5];return Math.abs(r-c)<=t.EPSILON*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-u)<=t.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=t.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(a-d)<=t.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(s-f)<=t.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(l-p)<=t.EPSILON*Math.max(1,Math.abs(l),Math.abs(p))},u.sub=u.mul=void 0;var t=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=n(void 0);if(r&&r.has(t))return r.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=o?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(o());function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function r(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=n[0],u=n[1],h=n[2],d=n[3],f=n[4],p=n[5];return e[0]=r*c+o*u,e[1]=i*c+a*u,e[2]=r*h+o*d,e[3]=i*h+a*d,e[4]=r*f+o*p+s,e[5]=i*f+a*p+l,e}function i(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}return u.mul=r,u.sub=i,u}var d,f={};function p(){if(d)return f;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}d=1,Object.defineProperty(f,"__esModule",{value:!0}),f.create=function(){var e=new t.ARRAY_TYPE(9);return t.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},f.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},f.clone=function(e){var n=new t.ARRAY_TYPE(9);return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n},f.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},f.fromValues=function(e,n,r,i,o,a,s,l,c){var u=new t.ARRAY_TYPE(9);return u[0]=e,u[1]=n,u[2]=r,u[3]=i,u[4]=o,u[5]=a,u[6]=s,u[7]=l,u[8]=c,u},f.set=function(e,t,n,r,i,o,a,s,l,c){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e},f.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},f.transpose=function(e,t){if(e===t){var n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},f.invert=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=u*a-s*c,d=-u*o+s*l,f=c*o-a*l,p=n*h+r*d+i*f;return p?(e[0]=h*(p=1/p),e[1]=(-u*r+i*c)*p,e[2]=(s*r-i*a)*p,e[3]=d*p,e[4]=(u*n-i*l)*p,e[5]=(-s*n+i*o)*p,e[6]=f*p,e[7]=(-c*n+r*l)*p,e[8]=(a*n-r*o)*p,e):null},f.adjoint=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=a*u-s*c,e[1]=i*c-r*u,e[2]=r*s-i*a,e[3]=s*l-o*u,e[4]=n*u-i*l,e[5]=i*o-n*s,e[6]=o*c-a*l,e[7]=r*l-n*c,e[8]=n*a-r*o,e},f.determinant=function(e){var t=e[3],n=e[4],r=e[5],i=e[6],o=e[7],a=e[8];return e[0]*(a*n-r*o)+e[1]*(-a*t+r*i)+e[2]*(o*t-n*i)},f.multiply=r,f.translate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=n[0],f=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=d*r+f*a+c,e[7]=d*i+f*s+u,e[8]=d*o+f*l+h,e},f.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=Math.sin(n),f=Math.cos(n);return e[0]=f*r+d*a,e[1]=f*i+d*s,e[2]=f*o+d*l,e[3]=f*a-d*r,e[4]=f*s-d*i,e[5]=f*l-d*o,e[6]=c,e[7]=u,e[8]=h,e},f.scale=function(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},f.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},f.fromRotation=function(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},f.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},f.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},f.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,l=i+i,c=n*a,u=r*a,h=r*s,d=i*a,f=i*s,p=i*l,m=o*a,g=o*s,_=o*l;return e[0]=1-h-p,e[3]=u-_,e[6]=d+g,e[1]=u+_,e[4]=1-c-p,e[7]=f-m,e[2]=d-g,e[5]=f+m,e[8]=1-c-h,e},f.normalFromMat4=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],y=n*s-r*a,v=n*l-i*a,x=n*c-o*a,b=r*l-i*s,w=r*c-o*s,S=i*c-o*l,M=u*m-h*p,A=u*g-d*p,E=u*_-f*p,T=h*g-d*m,C=h*_-f*m,k=d*_-f*g,I=y*k-v*C+x*T+b*E-w*A+S*M;return I?(e[0]=(s*k-l*C+c*T)*(I=1/I),e[1]=(l*E-a*k-c*A)*I,e[2]=(a*C-s*E+c*M)*I,e[3]=(i*C-r*k-o*T)*I,e[4]=(n*k-i*E+o*A)*I,e[5]=(r*E-n*C-o*M)*I,e[6]=(m*S-g*w+_*b)*I,e[7]=(g*x-p*S-_*v)*I,e[8]=(p*w-m*x+_*y)*I,e):null},f.projection=function(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},f.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},f.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},f.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e},f.subtract=i,f.multiplyScalar=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},f.multiplyScalarAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e},f.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},f.equals=function(e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=n[0],f=n[1],p=n[2],m=n[3],g=n[4],_=n[5],y=n[6],v=n[7],x=n[8];return Math.abs(r-d)<=t.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(i-f)<=t.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(o-p)<=t.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=t.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-g)<=t.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-_)<=t.EPSILON*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(c-y)<=t.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-v)<=t.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(h-x)<=t.EPSILON*Math.max(1,Math.abs(h),Math.abs(x))},f.sub=f.mul=void 0;var t=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=n(void 0);if(r&&r.has(t))return r.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=o?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(o());function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function r(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=n[0],f=n[1],p=n[2],m=n[3],g=n[4],_=n[5],y=n[6],v=n[7],x=n[8];return e[0]=d*r+f*a+p*c,e[1]=d*i+f*s+p*u,e[2]=d*o+f*l+p*h,e[3]=m*r+g*a+_*c,e[4]=m*i+g*s+_*u,e[5]=m*o+g*l+_*h,e[6]=y*r+v*a+x*c,e[7]=y*i+v*s+x*u,e[8]=y*o+v*l+x*h,e}function i(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}return f.mul=r,f.sub=i,f}var m,g={};function _(){if(m)return g;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}m=1,Object.defineProperty(g,"__esModule",{value:!0}),g.create=function(){var e=new t.ARRAY_TYPE(16);return t.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},g.clone=function(e){var n=new t.ARRAY_TYPE(16);return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},g.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},g.fromValues=function(e,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g){var _=new t.ARRAY_TYPE(16);return _[0]=e,_[1]=n,_[2]=r,_[3]=i,_[4]=o,_[5]=a,_[6]=s,_[7]=l,_[8]=c,_[9]=u,_[10]=h,_[11]=d,_[12]=f,_[13]=p,_[14]=m,_[15]=g,_},g.set=function(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e[9]=u,e[10]=h,e[11]=d,e[12]=f,e[13]=p,e[14]=m,e[15]=g,e},g.identity=r,g.transpose=function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},g.invert=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],y=n*s-r*a,v=n*l-i*a,x=n*c-o*a,b=r*l-i*s,w=r*c-o*s,S=i*c-o*l,M=u*m-h*p,A=u*g-d*p,E=u*_-f*p,T=h*g-d*m,C=h*_-f*m,k=d*_-f*g,I=y*k-v*C+x*T+b*E-w*A+S*M;return I?(e[0]=(s*k-l*C+c*T)*(I=1/I),e[1]=(i*C-r*k-o*T)*I,e[2]=(m*S-g*w+_*b)*I,e[3]=(d*w-h*S-f*b)*I,e[4]=(l*E-a*k-c*A)*I,e[5]=(n*k-i*E+o*A)*I,e[6]=(g*x-p*S-_*v)*I,e[7]=(u*S-d*x+f*v)*I,e[8]=(a*C-s*E+c*M)*I,e[9]=(r*E-n*C-o*M)*I,e[10]=(p*w-m*x+_*y)*I,e[11]=(h*x-u*w-f*y)*I,e[12]=(s*A-a*T-l*M)*I,e[13]=(n*T-r*A+i*M)*I,e[14]=(m*v-p*b-g*y)*I,e[15]=(u*b-h*v+d*y)*I,e):null},g.adjoint=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15];return e[0]=s*(d*_-f*g)-h*(l*_-c*g)+m*(l*f-c*d),e[1]=-(r*(d*_-f*g)-h*(i*_-o*g)+m*(i*f-o*d)),e[2]=r*(l*_-c*g)-s*(i*_-o*g)+m*(i*c-o*l),e[3]=-(r*(l*f-c*d)-s*(i*f-o*d)+h*(i*c-o*l)),e[4]=-(a*(d*_-f*g)-u*(l*_-c*g)+p*(l*f-c*d)),e[5]=n*(d*_-f*g)-u*(i*_-o*g)+p*(i*f-o*d),e[6]=-(n*(l*_-c*g)-a*(i*_-o*g)+p*(i*c-o*l)),e[7]=n*(l*f-c*d)-a*(i*f-o*d)+u*(i*c-o*l),e[8]=a*(h*_-f*m)-u*(s*_-c*m)+p*(s*f-c*h),e[9]=-(n*(h*_-f*m)-u*(r*_-o*m)+p*(r*f-o*h)),e[10]=n*(s*_-c*m)-a*(r*_-o*m)+p*(r*c-o*s),e[11]=-(n*(s*f-c*h)-a*(r*f-o*h)+u*(r*c-o*s)),e[12]=-(a*(h*g-d*m)-u*(s*g-l*m)+p*(s*d-l*h)),e[13]=n*(h*g-d*m)-u*(r*g-i*m)+p*(r*d-i*h),e[14]=-(n*(s*g-l*m)-a*(r*g-i*m)+p*(r*l-i*s)),e[15]=n*(s*d-l*h)-a*(r*d-i*h)+u*(r*l-i*s),e},g.determinant=function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15];return(t*a-n*o)*(h*g-d*m)-(t*s-r*o)*(u*g-d*p)+(t*l-i*o)*(u*m-h*p)+(n*s-r*a)*(c*g-d*f)-(n*l-i*a)*(c*m-h*f)+(r*l-i*s)*(c*p-u*f)},g.multiply=i,g.translate=function(e,t,n){var r,i,o,a,s,l,c,u,h,d,f,p,m=n[0],g=n[1],_=n[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*_+t[12],e[13]=t[1]*m+t[5]*g+t[9]*_+t[13],e[14]=t[2]*m+t[6]*g+t[10]*_+t[14],e[15]=t[3]*m+t[7]*g+t[11]*_+t[15]):(i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=r=t[0],e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=r*m+s*g+h*_+t[12],e[13]=i*m+l*g+d*_+t[13],e[14]=o*m+c*g+f*_+t[14],e[15]=a*m+u*g+p*_+t[15]),e},g.scale=function(e,t,n){var r=n[0],i=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},g.rotate=function(e,n,r,i){var o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b,w,S,M,A,E,T,C,k=i[0],I=i[1],P=i[2],R=Math.hypot(k,I,P);return R0?(r[0]=2*(c*l+d*i+u*s-h*o)/f,r[1]=2*(u*l+d*o+h*i-c*s)/f,r[2]=2*(h*l+d*s+c*o-u*i)/f):(r[0]=2*(c*l+d*i+u*s-h*o),r[1]=2*(u*l+d*o+h*i-c*s),r[2]=2*(h*l+d*s+c*o-u*i)),a(e,n,r),e},g.getTranslation=function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e},g.getScaling=s,g.getRotation=function(e,n){var r=new t.ARRAY_TYPE(3);s(r,n);var i=1/r[0],o=1/r[1],a=1/r[2],l=n[0]*i,c=n[1]*o,u=n[2]*a,h=n[4]*i,d=n[5]*o,f=n[6]*a,p=n[8]*i,m=n[9]*o,g=n[10]*a,_=l+d+g,y=0;return _>0?(y=2*Math.sqrt(_+1),e[3]=.25*y,e[0]=(f-m)/y,e[1]=(p-u)/y,e[2]=(c-h)/y):l>d&&l>g?(y=2*Math.sqrt(1+l-d-g),e[3]=(f-m)/y,e[0]=.25*y,e[1]=(c+h)/y,e[2]=(p+u)/y):d>g?(y=2*Math.sqrt(1+d-l-g),e[3]=(p-u)/y,e[0]=(c+h)/y,e[1]=.25*y,e[2]=(f+m)/y):(y=2*Math.sqrt(1+g-l-d),e[3]=(c-h)/y,e[0]=(p+u)/y,e[1]=(f+m)/y,e[2]=.25*y),e},g.fromRotationTranslationScale=function(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3],l=i+i,c=o+o,u=a+a,h=i*l,d=i*c,f=i*u,p=o*c,m=o*u,g=a*u,_=s*l,y=s*c,v=s*u,x=r[0],b=r[1],w=r[2];return e[0]=(1-(p+g))*x,e[1]=(d+v)*x,e[2]=(f-y)*x,e[3]=0,e[4]=(d-v)*b,e[5]=(1-(h+g))*b,e[6]=(m+_)*b,e[7]=0,e[8]=(f+y)*w,e[9]=(m-_)*w,e[10]=(1-(h+p))*w,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e},g.fromRotationTranslationScaleOrigin=function(e,t,n,r,i){var o=t[0],a=t[1],s=t[2],l=t[3],c=o+o,u=a+a,h=s+s,d=o*c,f=o*u,p=o*h,m=a*u,g=a*h,_=s*h,y=l*c,v=l*u,x=l*h,b=r[0],w=r[1],S=r[2],M=i[0],A=i[1],E=i[2],T=(1-(m+_))*b,C=(f+x)*b,k=(p-v)*b,I=(f-x)*w,P=(1-(d+_))*w,R=(g+y)*w,L=(p+v)*S,z=(g-y)*S,D=(1-(d+m))*S;return e[0]=T,e[1]=C,e[2]=k,e[3]=0,e[4]=I,e[5]=P,e[6]=R,e[7]=0,e[8]=L,e[9]=z,e[10]=D,e[11]=0,e[12]=n[0]+M-(T*M+I*A+L*E),e[13]=n[1]+A-(C*M+P*A+z*E),e[14]=n[2]+E-(k*M+R*A+D*E),e[15]=1,e},g.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,l=i+i,c=n*a,u=r*a,h=r*s,d=i*a,f=i*s,p=i*l,m=o*a,g=o*s,_=o*l;return e[0]=1-h-p,e[1]=u+_,e[2]=d-g,e[3]=0,e[4]=u-_,e[5]=1-c-p,e[6]=f+m,e[7]=0,e[8]=d+g,e[9]=f-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},g.frustum=function(e,t,n,r,i,o,a){var s=1/(n-t),l=1/(i-r),c=1/(o-a);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*l,e[10]=(a+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*c,e[15]=0,e},g.perspectiveNO=l,g.perspectiveZO=function(e,t,n,r,i){var o,a=1/Math.tan(t/2);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=i*(o=1/(r-i)),e[14]=i*r*o):(e[10]=-1,e[14]=-r),e},g.perspectiveFromFieldOfView=function(e,t,n,r){var i=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(a+s),c=2/(i+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(a-s)*l*.5,e[9]=(i-o)*c*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e},g.orthoNO=c,g.orthoZO=function(e,t,n,r,i,o,a){var s=1/(t-n),l=1/(r-i),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=o*c,e[15]=1,e},g.lookAt=function(e,n,i,o){var a,s,l,c,u,h,d,f,p,m,g=n[0],_=n[1],y=n[2],v=o[0],x=o[1],b=o[2],w=i[0],S=i[1],M=i[2];return Math.abs(g-w)0&&(u*=f=1/Math.sqrt(f),h*=f,d*=f);var p=l*d-c*h,m=c*u-s*d,g=s*h-l*u;return(f=p*p+m*m+g*g)>0&&(p*=f=1/Math.sqrt(f),m*=f,g*=f),e[0]=p,e[1]=m,e[2]=g,e[3]=0,e[4]=h*g-d*m,e[5]=d*p-u*g,e[6]=u*m-h*p,e[7]=0,e[8]=u,e[9]=h,e[10]=d,e[11]=0,e[12]=i,e[13]=o,e[14]=a,e[15]=1,e},g.str=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},g.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},g.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e},g.subtract=u,g.multiplyScalar=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e},g.multiplyScalarAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e[9]=t[9]+n[9]*r,e[10]=t[10]+n[10]*r,e[11]=t[11]+n[11]*r,e[12]=t[12]+n[12]*r,e[13]=t[13]+n[13]*r,e[14]=t[14]+n[14]*r,e[15]=t[15]+n[15]*r,e},g.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},g.equals=function(e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],_=e[14],y=e[15],v=n[0],x=n[1],b=n[2],w=n[3],S=n[4],M=n[5],A=n[6],E=n[7],T=n[8],C=n[9],k=n[10],I=n[11],P=n[12],R=n[13],L=n[14],z=n[15];return Math.abs(r-v)<=t.EPSILON*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-x)<=t.EPSILON*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-b)<=t.EPSILON*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-w)<=t.EPSILON*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-S)<=t.EPSILON*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(l-M)<=t.EPSILON*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(c-A)<=t.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(u-E)<=t.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-T)<=t.EPSILON*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-C)<=t.EPSILON*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(f-k)<=t.EPSILON*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(p-I)<=t.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-P)<=t.EPSILON*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(g-R)<=t.EPSILON*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(_-L)<=t.EPSILON*Math.max(1,Math.abs(_),Math.abs(L))&&Math.abs(y-z)<=t.EPSILON*Math.max(1,Math.abs(y),Math.abs(z))},g.sub=g.mul=g.ortho=g.perspective=void 0;var t=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=n(void 0);if(r&&r.has(t))return r.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=o?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(o());function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function r(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function i(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],_=t[14],y=t[15],v=n[0],x=n[1],b=n[2],w=n[3];return e[0]=v*r+x*s+b*h+w*m,e[1]=v*i+x*l+b*d+w*g,e[2]=v*o+x*c+b*f+w*_,e[3]=v*a+x*u+b*p+w*y,e[4]=(v=n[4])*r+(x=n[5])*s+(b=n[6])*h+(w=n[7])*m,e[5]=v*i+x*l+b*d+w*g,e[6]=v*o+x*c+b*f+w*_,e[7]=v*a+x*u+b*p+w*y,e[8]=(v=n[8])*r+(x=n[9])*s+(b=n[10])*h+(w=n[11])*m,e[9]=v*i+x*l+b*d+w*g,e[10]=v*o+x*c+b*f+w*_,e[11]=v*a+x*u+b*p+w*y,e[12]=(v=n[12])*r+(x=n[13])*s+(b=n[14])*h+(w=n[15])*m,e[13]=v*i+x*l+b*d+w*g,e[14]=v*o+x*c+b*f+w*_,e[15]=v*a+x*u+b*p+w*y,e}function a(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=r+r,l=i+i,c=o+o,u=r*s,h=r*l,d=r*c,f=i*l,p=i*c,m=o*c,g=a*s,_=a*l,y=a*c;return e[0]=1-(f+m),e[1]=h+y,e[2]=d-_,e[3]=0,e[4]=h-y,e[5]=1-(u+m),e[6]=p+g,e[7]=0,e[8]=d+_,e[9]=p-g,e[10]=1-(u+f),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function s(e,t){var n=t[4],r=t[5],i=t[6],o=t[8],a=t[9],s=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(n,r,i),e[2]=Math.hypot(o,a,s),e}function l(e,t,n,r,i){var o,a=1/Math.tan(t/2);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+r)*(o=1/(r-i)),e[14]=2*i*r*o):(e[10]=-1,e[14]=-2*r),e}function c(e,t,n,r,i,o,a){var s=1/(t-n),l=1/(r-i),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=(a+o)*c,e[15]=1,e}function u(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}return g.perspective=l,g.ortho=c,g.mul=i,g.sub=u,g}var y,v={},x={};function b(){if(y)return x;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}y=1,Object.defineProperty(x,"__esModule",{value:!0}),x.create=r,x.clone=function(e){var n=new t.ARRAY_TYPE(3);return n[0]=e[0],n[1]=e[1],n[2]=e[2],n},x.length=i,x.fromValues=function(e,n,r){var i=new t.ARRAY_TYPE(3);return i[0]=e,i[1]=n,i[2]=r,i},x.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},x.set=function(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e},x.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e},x.subtract=a,x.multiply=s,x.divide=l,x.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},x.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},x.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e},x.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e},x.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},x.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e},x.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e},x.distance=c,x.squaredDistance=u,x.squaredLength=h,x.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},x.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},x.normalize=function(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e},x.dot=d,x.cross=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2];return e[0]=i*l-o*s,e[1]=o*a-r*l,e[2]=r*s-i*a,e},x.lerp=function(e,t,n,r){var i=t[0],o=t[1],a=t[2];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e},x.hermite=function(e,t,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,l=a*(o-2)+o,c=a*(o-1),u=a*(3-2*o);return e[0]=t[0]*s+n[0]*l+r[0]*c+i[0]*u,e[1]=t[1]*s+n[1]*l+r[1]*c+i[1]*u,e[2]=t[2]*s+n[2]*l+r[2]*c+i[2]*u,e},x.bezier=function(e,t,n,r,i,o){var a=1-o,s=a*a,l=o*o,c=s*a,u=3*o*s,h=3*l*a,d=l*o;return e[0]=t[0]*c+n[0]*u+r[0]*h+i[0]*d,e[1]=t[1]*c+n[1]*u+r[1]*h+i[1]*d,e[2]=t[2]*c+n[2]*u+r[2]*h+i[2]*d,e},x.random=function(e,n){n=n||1;var r=2*t.RANDOM()*Math.PI,i=2*t.RANDOM()-1,o=Math.sqrt(1-i*i)*n;return e[0]=Math.cos(r)*o,e[1]=Math.sin(r)*o,e[2]=i*n,e},x.transformMat4=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e},x.transformMat3=function(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=r*n[0]+i*n[3]+o*n[6],e[1]=r*n[1]+i*n[4]+o*n[7],e[2]=r*n[2]+i*n[5]+o*n[8],e},x.transformQuat=function(e,t,n){var r=n[0],i=n[1],o=n[2],a=t[0],s=t[1],l=t[2],c=i*l-o*s,u=o*a-r*l,h=r*s-i*a,d=i*h-o*u,f=o*c-r*h,p=r*u-i*c,m=2*n[3];return u*=m,h*=m,f*=2,p*=2,e[0]=a+(c*=m)+(d*=2),e[1]=s+u+f,e[2]=l+h+p,e},x.rotateX=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},x.rotateY=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},x.rotateZ=function(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e},x.angle=function(e,t){var n=e[0],r=e[1],i=e[2],o=t[0],a=t[1],s=t[2],l=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),c=l&&d(e,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))},x.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e},x.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},x.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},x.equals=function(e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],l=n[2];return Math.abs(r-a)<=t.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=t.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-l)<=t.EPSILON*Math.max(1,Math.abs(o),Math.abs(l))},x.forEach=x.sqrLen=x.len=x.sqrDist=x.dist=x.div=x.mul=x.sub=void 0;var t=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=n(void 0);if(r&&r.has(t))return r.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=o?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(o());function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function r(){var e=new t.ARRAY_TYPE(3);return t.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function i(e){return Math.hypot(e[0],e[1],e[2])}function a(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function s(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function l(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function c(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])}function u(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i}function h(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}x.sub=a,x.mul=s,x.div=l,x.dist=c,x.sqrDist=u,x.len=i,x.sqrLen=h;var f,p=(f=r(),function(e,t,n,r,i,o){var a,s;for(t||(t=3),n||(n=0),s=r?Math.min(r*t+n,e.length):e.length,a=n;a0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a,e},M.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},M.cross=function(e,t,n,r){var i=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],l=n[1]*r[3]-n[3]*r[1],c=n[2]*r[3]-n[3]*r[2],u=t[0],h=t[1],d=t[2],f=t[3];return e[0]=h*c-d*l+f*s,e[1]=-u*c+d*a-f*o,e[2]=u*l-h*a+f*i,e[3]=-u*s+h*o-d*i,e},M.lerp=function(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e[3]=s+r*(n[3]-s),e},M.random=function(e,n){var r,i,o,a,s,l;n=n||1;do{s=(r=2*t.RANDOM()-1)*r+(i=2*t.RANDOM()-1)*i}while(s>=1);do{l=(o=2*t.RANDOM()-1)*o+(a=2*t.RANDOM()-1)*a}while(l>=1);var c=Math.sqrt((1-s)/l);return e[0]=n*r,e[1]=n*i,e[2]=n*o*c,e[3]=n*a*c,e},M.transformMat4=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e},M.transformQuat=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2],c=n[3],u=c*r+s*o-l*i,h=c*i+l*r-a*o,d=c*o+a*i-s*r,f=-a*r-s*i-l*o;return e[0]=u*c+f*-a+h*-l-d*-s,e[1]=h*c+f*-s+d*-a-u*-l,e[2]=d*c+f*-l+u*-s-h*-a,e[3]=t[3],e},M.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},M.str=function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},M.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},M.equals=function(e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],l=n[1],c=n[2],u=n[3];return Math.abs(r-s)<=t.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=t.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-c)<=t.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(a-u)<=t.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))},M.forEach=M.sqrLen=M.len=M.sqrDist=M.dist=M.div=M.mul=M.sub=void 0;var t=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=n(void 0);if(r&&r.has(t))return r.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=o?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(o());function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function r(){var e=new t.ARRAY_TYPE(4);return t.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function i(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function a(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}function s(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}function l(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2],t[3]-e[3])}function c(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return n*n+r*r+i*i+o*o}function u(e){return Math.hypot(e[0],e[1],e[2],e[3])}function h(e){var t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i}M.sub=i,M.mul=a,M.div=s,M.dist=l,M.sqrDist=c,M.len=u,M.sqrLen=h;var d,f=(d=r(),function(e,t,n,r,i,o){var a,s;for(t||(t=4),n||(n=0),s=r?Math.min(r*t+n,e.length):e.length,a=n;at.EPSILON?(e[0]=n[0]/i,e[1]=n[1]/i,e[2]=n[2]/i):(e[0]=1,e[1]=0,e[2]=0),r},v.getAngle=function(e,t){var n=_(e,t);return Math.acos(2*n*n-1)},v.multiply=u,v.rotateX=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+a*s,e[1]=i*l+o*s,e[2]=o*l-i*s,e[3]=a*l-r*s,e},v.rotateY=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l-o*s,e[1]=i*l+a*s,e[2]=o*l+r*s,e[3]=a*l-i*s,e},v.rotateZ=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+i*s,e[1]=i*l-r*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},v.calculateW=function(e,t){var n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e},v.exp=h,v.ln=d,v.pow=function(e,t,n){return d(e,t),g(e,e,n),h(e,e),e},v.slerp=f,v.random=function(e){var n=t.RANDOM(),r=t.RANDOM(),i=t.RANDOM(),o=Math.sqrt(1-n),a=Math.sqrt(n);return e[0]=o*Math.sin(2*Math.PI*r),e[1]=o*Math.cos(2*Math.PI*r),e[2]=a*Math.sin(2*Math.PI*i),e[3]=a*Math.cos(2*Math.PI*i),e},v.invert=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=o*s,e},v.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},v.fromMat3=m,v.fromEuler=function(e,t,n,r){var i=.5*Math.PI/180;t*=i,n*=i,r*=i;var o=Math.sin(t),a=Math.cos(t),s=Math.sin(n),l=Math.cos(n),c=Math.sin(r),u=Math.cos(r);return e[0]=o*l*u-a*s*c,e[1]=a*s*u+o*l*c,e[2]=a*l*c-o*s*u,e[3]=a*l*u+o*s*c,e},v.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},v.setAxes=v.sqlerp=v.rotationTo=v.equals=v.exactEquals=v.normalize=v.sqrLen=v.squaredLength=v.len=v.length=v.lerp=v.dot=v.scale=v.mul=v.add=v.set=v.copy=v.fromValues=v.clone=void 0;var t=s(o()),n=s(p()),r=s(b()),i=s(A());function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function s(t,n){if(t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=a(n);if(r&&r.has(t))return r.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var l=o?Object.getOwnPropertyDescriptor(t,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}function l(){var e=new t.ARRAY_TYPE(4);return t.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function c(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function u(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1],c=n[2],u=n[3];return e[0]=r*u+a*s+i*c-o*l,e[1]=i*u+a*l+o*s-r*c,e[2]=o*u+a*c+r*l-i*s,e[3]=a*u-r*s-i*l-o*c,e}function h(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=Math.sqrt(n*n+r*r+i*i),s=Math.exp(o),l=a>0?s*Math.sin(a)/a:0;return e[0]=n*l,e[1]=r*l,e[2]=i*l,e[3]=s*Math.cos(a),e}function d(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=Math.sqrt(n*n+r*r+i*i),s=a>0?Math.atan2(a,o)/a:0;return e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=.5*Math.log(n*n+r*r+i*i+o*o),e}function f(e,n,r,i){var o,a,s,l,c,u=n[0],h=n[1],d=n[2],f=n[3],p=r[0],m=r[1],g=r[2],_=r[3];return(a=u*p+h*m+d*g+f*_)<0&&(a=-a,p=-p,m=-m,g=-g,_=-_),1-a>t.EPSILON?(o=Math.acos(a),s=Math.sin(o),l=Math.sin((1-i)*o)/s,c=Math.sin(i*o)/s):(l=1-i,c=i),e[0]=l*u+c*p,e[1]=l*h+c*m,e[2]=l*d+c*g,e[3]=l*f+c*_,e}function m(e,t){var n,r=t[0]+t[4]+t[8];if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,e[0]=(t[5]-t[7])*(n=.5/n),e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(t[3*i+i]-t[3*o+o]-t[3*a+a]+1),e[i]=.5*n,e[3]=(t[3*o+a]-t[3*a+o])*(n=.5/n),e[o]=(t[3*o+i]+t[3*i+o])*n,e[a]=(t[3*a+i]+t[3*i+a])*n}return e}v.clone=i.clone,v.fromValues=i.fromValues,v.copy=i.copy,v.set=i.set,v.add=i.add,v.mul=u;var g=i.scale;v.scale=g;var _=i.dot;v.dot=_,v.lerp=i.lerp;var y=i.length;v.length=y,v.len=y;var x=i.squaredLength;v.squaredLength=x,v.sqrLen=x;var w=i.normalize;v.normalize=w,v.exactEquals=i.exactEquals,v.equals=i.equals;var M,E,T,C=(M=r.create(),E=r.fromValues(1,0,0),T=r.fromValues(0,1,0),function(e,t,n){var i=r.dot(t,n);return i<-.999999?(r.cross(M,E,t),r.len(M)<1e-6&&r.cross(M,T,t),r.normalize(M,M),c(e,M,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(r.cross(M,t,n),e[0]=M[0],e[1]=M[1],e[2]=M[2],e[3]=1+i,w(e,e))});v.rotationTo=C;var k,I,P=(k=l(),I=l(),function(e,t,n,r,i,o){return f(k,t,i,o),f(I,n,r,o),f(e,k,I,2*o*(1-o)),e});v.sqlerp=P;var R,L=(R=n.create(),function(e,t,n,r){return R[0]=n[0],R[3]=n[1],R[6]=n[2],R[1]=r[0],R[4]=r[1],R[7]=r[2],R[2]=-t[0],R[5]=-t[1],R[8]=-t[2],w(e,m(e,R))});return v.setAxes=L,v}var T,C={};function k(){if(T)return C;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}T=1,Object.defineProperty(C,"__esModule",{value:!0}),C.create=function(){var e=new t.ARRAY_TYPE(8);return t.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0),e[3]=1,e},C.clone=function(e){var n=new t.ARRAY_TYPE(8);return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n},C.fromValues=function(e,n,r,i,o,a,s,l){var c=new t.ARRAY_TYPE(8);return c[0]=e,c[1]=n,c[2]=r,c[3]=i,c[4]=o,c[5]=a,c[6]=s,c[7]=l,c},C.fromRotationTranslationValues=function(e,n,r,i,o,a,s){var l=new t.ARRAY_TYPE(8);l[0]=e,l[1]=n,l[2]=r,l[3]=i;var c=.5*o,u=.5*a,h=.5*s;return l[4]=c*i+u*r-h*n,l[5]=u*i+h*e-c*r,l[6]=h*i+c*n-u*e,l[7]=-c*e-u*n-h*r,l},C.fromRotationTranslation=s,C.fromTranslation=function(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=.5*t[0],e[5]=.5*t[1],e[6]=.5*t[2],e[7]=0,e},C.fromRotation=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},C.fromMat4=function(e,i){var o=n.create();r.getRotation(o,i);var a=new t.ARRAY_TYPE(3);return r.getTranslation(a,i),s(e,o,a),e},C.copy=l,C.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},C.set=function(e,t,n,r,i,o,a,s,l){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e},C.getDual=function(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e},C.setDual=function(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e},C.getTranslation=function(e,t){var n=t[4],r=t[5],i=t[6],o=t[7],a=-t[0],s=-t[1],l=-t[2],c=t[3];return e[0]=2*(n*c+o*a+r*l-i*s),e[1]=2*(r*c+o*s+i*a-n*l),e[2]=2*(i*c+o*l+n*s-r*a),e},C.translate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=.5*n[0],l=.5*n[1],c=.5*n[2],u=t[4],h=t[5],d=t[6],f=t[7];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=a*s+i*c-o*l+u,e[5]=a*l+o*s-r*c+h,e[6]=a*c+r*l-i*s+d,e[7]=-r*s-i*l-o*c+f,e},C.rotateX=function(e,t,r){var i=-t[0],o=-t[1],a=-t[2],s=t[3],l=t[4],c=t[5],u=t[6],h=t[7],d=l*s+h*i+c*a-u*o,f=c*s+h*o+u*i-l*a,p=u*s+h*a+l*o-c*i,m=h*s-l*i-c*o-u*a;return n.rotateX(e,t,r),e[4]=d*(s=e[3])+m*(i=e[0])+f*(a=e[2])-p*(o=e[1]),e[5]=f*s+m*o+p*i-d*a,e[6]=p*s+m*a+d*o-f*i,e[7]=m*s-d*i-f*o-p*a,e},C.rotateY=function(e,t,r){var i=-t[0],o=-t[1],a=-t[2],s=t[3],l=t[4],c=t[5],u=t[6],h=t[7],d=l*s+h*i+c*a-u*o,f=c*s+h*o+u*i-l*a,p=u*s+h*a+l*o-c*i,m=h*s-l*i-c*o-u*a;return n.rotateY(e,t,r),e[4]=d*(s=e[3])+m*(i=e[0])+f*(a=e[2])-p*(o=e[1]),e[5]=f*s+m*o+p*i-d*a,e[6]=p*s+m*a+d*o-f*i,e[7]=m*s-d*i-f*o-p*a,e},C.rotateZ=function(e,t,r){var i=-t[0],o=-t[1],a=-t[2],s=t[3],l=t[4],c=t[5],u=t[6],h=t[7],d=l*s+h*i+c*a-u*o,f=c*s+h*o+u*i-l*a,p=u*s+h*a+l*o-c*i,m=h*s-l*i-c*o-u*a;return n.rotateZ(e,t,r),e[4]=d*(s=e[3])+m*(i=e[0])+f*(a=e[2])-p*(o=e[1]),e[5]=f*s+m*o+p*i-d*a,e[6]=p*s+m*a+d*o-f*i,e[7]=m*s-d*i-f*o-p*a,e},C.rotateByQuatAppend=function(e,t,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=t[0],l=t[1],c=t[2],u=t[3];return e[0]=s*a+u*r+l*o-c*i,e[1]=l*a+u*i+c*r-s*o,e[2]=c*a+u*o+s*i-l*r,e[3]=u*a-s*r-l*i-c*o,e[4]=(s=t[4])*a+(u=t[7])*r+(l=t[5])*o-(c=t[6])*i,e[5]=l*a+u*i+c*r-s*o,e[6]=c*a+u*o+s*i-l*r,e[7]=u*a-s*r-l*i-c*o,e},C.rotateByQuatPrepend=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1],c=n[2],u=n[3];return e[0]=r*u+a*s+i*c-o*l,e[1]=i*u+a*l+o*s-r*c,e[2]=o*u+a*c+r*l-i*s,e[3]=a*u-r*s-i*l-o*c,e[4]=r*(u=n[7])+a*(s=n[4])+i*(c=n[6])-o*(l=n[5]),e[5]=i*u+a*l+o*s-r*c,e[6]=o*u+a*c+r*l-i*s,e[7]=a*u-r*s-i*l-o*c,e},C.rotateAroundAxis=function(e,n,r,i){if(Math.abs(i)0){n=Math.sqrt(n);var r=t[0]/n,i=t[1]/n,o=t[2]/n,a=t[3]/n,s=t[4],l=t[5],c=t[6],u=t[7],h=r*s+i*l+o*c+a*u;e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=(s-r*h)/n,e[5]=(l-i*h)/n,e[6]=(c-o*h)/n,e[7]=(u-a*h)/n}return e},C.str=function(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"},C.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]},C.equals=function(e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=n[0],d=n[1],f=n[2],p=n[3],m=n[4],g=n[5],_=n[6],y=n[7];return Math.abs(r-h)<=t.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-d)<=t.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-f)<=t.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-p)<=t.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-m)<=t.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(l-g)<=t.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-_)<=t.EPSILON*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-y)<=t.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))},C.sqrLen=C.squaredLength=C.len=C.length=C.dot=C.mul=C.setReal=C.getReal=void 0;var t=a(o()),n=a(E()),r=a(_());function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}function a(t,n){if(t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=i(n);if(r&&r.has(t))return r.get(t);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var l=a?Object.getOwnPropertyDescriptor(t,s):null;l&&(l.get||l.set)?Object.defineProperty(o,s,l):o[s]=t[s]}return o.default=t,r&&r.set(t,o),o}function s(e,t,n){var r=.5*n[0],i=.5*n[1],o=.5*n[2],a=t[0],s=t[1],l=t[2],c=t[3];return e[0]=a,e[1]=s,e[2]=l,e[3]=c,e[4]=r*c+i*l-o*s,e[5]=i*c+o*a-r*l,e[6]=o*c+r*s-i*a,e[7]=-r*a-i*s-o*l,e}function l(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function c(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[4],l=n[5],c=n[6],u=n[7],h=t[4],d=t[5],f=t[6],p=t[7],m=n[0],g=n[1],_=n[2],y=n[3];return e[0]=r*y+a*m+i*_-o*g,e[1]=i*y+a*g+o*m-r*_,e[2]=o*y+a*_+r*g-i*m,e[3]=a*y-r*m-i*g-o*_,e[4]=r*u+a*s+i*c-o*l+h*y+p*m+d*_-f*g,e[5]=i*u+a*l+o*s-r*c+d*y+p*g+f*m-h*_,e[6]=o*u+a*c+r*l-i*s+f*y+p*_+h*g-d*m,e[7]=a*u-r*s-i*l-o*c+p*y-h*m-d*g-f*_,e}C.getReal=n.copy,C.setReal=n.copy,C.mul=c;var u=n.dot;C.dot=u;var h=n.length;C.length=h,C.len=h;var d=n.squaredLength;return C.squaredLength=d,C.sqrLen=d,C}var I,P,R={};function L(){if(I)return R;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}I=1,Object.defineProperty(R,"__esModule",{value:!0}),R.create=r,R.clone=function(e){var n=new t.ARRAY_TYPE(2);return n[0]=e[0],n[1]=e[1],n},R.fromValues=function(e,n){var r=new t.ARRAY_TYPE(2);return r[0]=e,r[1]=n,r},R.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},R.set=function(e,t,n){return e[0]=t,e[1]=n,e},R.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},R.subtract=i,R.multiply=a,R.divide=s,R.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e},R.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e},R.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},R.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e},R.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e},R.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},R.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},R.distance=l,R.squaredDistance=c,R.length=u,R.squaredLength=h,R.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},R.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},R.normalize=function(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e},R.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},R.cross=function(e,t,n){var r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e},R.lerp=function(e,t,n,r){var i=t[0],o=t[1];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e},R.random=function(e,n){n=n||1;var r=2*t.RANDOM()*Math.PI;return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e},R.transformMat2=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e},R.transformMat2d=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e},R.transformMat3=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[3]*i+n[6],e[1]=n[1]*r+n[4]*i+n[7],e},R.transformMat4=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e},R.rotate=function(e,t,n,r){var i=t[0]-n[0],o=t[1]-n[1],a=Math.sin(r),s=Math.cos(r);return e[0]=i*s-o*a+n[0],e[1]=i*a+o*s+n[1],e},R.angle=function(e,t){var n=e[0],r=e[1],i=t[0],o=t[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o);return Math.acos(Math.min(Math.max(a&&(n*i+r*o)/a,-1),1))},R.zero=function(e){return e[0]=0,e[1]=0,e},R.str=function(e){return"vec2("+e[0]+", "+e[1]+")"},R.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]},R.equals=function(e,n){var r=e[0],i=e[1],o=n[0],a=n[1];return Math.abs(r-o)<=t.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=t.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))},R.forEach=R.sqrLen=R.sqrDist=R.dist=R.div=R.mul=R.sub=R.len=void 0;var t=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=n(void 0);if(r&&r.has(t))return r.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=o?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(o());function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function r(){var e=new t.ARRAY_TYPE(2);return t.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function i(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function a(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}function s(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}function l(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function c(e,t){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function u(e){return Math.hypot(e[0],e[1])}function h(e){var t=e[0],n=e[1];return t*t+n*n}R.len=u,R.sub=i,R.mul=a,R.div=s,R.dist=l,R.sqrDist=c,R.sqrLen=h;var d,f=(d=r(),function(e,t,n,r,i,o){var a,s;for(t||(t=2),n||(n=0),s=r?Math.min(r*t+n,e.length):e.length,a=n;a1)return 1;for(var n=e,r=0;r<8;r++){var i=this.sampleCurveX(n)-e;if(Math.abs(i)i?a=n:s=n,n=.5*(s-a)+a;return n},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},D}(),V=t(j);function U(){if(B)return F;function e(e,t){this.x=e,this.y=t}return B=1,F=e,e.prototype={clone:function(){return new e(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=n*this.x+t*this.y;return this.x=t*this.x-n*this.y,this.y=r,this},_rotateAround:function(e,t){var n=Math.cos(e),r=Math.sin(e),i=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=t.x+n*(this.x-t.x)-r*(this.y-t.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},e.convert=function(t){return t instanceof e?t:Array.isArray(t)?new e(t[0],t[1]):t},F}var $=t(U());function G(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n=1)return 1;const t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function K(e,t,n,r){const i=new V(e,t,n,r);return function(e){return i.solve(e)}}const J=K(.25,.1,.25,1);function Q(e,t,n){return Math.min(n,Math.max(t,e))}function ee(e,t,n){return(n=Q((n-e)/(t-e),0,1))*n*(3-2*n)}function te(e,t,n){const r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}function ne(e,t,n){if(!e.length)return n(null,[]);let r=e.length;const i=new Array(e.length);let o=null;e.forEach(((e,a)=>{t(e,((e,t)=>{e&&(o=e),i[a]=t,0==--r&&n(o,i)}))}))}function re(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{t[e]&&(t[e]=t[e].bind(t))}))}function le(e,t){return-1!==e.indexOf(t,e.length-t.length)}function ce(e,t,n){const r={};for(const i in e)r[i]=t.call(this,e[i],i,e);return r}function ue(e,t,n){const r={};for(const i in e)t.call(this,e[i],i,e)&&(r[i]=e[i]);return r}function he(e){return Array.isArray(e)?e.map(he):"object"==typeof e&&e?ce(e,he):e}const de={};function fe(e){de[e]||("undefined"!=typeof console&&console.warn(e),de[e]=!0)}function pe(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}function me(e){let t=0;for(let n,r,i=0,o=e.length,a=o-1;i@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,n,r,i)=>{const o=r||i;return t[n]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let ve,xe=null;function be(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function we(e,t,n,r){for(;t>1;e[i]>1;e[i]<=r?t=i+1:n=i}return t}function Me(e){return e>0?1/(1.001-e):1+e}function Ae(e){return e>0?1-1/(1.001-e):-e}const Ee={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==ve){const e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{ve=null!={NODE_ENV:"production",PUBLIC_URL:"/UBEMViewer",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_MAPBOX_TOKEN:"pk.eyJ1Ijoia3g2NCIsImEiOiJjbGkzd2E1dmsxMzNoM2twY2p2azF0bGVlIn0.t_v73kaAMUtoGBPESpw3uA"}.API_URL_REGEX?new RegExp({NODE_ENV:"production",PUBLIC_URL:"/UBEMViewer",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_MAPBOX_TOKEN:"pk.eyJ1Ijoia3g2NCIsImEiOiJjbGkzd2E1dmsxMzNoM2twY2p2azF0bGVlIn0.t_v73kaAMUtoGBPESpw3uA"}.API_URL_REGEX):e}catch(t){ve=e}}return ve},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!Ee.API_URL)return null;try{const e=new URL(Ee.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function Te(e){return Ee.API_URL_REGEX.test(e)}function Ce(e){return Ee.API_SPRITE_REGEX.test(e)}let ke,Ie,Pe,Re,Le,ze;function De(){return null==ke&&(ke=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ke}const Oe={now:()=>void 0!==Re?Re:performance.now(),setNow(e){Re=e},restoreNow(){Re=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const{width:n,height:r}=e;Le||(Le=document.createElement("canvas"));const i=Le.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return(n>Le.width||r>Le.height)&&(Le.width=n,Le.height=r),i.clearRect(-t,-t,n+2*t,r+2*t),i.drawImage(e,0,0,n,r),i.getImageData(-t,-t,n+2*t,r+2*t)},resolveURL:e=>(Ie||(Ie=document.createElement("a")),Ie.href=e,Ie.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==Pe&&(Pe=window.matchMedia("(prefers-reduced-motion: reduce)")),Pe.matches)},hasCanvasFingerprintNoise(){if(void 0!==ze)return ze;if(!De())return ze=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let n=0;for(let i=0;i1&&void 0!==arguments[1]?arguments[1]:{persistentParams:[]};const n=e.indexOf("?");if(n<0)return e;const r=new URLSearchParams,i=new URLSearchParams(e.slice(n));for(const a of t.persistentParams){const e=i.get(a);e&&r.set(a,e)}const o=r.toString();return`${e.slice(0,n)}${o.length>0?`?${o}`:""}`}const Ne="mapbox-tiles";let je=500,Ve=50;const Ue=["language","worldview","jobid"];let $e,Ge;function qe(){try{return caches}catch(e){}}function We(){const e=qe();e&&null==$e&&($e=e.open(Ne))}let He=1/0;const Ze={supported:!1,testSupport:function(e){!Ke&&Xe&&(Je?et(e):Ye=e)}};let Ye,Xe,Ke=!1,Je=!1;const Qe="undefined"!=typeof self?self:{};function et(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Xe),e.isContextLost())return;Ze.supported=!0}catch(e){}e.deleteTexture(t),Ke=!0}Qe.document&&(Xe=Qe.document.createElement("img"),Xe.onload=function(){Ye&&et(Ye),Ye=null,Je=!0},Xe.onerror=function(){Ke=!0,Ye=null},Xe.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const tt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(tt);class nt extends Error{constructor(e,t,n){401===t&&Te(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=n}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const rt=_e()?()=>self.worker&&self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,it=function(e,t){if(!(/^file:/.test(n=e.url)||/^file:/.test(rt())&&!/^\w+:/.test(n))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(e,t){const n=new AbortController,r=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:rt(),referrerPolicy:e.referrerPolicy,signal:n.signal});let i=!1,o=!1;const a=(s=r.url).indexOf("sku=")>0&&Te(s);var s;"json"===e.type&&r.headers.set("Accept","application/json");const l=(n,i,s)=>{if(o)return;if(n&&"SecurityError"!==n.message&&fe(n.toString()),i&&s)return c(i);const l=Date.now();fetch(r).then((n=>{if(n.ok){const e=a?n.clone():null;return c(n,e,l)}return t(new nt(n.statusText,n.status,e.url))})).catch((n=>{"AbortError"!==n.name&&t(new Error(`${n.message} ${e.url}`))}))},c=(n,a,s)=>{("arrayBuffer"===e.type?n.arrayBuffer():"json"===e.type?n.json():n.text()).then((e=>{o||(a&&s&&function(e,t,n){if(We(),null==$e)return;const r=ye(t.headers.get("Cache-Control")||"");if(r["no-store"])return;const i={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach(((e,t)=>i.headers.set(t,e))),r["max-age"]&&i.headers.set("Expires",new Date(n+1e3*r["max-age"]).toUTCString());const o=i.headers.get("Expires");if(!o)return;if(new Date(o).getTime()-n<42e4)return;let a=Be(e.url,{persistentParams:Ue});if(206===t.status){const t=e.headers.get("Range");if(!t)return;i.status=200,a=Fe(a,{range:t})}!function(e,t){if(void 0===Ge)try{new Response(new ReadableStream),Ge=!0}catch(e){Ge=!1}Ge?t(e.body):e.blob().then(t)}(t,(e=>{const n=new Response(200!==(r=t.status)&&404!==r&&[101,103,204,205,304].includes(r)?null:e,i);var r;We(),null!=$e&&$e.then((e=>e.put(a,n))).catch((e=>fe(e.message)))}))}(r,a,s),i=!0,t(null,e,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((e=>{o||t(new Error(e.message))}))};return a?function(e,t){if(We(),null==$e)return t(null);$e.then((n=>{let r=Be(e.url,{persistentParams:Ue});const i=e.headers.get("Range");i&&(r=Fe(r,{range:i})),n.match(r).then((e=>{const i=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),n=ye(e.headers.get("Cache-Control")||"");return t>Date.now()&&!n["no-cache"]}(e);n.delete(r),i&&n.put(r,e.clone()),t(null,e,i)})).catch(t)})).catch(t)}(r,l):l(null,null),{cancel:()=>{o=!0,i||n.abort()}}}(e,t);if(_e()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var n;return function(e,t){const n=new XMLHttpRequest;n.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(n.responseType="arraybuffer");for(const r in e.headers)n.setRequestHeader(r,e.headers[r]);return"json"===e.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===e.credentials,n.onerror=()=>{t(new Error(n.statusText))},n.onload=()=>{if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let r=n.response;if("json"===e.type)try{r=JSON.parse(n.response)}catch(e){return t(e)}t(null,r,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else t(new nt(n.statusText,n.status,e.url))},n.send(e.body),{cancel:()=>n.abort()}}(e,t)},ot=function(e,t){return it(re(e,{type:"arrayBuffer"}),t)};function at(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}const st="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let lt,ct;lt=[],ct=0;const ut=function(e,t){if(Ze.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),ct>=Ee.MAX_PARALLEL_IMAGE_REQUESTS){const n={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return lt.push(n),n}ct++;let n=!1;const r=()=>{if(!n)for(n=!0,ct--;lt.length&&ct{r(),e?t(e):n&&(self.createImageBitmap?function(e,t){const n=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(n).then((e=>{t(null,e)})).catch((e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(n,((e,n)=>t(e,n,i,o))):function(e,t){const n=new Image;n.onload=()=>{t(null,n),URL.revokeObjectURL(n.src),n.onload=null,requestAnimationFrame((()=>{n.src=st}))},n.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const r=new Blob([new Uint8Array(e)],{type:"image/png"});n.src=e.byteLength?URL.createObjectURL(r):st}(n,((e,n)=>t(e,n,i,o))))}));return{cancel:()=>{i.cancel(),r()}}};var ht,dt,ft,pt={exports:{}},mt={exports:{}},gt={exports:{}},_t=function(){if(ft)return pt.exports;ft=1;var e=(ht||(ht=1,mt.exports=function(e,t){var n,r,i,o,a,s,l,c;for(r=e.length-(n=3&e.length),i=t,a=3432918353,s=461845907,c=0;c>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,n){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}),mt.exports),t=(dt||(dt=1,gt.exports=function(e,t){for(var n,r=e.length,i=t^r,o=0;r>=4;)n=1540483477*(65535&(n=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:i^=(255&e.charCodeAt(o+2))<<16;case 2:i^=(255&e.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}),gt.exports);return pt.exports=e,pt.exports.murmur3=e,pt.exports.murmur2=t,pt.exports}(),yt=t(_t);class vt{constructor(e){re(this,(arguments.length<=1?void 0:arguments[1])||{}),this.type=e}}class xt extends vt{constructor(e){super("error",re({error:e},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}}function bt(e,t,n){n[e]&&-1!==n[e].indexOf(t)||(n[e]=n[e]||[],n[e].push(t))}function wt(e,t,n){if(n&&n[e]){const r=n[e].indexOf(t);-1!==r&&n[e].splice(r,1)}}class St{on(e,t){return this._listeners=this._listeners||{},bt(e,t,this._listeners),this}off(e,t){return wt(e,t,this._listeners),wt(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},bt(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){const n="string"==typeof e?new vt(e,t):e,r=n.type;if(this.listens(r)){n.target=this;const e=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of e)r.call(this,n);const t=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const o of t)wt(r,o,this._oneTimeListeners),o.call(this,n);const i=this._eventedParent;i&&(re(n,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(n))}else n instanceof xt&&console.error(n.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}var Mt,At={},Et=function(){if(Mt)return At;Mt=1;var e={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function t(e){return(e=Math.round(e))<0?0:e>255?255:e}function n(e){return t("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function r(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function i(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}try{At.parseCSSColor=function(o){var a,s=o.replace(/ /g,"").toLowerCase();if(s in e)return e[s].slice();if("#"===s[0])return 4===s.length?(a=parseInt(s.substr(1),16))>=0&&a<=4095?[(3840&a)>>4|(3840&a)>>8,240&a|(240&a)>>4,15&a|(15&a)<<4,1]:null:7===s.length&&(a=parseInt(s.substr(1),16))>=0&&a<=16777215?[(16711680&a)>>16,(65280&a)>>8,255&a,1]:null;var l=s.indexOf("("),c=s.indexOf(")");if(-1!==l&&c+1===s.length){var u=s.substr(0,l),h=s.substr(l+1,c-(l+1)).split(","),d=1;switch(u){case"rgba":if(4!==h.length)return null;d=r(h.pop());case"rgb":return 3!==h.length?null:[n(h[0]),n(h[1]),n(h[2]),d];case"hsla":if(4!==h.length)return null;d=r(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,p=r(h[1]),m=r(h[2]),g=m<=.5?m*(p+1):m+p-m*p,_=2*m-g;return[t(255*i(_,g,f+1/3)),t(255*i(_,g,f)),t(255*i(_,g,f-1/3)),d];default:return null}}return null}}catch(e){}return At}();class Tt{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.r=e,this.g=t,this.b=n,this.a=r}static parse(e){if(!e)return;if(e instanceof Tt)return e;if("string"!=typeof e)return;const t=Et.parseCSSColor(e);return t?new Tt(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3]):void 0}toString(){const[e,t,n,r]=0===this.a?[0,0,0,0]:[255*this.r/this.a,255*this.g/this.a,255*this.b/this.a,this.a];return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(n)},${r})`}toRenderColor(e){const{r:t,g:n,b:r,a:i}=this;return new Ct(e,t,n,r,i)}}class Ct{constructor(e,t,n,r,i){if(e){const o=e.image.height,a=o*o;t=0===i?0:t/i*(o-1),n=0===i?0:n/i*(o-1),r=0===i?0:r/i*(o-1);const s=Math.floor(t),l=Math.floor(n),c=Math.floor(r),u=Math.ceil(t),h=Math.ceil(n),d=Math.ceil(r),f=t-s,p=n-l,m=r-c,g=e.image.data,_=4*(s+l*a+c*o),y=4*(s+l*a+d*o),v=4*(s+h*a+c*o),x=4*(s+h*a+d*o),b=4*(u+l*a+c*o),w=4*(u+l*a+d*o),S=4*(u+h*a+c*o),M=4*(u+h*a+d*o);if(_<0||M>=g.length)throw new Error("out of range");this.r=kt(kt(kt(g[_],g[y],m),kt(g[v],g[x],m),p),kt(kt(g[b],g[w],m),kt(g[S],g[M],m),p),f)/255*i,this.g=kt(kt(kt(g[_+1],g[y+1],m),kt(g[v+1],g[x+1],m),p),kt(kt(g[b+1],g[w+1],m),kt(g[S+1],g[M+1],m),p),f)/255*i,this.b=kt(kt(kt(g[_+2],g[y+2],m),kt(g[v+2],g[x+2],m),p),kt(kt(g[b+2],g[w+2],m),kt(g[S+2],g[M+2],m),p),f)/255*i,this.a=i}else this.r=t,this.g=n,this.b=r,this.a=i}toArray(){const{r:e,g:t,b:n,a:r}=this;return 0===r?[0,0,0,0]:[255*e/r,255*t/r,255*n/r,r]}toArray01(){const{r:e,g:t,b:n,a:r}=this;return 0===r?[0,0,0,0]:[e/r,t/r,n/r,r]}toArray01Scaled(e){const{r:t,g:n,b:r,a:i}=this;return 0===i?[0,0,0]:[t/i*e,n/i*e,r/i*e]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:n,a:r}=this;return[e,t,n,r]}toArray01Linear(){const{r:e,g:t,b:n,a:r}=this;return 0===r?[0,0,0,0]:[Math.pow(e/r,2.2),Math.pow(t/r,2.2),Math.pow(n/r,2.2),r]}}function kt(e,t,n){return e*(1-n)+t*n}function It(e,t,n){return e.map(((e,r)=>kt(e,t[r],n)))}Tt.black=new Tt(0,0,0,1),Tt.white=new Tt(1,1,1,1),Tt.transparent=new Tt(0,0,0,0),Tt.red=new Tt(1,0,0,1),Tt.blue=new Tt(0,0,1,1);var Pt=Object.freeze({__proto__:null,array:It,color:function(e,t,n){return new Tt(kt(e.r,t.r,n),kt(e.g,t.g,n),kt(e.b,t.b,n),kt(e.a,t.a,n))},number:kt});function Rt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:[];this.parent=e,this.bindings={};for(const[n,r]of t)this.bindings[n]=r}concat(e){return new zt(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Dt={kind:"null"},Ot={kind:"number"},Ft={kind:"string"},Bt={kind:"boolean"},Nt={kind:"color"},jt={kind:"object"},Vt={kind:"value"},Ut={kind:"collator"},$t={kind:"formatted"},Gt={kind:"resolvedImage"};function qt(e,t){return{kind:"array",itemType:e,N:t}}function Wt(e){if("array"===e.kind){const t=Wt(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Ht=[Dt,Ot,Ft,Bt,Nt,$t,jt,qt(Vt),Gt];function Zt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Zt(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of Ht)if(!Zt(e,t))return null}return`Expected ${Wt(e)} but found ${Wt(t)} instead.`}function Yt(e,t){return t.some((t=>t.kind===e.kind))}function Xt(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}class Kt{constructor(e,t,n){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Jt{constructor(e,t,n,r,i){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i}}class Qt{constructor(e){this.sections=e}static fromString(e){return new Qt([new Jt(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.namePrimary.length))}static factory(e){return e instanceof Qt?e:Qt.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.namePrimary]);continue}e.push(t.text);const n={};t.fontStack&&(n["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(n["font-scale"]=t.scale),t.textColor&&(n["text-color"]=["rgba"].concat(t.textColor.toRenderColor(null).toArray())),e.push(n)}return e}}class en{constructor(e){this.namePrimary=e.namePrimary,e.nameSecondary&&(this.nameSecondary=e.nameSecondary),this.available=e.available}toString(){return this.nameSecondary?`[${this.namePrimary},${this.nameSecondary}]`:this.namePrimary}static fromString(e,t){return e?new en({namePrimary:e,nameSecondary:t,available:!1}):null}serialize(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}function tn(e,t,n,r){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,n,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[e,t,n,r]:[e,t,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function nn(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Tt)return!0;if(e instanceof Kt)return!0;if(e instanceof Qt)return!0;if(e instanceof en)return!0;if(Array.isArray(e)){for(const t of e)if(!nn(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!nn(e[t]))return!1;return!0}return!1}function rn(e){if(null===e)return Dt;if("string"==typeof e)return Ft;if("boolean"==typeof e)return Bt;if("number"==typeof e)return Ot;if(e instanceof Tt)return Nt;if(e instanceof Kt)return Ut;if(e instanceof Qt)return $t;if(e instanceof en)return Gt;if(Array.isArray(e)){const t=e.length;let n;for(const r of e){const e=rn(r);if(n){if(n===e)continue;n=Vt;break}n=e}return qt(n||Vt,t)}return jt}function on(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Tt||e instanceof Qt||e instanceof en?e.toString():JSON.stringify(e)}class an{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!nn(e[1]))return t.error("invalid value");const n=e[1];let r=rn(n);const i=t.expectedType;return"array"!==r.kind||0!==r.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(r=i),new an(r,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Tt?["rgba"].concat(this.value.toRenderColor(null).toArray()):this.value instanceof Qt?this.value.serialize():this.value}}class sn{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const ln={string:Ft,number:Ot,boolean:Bt,object:jt};class cn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let n,r=1;const i=e[0];if("array"===i){let i,o;if(e.length>2){const n=e[1];if("string"!=typeof n||!(n in ln)||"object"===n)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=ln[n],r++}else i=Vt;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],r++}n=qt(i,o)}else n=ln[i];const o=[];for(;re.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const n=e.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){t.push(n.kind);const r=e.N;("number"==typeof r||this.args.length>1)&&t.push(r)}}return t.concat(this.args.map((e=>e.serialize())))}}class un{constructor(e){this.type=$t,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const n=e[1];if(!Array.isArray(n)&&"object"==typeof n)return t.error("First argument must be an image or text section.");const r=[];let i=!1;for(let o=1;o<=e.length-1;++o){const n=e[o];if(i&&"object"==typeof n&&!Array.isArray(n)){i=!1;let e=null;if(n["font-scale"]&&(e=t.parseObjectValue(n["font-scale"],o,"font-scale",Ot),!e))return null;let a=null;if(n["text-font"]&&(a=t.parseObjectValue(n["text-font"],o,"text-font",qt(Ft)),!a))return null;let s=null;if(n["text-color"]&&(s=t.parseObjectValue(n["text-color"],o,"text-color",Nt),!s))return null;const l=r[r.length-1];l.scale=e,l.font=a,l.textColor=s}else{const n=t.parse(e[o],o,Vt);if(!n)return null;const a=n.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,r.push({content:n,scale:null,font:null,textColor:null})}}return new un(r)}evaluate(e){return new Qt(this.sections.map((t=>{const n=t.content.evaluate(e);return rn(n)===Gt?new Jt("",n,null,null,null):new Jt(on(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const n={};t.scale&&(n["font-scale"]=t.scale.serialize()),t.font&&(n["text-font"]=t.font.serialize()),t.textColor&&(n["text-color"]=t.textColor.serialize()),e.push(n)}return e}}class hn{constructor(e,t){this.type=Gt,this.inputPrimary=e,this.inputSecondary=t}static parse(e,t){if(e.length<2)return t.error("Expected two or more arguments.");const n=t.parse(e[1],1,Ft);if(!n)return t.error("No image name provided.");if(2===e.length)return new hn(n);const r=t.parse(e[2],1,Ft);return r?new hn(n,r):t.error("Secondary image variant is not a string.")}evaluate(e){const t=en.fromString(this.inputPrimary.evaluate(e),this.inputSecondary?this.inputSecondary.evaluate(e):void 0);return t&&e.availableImages&&(t.available=e.availableImages.indexOf(t.namePrimary)>-1,t.nameSecondary&&t.available&&e.availableImages&&(t.available=e.availableImages.indexOf(t.nameSecondary)>-1)),t}eachChild(e){e(this.inputPrimary),this.inputSecondary&&e(this.inputSecondary)}outputDefined(){return!1}serialize(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}function dn(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}const fn={"to-boolean":Bt,"to-color":Nt,"to-number":Ot,"to-string":Ft};class pn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const n=e[0],r=[];let i=Dt;if("to-array"===n){if(!Array.isArray(e[1]))return null;const n=e[1].length;if(t.expectedType){if("array"!==t.expectedType.kind)return t.error(`Expected ${t.expectedType.kind} but found array.`);i=qt(t.expectedType.itemType,n)}else{if(!(n>0&&nn(e[1][0])))return null;i=qt(rn(e[1][0]),n)}for(let o=0;o4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:tn(t[0],t[1],t[2],t[3]),!n))return new Tt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new sn(n||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const n of this.args){if(t=n.evaluate(e),null===t)return 0;const r=Number(t);if(!isNaN(r))return r}throw new sn(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?Qt.fromString(on(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?en.fromString(on(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map((t=>t.evaluate(e))):on(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new un([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new hn(this.args[0]).serialize();const e="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}const mn=["Unknown","Point","LineString","Polygon"];class gn{constructor(e,t){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=t}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?mn[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:n,y:r}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(n*t-e[0])+this.featureDistanceData.bearing[1]*(r*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Tt.parse(e)),t}getConfig(e){return this.options?this.options.get(e):null}}class _n{constructor(e,t,n,r,i){this.name=e,this.type=t,this._evaluate=n,this.args=r,this._overloadIndex=i}evaluate(e){if(!this._evaluate){const e=_n.definitions[this.name];this._evaluate=Array.isArray(e)?e[2]:e.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const n=e[0],r=_n.definitions[n];if(!r)return t.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=[];let s=null,l=-1;for(const[c,u]of o){if(Array.isArray(c)&&c.length!==e.length-1)continue;a.push(c),l++,s=new Fr(t.registry,t.path,null,t.scope,void 0,t._scope,t.options);const r=[];let o=!1;for(let t=1;t{let[t]=e;return t}))).map(yn).join(" | "),r=[];for(let i=1;i2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length-1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:wn;for(;r>n;){if(r-n>600){const o=r-n+1,a=t-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);xn(e,t,Math.max(n,Math.floor(t-a*l/o+c)),Math.min(r,Math.floor(t+(o-a)*l/o+c)),i)}const o=e[t];let a=n,s=r;for(bn(e,n,t),i(e[r],o)>0&&bn(e,n,r);a0;)s--}0===i(e[n],o)?bn(e,n,s):(s++,bn(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function bn(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function wn(e,t){return et?1:0}function Sn(e){let t=0;for(let n,r,i=0,o=e.length,a=o-1;i=t[2]||e[1]<=t[1]||e[3]>=t[3])}function En(e,t,n){const r=e[0]-t[0],i=e[1]-t[1],o=e[0]-n[0],a=e[1]-n[1];return r*a-o*i==0&&r*o<=0&&i*a<=0}function Tn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!1;for(let s=0,l=t.length;s(i=e)[1]!=(a=u)[1]>i[1]&&i[0]<(a[0]-o[0])*(i[1]-o[1])/(a[1]-o[1])+o[0]&&(r=!r)}}var i,o,a;return r}function Cn(e,t,n,r){const i=r[0]-n[0],o=r[1]-n[1],a=(e[0]-n[0])*o-i*(e[1]-n[1]),s=(t[0]-n[0])*o-i*(t[1]-n[1]);return a>0&&s<0||a<0&&s>0}function kn(e,t,n,r){return 0!=(i=[r[0]-n[0],r[1]-n[1]])[0]*(o=[t[0]-e[0],t[1]-e[1]])[1]-i[1]*o[0]&&!(!Cn(e,t,n,r)||!Cn(n,r,e,t));var i,o}const In=8192;function Pn(e,t){const n=(180+e[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=Math.pow(2,t.z);return[Math.round(n*i*In),Math.round(r*i*In)]}function Rn(e,t){for(let n=0;nn[2]){const t=.5*r;let i=e[0]-n[0]>t?-r:n[0]-e[0]>t?r:0;0===i&&(i=e[0]-n[2]>t?-r:n[2]-e[0]>t?r:0),e[0]+=i}Mn(t,e)}function Nn(e,t,n,r){const i=Math.pow(2,r.z)*In,o=[r.x*In,r.y*In],a=[];if(!e)return a;for(const s of e)for(const e of s){const r=[e.x+o[0],e.y+o[1]];Bn(r,t,n,i),a.push(r)}return a}function jn(e,t,n,r){const i=Math.pow(2,r.z)*In,o=[r.x*In,r.y*In],a=[];if(!e)return a;for(const l of e){const e=[];for(const n of l){const r=[n.x+o[0],n.y+o[1]];Mn(t,r),e.push(r)}a.push(e)}if(t[2]-t[0]<=i/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const e of a)for(const r of e)Bn(r,t,n,i)}var s;return a}class Vn{constructor(e,t){this.type=Bt,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(nn(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;et)return Zn(i,o,(t-(n-a))/a)}return e[e.length-1]}pointToSegmentDistance(e,t,n){let[r,i]=t,o=Yn(n[0]-r)*this.kx,a=(n[1]-i)*this.ky;if(0!==o||0!==a){const t=(Yn(e[0]-r)*this.kx*o+(e[1]-i)*this.ky*a)/(o*o+a*a);t>1?(r=n[0],i=n[1]):t>0&&(r+=o/this.kx*t,i+=a/this.ky*t)}return o=Yn(e[0]-r)*this.kx,a=(e[1]-i)*this.ky,Math.sqrt(o*o+a*a)}pointOnLine(e,t){let n=1/0,r=e[0][0],i=e[0][1],o=0,a=0;for(let s=0;s1?(l=e[s+1][0],c=e[s+1][1]):d>0&&(l+=u/this.kx*d,c+=h/this.ky*d)),u=Yn(t[0]-l)*this.kx,h=(t[1]-c)*this.ky;const f=u*u+h*h;fi.index||r.index===i.index&&r.t>i.t){const e=r;r=i,i=e}const o=[r.point],a=r.index+1,s=i.index;!Hn(n[a],o[0])&&a<=s&&o.push(n[a]);for(let l=a+1;l<=s;l++)o.push(n[l]);return Hn(n[s],i.point)||o.push(i.point),o}lineSliceAlong(e,t,n){let r=0;const i=[];for(let o=0;oe&&0===i.length&&i.push(Zn(a,s,(e-(r-l))/l)),r>=t)return i.push(Zn(a,s,(t-(r-l))/l)),i;r>e&&i.push(s)}return i}bufferPoint(e,t){const n=t/this.ky,r=t/this.kx;return[e[0]-r,e[1]-n,e[0]+r,e[1]+n]}bufferBBox(e,t){const n=t/this.ky,r=t/this.kx;return[e[0]-r,e[1]-n,e[2]+r,e[3]+n]}insideBBox(e,t){return Yn(e[0]-t[0])>=0&&Yn(e[0]-t[2])<=0&&e[1]>=t[1]&&e[1]<=t[3]}}function Hn(e,t){return e[0]===t[0]&&e[1]===t[1]}function Zn(e,t,n){const r=Yn(t[0]-e[0]);return[e[0]+r*n,e[1]+(t[1]-e[1])*n]}function Yn(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}class Xn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e,t)=>et?1:0;if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:n}=this,r=t[e];for(;e>0;){const i=e-1>>1,o=t[i];if(n(r,o)>=0)break;t[e]=o,e=i}t[e]=r}_down(e){const{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e=0)break;t[e]=t[r],e=r}t[e]=i}}var Kn=8192;function Jn(e,t){return t.dist-e.dist}const Qn=100,er=50;function tr(e){const t=[1/0,1/0,-1/0,-1/0];if(t.length!==e.length)return!1;for(let n=0;n=e[0]&&e[1]e[1])return[null,null];const n=nr(e);if(t){if(2===n)return[e,null];const t=Math.floor(n/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}{if(1===n)return[e,null];const t=Math.floor(n/2)-1;return[[e[0],e[0]+t],[e[0]+t+1,e[1]]]}}function or(e,t){const n=[1/0,1/0,-1/0,-1/0];if(!rr(t,e.length))return n;for(let r=t[0];r<=t[1];++r)Mn(n,e[r]);return n}function ar(e){const t=[1/0,1/0,-1/0,-1/0];for(let n=0;nt[2]&&(r=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]3&&void 0!==arguments[3]?arguments[3]:1/0;const i=ar(e),o=ar(t);if(r!==1/0&&sr(i,o,n)>=r)return r;if(An(i,o)){if(vr(e,t))return 0}else if(vr(t,e))return 0;let a=r;for(const s of e)for(let e=0,r=s.length,i=r-1;e4&&void 0!==arguments[4]?arguments[4]:1/0,o=Math.min(r.distance(e[0],n[0][0]),i);if(0===o)return o;const a=new Xn([{dist:0,range1:[0,e.length-1],range2:[0,0]}],Jn),s=t?er:Qn,l=ar(n);for(;a.length;){const i=a.pop();if(i.dist>=o)continue;const c=i.range1;if(nr(c)<=s){if(!rr(c,e.length))return NaN;if(t){const t=yr(e,c,n,r);if(0===(o=Math.min(o,t)))return o}else for(let t=c[0];t<=c[1];++t){const i=_r(e[t],n,r);if(0===(o=Math.min(o,i)))return o}}else{const n=ir(c,t);if(null!==n[0]){const t=sr(or(e,n[0]),l,r);t5&&void 0!==arguments[5]?arguments[5]:1/0,a=Math.min(o,i.distance(e[0],n[0]));if(0===a)return a;const s=new Xn([{dist:0,range1:[0,e.length-1],range2:[0,n.length-1]}],Jn),l=t?er:Qn,c=r?er:Qn;for(;s.length;){const o=s.pop();if(o.dist>=a)continue;const u=o.range1,h=o.range2;if(nr(u)<=l&&nr(h)<=c){if(!rr(u,e.length)||!rr(h,n.length))return NaN;if(t&&r?a=Math.min(a,mr(e,u,n,h,i)):t||r?t&&!r?a=Math.min(a,fr(n,h,e,u,i)):!t&&r&&(a=Math.min(a,fr(e,u,n,h,i))):a=Math.min(a,gr(e,u,n,h,i)),0===a)return a}else{const o=ir(u,t),l=ir(h,r);br(s,a,i,e,n,o[0],l[0]),br(s,a,i,e,n,o[0],l[1]),br(s,a,i,e,n,o[1],l[0]),br(s,a,i,e,n,o[1],l[1])}}return a}function Mr(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0;const o=or(e,[0,e.length-1]);for(const a of n)if(!(i!==1/0&&sr(o,or(a,[0,a.length-1]),r)>=i)&&(i=Math.min(i,Sr(e,t,a,!0,r,i)),0===i))return i;return i}function Ar(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0;const o=or(e,[0,e.length-1]);for(const a of n){if(i!==1/0&&sr(o,ar(a),r)>=i)continue;const n=wr(e,t,a,r,i);if(isNaN(n))return n;if(0===(i=Math.min(i,n)))return i}return i}function Er(e){return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}class Tr{constructor(e,t){this.type=Ot,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(nn(e[1])){const t=e[1];if("FeatureCollection"===t.type){for(let e=0;en&&(e=n),e}class Ir{constructor(e,t,n){this.type=e,this.key=t,this.scope=n}static parse(e,t){let n=t.expectedType;if(null==n&&(n=Vt),e.length<2||e.length>3)return t.error("Invalid number of arguments for 'config' expression.");const r=t.parse(e[1],1);if(!(r instanceof an))return t.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){const i=t.parse(e[2],2);return i instanceof an?new Ir(n,on(r.value),on(i.value)):t.error("Scope of 'config' expression must be a string literal.")}return new Ir(n,on(r.value))}evaluate(e){const t=[this.key,this.scope,e.scope].filter(Boolean).join("\x1f"),n=e.getConfig(t);if(!n)return null;const{type:r,value:i,values:o,minValue:a,maxValue:s,stepValue:l}=n,c=n.default.evaluate(e);let u=c;if(i){const t=e.scope;e.scope=(t||"").split("\x1f").slice(1).join("\x1f"),u=i.evaluate(e),e.scope=t}return r&&(u=Cr(r,u)),void 0===u||void 0===a&&void 0===s&&void 0===l||("number"==typeof u?u=kr(u,a,s,l):Array.isArray(u)&&(u=u.map((e=>"number"==typeof e?kr(e,a,s,l):e)))),void 0!==i&&void 0!==u&&o&&!o.includes(u)&&(u=c,r&&(u=Cr(r,u))),(r&&r!==this.type||void 0!==u&&rn(u)!==this.type)&&(u=Cr(this.type.kind,u)),u}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.key),e}}function Pr(e){if(e instanceof _n){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Vn)return!1;if(e instanceof Tr)return!1;let t=!0;return e.eachChild((e=>{t&&!Pr(e)&&(t=!1)})),t}function Rr(e){if(e instanceof _n&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!Rr(e)&&(t=!1)})),t}function Lr(e){if(e instanceof Ir)return new Set([e.key]);let t=new Set;return e.eachChild((e=>{t=new Set([...t,...Lr(e)])})),t}function zr(e,t){if(e instanceof _n&&t.indexOf(e.name)>=0)return!1;let n=!0;return e.eachChild((e=>{n&&!zr(e,t)&&(n=!1)})),n}class Dr{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const n=e[1];return t.scope.has(n)?new Dr(n,t.scope.get(n)):t.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Or{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new zt,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;this.registry=e,this.path=t,this.key=t.map((e=>"string"==typeof e?`['${e}']`:`[${e}]`)).join(""),this.scope=r,this.errors=i,this.expectedType=n,this._scope=o,this.options=a}parse(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return t||n?this.concat(t,null,n,r)._parse(e,i):this._parse(e,i)}parseObjectValue(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return this.concat(t,n,r,i)._parse(e,o)}_parse(e,t){function n(e,t,n){return"assert"===n?new cn(t,[e]):"coerce"===n?new pn(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r="string"==typeof e[0]?this.registry[e[0]]:void 0;if(r){let i=r.parse(e,this);if(!i)return null;if(this.expectedType){const e=this.expectedType,r=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==r.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==r.kind&&"string"!==r.kind){if(this.checkSubtype(e,r))return null}else i=n(i,e,t.typeAnnotation||"coerce");else i=n(i,e,t.typeAnnotation||"assert")}if(!(i instanceof an)&&"resolvedImage"!==i.type.kind&&Br(i)){const t=new gn(this._scope,this.options);try{i=new an(i.type,i.evaluate(t))}catch(e){return this.error(e.message),null}}return i}return pn.parse(["to-array",e],this)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,n,r){let i="number"==typeof e?this.path.concat(e):this.path;i="string"==typeof t?i.concat(t):i;const o=r?this.scope.concat(r):this.scope;return new Or(this.registry,i,n||null,o,this.errors,this._scope,this.options)}error(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r`[${e}]`)).join("")}`;this.errors.push(new Lt(i,e))}checkSubtype(e,t){const n=Zt(e,t);return n&&this.error(n),n}}var Fr=Or;function Br(e){if(e instanceof Dr)return Br(e.boundExpression);if(e instanceof _n&&"error"===e.name)return!1;if(e instanceof vn)return!1;if(e instanceof Vn)return!1;if(e instanceof Tr)return!1;if(e instanceof Ir)return!1;const t=e instanceof pn||e instanceof cn;let n=!0;return e.eachChild((e=>{n=t?n&&Br(e):n&&e instanceof an})),!!n&&Pr(e)&&zr(e,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function Nr(e,t){const n=e.length-1;let r,i,o=0,a=n,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),r=e[s],i=e[s+1],r<=t){if(s===n||tt))throw new sn("Input is not a number.");a=s-1}return 0}class jr{constructor(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[r,i]of n)this.labels.push(r),this.outputs.push(i)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const n=t.parse(e[1],1,Ot);if(!n)return null;const r=[];let i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let o=1;o=n)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=t.parse(a,l,i);if(!c)return null;i=i||c.type,r.push([n,c])}return new jr(i,n,r)}evaluate(e){const t=this.labels,n=this.outputs;if(1===t.length)return n[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);const i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[Nr(t,r)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}const Vr=.95047,Ur=1.08883,$r=4/29,Gr=6/29,qr=3*Gr*Gr,Wr=Gr*Gr*Gr,Hr=Math.PI/180,Zr=180/Math.PI;function Yr(e){return e>Wr?Math.pow(e,1/3):e/qr+$r}function Xr(e){return e>Gr?e*e*e:qr*(e-$r)}function Kr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Jr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Qr(e){const t=Jr(e.r),n=Jr(e.g),r=Jr(e.b),i=Yr((.4124564*t+.3575761*n+.1804375*r)/Vr),o=Yr((.2126729*t+.7151522*n+.072175*r)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Yr((.0193339*t+.119192*n+.9503041*r)/Ur)),alpha:e.a}}function ei(e){let t=(e.l+16)/116,n=isNaN(e.a)?t:t+e.a/500,r=isNaN(e.b)?t:t-e.b/200;return t=1*Xr(t),n=Vr*Xr(n),r=Ur*Xr(r),new Tt(Kr(3.2404542*n-1.5371385*t-.4985314*r),Kr(-.969266*n+1.8760108*t+.041556*r),Kr(.0556434*n-.2040259*t+1.0572252*r),e.alpha)}function ti(e,t,n){const r=t-e;return e+n*(r>180||r<-180?r-360*Math.round(r/360):r)}const ni={forward:Qr,reverse:ei,interpolate:function(e,t,n){return{l:kt(e.l,t.l,n),a:kt(e.a,t.a,n),b:kt(e.b,t.b,n),alpha:kt(e.alpha,t.alpha,n)}}},ri={forward:function(e){const{l:t,a:n,b:r}=Qr(e),i=Math.atan2(r,n)*Zr;return{h:i<0?i+360:i,c:Math.sqrt(n*n+r*r),l:t,alpha:e.a}},reverse:function(e){const t=e.h*Hr,n=e.c;return ei({l:e.l,a:Math.cos(t)*n,b:Math.sin(t)*n,alpha:e.alpha})},interpolate:function(e,t,n){return{h:ti(e.h,t.h,n),c:kt(e.c,t.c,n),l:kt(e.l,t.l,n),alpha:kt(e.alpha,t.alpha,n)}}};var ii=Object.freeze({__proto__:null,hcl:ri,lab:ni});class oi{constructor(e,t,n,r,i){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(const[o,a]of i)this.labels.push(o),this.outputs.push(a)}static interpolationFactor(e,t,n,r){let i=0;if("exponential"===e.name)i=ai(t,e.base,n,r);else if("linear"===e.name)i=ai(t,1,n,r);else if("cubic-bezier"===e.name){const o=e.controlPoints;i=new V(o[0],o[1],o[2],o[3]).solve(ai(t,1,n,r))}return i}static parse(e,t){let[n,r,i,...o]=e;if(!Array.isArray(r)||0===r.length)return t.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const e=r[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:e}}else{if("cubic-bezier"!==r[0])return t.error(`Unknown interpolation type ${String(r[0])}`,1,0);{const e=r.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(i=t.parse(i,2,Ot),!i)return null;const a=[];let s=null;"interpolate-hcl"===n||"interpolate-lab"===n?s=Nt:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let l=0;l=e)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',r);const c=t.parse(n,i,s);if(!c)return null;s=s||c.type,a.push([e,c])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new oi(s,n,r,i,a):t.error(`Type ${Wt(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,n=this.outputs;if(1===t.length)return n[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);const i=t.length;if(r>=t[i-1])return n[i-1].evaluate(e);const o=Nr(t,r),a=oi.interpolationFactor(this.interpolation,r,t[o],t[o+1]),s=n[o].evaluate(e),l=n[o+1].evaluate(e);return"interpolate"===this.operator?Pt[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?ri.reverse(ri.interpolate(ri.forward(s),ri.forward(l),a)):ni.reverse(ni.interpolate(ni.forward(s),ni.forward(l),a))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let n=0;nZt(r,e.type)));return new si(o?Vt:n,i)}evaluate(e){let t,n=null,r=0;for(const i of this.args){if(r++,n=i.evaluate(e),n&&n instanceof en&&!n.available&&(t||(t=n),n=null,r===this.args.length))return t;if(null!==n)break}return n}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class li{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const n=[];for(let i=1;i=n.length)throw new sn(`Array index out of bounds: ${t} > ${n.length-1}.`);if(t!==Math.floor(t))throw new sn(`Array index must be an integer, but found ${t} instead.`);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class ui{constructor(e,t){this.type=Bt,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,Vt),r=t.parse(e[2],2,Vt);return n&&r?Yt(n.type,[Bt,Ft,Ot,Dt,Vt])?new ui(n,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Wt(n.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(null==n)return!1;if(!Xt(t,["boolean","string","number","null"]))throw new sn(`Expected first argument to be of type boolean, string, number or null, but found ${Wt(rn(t))} instead.`);if(!Xt(n,["string","array"]))throw new sn(`Expected second argument to be of type array or string, but found ${Wt(rn(n))} instead.`);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class hi{constructor(e,t,n){this.type=Ot,this.needle=e,this.haystack=t,this.fromIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,Vt),r=t.parse(e[2],2,Vt);if(!n||!r)return null;if(!Yt(n.type,[Bt,Ft,Ot,Dt,Vt]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Wt(n.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,Ot);return i?new hi(n,r,i):null}return new hi(n,r)}evaluate(e){const t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Xt(t,["boolean","string","number","null"]))throw new sn(`Expected first argument to be of type boolean, string, number or null, but found ${Wt(rn(t))} instead.`);if(!Xt(n,["string","array"]))throw new sn(`Expected second argument to be of type array or string, but found ${Wt(rn(n))} instead.`);if(this.fromIndex){const r=this.fromIndex.evaluate(e);return n.indexOf(t,r)}return n.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class di{constructor(e,t,n,r,i,o){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let n,r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const i={},o=[];for(let l=2;lNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,rn(e)))return null}else n=rn(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=o.length}const u=t.parse(s,l,r);if(!u)return null;r=r||u.type,o.push(u)}const a=t.parse(e[1],1,Vt);if(!a)return null;const s=t.parse(e[e.length-1],e.length-1,r);return s?"value"!==a.type.kind&&t.concat(1).checkSubtype(n,a.type)?null:new di(n,r,a,i,o,s):null}evaluate(e){const t=this.input.evaluate(e);return(rn(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),n=[],r={};for(const o of t){const e=r[this.cases[o]];void 0===e?(r[this.cases[o]]=n.length,n.push([this.cases[o],[o]])):n[e][1].push(o)}const i=e=>"number"===this.inputType.kind?Number(e):e;for(const[o,a]of n)e.push(1===a.length?i(a[0]):a.map(i)),e.push(this.outputs[o].serialize());return e.push(this.otherwise.serialize()),e}}class fi{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const r=[];for(let o=1;o{let[t,n]=e;return n.outputDefined()}))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class pi{constructor(e,t,n,r){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,Vt),r=t.parse(e[2],2,Ot);if(!n||!r)return null;if(!Yt(n.type,[qt(Vt),Ft,Vt]))return t.error(`Expected first argument to be of type array or string, but found ${Wt(n.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,Ot);return i?new pi(n.type,n,r,i):null}return new pi(n.type,n,r)}evaluate(e){const t=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!Xt(t,["string","array"]))throw new sn(`Expected first argument to be of type array or string, but found ${Wt(rn(t))} instead.`);if(this.endIndex){const r=this.endIndex.evaluate(e);return t.slice(n,r)}return t.slice(n)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function mi(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function gi(e,t,n,r){return 0===r.compare(t,n)}function _i(e,t,n){const r="=="!==e&&"!="!==e;return class i{constructor(e,t,n){this.type=Bt,this.lhs=e,this.rhs=t,this.collator=n,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const n=e[0];let o=t.parse(e[1],1,Vt);if(!o)return null;if(!mi(n,o.type))return t.concat(1).error(`"${n}" comparisons are not supported for type '${Wt(o.type)}'.`);let a=t.parse(e[2],2,Vt);if(!a)return null;if(!mi(n,a.type))return t.concat(2).error(`"${n}" comparisons are not supported for type '${Wt(a.type)}'.`);if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error(`Cannot compare types '${Wt(o.type)}' and '${Wt(a.type)}'.`);r&&("value"===o.type.kind&&"value"!==a.type.kind?o=new cn(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new cn(o.type,[a])));let s=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,Ut),!s)return null}return new i(o,a,s)}evaluate(i){const o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){const t=rn(o),n=rn(a);if(t.kind!==n.kind||"string"!==t.kind&&"number"!==t.kind)throw new sn(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${n.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const e=rn(o),n=rn(a);if("string"!==e.kind||"string"!==n.kind)return t(i,o,a)}return this.collator?n(i,o,a,this.collator.evaluate(i)):t(i,o,a)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}}const yi=_i("==",(function(e,t,n){return t===n}),gi),vi=_i("!=",(function(e,t,n){return t!==n}),(function(e,t,n,r){return!gi(0,t,n,r)})),xi=_i("<",(function(e,t,n){return t",(function(e,t,n){return t>n}),(function(e,t,n,r){return r.compare(t,n)>0})),wi=_i("<=",(function(e,t,n){return t<=n}),(function(e,t,n,r){return r.compare(t,n)<=0})),Si=_i(">=",(function(e,t,n){return t>=n}),(function(e,t,n,r){return r.compare(t,n)>=0}));class Mi{constructor(e,t,n,r,i,o){this.type=Ft,this.number=e,this.locale=t,this.currency=n,this.unit=r,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const n=t.parse(e[1],1,Ot);if(!n)return null;const r=e[2];if("object"!=typeof r||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");let i=null;if(r.locale&&(i=t.parseObjectValue(r.locale,2,"locale",Ft),!i))return null;let o=null;if(r.currency&&(o=t.parseObjectValue(r.currency,2,"currency",Ft),!o))return null;let a=null;if(r.unit&&(a=t.parseObjectValue(r.unit,2,"unit",Ft),!a))return null;let s=null;if(r["min-fraction-digits"]&&(s=t.parseObjectValue(r["min-fraction-digits"],2,"min-fraction-digits",Ot),!s))return null;let l=null;return r["max-fraction-digits"]&&(l=t.parseObjectValue(r["max-fraction-digits"],2,"max-fraction-digits",Ot),!l)?null:new Mi(n,i,o,a,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class Ai{constructor(e){this.type=Ot,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const n=t.parse(e[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?t.error(`Expected argument of type string or array, but found ${Wt(n.type)} instead.`):new Ai(n):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new sn(`Expected value to be of type string or array, but found ${Wt(rn(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}function Ei(e){return function(){e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const Ti={"==":yi,"!=":vi,">":bi,"<":xi,">=":Si,"<=":wi,array:cn,at:ci,boolean:cn,case:fi,coalesce:si,collator:vn,format:un,image:hn,in:ui,"index-of":hi,interpolate:oi,"interpolate-hcl":oi,"interpolate-lab":oi,length:Ai,let:li,literal:an,match:di,number:cn,"number-format":Mi,object:cn,slice:pi,step:jr,string:cn,"to-boolean":pn,"to-color":pn,"to-number":pn,"to-string":pn,var:Dr,within:Vn,distance:Tr,config:Ir};function Ci(e,t){let[n,r,i,o]=t;n=n.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);const a=o?o.evaluate(e):1,s=tn(n,r,i,a);if(s)throw new sn(s);return new Tt(n/255*a,r/255*a,i/255*a,a)}function ki(e,t){let[n,r,i,o]=t;n=n.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);const a=o?o.evaluate(e):1,s=function(e,t,n,r){return"number"==typeof e&&e>=0&&e<=360?"number"==typeof t&&t>=0&&t<=100&&"number"==typeof n&&n>=0&&n<=100?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid hsla value [${[e,t,n,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof r?[e,t,n,r]:[e,t,n]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof r?[e,t,n,r]:[e,t,n]).join(", ")}]: 'h' must be between 0 and 360.`}(n,r,i,a);if(s)throw new sn(s);const l=`hsla(${n}, ${r}%, ${i}%, ${a})`,c=Tt.parse(l);if(!c)throw new sn(`Failed to parse HSLA color: ${l}`);return c}function Ii(e,t){return e in t}function Pi(e,t){const n=t[e];return void 0===n?null:n}function Ri(e){return{type:e}}function Li(e){return{result:"success",value:e}}function zi(e){return{result:"error",value:e}}function Di(e,t){return!!e&&!!e.parameters&&e.parameters.indexOf(t)>-1}function Oi(e){return"data-driven"===e["property-type"]}function Fi(e){return Di(e.expression,"measure-light")}function Bi(e){return Di(e.expression,"zoom")}function Ni(e){return!!e.expression&&e.expression.interpolated}function ji(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Vi(e){return e}function Ui(e,t){const n="color"===t.type,r=e.stops&&"object"==typeof e.stops[0][0],i=r||!(r||void 0!==e.property),o=e.type||(Ni(t)?"exponential":"interval");if(n&&((e=Rt({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],Tt.parse(e[1])]))),e.default=Tt.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!ii[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let a,s,l;if("exponential"===o)a=Wi;else if("interval"===o)a=qi;else if("categorical"===o){a=Gi,s=Object.create(null);for(const t of e.stops)s[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=Hi}if(r){const n={},r=[];for(let t=0;te[0])),evaluate:(n,r)=>{let{zoom:o}=n;return Wi({stops:i,base:e.base},t,o).evaluate(o,r)}}}if(i){const n="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:n,interpolationFactor:oi.interpolationFactor.bind(void 0,n),zoomStops:e.stops.map((e=>e[0])),evaluate:n=>{let{zoom:r}=n;return a(e,t,r,s,l)}}}return{kind:"source",evaluate(n,r){const i=r&&r.properties?r.properties[e.property]:void 0;return void 0===i?$i(e.default,t.default):a(e,t,i,s,l)}}}function $i(e,t,n){return void 0!==e?e:void 0!==t?t:void 0!==n?n:void 0}function Gi(e,t,n,r,i){return $i(typeof n===i?r[n]:void 0,e.default,t.default)}function qi(e,t,n){if("number"!==dn(n))return $i(e.default,t.default);const r=e.stops.length;if(1===r)return e.stops[0][1];if(n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[r-1][0])return e.stops[r-1][1];const i=Nr(e.stops.map((e=>e[0])),n);return e.stops[i][1]}function Wi(e,t,n){const r=void 0!==e.base?e.base:1;if("number"!==dn(n))return $i(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[i-1][0])return e.stops[i-1][1];const o=Nr(e.stops.map((e=>e[0])),n),a=function(e,t,n,r){const i=r-n,o=e-n;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}(n,r,e.stops[o][0],e.stops[o+1][0]),s=e.stops[o][1],l=e.stops[o+1][1];let c=Pt[t.type]||Vi;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=ii[e.colorSpace];c=(e,n)=>t.reverse(t.interpolate(t.forward(e),t.forward(n),a))}return"function"==typeof s.evaluate?{evaluate(){for(var e=arguments.length,t=new Array(e),n=0;n{let[n]=t;throw new sn(n.evaluate(e))}],typeof:[Ft,[Vt],(e,t)=>{let[n]=t;return Wt(rn(n.evaluate(e)))}],"to-rgba":[qt(Ot,4),[Nt],(e,t)=>{let[n]=t;return n.evaluate(e).toRenderColor(null).toArray()}],rgb:[Nt,[Ot,Ot,Ot],Ci],rgba:[Nt,[Ot,Ot,Ot,Ot],Ci],hsl:[Nt,[Ot,Ot,Ot],ki],hsla:[Nt,[Ot,Ot,Ot,Ot],ki],has:{type:Bt,overloads:[[[Ft],(e,t)=>{let[n]=t;return Ii(n.evaluate(e),e.properties())}],[[Ft,jt],(e,t)=>{let[n,r]=t;return Ii(n.evaluate(e),r.evaluate(e))}]]},get:{type:Vt,overloads:[[[Ft],(e,t)=>{let[n]=t;return Pi(n.evaluate(e),e.properties())}],[[Ft,jt],(e,t)=>{let[n,r]=t;return Pi(n.evaluate(e),r.evaluate(e))}]]},"feature-state":[Vt,[Ft],(e,t)=>{let[n]=t;return Pi(n.evaluate(e),e.featureState||{})}],properties:[jt,[],e=>e.properties()],"geometry-type":[Ft,[],e=>e.geometryType()],id:[Vt,[],e=>e.id()],zoom:[Ot,[],e=>e.globals.zoom],pitch:[Ot,[],e=>e.globals.pitch||0],"distance-from-center":[Ot,[],e=>e.distanceFromCenter()],"measure-light":[Ot,[Ft],(e,t)=>{let[n]=t;return e.measureLight(n.evaluate(e))}],"heatmap-density":[Ot,[],e=>e.globals.heatmapDensity||0],"line-progress":[Ot,[],e=>e.globals.lineProgress||0],"raster-value":[Ot,[],e=>e.globals.rasterValue||0],"raster-particle-speed":[Ot,[],e=>e.globals.rasterParticleSpeed||0],"sky-radial-progress":[Ot,[],e=>e.globals.skyRadialProgress||0],accumulated:[Vt,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[Ot,Ri(Ot),(e,t)=>{let n=0;for(const r of t)n+=r.evaluate(e);return n}],"*":[Ot,Ri(Ot),(e,t)=>{let n=1;for(const r of t)n*=r.evaluate(e);return n}],"-":{type:Ot,overloads:[[[Ot,Ot],(e,t)=>{let[n,r]=t;return n.evaluate(e)-r.evaluate(e)}],[[Ot],(e,t)=>{let[n]=t;return-n.evaluate(e)}]]},"/":[Ot,[Ot,Ot],(e,t)=>{let[n,r]=t;return n.evaluate(e)/r.evaluate(e)}],"%":[Ot,[Ot,Ot],(e,t)=>{let[n,r]=t;return n.evaluate(e)%r.evaluate(e)}],ln2:[Ot,[],()=>Math.LN2],pi:[Ot,[],()=>Math.PI],e:[Ot,[],()=>Math.E],"^":[Ot,[Ot,Ot],(e,t)=>{let[n,r]=t;return Math.pow(n.evaluate(e),r.evaluate(e))}],sqrt:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.sqrt(n.evaluate(e))}],log10:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.log(n.evaluate(e))/Math.LN10}],ln:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.log(n.evaluate(e))}],log2:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.log(n.evaluate(e))/Math.LN2}],sin:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.sin(n.evaluate(e))}],cos:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.cos(n.evaluate(e))}],tan:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.tan(n.evaluate(e))}],asin:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.asin(n.evaluate(e))}],acos:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.acos(n.evaluate(e))}],atan:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.atan(n.evaluate(e))}],min:[Ot,Ri(Ot),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[Ot,Ri(Ot),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.abs(n.evaluate(e))}],round:[Ot,[Ot],(e,t)=>{let[n]=t;const r=n.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.floor(n.evaluate(e))}],ceil:[Ot,[Ot],(e,t)=>{let[n]=t;return Math.ceil(n.evaluate(e))}],"filter-==":[Bt,[Ft,Vt],(e,t)=>{let[n,r]=t;return e.properties()[n.value]===r.value}],"filter-id-==":[Bt,[Vt],(e,t)=>{let[n]=t;return e.id()===n.value}],"filter-type-==":[Bt,[Ft],(e,t)=>{let[n]=t;return e.geometryType()===n.value}],"filter-<":[Bt,[Ft,Vt],(e,t)=>{let[n,r]=t;const i=e.properties()[n.value],o=r.value;return typeof i==typeof o&&i{let[n]=t;const r=e.id(),i=n.value;return typeof r==typeof i&&r":[Bt,[Ft,Vt],(e,t)=>{let[n,r]=t;const i=e.properties()[n.value],o=r.value;return typeof i==typeof o&&i>o}],"filter-id->":[Bt,[Vt],(e,t)=>{let[n]=t;const r=e.id(),i=n.value;return typeof r==typeof i&&r>i}],"filter-<=":[Bt,[Ft,Vt],(e,t)=>{let[n,r]=t;const i=e.properties()[n.value],o=r.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Bt,[Vt],(e,t)=>{let[n]=t;const r=e.id(),i=n.value;return typeof r==typeof i&&r<=i}],"filter->=":[Bt,[Ft,Vt],(e,t)=>{let[n,r]=t;const i=e.properties()[n.value],o=r.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Bt,[Vt],(e,t)=>{let[n]=t;const r=e.id(),i=n.value;return typeof r==typeof i&&r>=i}],"filter-has":[Bt,[Vt],(e,t)=>{let[n]=t;return n.value in e.properties()}],"filter-has-id":[Bt,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[Bt,[qt(Ft)],(e,t)=>{let[n]=t;return n.value.indexOf(e.geometryType())>=0}],"filter-id-in":[Bt,[qt(Vt)],(e,t)=>{let[n]=t;return n.value.indexOf(e.id())>=0}],"filter-in-small":[Bt,[Ft,qt(Vt)],(e,t)=>{let[n,r]=t;return r.value.indexOf(e.properties()[n.value])>=0}],"filter-in-large":[Bt,[Ft,qt(Vt)],(e,t)=>{let[n,r]=t;return function(e,t,n,r){for(;n<=r;){const i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}(e.properties()[n.value],r.value,0,r.value.length-1)}],all:{type:Bt,overloads:[[[Bt,Bt],(e,t)=>{let[n,r]=t;return n.evaluate(e)&&r.evaluate(e)}],[Ri(Bt),(e,t)=>{for(const n of t)if(!n.evaluate(e))return!1;return!0}]]},any:{type:Bt,overloads:[[[Bt,Bt],(e,t)=>{let[n,r]=t;return n.evaluate(e)||r.evaluate(e)}],[Ri(Bt),(e,t)=>{for(const n of t)if(n.evaluate(e))return!0;return!1}]]},"!":[Bt,[Bt],(e,t)=>{let[n]=t;return!n.evaluate(e)}],"is-supported-script":[Bt,[Ft],(e,t)=>{let[n]=t;const r=e.globals&&e.globals.isSupportedScript;return!r||r(n.evaluate(e))}],upcase:[Ft,[Ft],(e,t)=>{let[n]=t;return n.evaluate(e).toUpperCase()}],downcase:[Ft,[Ft],(e,t)=>{let[n]=t;return n.evaluate(e).toLowerCase()}],concat:[Ft,Ri(Vt),(e,t)=>t.map((t=>on(t.evaluate(e)))).join("")],"resolved-locale":[Ft,[Ut],(e,t)=>{let[n]=t;return n.evaluate(e).resolvedLocale()}],random:[Ot,[Ot,Ot,Vt],(e,t)=>{const[n,r,i]=t.map((t=>t.evaluate(e)));if(n>r)return n;if(n===r)return n;let o;if("string"==typeof i)o=function(e){let t=0;if(0===e.length)return t;for(let n=0;nJSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${e.message}`)),this._defaultValue}}}function Yi(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Ti}function Xi(e,t,n,r){const i=new Fr(Ti,[],t?function(e){const t={color:Nt,string:Ft,number:Ot,enum:Ft,boolean:Bt,formatted:$t,resolvedImage:Gt};return"array"===e.type?qt(t[e.value]||Vt,e.length):t[e.type]}(t):void 0,void 0,void 0,n,r),o=i.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Li(new Zi(o,t,n,r)):zi(i.errors)}class Ki{constructor(e,t,n){this.kind=e,this._styleExpression=t,this.isLightConstant=n,this.isStateDependent="constant"!==e&&!Rr(t.expression),this.configDependencies=Lr(t.expression)}evaluateWithoutErrorHandling(e,t,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,o)}evaluate(e,t,n,r,i,o){return this._styleExpression.evaluate(e,t,n,r,i,o)}}class Ji{constructor(e,t,n,r,i){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Rr(t.expression),this.isLightConstant=i,this.configDependencies=Lr(t.expression),this.interpolationType=r}evaluateWithoutErrorHandling(e,t,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,o)}evaluate(e,t,n,r,i,o){return this._styleExpression.evaluate(e,t,n,r,i,o)}interpolationFactor(e,t,n){return this.interpolationType?oi.interpolationFactor(this.interpolationType,e,t,n):0}}function Qi(e,t,n,r){if("error"===(e=Xi(e,t,n,r)).result)return e;const i=e.value.expression,o=Pr(i);if(!o&&!Oi(t))return zi([new Lt("","data expressions not supported")]);const a=zr(i,["zoom","pitch","distance-from-center"]);if(!a&&!Bi(t))return zi([new Lt("","zoom expressions not supported")]);const s=zr(i,["measure-light"]);if(!s&&!Fi(t))return zi([new Lt("","measure-light expression not supported")]);const l=t.expression&&t.expression.relaxZoomRestriction,c=to(i);return c||a||l?c instanceof Lt?zi([c]):c instanceof oi&&!Ni(t)?zi([new Lt("",'"interpolate" expressions cannot be used with this property')]):Li(c?new Ji(o?"camera":"composite",e.value,c.labels,c instanceof oi?c.interpolation:void 0,s):new Ki(o?"constant":"source",e.value,s)):zi([new Lt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class eo{constructor(e,t){this._parameters=e,this._specification=t,Rt(this,Ui(this._parameters,this._specification))}static deserialize(e){return new eo(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function to(e){let t=null;if(e instanceof li)t=to(e.result);else if(e instanceof si){for(const n of e.args)if(t=to(n),t)break}else(e instanceof jr||e instanceof oi)&&e.input instanceof _n&&"zoom"===e.input.name&&(t=e);return t instanceof Lt||e.eachChild((e=>{const n=to(e);n instanceof Lt?t=n:t&&n&&t!==n&&(t=new Lt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}var no,ro,io=function(){if(ro)return no;ro=1,no=t;var e=3;function t(t,n,r){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var o=new Int32Array(this.arrayBuffer);t=o[0],this.d=(n=o[1])+2*(r=o[2]);for(var a=0;a=u[f+0]&&r>=u[f+1])?(a[d]=!0,o.push(c[d])):a[d]=!1}}},t.prototype._forEachCell=function(e,t,n,r,i,o,a,s){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(n),h=this._convertToCellCoord(r),d=l;d<=u;d++)for(var f=c;f<=h;f++){var p=this.d*f+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(f),this._convertFromCellCoord(d+1),this._convertFromCellCoord(f+1)))&&i.call(this,e,t,n,r,p,o,a,s))return}},t.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},t.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},t.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,n=e+this.cells.length+1+1,r=0,i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.defineProperty(e,"_classRegistryKey",{value:t,writable:!1}),ao[t]={klass:e,omit:n.omit||[]}}so(Object,"Object"),oo.serialize=function(e,t){const n=e.toArrayBuffer();return t&&t.add(n),{buffer:n}},oo.deserialize=function(e){return new oo(e.buffer)},Object.defineProperty(oo,"name",{value:"Grid"}),so(oo,"Grid"),so(Tt,"Color"),so(Error,"Error"),so(Qt,"Formatted"),so(Jt,"FormattedSection"),so(nt,"AJAXError"),so(en,"ResolvedImage"),so(eo,"StylePropertyFunction"),so(Zi,"StyleExpression",{omit:["_evaluator"]}),so(Ji,"ZoomDependentExpression"),so(Ki,"ZoomConstantExpression"),so(_n,"CompoundExpression",{omit:["_evaluate"]});for(const wy in Ti)ao[Ti[wy]._classRegistryKey]||so(Ti[wy],`Expression${wy}`);function lo(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function co(e){return self.ImageBitmap&&e instanceof ImageBitmap}function uo(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(lo(e)||co(e))return t&&t.add(e),e;if(ArrayBuffer.isView(e)){const n=e;return t&&t.add(n.buffer),n}if(e instanceof ImageData)return t&&t.add(e.data.buffer),e;if(Array.isArray(e)){const n=[];for(const r of e)n.push(uo(r,t));return n}if(e instanceof Map){const t={$name:"Map"};for(const[n,r]of e.entries())t[n]=uo(r);return t}if(e instanceof Set){const t={$name:"Set"};let n=0;for(const r of e.values())t[++n]=uo(r);return t}if("object"==typeof e){const n=e.constructor,r=n._classRegistryKey;if(!r)throw new Error(`can't serialize object of unregistered class ${r}`);const i=n.serialize?n.serialize(e,t):{};if(!n.serialize){for(const n in e)e.hasOwnProperty(n)&&(ao[r].omit.indexOf(n)>=0||(i[n]=uo(e[n],t)));e instanceof Error&&(i.message=e.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}throw new Error("can't serialize object of type "+typeof e)}function ho(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||lo(e)||co(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(ho);if("object"==typeof e){const t=e.$name||"Object";if("Map"===t){const t=new Map;for(const n of Object.keys(e))"$name"!==n&&t.set(n,ho(e[n]));return t}if("Set"===t){const t=new Set;for(const n of Object.keys(e))"$name"!==n&&t.add(ho(e[n]));return t}const{klass:n}=ao[t];if(!n)throw new Error(`can't deserialize unregistered class ${t}`);if(n.deserialize)return n.deserialize(e);const r=Object.create(n.prototype);for(const i of Object.keys(e))"$name"!==i&&(r[i]=ho(e[i]));return r}throw new Error("can't deserialize object of type "+typeof e)}const fo={"Latin-1 Supplement":e=>e>=128&&e<=255,Arabic:e=>e>=1536&&e<=1791,"Arabic Supplement":e=>e>=1872&&e<=1919,"Arabic Extended-A":e=>e>=2208&&e<=2303,"Hangul Jamo":e=>e>=4352&&e<=4607,"Unified Canadian Aboriginal Syllabics":e=>e>=5120&&e<=5759,Khmer:e=>e>=6016&&e<=6143,"Unified Canadian Aboriginal Syllabics Extended":e=>e>=6320&&e<=6399,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"CJK Radicals Supplement":e=>e>=11904&&e<=12031,"Kangxi Radicals":e=>e>=12032&&e<=12255,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Hiragana:e=>e>=12352&&e<=12447,Katakana:e=>e>=12448&&e<=12543,Bopomofo:e=>e>=12544&&e<=12591,"Hangul Compatibility Jamo":e=>e>=12592&&e<=12687,Kanbun:e=>e>=12688&&e<=12703,"Bopomofo Extended":e=>e>=12704&&e<=12735,"CJK Strokes":e=>e>=12736&&e<=12783,"Katakana Phonetic Extensions":e=>e>=12784&&e<=12799,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"CJK Unified Ideographs Extension A":e=>e>=13312&&e<=19903,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"CJK Unified Ideographs":e=>e>=19968&&e<=40959,"Yi Syllables":e=>e>=40960&&e<=42127,"Yi Radicals":e=>e>=42128&&e<=42191,"Hangul Jamo Extended-A":e=>e>=43360&&e<=43391,"Hangul Syllables":e=>e>=44032&&e<=55215,"Hangul Jamo Extended-B":e=>e>=55216&&e<=55295,"Private Use Area":e=>e>=57344&&e<=63743,"CJK Compatibility Ideographs":e=>e>=63744&&e<=64255,"Arabic Presentation Forms-A":e=>e>=64336&&e<=65023,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Arabic Presentation Forms-B":e=>e>=65136&&e<=65279,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519,"CJK Unified Ideographs Extension B":e=>e>=131072&&e<=173791};function po(e){for(const t of e)if(_o(t.charCodeAt(0)))return!0;return!1}function mo(e){for(const t of e)if(!go(t.charCodeAt(0)))return!1;return!0}function go(e){return!(fo.Arabic(e)||fo["Arabic Supplement"](e)||fo["Arabic Extended-A"](e)||fo["Arabic Presentation Forms-A"](e)||fo["Arabic Presentation Forms-B"](e))}function _o(e){return!(746!==e&&747!==e&&(e<4352||!(fo["Bopomofo Extended"](e)||fo.Bopomofo(e)||fo["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||fo["CJK Compatibility Ideographs"](e)||fo["CJK Compatibility"](e)||fo["CJK Radicals Supplement"](e)||fo["CJK Strokes"](e)||!(!fo["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||fo["CJK Unified Ideographs Extension A"](e)||fo["CJK Unified Ideographs"](e)||fo["Enclosed CJK Letters and Months"](e)||fo["Hangul Compatibility Jamo"](e)||fo["Hangul Jamo Extended-A"](e)||fo["Hangul Jamo Extended-B"](e)||fo["Hangul Jamo"](e)||fo["Hangul Syllables"](e)||fo.Hiragana(e)||fo["Ideographic Description Characters"](e)||fo.Kanbun(e)||fo["Kangxi Radicals"](e)||fo["Katakana Phonetic Extensions"](e)||fo.Katakana(e)&&12540!==e||!(!fo["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!fo["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||fo["Unified Canadian Aboriginal Syllabics"](e)||fo["Unified Canadian Aboriginal Syllabics Extended"](e)||fo["Vertical Forms"](e)||fo["Yijing Hexagram Symbols"](e)||fo["Yi Syllables"](e)||fo["Yi Radicals"](e))))}function yo(e){return!(_o(e)||function(e){return!!(fo["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||fo["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||fo["Letterlike Symbols"](e)||fo["Number Forms"](e)||fo["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||fo["Control Pictures"](e)&&9251!==e||fo["Optical Character Recognition"](e)||fo["Enclosed Alphanumerics"](e)||fo["Geometric Shapes"](e)||fo["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||fo["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||fo["CJK Symbols and Punctuation"](e)||fo.Katakana(e)||fo["Private Use Area"](e)||fo["CJK Compatibility Forms"](e)||fo["Small Form Variants"](e)||fo["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function vo(e){return e>=1424&&e<=2303||fo["Arabic Presentation Forms-A"](e)||fo["Arabic Presentation Forms-B"](e)}function xo(e,t){return!(!t&&vo(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||fo.Khmer(e))}function bo(e){for(const t of e)if(vo(t.charCodeAt(0)))return!0;return!1}const wo="deferred",So="loading",Mo="loaded";let Ao=null,Eo="unavailable",To=null;const Co=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(Eo="error"),Ao&&Ao(e)};function ko(){Io.fire(new vt("pluginStateChange",{pluginStatus:Eo,pluginURL:To}))}const Io=new St,Po=function(){return Eo},Ro=function(){if(Eo!==wo||!To)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Eo=So,ko(),To&&ot({url:To},(e=>{e?Co(e):(Eo=Mo,ko())}))},Lo={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Eo===Mo||null!=Lo.applyArabicShaping,isLoading:()=>Eo===So,setState(e){Eo=e.pluginStatus,To=e.pluginURL},isParsed:()=>null!=Lo.applyArabicShaping&&null!=Lo.processBidirectionalText&&null!=Lo.processStyledBidirectionalText,getPluginURL:()=>To};class zo{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch,this.brightness=t.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(e,t){for(const n of e)if(!xo(n.charCodeAt(0),t))return!1;return!0}(e,Lo.isLoaded())}}class Do{constructor(e,t,n,r){this.property=e,this.value=t,this.expression=function(e,t,n,r){if(ji(e))return new eo(e,t);if(Yi(e)||Array.isArray(e)&&e.length>0){const i=Qi(e,t,n,r);if("error"===i.result)throw new Error(i.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return i.value}{let n=e;return"string"==typeof e&&"color"===t.type&&(n=Tt.parse(e)),{kind:"constant",configDependencies:new Set,evaluate:()=>n}}}(void 0===t?e.specification.default:t,e.specification,n,r)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,n){return this.property.possiblyEvaluate(this,e,t,n)}}class Oo{constructor(e,t,n){this.property=e,this.value=new Do(e,void 0,t,n)}transitioned(e,t){return new Bo(this.property,this.value,t,re({},e.transition,this.transition),e.now)}untransitioned(){return new Bo(this.property,this.value,null,{},0)}}class Fo{constructor(e,t,n){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=t,this._options=n,this.configDependencies=new Set}getValue(e){return he(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Oo(this._values[e].property,this._scope,this._options)),this._values[e].value=new Do(this._values[e].property,null===t?void 0:he(t),this._scope,this._options),this._values[e].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].value.expression.configDependencies]))}setTransitionOrValue(e,t){t&&(this._options=t);const n=this._properties.properties;if(e)for(const r in e){const t=e[r];if(le(r,"-transition")){const e=r.slice(0,-11);n[e]&&this.setTransition(e,t)}else n.hasOwnProperty(r)&&this.setValue(r,t)}}getTransition(e){return he(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Oo(this._values[e].property)),this._values[e].transition=he(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const n=this.getValue(t);void 0!==n&&(e[t]=n);const r=this.getTransition(t);void 0!==r&&(e[`${t}-transition`]=r)}return e}transitioned(e,t){const n=new No(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].transitioned(e,t._values[r]);return n}untransitioned(){const e=new No(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class Bo{constructor(e,t,n,r,i){const o=r.delay||0,a=r.duration||0;i=i||0,this.property=e,this.value=t,this.begin=i+o,this.end=this.begin+a,e.specification.transition&&(r.delay||r.duration)&&(this.prior=n)}possiblyEvaluate(e,t,n){const r=e.now||0,i=this.value.possiblyEvaluate(e,t,n),o=this.prior;if(o){if(r>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(r":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"colorTheme":{"data":{"type":"string","property-type":"data-constant","expression":{}}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"fill-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","experimental":true,"default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","experimental":true,"default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","experimental":true,"default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"experimental":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true,"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"property-type":"constant"},"line-trim-fade-range":{"type":"array","value":"number","experimental":true,"length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-trim-color":{"type":"color","experimental":true,"default":"transparent","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"property-type":"data-constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1},"default":"ground","experimental":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"experimental":true,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-particle-count":{"type":"number","default":512,"minimum":1,"property-type":"data-constant"},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1,"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1,"property-type":"data-constant"},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":[]},"property-type":"data-constant"},"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function Zo(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Yo(e){if(Array.isArray(e))return e.map(Yo);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const n in e)t[n]=Yo(e[n]);return t}return Zo(e)}function Xo(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!Xo(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function Ko(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"fill";if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Xo(e)||(e=ia(e));const i=e;let o=!0;try{o=function(e){if(!ea(e))return e;let t=Yo(e);return Qo(t),t=Jo(t),t}(i)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n `)}const a=Ho[`filter_${r}`],s=Xi(o,a,t,n);let l=null;if("error"===s.result)throw new Error(s.value.map((e=>`${e.key}: ${e.message}`)).join(", "));l=(e,t,n)=>s.value.evaluate(e,t,{},n);let c=null,u=null;if(o!==i){const e=Xi(i,a,t,n);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));c=(t,n,r,i,o)=>e.value.evaluate(t,n,{},r,void 0,void 0,i,o),u=!Pr(e.value.expression)}return{filter:l,dynamicFilter:c||void 0,needGeometry:ra(o),needFeature:!!u}}function Jo(e){if(!Array.isArray(e))return e;const t=function(e){if(ta.has(e[0]))for(let t=1;tJo(e)))}function Qo(e){let t=!1;const n=[];if("case"===e[0]){for(let r=1;r",">=","<","<=","to-boolean"]);function na(e,t){return et?1:0}function ra(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t"===t||"<="===t||">="===t?oa(e[1],e[2],t):"any"===t?(n=e.slice(1),["any"].concat(n.map(ia))):"all"===t?["all"].concat(e.slice(1).map(ia)):"none"===t?["all"].concat(e.slice(1).map(ia).map(la)):"in"===t?aa(e[1],e.slice(2)):"!in"===t?la(aa(e[1],e.slice(2))):"has"===t?sa(e[1]):"!has"!==t||la(sa(e[1]));var n}function oa(e,t,n){switch(e){case"$type":return[`filter-type-${n}`,t];case"$id":return[`filter-id-${n}`,t];default:return[`filter-${n}`,e,t]}}function aa(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(na)]]:["filter-in-small",e,["literal",t]]}}function sa(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function la(e){return["!",e]}const ca="\x1f";function ua(e,t){return t?`${e}${ca}${t}`:e}const ha="-transition",da=new Set(["fill","line","background","hillshade","raster"]);class fa extends St{constructor(e,t,n,r,i){if(super(),this.id=e.id,this.fqid=ua(this.id,n),this.type=e.type,this.scope=n,this.lut=r,this.options=i,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.configDependencies=new Set,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&"slot"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),e.slot&&(this.slot=e.slot),t.layout&&(this._unevaluatedLayout=new jo(t.layout,this.scope,i),this.configDependencies=new Set([...this.configDependencies,...this._unevaluatedLayout.configDependencies])),t.paint)){this._transitionablePaint=new Fo(t.paint,this.scope,i);for(const t in e.paint)this.setPaintProperty(t,e.paint[t]);for(const t in e.layout)this.setLayoutProperty(t,e.layout[t]);this.configDependencies=new Set([...this.configDependencies,...this._transitionablePaint.configDependencies]),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Uo(t.paint)}}onAdd(e){}onRemove(e){}isDraped(e){return!this.is3D()&&da.has(this.type)}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){if("custom"===this.type&&"visibility"===e)return void(this.visibility=t);const n=this._unevaluatedLayout;n._properties.properties[e]&&(n.setValue(e,t),this.configDependencies=new Set([...this.configDependencies,...n.configDependencies]),"visibility"===e&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0})}getPaintProperty(e){return le(e,ha)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t){const n=this._transitionablePaint,r=n._properties.properties;if(le(e,ha)){const i=e.slice(0,-11);return r[i]&&n.setTransition(i,t||void 0),!1}if(!r[e])return!1;const i=n._values[e],o=i.value.isDataDriven(),a=i.value;n.setValue(e,t),this.configDependencies=new Set([...this.configDependencies,...n.configDependencies]),this._handleSpecialPaintPropertyUpdate(e);const s=n._values[e].value,l=s.isDataDriven(),c=le(e,"pattern")||"line-dasharray"===e;return l||o||c||this._handleOverridablePaintPropertyUpdate(e,a,s)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,t,n){return null}_handleOverridablePaintPropertyUpdate(e,t,n){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){return ue({id:this.id,type:this.type,slot:this.slot,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()},((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof Vo&&Oi(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}compileFilter(e){this._filterCompiled||(this._featureFilter=Ko(this.filter,this.scope,e),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&("shadow"===e.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(e){}queryIntersectsFeature(e,t,n,r,i,o,a,s,l){}queryIntersectsMatchingFeature(e,t,n,r){}}const pa={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ma{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ga{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.add(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function _a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=0,r=0;return{members:e.map((e=>{const i=pa[e.type].BYTES_PER_ELEMENT,o=n=ya(n,Math.max(t,i)),a=e.components||1;return r=Math.max(r,i),n+=i*a,{name:e.name,type:e.type,components:a,offset:o}})),size:ya(n,Math.max(r,t)),alignment:t}}function ya(e,t){return Math.ceil(e/t)*t}class va extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){const r=2*e;return this.int16[r+0]=t,this.int16[r+1]=n,e}}va.prototype.bytesPerElement=4,so(va,"StructArrayLayout2i4");class xa extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){const i=3*e;return this.int16[i+0]=t,this.int16[i+1]=n,this.int16[i+2]=r,e}}xa.prototype.bytesPerElement=6,so(xa,"StructArrayLayout3i6");class ba extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=n,this.int16[o+2]=r,this.int16[o+3]=i,e}}ba.prototype.bytesPerElement=8,so(ba,"StructArrayLayout4i8");class wa extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i)}emplace(e,t,n,r,i,o){const a=5*e;return this.int16[a+0]=t,this.int16[a+1]=n,this.int16[a+2]=r,this.int16[a+3]=i,this.int16[a+4]=o,e}}wa.prototype.bytesPerElement=10,so(wa,"StructArrayLayout5i10");class Sa extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,r,i,o,a)}emplace(e,t,n,r,i,o,a,s){const l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=n,this.uint8[c+4]=r,this.uint8[c+5]=i,this.uint8[c+6]=o,this.uint8[c+7]=a,this.float32[u+2]=s,e}}Sa.prototype.bytesPerElement=12,so(Sa,"StructArrayLayout2i4ub1f12");class Ma extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=r,this.float32[o+3]=i,e}}Ma.prototype.bytesPerElement=16,so(Ma,"StructArrayLayout4f16");class Aa extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){const i=3*e;return this.float32[i+0]=t,this.float32[i+1]=n,this.float32[i+2]=r,e}}Aa.prototype.bytesPerElement=12,so(Aa,"StructArrayLayout3f12");class Ea extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i)}emplace(e,t,n,r,i,o){const a=6*e,s=3*e;return this.uint16[a+0]=t,this.uint16[a+1]=n,this.uint16[a+2]=r,this.uint16[a+3]=i,this.float32[s+2]=o,e}}Ea.prototype.bytesPerElement=12,so(Ea,"StructArrayLayout4ui1f12");class Ta extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=n,this.uint16[o+2]=r,this.uint16[o+3]=i,e}}Ta.prototype.bytesPerElement=8,so(Ta,"StructArrayLayout4ui8");class Ca extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i,o)}emplace(e,t,n,r,i,o,a){const s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,e}}Ca.prototype.bytesPerElement=12,so(Ca,"StructArrayLayout6i12");class ka extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,n,r,i,o,a,s,l,c,u,h)}emplace(e,t,n,r,i,o,a,s,l,c,u,h,d){const f=12*e;return this.int16[f+0]=t,this.int16[f+1]=n,this.int16[f+2]=r,this.int16[f+3]=i,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=c,this.int16[f+9]=u,this.int16[f+10]=h,this.int16[f+11]=d,e}}ka.prototype.bytesPerElement=24,so(ka,"StructArrayLayout4i4ui4i24");class Ia extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i,o)}emplace(e,t,n,r,i,o,a){const s=10*e,l=5*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.float32[l+2]=i,this.float32[l+3]=o,this.float32[l+4]=a,e}}Ia.prototype.bytesPerElement=20,so(Ia,"StructArrayLayout3i3f20");class Pa extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}Pa.prototype.bytesPerElement=4,so(Pa,"StructArrayLayout1ul4");class Ra extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){const r=2*e;return this.uint16[r+0]=t,this.uint16[r+1]=n,e}}Ra.prototype.bytesPerElement=4,so(Ra,"StructArrayLayout2ui4");class La extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,h,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,t,n,r,i,o,a,s,l,c,u,h,d)}emplace(e,t,n,r,i,o,a,s,l,c,u,h,d,f){const p=20*e,m=10*e;return this.int16[p+0]=t,this.int16[p+1]=n,this.int16[p+2]=r,this.int16[p+3]=i,this.int16[p+4]=o,this.float32[m+3]=a,this.float32[m+4]=s,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[p+14]=u,this.uint32[m+8]=h,this.uint16[p+18]=d,this.uint16[p+19]=f,e}}La.prototype.bytesPerElement=40,so(La,"StructArrayLayout5i4f1i1ul2ui40");class za extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,r,i,o,a)}emplace(e,t,n,r,i,o,a,s){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=n,this.int16[l+2]=r,this.int16[l+4]=i,this.int16[l+5]=o,this.int16[l+6]=a,this.int16[l+7]=s,e}}za.prototype.bytesPerElement=16,so(za,"StructArrayLayout3i2i2i16");class Da extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i)}emplace(e,t,n,r,i,o){const a=4*e,s=8*e;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=r,this.int16[s+6]=i,this.int16[s+7]=o,e}}Da.prototype.bytesPerElement=16,so(Da,"StructArrayLayout2f1f2i16");class Oa extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i,o)}emplace(e,t,n,r,i,o,a){const s=20*e,l=5*e;return this.uint8[s+0]=t,this.uint8[s+1]=n,this.float32[l+1]=r,this.float32[l+2]=i,this.float32[l+3]=o,this.float32[l+4]=a,e}}Oa.prototype.bytesPerElement=20,so(Oa,"StructArrayLayout2ub4f20");class Fa extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){const i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=n,this.uint16[i+2]=r,e}}Fa.prototype.bytesPerElement=6,so(Fa,"StructArrayLayout3ui6");class Ba extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x){const b=this.length;return this.resize(b+1),this.emplace(b,e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x)}emplace(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b){const w=30*e,S=15*e,M=60*e;return this.int16[w+0]=t,this.int16[w+1]=n,this.int16[w+2]=r,this.float32[S+2]=i,this.float32[S+3]=o,this.uint16[w+8]=a,this.uint16[w+9]=s,this.uint32[S+5]=l,this.uint32[S+6]=c,this.uint32[S+7]=u,this.uint16[w+16]=h,this.uint16[w+17]=d,this.uint16[w+18]=f,this.float32[S+10]=p,this.float32[S+11]=m,this.uint8[M+48]=g,this.uint8[M+49]=_,this.uint8[M+50]=y,this.uint32[S+13]=v,this.int16[w+28]=x,this.uint8[M+58]=b,e}}Ba.prototype.bytesPerElement=60,so(Ba,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Na extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b,w,S,M,A,E,T,C,k,I,P){const R=this.length;return this.resize(R+1),this.emplace(R,e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b,w,S,M,A,E,T,C,k,I,P)}emplace(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b,w,S,M,A,E,T,C,k,I,P,R){const L=20*e,z=40*e,D=80*e;return this.float32[L+0]=t,this.float32[L+1]=n,this.int16[z+4]=r,this.int16[z+5]=i,this.int16[z+6]=o,this.int16[z+7]=a,this.int16[z+8]=s,this.int16[z+9]=l,this.int16[z+10]=c,this.int16[z+11]=u,this.int16[z+12]=h,this.uint16[z+13]=d,this.uint16[z+14]=f,this.uint16[z+15]=p,this.uint16[z+16]=m,this.uint16[z+17]=g,this.uint16[z+18]=_,this.uint16[z+19]=y,this.uint16[z+20]=v,this.uint16[z+21]=x,this.uint16[z+22]=b,this.uint16[z+23]=w,this.uint16[z+24]=S,this.uint16[z+25]=M,this.uint16[z+26]=A,this.uint16[z+27]=E,this.uint32[L+14]=T,this.float32[L+15]=C,this.float32[L+16]=k,this.float32[L+17]=I,this.float32[L+18]=P,this.uint8[D+76]=R,e}}Na.prototype.bytesPerElement=80,so(Na,"StructArrayLayout2f9i15ui1ul4f1ub80");class ja extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}ja.prototype.bytesPerElement=4,so(ja,"StructArrayLayout1f4");class Va extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i)}emplace(e,t,n,r,i,o){const a=5*e;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=r,this.float32[a+3]=i,this.float32[a+4]=o,e}}Va.prototype.bytesPerElement=20,so(Va,"StructArrayLayout5f20");class Ua extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,r,i,o,a)}emplace(e,t,n,r,i,o,a,s){const l=7*e;return this.float32[l+0]=t,this.float32[l+1]=n,this.float32[l+2]=r,this.float32[l+3]=i,this.float32[l+4]=o,this.float32[l+5]=a,this.float32[l+6]=s,e}}Ua.prototype.bytesPerElement=28,so(Ua,"StructArrayLayout7f28");class $a extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=n,this.uint16[o+3]=r,this.uint16[o+4]=i,e}}$a.prototype.bytesPerElement=12,so($a,"StructArrayLayout1ul3ui12");class Ga extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}Ga.prototype.bytesPerElement=2,so(Ga,"StructArrayLayout1ui2");class qa extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){const r=2*e;return this.float32[r+0]=t,this.float32[r+1]=n,e}}qa.prototype.bytesPerElement=8,so(qa,"StructArrayLayout2f8");class Wa extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m)}emplace(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g){const _=16*e;return this.float32[_+0]=t,this.float32[_+1]=n,this.float32[_+2]=r,this.float32[_+3]=i,this.float32[_+4]=o,this.float32[_+5]=a,this.float32[_+6]=s,this.float32[_+7]=l,this.float32[_+8]=c,this.float32[_+9]=u,this.float32[_+10]=h,this.float32[_+11]=d,this.float32[_+12]=f,this.float32[_+13]=p,this.float32[_+14]=m,this.float32[_+15]=g,e}}Wa.prototype.bytesPerElement=64,so(Wa,"StructArrayLayout16f64");class Ha extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,r,i,o,a)}emplace(e,t,n,r,i,o,a,s){const l=10*e,c=5*e;return this.uint16[l+0]=t,this.uint16[l+1]=n,this.uint16[l+2]=r,this.uint16[l+3]=i,this.float32[c+2]=o,this.float32[c+3]=a,this.float32[c+4]=s,e}}Ha.prototype.bytesPerElement=20,so(Ha,"StructArrayLayout4ui3f20");class Za extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.int16[1*e+0]=t,e}}Za.prototype.bytesPerElement=2,so(Za,"StructArrayLayout1i2");class Ya extends ga{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint8[1*e+0]=t,e}}Ya.prototype.bytesPerElement=1,so(Ya,"StructArrayLayout1ub1");class Xa extends ma{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Xa.prototype.size=40;class Ka extends La{get(e){return new Xa(this,e)}}so(Ka,"CollisionBoxArray");class Ja extends ma{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}Ja.prototype.size=60;class Qa extends Ba{get(e){return new Ja(this,e)}}so(Qa,"PlacedSymbolArray");class es extends ma{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}}es.prototype.size=80;class ts extends Na{get(e){return new es(this,e)}}so(ts,"SymbolInstanceArray");class ns extends ja{getoffsetX(e){return this.float32[1*e+0]}}so(ns,"GlyphOffsetArray");class rs extends va{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}so(rs,"SymbolLineVertexArray");class is extends ma{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}is.prototype.size=12;class os extends $a{get(e){return new is(this,e)}}so(os,"FeatureIndexArray");class as extends Ra{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}so(as,"FillExtrusionCentroidArray");class ss extends ma{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}ss.prototype.size=6;class ls extends xa{get(e){return new ss(this,e)}}so(ls,"FillExtrusionWallArray");const cs=_a([{name:"a_pos",components:2,type:"Int16"}],4),us=_a([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class hs{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.segments=e}_prepareSegment(e,t,n,r){let i=this.segments[this.segments.length-1];return e>hs.MAX_VERTEX_ARRAY_LENGTH&&fe(`Max vertices per segment is ${hs.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!i||i.vertexLength+e>hs.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r)&&(i={vertexOffset:t,primitiveOffset:n,vertexLength:0,primitiveLength:0},void 0!==r&&(i.sortKey=r),this.segments.push(i)),i}prepareSegment(e,t,n,r){return this._prepareSegment(e,t.length,n.length,r)}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,n,r){return new hs([{vertexOffset:e,primitiveOffset:t,vertexLength:n,primitiveLength:r,vaos:{},sortKey:0}])}}function ds(e,t){return 256*(e=Q(Math.floor(e),0,255))+Q(Math.floor(t),0,255)}hs.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,so(hs,"SegmentVector");const fs=_a([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),ps=_a([{name:"a_dash",components:4,type:"Uint16"}]);class ms{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,t,n,r){this.ids.push(gs(e)),this.positions.push(t,n,r)}eachPosition(e,t){const n=gs(e);let r=0,i=this.ids.length-1;for(;r>1;this.ids[e]>=n?i=e:r=e+1}for(;this.ids[r]===n;)t(this.positions[3*r],this.positions[3*r+1],this.positions[3*r+2]),r++}static serialize(e,t){const n=new Float64Array(e.ids),r=new Uint32Array(e.positions);return _s(n,r,0,n.length-1),t&&(t.add(n.buffer),t.add(r.buffer)),{ids:n,positions:r}}static deserialize(e){const t=new ms;let n;t.ids=e.ids,t.positions=e.positions;for(const r of t.ids)r!==n&&t.uniqueIds.push(r),n=r;return t.indexed=!0,t}}function gs(e){const t=+e;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:yt(String(e))}function _s(e,t,n,r){for(;n>1];let o=n-1,a=r+1;for(;;){do{o++}while(e[o]i);if(o>=a)break;ys(e,o,a),ys(t,3*o,3*a),ys(t,3*o+1,3*a+1),ys(t,3*o+2,3*a+2)}a-n`u_${e}`)),this.type=n,this.context=r}setUniform(e,t,n,r,i){const o=r.constantOr(this.value);t.set(e,i,o instanceof Tt?o.toRenderColor(this.context.lut):o)}getBinding(e,t){return"color"===this.type?new As(e):new bs(e)}}class Ls{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,t,n,r,i){const o="u_pattern"===i||"u_dash"===i?this.pattern:"u_pixel_ratio"===i?this.pixelRatio:null;o&&t.set(e,i,o)}getBinding(e,t){return"u_pattern"===t||"u_dash"===t?new Ms(e):new bs(e)}}class zs{constructor(e,t,n,r){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===n?2:1,offset:0}))),this.paintVertexArray=new r}populatePaintArray(e,t,n,r,i,o,a){const s=this.paintVertexArray.length,l=this.expression.evaluate(new zo(0,{brightness:o}),t,{},i,r,a);this.paintVertexArray.resize(e),this._setPaintValue(s,e,l,this.context)}updatePaintArray(e,t,n,r,i,o,a){const s=this.expression.evaluate({zoom:0,brightness:a},n,r,void 0,i);this._setPaintValue(e,t,s,this.context)}_setPaintValue(e,t,n,r){if("color"===this.type){const i=Ps(n.toRenderColor(r.lut));for(let n=e;n`u_${e}_t`)),this.type=n,this.useIntegerZoom=r,this.context=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===n?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,n,r,i,o,a){const s=this.expression.evaluate(new zo(this.context.zoom,{brightness:o}),t,{},i,r,a),l=this.expression.evaluate(new zo(this.context.zoom+1,{brightness:o}),t,{},i,r,a),c=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(c,e,s,l,this.context)}updatePaintArray(e,t,n,r,i,o,a){const s=this.expression.evaluate({zoom:this.context.zoom,brightness:a},n,r,void 0,i),l=this.expression.evaluate({zoom:this.context.zoom+1,brightness:a},n,r,void 0,i);this._setPaintValue(e,t,s,l,this.context)}_setPaintValue(e,t,n,r,i){if("color"===this.type){const r=Ps(n.toRenderColor(i.lut)),o=Ps(n.toRenderColor(i.lut));for(let n=e;n2&&void 0!==arguments[2]?arguments[2]:()=>!0;this.binders={},this._buffers=[],this.context=t;const r=[];for(const i in e.paint._values){const o=e.paint.get(i);if(!n(i))continue;if(!(o instanceof Vo&&Oi(o.property.specification)))continue;const a=js(i,e.type),s=o.value,l=o.property.specification.type,c=!!o.property.useIntegerZoom,u="line-dasharray"===i||i.endsWith("pattern"),h="line-dasharray"===i&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==s.kind||h)if("source"===s.kind||h||u){const t=$s(i,l,"source");this.binders[i]=u?new Os(s,a,l,t,e.id):new zs(s,a,l,t),r.push(`/a_${i}`)}else{const e=$s(i,l,"composite");this.binders[i]=new Ds(s,a,l,c,t,e),r.push(`/z_${i}`)}else this.binders[i]=u?new Ls(s.value,a):new Rs(s.value,a,l,t),r.push(`/u_${i}`)}this.cacheKey=r.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof zs||t instanceof Ds?t.maxValue:0}populatePaintArrays(e,t,n,r,i,o,a){for(const s in this.binders){const l=this.binders[s];l.context=this.context,(l instanceof zs||l instanceof Ds||l instanceof Os)&&l.populatePaintArray(e,t,n,r,i,o,a)}}setConstantPatternPositions(e){for(const t in this.binders){const n=this.binders[t];n instanceof Ls&&n.setConstantPatternPositions(e)}}updatePaintArrays(e,t,n,r,i,o,a,s){let l=!1;const c=Object.keys(e),u=0!==c.length,h=u?c:t.uniqueIds;this.context.lut=i.lut;for(const d in this.binders){const c=this.binders[d];if(c.context=this.context,(c instanceof zs||c instanceof Ds||c instanceof Os)&&(!0===c.expression.isStateDependent||!1===c.expression.isLightConstant)){const f=i.paint.get(d);c.expression=f.value;for(const n of h){const i=e[n.toString()];t.eachPosition(n,((e,t,n)=>{const l=r.feature(e);c.updatePaintArray(t,n,l,i,o,a,s)}))}if(!u)for(const t of n.uniqueIds){const i=e[t.toString()];n.eachPosition(t,((e,t,n)=>{const l=r.feature(e);c.updatePaintArray(t,n,l,i,o,a,s)}))}l=!0}}return l}defines(){const e=[];for(const t in this.binders){const n=this.binders[t];(n instanceof Rs||n instanceof Ls)&&e.push(...n.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const n=this.binders[t];if(n instanceof zs||n instanceof Ds||n instanceof Os)for(let t=0;t2&&void 0!==arguments[2]?arguments[2]:()=>!0;this.programConfigurations={};for(const r of e)this.programConfigurations[r.id]=new Fs(r,t,n);this.needsUpload=!1,this._featureMap=new ms,this._featureMapWithoutIds=new ms,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,t,n,r,i,o,a,s){for(const l in this.programConfigurations)this.programConfigurations[l].populatePaintArrays(e,t,r,i,o,a,s);void 0!==t.id?this._featureMap.add(t.id,n,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,n,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,n,r,i,o){for(const a of n)this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,t,a,r,i,o||0)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Ns={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"symbol-z-offset":["z_offset"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function js(e,t){return Ns[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const Vs={"line-pattern":{source:Ea,composite:Ea},"fill-pattern":{source:Ea,composite:Ea},"fill-extrusion-pattern":{source:Ea,composite:Ea},"line-dasharray":{source:Ta,composite:Ta}},Us={color:{source:qa,composite:Ma},number:{source:ja,composite:qa}};function $s(e,t,n){const r=Vs[e];return r&&r[n]||Us[t][n]}so(Rs,"ConstantBinder"),so(Ls,"PatternConstantBinder"),so(zs,"SourceExpressionBinder"),so(Os,"PatternCompositeBinder"),so(Ds,"CompositeExpressionBinder"),so(Fs,"ProgramConfiguration",{omit:["_buffers"]}),so(Bs,"ProgramConfigurationSet");const Gs=Kn/Math.PI/2,qs=5,Ws=6,Hs=16383,Zs=64,Ys=[Zs,32,16],Xs=-Gs,Ks=Gs;function Js(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Gs;return n=H(n),[e*Math.sin(n)*r,-t*r,e*Math.cos(n)*r]}function Qs(e,t,n){return Js(Math.cos(H(e)),Math.sin(H(e)),t,n)}const el=6371008.8,tl=2*Math.PI*el;class nl{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new nl(te(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return el*Math.acos(Math.min(i,1))}toBounds(){const e=360*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)/40075017,t=e/Math.cos(Math.PI/180*this.lat);return new rl({lng:this.lng-t,lat:this.lat-e},{lng:this.lng+t,lat:this.lat+e})}toEcef(e){return Qs(this.lat,this.lng,Gs+e*Gs/el)}static convert(e){if(e instanceof nl)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new nl(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new nl(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class rl{constructor(e,t){if(e)if(t)this.setSouthWest(e).setNorthEast(t);else if(4===e.length){const t=e;this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]])}else{const t=e;this.setSouthWest(t[0]).setNorthEast(t[1])}}setNorthEast(e){return this._ne=e instanceof nl?new nl(e.lng,e.lat):nl.convert(e),this}setSouthWest(e){return this._sw=e instanceof nl?new nl(e.lng,e.lat):nl.convert(e),this}extend(e){const t=this._sw,n=this._ne;let r,i;if(e instanceof nl)r=e,i=e;else{if(!(e instanceof rl))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(rl.convert(e)):this.extend(nl.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(nl.convert(e)):this;if(r=e._sw,i=e._ne,!r||!i)return this}return t||n?(t.lng=Math.min(r.lng,t.lng),t.lat=Math.min(r.lat,t.lat),n.lng=Math.max(i.lng,n.lng),n.lat=Math.max(i.lat,n.lat)):(this._sw=new nl(r.lng,r.lat),this._ne=new nl(i.lng,i.lat)),this}getCenter(){return new nl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new nl(this.getWest(),this.getNorth())}getSouthEast(){return new nl(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:n}=nl.convert(e);let r=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(r=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&r}static convert(e){if(e)return e instanceof rl?e:new rl(e)}}const il=0,ol=25.5;function al(e){return tl*Math.cos(e*Math.PI/180)}function sl(e){return(180+e)/360}function ll(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function cl(e,t){return e/al(t)}function ul(e){return 360*e-180}function hl(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function dl(e,t){return e*al(hl(t))}const fl=85.051129;function pl(e){return Math.cos(H(Q(e,-fl,fl)))}function ml(e,t){const n=Q(t,il,ol),r=Math.pow(2,n);return pl(e)*tl/(512*r)}function gl(e){return 1/Math.cos(e*Math.PI/180)}function _l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=Math.exp(Math.PI*(1-(e.y+t/Kn)/(1<2&&void 0!==arguments[2]?arguments[2]:0;this.x=+e,this.y=+t,this.z=+n}static fromLngLat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=nl.convert(e);return new yl(sl(n.lng),ll(n.lat),cl(t,n.lat))}toLngLat(){return new nl(ul(this.x),hl(this.y))}toAltitude(){return dl(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/tl*gl(hl(this.y))}}function vl(e,t,n,r,i,o,a,s,l){const c=(t+r)/2,u=(n+i)/2,h=new $(c,u);s(h),function(e,t,n,r,i,o){const a=n-i,s=r-o;return Math.abs((r-t)*a-(n-e)*s)/Math.hypot(a,s)}(h.x,h.y,o.x,o.y,a.x,a.y)>=l?(vl(e,t,n,c,u,o,h,s,l),vl(e,c,u,r,i,h,a,s,l)):e.push(a)}function xl(e,t,n){let r=e[0],i=r.x,o=r.y;t(r);const a=[r];for(let s=1;se.x+1||re.y+1)&&fe("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function El(e,t,n){const r=e.loadGeometry(),i=e.extent,o=Kn/i;if(t&&n&&n.projection.isReprojectedInTileSpace){const o=1<{const n=ul((t.x+e.x/i)/o),r=hl((t.y+e.y/i)/o),u=c.project(n,r);e.x=(u.x*a-s)*i,e.y=(u.y*a-l)*i};for(let t=0;t=i||n.y<0||n.y>=i||(u(n),e.push(n));r[t]=e}}for(const a of r)for(const e of a)Al(e,o);return r}function Tl(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?El(e):[]}}function Cl(e,t,n,r,i){e.emplaceBack(2*t+(r+1)/2,2*n+(i+1)/2)}function kl(e,t,n){const r=16384;e.emplaceBack(t.x,t.y,t.z,n[0]*r,n[1]*r,n[2]*r)}class Il{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new va,this.indexArray=new Fa,this.segments=new hs,this.programConfigurations=new Bs(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}updateFootprints(e,t){}populate(e,t,n,r){const i=this.layers[0],o=[];let a=null;"circle"===i.type&&(a=i.layout.get("circle-sort-key"));for(const{feature:l,id:c,index:u,sourceLayerIndex:h}of e){const e=this.layers[0]._featureFilter.needGeometry,t=Tl(l,e);if(!this.layers[0]._featureFilter.filter(new zo(this.zoom),t,n))continue;const i=a?a.evaluate(t,{},n):void 0,s={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:e?t.geometry:El(l,n,r),patterns:{},sortKey:i};o.push(s)}a&&o.sort(((e,t)=>e.sortKey-t.sortKey));let s=null;"globe"===r.projection.name&&(this.globeExtVertexArray=new Ca,s=r.projection);for(const l of o){const{geometry:r,index:i,sourceLayerIndex:o}=l,a=e[i].feature;this.addFeature(l,r,i,t.availableImages,n,s,t.brightness),t.featureIndex.insert(a,r,i,o,this.index)}}update(e,t,n,r,i){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,n,r,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,cs.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,us.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,t,n,r,i,o,a){for(const s of t)for(const t of s){const n=t.x,r=t.y;if(n<0||n>=Kn||r<0||r>=Kn)continue;if(o){const e=o.projectTilePoint(n,r,i),t=o.upVector(i,n,r),a=this.globeExtVertexArray;kl(a,e,t),kl(a,e,t),kl(a,e,t),kl(a,e,t)}const a=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),s=a.vertexLength;Cl(this.layoutVertexArray,n,r,-1,-1),Cl(this.layoutVertexArray,n,r,1,-1),Cl(this.layoutVertexArray,n,r,1,1),Cl(this.layoutVertexArray,n,r,-1,1),this.indexArray.emplaceBack(s,s+1,s+2),this.indexArray.emplaceBack(s,s+2,s+3),a.vertexLength+=4,a.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},r,i,a)}}function Pl(e,t){for(let n=0;n1){if(Dl(e,t))return!0;for(let r=0;r1?n:n.sub(t)._mult(i)._add(t))}function Nl(e,t){let n,r,i,o=!1;for(let a=0;at.y!=i.y>t.y&&t.x<(i.x-r.x)*(t.y-r.y)/(i.y-r.y)+r.x&&(o=!o)}return o}function jl(e,t){let n=!1;for(let r=0,i=e.length-1;rt.y!=a.y>t.y&&t.x<(a.x-o.x)*(t.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}function Vl(e,t,n,r,i){for(const a of e)if(t<=a.x&&n<=a.y&&r>=a.x&&i>=a.y)return!0;const o=[new $(t,n),new $(t,i),new $(r,i),new $(r,n)];if(e.length>2)for(const a of o)if(jl(e,a))return!0;for(let a=0;ai.x&&t.x>i.x||e.yi.y&&t.y>i.y)return!1;const o=pe(e,t,n[0]);return o!==pe(e,t,n[1])||o!==pe(e,t,n[2])||o!==pe(e,t,n[3])}function $l(e,t,n,r,i,o){let a=t.y-e.y,s=e.x-t.x;if(o=o||0){const e=a*a+s*s;if(0===e)return!0;const t=Math.sqrt(e);a/=t,s/=t}return!((n.x-e.x)*a+(n.y-e.y)*s-o<0||(r.x-e.x)*a+(r.y-e.y)*s-o<0||(i.x-e.x)*a+(i.y-e.y)*s-o<0)}function Gl(e,t,n,r,i,o,a){return!($l(e,t,r,i,o,a)||$l(t,n,r,i,o,a)||$l(n,e,r,i,o,a)||$l(r,i,e,t,n,a)||$l(i,o,e,t,n,a)||$l(o,r,e,t,n,a))}function ql(e,t,n){const r=t.paint.get(e).value;return"constant"===r.kind?r.value:n.programConfigurations.get(t.id).getMaxValue(e)}function Wl(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Hl(e,t,n,r,i){if(!t[0]&&!t[1])return e;const o=$.convert(t)._mult(i);"viewport"===n&&o._rotate(-r);const a=[];for(let s=0;s0;o--)r=1<this.canonical.z?new nc(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new nc(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return rc(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const n=this.canonical.z-e;return rc(this.wrap*+t,e,e,this.canonical.x>>n,this.canonical.y>>n)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new nc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,n=2*this.canonical.x,r=2*this.canonical.y;return[new nc(t,this.wrap,t,n,r),new nc(t,this.wrap,t,n+1,r),new nc(t,this.wrap,t,n,r+1),new nc(t,this.wrap,t,n+1,r+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y{let t=e.canonical.x-1,n=e.wrap;return t<0&&(t=(1<{let t=e.canonical.x+1,n=e.wrap;return t===1<new nc(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<new nc(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<=0;if(0===o)return 0;o!==t.length&&(n=!1)}return n?2:1}function fc(e,t){for(const n of e.projections){const r=hc(t,e.points[0],n.axis);if(n.projection[1]r[1])return 0}return 1}function pc(e,t){let n=0;const r=[0,0,0,0];for(let i=0;i=0&&n++;return n}class mc{constructor(e,t){this.points=e||new Array(8).fill([0,0,0]),this.planes=t||new Array(6).fill([0,0,0,0]),this.bounds=gc.fromPoints(this.points),this.projections=[],this.frustumEdges=[N.vec3.sub([],this.points[2],this.points[3]),N.vec3.sub([],this.points[0],this.points[3]),N.vec3.sub([],this.points[4],this.points[0]),N.vec3.sub([],this.points[5],this.points[1]),N.vec3.sub([],this.points[6],this.points[2]),N.vec3.sub([],this.points[7],this.points[3])];for(const n of this.frustumEdges){const e=[0,-n[2],n[1]],t=[n[2],0,-n[0]];this.projections.push({axis:e,projection:hc(this.points,this.points[0],e)}),this.projections.push({axis:t,projection:hc(this.points,this.points[0],t)})}}static fromInvProjectionMatrix(e,t,n,r){const i=Math.pow(2,n),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((n=>{const o=N.vec4.transformMat4([],n,e),a=1/o[3]/t*i;return N.vec4.mul(o,o,[a,a,r?1/o[3]:a,a])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((e=>{const t=N.vec3.sub([],o[e[0]],o[e[1]]),n=N.vec3.sub([],o[e[2]],o[e[1]]),r=N.vec3.normalize([],N.vec3.cross([],t,n)),i=-N.vec3.dot(r,o[e[1]]);return r.concat(i)})),s=[];for(let l=0;la[1]||a[0]>o[1])return 0}return 1}containsPoint(e){for(const t of this.planes){const n=t[3];if(N.vec3.dot([t[0],t[1],t[2]],e)+n<0)return!1}return!0}}class gc{static fromPoints(e){const t=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];for(const r of e)N.vec3.min(t,t,r),N.vec3.max(n,n,r);return new gc(t,n)}static fromTileIdAndHeight(e,t,n){const r=1<e.max[t]||e.min[t]>this.max[t])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e.min[t]),this.max[t]=Math.max(this.max[t],e.max[t])}encapsulatePoint(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e[t]),this.max[t]=Math.max(this.max[t],e[t])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}function _c(e){return e*Gs/el}so(gc,"Aabb");const yc=[new gc([Xs,Xs,Xs],[Ks,Ks,Ks]),new gc([Xs,Xs,Xs],[0,0,Ks]),new gc([0,Xs,Xs],[Ks,0,Ks]),new gc([Xs,0,Xs],[0,Ks,Ks]),new gc([0,0,Xs],[Ks,Ks,Ks])];function vc(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const i=N.vec3.scale([],e._camera.position,e.worldSize),o=[t,n,1,1];N.vec4.transformMat4(o,o,e.pixelMatrixInverse),N.vec4.scale(o,o,1/o[3]);const a=N.vec3.sub([],o,i),s=N.vec3.normalize([],a),l=e.globeMatrix,c=[l[12],l[13],l[14]],u=N.vec3.sub([],c,i),h=N.vec3.length(u),d=N.vec3.normalize([],u),f=e.worldSize/(2*Math.PI),p=N.vec3.dot(d,s),m=Math.asin(f/h);if(m1?null:function(e,t,n,r){const i=Math.sin(n);return e*(Math.sin((1-r)*n)/i)+t*(Math.sin(r*n)/i)}(e.a[t],e.b[t],e.angle,Q(n,0,1))+e.center[t]}function wc(e){if(e.z<=1)return yc[e.z+2*e.y+e.x];const t=Tc(Ec(e));return gc.fromPoints(t)}function Sc(e,t,n){return N.vec3.scale(e,e,1-n),N.vec3.scaleAndAdd(e,e,t,n)}function Mc(e,t,n){for(const r of e)N.vec3.transformMat4(r,r,t),N.vec3.scale(r,r,n)}function Ac(e,t,n,r){const i=t/e.worldSize,o=e.globeMatrix;if(n.z<=1){const e=wc(n).getCorners();return Mc(e,o,i),gc.fromPoints(e)}const a=Ec(n,r),s=Tc(a,Gs+_c(e._tileCoverLift));Mc(s,o,i);const l=Number.MAX_VALUE,c=[-l,-l,-l],u=[l,l,l];if(a.contains(e.center)){for(const e of s)N.vec3.min(u,u,e),N.vec3.max(c,c,e);c[2]=0;const t=e.point,n=[t.x*i,t.y*i,0];return N.vec3.min(u,u,n),N.vec3.max(c,c,n),new gc(u,c)}if(e._tileCoverLift>0){for(const e of s)N.vec3.min(u,u,e),N.vec3.max(c,c,e);return new gc(u,c)}const h=[o[12]*i,o[13]*i,o[14]*i],d=a.getCenter(),f=Q(e.center.lat,-fl,fl),p=Q(d.lat,-fl,fl),m=sl(e.center.lng),g=ll(f);let _=m-sl(d.lng);const y=g-ll(p);_>.5?_-=1:_<-.5&&(_+=1);let v=0;if(Math.abs(_)>Math.abs(y))v=_>=0?1:3;else{v=y>=0?0:2;const e=[o[4]*i,o[5]*i,o[6]*i],t=-Math.sin(H(y>=0?a.getSouth():a.getNorth()))*Gs;N.vec3.scaleAndAdd(h,h,e,t)}const x=s[v],b=s[(v+1)%4],w=new xc(x,b,h),S=[bc(w,0)||x[0],bc(w,1)||x[1],bc(w,2)||x[2]],M=Oc(e.zoom);if(M>0){const r=function(e,t,n,r,i){let{x:o,y:a,z:s}=e;const l=1/(1<.5?f=-1:p<-.5&&(f=1),c=((c+f)*t-(r*=t))*n+r,u=((u+f)*t-r)*n+r,h=(h*t-(i*=t))*n+i,d=(d*t-i)*n+i,[[c,d,0],[u,d,0],[u,h,0],[c,h,0]]}(n,t,e._pixelsPerMercatorPixel,m,g);for(let e=0;e1&&void 0!==arguments[1]&&arguments[1];const o=1/(1<1&&void 0!==arguments[1]?arguments[1]:Gs;const n=H(e.getNorth()),r=H(e.getSouth()),i=Math.cos(n),o=Math.cos(r),a=Math.sin(n),s=Math.sin(r),l=e.getWest(),c=e.getEast();return[Js(o,s,l,t),Js(o,s,c,t),Js(i,a,c,t),Js(i,a,l,t)]}function Cc(e,t,n,r){const i=1<Math.PI/2*1.01}const Nc=H(85),jc=Math.cos(Nc),Vc=Math.sin(Nc),Uc=N.mat4.create(),$c=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t};function Gc(e,t,n,r,i,o,a,s,l){if(o&&e.queryGeometry.isAboveHorizon)return!1;o&&(l*=e.pixelToTileUnitsFactor);const c=e.tileID.canonical,u=n.projection.upVectorScale(c,n.center.lat,n.worldSize).metersToTile;for(const h of t)for(const t of h){const h=t.add(s),d=i&&n.elevation?n.elevation.exaggeration()*i.getElevationAt(h.x,h.y,!0):0,f=n.projection.projectTilePoint(h.x,h.y,c);if(d>0){const e=n.projection.upVector(c,h.x,h.y);f.x+=e[0]*u*d,f.y+=e[1]*u*d,f.z+=e[2]*u*d}const p=o?h:qc(f.x,f.y,f.z,r),m=o?e.tilespaceRays.map((e=>Zc(e,d))):e.queryGeometry.screenGeometry,g=N.vec4.transformMat4([],[f.x,f.y,f.z,1],r);if(!a&&o?l*=g[3]/n.cameraToCenterDistance:a&&!o&&(l*=n.cameraToCenterDistance/g[3]),o){const e=hl((t.y/Kn+c.y)/(1<e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const l=e.data,c=t.data,u=4===o&&s;for(let h=0;h{t[e.evaluationKey]=o;const a=e.expression.evaluate(t);a&&(i.data[n+r+0]=Math.floor(255*a.r/a.a),i.data[n+r+1]=Math.floor(255*a.g/a.a),i.data[n+r+2]=Math.floor(255*a.b/a.a),i.data[n+r+3]=Math.floor(255*a.a))};if(e.clips)for(let a=0,s=0;a2&&void 0!==arguments[2]?arguments[2]:2;const r=t&&t.length,i=r?t[0]*n:e.length;let o=uu(e,0,i,n,!0);const a=[];if(!o||o.next===o.prev)return a;let s,l,c;if(r&&(o=function(e,t,n,r){const i=[];for(let o=0,a=t.length;o80*n){s=1/0,l=1/0;let t=-1/0,r=-1/0;for(let o=n;ot&&(t=n),i>r&&(r=i)}c=Math.max(t-s,r-l),c=0!==c?32767/c:0}return du(o,a,n,s,l,c,0),a}function uu(e,t,n,r,i){let o;if(i===function(e,t,n,r){let i=0;for(let o=t,a=n-r;o0)for(let a=t;a=t;a-=r)o=Pu(a/r|0,e[a],e[a+1],o);return o&&Au(o,o.next)&&(Ru(o),o=o.next),o}function hu(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!Au(r,r.next)&&0!==Mu(r.prev,r,r.next))r=r.next;else{if(Ru(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function du(e,t,n,r,i,o,a){if(!e)return;!a&&o&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=xu(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n=1;do{let r,i=e;e=null;let o=null;for(t=0;i;){t++;let a=i,s=0;for(let e=0;e0||l>0&&a;)0!==s&&(0===l||!a||i.z<=a.z)?(r=i,i=i.nextZ,s--):(r=a,a=a.nextZ,l--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;i=a}o.nextZ=null,n*=2}while(t>1)}(i)}(e,r,i,o);let s=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(o?pu(e,r,i,o):fu(e))t.push(l.i,e.i,c.i),Ru(e),e=c.next,s=c.next;else if((e=c)===s){a?1===a?du(e=mu(hu(e),t),t,n,r,i,o,2):2===a&&gu(e,t,n,r,i,o):du(hu(e),t,n,r,i,o,1);break}}}function fu(e){const t=e.prev,n=e,r=e.next;if(Mu(t,n,r)>=0)return!1;const i=t.x,o=n.x,a=r.x,s=t.y,l=n.y,c=r.y,u=io?i>a?i:a:o>a?o:a,f=s>l?s>c?s:c:l>c?l:c;let p=r.next;for(;p!==t;){if(p.x>=u&&p.x<=d&&p.y>=h&&p.y<=f&&wu(i,s,o,l,a,c,p.x,p.y)&&Mu(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function pu(e,t,n,r){const i=e.prev,o=e,a=e.next;if(Mu(i,o,a)>=0)return!1;const s=i.x,l=o.x,c=a.x,u=i.y,h=o.y,d=a.y,f=sl?s>c?s:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,_=xu(f,p,t,n,r),y=xu(m,g,t,n,r);let v=e.prevZ,x=e.nextZ;for(;v&&v.z>=_&&x&&x.z<=y;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==i&&v!==a&&wu(s,u,l,h,c,d,v.x,v.y)&&Mu(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==i&&x!==a&&wu(s,u,l,h,c,d,x.x,x.y)&&Mu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=_;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==i&&v!==a&&wu(s,u,l,h,c,d,v.x,v.y)&&Mu(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==i&&x!==a&&wu(s,u,l,h,c,d,x.x,x.y)&&Mu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function mu(e,t){let n=e;do{const r=n.prev,i=n.next.next;!Au(r,i)&&Eu(r,n,n.next,i)&&ku(r,i)&&ku(i,r)&&(t.push(r.i,n.i,i.i),Ru(n),Ru(n.next),n=e=i),n=n.next}while(n!==e);return hu(n)}function gu(e,t,n,r,i,o){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&Su(a,e)){let s=Iu(a,e);return a=hu(a,a.next),s=hu(s,s.next),du(a,t,n,r,i,o,0),void du(s,t,n,r,i,o,0)}e=e.next}a=a.next}while(a!==e)}function _u(e,t){return e.x-t.x}function yu(e,t){const n=function(e,t){let n=t;const r=e.x,i=e.y;let o,a=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x=n.x&&n.x>=l&&r!==n.x&&wu(io.x||n.x===o.x&&vu(o,n)))&&(o=n,u=t)}n=n.next}while(n!==s);return o}(e,t);if(!n)return t;const r=Iu(n,e);return hu(r,r.next),hu(n,n.next)}function vu(e,t){return Mu(e.prev,e,t.prev)<0&&Mu(t.next,e,e.next)<0}function xu(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function bu(e){let t=e,n=e;do{(t.x=(e-a)*(o-s)&&(e-a)*(r-s)>=(n-a)*(t-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function Su(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Eu(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(ku(e,t)&&ku(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Mu(e.prev,e,t.prev)||Mu(e,t.prev,t))||Au(e,t)&&Mu(e.prev,e,e.next)>0&&Mu(t.prev,t,t.next)>0)}function Mu(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Au(e,t){return e.x===t.x&&e.y===t.y}function Eu(e,t,n,r){const i=Cu(Mu(e,t,n)),o=Cu(Mu(e,t,r)),a=Cu(Mu(n,r,e)),s=Cu(Mu(n,r,t));return i!==o&&a!==s||!(0!==i||!Tu(e,n,t))||!(0!==o||!Tu(e,r,t))||!(0!==a||!Tu(n,e,r))||!(0!==s||!Tu(n,t,r))}function Tu(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Cu(e){return e>0?1:e<0?-1:0}function ku(e,t){return Mu(e.prev,e,e.next)<0?Mu(e,t,e.next)>=0&&Mu(e,e.prev,t)>=0:Mu(e,t,e.prev)<0||Mu(e,e.next,t)<0}function Iu(e,t){const n=Lu(e.i,e.x,e.y),r=Lu(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Pu(e,t,n,r){const i=Lu(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ru(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Lu(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function zu(e,t){const n=e.length;if(n<=1)return[e];const r=[];let i,o;for(let a=0;a1)for(let a=0;ae.fqid)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new va,this.indexArray=new Fa,this.indexArray2=new Ra,this.programConfigurations=new Bs(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new hs,this.segments2=new hs,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.projection=e.projection}updateFootprints(e,t){}populate(e,t,n,r){this.hasPattern=Ou("fill",this.layers,t);const i=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:a,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Tl(a,e);if(!this.layers[0]._featureFilter.filter(new zo(this.zoom),u,n))continue;const h=i?i.evaluate(u,{},n,t.availableImages):void 0,d={id:s,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:El(a,n,r),patterns:{},sortKey:h};o.push(d)}i&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const a of o){const{geometry:r,index:i,sourceLayerIndex:o}=a;if(this.hasPattern){const e=Fu("fill",this.layers,a,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(a,r,i,n,{},t.availableImages,t.brightness);t.featureIndex.insert(e[i].feature,r,i,o,this.index)}}update(e,t,n,r,i){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,n,r,i)}addFeatures(e,t,n,r,i,o){for(const a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,t,n,r,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,lu),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],a=arguments.length>6?arguments[6]:void 0;for(const s of zu(t,500)){let e=0;for(const a of s)e+=a.length;const t=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),n=t.vertexLength,r=[],i=[];for(const a of s){if(0===a.length)continue;a!==s[0]&&i.push(r.length/2);const e=this.segments2.prepareSegment(a.length,this.layoutVertexArray,this.indexArray2),t=e.vertexLength;this.layoutVertexArray.emplaceBack(a[0].x,a[0].y),this.indexArray2.emplaceBack(t+a.length-1,t),r.push(a[0].x),r.push(a[0].y);for(let n=1;ne.cellIdx-t.cellIdx||e.triIdx-t.triIdx));let c=0;for(;cthis.max.x||this.min.x>e.x||e.y>this.max.y||this.min.y>e.y)return;const n=Gu(e.x-this.min.x,this.xScale,this.cellsX),r=Gu(e.y-this.min.y,this.yScale,this.cellsY),i=this.cells[r*this.cellsX+n];if(i){this._lazyInitLookup();for(let e=0;ethis.max.x||this.min.x>t.x)return;if(e.y>this.max.y||this.min.y>t.y)return;this._lazyInitLookup();const r=Gu(e.x-this.min.x,this.xScale,this.cellsX),i=Gu(t.x-this.min.x,this.xScale,this.cellsX),o=Gu(e.y-this.min.y,this.yScale,this.cellsY),a=Gu(t.y-this.min.y,this.yScale,this.cellsY);for(let s=o;s<=a;s++)for(let e=r;e<=i;e++){const t=this.cells[s*this.cellsX+e];if(t)for(let e=0;ee.fqid)),this.index=e.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.footprints=[]}updateFootprints(e,t){for(const n of this.footprints)t.push({footprint:n,id:e})}populate(e,t,n,r){const i=[];for(const{feature:o,id:a,index:s,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,t=Tl(o,e);if(!this.layers[0]._featureFilter.filter(new zo(this.zoom),t,n))continue;const c={id:a,properties:o.properties,type:o.type,sourceLayerIndex:l,index:s,geometry:e?t.geometry:El(o,n,r),patterns:{}};i.push(c)}for(const o of i){const{geometry:r,index:i,sourceLayerIndex:a}=o;this.addFeature(o,r,i,n,{},t.availableImages,t.brightness),t.featureIndex.insert(e[i].feature,r,i,a,this.index)}}isEmpty(){return 0===this.footprints.length}uploadPending(){return!1}upload(e){}update(e,t,n,r,i){}destroy(){}addFeature(e,t,n,r,i){for(const o of zu(t,2)){const e=[],t=[],n=[],r=new $(1/0,1/0),i=new $(-1/0,-1/0);for(const l of o)if(0!==l.length){l!==o[0]&&n.push(t.length/2);for(let n=0;n>3}if(o--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(n&&l.push(n),n=[]),n.push(new e(a,s));else{if(7!==i)throw new Error("unknown command "+i);n&&n.push(n[0].clone())}}return n&&l.push(n),l},t.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;e.pos>3}if(r--,1===n||2===n)(i+=e.readSVarint())s&&(s=i),(o+=e.readSVarint())c&&(c=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,l,s,c]},t.prototype.toGeoJSON=function(e,n,i){var o,a,s=this.extent*Math.pow(2,i),l=this.extent*e,c=this.extent*n,u=this.loadGeometry(),h=t.types[this.type];function d(e){for(var t=0;t>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(n))}return th=t,t.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var n=this._pbf.readVarint()+this._pbf.pos;return new e(this._pbf,n,this.extent,this._keys,this._values)},th}function ch(){return oh||(oh=1,ah.VectorTile=function(){if(ih)return rh;ih=1;var e=lh();function t(t,n,r){if(3===t){var i=new e(r,r.readVarint()+r.pos);i.length&&(n[i.name]=i)}}return rh=function(e,n){this.layers=e.readFields(t,{},n)},rh}(),ah.VectorTileFeature=sh(),ah.VectorTileLayer=lh()),ah}var uh=ch();class hh extends ${constructor(e,t,n){super(e,t),this.z=n}}class dh extends hh{constructor(e,t,n,r){super(e,t,n),this.w=r}}function fh(e,t,n,r){const i=[],o=0===r?(e,t,n,r,i,o)=>{e.push(new $(o,n+(o-t)/(r-t)*(i-n)))}:(e,t,n,r,i,o)=>{e.push(new $(t+(o-n)/(i-n)*(r-t),o))};for(const a of e){const e=[];for(const i of a){if(i.length<=2)continue;const a=[];for(let e=0;et&&o(a,s,l,c,u,t):h>n?d=t&&o(a,s,l,c,u,t),d>n&&h<=n&&o(a,s,l,c,u,n)}let s=i[i.length-1];const l=0===r?s.x:s.y;l>=t&&l<=n&&a.push(s),a.length&&(s=a[a.length-1],a[0].x===s.x&&a[0].y===s.y||a.push(a[0]),e.push(a))}e.length&&i.push(e)}return i}function ph(e,t,n,r){const i="x"===n?"y":"x",o=(r-e[n])/(t[n]-e[n]);e[i]=e[i]+(t[i]-e[i])*o,e[n]=r,e.hasOwnProperty("z")&&(e.z=kt(e.z,t.z,o)),e.hasOwnProperty("w")&&(e.w=kt(e.w,t.w,o))}function mh(e,t,n,r){const i=n,o=r;for(const a of["x","y"]){let n=e,r=t;n[a]>=r[a]&&(n=t,r=e),n[a]i&&ph(n,r,a,i),n[a]o&&ph(r,n,a,o)}}const gh=Number.MAX_SAFE_INTEGER;function _h(e,t,n,r){return e.ordert===e))}(r,e.clipScope)}function yh(e,t){return e.x-t.x||e.y-t.y}function vh(e,t){return 0===yh(e.min,t.min)&&0===yh(e.max,t.max)}function xh(e,t){return!(e.min.x>t.max.x||e.max.xt.max.y||e.max.ynew $((e.x+o.x*Kn)*s-a.x*Kn,(e.y+o.y*Kn)*s-a.y*Kn)))}return Mh(n,i,e.indices,0,e.indices.length,0,0)}function Eh(e,t,n,r){const i=Math.pow(2,r.z-n.z);return new $((e+n.x*Kn)*i-r.x*Kn,(t+n.y*Kn)*i-r.y*Kn)}function Th(e,t){const n=[];t.grid.queryPoint(e,n);const r=t.indices,i=t.vertices;for(let o=0;o0&&(r.length>1&&n.push(r),r=[])}return r.length>1&&n.push(r),n}const Ih=uh.VectorTileFeature.types,Ph=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],Rh=["fill-extrusion-flood-light-ground-radius"],Lh=Math.pow(2,13),zh=Math.pow(2,15)-1,Dh=new $(0,1),Oh=2147483648;function Fh(e,t,n,r,i,o,a,s){e.emplaceBack((t<<1)+a,(n<<1)+o,(Math.floor(r*Lh)<<1)+i,Math.round(s))}function Bh(e,t,n){e.emplaceBack(t.x*Kn,t.y*Kn,n?1:0)}function Nh(e,t,n,r,i,o){e.emplaceBack(t.x,t.y,(n.x<<1)+r,(n.y<<1)+i,o)}function jh(e,t,n){const r=16384;e.emplaceBack(t.x,t.y,t.z,n[0]*r,n[1]*r,n[2]*r)}class Vh{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class Uh{constructor(){this.centroidXY=new $(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new $(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new $(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0}span(){return new $(this.max.x-this.min.x,this.max.y-this.min.y)}}class $h{constructor(){this.acc=new $(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,t){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=t.x,e.min.y=e.max.y=t.y)}appendEdge(e,t,n){this.accCount++,this.acc._add(t);let r=!!this.borders;t.xe.max.x&&(e.max.x=t.x,r=!0),t.ye.max.y&&(e.max.y=t.y,r=!0),((0===t.x||t.x===Kn)&&t.x===n.x)!=((0===t.y||t.y===Kn)&&t.y===n.y)&&this.processBorderOverlap(t,n),r&&this.checkBorderIntersection(t,n)}checkBorderIntersection(e,t){t.x<0!=e.x<0&&this.addBorderIntersection(0,kt(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>Kn!=e.x>Kn&&this.addBorderIntersection(1,kt(t.y,e.y,(Kn-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,kt(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>Kn!=e.y>Kn&&this.addBorderIntersection(3,kt(t.x,e.x,(Kn-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const n=this.borders[e];tn[1]&&(n[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const n=0===e.x?0:1;this.addBorderIntersection(n,t.y),this.addBorderIntersection(n,e.y)}else{const n=0===e.y?2:3;this.addBorderIntersection(n,t.x),this.addBorderIntersection(n,e.x)}}centroid(){return 0===this.accCount?new $(0,0):new $(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce(((e,t)=>e+ +(t[0]!==Number.MAX_VALUE)),0):0}}function Gh(e,t){const n=e.add(t)._unit(),r=Q(e.x*n.x+e.y*n.y,-1,1);var i,o,a;return a=Math.acos(r),Math.min(4,Math.max(-4,Math.tan(a)))/4*zh*((i=e).x*(o=t).y-i.y*o.x<0?-1:1)}const qh=[e=>e.x<0,e=>e.x>Kn,e=>e.y<0,e=>e.y>Kn];function Wh(e,t,n,r){const i=[4];if(0===r)return i;n._mult(r);const o=e.sub(n),a=t.sub(n),s=[e,t,o,a];for(let l=0;l<4;l++)for(const e of s)if(qh[l](e)){i.push(l);break}return i}class Hh{constructor(e){this.vertexArray=new wa,this.indexArray=new Fa,this.programConfigurations=new Bs(e.layers,{zoom:e.zoom,lut:e.lut},(e=>Rh.includes(e))),this._segments=new hs,this.hiddenByLandmarkVertexArray=new Ya,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new hs}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=e.length;if(i>2){let o=Math.max(0,this._segments.get().length-1);const a=this._segments._prepareSegment(4*i,this.vertexArray.length,2*this._segmentToGroundQuads[o].length);let s;o!==this._segments.get().length-1&&(o++,this._segmentToGroundQuads[o]=[],this._segmentToRegionTriCounts[o]=[0,0,0,0,0]);{const t=e[0],n=e[1];s=Gh(t.sub(e[i-1])._perp()._unit(),n.sub(t)._perp()._unit())}for(let l=0;le.region-t.region));for(let n=0;ne+t),0);let o=0;for(let e=0;e<=4;e++){const t=i[e];if(0!==t){let n=this.regionSegments[e];n||(n=this.regionSegments[e]=new hs);const i={vertexOffset:r.vertexOffset,primitiveOffset:r.primitiveOffset+o,vertexLength:r.vertexLength,primitiveLength:t};n.get().push(i)}o+=t}for(let e=0;e0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,Xu.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const t=this.regionSegments[e];t&&t.destroy()}}}}class Zh{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new Fa,this.footprintVertices=new va,this.footprintSegments=[],this.layoutVertexArray=new ba,this.centroidVertexArray=new as,this.wallVertexArray=new ls,this.indexArray=new Fa,this.programConfigurations=new Bs(e.layers,{zoom:e.zoom,lut:e.lut},(e=>Ph.includes(e))),this.segments=new hs,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.groundEffect=new Hh(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}updateFootprints(e,t){}populate(e,t,n,r){this.features=[],this.hasPattern=Ou("fill-extrusion",this.layers,t),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=_l(n),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=0!==this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1);for(const{feature:i,id:o,index:a,sourceLayerIndex:s}of e){const e=this.layers[0]._featureFilter.needGeometry,l=Tl(i,e);if(!this.layers[0]._featureFilter.filter(new zo(this.zoom),l,n))continue;const c={id:o,sourceLayerIndex:s,index:a,geometry:e?l.geometry:El(i,n,r),properties:i.properties,type:i.type,patterns:{}},u=this.layoutVertexArray.length,h="Polygon"===Ih[c.type];if(this.hasPattern)this.features.push(Fu("fill-extrusion",this.layers,c,this.zoom,t));else if(this.wallMode)for(const i of c.geometry)for(const e of kh(i,h))this.addFeature(c,[e],a,n,{},t.availableImages,r,t.brightness);else this.addFeature(c,c.geometry,a,n,{},t.availableImages,r,t.brightness);t.featureIndex.insert(i,c.geometry,a,s,this.index,u)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,t,n,r,i,o){for(const a of this.features){const e="Polygon"===Ih[a.type],{geometry:s}=a;if(this.wallMode)for(const l of s)for(const s of kh(l,e))this.addFeature(a,[s],a.index,t,n,r,i,o);else this.addFeature(a,s,a.index,t,n,r,i,o)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(e,t,n,r,i){const o=0!==Object.keys(e).length;if(o&&!this.stateDependentLayers.length)return;const a=o?this.stateDependentLayers:this.layers;this.programConfigurations.updatePaintArrays(e,t,a,n,r,i),this.groundEffect.update(e,t,a,n,r,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ju),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.wallVertexBuffer=e.createVertexBuffer(this.wallVertexArray,Yu.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,Ku.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Zu.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,n,r,i,o,a,s){const l=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(e,{})/this.tileToMeter,c=[new $(0,0),new $(Kn,Kn)],u=a.projection,h="globe"===u.name,d=this.wallMode||"Polygon"===Ih[e.type],f=new $h;f.centroidDataIndex=this.centroidData.length;const p=new Uh,m=this.layers[0].paint.get("fill-extrusion-base").evaluate(e,{},r)<=0,g=this.layers[0].paint.get("fill-extrusion-height").evaluate(e,{},r);let _;if(p.height=g,p.vertexArrayOffset=this.layoutVertexArray.length,p.groundVertexArrayOffset=this.groundEffect.vertexArray.length,h&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Ca),this.wallMode){if(h)return void fe("Non zero fill-extrusion-line-width is not yet supported on globe.");if(1!==t.length)return;_=function(e){const t=e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y,n=function(e){let t=0;const n=e.length;for(let r=0;r=0}(e);n||(e=e.reverse());const r={geometry:[],joinNormals:[],indices:[]},i=[],o=[],a=[];let s=e.length;if(s<(t?3:2))return r;for(;s>=2&&e[s-1].equals(e[s-2]);)s--;let l,c,u,h,d,f=0;for(;f0;let _="miter";const y=2;"miter"===_&&p>y&&(_="bevel"),"bevel"===_&&(p>100&&(_="flipbevel"),p{const s=new $(e.x,e.y),l=new $(e.x,e.y);s.x+=t.x*r,s.y+=t.y*r,l.x-=t.x*Math.max(n,1),l.y-=t.y*Math.max(n,1),a.push(t),i.push(s),o.push(l)};if("miter"===_)n._mult(p),v(l,n,0,0);else if("flipbevel"===_)n=d.mult(-1),v(l,n,0,0),v(l,n.mult(-1),0,0);else{const e=-Math.sqrt(p*p-1),t=g?e:0,n=g?0:e;c&&v(l,h,t,n),u&&v(l,d,t,n)}}r.geometry=[...i,...o.reverse(),i[0]],r.joinNormals=[...a,...a.reverse(),a[a.length-1]];const p=r.geometry.length-1;for(let m=0;m

e<(t.length-1)/2||e===t.length-1,v=this.wallMode?[t]:zu(t,500);for(let A=v.length-1;A>=0;A--){const e=v[A];(0===e.length||(x=e[0]).every((e=>e.x<=0))||x.every((e=>e.x>=Kn))||x.every((e=>e.y<=0))||x.every((e=>e.y>=Kn)))&&v.splice(A,1)}var x;let b;if(h)b=rd(v,c,r);else{b=[];for(const e of v)b.push({polygon:e,bounds:c})}const w=d?this.edgeRadius:0,S=w>0&&this.zoom<17,M=(e,t)=>{if(0===e.length)return!1;const n=e[e.length-1];return t.x===n.x&&t.y===n.y};for(const{polygon:A,bounds:E}of b){let e=0,t=0;for(const r of A)d&&!r[0].equals(r[r.length-1])&&r.push(r[0]),t+=d?r.length-1:r.length;const n=this.segments.prepareSegment((d?5:4)*t,this.layoutVertexArray,this.indexArray);p.footprintSegIdx<0&&(p.footprintSegIdx=this.footprintSegments.length),p.polygonSegIdx<0&&(p.polygonSegIdx=this.polygonSegments.length);const i={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},o=new Vh;if(o.vertexOffset=this.footprintVertices.length,o.indexOffset=3*this.footprintIndices.length,o.ringIndices=[],d){const t=[],i=[];e=n.vertexLength;for(let e=0;e4&&ed(t[t.length-2],t[0],t[1]),o=w?Xh(t[t.length-2],t[0],t[1],w):0;const s=[];let c,g,v;g=t[1].sub(t[0])._perp()._unit();let x=!0;for(let a=1,l=0;a0?1:0,k=d.dist(b);if(l+k>32768&&(l=0),w){v=S.sub(b)._perp()._unit();let e=Kh(d,b,S,Yh(g,v),w);isNaN(e)&&(e=0);const t=b.sub(d)._unit();d=d.add(t.mult(o))._round(),b=b.add(t.mult(-e))._round(),o=e,g=v,m&&this.zoom>=17&&(M(s,d)||s.push(d),M(s,b)||s.push(b))}const I=n.vertexLength,P=t.length>4&&ed(d,b,S);let R=td(l,i,x);if(Fh(this.layoutVertexArray,d.x,d.y,T,C,0,0,R),Fh(this.layoutVertexArray,d.x,d.y,T,C,0,1,R),this.wallMode){const e=y(a-1,t),n=_.joinNormals[a-1];Bh(this.wallVertexArray,n,e),Bh(this.wallVertexArray,n,e)}if(l+=k,R=td(l,P,!x),i=P,Fh(this.layoutVertexArray,b.x,b.y,T,C,0,0,R),Fh(this.layoutVertexArray,b.x,b.y,T,C,0,1,R),this.wallMode){const e=y(a,t),n=_.joinNormals[a];Bh(this.wallVertexArray,n,e),Bh(this.wallVertexArray,n,e)}if(n.vertexLength+=4,this.indexArray.emplaceBack(I+0,I+1,I+2),this.indexArray.emplaceBack(I+1,I+3,I+2),n.primitiveLength+=2,w){const r=e+(1===a?t.length-2:a-2),i=1===a?e:r+1;if(this.indexArray.emplaceBack(I+1,r,I+3),this.indexArray.emplaceBack(r,i,I+3),n.primitiveLength+=2,void 0===c&&(c=I),!Jh(S,t[a],E)){const e=a===t.length-1?c:n.vertexLength;this.indexArray.emplaceBack(I+2,I+3,e),this.indexArray.emplaceBack(I+3,e+1,e),this.indexArray.emplaceBack(I+3,i,e+1),n.primitiveLength+=3}x=!x}if(h){const e=this.layoutVertexExtArray,t=u.projectTilePoint(d.x,d.y,r),n=u.projectTilePoint(b.x,b.y,r),i=u.upVector(r,d.x,d.y),o=u.upVector(r,b.x,b.y);jh(e,t,i),jh(e,t,i),jh(e,n,o),jh(e,n,o)}}d&&(e+=t.length-1),m&&w&&this.zoom>=17&&(0!==s.length&&M(s,s[0])&&s.pop(),this.groundEffect.addData(s,E,l,w>0))}this.footprintSegments.push(o),i.triangleCount=this.indexArray.length-i.triangleArrayOffset,this.polygonSegments.push(i),++p.footprintSegLen,++p.polygonSegLen}if(p.vertexCount=this.layoutVertexArray.length-p.vertexArrayOffset,p.groundVertexCount=this.groundEffect.vertexArray.length-p.groundVertexArrayOffset,0!==p.vertexCount){if(p.centroidXY=f.borders?Dh:this.encodeCentroid(f,p),this.centroidData.push(p),f.borders){this.featuresOnBorder.push(f);const e=this.featuresOnBorder.length-1;for(let t=0;tthis.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[n].borders[e][0]))}splitToSubtiles(){const e=[];for(let a=0;aKn),r=2*n+(+(t.min.x+t.max.x>Kn)^n);for(let i=0;ie.triangleSegmentIdx===t.triangleSegmentIdx?e.subtile-t.subtile:e.triangleSegmentIdx-t.triangleSegmentIdx));let n=0,r=0,i=0;for(const a of e){if(a.triangleSegmentIdx!==n)break;i++}const o=e.length;for(;r!==e.length;){n=e[r].triangleSegmentIdx;let a=0,s=r,l=r;for(let t=s;t0&&this.triangleSubSegments.push({segment:u,min:o,max:c}),s=l;for(let t=s;t[e[0]*(1-n[0])+t[0]*n[0],e[1]*(1-n[1])+t[1]*n[1]],d=[],f=[];for(const p of this.triangleSubSegments){d[0]=p.min.x/Kn,d[1]=p.min.y/Kn,f[0]=p.max.x/Kn,f[1]=p.max.y/Kn;const e=h(c,u,d),t=h(c,u,f);if(0===new gc([e[0],e[1],i],[t[0],t[1],o]).intersectsPrecise(n)){l&&(r.segments.push(l),l=void 0);continue}const a=p.segment;l&&l.vertexOffset!==a.vertexOffset&&(r.segments.push(l),l=void 0),l?(l.vertexLength+=a.vertexLength,l.primitiveLength+=a.primitiveLength):l={vertexOffset:a.vertexOffset,primitiveLength:a.primitiveLength,vertexLength:a.vertexLength,primitiveOffset:a.primitiveOffset,sortKey:void 0,vaos:{}}}return l&&r.segments.push(l),r}encodeCentroid(e,t){const n=e.centroid(),r=t.span(),i=Math.min(7,Math.round(r.x*this.tileToMeter/10)),o=Math.min(7,Math.round(r.y*this.tileToMeter/10));return new $(Q(n.x,1,Kn-1)<<3|i,Q(n.y,1,Kn-1)<<3|o)}encodeBorderCentroid(e){if(!e.borders)return new $(0,0);const t=e.borders,n=Number.MAX_VALUE;if(t[0][0]!==n||t[1][0]!==n){const e=t[0][0]!==n?0:1;return new $(6|(t[0][0]!==n?0:65528),(t[e][0]+t[e][1])/2<<3|6)}{const e=t[2][0]!==n?2:3;return new $((t[e][0]+t[e][1])/2<<3|6,6|(t[2][0]!==n?0:65528))}}showCentroid(e){const t=this.centroidData[e.centroidDataIndex];t.flags&=Oh,t.centroidXY.x=0,t.centroidXY.y=0,this.writeCentroidToBuffer(t)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const t=e.vertexArrayOffset,n=e.vertexCount+e.vertexArrayOffset,r=e.flags&Oh?Dh:e.centroidXY,i=this.centroidVertexArray.geta_centroid_pos0(t);if(this.centroidVertexArray.geta_centroid_pos1(t)!==r.y||i!==r.x){for(let e=t;en.max.x||n.min.x>o.max.x||o.min.y>n.max.y||n.min.y>o.max.y))for(let r=0;rt!=l>t&&e<(this.footprintVertices.int16[2*(s+o.vertexOffset)+0]-n)*(t-a)/(l-a)+n&&(r=!r)}a=n}}return r}getHeightAtTileCoord(e,t){let n=Number.NEGATIVE_INFINITY,r=!0;const i=4*(e+Kn)*Kn+(t+Kn);if(this.partLookup.hasOwnProperty(i)){const e=this.partLookup[i];return e?{height:e.height,hidden:!!(e.flags&Oh)}:void 0}for(const o of this.centroidData)e>o.max.x||o.min.x>e||t>o.max.y||o.min.y>t||this.footprintContainsPoint(e,t,o)&&o&&o.height>n&&(n=o.height,this.partLookup[i]=o,r=!!(o.flags&Oh));if(n!==Number.NEGATIVE_INFINITY)return{height:n,hidden:r};this.partLookup[i]=void 0}}function Yh(e,t){const n=e.add(t)._unit();return e.x*n.x+e.y*n.y}function Xh(e,t,n,r){const i=t.sub(e)._perp()._unit(),o=n.sub(t)._perp()._unit();return Kh(e,t,n,Yh(i,o),r)}function Kh(e,t,n,r,i){const o=Math.sqrt(1-r*r);return Math.min(e.dist(t)/3,t.dist(n)/3,i*o/r)}function Jh(e,t,n){return e.xn[1].x&&t.x>n[1].x||e.yn[1].y&&t.y>n[1].y}function Qh(e,t){return e.xt[1].x||e.yt[1].y}function ed(e,t,n){if(e.x<0||e.x>=Kn||t.x<0||t.x>=Kn||n.x<0||n.x>=Kn)return!1;const r=n.sub(t),i=r.perp(),o=e.sub(t);return(r.x*o.x+r.y*o.y)/Math.sqrt((r.x*r.x+r.y*r.y)*(o.x*o.x+o.y*o.y))>-.866&&i.x*o.x+i.y*o.y<0}function td(e,t,n){const r=t?2|e:-3&e;return n?1|r:-2&r}function nd(){const e=Math.PI/32,t=Math.tan(e),n=el;return n*Math.sqrt(1+2*t*t)-n}function rd(e,t,n){const r=1<4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;const a=[];if(!e.length||!n||!r)return a;const s=(e,t)=>{for(const n of e)a.push({polygon:n,bounds:t})},l=Math.ceil(Math.log2(n)),c=Math.ceil(Math.log2(r)),u=l-c,h=[];for(let p=0;p0?0:1);for(let p=0;pt+1?f.push({polygons:d,bounds:e,depth:t+1}):s(d,e)}if(p.length){const e=[new $(0===n?u:r.x,1===n?u:r.y),a];h.length>t+1?f.push({polygons:p,bounds:e,depth:t+1}):s(p,e)}}return a}(e,t,Math.ceil((o-i)/11.25),Math.ceil((a-s)/11.25),1,((e,t,i)=>{if(0===e)return.5*(t+i);{const e=hl((n.y+t/Kn)/r);return(ll(.5*(hl((n.y+i/Kn)/r)+e))*r-n.y)*Kn}}))}function id(e,t,n,r,i,o){const a=Math.pow(2,r.z-i.z);for(let s=0;s1&&(a=e[++o]);const l=Math.abs(s-a.left),c=Math.abs(s-a.right),u=Math.min(l,c);let h;const d=i/n*(r+1);if(a.isDash){const e=r-Math.abs(d);h=Math.sqrt(u*u+e*e)}else h=r-Math.sqrt(u*u+d*d);this.image.data[t+s]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e,t){for(let s=e.length-1;s>=0;--s){const t=e[s],n=e[s+1];t.zeroLength?e.splice(s,1):n&&n.isDash===t.isDash&&(n.left=t.left,e.splice(s,1))}const n=e[0],r=e[e.length-1];n.isDash===r.isDash&&(n.left=r.left-this.width,r.right=n.right+this.width);const i=this.width*this.nextRow;let o=0,a=e[o];for(let s=0;s1&&(a=e[++o]);const n=Math.abs(s-a.left),r=Math.abs(s-a.right),l=Math.min(n,r);this.image.data[i+s]=Math.max(0,Math.min(255,(a.isDash?l:-l)+t+128))}}addDash(e,t){const n=this.getKey(e,t);if(this.positions[n])return this.positions[n];const r="round"===t,i=r?7:0,o=2*i+1;if(this.nextRow+o>this.height)return fe("LineAtlas out of space"),null;0===e.length&&e.push(1);let a=0;for(let c=0;ce.fqid)),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.hasZOffset=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Sa,this.layoutVertexArray2=new Ma,this.patternVertexArray=new Aa,this.indexArray=new Fa,this.programConfigurations=new Bs(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new hs,this.maxLineLength=0,this.zOffsetVertexArray=new ja,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.tessellationStep=e.tessellationStep?e.tessellationStep:Kn/64}updateFootprints(e,t){}populate(e,t,n,r){this.hasPattern=Ou("line",this.layers,t);const i=this.layers[0].layout.get("line-sort-key"),o=this.layers[0].layout.get("line-z-offset");this.hasZOffset=!o.isConstant()||!!o.constantOr(0);const a=[];for(const{feature:u,id:h,index:d,sourceLayerIndex:f}of e){const e=this.layers[0]._featureFilter.needGeometry,t=Tl(u,e);if(!this.layers[0]._featureFilter.filter(new zo(this.zoom),t,n))continue;const o=i?i.evaluate(t,{},n):void 0,s={id:h,properties:u.properties,type:u.type,sourceLayerIndex:f,index:d,geometry:e?t.geometry:El(u,n,r),patterns:{},sortKey:o};a.push(s)}i&&a.sort(((e,t)=>e.sortKey-t.sortKey));const{lineAtlas:s,featureIndex:l}=t,c=this.addConstantDashes(s);for(const u of a){const{geometry:r,index:i,sourceLayerIndex:o}=u;if(c&&this.addFeatureDashes(u,s),this.hasPattern){const e=Fu("line",this.layers,u,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(u,r,i,n,s.positions,t.availableImages,t.brightness);l.insert(e[i].feature,r,i,o,this.index)}}addConstantDashes(e){let t=!1;for(const n of this.layers){const r=n.paint.get("line-dasharray").value,i=n.layout.get("line-cap").value;if("constant"!==r.kind||"constant"!==i.kind)t=!0;else{const t=i.value,n=r.value;if(!n)continue;e.addDash(n,t)}}return t}addFeatureDashes(e,t){const n=this.zoom;for(const r of this.layers){const i=r.paint.get("line-dasharray").value,o=r.layout.get("line-cap").value;if("constant"===i.kind&&"constant"===o.kind)continue;let a,s;if("constant"===i.kind){if(a=i.value,!a)continue}else a=i.evaluate({zoom:n},e);s="constant"===o.kind?o.value:o.evaluate({zoom:n},e),t.addDash(a,s),e.patterns[r.id]=t.getKey(a,s)}}update(e,t,n,r,i){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,n,r,i)}addFeatures(e,t,n,r,i,o){for(const a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,t,n,r,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,pd)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,gd)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,hd.members,!0)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,dd),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,n,r,i,o,a){const s=this.layers[0].layout,l=s.get("line-join").evaluate(e,{}),c=s.get("line-cap").evaluate(e,{}),u=s.get("line-miter-limit"),h=s.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const d of t)this.addLine(d,e,r,l,c,u,h);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,o,r,a)}addLine(e,t,n,r,i,o,a){this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.currentVertex=void 0;const s={zoom:this.zoom,lineProgress:void 0},l=this.layers[0].layout,c="none"===r;if(this.patternJoinNone=this.hasPattern&&c,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[],this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t=2&&e[h-1].equals(e[h-2]);)h--;let d=0;for(;d0;if(C&&b>d){const e=m.dist(g);if(e>2*f){const t=m.sub(m.sub(g)._mult(f/e)._round());this.updateDistance(g,t),this.addCurrentVertex(t,y,0,0,p,x),g=t}}if(n&&"round"===w&&(Eo&&(w="bevel"),"bevel"===w&&(E>2&&(w="flipbevel"),E100)M=v.mult(-1);else{const e=E*y.add(v).mag()/y.sub(v).mag();M._perp()._mult(e*(k?-1:1))}this.addCurrentVertex(m,M,0,0,p,x),this.addCurrentVertex(m,M.mult(-1),0,0,p,x)}else if("bevel"===w||"fakeround"===w){const e=-Math.sqrt(E*E-1),t=k?e:0,n=k?0:e;if(g&&this.addCurrentVertex(m,y,t,n,p,x),"fakeround"===w){const e=Math.round(180*T/Math.PI/20);for(let t=1;t2*f){const t=m.add(_.sub(m)._mult(f/e)._round());this.updateDistance(m,t),this.addCurrentVertex(t,v,0,0,p,x),m=t}}}}addVerticesTo(e,t,n,r,i,o,a,s,l,c){const u=(t.w-e.w)/this.tessellationStep|0;if(u>1){this.lineSoFar=e.w;const h=(t.x-e.x)/u,d=(t.y-e.y)/u,f=(t.z-e.z)/u,p=(t.w-e.w)/u;for(let t=1;t6&&void 0!==arguments[6]&&arguments[6];const s=t.x+t.y*n,l=t.y-t.x*n,c=t.y*r-t.x,u=-t.y-t.x*r;if(null!=o){const t=-10,h=Kn+10,d=o,f=new dh(e.x,e.y,d,this.lineSoFar),p=wd(e,t,h),m=this.lineSoFar;if(this.currentVertex)if(p){const o=this.currentVertexIsOutside,f=this.currentVertex,p=new dh(e.x,e.y,d,this.lineSoFar);mh(f,p,t,h),wd(p,t,h)||(o&&(this.e1=this.e2=-1,this.lineSoFar=f.w,this.addHalfVertex(f,s,l,a,!1,n,i,f.z),this.addHalfVertex(f,c,u,a,!0,-r,i,f.z)),this.addVerticesTo(f,p,s,l,c,u,n,r,i,a))}else{const e=this.currentVertex;this.currentVertexIsOutside&&(mh(e,f,t,h),this.e1=this.e2=-1,this.lineSoFar=e.w,this.addHalfVertex(e,s,l,a,!1,n,i,e.z),this.addHalfVertex(e,c,u,a,!0,-r,i,e.z)),this.addVerticesTo(e,f,s,l,c,u,n,r,i,a)}else p||(this.addHalfVertex(e,s,l,a,!1,n,i,o),this.addHalfVertex(e,c,u,a,!0,-r,i,o));this.currentVertex=f,this.currentVertexIsOutside=p,this.lineSoFar=m}else this.addHalfVertex(e,s,l,a,!1,n,i,o),this.addHalfVertex(e,c,u,a,!0,-r,i,o)}addHalfVertex(e,t,n,r,i,o,a,s){let{x:l,y:c}=e;this.patternJoinNone&&(0===this.segmentPoints.length&&(this.segmentStart=this.lineSoFar,this.segmentStartf32=Math.fround(this.lineSoFar)),i||this.segmentPoints.push(this.lineSoFar-this.segmentStart,o)),this.layoutVertexArray.emplaceBack((l<<1)+(r?1:0),(c<<1)+(i?1:0),Math.round(63*t)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1),0,this.lineSoFar-this.segmentStartf32),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u,null!=s&&this.zOffsetVertexArray.emplaceBack(s)}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}function wd(e,t,n){return e.xn||e.yn}let Sd,Md;function Ad(e,t,n){return t*(Kn/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}function Ed(e,t){return 1/Ad(e,1,t.tileZoom)}function Td(e,t,n,r){return e.translatePosMatrix(r||t.tileID.projMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}so(bd,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const Cd=e=>{const t=[];kd(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const n=e.paint.get("line-trim-offset");0===n[0]&&0===n[1]||t.push("RENDER_LINE_TRIM_OFFSET"),0!==e.paint.get("line-border-width").constantOr(1)&&t.push("RENDER_LINE_BORDER");const r="none"===e.layout.get("line-join").constantOr("miter"),i=!!e.paint.get("line-pattern").constantOr(1);return r&&i&&t.push("LINE_JOIN_NONE"),t};function kd(e){const t=e.paint.get("line-dasharray").value;return t.value||"constant"!==t.kind}let Id;const Pd=()=>Id||(Id={layout:Sd||(Sd=new Wo({"line-cap":new Go(Ho.layout_line["line-cap"]),"line-join":new Go(Ho.layout_line["line-join"]),"line-miter-limit":new $o(Ho.layout_line["line-miter-limit"]),"line-round-limit":new $o(Ho.layout_line["line-round-limit"]),"line-sort-key":new Go(Ho.layout_line["line-sort-key"]),"line-z-offset":new Go(Ho.layout_line["line-z-offset"]),visibility:new $o(Ho.layout_line.visibility)})),paint:Md||(Md=new Wo({"line-opacity":new Go(Ho.paint_line["line-opacity"]),"line-color":new Go(Ho.paint_line["line-color"]),"line-translate":new $o(Ho.paint_line["line-translate"]),"line-translate-anchor":new $o(Ho.paint_line["line-translate-anchor"]),"line-width":new Go(Ho.paint_line["line-width"]),"line-gap-width":new Go(Ho.paint_line["line-gap-width"]),"line-offset":new Go(Ho.paint_line["line-offset"]),"line-blur":new Go(Ho.paint_line["line-blur"]),"line-dasharray":new Go(Ho.paint_line["line-dasharray"]),"line-pattern":new Go(Ho.paint_line["line-pattern"]),"line-gradient":new qo(Ho.paint_line["line-gradient"]),"line-trim-offset":new $o(Ho.paint_line["line-trim-offset"]),"line-trim-fade-range":new $o(Ho.paint_line["line-trim-fade-range"]),"line-trim-color":new $o(Ho.paint_line["line-trim-color"]),"line-emissive-strength":new $o(Ho.paint_line["line-emissive-strength"]),"line-border-width":new Go(Ho.paint_line["line-border-width"]),"line-border-color":new Go(Ho.paint_line["line-border-color"]),"line-occlusion-opacity":new $o(Ho.paint_line["line-occlusion-opacity"])}))},Id);class Rd extends Go{possiblyEvaluate(e,t){return t=new zo(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,n,r){return t=re({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,n,r)}}let Ld;function zd(e,t){return t>0?t+2*e:e}const Dd=_a([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Od=_a([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),Fd=_a([{name:"a_projected_pos",components:4,type:"Float32"}],4);_a([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Bd=_a([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),Nd=_a([{name:"a_texb",components:2,type:"Uint16"}]),jd=_a([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),Vd=_a([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);_a([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Ud=_a([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),$d=_a([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);_a([{name:"triangle",components:3,type:"Uint16"}]),_a([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),_a([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"}]),_a([{type:"Float32",name:"offsetX"}]),_a([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Gd=24;const qd=128;function Wd(e,t){const{expression:n}=t;if("constant"===n.kind)return{kind:"constant",layoutSize:n.evaluate(new zo(e+1))};if("source"===n.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:r}=n;let i=0;for(;i{e.text=function(e,t,n){const r=t.layout.get("text-transform").evaluate(n,{});return"uppercase"===r?e=e.toLocaleUpperCase():"lowercase"===r&&(e=e.toLocaleLowerCase()),Lo.applyArabicShaping&&(e=Lo.applyArabicShaping(e)),e}(e.text,t,n)})),e}const Kd={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42","\u2190":"\u2191","\u2192":"\u2193"};function Jd(e){return"\ufe36"===e||"\ufe48"===e||"\ufe38"===e||"\ufe44"===e||"\ufe42"===e||"\ufe3e"===e||"\ufe3c"===e||"\ufe3a"===e||"\ufe18"===e||"\ufe40"===e||"\ufe10"===e||"\ufe13"===e||"\ufe14"===e||"\uff40"===e||"\uffe3"===e||"\ufe11"===e||"\ufe12"===e}function Qd(e){return"\ufe35"===e||"\ufe47"===e||"\ufe37"===e||"\ufe43"===e||"\ufe41"===e||"\ufe3d"===e||"\ufe3b"===e||"\ufe39"===e||"\ufe17"===e||"\ufe3f"===e}var ef,tf,nf,rf={};function of(){return ef||(ef=1,rf.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<>1,u=-7,h=n?i-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},rf.write=function(e,t,n,r,i,o){var a,s,l,c=8*o-i-1,u=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(t*l-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-p]|=128*m}),rf}function af(){if(nf)return tf;nf=1,tf=t;var e=of();function t(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}t.Varint=0,t.Fixed64=1,t.Bytes=2,t.Fixed32=5;var n=4294967296,r=1/n,i="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function o(e){return e.type===t.Bytes?e.readVarint()+e.pos:e.pos+1}function a(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function s(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function l(e,t){for(var n=0;n>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function v(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}return t.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos>3,o=this.pos;this.type=7&r,e(i,t,this),this.pos===o&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=_(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=v(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=_(this.buf,this.pos)+_(this.buf,this.pos+4)*n;return this.pos+=8,e},readSFixed64:function(){var e=_(this.buf,this.pos)+v(this.buf,this.pos+4)*n;return this.pos+=8,e},readFloat:function(){var t=e.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=e.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(e){var t,n,r=this.buf;return t=127&(n=r[this.pos++]),n<128?t:(t|=(127&(n=r[this.pos++]))<<7,n<128?t:(t|=(127&(n=r[this.pos++]))<<14,n<128?t:(t|=(127&(n=r[this.pos++]))<<21,n<128?t:function(e,t,n){var r,i,o=n.buf;if(r=(112&(i=o[n.pos++]))>>4,i<128)return a(e,r,t);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return a(e,r,t);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return a(e,r,t);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return a(e,r,t);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return a(e,r,t);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return a(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(n=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&i?function(e,t,n){return i.decode(e.subarray(t,n))}(this.buf,t,e):function(e,t,n){for(var r="",i=t;i239?4:l>223?3:l>191?2:1;if(i+u>n)break;1===u?l<128&&(c=l):2===u?128==(192&(o=e[i+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&((c=(15&l)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=u}return r}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,n){if(this.type!==t.Bytes)return e.push(this.readVarint(n));var r=o(this);for(e=e||[];this.pos127;);else if(n===t.Bytes)this.pos=this.readVarint()+this.pos;else if(n===t.Fixed32)this.pos+=4;else{if(n!==t.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?function(e,t){var n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,n.buf[n.pos]=127&(e>>>=7)}(n,0,t),function(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var r,i,o=0;o55295&&r<57344){if(!i){r>56319||o+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):i=r;continue}if(r<56320){e[n++]=239,e[n++]=191,e[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(e[n++]=239,e[n++]=191,e[n++]=189,i=null);r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos);var n=this.pos-t;n>=128&&s(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),e.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),e.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n=128&&s(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,n,r){this.writeTag(e,t.Bytes),this.writeRawMessage(n,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,l,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,c,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,d,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,u,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,m,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,g,t)},writeBytesField:function(e,n){this.writeTag(e,t.Bytes),this.writeBytes(n)},writeFixed32Field:function(e,n){this.writeTag(e,t.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(e,n){this.writeTag(e,t.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(e,n){this.writeTag(e,t.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(e,n){this.writeTag(e,t.Fixed64),this.writeSFixed64(n)},writeVarintField:function(e,n){this.writeTag(e,t.Varint),this.writeVarint(n)},writeSVarintField:function(e,n){this.writeTag(e,t.Varint),this.writeSVarint(n)},writeStringField:function(e,n){this.writeTag(e,t.Bytes),this.writeString(n)},writeFloatField:function(e,n){this.writeTag(e,t.Fixed32),this.writeFloat(n)},writeDoubleField:function(e,n){this.writeTag(e,t.Fixed64),this.writeDouble(n)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}},tf}var sf=t(af());const lf=3;function cf(e,t,n){t.glyphs=[],1===e&&n.readMessage(uf,t)}function uf(e,t,n){if(3===e){const{id:e,bitmap:r,width:i,height:o,left:a,top:s,advance:l}=n.readMessage(hf,{});t.glyphs.push({id:e,bitmap:new ru({width:i+2*lf,height:o+2*lf},r),metrics:{width:i,height:o,left:a,top:s,advance:l}})}else 4===e?t.ascender=n.readSVarint():5===e&&(t.descender=n.readSVarint())}function hf(e,t,n){1===e?t.id=n.readVarint():2===e?t.bitmap=n.readBytes():3===e?t.width=n.readVarint():4===e?t.height=n.readVarint():5===e?t.left=n.readSVarint():6===e?t.top=n.readSVarint():7===e&&(t.advance=n.readVarint())}const df=lf,ff={horizontal:1,vertical:2,horizontalOnly:3};class pf{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){const n=new pf;return n.scale=e||1,n.fontStack=t,n}static forImage(e){const t=new pf;return t.imageName=e,t}}class mf{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){const n=new mf;for(let r=0;r=0&&n>=e&&_f[this.text.charCodeAt(n)];n--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const n=new mf;return n.text=this.text.substring(e,t),n.sectionIndex=this.sectionIndex.slice(e,t),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(pf.forText(e.scale,e.fontStack||t));const n=this.sections.length-1;for(let r=0;r=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function gf(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p){const m=mf.fromFeature(e,i);h===ff.vertical&&m.verticalizePunctuation(d);let g=[];const _=function(e,t,n,r,i,o){if(!e)return[];const a=[],s=function(e,t,n,r,i,o){let a=0;for(let s=0;s=0;let c=0;for(let h=0;h0&&o>x&&(x=o)}else{const e=n[a.fontStack];if(!e)continue;e[p]&&(M=e[p]);const r=t[a.fontStack];if(!r)continue;const o=r.glyphs[p];if(!o)continue;if(_=o.metrics,E=8203!==p?Gd:0,g){const e=void 0!==r.ascender?Math.abs(r.ascender):0,t=void 0!==r.descender?Math.abs(r.descender):0,n=(e+t)*m;b-n/2;){if(a--,a<0)return!1;s-=e[a].dist(o),o=e[a]}s+=e[a].dist(e[a+1]),a++;const l=[];let c=0;for(;sr;)c-=l.shift().angleDelta;if(c>i)return!1;a++,s+=t.dist(n)}return!0}function If(e){let t=0;for(let n=0;nc){const o=(c-l)/i,h=kt(n.x,r.x,o),d=kt(n.y,r.y,o),f=new Cf(h,d,0,r.angleTo(n),u);return!a||kf(e,f,s,a,t)?f:void 0}l+=i}}function zf(e,t,n,r,i,o,a,s,l){const c=Pf(r,o,a),u=Rf(r,i),h=u*a,d=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h=0&&_=0&&y=0&&d+c<=u){const t=new Cf(_,y,0,m,p);r&&!kf(e,t,o,r,i)||f.push(t)}}h+=s}return s||f.length||a||(f=Df(e,h/2,n,r,i,o,a,!0,l)),f}function Of(e,t,n,r,i){const o=[];for(let a=0;a=r&&c.x>=r||(a.x>=r?a=new $(r,a.y+(r-a.x)/(c.x-a.x)*(c.y-a.y))._round():c.x>=r&&(c=new $(r,a.y+(r-a.x)/(c.x-a.x)*(c.y-a.y))._round()),a.y>=i&&c.y>=i||(a.y>=i?a=new $(a.x+(i-a.y)/(c.y-a.y)*(c.x-a.x),i)._round():c.y>=i&&(c=new $(a.x+(i-a.y)/(c.y-a.y)*(c.x-a.x),i)._round()),l&&a.equals(l[l.length-1])||(l=[a],o.push(l)),l.push(c)))))}}return o}function Ff(e){let t=0,n=0;for(const a of e)t+=a.w*a.h,n=Math.max(n,a.w);e.sort(((e,t)=>t.h-e.h));const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),n),h:1/0}];let i=0,o=0;for(const a of e)for(let e=r.length-1;e>=0;e--){const t=r[e];if(!(a.w>t.w||a.h>t.h)){if(a.x=t.x,a.y=t.y,o=Math.max(o,a.y+a.h),i=Math.max(i,a.x+a.w),a.w===t.w&&a.h===t.h){const t=r.pop();e1?o-1:o,iu.copy(e.data,l,{x:0,y:0},{x:a,y:s},e.data,n),iu.copy(e.data,l,{x:0,y:h-o},{x:a,y:s-o},{width:u,height:o},n),iu.copy(e.data,l,{x:0,y:0},{x:a,y:s+h},{width:u,height:o},n),iu.copy(e.data,l,{x:u-o,y:0},{x:a-o,y:s},{width:o,height:h},n),iu.copy(e.data,l,{x:0,y:0},{x:a+u,y:s},{width:o,height:h},n),iu.copy(e.data,l,{x:u-o,y:h-o},{x:a-o,y:s-o},{width:o,height:o},n),iu.copy(e.data,l,{x:0,y:h-o},{x:a+u,y:s-o},{width:o,height:o},n),iu.copy(e.data,l,{x:0,y:0},{x:a+u,y:s+h},{width:o,height:o},n),iu.copy(e.data,l,{x:u-o,y:0},{x:a-o,y:s+h},{width:o,height:o},n)}this.image=l,this.iconPositions=r,this.patternPositions=i}addImages(e,t,n,r){for(const i in e){const o=e[i],a={x:0,y:0,w:o.data.width+2*n,h:o.data.height+2*n};r.push(a),t[i]=new Nf(a,o,n),o.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t,n){this.haveRenderCallbacks=this.haveRenderCallbacks.filter((t=>e.hasImage(t,n))),e.dispatchRenderCallbacks(this.haveRenderCallbacks,n);for(const r in e.getUpdatedImages(n))this.patchUpdatedImage(this.iconPositions[r],e.getImage(r,n),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r,n),t)}patchUpdatedImage(e,t,n){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[r,i]=e.tl;n.update(t.data,{position:{x:r,y:i}})}}so(Nf,"ImagePosition"),so(jf,"ImageAtlas");const Vf=1e20;function Uf(e,t,n,r,i,o,a,s,l){for(let c=t;c-1);l++,o[l]=s,a[l]=c,a[l+1]=Vf}for(let s=0,l=0;s{let{stack:n,id:r}=e,o=this.entries[n];o||(o=this.entries[n]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let a=o.glyphs[r];if(void 0!==a)return void t(null,{stack:n,id:r,glyph:a});if(a=this._tinySDF(o,n,r),a)return o.glyphs[r]=a,void t(null,{stack:n,id:r,glyph:a});const s=Math.floor(r/256);if(256*s>65535)return void t(new Error("glyphs > 65535 not supported"));if(o.ranges[s])return void t(null,{stack:n,id:r,glyph:a});let l=o.requests[s];l||(l=o.requests[s]=[],Wf.loadGlyphRange(n,s,i,this.requestManager,((e,t)=>{if(t){o.ascender=t.ascender,o.descender=t.descender;for(const e in t.glyphs)this._doesCharSupportLocalGlyph(+e)||(o.glyphs[+e]=t.glyphs[+e]);o.ranges[s]=!0}for(const n of l)n(e,t);delete o.requests[s]}))),l.push(((e,i)=>{e?t(e):i&&t(null,{stack:n,id:r,glyph:i.glyphs[r]||null})}))}),((e,t)=>{if(e)n(e);else if(t){const e={};for(const{stack:n,id:r,glyph:i}of t)void 0===e[n]&&(e[n]={}),void 0===e[n].glyphs&&(e[n].glyphs={}),e[n].glyphs[r]=i&&{id:i.id,bitmap:i.bitmap.clone(),metrics:i.metrics},e[n].ascender=this.entries[n].ascender,e[n].descender=this.entries[n].descender;n(null,e)}}))}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==qf.none&&(this.localGlyphMode===qf.all?!!this.localFontFamily:!!this.localFontFamily&&(fo["CJK Unified Ideographs"](e)||fo["Hangul Syllables"](e)||fo.Hiragana(e)||fo.Katakana(e)||fo["CJK Symbols and Punctuation"](e)||fo["CJK Unified Ideographs Extension A"](e)||fo["CJK Unified Ideographs Extension B"](e)))}_tinySDF(e,t,n){const r=this.localFontFamily;if(!r||!this._doesCharSupportLocalGlyph(n))return;let i=e.tinySDF;if(!i){let n="400";/bold/i.test(t)?n="900":/medium/i.test(t)?n="500":/light/i.test(t)&&(n="200"),i=e.tinySDF=new Wf.TinySDF({fontFamily:r,fontWeight:n,fontSize:24*Gf,buffer:3*Gf,radius:8*Gf}),i.fontWeight=n}if(this.localGlyphs[i.fontWeight][n])return this.localGlyphs[i.fontWeight][n];const o=String.fromCodePoint(n),{data:a,width:s,height:l,glyphWidth:c,glyphHeight:u,glyphLeft:h,glyphTop:d,glyphAdvance:f}=i.draw(o);return this.localGlyphs[i.fontWeight][n]={id:n,bitmap:new ru({width:s,height:l},a),metrics:{width:c/Gf,height:u/Gf,left:h/Gf,top:d/Gf-27,advance:f/Gf,localGlyph:!0}}}}Wf.loadGlyphRange=function(e,t,n,r,i){const o=256*t,a=o+255,s=r.transformRequest(r.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}",`${o}-${a}`),tt.Glyphs);ot(s,((e,t)=>{if(e)i(e);else if(t){const e={},n=function(e){return new sf(e).readFields(cf,{})}(t);for(const t of n.glyphs)e[t.id]=t;i(null,{glyphs:e,ascender:n.ascender,descender:n.descender})}}))},Wf.TinySDF=class{constructor(){let{fontSize:e=24,buffer:t=3,radius:n=8,cutoff:r=.25,fontFamily:i="sans-serif",fontWeight:o="normal",fontStyle:a="normal"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.buffer=t,this.cutoff=r,this.radius=n;const s=this.size=e+4*t,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${a} ${o} ${e}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:r,actualBoundingBoxLeft:i,actualBoundingBoxRight:o}=this.ctx.measureText(e),a=Math.ceil(n),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-i))),l=Math.min(this.size-this.buffer,a+Math.ceil(r)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),d=new Uint8ClampedArray(h),f={data:d,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:a,glyphLeft:0,glyphAdvance:t};if(0===s||0===l)return f;const{ctx:p,buffer:m,gridInner:g,gridOuter:_}=this;p.clearRect(m,m,s,l),p.fillText(e,m,m+a);const y=p.getImageData(m,m,s,l);_.fill(Vf,0,h),g.fill(0,0,h);for(let v=0;v0?e*e:0,g[n]=e<0?e*e:0}}Uf(_,0,0,c,u,c,this.f,this.v,this.z),Uf(g,m,m,s,l,c,this.f,this.v,this.z);for(let v=0;ve+t[1]-t[0],p=h.reduce(f,0),m=d.reduce(f,0),g=s-p,_=l-m;let y=0,v=p,x=0,b=m,w=0,S=g,M=0,A=_;if(o.content&&r){const e=o.content;y=Yf(h,0,e[0]),x=Yf(d,0,e[1]),v=Yf(h,e[0],e[2]),b=Yf(d,e[1],e[3]),w=e[0]-y,M=e[1]-x,S=e[2]-e[0]-v,A=e[3]-e[1]-b}const E=(r,i,s,l)=>{const h=Kf(r.stretch-y,v,c,e.left),d=Jf(r.fixed-w,S,r.stretch,p),f=Kf(i.stretch-x,b,u,e.top),g=Jf(i.fixed-M,A,i.stretch,m),_=Kf(s.stretch-y,v,c,e.left),E=Jf(s.fixed-w,S,s.stretch,p),T=Kf(l.stretch-x,b,u,e.top),C=Jf(l.fixed-M,A,l.stretch,m),k=new $(h,f),I=new $(_,f),P=new $(_,T),R=new $(h,T),L=new $(d/a,g/a),z=new $(E/a,C/a),D=t*Math.PI/180;if(D){const e=Math.sin(D),t=Math.cos(D),n=[t,-e,e,t];k._matMult(n),I._matMult(n),R._matMult(n),P._matMult(n)}const O=r.stretch+r.fixed,F=s.stretch+s.fixed,B=i.stretch+i.fixed,N=l.stretch+l.fixed,j=e.imageSecondary;return{tl:k,tr:I,bl:R,br:P,texPrimary:{x:o.paddedRect.x+Hf+O,y:o.paddedRect.y+Hf+B,w:F-O,h:N-B},texSecondary:j?{x:j.paddedRect.x+Hf+O,y:j.paddedRect.y+Hf+B,w:F-O,h:N-B}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:L,pixelOffsetBR:z,minFontScaleX:S/a/c,minFontScaleY:A/a/u,isSDF:n}};if(r&&(o.stretchX||o.stretchY)){const e=Xf(h,g,p),t=Xf(d,_,m);for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=1/0,i=1/0,o=-1/0,a=-1/0;const s=e[0];for(let f=0;fo)&&(o=e.x),(!f||e.y>a)&&(a=e.y)}const l=Math.min(o-r,a-i);let c=l/2;const u=new Xn([],tp);if(0===l)return new $(r,i);for(let f=r;fh.d||!h.d)&&(h=r,n&&console.log("found best %d after %d probes",Math.round(1e4*r.d)/1e4,d)),r.max-h.d<=t||(c=r.h/2,u.push(new np(r.p.x-c,r.p.y-c,c,e)),u.push(new np(r.p.x+c,r.p.y-c,c,e)),u.push(new np(r.p.x-c,r.p.y+c,c,e)),u.push(new np(r.p.x+c,r.p.y+c,c,e)),d+=4)}return n&&(console.log(`num probes: ${d}`),console.log(`best distance: ${h.d}`)),h.p}function tp(e,t){return t.max-e.max}class np{constructor(e,t,n,r){this.p=new $(e,t),this.h=n,this.d=function(e,t){let n=!1,r=1/0;for(let i=0;ie.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n),r=Math.min(r,Bl(e,i,s))}}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}}const rp=Number.POSITIVE_INFINITY,ip=Math.sqrt(2);function op(e,t){let[n,r]=t,i=0,o=0;if(r===rp){n<0&&(n=0);const t=n/ip;switch(e){case"top-right":case"top-left":o=t-7;break;case"bottom-right":case"bottom-left":o=7-t;break;case"bottom":o=7-n;break;case"top":o=n-7}switch(e){case"top-right":case"bottom-right":i=-t;break;case"top-left":case"bottom-left":i=t;break;case"left":i=n;break;case"right":i=-n}}else{switch(n=Math.abs(n),r=Math.abs(r),e){case"top-right":case"top-left":case"top":o=r-7;break;case"bottom-right":case"bottom-left":case"bottom":o=7-r}switch(e){case"top-right":case"bottom-right":case"right":i=-n;break;case"top-left":case"bottom-left":case"left":i=n}}return[i,o]}function ap(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function sp(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p){let m=o.textMaxSize.evaluate(t,{},h);void 0===m&&(m=a);const g=e.layers[0].layout,_=g.get("icon-offset").evaluate(t,{},h),y=hp(n.horizontal)||n.vertical,v="globe"===d.name,x=Gd,b=a/x,w=e.tilePixelRatio*m/x,S=(P=e.overscaling,e.zoom>18&&P>2&&(P>>=1),Math.max(Kn/(512*P),1)*g.get("symbol-spacing")),M=g.get("text-padding")*e.tilePixelRatio,A=g.get("icon-padding")*e.tilePixelRatio,E=H(g.get("text-max-angle")),T="map"===g.get("text-rotation-alignment")&&"point"!==g.get("symbol-placement"),C="map"===g.get("icon-rotation-alignment")&&"point"!==g.get("symbol-placement"),k=g.get("symbol-placement"),I=S/2;var P;const R=g.get("icon-text-fit").evaluate(t,{},h),L=g.get("icon-text-fit-padding").evaluate(t,{},h),z="none"!==R;let D;!1===e.hasAnyIconTextFit&&z&&(e.hasAnyIconTextFit=!0),r&&z&&(e.allowVerticalPlacement&&n.vertical&&(D=Tf(r,n.vertical,R,L,_,b)),y&&(r=Tf(r,y,R,L,_,b)));const O=(a,s,m)=>{if(s.x<0||s.x>=Kn||s.y<0||s.y>=Kn)return;let g=null;if(v){const{x:e,y:t,z:n}=d.projectTilePoint(s.x,s.y,m);g={anchor:new Cf(e,t,n,0,void 0),up:d.upVector(m,s.x,s.y)}}!function(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b,w,S,M,A,E){const T=e.addToLineVertexArray(t,r);let C,k,I,P,R,L,z,D=0,O=0,F=0,B=0,N=-1,j=-1;const V={};let U=yt("");const $=n?n.anchor:t,G="none"!==l.layout.get("icon-text-fit").evaluate(x,{},M);let q=0,W=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[q,W]=l.layout.get("text-offset").evaluate(x,{},M).map((e=>e*Gd)):(q=l.layout.get("text-radial-offset").evaluate(x,{},M)*Gd,W=rp),e.allowVerticalPlacement&&i.vertical){const e=i.vertical;if(p)L=fp(e),s&&(z=fp(s));else{const n=l.layout.get("text-rotate").evaluate(x,{},M)+90;I=dp(c,$,t,u,h,d,e,f,n,m),s&&(P=dp(c,$,t,u,h,d,s,_,n))}}if(o){const r=l.layout.get("icon-rotate").evaluate(x,{},M),i=Zf(o,r,w,G),a=s?Zf(s,r,w,G):void 0;k=dp(c,$,t,u,h,d,o,_,r),D=4*i.length;const f=e.iconSizeData;let p=null;"source"===f.kind?(p=[qd*l.layout.get("icon-size").evaluate(x,{},M)],p[0]>cp&&fe(`${e.layerIds[0]}: Value for "icon-size" is >= ${lp}. Reduce your "icon-size".`)):"composite"===f.kind&&(p=[qd*b.compositeIconSizes[0].evaluate(x,{},M),qd*b.compositeIconSizes[1].evaluate(x,{},M)],(p[0]>cp||p[1]>cp)&&fe(`${e.layerIds[0]}: Value for "icon-size" is >= ${lp}. Reduce your "icon-size".`)),e.addSymbols(e.icon,i,p,v,y,x,!1,n,t,T.lineStartIndex,T.lineLength,-1,S,M,A,E),N=e.icon.placedSymbolArray.length-1,a&&(O=4*a.length,e.addSymbols(e.icon,a,p,v,y,x,ff.vertical,n,t,T.lineStartIndex,T.lineLength,-1,S,M,A,E),j=e.icon.placedSymbolArray.length-1)}for(const X in i.horizontal){const r=i.horizontal[X];C||(U=yt(r.text),p?R=fp(r):C=dp(c,$,t,u,h,d,r,f,l.layout.get("text-rotate").evaluate(x,{},M),m));const o=1===r.positionedLines.length;if(F+=up(e,n,t,r,a,l,p,x,m,T,i.vertical?ff.horizontal:ff.horizontalOnly,o?Object.keys(i.horizontal):[X],V,N,b,S,M,A),o)break}i.vertical&&(B+=up(e,n,t,i.vertical,a,l,p,x,m,T,ff.vertical,["vertical"],V,j,b,S,M,A));let H=-1;const Z=(e,t)=>e?Math.max(e,t):t;H=Z(R,H),H=Z(L,H),H=Z(z,H);const Y=H>-1?1:0;e.glyphOffsetArray.length>=65535&&fe("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,x.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,$.x,$.y,$.z,V.right>=0?V.right:-1,V.center>=0?V.center:-1,V.left>=0?V.left:-1,V.vertical>=0?V.vertical:-1,N,j,U,void 0!==C?C:e.collisionBoxArray.length,void 0!==C?C+1:e.collisionBoxArray.length,void 0!==I?I:e.collisionBoxArray.length,void 0!==I?I+1:e.collisionBoxArray.length,void 0!==k?k:e.collisionBoxArray.length,void 0!==k?k+1:e.collisionBoxArray.length,P||e.collisionBoxArray.length,P?P+1:e.collisionBoxArray.length,u,F,B,D,O,Y,0,q,W,H,0,G?1:0)}(e,s,g,a,n,r,i,D,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,M,T,l,0,A,C,_,t,o,c,u,h,f,p)};if("line"===k)for(const F of Of(t.geometry,0,0,Kn,Kn)){const t=zf(F,S,E,n.vertical||y,r,x,w,e.overscaling,Kn);for(const n of t)y&&pp(e,y.text,I,n)||O(F,n,h)}else if("line-center"===k){for(const F of t.geometry)if(F.length>1){const e=Lf(F,E,n.vertical||y,r,x,w);e&&O(F,e,h)}}else if("Polygon"===t.type)for(const F of zu(t.geometry,0)){const e=ep(F,16);O(F[0],new Cf(e.x,e.y,0,0,void 0),h)}else if("LineString"===t.type)for(const F of t.geometry)O(F,new Cf(F[0].x,F[0].y,0,0,void 0),h);else if("Point"===t.type)for(const F of t.geometry)for(const e of F)O([e],new Cf(e.x,e.y,0,0,void 0),h)}const lp=255,cp=lp*qd;function up(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_){const y=function(e,t,n,r,i,o,a,s){const l=[];if(0===t.positionedLines.length)return l;const c=r.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=function(e){const t=e[0],n=e[1],r=t*n;return r>0?[t,-n]:r<0?[-t,n]:0===t?[n,t]:[n,-t]}(n);let h=Math.abs(t.top-t.bottom);for(const m of t.positionedLines)h-=m.lineOffset;const d=t.positionedLines.length,f=h/d;let p=t.top-n[1];for(let m=0;mcp&&fe(`${e.layerIds[0]}: Value for "text-size" is >= ${lp}. Reduce your "text-size".`)):"composite"===v.kind&&(x=[qd*p.compositeTextSizes[0].evaluate(s,{},g),qd*p.compositeTextSizes[1].evaluate(s,{},g)],(x[0]>cp||x[1]>cp)&&fe(`${e.layerIds[0]}: Value for "text-size" is >= ${lp}. Reduce your "text-size".`)),e.addSymbols(e.text,y,x,l,a,s,u,t,n,c.lineStartIndex,c.lineLength,f,m,g,_,!1);for(const b of h)d[b]=e.text.placedSymbolArray.length-1;return 4*y.length}function hp(e){for(const t in e)return e[t];return null}function dp(e,t,n,r,i,o,a,s,l,c){let u=a.top,h=a.bottom,d=a.left,f=a.right;const p=a.collisionPadding;if(p&&(d-=p[0],u-=p[1],f+=p[2],h+=p[3]),l){const e=new $(d,u),t=new $(f,u),n=new $(d,h),r=new $(f,h),i=H(l);let o=new $(0,0);c&&(o=new $(c[0],c[1])),e._rotateAround(i,o),t._rotateAround(i,o),n._rotateAround(i,o),r._rotateAround(i,o),d=Math.min(e.x,t.x,n.x,r.x),f=Math.max(e.x,t.x,n.x,r.x),u=Math.min(e.y,t.y,n.y,r.y),h=Math.max(e.y,t.y,n.y,r.y)}return e.emplaceBack(t.x,t.y,t.z,n.x,n.y,d,u,f,h,s,r,i,o),e.length-1}function fp(e){e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);const t=e.bottom-e.top;return t>0?Math.max(10,t):null}function pp(e,t,n,r){const i=e.compareText;if(t in i){const e=i[t];for(let t=e.length-1;t>=0;t--)if(r.dist(e[t])v&&(x(e,c,r,i,s,l),x(c,n,s,l,o,a))}x(h,d,r,o,i,o),x(d,f,i,o,i,a),x(f,p,i,a,r,a),x(p,h,r,a,r,o),m-=v,g-=v,_+=v,y+=v;const b=1/Math.max(_-m,y-g);return{scale:b,x:m*b,y:g*b,x2:_*b,y2:y*b,projection:t}}function _p(e,t){let{x:n,y:r}=t;return new $(((n-(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0))*e.scale-e.x)*Kn,(r*e.scale-e.y)*Kn)}const yp=N.mat4.identity(new Float32Array(16));class vp{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,t){return{x:0,y:0,z:0}}unproject(e,t){return new nl(0,0)}projectTilePoint(e,t,n){return{x:e,y:t,z:0}}locationPoint(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e._coordinatePoint(e.locationCoordinate(t),n)}pixelsPerMeter(e,t){return cl(1,e)*t}pixelSpaceConversion(e,t,n){return 1}farthestPixelDistance(e){return mp(e,e.pixelsPerMeter)}pointCoordinate(e,t,n,r){const i=e.horizonLineFromTop(!1),o=new $(t,Math.max(i,n));return e.rayIntersectionCoordinate(e.pointRayIntersection(o,r))}pointCoordinate3D(e,t,n){const r=new $(t,n);if(e.elevation)return e.elevation.pointCoordinate(r);{const t=this.pointCoordinate(e,r.x,r.y,0);return[t.x,t.y,t.z]}}isPointAboveHorizon(e,t){if(e.elevation&&e.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(e,t.x,t.y);const n=e.horizonLineFromTop();return t.y0?t<-Cp+n&&(t=-Cp+n):t>Cp-n&&(t=Cp-n);const o=i/Math.pow(kp(t),r);let a=o*Math.sin(r*e),s=i-o*Math.cos(r*e);return a=.5*(a/Math.PI+.5),s=.5*(s/Math.PI+.5),{x:a,y:this.southernCenter?s:1-s,z:0}}unproject(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;const{n:n,f:r}=this,i=r-t,o=Math.sign(i),a=Math.sign(n)*Math.sqrt(e*e+i*i);let s=Math.atan2(e,Math.abs(i))*o;i*n<0&&(s-=Math.PI*Math.sign(e)*o);const l=Q(Z(s/n)+this.center[0],-180,180),c=Q(Z(2*Math.atan(Math.pow(r/a,1/n))-Cp),-fl,fl);return new nl(l,this.southernCenter?-c:c)}}class Pp extends vp{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,t){return{x:sl(e),y:ll(t),z:0}}unproject(e,t){const n=ul(e),r=hl(t);return new nl(n,r)}}const Rp=H(fl);class Lp extends vp{project(e,t){const n=(t=H(t))*t,r=n*n;return{x:.5*((e=H(e))*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let n=t=(2*(1-t)-1)*Math.PI,r=25,i=0,o=n*n;do{o=n*n;const e=o*o;i=(n*(1.007226+o*(.015085+e*(.028874*o-.044475-.005916*e)))-t)/(1.007226+o*(.045255+e*(.259866*o-.311325-.005916*11*e))),n=Q(n-i,-Rp,Rp)}while(Math.abs(i)>1e-6&&--r>0);o=n*n;const a=Q(Z(e/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),s=Z(n);return new nl(a,s)}}const zp=H(fl);class Dp extends vp{project(e,t){t=H(t),e=H(e);const n=Math.cos(t),r=2/Math.PI,i=Math.acos(n*Math.cos(e/2)),o=Math.sin(i)/i,a=.5*(e*r+2*n*Math.sin(e/2)/o)||0,s=.5*(t+Math.sin(t)/o)||0;return{x:.5*(a/Math.PI+.5),y:1-.5*(s/Math.PI+1),z:0}}unproject(e,t){let n=e=(2*e-.5)*Math.PI,r=t=(2*(1-t)-1)*Math.PI,i=25;const o=1e-6;let a=0,s=0;do{const i=Math.cos(r),o=Math.sin(r),l=2*o*i,c=o*o,u=i*i,h=Math.cos(n/2),d=Math.sin(n/2),f=2*h*d,p=d*d,m=1-u*h*h,g=m?1/m:0,_=m?Math.acos(i*h)*Math.sqrt(1/m):0,y=.5*(2*_*i*d+2*n/Math.PI)-e,v=.5*(_*o+r)-t,x=.5*g*(u*p+_*i*h*c)+1/Math.PI,b=g*(f*l/4-_*o*d),w=.125*g*(l*d-_*o*u*f),S=.5*g*(c*h+_*p*i)+.5,M=b*w-S*x;a=(v*b-y*S)/M,s=(y*w-v*x)/M,n=Q(n-a,-Math.PI,Math.PI),r=Q(r-s,-zp,zp)}while((Math.abs(a)>o||Math.abs(s)>o)&&--i>0);return new nl(Z(n),Z(r))}}class Op extends vp{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(H(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){const{scale:n,cosPhi:r}=this;return{x:H(e)*r*n+.5,y:-Math.sin(H(t))/r*n+.5,z:0}}unproject(e,t){const{scale:n,cosPhi:r}=this,i=-(t-.5)/n,o=Q(Z((e-.5)/n)/r,-180,180),a=Math.asin(Q(i*r,-1,1)),s=Q(Z(a),-fl,fl);return new nl(o,s)}}class Fp extends Pp{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,t,n){const r=Cc(e,t,n),i=Pc(wc(n));return N.vec3.transformMat4(r,r,i),{x:r[0],y:r[1],z:r[2]}}locationPoint(e,t){const n=Qs(t.lat,t.lng),r=N.vec3.normalize([],n),i=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(t),e._centerAltitude):e._centerAltitude,o=cl(1,0)*Kn*i;N.vec3.scaleAndAdd(n,n,r,o);const a=N.mat4.identity(new Float64Array(16));return N.mat4.multiply(a,e.pixelMatrix,e.globeMatrix),N.vec3.transformMat4(n,n,a),new $(n[0],n[1])}pixelsPerMeter(e,t){return cl(1,0)*t}pixelSpaceConversion(e,t,n){const r=cl(1,e)*t,i=kt(cl(1,45)*t,r,n);return this.pixelsPerMeter(e,t)/i}createTileMatrix(e,t,n){const r=Rc(wc(n.canonical));return N.mat4.multiply(new Float64Array(16),e.globeMatrix,r)}createInversionMatrix(e,t){const{center:n}=e,r=Pc(wc(t));return N.mat4.rotateY(r,r,H(n.lng)),N.mat4.rotateX(r,r,H(n.lat)),N.mat4.scale(r,r,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(r)}pointCoordinate(e,t,n,r){return vc(e,t,n,!0)||new yl(0,0)}pointCoordinate3D(e,t,n){const r=this.pointCoordinate(e,t,n,0);return[r.x,r.y,r.z]}isPointAboveHorizon(e,t){return!vc(e,t.x,t.y,!1)}farthestPixelDistance(e){const t=function(e,t){const n=e.cameraToCenterDistance,r=e._centerAltitude*t,i=e._camera,o=e._camera.forward(),a=N.vec3.add([],N.vec3.scale([],o,-n),[0,0,r]),s=e.worldSize/(2*Math.PI),l=[0,0,-s],c=e.width/e.height,u=Math.tan(e.fovAboveCenter),h=N.vec3.scale([],i.up(),u),d=N.vec3.scale([],i.right(),u*c),f=N.vec3.normalize([],N.vec3.add([],N.vec3.add([],o,h),d)),p=[];let m;if(new cc(a,f).closestPointOnSphere(l,s,p)){const t=N.vec3.add([],p,l),n=N.vec3.sub([],t,a);m=Math.cos(e.fovAboveCenter)*N.vec3.length(n)}else{const e=N.vec3.sub([],a,l),t=N.vec3.sub([],l,a);N.vec3.normalize(t,t);const n=N.vec3.length(e)-s;m=Math.sqrt(n*(n+2*s));const r=Math.acos(m/(s+n))-Math.acos(N.vec3.dot(o,t));m*=Math.cos(r)}return 1.01*m}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),n=Oc(e.zoom);if(n>0){const r=mp(e,cl(1,e.center.lat)*e.worldSize),i=e.worldSize/(2*Math.PI),o=Math.max(e.width,e.height)/e.worldSize*Math.PI;return kt(t,r+i*(1-Math.cos(o)),Math.pow(n,10))}return t}upVector(e,t,n){return Cc(t,n,e,1)}upVectorScale(e){return{metersToTile:_c(kc(wc(e)))}}}function Bp(e){const t=e.parallels,n=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new Pp(e);case"equirectangular":return new Tp(e);case"naturalEarth":return new Lp(e);case"equalEarth":return new Ep(e);case"winkelTripel":return new Dp(e);case"albers":return n?new Op(e):new xp(e);case"lambertConformalConic":return n?new Op(e):new Ip(e);case"globe":return new Fp(e)}throw new Error(`Invalid projection name: ${e.name}`)}const Np=uh.VectorTileFeature.types,jp=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Vp(e,t,n,r,i,o,a,s,l,c,u,h,d){const f=s?Math.min(cp,Math.round(s[0])):0,p=s?Math.min(cp,Math.round(s[1])):0;e.emplaceBack(t,n,Math.round(32*r),Math.round(32*i),o,a,(f<<1)+(l?1:0),p,16*c,16*u,256*h,256*d)}function Up(e,t,n){e.emplaceBack(t,n)}function $p(e,t,n,r,i,o,a){e.emplaceBack(t,n,r,i,o,a)}function Gp(e,t,n,r,i){e.emplaceBack(t,n,r,i),e.emplaceBack(t,n,r,i),e.emplaceBack(t,n,r,i),e.emplaceBack(t,n,r,i)}function qp(e){for(const t of e.sections)if(bo(t.text))return!0;return!1}class Wp{constructor(e){this.layoutVertexArray=new ka,this.indexArray=new Fa,this.programConfigurations=e,this.segments=new hs,this.dynamicLayoutVertexArray=new Ma,this.opacityVertexArray=new Pa,this.placedSymbolArray=new Qa,this.iconTransitioningVertexArray=new Ra,this.globeExtVertexArray=new Ia,this.zOffsetVertexArray=new ja}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}upload(e,t,n,r,i){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Dd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Fd.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,jp,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,Nd.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Od.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||i)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Bd.members,!0)),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy())}}so(Wp,"SymbolBuffers");class Hp{constructor(e,t,n){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new n,this.segments=new hs,this.collisionVertexArray=new Oa,this.collisionVertexArrayExt=new Ma}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,jd.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Vd.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}so(Hp,"CollisionBuffers");class Zp{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.lut=e.lut,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=N.mat4.identity([]),this.placementViewportMatrix=N.mat4.identity([]);const t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Wd(this.zoom,t["text-size"]),this.iconSizeData=Wd(this.zoom,t["icon-size"]);const n=this.layers[0].layout,r=n.get("symbol-sort-key"),i=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==r.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=n.get("text-writing-mode").map((e=>ff[e])),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=e.sourceID,this.projection=e.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=n.get("symbol-z-elevate"),this.activeReplacements=[],this.replacementUpdateTime=0}createArrays(){this.text=new Wp(new Bs(this.layers,{zoom:this.zoom,lut:this.lut},(e=>e.startsWith("text")||e.startsWith("symbol")))),this.icon=new Wp(new Bs(this.layers,{zoom:this.zoom,lut:this.lut},(e=>e.startsWith("icon")||e.startsWith("symbol")))),this.glyphOffsetArray=new ns,this.lineVertexArray=new rs,this.symbolInstances=new ts}calculateGlyphDependencies(e,t,n,r,i){for(let o=0;o0)&&("constant"!==s.value.kind||s.value.value.length>0),h="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,d=o.get("symbol-sort-key");if(this.features=[],!u&&!h)return;const f=t.iconDependencies,p=t.glyphDependencies,m=t.availableImages,g=new zo(this.zoom);for(const{feature:_,id:y,index:v,sourceLayerIndex:x}of e){const e=i._featureFilter.needGeometry,t=Tl(_,e);if(!i._featureFilter.filter(g,t,n))continue;if(e||(t.geometry=El(_,n,r)),a&&1!==_.type&&n.z<=5){const e=t.geometry,r=.98078528056,i=(e,t)=>{const i=Cc(e.x,e.y,n,1),o=Cc(t.x,t.y,n,1);return N.vec3.dot(i,o)=0;for(const t of l.sections)if(t.image)f[t.image.namePrimary]=!0;else{const n=po(l.toString()),i=t.fontStack||e,o=p[i]=p[i]||{};this.calculateGlyphDependencies(t.text,o,r,this.allowVerticalPlacement,n)}}}"line"===o.get("symbol-placement")&&(this.features=function(e){const t={},n={},r=[];let i=0;function o(t){r.push(e[t]),i++}function a(e,t,i){const o=n[e];return delete n[e],n[t]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(i[0]),o}function s(e,n,i){const o=t[n];return delete t[n],t[e]=o,r[o].geometry[0].shift(),r[o].geometry[0]=i[0].concat(r[o].geometry[0]),o}function l(e,t,n){const r=n?t[0][t[0].length-1]:t[0][0];return`${e}:${r.x}:${r.y}`}for(let c=0;ce.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,n,r,i){const o=0!==Object.keys(e).length;if(o&&!this.stateDependentLayers.length)return;const a=o?this.stateDependentLayers:this.layers;this.text.programConfigurations.updatePaintArrays(e,t,a,n,r,i),this.icon.programConfigurations.updatePaintArrays(e,t,a,n,r,i)}updateZOffset(){const e=(e,t,r)=>{n+=t,n>e.length&&e.resize(n);for(let i=-t;i<0;i++)e.emplace(i+n,r)},t=(e,t,n)=>{r+=t,r>e.length&&e.resize(r);for(let i=-t;i<0;i++)e.emplace(i+r,n)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let n=0,r=0;for(let i=0;i0;if((r>0||o>0)&&(e(this.text.zOffsetVertexArray,r,s),e(this.text.zOffsetVertexArray,o,s)),l){const{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:r}=n;e>=0&&t(this.icon.zOffsetVertexArray,a,s),r>=0&&t(this.icon.zOffsetVertexArray,n.numVerticalIconVertices,s)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Bp(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const n=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:r,y:i}of t)this.lineVertexArray.emplaceBack(r,i);return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m){const g=e.indexArray,_=e.layoutVertexArray,y=e.globeExtVertexArray,v=e.segments.prepareSegment(4*t.length,_,g,this.canOverlap?o.sortKey:void 0),x=this.glyphOffsetArray.length,b=v.vertexLength,w=this.allowVerticalPlacement&&a===ff.vertical?Math.PI/2:0,S=o.text&&o.text.sections;for(let A=0;A=0?t.rightJustifiedTextSymbolIndex:t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.leftJustifiedTextSymbolIndex>=0?t.leftJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex>=0?t.verticalPlacedTextSymbolIndex:r),o=Hd(this.textSizeData,e,i)/Gd;return this.tilePixelRatio*o}getSymbolInstanceIconSize(e,t,n){const r=this.icon.placedSymbolArray.get(n),i=Hd(this.iconSizeData,e,r);return this.tilePixelRatio*i}_commitDebugCollisionVertexUpdate(e,t,n,r){e.emplaceBack(t,-n,-n,r),e.emplaceBack(t,n,-n,r),e.emplaceBack(t,n,n,r),e.emplaceBack(t,-n,n,r)}_updateTextDebugCollisionBoxes(e,t,n,r,i,o){for(let a=r;a0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(e,t){const n=e.placedSymbolArray.get(t),r=n.vertexStartIndex+4*n.numGlyphs;for(let i=n.vertexStartIndex;ir[e]-r[t]||i[t]-i[e])),o}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let e=0;ethis.symbolInstances.get(t).zOffset-this.symbolInstances.get(e).zOffset))}addToSortKeyRanges(e,t){const n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===t?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);const{rightJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:r,leftJustifiedTextSymbolIndex:i,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:a,verticalPlacedIconSymbolIndex:s}=t;n>=0&&this.addIndicesForPlacedSymbol(this.text,n),r>=0&&r!==n&&this.addIndicesForPlacedSymbol(this.text,r),i>=0&&i!==r&&i!==n&&this.addIndicesForPlacedSymbol(this.text,i),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Yp,Xp,Kp;so(Zp,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),Zp.addDynamicAttributes=Gp;class Jp{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Dt,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}so(Jp,"FormatSectionOverride",{omit:["defaultValue"]});const Qp=()=>Kp||(Kp={layout:Yp||(Yp=new Wo({"symbol-placement":new $o(Ho.layout_symbol["symbol-placement"]),"symbol-spacing":new $o(Ho.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new $o(Ho.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Go(Ho.layout_symbol["symbol-sort-key"]),"symbol-z-order":new $o(Ho.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new $o(Ho.layout_symbol["symbol-z-elevate"]),"icon-allow-overlap":new $o(Ho.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new $o(Ho.layout_symbol["icon-ignore-placement"]),"icon-optional":new $o(Ho.layout_symbol["icon-optional"]),"icon-rotation-alignment":new $o(Ho.layout_symbol["icon-rotation-alignment"]),"icon-size":new Go(Ho.layout_symbol["icon-size"]),"icon-text-fit":new Go(Ho.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Go(Ho.layout_symbol["icon-text-fit-padding"]),"icon-image":new Go(Ho.layout_symbol["icon-image"]),"icon-rotate":new Go(Ho.layout_symbol["icon-rotate"]),"icon-padding":new $o(Ho.layout_symbol["icon-padding"]),"icon-keep-upright":new $o(Ho.layout_symbol["icon-keep-upright"]),"icon-offset":new Go(Ho.layout_symbol["icon-offset"]),"icon-anchor":new Go(Ho.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new $o(Ho.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new $o(Ho.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new $o(Ho.layout_symbol["text-rotation-alignment"]),"text-field":new Go(Ho.layout_symbol["text-field"]),"text-font":new Go(Ho.layout_symbol["text-font"]),"text-size":new Go(Ho.layout_symbol["text-size"]),"text-max-width":new Go(Ho.layout_symbol["text-max-width"]),"text-line-height":new Go(Ho.layout_symbol["text-line-height"]),"text-letter-spacing":new Go(Ho.layout_symbol["text-letter-spacing"]),"text-justify":new Go(Ho.layout_symbol["text-justify"]),"text-radial-offset":new Go(Ho.layout_symbol["text-radial-offset"]),"text-variable-anchor":new $o(Ho.layout_symbol["text-variable-anchor"]),"text-anchor":new Go(Ho.layout_symbol["text-anchor"]),"text-max-angle":new $o(Ho.layout_symbol["text-max-angle"]),"text-writing-mode":new $o(Ho.layout_symbol["text-writing-mode"]),"text-rotate":new Go(Ho.layout_symbol["text-rotate"]),"text-padding":new $o(Ho.layout_symbol["text-padding"]),"text-keep-upright":new $o(Ho.layout_symbol["text-keep-upright"]),"text-transform":new Go(Ho.layout_symbol["text-transform"]),"text-offset":new Go(Ho.layout_symbol["text-offset"]),"text-allow-overlap":new $o(Ho.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new $o(Ho.layout_symbol["text-ignore-placement"]),"text-optional":new $o(Ho.layout_symbol["text-optional"]),visibility:new $o(Ho.layout_symbol.visibility)})),paint:Xp||(Xp=new Wo({"icon-opacity":new Go(Ho.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new Go(Ho.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new Go(Ho.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new Go(Ho.paint_symbol["text-emissive-strength"]),"icon-color":new Go(Ho.paint_symbol["icon-color"]),"icon-halo-color":new Go(Ho.paint_symbol["icon-halo-color"]),"icon-halo-width":new Go(Ho.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Go(Ho.paint_symbol["icon-halo-blur"]),"icon-translate":new $o(Ho.paint_symbol["icon-translate"]),"icon-translate-anchor":new $o(Ho.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new Go(Ho.paint_symbol["icon-image-cross-fade"]),"text-opacity":new Go(Ho.paint_symbol["text-opacity"]),"text-occlusion-opacity":new Go(Ho.paint_symbol["text-occlusion-opacity"]),"text-color":new Go(Ho.paint_symbol["text-color"],{runtimeType:Nt,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Go(Ho.paint_symbol["text-halo-color"]),"text-halo-width":new Go(Ho.paint_symbol["text-halo-width"]),"text-halo-blur":new Go(Ho.paint_symbol["text-halo-blur"]),"text-translate":new $o(Ho.paint_symbol["text-translate"]),"text-translate-anchor":new $o(Ho.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new $o(Ho.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new $o(Ho.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new $o(Ho.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new $o(Ho.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new Go(Ho.paint_symbol["symbol-z-offset"]),"symbol-elevation-reference":new $o(Ho.paint_symbol["symbol-elevation-reference"])}))},Kp);class em extends fa{constructor(e,t,n,r){super(e,Qp(),t,n,r),this._colorAdjustmentMatrix=N.mat4.identity([]),this.hasInitialOcclusionOpacityProperties=void 0!==e.paint&&("icon-occlusion-opacity"in e.paint||"text-occlusion-opacity"in e.paint)}recalculate(e,t){super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const n=this.layout.get("text-writing-mode");if(n){const e=[];for(const t of n)e.indexOf(t)<0&&e.push(t);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(e,t,n,r){return this._saturation===e&&this._contrast===t&&this._brightnessMin===n&&this._brightnessMax===r||(this._colorAdjustmentMatrix=function(e,t,n,r){e=Ae(e),t=Me(t);const i=N.mat4.create(),o=e/3,a=1-2*o,s=[a,o,o,0,o,a,o,0,o,o,a,0,0,0,0,1],l=.5-.5*t,c=r-n;return N.mat4.multiply(i,[c,0,0,0,0,c,0,0,0,0,c,0,n,n,n,1],[t,0,0,0,0,t,0,0,0,0,t,0,l,l,l,1]),N.mat4.multiply(i,i,s),i}(e,t,n,r),this._saturation=e,this._contrast=t,this._brightnessMin=n,this._brightnessMax=r),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,t,n,r){const i=this.layout.get(e).evaluate(t,{},n,r),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||Yi(o.value)||!i?i:function(e,t){return t.replace(/{([^{}]+)}/g,((t,n)=>n in e?String(e[n]):""))}(t.properties,i)}createBucket(e){return new Zp(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Qp().paint.overridableProperties){if(!em.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),n=new Jp(t),r=new Zi(n,t.property.specification,this.scope,this.options);let i=null;i="constant"===t.value.kind||"source"===t.value.kind?new Ki("source",r):new Ji("composite",r,t.value.zoomStops,t.value._interpolationType),this.paint._values[e]=new Vo(t.property,i,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,n){return!(!this.layout||t.isDataDriven()||n.isDataDriven())&&em.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const n=e.get("text-field"),r=Qp().paint.properties[t];let i=!1;const o=e=>{for(const t of e)if(r.overrides&&r.overrides.hasOverride(t))return void(i=!0)};if("constant"===n.value.kind&&n.value.value instanceof Qt)o(n.value.value.sections);else if("source"===n.value.kind){const e=t=>{i||(t instanceof an&&rn(t.value)===$t?o(t.value.sections):t instanceof un?o(t.sections):t.eachChild(e))},t=n.value;t._styleExpression&&e(t._styleExpression.expression)}return i}getProgramIds(){return["symbol"]}getDefaultProgramParams(e,t,n){return{config:new Fs(this,{zoom:t,lut:n}),overrideFog:!1}}}let tm,nm,rm,im;var om=_a([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);function am(e){switch(e){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.RGBA;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.DEPTH_COMPONENT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.DEPTH_STENCIL;case WebGL2RenderingContext.R8:case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.RED}}function sm(e){switch(e){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.UNSIGNED_SHORT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.UNSIGNED_INT_24_8;case WebGL2RenderingContext.R8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.FLOAT}}class lm{constructor(e,t,n,r){this.context=e,this.format=n,this.useMipmap=r&&r.useMipmap,this.texture=e.gl.createTexture(),this.update(t,{premultiply:r&&r.premultiply})}update(e,t){const n=e&&e instanceof HTMLVideoElement&&0===e.width?e.videoWidth:e.width,r=e&&e instanceof HTMLVideoElement&&0===e.height?e.videoHeight:e.height,{context:i}=this,{gl:o}=i,{x:a,y:s}=t&&t.position?t.position:{x:0,y:0},l=Math.max(a+n,this.size?this.size[0]:0),c=Math.max(s+r,this.size?this.size[1]:0);!this.size||this.size[0]===l&&this.size[1]===c||(o.bindTexture(o.TEXTURE_2D,null),o.deleteTexture(this.texture),this.texture=o.createTexture(),this.size=null),o.bindTexture(o.TEXTURE_2D,this.texture),i.pixelStoreUnpackFlipY.set(!1),i.pixelStoreUnpack.set(1),i.pixelStoreUnpackPremultiplyAlpha.set(this.format===o.RGBA8&&(!t||!1!==t.premultiply));const u=e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap;if(!this.size&&l>0&&c>0){const e=this.useMipmap?Math.floor(Math.log2(Math.max(l,c)))+1:1;o.texStorage2D(o.TEXTURE_2D,e,this.format,l,c),this.size=[l,c]}if(this.size)if(u)o.texSubImage2D(o.TEXTURE_2D,0,a,s,am(this.format),sm(this.format),e);else{const t=e.data;t&&o.texSubImage2D(o.TEXTURE_2D,0,a,s,n,r,am(this.format),sm(this.format),t)}this.useMipmap&&o.generateMipmap(o.TEXTURE_2D)}bind(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{context:r}=this,{gl:i}=r;i.bindTexture(i.TEXTURE_2D,this.texture),e!==this.minFilter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,this.useMipmap&&!n?e===i.NEAREST?i.NEAREST_MIPMAP_NEAREST:i.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),t!==this.wrapS&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrapS=t)}bindExtraParam(e,t,n,r){const{context:i}=this,{gl:o}=i;o.bindTexture(o.TEXTURE_2D,this.texture),t!==this.magFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,t),this.magFilter=t),e!==this.minFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,this.useMipmap?e===o.NEAREST?o.NEAREST_MIPMAP_NEAREST:o.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),n!==this.wrapS&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,n),this.wrapS=n),r!==this.wrapT&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,r),this.wrapT=r)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class cm{constructor(e,t){this.context=e,this.texture=t}bind(e,t){const{context:n}=this,{gl:r}=n;r.bindTexture(r.TEXTURE_2D,this.texture),e!==this.minFilter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,t),this.wrapS=t)}}function um(e,t,n,r,i,o,a,s){const l=[e,t,1,n,r,1,i,o,1],c=[a,s,1],u=N.mat3.adjoint([],l),[h,d,f]=N.vec3.transformMat3(c,c,u);return N.mat3.multiply(l,l,[h,0,0,0,d,0,0,0,f])}function hm(e,t,n,r,i,o,a,s){const l=function(e,t,n,r,i,o,a,s){const l=um(0,0,1,0,1,1,0,1),c=um(e,t,n,r,i,o,a,s),u=N.mat3.adjoint([],l);return N.mat3.multiply(c,c,u)}(e,t,n,r,i,o,a,s);return[l[2]/l[8]/Kn,l[5]/l[8]/Kn]}function dm(e){return[e[0],Math.min(Math.max(e[1],-fl),fl)]}class fm extends St{constructor(e,t,n,r){super(),this.id=e,this.dispatcher=n,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(r),this.options=t,this._dirty=!1}load(e,t){if(this._loaded=t||!1,this.fire(new vt("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return e&&(this.coordinates=e),this._loaded=!0,void this._finishLoading();this._imageRequest=ut(this.map._requestManager.transformRequest(this.url,tt.Image),((t,n)=>{this._imageRequest=null,this._loaded=!0,t?this.fire(new xt(t)):n&&(this.image=n instanceof HTMLImageElement?Oe.getImageData(n):n,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading())}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}setTexture(e){if(!(e.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new cm(this.map.painter.context,e.handle),this.width=e.dimensions[0],this.height=e.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new vt("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(e){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof cm||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(e){if(this.coordinates=e,this._boundsArray=void 0,this._unsupportedCoords=!1,!e.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let t=e[0][1],n=e[0][1];for(const i of e)i[1]>n&&(n=i[1]),i[1]fl?this.onNorthPole=!0:r<-fl&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const t=e.map(yl.fromLngLat);this.tileID=function(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(const c of e)t=Math.min(t,c.x),n=Math.min(n,c.y),r=Math.max(r,c.x),i=Math.max(i,c.y);const o=Math.max(r-t,i-n),a=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),s=Math.pow(2,a);let l=Math.floor((t+r)/2*s);return l>1&&(l-=1),new ec(a,l,Math.floor((n+i)/2*s))}(t),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new vt("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(e){for(const g in this.tiles){const e=this.tiles[g];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const t=gp(new ec(0,0,0),this.map.transform.projection),n=[t.projection.project(this.coordinates[0][0],this.coordinates[0][1]),t.projection.project(this.coordinates[1][0],this.coordinates[1][1]),t.projection.project(this.coordinates[2][0],this.coordinates[2][1]),t.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(e){const t=e[1].x-e[0].x,n=e[1].y-e[0].y,r=e[2].x-e[1].x,i=e[2].y-e[1].y,o=e[3].x-e[2].x,a=e[3].y-e[2].y,s=e[0].x-e[3].x,l=e[0].y-e[3].y,c=t*i-r*n,u=r*a-o*i,h=o*l-s*a,d=s*n-t*l;return c>0&&u>0&&h>0&&d>0||c<0&&u<0&&h<0&&d<0}(n))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const r=gp(this.tileID,this.map.transform.projection),[i,o,a,s]=this.coordinates.map((e=>{const t=r.projection.project(e[0],e[1]);return _p(r,t)._round()}));this.perspectiveTransform=hm(i.x,i.y,o.x,o.y,a.x,a.y,s.x,s.y);const l=this._boundsArray=new ba;l.emplaceBack(i.x,i.y,0,0),l.emplaceBack(o.x,o.y,Kn,0),l.emplaceBack(s.x,s.y,0,Kn),l.emplaceBack(a.x,a.y,Kn,Kn),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=e.createVertexBuffer(l,om.members),this.boundsSegments=hs.simpleSegment(0,0,4,2);const c=[],u=[dm((h=this.coordinates)[0]),dm(h[1]),dm(h[2]),dm(h[3])];var h;const[d,f,p,m]=function(e){let t=e[0][0],n=t,r=e[0][1],i=r;for(let o=1;on&&(n=e[o][0]),e[o][1]i&&(i=e[o][1]);return[t,r,n-t,i-r]}(u);{const r=new ba,[i,o,a,s]=function(e){let t=e[0].x,n=t,r=e[0].y,i=r;for(let o=1;on&&(n=e[o].x),e[o].yi&&(i=e[o].y);return[t,r,n-t,i-r]}(n),l=e=>[(e.x-i)/a,(e.y-o)/s],[u,h,g,_]=n.map(l),y=function(e,t,n,r,i,o,a,s){const l=um(0,0,1,0,1,1,0,1),c=um(e,t,n,r,i,o,a,s),u=N.mat3.adjoint([],c);return N.mat3.multiply(l,l,u)}(u[0],u[1],h[0],h[1],g[0],g[1],_[0],_[1]);this.elevatedGlobePerspectiveTransform=hm(u[0],u[1],h[0],h[1],g[0],g[1],_[0],_[1]);const v=(e,t)=>{c.push(e.lng);const n=Math.round((e.lng-d)/p*Kn),i=Math.round((e.lat-f)/m*Kn),o=l(t),a=N.vec3.transformMat3([],[o[0],o[1],1],y),s=Math.round(a[0]/a[2]*Kn),u=Math.round(a[1]/a[2]*Kn);r.emplaceBack(n,i,s,u)},x=n[3].x-n[0].x,b=n[3].y-n[0].y,w=n[2].x-n[1].x,S=n[2].y-n[1].y;for(let e=0;e<65;e++){const r=e/64,i=[n[0].x+r*x,n[0].y+r*b],o=[n[1].x+r*w,n[1].y+r*S],a=o[0]-i[0],s=o[1]-i[1];for(let e=0;e<65;e++){const n=e/64,r={x:i[0]+a*n,y:i[1]+s*n,z:0};v(t.projection.unproject(r.x,r.y),r)}}this.elevatedGlobeVertexBuffer=e.createVertexBuffer(r,om.members)}{this.maxLongitudeTriangleSize=0;let t=[],n=new Fa;const r=(e,r,i)=>{n.emplaceBack(e,r,i);const o=c[e],a=c[r],s=c[i],l=Math.min(Math.min(o,a),s),u=Math.max(Math.max(o,a),s)-l;u>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=u),t.push(l+u/2)};for(let e=0;e<64;e++)for(let t=0;t<64;t++){const n=65*e+t,i=n+1,o=n+65,a=o+1;r(n,o,i),r(i,o,a)}[t,n]=function(e,t){const n=Array.from({length:e.length},((e,t)=>t));n.sort(((t,n)=>e[t]-e[n]));const r=[],i=new Fa;for(let o=0;o{o.segments.push({vertexOffset:0,primitiveOffset:e,vertexLength:t.segments[0].vertexLength,primitiveLength:n,sortKey:void 0,vaos:{}})},s=.51*this.maxLongitudeTriangleSize;if(Math.abs(n[0]-r)<=s){const e=Se(n,0,n.length,r+s);return e===n.length||a(e,we(n,e+1,n.length,r+360-s)-e),o}r4&&void 0!==arguments[4]?arguments[4]:1/0;const o=e.range;if(!o)return 0;const a=Math.min(i,Math.max(n,r)),s=Math.log(a/1024)/Math.LN2;return ee(o[0]+s,o[1]+s,t)}const Tm=1/4e4;function Cm(e,t){const n=Q(t.lat,-fl,fl),r=new nl(t.lng-180*Tm,n),i=new nl(t.lng+180*Tm,n),o=e.project(r.lng,n),a=e.project(i.lng,n),s=yl.fromLngLat(r),l=yl.fromLngLat(i),c=a.x-o.x,u=a.y-o.y,h=l.x-s.x,d=l.y-s.y,f=Math.sqrt((h*h+d*d)/(c*c+u*u));return Math.log(f)/Math.LN2}function km(e,t,n){const r=Math.cos(n),i=Math.sin(n);return{x:e*r-t*i,y:e*i+t*r}}function Im(e,t,n){N.mat4.identity(e),N.mat4.rotateZ(e,e,H(t[2])),N.mat4.rotateX(e,e,H(t[0])),N.mat4.rotateY(e,e,H(t[1])),N.mat4.scale(e,e,n),N.mat4.multiply(e,e,[1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1])}function Pm(e,t,n,r,i,o,a,s){const l=[n[0]-t[0],n[1]-t[1],0],c=[r[0]-t[0],r[1]-t[1],0];if(N.vec3.length(l)<1e-12||N.vec3.length(c)<1e-12)return N.quat.identity(e);const u=N.vec3.cross([],l,c);N.vec3.normalize(u,u),N.vec3.subtract(c,r,t),l[2]=(o-i)*s,c[2]=(a-i)*s;const h=l;return N.vec3.cross(h,l,c),N.vec3.normalize(h,h),N.quat.rotationTo(e,u,h)}function Rm(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=Oc(t.zoom),i=function(e,t,n){const r=t.worldSize,i=[e[12],e[13],e[14]],o=hl(i[1]/r),a=ul(i[0]/r),s=N.mat4.identity([]),l=cl(1,o)*r,c=cl(1,0)*r*ml(o,t.zoom),u=1/Lc(r);let h=c*u;if(n){const e=Em(t.projection,t.zoom,t.width,t.height,1024);h=u*t.projection.pixelSpaceConversion(t.center.lat,r,e)}const d=Qs(o,a);N.vec3.add(d,d,N.vec3.scale([],N.vec3.normalize([],d),l*h*i[2]));const f=function(e){const t=[e[0],e[1],e[2]];let n=[0,1,0];const r=N.vec3.cross([],n,t);return N.vec3.cross(n,t,r),0===N.vec3.squaredLength(n)&&(n=[0,1,0],N.vec3.cross(r,t,n)),N.vec3.normalize(r,r),N.vec3.normalize(n,n),N.vec3.normalize(t,t),[r[0],r[1],r[2],0,n[0],n[1],n[2],0,t[0],t[1],t[2],0,e[0],e[1],e[2],1]}(d);N.mat4.scale(s,s,[h,h,h*l]),N.mat4.translate(s,s,[-i[0],-i[1],-i[2]]);const p=N.mat4.multiply([],t.globeMatrix,f);return N.mat4.multiply(p,p,s),N.mat4.multiply(p,p,e),p}(e,t,n);if(r>0){const n=function(e,t){const n=t.worldSize,r=cl(1,0)*n*ml(t.center.lat,t.zoom)/Lc(n),i=cl(1,t.center.lat)*n,o=N.mat4.identity([]);return N.mat4.rotateY(o,o,H(t.center.lng)),N.mat4.rotateX(o,o,H(t.center.lat)),N.mat4.translate(o,o,[0,0,Gs]),N.mat4.scale(o,o,[r,r,r*i]),N.mat4.translate(o,o,[t.point.x-.5*n,t.point.y-.5*n,0]),N.mat4.multiply(o,o,e),N.mat4.multiply(o,t.globeMatrix,o)}(e,t);return function(e,t,n){const r=(e,t,n)=>{const r=N.vec3.length(e),i=N.vec3.length(t),o=Sc(e,t,n);return N.vec3.scale(o,o,1/N.vec3.length(o)*kt(r,i,n))},i=r([e[0],e[1],e[2]],[t[0],t[1],t[2]],n),o=r([e[4],e[5],e[6]],[t[4],t[5],t[6]],n),a=r([e[8],e[9],e[10]],[t[8],t[9],t[10]],n),s=Sc([e[12],e[13],e[14]],[t[12],t[13],t[14]],n);return[i[0],i[1],i[2],0,o[0],o[1],o[2],0,a[0],a[1],a[2],0,s[0],s[1],s[2],1]}(i,n,r)}return i}function Lm(e,t,n,r){const i=gc.projectAabbCorners(r,n);let o=Number.MAX_VALUE,a=-1;for(let c=0;cnew $(i[e][0],i[e][1]);let l;switch(a){case 0:case 6:l=[s(1),s(5),s(4),s(7),s(3),s(2),s(1)];break;case 1:case 7:l=[s(0),s(4),s(5),s(6),s(2),s(3),s(0)];break;case 3:case 5:l=[s(1),s(0),s(4),s(7),s(6),s(2),s(1)];break;default:l=[s(1),s(5),s(6),s(7),s(3),s(0),s(1)]}if(Pl(e,l))return o}const zm=_a([{name:"a_pos_3f",components:3,type:"Float32"}]),Dm=_a([{name:"a_color_3f",components:3,type:"Float32"}]),Om=_a([{name:"a_color_4f",components:4,type:"Float32"}]),Fm=_a([{name:"a_uv_2f",components:2,type:"Float32"}]),Bm=_a([{name:"a_normal_3f",components:3,type:"Float32"}]),Nm=_a([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),jm=_a([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]),Vm={None:0,Model:1,Symbol:2,FillExtrusion:4,All:7};class Um{constructor(e,t,n,r){this.message=(e?`${e}: `:"")+n,r&&(this.identifier=r),null!=t&&t.__line__&&(this.line=t.__line__)}}function $m(e,t){const n=-1===e.indexOf("://");try{return new URL(e,n&&t?"http://example.com":void 0),!0}catch(e){return!1}}class Gm{constructor(e,t){this.feature=e,this.instancedDataOffset=t,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class qm{constructor(){this.instancedDataArray=new Wa,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}}class Wm{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.projection=e.projection,this.index=e.index,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0}updateFootprints(e,t){}populate(e,t,n,r){this.tileToMeter=_l(n);const i=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:o,id:a,index:s,sourceLayerIndex:l}of e){const e=null!=a?a:o.properties&&o.properties.hasOwnProperty("id")?o.properties.id:void 0,c=Tl(o,i);if(!this.layers[0]._featureFilter.filter(new zo(this.zoom),c,n))continue;const u={id:e,sourceLayerIndex:l,index:s,geometry:i?c.geometry:El(o,n,r),properties:o.properties,type:o.type,patterns:{}},h=this.addFeature(u,u.geometry,c);h&&t.featureIndex.insert(o,u.geometry,s,l,this.index,this.instancesPerModel[h].instancedDataArray.length,Kn/32)}this.lookup=null}update(e,t,n,r){for(const i in this.instancesPerModel){const t=this.instancesPerModel[i];for(const n in e)t.idToFeaturesIndex.hasOwnProperty(n)&&(this.evaluate(t.features[t.idToFeaturesIndex[n]],e[n],t,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let e=!1;for(const t in this.instancesPerModel){const n=this.instancesPerModel[t];for(const t of n.features){const r=this.layers[0],i=t.feature,o=this.canonical,a=r.paint.get("model-rotation").evaluate(i,{},o),s=r.paint.get("model-scale").evaluate(i,{},o),l=r.paint.get("model-translation").evaluate(i,{},o);N.vec3.exactEquals(t.rotation,a)&&N.vec3.exactEquals(t.scale,s)&&N.vec3.exactEquals(t.translation,l)||(this.evaluate(t,t.featureStates,n,!0),e=!0)}}return e}updateReplacement(e,t,n,r){if(t.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=t.updateTime;const i=t.getReplacementRegionsForTile(e.toUnwrapped(),!0);if(bh(this.activeReplacements,i))return!1;this.activeReplacements=i;let o=!1;for(const a in this.instancesPerModel){const t=this.instancesPerModel[a],i=t.instancedDataArray;for(const a of t.features){const t=a.instancedDataOffset,s=a.instancedDataCount;for(let a=0;aKn;l=c?l-Kn:l;const u=Math.floor(l),h=i.float32[s+1];let d=!1;for(const t of this.activeReplacements)if(!_h(t,n,Vm.Model,r)&&!(t.min.x>u||u>t.max.x||t.min.y>h||h>t.max.y)&&(d=Th(Eh(u,h,e.canonical,t.footprintTileId.canonical),t.footprint),d))break;i.float32[s]=d?l+Kn:l,o=o||d!==c}}}return o}isEmpty(){for(const e in this.instancesPerModel)if(0!==this.instancesPerModel[e].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(const t in this.instancesPerModel){const n=this.instancesPerModel[t];n.instancedDataArray.length<0||0===n.instancedDataArray.length||(n.instancedDataBuffer?n.instancedDataBuffer.updateData(n.instancedDataArray):n.instancedDataBuffer=e.createVertexBuffer(n.instancedDataArray,Nm.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(){for(const t in this.instancesPerModel){const e=this.instancesPerModel[t];0!==e.instancedDataArray.length&&e.instancedDataBuffer&&e.instancedDataBuffer.destroy()}const e=this.layers[0].modelManager;if(e&&this.modelUris)for(const t of this.modelUris)e.removeModel(t,"")}addFeature(e,t,n){const r=this.layers[0],i=r.layout.get("model-id").evaluate(n,{},this.canonical);if(!i)return fe(`modelId is not evaluated for layer ${r.id} and it is not going to get rendered.`),i;$m(i,!1)&&(this.modelUris.includes(i)||this.modelUris.push(i)),this.instancesPerModel[i]||(this.instancesPerModel[i]=new qm);const o=this.instancesPerModel[i],a=o.instancedDataArray,s=new Gm(n,a.length);for(const l of t)for(const e of l){if(e.x<0||e.x>=Kn||e.y<0||e.y>=Kn)continue;const t=(this.lookupDim-1)/Kn,n=this.lookupDim*(e.y*t|0)+e.x*t|0;if(this.lookup){if(0!==this.lookup[n])continue;this.lookup[n]=1}this.instanceCount++;const r=a.length;a.resize(r+1),o.instancesEvaluatedElevation.push(0),a.float32[16*r]=e.x,a.float32[16*r+1]=e.y}return s.instancedDataCount=o.instancedDataArray.length-s.instancedDataOffset,s.instancedDataCount>0&&(e.id&&(o.idToFeaturesIndex[e.id]=o.features.length),o.features.push(s),this.evaluate(s,{},o,!1)),i}getModelUris(){return this.modelUris}evaluate(e,t,n,r){const i=this.layers[0],o=e.feature,a=this.canonical,s=e.rotation=i.paint.get("model-rotation").evaluate(o,t,a),l=e.scale=i.paint.get("model-scale").evaluate(o,t,a),c=e.translation=i.paint.get("model-translation").evaluate(o,t,a),u=i.paint.get("model-color").evaluate(o,t,a);u.a=i.paint.get("model-color-mix-intensity").evaluate(o,t,a);const h=[];this.maxVerticalOffset10?this.tileToMeter:_l(a,l)),o[i+4]=c[0],o[i+5]=c[1],o[i+6]=c[2]+s,o[i+7]=h[0],o[i+8]=h[1],o[i+9]=h[2],o[i+10]=h[4],o[i+11]=h[5],o[i+12]=h[6],o[i+13]=h[8],o[i+14]=h[9],o[i+15]=h[10],n.instancesEvaluatedElevation[t]=c[2]}}}let Hm,Zm;so(Wm,"ModelBucket",{omit:["layers"]}),so(qm,"PerModelAttributes"),so(Gm,"ModelFeature");const Ym=64,Xm={CoordinateSpaceTile:1,CoordinateSpaceYUp:2,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function Km(e,t,n,r,i,o,a,s,l){let c=arguments.length>9&&void 0!==arguments[9]&&arguments[9];const u=n.zoom,h=n.project(r),d=ml(r.lat,u),f=1/d;N.mat4.identity(e),N.mat4.translate(e,e,[h.x+a[0]*f,h.y+a[1]*f,a[2]]);let p=1,m=1;const g=n.worldSize;if(c){if("mercator"===n.projection.name){let e=0;n.elevation&&(e=n.elevation.getAtPointOrZero(new yl(h.x/g,h.y/g),0));const t=N.vec4.transformMat4([],[h.x,h.y,e,1],n.projMatrix)[3]/n.cameraToCenterDistance;p=t,m=t*ml(n.center.lat,u)}else if("globe"===n.projection.name){const t=Rm(e,n),i=N.mat4.multiply([],n.projMatrix,t),o=[0,0,0,1];N.vec4.transformMat4(o,o,i);const a=o[3]/n.cameraToCenterDistance,s=Oc(u),l=n.projection.pixelsPerMeter(r.lat,g)*ml(r.lat,u),c=n.projection.pixelsPerMeter(n.center.lat,g)*ml(n.center.lat,u);p=a/kt(l,pl(n.center.lat),s),m=a*d/l,p*=c,m*=c}}else p=f;N.mat4.scale(e,e,[p,p,m]);const _=[...e],y=t.orientation,v=[];if(Im(v,[y[0]+i[0],y[1]+i[1],y[2]+i[2]],o),N.mat4.multiply(e,_,v),s&&n.elevation){let i=0;const o=[];if(l&&n.elevation){i=function(e,t,n,r,i){const o=t.elevation;if(!o)return 0;const a=gc.projectAabbCorners(n,r),s=cl(1,i.lat)*t.worldSize,l=function(e,t){const n=[0,0,1],r=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const i of r){const r=e[i.corners[0]],o=e[i.corners[1]],a=e[i.corners[2]],s=[o[0]-r[0],o[1]-r[1],t*(o[2]-r[2])],l=N.vec3.cross(s,s,[a[0]-r[0],a[1]-r[1],t*(a[2]-r[2])]);N.vec3.normalize(l,l),i.dotProductWithUp=N.vec3.dot(l,n)}return r.sort(((e,t)=>e.dotProductWithUp-t.dotProductWithUp)),r[0].corners}(a,s),c=a[l[0]],u=a[l[1]],h=a[l[2]],d=a[l[3]],f=o.getAtPointOrZero(new yl(c[0]/t.worldSize,c[1]/t.worldSize),0),p=o.getAtPointOrZero(new yl(u[0]/t.worldSize,u[1]/t.worldSize),0),m=o.getAtPointOrZero(new yl(h[0]/t.worldSize,h[1]/t.worldSize),0),g=o.getAtPointOrZero(new yl(d[0]/t.worldSize,d[1]/t.worldSize),0),_=(f+g)/2,y=(p+m)/2;return _>y?p2&&void 0!==arguments[2]&&arguments[2];e.uploaded||(e.gfxTexture=new lm(t,e.image,n?t.gl.R8:t.gl.RGBA8,{useMipmap:e.sampler.minFilter>=t.gl.NEAREST_MIPMAP_NEAREST}),e.uploaded=!0,e.image=null)}function Qm(e,t,n){e.indexBuffer=t.createIndexBuffer(e.indexArray,!1,!0),e.vertexBuffer=t.createVertexBuffer(e.vertexArray,zm.members,!1,!0),e.normalArray&&(e.normalBuffer=t.createVertexBuffer(e.normalArray,Bm.members,!1,!0)),e.texcoordArray&&(e.texcoordBuffer=t.createVertexBuffer(e.texcoordArray,Fm.members,!1,!0)),e.colorArray&&(e.colorBuffer=t.createVertexBuffer(e.colorArray,(12===e.colorArray.bytesPerElement?Dm:Om).members,!1,!0)),e.featureArray&&(e.pbrBuffer=t.createVertexBuffer(e.featureArray,jm.members,!0)),e.segments=hs.simpleSegment(0,0,e.vertexArray.length,e.indexArray.length);const r=e.material;r.pbrMetallicRoughness.baseColorTexture&&Jm(r.pbrMetallicRoughness.baseColorTexture,t),r.pbrMetallicRoughness.metallicRoughnessTexture&&Jm(r.pbrMetallicRoughness.metallicRoughnessTexture,t),r.normalTexture&&Jm(r.normalTexture,t),r.occlusionTexture&&Jm(r.occlusionTexture,t,n),r.emissionTexture&&Jm(r.emissionTexture,t)}function eg(e,t,n){if(e.meshes)for(const r of e.meshes)Qm(r,t,n);if(e.children)for(const r of e.children)eg(r,t,n)}function tg(e){if(e.meshes)for(const t of e.meshes)t.indexArray.destroy(),t.vertexArray.destroy(),t.colorArray&&t.colorArray.destroy(),t.normalArray&&t.normalArray.destroy(),t.texcoordArray&&t.texcoordArray.destroy(),t.featureArray&&t.featureArray.destroy();if(e.children)for(const t of e.children)tg(t)}function ng(e){if(e.meshes)for(const n of e.meshes)n.vertexBuffer&&(n.vertexBuffer.destroy(),n.indexBuffer.destroy(),n.normalBuffer&&n.normalBuffer.destroy(),n.texcoordBuffer&&n.texcoordBuffer.destroy(),n.colorBuffer&&n.colorBuffer.destroy(),n.pbrBuffer&&n.pbrBuffer.destroy(),n.segments.destroy(),n.material&&((t=n.material).pbrMetallicRoughness.baseColorTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),t.pbrMetallicRoughness.metallicRoughnessTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),t.normalTexture&&t.normalTexture.gfxTexture&&t.normalTexture.gfxTexture.destroy(),t.emissionTexture&&t.emissionTexture.gfxTexture&&t.emissionTexture.gfxTexture.destroy(),t.occlusionTexture&&t.occlusionTexture.gfxTexture&&t.occlusionTexture.gfxTexture.destroy()));var t;if(e.children)for(const n of e.children)ng(n)}class rg{constructor(e,t,n){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=n}static create(e,t,n){const r=n||e.findDEMTileFor(t);if(!r||!r.dem)return;const i=r.dem,o=r.tileID,a=1<=a)continue;const h=ig[c],d=Math.abs(h);d>s&&(i=h,s=d,l=r,u=t)}if(s>.1){const o=1-(a+.5*Math.abs(l*u))/c;let s=t._dem.get(n,e)+i*o;const h=t._dem.get(n+l,e+u),d=t._dem.get(n-l,e-u,!0);(s-h)*(s-d)>0&&(s=(h+d)/2),ig[r]=t._dem.set(n,e,s),og[r]=a}}}}}a&&(t._demTile.needsDEMTextureUpload=!0,t._dem._timestamp=Oe.now())}getNodesInfo(){return this.nodesInfo}destroy(){const e=this.getNodesInfo();for(const t of e)tg(t.node),ng(t.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const n=t.getReplacementRegionsForTile(e.toUnwrapped()),r=this.getNodesInfo();for(let i=0;it.footprint===e.footprint))}}getHeightAtTileCoord(e,t){const n=this.getNodesInfo(),r=[],i=[0,0,0],o=N.mat4.identity([]);for(let a=0;ac.max[0]||t>c.max[1])continue;if(!0===s.node.hidden)return{height:1/0,maxHeight:s.feature.properties.height,hidden:!1,verticalScale:s.evaluatedScale[2]};N.mat4.invert(o,s.node.matrix),i[0]=e,i[1]=t,N.vec3.transformMat4(i,i,o);const u=(i[0]-l.aabb.min[0])/(l.aabb.max[0]-l.aabb.min[0])*Ym|0,h=Math.min(63,(i[1]-l.aabb.min[1])/(l.aabb.max[1]-l.aabb.min[1])*Ym|0)*Ym+Math.min(63,u),d=l.heightmap[h];if(!(d<0&&s.node.footprint)){if(s.hiddenByReplacement)return;return{height:d,maxHeight:s.feature.properties.height,hidden:!1,verticalScale:s.evaluatedScale[2]}}if(s.node.footprint.grid.query(new $(e,t),new $(e,t),r),r.length>0)return{height:void 0,maxHeight:s.feature.properties.height,hidden:s.hiddenByReplacement,verticalScale:s.evaluatedScale[2]}}}}function hg(e,t){return!e.isLightConstant&&t}function dg(e,t,n,r,i,o,a,s){let l=(61440&t|(61440&t)>>4)>>8,c=(3840&t|(3840&t)>>4)>>4,u=240&t|(240&t)>>4;n[3]>0&&(l=kt(l,255*n[0],n[3]),c=kt(c,255*n[1],n[3]),u=kt(u,255*n[2],n[3]));const h=l<<8|c,d=u<<8|Math.floor(255*r[3]),f=function(e){const t=Q(e,0,2);return Math.min(Math.round(.5*t*255),255)}(r[2])<<8|15*r[0]<<4|15*r[1],p=Q(i[0],0,1),m=Q(i[1],0,1),g=Q(i[2],0,1),_=Q(i[3],0,1);let y,v,x,b;if(p!==m&&a!==o&&m!==p){const e=a-o;v=1/(e*(m-p)),x=-(o+e*p)/(e*(m-p));const t=Q(i[4],-1,1);b=Math.pow(10,t),y=255*g<<8|255*_}else y=65535,v=0,x=1,b=1;if(e.emplaceBack(h,d,f,y,v,x,b),s){const e=s.length;s.clear();for(let t=0;t>16&65535,s=o?t>>16&65535:65535&t,l=(15&s)<8?15&s:0,c=e.evaluatedRMEA[l],u=e.evaluatedColor[l],h=e.emissionHeightBasedParams[l];let d;if(n&&2===l&&r.lights&&(d=new Ha,d.resize(10*r.lights.length)),dg(a.featureArray,i,u,c,h,a.aabb.min[2],a.aabb.max[2],d),d&&n){n=!1;const e=r.meshes[r.lightMeshIndex];e.featureArray=d,e.featureArray._trim()}}a.featureArray._trim(),i++}}function pg(e,t,n,r){const i=1<e.polygon)).flat());const g=f?s:null,[_,y]=function(e,t,n,r,i,o,a,s,l,c,u){return"globe"===e.projection.name?function(e,t,n,r,i,o,a,s,l,c,u){const h=[],d=[],f=e.projection.upVectorScale(u,e.center.lat,e.worldSize).metersToTile,p=[0,0,0,1],m=[0,0,0,1],g=(e,t,n,r)=>{e[0]=t,e[1]=n,e[2]=r,e[3]=1},_=nd();n>0&&(n+=_),r+=_;for(const y of t){const t=[],_=[];for(const h of y){const d=h.x+i.x,y=h.y+i.y,v=e.projection.projectTilePoint(d,y,u),x=e.projection.upVector(u,h.x,h.y);let b=n,w=r;if(a){const e=cd(d,y,n,r,a,s,l,c);b+=e.base,w+=e.top}0!==n?g(p,v.x+x[0]*f*b,v.y+x[1]*f*b,v.z+x[2]*f*b):g(p,v.x,v.y,v.z),g(m,v.x+x[0]*f*w,v.y+x[1]*f*w,v.z+x[2]*f*w),N.vec3.transformMat4(p,p,o),N.vec3.transformMat4(m,m,o),t.push(new hh(p[0],p[1],p[2])),_.push(new hh(m[0],m[1],m[2]))}h.push(t),d.push(_)}return[h,d]}(e,t,n,r,i,o,a,s,l,c,u):a?function(e,t,n,r,i,o,a,s,l){const c=[],u=[],h=[0,0,0,1];for(const d of e){const e=[],f=[];for(const c of d){const u=c.x+r.x,d=c.y+r.y,p=cd(u,d,t,n,o,a,s,l);h[0]=u,h[1]=d,h[2]=p.base,h[3]=1,N.vec4.transformMat4(h,h,i),h[3]=Math.max(h[3],1e-5);const m=new hh(h[0]/h[3],h[1]/h[3],h[2]/h[3]);h[0]=u,h[1]=d,h[2]=p.top,h[3]=1,N.vec4.transformMat4(h,h,i),h[3]=Math.max(h[3],1e-5);const g=new hh(h[0]/h[3],h[1]/h[3],h[2]/h[3]);e.push(m),f.push(g)}c.push(e),u.push(f)}return[c,u]}(t,n,r,i,o,a,s,l,c):function(e,t,n,r,i){const o=[],a=[],s=i[8]*t,l=i[9]*t,c=i[10]*t,u=i[11]*t,h=i[8]*n,d=i[9]*n,f=i[10]*n,p=i[11]*n;for(const m of e){const e=[],t=[];for(const n of m){const o=n.x+r.x,a=n.y+r.y,m=i[0]*o+i[4]*a+i[12],g=i[1]*o+i[5]*a+i[13],_=i[2]*o+i[6]*a+i[14],y=i[3]*o+i[7]*a+i[15],v=m+s,x=g+l,b=_+c,w=Math.max(y+u,1e-5),S=m+h,M=g+d,A=_+f,E=Math.max(y+p,1e-5);e.push(new hh(v/w,x/w,b/w)),t.push(new hh(S/E,M/E,A/E))}o.push(e),a.push(t)}return[o,a]}(t,n,r,i,o)}(o,r,h,u,c,a,g,d,p,o.center.lat,e.tileID.canonical),v=e.queryGeometry;return function(e,t,n){let r=1/0;Ll(n,t)&&(r=ld(n,t[0]));for(let i=0;i{if(Ld)return Ld;const e=Pd();return Ld=new Rd(e.paint.properties["line-width"].specification),Ld.useIntegerZoom=!0,Ld})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new bd(e)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(e,t,n){const r=Cd(this);return{config:new Fs(this,{zoom:t,lut:n}),defines:r,overrideFog:!1}}queryRadius(e){const t=e,n=zd(ql("line-width",this,t),ql("line-gap-width",this,t)),r=ql("line-offset",this,t);return n/2+Math.abs(r)+Wl(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,n,r,i,o){if(e.queryGeometry.isAboveHorizon)return!1;const a=Hl(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),s=e.pixelToTileUnitsFactor/2*zd(this.paint.get("line-width").evaluate(t,n),this.paint.get("line-gap-width").evaluate(t,n)),l=this.paint.get("line-offset").evaluate(t,n);return l&&(r=function(e,t){const n=[],r=new $(0,0);for(let i=0;i=3)for(let t=0;t{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){this._channel=void 0,this._callback=()=>{}}}class _g{constructor(){this.tasks={},this.taskQueue=[],se(["process"],this),this.invoker=new gg(this.process),this.nextId=0}add(e,t){const n=this.nextId++,r=function(e){let{type:t,isSymbolTile:n,zoom:r}=e;return r=r||0,"message"===t?0:"maybePrepare"!==t||n?"parseTile"!==t||n?"parseTile"===t&&n?300-r:"maybePrepare"===t&&n?400-r:500:200-r:100-r}(t);if(0===r){try{e()}finally{}return null}return this.tasks[n]={fn:e,metadata:t,priority:r,id:n},this.taskQueue.push(n),this.invoker.trigger(),{cancel:()=>{delete this.tasks[n]}}}process(){try{if(this.taskQueue=this.taskQueue.filter((e=>!!this.tasks[e])),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!t)return;t.fn()}finally{}}pick(){let e=null,t=1/0;for(let r=0;r4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5?arguments[5]:void 0;const a=Math.round(1e18*Math.random()).toString(36).substring(0,10);n&&(n.metadata=o,this.callbacks[a]=n);const s=new Set;return this.target.postMessage({id:a,type:e,hasCallback:!!n,targetMapId:r,mustQueue:i,sourceMapId:this.mapId,data:uo(t,s)},s),{cancel:()=>{n&&delete this.callbacks[a],this.target.postMessage({id:a,type:"",targetMapId:r,sourceMapId:this.mapId})}}}receive(e){const t=e.data,n=t.id;if(n&&(!t.targetMapId||this.mapId===t.targetMapId))if(""===t.type){const e=this.cancelCallbacks[n];delete this.cancelCallbacks[n],e&&e.cancel()}else if(t.mustQueue||_e()){const e=this.callbacks[n],r=this.scheduler.add((()=>this.processTask(n,t)),e&&e.metadata||{type:"message"});r&&(this.cancelCallbacks[n]=r)}else this.processTask(n,t)}processTask(e,t){if(delete this.cancelCallbacks[e],""===t.type){const n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n(ho(t.error)):n(null,ho(t.data)))}else{const n=new Set,r=t.hasCallback?(t,r)=>{this.target.postMessage({id:e,type:"",sourceMapId:this.mapId,error:t?uo(t):null,data:uo(r,n)},n)}:e=>{},i=ho(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,i,r);else if(this.parent.getWorkerSource){const e=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,e[0],i.source,i.scope)[e[1]](i,r)}else r(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}class vg{constructor(e,t){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=oe();const n=this.workerPool.acquire(this.id);for(let r=0;r{this.ready=!0}))}broadcast(e,t,n){ne(this.actors,((n,r)=>{n.send(e,t,r)}),n=n||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((e=>{e.remove()})),this.actors=[],this.workerPool.release(this.id)}}vg.Actor=yg;class xg{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const n=this.toIdx(e,t);return{min:this.minimums[n],max:this.maximums[n]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function bg(e,t,n,r){let i=0,o=Number.MAX_VALUE;for(let a=0;a<3;a++)if(Math.abs(r[a])<1e-15){if(n[a]t[a])return null}else{const s=1/r[a];let l=(e[a]-n[a])*s,c=(t[a]-n[a])*s;if(l>c){const e=l;l=c,c=e}if(l>i&&(i=l),co)return null}return i}function wg(e,t,n,r,i,o,a,s,l,c,u){const h=r-e,d=i-t,f=o-n,p=a-e,m=s-t,g=l-n,_=u[1]*g-u[2]*m,y=u[2]*p-u[0]*g,v=u[0]*m-u[1]*p,x=h*_+d*y+f*v;if(Math.abs(x)<1e-15)return null;const b=1/x,w=c[0]-e,S=c[1]-t,M=c[2]-n,A=(w*_+S*y+M*v)*b;if(A<0||A>1)return null;const E=S*f-M*d,T=M*h-w*f,C=w*d-S*h,k=(u[0]*E+u[1]*T+u[2]*C)*b;return k<0||A+k>1?null:(p*E+m*T+g*C)*b}function Sg(e,t,n){return(e-t)/(n-t)}function Mg(e,t,n,r,i,o,a,s,l){const c=1<{const o=r?1:0,a=(e+1)*n-o,s=t*n,l=(t+1)*n-o;i[0]=e*n,i[1]=s,i[2]=a,i[3]=l};let a=new xg(r);const s=[];for(let l=0;l=1;r/=2){const e=n[n.length-1];a=new xg(r);for(let t=0;t6&&void 0!==arguments[6]?arguments[6]:1;return bg([e,t,-100],[n,r,this.maximums[0]*a],i,o)}raycast(e,t,n,r,i,o){let a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(!this.nodeCount)return null;const s=this.raycastRoot(e,t,n,r,i,o,a);if(null==s)return null;const l=[],c=[],u=[],h=[],d=[{idx:0,t:s,nodex:0,nodey:0,depth:0}];for(;d.length>0;){const{idx:s,t:f,nodex:p,nodey:m,depth:g}=d.pop();if(this.leaves[s]){Mg(p,m,g,e,t,n,r,u,h);const s=1<=e[2])return f}continue}let _=0;for(let d=0;d=l[c[n]]&&(c.splice(n,0,d),t=!0);t||(c[_]=d),_++}}for(let e=0;e<_;e++){const t=c[e];d.push({idx:this.childOffsets[s]+t,t:l[t],nodex:(p<<1)+this._siblingOffset[t][0],nodey:(m<<1)+this._siblingOffset[t][1],depth:g+1})}}return null}_addNode(e,t,n){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(n),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,n,r,i){if(1===e[r].isLeaf(t,n))return;this.childOffsets[i]||(this.childOffsets[i]=this.nodeCount);const o=r-1,a=e[o];let s=0,l=0;for(let c=0;c3&&void 0!==arguments[3]&&arguments[3];if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(n&&"mapbox"!==n&&"terrarium"!==n)return void fe(`"${n}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const i=this.dim=t.height-2,o=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.floatView=new Float32Array(t.data.buffer),this.borderReady=r,this._modifiedForSources={},!r){for(let e=0;e2&&void 0!==arguments[2]&&arguments[2]&&(e=Q(e,-1,this.dim),t=Q(t,-1,this.dim));const n=this._idx(e,t);return this.floatView[n]}set(e,t,n){const r=this._idx(e,t),i=this.floatView[r];return this.floatView[r]=n,n-i}static getUnpackVector(e){return Cg[e]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const n=[0,0,0,0],r=Pg.getUnpackVector(t);let i=Math.floor((e+r[3])/r[2]);return n[2]=i%256,i=Math.floor(i/256),n[1]=i%256,i=Math.floor(i/256),n[0]=i,n}getPixels(){return new ou({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let r=t*this.dim,i=t*this.dim+this.dim,o=n*this.dim,a=n*this.dim+this.dim;switch(t){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:o=a-1;break;case 1:a=o+1}const s=-t*this.dim,l=-n*this.dim;for(let c=o;c=1;r--){const i=1===r?1:0,o=2===r?1:0;for(let r=0;r>>1^-(1&e[t]);return e}function $g(e,t){switch(t){case"uint32":return e;case"uint16":for(let t=0;t>4|(61440&n)>>8|(240&r)<<4|61440&r,e[t+1]=15&n|(3840&n)>>4|(15&r)<<8|(3840&r)<<4}return e;case"uint8":for(let t=0;t>6|(192&r)>>4|(192&i)>>2|192&o,e[t+1]=(48&n)>>4|(48&r)>>2|48&i|(48&o)<<2,e[t+2]=(12&n)>>2|12&r|(12&i)<<2|(12&o)<<4,e[t+3]=3&n|(3&r)<<2|(3&i)<<4|(3&o)<<6}return e;default:throw new Error(`Invalid pixel format, "${t}"`)}}var Gg=Uint8Array,qg=Uint16Array,Wg=Int32Array,Hg=new Gg([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Zg=new Gg([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Yg=new Gg([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xg=function(e,t){for(var n=new qg(31),r=0;r<31;++r)n[r]=t+=1<>1|(21845&n_)<<1;t_[n_]=((65280&(r_=(61680&(r_=(52428&r_)>>2|(13107&r_)<<2))>>4|(3855&r_)<<4))>>8|(255&r_)<<8)>>1}var i_=function(e,t,n){for(var r=e.length,i=0,o=new qg(t);i>l]=c;return a},o_=new Gg(288);for(n_=0;n_<144;++n_)o_[n_]=8;for(n_=144;n_<256;++n_)o_[n_]=9;for(n_=256;n_<280;++n_)o_[n_]=7;for(n_=280;n_<288;++n_)o_[n_]=8;var a_=new Gg(32);for(n_=0;n_<32;++n_)a_[n_]=5;var s_=i_(o_,9),l_=i_(a_,5),c_=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},u_=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},h_=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},d_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],f_=function(e,t,n){var r=new Error(t||d_[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,f_),!n)throw r;return r},p_=new Gg(0),m_="undefined"!=typeof TextDecoder&&new TextDecoder;try{m_.decode(p_,{stream:!0})}catch(e){}const g_={gzip_data:"gzip"};class __ extends Error{constructor(e){super(e),this.name="MRTError"}}const y_={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},v_={uint32:1,uint16:2,uint8:4},x_={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let b_;class w_{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=e}getLayer(e){const t=this.layers[e];if(!t)throw new __(`Layer '${e}' not found`);return t}getHeaderLength(e){const t=new Uint8Array(e),n=new DataView(e);if(13!==t[0])throw new __("File is not a valid MRT.");return n.getUint32(1,!0)}parseHeader(e){const t=new Uint8Array(e),n=this.getHeaderLength(e);if(t.length= ${n} but got buffer of length ${t.length}`);const r=function(e){return e.readFields(Rg,{header_length:0,x:0,y:0,z:0,layers:[]},void 0)}(new b_(t.subarray(0,n)));if(!isNaN(this.x)&&(this.x!==r.x||this.y!==r.y||this.z!==r.z))throw new __(`Invalid attempt to parse header ${r.z}/${r.x}/${r.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=r.x,this.y=r.y,this.z=r.z;for(const i of r.layers)this.layers[i.name]=new S_(i,{cacheSize:this._cacheSize});return this}createDecodingTask(e){const t=[],n=this.getLayer(e.layerName);for(let r of e.blockIndices){const i=n.dataIndex[r],o=i.first_byte-e.firstByte,a=i.last_byte-e.firstByte;if(n._blocksInProgress.has(r))continue;const s={layerName:n.name,firstByte:o,lastByte:a,pixelFormat:n.pixelFormat,blockIndex:r,blockShape:[i.bands.length].concat(n.bandShape),buffer:n.buffer,codec:i.codec.codec,filters:i.filters.map((e=>e.filter))};n._blocksInProgress.add(r),t.push(s)}return new M_(t,(()=>{t.forEach((e=>n._blocksInProgress.delete(e.blockIndex)))}),((e,r)=>{if(t.forEach((e=>n._blocksInProgress.delete(e.blockIndex))),e)throw e;r.forEach((e=>{this.getLayer(e.layerName).processDecodedData(e)}))}))}}class S_{constructor(e,t){let{version:n,name:r,units:i,tilesize:o,pixel_format:a,buffer:s,data_index:l}=e;if(this.version=n,1!==this.version)throw new __(`Cannot parse raster layer encoded with MRT version ${n}`);this.name=r,this.units=i,this.tileSize=o,this.buffer=s,this.pixelFormat=y_[a],this.dataIndex=l,this.bandShape=[o+2*s,o+2*s,v_[this.pixelFormat]],this._decodedBlocks=new jg(t?t.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return v_[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map((e=>{let{bands:t}=e;return t})).flat()}processDecodedData(e){const t=e.blockIndex.toString();this._decodedBlocks.get(t)||this._decodedBlocks.put(t,e.data)}getBlockForBand(e){let t=0;switch(typeof e){case"string":for(const[n,r]of this.dataIndex.entries()){for(const[i,o]of r.bands.entries())if(o===e)return{bandIndex:t+i,blockIndex:n,blockBandIndex:i};t+=r.bands.length}break;case"number":for(const[n,r]of this.dataIndex.entries()){if(e>=t&&ethis.cacheSize)throw new __(`Number of blocks to decode (${i.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:t,lastByte:n,blockIndices:r}}hasBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0}hasDataForBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0&&!!this._decodedBlocks.get(t.toString())}getBandView(e){const{blockIndex:t,blockBandIndex:n}=this.getBlockForBand(e),r=this._decodedBlocks.get(t.toString());if(!r)throw new __(`Data for band ${JSON.stringify(e)} of layer "${this.name}" not decoded.`);const i=this.dataIndex[t],o=this.bandShape.reduce(((e,t)=>e*t),1),a=n*o,s=r.subarray(a,a+o);return{data:s,bytes:new Uint8Array(s.buffer).subarray(s.byteOffset,s.byteOffset+s.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:0!==i.offset?i.offset:i.deprecated_offset,scale:0!==i.scale?i.scale:i.deprecated_scale}}}w_.setPbf=function(e){b_=e};class M_{constructor(e,t,n){this.tasks=e,this._onCancel=t,this._onComplete=n,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(e,t){this._finalized||(this._onComplete(e,t),this._finalized=!0)}}w_.performDecoding=function(e,t){const n=new Uint8Array(e);return Promise.all(t.tasks.map((e=>{const{layerName:t,firstByte:r,lastByte:i,pixelFormat:o,blockShape:a,blockIndex:s,filters:l,codec:c}=e,u=n.subarray(r,i+1),h=new Uint32Array(a[0]*a[1]*a[2]);let d;if("gzip_data"!==c)throw new __(`Unhandled codec: ${c}`);return d=function(e,t){if(!globalThis.DecompressionStream&&"gzip_data"===t)return Promise.resolve(((o=function(e){31==e[0]&&139==e[1]&&8==e[2]||f_(6,"invalid gzip data");var t=e[3],n=10;4&t&&(n+=2+(e[10]|e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)}(i=e))+8>i.length&&f_(6,"invalid gzip data"),function(e,t,n){var r=e.length;if(!r||t.f&&!t.l)return n||new Gg(0);var i=!n,o=i||2!=t.i,a=t.i;i&&(n=new Gg(3*r));var s,l,c=function(e){var t=n.length;if(e>t){var r=new Gg(Math.max(2*t,e));r.set(n),n=r}},u=t.f||0,h=t.p||0,d=t.b||0,f=t.l,p=t.d,m=t.m,g=t.n,_=8*r;do{if(!f){u=u_(e,h,1);var y=u_(e,h+1,3);if(h+=3,!y){var v=e[(I=4+((h+7)/8|0))-4]|e[I-3]<<8,x=I+v;if(x>r){a&&f_(0);break}o&&c(d+v),n.set(e.subarray(I,x),d),t.b=d+=v,t.p=h=8*x,t.f=u;continue}if(1==y)f=s_,p=l_,m=9,g=5;else if(2==y){var b=u_(e,h,31)+257,w=u_(e,h+10,15)+4,S=b+u_(e,h+5,31)+1;h+=14;for(var M=new Gg(S),A=new Gg(19),E=0;E>4)<16)M[E++]=I;else{var R=0,L=0;for(16==I?(L=3+u_(e,h,3),h+=2,R=M[E-1]):17==I?(L=3+u_(e,h,7),h+=3):18==I&&(L=11+u_(e,h,127),h+=7);L--;)M[E++]=R}}var z=M.subarray(0,b),D=M.subarray(b);m=c_(z),g=c_(D),f=i_(z,m),p=i_(D,g)}else f_(1);if(h>_){a&&f_(0);break}}o&&c(d+131072);for(var O=(1<>4;if((h+=15&R)>_){a&&f_(0);break}if(R||f_(2),N<256)n[d++]=N;else{if(256==N){B=h,f=null;break}var j=N-254;N>264&&(j=u_(e,h,(1<<($=Hg[E=N-257]))-1)+Jg[E],h+=$);var V=p[h_(e,h)&F],U=V>>4;if(V||f_(3),h+=15&V,D=e_[U],U>3){var $=Zg[U];D+=h_(e,h)&(1<<$)-1,h+=$}if(h>_){a&&f_(0);break}o&&c(d+131072);var G=d+j;if(ds.length)&&(l=s.length),new Gg(s.subarray(0,l))):n.subarray(0,d)}(i.subarray(o,-8),{i:2},new Gg(((n=i)[(r=n.length)-4]|n[r-3]<<8|n[r-2]<<16|n[r-1]<<24)>>>0))));var n,r,i,o;const a=g_[t];if(!a)throw new Error(`Unhandled codec: ${t}`);const s=new globalThis.DecompressionStream(a);return new Response(new Blob([e]).stream().pipeThrough(s)).arrayBuffer().then((e=>new Uint8Array(e)))}(u,c).then((e=>(function(e,t){e.readFields(Bg,t)}(new b_(e),h),new(0,x_[o])(h.buffer)))),d.then((e=>{for(let t=l.length-1;t>=0;t--)switch(l[t]){case"delta_filter":Vg(e,a);break;case"zigzag_filter":Ug(e);break;case"bitshuffle_filter":$g(e,o);break;default:throw new __(`Unhandled filter "${l[t]}"`)}return{layerName:t,blockIndex:s,data:e}})).catch((e=>{throw e}))})))},so(M_,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]});var A_={workerUrl:"",workerClass:null,workerParams:void 0};const E_="mapboxgl_preloaded_worker_pool";class T_{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[E_]}numActive(){return Object.keys(this.active).length}}let C_;function k_(){return C_||(C_=new T_),C_}T_.workerCount=2;let I_,P_,R_,L_,z_,D_=null;function O_(){return _e()&&self.worker&&self.worker.dracoUrl?self.worker.dracoUrl:P_||Ee.DRACO_URL}function F_(){if(_e()&&self.worker&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(L_)return L_;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return L_=WebAssembly.validate(e)?Ee.MESHOPT_SIMD_URL:Ee.MESHOPT_URL,L_}const B_={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},N_={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},j_={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function V_(e,t,n){const r=n.json.bufferViews.length,i=n.buffers.length;t.bufferView=r,n.json.bufferViews[r]={buffer:i,byteLength:e.byteLength},n.buffers[i]=e}const U_="KHR_draco_mesh_compression";function $_(e,t){const n=e.extensions&&e.extensions[U_];if(!n)return;const r=new R_.Decoder,i=X_(t,n.bufferView),o=new R_.Mesh;if(!r.DecodeArrayToMesh(i,i.byteLength,o))throw new Error("Failed to decode Draco mesh");const a=t.json.accessors[e.indices],s=B_[a.componentType],l=a.count*s.BYTES_PER_ELEMENT,c=R_._malloc(l);s===Uint16Array?r.GetTrianglesUInt16Array(o,l,c):r.GetTrianglesUInt32Array(o,l,c),V_(R_.memory.buffer.slice(c,c+l),a,t),R_._free(c);for(const u of Object.keys(n.attributes)){const i=r.GetAttributeByUniqueId(o,n.attributes[u]),a=t.json.accessors[e.attributes[u]],s=N_[a.componentType],l=a.count*j_[a.type]*B_[a.componentType].BYTES_PER_ELEMENT,c=R_._malloc(l);r.GetAttributeDataArrayForAllPoints(o,i,R_[s],l,c),V_(R_.memory.buffer.slice(c,c+l),a,t),R_._free(c)}r.destroy(),o.destroy(),delete e.extensions[U_]}const G_="EXT_meshopt_compression";function q_(e,t){if(!e.extensions||!e.extensions[G_])return;const n=e.extensions[G_],r=new Uint8Array(t.buffers[n.buffer],n.byteOffset||0,n.byteLength||0),i=new Uint8Array(n.count*n.byteStride);z_.decodeGltfBuffer(i,n.count,n.byteStride,r,n.mode,n.filter),e.buffer=t.buffers.length,e.byteOffset=0,t.buffers[e.buffer]=i.buffer,delete e.extensions[G_]}const W_=1179937895,H_=new TextDecoder("utf8");function Z_(e,t){return new URL(e,t).href}function Y_(e,t,n,r){return fetch(Z_(e.uri,r)).then((e=>e.arrayBuffer())).then((e=>{t.buffers[n]=e}))}function X_(e,t){const n=e.json.bufferViews[t];return new Uint8Array(e.buffers[n.buffer],n.byteOffset||0,n.byteLength)}function K_(e,t,n,r){if(e.uri){const i=Z_(e.uri,r);return fetch(i).then((e=>e.blob())).then((e=>createImageBitmap(e))).then((e=>{t.images[n]=e}))}if(void 0!==e.bufferView){const r=X_(t,e.bufferView),i=new Blob([r],{type:e.mimeType});return createImageBitmap(i).then((e=>{t.images[n]=e}))}}function J_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;const r={json:null,images:[],buffers:[]};if(new Uint32Array(e,t,1)[0]===W_){const n=new Uint32Array(e,t);let i=2;const o=(n[i++]>>2)-3,a=n[i++]>>2;if(i++,r.json=JSON.parse(H_.decode(n.subarray(i,i+a))),i+=a,i{const e=[],t=s&&s.includes(U_),i=s&&s.includes(G_);if(t&&e.push(function(){if(!R_)return null!=I_?I_:(I_=function(e){let t,n=null;function r(){t=new Uint8Array(n.buffer)}function i(){throw new Error("Unexpected Draco error.")}const o={a:{a:i,d:function(e,n,r){return t.copyWithin(e,n,n+r)},c:function(e){const i=t.length,o=Math.max(e>>>0,Math.ceil(1.2*i)),a=Math.ceil((o-i)/65536);try{return n.grow(a),r(),!0}catch(e){return!1}},b:i}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,o):e.then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,o)))).then((e=>{const{Rb:i,Qb:o,P:a,T:s,X:l,Ja:c,La:u,Qa:h,Va:d,Wa:f,eb:p,jb:m,f:g,e:_,yb:y,zb:v,Ab:x,Bb:b,Db:w,Gb:S}=e.instance.exports;n=_;const M=(()=>{let e=0,n=0,r=0,a=0;return s=>{r&&(i(a),i(e),n+=r,r=e=0),e||(n+=128,e=o(n));const l=s.length+7&-8;let c=e;l>=n&&(r=l,c=a=o(l));for(let e=0;e{R_=e,I_=void 0})))}()),i&&e.push(function(){if(z_)return;const e=function(e){let t;const n=WebAssembly.instantiateStreaming(e,{}).then((e=>{t=e.instance,t.exports.__wasm_call_ctors()})),r={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},i={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:n,supported:!0,decodeGltfBuffer(e,n,o,a,s,l){!function(e,t,n,r,i,o,a){const s=e.exports.sbrk,l=r+3&-4,c=s(l*i),u=s(o.length),h=new Uint8Array(e.exports.memory.buffer);h.set(o,u);const d=t(c,r,i,u,o.length);if(0===d&&a&&a(c,l,i),n.set(h.subarray(c,c+r*i)),s(c-s(0)),0!==d)throw new Error(`Malformed buffer data: ${d}`)}(t,t.exports[i[s]],e,n,o,a,t.exports[r[l]])}}}(fetch(F_()));return e.ready.then((()=>{z_=e}))}()),o)for(let a=0;a{if(t&&a)for(const{primitives:e}of a)for(const t of e)$_(t,r);if(i&&a&&l)for(const e of l)q_(e,r);return r}))}))}function Q_(e,t){const n=e.json.bufferViews[t.bufferView],r=B_[t.componentType];return new r(e.buffers[n.buffer],(t.byteOffset||0)+(n.byteOffset||0),t.count*(n.byteStride&&n.byteStride!==j_[t.type]*r.BYTES_PER_ELEMENT?n.byteStride/r.BYTES_PER_ELEMENT:j_[t.type]))}function ey(e,t,n,r){const i=B_[t.componentType],o=function(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(i),a=e.json.bufferViews[t.bufferView],s=a.byteStride?a.byteStride/i.BYTES_PER_ELEMENT:j_[t.type],l=n.float32,c=l.length/n.capacity;for(let u=0,h=0;u0){for(let i=0;i0){o.texcoordArray=new qa;const e=t.json.accessors[i.TEXCOORD_0];o.texcoordArray.resize(e.count);const n=Q_(t,e);ey(t,e,o.texcoordArray,n)}if(void 0!==i._FEATURE_ID_RGBA4444){const e=t.json.accessors[i._FEATURE_ID_RGBA4444];t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression")&&(o.featureData=Q_(t,e))}void 0!==i._FEATURE_RGBA4444&&(o.featureData=new Uint32Array(Q_(t,t.json.accessors[i._FEATURE_RGBA4444]).buffer));const h=e.material;return o.material=function(e,t){const{emissiveFactor:n=[0,0,0],alphaMode:r="OPAQUE",alphaCutoff:i=.5,normalTexture:o,occlusionTexture:a,emissiveTexture:s,doubleSided:l}=e,{baseColorFactor:c=[1,1,1,1],metallicFactor:u=1,roughnessFactor:h=1,baseColorTexture:d,metallicRoughnessTexture:f}=e.pbrMetallicRoughness||{},p=a?t[a.index]:void 0;if(a&&a.extensions&&a.extensions.KHR_texture_transform&&p){const e=a.extensions.KHR_texture_transform;p.offsetScale=[e.offset[0],e.offset[1],e.scale[0],e.scale[1]]}return{pbrMetallicRoughness:{baseColorFactor:new Tt(...c),metallicFactor:u,roughnessFactor:h,baseColorTexture:d?t[d.index]:void 0,metallicRoughnessTexture:f?t[f.index]:void 0},doubleSided:l,emissiveFactor:n,alphaMode:r,alphaCutoff:i,normalTexture:o?t[o.index]:void 0,occlusionTexture:p,emissionTexture:s?t[s.index]:void 0,defined:void 0===e.defined}}(void 0!==h?t.json.materials[h]:{defined:!1},n),o}function ny(e,t,n){const{matrix:r,rotation:i,translation:o,scale:a,mesh:s,extras:l,children:c}=e,u={};if(u.matrix=r||N.mat4.fromRotationTranslationScale([],i||[0,0,0,1],o||[0,0,0],a||[1,1,1]),void 0!==s){u.meshes=n[s];const e=u.anchor=[0,0];for(const t of u.meshes){const{min:n,max:r}=t.aabb;e[0]+=n[0]+r[0],e[1]+=n[1]+r[1]}e[0]=Math.floor(e[0]/u.meshes.length/2),e[1]=Math.floor(e[1]/u.meshes.length/2)}if(l&&(l.id&&(u.id=l.id),l.lights&&(u.lights=function(e){if(!e.length)return[];const t=function(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r1&&r[r.length-1].equals(r[0])&&r.pop();let i=0;for(let a=0;a0&&r.reverse();const o=cu(r.flatMap((e=>[e.x,e.y])),[]);return 0===o.length?null:{vertices:r,indices:o}}function oy(e,t){const n=[],r=[];let i=0;const o=[];for(const a of e){i=n.length;const e=a.vertexArray.float32,s=a.indexArray.uint16;for(let r=0;r0&&([r[a+1],r[a+2]]=[r[a+2],r[a+1]])}return{vertices:n,indices:r}}function ay(e){const t=function(e,t){const n=[],r=WebGL2RenderingContext;if(e.json.textures)for(const i of e.json.textures){const o={magFilter:r.LINEAR,minFilter:r.NEAREST,wrapS:r.REPEAT,wrapT:r.REPEAT};void 0!==i.sampler&&Object.assign(o,e.json.samplers[i.sampler]),n.push({image:t[i.source],sampler:o,uploaded:!1})}return n}(e,e.images),n=function(e,t){const n=[];for(const r of e.json.meshes){const i=[];for(const n of r.primitives)i.push(ty(n,e,t));n.push(i)}return n}(e,t),{scenes:r,scene:i,nodes:o}=e.json,a=r?r[i||0].nodes:o,s=[];for(const l of a)s.push(ny(o[l],e,n));return function(e,t,n){const r={},i=new Set;for(let o=0;o0){const t=Array.from(i.values()).sort(((e,t)=>e-t));for(let n=t.length-1;n>=0;n--)e.splice(t[n],1)}}(s,a,e.json.nodes),s}function sy(e){e.heightmap=new Float32Array(4096),e.heightmap.fill(-1);const t=e.vertexArray.float32,n=e.aabb.min[0]-1,r=e.aabb.min[1]-1,i=Ym/(e.aabb.max[0]-n+2),o=Ym/(e.aabb.max[1]-r+2);for(let a=0;ae.heightmap[c*Ym+l]&&(e.heightmap[c*Ym+l]=s)}}function ly(e,t){const n={};n.indexArray=new Fa,n.indexArray.reserve(4*e.length),n.vertexArray=new Aa,n.vertexArray.reserve(10*e.length),n.colorArray=new Ma,n.vertexArray.reserve(10*e.length);let r=0;for(const a of e){const e=Math.min(10,Math.max(4,1.3*a.height))*t,i=[-a.normal[1],a.normal[0],0],o=Math.min(.29,.1*a.width/a.depth),s=a.width-2*a.depth*t*(o+.01),l=N.vec3.scaleAndAdd([],a.pos,i,s/2),c=N.vec3.scaleAndAdd([],a.pos,i,-s/2),u=[l[0],l[1],l[2]+a.height],h=[c[0],c[1],c[2]+a.height],d=N.vec3.scaleAndAdd([],a.normal,i,o);N.vec3.scale(d,d,e);const f=N.vec3.scaleAndAdd([],a.normal,i,-o);N.vec3.scale(f,f,e),N.vec3.add(d,l,d),N.vec3.add(f,c,f),l[2]+=.1,c[2]+=.1,n.vertexArray.emplaceBack(d[0],d[1],d[2]),n.vertexArray.emplaceBack(f[0],f[1],f[2]),n.vertexArray.emplaceBack(l[0],l[1],l[2]),n.vertexArray.emplaceBack(c[0],c[1],c[2]),n.vertexArray.emplaceBack(u[0],u[1],u[2]),n.vertexArray.emplaceBack(h[0],h[1],h[2]),n.vertexArray.emplaceBack(l[0],l[1],l[2]),n.vertexArray.emplaceBack(c[0],c[1],c[2]),n.vertexArray.emplaceBack(d[0],d[1],d[2]),n.vertexArray.emplaceBack(f[0],f[1],f[2]);const p=s/e/2;n.colorArray.emplaceBack(-p-o,-1,p,.8),n.colorArray.emplaceBack(p+o,-1,p,.8),n.colorArray.emplaceBack(-p,0,p,1.3),n.colorArray.emplaceBack(p,0,p,1.3),n.colorArray.emplaceBack(p+o,-.8,p,.7),n.colorArray.emplaceBack(p+o,-.8,p,.7),n.colorArray.emplaceBack(0,0,p,1.3),n.colorArray.emplaceBack(0,0,p,1.3),n.colorArray.emplaceBack(p+o,-1.2,p,.8),n.colorArray.emplaceBack(p+o,-1.2,p,.8),n.indexArray.emplaceBack(6+r,4+r,8+r),n.indexArray.emplaceBack(7+r,9+r,5+r),n.indexArray.emplaceBack(0+r,1+r,2+r),n.indexArray.emplaceBack(1+r,3+r,2+r),r+=10}const i={defined:!0,emissiveFactor:[0,0,0]},o={};return o.baseColorFactor=Tt.white,i.pbrMetallicRoughness=o,n.material=i,n.aabb=new gc([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),n}class cy{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;const s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i,o);const l=this.grid;for(let c=0;c=0&&n[3]>=0&&l.insert(s,n[0],n[1],n[2],n[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new uh.VectorTile(new sf(this.rawTileData)).layers,this.sourceLayerCoder=new cy(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,t,n,r){var i=this;this.loadVTLayers();const o=e.params||{},a=Ko(o.filter),s=e.tileResult,l=e.transform,c=s.bufferedTilespaceBounds,u=this.grid.query(c.min.x,c.min.y,c.max.x,c.max.y,((e,t,n,r)=>Vl(s.bufferedTilespaceGeometry,e,t,n,r)));u.sort(py);let h=null;l.elevation&&u.length>0&&(h=rg.create(l.elevation,this.tileID));const d={};let f;for(let p=0;p3&&void 0!==arguments[3]?arguments[3]:0;return g||(g=El(t,i.tileID.canonical,e.tileTransform)),n.queryIntersectsFeature(s,t,r,g,i.z,e.transform,e.pixelPosMatrix,h,o)}))}return d}loadMatchingFeature(e,t,n,r,i,o,a,s,l){const{featureIndex:c,bucketIndex:u,sourceLayerIndex:h,layoutVertexArrayOffset:d}=t,f=this.bucketLayerIDs[u];if(r&&!function(e,t){for(let n=0;n=0)return!0;return!1}(r,f))return;const p=this.sourceLayerCoder.decode(h),m=this.vtLayers[p].feature(c);if(n.needGeometry){const e=Tl(m,!0);if(!n.filter(new zo(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!n.filter(new zo(this.tileID.overscaledZ),m))return;const g=this.getId(m,p);for(let _=0;_{const a=t instanceof Uo?t.get(o):null;return a&&a.evaluate?a.evaluate(n,r,i):a}))}function py(e,t){return t-e}so(dy,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const my=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class gy{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,n]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");const r=n>>4;if(1!==r)throw new Error(`Got v${r} data when expected v1.`);const i=my[15&n];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new gy(a,o,i,e)}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float64Array,r=arguments.length>3?arguments[3]:void 0;if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const i=my.indexOf(this.ArrayType),o=2*e*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+o+a+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return _y(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,s=[0,i.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=a){for(let a=h;a<=u;a++){const s=o[2*a],c=o[2*a+1];s>=e&&s<=n&&c>=t&&c<=r&&l.push(i[a])}continue}const d=h+u>>1,f=o[2*d],p=o[2*d+1];f>=e&&f<=n&&p>=t&&p<=r&&l.push(i[d]),(0===c?e<=f:t<=p)&&(s.push(h),s.push(d-1),s.push(1-c)),(0===c?n>=f:r>=p)&&(s.push(d+1),s.push(u),s.push(1-c))}return l}within(e,t,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:i,nodeSize:o}=this,a=[0,r.length-1,0],s=[],l=n*n;for(;a.length;){const c=a.pop()||0,u=a.pop()||0,h=a.pop()||0;if(u-h<=o){for(let n=h;n<=u;n++)by(i[2*n],i[2*n+1],e,t)<=l&&s.push(r[n]);continue}const d=h+u>>1,f=i[2*d],p=i[2*d+1];by(f,p,e,t)<=l&&s.push(r[d]),(0===c?e-n<=f:t-n<=p)&&(a.push(h),a.push(d-1),a.push(1-c)),(0===c?e+n>=f:t+n>=p)&&(a.push(d+1),a.push(u),a.push(1-c))}return s}}function _y(e,t,n,r,i,o){if(i-r<=n)return;const a=r+i>>1;yy(e,t,a,r,i,o),_y(e,t,n,r,a-1,1-o),_y(e,t,n,a+1,i,1-o)}function yy(e,t,n,r,i,o){for(;i>r;){if(i-r>600){const a=i-r+1,s=n-r+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(s-a/2<0?-1:1);yy(e,t,n,Math.max(r,Math.floor(n-s*c/a+u)),Math.min(i,Math.floor(n+(a-s)*c/a+u)),o)}const a=t[2*n+o];let s=r,l=i;for(vy(e,t,r,n),t[2*i+o]>a&&vy(e,t,r,i);sa;)l--}t[2*r+o]===a?vy(e,t,r,l):(l++,vy(e,t,l,i)),l<=n&&(r=l+1),n<=l&&(i=l-1)}}function vy(e,t,n,r){xy(e,n,r),xy(t,2*n,2*r),xy(t,2*n+1,2*r+1)}function xy(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function by(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}e.$=Fo,e.A=class extends Um{},e.B=dn,e.C=Rt,e.D=Zo,e.E=St,e.F=Ni,e.G=Oi,e.H=Bi,e.I=Nf,e.J=Yi,e.K=Yo,e.L=Qi,e.M=Xi,e.N=Rr,e.O=zr,e.P=$,e.Q=Pr,e.R=tt,e.S=_n,e.T=lm,e.U=Et,e.V=Um,e.W=Xo,e.X=ji,e.Y=Fi,e.Z=function(e){const t=e.value;let n=[];if(!t)return n;const r=dn(t);return"string"!==r?(n=n.concat([new Um(e.key,t,`string expected, "${r}" found`)]),n):($m(t,!0)||(n=n.concat([new Um(e.key,t,`invalid url "${t}"`)])),n)},e._=Ho,e.a=function(e){return Ee.API_CDN_URL_REGEX.test(e)},e.a$=Ga,e.a0=Wo,e.a1=$o,e.a2=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return ge(e.expression.evaluate(t))}interpolate(e,t,n){return{x:kt(e.x,t.x,n),y:kt(e.y,t.y,n),z:kt(e.z,t.z,n),azimuthal:kt(e.azimuthal,t.azimuthal,n),polar:kt(e.polar,t.polar,n)}}},e.a3=zo,e.a4=Ji,e.a5=yl,e.a6=N,e.a7=ee,e.a8=Uo,e.a9=Oc,e.aA=nc,e.aB=mm,e.aC=bm,e.aD=fm,e.aE=function(e,t){const n=document.createElement("video");n.muted=!0,n.onloadstart=function(){t(null,n)};for(let r=0;r{}}},e.aF=cm,e.aG=function(e){return fetch(e).then((e=>e.arrayBuffer())).then((t=>J_(t,0,e)))},e.aH=ay,e.aI=class{constructor(e,t,n,r){this.id=e,this.position=null!=t?new nl(t[0],t[1]):new nl(0,0),this.orientation=null!=n?n:[0,0,0],this.nodes=r,this.uploaded=!1,this.aabb=new gc([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(e,t){if(N.mat4.multiply(e.matrix,t,e.matrix),e.meshes)for(const n of e.meshes){const t=gc.applyTransformFast(n.aabb,e.matrix);this.aabb.encapsulate(t)}if(e.children)for(const n of e.children)this._applyTransformations(n,e.matrix)}computeBoundsAndApplyParent(){const e=N.mat4.identity([]);for(const t of this.nodes)this._applyTransformations(t,e)}computeModelMatrix(e,t,n,r,i,o){let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];Km(this.matrix,this,e.transform,this.position,t,n,r,i,o,a)}upload(e){if(!this.uploaded){for(const t of this.nodes)eg(t,e);for(const e of this.nodes)tg(e);this.uploaded=!0}}destroy(){for(const e of this.nodes)ng(e)}},e.aJ=se,e.aK=gp,e.aL=ul,e.aM=hl,e.aN=ba,e.aO=Fa,e.aP=oe,e.aQ=Ka,e.aR=Zp,e.aS=function(){Lo.isLoading()||Lo.isLoaded()||"deferred"!==Po()||Ro()},e.aT=Ko,e.aU=Tl,e.aV=hy,e.aW=ye,e.aX=bd,e.aY=Bu,e.aZ=El,e.a_=va,e.aa=kt,e.ab=Kn,e.ac=It,e.ad=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return function(e){let[t,n]=e;const r=ge([1,t,n]);return{x:r.x,y:r.y,z:r.z}}(e.expression.evaluate(t))}interpolate(e,t,n){return{x:kt(e.x,t.x,n),y:kt(e.y,t.y,n),z:kt(e.z,t.z,n)}}},e.ae=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const i=new $(n,n),o=e.sub(i),a=t.add(i),s=[o,new $(a.x,o.y),a,new $(o.x,a.y)];return r&&s.push(o.clone()),s},e.af=function(e,t){const n=[];for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:0;return N.vec3.fromValues(((t.x-n)*e.scale-e.x)*Kn,(t.y*e.scale-e.y)*Kn,dl(t.z,t.y))},e.aj=cc,e.ak=Ad,e.al=function(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(const o of e)t=Math.min(t,o.x),n=Math.min(n,o.y),r=Math.max(r,o.x),i=Math.max(i,o.y);return{min:new $(t,n),max:new $(r,i)}},e.am=sl,e.an=jl,e.ao=xl,e.ap=Q,e.aq=Gs,e.ar=function(e,t){const n={};for(let r=0;r{r(e,n)}),t):r(e,n),()=>{}}return i.callbacks.push(r),i.cancel||(i.cancel=n(((n,r)=>{i.result=[n,r];for(const e of i.callbacks)this.scheduler?this.scheduler.add((()=>{e(n,r)}),t):e(n,r);setTimeout((()=>delete this.entries[e]),3e3)}))),()=>{i.result||(i.callbacks=i.callbacks.filter((e=>e!==r)),i.callbacks.length||(i.cancel(),delete this.entries[e]))}}},e.av=ua,e.aw=function(e,t,n){const r=JSON.stringify(e.request);return e.data&&(this.deduped.entries[r]={result:[null,e.data]}),this.deduped.request(r,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom},(t=>{const r=ot(e.request,((e,r,i,o)=>{e?t(e):r&&t(null,{vectorTile:n?void 0:new uh.VectorTile(new sf(r)),rawData:r,cacheControl:i,expires:o})}));return()=>{r.cancel(),t()}}),t)},e.ax=function(e){He++,He>Ve&&(e.getActor().send("enforceCacheSizeLimit",je),He=0)},e.ay=De,e.az=function(e){return e<=1?1:Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},e.b=function(e){return Ee.API_FONTS_REGEX.test(e)},e.b$=function(e){const{x:t,y:n}=e.point,{lng:r,lat:i}=e._center;return Dc(t,n,e.worldSize,r,i)},e.b0=lc,e.b1=hs,e.b2=cu,e.b3=om,e.b4=function(e,t){const n=Oc(t.zoom);if(0===n)return wc(e);const r=Ec(e),i=Tc(r),o=sl(r.getWest())*t.worldSize,a=sl(r.getEast())*t.worldSize,s=ll(r.getNorth())*t.worldSize,l=ll(r.getSouth())*t.worldSize,c=[o,s,0],u=[a,s,0],h=[o,l,0],d=[a,l,0],f=N.mat4.invert([],t.globeMatrix);return N.vec3.transformMat4(c,c,f),N.vec3.transformMat4(u,u,f),N.vec3.transformMat4(h,h,f),N.vec3.transformMat4(d,d,f),i[0]=Sc(i[0],h,n),i[1]=Sc(i[1],d,n),i[2]=Sc(i[2],u,n),i[3]=Sc(i[3],c,n),gc.fromPoints(i)},e.b5=Pc,e.b6=Cc,e.b7=Sc,e.b8=xa,e.b9=sc,e.bA=te,e.bB=H,e.bC=be,e.bD=cl,e.bE=function(e,t,n){e[4*t+0]=n[0],e[4*t+1]=n[1],e[4*t+2]=n[2],e[4*t+3]=n[3]},e.bF=Ts,e.bG=ws,e.bH=Ss,e.bI=bs,e.bJ=xs,e.bK=nl,e.bL=Bp,e.bM=tc,e.bN=mc,e.bO=Am,e.bP=ec,e.bQ=Ac,e.bR=function(e,t,n,r,i,o,a,s,l){if("globe"===l.name)return Ac(e,t,new ec(n,r,i),!1);const c=gp({z:n,x:r,y:i},l);return new gc([(o+c.x/c.scale)*t,t*(c.y/c.scale),a],[(o+c.x2/c.scale)*t,t*(c.y2/c.scale),s])},e.bS=function(e,t,n){let r=0;for(let i=0;i<2;++i){const n=0;e[i]>n&&(r+=(e[i]-n)*(e[i]-n)),t[i]0&&n[0]<=e.width&&n[1]>0&&n[1]<=e.height&&!Bc(e,new nl(e.center.lat,90)),r[0]>0&&r[0]<=e.width&&r[1]>0&&r[1]<=e.height&&!Bc(e,new nl(e.center.lat,-90))]},e.bW=function(e,t){const{scale:n}=e.tileTransform,r=n*Kn/(e.tileSize*Math.pow(2,t.zoom-e.tileID.overscaledZ+e.tileID.canonical.z));return N.mat2.scale(new Float32Array(4),t.inverseAdjustmentMatrix,[r,r])},e.bX=Em,e.bY=Mm,e.bZ=function(e){const t=Mm(e,!0);return N.mat2.invert([],[t[0],t[1],t[4],t[5]])},e.b_=uc,e.ba=w_,e.bb=sf,e.bc=ot,e.bd=function(e){const t=[];for(const n in e)t.push(e[n]);return t},e.be=function(e,t){const n=[];for(const r in e)r in t||n.push(r);return n},e.bf=ne,e.bg=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.bh=G,e.bi=function(e,t){const{x:n,y:r}=e.point,i=Dc(n,r,e.worldSize/e._pixelsPerMercatorPixel,0,0);return N.mat4.multiply(i,i,Rc(wc(t)))},e.bj=Zd,e.bk=ff,e.bl=Hd,e.bm=function(e,t,n,r,i){const o=5*t+2;e.float32[o+0]=n,e.float32[o+1]=r,e.float32[o+2]=i},e.bn=Gp,e.bo=Of,e.bp=Pl,e.bq=Gd,e.br=_h,e.bs=Vm,e.bt=Eh,e.bu=Th,e.bv=ap,e.bw=op,e.bx=Mf,e.by=gy,e.bz=Tt,e.c=Ce,e.c$=ic,e.c0=Z,e.c1=rc,e.c2=qs,e.c3=function(e){const t=Math.round((e+45+360)%360/90)%4;return Y[t]},e.c4=45,e.c5=al,e.c6=Ms,e.c7=function(e,t,n){const r=Math.sqrt(e*e+t*t+n*n),i=r>0?Math.acos(n/r)*W:0;let o=0!==e||0!==t?Math.atan2(-t,-e)*W+90:0;return o<0&&(o+=360),[r,o,i]},e.c8=_l,e.c9=gc,e.cA=function(e){const t=fl-5;e=Q(e,-t,t)/t*90;const n=Math.pow(Math.abs(Math.sin(H(e))),3);return Math.round(n*(Ys.length-1))},e.cB=function(e,t,n,r){const i=t.getNorth(),o=t.getSouth(),a=t.getWest(),s=t.getEast(),l=1<0){const e=180/r;N.mat3.multiply(f,f,[e/c+1,0,0,0,e/u+1,0,-.5*e/h,.5*e/d,1])}return f[2]=l,f[5]=e.x,f[8]=e.y,f},e.cC=wc,e.cD=function(e,t,n){const r=N.mat4.identity(new Float64Array(16)),i=(t/(1<1)return!1;const n=t.getSource().maxzoom,r=1<1&&void 0!==arguments[1]?arguments[1]:0;return this.getAtPoint(e,t)||0}getAtPoint(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.isUsingMockSource())return null;null==t&&(t=null);const r=this._source();if(!r)return t;if(e.y<0||e.y>1)return t;const i=r.getSource().maxzoom,o=1<{const o=this.getAtTileOffset(e,i.x,i.y),a=r.upVector(e.canonical,i.x,i.y),s=r.upVectorScale(e.canonical,t,n).metersToTile;return N.vec3.scale(a,a,o*s),a}}getForTilePoints(e,t,n,r){if(this.isUsingMockSource())return!1;const i=rg.create(this,e,r);return!!i&&(t.forEach((e=>{e[2]=this.exaggeration()*i.getElevationAt(e[0],e[1],n)})),!0)}getMinMaxForTile(e){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(e);if(!t||!t.dem)return null;const n=t.dem.tree,r=t.tileID,i=1<({u_camera_to_center_distance:new bs(e),u_extrude_scale:new Is(e),u_device_pixel_ratio:new bs(e),u_matrix:new Ts(e),u_inv_rot_matrix:new Ts(e),u_merc_center:new ws(e),u_tile_id:new Ss(e),u_zoom_transition:new bs(e),u_up_dir:new Ss(e),u_emissive_strength:new bs(e)}),e.cO=e=>({u_matrix:new Ts(e),u_pixels_to_tile_units:new Is(e),u_device_pixel_ratio:new bs(e),u_units_to_pixels:new ws(e),u_dash_image:new xs(e),u_gradient_image:new xs(e),u_image_height:new bs(e),u_texsize:new ws(e),u_tile_units_to_pixels:new bs(e),u_alpha_discard_threshold:new bs(e),u_trim_offset:new ws(e),u_trim_fade_range:new ws(e),u_trim_color:new Ms(e),u_emissive_strength:new bs(e)}),e.cP=e=>({u_matrix:new Ts(e),u_texsize:new ws(e),u_pixels_to_tile_units:new Is(e),u_device_pixel_ratio:new bs(e),u_image:new xs(e),u_units_to_pixels:new ws(e),u_tile_units_to_pixels:new bs(e),u_alpha_discard_threshold:new bs(e),u_trim_offset:new ws(e)}),e.cQ=Da,e.cR=$d,e.cS=Yd,e.cT=$c,e.cU=(e,t,n,r,i,o)=>{const a=e.transform,s="globe"===a.projection.name;let l;if("map"===o.paint.get("circle-pitch-alignment"))if(s){const e=zc(a.zoom,t.canonical)*a._pixelsPerMercatorPixel;l=Float32Array.from([e,0,0,e])}else l=a.calculatePixelsToTileUnitsMatrix(n);else l=new Float32Array([a.pixelsToGLUnits[0],0,0,a.pixelsToGLUnits[1]]);const c={u_camera_to_center_distance:e.transform.getCameraToCenterDistance(a.projection),u_matrix:e.translatePosMatrix(t.projMatrix,n,o.paint.get("circle-translate"),o.paint.get("circle-translate-anchor")),u_device_pixel_ratio:Oe.devicePixelRatio,u_extrude_scale:l,u_inv_rot_matrix:Uc,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:o.paint.get("circle-emissive-strength")};if(s){c.u_inv_rot_matrix=r,c.u_merc_center=i,c.u_tile_id=[t.canonical.x,t.canonical.y,1<{const a=e.transform;return{u_matrix:Td(e,t,n,r),u_texsize:t.imageAtlasTexture?t.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:a.calculatePixelsToTileUnitsMatrix(t),u_device_pixel_ratio:i,u_image:0,u_tile_units_to_pixels:Ed(t,a),u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:o}},e.cX=(e,t,n,r,i,o,a)=>{const s=e.transform,l=s.calculatePixelsToTileUnitsMatrix(t);return{u_matrix:Td(e,t,n,r),u_pixels_to_tile_units:l,u_device_pixel_ratio:o,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:i,u_texsize:kd(n)&&t.lineAtlasTexture?t.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Ed(t,e.transform),u_alpha_discard_threshold:0,u_trim_offset:a,u_trim_fade_range:n.paint.get("line-trim-fade-range"),u_trim_color:n.paint.get("line-trim-color").toRenderColor(n.lut).toArray01(),u_emissive_strength:n.paint.get("line-emissive-strength")}},e.cY=ae,e.cZ=au,e.c_=nd,e.ca=ge,e.cb=function(e){return[Math.pow(e[0],1/2.2),Math.pow(e[1],1/2.2),Math.pow(e[2],1/2.2)]},e.cc=function(e){return e({pluginStatus:Eo,pluginURL:To}),Io.on("pluginStateChange",e),e},e.cd=vg,e.ce=k_,e.cf=Wf,e.cg=qf,e.ch=rt,e.ci=Co,e.cj=Be,e.ck=yt,e.cl=he,e.cm=function(e){const t=e.indexOf(ca);return t>=0?e.slice(0,t):e},e.cn=function(e){return e.indexOf(ca)>=0},e.co=function(e){const t=e.indexOf(ca);return t>=0?e.slice(t+1):""},e.cp=function(e){const t=[],n=e.id;return void 0===n&&t.push({message:`layers.${n}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${n}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${n}: property "renderingMode" must be either "2d" or "3d"`}),t},e.cq=function(e,t,n,r){return"custom"===e.type?new wm(e,t):new mg[e.type](e,t,n,r)},e.cr=ue,e.cs=Io,e.ct=it,e.cu=As,e.cv=class extends vs{constructor(e){super(e),this.current=Cs}set(e,t,n){if(this.fetchUniformLocation(e,t))for(let r=0;r<9;r++)if(n[r]!==this.current[r]){this.current=n,this.gl.uniformMatrix3fv(this.location,!1,n);break}}},e.cw=X,e.cx=function(e,t,n){const r=Oc(n.zoom),i=e.style.map._antialias,o=t.options.extStandardDerivativesForceOff||e.terrain&&e.terrain.exaggeration()>0;return 0===r&&!i&&!o},e.cy=function(e){const t=e.pixelsPerMeter,n=t/cl(1,e.center.lat),r=N.mat4.identity(new Float64Array(16));return N.mat4.translate(r,r,[e.point.x,e.point.y,0]),N.mat4.scale(r,r,[n,n,t]),Float32Array.from(r)},e.cz=Ec,e.d=function(e){return Ee.API_TILEJSON_REGEX.test(e)},e.d$=t,e.d0=Zh,e.d1=Oh,e.d2=450,e.d3=7,e.d4=pm,e.d5=_a,e.d6=Za,e.d7=256,e.d8=Rc,e.d9=Aa,e.dA=Fc,e.dB=function(e){const t=[0,0,0],n=N.mat4.identity(new Float64Array(16));return N.mat4.multiply(n,e.pixelMatrix,e.globeMatrix),N.vec3.transformMat4(t,t,n),new $(t[0],t[1])},e.dC=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Eo===wo||Eo===So||Eo===Mo)throw new Error("setRTLTextPlugin cannot be called multiple times.");To=Oe.resolveURL(e),Eo=wo,Ao=t,ko(),n||Ro()},e.dD=Po,e.dE=function(){k_().acquire(E_)},e.dF=function(){const e=C_;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(E_),C_=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.dG=T_,e.dH=function(e){const t=qe();if(!t)return;const n=t.delete(Ne);e&&n.catch(e).then((()=>e()))},e.dI=A_,e.dJ=O_,e.dK=function(e){P_=Oe.resolveURL(e),D_||(D_=new vg(k_(),new St)),D_.broadcast("setDracoUrl",P_)},e.dL=F_,e.dM=function(e){L_=Oe.resolveURL(e),D_||(D_=new vg(k_(),new St)),D_.broadcast("setMeshoptUrl",L_)},e.dN=so,e.dO=ru,e.dP=Gf,e.dQ=cy,e.dR=dy,e.dS=_d,e.dT=ce,e.dU=jf,e.dV=function(e,t,n,r,i,o,a,s,l,c,u){e.createArrays(),e.tilePixelRatio=Kn/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;const h=e.layers[0].layout,d=e.layers[0]._unevaluatedLayout._values,f={};if("composite"===e.textSizeData.kind){const{minZoom:t,maxZoom:n}=e.textSizeData;f.compositeTextSizes=[d["text-size"].possiblyEvaluate(new zo(t),s),d["text-size"].possiblyEvaluate(new zo(n),s)]}if("composite"===e.iconSizeData.kind){const{minZoom:t,maxZoom:n}=e.iconSizeData;f.compositeIconSizes=[d["icon-size"].possiblyEvaluate(new zo(t),s),d["icon-size"].possiblyEvaluate(new zo(n),s)]}f.layoutTextSize=d["text-size"].possiblyEvaluate(new zo(l+1),s),f.layoutIconSize=d["icon-size"].possiblyEvaluate(new zo(l+1),s),f.textMaxSize=d["text-size"].possiblyEvaluate(new zo(18),s);const p="map"===h.get("text-rotation-alignment")&&"point"!==h.get("symbol-placement"),m=h.get("text-size");let g=!1;for(const _ of e.features)if(_.icon&&_.icon.nameSecondary){g=!0;break}for(const _ of e.features){const o=h.get("text-font").evaluate(_,{},s).join(","),l=m.evaluate(_,{},s),d=f.layoutTextSize.evaluate(_,{},s),y=(f.layoutIconSize.evaluate(_,{},s),{horizontal:{},vertical:void 0}),v=_.text;let x,b=[0,0];if(v){const r=v.toString(),a=h.get("text-letter-spacing").evaluate(_,{},s)*Gd,c=h.get("text-line-height").evaluate(_,{},s)*Gd,u=mo(r)?a:0,f=h.get("text-anchor").evaluate(_,{},s),m=h.get("text-variable-anchor");if(!m){const e=h.get("text-radial-offset").evaluate(_,{},s);b=e?op(f,[e*Gd,rp]):h.get("text-offset").evaluate(_,{},s).map((e=>e*Gd))}let g=p?"center":h.get("text-justify").evaluate(_,{},s);const x="point"===h.get("symbol-placement"),w=x?h.get("text-max-width").evaluate(_,{},s)*Gd:1/0,S=a=>{e.allowVerticalPlacement&&po(r)&&(y.vertical=gf(v,t,n,i,o,w,c,f,a,u,b,ff.vertical,!0,d,l))};if(!p&&m){const e="auto"===g?m.map((e=>ap(e))):[g];let r=!1;for(let a=0;a=0||!po(r)){const e=gf(v,t,n,i,o,w,c,f,g,u,b,ff.horizontal,!1,d,l);e&&(y.horizontal[g]=e)}S(x?"left":g)}}let w=!1;if(_.icon&&_.icon.namePrimary){const t=r[_.icon.namePrimary];t&&(x=Ef(i[_.icon.namePrimary],_.icon.nameSecondary?i[_.icon.nameSecondary]:void 0,h.get("icon-offset").evaluate(_,{},s),h.get("icon-anchor").evaluate(_,{},s)),w=t.sdf,void 0===e.sdfIcons?e.sdfIcons=t.sdf:e.sdfIcons!==t.sdf&&fe("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.pixelRatio||0!==h.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0))}const S=hp(y.horizontal)||y.vertical;e.iconsInText||(e.iconsInText=!!S&&S.iconsInText),(S||x)&&sp(e,_,y,x,r,f,d,0,b,w,a,s,c,u,g)}o&&e.generateCollisionDebugBuffers(l,e.collisionBoxArray)},e.dW=uh,e.dX=Pg,e.dY=U,e.dZ=ch,e.d_=af,e.da=Va,e.db=Ua,e.dc=function(e,t,n,r,i){return Q((e-t)/(n-t)*(i-r)+r,r,i)},e.dd=Ei,e.de=ml,e.df=class{constructor(e,t,n,r){this.context=e,this.format=r,this.size=n,this.texture=e.gl.createTexture();const[i,o,a]=this.size,{gl:s}=e;s.bindTexture(s.TEXTURE_3D,this.texture),e.pixelStoreUnpackFlipY.set(!1),e.pixelStoreUnpack.set(1),e.pixelStoreUnpackPremultiplyAlpha.set(!1),s.texImage3D(s.TEXTURE_3D,0,this.format,i,o,a,0,am(this.format),sm(this.format),t.data)}bind(e,t){const{context:n}=this,{gl:r}=n;r.bindTexture(r.TEXTURE_3D,this.texture),e!==this.minFilter&&(r.texParameteri(r.TEXTURE_3D,r.TEXTURE_MAG_FILTER,e),r.texParameteri(r.TEXTURE_3D,r.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(r.texParameteri(r.TEXTURE_3D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_3D,r.TEXTURE_WRAP_T,t),this.wrapS=t)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}},e.dg=Rm,e.dh=[1,1,1],e.di=rg,e.dj=Xm,e.dk=Ra,e.dl=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new $(1/0,1/0),max:new $(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=wh(new $(0,0),new $(Kn,Kn),e),r=[];if(t&&!xh(n,this._globalClipBounds))return r;for(const i of this._activeRegions){if(i.hiddenByOverlap)continue;if(!xh(n,i))continue;const t=Sh(i.min,i.max,e);r.push({min:t.min,max:t.max,sourceId:this._sourceIds[i.priority],footprint:i.footprint,footprintTileId:i.tileId,order:i.order,clipMask:i.clipMask,clipScope:i.clipScope})}return r}setSources(e){this._setSources(e.map((e=>({getSourceId:()=>e.cache.id,getFootprints:()=>{const t=[];for(const n of e.cache.getVisibleCoordinates()){const r=e.cache.getTile(n).buckets[e.layer];r&&r.updateFootprints(n.toUnwrapped(),t)}return t},getOrder:()=>e.order,getClipMask:()=>e.clipMask,getClipScope:()=>e.clipScope}))))}_addSource(e){const t=e.getFootprints();if(0===t.length)return;const n=e.getOrder(),r=e.getClipMask(),i=e.getClipScope();for(const o of t){if(!o.footprint)continue;const e=wh(o.footprint.min,o.footprint.max,o.id);this._activeRegions.push({min:e.min,max:e.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:o.id,footprint:o.footprint,order:n,clipMask:r,clipScope:i})}this._sourceIds.push(e.getSourceId())}_computeReplacement(){this._activeRegions.sort(((e,t)=>e.priority-t.priority||yh(e.min,t.min)||yh(e.max,t.max)||e.order-t.order||e.clipMask-t.clipMask||function(e,t){const n=(e,t)=>e+t;return e.length-t.length||e.reduce(n,"").localeCompare(t.reduce(n,""))}(e.clipScope,t.clipScope)));let e=this._activeRegions.length!==this._prevRegions.length;if(!e){let t=0;for(;!e&&t!==this._activeRegions.length;){const n=this._activeRegions[t],r=this._prevRegions[t];e=n.priority!==r.priority||!vh(n,r)||n.order!==r.order||n.clipMask!==r.clipMask||!G(n.clipScope,r.clipScope),++t}}if(e){++this._updateTime;for(const t of this._activeRegions)t.order!==gh&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,t.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,t.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,t.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,t.max.y));const e=e=>{const t=this._activeRegions;if(e>=t.length)return e;const n=t[e].priority;for(;e1){let t=0,n=e(t);for(;t!==n;){let r=t;const i=t;for(;r!==n;){const e=this._activeRegions[r];e.hiddenByOverlap=!1;for(let t=0;t=0;t--)this._addSource(e[t]);this._computeReplacement()}},e.dm=class{constructor(e){this._createGrid(e),this._createPoles(e)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const e of this._poleSegments)e.destroy();for(const e of this._gridSegments)e.withSkirts.destroy(),e.withoutSkirts.destroy()}_fillGridMeshWithLods(e,t){const n=new va,r=new Fa,i=[],o=e+1+2,a=t[0]+1,s=t[0]+1+(1+t.length),l=(e,t,n)=>{let r=e===o-1?e-2:0===e?e:e-1;return r+=n?24575:0,[r,t]};for(let c=0;c=e.byteLength)&&fe("Invalid b3dm header information.")}return J_(e,t)},e.e1=function(e,t){const n=ay(e);for(const r of n){for(const e of r.meshes)sy(e);r.lights&&(r.lightMeshIndex=r.meshes.length,r.meshes.push(ly(r.lights,t)))}return n},e.e2=ug,e.e3=yg,e.e4=Lo,e.e5=function(e){We(),null!=$e&&$e.then((t=>{t.keys().then((n=>{for(let r=0;r"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join(""))},e.k=function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number("0x"+t)))))},e.l=re,e.m=Ze,e.n=function(e,t){return it(re(e,{type:"json"}),t)},e.o=ut,e.p=function(e,t){return it(re(e,{method:"POST"}),t)},e.q=Oe,e.r=iu,e.s=function(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}},e.t=xt,e.u=function(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()},e.v=function(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e.w=fe,e.x=vt,e.y=2,e.z=Ff})),r(["./shared"],(function(e){function t(e){const t=e?e.url.toString():void 0;return t?performance.getEntriesByName(t):[]}function n(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(const r of e)t+=`${n(r)},`;return`${t}]`}let t="{";for(const r of Object.keys(e).sort())t+=`${r}:${n(e[r])},`;return`${t}}`}function r(t){let r="";for(const i of e.bg)r+=`/${n(t[i])}`;return r}class i{constructor(e){this.keyCache={},this._layers={},this._layerConfigs={},e&&this.replace(e)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(t,n,i){this._options=i;for(const r of t)this._layerConfigs[r.id]=r,(this._layers[r.id]=e.cq(r,this.scope,null,this._options)).compileFilter(i),this.keyCache[r.id]&&delete this.keyCache[r.id];for(const e of n)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const o=function(e,t){const n={};for(let o=0;othis._layers[e.id])),n=t[0];if("none"===n.visibility)continue;const r=n.source||"";let i=this.familiesBySource[r];i||(i=this.familiesBySource[r]={});const o=n.sourceLayer||"_geojsonTileLayer";let a=i[o];a||(a=i[o]=[]),a.push(t)}}}const o=1*e.dP;class a{constructor(t){const n={},r=[];for(const e in t){const i=t[e],a=n[e]={};for(const e in i.glyphs){const t=i.glyphs[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const n=t.metrics.localGlyph?o:1,s={x:0,y:0,w:t.bitmap.width+2*n,h:t.bitmap.height+2*n};r.push(s),a[e]=s}}const{w:i,h:a}=e.z(r),s=new e.dO({width:i||1,height:a||1});for(const l in t){const r=t[l];for(const t in r.glyphs){const i=r.glyphs[+t];if(!i||0===i.bitmap.width||0===i.bitmap.height)continue;const a=n[l][t],c=i.metrics.localGlyph?o:1;e.dO.copy(i.bitmap,s,{x:0,y:0},{x:a.x+c,y:a.y+c},i.bitmap)}}this.image=s,this.positions=n}}e.dN(a,"GlyphAtlas");class s{constructor(t){this.tileID=new e.aA(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.lut=t.lut,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.scope=t.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.promoteId=t.promoteId,this.isSymbolTile=t.isSymbolTile,this.tileTransform=e.aK(t.tileID.canonical,t.projection),this.projection=t.projection,this.brightness=t.brightness,this.extraShadowCaster=!!t.extraShadowCaster,this.tessellationStep=t.tessellationStep}parse(t,n,r,i,o){this.status="parsing",this.data=t,this.collisionBoxArray=new e.aQ;const s=new e.dQ(Object.keys(t.layers).sort()),c=new e.dR(this.tileID,this.promoteId);c.bucketLayerIDs=[];const u={},h=new e.dS(256,256),d={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:h,availableImages:r,brightness:this.brightness},f=n.familiesBySource[this.source];for(const a in f){const n=t.layers[a];if(!n)continue;let i=!1,o=!1,h=!1;for(const e of f[a])"symbol"===e[0].type?i=!0:o=!0,e[0].is3D()&&"model"!==e[0].type&&(h=!0);if(this.extraShadowCaster&&!h)continue;if(!0===this.isSymbolTile&&!i)continue;if(!1===this.isSymbolTile&&!o)continue;1===n.version&&e.w(`Vector tile source "${this.source}" layer "${a}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const p=s.encode(a),m=[];for(let e=0;e=t.maxzoom||"none"!==t.visibility&&(l(e,this.zoom,d.brightness,r),(u[t.id]=t.createBucket({index:c.bucketLayerIDs.length,layers:e,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:p,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep})).populate(m,d,this.tileID.canonical,this.tileTransform),c.bucketLayerIDs.push(e.map((e=>e.id)))))}}let p,m,g,_;h.trim();const y={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},v=()=>{if(p)return this.status="done",o(p);if(this.extraShadowCaster)this.status="done",o(null,{buckets:e.bd(u).filter((e=>!e.isEmpty())),featureIndex:c,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:d.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(m&&g&&_){const t=new a(m),n=new e.dU(g,_,this.lut);for(const i in u){const o=u[i];o instanceof e.aR?(l(o.layers,this.zoom,d.brightness,r),e.dV(o,m,t.positions,g,n.iconPositions,this.showCollisionBoxes,r,this.tileID.canonical,this.tileZoom,this.projection,this.brightness)):o.hasPattern&&(o instanceof e.aX||o instanceof e.aY||o instanceof e.d0)&&(l(o.layers,this.zoom,d.brightness,r),o.addFeatures(d,this.tileID.canonical,n.patternPositions,r,this.tileTransform,this.brightness))}this.status="done",o(null,{buckets:e.bd(u).filter((e=>!e.isEmpty())),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,lineAtlas:h,imageAtlas:n,brightness:d.brightness})}};if(!this.extraShadowCaster){const t=e.dT(d.glyphDependencies,(e=>Object.keys(e).map(Number)));Object.keys(t).length?i.send("getGlyphs",{uid:this.uid,stacks:t,scope:this.scope},((e,t)=>{p||(p=e,m=t,v())}),void 0,!1,y):m={};const n=Object.keys(d.iconDependencies);n.length?i.send("getImages",{icons:n,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},((e,t)=>{p||(p=e,g=t,v())}),void 0,!1,y):g={};const r=Object.keys(d.patternDependencies);r.length?i.send("getImages",{icons:r,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},((e,t)=>{p||(p=e,_=t,v())}),void 0,!1,y):_={}}v()}}function l(t,n,r,i){const o=new e.a3(n,{brightness:r});for(const e of t)e.recalculate(o,i)}class c extends e.E{constructor(t,n,r,i,o,a){super(),this.actor=t,this.layerIndex=n,this.availableImages=r,this.loadVectorData=o||e.aw,this.loading={},this.loaded={},this.deduped=new e.au(t.scheduler),this.isSpriteLoaded=i,this.scheduler=t.scheduler,this.brightness=a}loadTile(n,r){const i=n.uid,o=n&&n.request,a=o&&o.collectResourceTiming,l=this.loading[i]=new s(n);l.abort=this.loadVectorData(n,((s,c)=>{const u=!this.loading[i];if(delete this.loading[i],u||s||!c)return l.status="done",u||(this.loaded[i]=l),r(s);const h=c.rawData,d={};c.expires&&(d.expires=c.expires),c.cacheControl&&(d.cacheControl=c.cacheControl),l.vectorTile=c.vectorTile||new e.dW.VectorTile(new e.bb(h));const f=()=>{l.parse(l.vectorTile,this.layerIndex,this.availableImages,this.actor,((n,i)=>{if(n||!i)return r(n);const s={};if(a){const e=t(o);e.length>0&&(s.resourceTiming=JSON.parse(JSON.stringify(e)))}r(null,e.l({rawTileData:h.slice(0)},i,d,s))}))};this.isSpriteLoaded?f():this.once("isSpriteLoaded",(()=>{this.scheduler?this.scheduler.add(f,{type:"parseTile",isSymbolTile:n.isSymbolTile,zoom:n.tileZoom}):f()})),this.loaded=this.loaded||{},this.loaded[i]=l}))}reloadTile(t,n){const r=this.loaded,i=t.uid;if(r&&r[i]){const o=r[i];o.showCollisionBoxes=t.showCollisionBoxes,o.projection=t.projection,o.brightness=t.brightness,o.tileTransform=e.aK(t.tileID.canonical,t.projection),o.extraShadowCaster=t.extraShadowCaster,o.lut=t.lut;const a=(e,t)=>{const r=o.reloadCallback;r&&(delete o.reloadCallback,o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,r)),n(e,t)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}else n(null,void 0)}abortTile(e,t){const n=e.uid,r=this.loading[n];r&&(r.abort&&r.abort(),delete this.loading[n]),t()}removeTile(e,t){const n=this.loaded,r=e.uid;n&&n[r]&&delete n[r],t()}}class u{loadTile(t,n){const{uid:r,encoding:i,rawImageData:o,padding:a}=t,s=ImageBitmap&&o instanceof ImageBitmap?this.getImageData(o,a):o;n(null,new e.dX(r,s,i,a<1))}getImageData(e,t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);const n=this.offscreenCanvasContext.getImageData(-t,-t,e.width+2*t,e.height+2*t);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),n}}e.ba.setPbf(e.bb);class h{decodeRasterArray(t,n){let{task:r,buffer:i}=t;e.ba.performDecoding(i,r).then((e=>{n(null,e)}),(e=>{n(e)}))}}const d=e.dW.VectorTileFeature.prototype.toGeoJSON;class f{constructor(t){this._feature=t,this.extent=e.ab,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){const t=[];for(const n of this._feature.geometry)t.push([new e.P(n[0],n[1])]);return t}{const t=[];for(const n of this._feature.geometry){const r=[];for(const t of n)r.push(new e.P(t[0],t[1]));t.push(r)}return t}}toGeoJSON(e,t,n){return d.call(this,e,t,n)}}class p{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.ab,this.length=t.length,this._features=t}feature(e){return new f(this._features[e])}}const m=64/4096,g=128;class _{constructor(){this.features=new Map}clear(){this.features.clear()}load(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;for(const n of e){const e=n.id;if(null==e)continue;let r=this.features.get(e);r&&this.updateCache(r,t),n.geometry?(r=v(n),this.updateCache(r,t),this.features.set(e,r)):this.features.delete(e),this.updateCache(r,t)}}updateCache(e,t){for(const{canonical:n,uid:r}of Object.values(t)){const{z:i,x:o,y:a}=n;y(e,Math.pow(2,i),o,a)&&delete t[r]}}getTile(e,t,n){const r=Math.pow(2,e),i=[];for(const o of this.features.values())y(o,r,t,n)&&i.push(S(o,r,t,n));return{features:i}}getFeatures(){return[...this.features.values()]}}function y(e,t,n,r){let{minX:i,minY:o,maxX:a,maxY:s}=e;return i<(n+1+m)/t&&o<(r+1+m)/t&&a>(n-m)/t&&s>(r-m)/t}function v(e){const{id:t,geometry:n,properties:r}=e;if(!n)return;if("GeometryCollection"===n.type)throw new Error("GeometryCollection not supported in dynamic mode.");const{type:i,coordinates:o}=n,a={id:t,type:1,geometry:[],tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},s=a.geometry;if("Point"===i)x(o,s,a);else if("MultiPoint"===i)for(const l of o)x(l,s,a);else if("LineString"===i)a.type=2,b(o,s,a);else if("MultiLineString"===i)a.type=2,w(o,s,a);else if("Polygon"===i)a.type=3,w(o,s,a,!0);else{if("MultiPolygon"!==i)throw new Error("Input data is not a valid GeoJSON object.");a.type=3;for(const e of o)w(e,s,a,!0)}return a}function x(t,n,r){let[i,o]=t;const a=e.am(i);let s=e.at(o);s=s<0?0:s>1?1:s,n.push(a,s),r.minX=Math.min(r.minX,a),r.minY=Math.min(r.minY,s),r.maxX=Math.max(r.maxX,a),r.maxY=Math.max(r.maxY,s)}function b(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const o=[];for(const a of e)x(a,o,n);t.push(o),r&&function(e,t){let n=0;for(let r=0,i=e.length,o=i-2;r0===t)for(let r=0,i=e.length;r3&&void 0!==arguments[3]&&arguments[3];for(let i=0;i=s&&d>=s||(u>=s?(h+=Math.round(m*((s-u)/p)),u=s):d>=s&&(f=h+Math.round(m*((s-u)/p)),d=s),h>=s&&f>=s||(h>=s?(u+=Math.round(p*((s-h)/m)),h=s):f>=s&&(d=u+Math.round(p*((s-h)/m)),f=s),l&&u===l[l.length-1][0]&&h===l[l.length-1][1]||(l=[[u,h]],o.push(l)),l.push([d,f])))))}}var A,E,T,C={exports:{}},k=function(){if(T)return C.exports;T=1;var t=e.d_(),n=function(){if(E)return A;E=1;var t=e.dY(),n=e.dZ().VectorTileFeature;function r(e,t){this.options=t||{},this.features=e,this.length=e.length}function i(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}return A=r,r.prototype.feature=function(e){return new i(this.features[e],this.options.extent)},i.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var n=0;n>31}function c(e,t){for(var n=e.loadGeometry(),r=e.type,i=0,o=0,a=n.length,c=0;ce},R=Math.fround||(L=new Float32Array(1),e=>(L[0]=+e,L[0]));var L;const z=3,D=5,O=6;class F{constructor(e){this.options=Object.assign(Object.create(P),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:n,maxZoom:r}=this.options;t&&console.time("total time");const i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;const o=[];for(let s=0;s=n;s--){const e=+Date.now();a=this.trees[s]=this._createTree(this._cluster(a,s)),t&&console.log("z%d: %d clusters in %dms",s,a.numItems,+Date.now()-e)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[1]));let i=180===e[2]?180:((e[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){const e=this.getClusters([n,r,180,o],t),a=this.getClusters([-180,r,i,o],t);return e.concat(a)}const a=this.trees[this._limitZoom(t)],s=a.range(j(n),V(o),j(i),V(r)),l=a.data,c=[];for(const u of s){const e=this.stride*u;c.push(l[e+D]>1?B(l,e,this.clusterProps):this.points[l[e+z]])}return c}getChildren(e){const t=this._getOriginId(e),n=this._getOriginZoom(e),r="No cluster with the specified id.",i=this.trees[n];if(!i)throw new Error(r);const o=i.data;if(t*this.stride>=o.length)throw new Error(r);const a=this.options.radius/(this.options.extent*Math.pow(2,n-1)),s=i.within(o[t*this.stride],o[t*this.stride+1],a),l=[];for(const c of s){const t=c*this.stride;o[t+4]===e&&l.push(o[t+D]>1?B(o,t,this.clusterProps):this.points[o[t+z]])}if(0===l.length)throw new Error(r);return l}getLeaves(e,t,n){const r=[];return this._appendLeaves(r,e,t=t||10,n=n||0,0),r}getTile(e,t,n){const r=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:o,radius:a}=this.options,s=a/o,l=(n-s)/i,c=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((t-s)/i,l,(t+1+s)/i,c),r.data,t,n,i,u),0===t&&this._addTileFeatures(r.range(1-s/i,l,1,c),r.data,i,n,i,u),t===i-1&&this._addTileFeatures(r.range(0,l,s/i,c),r.data,-1,n,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const n=this.getChildren(e);if(t++,1!==n.length)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,r,i){const o=this.getChildren(t);for(const a of o){const t=a.properties;if(t&&t.cluster?i+t.point_count<=r?i+=t.point_count:i=this._appendLeaves(e,t.cluster_id,n,r,i):i1;let l,c,u;if(s)l=N(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const n=this.points[t[e+z]];l=n.properties;const[r,i]=n.geometry.coordinates;c=j(r),u=V(i)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*i-n)),Math.round(this.options.extent*(u*i-r))]],tags:l};let d;d=s||this.options.generateId?t[e+z]:this.points[t[e+z]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:n,extent:r,reduce:i,minPoints:o}=this.options,a=n/(r*Math.pow(2,t)),s=e.data,l=[],c=this.stride;for(let u=0;ut&&(f+=s[n+D])}if(f>d&&f>=o){let e,o=n*d,a=r*d,p=-1;const m=(u/c<<5)+(t+1)+this.points.length;for(const n of h){const r=n*c;if(s[r+2]<=t)continue;s[r+2]=t;const l=s[r+D];o+=s[r]*l,a+=s[r+1]*l,s[r+4]=m,i&&(e||(e=this._map(s,u,!0),p=this.clusterProps.length,this.clusterProps.push(e)),i(e,this._map(s,r)))}s[u+4]=m,l.push(o/f,a/f,1/0,m,-1,f),i&&l.push(p)}else{for(let e=0;e1)for(const e of h){const n=e*c;if(!(s[n+2]<=t)){s[n+2]=t;for(let e=0;e>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+D]>1){const r=this.clusterProps[e[t+O]];return n?Object.assign({},r):r}const r=this.points[e[t+z]].properties,i=this.options.map(r);return n&&i===r?Object.assign({},i):i}}function B(e,t,n){return{type:"Feature",id:e[t+z],properties:N(e,t,n),geometry:{type:"Point",coordinates:[(r=e[t],360*(r-.5)),U(e[t+1])]}};var r}function N(e,t,n){const r=e[t+D],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+"k":r,o=e[t+O],a=-1===o?{}:Object.assign({},n[o]);return Object.assign(a,{cluster:!0,cluster_id:e[t+z],point_count:r,point_count_abbreviated:i})}function j(e){return e/360+.5}function V(e){const t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function U(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function $(e,t,n,r){let i=r;const o=t+(n-t>>1);let a,s=n-t;const l=e[t],c=e[t+1],u=e[n],h=e[n+1];for(let d=t+3;di)a=d,i=t;else if(t===i){const e=Math.abs(d-o);er&&(a-t>3&&$(e,t,a,r),e[a+2]=i,n-a>3&&$(e,a,n,r))}function G(e,t,n,r,i,o){let a=i-n,s=o-r;if(0!==a||0!==s){const l=((e-n)*a+(t-r)*s)/(a*a+s*s);l>1?(n=i,r=o):l>0&&(n+=a*l,r+=s*l)}return a=e-n,s=t-r,a*a+s*s}function q(e,t,n,r){const i={id:e??null,type:t,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)W(i,n);else if("Polygon"===t)W(i,n[0]);else if("MultiLineString"===t)for(const o of n)W(i,o);else if("MultiPolygon"===t)for(const o of n)W(i,o[0]);return i}function W(e,t){for(let n=0;n0&&(a+=r?(i*s-n*o)/2:Math.sqrt(Math.pow(n-i,2)+Math.pow(s-o,2))),i=n,o=s}const s=t.length-3;t[2]=1,$(t,0,s,n),t[s+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function X(e,t,n,r){for(let i=0;i1?1:n}function Q(e,t,n,r,i,o,a,s){if(r/=t,o>=(n/=t)&&a=r)return null;const l=[];for(const c of e){const e=c.geometry;let t=c.type;const o=0===i?c.minX:c.minY,a=0===i?c.maxX:c.maxY;if(o>=n&&a=r)continue;let u=[];if("Point"===t||"MultiPoint"===t)ee(e,u,n,r,i);else if("LineString"===t)te(e,u,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===t)re(e,u,n,r,i,!1);else if("Polygon"===t)re(e,u,n,r,i,!0);else if("MultiPolygon"===t)for(const s of e){const e=[];re(s,e,n,r,i,!0),e.length&&u.push(e)}if(u.length){if(s.lineMetrics&&"LineString"===t){for(const e of u)l.push(q(c.id,t,e,c.tags));continue}"LineString"!==t&&"MultiLineString"!==t||(1===u.length?(t="LineString",u=u[0]):t="MultiLineString"),"Point"!==t&&"MultiPoint"!==t||(t=3===u.length?"Point":"MultiPoint"),l.push(q(c.id,t,u,c.tags))}}return l.length?l:null}function ee(e,t,n,r,i){for(let o=0;o=n&&a<=r&&ie(t,e[o],e[o+1],e[o+2])}}function te(e,t,n,r,i,o,a){let s=ne(e);const l=0===i?oe:ae;let c,u,h=e.start;for(let g=0;gn&&(u=l(s,d,f,m,_,n),a&&(s.start=h+c*u)):y>r?v=n&&(u=l(s,d,f,m,_,n),x=!0),v>r&&y<=r&&(u=l(s,d,f,m,_,r),x=!0),!o&&x&&(a&&(s.end=h+c*u),t.push(s),s=ne(e)),a&&(h+=c)}let d=e.length-3;const f=e[d],p=e[d+1],m=0===i?f:p;m>=n&&m<=r&&ie(s,f,p,e[d+2]),d=s.length-3,o&&d>=3&&(s[d]!==s[0]||s[d+1]!==s[1])&&ie(s,s[0],s[1],s[2]),s.length&&t.push(s)}function ne(e){const t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function re(e,t,n,r,i,o){for(const a of e)te(a,t,n,r,i,o,!1)}function ie(e,t,n,r){e.push(t,n,r)}function oe(e,t,n,r,i,o){const a=(o-t)/(r-t);return ie(e,o,n+(i-n)*a,1),a}function ae(e,t,n,r,i,o){const a=(o-n)/(i-n);return ie(e,t+(r-t)*a,o,1),a}function se(e,t){const n=[];for(let r=0;r0&&t.size<(i?a:r))return void(n.numPoints+=t.length/3);const s=[];for(let l=0;la)&&(n.numSimplified++,s.push(t[l],t[l+1])),n.numPoints++;i&&function(e,t){let n=0;for(let r=0,i=e.length,o=i-2;r0===t)for(let r=0,i=e.length;r24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=function(e,t){const n=[];if("FeatureCollection"===e.type)for(let r=0;r1&&console.time("creation"),d=this.tiles[h]=he(e,t,n,r,l),this.tileCoords.push({z:t,x:n,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,n,r,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(d.source=e,null==i){if(t===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===i)continue;if(null!=i){const e=i-t;if(n!==o>>e||r!==a>>e)continue}}if(d.source=null,0===e.length)continue;c>1&&console.time("clipping");const f=.5*l.buffer/l.extent,p=.5-f,m=.5+f,g=1+f;let _=null,y=null,v=null,x=null,b=Q(e,u,n-f,n+m,0,d.minX,d.maxX,l),w=Q(e,u,n+p,n+g,0,d.minX,d.maxX,l);e=null,b&&(_=Q(b,u,r-f,r+m,1,d.minY,d.maxY,l),y=Q(b,u,r+p,r+g,1,d.minY,d.maxY,l),b=null),w&&(v=Q(w,u,r-f,r+m,1,d.minY,d.maxY,l),x=Q(w,u,r+p,r+g,1,d.minY,d.maxY,l),w=null),c>1&&console.timeEnd("clipping"),s.push(_||[],t+1,2*n,2*r),s.push(y||[],t+1,2*n,2*r+1),s.push(v||[],t+1,2*n+1,2*r),s.push(x||[],t+1,2*n+1,2*r+1)}}getTile(e,t,n){e=+e,t=+t,n=+n;const r=this.options,{extent:i,debug:o}=r;if(e<0||e>24)return null;const a=1<1&&console.log("drilling down to z%d-%d-%d",e,t,n);let l,c=e,u=t,h=n;for(;!l&&c>0;)c--,u>>=1,h>>=1,l=this.tiles[ge(c,u,h)];return l&&l.source?(o>1&&(console.log("found parent tile z%d-%d-%d",c,u,h),console.time("drilling down")),this.splitTile(l.source,c,u,h,e,t,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?ce(this.tiles[s],i):null):null}}function ge(e,t,n){return 32*((1<{if(a||!s)return r(a);if("object"!=typeof s)return r(new Error(`Input data given to '${n.source}' is not a valid GeoJSON object.`));{try{if(n.filter){const t=e.M(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s.features=s.features.filter((e=>t.value.evaluate({zoom:0},e)))}n.dynamic?("Feature"===s.type&&(s={type:"FeatureCollection",features:[s]}),n.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(s.features,this.loaded),n.cluster&&(s.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=n.cluster?new F(function(t){let{superclusterOptions:n,clusterProperties:r}=t;if(!r||!n)return n;const i={},o={},a={accumulated:null,zoom:0},s={properties:null},l=Object.keys(r);for(const c of l){const[t,n]=r[c],a=e.M(n),s=e.M("string"==typeof t?[t,["accumulated"],["get",c]]:t);i[c]=a.value,o[c]=s.value}return n.map=e=>{s.properties=e;const t={};for(const n of l)t[n]=i[n].evaluate(a,s);return t},n.reduce=(e,t)=>{s.properties=t;for(const n of l)a.accumulated=e[n],e[n]=o[n].evaluate(a,s)},n}(n)).load(s.features):n.dynamic?this._dynamicIndex:function(e,t){return new me(e,t)}(s,n.geojsonVtOptions)}catch(e){return r(e)}const a={};if(o){const e=t(i);e&&(a.resourceTiming={},a.resourceTiming[n.source]=JSON.parse(JSON.stringify(e)))}r(null,a)}}))}reloadTile(e,t){const n=this.loaded;return n&&n[e.uid]?e.partial?t(null,void 0):super.reloadTile(e,t):this.loadTile(e,t)}loadGeoJSON(t,n){if(t.request)e.n(t.request,n);else{if("string"!=typeof t.data)return n(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));try{return n(null,JSON.parse(t.data))}catch(e){return n(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}}class ve{constructor(t,n){this.tileID=new e.aA(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=t.projection,this.brightness=n}parse(t,n,r,i){this.status="parsing";const o=new e.aA(r.tileID.overscaledZ,r.tileID.wrap,r.tileID.canonical.z,r.tileID.canonical.x,r.tileID.canonical.y),a={},s=n.familiesBySource[r.source],l=new e.dR(o,r.promoteId);return l.bucketLayerIDs=[],l.is3DTile=!0,e.e0(t).then((t=>{if(!t)return i(new Error("Could not parse tile"));const n=e.e1(t,1/e.c8(r.tileID.canonical)),c=t.json.extensionsUsed&&t.json.extensionsUsed.includes("MAPBOX_mesh_features")||t.json.asset.extras&&t.json.asset.extras.MAPBOX_mesh_features,u=t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression"),h=new e.a3(this.zoom,{brightness:this.brightness});for(const r in s)for(const t of s[r]){const r=t[0];l.bucketLayerIDs.push(t.map((e=>e.id))),r.recalculate(h,[]);const i=new e.e2(n,o,c,u,this.brightness,l);c||(i.needsUpload=!0),a[r.fqid]=i,i.evaluate(r)}this.status="done",i(null,{buckets:a,featureIndex:l})})).catch((e=>i(new Error(e.message))))}}class xe{constructor(e,t,n,r,i,o){this.actor=e,this.layerIndex=t,this.brightness=o,this.loading={},this.loaded={}}loadTile(t,n){const r=t.uid,i=this.loading[r]=new ve(t,this.brightness);e.bc(t.request,((e,o)=>{const a=!this.loading[r];return delete this.loading[r],a||e?(i.status="done",a||(this.loaded[r]=i),n(e)):o&&0!==o.byteLength?void i.parse(o,this.layerIndex,t,((e,t)=>{i.status="done",this.loaded=this.loaded||{},this.loaded[r]=i,e||!t?n(e):n(null,t)})):(i.status="done",this.loaded[r]=i,n())}))}reloadTile(e,t){const n=this.loaded,r=e.uid;if(n&&n[r]){const i=n[r];i.projection=e.projection,i.brightness=e.brightness;const o=(n,r)=>{i.reloadCallback&&(delete i.reloadCallback,this.loadTile(e,t)),t(n,r)};"parsing"===i.status?i.reloadCallback=o:"done"===i.status&&this.loadTile(e,t)}}abortTile(e,t){const n=e.uid;this.loading[n]&&delete this.loading[n],t()}removeTile(e,t){const n=this.loaded,r=e.uid;n&&n[r]&&delete n[r],t()}}class be{constructor(t){this.self=t,this.actor=new e.e3(t,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=e.bL({name:"mercator"}),this.workerSourceTypes={vector:c,geojson:ye,"batched-model":xe},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=t=>{if(e.e4.isParsed())throw new Error("RTL text plugin already registered.");e.e4.applyArabicShaping=t.applyArabicShaping,e.e4.processBidirectionalText=t.processBidirectionalText,e.e4.processStyledBidirectionalText=t.processStyledBidirectionalText}}clearCaches(e,t,n){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],delete this.rasterArrayWorkerSource,n()}checkIfReady(e,t,n){n()}setReferrer(e,t){this.referrer=t}spriteLoaded(t,n){let{scope:r,isLoaded:i}=n;if(this.isSpriteLoaded[t]||(this.isSpriteLoaded[t]={}),this.isSpriteLoaded[t][r]=i,this.workerSources[t]&&this.workerSources[t][r])for(const o in this.workerSources[t][r]){const n=this.workerSources[t][r][o];for(const t in n){const r=n[t];r instanceof c&&(r.isSpriteLoaded=i,r.fire(new e.x("isSpriteLoaded")))}}}setImages(e,t,n){let{scope:r,images:i}=t;if(this.availableImages[e]||(this.availableImages[e]={}),this.availableImages[e][r]=i,this.workerSources[e]&&this.workerSources[e][r]){for(const t in this.workerSources[e][r]){const n=this.workerSources[e][r][t];for(const e in n)n[e].availableImages=i}n()}else n()}setProjection(t,n){this.projections[t]=e.bL(n)}setBrightness(e,t,n){this.brightness=t,n()}setLayers(e,t,n){this.getLayerIndex(e,t.scope).replace(t.layers,t.options),n()}updateLayers(e,t,n){this.getLayerIndex(e,t.scope).update(t.layers,t.removedIds,t.options),n()}loadTile(e,t,n){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).loadTile(t,n)}loadDEMTile(e,t,n){this.getDEMWorkerSource(e,t.source,t.scope).loadTile(t,n)}decodeRasterArray(e,t,n){this.getRasterArrayWorkerSource().decodeRasterArray(t,n)}reloadTile(e,t,n){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).reloadTile(t,n)}abortTile(e,t,n){this.getWorkerSource(e,t.type,t.source,t.scope).abortTile(t,n)}removeTile(e,t,n){this.getWorkerSource(e,t.type,t.source,t.scope).removeTile(t,n)}removeSource(e,t,n){if(!(this.workerSources[e]&&this.workerSources[e][t.scope]&&this.workerSources[e][t.scope][t.type]&&this.workerSources[e][t.scope][t.type][t.source]))return;const r=this.workerSources[e][t.scope][t.type][t.source];delete this.workerSources[e][t.scope][t.type][t.source],void 0!==r.removeSource?r.removeSource(t,n):n()}loadWorkerSource(e,t,n){try{this.self.importScripts(t.url),n()}catch(e){n(e.toString())}}syncRTLPluginState(t,n,r){try{e.e4.setState(n);const t=e.e4.getPluginURL();if(e.e4.isLoaded()&&!e.e4.isParsed()&&null!=t){this.self.importScripts(t);const n=e.e4.isParsed();r(n?void 0:new Error(`RTL Text Plugin failed to import scripts from ${t}`),n)}}catch(e){r(e.toString())}}setDracoUrl(e,t){this.dracoUrl=t}getAvailableImages(e,t){this.availableImages[e]||(this.availableImages[e]={});let n=this.availableImages[e][t];return n||(n=[]),n}getLayerIndex(e,t){this.layerIndexes[e]||(this.layerIndexes[e]={});let n=this.layerIndexes[e][t];return n||(n=this.layerIndexes[e][t]=new i,n.scope=t),n}getWorkerSource(e,t,n,r){return this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][r]||(this.workerSources[e][r]={}),this.workerSources[e][r][t]||(this.workerSources[e][r][t]={}),this.isSpriteLoaded[e]||(this.isSpriteLoaded[e]={}),this.workerSources[e][r][t][n]||(this.workerSources[e][r][t][n]=new this.workerSourceTypes[t]({send:(t,n,r,i,o,a)=>{this.actor.send(t,n,r,e,o,a)},scheduler:this.actor.scheduler},this.getLayerIndex(e,r),this.getAvailableImages(e,r),this.isSpriteLoaded[e][r],void 0,this.brightness)),this.workerSources[e][r][t][n]}getDEMWorkerSource(e,t,n){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][n]||(this.demWorkerSources[e][n]={}),this.demWorkerSources[e][n][t]||(this.demWorkerSources[e][n][t]=new u),this.demWorkerSources[e][n][t]}getRasterArrayWorkerSource(){return this.rasterArrayWorkerSource||(this.rasterArrayWorkerSource=new h),this.rasterArrayWorkerSource}enforceCacheSizeLimit(t,n){e.e5(n)}getWorkerPerformanceMetrics(e,t,n){n(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new be(self)),be})),r(["./shared"],(function(e){var t="3.7.0";const n={create:"create",load:"load",fullLoad:"fullLoad"},r={mark(e){performance.mark(e)},measure(e,t,n){performance.measure(e,t,n)}};function i(t){const n=t.name.split("?")[0];return e.a(n)&&n.includes("mapbox-gl.js")?"javascript":e.a(n)&&n.includes("mapbox-gl.css")?"css":e.b(n)?"fontRange":e.c(n)?"sprite":e.i(n)?"style":e.d(n)?"tilejson":"other"}var o,a={},s=function(){if(o)return a;function e(e){return!t(e)}function t(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,n=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(n);try{t=new Worker(r),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(r),e}()?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var n=t.getImageData(0,0,1,1);return n&&n.width===e.width}()?(void 0===n[r=t&&t.failIfMajorPerformanceCaveat]&&(n[r]=function(t){var n,r=function(t){var n=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,n.getContext("webgl2",r)}(t);if(!r)return!1;try{n=r.createShader(r.VERTEX_SHADER)}catch(e){return!1}return!(!n||r.isContextLost())&&(r.shaderSource(n,"void main() {}"),r.compileShader(n),!0===r.getShaderParameter(n,r.COMPILE_STATUS))}(r)),n[r]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var r}o=1,a.supported=e,a.notSupportedReason=t;var n={};return e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0},a}();function l(e,t,n){const r=document.createElement(e);return null!=t&&(r.className=t),n&&n.appendChild(r),r}function c(e,t,n){const r=document.createElementNS("http://www.w3.org/2000/svg",e);for(const i of Object.keys(t))r.setAttributeNS(null,i,String(t[i]));return n&&n.appendChild(r),r}const u="undefined"!=typeof document?document.documentElement&&document.documentElement.style:null,h=u&&void 0!==u.userSelect?"userSelect":"WebkitUserSelect";let d;function f(){u&&h&&(d=u[h],u[h]="none")}function p(){u&&h&&(u[h]=d)}function m(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",m,!0)}function g(){window.addEventListener("click",m,!0),window.setTimeout((()=>{window.removeEventListener("click",m,!0)}),0)}function _(e,t){const n=e.getBoundingClientRect();return x(e,n,t)}function y(e,t){const n=e.getBoundingClientRect(),r=[];for(let i=0;i=0?0:e.button}function x(t,n,r){const i=t.offsetWidth===n.width?1:t.offsetWidth/n.width;return new e.P((r.clientX-n.left)*i,(r.clientY-n.top)*i)}const b="01",w="NO_ACCESS_TOKEN";class S{constructor(e,t,n){this._transformRequestFn=e,this._customAccessToken=t,this._silenceAuthErrors=!!n,this._createSkuToken()}_createSkuToken(){const e=function(){let e="";for(let t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",b,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}normalizeStyleURL(n,r){if(!e.f(n))return n;const i=A(n);return i.params.push(`sdk=js-${t}`),i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||r)}normalizeGlyphsURL(t,n){if(!e.f(t))return t;const r=A(t);return r.path=`/fonts/v1${r.path}`,this._makeAPIURL(r,this._customAccessToken||n)}normalizeModelURL(t,n){if(!e.f(t))return t;const r=A(t);return r.path=`/models/v1${r.path}`,this._makeAPIURL(r,this._customAccessToken||n)}normalizeSourceURL(t,n,r,i){if(!e.f(t))return t;const o=A(t);return o.path=`/v4/${o.authority}.json`,o.params.push("secure"),r&&o.params.push(`language=${r}`),i&&o.params.push(`worldview=${i}`),this._makeAPIURL(o,this._customAccessToken||n)}normalizeSpriteURL(t,n,r,i){const o=A(t);return e.f(t)?(o.path=`/styles/v1${o.path}/sprite${n}${r}`,this._makeAPIURL(o,this._customAccessToken||i)):(o.path+=`${n}${r}`,E(o))}normalizeTileURL(t,n,r){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!e.f(t))return t;const i=A(t);i.path=i.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${n||r&&"raster"!==i.authority&&512===r?"@2x":""}${e.m.supported?".webp":"$1"}`),"raster"===i.authority?i.path=`/${e.e.RASTER_URL_PREFIX}${i.path}`:"rasterarrays"===i.authority?i.path=`/${e.e.RASTERARRAYS_URL_PREFIX}${i.path}`:"3dtiles"===i.authority?i.path=`/${e.e.TILES3D_URL_PREFIX}${i.path}`:(i.path=i.path.replace(/^.+\/v4\//,"/"),i.path=`/${e.e.TILE_URL_VERSION}${i.path}`);const o=this._customAccessToken||function(e){for(const t of e){const e=t.match(/^access_token=(.*)$/);if(e)return e[1]}return null}(i.params)||e.e.ACCESS_TOKEN;return e.e.REQUIRE_ACCESS_TOKEN&&o&&this._skuToken&&i.params.push(`sku=${this._skuToken}`),this._makeAPIURL(i,o)}canonicalizeTileURL(t,n){const r=A(t);if(!r.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!r.path.match(/\.[\w]+$/))return t;let i="mapbox://";r.path.match(/^\/raster\/v1\//)?i+=`raster/${r.path.replace(`/${e.e.RASTER_URL_PREFIX}/`,"")}`:r.path.match(/^\/rasterarrays\/v1\//)?i+=`rasterarrays/${r.path.replace(`/${e.e.RASTERARRAYS_URL_PREFIX}/`,"")}`:i+=`tiles/${r.path.replace(`/${e.e.TILE_URL_VERSION}/`,"")}`;let o=r.params;return n&&(o=o.filter((e=>!e.match(/^access_token=/)))),o.length&&(i+=`?${o.join("&")}`),i}canonicalizeTileset(t,n){const r=!!n&&e.f(n),i=[];for(const o of t.tiles||[])e.h(o)?i.push(this.canonicalizeTileURL(o,r)):i.push(o);return i}_makeAPIURL(t,n){const r="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",i=A(e.e.API_URL);if(t.protocol=i.protocol,t.authority=i.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==i.path&&(t.path=`${i.path}${t.path}`),!e.e.REQUIRE_ACCESS_TOKEN)return E(t);if(n=n||e.e.ACCESS_TOKEN,!this._silenceAuthErrors){if(!n)throw new Error(`An API access token is required to use Mapbox GL. ${r}`);if("s"===n[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${r}`)}return t.params=t.params.filter((e=>-1===e.indexOf("access_token"))),t.params.push(`access_token=${n||""}`),E(t)}}const M=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function A(e){const t=e.match(M);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function E(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const T="mapbox.eventData";function C(t){if(!t)return null;const n=t.split(".");if(!n||3!==n.length)return null;try{return JSON.parse(e.j(n[1]))}catch(e){return null}}class k{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const n=C(e.e.ACCESS_TOKEN);let r="";return r=n&&n.u?e.k(n.u):e.e.ACCESS_TOKEN||"",t?`${T}.${t}:${r}`:`${T}:${r}`}fetchEventData(){const t=e.s("localStorage"),n=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{const e=localStorage.getItem(n);e&&(this.eventData=JSON.parse(e));const t=localStorage.getItem(r);t&&(this.anonId=t)}catch(t){e.w("Unable to read from LocalStorage")}}saveEventData(){const t=e.s("localStorage"),n=this.getStorageKey(),r=this.getStorageKey("uuid"),i=this.anonId;if(t&&i)try{localStorage.setItem(r,i),Object.keys(this.eventData).length>=1&&localStorage.setItem(n,JSON.stringify(this.eventData))}catch(t){e.w("Unable to write to LocalStorage")}}processRequests(e){}postEvent(t,n,r,i){if(!e.e.EVENTS_URL)return;const o=A(e.e.EVENTS_URL);o.params.push(`access_token=${i||e.e.ACCESS_TOKEN||""}`);const a={event:this.type,created:new Date(t).toISOString()},s=n?e.l(a,n):a,l={url:E(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=e.p(l,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(i)}))}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}const I=new class extends k{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(t,n){e.e.EVENTS_URL&&e.e.ACCESS_TOKEN&&Array.isArray(t)&&t.some((t=>e.f(t)||e.h(t)))&&this.queueRequest(Date.now(),n)}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const r=C(e.e.ACCESS_TOKEN),i=r?r.u:e.e.ACCESS_TOKEN;let o=i!==this.eventData.tokenU;e.v(this.anonId)||(this.anonId=e.u(),o=!0);const a=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(a),n=(a-this.eventData.lastSuccess)/864e5;o=o||n>=1||n<-1||e.getDate()!==t.getDate()}else o=!0;o?this.postEvent(a,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:b,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=a,this.eventData.tokenU=i)}),n):this.processRequests()}},P=I.postTurnstileEvent.bind(I),R=new class extends k{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,n,r,i){this.skuToken=n,this.errorCb=i,e.e.EVENTS_URL&&(r||e.e.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},r):this.errorCb(new Error(w)))}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;const{id:r,timestamp:i}=this.queue.shift();r&&this.success[r]||(this.anonId||this.fetchEventData(),e.v(this.anonId)||(this.anonId=e.u()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:b,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):r&&(this.success[r]=!0)}),n))}remove(){this.errorCb=null}},L=R.postMapLoadEvent.bind(R),z=new class extends k{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(t){let n=this.mapInstanceIdMap.get(t);return n||(n=e.u(),this.mapInstanceIdMap.set(t,n)),n}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(t,n){const{map:r,style:i,importedStyles:o}=n;if(!e.e.EVENTS_URL||!t&&!e.e.ACCESS_TOKEN)return;const a=this.getMapInstanceId(r),s={mapInstanceId:a,eventId:this.getEventId(a),style:i};o.length&&(s.importedStyles=o),this.queueRequest({timestamp:Date.now(),payload:s},t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:n}=this.queue.shift();this.postEvent(t,n,(()=>{}),e)}},D=z.postStyleLoadEvent.bind(z),O=new class extends k{constructor(){super("gljs.performance")}postPerformanceEvent(t,n){e.e.EVENTS_URL&&(t||e.e.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:n},t)}processRequests(r){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:o,performanceData:a}=this.queue.shift(),s=function(r){const o=performance.getEntriesByType("resource"),a=performance.getEntriesByType("mark"),s=function(e){const t={};if(e)for(const n in e)if("other"!==n)for(const r of e[n]){const e=`${n}ResolveRangeMin`,i=`${n}ResolveRangeMax`,o=`${n}RequestCount`,a=`${n}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,r.startTime),t[i]=Math.max(t[i]||-1/0,r.responseEnd);const s=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==r.transferSize&&0===r.transferSize&&s(a),s(o)}return t}(function(e,t){const n={};if(e)for(const r of e){const e=t(r);void 0===n[e]&&(n[e]=[]),n[e].push(r)}return n}(o,i)),l=window.devicePixelRatio,c=navigator.connection||navigator.mozConnection||navigator.webkitConnection,u=c?c.effectiveType:void 0,h={counters:[],metadata:[],attributes:[]},d=(e,t,n)=>{null!=n&&e.push({name:t,value:n.toString()})};for(const e in s)d(h.counters,e,s[e]);if(r.interactionRange[0]!==1/0&&r.interactionRange[1]!==-1/0&&(d(h.counters,"interactionRangeMin",r.interactionRange[0]),d(h.counters,"interactionRangeMax",r.interactionRange[1])),a)for(const e of Object.keys(n)){const t=n[e],r=a.find((e=>e.name===t));r&&d(h.counters,t,r.startTime)}return d(h.counters,"visibilityHidden",r.visibilityHidden),d(h.attributes,"style",function(t){if(t)for(const n of t){const t=n.name.split("?")[0];if(e.i(t)){const e=t.split("/").slice(-2);if(2===e.length)return`mapbox://styles/${e[0]}/${e[1]}`}}}(o)),d(h.attributes,"terrainEnabled",r.terrainEnabled?"true":"false"),d(h.attributes,"fogEnabled",r.fogEnabled?"true":"false"),d(h.attributes,"projection",r.projection),d(h.attributes,"zoom",r.zoom),d(h.metadata,"devicePixelRatio",l),d(h.metadata,"connectionEffectiveType",u),d(h.metadata,"navigatorUserAgent",navigator.userAgent),d(h.metadata,"screenWidth",window.screen.width),d(h.metadata,"screenHeight",window.screen.height),d(h.metadata,"windowWidth",window.innerWidth),d(h.metadata,"windowHeight",window.innerHeight),d(h.metadata,"mapWidth",r.width/l),d(h.metadata,"mapHeight",r.height/l),d(h.metadata,"webglRenderer",r.renderer),d(h.metadata,"webglVendor",r.vendor),d(h.metadata,"sdkVersion",t),d(h.metadata,"sdkIdentifier","mapbox-gl-js"),h}(a);for(const e of s.metadata);for(const e of s.counters);for(const e of s.attributes);this.postEvent(o,s,(()=>{}),r)}},F=O.postPerformanceEvent.bind(O),B=new class extends k{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,n,r,i){if(!e.e.API_URL||!e.e.SESSION_PATH)return;const o=A(e.e.API_URL+e.e.SESSION_PATH);o.params.push(`sku=${n||""}`),o.params.push(`access_token=${i||e.e.ACCESS_TOKEN||""}`);const a={url:E(o),headers:{"Content-Type":"text/plain"}};this.pendingRequest=e.g(a,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(i)}))}getSessionAPI(t,n,r,i){this.skuToken=n,this.errorCb=i,e.e.SESSION_PATH&&e.e.API_URL&&(r||e.e.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},r):this.errorCb(new Error(w)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:n}=this.queue.shift();t&&this.success[t]||this.getSession(n,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e)}remove(){this.errorCb=null}},N=B.getSessionAPI.bind(B),j=new Set;function V(e,t){t?j.add(e):j.delete(e)}class U{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages=new Set}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(e,t){this._updatedSourceCaches[e]=t,this.setDirty()}discardSourceCacheUpdate(e){delete this._updatedSourceCaches[e]}updateLayer(e){const t=e.scope;this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._updatedLayers[t].add(e.id),this.setDirty()}removeLayer(e){const t=e.scope;this._removedLayers[t]=this._removedLayers[t]||{},this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._removedLayers[t][e.id]=e,this._updatedLayers[t].delete(e.id),this._updatedPaintProps.delete(e.fqid),this.setDirty()}getRemovedLayer(e){return this._removedLayers[e.scope]?this._removedLayers[e.scope][e.id]:null}discardLayerRemoval(e){this._removedLayers[e.scope]&&delete this._removedLayers[e.scope][e.id]}getLayerUpdatesByScope(){const e={};for(const t in this._updatedLayers)e[t]=e[t]||{},e[t].updatedIds=Array.from(this._updatedLayers[t].values());for(const t in this._removedLayers)e[t]=e[t]||{},e[t].removedIds=Object.keys(this._removedLayers[t]);return e}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(e){this._updatedPaintProps.add(e.fqid),this.setDirty()}getUpdatedImages(){return Array.from(this._updatedImages.values())}updateImage(e){this._updatedImages.add(e),this.setDirty()}resetUpdatedImages(){this._updatedImages.clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages.clear()}}function $(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class G extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded={},this.requestors=[],this.patterns={},this.atlasImage={},this.atlasTexture={},this.dirty=!0}createScope(t){this.images[t]={},this.loaded[t]=!1,this.updatedImages[t]={},this.patterns[t]={},this.callbackDispatchedThisFrame[t]={},this.atlasImage[t]=new e.r({width:1,height:1})}isLoaded(){for(const e in this.loaded)if(!this.loaded[e])return!1;return!0}setLoaded(e,t){if(this.loaded[t]!==e&&(this.loaded[t]=e,e)){for(const{ids:e,callback:n}of this.requestors)this._notify(e,t,n);this.requestors=[]}}hasImage(e,t){return!!this.getImage(e,t)}getImage(e,t){return this.images[t][e]}addImage(e,t,n){this._validate(e,n)&&(this.images[t][e]=n)}_validate(t,n){let r=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new e.t(new Error(`Image "${t}" has invalid "stretchX" value`))),r=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new e.t(new Error(`Image "${t}" has invalid "stretchY" value`))),r=!1),this._validateContent(n.content,n)||(this.fire(new e.t(new Error(`Image "${t}" has invalid "content" value`))),r=!1),r}_validateStretch(e,t){if(!e)return!0;let n=0;for(const r of e){if(r[0]1?o-1:o,e.r.copy(u,a,{x:0,y:0},{x:l,y:c},{width:h,height:d},n),e.r.copy(u,a,{x:0,y:d-o},{x:l,y:c-o},{width:h,height:o},n),e.r.copy(u,a,{x:0,y:0},{x:l,y:c+d},{width:h,height:o},n),e.r.copy(u,a,{x:h-o,y:0},{x:l-o,y:c},{width:o,height:d},n),e.r.copy(u,a,{x:0,y:0},{x:l+h,y:c},{width:o,height:d},n),e.r.copy(u,a,{x:h-o,y:d-o},{x:l-o,y:c-o},{width:o,height:o},n),e.r.copy(u,a,{x:0,y:d-o},{x:l+h,y:c-o},{width:o,height:o},n),e.r.copy(u,a,{x:0,y:0},{x:l+h,y:c+d},{width:o,height:o},n),e.r.copy(u,a,{x:h-o,y:0},{x:l-o,y:c+d},{width:o,height:o},n)}this.dirty=!0}beginFrame(){for(const e in this.images)this.callbackDispatchedThisFrame[e]={}}dispatchRenderCallbacks(e,t){for(const n of e){if(this.callbackDispatchedThisFrame[t][n])continue;this.callbackDispatchedThisFrame[t][n]=!0;const e=this.images[t][n];$(e)&&this.updateImage(n,t,e)}}}function q(t){const n=t.key,r=t.value,i=t.valueSpec||{},o=t.objectElementValidators||{},a=t.style,s=t.styleSpec;let l=[];const c=e.B(r);if("object"!==c)return[new e.V(n,r,`object expected, ${c} found`)];for(const u in r){const t=u.split(".")[0];let c;o[t]?c=o[t]:i[t]?c=fe:o["*"]?c=o["*"]:i["*"]&&(c=fe),c?l=l.concat(c({key:(n?`${n}.`:n)+u,value:r[u],valueSpec:i[t]||i["*"],style:a,styleSpec:s,object:r,objectKey:u},r)):l.push(new e.A(n,r[u],`unknown property "${u}"`))}for(const u in i)o[u]||i[u].required&&void 0===i[u].default&&void 0===r[u]&&l.push(new e.V(n,r,`missing required property "${u}"`));return l}function W(t){const n=t.value,r=t.valueSpec,i=t.style,o=t.styleSpec,a=t.key,s=t.arrayElementValidator||fe;if("array"!==e.B(n))return[new e.V(a,n,`array expected, ${e.B(n)} found`)];if(r.length&&n.length!==r.length)return[new e.V(a,n,`array length ${r.length} expected, length ${n.length} found`)];if(r["min-length"]&&n.lengtho)return[new e.V(n,r,`${r} is greater than the maximum value ${o}`)]}return[]}function Z(t){const n=t.valueSpec,r=e.D(t.value.type);let i,o,a,s={};const l="categorical"!==r&&void 0===t.value.property,c=!l,u="array"===e.B(t.value.stops)&&"array"===e.B(t.value.stops[0])&&"object"===e.B(t.value.stops[0][0]),h=q({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===r)return[new e.V(t.key,t.value,'identity function may not have a "stops" property')];let n=[];const i=t.value;return n=n.concat(W({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:d})),"array"===e.B(i)&&0===i.length&&n.push(new e.V(t.key,i,"array must have at least one stop")),n},default:function(e){return fe({key:e.key,value:e.value,valueSpec:n,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&l&&h.push(new e.V(t.key,t.value,'missing required property "property"')),"identity"===r||t.value.stops||h.push(new e.V(t.key,t.value,'missing required property "stops"')),"exponential"===r&&t.valueSpec.expression&&!e.F(t.valueSpec)&&h.push(new e.V(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(c&&!e.G(t.valueSpec)?h.push(new e.V(t.key,t.value,"property functions not supported")):l&&!e.H(t.valueSpec)&&h.push(new e.V(t.key,t.value,"zoom functions not supported"))),"categorical"!==r&&!u||void 0!==t.value.property||h.push(new e.V(t.key,t.value,'"property" property is required')),h;function d(t){let r=[];const i=t.value,l=t.key;if("array"!==e.B(i))return[new e.V(l,i,`array expected, ${e.B(i)} found`)];if(2!==i.length)return[new e.V(l,i,`array length 2 expected, length ${i.length} found`)];if(u){if("object"!==e.B(i[0]))return[new e.V(l,i,`object expected, ${e.B(i[0])} found`)];if(void 0===i[0].zoom)return[new e.V(l,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new e.V(l,i,"object stop key must have value")];const n=e.D(i[0].zoom);if("number"!=typeof n)return[new e.V(l,i[0].zoom,"stop zoom values must be numbers")];if(a&&a>n)return[new e.V(l,i[0].zoom,"stop zoom values must appear in ascending order")];n!==a&&(a=n,o=void 0,s={}),r=r.concat(q({key:`${l}[0]`,value:i[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:H,value:f}}))}else r=r.concat(f({key:`${l}[0]`,value:i[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},i));return e.J(e.K(i[1]))?r.concat([new e.V(`${l}[1]`,i[1],"expressions are not allowed in function stops.")]):r.concat(fe({key:`${l}[1]`,value:i[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function f(t,a){const l=e.B(t.value),c=e.D(t.value),u=null!==t.value?t.value:a;if(i){if(l!==i)return[new e.V(t.key,u,`${l} stop domain type must match previous stop domain type ${i}`)]}else i=l;if("number"!==l&&"string"!==l&&"boolean"!==l&&"number"!=typeof c&&"string"!=typeof c&&"boolean"!=typeof c)return[new e.V(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==l&&"categorical"!==r){let i=`number expected, ${l} found`;return e.G(n)&&void 0===r&&(i+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new e.V(t.key,u,i)]}return"categorical"!==r||"number"!==l||"number"==typeof c&&isFinite(c)&&Math.floor(c)===c?"categorical"!==r&&"number"===l&&"number"==typeof c&&"number"==typeof o&&void 0!==o&&cnew e.V(`${t.key}${n.key}`,t.value,n.message)));const r=n.value.expression||n.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new e.V(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!e.N(r))return[new e.V(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext)return X(r,t);if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!e.O(r,["zoom","feature-state"]))return[new e.V(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!e.Q(r))return[new e.V(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function X(t,n){const r=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(n.valueSpec&&n.valueSpec.expression)for(const e of n.valueSpec.expression.parameters)r.delete(e);if(0===r.size)return[];const i=[];return t instanceof e.S&&r.has(t.name)?[new e.V(n.key,n.value,`["${t.name}"] expression is not supported in a filter for a ${n.object.type} layer with id: ${n.object.id}`)]:(t.eachChild((e=>{i.push(...X(e,n))})),i)}function K(t){const n=t.key,r=t.value,i=t.valueSpec,o=[];return Array.isArray(i.values)?-1===i.values.indexOf(e.D(r))&&o.push(new e.V(n,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(i.values).indexOf(e.D(r))&&o.push(new e.V(n,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),o}function J(t){return e.W(e.K(t.value))?Y(e.C({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):Q(t)}function Q(t){const n=t.value,r=t.key;if("array"!==e.B(n))return[new e.V(r,n,`array expected, ${e.B(n)} found`)];const i=t.styleSpec;let o,a=[];if(n.length<1)return[new e.V(r,n,"filter array must have at least 1 element")];switch(a=a.concat(K({key:`${r}[0]`,value:n[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),e.D(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===e.D(n[1])&&a.push(new e.V(r,n,`"$type" cannot be use with operator "${n[0]}"`));case"==":case"!=":3!==n.length&&a.push(new e.V(r,n,`filter array for operator "${n[0]}" must have 3 elements`));case"in":case"!in":n.length>=2&&(o=e.B(n[1]),"string"!==o&&a.push(new e.V(`${r}[1]`,n[1],`string expected, ${o} found`)));for(let s=2;s{t in r&&n.push(new e.V(i,r[t],`"${t}" is prohibited for ref layers`))})),o.layers.forEach((n=>{e.D(n.id)===l&&(t=n)})),t?t.ref?n.push(new e.V(i,r.ref,"ref cannot reference another ref layer")):s=e.D(t.type):"string"==typeof l&&n.push(new e.V(i,r.ref,`ref layer "${l}" not found`))}else if("background"!==s&&"sky"!==s&&"slot"!==s)if(r.source){const t=o.sources&&o.sources[r.source],a=t&&e.D(t.type);t?"vector"===a&&"raster"===s?n.push(new e.V(i,r.source,`layer "${r.id}" requires a raster source`)):"raster"===a&&"raster"!==s?n.push(new e.V(i,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==s?n.push(new e.V(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"raster-array"!==a||["raster","raster-particle"].includes(s)?"line"!==s||!r.paint||!r.paint["line-gradient"]&&!r.paint["line-trim-offset"]||"geojson"===a&&t.lineMetrics?"raster-particle"===s&&"raster-array"!==a&&n.push(new e.V(i,r.source,`layer "${r.id}" requires a 'raster-array' source.`)):n.push(new e.V(i,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):n.push(new e.V(i,r.source,"raster-array source can only be used with layer type 'raster'.")):n.push(new e.V(i,r,`layer "${r.id}" must specify a "source-layer"`)):n.push(new e.V(i,r.source,`source "${r.source}" not found`))}else n.push(new e.V(i,r,'missing required property "source"'));return n=n.concat(q({key:i,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>fe({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"}),filter:t=>J(e.C({layerType:s},t)),layout:t=>q({layer:r,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>ne(e.C({layerType:s},t))}}),paint:t=>q({layer:r,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>te(e.C({layerType:s,layer:r},t))}})}})),n}function ie(t){const n=t.value,r=t.key,i=e.B(n);return"string"!==i?[new e.V(r,n,`string expected, ${i} found`)]:[]}const oe={promoteId:function(t){let{key:n,value:r}=t;if("string"===e.B(r))return ie({key:n,value:r});{const e=[];for(const t in r)e.push(...ie({key:`${n}.${t}`,value:r[t]}));return e}}};function ae(t){const n=t.value,r=t.key,i=t.styleSpec,o=t.style;if(!n.type)return[new e.V(r,n,'"type" is required')];const a=e.D(n.type);let s=[];switch(["vector","raster","raster-dem","raster-array"].includes(a)&&(n.url||n.tiles||s.push(new e.A(r,n,'Either "url" or "tiles" is required.'))),a){case"vector":case"raster":case"raster-dem":case"raster-array":return s=s.concat(q({key:r,value:n,valueSpec:i[`source_${a.replace("-","_")}`],style:t.style,styleSpec:i,objectElementValidators:oe})),s;case"geojson":if(s=q({key:r,value:n,valueSpec:i.source_geojson,style:o,styleSpec:i,objectElementValidators:oe}),n.cluster)for(const e in n.clusterProperties){const[t,i]=n.clusterProperties[e],o="string"==typeof t?[t,["accumulated"],["get",e]]:t;s.push(...Y({key:`${r}.${e}.map`,value:i,expressionContext:"cluster-map"})),s.push(...Y({key:`${r}.${e}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return s;case"video":return q({key:r,value:n,valueSpec:i.source_video,style:o,styleSpec:i});case"image":return q({key:r,value:n,valueSpec:i.source_image,style:o,styleSpec:i});case"canvas":return[new e.V(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return K({key:`${r}.type`,value:n.type,valueSpec:{values:se(i)},style:o,styleSpec:i})}}function se(e){return e.source.reduce(((t,n)=>{const r=e[n];return"enum"===r.type.type&&(t=t.concat(Object.keys(r.type.values))),t}),[])}function le(t){const n=t.value,r=t.styleSpec,i=r.light,o=t.style;let a=[];const s=e.B(n);if(void 0===n)return a;if("object"!==s)return a=a.concat([new e.V("light",n,`object expected, ${s} found`)]),a;for(const l in n){const t=l.match(/^(.*)-transition$/);a=a.concat(t&&i[t[1]]&&i[t[1]].transition?fe({key:l,value:n[l],valueSpec:r.transition,style:o,styleSpec:r}):i[l]?fe({key:l,value:n[l],valueSpec:i[l],style:o,styleSpec:r}):[new e.V(l,n[l],`unknown property "${l}"`)])}return a}function ce(t){const n=t.value;let r=[];if(!n)return r;const i=e.B(n);if("object"!==i)return r=r.concat([new e.V("light-3d",n,`object expected, ${i} found`)]),r;const o=t.styleSpec,a=o["light-3d"],s=t.key,l=t.style,c=t.style.lights;for(const d of["type","id"])if(!(d in n))return r=r.concat([new e.V("light-3d",n,`missing property ${d} on light`)]),r;if(n.type&&c)for(let d=0;d[],array:W,boolean:function(t){const n=t.value,r=t.key,i=e.B(n);return"boolean"!==i?[new e.V(r,n,`boolean expected, ${i} found`)]:[]},number:H,color:function(t){const n=t.key,r=t.value,i=e.B(r);return"string"!==i?[new e.V(n,r,`color expected, ${i} found`)]:null===e.U.parseCSSColor(r)?[new e.V(n,r,`color expected, "${r}" found`)]:[]},enum:K,filter:J,function:Z,layer:re,object:q,source:ae,model:e.Z,light:le,"light-3d":ce,terrain:ue,fog:he,string:ie,formatted:function(e){return 0===ie(e).length?[]:Y(e)},resolvedImage:function(e){return 0===ie(e).length?[]:Y(e)},projection:function(t){const n=t.value,r=t.styleSpec,i=r.projection,o=t.style;let a=[];const s=e.B(n);if("object"===s)for(const e in n)a=a.concat(fe({key:e,value:n[e],valueSpec:i[e],style:o,styleSpec:r}));else"string"!==s&&(a=a.concat([new e.V("projection",n,`object or string expected, ${s} found`)]));return a},import:function(t){const{value:n,styleSpec:r}=t,{data:i,...o}=n;Object.defineProperty(o,"__line__",{value:n.__line__,enumerable:!1});let a=q(e.C({},t,{value:o,valueSpec:r.import}));return""===e.D(o.id)&&a.push(new e.V(`${t.key}.id`,o,"import id can't be an empty string")),i&&(a=a.concat(me(i,r,{key:`${t.key}.data`}))),a}};function fe(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=t.value,i=t.valueSpec,o=t.styleSpec;if(i.expression&&e.X(e.D(r)))return Z(t);if(i.expression&&e.J(e.K(r)))return Y(t);if(i.type&&de[i.type]){const r=de[i.type](t);return!0===n&&r.length>0&&"array"===e.B(t.value)?Y(t):r}return q(e.C({},t,{valueSpec:i.type?o[i.type]:i}))}function pe(t){const n=t.value,r=t.key,i=ie(t);return i.length||(-1===n.indexOf("{fontstack}")&&i.push(new e.V(r,n,'"glyphs" url must include a "{fontstack}" token')),-1===n.indexOf("{range}")&&i.push(new e.V(r,n,'"glyphs" url must include a "{range}" token'))),i}function me(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e._;return fe({key:(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).key||"",value:t,valueSpec:n.$root,styleSpec:n,style:t,objectElementValidators:{glyphs:pe,"*":()=>[]}})}function ge(t){return Te(me(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:e._))}const _e=e=>Te(ae(e)),ye=e=>Te(le(e)),ve=e=>Te(ce(e)),xe=e=>Te(ue(e)),be=e=>Te(he(e)),we=e=>Te(re(e)),Se=e=>Te(J(e)),Me=e=>Te(te(e)),Ae=e=>Te(ne(e)),Ee=t=>Te(e.Z(t));function Te(e){return e.slice().sort(((e,t)=>e.line&&t.line?e.line-t.line:0))}function Ce(t,n){let r=!1;if(n&&n.length)for(const i of n)i instanceof e.A?e.w(i.message):(t.fire(new e.t(new Error(i.message))),r=!0);return r}let ke;class Ie extends e.E{constructor(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flat";super(),this._transitionable=new e.$(ke||(ke=new e.a0({anchor:new e.a1(e._.light.anchor),position:new e.a2(e._.light.position),color:new e.a1(e._.light.color),intensity:new e.a1(e._.light.intensity)}))),this.setLight(t,n),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._validate(ye,e,n)||(this._transitionable.setTransitionOrValue(e),this.id=t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,n,r){return(!r||!1!==r.validate)&&Ce(this,t.call(ge,e.l({value:n,style:{glyphs:!0,sprite:!0},styleSpec:e._})))}}const Pe=new e.a0({source:new e.a1(e._.terrain.source),exaggeration:new e.a1(e._.terrain.exaggeration)});let Re=class extends e.E{constructor(t,n,r,i){super(),this.scope=r,this._transitionable=new e.$(Pe,r,i),this._transitionable.setTransitionOrValue(t,i),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=n}get(){return this._transitionable.serialize()}set(e,t){this._transitionable.setTransitionOrValue(e,t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}getExaggeration(t){return this._transitioning.possiblyEvaluate(new e.a3(t)).get("exaggeration")}isZoomDependent(){const t=this._transitionable._values.exaggeration;return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof e.a4}};const Le=45,ze=65,De=.05;function Oe(t,n,r,i){const o=e.a7(Le,ze,r),[a,s]=Fe(t,i);let l=1-Math.min(1,Math.exp((n-a)/(s-a)*-6));return l*=l*l,l=Math.min(1,1.00747*l),l*o*t.alpha}function Fe(e,t){const n=.5/Math.tan(.5*t);return[e.range[0]+n,e.range[1]+n]}function Be(t,n,r,i,o){const a=e.a6.vec3.transformMat4([],[n,r,i],o.mercatorFogMatrix);return Oe(t,e.a6.vec3.length(a),o.pitch,o._fov)}function Ne(t,n,r,i,o,a,s){const l=[[r,i,0],[o,i,0],[o,a,0],[r,a,0]];let c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(const h of l){const t=e.a6.vec3.transformMat4([],h,n),r=e.a6.vec3.length(t);c=Math.min(c,r),u=Math.max(u,r)}return[Oe(t,c,s.pitch,s._fov),Oe(t,u,s.pitch,s._fov)]}const je=new e.a0({range:new e.a1(e._.fog.range),color:new e.a1(e._.fog.color),"high-color":new e.a1(e._.fog["high-color"]),"space-color":new e.a1(e._.fog["space-color"]),"horizon-blend":new e.a1(e._.fog["horizon-blend"]),"star-intensity":new e.a1(e._.fog["star-intensity"]),"vertical-range":new e.a1(e._.fog["vertical-range"])});class Ve extends e.E{constructor(t,n,r,i){super(),this._transitionable=new e.$(je,r,new Map(i)),this.set(t,i),this._transitioning=this._transitionable.untransitioned(),this._transform=n,this.properties=new e.a8(je),this.scope=r}get state(){const t=this._transform,n="globe"===t.projection.name,r=e.a9(t.zoom),i=this.properties.get("range"),o=[.5,3];return{range:n?[e.aa(o[0],i[0],r),e.aa(o[1],i[1],r)]:i,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._validate(be,t,r))return;const i=e.l({},t);for(const o of Object.keys(e._.fog))void 0===i[o]&&(i[o]=e._.fog[o].default);this._options=i,this._transitionable.setTransitionOrValue(this._options,n)}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const n=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:e.a7(Le,ze,t))*n.a}getOpacityAtLatLng(t,n){return this._transform.projection.supportsFog?function(t,n,r){const i=e.a5.fromLngLat(n),o=r.elevation?r.elevation.getAtPointOrZero(i):0;return Be(t,i.x,i.y,o,r)}(this.state,t,n):0}getOpacityForTile(t){if(!this._transform.projection.supportsFog)return[1,1];const n=this._transform.calculateFogTileMatrix(t.toUnwrapped());return Ne(this.state,n,0,0,e.ab,e.ab,this._transform)}getOpacityForBounds(e,t,n,r,i){return this._transform.projection.supportsFog?Ne(this.state,e,t,n,r,i,this._transform):[1,1]}getFovAdjustedRange(e){return this._transform.projection.supportsFog?Fe(this.state,e):[0,1]}isVisibleOnFrustum(t){if(!this._transform.projection.supportsFog)return!1;const n=[4,5,6,7];for(const r of n){const n=t.points[r];let i;if(n[2]>=0)i=n;else{const o=t.points[r-4];i=e.ac(o,n,o[2]/(o[2]-n[2]))}if(Be(this.state,i[0],i[1],0,this._transform)>=De)return!0}return!1}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,n,r){return(!r||!1!==r.validate)&&Ce(this,t.call(ge,e.l({value:n,style:{glyphs:!0,sprite:!0},styleSpec:e._})))}}class Ue extends e.E{constructor(t,n,r,i){super(),this.scope=r,this._options=t,this.properties=new e.a8(n),this._transitionable=new e.$(n,r,new Map(i)),this._transitionable.setTransitionOrValue(t.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(e){this._transitionable.setTransitionOrValue(this._options.properties,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(e,t){this._options=e,this._transitionable.setTransitionOrValue(e.properties,t)}shadowsEnabled(){return!!this.properties&&!0===this.properties.get("cast-shadows")}}let $e,Ge;class qe{constructor(e,t,n,r){this.screenBounds=e,this.cameraPoint=t,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=n,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,r)}static createFromScreenPoints(t,n){let r,i;if(t instanceof e.P||"number"==typeof t[0]){const o=e.P.convert(t);r=[o],i=n.isPointAboveHorizon(o)}else{const o=e.P.convert(t[0]),a=e.P.convert(t[1]);r=[o,a],i=e.ae(o,a).every((e=>n.isPointAboveHorizon(e)))}return new qe(r,n.getCameraPoint(),i,n)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(t){return e.ae(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const n=this.screenBounds[0],r=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],i=e.ae(n,r,0,!1);return this.cameraPoint.y>r.y&&(this.cameraPoint.x>n.x&&this.cameraPoint.x=r.x?i[2]=this.cameraPoint:this.cameraPoint.x<=n.x&&(i[3]=this.cameraPoint)),e.af(i,t)}bufferedCameraGeometryGlobe(t){const n=this.screenBounds[0],r=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],i=e.ae(n,r,t),o=this.cameraPoint.clone();switch(3*((o.y>n.y)+(o.y>r.y))+((o.x>n.x)+(o.x>r.x))){case 0:i[0]=o,i[4]=o.clone();break;case 1:i.splice(1,0,o);break;case 2:i[1]=o;break;case 3:i.splice(4,0,o);break;case 5:i.splice(2,0,o);break;case 6:i[3]=o;break;case 7:i.splice(3,0,o);break;case 8:i[2]=o}return i}containsTile(t,n,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const o=t.queryPadding/n._pixelsPerMercatorPixel+1,a=r?this._bufferedCameraMercator(o,n):this._bufferedScreenMercator(o,n);let s=t.tileID.wrap+(a.unwrapped?i:0);const l=a.polygon.map((n=>e.ag(t.tileTransform,n,s)));if(!e.ah(l,0,0,e.ab,e.ab))return;s=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?i:0);const c=this.screenGeometryMercator.polygon.map((n=>e.ai(t.tileTransform,n,s))),u=c.map((t=>new e.P(t[0],t[1]))),h=n.getFreeCameraOptions().position||new e.a5(0,0,0),d=e.ai(t.tileTransform,h,s),f=c.map((t=>{const n=e.a6.vec3.sub(t,t,d);return e.a6.vec3.normalize(n,n),new e.aj(d,n)})),p=e.ak(t,1,n.zoom)*n._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:u,tilespaceRays:f,bufferedTilespaceGeometry:l,bufferedTilespaceBounds:(m=e.al(l),m.min.x=e.ap(m.min.x,0,e.ab),m.min.y=e.ap(m.min.y,0,e.ab),m.max.x=e.ap(m.max.x,0,e.ab),m.max.y=e.ap(m.max.y,0,e.ab),m),tile:t,tileID:t.tileID,pixelToTileUnitsFactor:p};var m}_bufferedScreenMercator(e,t){const n=Ze(e);if(this._screenRaycastCache[n])return this._screenRaycastCache[n];{let r;return r="globe"===t.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),t):{polygon:this.bufferedScreenGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._screenRaycastCache[n]=r,r}}_bufferedCameraMercator(e,t){const n=Ze(e);if(this._cameraRaycastCache[n])return this._cameraRaycastCache[n];{let r;return r="globe"===t.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),t):{polygon:this.bufferedCameraGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._cameraRaycastCache[n]=r,r}}_projectAndResample(t,n){const r=function(t,n){const r=e.a6.mat4.multiply([],n.pixelMatrix,n.globeMatrix),i=[0,-e.aq,0,1],o=[0,e.aq,0,1],a=[0,0,0,1];e.a6.vec4.transformMat4(i,i,r),e.a6.vec4.transformMat4(o,o,r),e.a6.vec4.transformMat4(a,a,r);const s=new e.P(i[0]/i[3],i[1]/i[3]),l=new e.P(o[0]/o[3],o[1]/o[3]),c=e.an(t,s)&&i[3]1?We(t.slice(0,d),n):[],m=dnew e.P(He(t.x),t.y))),m=m.map((t=>new e.P(He(t.x),t.y)));const g=[...p];0===g.length&&g.push(m[m.length-1]);const _=e.aa(g[g.length-1].y,(0===m.length?p[0]:m[0]).y,f);let y;return y=c?[new e.P(0,_),new e.P(0,0),new e.P(1,0),new e.P(1,_)]:[new e.P(1,_),new e.P(1,1),new e.P(0,1),new e.P(0,_)],g.push(...y),0===m.length?g.push(p[0]):g.push(...m),{polygon:g.map((t=>new e.a5(t.x,t.y))),unwrapped:!1}}(t,n);if(r)return r;const i=function(t,n){let r=!1,i=-1/0,o=0;for(let e=0;ei&&(i=t[e].x,o=e);for(let e=0;e.5&&(i.x{e.x-=1})),{polygon:t,unwrapped:r}}(We(t,n).map((t=>new e.P(He(t.x),t.y))),n);return{polygon:i.polygon.map((t=>new e.a5(t.x,t.y))),unwrapped:i.unwrapped}}}function We(t,n){return e.ao(t,(e=>{const t=n.pointCoordinate3D(e);e.x=t.x,e.y=t.y}),1/256)}function He(e){return e<0?1+e%1:e%1}function Ze(e){return 100*e|0}function Ye(t,n,r,i,o){const a=function(r,i){if(r)return o(r);if(i){if(t.url&&i.tiles&&t.tiles&&delete t.tiles,i.variants){if(!Array.isArray(i.variants))return o(new Error("variants must be an array"));for(const t of i.variants){if(null==t||"object"!=typeof t||t.constructor!==Object)return o(new Error("variant must be an object"));if(!Array.isArray(t.capabilities))return o(new Error("capabilities must be an array"));if(1===t.capabilities.length&&"meshopt"===t.capabilities[0]){i=e.l(i,t);break}}}const r=e.ar(e.l(i,t),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);i.vector_layers&&(r.vectorLayers=i.vector_layers,r.vectorLayerIds=r.vectorLayers.map((e=>e.id))),i.raster_layers&&(r.rasterLayers=i.raster_layers,r.rasterLayerIds=r.rasterLayers.map((e=>e.id))),r.tiles=n.canonicalizeTileset(r,t.url),o(null,r)}},s=function(e,t,n){if(!e)return null;if(!t&&!n)return e;n=n||e.worldview_default;const r=Object.values(e.language||{});if(0===r.length)return null;const i=Object.values(e.worldview||{});if(0===i.length)return null;const o=r.every((e=>e===t)),a=i.every((e=>e===n));return o&&a?e:t in(e.language_options||{})||n in(e.worldview_options||{})?null:e.language_options&&e.worldview_options?e:null}(t.data,r,i);return s?e.q.frame((()=>a(null,s))):t.url?e.n(n.transformRequest(n.normalizeSourceURL(t.url,null,r,i),e.R.Source),a):e.q.frame((()=>{const{data:e,...n}=t;a(null,n)}))}class Xe{constructor(t,n,r){this.bounds=e.as.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=r||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(t){const n=Math.pow(2,t.z),r=Math.floor(e.am(this.bounds.getWest())*n),i=Math.floor(e.at(this.bounds.getNorth())*n),o=Math.ceil(e.am(this.bounds.getEast())*n),a=Math.ceil(e.at(this.bounds.getSouth())*n);return t.x>=r&&t.x=i&&t.y{this._tileJSONRequest=null,this._loaded=!0,i?(n&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${n}`),r&&2!==r.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${r}`),this.fire(new e.t(i))):o&&(e.l(this,o),o.bounds&&(this.tileBounds=new Xe(o.bounds,this.minzoom,this.maxzoom)),P(o.tiles,this.map._requestManager._customAccessToken),this.fire(new e.x("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.x("data",{dataType:"source",sourceDataType:"content"}))),t&&t(i)}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.av(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return e.l({},this._options)}loadTile(t,n){const r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),i=this.map._requestManager.transformRequest(r,e.R.Tile),o=this.map.style?this.map.style.getLut(this.scope):null,a={request:i,data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,lut:o?{image:o.image.clone()}:null,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,pixelRatio:e.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,tessellationStep:this.map._tessellationStep};if(a.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state)"loading"===t.state?t.reloadCallback=n:t.request=t.actor.send("reloadTile",a,s.bind(this));else if(t.actor=this._tileWorkers[r]=this._tileWorkers[r]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",a,s.bind(this),void 0,!0);else{const n=e.aw.call({deduped:this._deduped},a,((e,n)=>{e||!n?s.call(this,e):(a.data={cacheControl:n.cacheControl,expires:n.expires,rawData:n.rawData.slice(0)},t.actor&&t.actor.send("loadTile",a,s.bind(this),void 0,!0))}),!0);t.request={cancel:n}}function s(r,i){return delete t.request,t.aborted?n(null):r&&404!==r.status?n(r):(i&&i.resourceTiming&&(t.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),e.ax(this.dispatcher),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(e,t){e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Je extends e.E{constructor(t,n,r,i){super(),this.id=t,this.dispatcher=r,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.l({type:"raster"},n),e.l(this,e.ar(n,["url","scheme","tileSize"]))}load(t){this._loaded=!1,this.fire(new e.x("dataloading",{dataType:"source"})),this._tileJSONRequest=Ye(this._options,this.map._requestManager,null,null,((n,r)=>{this._tileJSONRequest=null,this._loaded=!0,n?this.fire(new e.t(n)):r&&(e.l(this,r),r.bounds&&(this.tileBounds=new Xe(r.bounds,this.minzoom,this.maxzoom)),P(r.tiles),this.fire(new e.x("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.x("data",{dataType:"source",sourceDataType:"content"}))),t&&t(n)}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.av(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return e.l({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,n){const r=e.q.devicePixelRatio>=2,i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),r,this.tileSize);t.request=e.o(this.map._requestManager.transformRequest(i,e.R.Tile),((r,i,o,a)=>(delete t.request,t.aborted?(t.state="unloaded",n(null)):r?(t.state="errored",n(r)):i?(this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:o,expires:a}),t.setTexture(i,this.map.painter),t.state="loaded",e.ax(this.dispatcher),void n(null)):n(null))))}abortTile(e,t){e.request&&(e.request.cancel(),delete e.request),t&&t()}unloadTile(t,n){t.texture&&t.texture instanceof e.T?(t.destroy(!0),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),n&&n()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Qe extends Je{constructor(t,n,r,i){super(t,n,r,i),this.type="raster-array",this.maxzoom=22,this._options=e.l({type:"raster-array"},n)}triggerRepaint(e){const t=this.map.painter._terrain,n=this.map.style.getSourceCache(this.id);t&&t.enabled&&n&&t._clearRenderCacheForTile(n.id,e.tileID),this.map.triggerRepaint()}loadTile(t,n){const r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),i=this.map._requestManager.transformRequest(r,e.R.Tile);t.requestParams=i,t.actor||(t.actor=this.dispatcher.getActor()),t.request=t.fetchHeader(void 0,((e,r,i,o)=>{if(delete t.request,t.aborted)return t.state="unloaded",n(null);if(e){if(20===e.code)return;return t.state="errored",n(e)}this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:i,expires:o}),t.state="empty",n(null)}))}unloadTile(t,n){const r=t.texture;r&&r instanceof e.T?(t.destroy(!0),this.map.painter.saveTileTexture(r)):(t.destroy(),t.flushQueues(),t._isHeaderLoaded=!1,delete t._mrt,delete t.textureDescriptor),t.fbo&&(t.fbo.destroy(),delete t.fbo),delete t.request,delete t.requestParams,delete t.neighboringTiles,t.state="unloaded"}prepareTile(t,n,r){t._isHeaderLoaded&&("empty"!==t.state&&(t.state="reloading"),t.fetchBand(n,r,((n,r)=>{if(n)return t.state="errored",this.fire(new e.t(n)),void this.triggerRepaint(t);r&&(t.setTexture(r,this.map.painter),t.state="loaded",this.triggerRepaint(t))})))}getInitialBand(e){if(!this.rasterLayers)return 0;const t=this.rasterLayers.find((t=>{let{id:n}=t;return n===e})),n=t&&t.fields,r=n&&n.bands&&n.bands;return r?r[0]:0}getTextureDescriptor(t,n,r){if(!t)return;const i=n.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!i)return;let o=null;n instanceof e.aB?o=n.paint.get("raster-array-band"):n instanceof e.aC&&(o=n.paint.get("raster-particle-array-band"));const a=o||this.getInitialBand(i);if(null!=a)if(t.textureDescriptor){if(!t.updateNeeded(i,a)||r)return Object.assign({},t.textureDescriptor,{texture:t.texture})}else this.prepareTile(t,i,a)}}const et={vector:Ke,raster:Je,"raster-dem":class extends Je{constructor(t,n,r,i){super(t,n,r,i),this.type="raster-dem",this.maxzoom=22,this._options=e.l({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}loadTile(t,n){const r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function i(e,r){e&&(t.state="errored",n(e)),r&&(t.dem=r,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0,t.state="loaded",n(null))}t.request=e.o(this.map._requestManager.transformRequest(r,e.R.Tile),function(r,o,a,s){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(r)t.state="errored",n(r);else if(o){this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:a,expires:s});const n=ImageBitmap&&o instanceof ImageBitmap&&e.ay(),r=1-(o.width-e.az(o.width))/2;r<1||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID));const l=n?o:e.q.getImageData(o,r),c={uid:t.uid,coord:t.tileID,source:this.id,scope:this.scope,rawImageData:l,encoding:this.encoding,padding:r};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",c,i.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(t){const n=t.canonical,r=Math.pow(2,n.z),i=(n.x-1+r)%r,o=0===n.x?t.wrap-1:t.wrap,a=(n.x+1+r)%r,s=n.x+1===r?t.wrap+1:t.wrap,l={};return l[new e.aA(t.overscaledZ,o,n.z,i,n.y).key]={backfilled:!1},l[new e.aA(t.overscaledZ,s,n.z,a,n.y).key]={backfilled:!1},n.y>0&&(l[new e.aA(t.overscaledZ,o,n.z,i,n.y-1).key]={backfilled:!1},l[new e.aA(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},l[new e.aA(t.overscaledZ,s,n.z,a,n.y-1).key]={backfilled:!1}),n.y+10&&void 0!==arguments[0]&&arguments[0];if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new e.x("dataloading",{dataType:"source"})),this._loaded=!1;const n=e.l({append:t},this.workerOptions);n.scope=this.scope;const r=this._data;"string"==typeof r?(n.request=this.map._requestManager.transformRequest(e.q.resolveURL(r),e.R.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(r),this._pendingLoad=this.actor.send(`${this.type}.loadData`,n,((n,r)=>{if(this._loaded=!0,this._pendingLoad=null,n)this.fire(new e.t(n));else{const n={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&r&&r.resourceTiming&&r.resourceTiming[this.id]&&(n.resourceTiming=r.resourceTiming[this.id]),t&&(this._partialReload=!0),this.fire(new e.x("data",n)),this._partialReload=!1,this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(t),this._coalesce=!1)}))}loaded(){return this._loaded}loadTile(t,n){const r=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const i=this.map.style?this.map.style.getLut(this.scope):null,o=this._partialReload,a={type:this.type,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:i?{image:i.image.clone()}:null,scope:this.scope,pixelRatio:e.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,partial:o};t.request=this.actor.send(r,a,((e,i)=>o&&!i?(t.state="loaded",n(null)):(delete t.request,t.destroy(),t.aborted?n(null):e?n(e):(t.loadVectorData(i,this.map.painter,"reloadTile"===r),n(null)))),void 0,"loadTile"===r)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e,t){this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy()}onRemove(e){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return e.l({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends e.aD{constructor(e,t,n,r){super(e,t,n,r),this.roundZoom=!0,this.type="video",this.options=t}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,e.R.Source).url);e.aE(this.urls,((t,n)=>{this._loaded=!0,t?this.fire(new e.t(t)):n&&(this.video=n,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading())}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;tn.end(0)?this.fire(new e.t(new e.V(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,n=t.gl;this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new e.T(t,this.video,n.RGBA8),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(t)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:e.aD,model:class extends e.E{constructor(e,t,n,r){super(),this.id=e,this.type="model",this.models=[],this._loaded=!1,this._options=t}load(){const t=[];for(const n in this._options.models){const r=this._options.models[n],i=e.aG(this.map._requestManager.transformRequest(r.uri,e.R.Model).url).then((t=>{if(!t)return;const i=e.aH(t),o=new e.aI(n,r.position,r.orientation,i);o.computeBoundsAndApplyParent(),this.models.push(o)})).catch((t=>{this.fire(new e.t(new Error(`Could not load model ${n} from ${r.uri}: ${t.message}`)))}));t.push(i)}return Promise.allSettled(t).then((()=>{this._loaded=!0,this.fire(new e.x("data",{dataType:"source",sourceDataType:"metadata"}))})).catch((t=>{this.fire(new e.t(new Error(`Could not load models: ${t.message}`)))}))}onAdd(e){this.map=e,this.load()}hasTransition(){return!1}loaded(){return this._loaded}getModels(){return this.models}loadTile(e,t){}serialize(){return{type:"model"}}},"batched-model":class extends e.E{constructor(e,t,n,r){super(),this.type="batched-model",this.id=e,this.tileSize=512,this._options=t,this.tiles=this._options.tiles,this.maxzoom=t.maxzoom||19,this.minzoom=t.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=n,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(r)}onAdd(e){this.map=e,this.load()}load(t){this._loaded=!1,this.fire(new e.x("dataloading",{dataType:"source"}));const n=Array.isArray(this.map._language)?this.map._language.join():this.map._language,r=this.map._worldview;this._tileJSONRequest=Ye(this._options,this.map._requestManager,n,r,((i,o)=>{this._tileJSONRequest=null,this._loaded=!0,i?(n&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${n}`),r&&2!==r.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${r}`),this.fire(new e.t(i))):o&&(e.l(this,o),o.bounds&&(this.tileBounds=new Xe(o.bounds,this.minzoom,this.maxzoom)),P(o.tiles,this.map._requestManager._customAccessToken),this.fire(new e.x("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.x("data",{dataType:"source",sourceDataType:"content"}))),t&&t(i)}))}hasTransition(){return!1}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loaded(){return this._loaded}loadTile(t,n){const r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(r,e.R.Tile),data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0};if(t.actor&&"expired"!==t.state)if("loading"===t.state)t.reloadCallback=n;else{if(t.buckets){const e=Object.values(t.buckets);for(const t of e)t.dirty=!0;return void(t.state="loaded")}t.request=t.actor.send("reloadTile",i,o.bind(this))}else t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",i,o.bind(this),void 0,!0);function o(e,r){return t.aborted?n(null):e&&404!==e.status?n(e):(r&&(r.resourceTiming&&(t.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&t.setExpiryData(r),t.buckets={...t.buckets,...r.buckets},r.featureIndex&&(t.latestFeatureIndex=r.featureIndex)),t.state="loaded",void n(null))}}serialize(){return e.l({},this._options)}},canvas:class extends e.aD{constructor(t,n,r,i){super(t,n,r,i),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new e.t(new e.V(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.t(new e.V(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new e.t(new e.V(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof HTMLCanvasElement||this.fire(new e.t(new e.V(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.t(new e.V(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.t(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(e){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const n=this.map.painter.context;this.texture?!t&&!this._playing||this.texture instanceof e.aF||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.T(n,this.canvas,n.gl.RGBA8,{premultiply:!0}),this._prepareData(n)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},custom:class extends e.E{constructor(t,n,r,i){super(),this.id=t,this.type="custom",this._dataType="raster",this._dispatcher=r,this._implementation=n,this.setEventedParent(i),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new e.t(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new e.t(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new Xe(this._implementation.bounds,this.minzoom,this.maxzoom)),n.update=this._update.bind(this),n.clearTiles=this._clearTiles.bind(this),n.coveringTiles=this._coveringTiles.bind(this),e.l(this,e.ar(n,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return e.ar(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new e.x("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.x("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(t){this.map=t,this._loaded=!1,this.fire(new e.x("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(t),this.load()}onRemove(e){this._implementation.onRemove&&this._implementation.onRemove(e)}hasTile(e){if(this._implementation.hasTile){const{x:t,y:n,z:r}=e.canonical;return this._implementation.hasTile({x:t,y:n,z:r})}return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e,t){const{x:n,y:r,z:i}=e.tileID.canonical,o=new AbortController;e.request=Promise.resolve(this._implementation.loadTile({x:n,y:r,z:i},{signal:o.signal})).then(function(n){return delete e.request,e.aborted?(e.state="unloaded",t(null)):void 0===n?(e.state="errored",t(null)):null===n?(this.loadTileData(e,{width:this.tileSize,height:this.tileSize,data:null}),e.state="loaded",t(null)):function(e){return e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof ImageBitmap||e instanceof HTMLImageElement}(n)?(this.loadTileData(e,n),e.state="loaded",void t(null)):(e.state="errored",t(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}.bind(this)).catch((n=>{20!==n.code&&(e.state="errored",t(n))})),e.request.cancel=()=>o.abort()}loadTileData(e,t){e.setTexture(t,this.map.painter)}unloadTile(t,n){if(t.texture&&t.texture instanceof e.T?(t.destroy(!0),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),this._implementation.unloadTile){const{x:e,y:n,z:r}=t.tileID.canonical;this._implementation.unloadTile({x:e,y:n,z:r})}n&&n()}abortTile(e,t){e.request&&e.request.cancel&&(e.request.cancel(),delete e.request),t&&t()}hasTransition(){return!1}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map((e=>({x:e.canonical.x,y:e.canonical.y,z:e.canonical.z})))}_clearTiles(){const t=e.av(this.id,this.scope);this.map.style.clearSource(t)}_update(){this.fire(new e.x("data",{dataType:"source",sourceDataType:"content"}))}}},tt=function(t,n,r,i){const o=new et[n.type](t,n,r,i);if(o.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${o.id}`);return e.aJ(["load","abort","unload","serialize","prepare"],o),o};function nt(t,n){const r=e.a6.mat4.identity([]);return e.a6.mat4.scale(r,r,[.5*t.width,.5*-t.height,1]),e.a6.mat4.translate(r,r,[1,-1,0]),e.a6.mat4.multiply(r,r,t.calculateProjMatrix(n.toUnwrapped())),Float32Array.from(r)}function rt(e,t,n,r,i,o,a){let s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const l=e.tilesIn(r,a,s);l.sort(ot);const c=[];for(const h of l)c.push({wrappedTileID:h.tile.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(t,n,e._state,h,i,o,nt(e.transform,h.tile.tileID),s)});const u=function(e){const t={},n={};for(const r of e){const e=r.queryResults,i=r.wrappedTileID,o=n[i]=n[i]||{};for(const n in e){const r=e[n],i=o[n]=o[n]||{},a=t[n]=t[n]||[];for(const e of r)i[e.featureIndex]||(i[e.featureIndex]=!0,a.push(e))}}return t}(c);for(const h in u)u[h].forEach((t=>{const n=t.feature,r=n.layer;r&&"background"!==r.type&&"sky"!==r.type&&"slot"!==r.type&&(n.source=r.source,r["source-layer"]&&(n.sourceLayer=r["source-layer"]),n.state=void 0!==n.id?e.getFeatureState(r["source-layer"],n.id):{})}));return u}function it(e,t){const n=e.getRenderableIds().map((t=>e.getTileByID(t))),r=[],i={};for(let o=0;o>=1)>1;){const s=t+r>>1,l=n+i>>1;1&e?(r=t,i=n,t=o,n=a):(t=r,n=i,r=o,i=a),o=s,a=l}const s=4*$s;lt[s+0]=t,lt[s+1]=n,lt[s+2]=r,lt[s+3]=i}const ct=new Uint16Array(2178),ut=new Uint8Array(1089),ht=new Uint16Array(1089);function dt(e){return 0===e?-.03125:32===e?.03125:0}const ft={type:2,extent:e.ab,loadGeometry:()=>[[new e.P(0,0),new e.P(e.ab+1,0),new e.P(e.ab+1,e.ab+1),new e.P(0,e.ab+1),new e.P(0,0)]]};class pt{constructor(t,n,r,i,o){this.tileID=t,this.uid=e.aP(),this.uses=0,this.tileSize=n,this.tileZoom=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=o,i&&i.style&&(this._lastUpdatedBrightness=i.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",i&&i.transform&&(this.projection=i.transform.projection)}registerFadeDuration(t){const n=t+this.timeAdded;nt.getLayer(e))).filter(Boolean);if(0!==e.length){r.layers=e,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(const t of e)n[t.fqid]=r}}return n}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const n=this.buckets[t];if(n instanceof e.aR){if(this.hasSymbolBuckets=!0,!r)break;n.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const n=this.buckets[t];if(n instanceof e.aR&&n.hasRTLText){this.hasRTLText=!0,e.aS();break}}this.queryPadding=0;for(const e in this.buckets){const t=this.buckets[e],r=n.style.getOwnLayer(e);if(!r)continue;const i=r.queryRadius(t);this.queryPadding=Math.max(this.queryPadding,i)}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas),this._lastUpdatedBrightness=t.brightness}else this.collisionBoxArray=new e.aQ}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.fqid]}upload(t){for(const e in this.buckets){const n=this.buckets[e];n.uploadPending()&&n.upload(t)}const n=t.gl,r=this.imageAtlas;if(r&&!r.uploaded){const i=!!Object.keys(r.patternPositions).length;this.imageAtlasTexture=new e.T(t,r.image,n.RGBA8,{useMipmap:i}),this.imageAtlas.uploaded=!0}this.glyphAtlasImage&&(this.glyphAtlasTexture=new e.T(t,this.glyphAtlasImage,n.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new e.T(t,this.lineAtlas.image,n.R8),this.lineAtlas.uploaded=!0)}prepare(e,t,n){if(this.imageAtlas&&this.imageAtlasTexture&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture,n),!t||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const r=t.style.getBrightness();(this._lastUpdatedBrightness||r)&&(this._lastUpdatedBrightness&&r&&Math.abs(this._lastUpdatedBrightness-r)<.001||(this._lastUpdatedBrightness=r,this.updateBuckets(t)))}queryRenderedFeatures(e,t,n,r,i,o,a,s){return this.latestFeatureIndex&&(this.latestFeatureIndex.rawTileData||this.latestFeatureIndex.is3DTile)?this.latestFeatureIndex.query({tileResult:r,pixelPosMatrix:a,transform:o,params:i,tileTransform:this.tileTransform},e,t,n):{}}querySourceFeatures(t,n){const r=this.latestFeatureIndex;if(!r||!r.rawTileData)return;const i=r.loadVTLayers(),o=n?n.sourceLayer:"",a=i._geojsonTileLayer||i[o];if(!a)return;const s=e.aT(n&&n.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let d=0;de)t=!1;else if(n)if(this.expirationTime=0;e--){const t=4*e,n=lt[t+0],r=lt[t+1],i=lt[t+2],o=lt[t+3],a=n+i>>1,s=r+o>>1,l=a+s-r,c=s+n-a,u=r*st+n,h=o*st+i,d=s*st+a,f=Math.hypot((ct[2*u+0]+ct[2*h+0])/2-ct[2*d+0],(ct[2*u+1]+ct[2*h+1])/2-ct[2*d+1])>=16;ut[d]=ut[d]||(f?1:0),e<1022&&(ut[d]=ut[d]||ut[(r+c>>1)*st+(n+l>>1)]||ut[(o+c>>1)*st+(i+l>>1)])}const o=new e.aN,a=new e.aO;let s=0;function l(t,n){const r=n*st+t;return 0===ht[r]&&(o.emplaceBack(ct[2*r+0],ct[2*r+1],t*e.ab/at,n*e.ab/at),ht[r]=++s),ht[r]-1}function c(e,t,n,r,i,o){const s=e+n>>1,u=t+r>>1;if(Math.abs(e-i)+Math.abs(t-o)>1&&ut[u*st+s])c(i,o,e,t,s,u),c(n,r,i,o,s,u);else{const s=l(e,t),c=l(n,r),u=l(i,o);a.emplaceBack(s,c,u)}}return c(0,0,at,at,at,0),c(at,at,0,0,0,at),{vertices:o,indices:a}}(this.tileID.canonical,n);i=t.vertices,o=t.indices}else{i=new e.aN,o=new e.aO;for(const{x:e,y:n}of r)i.emplaceBack(e,n,0,0);const t=e.b2(i.int16,void 0,4);for(let e=0;e0&&(l=e.a6.mat4.invert(new Float64Array(16),n.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,i,n,a,l,s),this._makeGlobeTileDebugTextBuffer(t,i,n,a,l,s)}_globePoint(t,n,r,i,o,a,s){let l=e.b6(t,n,r);if(a){const o=1<.5?d=-1:h<-.5&&(d=1);let f=(t/e.ab+r.x)/o+d,p=(n/e.ab+r.y)/o;f=(f-c)*i._pixelsPerMercatorPixel+c,p=(p-u)*i._pixelsPerMercatorPixel+u;const m=[f*i.worldSize,p*i.worldSize,0];e.a6.vec3.transformMat4(m,m,a),l=e.b7(l,m,s)}return e.a6.vec3.transformMat4(l,l,o)}_makeGlobeTileDebugBorderBuffer(t,n,r,i,o,a){const s=new e.a_,l=new e.a$,c=new e.b8,u=(e,t,u,h,d)=>{const f=(u-e)/(d-1),p=(h-t)/(d-1),m=s.length;for(let g=0;gh*e+t;for(let e=0;e0&&void 0!==arguments[0]&&arguments[0];for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture.destroy(),delete this.imageAtlasTexture),this.glyphAtlasTexture&&(this.glyphAtlasTexture.destroy(),delete this.glyphAtlasTexture),this.lineAtlasTexture&&(this.lineAtlasTexture.destroy(),delete this.lineAtlasTexture),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),!t&&this.texture&&this.texture instanceof e.T&&(this.texture.destroy(),delete this.texture),this.hillshadeFBO&&(this.hillshadeFBO.destroy(),delete this.hillshadeFBO),this.dem&&delete this.dem,this.neighboringTiles&&delete this.neighboringTiles,this.demTexture&&(this.demTexture.destroy(),delete this.demTexture),this.rasterParticleState&&(this.rasterParticleState.destroy(),delete this.rasterParticleState),this.latestFeatureIndex=null,this.state="unloaded"}}e.ba.setPbf(e.bb);class mt extends pt{constructor(e,t,n,r,i){super(e,t,n,r,i),this._workQueue=[],this._fetchQueue=[],this._isHeaderLoaded=!1}setTexture(t,n){const r=n.context,i=r.gl;this.texture=this.texture||n.getTileTexture(t.width),this.texture&&this.texture instanceof e.T?this.texture.update(t,{premultiply:!1}):this.texture=new e.T(r,t,i.RGBA8,{premultiply:!1})}flushQueues(){for(;this._workQueue.length;)this._workQueue.pop()();for(;this._fetchQueue.length;)this._fetchQueue.pop()()}fetchHeader(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16384,n=arguments.length>1?arguments[1]:void 0;const r=this._mrt=new e.ba(30),i=Object.assign({},this.requestParams,{headers:{Range:"bytes=0-"+(t-1)}});return this.entireBuffer=null,this.request=e.bc(i,((e,i,o,a)=>{if(e)n(e);else try{const e=r.getHeaderLength(i);if(e>t)return void(this.request=this.fetchHeader(e,n));r.parseHeader(i),this._isHeaderLoaded=!0;let s=0;for(const t of Object.values(r.layers))s=Math.max(s,t.dataIndex[t.dataIndex.length-1].last_byte);i.byteLength>=s&&(this.entireBuffer=i),n(null,this.entireBuffer||i,o,a)}catch(e){n(e)}})),this.request}fetchBand(t,n,r){const i=this._mrt;if(!this._isHeaderLoaded||!i)return void r(new Error("Tile header is not ready"));const o=this.actor;if(!o)return void r(new Error("Can't fetch tile band without an actor"));let a;const s=(e,i)=>{a.complete(e,i),e?r(e):(this.updateTextureDescriptor(t,n),r(null,this.textureDescriptor&&this.textureDescriptor.img))},l=(e,t)=>{if(e)return r(e);const n=o.send("decodeRasterArray",{buffer:t,task:a},s,void 0,!0);this._workQueue.push((()=>{n&&n.cancel(),a.cancel()}))},c=i.getLayer(t);if(!c)return void r(new Error(`Unknown sourceLayer "${t}"`));if(c.hasDataForBand(n))return this.updateTextureDescriptor(t,n),void r(null,this.textureDescriptor?this.textureDescriptor.img:null);const u=c.getDataRange([n]);if(a=i.createDecodingTask(u),!a||a.tasks.length)if(this.flushQueues(),this.entireBuffer)l(null,this.entireBuffer.slice(u.firstByte,u.lastByte+1));else{const t=Object.assign({},this.requestParams,{headers:{Range:`bytes=${u.firstByte}-${u.lastByte}`}}),n=e.bc(t,l);this._fetchQueue.push((()=>{n.cancel(),a.cancel()}))}else r(null)}updateNeeded(e,t){return(!this.textureDescriptor||this.textureDescriptor.band!==t||this.textureDescriptor.layer!==e)&&"errored"!==this.state}updateTextureDescriptor(t,n){if(!this._mrt)return;const r=this._mrt.getLayer(t);if(!r||!r.hasBand(n)||!r.hasDataForBand(n))return;const{bytes:i,tileSize:o,buffer:a,offset:s,scale:l}=r.getBandView(n),c=o+2*a,u={data:i,width:c,height:c},h=this.texture;h&&h instanceof e.T&&h.update(u,{premultiply:!1}),this.textureDescriptor={layer:t,band:n,img:u,buffer:a,offset:s,tileSize:o,format:r.pixelFormat,mix:[l,256*l,65536*l,16777216*l]}}}class gt{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(const e in this.data)for(const t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,n){const r=e.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);const i={value:t,timeout:void 0};if(void 0!==n&&(i.timeout=setTimeout((()=>{this.remove(e,i)}),n)),this.data[r].push(i),this.order.push(r),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const n=e.wrapped().key,r=void 0===t?0:this.data[n].indexOf(t),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const n in this.data)for(const r of this.data[n])e(r.value)||t.push(r);for(const n of t)this.remove(n.value.tileID,n)}}class _t{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,r){const i=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},e.l(this.stateChanges[t][i],r),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==i&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][i]){this.deletedStates[t][i]={};for(const e in this.state[t][i])r[e]||(this.deletedStates[t][i][e]=null)}else for(const e in r)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][e]&&delete this.deletedStates[t][i][e]}removeFeatureState(e,t,n){if(null===this.deletedStates[e])return;const r=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},n&&void 0!==t)null!==this.deletedStates[e][r]&&(this.deletedStates[e][r]=this.deletedStates[e][r]||{},this.deletedStates[e][r][n]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][r])for(n in this.deletedStates[e][r]={},this.stateChanges[e][r])this.deletedStates[e][r][n]=null;else this.deletedStates[e][r]=null;else this.deletedStates[e]=null}getState(t,n){const r=this.state[t]||{},i=this.stateChanges[t]||{},o=this.deletedStates[t];if(null===o)return{};if(void 0!==n){const t=String(n),a=e.l({},r[t],i[t]);if(o){const e=o[n];if(null===e)return{};for(const t in e)delete a[t]}return a}const a=e.l({},r,i);if(o)for(const e in o)delete a[e];return a}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(t,n){const r={};for(const i in this.stateChanges){this.state[i]=this.state[i]||{};const t={};for(const n in this.stateChanges[i])this.state[i][n]||(this.state[i][n]={}),e.l(this.state[i][n],this.stateChanges[i][n]),t[n]=this.state[i][n];r[i]=t}for(const i in this.deletedStates){this.state[i]=this.state[i]||{};const t={};if(null===this.deletedStates[i])for(const e in this.state[i])t[e]={},this.state[i][e]={};else for(const e in this.deletedStates[i]){if(null===this.deletedStates[i][e])this.state[i][e]={};else if(this.state[i][e])for(const t of Object.keys(this.deletedStates[i][e]))delete this.state[i][e][t];t[e]=this.state[i][e]}r[i]=r[i]||{},e.l(r[i],t)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(const e in t)t[e].setFeatureState(r,n)}}class yt extends e.E{constructor(e,t,n){super(),this.id=e,this._onlySymbols=n,t.on("data",(e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))})),t.on("error",(()=>{this._sourceErrored=!0})),this._source=t,this._tiles={},this._cache=new gt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new _t,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"raster-array"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const e in this._tiles){const t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,t){return e.isSymbolTile=this._onlySymbols,e.isExtraShadowCaster=this._shadowCasterTiles[e.tileID.key],this._source.loadTile(e,t)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e)}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e)}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const n=this._tiles[t];n.upload(e),n.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return e.bd(this._tiles).map((e=>e.tileID)).sort(vt).map((e=>e.key))}getRenderableIds(t,n){const r=[];for(const e in this._tiles)this._isIdRenderable(+e,t,n)&&r.push(this._tiles[e]);return t?r.sort(((t,n)=>{const r=t.tileID,i=n.tileID,o=new e.P(r.canonical.x,r.canonical.y)._rotate(this.transform.angle),a=new e.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return r.overscaledZ-i.overscaledZ||a.y-o.y||a.x-o.x})).map((e=>e.tileID.key)):r.map((e=>e.tileID)).sort(vt).map((e=>e.key))}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t,n){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())&&(n||!this._shadowCasterTiles[e])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,t){const n=this._tiles[e];n&&("loading"!==n.state&&(n.state=t),this._loadTile(n,this._tileLoaded.bind(this,n,e,t)))}_tileLoaded(t,n,r,i){if(i)if(t.state="errored",404!==i.status)this._source.fire(new e.t(i,{tile:t}));else{if(this._source.fire(new e.x("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:t})),!(t.tileID.key in this._loadedParentTiles))return;if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const e=this.map.painter.terrain;this.update(this.transform,e.getScaledDemTileSize(),!0),e.resetTileLookupCache(this.id)}else this.update(this.transform)}else t.timeAdded=e.q.now(),"expired"===r&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),"raster-dem"===this._source.type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new e.x("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const t=this.getRenderableIds();for(let r=0;r1||(Math.abs(n)>1&&(1===Math.abs(n+i)?n+=i:1===Math.abs(n-i)&&(n-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,n,r),e.neighboringTiles&&e.neighboringTiles[o]&&(e.neighboringTiles[o].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,n,r){for(const i in this._tiles){let o=this._tiles[i];if(r[i]||!o.hasData()||o.tileID.overscaledZ<=t||o.tileID.overscaledZ>n)continue;let a=o.tileID;for(;o&&o.tileID.overscaledZ>t+1;){const e=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[e.key],o&&o.hasData()&&(a=e)}let s=a;for(;s.overscaledZ>t;)if(s=s.scaledTo(s.overscaledZ-1),e[s.key]){r[a.key]=a;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=t?n:null}for(let n=e.overscaledZ-1;n>=t;n--){const t=e.scaledTo(n),r=this._getLoadedTile(t);if(r)return r}}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,t){t=t||this._source.tileSize;const n=Math.ceil(e.width/t)+1,r=Math.ceil(e.height/t)+1,i=Math.floor(n*r*5),o="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,i):i,a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(a)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const n in this._tiles){const r=this._tiles[n];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),e[r.tileID.key]=r}this._tiles=e;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(+t,this._tiles[t])}}update(t,n,r,i){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!r)return;this.updateCacheSize(t,n),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const o="batched-model"===this._source.type;let a;if(this.used||this.usedForTerrain){if(this._source.tileID)a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.aA(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)));else if(0!==this.tileCoverLift){const i=t.clone();i.tileCoverLift=this.tileCoverLift,a=i.coveringTiles({tileSize:n||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!r,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:o}),this._source.minzoom<=1&&"globe"===t.projection.name&&(a.push(new e.aA(1,0,1,0,0)),a.push(new e.aA(1,0,1,1,0)),a.push(new e.aA(1,0,1,0,1)),a.push(new e.aA(1,0,1,1,1)))}else if(a=t.coveringTiles({tileSize:n||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!r,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:o}),this._source.hasTile){const e=this._source.hasTile.bind(this._source);a=a.filter((t=>e(t)))}}else a=[];if(a.length>0&&this.castsShadows&&i&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!xt(this._source.type)){const e=t.coveringZoomLevel({tileSize:n||this._source.tileSize,roundZoom:this._source.roundZoom&&!r}),s=Math.min(e,this._source.maxzoom);if(o){const e=t.extendTileCover(a,s);for(const t of e)a.push(t)}else{const e=t.extendTileCover(a,s,i);for(const t of e)this._shadowCasterTiles[t.key]=!0,a.push(t)}}const s=this._updateRetainedTiles(a);if(xt(this._source.type)&&0!==a.length){const t={},n={},r=Object.keys(s);for(const o of r){const r=s[o],i=this._tiles[o];if(!i||i.fadeEndTime&&i.fadeEndTime<=e.q.now())continue;const a=this.findLoadedParent(r,Math.max(r.overscaledZ-yt.maxOverzooming,this._source.minzoom));a&&(this._addTile(a.tileID),t[a.tileID.key]=a.tileID),n[o]=r}const i=a[a.length-1].overscaledZ;for(const e in this._tiles){const t=this._tiles[e];if(s[e]||!t.hasData())continue;let r=t.tileID;for(;r.overscaledZ>i;){r=r.scaledTo(r.overscaledZ-1);const i=this._tiles[r.key];if(i&&i.hasData()&&n[r.key]){s[e]=t.tileID;break}}}for(const e in t)s[e]||(this._coveredTiles[e]=!0,s[e]=t[e])}for(const e in s)this._tiles[e].clearFadeHold();const l=e.be(this._tiles,s);for(const e of l){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(+e)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const t={};if(0===e.length)return t;const n={},r=e.reduce(((e,t)=>Math.min(e,t.overscaledZ)),1/0),i=e[0].overscaledZ,o=Math.max(i-yt.maxOverzooming,this._source.minzoom),a=Math.max(i+yt.maxUnderzooming,this._source.minzoom),s={};for(const l of e){const e=this._addTile(l);t[l.key]=l,e.hasData()||r=this._source.maxzoom){const e=l.children(this._source.maxzoom)[0],n=this.getTile(e);if(n&&n.hasData()){t[e.key]=e;continue}}else{const e=l.children(this._source.maxzoom);if(t[e[0].key]&&t[e[1].key]&&t[e[2].key]&&t[e[3].key])continue}let r=e.wasRequested();for(let i=l.overscaledZ-1;i>=o;--i){const o=l.scaledTo(i);if(n[o.key])break;if(n[o.key]=!0,e=this.getTile(o),!e&&r&&(e=this._addTile(o)),e&&(t[o.key]=o,r=e.wasRequested(),e.hasData()))break}}return t}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let n,r=this._tiles[e].tileID;for(;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){n=this._loadedParentTiles[r.key];break}t.push(r.key);const e=r.scaledTo(r.overscaledZ-1);if(n=this._getLoadedTile(e),n)break;r=e}for(const e of t)this._loadedParentTiles[e]=n}}_addTile(t){let n=this._tiles[t.key];if(n)return!0!==n.isExtraShadowCaster||!!this._shadowCasterTiles[t.key]||this._reloadTile(t.key,"reloading"),n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const r=Boolean(n);if(!r){const e=this.map?this.map.painter:null,r=this._source.tileSize*t.overscaleFactor();n="raster-array"===this._source.type?new mt(t,r,this.transform.tileZoom,e,this._isRaster):new pt(t,r,this.transform.tileZoom,e,this._isRaster),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))}return n?(n.uses++,this._tiles[t.key]=n,r||this._source.fire(new e.x("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n):null}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const n=t.getExpiryTimeout();n&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),n))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state||"empty"===t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,n,r){const i=[],o=this.transform;if(!o)return i;const a="globe"===o.projection.name,s=e.am(o.center.lng);for(const l in this._tiles){const c=this._tiles[l];if(r&&c.clearQueryDebugViz(),c.holdingForFade())continue;let u;if(a){const t=c.tileID.canonical;if(0===t.z){const n=[Math.abs(e.ap(s,...bt(t,-1))-s),Math.abs(e.ap(s,...bt(t,1))-s)];u=[0,2*n.indexOf(Math.min(...n))-1]}else{const n=[Math.abs(e.ap(s,...bt(t,-1))-s),Math.abs(e.ap(s,...bt(t,0))-s),Math.abs(e.ap(s,...bt(t,1))-s)];u=[n.indexOf(Math.min(...n))-1]}}else u=[0];for(const e of u){const r=t.containsTile(c,o,n,e);r&&i.push(r)}}return i}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(e){return this._getRenderableCoordinates(e)}_getRenderableCoordinates(e,t){const n=this.getRenderableIds(e,t).map((e=>this._tiles[e].tileID)),r="globe"===this.transform.projection.name;for(const i of n)i.projMatrix=this.transform.calculateProjMatrix(i.toUnwrapped()),i.expandedProjMatrix=r?this.transform.calculateProjMatrix(i.toUnwrapped(),!1,!0):i.projMatrix;return n}sortCoordinatesByDistance(e){const t=e.slice(),n=this.transform._camera.position,r=this.transform._camera.forward(),i={};for(const o of t){const e=1/(1<i[e.key]-i[t.key])),t}hasTransition(){if(this._source.hasTransition())return!0;if(xt(this._source.type))for(const t in this._tiles){const n=this._tiles[t];if(void 0!==n.fadeEndTime&&n.fadeEndTime>=e.q.now())return!0}return!1}setFeatureState(e,t,n){this._state.updateState(e=e||"_geojsonTileLayer",t,n)}removeFeatureState(e,t,n){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,n)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,n){const r=this._tiles[e];r&&r.setDependencies(t,n)}reloadTilesForDependencies(e,t){for(const n in this._tiles)this._tiles[n].hasDependency(e,t)&&this._reloadTile(+n,"reloading");this._cache.filter((n=>!n.hasDependency(e,t)))}_preloadTiles(t,n){if(!this._sourceLoaded){const e=()=>{this._sourceLoaded&&(this._source.off("data",e),this._preloadTiles(t,n))};return void this._source.on("data",e)}const r=new Map,i=Array.isArray(t)?t:[t],o=this.map.painter.terrain,a=this.usedForTerrain&&o?o.getScaledDemTileSize():this._source.tileSize;for(const e of i){const t=e.coveringTiles({tileSize:a,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const e of t)r.set(e.key,e);this.usedForTerrain&&e.updateElevation(!1)}const s=Array.from(r.values());e.bf(s,((e,t)=>{const n=new pt(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(n,(e=>{"raster-dem"===this._source.type&&n.dem&&this._backfillDEM(n),t(e,n)}))}),n)}}function vt(e,t){const n=Math.abs(2*e.wrap)-+(e.wrap<0),r=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-n||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function xt(e){return"raster"===e||"image"===e||"video"===e||"custom"===e}function bt(e,t){const n=1<0:"model"===n.type&&(r=!n.isHidden(e)&&n.paint.get("model-opacity")>0),this.layersGotHidden=this.layersGotHidden||!r&&t.visible,t.visible=r}}updateZOffset(e,t){this.currentBuildingBuckets=[];for(const r of this.layers){const e=r.layer,n=this.style.getLayerSourceCache(e);let i=1;"fill-extrusion"===e.type&&(i=r.visible?e.paint.get("fill-extrusion-vertical-scale"):0);let o=n?n.getTile(t):null;if(!o&&n&&t.canonical.z>n.getSource().minzoom){let e=t.scaledTo(Math.min(n.getSource().maxzoom,t.overscaledZ-1));for(;e.overscaledZ>=n.getSource().minzoom&&(o=n.getTile(e),!o&&0!==e.overscaledZ);)e=e.scaledTo(e.overscaledZ-1)}this.currentBuildingBuckets.push({bucket:o?o.getBucket(e):null,tileID:o?o.tileID:t,verticalScale:i})}e.hasAnyZOffset=!1;let n=!1;for(let r=0;r{e in n&&(r[e]=n[e])})),r}function Mt(e){e=e.slice();const t=Object.create(null);for(let n=0;n0?(i-a)/s:0;return this.points[o].mult(1-l).add(this.points[n].mult(l))}}class zt{constructor(e,t,n){const r=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(t/n);for(let o=0;othis.width||r<0||t>this.height)return!i&&[];const a=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(let e=0;e0:a}_queryCircle(e,t,n,r,i){const o=e-n,a=e+n,s=t-n,l=t+n;if(a<0||o>this.width||l<0||s>this.height)return!r&&[];const c=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,c,{hitTest:r,circle:{x:e,y:t,radius:n},seenUids:{box:{},circle:{}}},i),r?c.length>0:c}query(e,t,n,r,i){return this._query(e,t,n,r,!1,i)}hitTest(e,t,n,r,i){return this._query(e,t,n,r,!0,i)}hitTestCircle(e,t,n,r){return this._queryCircle(e,t,n,!0,r)}_queryCell(e,t,n,r,i,o,a,s){const l=a.seenUids,c=this.boxCells[i];if(null!==c){const i=this.bboxes;for(const u of c)if(!l.box[u]){l.box[u]=!0;const c=4*u;if(e<=i[c+2]&&t<=i[c+3]&&n>=i[c+0]&&r>=i[c+1]&&(!s||s(this.boxKeys[u]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[u],x1:i[c],y1:i[c+1],x2:i[c+2],y2:i[c+3]})}}}const u=this.circleCells[i];if(null!==u){const i=this.circles;for(const c of u)if(!l.circle[c]){l.circle[c]=!0;const u=3*c;if(this._circleAndRectCollide(i[u],i[u+1],i[u+2],e,t,n,r)&&(!s||s(this.circleKeys[c]))){if(a.hitTest)return o.push(!0),!0;{const e=i[u],t=i[u+1],n=i[u+2];o.push({key:this.circleKeys[c],x1:e-n,y1:t-n,x2:e+n,y2:t+n})}}}}}_queryCellCircle(e,t,n,r,i,o,a,s){const l=a.circle,c=a.seenUids,u=this.boxCells[i];if(null!==u){const e=this.bboxes;for(const t of u)if(!c.box[t]){c.box[t]=!0;const n=4*t;if(this._circleAndRectCollide(l.x,l.y,l.radius,e[n+0],e[n+1],e[n+2],e[n+3])&&(!s||s(this.boxKeys[t])))return o.push(!0),!0}}const h=this.circleCells[i];if(null!==h){const e=this.circles;for(const t of h)if(!c.circle[t]){c.circle[t]=!0;const n=3*t;if(this._circlesCollide(e[n],e[n+1],e[n+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[t])))return o.push(!0),!0}}}_forEachCell(e,t,n,r,i,o,a,s){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(n),h=this._convertToYCellCoord(r);for(let d=l;d<=u;d++)for(let l=c;l<=h;l++)if(i.call(this,e,t,n,r,this.xCellCount*l+d,o,a,s))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,n,r,i,o){const a=r-e,s=i-t,l=n+o;return l*l>a*a+s*s}_circleAndRectCollide(e,t,n,r,i,o,a){const s=(o-r)/2,l=Math.abs(e-(r+s));if(l>s+n)return!1;const c=(a-i)/2,u=Math.abs(t-(i+c));if(u>c+n)return!1;if(l<=s||u<=c)return!0;const h=l-s,d=u-c;return h*h+d*d<=n*n}}const Dt={unknown:0,flipRequired:1,flipNotRequired:2},Ot=Math.tan(85*Math.PI/180);function Ft(t,n,r,i,o,a,s){const l=e.a6.mat4.create();if(r)if("globe"===a.name){const t=e.bi(o,n);e.a6.mat4.multiply(l,l,t)}else{const t=e.a6.mat2.invert([],s);l[0]=t[0],l[1]=t[1],l[4]=t[2],l[5]=t[3],i||e.a6.mat4.rotateZ(l,l,o.angle)}else e.a6.mat4.multiply(l,o.labelPlaneMatrix,t);return l}function Bt(e,t,n,r,i,o,a){const s=Ft(e,t,n,r,i,o,a);return"globe"===o.name&&n||(s[2]=s[6]=s[10]=s[14]=0),s}function Nt(t,n,r,i,o,a,s){if(r){if("globe"===a.name){const l=Ft(t,n,r,i,o,a,s);return e.a6.mat4.invert(l,l),e.a6.mat4.multiply(l,t,l),l}{const n=e.a6.mat4.clone(t),r=e.a6.mat4.identity([]);return r[0]=s[0],r[1]=s[1],r[4]=s[2],r[5]=s[3],e.a6.mat4.multiply(n,n,r),i||e.a6.mat4.rotateZ(n,n,-o.angle),n}}return o.glCoordMatrix}function jt(t,n,r,i){const o=[t,n,r,1];r?e.a6.vec4.transformMat4(o,o,i):Kt(o,o,i);const a=o[3];return o[0]/=a,o[1]/=a,o[2]/=a,o}function Vt(e,t){return Math.min(.5+e/t*.5,1.5)}function Ut(e,t){const n=e[0]/e[3],r=e[1]/e[3];return n>=-t[0]&&n<=t[0]&&r>=-t[1]&&r<=t[1]}function $t(t,n,r,i,o,a,s,l,c,u){const h=r.transform,d=i?t.textSizeData:t.iconSizeData,f=e.bj(d,r.transform.zoom),p="globe"===h.projection.name,m=[256/r.width*2+1,256/r.height*2+1],g=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;g.clear();let _=null;p&&(_=i?t.text.globeExtVertexArray:t.icon.globeExtVertexArray);const y=t.lineVertexArray,v=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,x=r.transform.width/r.transform.height;let b,w=!1;for(let S=0;SMath.abs(r)?{useVertical:!0}:t===e.bk.vertical?i>0?{needsFlipping:!0}:null:n!==Dt.unknown&&function(e,t){return 0===e||Math.abs(t/e)>Ot}(r,i)?n===Dt.flipRequired?{needsFlipping:!0}:null:r<0?{needsFlipping:!0}:null}function Wt(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v){const x=n/24,b=t.lineOffsetX*x,w=t.lineOffsetY*x,{lineStartIndex:S,glyphStartIndex:M,numGlyphs:A,segment:E,writingMode:T,flipState:C}=t,k=S+t.lineLength,I=t=>{if(h){const[n,r,i]=t.up,o=u.length;e.bm(h,o+0,n,r,i),e.bm(h,o+1,n,r,i),e.bm(h,o+2,n,r,i),e.bm(h,o+3,n,r,i)}const[n,r,i]=t.point;e.bn(u,n,r,i,t.angle)};if(A>1){const e=Gt(x,l,b,w,r,d,f,t,c,a,p,g,!1,_,y,v);if(!e)return{notEnoughRoom:!0};if(i&&!r){let[n,r,i]=e.first.point,[o,a,l]=e.last.point;[n,r]=jt(n,r,i,s),[o,a]=jt(o,a,l,s);const c=qt(T,C,(o-n)*m,a-r);if(t.flipState=c&&c.needsFlipping?Dt.flipRequired:Dt.flipNotRequired,c)return c}I(e.first);for(let t=M+1;t0?a:Zt(f,i,n,1,o,void 0,_,y.canonical),l=qt(T,C,(s[0]-n[0])*m,s[1]-n[1]);if(t.flipState=l&&l.needsFlipping?Dt.flipRequired:Dt.flipNotRequired,l)return l}const n=Yt(x*l.getoffsetX(M),b,w,r,d,f,E,S,k,c,a,p,g,!1,!1,_,y,v);if(!n)return{notEnoughRoom:!0};I(n)}return{}}function Ht(e,t,n,r,i){const{x:o,y:a,z:s}=r.projectTilePoint(e.x,e.y,t);if(!i)return jt(o,a,s,n);const[l,c,u]=i(e);return jt(o+l,a+c,s+u,n)}function Zt(t,n,r,i,o,a,s,l){const c=Ht(t.sub(n)._unit()._add(t),l,o,s,a);return e.a6.vec3.sub(c,r,c),e.a6.vec3.normalize(c,c),e.a6.vec3.scaleAndAdd(c,r,c,i)}function Yt(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_,y){const v=i?t-n:t+n;let x=v>0?1:-1,b=0;i&&(x*=-1,b=Math.PI),x<0&&(b+=Math.PI);let w=l+s+(x>0?0:1)|0,S=o,M=o,A=0,E=0;const T=Math.abs(v),C=[],k=[];let I=a,P=I;const R=()=>Zt(P,I,M,T-A+1,h,f,g,_.canonical);for(;A+E<=T;){if(w+=x,w=c)return null;if(M=S,P=I,C.push(M),p&&k.push(P),I=new e.P(u.getx(w),u.gety(w)),S=d[w],!S){const e=Ht(I,_.canonical,h,g,f);S=e[3]>0?d[w]=e:R()}A+=E,E=e.a6.vec3.distance(M,S)}m&&f&&(d[w]&&(S=R(),E=e.a6.vec3.distance(M,S)),d[w]=S);const L=(T-A)/E,z=I.sub(P)._mult(L)._add(P),D=e.a6.vec3.sub([],S,M),O=e.a6.vec3.scaleAndAdd([],M,D,L);let F=[0,0,1],B=D[0],N=D[1];if(y&&(F=g.upVector(_.canonical,z.x,z.y),0!==F[0]||0!==F[1]||1!==F[2])){const t=[F[2],0,-F[0]],n=e.a6.vec3.cross([],F,t);e.a6.vec3.normalize(t,t),e.a6.vec3.normalize(n,n),B=e.a6.vec3.dot(D,t),N=e.a6.vec3.dot(D,n)}if(r){const t=e.a6.vec3.cross([],F,D);e.a6.vec3.normalize(t,t),e.a6.vec3.scaleAndAdd(O,O,t,r*x)}const j=b+Math.atan2(N,B);return C.push(O),p&&k.push(z),{point:O,angle:j,path:C,tilePath:k,up:F}}function Xt(e,t){const n=t.length,r=n+4*e;t.resize(r),t.float32.fill(-1/0,4*n,4*r)}function Kt(e,t,n){const r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e[3]=n[3]*r+n[7]*i+n[15],e}const Jt=100;class Qt{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new zt(e.width+200,e.height+200,25),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new zt(e.width+200,e.height+200,25);this.transform=e,this.grid=n,this.ignoredGrid=r,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Jt,this.screenBottomBoundary=e.height+Jt,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.fogState=t}placeCollisionBox(e,t,n,r,i,o,a,s){let l=n.projectedAnchorX,c=n.projectedAnchorY,u=n.projectedAnchorZ;const h=n.elevation,d=n.tileID,f=e.getProjection();if(h&&d){const[e,t,r]=f.upVector(d.canonical,n.tileAnchorX,n.tileAnchorY),i=f.upVectorScale(d.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;l+=e*h*i,c+=t*h*i,u+=r*h*i}const p=this.projectAndGetPerspectiveRatio(a,l,c,u,n.tileID,"globe"===f.name||!!h||this.transform.pitch>0,f),m=o*p.perspectiveRatio,g=(n.x1*t+r.x-n.padding)*m+p.point.x,_=(n.y1*t+r.y-n.padding)*m+p.point.y,y=(n.x2*t+r.x+n.padding)*m+p.point.x,v=(n.y2*t+r.y+n.padding)*m+p.point.y,x=p.perspectiveRatio<=.55||p.occluded;return!this.isInsideGrid(g,_,y,v)||!i&&this.grid.hitTest(g,_,y,v,s)||x?{box:[],offscreen:!1,occluded:p.occluded}:{box:[g,_,y,v],offscreen:this.isOffscreen(g,_,y,v),occluded:!1}}placeCollisionCircles(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m){const g=[],_=this.transform.elevation,y=t.getProjection(),v=_?_.getAtTileOffsetFunc(m,this.transform.center.lat,this.transform.worldSize,y):null,x=new e.P(r.tileAnchorX,r.tileAnchorY);let{x:b,y:w,z:S}=y.projectTilePoint(x.x,x.y,m.canonical);if(v){const[e,t,n]=v(x);b+=e,w+=t,S+=n}const M="globe"===y.name,A=this.projectAndGetPerspectiveRatio(s,b,w,S,m,M||!!_||this.transform.pitch>0,y),{perspectiveRatio:E}=A,T=(h?a/E:a*E)/e.bq,C=jt(b,w,S,l),k=A.signedDistanceFromCamera>0?Gt(T,o,r.lineOffsetX*T,r.lineOffsetY*T,!1,C,x,r,i,l,{},_&&!h?v:null,h&&!!_,y,m,h):null;let I=!1,P=!1,R=!0;if(k&&!A.occluded){const t=.5*f*E+p,r=new e.P(-100,-100),i=new e.P(this.screenRightBoundary,this.screenBottomBoundary),o=new Lt,{first:a,last:s}=k,l=a.path.length;let h=[];for(let e=l-1;e>=1;e--)h.push(a.path[e]);for(let e=1;e{let[n,r,i]=e;return v&&!M&&(i=v(te[3]<=0))&&(h=[]));let _=[];if(h.length>0){let t=1/0,n=-1/0,o=1/0,a=-1/0;for(const e of h)t=Math.min(t,e[0]),o=Math.min(o,e[1]),n=Math.max(n,e[0]),a=Math.max(a,e[1]);n>=r.x&&t<=i.x&&a>=r.y&&o<=i.y&&(_=[h.map((t=>new e.P(t[0],t[1])))],(ti.x||oi.y)&&(_=e.bo(_,r.x,r.y,i.x,i.y)))}for(const e of _){o.reset(e,.25*t);let r=0;r=o.length<=.5*t?1:Math.ceil(o.paddedLength/m)+1;for(let e=0;e0){if(e.a6.vec4.transformMat4(l,l,t),this.fogState&&o&&"globe"!==s.name){const t=function(t,n,r,i,o,a){const s=a.calculateFogTileMatrix(o),l=[n,r,i];return e.a6.vec3.transformMat4(l,l,s),Oe(t,e.a6.vec3.length(l),a.pitch,a._fov)}(this.fogState,n,r,i,o.toUnwrapped(),this.transform);c=t>.9}}else Kt(l,l,t);const u=l[3];return{point:new e.P((l[0]/u+1)/2*this.transform.width+Jt,(-l[1]/u+1)/2*this.transform.height+Jt),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(s)/u*.5,1.5),signedDistanceFromCamera:u,occluded:a&&l[2]>u||c}}isOffscreen(e,t,n,r){return n=this.screenRightBoundary||rthis.screenBottomBoundary}isInsideGrid(e,t,n,r){return n>=0&&e=0&&t5&&void 0!==arguments[5]&&arguments[5];this.text=new rn(e?e.text:null,t,n,i),this.icon=new rn(e?e.icon:null,t,r,i),this.clipped=o}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class an{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.text=e,this.icon=t,this.skipFade=n,this.clipped=r}}class sn{constructor(){this.invProjMatrix=e.a6.mat4.create(),this.viewportMatrix=e.a6.mat4.create(),this.circles=[]}}class ln{constructor(e,t,n,r,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=n,this.bucketIndex=r,this.tileID=i}}class cn{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function un(t,n,r,i,o){const{horizontalAlign:a,verticalAlign:s}=e.bx(t),l=-(a-.5)*n,c=-(s-.5)*r,u=e.bw(t,i);return new e.P(l+u[0]*o,c+u[1]*o)}function hn(t,n,r,i,o){const a=new e.P(t,n);return r&&a._rotate(i?o:-o),a}class dn{constructor(e,t,n,r,i,o){this.transform=e.clone(),this.projection=e.projection.name,this.collisionIndex=new Qt(this.transform,i),this.buildingIndex=o,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new cn(n),this.collisionCircleArrays={},this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,r,i){const o=r.getBucket(n),a=r.latestFeatureIndex;if(!o||!a||n.fqid!==o.layerIds[0])return;const s=o.layers[0].layout,l=o.layers[0].paint,c=r.collisionBoxArray,u=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),h=r.tileSize/e.ab,d=r.tileID.toUnwrapped();this.transform.setProjection(o.projection);const f=(p=r.tileID,m=o.getProjection(),g=this.transform,m.name===this.projection?g.calculateProjMatrix(p.toUnwrapped()):en(g,m,p));var p,m,g;const _="map"===s.get("text-pitch-alignment"),y="map"===s.get("text-rotation-alignment");n.compileFilter();const v=n.dynamicFilter(),x=n.dynamicFilterNeedsFeature(),b=this.transform.calculatePixelsToTileUnitsMatrix(r),w=Bt(f,r.tileID.canonical,_,y,this.transform,o.getProjection(),b);let S=null;if(_){const t=Nt(f,r.tileID.canonical,_,y,this.transform,o.getProjection(),b);S=e.a6.mat4.multiply([],this.transform.labelPlaneMatrix,t)}let M=null;v&&r.latestFeatureIndex&&(M={unwrappedTileID:d,dynamicFilter:v,dynamicFilterNeedsFeature:x}),this.retainedQueryData[o.bucketInstanceId]=new ln(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,r.tileID);const A={bucket:o,layout:s,paint:l,posMatrix:f,textLabelPlaneMatrix:w,labelToScreenMatrix:S,clippingData:M,scale:u,textPixelRatio:h,holdingForFade:r.holdingForFade(),collisionBoxArray:c,partiallyEvaluatedTextSize:e.bj(o.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:e.bj(o.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID),latestFeatureIndex:r.latestFeatureIndex};if(i)for(const e of o.sortKeyRanges){const{sortKey:n,symbolInstanceStart:r,symbolInstanceEnd:i}=e;t.push({sortKey:n,symbolInstanceStart:r,symbolInstanceEnd:i,parameters:A})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:A})}attemptAnchorPlacement(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_){const{textOffset0:y,textOffset1:v,crossTileID:x}=h,b=[y,v],w=un(e,n,r,b,i),S=this.collisionIndex.placeCollisionBox(f,i,t,hn(w.x,w.y,o,a,this.transform.angle),u,s,l,c.predicate);if(m){const e=f.getSymbolInstanceIconSize(_,this.transform.zoom,h.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(f,e,m,hn(w.x,w.y,o,a,this.transform.angle),u,s,l,c.predicate).box.length)return}if(S.box.length>0){let t;return this.prevPlacement&&this.prevPlacement.variableOffsets[x]&&this.prevPlacement.placements[x]&&this.prevPlacement.placements[x].text&&(t=this.prevPlacement.variableOffsets[x].anchor),this.variableOffsets[x]={textOffset:b,width:n,height:r,anchor:e,textScale:i,prevAnchor:t},this.markUsedJustification(f,e,h,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,h),this.placedOrientations[x]=p),{shift:w,placedGlyphBoxes:S}}}placeLayerBucketPart(t,n,r,i){const{bucket:o,layout:a,paint:s,posMatrix:l,textLabelPlaneMatrix:c,labelToScreenMatrix:u,clippingData:h,textPixelRatio:d,holdingForFade:f,collisionBoxArray:p,partiallyEvaluatedTextSize:m,partiallyEvaluatedIconSize:g,collisionGroup:_,latestFeatureIndex:y}=t.parameters,v=a.get("text-optional"),x=a.get("icon-optional"),b=a.get("text-allow-overlap"),w=a.get("icon-allow-overlap"),S="map"===a.get("text-rotation-alignment"),M="map"===a.get("text-pitch-alignment"),A=a.get("symbol-z-elevate"),E=s.get("symbol-z-offset"),T="sea"===s.get("symbol-elevation-reference");this.transform.setProjection(o.projection);let C=b&&(w||!o.hasIconData()||x),k=w&&(b||!o.hasTextData()||v);const I=!E.isConstant();!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p),r&&i&&o.updateCollisionDebugBuffers(this.transform.zoom,p);const P=(t,i,s)=>{const{crossTileID:p,numVerticalGlyphVertices:A}=t;let P=null;if(h&&h.dynamicFilterNeedsFeature||I){const e=this.retainedQueryData[o.bucketInstanceId];P=y.loadFeature({featureIndex:t.featureIndex,bucketIndex:e.bucketIndex,sourceLayerIndex:e.sourceLayerIndex,layoutVertexArrayOffset:0})}if(h&&!(0,h.dynamicFilter)({zoom:this.transform.zoom,pitch:this.transform.pitch},P,this.retainedQueryData[o.bucketInstanceId].tileID.canonical,new e.P(t.tileAnchorX,t.tileAnchorY),this.transform.calculateDistanceTileData(h.unwrappedTileID)))return this.placements[p]=new an(!1,!1,!1,!0),void n.add(p);const R=E.evaluate(P,{});if(n.has(p))return;if(f)return void(this.placements[p]=new an(!1,!1,!1));let L=!1,z=!1,D=!0,O=!1,F=!1,B=null,N={box:null,offscreen:null,occluded:null},j={box:null,offscreen:null,occluded:null},V=null,U=null,$=null,G=0,q=0,W=0;s.textFeatureIndex?G=s.textFeatureIndex:t.useRuntimeCollisionCircles&&(G=t.featureIndex),s.verticalTextFeatureIndex&&(q=s.verticalTextFeatureIndex);const H=e=>{e.tileID=this.retainedQueryData[o.bucketInstanceId].tileID;const n=this.transform.elevation;e.elevation=T?R:R+(n?n.getAtTileOffset(e.tileID,e.tileAnchorX,e.tileAnchorY):0),e.elevation+=t.zOffset},Z=s.textBox;if(Z){H(Z);const n=n=>{let r=e.bk.horizontal;if(o.allowVerticalPlacement&&!n&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[p];e&&(this.placedOrientations[p]=e,r=e,this.markUsedOrientation(o,r,t))}return r},r=(t,n)=>{if(o.allowVerticalPlacement&&A>0&&s.verticalTextBox){for(const r of o.writingModes)if(r===e.bk.vertical?(N=n(),j=N):N=t(),N&&N.box&&N.box.length)break}else N=t()};if(a.get("text-variable-anchor")){let c=a.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[p]){const e=this.prevPlacement.variableOffsets[p];c.indexOf(e.anchor)>0&&(c=c.filter((t=>t!==e.anchor)),c.unshift(e.anchor))}const u=(e,n,r)=>{const a=o.getSymbolInstanceTextSize(m,t,this.transform.zoom,i),s=(e.x2-e.x1)*a+2*e.padding,u=(e.y2-e.y1)*a+2*e.padding,h=t.hasIconTextFit&&!w?n:null;h&&H(h);let f={box:[],offscreen:!1,occluded:!1};const p=b?2*c.length:c.length;for(let y=0;y=c.length,t,i,o,r,h,m,g);if(n&&(f=n.placedGlyphBoxes,f&&f.box&&f.box.length)){L=!0,B=n.shift;break}}return f};r((()=>u(Z,s.iconBox,e.bk.horizontal)),(()=>{const t=s.verticalTextBox;return t&&H(t),o.allowVerticalPlacement&&!(N&&N.box&&N.box.length)&&A>0&&t?u(t,s.verticalIconBox,e.bk.vertical):{box:null,offscreen:null,occluded:null}})),N&&(L=N.box,D=N.offscreen,O=N.occluded);const h=n(!(!N||!N.box));if(!L&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[p];e&&(this.variableOffsets[p]=e,this.markUsedJustification(o,e.anchor,t,h))}}else{const a=(n,r)=>{const a=o.getSymbolInstanceTextSize(m,t,this.transform.zoom,i),s=this.collisionIndex.placeCollisionBox(o,a,n,new e.P(0,0),b,d,l,_.predicate);return s&&s.box&&s.box.length&&(this.markUsedOrientation(o,r,t),this.placedOrientations[p]=r),s};r((()=>a(Z,e.bk.horizontal)),(()=>{const t=s.verticalTextBox;return o.allowVerticalPlacement&&A>0&&t?(H(t),a(t,e.bk.vertical)):{box:null,offscreen:null,occluded:null}})),n(!!(N&&N.box&&N.box.length))}}if(V=N,L=V&&V.box&&V.box.length>0,D=V&&V.offscreen,O=V&&V.occluded,t.useRuntimeCollisionCircles){const n=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex),i=e.bl(o.textSizeData,m,n),s=a.get("text-padding");U=this.collisionIndex.placeCollisionCircles(o,b,n,o.lineVertexArray,o.glyphOffsetArray,i,l,c,u,r,M,_.predicate,t.collisionCircleDiameter*i/e.bq,s,this.retainedQueryData[o.bucketInstanceId].tileID),L=b||U.circles.length>0&&!U.collisionDetected,D=D&&U.offscreen,O=U.occluded}if(s.iconFeatureIndex&&(W=s.iconFeatureIndex),s.iconBox){const n=n=>{H(n);const r=t.hasIconTextFit&&B?hn(B.x,B.y,S,M,this.transform.angle):new e.P(0,0),i=o.getSymbolInstanceIconSize(g,this.transform.zoom,t.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(o,i,n,r,w,d,l,_.predicate)};j&&j.box&&j.box.length&&s.verticalIconBox?($=n(s.verticalIconBox),z=$.box.length>0):($=n(s.iconBox),z=$.box.length>0),D=D&&$.offscreen,F=$.occluded}const Y=v||0===t.numHorizontalGlyphVertices&&0===A,X=x||0===t.numIconVertices;if(Y||X?X?Y||(z=z&&L):L=z&&L:z=L=z&&L,L&&V&&V.box&&this.collisionIndex.insertCollisionBox(V.box,a.get("text-ignore-placement"),o.bucketInstanceId,j&&j.box&&q?q:G,_.ID),z&&$&&this.collisionIndex.insertCollisionBox($.box,a.get("icon-ignore-placement"),o.bucketInstanceId,W,_.ID),U&&(L&&this.collisionIndex.insertCollisionCircles(U.circles,a.get("text-ignore-placement"),o.bucketInstanceId,G,_.ID),r)){const e=o.bucketInstanceId;let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new sn);for(let n=0;n=0;--e){const n=t[e];P(o.symbolInstances.get(n),n,o.collisionArrays[n])}o.hasAnyZOffset&&e.w(`${o.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(o.hasAnyZOffset){const e=o.getSortedIndexesByZOffset();for(let t=0;t=0&&(t.text.placedSymbolArray.get(o).crossTileID=h>=0&&o!==h?0:c),a>=0&&(t.text.placedSymbolArray.get(a).crossTileID=h>=0&&a!==h?0:c),s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=h>=0&&s!==h?0:c),l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=h>=0&&l!==h?0:c)}markUsedOrientation(t,n,r){const i=n===e.bk.horizontal||n===e.bk.horizontalOnly?n:0,o=n===e.bk.vertical?n:0,{leftJustifiedTextSymbolIndex:a,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=r,u=t.text.placedSymbolArray;a>=0&&(u.get(a).placedOrientation=i),s>=0&&(u.get(s).placedOrientation=i),l>=0&&(u.get(l).placedOrientation=i),c>=0&&(u.get(c).placedOrientation=o)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let n=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const r=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},o=t?t.variableOffsets:{},a=t?t.placedOrientations:{};for(const s in this.placements){const e=this.placements[s],t=i[s];t?(this.opacities[s]=new on(t,r,e.text,e.icon,null,e.clipped),n=n||e.text!==t.text.placed||e.icon!==t.icon.placed):(this.opacities[s]=new on(null,r,e.text,e.icon,e.skipFade,e.clipped),n=n||e.text||e.icon)}for(const s in i){const e=i[s];if(!this.opacities[s]){const t=new on(e,r,!1,!1);t.isHidden()||(this.opacities[s]=t,n=n||e.text.placed||e.icon.placed)}}for(const s in o)this.variableOffsets[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.variableOffsets[s]=o[s]);for(const s in a)this.placedOrientations[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.placedOrientations[s]=a[s]);n?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t,n,r){const i=new Set;for(const o of t){const t=o.getBucket(e);t&&o.latestFeatureIndex&&e.fqid===t.layerIds[0]&&(this.updateBucketOpacities(t,i,o,o.collisionBoxArray,n,r,o.tileID,e.scope),t.layers[0].layout.get("symbol-z-elevate")&&this.buildingIndex&&(this.buildingIndex.updateZOffset(t,o.tileID),t.updateZOffset()))}}updateBucketOpacities(t,n,r,i,o,a,s,l){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const c=t.layers[0].layout,u=t.layers[0].paint,h=!!t.layers[0].dynamicFilter(),d=new on(null,0,!1,!1,!0),f=c.get("text-allow-overlap"),p=c.get("icon-allow-overlap"),m=c.get("text-variable-anchor"),g="map"===c.get("text-rotation-alignment"),_="map"===c.get("text-pitch-alignment"),y=u.get("symbol-z-offset"),v="sea"===u.get("symbol-elevation-reference"),x=!y.isConstant(),b=new on(null,0,f&&(p||!t.hasIconData()||c.get("icon-optional")),p&&(f||!t.hasTextData()||c.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);const w=(e,t,n)=>{for(let r=0;r0||u>0,R=p>0,L=this.placedOrientations[f],z=L===e.bk.vertical,D=L===e.bk.horizontal||L===e.bk.horizontalOnly;!P&&!R||I.isHidden()||S++;let O=!1;if((P||R)&&a)for(const n of t.activeReplacements){if(e.br(n,o,e.bs.Symbol,l))continue;if(n.min.x>A||A>n.max.x||n.min.y>E||E>n.max.y)continue;const t=e.bt(A,E,s.canonical,n.footprintTileId.canonical);if(O=e.bu(t,n.footprint),O)break}if(P){const e=O?wn:bn(I.text);w(t.text,c,z?wn:e),w(t.text,u,D?wn:e);const n=I.text.isHidden(),{leftJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:o,rightJustifiedTextSymbolIndex:a,verticalPlacedTextSymbolIndex:s}=i,l=t.text.placedSymbolArray,h=n||z?1:0;r>=0&&(l.get(r).hidden=h),o>=0&&(l.get(o).hidden=h),a>=0&&(l.get(a).hidden=h),s>=0&&(l.get(s).hidden=n||D?1:0);const d=this.variableOffsets[f];d&&this.markUsedJustification(t,d.anchor,i,L);const p=this.placedOrientations[f];p&&(this.markUsedJustification(t,"left",i,p),this.markUsedOrientation(t,p,i))}if(R){const e=O?wn:bn(I.icon),{placedIconSymbolIndex:n,verticalPlacedIconSymbolIndex:r}=i,o=t.icon.placedSymbolArray,a=I.icon.isHidden()?1:0;n>=0&&(w(t.icon,p,z?wn:e),o.get(n).hidden=a),r>=0&&(w(t.icon,i.numVerticalIconVertices,D?wn:e),o.get(r).hidden=a)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const n=t.collisionArrays[M];if(n){let r=new e.P(0,0),o=!0;if(n.textBox||n.verticalTextBox){if(m){const e=this.variableOffsets[f];e?(r=un(e.anchor,e.width,e.height,e.textOffset,e.textScale),g&&r._rotate(_?this.transform.angle:-this.transform.angle)):o=!1}h&&(o=!I.clipped),n.textBox&&fn(t.textCollisionBox.collisionVertexArray,I.text.placed,!o||z,C,v,r.x,r.y),n.verticalTextBox&&fn(t.textCollisionBox.collisionVertexArray,I.text.placed,!o||D,C,v,r.x,r.y)}const a=o&&Boolean(!D&&n.verticalIconBox);n.iconBox&&fn(t.iconCollisionBox.collisionVertexArray,I.icon.placed,a,C,v,i.hasIconTextFit?r.x:0,i.hasIconTextFit?r.y:0),n.verticalIconBox&&fn(t.iconCollisionBox.collisionVertexArray,I.icon.placed,!a,C,v,i.hasIconTextFit?r.x:0,i.hasIconTextFit?r.y:0)}}}if(t.fullyClipped=0===S,t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTimee}setStale(){this.stale=!0}}function fn(e,t,n,r,i,o,a){e.emplaceBack(t?1:0,n?1:0,o||0,a||0,r,i?1:0),e.emplaceBack(t?1:0,n?1:0,o||0,a||0,r,i?1:0),e.emplaceBack(t?1:0,n?1:0,o||0,a||0,r,i?1:0),e.emplaceBack(t?1:0,n?1:0,o||0,a||0,r,i?1:0)}const pn=Math.pow(2,25),mn=Math.pow(2,24),gn=Math.pow(2,17),_n=Math.pow(2,16),yn=Math.pow(2,9),vn=Math.pow(2,8),xn=Math.pow(2,1);function bn(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,n=Math.floor(127*e.opacity);return n*pn+t*mn+n*gn+t*_n+n*yn+t*vn+n*xn+t}const wn=0;class Sn{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(e,t,n,r,i){const o=this._bucketParts;for(;this._currentTileIndexe.sortKey-t.sortKey)));this._currentPartIndex{const t=e.q.now()-o;return!this._forceFullPlacement&&t>2};for(;this._currentPlacementIndex>=0;){const o=n[t[this._currentPlacementIndex]],s=this.placement.collisionIndex.transform.zoom;if("symbol"===o.type&&(!o.minzoom||o.minzoom<=s)&&(!o.maxzoom||o.maxzoom>s)){const t=o,n=t.layout.get("symbol-z-elevate"),s=void 0!==t.layout.get("symbol-sort-key").constantOr(1),l=t.layout.get("symbol-z-order"),c="viewport-y"===l||"auto"===l&&!("viewport-y"!==l&&s),u=t.layout.get("text-allow-overlap")||t.layout.get("icon-allow-overlap")||t.layout.get("text-ignore-placement")||t.layout.get("icon-ignore-placement"),h=c&&u,d=this._inProgressLayer=this._inProgressLayer||new Sn(t),f=e.av(o.source,o.scope);if(d.continuePlacement(n||h?i[f]:r[f],this.placement,this._showCollisionBoxes,o,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const An=512/e.ab/2;class En{constructor(t,n,r){this.tileID=t,this.bucketInstanceId=r,this.index=new e.by(n.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const i=t.canonical.x*e.ab,o=t.canonical.y*e.ab;for(let e=0;ee.overscaledZ)for(const i in n){const o=n[i];o.tileID.isChildOf(e)&&o.findMatches(t.symbolInstances,e,r)}else{const o=n[e.scaledTo(Number(i)).key];o&&o.findMatches(t.symbolInstances,e,r)}}for(let i=0;i{t[e]=!0}));for(const n in this.layerIndexes)t[n]||delete this.layerIndexes[n]}}const In=771;class Pn{constructor(e,t,n,r){this.blendFunction=e,this.blendColor=t,this.mask=n,this.blendEquation=r}}Pn.Replace=[1,0,1,0],Pn.disabled=new Pn(Pn.Replace,e.bz.transparent,[!1,!1,!1,!1]),Pn.unblended=new Pn(Pn.Replace,e.bz.transparent,[!0,!0,!0,!0]),Pn.alphaBlended=new Pn([1,In,1,In],e.bz.transparent,[!0,!0,!0,!0]),Pn.alphaBlendedNonPremultiplied=new Pn([770,In,770,In],e.bz.transparent,[!0,!0,!0,!0]),Pn.multiply=new Pn([774,0,774,0],e.bz.transparent,[!0,!0,!0,!0]);class Rn{constructor(e,t,n){this.func=e,this.mask=t,this.range=n}}Rn.ReadOnly=!1,Rn.ReadWrite=!0,Rn.disabled=new Rn(519,Rn.ReadOnly,[0,1]);const Ln=7680;class zn{constructor(e,t,n,r,i,o){this.test=e,this.ref=t,this.mask=n,this.fail=r,this.depthFail=i,this.pass=o}}zn.disabled=new zn({func:519,mask:0},0,0,Ln,Ln,Ln);const Dn=1029,On=2305;class Fn{constructor(e,t,n){this.enable=e,this.mode=t,this.frontFace=n}}function Bn(t,n){const r=e.bC(t,3);e.a6.mat4.fromQuat(t,n),e.bE(t,3,r)}function Nn(t,n){const r=e.a6.quat.identity([]);return e.a6.quat.rotateZ(r,r,-n),e.a6.quat.rotateX(r,r,-t),r}function jn(t,n){const r=[t[0],t[1],0],i=[n[0],n[1],0];if(e.a6.vec3.length(r)>=1e-15){const t=e.a6.vec3.normalize([],r);e.a6.vec3.scale(i,t,e.a6.vec3.dot(i,t)),n[0]=i[0],n[1]=i[1]}const o=e.a6.vec3.cross([],n,t);if(e.a6.vec3.len(o)<1e-15)return null;const a=Math.atan2(-o[1],o[0]);return Nn(Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2]),a)}Fn.disabled=new Fn(!1,Dn,On),Fn.backCCW=new Fn(!0,Dn,On),Fn.backCW=new Fn(!0,Dn,2304),Fn.frontCW=new Fn(!0,1028,2304),Fn.frontCCW=new Fn(!0,1028,On);class Vn{constructor(e,t){this.position=e,this.orientation=t}get position(){return this._position}set position(t){if(t){const n=t instanceof e.a5?t:new e.a5(t[0],t[1],t[2]);this._renderWorldCopies&&(n.x=e.bA(n.x,0,1)),this._position=n}else this._position=null}lookAtPoint(t,n){if(this.orientation=null,!this.position)return;const r=this.position,i=this._elevation?this._elevation.getAtPointOrZero(e.a5.fromLngLat(t)):0,o=e.a5.fromLngLat(t,i),a=[o.x-r.x,o.y-r.y,o.z-r.z];n||(n=[0,0,1]),n[2]=Math.abs(n[2]),this.orientation=jn(a,n)}setPitchBearing(t,n){this.orientation=Nn(e.bB(t),e.bB(-n))}}class Un{constructor(t,n){this._transform=e.a6.mat4.identity([]),this.orientation=n,this.position=t}get mercatorPosition(){const t=this.position;return new e.a5(t[0],t[1],t[2])}get position(){const t=e.bC(this._transform,3);return[t[0],t[1],t[2]]}set position(t){var n;t&&e.bE(this._transform,3,[(n=t)[0],n[1],n[2],1])}get orientation(){return this._orientation}set orientation(t){this._orientation=t||e.a6.quat.identity([]),t&&Bn(this._transform,this._orientation)}getPitchBearing(){const e=this.forward(),t=this.right();return{bearing:Math.atan2(-t[1],t[0]),pitch:Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2])}}setPitchBearing(e,t){this._orientation=Nn(e,t),Bn(this._transform,this._orientation)}forward(){const t=e.bC(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=e.bC(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=e.bC(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(t,n){const r=new Float64Array(16);return e.a6.mat4.invert(r,this.getWorldToCamera(t,n)),r}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(t,n,r){const i=this.position;e.a6.vec3.scale(i,i,-t);const o=new Float64Array(16);return e.a6.mat4.fromScaling(o,[r,r,r]),e.a6.mat4.translate(o,o,i),o[10]*=n,o}getWorldToCamera(t,n){const r=new Float64Array(16),i=new Float64Array(4),o=this.position;return e.a6.quat.conjugate(i,this._orientation),e.a6.vec3.scale(o,o,-t),e.a6.mat4.fromQuat(r,i),e.a6.mat4.translate(r,r,o),r[1]*=-1,r[5]*=-1,r[9]*=-1,r[13]*=-1,r[8]*=n,r[9]*=n,r[10]*=n,r[11]*=n,r}getCameraToClipPerspective(t,n,r,i){const o=new Float64Array(16);return e.a6.mat4.perspective(o,t,n,r,i),o}getCameraToClipOrthographic(t,n,r,i,o,a){const s=new Float64Array(16);return e.a6.mat4.ortho(s,t,n,r,i,o,a),s}getDistanceToElevation(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=0===t?0:e.bD(t,n?e.aM(this.position[1]):this.position[1]),i=this.forward();return(r-this.position[2])/i[2]}clone(){return new Un([...this.position],[...this.orientation])}}const $n={BaseColor:5,MetallicRoughness:6,Normal:7,Occlusion:8,Emission:9,LUT:10,ShadowMap0:11};class Gn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=n,this.right=r}interpolate(t,n,r){return null!=n.top&&null!=t.top&&(this.top=e.aa(t.top,n.top,r)),null!=n.bottom&&null!=t.bottom&&(this.bottom=e.aa(t.bottom,n.bottom,r)),null!=n.left&&null!=t.left&&(this.left=e.aa(t.left,n.left,r)),null!=n.right&&null!=t.right&&(this.right=e.aa(t.right,n.right,r)),this}getCenter(t,n){const r=e.ap((this.left+t-this.right)/2,0,t),i=e.ap((this.top+n-this.bottom)/2,0,n);return new e.P(r,i)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Gn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const qn=(e,t,n)=>(1-n)*e+n*t,Wn=e=>e*e*e*e*e;class Hn{constructor(t,n,r,i,o,a,s){this.tileSize=512,this._renderWorldCopies=void 0===o||o,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=r??0,this._maxPitch=i??60,this.setProjection(a),this.setMaxBounds(s),this.width=0,this.height=0,this._center=new e.bK(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Gn,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new Un,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1}clone(){const e=new Hn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return e._elevation=this._elevation,e._centerAltitude=this._centerAltitude,e._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,e.tileSize=this.tileSize,e.mercatorFromTransition=this.mercatorFromTransition,e.width=this.width,e.height=this.height,e.cameraElevationReference=this.cameraElevationReference,e._center=this._center,e._setZoom(this.zoom),e._seaLevelZoom=this._seaLevelZoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._nearZ=this._nearZ,e._farZ=this._farZ,e._averageElevation=this._averageElevation,e._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._camera=this._camera.clone(),e._calcMatrices(),e.freezeTileCoverage=this.freezeTileCoverage,e.frustumCorners=this.frustumCorners,e}get isOrthographic(){return"globe"!==this.projection.name&&this._orthographicProjectionAtLowPitch&&this.pitch<15}get elevation(){return this._elevation}set elevation(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices())}get depthOcclusionForSymbolsAndCircles(){return"globe"!==this.projection.name&&!this.isOrthographic}updateElevation(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||n)&&this._updateCameraOnTerrain(),(e||n)&&this._constrainCamera(t),this._calcMatrices()}getProjection(){return e.ar(this.projection,["name","center","parallels"])}setProjection(t){this.projectionOptions=t||{name:"mercator"};const n=this.projection?this.getProjection():void 0;this.projection=e.bL(this.projectionOptions);const r=this.getProjection(),i=!e.bh(n,r);return i&&this._calcMatrices(),this.mercatorFromTransition=!1,i}setOrthographicProjectionAtLowPitch(e){return this._orthographicProjectionAtLowPitch!==e&&(this._orthographicProjectionAtLowPitch=e,this._calcMatrices(),!0)}setMercatorFromTransition(){const t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=e.bL({name:"mercator"});const n=t!==this.projection.name;return n&&this._calcMatrices(),n}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get cameraWorldSize(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return e.bD(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return e.bA(this.rotation,-180,180)}set bearing(e){this.rotation=e}get rotation(){return-this.angle/Math.PI*180}set rotation(t){const n=-t*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=e.a6.mat2.create(),e.a6.mat2.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=e.ap(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=e.bB(t),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(e){this._averageElevation=e,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._setZoom(t),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(e){this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(e){this._tileCoverLift!==e&&(this._tileCoverLift=e)}_updateCameraOnTerrain(){const e=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,t=this.elevation&&e===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>0&&this._centerAltitudeValidForExaggeration;if(!this._elevation||e===Number.NEGATIVE_INFINITY&&(!t||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const n=this._elevation;t||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&n.exaggeration()&&this._centerAltitudeValidForExaggeration!==n.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*n.exaggeration(),this._centerAltitudeValidForExaggeration=n.exaggeration()):(this._centerAltitude=e||0,this._centerAltitudeValidForExaggeration=n.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const t=this._elevation,n=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],r=this.horizonLineFromTop();let i=0,o=0;for(let a=0;a{const l=e.c1(n,t,r,o,a);s.has(l)||(i.push(new e.aA(t,n,r,o,a)),s.add(l))};for(let e=0;e0,p=s.y+10,g=i.wrap-(f?0:1),_=i.wrap+(d?0:1),y=f?s.x-1:h-1,v=d?s.x+1:0;if(o)r[0]<0?(l(c,_,s.z,v,s.y),r[1]<0&&p&&(l(c,u,s.z,s.x,s.y+1),l(c,_,s.z,v,s.y+1)),r[1]>0&&m&&(l(c,u,s.z,s.x,s.y-1),l(c,_,s.z,v,s.y-1))):r[0]>0?(l(c,g,s.z,y,s.y),r[1]<0&&p&&(l(c,u,s.z,s.x,s.y+1),l(c,g,s.z,y,s.y+1)),r[1]>0&&m&&(l(c,u,s.z,s.x,s.y-1),l(c,g,s.z,y,s.y-1))):r[1]<0&&p?l(c,u,s.z,s.x,s.y+1):m&&l(c,u,s.z,s.x,s.y-1);else{const e=i.visibleQuadrants;1&e&&(l(c,g,s.z,y,s.y),m&&(l(c,u,s.z,s.x,s.y-1),l(c,g,s.z,y,s.y-1))),2&e&&(l(c,_,s.z,v,s.y),m&&(l(c,u,s.z,s.x,s.y-1),l(c,_,s.z,v,s.y-1))),4&e&&(l(c,g,s.z,y,s.y),p&&(l(c,u,s.z,s.x,s.y+1),l(c,g,s.z,y,s.y+1))),8&e&&(l(c,_,s.z,v,s.y),p&&(l(c,u,s.z,s.x,s.y+1),l(c,_,s.z,v,s.y+1)))}}const c=[];for(const e of i)i.some((t=>e.isChildOf(t)))||c.push(e);if(i=c.filter((e=>!t.some((t=>!!(e.overscaledZ{const t=e.canonical.x+.5-r[0],n=e.canonical.y+.5-r[1];return t*t+n*nt.maxzoom&&(n=t.maxzoom);const s=this.locationCoordinate(this.center),l=this.center.lat,c=1<{const n=1/4e4,r=new e.a5(t.x+n,t.y,t.z),i=new e.a5(t.x,t.y+n,t.z),o=t.toLngLat(),a=r.toLngLat(),s=i.toLngLat(),l=this.locationCoordinate(o),c=this.locationCoordinate(a),u=this.locationCoordinate(s),h=Math.hypot(c.x-l.x,c.y-l.y),d=Math.hypot(u.x-l.x,u.y-l.y);return Math.sqrt(h*d)*S/n},A=t=>{const n=b,r=w;return{aabb:e.bR(this,c,0,0,0,t,r,n,this.projection),zoom:0,x:0,y:0,minZ:r,maxZ:n,wrap:t,fullyVisible:!1}},E=[];let T=[];const C=n,k=t.reparseOverscaled?r:n,I=(g-this._centerAltitude)*m,P=e=>{if(!this._elevation||!e.tileID||!a)return;const t=this._elevation.getMinMaxForTile(e.tileID),n=e.aabb;t?(n.min[2]=t.min,n.max[2]=t.max,n.center[2]=(n.min[2]+n.max[2])/2):(e.shouldSplit=L(e),e.shouldSplit||(n.min[2]=n.max[2]=n.center[2]=this._centerAltitude))},R=(e,t)=>{if(.707*t{if(t.zoom=.9)return!0}else if(o&&(s=t.aabb.distanceZ(_)*m),this.projection.isReprojectedInTileSpace&&r<=5){const n=Math.pow(2,t.zoom),r=M(new e.a5((t.x+.5)/n,(t.y+.5)/n));c=r>.85?1:r}if(!a){const e=Math.sqrt(n*n+i*i+s*s);let r=(1<0;){const r=E.pop(),i=r.x,s=r.y;let l=r.fullyVisible;const d=()=>"globe"===this.projection.name&&(0===r.y||r.y===(1<>1),d={aabb:a?r.aabb.quadrant(t):e.bR(this,c,r.zoom+1,n,u,r.wrap,r.minZ,r.maxZ,this.projection),zoom:r.zoom+1,x:n,y:u,wrap:r.wrap,fullyVisible:l,tileID:void 0,shouldSplit:void 0,minZ:r.minZ,maxZ:r.maxZ};o&&!h&&(d.tileID=new e.aA(r.zoom+1===C?k:r.zoom+1,r.wrap,r.zoom+1,n,u),P(d)),E.push(d)}else{const o=r.zoom===C?k:r.zoom;if(t.minzoom&&t.minzoom>o)continue;let a=0;if(!l){let n=y?r.aabb.intersectsPrecise(f):r.aabb.intersectsPreciseFlat(f);if(0===n&&d()){const t=new e.bP(r.zoom,i,s);n=e.bQ(this,c,t,!0).intersectsPrecise(f)}if(0===n)continue;if(t.calculateQuadrantVisibility)if(f.containsPoint(r.aabb.center))a=15;else for(let e=0;e<4;e++)0!==r.aabb.quadrant(e).intersects(f)&&(a|=1<{const o=[0,0,0,1],a=[e.ab,e.ab,0,1],s=this.calculateFogTileMatrix(i.tileID.toUnwrapped());e.a6.vec4.transformMat4(o,o,s),e.a6.vec4.transformMat4(a,a,s);const l=e.a6.vec4.min([],o,a),c=e.a6.vec4.max([],o,a),u=e.bS(l,c);if(0===u)return!0;let h=!1;const d=this._elevation;if(d&&u>n&&0!==r){const n=this.calculateProjMatrix(i.tileID.toUnwrapped());let o;t.isTerrainDEM||(o=d.getMinMaxForTile(i.tileID)),o||(o={min:w,max:b});const a=e.c3(this.rotation),s=[a[0]*e.ab,a[1]*e.ab,o.max];e.a6.vec3.transformMat4(s,s,n),h=(1-s[1])*this.height*.5e.distanceSq-t.distanceSq)).map((e=>e.tileID))}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(t){const n=e.ap(t.lat,-e.bT,e.bT),r=this.projection.project(t.lng,n);return new e.P(r.x*this.worldSize,r.y*this.worldSize)}unproject(e){return this.projection.unproject(e.x/this.worldSize,e.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/e.bD(1,this.center.lat)/this.worldSize}setLocationAtPoint(t,n){let r,i;const o=this.centerPoint;if("globe"===this.projection.name){const e=this.worldSize;r=(n.x-o.x)/e,i=(n.y-o.y)/e}else{const e=this.pointCoordinate(n),t=this.pointCoordinate(o);r=e.x-t.x,i=e.y-t.y}const a=this.locationCoordinate(t);this.setLocation(new e.a5(a.x-r,a.y-i))}setLocation(e){this.center=this.coordinateLocation(e),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(e){return this.projection.locationPoint(this,e)}locationPoint3D(e){return this.projection.locationPoint(this,e,!0)}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}pointLocation3D(e){return this.coordinateLocation(this.pointCoordinate3D(e))}locationCoordinate(t,n){const r=n?e.bD(n,t.lat):void 0,i=this.projection.project(t.lng,t.lat);return new e.a5(i.x,i.y,r)}coordinateLocation(e){return this.projection.unproject(e.x,e.y)}pointRayIntersection(t,n){const r=null!=n?n:this._centerAltitude,i=[t.x,t.y,0,1],o=[t.x,t.y,1,1];e.a6.vec4.transformMat4(i,i,this.pixelMatrixInverse),e.a6.vec4.transformMat4(o,o,this.pixelMatrixInverse);const a=o[3];e.a6.vec4.scale(i,i,1/i[3]),e.a6.vec4.scale(o,o,1/a);const s=i[2],l=o[2];return{p0:i,p1:o,t:s===l?0:(r-s)/(l-s)}}screenPointToMercatorRay(t){const n=[t.x,t.y,0,1],r=[t.x,t.y,1,1];return e.a6.vec4.transformMat4(n,n,this.pixelMatrixInverse),e.a6.vec4.transformMat4(r,r,this.pixelMatrixInverse),e.a6.vec4.scale(n,n,1/n[3]),e.a6.vec4.scale(r,r,1/r[3]),n[2]=e.bD(n[2],this._center.lat)*this.worldSize,r[2]=e.bD(r[2],this._center.lat)*this.worldSize,e.a6.vec4.scale(n,n,1/this.worldSize),e.a6.vec4.scale(r,r,1/this.worldSize),new e.aj([n[0],n[1],n[2]],e.a6.vec3.normalize([],e.a6.vec3.sub([],r,n)))}rayIntersectionCoordinate(t){const{p0:n,p1:r,t:i}=t,o=e.bD(n[2],this._center.lat),a=e.bD(r[2],this._center.lat);return new e.a5(e.aa(n[0],r[0],i)/this.worldSize,e.aa(n[1],r[1],i)/this.worldSize,e.aa(o,a,i))}pointCoordinate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._centerAltitude;return this.projection.pointCoordinate(this,e.x,e.y,t)}pointCoordinate3D(t){if(!this.elevation)return this.pointCoordinate(t);let n=this.projection.pointCoordinate3D(this,t.x,t.y);if(n)return new e.a5(n[0],n[1],n[2]);let r=0,i=this.horizonLineFromTop();if(t.y>i)return this.pointCoordinate(t);const o=.02*i,a=t.clone();for(let s=0;s<10&&i-r>o;s++){a.y=e.aa(r,i,.66);const t=this.projection.pointCoordinate3D(this,a.x,a.y);t?(i=a.y,n=t):r=a.y}return n?new e.a5(n[0],n[1],n[2]):this.pointCoordinate(t)}isPointAboveHorizon(e){return this.projection.isPointAboveHorizon(this,e)}isPointOnSurface(t){if(t.y<0||t.y>this.height||t.x<0||t.x>this.width)return!1;if(this.elevation||this.zoom>=e.bU)return!this.isPointAboveHorizon(t);const n=this.pointCoordinate(t);return n.y>=0&&n.y<=1}_coordinatePoint(t,n){const r=n&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,i=[t.x*this.worldSize,t.y*this.worldSize,r+t.toAltitude(),1];return e.a6.vec4.transformMat4(i,i,this.pixelMatrix),i[3]>0?new e.P(i[0]/i[3],i[1]/i[3]):new e.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:t,left:n}=this._edgeInsets,r=this.height-this._edgeInsets.bottom,i=this.width-this._edgeInsets.right,o=this.pointLocation3D(new e.P(n,t)),a=this.pointLocation3D(new e.P(i,t)),s=this.pointLocation3D(new e.P(i,r)),l=this.pointLocation3D(new e.P(n,r));let c=Math.min(o.lng,a.lng,s.lng,l.lng),u=Math.max(o.lng,a.lng,s.lng,l.lng),h=Math.min(o.lat,a.lat,s.lat,l.lat),d=Math.max(o.lat,a.lat,s.lat,l.lat);const f=Math.pow(2,-this.zoom)/16*270,p="globe"===this.projection.name?1:4,m=(t,n,r,i,o)=>{const a=(t+r)/2,s=(n+i)/2,l=new e.P(a,s),{lng:g,lat:_}=this.pointLocation3D(l),y=Math.max(0,c-g,h-_,g-u,_-d);c=Math.min(c,g),u=Math.max(u,g),h=Math.min(h,_),d=Math.max(d,_),(of)&&(m(t,n,a,s,o+1),m(a,s,r,i,o+1))};if(m(n,t,i,t,1),m(i,t,i,r,1),m(i,r,n,r,1),m(n,r,n,t,1),"globe"===this.projection.name){const[t,n]=e.bV(this);t?(d=90,u=180,c=-180):n&&(h=-90,u=180,c=-180)}return new e.as(new e.bK(c,h),new e.bK(u,d))}_getBoundsRectangular(t,n){const{top:r,left:i}=this._edgeInsets,o=this.height-this._edgeInsets.bottom,a=this.width-this._edgeInsets.right,s=new e.P(i,r),l=new e.P(a,r),c=new e.P(a,o),u=new e.P(i,o);let h=this.pointCoordinate(s,t),d=this.pointCoordinate(l,t);const f=this.pointCoordinate(c,n),p=this.pointCoordinate(u,n),m=(e,t)=>(t.y-e.y)/(t.x-e.x);return h.y>1&&d.y>=0?h=new e.a5((1-p.y)/m(p,h)+p.x,1):h.y<0&&d.y<=1&&(h=new e.a5(-p.y/m(p,h)+p.x,0)),d.y>1&&h.y>=0?d=new e.a5((1-f.y)/m(f,d)+f.x,1):d.y<0&&h.y<=1&&(d=new e.a5(-f.y/m(f,d)+f.x,0)),(new e.as).extend(this.coordinateLocation(h)).extend(this.coordinateLocation(d)).extend(this.coordinateLocation(p)).extend(this.coordinateLocation(f))}_getBoundsRectangularTerrain(){const e=this.elevation;if(!e.visibleDemTiles.length||e.isUsingMockSource())return this._getBoundsRectangular(0,0);const t=e.visibleDemTiles.reduce(((e,t)=>{if(t.dem){const n=t.dem.tree;e.min=Math.min(e.min,n.minimums[0]),e.max=Math.max(e.max,n.maximums[0])}return e}),{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(t.min*e.exaggeration(),t.max*e.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,n=this.height/2-t*(1-this._horizonShift);return e?Math.max(0,n):n}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-e.bT,this.maxLat=e.bT,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLng1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=t.key;let o;if(o=r?this._expandedProjMatrixCache:n?this._alignedProjMatrixCache:this._projMatrixCache,o[i])return o[i];const a=this.calculatePosMatrix(t,this.worldSize);let s;return s=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:r?this.expandedFarZProjMatrix:n?this.alignedProjMatrix:this.projMatrix,e.a6.mat4.multiply(a,s,a),o[i]=new Float32Array(a),o[i]}calculatePixelsToTileUnitsMatrix(t){const n=t.tileID.key,r=this._pixelsToTileUnitsCache;if(r[n])return r[n];const i=e.bW(t,this);return r[n]=i,r[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){const t=1/this.worldSize,n=e.a6.mat4.fromScaling([],[t,t,t]);return e.a6.mat4.multiply(n,n,this.globeMatrix),n}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const t=this._elevation;this._updateCameraState();const n=e.bD(1,this._center.lat)*this.worldSize,r=this._computeCameraPosition(n),i=this._camera.forward(),o=e.bD(1,this._center.lat);r[2]/=o,i[2]/=o,e.a6.vec3.normalize(i,i);const a=t.raycast(r,i,t.exaggeration());if(a){const t=e.a6.vec3.scaleAndAdd([],r,i,a),n=new e.a5(t[0],t[1],e.bD(t[2],e.aM(t[1]))),s=(n.z+e.a6.vec3.length([n.x-r[0],n.y-r[1],n.z-r[2]*o]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(s),this._centerAltitude=n.toAltitude(),this._center=this.coordinateLocation(n),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._elevation)return;const n=this._elevation,r=e.bD(1,this._center.lat)*this.worldSize,i=this._computeCameraPosition(r),o=n.getAtPointOrZero(new e.a5(...i)),a=this.pixelsPerMeter/this.worldSize*o,s=this._minimumHeightOverTerrain(),l=i[2]-a;if(l<=s)if(l<0||t){const t=this.locationCoordinate(this._center,this._centerAltitude),n=[i[0],i[1],t.z-i[2]],r=e.a6.vec3.length(n);n[2]-=(s-l)/this._pixelsPerMercatorPixel;const o=e.a6.vec3.length(n);if(0===o)return;e.a6.vec3.scale(n,n,r/o*this._pixelsPerMercatorPixel),this._camera.position=[i[0],i[1],t.z*this._pixelsPerMercatorPixel-n[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||t){const n=this.center;return n.lat=e.ap(n.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!t)&&(n.lng=e.ap(n.lng,this.minLng,this.maxLng)),this.center=n,void(this._constraining=!1)}const n=this._unmodified,{x:r,y:i}=this.point;let o=0,a=r,s=i;const l=this.width/2,c=this.height/2,u=this.worldMinY*this.scale,h=this.worldMaxY*this.scale;if(i-ch&&(s=h-c),h-ut&&(a=t-l),t-e{for(let i=0;i<16;i++)e[i]=qn(t[i],n[i],r)})(s,s,l,Wn(this.pitch>=15?1:this.pitch/15))}else s=l;const c=e.a6.mat4.mul([],l,a);let u=e.a6.mat4.mul([],s,a);if(this.projection.isReprojectedInTileSpace){const t=this.locationCoordinate(this.center),n=e.a6.mat4.identity([]);e.a6.mat4.translate(n,n,[t.x*this.worldSize,t.y*this.worldSize,0]),e.a6.mat4.multiply(n,n,e.bY(this)),e.a6.mat4.translate(n,n,[-t.x*this.worldSize,-t.y*this.worldSize,0]),e.a6.mat4.multiply(u,u,n),e.a6.mat4.multiply(c,c,n),this.inverseAdjustmentMatrix=e.bZ(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=e.a6.mat4.scale([],u,[this.worldSize,this.worldSize,this.worldSize/o,1]),this.projMatrix=u,this.invProjMatrix=e.a6.mat4.invert(new Float64Array(16),this.projMatrix),n){const n=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);n[8]=2*-t.x/this.width,n[9]=2*t.y/this.height,this.expandedFarZProjMatrix=e.a6.mat4.mul([],n,a)}else this.expandedFarZProjMatrix=this.projMatrix;const h=e.a6.mat4.invert([],s);this.frustumCorners=e.b_.fromInvProjectionMatrix(h,this.horizonLineFromTop(),this.height),this.cameraFrustum=e.bN.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!n);const d=new Float32Array(16);e.a6.mat4.identity(d),e.a6.mat4.scale(d,d,[1,-1,1]),e.a6.mat4.rotateX(d,d,this._pitch),e.a6.mat4.rotateZ(d,d,this.angle);const f=e.a6.mat4.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=e.a6.mat4.clone(f);const p=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;f[8]=2*-t.x/this.width,f[9]=2*(t.y+p)/this.height,this.skyboxMatrix=e.a6.mat4.multiply(d,f,d);const m=this.point,g=m.x,_=m.y,y=this.width%2/2,v=this.height%2/2,x=Math.cos(this.angle),b=Math.sin(this.angle),w=g-Math.round(g)+x*y+b*v,S=_-Math.round(_)+x*v+b*y,M=new Float64Array(u);if(e.a6.mat4.translate(M,M,[w>.5?w-1:w,S>.5?S-1:S,0]),this.alignedProjMatrix=M,u=e.a6.mat4.create(),e.a6.mat4.scale(u,u,[this.width/2,-this.height/2,1]),e.a6.mat4.translate(u,u,[1,-1,0]),this.labelPlaneMatrix=u,u=e.a6.mat4.create(),e.a6.mat4.scale(u,u,[1,-1,1]),e.a6.mat4.translate(u,u,[-1,-1,0]),e.a6.mat4.scale(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u,this.pixelMatrix=e.a6.mat4.multiply(new Float64Array(16),this.labelPlaneMatrix,c),this._calcFogMatrices(),this._distanceTileDataCache={},u=e.a6.mat4.invert(new Float64Array(16),this.pixelMatrix),!u)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=u,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=e.b$(this);const t=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=e.a6.vec3.transformMat4(t,t,a),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=u;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,n=this.cameraPixelsPerMeter,r=this._camera.position,i=1/this.height/this._pixelsPerMercatorPixel,o=[t,t,n];e.a6.vec3.scale(o,o,i),e.a6.vec3.scale(r,r,-1),e.a6.vec3.multiply(r,r,o);const a=e.a6.mat4.create();e.a6.mat4.translate(a,a,r),e.a6.mat4.scale(a,a,o),this.mercatorFogMatrix=a,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,n,i)}_computeCameraPosition(e){const t=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,n=this._camera.forward(),r=this.point,i=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*t-e/this.worldSize*this._centerAltitude;return[r.x/this.worldSize-n[0]*i,r.y/this.worldSize-n[1]*i,e/this.worldSize*this._centerAltitude-n[2]*i]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(t){const n=this._maxCameraBoundsDistance()*Math.cos(this._pitch),r=this._camera.position[2],i=t[2];let o=1;this.projection.wrap&&(this.center=this.center.wrap()),i>0&&(o=Math.min((n-r)/i,1)),this._camera.position=e.a6.vec3.scaleAndAdd([],this._camera.position,t,o),this._updateStateFromCamera()}_updateStateFromCamera(){const t=this._camera.position,n=this._camera.forward(),{pitch:r,bearing:i}=this._camera.getPitchBearing(),o=e.bD(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,a=this._mercatorZfromZoom(this._maxZoom)*Math.cos(e.bB(this._maxPitch)),s=Math.max((t[2]-o)/Math.cos(r),a),l=this._zoomFromMercatorZ(s);e.a6.vec3.scaleAndAdd(t,t,n,s),this._pitch=e.ap(r,e.bB(this.minPitch),e.bB(this.maxPitch)),this.angle=e.bA(i,-Math.PI,Math.PI),this._setZoom(e.ap(l,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new e.a5(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(e){return Math.pow(2,e)*this.tileSize}_mercatorZfromZoom(e){return this.cameraToCenterDistance/this._worldSizeFromZoom(e)}_minimumHeightOverTerrain(){const e=Math.min(null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(e)}_zoomFromMercatorZ(e){return this.scaleZoom(this.cameraToCenterDistance/(e*this.tileSize))}zoomFromMercatorZAdjusted(t){let n=0,r=e.bU,i=0,o=1/0;for(;r-n>1e-6&&r>n;){const e=n+.5*(r-n),a=this.tileSize*Math.pow(2,e),s=this.getCameraToCenterDistance(this.projection,e,a),l=this.scaleZoom(s/(t*this.tileSize)),c=Math.abs(e-l);cc||n.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+e.c0(this.fovAboveCenter)>88||this.anyCornerOffEdge(new e.P(0,0),new e.P(this.width,this.height))}zoomDeltaToMovement(t,n){const r=e.a6.vec3.length(e.a6.vec3.sub([],this._camera.position,t)),i=this._zoomFromMercatorZ(r)+n;return r-this._mercatorZfromZoom(i)}getCameraPoint(){if("globe"===this.projection.name){const t=function(t,n){let[r,i,o]=t;const a=[r,i,o,1];e.a6.vec4.transformMat4(a,a,n);const s=a[3]=Math.max(a[3],1e-6);return a[0]/=s,a[1]/=s,a[2]/=s,a}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new e.P(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}}getCameraToCenterDistance(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.zoom,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.worldSize;const i=e.bX(t,n,this.width,this.height,1024),o=t.pixelSpaceConversion(this.center.lat,r,i);let a=.5/Math.tan(.5*this._fov)*this.height*o;return this.isOrthographic&&(a=qn(1,a,Wn(this.pitch>=15?1:this.pitch/15))),a}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&e.a6.mat4.multiply(t,t,this.globeMatrix),t}getFrustum(t){return e.bN.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,t,"meters"===this.projection.zAxisUnit)}}const Zn=(t,n)=>{if(n>0&&t.terrain&&e.w("Cutoff is currently disabled on terrain"),n<=0||t.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const r=t.transform,i=Math.max(Math.abs(r._zoom-(t.minCutoffZoom-1)),1),o=r.isLODDisabled(!1)?e.a7(60,45,r.pitch):e.a7(30,15,r.pitch),a=r._farZ-r._nearZ,s=n*r.height,l=((1-(c=o))*r.cameraToCenterDistance+c*(r._farZ+s))*i;var c;return{shouldRenderCutoff:o<1,uniformValues:{u_cutoff_params:[r._nearZ,r._farZ,(l-r._nearZ)/a,(l-s-r._nearZ)/a]}}},Yn={cascadeCount:2,normalOffset:3,shadowMapResolution:2048};class Xn{constructor(e,t){this.aabb=e,this.lastCascade=t}}class Kn{add(e,t){const n=this.receivers[e.key];void 0!==n?(n.aabb.min[0]=Math.min(n.aabb.min[0],t.min[0]),n.aabb.min[1]=Math.min(n.aabb.min[1],t.min[1]),n.aabb.min[2]=Math.min(n.aabb.min[2],t.min[2]),n.aabb.max[0]=Math.max(n.aabb.max[0],t.max[0]),n.aabb.max[1]=Math.max(n.aabb.max[1],t.max[1]),n.aabb.max[2]=Math.max(n.aabb.max[2],t.max[2])):this.receivers[e.key]=new Xn(t,null)}clear(){this.receivers={}}get(e){return this.receivers[e.key]}computeRequiredCascades(t,n,r){const i=e.c9.fromPoints(t.points);let o=0;for(const a in this.receivers){const t=this.receivers[a];if(!t)continue;if(!i.intersectsAabb(t.aabb))continue;t.aabb.min=i.closestPoint(t.aabb.min),t.aabb.max=i.closestPoint(t.aabb.max);const s=t.aabb.getCorners();for(let i=0;i1||o[1]<-1||o[1]>1){a=!1;break}}if(t.lastCascade=i,o=Math.max(o,i),a)break}}return o+1}}class Jn{constructor(e){this.painter=e,this._enabled=!1,this._shadowLayerCount=0,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new Kn,this._depthMode=new Rn(e.context.gl.LEQUAL,Rn.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this.useNormalOffset=!1,e.tp.registerParameter(this,["Shadows"],"_forceDisable",{label:"forceDisable"},(()=>{this.painter.style.map.triggerRepaint()})),e.tp.registerParameter(Yn,["Shadows"],"cascadeCount",{min:1,max:2,step:1}),e.tp.registerParameter(Yn,["Shadows"],"normalOffset",{min:0,max:10,step:.05}),e.tp.registerParameter(Yn,["Shadows"],"shadowMapResolution",{min:32,max:2048,step:32}),e.tp.registerBinding(this,["Shadows"],"_numCascadesToRender",{readonly:!0,label:"numCascadesToRender"})}destroy(){for(const e of this._cascades)e.texture.destroy(),e.framebuffer.destroy();this._cascades=[]}updateShadowParameters(t,n){const r=this.painter;if(this._enabled=!1,this._shadowLayerCount=0,this._receivers.clear(),!n||!n.properties)return;const i=n.properties.get("shadow-intensity");if(!n.shadowsEnabled()||i<=0)return;if(this._shadowLayerCount=r.style.order.reduce(((e,n)=>{const i=r.style._mergedLayers[n];return e+(i.hasShadowPass()&&!i.isHidden(t.zoom)?1:0)}),0),this._enabled=this._shadowLayerCount>0,!this.enabled)return;const o=r.context,a=Yn.shadowMapResolution,s=Yn.shadowMapResolution;if(0===this._cascades.length||Yn.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let t=0;te.dem)).forEach((e=>{const t=e.dem.tree;n[0]=Math.min(n[0],t.minimums[0]),n[1]=Math.max(n[1],t.maximums[0])})),1e4!==n[0]&&(l=(n[1]-n[0])*e.exaggeration())}const c=1.5*t.cameraToCenterDistance,u=3*c,h=new Float64Array(16);for(let p=0;p3&&void 0!==arguments[3]?arguments[3]:0;if(!this.enabled)return;const o=this.painter.transform,a=this.painter.context,s=a.gl,l=this._uniformValues,c=new Float64Array(16),u=o.calculatePosMatrix(t,o.worldSize);for(let h=0;h2&&void 0!==arguments[2]&&arguments[2];if(!this.enabled)return;const i=this.painter.context,o=i.gl,a=this._uniformValues,s=new Float64Array(16);for(let l=0;l=0)return{};const o=function(t,n,r){const i=r/(1<0&&(e.a6.vec3.add(o[1],o[1],[i[0]*a,0,0]),e.a6.vec3.add(o[2],o[2],[i[0]*a,0,0])),i[1]<0?(e.a6.vec3.add(o[0],o[0],[0,i[1]*a,0]),e.a6.vec3.add(o[1],o[1],[0,i[1]*a,0])):i[1]>0&&(e.a6.vec3.add(o[2],o[2],[0,i[1]*a,0]),e.a6.vec3.add(o[3],o[3],[0,i[1]*a,0]));const s={};return s.vertices=o,s.planes=[Qn(o[1],o[0],o[4]),Qn(o[2],o[1],o[5]),Qn(o[3],o[2],o[6]),Qn(o[0],o[3],o[7])],s}addShadowReceiver(t,n,r){this._receivers.add(t,e.c9.fromTileIdAndHeight(t,n,r))}getMaxCascadeForTile(e){const t=this._receivers.get(e);return t&&t.lastCascade?t.lastCascade:0}}function Qn(t,n,r){const i=e.a6.vec3.sub([],r,n),o=e.a6.vec3.sub([],t,n),a=e.a6.vec3.cross([],i,o),s=e.a6.vec3.length(a);return 0===s?[0,0,1,0]:(e.a6.vec3.scale(a,a,1/s),[a[0],a[1],a[2],-e.a6.vec3.dot(a,n)])}function er(t){const n=t.properties.get("direction"),r=e.c7(n.x,n.y,n.z);r[2]=e.ap(r[2],0,75);const i=e.ca([r[0],r[1],r[2]]);return e.a6.vec3.fromValues(i.x,i.y,i.z)}function tr(t,n,r){const i=n.properties.get("color"),o=n.properties.get("intensity"),a=n.properties.get("direction"),s=[a.x,a.y,a.z],l=r.properties.get("color"),c=r.properties.get("intensity"),u=Math.max(e.a6.vec3.dot([0,0,1],s),0),h=[0,0,0];e.a6.vec3.scale(h,l.toRenderColor(t.getLut(n.scope)).toArray01Linear().slice(0,3),c);const d=[0,0,0];return e.a6.vec3.scale(d,i.toRenderColor(t.getLut(r.scope)).toArray01Linear().slice(0,3),u*o),e.cb([h[0]>0?h[0]/(h[0]+d[0]):0,h[1]>0?h[1]/(h[1]+d[1]):0,h[2]>0?h[2]/(h[2]+d[2]):0])}function nr(t,n,r,i,o,a){const s=t.zoom,l=t.scale,c=t.worldSize,u=1/c,h=t.aspect,d=Math.sqrt(1+h*h)*Math.tan(.5*t.fovX),f=d*d,p=i-r,m=i+r;let g,_;f>p/m?(g=i,_=i*d):(g=.5*m*(1+f),_=.5*Math.sqrt(p*p+2*(i*i+r*r)*f+m*m*f*f));const y=t.projection.pixelsPerMeter(t.center.lat,c),v=t._camera.getCameraToWorldMercator(),x=[0,0,-g*u];e.a6.vec3.transformMat4(x,x,v);let b=_*u;const w=t._edgeInsets;if(!(0===w.left&&0===w.top&&0===w.right&&0===w.bottom||w.left===w.right&&w.top===w.bottom)){const n=t._camera.getWorldToCamera(t.worldSize,"meters"===t.projection.zAxisUnit?y:1),o=t._camera.getCameraToClipPerspective(t._fov,t.width/t.height,r,i);o[8]=2*-t.centerOffset.x/t.width,o[9]=2*t.centerOffset.y/t.height;const a=new Float64Array(16);e.a6.mat4.mul(a,o,n);const u=new Float64Array(16);e.a6.mat4.invert(u,a);const h=e.bN.fromInvProjectionMatrix(u,c,s,!0);for(const r of h.points){const n=((S=r)[0]/=l,S[1]/=l,S[2]=e.bD(S[2],t._center.lat),S);b=Math.max(b,e.a6.vec3.len(e.a6.vec3.subtract([],x,n)))}}var S;b*=o/(o-1);const M=Math.acos(n[2]),A=Math.atan2(-n[0],-n[1]),E=new Un;E.position=x,E.setPitchBearing(M,A);const T=E.getWorldToCamera(c,y),C=b*c,k=Math.min(t._mercatorZfromZoom(17)*c*-2,-2*C),I=E.getCameraToClipOrthographic(-C,C,-C,C,k,(C+a*y)/n[2]),P=new Float64Array(16);e.a6.mat4.multiply(P,I,T);const R=e.a6.vec3.fromValues(Math.floor(1e6*x[0])/1e6*c,Math.floor(1e6*x[1])/1e6*c,0),L=.5*o,z=[0,0,0];e.a6.vec3.transformMat4(z,R,P),e.a6.vec3.scale(z,z,L);const D=[Math.floor(z[0]),Math.floor(z[1]),Math.floor(z[2])],O=[0,0,0];e.a6.vec3.sub(O,z,D),e.a6.vec3.scale(O,O,-1/L);const F=new Float64Array(16);return e.a6.mat4.identity(F),e.a6.mat4.translate(F,F,O),e.a6.mat4.multiply(P,F,P),[P,C]}class rr extends e.E{constructor(e){super(),this.requestManager=e,this.models={"":{}},this.numModelsLoading={}}loadModel(t,n){return e.aG(this.requestManager.transformRequest(n,e.R.Model).url).then((n=>{if(!n)return;const r=e.aH(n),i=new e.aI(t,void 0,void 0,r);return i.computeBoundsAndApplyParent(),i})).catch((r=>{if(r&&404===r.status)return null;this.fire(new e.t(new Error(`Could not load model ${t} from ${n}: ${r.message}`)))}))}load(t,n){this.models[n]||(this.models[n]={});const r=Object.keys(t);this.numModelsLoading[n]=(this.numModelsLoading[n]||0)+r.length;const i=[];for(const e of r)i.push(this.loadModel(e,t[e]));Promise.allSettled(i).then((t=>{for(let e=0;e{this.fire(new e.t(new Error(`Could not load models: ${t.message}`)))}))}isLoaded(){for(const e in this.numModelsLoading)if(this.numModelsLoading[e]>0)return!1;return!0}hasModel(e,t){return!!this.getModel(e,t)}getModel(e,t){return this.models[t]||(this.models[t]={}),this.models[t][e]?this.models[t][e].model:void 0}addModel(e,t,n){this.models[n]||(this.models[n]={}),this.hasModel(e,n)&&this.models[n][e].numReferences++,this.load({[e]:this.requestManager.normalizeModelURL(t)},n)}addModels(e,t){this.models[t]||(this.models[t]={});const n={};for(const r in e)this.models[t][r]={},n[r]=this.requestManager.normalizeModelURL(e[r]);this.load(n,t)}addModelsFromBucket(e,t){this.models[t]||(this.models[t]={});const n={};for(const r of e)this.hasModel(r,t)?this.models[t][r].numReferences++:n[r]=this.requestManager.normalizeModelURL(r);this.load(n,t)}removeModel(e,t){if(this.models[t]&&this.models[t][e]&&(this.models[t][e].numReferences--,0===this.models[t][e].numReferences)){const n=this.models[t][e].model;delete this.models[t][e],n.destroy()}}listModels(e){return this.models[e]||(this.models[e]={}),Object.keys(this.models[e])}upload(e,t){this.models[t]||(this.models[t]={});for(const n in this.models[t])this.models[t][n].model&&this.models[t][n].model.upload(e.context)}}const ir=new e.a0({data:new e.a1(e._.colorTheme.data)}),or=(e,t)=>Ce(e,t&&t.filter((e=>"source.canvas"!==e.identifier))),ar=e.ar(At,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection","setCamera","addImport","removeImport","updateImport"]),sr=e.ar(At,["setCenter","setZoom","setBearing","setPitch"]),lr={version:8,layers:[],sources:{}},cr={duration:300,delay:0};class ur extends e.E{constructor(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.map=t,this.scope=n.scope||"",this.globalId=null,this.fragments=[],this.importDepth=n.importDepth||0,this.importsCache=n.importsCache||new Map,this.resolvedImports=n.resolvedImports||new Set,this.transition=e.l({},cr),this._buildingIndex=new wt(this),this.crossTileSymbolIndex=new kn,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._clipLayerPresent=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._changes=n.styleChanges||new U,this.dispatcher=n.dispatcher?n.dispatcher:new e.cd(e.ce(),this),n.imageManager?this.imageManager=n.imageManager:(this.imageManager=new G,this.imageManager.setEventedParent(this)),this.imageManager.createScope(this.scope),this.glyphManager=n.glyphManager?n.glyphManager:new e.cf(t._requestManager,n.localFontFamily?e.cg.all:n.localIdeographFontFamily?e.cg.ideographs:e.cg.none,n.localFontFamily||n.localIdeographFontFamily),n.modelManager?this.modelManager=n.modelManager:(this.modelManager=new rr(t._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._order=[],this._markersNeedUpdate=!1,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null},this._styleColorThemeForScope={},this.options=n.configOptions?n.configOptions:new Map,this._configDependentLayers=n.configDependentLayers?n.configDependentLayers:new Set,this._config=n.config,this._initialConfig=n.initialConfig,this.dispatcher.broadcast("setReferrer",e.ch());const r=this;this._rtlTextPluginCallback=ur.registerForPluginStateChange((t=>{r.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},((t,n)=>{if(e.ci(t),n&&n.every((e=>e)))for(const e in r._sourceCaches){const t=r._sourceCaches[e],n=t.getSource().type;"vector"!==n&&"geojson"!==n||t.reload()}}))})),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.getOwnSource(e.sourceId);if(t&&t.vectorLayerIds)for(const n in this._layers){const e=this._layers[n];e.source===t.id&&this._validateLayer(e)}}))}load(e){return e?("string"==typeof e?this.loadURL(e):this.loadJSON(e),this):this}_getGlobalId(t){if(!t)return null;if("string"==typeof t){if(e.f(t))return t;const n=e.cj(t);if(!n.startsWith("http"))try{return new URL(n,location.href).toString()}catch(e){return n}return n}return`json://${e.ck(JSON.stringify(t))}`}_diffStyle(t,n,r){this.globalId=this._getGlobalId(t);const i=(e,t)=>{try{t(null,this.setState(e,r))}catch(e){t(e,!1)}};if("string"==typeof t){const r=this.map._requestManager.normalizeStyleURL(t),o=this.map._requestManager.transformRequest(r,e.R.Style);e.n(o,((t,r)=>{t?this.fire(new e.t(t)):r&&i(r,n)}))}else"object"==typeof t&&i(t,n)}loadURL(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.fire(new e.x("dataloading",{dataType:"style"}));const r="boolean"==typeof n.validate?n.validate:!e.f(t);this.globalId=this._getGlobalId(t),t=this.map._requestManager.normalizeStyleURL(t,n.accessToken),this.resolvedImports.add(t);const i=this.importsCache.get(t);if(i)return this._load(i,r);const o=this.map._requestManager.transformRequest(t,e.R.Style);this._request=e.n(o,((n,i)=>{if(this._request=null,n)this.fire(new e.t(n));else if(i)return this.importsCache.set(t,i),this._load(i,r)}))}loadJSON(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.fire(new e.x("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(t),this._request=e.q.frame((()=>{this._request=null,this._load(t,!1!==n.validate)}))}loadEmpty(){this.fire(new e.x("dataloading",{dataType:"style"})),this._load(lr,!1)}_loadImports(t,n,r){if(this.importDepth>=4)return e.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const i=[];for(const e of t){const t=this._createFragmentStyle(e),o=new Promise((e=>{t.once("style.import.load",e),t.once("error",e)})).then((()=>this.mergeAll()));if(i.push(o),this.resolvedImports.has(e.url)){t.loadEmpty();continue}const a=e.data||this.importsCache.get(e.url);a?(t.loadJSON(a,{validate:n}),this._isInternalStyle(a)&&(t.globalId=null)):e.url?t.loadURL(e.url,{validate:n}):t.loadEmpty();const s={style:t,id:e.id,config:e.config};if(r){const e=this.fragments.findIndex((e=>{let{id:t}=e;return t===r}));this.fragments=this.fragments.slice(0,e).concat(s).concat(this.fragments.slice(e))}else this.fragments.push(s)}return Promise.allSettled(i)}getImportGlobalIds(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set;for(const n of e.fragments)n.style.globalId&&t.add(n.style.globalId),this.getImportGlobalIds(n.style,t);return[...t.values()]}_createFragmentStyle(t){const n=this.scope?e.av(t.id,this.scope):t.id;let r;const i=this._initialConfig&&this._initialConfig[n];(t.config||i)&&(r=e.l({},t.config,i));const o=new ur(this.map,{scope:n,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:r,configOptions:this.options,configDependentLayers:this._configDependentLayers});return o.setEventedParent(this.map,{style:o}),o}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.updateConfigDependencies(),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),this._shouldPrecompile=this.map._precompilePrograms&&this.isRootStyle()}_isInternalStyle(e){return this.isRootStyle()&&(e.fragment||!!e.schema&&!1!==e.fragment)}_load(t,n){const r=t.schema;if(this._isInternalStyle(t)){const r=e.l({},lr,{imports:[{id:"basemap",data:t,url:""}]});return void this._load(r,n)}if(this.updateConfig(this._config,r),n&&or(this,ge(t)))return;this._loaded=!0,this.stylesheet=e.cl(t);const i=()=>{for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1,isInitialLoad:!0});t.sprite?this._loadSprite(t.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),this.glyphManager.setURL(t.glyphs,this.scope);const r=Mt(this.stylesheet.layers);if(this._order=r.map((e=>e.id)),this.stylesheet.light&&e.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){const e=this.stylesheet.lights[0];this.light=new Ie(e.properties,e.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new Ie(this.stylesheet.light)),this._layers={},this._serializedLayers={};for(const t of r){const n=e.cq(t,this.scope,this._styleColorTheme.lut,this.options);0!==n.configDependencies.size&&this._configDependentLayers.add(n.fqid),n.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=n,this._serializedLayers[n.id]=n.serialize();const r=this.getOwnLayerSourceCache(n),i=!!this.directionalLight&&this.directionalLight.shadowsEnabled();r&&n.canCastShadows()&&i&&(r.castsShadows=!0)}this.stylesheet.models&&this.modelManager.addModels(this.stylesheet.models,this.scope);const i=this.stylesheet.terrain;i&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(i,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new e.x("data",{dataType:"style"}));const o=this.isRootStyle();t.imports?this._loadImports(t.imports,n).then((()=>{this._reloadImports(),this.fire(new e.x(o?"style.load":"style.import.load"))})):(this._reloadImports(),this.fire(new e.x(o?"style.load":"style.import.load")))},o=this.stylesheet["color-theme"];if(this._styleColorTheme.colorTheme=o,o){const t=this._evaluateColorThemeData(o);this._loadColorTheme(t).then((()=>{i()})).catch((t=>{e.w(`Couldn't load color theme from the stylesheet: ${t}`),i()}))}else this._styleColorTheme.lut=null,i()}isRootStyle(){return 0===this.importDepth}mergeAll(){let t,n,r,i,o,a,s,l;const c={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle((e=>{if(e.stylesheet){if(null!=e.light&&(t=e.light),e.stylesheet.lights)for(const t of e.stylesheet.lights)"ambient"===t.type&&null!=e.ambientLight&&(n=e.ambientLight),"directional"===t.type&&null!=e.directionalLight&&(r=e.directionalLight);i=this._prioritizeTerrain(i,e.terrain,e.stylesheet.terrain),e.stylesheet.fog&&null!=e.fog&&(o=e.fog),null!=e.stylesheet.camera&&(l=e.stylesheet.camera),null!=e.stylesheet.projection&&(a=e.stylesheet.projection),null!=e.stylesheet.transition&&(s=e.stylesheet.transition),c[e.scope]=e._styleColorTheme}})),this.light=t,this.ambientLight=n,this.directionalLight=r,this.fog=o,this._styleColorThemeForScope=c,null===i?delete this.terrain:this.terrain=i,this.camera=l||{"camera-projection":"perspective"},this.projection=a||{name:"mercator"},this.transition=e.l({},cr,s),this.mergeSources(),this.mergeLayers()}forEachFragmentStyle(e){const t=n=>{for(const e of n.fragments)t(e.style);e(n)};t(this)}_prioritizeTerrain(e,t,n){const r=e&&0===e.drapeRenderMode;return null===n?t&&0===t.drapeRenderMode?t:r?e:null:null!=t&&(!e||r||t&&1===t.drapeRenderMode)?t:e}mergeTerrain(){let e;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle((t=>{e=this._prioritizeTerrain(e,t.terrain,t.stylesheet.terrain)})),null===e?delete this.terrain:this.terrain=e}mergeProjection(){let e;this.forEachFragmentStyle((t=>{null!=t.stylesheet.projection&&(e=t.stylesheet.projection)})),this.projection=e||{name:"mercator"}}mergeSources(){const t={},n={},r={};this.forEachFragmentStyle((i=>{for(const n in i._sourceCaches){const r=e.av(n,i.scope);t[r]=i._sourceCaches[n]}for(const t in i._otherSourceCaches){const r=e.av(t,i.scope);n[r]=i._otherSourceCaches[t]}for(const t in i._symbolSourceCaches){const n=e.av(t,i.scope);r[n]=i._symbolSourceCaches[t]}})),this._mergedSourceCaches=t,this._mergedOtherSourceCaches=n,this._mergedSymbolSourceCaches=r}mergeLayers(){var t=this;const n={},r=[],i={};this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle((t=>{for(const i of t._order){const o=t._layers[i];if("slot"===o.type){const t=e.cm(i);if(n[t])continue;n[t]=[]}o.slot&&n[o.slot]?n[o.slot].push(o):r.push(o)}})),this._mergedOrder=[];const o=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(const a of r)if("slot"===a.type){const r=e.cm(a.id);n[r]&&o(n[r]),t._mergedSlots.push(r)}else{const n=e.av(a.id,a.scope);t._mergedOrder.push(n),i[n]=a,a.is3D()&&(t._has3DLayers=!0),"circle"===a.type&&(t._hasCircleLayers=!0),"symbol"===a.type&&(t._hasSymbolLayers=!0),"clip"===a.type&&(t._clipLayerPresent=!0)}};o(r),this._mergedOrder.sort(((e,t)=>{const n=i[e],r=i[t];return n.hasInitialOcclusionOpacityProperties?r.is3D()?1:0:n.is3D()&&r.hasInitialOcclusionOpacityProperties?-1:0})),this._mergedLayers=i,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged()}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(t){return this.stylesheet.camera=e.l({},this.stylesheet.camera,t),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(t){return t.data?function(t,n,r){const i=e.l({},n);for(const a of Object.keys(e._.colorTheme))void 0===i[a]&&(i[a]=e._.colorTheme[a].default);const o=new e.$(ir,t,new Map(r));return o.setTransitionOrValue(i,r),o.untransitioned().possiblyEvaluate(new e.a3(0))}(this.scope,t,this.options).get("data"):null}_loadColorTheme(t){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const n=this._styleColorTheme.lutLoadingCorrelationID;return new Promise(((r,i)=>{const o="data:image/png;base64,";if(!t||0===t.length)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void r();let a=t;a.startsWith(o)||(a=o+a);const s="mapbox-reserved-lut",l=new Image;l.src=a,l.onerror=()=>{this._styleColorTheme.lutLoading=!1,i(new Error("Failed to load image data"))},l.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==n)return void r();this._styleColorTheme.lutLoading=!1;const{width:o,height:a,data:c}=e.q.getImageData(l);if(a>32)return void i(new Error("The height of the image must be less than or equal to 32 pixels."));if(o!==a*a)return void i(new Error("The width of the image must be equal to the height squared."));this.getImage(s)&&this.removeImage(s),this.addImage(s,{data:new e.r({width:o,height:a},c),pixelRatio:1,sdf:!1,version:0});const u=this.imageManager.getImage(s,this.scope);u?(this._styleColorTheme.lut={image:u.data,data:t},r()):i(new Error("Missing LUT image."))}}))}getLut(e){const t=this._styleColorThemeForScope[e];return t?t.lut:null}setProjection(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(t){this._spriteRequest=function(t,n,r){let i,o,a;const s=e.q.devicePixelRatio>1?"@2x":"";let l=e.n(n.transformRequest(n.normalizeSpriteURL(t,s,".json"),e.R.SpriteJSON),((e,t)=>{l=null,a||(a=e,i=t,u())})),c=e.o(n.transformRequest(n.normalizeSpriteURL(t,s,".png"),e.R.SpriteImage),((e,t)=>{c=null,a||(a=e,o=t,u())}));function u(){if(a)r(a);else if(i&&o){const t=e.q.getImageData(o),n={};for(const r in i){const{width:o,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:d,content:f}=i[r],p=new e.r({width:o,height:a});e.r.copy(t,p,{x:s,y:l},{x:0,y:0},{width:o,height:a},null),n[r]={data:p,pixelRatio:u,sdf:c,stretchX:h,stretchY:d,content:f}}r(null,n)}}return{cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,((t,n)=>{if(this._spriteRequest=null,t)this.fire(new e.t(t));else if(n)for(const e in n)this.imageManager.addImage(e,this.scope,n[e]);this.imageManager.setLoaded(!0,this.scope),this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new e.x("data",{dataType:"style"}))}))}_validateLayer(t){const n=this.getOwnSource(t.source);if(!n)return;const r=t.sourceLayer;r&&("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(r))&&this.fire(new e.t(new Error(`Source layer "${r}" does not exist on source "${n.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return!1;if(!this.imageManager.isLoaded())return!1;if(!this.modelManager.isLoaded())return!1;if(this._styleColorTheme.lutLoading)return!1;for(const{style:e}of this.fragments)if(!e.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map(((e,t)=>{const n=this.fragments[t];return n&&n.style&&(e.data=n.style.serialize()),e}))}_serializeSources(){const e={};for(const t in this._sourceCaches){const n=this._sourceCaches[t].getSource();e[n.id]||(e[n.id]=n.serialize())}return e}_serializeLayers(e){const t=[];for(const n of e){const e=this._layers[n];e&&"custom"!==e.type&&t.push(e.serialize())}return t}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasTransitions(){if(this.hasLightTransitions())return!0;if(this.hasFogTransition())return!0;for(const e in this._sourceCaches)if(this._sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}isLayerDraped(e){return!!this.terrain&&e.isDraped(this.getLayerSourceCache(e))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(t){const n=this.getOwnLayer(t);if(n)return n;this.fire(new e.t(new Error(`The layer '${t}' does not exist in the map's style.`)))}_checkSource(t){const n=this.getOwnSource(t);if(n)return n;this.fire(new e.t(new Error(`The source '${t}' does not exist in the map's style.`)))}precompilePrograms(e,t){const n=this.map.painter;if(n)for(let r=e.minzoom||0;r<(e.maxzoom||25.5);r++){const r=e.getProgramIds();if(r)for(const i of r){const r=e.getDefaultProgramParams(i,t.zoom,this._styleColorTheme.lut);r&&(n.style=this,this.fog&&(n._fogVisible=!0,r.overrideFog=!0,n.getOrCreateProgram(i,r)),n._fogVisible=!1,r.overrideFog=!1,n.getOrCreateProgram(i,r),(this.stylesheet.terrain||this.stylesheet.projection&&"globe"===this.stylesheet.projection.name)&&(r.overrideRtt=!0,n.getOrCreateProgram(i,r)))}}}update(t){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(t),this.directionalLight&&this.directionalLight.recalculate(t);const n=this.calculateLightsBrightness();t.brightness=n||0,n!==this._brightness&&(this._brightness=n,this.dispatcher.broadcast("setBrightness",n));const r=this._changes.isDirty();let i=!1;if(this._changes.isDirty()){const e=this._changes.getLayerUpdatesByScope();for(const t in e){const{updatedIds:n,removedIds:r}=e[t];(n||r)&&(this._updateWorkerLayers(t,n,r),i=!0)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(t),this.light&&this.light.updateTransitions(t),this.ambientLight&&this.ambientLight.updateTransitions(t),this.directionalLight&&this.directionalLight.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this._changes.reset()}const o={};for(const e in this._mergedSourceCaches){const t=this._mergedSourceCaches[e];o[e]=t.used,t.used=!1,t.tileCoverLift=0}for(const e of this._mergedOrder){const n=this._mergedLayers[e];if(n.recalculate(t,this._availableImages),!n.isHidden(t.zoom)){const e=this.getLayerSourceCache(n);e&&(e.used=!0,e.tileCoverLift=Math.max(e.tileCoverLift,n.tileCoverLift()))}!this._precompileDone&&this._shouldPrecompile&&("requestIdleCallback"in window?requestIdleCallback((()=>{this.precompilePrograms(n,t)})):this.precompilePrograms(n,t))}this._shouldPrecompile&&(this._precompileDone=!0),this.terrain&&i&&this.mergeLayers();for(const a in o){const t=this._mergedSourceCaches[a];o[a]!==t.used&&t.getSource().fire(new e.x("data",{sourceDataType:"visibility",dataType:"source",sourceId:t.getSource().id}))}this.light&&this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),r&&this.fire(new e.x("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=this._changes.getUpdatedImages();if(e.length){for(const t in this._sourceCaches)this._sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changes.resetUpdatedImages()}}_updateWorkerLayers(e,t,n){const r=this.getFragmentStyle(e);r&&this.dispatcher.broadcast("updateLayers",{layers:t?r._serializeLayers(t):[],scope:e,removedIds:n||[],options:r.options})}setState(t,n){if(this._checkLoaded(),or(this,ge(t)))return!1;(t=e.cl(t)).layers=Mt(t.layers);const r=function(t,n){if(!t)return[{command:At.setStyle,args:[n]}];let r=[];try{if(!e.bh(t.version,n.version))return[{command:At.setStyle,args:[n]}];if(e.bh(t.center,n.center)||r.push({command:At.setCenter,args:[n.center]}),e.bh(t.zoom,n.zoom)||r.push({command:At.setZoom,args:[n.zoom]}),e.bh(t.bearing,n.bearing)||r.push({command:At.setBearing,args:[n.bearing]}),e.bh(t.pitch,n.pitch)||r.push({command:At.setPitch,args:[n.pitch]}),e.bh(t.sprite,n.sprite)||r.push({command:At.setSprite,args:[n.sprite]}),e.bh(t.glyphs,n.glyphs)||r.push({command:At.setGlyphs,args:[n.glyphs]}),e.bh(t.imports,n.imports)||function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;n=n||[];const i=(t=t||[]).map(Pt),o=n.map(Pt),a=t.reduce(Rt,{}),s=n.reduce(Rt,{}),l=i.slice();let c,u,h,d;for(c=0,u=0;c{e.source&&i[e.source]?r.push({command:At.removeLayer,args:[e.id]}):a.push(e)}));let s=t.terrain;s&&i[s.source]&&(r.push({command:At.setTerrain,args:[void 0]}),s=void 0),r=r.concat(o),e.bh(s,n.terrain)||r.push({command:At.setTerrain,args:[n.terrain]}),function(t,n,r){n=n||[];const i=(t=t||[]).map(Pt),o=n.map(Pt),a=t.reduce(Rt,{}),s=n.reduce(Rt,{}),l=i.slice(),c=Object.create(null);let u,h,d,f,p,m,g;for(u=0,h=0;u!(e.command in sr)));if(0===r.length)return!1;const i=r.filter((e=>!(e.command in ar)));if(i.length>0)throw new Error(`Unimplemented: ${i.map((e=>e.command)).join(", ")}.`);const o=[];return r.forEach((e=>{o.push(this[e.command].apply(this,e.args))})),n&&Promise.all(o).then(n),this.stylesheet=t,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}addImage(t,n){return this.getImage(t)?this.fire(new e.t(new Error("An image with this name already exists."))):(this.imageManager.addImage(t,this.scope,n),this._afterImageUpdated(t),this)}updateImage(e,t){this.imageManager.updateImage(e,this.scope,t)}getImage(e){return this.imageManager.getImage(e,this.scope)}removeImage(t){return this.getImage(t)?(this.imageManager.removeImage(t,this.scope),this._afterImageUpdated(t),this):this.fire(new e.t(new Error("No image with this name exists.")))}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(this.scope),this._changes.updateImage(t),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.fire(new e.x("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addModel(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._checkLoaded(),this._validate(Ee,`models.${e}`,t,null,n)||(this.modelManager.addModel(e,t,this.scope),this._changes.setDirty()),this}hasModel(e){return this.modelManager.hasModel(e,this.scope)}removeModel(t){return this.hasModel(t)?(this.modelManager.removeModel(t,this.scope),this):this.fire(new e.t(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.scope)}addSource(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._checkLoaded(),void 0!==this.getOwnSource(t))throw new Error(`There is already a source with ID "${t}".`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(_e,`sources.${t}`,n,null,r))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const i=tt(t,n,this.dispatcher,this);i.scope=this.scope,i.setEventedParent(this,(()=>({isSourceLoaded:this._isSourceCacheLoaded(i.id),source:i.serialize(),sourceId:i.id})));const o=t=>{const n=(t?"symbol:":"other:")+i.id,r=e.av(n,this.scope),o=this._sourceCaches[n]=new yt(r,i,t);(t?this._symbolSourceCaches:this._otherSourceCaches)[i.id]=o,o.onAdd(this.map)};o(!1),"vector"!==n.type&&"geojson"!==n.type||o(!0),i.onAdd&&i.onAdd(this.map),r.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(t){this._checkLoaded();const n=this.getOwnSource(t);if(!n)throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===t)return this.fire(new e.t(new Error(`Source "${t}" cannot be removed while layer "${i}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===t)return this.fire(new e.t(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));const r=this.getOwnSourceCaches(t);for(const i of r){const t=e.cm(i.id);delete this._sourceCaches[t],this._changes.discardSourceCacheUpdate(i.id),i.fire(new e.x("data",{sourceDataType:"metadata",dataType:"source",sourceId:i.getSource().id})),i.setEventedParent(null),i.clearTiles()}return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],this.mergeSources(),n.setEventedParent(null),n.onRemove&&n.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(e,t){this._checkLoaded(),this.getOwnSource(e).setData(t),this._changes.setDirty()}getOwnSource(e){const t=this.getOwnSourceCache(e);return t&&t.getSource()}getOwnSources(){const e=[];for(const t in this._otherSourceCaches){const n=this.getOwnSourceCache(t);n&&e.push(n.getSource())}return e}areTilesLoaded(){const e=this._mergedSourceCaches;for(const t in e){const n=e[t]._tiles;for(const e in n){const t=n[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}setLights(t){if(this._checkLoaded(),!t)return delete this.ambientLight,void delete this.directionalLight;const n=this._getTransitionParameters();for(const i of t){if(this._validate(ve,"lights",i))return;switch(i.type){case"ambient":if(this.ambientLight){const e=this.ambientLight;e.set(i),e.updateTransitions(n)}else this.ambientLight=new Ue(i,$e||($e=new e.a0({color:new e.a1(e._.properties_light_ambient.color),intensity:new e.a1(e._.properties_light_ambient.intensity)})),this.scope,this.options);break;case"directional":if(this.directionalLight){const e=this.directionalLight;e.set(i),e.updateTransitions(n)}else this.directionalLight=new Ue(i,Ge||(Ge=new e.a0({direction:new e.ad(e._.properties_light_directional.direction),color:new e.a1(e._.properties_light_directional.color),intensity:new e.a1(e._.properties_light_directional.intensity),"cast-shadows":new e.a1(e._.properties_light_directional["cast-shadows"]),"shadow-intensity":new e.a1(e._.properties_light_directional["shadow-intensity"])})),this.scope,this.options)}}const r=new e.a3(this.z||0,n);this.ambientLight&&this.ambientLight.recalculate(r),this.directionalLight&&this.directionalLight.recalculate(r),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){const t=this.directionalLight,n=this.ambientLight;if(!t||!n)return;const r=e=>.2126*(e[0]<=.03928?e[0]/12.92:Math.pow((e[0]+.055)/1.055,2.4))+.7152*(e[1]<=.03928?e[1]/12.92:Math.pow((e[1]+.055)/1.055,2.4))+.0722*(e[2]<=.03928?e[2]/12.92:Math.pow((e[2]+.055)/1.055,2.4)),i=t.properties.get("color").toRenderColor(null).toArray01(),o=t.properties.get("intensity"),a=t.properties.get("direction"),s=1-e.c7(a.x,a.y,a.z)[2]/90,l=r(i)*o*s,c=n.properties.get("color").toRenderColor(null).toArray01(),u=n.properties.get("intensity");return(l+r(c)*u)/2}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const e=[];return this.directionalLight&&e.push(this.directionalLight.get()),this.ambientLight&&e.push(this.ambientLight.get()),e}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(t){if(!t)return this;if(e.cn(t)){const n=e.co(t),r=this.fragments.find((e=>{let{id:t}=e;return t===n}));if(!r)throw new Error(`Style import not found: ${t}`);const i=e.cm(t);return r.style.getFragmentStyle(i)}{const e=this.fragments.find((e=>{let{id:n}=e;return n===t}));if(!e)throw new Error(`Style import not found: ${t}`);return e.style}}getConfigProperty(t,n){const r=this.getFragmentStyle(t);if(!r)return null;const i=e.av(n,r.scope),o=r.options.get(i),a=o?o.value||o.default:null;return a?a.serialize():null}setConfigProperty(t,n,r){const i=this.getFragmentStyle(t);if(!i)return;const o=i.stylesheet.schema;if(!o||!o[n])return;const a=e.M(r);if("success"!==a.result)return void or(this,a.value);const s=a.value.expression,l=e.av(n,i.scope),c=i.options.get(l);if(!c)return;let u;const{minValue:h,maxValue:d,stepValue:f,type:p,values:m}=o[n],g=e.M(o[n].default);"success"===g.result&&(u=g.value.expression),u?(this.options.set(l,{...c,value:s,default:u,minValue:h,maxValue:d,stepValue:f,type:p,values:m}),this.updateConfigDependencies(n)):this.fire(new e.t(new Error(`No schema defined for the config option "${n}" in the "${t}" fragment.`)))}getConfig(t){const n=this.getFragmentStyle(t);if(!n)return null;const r=n.stylesheet.schema;if(!r)return null;const i={};for(const o in r){const t=e.av(o,n.scope),r=n.options.get(t),a=r?r.value||r.default:null;i[o]=a?a.serialize():null}return i}setConfig(e,t){const n=this.getFragmentStyle(e);n&&(n.updateConfig(t,n.stylesheet.schema),this.updateConfigDependencies())}getSchema(e){const t=this.getFragmentStyle(e);return t?t.stylesheet.schema:null}setSchema(e,t){const n=this.getFragmentStyle(e);n&&(n.stylesheet.schema=t,n.updateConfig(n._config,t),this.updateConfigDependencies())}updateConfig(t,n){if(this._config=t,t||n)if(n)for(const r in n){let i,o;const a=e.M(n[r].default);if("success"===a.result&&(i=a.value.expression),t&&void 0!==t[r]){const n=e.M(t[r]);"success"===n.result&&(o=n.value.expression)}const{minValue:s,maxValue:l,stepValue:c,type:u,values:h}=n[r];if(i){const t=e.av(r,this.scope);this.options.set(t,{default:i,value:o,minValue:s,maxValue:l,stepValue:c,type:u,values:h})}else this.fire(new e.t(new Error(`No schema defined for config option "${r}".`)))}else this.fire(new e.t(new Error("Attempting to set config for a style without schema.")))}updateConfigDependencies(e){for(const t of this._configDependentLayers){const n=this.getLayer(t);if(n){if(e&&!n.configDependencies.has(e))continue;n.possiblyEvaluateVisibility(),this._updateLayer(n)}}this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.forEachFragmentStyle((e=>{if(e._styleColorTheme.colorTheme){const t=e._evaluateColorThemeData(e._styleColorTheme.colorTheme);(!e._styleColorTheme.lut&&""!==t||e._styleColorTheme.lut&&t!==e._styleColorTheme.lut.data)&&e.setColorTheme(e._styleColorTheme.colorTheme)}})),this._changes.setDirty()}addLayer(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const i=t.id;if(this._layers[i])return void this.fire(new e.t(new Error(`Layer with id "${i}" already exists on this map`)));let o;if("custom"===t.type){if(or(this,e.cp(t)))return;o=e.cq(t,this.scope,this._styleColorTheme.lut,this.options)}else{if("object"==typeof t.source&&(this.addSource(i,t.source),t=e.cl(t),t=e.l(t,{source:i})),this._validate(we,`layers.${i}`,t,{arrayIndex:-1},r))return;o=e.cq(t,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize()}0!==o.configDependencies.size&&this._configDependentLayers.add(o.fqid);let a=this._order.length;if(n){const t=this._order.indexOf(n);if(-1===t)return void this.fire(new e.t(new Error(`Layer with id "${n}" does not exist on this map.`)));o.slot===this._layers[n].slot?a=t:e.w(`Layer with id "${n}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o;const s=this.getOwnLayerSourceCache(o),l=!!this.directionalLight&&this.directionalLight.shadowsEnabled();s&&o.canCastShadows()&&l&&(s.castsShadows=!0);const c=this._changes.getRemovedLayer(o);if(c&&o.source&&s&&"custom"!==o.type){this._changes.discardLayerRemoval(o);const t=e.av(o.source,o.scope);c.type!==o.type?this._changes.updateSourceCache(t,"clear"):(this._changes.updateSourceCache(t,"reload"),s.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),o.scope=this.scope,this.mergeLayers()}moveLayer(t,n){this._checkLoaded();const r=this._checkLayer(t);if(!r)return;if(t===n)return;const i=this._order.indexOf(t);this._order.splice(i,1);let o=this._order.length;if(n){const t=this._order.indexOf(n);if(-1===t)return void this.fire(new e.t(new Error(`Layer with id "${n}" does not exist on this map.`)));r.slot===this._layers[n].slot?o=t:e.w(`Layer with id "${n}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(o,0,t),this._changes.setDirty(),this._layerOrderChanged=!0,this.mergeLayers()}removeLayer(e){this._checkLoaded();const t=this._checkLayer(e);if(!t)return;t.setEventedParent(null);const n=this._order.indexOf(e);this._order.splice(n,1),delete this._layers[e],delete this._serializedLayers[e],this._changes.setDirty(),this._layerOrderChanged=!0,this._configDependentLayers.delete(t.fqid),this._changes.removeLayer(t);const r=this.getOwnLayerSourceCache(t);if(r&&r.castsShadows){let e=!1;for(const n in this._layers)if(this._layers[n].source===t.source&&this._layers[n].canCastShadows()){e=!0;break}r.castsShadows=e}t.onRemove&&t.onRemove(this.map),this.mergeLayers()}getOwnLayer(e){return this._layers[e]}hasLayer(e){return e in this._mergedLayers}hasLayerType(e){for(const t in this._layers)if(this._layers[t].type===e)return!0;return!1}setLayerZoomRange(e,t,n){this._checkLoaded();const r=this._checkLayer(e);r&&(r.minzoom===t&&r.maxzoom===n||(null!=t&&(r.minzoom=t),null!=n&&(r.maxzoom=n),this._updateLayer(r)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(e,t){this._checkLoaded();const n=this._checkLayer(e);n&&n.slot!==t&&(n.slot=t,this._updateLayer(n))}setFilter(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const i=this._checkLayer(t);if(i&&!e.bh(i.filter,n))return null==n?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(Se,`layers.${i.id}.filter`,n,{layerType:i.type},r)||(i.filter=e.cl(n),this._updateLayer(i)))}getFilter(t){const n=this._checkLayer(t);if(n)return e.cl(n.filter)}setLayoutProperty(t,n,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const o=this._checkLayer(t);if(o&&!e.bh(o.getLayoutProperty(n),r)){if(null!=r&&(!i||!1!==i.validate)&&or(o,Ae.call(ge,{key:`layers.${t}.layout.${n}`,layerType:o.type,objectKey:n,value:r,styleSpec:e._,style:{glyphs:!0,sprite:!0}})))return;o.setLayoutProperty(n,r),0!==o.configDependencies.size&&this._configDependentLayers.add(o.fqid),this._updateLayer(o)}}getLayoutProperty(e,t){const n=this._checkLayer(e);if(n)return n.getLayoutProperty(t)}setPaintProperty(t,n,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const o=this._checkLayer(t);if(!o)return;if(e.bh(o.getPaintProperty(n),r))return;if(null!=r&&(!i||!1!==i.validate)&&or(o,Me.call(ge,{key:`layers.${t}.paint.${n}`,layerType:o.type,objectKey:n,value:r,styleSpec:e._})))return;const a=o.setPaintProperty(n,r);0!==o.configDependencies.size&&this._configDependentLayers.add(o.fqid),a&&this._updateLayer(o),this._changes.updatePaintProperties(o)}getPaintProperty(e,t){const n=this._checkLayer(e);if(n)return n.getPaintProperty(t)}setFeatureState(t,n){this._checkLoaded();const r=t.source,i=t.sourceLayer,o=this._checkSource(r);if(!o)return;const a=o.type;if("geojson"===a&&i)return void this.fire(new e.t(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===a&&!i)return void this.fire(new e.t(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===t.id&&this.fire(new e.t(new Error("The feature id parameter must be provided.")));const s=this.getOwnSourceCaches(r);for(const e of s)e.setFeatureState(i,t.id,n)}removeFeatureState(t,n){this._checkLoaded();const r=t.source,i=this._checkSource(r);if(!i)return;const o=i.type,a="vector"===o?t.sourceLayer:void 0;if("vector"===o&&!a)return void this.fire(new e.t(new Error("The sourceLayer parameter must be provided for vector source types.")));if(n&&"string"!=typeof t.id&&"number"!=typeof t.id)return void this.fire(new e.t(new Error("A feature id is required to remove its specific state property.")));const s=this.getOwnSourceCaches(r);for(const e of s)e.removeFeatureState(a,t.id,n)}getFeatureState(t){this._checkLoaded();const n=t.source,r=t.sourceLayer,i=this._checkSource(n);if(i){if("vector"!==i.type||r)return void 0===t.id&&this.fire(new e.t(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(n)[0].getFeatureState(r,t.id);this.fire(new e.t(new Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(t){return this.stylesheet.transition=e.l({},this.stylesheet.transition,t),this.transition=this.stylesheet.transition,this}getTransition(){return e.l({},this.stylesheet.transition)}serialize(){this._checkLoaded();const t=this.getTerrain(),n=t&&this.terrain&&this.terrain.scope===this.scope?t:this.stylesheet.terrain;return e.cr({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:n,fog:this.stylesheet.fog,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},(e=>void 0!==e))}_updateLayer(t){this._changes.updateLayer(t);const n=this.getLayerSourceCache(t),r=e.av(t.source,t.scope),i=this._changes.getUpdatedSourceCaches();t.source&&!i[r]&&n&&"raster"!==n.getSource().type&&(this._changes.updateSourceCache(r,"reload"),n.pause()),t.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(e){const t=e=>this._mergedLayers[e].is3D(),n=this.order,r={},i=[];for(let a=n.length-1;a>=0;a--){const o=n[a];if(t(o)){r[o]=a;for(const t of e){const e=t[o];if(e)for(const t of e)i.push(t)}}}i.sort(((e,t)=>t.intersectionZ-e.intersectionZ));const o=[];for(let a=n.length-1;a>=0;a--){const s=n[a];if(t(s))for(let e=i.length-1;e>=0;e--){const t=i[e].feature;if(t.layer&&r[t.layer.id]{const t=this.getLayer(e);return t&&t.is3D()})):this.has3DLayers(),l=qe.createFromScreenPoints(t,r);for(const e in this._mergedSourceCaches){const t=this._mergedSourceCaches[e].getSource();if(!t||t.scope!==n.scope)continue;const c=this._mergedSourceCaches[e].getSource().id;n.layers&&!i[c]||o.push(rt(this._mergedSourceCaches[e],this._mergedLayers,a,l,n,r,s,!!this.map._showQueryGeometry))}return this.placement&&o.push(function(e,t,n,r,i,o,a){const s={},l=o.queryRenderedSymbols(r),c=[];for(const u of Object.keys(l).map(Number))c.push(a[u]);c.sort(ot);for(const u of c){const n=u.featureIndex.lookupSymbolFeatures(l[u.bucketInstanceId],t,u.bucketIndex,u.sourceLayerIndex,i.filter,i.layers,i.availableImages,e);for(const e in n){const t=s[e]=s[e]||[],r=n[e];r.sort(((e,t)=>{const n=u.featureSortOrder;if(n){const r=n.indexOf(e.featureIndex);return n.indexOf(t.featureIndex)-r}return t.featureIndex-e.featureIndex}));for(const e of r)t.push(e)}}for(const u in s)s[u].forEach((t=>{const r=t.feature,i=n(e[u]);if(!i)return;const o=i.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=o}));return s}(this._mergedLayers,a,this.getLayerSourceCache.bind(this),l.screenGeometry,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(e,t){t&&t.filter&&this._validate(Se,"querySourceFeatures.filter",t.filter,null,t);const n=this.getOwnSourceCaches(e);let r=[];for(const i of n)r=r.concat(it(i,t));return r}addSourceType(e,t,n){return ur.getSourceType(e)?n(new Error(`A source type called "${e}" already exists.`)):(ur.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},n):n(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const i=this.light.getLight();let o=!1;for(const s in t)if(!e.bh(t[s],i[s])){o=!0;break}if(!o)return;const a=this._getTransitionParameters();this.light.setLight(t,n,r),this.light.updateTransitions(a)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=e.q.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&e.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this._checkLoaded(),!t)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),0===n&&delete this.terrain,null===t?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);this.checkCanvasFingerprintNoise();let r=t;const i=null==t.source;if(1===n){if(this.disableElevatedTerrain)return;if("object"==typeof r.source){const t="terrain-dem-src";this.addSource(t,r.source),r=e.cl(r),r=e.l(r,{source:t})}const t=e.l({},r),n={};if(this.terrain&&i){t.source=this.terrain.get().source;const e=this.terrain?this.getFragmentStyle(this.terrain.scope):null;e&&(n.style=e.serialize())}if(this._validate(xe,"terrain",t,n))return}if(!this.terrain||this.terrain.scope!==this.scope&&!i||this.terrain&&n!==this.terrain.drapeRenderMode){if(!r)return;this._createTerrain(r,n),this.fire(new e.x("data",{dataType:"style"}))}else{const n=this.terrain,i=n.get();for(const t of Object.keys(e._.terrain))!r.hasOwnProperty(t)&&e._.terrain[t].default&&(r[t]=e._.terrain[t].default);for(const r in t)if(!e.bh(t[r],i[r])){n.set(t,this.options),this.stylesheet.terrain=t;const r=this._getTransitionParameters({duration:0});n.updateTransitions(r),this.fire(new e.x("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(e){const t=this.fog=new Ve(e,this.map.transform,this.scope,this.options);this.stylesheet.fog=t.get();const n=this._getTransitionParameters({duration:0});t.updateTransitions(n)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask((()=>{for(const e of this.map._markers)e._evaluateOpacity()}))}getFog(){return this.fog?this.fog.get():null}setFog(t){if(this._checkLoaded(),!t)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const n=this.fog;if(!e.bh(n.get(),t)){n.set(t,this.options),this.stylesheet.fog=n.get();const e=this._getTransitionParameters({duration:0});n.updateTransitions(e)}}else this._createFog(t);this._markersNeedUpdate=!0}setColorTheme(t){this._checkLoaded();const n=()=>{for(const e in this._layers)this._layers[e].lut=this._styleColorTheme.lut;for(const e in this._sourceCaches)this._sourceCaches[e].clearTiles()};if(this._styleColorTheme.colorTheme=t,!t)return this._styleColorTheme.lut=null,void n();const r=this._evaluateColorThemeData(t);this._loadColorTheme(r).then((()=>{this.fire(new e.x("colorthemeset")),n()})).catch((t=>{e.w(`Couldn't set color theme: ${t}`)}))}_getTransitionParameters(t){return{now:e.q.now(),transition:e.l(this.transition,t)}}updateDrapeFirstLayers(){if(!this.terrain)return;const e=[],t=[];for(const n of this._mergedOrder)this.isLayerDraped(this._mergedLayers[n])?e.push(n):t.push(n);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...e),this._drapedFirstOrder.push(...t)}_createTerrain(e,t){const n=this.terrain=new Re(e,t,this.scope,this.options);1===t&&(this.stylesheet.terrain=e),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const r=this._getTransitionParameters({duration:0});n.updateTransitions(r)}_force3DLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"fill-extrusion"===t.type&&this._updateLayer(t)}}_forceSymbolLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"symbol"===t.type&&this._updateLayer(t)}}_validate(t,n,r,i){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(o&&!1===o.validate)return!1;const a=e.l({},this.serialize());return or(this,t.call(ge,e.l({key:n,style:a,value:r,styleSpec:e._},i)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.cs.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._mergedLayers)this._mergedLayers[e].setEventedParent(null);for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles(),this._mergedSourceCaches[e].setEventedParent(null);this.setEventedParent(null),delete this.fog,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.dispatcher.remove())}clearSource(e){const t=this.getSourceCaches(e);for(const n of t)n.clearTiles()}clearSources(){for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles()}reloadSource(e){const t=this.getSourceCaches(e);for(const n of t)n.resume(),n.reload()}reloadSources(){for(const e of this.getSources())e.reload&&e.reload()}updateSources(e){let t;this.directionalLight&&(t=er(this.directionalLight));for(const n in this._mergedSourceCaches)this._mergedSourceCaches[n].update(e,void 0,void 0,t)}_generateCollisionBoxes(){for(const e in this._sourceCaches){const t=this._sourceCaches[e];t.resume(),t.reload()}}_updatePlacement(t,n,r,i,o,a){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=!1,c=!1;const u={},h={};for(const d of this._mergedOrder){const t=this._mergedLayers[d];if("symbol"!==t.type)continue;const r=e.av(t.source,t.scope);let i=u[r];if(!i){const e=this.getLayerSourceCache(t);if(!e)continue;const n=e.getRenderableIds(!0).map((t=>e.getTileByID(t)));h[r]=n.slice(),i=u[r]=n.sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}const o=this.crossTileSymbolIndex.addLayer(t,i,n.center.lng,n.projection);l=l||o}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder),s=s||this._layerOrderChanged||0===i,this._layerOrderChanged&&this.fire(new e.x("neworder")),(s||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.q.now(),n.zoom))&&(this.pauseablePlacement=new Mn(n,this._mergedOrder,s,r,i,o,this.placement,this.fog&&n.projection.supportsFog?this.fog.state:null,this._buildingIndex),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,u,h),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.q.now()),c=!0),l&&this.pauseablePlacement.placement.setStale()),c||l){this._buildingIndex.onNewFrame(n.zoom);for(let t=0;t{let{id:n}=e;return n===t.id})))return void this.fire(new e.t(new Error(`Import with id '${t.id}' already exists in the map's style.`)));if(!n)return r.push(t),this._loadImports([t],!0);const i=r.findIndex((e=>{let{id:t}=e;return t===n}));return-1===i&&this.fire(new e.t(new Error(`Import with id "${n}" does not exist on this map.`))),this.stylesheet.imports=r.slice(0,i).concat(t).concat(r.slice(i)),this._loadImports([t],!0,n)}updateImport(t,n){this._checkLoaded();const r=this.stylesheet.imports||[],i=this.getImportIndex(t);return-1===i?this:"string"==typeof n?(this.setImportUrl(t,n),this):(n.url&&n.url!==r[i].url&&this.setImportUrl(t,n.url),e.bh(n.config,r[i].config)||this.setImportConfig(t,n.config),e.bh(n.data,r[i].data)||this.setImportData(t,n.data),this)}moveImport(e,t){this._checkLoaded();let n=this.stylesheet.imports||[];const r=this.getImportIndex(e);if(-1===r)return this;const i=this.getImportIndex(t);if(-1===i)return this;const o=n[r],a=this.fragments[r];return n=n.filter((t=>{let{id:n}=t;return n!==e})),this.fragments=this.fragments.filter((t=>{let{id:n}=t;return n!==e})),this.stylesheet.imports=n.slice(0,i).concat(o).concat(n.slice(i)),this.fragments=this.fragments.slice(0,i).concat(a).concat(this.fragments.slice(i)),this.mergeLayers(),this}setImportUrl(e,t){this._checkLoaded();const n=this.stylesheet.imports||[],r=this.getImportIndex(e);if(-1===r)return this;n[r].url=t;const i=this.fragments[r];return i.style=this._createFragmentStyle(n[r]),i.style.on("style.import.load",(()=>this.mergeAll())),i.style.loadURL(t),this}setImportData(e,t){this._checkLoaded();const n=this.getImportIndex(e),r=this.stylesheet.imports||[];return-1===n?this:t?(this.fragments[n].style.setState(t),this._reloadImports(),this):(delete r[n].data,this.setImportUrl(e,r[n].url))}setImportConfig(e,t){this._checkLoaded();const n=this.getImportIndex(e),r=this.stylesheet.imports||[];if(-1===n)return this;t?r[n].config=t:delete r[n].config;const i=this.fragments[n],o=i.style.stylesheet&&i.style.stylesheet.schema;return i.config=t,i.style.updateConfig(t,o),this.updateConfigDependencies(),this}removeImport(e){this._checkLoaded();const t=this.stylesheet.imports||[],n=this.getImportIndex(e);-1!==n&&(t.splice(n,1),this.fragments[n].style._remove(),this.fragments.splice(n,1),this._reloadImports())}getImportIndex(t){const n=(this.stylesheet.imports||[]).findIndex((e=>e.id===t));return-1===n&&this.fire(new e.t(new Error(`Import '${t}' does not exist in the map's style and cannot be updated.`))),n}getLayer(e){return this._mergedLayers[e]}getSources(){const e=[];for(const t in this._mergedOtherSourceCaches){const n=this._mergedOtherSourceCaches[t];n&&e.push(n.getSource())}return e}getSource(e,t){const n=this.getSourceCache(e,t);return n&&n.getSource()}getLayerSource(e){const t=this.getLayerSourceCache(e);return t&&t.getSource()}getSourceCache(t,n){const r=e.av(t,n);return this._mergedOtherSourceCaches[r]}getLayerSourceCache(t){const n=e.av(t.source,t.scope);return"symbol"===t.type?this._mergedSymbolSourceCaches[n]:this._mergedOtherSourceCaches[n]}getSourceCaches(e){if(null==e)return Object.values(this._mergedSourceCaches);const t=[];return this._mergedOtherSourceCaches[e]&&t.push(this._mergedOtherSourceCaches[e]),this._mergedSymbolSourceCaches[e]&&t.push(this._mergedSymbolSourceCaches[e]),t}updateSourceCaches(){const e=this._changes.getUpdatedSourceCaches();for(const t in e){const n=e[t];"reload"===n?this.reloadSource(t):"clear"===n&&this.clearSource(t)}}updateLayers(e){const t=this._changes.getUpdatedPaintProperties();for(const n of t){const t=this.getLayer(n);t&&t.updateTransitions(e)}}getImages(e,t,n){this.imageManager.getImages(t.icons,t.scope,n),this._updateTilesForChangedImages();const r=e=>{e&&e.setDependencies(t.tileID.key,t.type,t.icons)};r(this._otherSourceCaches[t.source]),r(this._symbolSourceCaches[t.source])}getGlyphs(e,t,n){this.glyphManager.getGlyphs(t.stacks,t.scope,n)}getResource(t,n,r){return e.ct(n,r)}getOwnSourceCache(e){return this._otherSourceCaches[e]}getOwnLayerSourceCache(e){return"symbol"===e.type?this._symbolSourceCaches[e.source]:this._otherSourceCaches[e.source]}getOwnSourceCaches(e){const t=[];return this._otherSourceCaches[e]&&t.push(this._otherSourceCaches[e]),this._symbolSourceCaches[e]&&t.push(this._symbolSourceCaches[e]),t}_isSourceCacheLoaded(t){const n=this.getOwnSourceCaches(t);return 0===n.length?(this.fire(new e.t(new Error(`There is no source with ID '${t}'`))),!1):n.every((e=>e.loaded()))}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(e,t){if(!this._clipLayerPresent&&"fill-extrusion"!==e.type)return!1;const n="fill-extrusion"===e.type&&"building"===e.sourceLayer;if(e.is3D()){if(n||t&&"batched-model"===t.type)return!0;if("model"===e.type)return!0}else if("symbol"===e.type)return!0;return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.fragments.forEach((e=>{e.style._remove()})),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}ur.getSourceType=function(e){return et[e]},ur.setSourceType=function(e,t){et[e]=t},ur.registerForPluginStateChange=e.cc;var hr="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",dr="\nout vec4 glFragColor;highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\n#ifdef INDICATOR_CUTOUT\nuniform vec2 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;\n#endif\nvec4 applyCutout(vec4 color) {\n#ifdef INDICATOR_CUTOUT\nfloat holeMinOpacity=u_indicator_cutout_params.x;float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);\n#else\nreturn color;\n#endif\n}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif\nvec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 applyLUT(highp sampler3D lut,vec4 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return vec4(texture(lut,uvw).rgb,col.a);}vec3 applyLUT(highp sampler3D lut,vec3 col) {return applyLUT(lut,vec4(col,1.0)).rgb;}",fr="\n#define EXTENT 8192.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const vec2 units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (units_to_pixels*pos+offset)/pattern_size;}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}",pr="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",mr="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nvec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }\n#endif\n#ifdef DEPTH_OCCLUSION\nuniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset;\n#ifdef DEPTH_D24\nfloat unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);}\n#else\nhighp float unpack_depth_rgba(vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;\n#ifdef DEPTH_D24\nfloat depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r);\n#else\nfloat depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5));\n#endif\nreturn coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef DEPTH_D24\nhighp vec4 depth=vec4(\ntexture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r\n);depth=unpack_depth4(depth);\n#else\nhighp vec4 depth=vec4(\nunpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy))\n);\n#endif\nreturn depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;int NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) {\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)));\n#endif\nres+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));}\n#else\nbool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; }\n#endif//DEPTH_OCCLUSION",gr="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",_r="highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}\n#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {\n#ifdef FOG_DITHERING\nvec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);\n#else\nreturn color;\n#endif\n}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",yr="#ifdef RASTER_ARRAY\nuniform sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0)\n);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0)\n);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",vr="#ifdef RASTER_ARRAY\nuniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;}\n#endif\nuniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}",xr="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif//RENDER_SHADOWS",br="#ifdef RENDER_SHADOWS\n#ifdef DEPTH_TEXTURE\nuniform highp sampler2D u_shadowmap_0;uniform highp sampler2D u_shadowmap_1;\n#else\nuniform sampler2D u_shadowmap_0;uniform sampler2D u_shadowmap_1;\n#endif\nuniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;highp float shadow_sample_1(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_1,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_1,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}highp float shadow_sample_0(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_0,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_0,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}float shadow_occlusion_1(highp vec4 pos,highp float bias) {highp vec2 uv=pos.xy;return shadow_sample_1(uv,pos.z-bias);}float shadow_occlusion_0(highp vec4 pos,highp float bias) {highp float compare0=pos.z-bias;\n#ifdef NATIVE\nhighp vec2 uv=pos.xy;highp vec4 samples=textureGather(u_shadowmap_0,uv,0);lowp vec4 stepSamples=step(samples,vec4(compare0));\n#else\nhighp vec2 uv00=pos.xy-vec2(0.5*u_shadow_texel_size);highp vec2 uv10=uv00+vec2(u_shadow_texel_size,0.0);highp vec2 uv01=uv00+vec2(0.0,u_shadow_texel_size);highp vec2 uv11=uv01+vec2(u_shadow_texel_size,0.0);lowp vec4 stepSamples=vec4(\nshadow_sample_0(uv01,compare0),shadow_sample_0(uv11,compare0),shadow_sample_0(uv10,compare0),shadow_sample_0(uv00,compare0)\n);\n#endif\nvec2 f=fract(pos.xy*u_shadow_map_resolution-vec2(0.5));lowp vec2 lerpx=mix(stepSamples.wx,stepSamples.zy,f.xx);return mix(lerpx.x,lerpx.y,f.y);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {\n#ifdef SHADOWS_SINGLE_CASCADE\nlight_view_pos0.xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);\n#else\nlight_view_pos0.xyz/=light_view_pos0.w;light_view_pos1.xyz/=light_view_pos1.w;vec4 uv=vec4(light_view_pos0.xy,light_view_pos1.xy);vec4 abs_bounds=abs(uv);if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}light_view_pos1.xyz=light_view_pos1.xyz*0.5+0.5;float occlusion1=shadow_occlusion_1(light_view_pos1,bias);return mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth));\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";const wr=[];Cr(hr,wr),Cr(fr,wr),Cr(dr,wr);const Sr={"_prelude_fog.vertex.glsl":gr,"_prelude_terrain.vertex.glsl":mr,"_prelude_shadow.vertex.glsl":xr,"_prelude_fog.fragment.glsl":_r,"_prelude_shadow.fragment.glsl":br,"_prelude_lighting.glsl":"\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif//LIGHTING_3D_MODE","_prelude_raster_array.glsl":yr,"_prelude_raster_particle.glsl":vr},Mr={};kr("",mr),kr(_r,gr),kr(br,xr),kr(yr,""),kr(vr,"");const Ar=kr(dr,fr),Er=hr;var Tr={background:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nin vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;uniform float u_emissive_strength;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),backgroundPattern:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in vec2 a_pos;out highp vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),circle:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float opacity_t=smoothstep((1.0-blur_positive)*antialiased_blur,blur_positive*antialiased_blur,extrude_length-1.0)-smoothstep(0.0,antialiasblur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}'),clippingMask:kr("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:kr('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),heatmapTexture:kr("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:kr("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;out float v_placed;out float v_notUsed;void main() {float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(a_anchor_pos));vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*(feature_elevation+terrain_elevation),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}'),collisionCircle:kr("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:kr("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;\n#endif\nout vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}'),fill:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\nuniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutline:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin highp vec2 v_pos;uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\nuniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutlinePattern:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_emissive_strength;in highp vec2 v_pos;in highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\nout highp vec2 v_pos;out highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillPattern:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;in highp vec2 v_pos;uniform float u_emissive_strength;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\nout highp vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillExtrusion:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec4 v_color;in vec4 v_flat;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\nuniform lowp float u_opacity;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radius;in float v_has_floodlight;\n#endif\nin float v_height;\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float emissive_strength\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor;\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\ncolor.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;uniform float u_width_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nuniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radius;out float v_has_floodlight;\n#endif\nout float v_height;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp float emissive_strength\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat cutoff=1.0;vec3 scaled_pos=pos;\n#ifdef RENDER_CUTOFF\nvec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_pos.x==0.0 ? pos.xyz : (centroid_random/8.0);vec4 ground=u_matrix*vec4(ground_pos.xy,ele,1.0);cutoff=cutoff_opacity(u_cutoff_params,ground.z);if (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale);\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0));\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\ngl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#endif\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);v_flat=vec4(linearProduct(color.rgb,vec3(calculate_NdotL(normal))),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillExtrusionDepth:kr("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp vec4 color\nout highp float v_depth;void main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp vec4 color\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nvec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;float ele=elevation(pos_nx.xy);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base);pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);v_depth=gl_Position.z/gl_Position.w;}'),fillExtrusionPattern:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\nin highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_width_scale;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nout highp vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\n#pragma mapbox: define highp float line_width\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\n#pragma mapbox: initialize highp float line_width\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);p.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;p.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_normal=normal;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}'),groundShadow:kr('#include "_prelude_shadow.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\n#ifdef INDICATOR_CUTOUT\nshadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0)).r);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos);\n#endif\n}'),fillExtrusionGroundEffect:kr("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;\n#endif\nHANDLE_WIREFRAME_DEBUG;\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao;\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=a_angular_offset_factor/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=a_hidden_by_landmark;\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),hillshadePrepare:kr("precision highp float;uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),line:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;in vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nfloat linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture(u_dash_image,v_tex).r;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trim_alpha=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);out_color=mix(out_color,u_trim_color,transition_factor);trim_alpha=out_color.a;}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=(border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) {float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color.rgb=mix(border_color.rgb*border_color.a*trim_alpha,out_color.rgb,smoothAlpha);}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*opacity);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\nin float a_z_offset;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nin highp vec4 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);\n#ifdef ELEVATED_ROADS\ngl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset+0.01*step(0.01,a_z_offset),1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 halfCellProgress=normal.yx*32.0;float ele0=elevation(pos);float ele_line=max(ele0,max(elevation(pos+halfCellProgress),elevation(pos-halfCellProgress)));float ele1=elevation(pos+offsetTile);float ele2=elevation(pos-offsetTile);float ele_max=max(ele_line,0.5*(ele1+ele2));float ele=ele_max-ele0+ele1+a_z_offset ;gl_Position=u_matrix*vec4(pos+offsetTile,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*0.1*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);\n#else\nv_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),linePattern:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform highp float u_device_pixel_ratio;uniform highp float u_alpha_discard_threshold;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec4 v_uv;\n#endif\n#ifdef LINE_JOIN_NONE\nin vec2 v_pattern_data;\n#endif\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {color=vec4(0,0,0,0);}}\n#endif\n#ifdef LINE_JOIN_NONE\nfloat pattern_len=pattern_size/aspect;float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);}\n#endif\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_ground(color);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}}\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\nin float a_z_offset;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec4 a_packed;\n#endif\nin highp float a_linesofar;\n#ifdef LINE_JOIN_NONE\nin highp vec3 a_pattern_data;out vec2 v_pattern_data;\n#endif\nuniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nout highp vec4 v_uv;\n#endif\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define mediump float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float floorwidth\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define mediump float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize mediump float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize mediump float pixel_ratio\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);\n#ifdef ELEVATED_ROADS\ngl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset+0.01*step(0.01,a_z_offset),1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 halfCellProgress=normal.yx*32.0;float ele0=elevation(pos);float ele_line=max(ele0,max(elevation(pos+halfCellProgress),elevation(pos-halfCellProgress)));float ele1=elevation(pos+offsetTile);float ele2=elevation(pos-offsetTile);float ele_max=max(ele_line,0.5*(ele1+ele2));float ele=ele_max-ele0+ele1+a_z_offset ;gl_Position=u_matrix*vec4(pos+offsetTile,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*0.1*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nfloat a_uv_x=a_packed[0];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef LINE_JOIN_NONE\nv_width=floorwidth+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/((pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),raster:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nin float v_split_fade;\n#endif\nuniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;\n#ifdef GLOBE_POLES\ncolor.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);\n#endif\nvec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef PROJECTION_GLOBE_VIEW\nglFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));\n#endif\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;in vec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nout float v_split_fade;\n#endif\nvoid main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos ,1.0);uv=a_uv;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\nfloat w=1.0+dot(a_texture_pos,u_perspective_transform);uv=a_texture_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]); \nv_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}float tiles=u_grid_matrix[0][2];if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\ngl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),rasterParticle:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),0.0).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\nin vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nuv=a_texture_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}'),rasterParticleDraw:kr("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",'#include "_prelude_raster_particle.glsl"\nin float a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2(\nmod(a_index,u_particle_texture_side_len),a_index/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}'),rasterParticleTexture:kr("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in vec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*a_pos+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:kr('#include "_prelude_raster_particle.glsl"\nuniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow(\nlinearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4)\n);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}',"in vec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*(a_pos+vec2(1.0));gl_Position=vec4(a_pos,0.0,1.0);}"),symbol:kr('#include "_prelude_lighting.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\n#ifdef COLOR_ADJUSTMENT\nuniform mat4 u_color_adj_mat;\n#endif\nin vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\nin float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nin float is_sdf;in vec2 v_tex_a_icon;\n#endif\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nvec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2];\n#ifdef RENDER_TEXT_AND_SYMBOL\nif (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity;glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}\n#endif\n#ifdef RENDER_SDF\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha;\n#else\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b);\n#else\nout_color=texture(u_texture,v_tex_a);\n#endif\n#ifdef COLOR_ADJUSTMENT\nout_color=u_color_adj_mat*out_color;\n#endif\n#endif\nout_color*=opacity*fade_opacity;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_auto_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin vec2 a_texb;\n#endif\n#ifdef OCCLUSION_QUERIES\nin float a_occlusion_query_opacity;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_elevation_from_sea;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nout float is_sdf;out vec2 v_tex_a_icon;\n#endif\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\n#pragma mapbox: define lowp float occlusion_opacity\n#pragma mapbox: define lowp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\n#pragma mapbox: initialize lowp float occlusion_opacity\n#pragma mapbox: initialize lowp float z_offset\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_auto_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=a_globe_anchor+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w;\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;\n#endif\nvec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\n#ifdef Z_OFFSET\nz+=u_pitch_with_map ? a_auto_z_offset+(u_elevation_from_sea ? z_offset : z_offset) : 0.0;\n#else\nz+=u_pitch_with_map ? (u_elevation_from_sea ? z_offset : z_offset) : 0.0;\n#endif\nfloat occlusion_fade=globe_occlusion_fade;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float out_fade_opacity=interpolated_fade_opacity*projection_transition_fade;\n#ifdef DEPTH_OCCLUSION\nfloat depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier;\n#endif\n#ifdef OCCLUSION_QUERIES\nfloat occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier;\n#endif\nfloat alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nfloat gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize;\n#ifdef RENDER_TEXT_AND_SYMBOL\nis_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon;\n#endif\n#ifdef ICON_TRANSITION\nv_tex_b=a_texb/u_texsize;\n#endif\n}'),terrainRaster:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;in vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nvec3 unlit_base=image_color.rgb*(1.0-image_color.a);vec3 emissive_base=image_color.rgb*image_color.a;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor.rgb=mix(color.rgb,image_color.rgb,image_color.a);color.a=1.0;\n#endif\n#endif\n#else\ncolor=image_color;\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;out float v_depth;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);\n#endif\n}'),terrainDepth:kr("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;out float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}'),skybox:kr('#include "_prelude_fog.fragment.glsl"\nin lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',pr),skyboxGradient:kr('#include "_prelude_fog.fragment.glsl"\nin highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',pr),skyboxCapture:kr("\nin highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float;\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;uniform float u_far_z_cutoff;in vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nvec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nraster=apply_lighting_with_emission_ground(raster,raster.a);color=vec4(raster.rgb*antialias,antialias);\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor=apply_lighting_with_emission_ground(color,color.a);color.a=1.0;\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;\n#endif\nout vec2 v_pos0;void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);globe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}'),globeAtmosphere:kr('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\n#ifdef NATIVE\nglFragColor=vec4(1,1,1,1);\n#else\nglFragColor=vec4(0,0,0,1);\n#endif\nreturn;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;\n#ifdef ALPHA_PASS\nfloat a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;\n#ifndef NATIVE\nc=dither(c,gl_FragCoord.xy+u_temporal_offset);\n#endif\nglFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}"),model:kr('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_opacity;uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nuniform vec4 u_occlusionTextureTransform;\n#endif\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_pbr\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nin highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack;\n#ifdef DEPTH_D24\nhighp float unpack_depth(highp float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}\n#else\nhighp float unpack_depth_rgba(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size;\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depthTexture,coord).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depthTexture,coord));\n#endif\nreturn v_depth > depth+0.0005;}\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-lightColor),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\nif(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0;\n#endif\nif(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}\n#endif\nvec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\nreturn color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;highp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_3f\nn=normalize(normal_3f);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));n=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_pbr\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) \nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*lightColor;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nif (isOccluded()) {discard;}\n#endif\nvec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nvec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;\n#else\nvec2 uv=uv_2f;\n#endif\nao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nfloat emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength;\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_pbr\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb;\n#ifdef APPLY_LUT_ON_GPU\ncolor_mix=applyLUT(u_lutTexture,color_mix);\n#endif\ncolor=mix(color,color_mix,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nfinalColor=applyCutout(finalColor);\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr\n#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength\nuniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nout highp float v_depth;\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp vec4 pbr\n#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_pbr\nvec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);\n#else\nnormal_3f=vec3(normal_matrix*vec4(normal_3f,0));\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:kr("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden);\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\nv_depth=gl_Position.z/gl_Position.w;}"),stars:kr("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_fade_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}"),occlusion:kr("uniform vec4 u_color;void main() {glFragColor=u_color;}",'#include "_prelude_terrain.vertex.glsl"\nin highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos;\n#ifdef TERRAIN\nfloat e=elevation(world_pos.xy);world_pos.z+=e;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}')};function Cr(e,t){const n=e.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let r of n)if(r=r.trim(),"#"===r[0]&&r.includes("if")&&!r.includes("endif")){r=r.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const e=r.split(" ");for(const n of e)t.includes(n)||t.push(n)}}function kr(e,t){const n=/#include\s+"([^"]+)"/g,r=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g;let i=t.match(/(attribute(\S*)|(^\s*|;)in) (highp |mediump |lowp )?([\w]+) ([\w]+)/gm);i&&(i=i.map((e=>{const t=e.split(" ");return t[t.length-1]})),i=[...new Set(i)]);const o={},a=[],s=[];if(e=e.replace(n,((e,t)=>(s.push(t),""))),(t=t.replace(n,((e,t)=>(a.push(t),"")))).includes("flat out"))return void console.error('The usage of "flat" qualifier is disallowed, see: https://bugs.webkit.org/show_bug.cgi?id=268071');let l=[...wr];Cr(e,l),Cr(t,l);for(const c of[...a,...s])Sr[c]||console.error(`Undefined include: ${c}`),Mr[c]||(Mr[c]=[],Cr(Sr[c],Mr[c])),l=[...l,...Mr[c]];return{fragmentSource:e=e.replace(r,((e,t,n,r,i)=>(o[i]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nin ${n} ${r} ${i};\n#else\nuniform ${n} ${r} u_${i};\n#endif\n`:"initialize"===t?`\n#ifdef HAS_UNIFORM_u_${i}\n ${n} ${r} ${i} = u_${i};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${i}\n in ${n} ${r} ${i};\n#endif\n`:"initialize-attribute"===t?"":void 0))),vertexSource:t=t.replace(r,((e,t,n,r,i)=>{const a="float"===r?"vec2":r,s=i.match(/color/)?"color":a;return"define-attribute-vertex-shader-only"===t?`\n#ifdef HAS_ATTRIBUTE_a_${i}\nin ${n} ${r} a_${i};\n#endif\n`:o[i]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nin ${n} ${a} a_${i};\nout ${n} ${r} ${i};\n#else\nuniform ${n} ${r} u_${i};\n#endif\n`:"initialize"===t?"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = a_${i};\n#else\n ${n} ${r} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = unpack_mix_${s}(a_${i}, u_${i}_t);\n#else\n ${n} ${r} ${i} = u_${i};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${i}\n in ${n} ${r} a_${i};\n out ${n} ${r} ${i};\n#endif\n`:"initialize-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${i}\n ${i} = a_${i};\n#endif\n`:void 0:"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nin ${n} ${a} a_${i};\n#else\nuniform ${n} ${r} u_${i};\n#endif\n`:"define-instanced"===t?"mat4"===s?`\n#ifdef INSTANCED_ARRAYS\nin vec4 a_${i}0;\nin vec4 a_${i}1;\nin vec4 a_${i}2;\nin vec4 a_${i}3;\n#else\nuniform ${n} ${r} u_${i};\n#endif\n`:`\n#ifdef INSTANCED_ARRAYS\nin ${n} ${a} a_${i};\n#else\nuniform ${n} ${r} u_${i};\n#endif\n`:"initialize-attribute-custom"===t?`\n#ifdef HAS_ATTRIBUTE_a_${i}\n ${n} ${r} ${i} = a_${i};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${i}\n ${n} ${r} ${i} = a_${i};\n#else\n ${n} ${r} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${n} ${r} ${i} = unpack_mix_${s}(a_${i}, u_${i}_t);\n#else\n ${n} ${r} ${i} = u_${i};\n#endif\n`})),staticAttributes:i,usedDefines:l,vertexIncludes:a,fragmentIncludes:s}}class Ir{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(e,t,n,r,i,o,a,s){this.context=e;let l=this.boundPaintVertexBuffers.length!==r.length;for(let u=0;!l&&u{const o=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),s=r.paint.get("hillshade-accent-color"),l=r.paint.get("hillshade-emissive-strength");let c=e.bB(r.paint.get("hillshade-illumination-direction"));if("viewport"===r.paint.get("hillshade-illumination-anchor"))c-=t.transform.angle;else if(t.style&&t.style.enable3dLights()&&t.style.directionalLight){const n=t.style.directionalLight.properties.get("direction"),r=e.c7(n.x,n.y,n.z);c=e.bB(r[1])}const u=!t.options.moving;return{u_matrix:i||t.transform.calculateProjMatrix(n.tileID.toUnwrapped(),u),u_image:0,u_latrange:Pr(0,n.tileID),u_light:[r.paint.get("hillshade-exaggeration"),c],u_shadow:o.toRenderColor(r.lut),u_highlight:a.toRenderColor(r.lut),u_emissive_strength:l,u_accent:s.toRenderColor(r.lut)}})(t,r,i,t.terrain?n.projMatrix:null);t.uploadCommonUniforms(l,d,n.toUnwrapped());const{tileBoundsBuffer:p,tileBoundsIndexBuffer:m,tileBoundsSegments:g}=t.getTileBoundsBuffers(r);d.draw(t,c.TRIANGLES,o,a,s,Fn.disabled,f,i.id,p,m,g)}function Lr(t,n,r){if(!n.needsDEMTextureUpload)return;const i=t.context,o=i.gl;i.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||t.getTileTexture(r.stride);const a=r.getPixels();n.demTexture?n.demTexture.update(a,{premultiply:!1}):n.demTexture=new e.T(i,a,o.R32F,{premultiply:!1}),n.needsDEMTextureUpload=!1}function zr(t,n,r){const i=t.context,o=i.gl;if(!n.dem)return;const a=n.dem;if(i.activeTexture.set(o.TEXTURE1),Lr(t,n,a),!n.demTexture)return;n.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE);const s=a.dim;i.activeTexture.set(o.TEXTURE0);let l=n.hillshadeFBO;if(!l){const t=new e.T(i,{width:s,height:s,data:null},o.RGBA8);t.bind(o.LINEAR,o.CLAMP_TO_EDGE),l=n.hillshadeFBO=i.createFramebuffer(s,s,!0,"renderbuffer"),l.colorAttachment.set(t.texture)}i.bindFramebuffer.set(l.framebuffer),i.viewport.set([0,0,s,s]);const{tileBoundsBuffer:c,tileBoundsIndexBuffer:u,tileBoundsSegments:h}=t.getMercatorTileBoundsBuffers(),d=[];t.linearFloatFilteringSupported()&&d.push("TERRAIN_DEM_FLOAT_FORMAT"),t.getOrCreateProgram("hillshadePrepare",{defines:d}).draw(t,o.TRIANGLES,Rn.disabled,zn.disabled,Pn.unblended,Fn.disabled,((t,n)=>{const r=n.stride,i=e.a6.mat4.create();return e.a6.mat4.ortho(i,0,e.ab,-e.ab,0,0,1),e.a6.mat4.translate(i,i,[0,-e.ab,0]),{u_matrix:i,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ}})(n.tileID,a),r.id,c,u,h),n.needsHillshadePrepare=!1}class Dr{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Or extends Dr{getDefault(){return e.bz.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Fr extends Dr{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class Br extends Dr{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class Nr extends Dr{getDefault(){return[!0,!0,!0,!0]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class jr extends Dr{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class Vr extends Dr{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class Ur extends Dr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class $r extends Dr{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class Gr extends Dr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class qr extends Dr{getDefault(){return[0,1]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class Wr extends Dr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class Hr extends Dr{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Zr extends Dr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class Yr extends Dr{getDefault(){const e=this.gl;return[e.ONE,e.ZERO,e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.blendFuncSeparate(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Xr extends Dr{getDefault(){return e.bz.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Kr extends Dr{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(e,e),this.current=e,this.dirty=!1)}}class Jr extends Dr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class Qr extends Dr{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class ei extends Dr{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}let ti=class extends Dr{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}};class ni extends Dr{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class ri extends Dr{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class ii extends Dr{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class oi extends Dr{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class ai extends Dr{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class si extends Dr{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class li extends Dr{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class ci extends Dr{getDefault(){return null}set(e){this.gl&&(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}}class ui extends Dr{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class hi extends Dr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class di extends Dr{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class fi extends Dr{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class pi extends fi{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class mi extends fi{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,this.attachment(),t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class gi extends fi{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,this.attachment(),t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class _i extends mi{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const yi=(e,t,n)=>({u_matrix:e,u_image0:0,u_skirt_height:t,u_ground_shadow_factor:n}),vi=(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m)=>({u_proj_matrix:Float32Array.from(e),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(r),u_merc_matrix:n,u_zoom_transition:i,u_merc_center:o,u_image0:0,u_frustum_tl:a,u_frustum_tr:s,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:u,u_globe_radius:h,u_viewport:d,u_grid_matrix:m?Float32Array.from(m):new Float32Array(9),u_skirt_height:f,u_far_z_cutoff:p});function xi(e,t){return null!=e&&null!=t&&!(!e.hasData()||!t.hasData())&&null!=e.demTexture&&null!=t.demTexture&&e.tileID.key!==t.tileID.key}const bi=new class{constructor(){this.operations={}}newMorphing(e,t,n,r,i){if(e in this.operations){const t=this.operations[e];t.to.tileID.key!==n.tileID.key&&(t.queued=n)}else this.operations[e]={startTime:r,phase:0,duration:i,from:t,to:n,queued:null}}getMorphValuesForProxy(e){if(!(e in this.operations))return null;const t=this.operations[e];return{from:t.from,to:t.to,phase:t.phase}}update(e){for(const t in this.operations){const n=this.operations[t];for(n.phase=(e-n.startTime)/n.duration;n.phase>=1||!this._validOp(n);)if(!this._nextOp(n,e)){delete this.operations[t];break}}}_nextOp(e,t){return!!e.queued&&(e.from=e.to,e.to=e.queued,e.queued=null,e.phase=0,e.startTime=t,!0)}_validOp(e){return e.from.hasData()&&e.to.hasData()}},wi={0:null,1:"TERRAIN_VERTEX_MORPHING"};function Si(e,t,n){if(0===t)return 0;const r=t<1&&514===n?.25/t:1;return 6*Math.pow(1.5,22-e)*Math.max(t,1)*r}function Mi(e,t){const n=1<({u_matrix:e});function Ei(t,n,r,i,o){if(o>0){const a=e.q.now(),s=(a-t.timeAdded)/o,l=n?(a-n.timeAdded)/o:-1,c=r.getSource(),u=i.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!n||Math.abs(n.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),d=h&&t.refreshedUponExpiration?1:e.ap(h?s:1-l,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),n?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}class Ti extends yt{constructor(t){const n={type:"raster-dem",maxzoom:t.transform.maxZoom},r=new e.cd(e.ce(),null),i=tt("mock-dem",n,r,t.style);super("mock-dem",i,!1),i.setEventedParent(this),this._sourceLoaded=!0}_loadTile(e,t){e.state="loaded",t(null)}}class Ci extends yt{constructor(t){const n=tt("proxy",{type:"geojson",maxzoom:t.transform.maxZoom},new e.cd(e.ce(),null),t.style);super("proxy",n,!1),n.setEventedParent(this),this.map=this.getSource().map=t,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(e,t,n){if(e.freezeTileCoverage)return;this.transform=e;const r=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce(((t,n)=>{if(t[n.key]="",!this._tiles[n.key]){const t=new pt(n,this._source.tileSize*n.overscaleFactor(),e.tileZoom);t.state="loaded",this._tiles[n.key]=t}return t}),{});for(const i in this._tiles)i in r||(this.freeFBO(i),this._tiles[i].unloadVectorData(),delete this._tiles[i])}freeFBO(e){const t=this.proxyCachedFBO[e];if(void 0!==t){const n=Object.values(t);this.renderCachePool.push(...n),delete this.proxyCachedFBO[e]}}deallocRenderCache(){this.renderCache.forEach((e=>e.fb.destroy())),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class ki extends e.aA{constructor(e,t,n){super(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y),this.proxyTileKey=t,this.projMatrix=n}}class Ii extends e.cE{constructor(t,n){super(),this._debugParams={sortTilesHiZFirst:!0,disableRenderCache:!1},t.tp.registerParameter(this._debugParams,["Terrain"],"sortTilesHiZFirst",{},(()=>{this._style.map.triggerRepaint()})),t.tp.registerParameter(this._debugParams,["Terrain"],"disableRenderCache",{},(()=>{this._style.map.triggerRepaint()})),t.tp.registerButton(["Terrain"],"Invalidate Render Cache",(()=>{this.invalidateRenderCache=!0,this._style.map.triggerRepaint()})),this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[r,i,o]=function(){const t=new e.a_,n=new e.aO,r=131;t.reserve(17161),n.reserve(33800);const i=e.ab/128,o=e.ab+i/2,a=o+i;for(let l=-i;lo||l<0||l>o?24575:0,i=e.ap(Math.round(n),0,e.ab),a=e.ap(Math.round(l),0,e.ab);t.emplaceBack(i+r,a)}const s=(e,t)=>{const i=t*r+e;n.emplaceBack(i+1,i,i+r),n.emplaceBack(i+r,i+r+1,i+1)};for(let e=1;e<129;e++)for(let t=1;t<129;t++)s(t,e);return[0,129].forEach((e=>{for(let t=0;t<130;t++)s(t,e),s(e,t)})),[t,n,32768]}(),a=t.context;this.gridBuffer=a.createVertexBuffer(r,e.b0.members),this.gridIndexBuffer=a.createIndexBuffer(i),this.gridSegments=e.b1.simpleSegment(0,0,r.length,i.length),this.gridNoSkirtSegments=e.b1.simpleSegment(0,0,r.length,o),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Ci(n.map),this.orthoMatrix=e.a6.mat4.create(),e.a6.mat4.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,e.ab,0,e.ab,0,1);const s=a.gl;this._overlapStencilMode=new zn({func:s.GEQUAL,mask:255},0,255,s.KEEP,s.KEEP,s.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=n,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Ti(n.map),this._pendingGroundEffectLayers=[]}set style(e){e.on("data",this._onStyleDataEvent.bind(this)),this._style=e,this._style.map.on("moveend",(()=>{this._clearLineLayersFromRenderCache()}))}update(t,n,r){if(t&&t.terrain){this._style!==t&&(this.style=t,this._evaluationZoom=void 0);const i=t.terrain.properties,o=0===t.terrain.drapeRenderMode,a=t.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=e.q.now();const s=t.terrain&&t.terrain.scope,l=i.get("source"),c=o?this._mockSourceCache:t.getSourceCache(l,s);if(!c)return void e.w(`Couldn't find terrain source "${l}".`);if(this.sourceCache=c,this._exaggeration=a?this.calculateExaggeration(n):i.get("exaggeration"),!n.projection.requiresDraping&&a&&0===this._exaggeration)return void this._disable();this.enabled=!0;const u=()=>{this.sourceCache.used&&e.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const t=this.getScaledDemTileSize();this.sourceCache.update(n,t,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,u(),this._initializing=!0),u(),n.updateElevation(!0,r),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(n),this._emptyDEMTextureDirty=!0,this._previousZoom=n.zoom}else this._disable()}calculateExaggeration(t){const n=this._previousCameraAltitude,r=t.getFreeCameraOptions().position.z/t.pixelsPerMeter*t.worldSize;this._previousCameraAltitude=r;const i=null!=n?r-n:Number.MAX_VALUE;if(Math.abs(i)<2)return this._exaggeration;const o=t.zoom,a=this._style.terrain;if(!this._previousUpdateTimestamp)return a.getExaggeration(o);let s=o-this._previousZoom;const l=this._previousUpdateTimestamp;let c=o;null!=this._evaluationZoom&&(c=this._evaluationZoom,Math.abs(o-c)>.5&&(s=.5*(o-c+s)),s*i<0&&(c+=s)),this._evaluationZoom=c;const u=a.getExaggeration(c),h=u===a.getExaggeration(Math.max(0,c-.1));if(h&&Math.abs(u-this._exaggeration)<.01)return u;let d=Math.min(.1,.00375*(this._updateTimestamp-l));return(h||u<.1||Math.abs(s)<1e-4)&&(d=Math.min(.2,4*d)),e.aa(this._exaggeration,u,d)}resetTileLookupCache(e){this._findCoveringTileCache[e]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(e){e.coord&&"source"===e.dataType?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const e in this._style._mergedSourceCaches)this._style._mergedSourceCaches[e].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach((e=>e.fb.destroy())),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const e=2*this.proxySourceCache.getSource().tileSize;return[e,e]}set useVertexMorphing(e){this._useVertexMorphing=e}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const n=this.proxySourceCache,r=this.painter.transform;this._initializing&&(this._initializing=0===r._centerAltitude&&-1===this.getAtPointOrZero(e.a5.fromLngLat(r.center),-1),this._emptyDEMTextureDirty=!this._initializing);const i=this.proxyCoords=n.getIds().map((e=>{const t=n.getTileByID(e).tileID;return t.projMatrix=r.calculateProjMatrix(t.toUnwrapped()),t}));!function(t,n){const r=n.transform.pointCoordinate(n.transform.getCameraPoint()),i=new e.P(r.x,r.y);t.sort(((t,n)=>{if(n.overscaledZ-t.overscaledZ)return n.overscaledZ-t.overscaledZ;const r=new e.P(t.canonical.x+(1<{this.proxyToSource[e.key]={}})),this.terrainTileForTile={};const a=this._style._mergedSourceCaches;for(const e in a){const n=a[e];if(!n.used)continue;if(n!==this.sourceCache&&this.resetTileLookupCache(n.id),this._setupProxiedCoordsForOrtho(n,t[e],o),n.usedForTerrain)continue;const r=t[e];n.getSource().reparseOverscaled&&this._assignTerrainTiles(r)}this.proxiedCoords[n.id]=i.map((e=>new ki(e,e.key,this.orthoMatrix))),this._assignTerrainTiles(i),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(o),this.renderingToTexture=!1;const s={};this._visibleDemTiles=[];for(const e of this.proxyCoords){const t=this.terrainTileForTile[e.key];if(!t)continue;const n=t.tileID.key;n in s||(this._visibleDemTiles.push(t),s[n]=n)}}_assignTerrainTiles(e){this._initializing||e.forEach((e=>{if(this.terrainTileForTile[e.key])return;const t=this._findTileCoveringTileID(e,this.sourceCache);t&&(this.terrainTileForTile[e.key]=t)}))}_prepareDEMTextures(){const e=this.painter.context,t=e.gl;for(const n in this.terrainTileForTile){const r=this.terrainTileForTile[n],i=r.dem;!i||r.demTexture&&!r.needsDEMTextureUpload||(e.activeTexture.set(t.TEXTURE1),Lr(this.painter,r,i))}}_prepareDemTileUniforms(e,t,n,r){if(!t||null==t.demTexture)return!1;const i=e.tileID.canonical,o=Math.pow(2,t.tileID.canonical.z-i.z),a=r||"";return n[`u_dem_tl${a}`]=[i.x*o%1,i.y*o%1],n[`u_dem_scale${a}`]=o,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let e=0;const t=this._visibleDemTiles.reduce(((t,n)=>{if(!n.dem)return t;const r=n.dem.tree.minimums[0];return r>0&&e++,t+r}),0);return e?t/e:0}_updateEmptyDEMTexture(){const t=this.painter.context,n=t.gl;t.activeTexture.set(n.TEXTURE2);const r=this._getLoadedAreaMinimum(),i=new e.cF({width:1,height:1},new Float32Array([r]));this._emptyDEMTextureDirty=!1;let o=this._emptyDEMTexture;return o?o.update(i,{premultiply:!1}):o=this._emptyDEMTexture=new e.T(t,i,n.R32F,{premultiply:!1}),o}setupElevationDraw(t,n,r){const i=this.painter.context,o=i.gl,a={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};a.u_exaggeration=this.exaggeration();let s=null,l=null,c=1;if(r&&r.morphing&&this._useVertexMorphing){const e=r.morphing.srcDemTile,n=r.morphing.dstDemTile;c=r.morphing.phase,e&&n&&(this._prepareDemTileUniforms(t,e,a,"_prev")&&(l=e),this._prepareDemTileUniforms(t,n,a)&&(s=n))}const u=e=>e&&e.demTexture&&this.painter.linearFloatFilteringSupported()?o.LINEAR:o.NEAREST;let h=null;var d;if(this.enabled?l&&s?(h=s.demTexture,i.activeTexture.set(o.TEXTURE4),l.demTexture.bind(u(l),o.CLAMP_TO_EDGE),a.u_dem_lerp=c):(s=this.terrainTileForTile[t.tileID.key],h=this._prepareDemTileUniforms(t,s,a)?s.demTexture:this.emptyDEMTexture):h=this.emptyDEMTexture,i.activeTexture.set(o.TEXTURE2),h&&(a.u_dem_size=1===(d=h).size[0]?1:d.size[0]-2,h.bind(u(s),o.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(r&&r.useDepthForOcclusion,n,a),r&&r.useMeterToDem&&s){const t=(1<{if(c===n)return;const r=[wi[n],"PROJECTION_GLOBE_VIEW"];h&&r.push("CUSTOM_ANTIALIASING");const i=t.isTileAffectedByFog(e);l=t.getOrCreateProgram("globeRaster",{defines:r,overrideFog:i}),c=n},f=t.colorModeForRenderPass(),p=new Rn(s.LEQUAL,Rn.ReadWrite,t.depthRangeFor3D);bi.update(o);const m=e.cy(u),g=[e.am(u.center.lng),e.at(u.center.lat)],_=t.globeSharedBuffers,y=[u.width*e.q.devicePixelRatio,u.height*e.q.devicePixelRatio],v=Float32Array.from(u.globeMatrix),x={useDenormalizedUpVectorScale:!0};{const u=t.transform,h=Si(u.zoom,n.exaggeration(),n.sourceCache._source.tileSize);c=-1;const b=s.TRIANGLES;for(const c of i){const i=r.getTile(c),w=zn.disabled,S=n.prevTerrainTileForTile[c.key],M=n.terrainTileForTile[c.key];xi(S,M)&&bi.newMorphing(c.key,S,M,o,250),a.activeTexture.set(s.TEXTURE0),i.texture&&i.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);const A=bi.getMorphValuesForProxy(c.key),E=A?1:0;A&&e.C(x,{morphing:{srcDemTile:A.from,dstDemTile:A.to,phase:e.cw(A.phase)}});const T=e.cz(c.canonical),C=e.cA(T.getCenter().lat),k=e.cB(c.canonical,T,C,u.worldSize/u._pixelsPerMercatorPixel),I=e.b5(e.cC(c.canonical)),P=vi(u.expandedFarZProjMatrix,v,m,I,e.a9(u.zoom),g,u.frustumCorners.TL,u.frustumCorners.TR,u.frustumCorners.BR,u.frustumCorners.BL,u.globeCenterInViewSpace,u.globeRadius,y,h,u._farZ,k);if(d(c,E),l&&(n.setupElevationDraw(i,l,x),t.uploadCommonUniforms(a,l,c.toUnwrapped()),_)){const[e,n,r]=_.getGridBuffers(C,0!==h);l.draw(t,b,p,w,f,Fn.backCCW,P,"globe_raster",e,n,r)}}}if(_&&(t.renderDefaultNorthPole||t.renderDefaultSouthPole)){const o=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];h&&o.push("CUSTOM_ANTIALIASING"),l=t.getOrCreateProgram("globeRaster",{defines:o});for(const c of i){const{x:i,y:o,z:h}=c.canonical,d=0===o,m=o===(1<e.draw(t,s.TRIANGLES,p,zn.disabled,f,Fn.disabled,vi(u.expandedFarZProjMatrix,_,_,M,0,g,u.frustumCorners.TL,u.frustumCorners.TR,u.frustumCorners.BR,u.frustumCorners.BL,u.globeCenterInViewSpace,u.globeRadius,y,0,u._farZ),"globe_pole_raster",n,w,S);n.setupElevationDraw(o,l,x),t.uploadCommonUniforms(a,l,c.toUnwrapped()),d&&t.renderDefaultNorthPole&&A(l,v),m&&t.renderDefaultSouthPole&&(_=e.a6.mat4.scale(e.a6.mat4.create(),_,[1,-1,1]),A(l,b))}}}}(t,n,r,i,o);else{const a=t.context,s=a.gl;let l,c;const u=t.shadowRenderer,h=Zn(t,t.longestCutoffRange),d=e=>{if(c===e)return;const n=[];n.push(wi[e]),h.shouldRenderCutoff&&n.push("RENDER_CUTOFF"),l=t.getOrCreateProgram("terrainRaster",{defines:n}),c=e},f=t.colorModeForRenderPass(),p=new Rn(s.LEQUAL,Rn.ReadWrite,t.depthRangeFor3D);bi.update(o);const m=t.transform,g=Si(m.zoom,n.exaggeration(),n.sourceCache._source.tileSize);let _=[0,0,0];if(u){const e=t.style.directionalLight,n=t.style.ambientLight;e&&n&&(_=tr(t.style,e,n))}{c=-1;const y=s.TRIANGLES,[v,x]=[n.gridIndexBuffer,n.gridSegments];for(const c of i){const i=r.getTile(c),b=zn.disabled,w=n.prevTerrainTileForTile[c.key],S=n.terrainTileForTile[c.key];xi(w,S)&&bi.newMorphing(c.key,w,S,o,250),a.activeTexture.set(s.TEXTURE0),i.texture&&i.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);const M=bi.getMorphValuesForProxy(c.key),A=M?1:0;let E;M&&(E={morphing:{srcDemTile:M.from,dstDemTile:M.to,phase:e.cw(M.phase)}});const T=yi(c.projMatrix,Mi(c.canonical,m.renderWorldCopies)?g/10:g,_);if(d(A),!l)continue;n.setupElevationDraw(i,l,E);const C=c.toUnwrapped();u&&u.setupShadows(C,l),t.uploadCommonUniforms(a,l,C,null,h),l.draw(t,y,p,b,f,Fn.backCCW,T,"terrain_raster",n.gridBuffer,v,x)}}}}(n,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,n.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(0===this._drapedRenderBatches.length)return t+1;this.renderingToTexture=!0;const n=this.painter,r=this.painter.context,i=this.proxySourceCache,o=this.proxiedCoords[i.id],a=this._drapedRenderBatches.shift(),s=n.style.order,l=[];let c=0;for(const u of o){const o=i.getTileByID(u.proxyTileKey),h=i.proxyCachedFBO[u.key]?i.proxyCachedFBO[u.key][t]:void 0,d=void 0!==h?i.renderCache[h]:this.pool[c++],f=void 0!==h;if(o.texture=d.tex,f&&!d.dirty){l.push(o.tileID);continue}let p;r.bindFramebuffer.set(d.fb.framebuffer),this.renderedToTile=!1,d.dirty&&(r.clear({color:e.bz.transparent,stencil:0}),d.dirty=!1);for(let e=a.start;e<=a.end;++e){const t=n.style._mergedLayers[s[e]];if(t.isHidden(n.transform.zoom))continue;const i=n.style.getLayerSourceCache(t),o=i?this.proxyToSource[u.key][i.id]:[u];if(!o)continue;const a=o;r.viewport.set([0,0,d.fb.width,d.fb.height]),p!==(i?i.id:null)&&(this._setupStencil(d,o,t,i),p=i?i.id:null),n.renderLayer(n,i,t,a)}if(0===this._drapedRenderBatches.length)for(const e of this._pendingGroundEffectLayers){const t=n.style._mergedLayers[s[e]];if(t.isHidden(n.transform.zoom))continue;const i=n.style.getLayerSourceCache(t),o=i?this.proxyToSource[u.key][i.id]:[u];if(!o)continue;const a=o;r.viewport.set([0,0,d.fb.width,d.fb.height]),p!==(i?i.id:null)&&(this._setupStencil(d,o,t,i),p=i?i.id:null),n.renderLayer(n,i,t,a)}this.renderedToTile?(d.dirty=!0,l.push(o.tileID)):f||--c,5===c&&(c=0,this.renderToBackBuffer(l))}return this.renderToBackBuffer(l),this.renderingToTexture=!1,r.bindFramebuffer.set(null),r.viewport.set([0,0,n.width,n.height]),a.end+1}postRender(){}isLayerOrderingCorrect(e){const t=e.order.length;let n=-1,r=t;for(let i=0;in}getMinElevationBelowMSL(){let e=0;return this._visibleDemTiles.filter((e=>e.dem)).forEach((t=>{e=Math.min(e,t.dem.tree.minimums[0])})),0===e?e:(e-30)*this._exaggeration}raycast(e,t,n){if(!this._visibleDemTiles)return null;const r=this._visibleDemTiles.filter((e=>e.dem)).map((r=>{const i=r.tileID,o=1<(null!==e.t?e.t:Number.MAX_VALUE)-(null!==t.t?t.t:Number.MAX_VALUE)));for(const i of r){if(null==i.t)return null;const r=i.tile.dem.tree.raycast(i.minx,i.miny,i.maxx,i.maxy,e,t,n);if(null!=r)return r}return null}_createFBO(){const t=this.painter.context,n=t.gl,r=this.drapeBufferSize;t.activeTexture.set(n.TEXTURE0);const i=new e.T(t,{width:r[0],height:r[1],data:null},n.RGBA8);i.bind(n.LINEAR,n.CLAMP_TO_EDGE);const o=t.createFramebuffer(r[0],r[1],!0,null);return o.colorAttachment.set(i.texture),o.depthAttachment=new _i(t,o.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,r[0],r[1]),this._stencilRef=0,o.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):o.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&n.texParameterf(n.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:o,tex:i,dirty:!1}}_initFBOPool(){for(;this.pool.length{const t=this._style._mergedLayers[e],n=t.isHidden(this.painter.transform.zoom);return"hillshade"===t.type||"custom"===t.type?!n&&t.shouldRedrape():!n&&t.hasTransition()}))}_clearLineLayersFromRenderCache(){let t=!1;for(const e of this._style.getSources())if(e instanceof Ke){t=!0;break}if(!t)return;const n={};for(let r=0;re>t.end))||e.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=r}_setupRenderCache(e){const t=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,t.renderCache.length>t.renderCachePool.length){const e=Object.values(t.proxyCachedFBO);t.proxyCachedFBO={};for(let n=0;n=0;o--){const i=n[o];if(t.getTileByID(i.key),void 0!==t.proxyCachedFBO[i.key]){const n=e[i.key],o=this.proxyToSource[i.key];let a=0;for(const e in o){const t=o[e],i=n[e];if(!i||i.length!==t.length||t.some(((t,n)=>t!==i[n]||r[e]&&r[e].hasOwnProperty(t.key)))){a=-1;break}++a}for(const e in t.proxyCachedFBO[i.key])t.renderCache[t.proxyCachedFBO[i.key][e]].dirty=a<0||a!==Object.values(n).length}}const i=[...this._drapedRenderBatches];i.sort(((e,t)=>t.end-t.start-(e.end-e.start)));for(const o of i)for(const e of n){if(t.proxyCachedFBO[e.key])continue;let n=t.renderCachePool.pop();void 0===n&&t.renderCache.length<50&&(n=t.renderCache.length,t.renderCache.push(this._createFBO())),void 0!==n&&(t.proxyCachedFBO[e.key]={},t.proxyCachedFBO[e.key][o.start]=n,t.renderCache[n].dirty=!0)}this._tilesDirty={}}_setupStencil(e,t,n,r){if(!r||!this._sourceTilesOverlap[r.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const i=this.painter.context,o=i.gl;if(t.length<=1)return void(this._overlapStencilType=!1);let a;if(n.isTileClipped())a=t.length,this._overlapStencilMode.test={func:o.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(t[0].overscaledZ>t[t.length-1].overscaledZ))return void(this._overlapStencilType=!1);a=1,this._overlapStencilMode.test={func:o.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+a>255&&(i.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=a,this._overlapStencilMode.ref=this._stencilRef,n.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(e){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[e.key]),this._overlapStencilMode):zn.disabled}_renderTileClippingMasks(e,t){const n=this.painter,r=this.painter.context,i=r.gl;n._tileClippingMaskIDs={},r.setColorMode(Pn.disabled),r.setDepthMode(Rn.disabled);const o=n.getOrCreateProgram("clippingMask");for(const a of e){const e=n._tileClippingMaskIDs[a.key]=--t;o.draw(n,i.TRIANGLES,Rn.disabled,new zn({func:i.ALWAYS,mask:0},e,255,i.KEEP,i.KEEP,i.REPLACE),Pn.disabled,Fn.disabled,Ai(a.projMatrix),"$clipping",n.tileExtentBuffer,n.quadTriangleIndexBuffer,n.tileExtentSegments)}}pointCoordinate(t){const n=this.painter.transform;if(t.x<0||t.x>n.width||t.y<0||t.y>n.height)return null;const r=[t.x,t.y,1,1];e.a6.vec4.transformMat4(r,r,n.pixelMatrixInverse),e.a6.vec4.scale(r,r,1/r[3]),r[0]/=n.worldSize,r[1]/=n.worldSize;const i=n._camera.position,o=e.bD(1,n.center.lat),a=[i[0],i[1],i[2]/o,0],s=e.a6.vec3.subtract([],r.slice(0,3),a);e.a6.vec3.normalize(s,s);const l=this.raycast(a,s,this._exaggeration);return null!==l&&l?(e.a6.vec3.scaleAndAdd(a,a,s,l),a[3]=a[2],a[2]*=o,a):null}_setupProxiedCoordsForOrtho(t,n,r){if(t.getSource()instanceof e.aD)return this._setupProxiedCoordsForImageSource(t,n,r);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const i=this.proxiedCoords[t.id]=[],o=this.proxyCoords;for(let e=0;et.overscaledZ-e.overscaledZ))}_setupProxiedCoordsForImageSource(t,n,r){if(!t.getSource().loaded())return;const i=this.proxiedCoords[t.id]=[],o=this.proxyCoords,a=t.getSource(),s=a.tileID;if(!s)return;const l=new e.P(s.x,s.y)._div(1<(e.min.x=Math.min(e.min.x,t.x-l.x),e.min.y=Math.min(e.min.y,t.y-l.y),e.max.x=Math.max(e.max.x,t.x-l.x),e.max.y=Math.max(e.max.y,t.y-l.y),e)),{min:new e.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new e.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),u=(t,n)=>{const r=t.wrap+t.canonical.x/(1<a+c.max.x||i+os+c.max.y};for(let e=0;ee.key===n.tileID.key));if(e)return e}if(n.tileID.key!==t.key){const r=t.canonical.z-n.tileID.canonical.z;let o,a,s;i=e.a6.mat4.create();const l=n.tileID.wrap-t.wrap<0?(o=e.ab>>r,a=o*((n.tileID.canonical.x<=i){const r=t.canonical.z-i;n.getSource().reparseOverscaled?(s=Math.max(t.canonical.z+2,n.transform.tileZoom),a=new e.aA(s,t.wrap,i,t.canonical.x>>r,t.canonical.y>>r)):0!==r&&(s=i,a=new e.aA(s,t.wrap,i,t.canonical.x>>r,t.canonical.y>>r))}a.key!==t.key&&(c.push(a.key),r=n.getTile(a))}const u=e=>{c.forEach((t=>{i[t]=e})),c.length=0};for(s-=1;s>=l&&(!r||!r.hasData());s--){r&&u(r.tileID.key);const e=a.calculateScaledKey(s);if(r=n.getTileByID(e),r&&r.hasData())break;const t=i[e];if(null===t)break;void 0===t?c.push(e):r=n.getTileByID(t)}return u(r?r.tileID.key:null),r&&r.hasData()?r:null}findDEMTileFor(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(e,t){let n=this._tilesDirty[e];n||(n=this._tilesDirty[e]={}),n[t.key]=!0}}function Pi(t,n,r){const i=function(t,n,r){const i=e.a6.vec3.dot(n,t),o=e.a6.vec3.dot(r,[.2126,.7152,.0722]),a=(e,t,n)=>(1-n)*e+n*t,s=a(1-.3*Math.min(o,1),1,Math.min(i+1,1));return a(.92,1,Math.asin(e.ap(n[2],-1,1))/Math.PI+.5)*s}(t,[0,0,1],n),o=[0,0,0];e.a6.vec3.scale(o,r.slice(0,3),i);const a=[0,0,0];e.a6.vec3.scale(a,n.slice(0,3),t[2]);const s=[0,0,0];return e.a6.vec3.add(s,o,a),e.cb(s)}const Ri=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],Li=["stars","fillExtrusion","fillExtrusionGroundEffect","model","symbol"];class zi{static cacheKey(e,t,n,r){let i=`${t}${r?r.cacheKey:""}`;for(const o of n)e.usedDefines.includes(o)&&(i+=`/${o}`);return i}constructor(t,n,r,i,o,a){const s=t.gl;this.program=s.createProgram(),this.configuration=i,this.name=n,this.fixedDefines=[...a];const l=i?i.getBinderAttributes():[],c=(r.staticAttributes||[]).concat(l);let u=i?i.defines():[];u=u.concat(a.map((e=>`#define ${e}`)));const h="#version 300 es\n";let d=h+u.concat("precision mediump float;",Er,Ar.fragmentSource).join("\n");for(const e of r.fragmentIncludes)d+=`\n${Sr[e]}`;d+=`\n${r.fragmentSource}`;let f=h+u.concat("precision highp float;",Er,Ar.vertexSource).join("\n");for(const e of r.vertexIncludes)f+=`\n${Sr[e]}`;f+=`\n${r.vertexSource}`;const p=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);s.shaderSource(p,d),s.compileShader(p),s.attachShader(this.program,p);const m=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())this.failedToCreate=!0;else{s.shaderSource(m,f),s.compileShader(m),s.attachShader(this.program,m),this.attributes={},this.numAttributes=c.length;for(let e=0;e({u_dem:new e.bJ(t),u_dem_prev:new e.bJ(t),u_dem_tl:new e.bG(t),u_dem_scale:new e.bI(t),u_dem_tl_prev:new e.bG(t),u_dem_scale_prev:new e.bI(t),u_dem_size:new e.bI(t),u_dem_lerp:new e.bI(t),u_exaggeration:new e.bI(t),u_depth:new e.bJ(t),u_depth_size_inv:new e.bG(t),u_depth_range_unpack:new e.bG(t),u_occluder_half_size:new e.bI(t),u_occlusion_depth_offset:new e.bI(t),u_meter_to_dem:new e.bI(t),u_label_plane_matrix_inv:new e.bF(t)}))(t)),a.includes("GLOBE")&&(this.globeUniforms=(t=>({u_tile_tl_up:new e.bH(t),u_tile_tr_up:new e.bH(t),u_tile_br_up:new e.bH(t),u_tile_bl_up:new e.bH(t),u_tile_up_scale:new e.bI(t)}))(t)),a.includes("FOG")&&(this.fogUniforms=(t=>({u_fog_matrix:new e.bF(t),u_fog_range:new e.bG(t),u_fog_color:new e.c6(t),u_fog_horizon_blend:new e.bI(t),u_fog_vertical_limit:new e.bG(t),u_fog_temporal_offset:new e.bI(t),u_frustum_tl:new e.bH(t),u_frustum_tr:new e.bH(t),u_frustum_br:new e.bH(t),u_frustum_bl:new e.bH(t),u_globe_pos:new e.bH(t),u_globe_radius:new e.bI(t),u_globe_transition:new e.bI(t),u_is_globe:new e.bJ(t),u_viewport:new e.bG(t)}))(t)),a.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(t=>({u_cutoff_params:new e.c6(t)}))(t)),a.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(t=>({u_lighting_ambient_color:new e.bH(t),u_lighting_directional_dir:new e.bH(t),u_lighting_directional_color:new e.bH(t),u_ground_radiance:new e.bH(t)}))(t)),a.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(t=>({u_light_matrix_0:new e.bF(t),u_light_matrix_1:new e.bF(t),u_fade_range:new e.bG(t),u_shadow_normal_offset:new e.bH(t),u_shadow_intensity:new e.bI(t),u_shadow_texel_size:new e.bI(t),u_shadow_map_resolution:new e.bI(t),u_shadow_direction:new e.bH(t),u_shadow_bias:new e.bH(t),u_shadowmap_0:new e.bJ(t),u_shadowmap_1:new e.bJ(t)}))(t))}}setTerrainUniformValues(e,t){if(!this.terrainUniforms)return;const n=this.terrainUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)n[e]&&n[e].set(this.program,e,t[e])}}setGlobeUniformValues(e,t){if(!this.globeUniforms)return;const n=this.globeUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)n[e]&&n[e].set(this.program,e,t[e])}}setFogUniformValues(e,t){if(!this.fogUniforms)return;const n=this.fogUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)n[e].set(this.program,e,t[e])}}setCutoffUniformValues(e,t){if(!this.cutoffUniforms)return;const n=this.cutoffUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)n[e].set(this.program,e,t[e])}}setLightsUniformValues(e,t){if(!this.lightsUniforms)return;const n=this.lightsUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)n[e].set(this.program,e,t[e])}}setShadowUniformValues(e,t){if(this.failedToCreate||!this.shadowUniforms)return;const n=this.shadowUniforms;e.program.set(this.program);for(const r in t)n[r].set(this.program,r,t[r])}_drawDebugWireframe(t,n,r,i,o,a,s,l,c,u){const h=t.options.wireframe;if(!1===h.terrain&&!1===h.layers2D&&!1===h.layers3D)return;const d=t.context;if(!(()=>!(!h.terrain||"terrainRaster"!==this.name&&"globeRaster"!==this.name)||!(!h.layers2D||t._terrain&&t._terrain.renderingToTexture||!Ri.includes(this.name))||!(!h.layers3D||!Li.includes(this.name)))())return;const f=d.gl,p=t.wireframeDebugCache.getLinesFromTrianglesBuffer(t.frameCounter,o,d);if(!p)return;const m=[...this.fixedDefines];m.push("DEBUG_WIREFRAME");const g=t.getOrCreateProgram(this.name,{config:this.configuration,defines:m});d.program.set(g.program);const _=(e,t,n)=>{if(t[e]&&n[e])for(const r in t[e])n[e][r]&&n[e][r].set(n.program,r,t[e][r].current)};c&&c.setUniforms(g.program,d,g.binderUniforms,s,{zoom:l}),_("fixedUniforms",this,g),_("terrainUniforms",this,g),_("globeUniforms",this,g),_("fogUniforms",this,g),_("lightsUniforms",this,g),_("shadowUniforms",this,g),p.bind(),d.setColorMode(new Pn([f.ONE,f.ONE_MINUS_SRC_ALPHA,f.ZERO,f.ONE],e.bz.transparent,[!0,!0,!0,!1])),d.setDepthMode(new Rn(n.func===f.LESS?f.LEQUAL:n.func,Rn.ReadOnly,n.range)),d.setStencilMode(zn.disabled);const y=3*a.primitiveLength*2,v=3*a.primitiveOffset*2*2;u&&u>1?f.drawElementsInstanced(f.LINES,y,f.UNSIGNED_SHORT,v,u):f.drawElements(f.LINES,y,f.UNSIGNED_SHORT,v),o.bind(),d.program.set(this.program),d.setDepthMode(n),d.setStencilMode(r),d.setColorMode(i)}draw(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m){const g=e.context,_=g.gl;if(this.failedToCreate)return;g.program.set(this.program),g.setDepthMode(n),g.setStencilMode(r),g.setColorMode(i),g.setCullFace(o);for(const x of Object.keys(this.fixedUniforms))this.fixedUniforms[x].set(this.program,x,a[x]);f&&f.setUniforms(this.program,g,this.binderUniforms,h,{zoom:d});const y={[_.POINTS]:1,[_.LINES]:2,[_.TRIANGLES]:3,[_.LINE_STRIP]:1}[t],v=m&&m>0?1:void 0;for(const x of u.get()){const o=x.vaos||(x.vaos={});(o[s]||(o[s]=new Ir)).bind(g,this,l,f?f.getPaintVertexBuffers():[],c,x.vertexOffset,p||[],v),m&&m>1?_.drawElementsInstanced(t,x.primitiveLength*y,_.UNSIGNED_SHORT,x.primitiveOffset*y*2,m):c?_.drawElements(t,x.primitiveLength*y,_.UNSIGNED_SHORT,x.primitiveOffset*y*2):_.drawArrays(t,x.vertexOffset,x.vertexLength),t===_.TRIANGLES&&c&&this._drawDebugWireframe(e,n,r,i,c,x,h,d,f,m)}}}function Di(t,n){const r=Math.pow(2,n.tileID.overscaledZ),i=n.tileSize*Math.pow(2,t.transform.tileZoom)/r,o=i*(n.tileID.canonical.x+n.tileID.wrap*r),a=i*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture?n.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/e.ak(n,1,t.transform.tileZoom),u_pixel_coord_upper:[o>>16,a>>16],u_pixel_coord_lower:[65535&o,65535&a]}}const Oi=e.a6.mat4.create(),Fi=(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g)=>{const _=n.style.light,y=_.properties.get("position"),v=[y.x,y.y,y.z],x=e.a6.mat3.create();"viewport"===_.properties.get("anchor")&&(e.a6.mat3.fromRotation(x,-n.transform.angle),e.a6.vec3.transformMat3(v,v,x));const b=_.properties.get("color"),w=n.transform,S={u_matrix:t,u_lightpos:v,u_lightintensity:_.properties.get("intensity"),u_lightcolor:[b.r,b.g,b.b],u_vertical_gradient:+r,u_opacity:i,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Oi,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:o,u_edge_radius:a,u_width_scale:s,u_flood_light_color:f,u_vertical_scale:p,u_flood_light_intensity:m,u_ground_shadow_factor:g};return"globe"===w.projection.name&&(S.u_tile_id=[l.canonical.x,l.canonical.y,1<({u_matrix:e,u_edge_radius:t,u_width_scale:n,u_vertical_scale:r}),Ni=(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m)=>{const g=Fi(t,n,r,i,o,a,s,l,u,h,d,f,p,m,1,[0,0,0]),_={u_height_factor:-Math.pow(2,l.overscaledZ)/c.tileSize/8};return e.l(g,Di(n,c),_)},ji=(e,t)=>({u_matrix:e,u_emissive_strength:t}),Vi=(t,n,r,i)=>e.l(ji(t,n),Di(r,i)),Ui=(e,t,n)=>({u_matrix:e,u_world:n,u_emissive_strength:t}),$i=(t,n,r,i,o)=>e.l(Vi(t,n,r,i),{u_world:o}),Gi=(t,n,r,i)=>{const o=e.ab/r.tileSize;return{u_matrix:t,u_camera_to_center_distance:n.getCameraToCenterDistance(i),u_extrude_scale:[n.pixelsToGLUnits[0]/o,n.pixelsToGLUnits[1]/o]}},qi=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return{u_matrix:e,u_color:t.toRenderColor(null),u_overlay:0,u_overlay_scale:n}},Wi=e.a6.mat4.create(),Hi=(t,n,r,i,o,a,s)=>{const l=t.transform,c="globe"===l.projection.name,u=c?e.cI(l.zoom,n.canonical)*l._pixelsPerMercatorPixel:e.ak(r,1,a),h={u_matrix:n.projMatrix,u_extrude_scale:u,u_intensity:s,u_inv_rot_matrix:Wi,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){h.u_inv_rot_matrix=i,h.u_merc_center=o,h.u_tile_id=[n.canonical.x,n.canonical.y,1<({u_matrix:t,u_normalize_matrix:n,u_globe_matrix:r,u_merc_matrix:i,u_grid_matrix:o,u_tl_parent:a,u_scale_parent:u,u_fade_t:h.mix,u_opacity:h.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:e.cJ(d.paint.get("raster-saturation")),u_contrast_factor:e.cK(d.paint.get("raster-contrast")),u_spin_weights:Ki(d.paint.get("raster-hue-rotate")),u_perspective_transform:f,u_raster_elevation:p,u_zoom_transition:s,u_merc_center:l,u_cutoff_params:c,u_colorization_mix:Zi(e.cL,g,y),u_colorization_offset:Yi(e.cL,_,y),u_color_ramp:m,u_texture_offset:[x/(v+2*x),v/(v+2*x)],u_texture_res:[v+2*x,v+2*x],u_emissive_strength:b});function Ki(e){e*=Math.PI/180;const t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const Ji=.05,Qi=(e,t,n,r,i,o,a,s,l,c,u,h)=>({u_matrix:e,u_normalize_matrix:t,u_globe_matrix:n,u_merc_matrix:r,u_grid_matrix:i,u_tl_parent:o,u_scale_parent:c,u_fade_t:u.mix,u_opacity:u.opacity,u_image0:0,u_image1:1,u_raster_elevation:h,u_zoom_transition:a,u_merc_center:s,u_cutoff_params:l}),eo=(e,t,n,r,i,o,a,s,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_tile_offset:n,u_velocity:r,u_color_ramp:o,u_velocity_res:i,u_max_speed:a,u_uv_offset:s,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[Ji,Ji]}),to=(e,t,n,r,i,o,a,s,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_velocity:n,u_velocity_res:r,u_max_speed:i,u_speed_factor:o,u_reset_rate:a,u_rand_seed:Math.random(),u_uv_offset:s,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[Ji,Ji]}),no=e.a6.mat4.create(),ro=(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b)=>{const w=o.transform,S={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:n?n.uSizeT:0,u_size:n?n.uSize:0,u_camera_to_center_distance:w.getCameraToCenterDistance(v),u_rotate_symbol:+r,u_aspect_ratio:w.width/w.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:s,u_coord_matrix:l,u_is_text:+u,u_elevation_from_sea:c?1:0,u_pitch_with_map:+i,u_texsize:h,u_texsize_icon:d,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:no,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:no,u_up_vector:[0,-1,0],u_color_adj_mat:x,u_icon_transition:b||0,u_gamma_scale:i?o.transform.getCameraToCenterDistance(v)*Math.cos(o.terrain?0:o.transform._pitch):1,u_device_pixel_ratio:e.q.devicePixelRatio,u_is_halo:+f};return"globe"===v.name&&(S.u_tile_id=[p.canonical.x,p.canonical.y,1<({u_matrix:e,u_emissive_strength:t,u_opacity:n,u_color:r}),oo=(t,n,r,i,o,a,s,l,c)=>e.l(function(t,n,r,i,o,a){const{width:s,height:l}=i.imageManager.getPixelSize(n),c=Math.pow(2,a.tileID.overscaledZ),u=a.tileSize*Math.pow(2,i.transform.tileZoom)/c,h=u*(a.tileID.canonical.x+a.tileID.wrap*c),d=u*a.tileID.canonical.y;return{u_image:0,u_pattern_tl:r.tl,u_pattern_br:r.br,u_texsize:[s,l],u_pattern_size:r.displaySize,u_pattern_units_to_pixels:o?[i.transform.width,-1*i.transform.height]:[1/e.ak(a,1,i.transform.tileZoom),1/e.ak(a,1,i.transform.tileZoom)],u_pixel_coord_upper:[h>>16,d>>16],u_pixel_coord_lower:[65535&h,65535&d]}}(0,a,s,i,l,c),{u_matrix:t,u_emissive_strength:n,u_opacity:r}),ao=new Float32Array(e.a6.mat4.identity([])),so=function(t,n,r,i,o,a,s,l,c,u,h,d,f){let p=arguments.length>13&&void 0!==arguments[13]?arguments[13]:[0,0,0],m=arguments.length>14?arguments[14]:void 0;const g=o.style.light,_=g.properties.get("position"),y=[-_.x,-_.y,_.z],v=e.a6.mat3.create();"viewport"===g.properties.get("anchor")&&(e.a6.mat3.fromRotation(v,-o.transform.angle),e.a6.vec3.transformMat3(y,y,v));const x="MASK"===h.alphaMode,b=g.properties.get("color").toRenderColor(null),w=f.paint.get("model-ambient-occlusion-intensity"),S=f.paint.get("model-color").constantOr(e.bz.white).toRenderColor(null),M=f.paint.get("model-color-mix-intensity").constantOr(0);return{u_matrix:t,u_lighting_matrix:n,u_normal_matrix:r,u_node_matrix:i||ao,u_lightpos:y,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[b.r,b.g,b.b],u_camera_pos:p,u_opacity:a,u_baseTextureIsAlpha:0,u_alphaMask:+x,u_alphaCutoff:h.alphaCutoff,u_baseColorFactor:[s.r,s.g,s.b,s.a],u_emissiveFactor:[l[0],l[1],l[2],1],u_metallicFactor:c,u_roughnessFactor:u,u_baseColorTexture:$n.BaseColor,u_metallicRoughnessTexture:$n.MetallicRoughness,u_normalTexture:$n.Normal,u_occlusionTexture:$n.Occlusion,u_emissionTexture:$n.Emission,u_lutTexture:$n.LUT,u_color_mix:[S.r,S.g,S.b,M],u_aoIntensity:w,u_emissive_strength:d,u_occlusionTextureTransform:m||[0,0,0,0]}},lo=function(e){return{u_matrix:e,u_instance:arguments.length>1&&void 0!==arguments[1]?arguments[1]:ao,u_node_matrix:arguments.length>2&&void 0!==arguments[2]?arguments[2]:ao}},co={fillExtrusion:t=>({u_matrix:new e.bF(t),u_lightpos:new e.bH(t),u_lightintensity:new e.bI(t),u_lightcolor:new e.bH(t),u_vertical_gradient:new e.bI(t),u_opacity:new e.bI(t),u_edge_radius:new e.bI(t),u_width_scale:new e.bI(t),u_ao:new e.bG(t),u_tile_id:new e.bH(t),u_zoom_transition:new e.bI(t),u_inv_rot_matrix:new e.bF(t),u_merc_center:new e.bG(t),u_up_dir:new e.bH(t),u_height_lift:new e.bI(t),u_flood_light_color:new e.bH(t),u_vertical_scale:new e.bI(t),u_flood_light_intensity:new e.bI(t),u_ground_shadow_factor:new e.bH(t)}),fillExtrusionDepth:t=>({u_matrix:new e.bF(t),u_edge_radius:new e.bI(t),u_width_scale:new e.bI(t),u_vertical_scale:new e.bI(t)}),fillExtrusionPattern:t=>({u_matrix:new e.bF(t),u_lightpos:new e.bH(t),u_lightintensity:new e.bI(t),u_lightcolor:new e.bH(t),u_vertical_gradient:new e.bI(t),u_height_factor:new e.bI(t),u_edge_radius:new e.bI(t),u_width_scale:new e.bI(t),u_ao:new e.bG(t),u_tile_id:new e.bH(t),u_zoom_transition:new e.bI(t),u_inv_rot_matrix:new e.bF(t),u_merc_center:new e.bG(t),u_up_dir:new e.bH(t),u_height_lift:new e.bI(t),u_image:new e.bJ(t),u_texsize:new e.bG(t),u_pixel_coord_upper:new e.bG(t),u_pixel_coord_lower:new e.bG(t),u_tile_units_to_pixels:new e.bI(t),u_opacity:new e.bI(t)}),fillExtrusionGroundEffect:t=>({u_matrix:new e.bF(t),u_opacity:new e.bI(t),u_ao_pass:new e.bI(t),u_meter_to_tile:new e.bI(t),u_ao:new e.bG(t),u_flood_light_intensity:new e.bI(t),u_flood_light_color:new e.bH(t),u_attenuation:new e.bI(t),u_edge_radius:new e.bI(t),u_fb:new e.bJ(t),u_fb_size:new e.bI(t),u_dynamic_offset:new e.bI(t)}),fill:t=>({u_matrix:new e.bF(t),u_emissive_strength:new e.bI(t)}),fillPattern:t=>({u_matrix:new e.bF(t),u_emissive_strength:new e.bI(t),u_image:new e.bJ(t),u_texsize:new e.bG(t),u_pixel_coord_upper:new e.bG(t),u_pixel_coord_lower:new e.bG(t),u_tile_units_to_pixels:new e.bI(t)}),fillOutline:t=>({u_matrix:new e.bF(t),u_emissive_strength:new e.bI(t),u_world:new e.bG(t)}),fillOutlinePattern:t=>({u_matrix:new e.bF(t),u_emissive_strength:new e.bI(t),u_world:new e.bG(t),u_image:new e.bJ(t),u_texsize:new e.bG(t),u_pixel_coord_upper:new e.bG(t),u_pixel_coord_lower:new e.bG(t),u_tile_units_to_pixels:new e.bI(t)}),circle:e.cN,collisionBox:t=>({u_matrix:new e.bF(t),u_camera_to_center_distance:new e.bI(t),u_extrude_scale:new e.bG(t)}),collisionCircle:t=>({u_matrix:new e.bF(t),u_inv_matrix:new e.bF(t),u_camera_to_center_distance:new e.bI(t),u_viewport_size:new e.bG(t)}),debug:t=>({u_color:new e.cu(t),u_matrix:new e.bF(t),u_overlay:new e.bJ(t),u_overlay_scale:new e.bI(t)}),clippingMask:t=>({u_matrix:new e.bF(t)}),heatmap:t=>({u_extrude_scale:new e.bI(t),u_intensity:new e.bI(t),u_matrix:new e.bF(t),u_inv_rot_matrix:new e.bF(t),u_merc_center:new e.bG(t),u_tile_id:new e.bH(t),u_zoom_transition:new e.bI(t),u_up_dir:new e.bH(t)}),heatmapTexture:t=>({u_image:new e.bJ(t),u_color_ramp:new e.bJ(t),u_opacity:new e.bI(t)}),hillshade:t=>({u_matrix:new e.bF(t),u_image:new e.bJ(t),u_latrange:new e.bG(t),u_light:new e.bG(t),u_shadow:new e.cu(t),u_highlight:new e.cu(t),u_emissive_strength:new e.bI(t),u_accent:new e.cu(t)}),hillshadePrepare:t=>({u_matrix:new e.bF(t),u_image:new e.bJ(t),u_dimension:new e.bG(t),u_zoom:new e.bI(t)}),line:e.cO,linePattern:e.cP,raster:t=>({u_matrix:new e.bF(t),u_normalize_matrix:new e.bF(t),u_globe_matrix:new e.bF(t),u_merc_matrix:new e.bF(t),u_grid_matrix:new e.cv(t),u_tl_parent:new e.bG(t),u_scale_parent:new e.bI(t),u_fade_t:new e.bI(t),u_opacity:new e.bI(t),u_image0:new e.bJ(t),u_image1:new e.bJ(t),u_brightness_low:new e.bI(t),u_brightness_high:new e.bI(t),u_saturation_factor:new e.bI(t),u_contrast_factor:new e.bI(t),u_spin_weights:new e.bH(t),u_perspective_transform:new e.bG(t),u_raster_elevation:new e.bI(t),u_zoom_transition:new e.bI(t),u_merc_center:new e.bG(t),u_cutoff_params:new e.c6(t),u_colorization_mix:new e.c6(t),u_colorization_offset:new e.bI(t),u_color_ramp:new e.bJ(t),u_texture_offset:new e.bG(t),u_texture_res:new e.bG(t),u_emissive_strength:new e.bI(t)}),rasterParticle:t=>({u_matrix:new e.bF(t),u_normalize_matrix:new e.bF(t),u_globe_matrix:new e.bF(t),u_merc_matrix:new e.bF(t),u_grid_matrix:new e.cv(t),u_tl_parent:new e.bG(t),u_scale_parent:new e.bI(t),u_fade_t:new e.bI(t),u_opacity:new e.bI(t),u_image0:new e.bJ(t),u_image1:new e.bJ(t),u_raster_elevation:new e.bI(t),u_zoom_transition:new e.bI(t),u_merc_center:new e.bG(t),u_cutoff_params:new e.c6(t)}),rasterParticleTexture:t=>({u_texture:new e.bJ(t),u_opacity:new e.bI(t)}),rasterParticleDraw:t=>({u_particle_texture:new e.bJ(t),u_particle_texture_side_len:new e.bI(t),u_tile_offset:new e.bG(t),u_velocity:new e.bJ(t),u_color_ramp:new e.bJ(t),u_velocity_res:new e.bG(t),u_max_speed:new e.bI(t),u_uv_offset:new e.bG(t),u_data_scale:new e.bG(t),u_data_offset:new e.bI(t),u_particle_pos_scale:new e.bI(t),u_particle_pos_offset:new e.bG(t)}),rasterParticleUpdate:t=>({u_particle_texture:new e.bJ(t),u_particle_texture_side_len:new e.bI(t),u_velocity:new e.bJ(t),u_velocity_res:new e.bG(t),u_max_speed:new e.bI(t),u_speed_factor:new e.bI(t),u_reset_rate:new e.bI(t),u_rand_seed:new e.bI(t),u_uv_offset:new e.bG(t),u_data_scale:new e.bG(t),u_data_offset:new e.bI(t),u_particle_pos_scale:new e.bI(t),u_particle_pos_offset:new e.bG(t)}),symbol:t=>({u_is_size_zoom_constant:new e.bJ(t),u_is_size_feature_constant:new e.bJ(t),u_size_t:new e.bI(t),u_size:new e.bI(t),u_camera_to_center_distance:new e.bI(t),u_rotate_symbol:new e.bJ(t),u_aspect_ratio:new e.bI(t),u_fade_change:new e.bI(t),u_matrix:new e.bF(t),u_label_plane_matrix:new e.bF(t),u_coord_matrix:new e.bF(t),u_is_text:new e.bJ(t),u_elevation_from_sea:new e.bJ(t),u_pitch_with_map:new e.bJ(t),u_texsize:new e.bG(t),u_texsize_icon:new e.bG(t),u_texture:new e.bJ(t),u_texture_icon:new e.bJ(t),u_gamma_scale:new e.bI(t),u_device_pixel_ratio:new e.bI(t),u_tile_id:new e.bH(t),u_zoom_transition:new e.bI(t),u_inv_rot_matrix:new e.bF(t),u_merc_center:new e.bG(t),u_camera_forward:new e.bH(t),u_tile_matrix:new e.bF(t),u_up_vector:new e.bH(t),u_ecef_origin:new e.bH(t),u_is_halo:new e.bJ(t),u_icon_transition:new e.bI(t),u_color_adj_mat:new e.bF(t)}),background:t=>({u_matrix:new e.bF(t),u_emissive_strength:new e.bI(t),u_opacity:new e.bI(t),u_color:new e.cu(t)}),backgroundPattern:t=>({u_matrix:new e.bF(t),u_emissive_strength:new e.bI(t),u_opacity:new e.bI(t),u_image:new e.bJ(t),u_pattern_tl:new e.bG(t),u_pattern_br:new e.bG(t),u_texsize:new e.bG(t),u_pattern_size:new e.bG(t),u_pixel_coord_upper:new e.bG(t),u_pixel_coord_lower:new e.bG(t),u_pattern_units_to_pixels:new e.bG(t)}),terrainRaster:t=>({u_matrix:new e.bF(t),u_image0:new e.bJ(t),u_skirt_height:new e.bI(t),u_ground_shadow_factor:new e.bH(t)}),skybox:t=>({u_matrix:new e.bF(t),u_sun_direction:new e.bH(t),u_cubemap:new e.bJ(t),u_opacity:new e.bI(t),u_temporal_offset:new e.bI(t)}),skyboxGradient:t=>({u_matrix:new e.bF(t),u_color_ramp:new e.bJ(t),u_center_direction:new e.bH(t),u_radius:new e.bI(t),u_opacity:new e.bI(t),u_temporal_offset:new e.bI(t)}),skyboxCapture:t=>({u_matrix_3f:new e.cv(t),u_sun_direction:new e.bH(t),u_sun_intensity:new e.bI(t),u_color_tint_r:new e.c6(t),u_color_tint_m:new e.c6(t),u_luminance:new e.bI(t)}),globeRaster:t=>({u_proj_matrix:new e.bF(t),u_globe_matrix:new e.bF(t),u_normalize_matrix:new e.bF(t),u_merc_matrix:new e.bF(t),u_zoom_transition:new e.bI(t),u_merc_center:new e.bG(t),u_image0:new e.bJ(t),u_grid_matrix:new e.cv(t),u_skirt_height:new e.bI(t),u_far_z_cutoff:new e.bI(t),u_frustum_tl:new e.bH(t),u_frustum_tr:new e.bH(t),u_frustum_br:new e.bH(t),u_frustum_bl:new e.bH(t),u_globe_pos:new e.bH(t),u_globe_radius:new e.bI(t),u_viewport:new e.bG(t)}),globeAtmosphere:t=>({u_frustum_tl:new e.bH(t),u_frustum_tr:new e.bH(t),u_frustum_br:new e.bH(t),u_frustum_bl:new e.bH(t),u_horizon:new e.bI(t),u_transition:new e.bI(t),u_fadeout_range:new e.bI(t),u_color:new e.c6(t),u_high_color:new e.c6(t),u_space_color:new e.c6(t),u_temporal_offset:new e.bI(t),u_horizon_angle:new e.bI(t)}),model:t=>({u_matrix:new e.bF(t),u_lighting_matrix:new e.bF(t),u_normal_matrix:new e.bF(t),u_node_matrix:new e.bF(t),u_lightpos:new e.bH(t),u_lightintensity:new e.bI(t),u_lightcolor:new e.bH(t),u_camera_pos:new e.bH(t),u_opacity:new e.bI(t),u_baseColorFactor:new e.c6(t),u_emissiveFactor:new e.c6(t),u_metallicFactor:new e.bI(t),u_roughnessFactor:new e.bI(t),u_baseTextureIsAlpha:new e.bJ(t),u_alphaMask:new e.bJ(t),u_alphaCutoff:new e.bI(t),u_baseColorTexture:new e.bJ(t),u_metallicRoughnessTexture:new e.bJ(t),u_normalTexture:new e.bJ(t),u_occlusionTexture:new e.bJ(t),u_emissionTexture:new e.bJ(t),u_lutTexture:new e.bJ(t),u_color_mix:new e.c6(t),u_aoIntensity:new e.bI(t),u_emissive_strength:new e.bI(t),u_occlusionTextureTransform:new e.c6(t)}),modelDepth:t=>({u_matrix:new e.bF(t),u_instance:new e.bF(t),u_node_matrix:new e.bF(t)}),groundShadow:t=>({u_matrix:new e.bF(t),u_ground_shadow_factor:new e.bH(t)}),stars:t=>({u_matrix:new e.bF(t),u_up:new e.bH(t),u_right:new e.bH(t),u_intensity_multiplier:new e.bI(t)}),occlusion:t=>({u_matrix:new e.bF(t),u_anchorPos:new e.bH(t),u_screenSizePx:new e.bG(t),u_occluderSizePx:new e.bG(t),u_color:new e.c6(t)})};class uo{constructor(e,t,n,r){this.id=uo.uniqueIdxCounter,uo.uniqueIdxCounter++,this.context=e;const i=e.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(n),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||r||t.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){this.id=uo.uniqueIdxCounter,uo.uniqueIdxCounter++;const t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}uo.uniqueIdxCounter=0;const ho={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class fo{constructor(e,t,n,r,i,o){this.length=t.length,this.attributes=n,this.itemSize=t.bytesPerElement,this.dynamicDraw=r,this.instanceCount=o,this.context=e;const a=e.gl;this.buffer=a.createBuffer(),e.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||i||t.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let n=0;n0&&e.vertexAttribDivisor(i,n)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class po{constructor(e,t,n,r,i){this.context=e,this.width=t,this.height=n;const o=this.framebuffer=e.gl.createFramebuffer();r&&(this.colorAttachment=new pi(e,o)),i&&(this.depthAttachmentType=i,this.depthAttachment="renderbuffer"===i?new mi(e,o):new gi(e,o))}destroy(){const e=this.context.gl;if(this.colorAttachment){const t=this.colorAttachment.get();t&&e.deleteTexture(t)}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}else{const t=this.depthAttachment.get();t&&e.deleteTexture(t)}e.deleteFramebuffer(this.framebuffer)}}class mo{constructor(e,t){this.gl=e,this.clearColor=new Or(this),this.clearDepth=new Fr(this),this.clearStencil=new Br(this),this.colorMask=new Nr(this),this.depthMask=new jr(this),this.stencilMask=new Vr(this),this.stencilFunc=new Ur(this),this.stencilOp=new $r(this),this.stencilTest=new Gr(this),this.depthRange=new qr(this),this.depthTest=new Wr(this),this.depthFunc=new Hr(this),this.blend=new Zr(this),this.blendFunc=new Yr(this),this.blendColor=new Xr(this),this.blendEquation=new Kr(this),this.cullFace=new Jr(this),this.cullFaceSide=new Qr(this),this.frontFace=new ei(this),this.program=new ti(this),this.activeTexture=new ni(this),this.viewport=new ri(this),this.bindFramebuffer=new ii(this),this.bindRenderbuffer=new oi(this),this.bindTexture=new ai(this),this.bindVertexBuffer=new si(this),this.bindElementBuffer=new li(this),this.bindVertexArrayOES=new ci(this),this.pixelStoreUnpack=new ui(this),this.pixelStoreUnpackPremultiplyAlpha=new hi(this),this.pixelStoreUnpackFlipY=new di(this),this.options=t?{...t}:{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=e.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=e.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=e.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=e.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxPointSize=e.getParameter(e.ALIASED_POINT_SIZE_RANGE)[1]}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t,n){return new uo(this,e,t,n)}createVertexBuffer(e,t,n,r,i){return new fo(this,e,t,n,r,i)}createRenderbuffer(e,t,n){const r=this.gl,i=r.createRenderbuffer();return this.bindRenderbuffer.set(i),r.renderbufferStorage(r.RENDERBUFFER,e,t,n),this.bindRenderbuffer.set(null),i}createFramebuffer(e,t,n,r){return new po(this,e,t,n,r)}clear(e){let{color:t,depth:n,stencil:r,colorMask:i}=e;const o=this.gl;let a=0;t&&(a|=o.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set(i||[!0,!0,!0,!0])),void 0!==n&&(a|=o.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),void 0!==r&&(a|=o.STENCIL_BUFFER_BIT,this.clearStencil.set(r),this.stencilMask.set(255)),o.clear(a)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(t){e.bh(t.blendFunction,Pn.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor),t.blendEquation?this.blendEquation.set(t.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(t.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}let go;function _o(t,n,r,i,o,a,s){const l=t.context,c=l.gl,u=t.transform,h=t.getOrCreateProgram("collisionBox"),d=[];let f=0,p=0;for(let b=0;b0){const t=e.a6.mat4.create(),n=y;e.a6.mat4.mul(t,g.placementInvProjMatrix,u.glCoordMatrix),e.a6.mat4.mul(t,t,g.placementViewportMatrix),d.push({circleArray:x,circleOffset:p,transform:n,invTransform:t,projection:g.getProjection()}),f+=x.length/4,p=f}v&&(t.terrain&&t.terrain.setupElevationDraw(m,h),h.draw(t,c.LINES,Rn.disabled,zn.disabled,t.colorModeForRenderPass(),Fn.disabled,Gi(y,u,m,g.getProjection()),r.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,null,u.zoom,null,[v.collisionVertexBuffer,v.collisionVertexBufferExt]))}if(!s||!d.length)return;const m=t.getOrCreateProgram("collisionCircle"),g=new e.cQ;g.resize(4*f),g._trim();let _=0;for(const e of d)for(let t=0;t=0&&(m[p.associatedIconIndex]={x:A,y:E,z:T,angle:R})}else Xt(S,f)}if(h){p.clear();const n=t.icon.placedSymbolArray;for(let t=0;t6&&void 0!==arguments[6]?arguments[6]:{};const l=r.paint.get("icon-translate"),c=r.paint.get("text-translate"),u=r.paint.get("icon-translate-anchor"),h=r.paint.get("text-translate-anchor"),d=r.layout.get("icon-rotation-alignment"),f=r.layout.get("text-rotation-alignment"),p=r.layout.get("icon-pitch-alignment"),m=r.layout.get("text-pitch-alignment"),g=r.layout.get("icon-keep-upright"),_=r.layout.get("text-keep-upright"),y=r.paint.get("icon-color-saturation"),v=r.paint.get("icon-color-contrast"),x=r.paint.get("icon-color-brightness-min"),b=r.paint.get("icon-color-brightness-max"),w="sea"===r.paint.get("symbol-elevation-reference"),S=r.paint.get("text-occlusion-opacity").constantOr(0),M=t.context,A=M.gl,E=t.transform,T="map"===d,C="map"===f,k="map"===p,I="map"===m,P=void 0!==r.layout.get("symbol-sort-key").constantOr(1);let R=!1;const L=t.depthModeForSublayer(0,Rn.ReadOnly),z=[e.am(E.center.lng),e.at(E.center.lat)],D=r.layout.get("text-variable-anchor"),O="globe"===E.projection.name,F=[],B=[0,-1,0];for(const N of i){const i=n.getTile(N),o=i.getBucket(r);if(!o)continue;if("mercator"===o.projection.name&&O)continue;if(o.fullyClipped)continue;const a="globe"===o.projection.name,d=a?e.a9(E.zoom):0,f=nn(N,o.getProjection(),E),p=E.calculatePixelsToTileUnitsMatrix(i),m=D&&o.hasTextData(),M=o.hasIconTextFit()&&m&&o.hasIconData(),L=o.getProjection().createInversionMatrix(E,N.canonical),j=e=>{E.depthOcclusionForSymbolsAndCircles&&(r.hasInitialOcclusionOpacityProperties||t.terrain)&&(e.push("DEPTH_D24"),e.push("DEPTH_OCCLUSION"))},V=()=>{const n=T&&"point"!==r.layout.get("symbol-placement"),s=[];j(s);const c=n||M,h=r.paint.get("icon-image-cross-fade").constantOr(0);t.terrainRenderModeElevated()&&k&&s.push("PITCH_WITH_MAP_TERRAIN"),a&&(s.push("PROJECTION_GLOBE_VIEW"),c&&s.push("PROJECTED_POS_ON_VIEWPORT")),h>0&&s.push("ICON_TRANSITION"),o.icon.zOffsetVertexBuffer&&s.push("Z_OFFSET"),0===y&&0===v&&0===x&&1===b||s.push("COLOR_ADJUSTMENT"),o.sdfIcons&&s.push("RENDER_SDF");const m=o.icon.programConfigurations.get(r.id),_=t.getOrCreateProgram("symbol",{config:m,defines:s}),S=i.imageAtlasTexture?i.imageAtlasTexture.size:[0,0],C=o.iconSizeData,I=e.bj(C,E.zoom),P=k||0!==E.pitch,R=Ft(f,i.tileID.canonical,k,T,E,o.getProjection(),p),D=Nt(f,i.tileID.canonical,k,T,E,o.getProjection(),p),F=t.translatePosMatrix(D,i,l,u,!0),V=t.translatePosMatrix(f,i,l,u),U=c?yo:R,$=T&&!k&&!n;let G=B;!O&&!E.mercatorFromTransition||T||(G=vo(E));const q=a?G:B,W=r.getColorAdjustmentMatrix(y,v,x,b),H=ro(C.kind,I,$,k,t,V,U,F,w,!1,S,[0,0],!0,N,d,z,L,q,o.getProjection(),W,h),Z=i.imageAtlasTexture?i.imageAtlasTexture:null,Y=1!==r.layout.get("icon-size").constantOr(0)||o.iconsNeedLinear,X=o.sdfIcons||t.options.rotating||t.options.zooming||Y||P?A.LINEAR:A.NEAREST,K=o.sdfIcons&&0!==r.paint.get("icon-halo-width").constantOr(1),J=t.terrain&&k&&n?e.a6.mat4.invert(e.a6.mat4.create(),R):yo;if(n&&o.icon){const e=E.elevation,n=e?e.getAtTileOffsetFunc(N,E.center.lat,E.worldSize,o.getProjection()):null,r=Bt(f,i.tileID.canonical,k,T,E,o.getProjection(),p);$t(o,f,t,!1,r,D,k,g,n,N)}return{program:_,buffers:o.icon,uniformValues:H,atlasTexture:Z,atlasTextureIcon:null,atlasInterpolation:X,atlasInterpolationIcon:null,isSDF:o.sdfIcons,hasHalo:K,tile:i,labelPlaneMatrixInv:J}},U=()=>{const n=C&&"point"!==r.layout.get("symbol-placement"),s=[],l=n||D||M;t.terrainRenderModeElevated()&&I&&s.push("PITCH_WITH_MAP_TERRAIN"),a&&(s.push("PROJECTION_GLOBE_VIEW"),l&&s.push("PROJECTED_POS_ON_VIEWPORT")),o.text.zOffsetVertexBuffer&&s.push("Z_OFFSET"),o.iconsInText&&s.push("RENDER_TEXT_AND_SYMBOL"),s.push("RENDER_SDF"),j(s);const u=o.text.programConfigurations.get(r.id),m=t.getOrCreateProgram("symbol",{config:u,defines:s});let g,y=[0,0],v=null;const x=o.textSizeData;o.iconsInText&&(y=i.imageAtlasTexture?i.imageAtlasTexture.size:[0,0],v=i.imageAtlasTexture?i.imageAtlasTexture:null,g=I||0!==E.pitch||t.options.rotating||t.options.zooming||"composite"===x.kind||"camera"===x.kind?A.LINEAR:A.NEAREST);const b=i.glyphAtlasTexture?i.glyphAtlasTexture.size:[0,0],T=e.bj(x,E.zoom),k=Ft(f,i.tileID.canonical,I,C,E,o.getProjection(),p),P=Nt(f,i.tileID.canonical,I,C,E,o.getProjection(),p),R=t.translatePosMatrix(P,i,c,h,!0),F=t.translatePosMatrix(f,i,c,h),V=l?yo:k,U=C&&!I&&!n;let $=B;!O&&!E.mercatorFromTransition||C||($=vo(E));const G=ro(x.kind,T,U,I,t,F,V,R,w,!0,b,y,!0,N,d,z,L,a?$:B,o.getProjection(),S),q=i.glyphAtlasTexture?i.glyphAtlasTexture:null,W=A.LINEAR,H=0!==r.paint.get("text-halo-width").constantOr(1),Z=t.terrain&&I&&n?e.a6.mat4.invert(e.a6.mat4.create(),k):yo;if(n&&o.text){const e=E.elevation,n=e?e.getAtTileOffsetFunc(N,E.center.lat,E.worldSize,o.getProjection()):null,r=Bt(f,i.tileID.canonical,I,C,E,o.getProjection(),p);$t(o,f,t,!0,r,P,I,_,n,N)}return{program:m,buffers:o.text,uniformValues:G,atlasTexture:q,atlasTextureIcon:v,atlasInterpolation:W,atlasInterpolationIcon:g,isSDF:!0,hasHalo:H,tile:i,labelPlaneMatrixInv:Z}},$=o.icon.segments.get().length,G=o.text.segments.get().length,q=$&&!s.onlyText?V():null,W=G&&!s.onlyIcons?U():null,H=r.paint.get("icon-opacity").constantOr(1),Z=r.paint.get("text-opacity").constantOr(1);if(P&&o.canOverlap){R=!0;const t=H&&!s.onlyText?o.icon.segments.get():[],n=Z&&!s.onlyIcons?o.text.segments.get():[];for(const r of t)F.push({segments:new e.b1([r]),sortKey:r.sortKey,state:q});for(const r of n)F.push({segments:new e.b1([r]),sortKey:r.sortKey,state:W})}else s.onlyText||F.push({segments:H?o.icon.segments:new e.b1([]),sortKey:0,state:q}),s.onlyIcons||F.push({segments:Z?o.text.segments:new e.b1([]),sortKey:0,state:W})}R&&F.sort(((e,t)=>e.sortKey-t.sortKey));for(const e of F){const n=e.state;if(n)if(t.terrain?t.terrain.setupElevationDraw(n.tile,n.program,{useDepthForOcclusion:E.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:n.labelPlaneMatrixInv}):t.setupDepthForOcclusion(E.depthOcclusionForSymbolsAndCircles,n.program),M.activeTexture.set(A.TEXTURE0),n.atlasTexture&&n.atlasTexture.bind(n.atlasInterpolation,A.CLAMP_TO_EDGE,!0),n.atlasTextureIcon&&(M.activeTexture.set(A.TEXTURE1),n.atlasTextureIcon&&n.atlasTextureIcon.bind(n.atlasInterpolationIcon,A.CLAMP_TO_EDGE,!0)),t.uploadCommonLightUniforms(t.context,n.program),n.hasHalo){const i=n.uniformValues;i.u_is_halo=1,So(n.buffers,e.segments,r,t,n.program,L,o,a,i,2),i.u_is_halo=0}else{if(n.isSDF){const i=n.uniformValues;n.hasHalo&&(i.u_is_halo=1,So(n.buffers,e.segments,r,t,n.program,L,o,a,i,1)),i.u_is_halo=0}So(n.buffers,e.segments,r,t,n.program,L,o,a,n.uniformValues,1)}}}function So(e,t,n,r,i,o,a,s,l,c){const u=[e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer,e.iconTransitioningVertexBuffer,e.globeExtVertexBuffer,e.zOffsetVertexBuffer];i.draw(r,r.context.gl.TRIANGLES,o,a,s,Fn.disabled,l,n.id,e.layoutVertexBuffer,e.indexBuffer,t,n.paint,r.transform.zoom,e.programConfigurations.get(n.id),u,c)}function Mo(e,t,n,r,i,o,a){const s=e.context.gl,l=n.paint.get("fill-pattern"),c=n.is3D(),u=c?e.stencilModeFor3D():zn.disabled,h=l&&l.constantOr(1);let d,f,p,m,g;a?(f=h&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",d=s.LINES):(f=h?"fillPattern":"fill",d=s.TRIANGLES);for(const _ of r){const r=t.getTile(_);if(h&&!r.patternsLoaded())continue;const y=r.getBucket(n);if(!y)continue;e.prepareDrawTile();const v=y.programConfigurations.get(n.id),x=e.isTileAffectedByFog(_),b=e.getOrCreateProgram(f,{config:v,overrideFog:x});h&&(e.context.activeTexture.set(s.TEXTURE0),r.imageAtlasTexture&&r.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),v.updatePaintBuffers());const w=l.constantOr(null);if(w&&r.imageAtlas){const e=r.imageAtlas.patternPositions[w.toString()];e&&v.setConstantPatternPositions(e)}const S=e.translatePosMatrix(_.projMatrix,r,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor")),M=n.paint.get("fill-emissive-strength");if(a){m=y.indexBuffer2,g=y.segments2;const t=e.terrain&&e.terrain.renderingToTexture?e.terrain.drapeBufferSize:[s.drawingBufferWidth,s.drawingBufferHeight];p="fillOutlinePattern"===f&&h?$i(S,M,e,r,t):Ui(S,M,t)}else m=y.indexBuffer,g=y.segments,p=h?Vi(S,M,e,r):ji(S,M);e.uploadCommonUniforms(e.context,b,_.toUnwrapped()),b.draw(e,d,i,c?u:e.stencilModeForClipping(_),o,Fn.disabled,p,n.id,y.layoutVertexBuffer,m,g,n.paint,e.transform.zoom,v,void 0)}}function Ao(t,n,r,i,o,a,s,l){r.resetLayerRenderingStats(t);const c=t.context,u=c.gl,h=t.transform,d=r.paint.get("fill-extrusion-pattern"),f=d.constantOr(1),p=r.paint.get("fill-extrusion-opacity"),m=t.style.enable3dLights(),g=r.paint.get(m&&!f?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),_=[r.paint.get("fill-extrusion-ambient-occlusion-intensity"),g],y=r.layout.get("fill-extrusion-edge-radius"),v=y>0&&!r.paint.get("fill-extrusion-rounded-roof"),x=v?0:y,b="globe"===h.projection.name?e.c_():0,w="globe"===h.projection.name,S=w?e.a9(h.zoom):0,M=[e.am(h.center.lng),e.at(h.center.lat)],A=r.paint.get("fill-extrusion-flood-light-color").toRenderColor(r.lut).toArray01().slice(0,3),E=r.paint.get("fill-extrusion-flood-light-intensity"),T=r.paint.get("fill-extrusion-vertical-scale"),C=0!==r.paint.get("fill-extrusion-line-width").constantOr(1),k=Zn(t,r.paint.get("fill-extrusion-cutoff-fade-range")),I=[];let P;w&&I.push("PROJECTION_GLOBE_VIEW"),_[0]>0&&I.push("FAUX_AO"),v&&I.push("ZERO_ROOF_RADIUS"),l&&I.push("HAS_CENTROID"),E>0&&I.push("FLOOD_LIGHT"),k.shouldRenderCutoff&&I.push("RENDER_CUTOFF"),C&&I.push("RENDER_WALL_MODE");const R="shadow"===t.renderPass,L=t.shadowRenderer,z=R&&!!L;t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!0);let D=[0,0,0];if(L){const e=t.style.directionalLight,n=t.style.ambientLight;e&&n&&(D=tr(t.style,e,n)),P=I.concat(["SHADOWS_SINGLE_CASCADE"])}const O=z?"fillExtrusionDepth":f?"fillExtrusionPattern":"fillExtrusion",F=r.getLayerRenderingStats();for(const e of i){const i=n.getTile(e),m=i.getBucket(r);if(!m||m.projection.name!==h.projection.name)continue;let g=!1;L&&(g=0===L.getMaxCascadeForTile(e.toUnwrapped()));const y=t.isTileAffectedByFog(e),v=m.programConfigurations.get(r.id),z=t.getOrCreateProgram(O,{config:v,defines:g?P:I,overrideFog:y});if(t.terrain&&t.terrain.setupElevationDraw(i,z,{useMeterToDem:!0}),!m.centroidVertexBuffer){const e=z.attributes.a_centroid_pos;void 0!==e&&u.vertexAttrib2f(e,0,0)}!R&&L&&L.setupShadows(i.tileID.toUnwrapped(),z,"vector-tile",i.tileID.overscaledZ),f&&(t.context.activeTexture.set(u.TEXTURE0),i.imageAtlasTexture&&i.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),v.updatePaintBuffers());const B=d.constantOr(null);if(B&&i.imageAtlas){const e=i.imageAtlas.patternPositions[B.toString()];e&&v.setConstantPatternPositions(e)}const N=r.paint.get("fill-extrusion-vertical-gradient"),j=1/m.tileToMeter;let V;if(R&&L){if(Po(i.tileID,m,t))continue;const e=L.calculateShadowPassMatrixFromTile(i.tileID.toUnwrapped());V=Bi(e,x,j,T)}else{const n=t.translatePosMatrix(e.expandedProjMatrix,i,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),o=h.projection.createInversionMatrix(h,e.canonical);V=f?Ni(n,t,N,p,_,x,j,e,i,b,S,M,o,A,T):Fi(n,t,N,p,_,x,j,e,b,S,M,o,A,T,E,D)}t.uploadCommonUniforms(c,z,e.toUnwrapped(),null,k);let U=m.segments;if("mercator"===h.projection.name&&!R&&(U=m.getVisibleSegments(i.tileID,t.terrain,t.transform.getFrustum(0)),!U.get().length))continue;if(F)if(R)for(const e of U.get())F.numRenderedVerticesInShadowPass+=e.primitiveLength;else for(const e of U.get())F.numRenderedVerticesInTransparentPass+=e.primitiveLength;const $=[];(t.terrain||l)&&$.push(m.centroidVertexBuffer),w&&$.push(m.layoutVertexExtBuffer),C&&$.push(m.wallVertexBuffer),z.draw(t,c.gl.TRIANGLES,o,a,s,Fn.backCCW,V,r.id,m.layoutVertexBuffer,m.indexBuffer,U,r.paint,t.transform.zoom,v,$)}t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!1)}function Eo(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v){const x=t.context,b=x.gl,w=t.transform,S=t.transform.zoom,M=[],A=Zn(t,r.paint.get("fill-extrusion-cutoff-fade-range"));"clear"===u?(M.push("CLEAR_SUBPASS"),v&&(M.push("CLEAR_FROM_TEXTURE"),x.activeTexture.set(b.TEXTURE0),v.bind(b.LINEAR,b.CLAMP_TO_EDGE))):"sdf"===u&&M.push("SDF_SUBPASS"),_&&M.push("HAS_CENTROID"),A.shouldRenderCutoff&&M.push("RENDER_CUTOFF");const E=r.layout.get("fill-extrusion-edge-radius"),T=(e,n,i,u,y)=>{const b=n.programConfigurations.get(r.id),w=t.isTileAffectedByFog(e),T=t.getOrCreateProgram("fillExtrusionGroundEffect",{config:b,defines:M,overrideFog:w}),C=((e,t,n,r,i,o,a,s,l,c,u)=>({u_matrix:t,u_opacity:n,u_ao_pass:r?1:0,u_meter_to_tile:i,u_ao:o,u_flood_light_intensity:a,u_flood_light_color:s,u_attenuation:l,u_edge_radius:c,u_fb:0,u_fb_size:u,u_dynamic_offset:1}))(0,u,h,c,y,[d,f*y],p,m,g,S>=17?0:E*y,v?v.size[0]:0),k=[];_&&k.push(n.hiddenByLandmarkVertexBuffer),t.uploadCommonUniforms(x,T,e.toUnwrapped(),null,A),T.draw(t,x.gl.TRIANGLES,o,a,s,l,C,r.id,n.vertexBuffer,n.indexBuffer,i,r.paint,S,b,k)};for(const C of i){const i=n.getTile(C),o=i.getBucket(r);if(!o||o.projection.name!==w.projection.name||!o.groundEffect||o.groundEffect&&!o.groundEffect.hasData())continue;const a=o.groundEffect,s=1/o.tileToMeter;{const e=t.translatePosMatrix(C.projMatrix,i,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),n=a.getDefaultSegment();T(C,a,n,e,s)}if(y)for(let l=0;l<4;l++){const o=e.c$[l](C),a=n.getTile(o);if(!a)continue;const c=a.getBucket(r);if(!c||c.projection.name!==w.projection.name||!c.groundEffect||c.groundEffect&&!c.groundEffect.hasData())continue;const u=c.groundEffect;let h,d;0===l?(h=[-e.ab,0,0],d=1):1===l?(h=[e.ab,0,0],d=0):2===l?(h=[0,-e.ab,0],d=3):(h=[0,e.ab,0],d=2);const f=u.regionSegments[d];if(!f)continue;const p=new Float32Array(16);e.a6.mat4.translate(p,C.projMatrix,h),T(C,u,f,t.translatePosMatrix(p,i,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),s)}}}function To(t,n,r,i,o,a,s){0===i.centroidVertexArray.length&&i.createCentroidsBuffer();const l=a?a.findDEMTileFor(r):null;if(!(l&&l.dem||s))return;const c=t=>new e.P(Math.ceil((t+e.d2)*e.d3),0),u=e=>{const t=n.getSource().minzoom,r=e=>{const t=n.getTileByID(e);if(t&&t.hasData())return t.getBucket(o)},i=[0,-1,1];for(const n of i){if(e.overscaledZ+n(h[0]=Math.min(t.min.y,n.min.y),h[1]=Math.max(t.max.y,n.max.y),h[2]=e.ab-n.min.x>t.max.x?n.min.x-e.ab:t.max.x,h),f=(t,n)=>(h[0]=Math.min(t.min.x,n.min.x),h[1]=Math.max(t.max.x,n.max.x),h[2]=e.ab-n.min.y>t.max.y?n.min.y-e.ab:t.max.y,h),p=[(e,t)=>d(e,t),(e,t)=>d(t,e),(e,t)=>f(e,t),(e,t)=>f(t,e)],m=(t,n,i,o,s,c,u)=>{if(!a)return 0;const h=[[c?i:t,c?t:i,0],[c?i:n,c?n:i,0]],d=u<0?e.ab+u:u,f=[c?d:(t+n)/2,c?(t+n)/2:d,0];return 0===i&&u<0||0!==i&&u>0?a.getForTilePoints(s,[f],!0,o):h.push(f),a.getForTilePoints(r,h,!0,l),Math.max(h[0][2],h[1][2],f[2])/a.exaggeration()};for(let y=0;y<4;y++){const t=i.borderFeatureIndices[y];if(0===t.length)continue;const n=e.c$[y](r),o=u(n);if(!(o&&o instanceof e.d0))continue;if(i.borderDoneWithNeighborZ[y]===o.canonical.z)continue;0===o.centroidVertexArray.length&&o.createCentroidsBuffer();const l=a?a.findDEMTileFor(n):null;if(!(l&&l.dem||s))continue;const h=(y<2?1:5)-y,d=o.borderDoneWithNeighborZ[h]!==i.canonical.z,f=o.borderFeatureIndices[h];let v=0;if(i.canonical.z!==o.canonical.z){for(const e of t)i.showCentroid(i.featuresOnBorder[e]);if(d)for(const e of f)o.showCentroid(o.featuresOnBorder[e]);i.borderDoneWithNeighborZ[y]=o.canonical.z,o.borderDoneWithNeighborZ[h]=i.canonical.z}for(const r of t){const t=i.featuresOnBorder[r],a=i.centroidData[t.centroidDataIndex],u=t.borders[y];let d;for(;vu[0]+3||e[0]>u[0]-3)break;o.showCentroid(d),v++}if(d&&vu[1]-3)&&(x++,++v!==f.length);)d=o.featuresOnBorder[f[v]];d=o.featuresOnBorder[f[r]];let b=!1;if(x>=1){const e=d.borders[h];Math.abs(u[0]-e[0])<3&&Math.abs(u[1]-e[1])<3&&(x=1,b=!0,v=r+1)}else if(0===x){i.showCentroid(t);continue}const w=o.centroidData[d.centroidDataIndex];s&&b&&(((g=a).flags|(_=w).flags)&e.d1?(g.flags|=e.d1,_.flags|=e.d1):(g.flags&=~e.d1,_.flags&=~e.d1));const S=t.intersectsCount()>1||d.intersectsCount()>1;if(x>1)v=r,a.centroidXY=w.centroidXY=new e.P(0,0);else if(l&&l.dem&&!S){const t=p[y](a,w),r=y%2?e.ab-1:0,i=m(t[0],Math.min(e.ab-1,t[1]),r,l,n,y<2,t[2]);a.centroidXY=w.centroidXY=c(i)}else S?a.centroidXY=w.centroidXY=new e.P(0,0):(a.centroidXY=i.encodeBorderCentroid(t),w.centroidXY=o.encodeBorderCentroid(d));i.writeCentroidToBuffer(a),o.writeCentroidToBuffer(w)}else i.showCentroid(t)}i.borderDoneWithNeighborZ[y]=o.canonical.z,o.borderDoneWithNeighborZ[h]=i.canonical.z}var g,_;(i.needsCentroidUpdate||!i.centroidVertexBuffer&&0!==i.centroidVertexArray.length)&&i.uploadCentroid(t)}const Co=[1,0,0],ko=[0,1,0],Io=[0,0,1];function Po(t,n,r){const i=r.transform,o=r.shadowRenderer;if(!o)return!0;const a=t.toUnwrapped(),s=i.tileSize*o._cascades[r.currentShadowCascade].scale;let l=n.maxHeight;if(i.elevation){const e=i.elevation.getMinMaxForTile(t);e&&(l+=e.max)}const c=[...o.shadowDirection];c[2]=-c[2];const u=o.computeSimplifiedTileShadowVolume(a,l,s,c);if(!u)return!1;const h=[Co,ko,Io,c,[c[0],0,c[2]],[0,c[1],c[2]]],d="globe"===i.projection.name,f=i.scaleZoom(s),p=e.bN.fromInvProjectionMatrix(i.invProjMatrix,i.worldSize,f,!d),m=o.getCurrentCascadeFrustum();return 0===p.intersectsPrecise(u.vertices,u.planes,h)||0===m.intersectsPrecise(u.vertices,u.planes,h)}function Ro(t){return[t[0]*e.d4,t[1]*e.d4,t[2]*e.d4,0]}function Lo(t,n,r,i,o,a,s,l,c){const u=i.getSource(),h=r.globeSharedBuffers;if(!h)return;let d,f,p;if(n&&(d=i.getTile(n)),u instanceof e.aD?(f=u.texture,p=e.cD(0,0,r.transform)):d&&n&&(f=d.texture,p=e.cD(n.canonical.z,n.canonical.x,r.transform)),!f||!p)return;t||(p=e.a6.mat4.scale(e.a6.mat4.create(),p,[1,-1,1]));const m=r.context,g=m.gl,_="nearest"===o.paint.get("raster-resampling")?g.NEAREST:g.LINEAR,y=r.colorModeForDrapableLayerRenderPass(a),v=s.defines;v.push("GLOBE_POLES");const x=new Rn(g.LEQUAL,Rn.ReadWrite,r.depthRangeFor3D),b=Float32Array.from(r.transform.expandedFarZProjMatrix),w=Float32Array.from(e.b5(e.cC(new e.bP(0,0,0))));r.terrain&&r.terrain.prepareDrawTile(),m.activeTexture.set(g.TEXTURE0),f.bind(_,g.CLAMP_TO_EDGE),m.activeTexture.set(g.TEXTURE1),f.bind(_,g.CLAMP_TO_EDGE),f.useMipmap&&m.extTextureFilterAnisotropic&&r.transform.pitch>20&&g.texParameterf(g.TEXTURE_2D,m.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,m.extTextureFilterAnisotropicMax);const[S,M,A,E]=n?h.getPoleBuffers(n.canonical.z,!1):h.getPoleBuffers(0,!0),T=o.paint.get("raster-elevation");let C;t?(C=S,r.renderDefaultNorthPole=0!==T):(C=M,r.renderDefaultSouthPole=0!==T);const k=Ro(s.mix),I=((e,t,n,r,i,o,a,s,l,c,u,h,d)=>Xi(e,t,n,new Float32Array(16),new Float32Array(9),[0,0],r,[0,0],[0,0,0,0],1,{opacity:1,mix:0},o,[0,0]||0,s,2,c,u,h,1,0,d))(b,w,p,e.a9(r.transform.zoom),0,o,0,T,0,k,s.offset,s.range,a),P=r.getOrCreateProgram("raster",{defines:v});r.uploadCommonUniforms(m,P,null),P.draw(r,g.TRIANGLES,x,c,y,l,I,o.id,C,A,E)}function zo(e){const t=e._nearZ,n=e.projection.farthestPixelDistance(e),r=n-t,i=.2*e.height,o=t+i;return[t,n,(o-i-t)/r,(o-t)/r]}function Do(e,t,n,r){if(e)return t instanceof Qe&&e instanceof mt?t.getTextureDescriptor(e,n,!0):{texture:e.texture,mix:Ro(r.mix),offset:r.offset,buffer:0,tileSize:1}}var Oo=e.d5([{name:"a_index",type:"Int16",components:1}]);class Fo{constructor(t,n,r,i){const o={width:r[0],height:r[1],data:null},a=t.gl;this.targetColorTexture=new e.T(t,o,a.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new e.T(t,o,a.RGBA8,{useMipmap:!1}),this.context=t,this.updateParticleTexture(n,i),this.lastInvalidatedAt=0}updateParticleTexture(t,n){if(this.particleTextureDimension===n.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const r=this.context.gl,i=n.width*n.height;this.particleTexture0=new e.T(this.context,n,r.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new e.T(this.context,n,r.RGBA8,{premultiply:!1,useMipmap:!1});const o=new e.d6;o.reserve(i);for(let e=0;e0){const t=e.b4(r.canonical,c),n=e.d8(t);f=e.a6.mat4.multiply(new Float32Array(16),c.globeMatrix,n),e.a6.mat4.multiply(f,c.projMatrix,f)}const p=e.a6.mat4.create();p[12]+=2*o/(e.q.devicePixelRatio*c.width),p[13]+=2*a/(e.q.devicePixelRatio*c.height),e.a6.mat4.multiply(f,p,f);const m=t.getOrCreateProgram("debug",{defines:d}),g=n.getTileByID(r.key);t.terrain&&t.terrain.setupElevationDraw(g,m);const _=Rn.disabled,y=zn.disabled,v=t.colorModeForRenderPass(),x="$debug";l.activeTexture.set(u.TEXTURE0),t.emptyTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),h?g._makeGlobeTileDebugBuffers(t.context,c):g._makeDebugTileBoundsBuffers(t.context,c.projection);const b=g._tileDebugBuffer||t.debugBuffer,w=g._tileDebugIndexBuffer||t.debugIndexBuffer,S=g._tileDebugSegments||t.debugSegments;if(m.draw(t,u.LINE_STRIP,_,y,v,Fn.disabled,qi(f,i),x,b,w,S,null,null,null,[g._globeTileDebugBorderBuffer]),s){const e=g.latestRawTileData,n=Math.floor((e&&e.byteLength||0)/1024);let i=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(i+=` => ${r.overscaledZ}`),i+=` ${g.state}`,i+=` ${n}kb`,function(e,t){e.initDebugOverlayCanvas();const n=e.debugOverlayCanvas,r=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,n.width,n.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,i)}const M=n.getTile(r).tileSize,A=512/Math.min(M,512)*(r.overscaledZ/c.zoom)*.5,E=g._tileDebugTextBuffer||t.debugBuffer,T=g._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,C=g._tileDebugTextSegments||t.debugSegments;m.draw(t,u.TRIANGLES,_,y,Pn.alphaBlended,Fn.disabled,qi(f,e.bz.transparent,A),x,E,T,C,null,null,null,[g._globeTileDebugTextBuffer])}function Wo(e,t,n,r){Zo(e,0,t+n/2,e.transform.width,n,r)}function Ho(e,t,n,r){Zo(e,t-n/2,0,n,e.transform.height,r)}function Zo(t,n,r,i,o,a){const s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(n*e.q.devicePixelRatio,r*e.q.devicePixelRatio,i*e.q.devicePixelRatio,o*e.q.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}const Yo=e.d5([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Xo}=Yo;function Ko(e,t,n,r){e.emplaceBack(t,n,r)}class Jo{constructor(t){this.vertexArray=new e.d9,this.indices=new e.aO,Ko(this.vertexArray,-1,-1,1),Ko(this.vertexArray,1,-1,1),Ko(this.vertexArray,-1,1,1),Ko(this.vertexArray,1,1,1),Ko(this.vertexArray,-1,-1,-1),Ko(this.vertexArray,1,-1,-1),Ko(this.vertexArray,-1,1,-1),Ko(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=t.createVertexBuffer(this.vertexArray,Xo),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=e.b1.simpleSegment(0,0,36,12)}}function Qo(t,n,r,i,o,a){const s=t.context.gl,l=n.paint.get("sky-atmosphere-color"),c=n.paint.get("sky-atmosphere-halo-color"),u=n.paint.get("sky-atmosphere-sun-intensity"),h=((e,t,n,r,i)=>({u_matrix_3f:e,u_sun_direction:t,u_sun_intensity:n,u_color_tint_r:[r.r,r.g,r.b,r.a],u_color_tint_m:[i.r,i.g,i.b,i.a],u_luminance:5e-5}))(e.a6.mat3.fromMat4(e.a6.mat3.create(),i),o,u,l,c);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+a,n.skyboxTexture,0),r.draw(t,s.TRIANGLES,Rn.disabled,zn.disabled,Pn.unblended,Fn.frontCW,h,"skyboxCapture",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}const ea=e.d5([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class ta{constructor(t){const n=new e.da;n.emplaceBack(-1,1,1,0,0),n.emplaceBack(1,1,1,1,0),n.emplaceBack(1,-1,1,1,1),n.emplaceBack(-1,-1,1,0,1);const r=new e.aO;r.emplaceBack(0,1,2),r.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(n,ea.members),this.indexBuffer=t.createIndexBuffer(r),this.segments=e.b1.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const na=e.d5([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_fade_opacity",components:1}]);class ra{constructor(){this.starsCount=16e3,this.sizeMultiplier=.15,this.sizeRange=100,this.intensityRange=200}}class ia{constructor(t){this.colorModeAlphaBlendedWriteRGB=new Pn([1,In,1,In],e.bz.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new Pn([1,0,1,0],e.bz.transparent,[!1,!1,!1,!0]),this.params=new ra,this.updateNeeded=!0,t.tp.registerParameter(this.params,["Stars"],"starsCount",{min:100,max:16e3,step:1},(()=>{this.updateNeeded=!0})),t.tp.registerParameter(this.params,["Stars"],"sizeMultiplier",{min:.01,max:2,step:.01}),t.tp.registerParameter(this.params,["Stars"],"sizeRange",{min:0,max:200,step:1},(()=>{this.updateNeeded=!0})),t.tp.registerParameter(this.params,["Stars"],"intensityRange",{min:0,max:200,step:1},(()=>{this.updateNeeded=!0}))}update(t){const n=t.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new ta(n);const t=this.params.sizeRange,r=this.params.intensityRange,i=function(t){const n=e.dd(30),r=[];for(let i=0;i{const n="globe"===o.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];e&&n.push("ALPHA_PASS");const l=t.getOrCreateProgram("globeAtmosphere",{defines:n}),d=((e,t,n,r,i,o,a,s,l,c,u,h)=>({u_frustum_tl:e,u_frustum_tr:t,u_frustum_br:n,u_frustum_bl:r,u_horizon:i,u_transition:o,u_fadeout_range:a,u_color:s,u_high_color:l,u_space_color:c,u_temporal_offset:u,u_horizon_angle:h}))(o.frustumCorners.TL,o.frustumCorners.TR,o.frustumCorners.BR,o.frustumCorners.BL,o.frustumCorners.horizon,s,f,c,u,h,m,y);t.uploadCommonUniforms(r,l);const p=this.atmosphereBuffer;p&&l.draw(t,i.TRIANGLES,a,zn.disabled,e?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,Fn.backCW,d,e?"atmosphere_glow_alpha":"atmosphere_glow",p.vertexBuffer,p.indexBuffer,p.segments)};v(!1),v(!0)}drawStars(t,n){const r=e.ap(n.properties.get("star-intensity"),0,1);if(0===r)return;const i=t.context,o=i.gl,a=t.transform,s=t.getOrCreateProgram("stars"),l=e.a6.quat.identity([]);e.a6.quat.rotateX(l,l,-a._pitch),e.a6.quat.rotateZ(l,l,-a.angle),e.a6.quat.rotateX(l,l,e.bB(a._center.lat)),e.a6.quat.rotateY(l,l,-e.bB(a._center.lng));const c=e.a6.mat4.fromQuat(new Float32Array(16),l),u=e.a6.mat4.multiply([],a.starsProjMatrix,c),h=e.a6.mat3.fromMat4([],c),d=e.a6.mat3.invert([],h),f=[0,1,0];e.a6.vec3.transformMat3(f,f,d),e.a6.vec3.scale(f,f,this.params.sizeMultiplier);const p=[1,0,0];e.a6.vec3.transformMat3(p,p,d),e.a6.vec3.scale(p,p,this.params.sizeMultiplier);const m=(g=f,_=p,y=r,{u_matrix:Float32Array.from(u),u_up:g,u_right:_,u_intensity_multiplier:y});var g,_,y;t.uploadCommonUniforms(i,s),this.starsVx&&this.starsIdx&&s.draw(t,o.TRIANGLES,Rn.disabled,zn.disabled,this.colorModeAlphaBlendedWriteRGB,Fn.disabled,m,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}function oa(t,n){const r=[...t],i=n.cameraWorldSizeForFog/n.worldSize,o=e.a6.mat4.identity([]);return e.a6.mat4.scale(o,o,[i,i,1]),e.a6.mat4.multiply(r,o,r),e.a6.mat4.multiply(r,n.worldToFogMatrix,r),r}function aa(t,n,r,i,o){const a=r.material,s=i.context,{baseColorTexture:l,metallicRoughnessTexture:c}=a.pbrMetallicRoughness,{normalTexture:u,occlusionTexture:h,emissionTexture:d}=a;function f(e,n,r){if(e&&(t.push(n),s.activeTexture.set(s.gl.TEXTURE0+r),e.gfxTexture)){const{minFilter:t,magFilter:n,wrapS:r,wrapT:i}=e.sampler;e.gfxTexture.bindExtraParam(t,n,r,i)}}f(l,"HAS_TEXTURE_u_baseColorTexture",$n.BaseColor),f(c,"HAS_TEXTURE_u_metallicRoughnessTexture",$n.MetallicRoughness),f(u,"HAS_TEXTURE_u_normalTexture",$n.Normal),f(h,"HAS_TEXTURE_u_occlusionTexture",$n.Occlusion),f(d,"HAS_TEXTURE_u_emissionTexture",$n.Emission),o&&(o.texture||(o.texture=new e.df(i.context,o.image,[o.image.height,o.image.height,o.image.height],s.gl.RGBA8)),s.activeTexture.set(s.gl.TEXTURE0+$n.LUT),o.texture&&o.texture.bind(s.gl.LINEAR,s.gl.CLAMP_TO_EDGE),t.push("APPLY_LUT_ON_GPU")),r.texcoordBuffer&&(t.push("HAS_ATTRIBUTE_a_uv_2f"),n.push(r.texcoordBuffer)),r.colorBuffer&&(t.push(12===r.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),n.push(r.colorBuffer)),r.normalBuffer&&(t.push("HAS_ATTRIBUTE_a_normal_3f"),n.push(r.normalBuffer)),r.pbrBuffer&&(t.push("HAS_ATTRIBUTE_a_pbr"),t.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),n.push(r.pbrBuffer)),"OPAQUE"!==a.alphaMode&&"MASK"!==a.alphaMode||t.push("UNPREMULT_TEXTURE_IN_SHADER"),a.defined||t.push("DIFFUSE_SHADED"),t.push("USE_STANDARD_DERIVATIVES")}function sa(t,n,r,i,o,a){const s=r.paint.get("model-opacity"),l=n.context,c=new Rn(n.context.gl.LEQUAL,Rn.ReadWrite,n.depthRangeFor3D),u=n.transform,h=t.mesh,d=h.material,f=d.pbrMetallicRoughness,p=n.style.fog;let m;m="pixels"===n.transform.projection.zAxisUnit?[...t.nodeModelMatrix]:e.a6.mat4.multiply([],i.zScaleMatrix,t.nodeModelMatrix),e.a6.mat4.multiply(m,i.negCameraPosMatrix,m);const g=e.a6.mat4.invert([],m);e.a6.mat4.transpose(g,g);const _=r.paint.get("model-emissive-strength").constantOr(0),y=so(new Float32Array(t.worldViewProjection),new Float32Array(m),new Float32Array(g),null,n,s,f.baseColorFactor.toRenderColor(null),d.emissiveFactor,f.metallicFactor,f.roughnessFactor,d,_,r),v={defines:[]},x=[];aa(v.defines,x,h,n,r.lut);const b=n.shadowRenderer;b&&(b.useNormalOffset=!1);let w=null;if(p){const e=oa(t.nodeModelMatrix,n.transform);if(w=new Float32Array(e),"globe"!==u.projection.name){const t=h.aabb.min,n=h.aabb.max,[r,i]=p.getOpacityForBounds(e,t[0],t[1],n[0],n[1]);v.overrideFog=r>=De||i>=De}}const S=Zn(n,r.paint.get("model-cutoff-fade-range"));S.shouldRenderCutoff&&v.defines.push("RENDER_CUTOFF");const M=n.getOrCreateProgram("model",v);n.uploadCommonUniforms(l,M,null,w,S),"shadow"!==n.renderPass&&b&&b.setupShadowsFromMatrix(t.nodeModelMatrix,M),M.draw(n,l.gl.TRIANGLES,c,o,a,h.material.doubleSided?Fn.disabled:Fn.backCCW,y,r.id,h.vertexBuffer,h.indexBuffer,h.segments,r.paint,n.transform.zoom,void 0,x)}function la(t,n,r,i,o,a,s){let l;l="globe"===t.projection.name?e.dg(r,t):[...r],e.a6.mat4.multiply(l,l,n.matrix);const c=e.a6.mat4.multiply([],i,l);if(n.meshes)for(const u of n.meshes){if("BLEND"!==u.material.alphaMode){s.push({mesh:u,depth:0,modelIndex:o,worldViewProjection:c,nodeModelMatrix:l});continue}const t=e.a6.vec3.transformMat4([],u.centroid,c);t[2]>0&&a.push({mesh:u,depth:t[2],modelIndex:o,worldViewProjection:c,nodeModelMatrix:l})}if(n.children)for(const e of n.children)la(t,e,r,i,o,a,s)}function ca(e,t,n,r){const i=n.shadowRenderer;if(!i)return;const o=i.getShadowPassDepthMode(),a=i.getShadowPassColorMode(),s=i.calculateShadowPassMatrixFromMatrix(t),l=lo(s);n.getOrCreateProgram("modelDepth",{defines:n._shadowMapDebug?[]:["DEPTH_TEXTURE"]}).draw(n,n.context.gl.TRIANGLES,o,zn.disabled,a,Fn.backCCW,l,r.id,e.vertexBuffer,e.indexBuffer,e.segments,r.paint,n.transform.zoom,void 0,void 0)}function ua(t,n,r){const i=n.updateZoomBasedPaintProperties(),o=function(t,n,r){let i,o,a,s=t.terrain?t.terrain.exaggeration():0;if(t.terrain&&s>0){const n=t.terrain,o=n.findDEMTileFor(r);o&&o.dem?i=e.di.create(n,r,o):s=0}if(0===s&&(n.terrainElevationMin=0,n.terrainElevationMax=0),s===n.validForExaggeration&&(0===s||i&&i._demTile&&i._demTile.tileID===n.validForDEMTile.id&&i._dem._timestamp===n.validForDEMTile.timestamp))return!1;for(const e in n.instancesPerModel){const t=n.instancesPerModel[e];for(let e=0;eu&&(u=e.max)}const h=e.ap(i.x,a,s)-i.x,d=e.ap(i.y,l,c)-i.y,f=e.bD(u,n.center.lat)-i.z;return n._zoomFromMercatorZ(Math.sqrt(h*h+d*d+f*f))}function fa(e,t,n,r,i,o,a){const s=e.context,l="shadow"===e.renderPass,c=e.shadowRenderer,u=l&&c?c.getShadowPassDepthMode():new Rn(s.gl.LEQUAL,Rn.ReadWrite,e.depthRangeFor3D),h=e.isTileAffectedByFog(o);if(n.meshes)for(const d of n.meshes){const f=["MODEL_POSITION_ON_GPU"],p=[];let m,g,_;r.instancedDataArray.length>20&&f.push("INSTANCED_ARRAYS");const y=Zn(e,t.paint.get("model-cutoff-fade-range"));if(y.shouldRenderCutoff&&f.push("RENDER_CUTOFF"),l&&c)m=e.getOrCreateProgram("modelDepth",{defines:f}),g=lo(a.shadowTileMatrix,a.shadowTileMatrix,Float32Array.from(n.matrix)),_=c.getShadowPassColorMode();else{aa(f,p,d,e,t.lut),m=e.getOrCreateProgram("model",{defines:f,overrideFog:h});const r=d.material,l=r.pbrMetallicRoughness,u=t.paint.get("model-opacity"),v=t.paint.get("model-emissive-strength").constantOr(0);g=so(o.expandedProjMatrix,Float32Array.from(n.matrix),new Float32Array(16),null,e,u,l.baseColorFactor.toRenderColor(null),r.emissiveFactor,l.metallicFactor,l.roughnessFactor,r,v,t,i),c&&(a.shadowUniformsInitialized?m.setShadowUniformValues(s,c.getShadowUniformValues()):(c.setupShadows(o.toUnwrapped(),m,"model-tile",o.overscaledZ),a.shadowUniformsInitialized=!0)),_=y.shouldRenderCutoff||u<1||"OPAQUE"!==r.alphaMode?Pn.alphaBlended:Pn.unblended}e.uploadCommonUniforms(s,m,o.toUnwrapped(),null,y);const v=d.material.doubleSided?Fn.disabled:Fn.backCCW;if(r.instancedDataArray.length>20)p.push(r.instancedDataBuffer),m.draw(e,s.gl.TRIANGLES,u,zn.disabled,_,v,g,t.id,d.vertexBuffer,d.indexBuffer,d.segments,t.paint,e.transform.zoom,void 0,p,r.instancedDataArray.length);else{const n=l?"u_instance":"u_normal_matrix";for(let i=0;ic[1]?s:c,a[0]=r.max[0],s=e.a6.vec4.transformMat4(e.a6.vec4.create(),a,o),l=s[1]c[1]?s:c,a[1]=r.min[1],s=e.a6.vec4.transformMat4(e.a6.vec4.create(),a,o),l=s[1]c[1]?s:c;const u=e.ap(i[0],0,1),h=100*n.pixelsPerMeter*e.ap(i[1],0,1),d=e.ap(i[2],0,1),f=e.a6.vec4.lerp(e.a6.vec4.create(),l,c,u),p=Math.tan(.5*n.fovX),m=-f[2]*p;if(0===h)return f[1]<-Math.abs(m)?d:1;const g=(-Math.abs(m)-f[1])/h,_=(e,t,n)=>(1-n)*e+n*t,y=e.ap(_(1,d,g),d,1);return _(1,y,e.ap((n.pitch-20)/20,0,1))}class ya{}class va{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(t,n,r){{const e=this._storage.get(n.id);if(e)return e.lastUsedFrameIdx=t,e.buf}const i=r.gl,o=i.getBufferParameter(i.ELEMENT_ARRAY_BUFFER,i.BUFFER_SIZE),a=new ArrayBuffer(o),s=new Int16Array(a);i.getBufferSubData(i.ELEMENT_ARRAY_BUFFER,0,new Int16Array(a));const l=new e.dk;for(let e=0;e30&&(n.buf.destroy(),this._storage.delete(t))}destroy(){for(const[e,t]of this._storage)t.buf.destroy(),this._storage.delete(e)}}class xa{constructor(e){this.occluderSize=30,this.depthOffset=-1e-4,e.registerParameter(this,["Occlusion"],"occluderSize",{min:1,max:100,step:1}),e.registerParameter(this,["Occlusion"],"depthOffset",{min:-.05,max:0,step:1e-5})}}const ba={symbol:function(t,n,r,i,o){if("translucent"!==t.renderPass)return;const a=zn.disabled,s=t.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&function(t,n,r,i,o,a,s){const l=n.transform,c="map"===o,u="map"===a;for(const h of t){const t=i.getTile(h),n=t.getBucket(r);if(!n||!n.text||!n.text.segments.get().length)continue;const o=e.bj(n.textSizeData,l.zoom),a=nn(h,n.getProjection(),l),d=l.calculatePixelsToTileUnitsMatrix(t),f=Ft(a,t.tileID.canonical,u,c,l,n.getProjection(),d),p=n.hasIconTextFit()&&n.hasIconData();if(o){const r=Math.pow(2,l.zoom-t.tileID.overscaledZ);bo(n,c,u,s,e.cS,l,f,h,r,o,p)}}}(i,t,r,n,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),o);const l=0!==r.paint.get("icon-opacity").constantOr(1),c=0!==r.paint.get("text-opacity").constantOr(1);void 0!==r.layout.get("symbol-sort-key").constantOr(1)&&(l||c)?wo(t,n,r,i,a,s):(l&&wo(t,n,r,i,a,s,{onlyIcons:!0}),c&&wo(t,n,r,i,a,s,{onlyText:!0})),n.map.showCollisionBoxes&&(_o(t,n,r,i,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),_o(t,n,r,i,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1))},circle:function(t,n,r,i){if("translucent"!==t.renderPass)return;const o=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),s=r.paint.get("circle-stroke-opacity"),l=void 0!==r.layout.get("circle-sort-key").constantOr(1),c=r.paint.get("circle-emissive-strength");if(0===o.constantOr(1)&&(0===a.constantOr(1)||0===s.constantOr(1)))return;const u=t.context,h=u.gl,d=t.transform,f=t.depthModeForSublayer(0,Rn.ReadOnly),p=zn.disabled,m=t.colorModeForDrapableLayerRenderPass(c),g="globe"===d.projection.name,_=[e.am(d.center.lng),e.at(d.center.lat)],y=[];for(let x=0;xe.sortKey-t.sortKey));const v={useDepthForOcclusion:d.depthOcclusionForSymbolsAndCircles};for(const e of y){const{programConfiguration:n,program:i,layoutVertexBuffer:o,globeExtVertexBuffer:a,indexBuffer:s,uniformValues:l,tile:c}=e.state,g=e.segments;t.terrain&&t.terrain.setupElevationDraw(c,i,v),t.uploadCommonUniforms(u,i,c.tileID.toUnwrapped()),i.draw(t,h.TRIANGLES,f,p,m,Fn.disabled,l,r.id,o,s,g,r.paint,d.zoom,n,[a])}},heatmap:function(t,n,r,i){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const o=t.context,a=o.gl,s=zn.disabled,l=new Pn([a.ONE,a.ONE,a.ONE,a.ONE],e.bz.transparent,[!0,!0,!0,!0]);!function(e,t,n,r){const i=e.gl,o=t.width*r,a=t.height*r;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,o,a]);let s=n.heatmapFbo;if(!s||s&&(s.width!==o||s.height!==a)){s&&s.destroy();const t=i.createTexture();i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),s=n.heatmapFbo=e.createFramebuffer(o,a,!0,null),function(e,t,n,r,i,o){const a=e.gl;a.texImage2D(a.TEXTURE_2D,0,e.extRenderToTextureHalfFloat?a.RGBA16F:a.RGBA,i,o,0,a.RGBA,e.extRenderToTextureHalfFloat?a.HALF_FLOAT:a.UNSIGNED_BYTE,null),r.colorAttachment.set(n)}(e,0,t,s,o,a)}else i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),e.bindFramebuffer.set(s.framebuffer)}(o,t,r,"globe"===t.transform.projection.name?.5:.25),o.clear({color:e.bz.transparent});const c=t.transform,u="globe"===c.projection.name,h=u?["PROJECTION_GLOBE_VIEW"]:[],d=u?Fn.frontCCW:Fn.disabled,f=[e.am(c.center.lng),e.at(c.center.lat)];for(let e=0;e({u_image:0,u_color_ramp:1,u_opacity:t.paint.get("heatmap-opacity")}))(0,n),n.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,n.paint,t.transform.zoom)}(t,r))},line:function(t,n,r,i){if("translucent"!==t.renderPass)return;const o=r.paint.get("line-opacity"),a=r.paint.get("line-width");if(0===o.constantOr(1)||0===a.constantOr(1))return;const s=r.paint.get("line-emissive-strength"),l=r.paint.get("line-occlusion-opacity"),c=t.context,u=c.gl,h=r.layout.get("line-z-offset"),d=!h.isConstant()||!!h.constantOr(0),f=d?new Rn(t.depthOcclusion?u.GREATER:u.LEQUAL,Rn.ReadOnly,t.depthRangeFor3D):t.depthModeForSublayer(0,Rn.ReadOnly),p=t.colorModeForDrapableLayerRenderPass(s),m=t.terrain&&t.terrain.renderingToTexture,g=m?1:e.q.devicePixelRatio,_=r.paint.get("line-dasharray"),y=_.constantOr(1),v=r.layout.get("line-cap"),x=_.constantOr(null),b=v.constantOr(null),w=r.paint.get("line-pattern"),S=w.constantOr(1),M=w.constantOr(null),A=r.paint.get("line-opacity").constantOr(1);let E=!S&&1!==A||t.depthOcclusion&&l>0&&l<1;const T=r.paint.get("line-gradient"),C=S?"linePattern":"line",k=e.cV(r);let I;if(m&&t.terrain&&t.terrain.clipOrMaskOverlapStencilType()&&(E=!1),0!==l&&t.depthOcclusion){const t=r.paint._values["line-opacity"];t&&t.value&&"constant"===t.value.kind?I=t.value:e.w(`Occlusion opacity for layer ${r.id} is supported only when line-opacity isn't data-driven.`)}if(d&&(t.forceTerrainMode=!0),!d&&0!==l&&t.terrain&&!m)return void e.w(`Occlusion opacity for layer ${r.id} is supported on terrain only if the layer has non-zero line-z-offset.`);const P=E&&d?t.stencilModeFor3D():zn.disabled;for(const R of i){const i=n.getTile(R);if(S&&!i.patternsLoaded())continue;const o=i.getBucket(r);if(!o)continue;t.prepareDrawTile();const a=o.programConfigurations.get(r.id),s=t.isTileAffectedByFog(R),h=t.getOrCreateProgram(C,{config:a,defines:d?[...k,"ELEVATED"]:k,overrideFog:s});if(M&&i.imageAtlas){const e=i.imageAtlas.patternPositions[M.toString()];e&&a.setConstantPatternPositions(e)}if(!S&&x&&b&&i.lineAtlas){const e=i.lineAtlas.getDash(x,b);e&&a.setConstantPatternPositions(e)}let[_,v]=r.paint.get("line-trim-offset");if("round"===b||"square"===b){const e=1;_!==v&&(0===_&&(_-=e),1===v&&(v+=e))}const w=m?R.projMatrix:null,L=S?e.cW(t,i,r,w,g,[_,v]):e.cX(t,i,r,w,o.lineClipsArray.length,g,[_,v]);if(T){const i=o.gradients[r.id];let a=i.texture;if(r.gradientVersion!==i.version){let s=256;if(r.stepInterpolant){const r=n.getSource().maxzoom,i=R.canonical.z===r?Math.ceil(1<{null!=I&&(I.value=A*l),h.draw(t,u.TRIANGLES,f,e,p,Fn.disabled,L,r.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,r.paint,t.transform.zoom,a,[o.layoutVertexBuffer2,o.patternVertexBuffer,o.zOffsetVertexBuffer]),null!=I&&(I.value=A)};if(E&&!d){const e=t.stencilModeForClipping(R).ref;0===e&&m&&c.clear({stencil:0});const n={func:u.EQUAL,mask:255};L.u_alpha_discard_threshold=.8,z(new zn(n,e,255,u.KEEP,u.KEEP,u.INVERT)),L.u_alpha_discard_threshold=0,z(new zn(n,e,255,u.KEEP,u.KEEP,u.KEEP))}else E&&d&&(L.u_alpha_discard_threshold=.001),z(d?P:t.stencilModeForClipping(R))}E&&(t.resetStencilClippingMasks(),m&&c.clear({stencil:0})),0===l||t.depthOcclusion||m||t.layersWithOcclusionOpacity.push(t.currentLayer),d&&(t.forceTerrainMode=!1)},fill:function(t,n,r,i){const o=r.paint.get("fill-color"),a=r.paint.get("fill-opacity"),s=r.is3D(),l=new Rn(t.context.gl.LEQUAL,Rn.ReadWrite,t.depthRangeFor3D);if(0===a.constantOr(1))return;const c=r.paint.get("fill-emissive-strength"),u=t.colorModeForDrapableLayerRenderPass(c),h=r.paint.get("fill-pattern"),d=t.opaquePassEnabledForLayer()&&!h.constantOr(1)&&1===o.constantOr(e.bz.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(t.renderPass===d){const e=s?l:t.depthModeForSublayer(1,"opaque"===t.renderPass?Rn.ReadWrite:Rn.ReadOnly);Mo(t,n,r,i,e,u,!1)}if(!s&&"translucent"===t.renderPass&&r.paint.get("fill-antialias")){const e=s?l:t.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,Rn.ReadOnly);Mo(t,n,r,i,e,u,!0)}},"fill-extrusion":function(t,n,r,i){const o=r.paint.get("fill-extrusion-opacity"),a=t.context,s=a.gl,l=t.terrain,c=l&&l.renderingToTexture;if(0===o)return;const u=t.conflationActive&&t.style.isLayerClipped(r,n.getSource()),h=t.style.order.indexOf(r.fqid);if(u&&function(e,t,n,r,i){for(const o of r){const r=t.getTile(o).getBucket(n);r&&(r.updateReplacement(o,e.replacementSource,i),r.uploadCentroid(e.context))}}(t,n,r,i,h),l||u)for(const e of i){const i=n.getTile(e).getBucket(r);i&&To(t.context,n,e,i,r,l,u)}if("shadow"===t.renderPass&&t.shadowRenderer){const a=t.shadowRenderer;if(l&&o<.65&&r._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof e.a4)return;const s=a.getShadowPassDepthMode(),c=a.getShadowPassColorMode();Ao(t,n,r,i,s,zn.disabled,c,u)}else if("translucent"===t.renderPass){const h=!r.paint.get("fill-extrusion-pattern").constantOr(1),d=r.paint.get("fill-extrusion-color").constantOr(e.bz.white);if(!c&&0!==d.a){const e=new Rn(t.context.gl.LEQUAL,Rn.ReadWrite,t.depthRangeFor3D);1===o&&h?Ao(t,n,r,i,e,zn.disabled,Pn.unblended,u):(Ao(t,n,r,i,e,zn.disabled,Pn.disabled,u),Ao(t,n,r,i,e,t.stencilModeFor3D(),t.colorModeForRenderPass(),u),t.resetStencilClippingMasks())}if(t.style.enable3dLights()&&h&&(!l&&"globe"!==t.transform.projection.name||c)){const o=r.paint.get("fill-extrusion-opacity"),h=r.paint.get("fill-extrusion-ambient-occlusion-intensity"),d=r.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),f=r.paint.get("fill-extrusion-flood-light-intensity"),p=r.paint.get("fill-extrusion-flood-light-color").toRenderColor(r.lut).toArray01().slice(0,3),m=h>0&&d>0,g=f>0,_=(e,t,n)=>(1-n)*e+n*t,y=a=>{const l=t.depthModeForSublayer(1,Rn.ReadOnly,s.LEQUAL,!0),c=r.paint.get(a?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),m=_(.1,3,c),g=t._showOverdrawInspector;if(!g){const c=new zn({func:s.ALWAYS,mask:255},255,255,s.KEEP,s.KEEP,s.REPLACE),g=new Pn([s.ONE,s.ONE,s.ONE,s.ONE],e.bz.transparent,[!1,!1,!1,!0],s.MIN);Eo(t,n,r,i,l,c,g,Fn.disabled,a,"sdf",o,h,d,f,p,m,u,!1)}{const c=g?zn.disabled:new zn({func:s.EQUAL,mask:255},255,255,s.KEEP,s.DECR,s.DECR),_=g?t.colorModeForRenderPass():new Pn([s.ONE_MINUS_DST_ALPHA,s.DST_ALPHA,s.ONE,s.ONE],e.bz.transparent,[!0,!0,!0,!0]);Eo(t,n,r,i,l,c,_,Fn.disabled,a,"color",o,h,d,f,p,m,u,!1)}};if(c){const c=(a,l,c)=>{const m=t.depthModeForSublayer(1,Rn.ReadOnly,s.LEQUAL,!1),g=r.paint.get(a?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),y=_(.1,3,g);{const c=new Pn([s.ONE,s.ONE,s.ONE,s.ONE],e.bz.transparent,[!1,!1,!1,!0]);Eo(t,n,r,i,m,zn.disabled,c,Fn.disabled,a,"clear",o,h,d,f,p,y,u,l)}{const c=new zn({func:s.ALWAYS,mask:255},255,255,s.KEEP,s.KEEP,s.REPLACE),g=new Pn([s.ONE,s.ONE,s.ONE,s.ONE],e.bz.transparent,[!1,!1,!1,!0],s.MIN);Eo(t,n,r,i,m,c,g,Fn.disabled,a,"sdf",o,h,d,f,p,y,u,l)}{const c=a?s.ZERO:s.ONE_MINUS_DST_ALPHA,g=new zn({func:s.EQUAL,mask:255},255,255,s.KEEP,s.DECR,s.DECR),_=new Pn([c,s.DST_ALPHA,s.ONE_MINUS_DST_ALPHA,s.ZERO],e.bz.transparent,[!0,!0,!0,!0]);Eo(t,n,r,i,m,g,_,Fn.disabled,a,"color",o,h,d,f,p,y,u,l)}{const g=new Pn([s.ONE,s.ONE,s.ONE,a?s.ZERO:s.ONE],e.bz.transparent,[!1,!1,!1,!0],a?s.FUNC_ADD:s.MAX);Eo(t,n,r,i,m,zn.disabled,g,Fn.disabled,a,"clear",o,h,d,f,p,y,u,l,c)}};if(m||g){let n;if(t.prepareDrawTile(),l){const t=l.drapeBufferSize[0],r=l.drapeBufferSize[1];n=l.framebufferCopyTexture,n&&(!n||n.size[0]===t&&n.size[1]===r)||(n&&n.destroy(),n=l.framebufferCopyTexture=new e.T(a,new e.r({width:t,height:r}),s.RGBA8)),n.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.copyTexImage2D(s.TEXTURE_2D,0,s.RGBA,0,0,t,r,0)}m&&c(!0,!1,n),g&&c(!1,!0,n)}}else m&&y(!0),g&&y(!1),(m||g)&&t.resetStencilClippingMasks()}}},hillshade:function(e,t,n,r){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;if(e.style.disableElevatedTerrain)return;const i=e.context,o=e.terrain&&e.terrain.renderingToTexture,[a,s]="translucent"!==e.renderPass||o?[{},r]:e.stencilConfigForOverlap(r);for(const l of s){const r=t.getTile(l);if(r.needsHillshadePrepare&&"offscreen"===e.renderPass)zr(e,r,n);else if("translucent"===e.renderPass){const t=e.depthModeForSublayer(0,Rn.ReadOnly),i=n.paint.get("hillshade-emissive-strength"),s=e.colorModeForDrapableLayerRenderPass(i),c=o&&e.terrain?e.terrain.stencilModeForRTTOverlap(l):a[l.overscaledZ];Rr(e,l,r,n,t,c,s)}}i.viewport.set([0,0,e.width,e.height]),e.resetStencilClippingMasks()},raster:function(t,n,r,i,o,a){if("translucent"!==t.renderPass)return;if(0===r.paint.get("raster-opacity"))return;const s="globe"===t.transform.projection.name,l=0!==r.paint.get("raster-elevation"),c=l&&s;if(t.renderElevatedRasterBackface&&!c)return;const u=t.context,h=u.gl,d=n.getSource(),f=function(t,n,r,i){const o=n.paint.get("raster-color"),a="raster-array"===t.type,s=[],l=n.paint.get("raster-resampling"),c=n.paint.get("raster-color-mix");let u=n.paint.get("raster-color-range");const h=[c[0],c[1],c[2],0],d=c[3];let f="nearest"===l?i.NEAREST:i.LINEAR;if(a&&(s.push("RASTER_ARRAY"),o||s.push("RASTER_COLOR"),"linear"===l&&s.push("RASTER_ARRAY_LINEAR"),f=i.NEAREST,!u&&t.rasterLayers)){const e=t.rasterLayers.find((e=>{let{id:t}=e;return t===n.sourceLayer}));e&&e.fields&&e.fields.range&&(u=e.fields.range)}if(u=u||[0,1],o){s.push("RASTER_COLOR"),r.activeTexture.set(i.TEXTURE2),n.updateColorRamp(u);let t=n.colorRampTexture;t||(t=n.colorRampTexture=new e.T(r,n.colorRamp,i.RGBA8)),t.bind(i.LINEAR,i.CLAMP_TO_EDGE)}return{mix:h,range:u,offset:d,defines:s,resampling:f}}(d,r,u,h);if(d instanceof e.aD&&!i.length&&!s)return;const p=r.paint.get("raster-emissive-strength"),m=t.colorModeForDrapableLayerRenderPass(p),g=t.terrain&&t.terrain.renderingToTexture,_=!t.options.moving,y="nearest"===r.paint.get("raster-resampling")?h.NEAREST:h.LINEAR;if(d instanceof e.aD&&!i.length&&(d.onNorthPole||d.onSouthPole)){const e=l?t.stencilModeFor3D():zn.disabled;return void Lo(!!d.onNorthPole,null,t,n,r,p,f,Fn.disabled,e)}if(!i.length)return;const[v,x]=d instanceof e.aD||g?[{},i]:t.stencilConfigForOverlap(i),b=x[x.length-1].overscaledZ;c&&f.defines.push("PROJECTION_GLOBE_VIEW"),l&&f.defines.push("RENDER_CUTOFF");const w=(i,o,x)=>{for(const w of i){const i=w.toUnwrapped(),S=n.getTile(w);if(g&&(!S||!S.hasData()))continue;u.activeTexture.set(h.TEXTURE0);const M=Do(S,d,r,f);if(!M||!M.texture)continue;const{texture:A,mix:E,offset:T,tileSize:C,buffer:k}=M;let I,P;g?(I=Rn.disabled,P=w.projMatrix):l?(I=new Rn(h.LEQUAL,Rn.ReadWrite,t.depthRangeFor3D),P=s?Float32Array.from(t.transform.expandedFarZProjMatrix):t.transform.calculateProjMatrix(i,_)):(I=t.depthModeForSublayer(w.overscaledZ-b,1===r.paint.get("raster-opacity")?Rn.ReadWrite:Rn.ReadOnly,h.LESS),P=t.transform.calculateProjMatrix(i,_));const R=t.terrain&&g?t.terrain.stencilModeForRTTOverlap(w):v[w.overscaledZ],L=a?0:r.paint.get("raster-fade-duration");S.registerFadeDuration(L);const z=n.findLoadedParent(w,0),D=Ei(S,z,n,t.transform,L);let O,F;t.terrain&&t.terrain.prepareDrawTile(),u.activeTexture.set(h.TEXTURE0),A.bind(y,h.CLAMP_TO_EDGE),u.activeTexture.set(h.TEXTURE1),z?(z.texture&&z.texture.bind(y,h.CLAMP_TO_EDGE),O=Math.pow(2,z.tileID.overscaledZ-S.tileID.overscaledZ),F=[S.tileID.canonical.x*O%1,S.tileID.canonical.y*O%1]):A.bind(y,h.CLAMP_TO_EDGE),A.useMipmap&&u.extTextureFilterAnisotropic&&t.transform.pitch>20&&h.texParameterf(h.TEXTURE_2D,u.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,u.extTextureFilterAnisotropicMax);const B=t.transform;let N;const j=l?zo(B):[0,0,0,0];let V,U,$,G,q,W=0;if(c&&d instanceof e.aD&&d.coordinates.length>3)V=Float32Array.from(e.b5(e.cC(new e.bP(0,0,0)))),U=Float32Array.from(B.globeMatrix),$=Float32Array.from(e.cy(B)),G=[e.am(B.center.lng),e.at(B.center.lat)],N=d.elevatedGlobePerspectiveTransform,q=d.elevatedGlobeGridMatrix||new Float32Array(9);else if(c){const t=e.cz(w.canonical);W=e.cA(t.getCenter().lat),V=Float32Array.from(e.b5(e.cC(w.canonical))),U=Float32Array.from(B.globeMatrix),$=Float32Array.from(e.cy(B)),G=[e.am(B.center.lng),e.at(B.center.lat)],N=[0,0],q=Float32Array.from(e.cB(w.canonical,t,W,B.worldSize/B._pixelsPerMercatorPixel))}else N=d instanceof e.aD?d.perspectiveTransform:[0,0],V=new Float32Array(16),U=new Float32Array(9),$=new Float32Array(16),G=[0,0],q=new Float32Array(9);const H=Xi(P,V,U,$,q,F||[0,0],e.a9(t.transform.zoom),G,j,O||1,D,r,N,l?r.paint.get("raster-elevation"):0,2,E,T,f.range,C,k,p),Z=t.isTileAffectedByFog(w),Y=t.getOrCreateProgram("raster",{defines:f.defines,overrideFog:Z});if(t.uploadCommonUniforms(u,Y,i),d instanceof e.aD){const n=d.elevatedGlobeVertexBuffer,i=d.elevatedGlobeIndexBuffer;if(g||!s)d.boundsBuffer&&d.boundsSegments&&Y.draw(t,h.TRIANGLES,I,zn.disabled,m,Fn.disabled,H,r.id,d.boundsBuffer,t.quadTriangleIndexBuffer,d.boundsSegments);else if(n&&i){const a=B.zoom<=e.c2?d.elevatedGlobeSegments:d.getSegmentsForLongitude(B.center.lng);a&&Y.draw(t,h.TRIANGLES,I,zn.disabled,m,o,H,r.id,n,i,a)}}else if(c){I=new Rn(h.LEQUAL,Rn.ReadOnly,t.depthRangeFor3D);const e=t.globeSharedBuffers;if(e){const[n,i,a]=e.getGridBuffers(W,!1);Y.draw(t,h.TRIANGLES,I,x||R,t.colorModeForRenderPass(),o,H,r.id,n,i,a)}}else{const{tileBoundsBuffer:e,tileBoundsIndexBuffer:n,tileBoundsSegments:i}=t.getTileBoundsBuffers(S);Y.draw(t,h.TRIANGLES,I,R,m,Fn.disabled,H,r.id,e,n,i)}}if(!(d instanceof e.aD)&&c)for(const e of i){const i=e.canonical.y===(1<>>16,2654435769),((e=Math.imul(e^e>>>16,2654435769))>>>0)/4294967296},i=1/1.1;for(let o=0;oe.c$[t](i)));p.push(i);const m=i.canonical.x,g=i.canonical.y;for(const e of p){const o=n.getTile(l?e.wrapped():e);if(!o)continue;const s=o.rasterParticleState;if(!s)continue;const u=e.canonical.x+(1<e.tileID))),f&&(c.activeTexture.set(u.TEXTURE0),t.imageManager.bind(t.context,r.scope)),l){const n=t.getOrCreateProgram(v,{overrideFog:!1,overrideRtt:!0}),i=new Float32Array(e.a6.mat4.identity([])),c=new e.aA(0,0,0,0,0),h=f?oo(i,s,a,t,0,r.scope,p,l,{tileID:c,tileSize:d}):io(i,s,a,o.toRenderColor(r.lut));n.draw(t,u.TRIANGLES,_,g,y,Fn.disabled,h,r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments)}else for(const e of b){const m=t.isTileAffectedByFog(e),b=t.getOrCreateProgram(v,{overrideFog:m}),w=e.toUnwrapped(),S=i?e.projMatrix:t.transform.calculateProjMatrix(w);t.prepareDrawTile();const M=n?n.getTile(e):x?x[e.key]:new pt(e,d,h.zoom,t),A=f?oo(S,s,a,t,0,r.scope,p,l,{tileID:e,tileSize:d}):io(S,s,a,o.toRenderColor(r.lut));t.uploadCommonUniforms(c,b,w);const{tileBoundsBuffer:E,tileBoundsIndexBuffer:T,tileBoundsSegments:C}=t.getTileBoundsBuffers(M);b.draw(t,u.TRIANGLES,_,g,y,Fn.disabled,A,r.id,E,T,C)}},sky:function(t,n,r){const i=t._atmosphere?e.a9(t.transform.zoom):1,o=r.paint.get("sky-opacity")*i;if(0===o)return;const a=t.context,s=r.paint.get("sky-type"),l=new Rn(a.gl.LEQUAL,Rn.ReadOnly,[0,1]),c=t.frameCounter/1e3%1;"atmosphere"===s?"offscreen"===t.renderPass?r.needsSkyboxCapture(t)&&(function(t,n){const r=t.context,i=r.gl;let o=n.skyboxFbo;if(!o){o=n.skyboxFbo=r.createFramebuffer(32,32,!0,null),n.skyboxGeometry=new Jo(r),n.skyboxTexture=r.gl.createTexture(),i.bindTexture(i.TEXTURE_CUBE_MAP,n.skyboxTexture),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR);for(let e=0;e<6;++e)i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,i.RGBA,32,32,0,i.RGBA,i.UNSIGNED_BYTE,null)}r.bindFramebuffer.set(o.framebuffer),r.viewport.set([0,0,32,32]);const a=n.getCenter(t,!0),s=t.getOrCreateProgram("skyboxCapture"),l=new Float64Array(16);e.a6.mat4.identity(l),e.a6.mat4.rotateY(l,l,.5*-Math.PI),Qo(t,n,s,l,a,0),e.a6.mat4.identity(l),e.a6.mat4.rotateY(l,l,.5*Math.PI),Qo(t,n,s,l,a,1),e.a6.mat4.identity(l),e.a6.mat4.rotateX(l,l,.5*-Math.PI),Qo(t,n,s,l,a,2),e.a6.mat4.identity(l),e.a6.mat4.rotateX(l,l,.5*Math.PI),Qo(t,n,s,l,a,3),e.a6.mat4.identity(l),Qo(t,n,s,l,a,4),e.a6.mat4.identity(l),e.a6.mat4.rotateY(l,l,Math.PI),Qo(t,n,s,l,a,5),r.viewport.set([0,0,t.width,t.height])}(t,r),r.markSkyboxValid(t)):"sky"===t.renderPass&&function(e,t,n,r,i){const o=e.context,a=o.gl,s=e.transform,l=e.getOrCreateProgram("skybox");o.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_CUBE_MAP,t.skyboxTexture);const c=((e,t,n,r,i)=>({u_matrix:e,u_sun_direction:t,u_cubemap:0,u_opacity:r,u_temporal_offset:i}))(s.skyboxMatrix,t.getCenter(e,!1),0,r,i);e.uploadCommonUniforms(o,l),l.draw(e,a.TRIANGLES,n,zn.disabled,e.colorModeForRenderPass(),Fn.backCW,c,"skybox",t.skyboxGeometry.vertexBuffer,t.skyboxGeometry.indexBuffer,t.skyboxGeometry.segment)}(t,r,l,o,c):"gradient"===s&&"sky"===t.renderPass&&function(t,n,r,i,o){const a=t.context,s=a.gl,l=t.transform,c=t.getOrCreateProgram("skyboxGradient");n.skyboxGeometry||(n.skyboxGeometry=new Jo(a)),a.activeTexture.set(s.TEXTURE0);let u=n.colorRampTexture;u||(u=n.colorRampTexture=new e.T(a,n.colorRamp,s.RGBA8)),u.bind(s.LINEAR,s.CLAMP_TO_EDGE);const h=((t,n,r,i,o)=>({u_matrix:t,u_color_ramp:0,u_center_direction:n,u_radius:e.bB(r),u_opacity:i,u_temporal_offset:o}))(l.skyboxMatrix,n.getCenter(t,!1),n.paint.get("sky-gradient-radius"),i,o);t.uploadCommonUniforms(a,c),c.draw(t,s.TRIANGLES,r,zn.disabled,t.colorModeForRenderPass(),Fn.backCW,h,"skyboxGradient",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}(t,r,l,o,c)},debug:function(t,n,r,i,o,a){for(let s=0;s{s&&(s.useNormalOffset=!0,l||(s.enabled=!0))},u=n.getSource();if("light-beam"===t.renderPass&&"batched-model"!==u.type)return;if("vector"===u.type||"geojson"===u.type)return function(t,n,r,i,o){const a=t.transform;if("mercator"!==a.projection.name)return void e.w(`Drawing 3D models for ${a.projection.name} projection is not yet implemented`);const s=a.getFreeCameraOptions().position;if(!t.modelManager)return;const l=t.modelManager;r.modelManager=l;const c=t.shadowRenderer;if(!r._unevaluatedLayout._values.hasOwnProperty("model-id"))return;const u=r._unevaluatedLayout._values["model-id"],h={...r.layout.get("model-id").parameters},d=t.style.order.indexOf(r.fqid);for(const f of i){const i=n.getTile(f).getBucket(r);if(!i||i.projection.name!==a.projection.name)continue;const p=i.getModelUris();p&&!i.modelsRequested&&(l.addModelsFromBucket(p,o),i.modelsRequested=!0);const m=da(f,a);h.zoom=m;const g=u.possiblyEvaluate(h);if(ua(t,i,f),ha.shadowUniformsInitialized=!1,ha.useSingleShadowCascade=!!c&&0===c.getMaxCascadeForTile(f.toUnwrapped()),"shadow"===t.renderPass&&c){if(1===t.currentShadowCascade&&i.isInsideFirstShadowMapFrustum)continue;const n=a.calculatePosMatrix(f.toUnwrapped(),a.worldSize);if(ha.tileMatrix.set(n),ha.shadowTileMatrix=Float32Array.from(c.calculateShadowPassMatrixFromMatrix(n)),ha.aabb.min.fill(0),ha.aabb.max[0]=ha.aabb.max[1]=e.ab,ha.aabb.max[2]=0,ma(i,ha,t,r.scope))continue}const _=1<0&&t.style.isLayerClipped(r,n.getSource())&&i.updateReplacement(f,t.replacementSource,d,o)&&(i.uploaded=!1,i.upload(t.context));for(let e in i.instancesPerModel){const n=i.instancesPerModel[e];n.features.length>0&&(e=g.evaluate(n.features[0].feature,{}));const a=l.getModel(e,o);if(a&&a.uploaded)for(const e of a.nodes)fa(t,r,e,n,y,f,ha)}}}(t,n,r,i,"vector"===u.type?r.scope:""),void c();if(!u.loaded())return;if("batched-model"===u.type)return function(t,n,r,i){r.resetLayerRenderingStats(t);const o=t.context,a=t.transform,s=t.style.fog,l=t.shadowRenderer;if("mercator"!==a.projection.name)return void e.w(`Drawing 3D landmark models for ${a.projection.name} projection is not yet implemented`);const c=t.transform.getFreeCameraOptions().position,u=e.a6.vec3.scale([],[c.x,c.y,c.z],t.transform.worldSize),h=e.a6.vec3.negate([],u),d=e.a6.mat4.identity([]),f=e.de(a.center.lat,a.zoom),p=e.a6.mat4.fromScaling([],[1,1,1/f]);e.a6.mat4.translate(d,d,h);const m=r.paint.get("model-opacity"),g=new Rn(o.gl.LEQUAL,Rn.ReadWrite,t.depthRangeFor3D),_=new Rn(o.gl.LEQUAL,Rn.ReadOnly,t.depthRangeFor3D),y=new e.c9([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),v="shadow"===t.renderPass,x=v&&l?l.getCurrentCascadeFrustum():a.getFrustum(a.scaleZoom(a.worldSize)),b=r.paint.get("model-front-cutoff"),w=b[2]<1,S=Zn(t,r.paint.get("model-cutoff-fade-range")),M=r.getLayerRenderingStats();(function(e,t,n,r){const i=e.terrain?e.terrain.exaggeration():0,o=e.transform.zoom;for(const a of r){const r=t.getTile(a).getBucket(n);r&&(e.conflationActive&&r.updateReplacement(a,e.replacementSource),r.evaluateScale(e,n),e.terrain&&i>0&&r.elevationUpdate(e.terrain,i,a,n.source),r.needsReEvaluation(e,o,n)&&r.evaluate(n))}})(t,n,r,i),function(){let c,h,A;w?(c=i.length-1,h=-1,A=-1):(c=0,h=i.length,A=1);const E=new Float64Array(16),T=e.a6.vec3.create(),C=new e.P(0,0);for(let k=c;k!==h;k+=A){const c=i[k],h=n.getTile(c).getBucket(r);if(!h||!h.uploaded)continue;let A=!1;l&&(A=0===l.getMaxCascadeForTile(c.toUnwrapped()));const I=a.calculatePosMatrix(c.toUnwrapped(),a.worldSize),P=h.modelTraits;!v&&w&&(e.a6.mat4.invert(E,I),e.a6.vec3.transformMat4(T,u,E),C.x=T[0],C.y=T[1]);const R=[];for(const n of h.getNodesInfo()){if(n.hiddenByReplacement)continue;if(!n.node.meshes)continue;const r=n.node;let i=0;t.terrain&&r.elevation&&(i=r.elevation*t.terrain.exaggeration());const o=(()=>{const t=n.aabb;return y.min=[...t.min],y.max=[...t.max],y.min[2]+=i,y.max[2]+=i,e.a6.vec3.transformMat4(y.min,y.min,I),e.a6.vec3.transformMat4(y.max,y.max,I),y})(),s=n.evaluatedScale;if(s[0]<=1&&s[1]<=1&&s[2]<=1&&0===o.intersects(x))continue;if(!v&&w){const t=1/6;n.cameraCollisionOpacity=u[0]>o.min[0]&&u[0]o.min[1]&&u[1]!w||1===e.opacity&&1===t.opacity?e.deptht.depth?-1:1));for(const n of R){const i=n.nodeInfo,c=i.node;let u=e.a6.mat4.multiply([],p,n.tileModelMatrix);e.a6.mat4.multiply(u,d,u);const h=e.a6.mat4.invert([],u);e.a6.mat4.transpose(h,h),e.a6.mat4.scale(h,h,pa),u=e.a6.mat4.multiply(u,u,c.matrix);const f="light-beam"===t.renderPass,m=P&e.dj.HasMapboxMeshFeatures,y=m?0:i.evaluatedRMEA[0][2];for(let e=0;e=De||i>=De}}const E=d.material;let T;E.occlusionTexture&&E.occlusionTexture.offsetScale&&(T=E.occlusionTexture.offsetScale,b.defines.push("OCCLUSION_TEXTURE_TRANSFORM")),!v&&l&&(l.useNormalOffset=!!d.normalBuffer);const C=t.getOrCreateProgram("model",b);!v&&l&&l.setupShadowsFromMatrix(n.tileModelMatrix,C,l.useNormalOffset),t.uploadCommonUniforms(o,C,null,S);const k=E.pbrMetallicRoughness;k.metallicFactor=.9,k.roughnessFactor=.5;const I=so(new Float32Array(x),new Float32Array(u),new Float32Array(h),new Float32Array(c.matrix),t,n.opacity,k.baseColorFactor.toRenderColor(null),E.emissiveFactor,k.metallicFactor,k.roughnessFactor,E,y,r,[0,0,0],T);!p&&(i.hasTranslucentParts||n.opacity<1)&&C.draw(t,o.gl.TRIANGLES,g,zn.disabled,Pn.disabled,Fn.backCCW,I,r.id,d.vertexBuffer,d.indexBuffer,d.segments,r.paint,t.transform.zoom,void 0,w),C.draw(t,o.gl.TRIANGLES,p?_:g,zn.disabled,p||n.opacity<1||i.hasTranslucentParts?Pn.alphaBlended:Pn.unblended,Fn.backCCW,I,r.id,d.vertexBuffer,d.indexBuffer,d.segments,r.paint,t.transform.zoom,void 0,w)}}}}()}(t,n,r,i),void c();if("model"!==u.type)return;const h=u.getModels(),d=[],f=t.transform.getFreeCameraOptions().position,p=e.a6.vec3.scale([],[f.x,f.y,f.z],t.transform.worldSize);e.a6.vec3.negate(p,p);const m=[],g=[];let _=0;for(const y of h){const n=r.paint.get("model-rotation").constantOr(null),i=r.paint.get("model-scale").constantOr(null),o=r.paint.get("model-translation").constantOr(null);y.computeModelMatrix(t,n,i,o,!0,!0,!1);const a=e.a6.mat4.identity([]),s=e.de(y.position.lat,t.transform.zoom),l=e.a6.mat4.fromScaling([],[1,1,1/s]);e.a6.mat4.translate(a,a,p),d.push({zScaleMatrix:l,negCameraPosMatrix:a});for(const e of y.nodes)la(t.transform,e,y.matrix,t.transform.expandedFarZProjMatrix,_,m,g);_++}if(m.sort(((e,t)=>t.depth-e.depth)),"shadow"!==t.renderPass){if(1===o)for(const e of g)sa(e,t,r,d[e.modelIndex],zn.disabled,t.colorModeForRenderPass());else{for(const e of g)sa(e,t,r,d[e.modelIndex],zn.disabled,Pn.disabled);for(const e of g)sa(e,t,r,d[e.modelIndex],t.stencilModeFor3D(),t.colorModeForRenderPass());t.resetStencilClippingMasks()}for(const e of m)sa(e,t,r,d[e.modelIndex],zn.disabled,t.colorModeForRenderPass());c()}else{for(const e of g)ca(e.mesh,e.nodeModelMatrix,t,r);for(const e of m)ca(e.mesh,e.nodeModelMatrix,t,r);c()}}},wa={model:function(e,t,n){const r=t.getSource();if(!r.loaded())return;if("vector"===r.type||"geojson"===r.type)return void(n.modelManager&&n.modelManager.upload(n,"vector"===r.type?e.scope:""));if("batched-model"===r.type)return;if("model"!==r.type)return;const i=r.getModels();for(const o of i)o.upload(n.context)},raster:function(e,t,n){const r=t.getSource();if(!(r instanceof Qe&&r.loaded()))return;const i=e.sourceLayer||r.rasterLayerIds&&r.rasterLayerIds[0];if(!i)return;const o=e.paint.get("raster-array-band")||r.getInitialBand(i);if(null==o)return;const a=t.getIds().map((e=>t.getTileByID(e)));for(const s of a)s.updateNeeded(i,o)&&r.prepareTile(s,i,o)},"raster-particle":function(e,t,n){const r=t.getSource();if(!(r instanceof Qe&&r.loaded()))return;const i=e.sourceLayer||r.rasterLayerIds&&r.rasterLayerIds[0];if(!i)return;const o=e.paint.get("raster-particle-array-band")||r.getInitialBand(i);if(null==o)return;const a=t.getIds().map((e=>t.getTileByID(e)));for(const s of a)s.updateNeeded(i,o)&&r.prepareTile(s,i,o)}};class Sa{constructor(t,n,r,i){this.context=new mo(t,n),this.transform=r,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.tp=i,this._timeStamp=e.q.now(),this._averageFPS=0,this._fpsHistory=[],this._dt=0,this._debugParams={showTerrainProxyTiles:!1,fpsWindow:30,continousRedraw:!1,enabledLayers:{}};const o=["fill","line","symbol","circle","heatmap","fill-extrusion","raster","raster-particle","hillshade","model","background","sky"];for(const e of o)this._debugParams.enabledLayers[e]=!0;i.registerParameter(this._debugParams,["Terrain"],"showTerrainProxyTiles",{},(()=>{this.style.map.triggerRepaint()})),i.registerParameter(this._debugParams,["FPS"],"fpsWindow",{min:1,max:100,step:1}),i.registerBinding(this._debugParams,["FPS"],"continousRedraw",{readonly:!0,label:"continuous redraw"}),i.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"value"}),i.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"graph",view:"graph",min:0,max:200});for(const e of o)i.registerParameter(this._debugParams.enabledLayers,["Debug","Layers"],e);this.occlusionParams=new xa(i),this.setup(),this.numSublayers=yt.maxUnderzooming+yt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new e.dl,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new Jn(this),this._wireframeDebugCache=new va,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const a=new e.r({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new e.T(this.context,a,t.RGBA8),this._clippingActiveLastFrame=!1}updateTerrain(e,t){const n=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;if(!(n||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new Ii(this,e));const r=this._terrain;this.transform.elevation=n?r:null,r.update(e,this.transform,t),this.transform.elevation&&!r.enabled&&(this.transform.elevation=null)}_updateFog(e){const t=e.fog;if(!t||"globe"===this.transform.projection.name||t.getOpacity(this.transform.pitch)<1||t.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[n,r]=t.getFovAdjustedRange(this.transform._fov);if(n>r)return void(this.transform.fogCullDistSq=null);const i=n+.78*(r-n);this.transform.fogCullDistSq=i*i}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(e){e&&!this._terrain&&(this._terrain=new Ii(this,this.style)),this._forceTerrainMode=e}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(t,n){if(this.width=t*e.q.devicePixelRatio,this.height=n*e.q.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const e of this.style.order)this.style._mergedLayers[e].resize()}setup(){const t=this.context,n=new e.a_;n.emplaceBack(0,0),n.emplaceBack(e.ab,0),n.emplaceBack(0,e.ab),n.emplaceBack(e.ab,e.ab),this.tileExtentBuffer=t.createVertexBuffer(n,e.b0.members),this.tileExtentSegments=e.b1.simpleSegment(0,0,4,2);const r=new e.a_;r.emplaceBack(0,0),r.emplaceBack(e.ab,0),r.emplaceBack(0,e.ab),r.emplaceBack(e.ab,e.ab),this.debugBuffer=t.createVertexBuffer(r,e.b0.members),this.debugSegments=e.b1.simpleSegment(0,0,4,5);const i=new e.a_;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(-1,1),i.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(i,e.b0.members),this.viewportSegments=e.b1.simpleSegment(0,0,4,2);const o=new e.aN;o.emplaceBack(0,0,0,0),o.emplaceBack(e.ab,0,e.ab,0),o.emplaceBack(0,e.ab,0,e.ab),o.emplaceBack(e.ab,e.ab,e.ab,e.ab),this.mercatorBoundsBuffer=t.createVertexBuffer(o,e.b3.members),this.mercatorBoundsSegments=e.b1.simpleSegment(0,0,4,2);const a=new e.aO;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(a);const s=new e.a$;for(const e of[0,1,3,2,0])s.emplaceBack(e);this.debugIndexBuffer=t.createIndexBuffer(s),this.emptyTexture=new e.T(t,new e.r({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA8),this.identityMat=e.a6.mat4.create();const l=this.context.gl;this.stencilClearMode=new zn({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(e){return e._makeTileBoundsBuffers(this.context,this.transform.projection),e._tileBoundsBuffer?{tileBoundsBuffer:e._tileBoundsBuffer,tileBoundsIndexBuffer:e._tileBoundsIndexBuffer,tileBoundsSegments:e._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const e=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,e.TRIANGLES,Rn.disabled,this.stencilClearMode,Pn.disabled,Fn.disabled,Ai(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(e,t,n){if(!t||this.currentStencilSource===t.id||!e.isTileClipped()||!n||0===n.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let e=!1;for(const t of n)if(void 0===this._tileClippingMaskIDs[t.key]){e=!0;break}if(!e)return}this.currentStencilSource=t.id;const r=this.context,i=r.gl;this.nextStencilID+n.length>256&&this.clearStencil(),r.setColorMode(Pn.disabled),r.setDepthMode(Rn.disabled);const o=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const a of n){const e=t.getTile(a),n=this._tileClippingMaskIDs[a.key]=this.nextStencilID++,{tileBoundsBuffer:r,tileBoundsIndexBuffer:s,tileBoundsSegments:l}=this.getTileBoundsBuffers(e);o.draw(this,i.TRIANGLES,Rn.disabled,new zn({func:i.ALWAYS,mask:0},n,255,i.KEEP,i.KEEP,i.REPLACE),Pn.disabled,Fn.disabled,Ai(a.projMatrix),"$clipping",r,s,l)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,t=this.context.gl;return new zn({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(e);const t=this.context.gl;return new zn({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){const t=this.context.gl,n=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),r=n[n.length-1].overscaledZ,i=n[0].overscaledZ-r+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();const e={};for(let n=0;nthis.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture)()&&"translucent"===this.renderPass?new Pn([n.ONE,n.ONE_MINUS_SRC_ALPHA,n.CONSTANT_ALPHA,n.ONE_MINUS_SRC_ALPHA],new e.bz(0,0,0,void 0===t?0:t),[!0,!0,!0,!0]):this.colorModeForRenderPass()}depthModeForSublayer(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.depthOcclusion)return new Rn(this.context.gl.GREATER,Rn.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!r)return Rn.disabled;const i=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Rn(n||this.context.gl.LEQUAL,t,[i,i])}opaquePassEnabledForLayer(){return this.currentLayerthis._debugParams.fpsWindow&&this._fpsHistory.splice(0,this._fpsHistory.length-this._debugParams.fpsWindow),this._averageFPS=Math.round(this._fpsHistory.reduce(((e,t)=>e+t/this._fpsHistory.length),0))}render(t,n){const r=e.q.now();this._dt=r-this._timeStamp,this._timeStamp=r,this._wireframeDebugCache.update(this.frameCounter),this._debugParams.continousRedraw=t.map.repaint,this.style=t,this.options=n;const i=this.style._mergedLayers,o=this.style.order.filter((e=>{const t=i[e];return!(t.type in this._debugParams.enabledLayers)||this._debugParams.enabledLayers[t.type]}));let a=!1,s=!1;for(const e of o){const t=i[e];"circle"===t.type&&(a=!0),"symbol"===t.type&&(t.hasInitialOcclusionOpacityProperties?s=!0:a=!0)}const l=o.map((e=>i[e])),c=this.style._mergedSourceCaches;this.imageManager=t.imageManager,this.modelManager=t.modelManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.q.now()),this.imageManager.beginFrame();let u=0,h=!1;for(const e in c){const t=c[e];t.used&&(t.prepare(this.context),t.getSource().usedInConflation&&++u)}let d=!1;for(const e of l)e.isHidden(this.transform.zoom)||("clip"===e.type&&(d=!0),this.prepareLayer(e));const f={},p={},m={},g={},_={};for(const e in c){const t=c[e];f[e]=t.getVisibleCoordinates(),p[e]=f[e].slice().reverse(),m[e]=t.getVisibleCoordinates(!0).reverse(),g[e]=t.getShadowCasterCoordinates(),_[e]=t.sortCoordinatesByDistance(f[e])}const y=e=>{const t=this.style.getLayerSourceCache(e);return t&&t.used?t.getSource():null};if(u||d||this._clippingActiveLastFrame){const t=[],n=[];let r=0;for(const e of l)this.isSourceForClippingOrConflation(e,y(e))&&(t.push(e),n.push(r)),r++;if(t&&(d||t.length>1)||this._clippingActiveLastFrame){d=!1;const r=[];for(let i=0;i0){const e=y(t);e&&(this.minCutoffZoom=Math.max(e.minzoom,this.minCutoffZoom)),t.minzoom&&(this.minCutoffZoom=Math.max(t.minzoom,this.minCutoffZoom))}t.is3D()&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=e),this._lastOcclusionLayer=e)}const v=this.style&&this.style.fog;v?(this._fogVisible=0!==v.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=v.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(m),this.opaquePassCutoff=0);const x=this._shadowRenderer;if(x){x.updateShadowParameters(this.transform,this.style.directionalLight);for(const e in c)for(const t of f[e]){let e={min:0,max:0};this.terrain&&(e=this.terrain.getMinMaxForTile(t)||e),x.addShadowReceiver(t.toUnwrapped(),e.min,e.max)}}if("globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new e.dm(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new ia(this)),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),!j.has(this.context.gl))return;this.renderPass="offscreen";for(const e of l){const n=t.getLayerSourceCache(e);if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const r=n?p[n.id]:void 0;("custom"===e.type||"raster"===e.type||"raster-particle"===e.type||e.isSky()||r&&r.length)&&this.renderLayer(this,n,e,r)}this.depthRangeFor3D=[0,1-(l.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,g)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const b="globe"===this.transform.projection.name||this.transform.isHorizonVisible(),w=(()=>{if(n.showOverdrawInspector)return e.bz.black;const t=this.style.fog;if(t&&this.transform.projection.supportsFog){const n=this.style.getLut(t.scope);if(!b){const r=t.properties.get("color").toRenderColor(n).toArray01();return new e.bz(...r)}if(b){const r=t.properties.get("space-color").toRenderColor(n).toArray01();return new e.bz(...r)}}return e.bz.transparent})();if(this.context.clear({color:w,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&b&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=o.length-1;this.currentLayer>=0;this.currentLayer--){const e=l[this.currentLayer],n=t.getLayerSourceCache(e);if(e.isSky())continue;const r=n?(e.is3D()?_:p)[n.id]:void 0;this._renderTileClippingMasks(e,n,r),this.renderLayer(this,n,e,r)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&b&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||e.a9(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isHorizonVisible()))for(this.currentLayer=0;this.currentLayer0&&e.hasShadowPass()&&0==--M&&(x.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer)){const e=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=e;this.currentLayer++){const e=l[this.currentLayer];if(!e.hasLightBeamPass())continue;const n=t.getLayerSourceCache(e);this.renderLayer(this,n,e,n?p[n.id]:void 0)}this.currentLayer=e,this.renderPass="translucent"}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const e=this.currentLayer;this.depthOcclusion=!0;for(const n of this.layersWithOcclusionOpacity){this.currentLayer=n;const e=l[this.currentLayer],r=t.getLayerSourceCache(e),i=r?p[r.id]:void 0;e.is3D()||this.terrain||this._renderTileClippingMasks(e,r,r?f[r.id]:void 0),this.renderLayer(this,r,e,i)}this.depthOcclusion=!1,this.currentLayer=e,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let n=null;l.forEach((e=>{const r=t.getLayerSourceCache(e);r&&!e.isHidden(this.transform.zoom)&&r.getVisibleCoordinates().length&&(!n||n.getSource().maxzoom0?t.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(e,t,n){const r=void 0===n?this.terrain&&this.terrain.renderingToTexture:n,i=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===e||"terrainRaster"===e?(i.push("LIGHTING_3D_MODE"),i.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):r||i.push("LIGHTING_3D_MODE")),"shadow"===this.renderPass?this._shadowMapDebug||i.push("DEPTH_TEXTURE"):this.shadowRenderer&&(this.shadowRenderer.useNormalOffset?i.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"):i.push("RENDER_SHADOWS","DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(i.push("TERRAIN"),this.linearFloatFilteringSupported()&&i.push("TERRAIN_DEM_FLOAT_FORMAT")),"globe"===this.transform.projection.name&&i.push("GLOBE"),!this._fogVisible||r||void 0!==t&&!t||i.push("FOG","FOG_DITHERING"),r&&i.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&i.push("OVERDRAW_INSPECTOR"),i}getOrCreateProgram(e,t){this.cache=this.cache||{};const n=t&&t.defines||[],r=t&&t.config,i=this.currentGlobalDefines(e,t&&t.overrideFog,t&&t.overrideRtt).concat(n),o=zi.cacheKey(Tr[e],e,i,r);return this.cache[o]||(this.cache[o]=new zi(this.context,e,Tr[e],r,co[e],i)),this.cache[o]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(t,n){if(this.style.enable3dLights()){const r=this.style.directionalLight,i=this.style.ambientLight;if(r&&i){const o=((t,n,r)=>{const i=t.properties.get("direction"),o=t.properties.get("color").toRenderColor(r.getLut(t.scope)).toArray01(),a=t.properties.get("intensity"),s=n.properties.get("color").toRenderColor(r.getLut(n.scope)).toArray01(),l=n.properties.get("intensity"),c=[i.x,i.y,i.z],u=e.cH(s,l),h=e.cH(o,a);return{u_lighting_ambient_color:u,u_lighting_directional_dir:c,u_lighting_directional_color:h,u_ground_radiance:Pi(c,h,u)}})(r,i,this.style);n.setLightsUniformValues(t,o)}}}uploadCommonUniforms(t,n,r,i,o){if(this.uploadCommonLightUniforms(t,n),this.terrain&&this.terrain.renderingToTexture)return;const a=this.style.fog;if(a){const o=a.getOpacity(this.transform.pitch),s=((t,n,r,i,o,a,s,l,c,u,h,d)=>{const f=t.transform,p=n.properties.get("color").toRenderColor(t.style.getLut(n.scope)).toArray01();p[3]=i;const m=t.frameCounter/1e3%1,[g,_]=n.properties.get("vertical-range");return{u_fog_matrix:r?f.calculateFogTileMatrix(r):d||t.identityMat,u_fog_range:n.getFovAdjustedRange(f._fov),u_fog_color:p,u_fog_horizon_blend:n.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(g,_),_],u_fog_temporal_offset:m,u_frustum_tl:o,u_frustum_tr:a,u_frustum_br:s,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:u,u_viewport:h,u_globe_transition:e.a9(f.zoom),u_is_globe:+("globe"===f.projection.name)}})(this,a,r,o,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*e.q.devicePixelRatio,this.transform.height*e.q.devicePixelRatio],i);n.setFogUniformValues(t,s)}o&&n.setCutoffUniformValues(t,o.uniformValues)}setTileLoadedFlag(e){this.tileLoaded=e}saveCanvasCopy(){const e=this.canvasCopy();e&&(this.frameCopies.push(e),this.tileLoaded=!1)}canvasCopy(){const e=this.context.gl,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,0,0,e.drawingBufferWidth,e.drawingBufferHeight,0),t}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const e=this.style&&this.style.fog;return!!e&&0!==e.getOpacity(this.transform.pitch)}getBackgroundTiles(){const e=this._backgroundTiles,t=this._backgroundTiles={},n=this.transform.coveringTiles({tileSize:512});for(const r of n)t[r.key]=e[r.key]||new pt(r,512,this.transform.tileZoom,this);return t}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(e,t){return!(!e.is3D()||"clip"!==e.type&&(e.minzoom&&e.minzoom>this.transform.zoom||(this.style._clipLayerPresent||"building"!==e.sourceLayer)&&(!t||"batched-model"!==t.type)))}isTileAffectedByFog(e){if(!this.style||!this.style.fog)return!1;if("globe"===this.transform.projection.name)return!0;let t=this._cachedTileFogOpacities[e.key];return t||(this._cachedTileFogOpacities[e.key]=t=this.style.fog.getOpacityForTile(e)),t[0]>=De||t[1]>=De}setupDepthForOcclusion(e,t,n){const r=this.context,i=r.gl,o=!!n;var a;n||(n={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),r.activeTexture.set(i.TEXTURE3),e&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(i.NEAREST,i.CLAMP_TO_EDGE),n.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],n.u_depth_range_unpack=[2/((a=this.depthRangeFor3D)[1]-a[0]),-1-2*a[0]/(a[1]-a[0])],n.u_occluder_half_size=.5*this.occlusionParams.occluderSize,n.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.emptyDepthTexture.bind(i.NEAREST,i.CLAMP_TO_EDGE),r.activeTexture.set(i.TEXTURE0),o||t.setTerrainUniformValues(r,n)}}function Ma(e,t){let n=!1,r=null;const i=()=>{r=null,n&&(e(),r=setTimeout(i,t),n=!1)};return()=>(n=!0,r||i(),r)}class Aa{constructor(t){this._hashName=t&&encodeURIComponent(t),e.aJ(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Ma(this._updateHashUnthrottled.bind(this),300)}addTo(e){return this._map=e,window.addEventListener("hashchange",this._onHashChange,!1),e.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const e=this._map;if(!e)return"";const t=Ea(e);if(this._hashName){const e=this._hashName;let n=!1;const r=location.hash.slice(1).split("&").map((r=>{const i=r.split("=")[0];return i===e?(n=!0,`${i}=${t}`):r})).filter((e=>e));return n||r.push(`${e}=${t}`),`#${r.join("&")}`}return`#${t}`}_getCurrentHash(){const e=location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((e=>e.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e)})),(t&&t[1]||"").split("/")}return e.split("/")}_onHashChange(){const e=this._map;if(!e)return!1;const t=this._getCurrentHash();if(t.length>=3&&!t.some((e=>isNaN(e)))){const n=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(t[3]||0):e.getBearing();return e.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:n,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(/(#.+)?$/,this.getHashString()))}}function Ea(e,t){const n=e.getCenter(),r=Math.round(100*e.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,i),a=Math.round(n.lng*o)/o,s=Math.round(n.lat*o)/o,l=e.getBearing(),c=e.getPitch();let u=t?`/${a}/${s}/${r}`:`${r}/${s}/${a}`;return(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+=`/${Math.round(c)}`),u}const Ta={linearity:.3,easing:e.dp(0,0,.3,1)},Ca=e.l({deceleration:2500,maxSpeed:1400},Ta),ka=e.l({deceleration:20,maxSpeed:1400},Ta),Ia=e.l({deceleration:1e3,maxSpeed:360},Ta),Pa=e.l({deceleration:1e3,maxSpeed:90},Ta);class Ra{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.q.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=e.q.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)n.zoom+=e.zoomDelta||0,n.bearing+=e.bearingDelta||0,n.pitch+=e.pitchDelta||0,e.panDelta&&n.pan._add(e.panDelta),e.around&&(n.around=e.around),e.pinchAround&&(n.pinchAround=e.pinchAround);const r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(n.pan.mag()){const o=za(n.pan.mag(),r,e.l({},Ca,t||{}));i.offset=n.pan.mult(o.amount/n.pan.mag()),i.center=this._map.transform.center,La(i,o)}if(n.zoom){const e=za(n.zoom,r,ka);i.zoom=this._map.transform.zoom+e.amount,La(i,e)}if(n.bearing){const t=za(n.bearing,r,Ia);i.bearing=this._map.transform.bearing+e.ap(t.amount,-179,179),La(i,t)}if(n.pitch){const e=za(n.pitch,r,Pa);i.pitch=this._map.transform.pitch+e.amount,La(i,e)}if(i.zoom||i.bearing){const e=void 0===n.pinchAround?n.around:n.pinchAround;i.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),i.noMoveStart=!0,i}}function La(e,t){(!e.duration||e.duration3&&void 0!==arguments[3]?arguments[3]:{};const o=_(n.getCanvasContainer(),r),a=n.unproject(o);super(t,e.l({point:o,lngLat:a,originalEvent:r},i)),this._defaultPrevented=!1,this.target=n}}class Oa extends e.x{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,r){const i="touchend"===t?r.changedTouches:r.touches,o=y(n.getCanvasContainer(),i),a=o.map((e=>n.unproject(e))),s=o.reduce(((e,t,n,r)=>e.add(t.div(r.length))),new e.P(0,0));super(t,{points:o,point:s,lngLats:a,lngLat:n.unproject(s),originalEvent:r}),this._defaultPrevented=!1}}class Fa extends e.x{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1}}class Ba{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._mousedownPos=void 0}wheel(e){return this._firePreventable(new Fa(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new Da(e.type,this._map,e))}mouseup(e){this._map.fire(new Da(e.type,this._map,e))}preclick(t){const n=e.l({},t);n.type="preclick",this._map.fire(new Da(n.type,this._map,n))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||(this.preclick(e),this._map.fire(new Da(e.type,this._map,e)))}dblclick(e){return this._firePreventable(new Da(e.type,this._map,e))}mouseover(e){this._map.fire(new Da(e.type,this._map,e))}mouseout(e){this._map.fire(new Da(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Oa(e.type,this._map,e))}touchmove(e){this._map.fire(new Oa(e.type,this._map,e))}touchend(e){this._map.fire(new Oa(e.type,this._map,e))}touchcancel(e){this._map.fire(new Oa(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Na{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(e){this._map.fire(new Da(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Da("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new Da(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ja{constructor(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(f(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const n=t,r=this._startPos,i=this._lastPos;if(!r||!i||i.equals(n)||!this._box&&n.dist(r){this._box&&(this._box.style.transform=`translate(${o}px,${s}px)`,this._box.style.width=a-o+"px",this._box.style.height=c-s+"px")}))}mouseupWindow(t,n){if(!this._active)return;const r=this._startPos,i=n;if(r&&0===t.button){if(this.reset(),g(),r.x!==i.x||r.y!==i.y)return this._map.fire(new e.x("boxzoomend",{originalEvent:t})),{cameraAnimation:e=>e.fitScreenCoordinates(r,i,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),p(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new e.x(t,{originalEvent:n}))}}function Va(e,t){const n={};for(let r=0;rthis.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){const n=new e.P(0,0);for(const e of t)n._add(e);return n.div(t.length)}(n),this.touches=Va(r,n)))}touchmove(e,t,n){if(this.aborted||!this.centroid)return;const r=Va(n,t);for(const i in this.touches){const e=r[i];(!e||e.dist(this.touches[i])>30)&&(this.aborted=!0)}}touchend(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class $a{constructor(e){this.singleTap=new Ua(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(e,t,n){this.singleTap.touchstart(e,t,n)}touchmove(e,t,n){this.singleTap.touchmove(e,t,n)}touchend(e,t,n){const r=this.singleTap.touchend(e,t,n);if(r){const t=e.timeStamp-this.lastTime<500,n=!this.lastTap||this.lastTap.dist(r)<30;if(t&&n||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class Ga{constructor(){this._zoomIn=new $a({numTouches:1,numTaps:2}),this._zoomOut=new $a({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)}touchmove(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)}touchend(e,t,n){const r=this._zoomIn.touchend(e,t,n),i=this._zoomOut.touchend(e,t,n);return r?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(r)},{originalEvent:e})}):i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(i)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const qa={0:1,2:2};class Wa{constructor(e){this.reset(),this._clickTolerance=e.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(e,t){return!1}_move(e,t){return{}}mousedown(e,t){if(this._lastPoint)return;const n=v(e);this._correctButton(e,n)&&(this._lastPoint=t,this._eventButton=n)}mousemoveWindow(e,t){const n=this._lastPoint;if(n)if(e.preventDefault(),null!=this._eventButton&&function(e,t){const n=qa[t];return void 0===e.buttons||(e.buttons&n)!==n}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(n)0&&(this._active=!0);const i=Va(r,n),o=new e.P(0,0),a=new e.P(0,0);let s=0;for(const e in i){const t=i[e],n=this._touches[e];n&&(o._add(t),a._add(t.sub(n)),s++,i[e]=t)}if(this._touches=i,s{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")}),500)}}class Ka{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(e){}_move(e,t,n){return{}}touchstart(e,t,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,n){const r=this._firstTwoTouches;if(!r)return;e.preventDefault();const[i,o]=r,a=Ja(n,t,i),s=Ja(n,t,o);if(!a||!s)return;const l=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],l,e)}touchend(e,t,n){if(!this._firstTwoTouches)return;const[r,i]=this._firstTwoTouches,o=Ja(n,t,r),a=Ja(n,t,i);o&&a||(this._active&&g(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Ja(e,t,n){for(let r=0;rMath.abs(e.x)}class is extends Ka{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(e){this._lastPoints=e,rs(e[0].sub(e[1]))&&(this._valid=!1)}_move(t,n,r){const i=this._lastPoints;if(!i)return;const o=t[0].sub(i[0]),a=t[1].sub(i[1]);return this._map._cooperativeGestures&&!e.dq()&&r.touches.length<3||(this._valid=this.gestureBeginsVertically(o,a,r.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(o.y+a.y)/2*-.5})}gestureBeginsVertically(e,t,n){if(void 0!==this._valid)return this._valid;const r=e.mag()>=2,i=t.mag()>=2;if(!r&&!i)return;if(!r||!i)return null==this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;const o=e.y>0==t.y>0;return rs(e)&&rs(t)&&o}}const os={panStep:100,bearingStep:15,pitchStep:10};class as{constructor(){const e=os;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,n=0,r=0,i=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?r=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?r=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,r=0),{cameraAnimation:a=>{const s=a.getZoom();a.easeTo({duration:300,easeId:"keyboardHandler",easing:ss,zoom:t?Math.round(s)+t*(e.shiftKey?2:1):s,bearing:a.getBearing()+n*this._bearingStep,pitch:a.getPitch()+r*this._pitchStep,offset:[-i*this._panStep,-o*this._panStep],center:a.getCenter()},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function ss(e){return e*(2-e)}const ls=4.000244140625,cs=1/450;class us{constructor(t,n){this._map=t,this._el=t.getCanvasContainer(),this._handler=n,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=cs,e.aJ(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||e.dq()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const r=e.q.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==n&&n%ls==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=n,this._timeout=window.setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_onTimeout(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const t=_(this._el,e);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:t,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._map.transform;"wheel"===this._type&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const n=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>ls?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==r&&(r=1/r);const i=n(),o=Math.pow(2,i),a="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):o;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(a*r))),"wheel"===this._type&&(this._startZoom=i,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const r="number"==typeof this._targetZoom?this._targetZoom:n(),i=this._startZoom,o=this._easing;let a,s=!1;if("wheel"===this._type&&i&&o){const t=Math.min((e.q.now()-this._lastWheelEventTime)/200,1),n=o(t);a=e.aa(i,r,n),t<1?this._frameId||(this._frameId=!0):s=!0}else a=r,s=!0;this._active=!0,s&&(this._active=!1,this._finishTimeout=window.setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200));let l=a-n();return l*this._lastDelta<0&&(l=0),{noInertia:!0,needsRenderFrame:!s,zoomDelta:l,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=e.dr;if(this._prevEase){const t=this._prevEase,r=(e.q.now()-t.start)/t.duration,i=t.easing(r+.01)-t.easing(r),o=.27/Math.sqrt(i*i+1e-4)*.01,a=Math.sqrt(.0729-o*o);n=e.dp(o,a,.25,1)}return this._prevEase={start:e.q.now(),duration:t,easing:n},n}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=l("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")}),200)}}class hs{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class ds{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(e,t){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:n.getZoom()+(e.shiftKey?-1:1),around:n.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class fs{constructor(){this._tap=new $a({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(e,t,n){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=t[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(e,t,n))}touchmove(e,t,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;const r=t[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,n)}touchend(e,t,n){this._tapTime?this._swipePoint&&0===n.length&&this.reset():this._tap.touchend(e,t,n)&&(this._tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ps{constructor(e,t,n){this._el=e,this._mousePan=t,this._touchPan=n}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ms{constructor(e,t,n){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=n}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class gs{constructor(e,t,n,r){this._el=e,this._touchZoom=t,this._touchRotate=n,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const _s=e=>e.zoom||e.drag||e.pitch||e.rotate;class ys extends e.x{}class vs{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,n){const r=e.a6.vec3.sub([],n,t);this.radius=e.a6.vec3.length(r[2]<0?e.a6.vec3.div([],r,this.constants):[r[0],r[1],0])}projectRay(t){e.a6.vec3.div(t,t,this.constants),e.a6.vec3.normalize(t,t),e.a6.vec3.mul(t,t,this.constants);const n=e.a6.vec3.scale([],t,this.radius);if(n[2]>0){const t=e.a6.vec3.scale([],[0,0,1],e.a6.vec3.dot(n,[0,0,1])),r=e.a6.vec3.scale([],e.a6.vec3.normalize([],[n[0],n[1],0]),this.radius),i=e.a6.vec3.add([],n,e.a6.vec3.scale([],e.a6.vec3.sub([],e.a6.vec3.add([],r,t),n),2));n[0]=i[0],n[1]=i[1]}return n}}function xs(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class bs{constructor(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ra(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new vs,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(n),e.aJ(["handleEvent","handleWindowEvent"],this);const r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(const[e,i,o]of this._listeners){const t=e===document?this.handleWindowEvent:this.handleEvent;e.addEventListener(i,t,o)}}destroy(){for(const[e,t,n]of this._listeners){const r=e===document?this.handleWindowEvent:this.handleEvent;e.removeEventListener(t,r,n)}}_addDefaultHandlers(e){const t=this._map,n=t.getCanvasContainer();this._add("mapEvent",new Ba(t,e));const r=t.boxZoom=new ja(t,e);this._add("boxZoom",r);const i=new Ga,o=new ds;t.doubleClickZoom=new hs(o,i),this._add("tapZoom",i),this._add("clickZoom",o);const a=new fs;this._add("tapDragZoom",a);const s=t.touchPitch=new is(t);this._add("touchPitch",s);const l=new Za(e),c=new Ya(e);t.dragRotate=new ms(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const u=new Ha(e),h=new Xa(t,e);t.dragPan=new ps(n,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);const d=new ns,f=new es;t.touchZoomRotate=new gs(n,f,d,a),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Na(t));const p=t.scrollZoom=new us(t,this);this._add("scrollZoom",p,["mousePan"]);const m=t.keyboard=new as;this._add("keyboard",m);for(const g of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[g]&&t[g].enable(e[g])}_add(e,t,n){this._handlers.push({handlerName:e,handler:t,allowed:n}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!_s(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(e,t,n){for(const r in e)if(r!==n&&(!t||t.indexOf(r)<0))return!0;return!1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`)}_getMapTouches(e){const t=[];for(const n of e)this._el.contains(n.target)&&t.push(n);return t}handleEvent(e,t){this._updatingCamera=!0;const n="renderFrame"===e.type,r=n?void 0:e,i={needsRenderFrame:!1},o={},a={},s=e.touches?this._getMapTouches(e.touches):void 0,l=s?y(this._el,s):n?void 0:_(this._el,e);for(const{handlerName:h,handler:d,allowed:f}of this._handlers){if(!d.isEnabled())continue;let n;this._blockedByActive(a,f,h)?d.reset():d[t||e.type]&&(n=d[t||e.type](e,l,s),this.mergeHandlerResult(i,o,n,h,r),n&&n.needsRenderFrame&&this._triggerRenderFrame()),(n||d.isActive())&&(a[h]=d)}const c={};for(const h in this._previousActiveHandlers)a[h]||(c[h]=r);this._previousActiveHandlers=a,(Object.keys(c).length||xs(i))&&(this._changes.push([i,o,c]),this._triggerRenderFrame()),(Object.keys(a).length||xs(i))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:u}=i;u&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))}mergeHandlerResult(t,n,r,i,o){if(!r)return;e.l(t,r);const a={handlerName:i,originalEvent:r.originalEvent||o};void 0!==r.zoomDelta&&(n.zoom=a),void 0!==r.panDelta&&(n.drag=a),void 0!==r.pitchDelta&&(n.pitch=a),void 0!==r.bearingDelta&&(n.rotate=a)}_applyChanges(){const t={},n={},r={};for(const[i,o,a]of this._changes)i.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(i.panDelta)),i.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(t.around=i.around),void 0!==i.aroundCoord&&(t.aroundCoord=i.aroundCoord),void 0!==i.pinchAround&&(t.pinchAround=i.pinchAround),i.noInertia&&(t.noInertia=i.noInertia),e.l(n,o),e.l(r,a);this._updateMapTransform(t,n,r),this._changes=[]}_updateMapTransform(t,n,r){const i=this._map,o=i.transform,a=e=>[e.x,e.y,e.z];if((()=>{const e=this._eventsInProgress.drag;return e&&!this._handlersById[e.handlerName].isActive()})()&&!xs(t)){const e=o.zoom;o.cameraElevationReference="sea",null!=this._originalZoom&&o._orthographicProjectionAtLowPitch&&"globe"!==o.projection.name&&0===o.pitch?(o.cameraElevationReference="ground",o.zoom=this._originalZoom):(o.recenterOnTerrain(),o.cameraElevationReference="ground"),e!==o.zoom&&this._map._update(!0)}if(o._isCameraConstrained&&i._stop(!0),!xs(t))return void this._fireEvents(n,r,!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:u,around:h,aroundCoord:d,pinchAround:f}=t;o._isCameraConstrained&&(l>0&&(l=0),o._isCameraConstrained=!1),void 0!==f&&(h=f),(l||(e=>n[e]&&!this._eventsInProgress[e])("drag"))&&h&&(this._dragOrigin=a(o.pointCoordinate3D(h)),this._originalZoom=o.zoom,this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",i._stop(!0),h=h||i.transform.centerPoint,c&&(o.bearing+=c),u&&(o.pitch+=u),o._updateCameraState();const p=[0,0,0];if(s)if("mercator"===o.projection.name){const e=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h).dir),t=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h.sub(s)).dir);p[0]=t[0]-e[0],p[1]=t[1]-e[1]}else{const t=o.pointCoordinate(h);if("globe"===o.projection.name){s=s.rotate(-o.angle);const n=o._pixelsPerMercatorPixel/o.worldSize;p[0]=-s.x*e.ds(e.aM(t.y))*n,p[1]=-s.y*e.ds(o.center.lat)*n}else{const e=o.pointCoordinate(h.sub(s));t&&e&&(p[0]=e.x-t.x,p[1]=e.y-t.y)}}const m=o.zoom,g=[0,0,0];if(l){const t=a(d||o.pointCoordinate3D(h)),n={dir:e.a6.vec3.normalize([],e.a6.vec3.sub([],t,o._camera.position))};if(n.dir[2]<0){const r=o.zoomDeltaToMovement(t,l);e.a6.vec3.scale(g,n.dir,r)}}const _=e.a6.vec3.add(p,p,g);o._translateCameraConstrained(_),l&&Math.abs(o.zoom-m)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,r,!0)}_fireEvents(t,n,r){const i=_s(this._eventsInProgress),o=_s(t),a={};for(const e in t){const{originalEvent:n}=t[e];this._eventsInProgress[e]||(a[`${e}start`]=n),this._eventsInProgress[e]=t[e]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in a)this._fireEvent(e,a[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:n}=t[e];this._fireEvent(e,n)}const s={};let l;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:r}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=n[t]||r,s[`${e}end`]=l)}for(const e in s)this._fireEvent(e,s[e]);const c=_s(this._eventsInProgress);if(r&&(i||o)&&!c){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),n=e=>0!==e&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new ys("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const ws="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Ss extends e.E{constructor(t,n){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,this._respectPrefersReducedMotion=!1!==n.respectPrefersReducedMotion,e.aJ(["_renderFrameCallback"],this)}getCenter(){return new e.bK(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,n,r){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.l({offset:t},n),r)}panTo(t,n,r){return this.easeTo(e.l({center:t},n),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(t,n,r){return this.easeTo(e.l({zoom:t},n),r)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(t,n,r){return this.easeTo(e.l({bearing:t},n),r)}resetNorth(t,n){return this.rotateTo(0,e.l({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(e.l({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(e,t){return Math.abs(this.getBearing())e.aspect?n/(2*Math.tan(.5*e.fovX)*e.aspect):r/(2*Math.tan(.5*e.fovY)*e.aspect)}_cameraForBoundsOnGlobe(t,n,r,i,o,a){const s=t.clone(),l=this._extendCameraOptions(a);s.bearing=i,s.pitch=o;const c=e.bK.convert(n),u=e.bK.convert(r),h=.5*(c.lat+u.lat),d=.5*(c.lng+u.lng),f=e.dt(h,d),p=e.a6.vec3.normalize([],f),m=e.a6.vec3.normalize([],e.a6.vec3.cross([],p,[0,1,0])),g=e.a6.vec3.cross([],m,p),_=[m[0],m[1],m[2],0,g[0],g[1],g[2],0,p[0],p[1],p[2],0,0,0,0,1],y=[f,e.dt(c.lat,c.lng),e.dt(u.lat,c.lng),e.dt(u.lat,u.lng),e.dt(c.lat,u.lng),e.dt(h,c.lng),e.dt(h,u.lng),e.dt(c.lat,d),e.dt(u.lat,d)];let v=e.c9.fromPoints(y.map((t=>[e.a6.vec3.dot(m,t),e.a6.vec3.dot(g,t),e.a6.vec3.dot(p,t)])));const x=e.a6.vec3.transformMat4([],v.center,_);0===e.a6.vec3.squaredLength(x)&&e.a6.vec3.set(x,0,0,1),e.a6.vec3.normalize(x,x),e.a6.vec3.scale(x,x,e.aq),s.center=e.du(x);const b=s.getWorldToCameraMatrix(),w=e.a6.mat4.invert(new Float64Array(16),b);v=e.c9.applyTransform(v,e.a6.mat4.multiply([],b,_));const S=this._extendAABB(v,s,l,i);if(!S)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");v=S,e.a6.vec3.transformMat4(x,x,b);const M=.5*(v.max[2]-v.min[2]),A=this._minimumAABBFrustumDistance(s,v),E=e.a6.vec3.scale([],[0,0,1],M),T=e.a6.vec3.add(E,x,E),C=A+(0===s.pitch?0:e.a6.vec3.distance(x,T)),k=s.globeCenterInViewSpace,I=e.a6.vec3.sub([],x,[k[0],k[1],k[2]]);e.a6.vec3.normalize(I,I),e.a6.vec3.scale(I,I,C);const P=e.a6.vec3.add([],x,I);e.a6.vec3.transformMat4(P,P,w);const R=e.dw/e.aq,L=e.a6.vec3.length(P),z=e.bD(Math.max(L*R-e.dw,Number.EPSILON),0),D=Math.min(s.zoomFromMercatorZAdjusted(z),l.maxZoom);return D>.5*(e.c2+e.bU)?(s.setProjection({name:"mercator"}),s.zoom=D,this._cameraForBounds(s,n,r,i,o,a)):{center:s.center,zoom:D,bearing:i,pitch:o}}_extendAABB(t,n,r,i){const o=.5*((r.padding.left||0)+(r.padding.right||0)),a=.5*((r.padding.top||0)+(r.padding.bottom||0)),s=a,l=o,c=o,u=a,h=n.width-(l+c),d=n.height-(s+u),f=e.a6.vec3.sub([],t.max,t.min),p=Math.min(h/f[0],d/f[1]),m=Math.min(n.scaleZoom(n.scale*p),r.maxZoom);if(isNaN(m))return null;const g=n.scale/n.zoomScale(m),_=new e.c9([t.min[0]-l*g,t.min[1]-u*g,t.min[2]],[t.max[0]+c*g,t.max[1]+s*g,t.max[2]]),y=("number"==typeof r.offset.x&&"number"==typeof r.offset.y?new e.P(r.offset.x,r.offset.y):e.P.convert(r.offset)).rotate(-e.bB(i));return _.center[0]-=y.x*g,_.center[1]+=y.y*g,_}queryTerrainElevation(t,n){const r=this.transform.elevation;return r?(n=e.l({},{exaggerated:!0},n),r.getAtPoint(e.a5.fromLngLat(t),null,n.exaggerated)):null}_cameraForBounds(t,n,r,i,o,a){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,n,r,i,o,a);const s=t.clone(),l=this._extendCameraOptions(a);s.bearing=i,s.pitch=o;const c=e.bK.convert(n),u=e.bK.convert(r),h=new e.bK(c.lng,u.lat),d=new e.bK(u.lng,c.lat),f=s.project(c),p=s.project(u),m=this.queryTerrainElevation(c),g=this.queryTerrainElevation(u),_=this.queryTerrainElevation(h),y=this.queryTerrainElevation(d),v=[[f.x,f.y,Math.min(m||0,g||0,_||0,y||0)],[p.x,p.y,Math.max(m||0,g||0,_||0,y||0)]];let x=e.c9.fromPoints(v);const b=s.getWorldToCameraMatrix(),w=e.a6.mat4.invert(new Float64Array(16),b);x=e.c9.applyTransform(x,b);const S=this._extendAABB(x,s,l,i);if(!S)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");x=S;const M=.5*e.a6.vec3.sub([],x.max,x.min)[2],A=this._minimumAABBFrustumDistance(s,x),E=[0,0,1,0];e.a6.vec4.transformMat4(E,E,b),e.a6.vec4.normalize(E,E);const T=e.a6.vec3.scale([],E,A+M),C=e.a6.vec3.add([],x.center,T);e.a6.vec3.transformMat4(x.center,x.center,w),e.a6.vec3.transformMat4(C,C,w);const k=s.unproject(new e.P(x.center[0],x.center[1])),I=e.dv(s.projection,k),P=Math.pow(2,I),R=Math.min(s._zoomFromMercatorZ(C[2]*s.pixelsPerMeter*P/s.worldSize),l.maxZoom);return s.mercatorFromTransition&&R<.5*(e.c2+e.bU)?(s.setProjection({name:"globe"}),s.zoom=R,this._cameraForBounds(s,n,r,i,o,a)):{center:k,zoom:R,bearing:i,pitch:o}}fitBounds(e,t,n){const r=this.cameraForBounds(e,t);return this._fitInternal(r,t,n)}fitScreenCoordinates(t,n,r,i,o){const a=e.P.convert(t),s=e.P.convert(n),l=new e.P(Math.min(a.x,s.x),Math.min(a.y,s.y)),c=new e.P(Math.max(a.x,s.x),Math.max(a.y,s.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(a,s))return this;const u=this.transform.pointLocation3D(l),h=this.transform.pointLocation3D(c),d=this.transform.pointLocation3D(new e.P(l.x,c.y)),f=this.transform.pointLocation3D(new e.P(c.x,l.y)),p=[Math.min(u.lng,h.lng,d.lng,f.lng),Math.min(u.lat,h.lat,d.lat,f.lat)],m=[Math.max(u.lng,h.lng,d.lng,f.lng),Math.max(u.lat,h.lat,d.lat,f.lat)],g=i&&i.pitch?i.pitch:this.getPitch(),_=this._cameraForBounds(this.transform,p,m,r,g,i);return this._fitInternal(_,i,o)}_fitInternal(t,n,r){return t?(n=e.l(t,n)).linear?this.easeTo(n,r):this.flyTo(n,r):this}jumpTo(t,n){this.stop();const r=t.preloadOnly?this.transform.clone():this.transform;let i=!1,o=!1,a=!1;"zoom"in t&&r.zoom!==+t.zoom&&(i=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=e.bK.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(o=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(a=!0,r.pitch=+t.pitch);const s="number"==typeof t.padding?this._extendPadding(t.padding):t.padding;if(null!=t.padding&&!r.isPaddingEqual(s))if(!1===t.retainPadding){const e=r.clone();e.padding=s,r.setLocationAtPoint(r.center,e.centerPoint)}else r.padding=s;return t.preloadOnly?(this._preloadTiles(r),this):(this.fire(new e.x("movestart",n)).fire(new e.x("move",n)),i&&this.fire(new e.x("zoomstart",n)).fire(new e.x("zoom",n)).fire(new e.x("zoomend",n)),o&&this.fire(new e.x("rotatestart",n)).fire(new e.x("rotate",n)).fire(new e.x("rotateend",n)),a&&this.fire(new e.x("pitchstart",n)).fire(new e.x("pitch",n)).fire(new e.x("pitchend",n)),this.fire(new e.x("moveend",n)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||e.w(ws),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,n){const r=this.transform;if(!r.projection.supportsFreeCamera)return e.w(ws),this;this.stop();const i=r.zoom,o=r.pitch,a=r.bearing;r.setFreeCameraOptions(t);const s=i!==r.zoom,l=o!==r.pitch,c=a!==r.bearing;return this.fire(new e.x("movestart",n)).fire(new e.x("move",n)),s&&this.fire(new e.x("zoomstart",n)).fire(new e.x("zoom",n)).fire(new e.x("zoomend",n)),c&&this.fire(new e.x("rotatestart",n)).fire(new e.x("rotate",n)).fire(new e.x("rotateend",n)),l&&this.fire(new e.x("pitchstart",n)).fire(new e.x("pitch",n)).fire(new e.x("pitchend",n)),this.fire(new e.x("moveend",n)),this}easeTo(t,n){this._stop(!1,t.easeId),(!1===(t=e.l({offset:[0,0],duration:500,easing:e.dr},t)).animate||this._prefersReducedMotion(t))&&(t.duration=0);const r=this.transform,i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?+t.zoom:i,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,h=this._extendPadding(t.padding),d=e.P.convert(t.offset);let f,p,m;if("globe"===r.projection.name){const n=e.a5.fromLngLat(r.center),i=d.rotate(-r.angle);n.x+=i.x/r.worldSize,n.y+=i.y/r.worldSize;const o=n.toLngLat(),a=e.bK.convert(t.center||o);this._normalizeCenter(a),f=r.centerPoint.add(i),p=new e.P(n.x,n.y).mult(r.worldSize),m=new e.P(e.am(a.lng),e.at(a.lat)).mult(r.worldSize).sub(p)}else{f=r.centerPoint.add(d);const n=r.pointLocation(f),i=e.bK.convert(t.center||n);this._normalizeCenter(i),p=r.project(n),m=r.project(i).sub(p)}const g=r.zoomScale(l-i);let _,y;t.around&&(_=e.bK.convert(t.around),y=r.locationPoint(_));const v=this._zooming||l!==i,x=this._rotating||o!==c,b=this._pitching||u!==a,w=!r.isPaddingEqual(h),S=!1===t.retainPadding?r.clone():r,M=r=>M=>{if(v&&(r.zoom=e.aa(i,l,M)),x&&(r.bearing=e.aa(o,c,M)),b&&(r.pitch=e.aa(a,u,M)),w&&(S.interpolatePadding(s,h,M),f=S.centerPoint.add(d)),_)r.setLocationAtPoint(_,y);else{const e=r.zoomScale(r.zoom-i),t=l>i?Math.min(2,g):Math.max(.5,g),n=Math.pow(t,1-M),o=r.unproject(p.add(m.mult(M*n)).mult(e));r.setLocationAtPoint(r.renderWorldCopies?o.wrap():o,f)}return t.preloadOnly||this._fireMoveEvents(n),r};if(t.preloadOnly){const e=this._emulate(M,t.duration,r);return this._preloadTiles(e),this}const A={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=v,this._rotating=x,this._pitching=b,this._padding=w,this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,A),this._ease(M(r),(e=>{"sea"===r.cameraElevationReference&&r.recenterOnTerrain(),this._afterEase(n,e)}),t),this}_prepareEase(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),n||r.moving||this.fire(new e.x("movestart",t)),this._zooming&&!r.zooming&&this.fire(new e.x("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new e.x("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new e.x("pitchstart",t))}_fireMoveEvents(t){this.fire(new e.x("move",t)),this._zooming&&this.fire(new e.x("zoom",t)),this._rotating&&this.fire(new e.x("rotate",t)),this._pitching&&this.fire(new e.x("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const r=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new e.x("zoomend",t)),i&&this.fire(new e.x("rotateend",t)),o&&this.fire(new e.x("pitchend",t)),this.fire(new e.x("moveend",t))}flyTo(t,n){if(this._prefersReducedMotion(t)){const r=e.ar(t,["center","zoom","bearing","pitch","around","padding","retainPadding"]);return this.jumpTo(r,n)}this.stop(),t=e.l({offset:[0,0],speed:1.2,curve:1.42,easing:e.dr},t);const r=this.transform,i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?e.ap(+t.zoom,r.minZoom,r.maxZoom):i,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,h=this._extendPadding(t.padding),d=r.zoomScale(l-i),f=e.P.convert(t.offset);let p=r.centerPoint.add(f);const m=r.pointLocation(p),g=e.bK.convert(t.center||m);this._normalizeCenter(g);const _=r.project(m),y=r.project(g).sub(_);let v=t.curve;const x=Math.max(r.width,r.height),b=x/d,w=y.mag();if("minZoom"in t){const n=e.ap(Math.min(t.minZoom,i,l),r.minZoom,r.maxZoom),o=x/r.zoomScale(n-i);v=Math.sqrt(o/w*2)}const S=v*v;function M(e){const t=(b*b-x*x+(e?-1:1)*S*S*w*w)/(2*(e?b:x)*S*w);return Math.log(Math.sqrt(t*t+1)-t)}function A(e){return(Math.exp(e)-Math.exp(-e))/2}function E(e){return(Math.exp(e)+Math.exp(-e))/2}const T=M(0);let C=function(e){return E(T)/E(T+v*e)},k=function(e){return x*((E(T)*(A(t=T+v*e)/E(t))-A(T))/S)/w;var t},I=(M(1)-T)/v;if(Math.abs(w)<1e-6||!isFinite(I)){if(Math.abs(x-b)<1e-6)return this.easeTo(t,n);const e=bt.maxDuration&&(t.duration=0);const P=o!==c,R=u!==a,L=!r.isPaddingEqual(h),z=!1===t.retainPadding?r.clone():r,D=r=>d=>{const m=d*I,v=1/C(m);r.zoom=1===d?l:i+r.scaleZoom(v),P&&(r.bearing=e.aa(o,c,d)),R&&(r.pitch=e.aa(a,u,d)),L&&(z.interpolatePadding(s,h,d),p=z.centerPoint.add(f));const x=1===d?g:r.unproject(_.add(y.mult(k(m))).mult(v));return r.setLocationAtPoint(r.renderWorldCopies?x.wrap():x,p),r._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(n),r};if(t.preloadOnly){const e=this._emulate(D,t.duration,r);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=P,this._pitching=R,this._padding=L,this._prepareEase(n,!1),this._ease(D(r),(()=>this._afterEase(n)),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(e){}_cancelRenderFrame(e){}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const e=this._onEaseEnd;this._onEaseEnd=void 0,e.call(this,t)}if(!e){const e=this.handlers;e&&e.stop(!1)}return this}_ease(t,n,r){!1===r.animate||0===r.duration?(t(1),n()):(this._easeStart=e.q.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((e.q.now()-this._easeStart)/this._easeOptions.duration,1),n=this._onEaseFrame;n&&n(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,n){t=e.bA(t,-180,180);const r=Math.abs(t-n);return Math.abs(t-360-n)180?-360:n<-180?360:0}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&e.q.prefersReducedMotion&&!(t&&t.essential)}_emulate(e,t,n){const r=Math.ceil(15*t/1e3),i=[],o=e(n.clone());for(let a=0;a<=r;a++){const e=o(a/r);i.push(e.clone())}return i}_preloadTiles(e,t){}}class Ms{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t,e.aJ(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(e){const t=this.options&&this.options.compact,n=e._getUIString("AttributionControl.ToggleAttribution");this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=l("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",n);const r=l("span","mapboxgl-ctrl-icon",this._compactButton);return r.setAttribute("aria-hidden","true"),r.setAttribute("title",n),this._innerContainer=l("div","mapboxgl-ctrl-attrib-inner",this._container),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));const n=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.e.ACCESS_TOKEN}];if(t){const r=n.reduce(((e,t,r)=>(t.value&&(e+=`${t.key}=${t.value}${re.length-t.length)),e=e.filter(((t,n)=>{for(let r=n+1;r=0)return!1;return!0})),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=[...this.options.customAttribution,...e]:e.unshift(this.options.customAttribution));const n=e.join(" | ");n!==this._attribHTML&&(this._attribHTML=n,e.length?(this._innerContainer.innerHTML=n,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class As{constructor(){e.aJ(["_updateLogo","_updateCompact"],this)}onAdd(e){this._map=e,this._container=l("div","mapboxgl-ctrl");const t=l("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const e=this._map.style._sourceCaches;if(0===Object.entries(e).length)return!0;for(const t in e){const n=e[t].getSource();if(n.hasOwnProperty("mapbox_logo")&&!n.mapbox_logo)return!1}return!0}_updateCompact(){const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}}}class Es{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,n=t?this._queue.concat(t):this._queue;for(const r of n)if(r.id===e)return void(r.cancelled=!0)}run(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const t=this._currentlyRunning=this._queue;this._queue=[];for(const n of t)if(!n.cancelled&&(n.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}class Ts{constructor(e){this.jumpTo(e)}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const n=e.cw((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-n)+this._end*n}isEasing(e){return e>=this._startTime&&e<=this._endTime}jumpTo(e){this._startTime=-1/0,this._endTime=-1/0,this._start=e,this._end=e}easeTo(e,t,n){this._start=this.getValue(t),this._end=e,this._startTime=t,this._endTime=t+n}}const Cs={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use \u2318 + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class ks{registerParameter(){}registerButton(){}registerBinding(){}refreshUI(){}}class Is{constructor(e){this.map=e,this.interactionsByType=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this)}add(t,n){if(this.typeById.has(t))throw new Error(`Interaction id "${t}" already exists.`);const{type:r,filter:i}=n;if(i){const n=e.M(i,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===n.result)throw new Error(n.value.map((e=>`${e.key}: ${e.message}`)).join(", "));this.filters.set(t,n.value)}const o=this.interactionsByType.get(r)||new Map;0===o.size&&(this.map.on(r,this.handleType),this.interactionsByType.set(r,o)),o.set(t,n),this.typeById.set(t,r)}remove(e){const t=this.typeById.get(e);if(!t)return;this.typeById.delete(e),this.filters.delete(e);const n=this.interactionsByType.get(t);n&&(n.delete(e),0===n.size&&this.map.off(t,this.handleType))}handleType(e){const t=e.features||this.map.queryRenderedFeatures(e.point);if(!t)return;const n=this.interactionsByType.get(e.type),r={zoom:0};for(const[i,o]of n){const e=this.filters.get(i),{handler:n,layers:a}=o;for(const s of t)if((!a||a.includes(s.layer.id))&&(!e||e.evaluate(r,s))&&!1!==n({id:i,feature:s,interaction:o}))break}}}const Ps={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0},Rs={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ls{constructor(t,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._clickTolerance=10,this.element=n,this.mouseRotate=new Za({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,r&&(this.mousePitch=new Ya({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.aJ(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),n.addEventListener("mousedown",this.mousedown),n.addEventListener("touchstart",this.touchstart,{passive:!1}),n.addEventListener("touchmove",this.touchmove),n.addEventListener("touchend",this.touchend),n.addEventListener("touchcancel",this.reset)}down(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),f()}move(e,t){const n=this.map,r=this.mouseRotate.mousemoveWindow(e,t),i=r&&r.bearingDelta;if(i&&n.setBearing(n.getBearing()+i),this.mousePitch){const r=this.mousePitch.mousemoveWindow(e,t),i=r&&r.pitchDelta;i&&n.setPitch(n.getPitch()+i)}}off(){const e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart,{passive:!1}),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){p(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(t){this.down(e.l({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),_(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(e){this.move(e,_(this.element,e))}mouseup(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}touchstart(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=y(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>e.preventDefault()},this._startPos))}touchmove(e){1!==e.targetTouches.length?this.reset():(this._lastPos=y(this.element,e.targetTouches)[0],this.move({preventDefault:()=>e.preventDefault()},this._lastPos))}touchend(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)r.width||n.y>r.height;r.locationPoint(i).distSqr(n)180;){const e=r.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=r.width&&e.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}const Ds={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class Os extends e.E{constructor(t,n){if(super(),(t instanceof HTMLElement||n)&&(t=e.l({element:t},n)),e.aJ(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=t&&t.occludedOpacity||.2,t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=l("div");const n=41,r=27,i=c("svg",{display:"block",height:n*this._scale+"px",width:r*this._scale+"px",viewBox:`0 0 ${r} ${n}`},this._element),o=c("radialGradient",{id:"shadowGradient"},c("defs",{},i));c("stop",{offset:"10%","stop-opacity":.4},o),c("stop",{offset:"100%","stop-opacity":.05},o),c("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},i),c("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},i),c("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},i),c("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},i),this._offset=e.P.convert(t&&t.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()}));const r=this._element.classList;for(const e in Ds)r.remove(`mapboxgl-marker-anchor-${e}`);r.add(`mapboxgl-marker-anchor-${this._anchor}`);const i=t&&t.className?t.className.trim().split(/\s+/):[];r.add(...i),this._popup=null}addTo(e){return e===this._map||(this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._updateMoving),e.on("moveend",this._update),e.on("remove",this._clearFadeTimer),e._addMarker(this),this.setDraggable(this._draggable),this._update(),e.on("click",this._onMapClick)),this}remove(){const e=this._map;return e&&(e.off("click",this._onMapClick),e.off("move",this._updateMoving),e.off("moveend",this._update),e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler),e.off("mouseup",this._onUp),e.off("touchend",this._onUp),e.off("mousemove",this._onMove),e.off("touchmove",this._onMove),e.off("remove",this._clearFadeTimer),e._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.bK.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const t=38.1,n=13.5,r=Math.sqrt(Math.pow(n,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[r,-1*(t-n+r)],"bottom-right":[-r,-1*(t-n+r)],left:[n,-1*(t-n)],right:[-n,-1*(t-n)]}:this._offset}this._popup=e,e._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(e){const t=e.code,n=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==n&&13!==n||this.togglePopup()}_onMapClick(e){const t=e.originalEvent.target,n=this._element;this._popup&&(t===n||n.contains(t))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const e=this._popup;return e?(e.isOpen()?(e.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(e.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const e=this._map,t=this._pos;if(!e||!t)return!1;const n=e.unproject(t),r=e.getFreeCameraOptions();if(!r.position)return!1;const i=r.position.toLngLat();return i.distanceTo(n)<.9*i.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const n=this._pos;if(!n||n.x<0||n.x>t.transform.width||n.y<0||n.y>t.transform.height)return void this._clearFadeTimer();const r=t.unproject(n);let i;t._showingGlobe()&&e.dz(t.transform,this._lngLat)?i=0:(i=1-t._queryFogOpacity(r),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(i*=this._occludedOpacity)),this._element.style.opacity=`${i}`,this._element.style.pointerEvents=i>0?"auto":"none",this._popup&&this._popup._setOpacity(i),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const e=this._pos;if(!e||!this._map)return;const t=this._offset.mult(this._scale);this._element.style.transform=`\n translate(${e.x}px,${e.y}px)\n ${Ds[this._anchor]}\n ${this._calculateXYTransform()} ${this._calculateZTransform()}\n translate(${t.x}px,${t.y}px)\n `}_calculateXYTransform(){const t=this._pos,n=this._map,r=this.getPitchAlignment();if(!n||!t||"map"!==r)return"";if(!n._showingGlobe()){const e=n.getPitch();return e?`rotateX(${e}deg)`:""}const i=e.c0(e.dA(n.transform,this._lngLat)),o=t.sub(e.dB(n.transform)),a=Math.abs(o.x)+Math.abs(o.y);if(0===a)return"";const s=i/a;return`rotateX(${-o.y*s}deg) rotateY(${o.x*s}deg)`}_calculateZTransform(){const t=this._pos,n=this._map;if(!n||!t)return"";let r=0;const i=this.getRotationAlignment();if("map"===i)if(n._showingGlobe()){const t=n.project(new e.bK(this._lngLat.lng,this._lngLat.lat+.001)),i=n.project(new e.bK(this._lngLat.lng,this._lngLat.lat-.001)).sub(t);r=e.c0(Math.atan2(i.y,i.x))-90}else r=-n.getBearing();else if("horizon"===i){const i=e.a7(4,6,n.getZoom()),o=e.dB(n.transform);o.y+=i*n.transform.height;const a=t.sub(o),s=e.c0(Math.atan2(a.y,a.x));r=(s>90?s-270:s+90)*(1-i)}return r+=this._rotation,r?`rotateZ(${r}deg)`:""}_update(e){cancelAnimationFrame(this._updateFrameId);const t=this._map;t&&(t.transform.renderWorldCopies&&(this._lngLat=zs(this._lngLat,this._pos,t.transform)),this._pos=t.project(this._lngLat),!0===e?this._updateFrameId=requestAnimationFrame((()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())})):this._pos=this._pos.round(),t._requestDomTask((()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(t._showingGlobe()||t.getTerrain()||t.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))})))}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(e){return this._element.classList.add(e),this}removeClassName(e){return this._element.classList.remove(e),this}toggleClassName(e){return this._element.classList.toggle(e)}_onMove(t){const n=this._map;if(!n)return;const r=this._pointerdownPos,i=this._positionDelta;if(r&&i){if(!this._isDragging){const e=this._clickTolerance||n._clickTolerance;if(t.point.dist(r)0&&void 0!==arguments[0]?arguments[0]:new e.P(0,0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"bottom";if("number"==typeof t){const r=Math.round(Math.sqrt(.5*Math.pow(t,2)));switch(n){case"top":return new e.P(0,t);case"top-left":return new e.P(r,r);case"top-right":return new e.P(-r,r);case"bottom":return new e.P(0,-t);case"bottom-left":return new e.P(r,-r);case"bottom-right":return new e.P(-r,-r);case"left":return new e.P(t,0);case"right":return new e.P(-t,0)}return new e.P(0,0)}return t instanceof e.P||Array.isArray(t)?e.P.convert(t):e.P.convert(t[n]||[0,0])}return{version:t,supported:s.supported,setRTLTextPlugin:e.dC,getRTLTextPluginStatus:e.dD,Map:class extends Ss{constructor(t){r.mark(n.create);const i=t;if(null!=(t=e.l({},Ps,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(t.antialias&&e.dx(window)&&(t.antialias=!1,e.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Hn(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),t),this._repaint=!!t.repaint,this._interactive=t.interactive,this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=t.crossSourceCollisions,this._collectResourceTiming=t.collectResourceTiming,this._language=this._parseLanguage(t.language),this._worldview=t.worldview,this._renderTaskQueue=new Es,this._domRenderTaskQueue=new Es,this._controls=[],this._markers=[],this._popups=[],this._mapId=e.aP(),this._locale=e.l({},Cs,t.locale),this._clickTolerance=t.clickTolerance,this._cooperativeGestures=t.cooperativeGestures,this._performanceMetricsCollection=t.performanceMetricsCollection,this._tessellationStep=t.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=t.precompilePrograms,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new Ts(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._requestManager=new S(t.transformRequest,t.accessToken,t.testMode),this._silenceAuthErrors=!!t.testMode,this._contextCreateOptions=t.contextCreateOptions?{...t.contextCreateOptions}:{},"string"==typeof t.container){const e=document.getElementById(t.container);if(!e)throw new Error(`Container '${t.container.toString()}' not found.`);this._container=e}else{if(!(t.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(this._container.childNodes.length>0&&e.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),t.maxBounds&&this.setMaxBounds(t.maxBounds),e.aJ(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._tp||(this._tp=new ks),this._tp.registerParameter(this,["Debug"],"showOverdrawInspector"),this._tp.registerParameter(this,["Debug"],"showTileBoundaries"),this._tp.registerParameter(this,["Debug"],"showParseStatus"),this._tp.registerParameter(this,["Debug"],"repaint"),this._tp.registerParameter(this,["Debug"],"showTileAABBs"),this._tp.registerParameter(this,["Debug"],"showPadding"),this._tp.registerParameter(this,["Debug"],"showCollisionBoxes",{noSave:!0}),this._tp.registerParameter(this.transform,["Debug"],"freezeTileCoverage",{noSave:!0},(()=>{this._update()})),this._tp.registerParameter(this,["Debug","Wireframe"],"showTerrainWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers2DWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers3DWireframe"),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");if(this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new bs(this,t),this._localFontFamily=t.localFontFamily,this._localIdeographFontFamily=t.localIdeographFontFamily,(t.style||!t.testMode)&&this.setStyle(t.style||e.e.DEFAULT_STYLE,{config:t.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),t.projection&&this.setProjection(t.projection),t.hash&&(this._hash=new Aa("string"==typeof t.hash&&t.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==i.center&&null==i.zoom||(this.transform._unmodified=!1),this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});const n=t.bounds;n&&(this.resize(),this.fitBounds(n,e.l({},t.fitBoundsOptions,{duration:0})))}this.resize(),t.attributionControl&&this.addControl(new Ms({customAttribution:t.customAttribution})),this._logoControl=new As,this.addControl(this._logoControl,t.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent()})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.x(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.x(`${t.dataType}dataloading`,t))})),this._interactions=new Is(this)}_getMapId(){return this._mapId}addControl(t,n){if(void 0===n&&(n=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.t(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=t.onAdd(this);this._controls.push(t);const i=this._controlPositions[n];return-1!==n.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.t(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const n=this._controls.indexOf(t);return n>-1&&this._controls.splice(n,1),t.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(t){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const n=!this._moving;return n&&this.fire(new e.x("movestart",t)).fire(new e.x("move",t)),this.fire(new e.x("resize",t)),n&&this.fire(new e.x("moveend",t)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(t){return this.transform.setMaxBounds(e.as.convert(t)),this._update()}setMinZoom(t){if((t=t??-2)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t?this.setZoom(t):this.fire(new e.x("zoomstart")).fire(new e.x("zoom")).fire(new e.x("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=t??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t?this.setPitch(t):this.fire(new e.x("pitchstart")).fire(new e.x("pitch")).fire(new e.x("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(e){return"auto"===e?navigator.language:Array.isArray(e)?0===e.length?void 0:e.map((e=>"auto"===e?navigator.language:e)):e}setLanguage(e){const t=this._parseLanguage(e);if(!this.style||t===this._language)return this;this._language=t,this.style.reloadSources();for(const n of this._controls)n._setLanguage&&n._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(e){return this.style&&e!==this._worldview?(this._worldview=e,this.style.reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(e){return this._lazyInitEmptyStyle(),e?"string"==typeof e&&(e={name:e}):e=null,this._useExplicitProjection=!!e,this._prioritizeAndUpdateProjection(e,this.style.projection)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const t=this.transform,n=t.projection.name;let r;"globe"===n&&t.zoom>=e.bU?(t.setMercatorFromTransition(),r=!0):"mercator"===n&&t.zoom=e.bU?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate(),n&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(t){return this.transform.locationPoint3D(e.bK.convert(t))}unproject(t){return this.transform.pointLocation3D(e.P.convert(t))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(e,t,n){if("mouseenter"===e||"mouseover"===e){let r=!1;const i=i=>{const o=t.filter((e=>this.getLayer(e))),a=o.length?this.queryRenderedFeatures(i.point,{layers:o}):[];a.length?r||(r=!0,n.call(this,new Da(e,this,i.originalEvent,{features:a}))):r=!1},o=()=>{r=!1};return{layers:new Set(t),listener:n,delegates:{mousemove:i,mouseout:o}}}if("mouseleave"===e||"mouseout"===e){let r=!1;const i=i=>{const o=t.filter((e=>this.getLayer(e)));(o.length?this.queryRenderedFeatures(i.point,{layers:o}):[]).length?r=!0:r&&(r=!1,n.call(this,new Da(e,this,i.originalEvent)))},o=t=>{r&&(r=!1,n.call(this,new Da(e,this,t.originalEvent)))};return{layers:new Set(t),listener:n,delegates:{mousemove:i,mouseout:o}}}{const r=e=>{const r=t.filter((e=>this.getLayer(e))),i=r.length?this.queryRenderedFeatures(e.point,{layers:r}):[];i.length&&(e.features=i,n.call(this,e),delete e.features)};return{layers:new Set(t),listener:n,delegates:{[e]:r}}}}on(e,t,n){if("function"==typeof t||void 0===n)return super.on(e,t);if(Array.isArray(t)||(t=[t]),t)for(const i of t)if(!this._isValidId(i))return this;const r=this._createDelegatedListener(e,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(r);for(const i in r.delegates)this.on(i,r.delegates[i]);return this}once(e,t,n){if("function"==typeof t||void 0===n)return super.once(e,t);if(Array.isArray(t)||(t=[t]),t)for(const i of t)if(!this._isValidId(i))return this;const r=this._createDelegatedListener(e,t,n);for(const i in r.delegates)this.once(i,r.delegates[i]);return this}off(e,t,n){if("function"==typeof t||void 0===n)return super.off(e,t);const r=new Set(Array.isArray(t)?t:[t]);for(const a of r)if(!this._isValidId(a))return this;const i=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0},o=this._delegatedListeners?this._delegatedListeners[e]:void 0;return o&&(e=>{for(let t=0;t{r?(e.w(`Unable to perform style diff: ${String(r.message||r.error||r)}. Rebuilding the style from scratch.`),this._updateStyle(t,n)):i&&this._update(!0)}),(()=>{this._postStyleLoadEvent()})),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._localFontFamily=n.localFontFamily,this._updateStyle(t,n))}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(t,n){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),t){const r=e.l({},n);n&&n.config&&(r.initialConfig=n.config,delete r.config),this.style=new ur(this,r).load(t),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new ur(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(e.w("There is no style added to the map."),!1)}_isValidId(t){return null==t?(this.fire(new e.t(new Error("IDs can't be empty."))),!1):!e.cn(t)||(this.fire(new e.t(new Error(`IDs can't contain special symbols: "${t}".`))),!1)}addSource(e,t){return this._isValidId(e)?(this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)):this}isSourceLoaded(e){return!!this._isValidId(e)&&!!this.style&&this.style._isSourceCacheLoaded(e)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(e,t,n){this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,n)}removeSource(e){return this._isValidId(e)?(this.style.removeSource(e),this._updateTerrain(),this._update(!0)):this}getSource(e){return this._isValidId(e)?this.style.getOwnSource(e):null}addImage(t,n){let{pixelRatio:r=1,sdf:i=!1,stretchX:o,stretchY:a,content:s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._lazyInitEmptyStyle(),n instanceof HTMLImageElement||ImageBitmap&&n instanceof ImageBitmap){const{width:l,height:c,data:u}=e.q.getImageData(n);this.style.addImage(t,{data:new e.r({width:l,height:c},u),pixelRatio:r,stretchX:o,stretchY:a,content:s,sdf:i,version:0})}else if(void 0===n.width||void 0===n.height)this.fire(new e.t(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:l,height:c}=n,u=n;this.style.addImage(t,{data:new e.r({width:l,height:c},new Uint8Array(u.data)),pixelRatio:r,stretchX:o,stretchY:a,content:s,sdf:i,version:0,userImage:u}),u.onAdd&&u.onAdd(this,t)}}updateImage(t,n){this._lazyInitEmptyStyle();const r=this.style.getImage(t);if(!r)return void this.fire(new e.t(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const i=n instanceof HTMLImageElement||ImageBitmap&&n instanceof ImageBitmap?e.q.getImageData(n):n,{width:o,height:a,data:s}=i;if(void 0===o||void 0===a)return void this.fire(new e.t(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==r.data.width||a!==r.data.height)return void this.fire(new e.t(new Error(`The width and height of the updated image (${o}, ${a})\n must be that same as the previous version of the image\n (${r.data.width}, ${r.data.height})`)));const l=!(n instanceof HTMLImageElement||ImageBitmap&&n instanceof ImageBitmap);r.data.replace(s,l),this.style.updateImage(t,r)}hasImage(t){return t?!!this.style&&!!this.style.getImage(t):(this.fire(new e.t(new Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(t,n){e.o(this._requestManager.transformRequest(t,e.R.Image),((t,r)=>{n(t,r instanceof HTMLImageElement?e.q.getImageData(r):r)}))}listImages(){return this.style.listImages()}addModel(e,t){this._lazyInitEmptyStyle(),this.style.addModel(e,t)}hasModel(t){return t?this.style.hasModel(t):(this.fire(new e.t(new Error("Missing required model id"))),!1)}removeModel(e){this.style.removeModel(e)}listModels(){return this.style.listModels()}addLayer(e,t){return this._isValidId(e.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)):this}getSlot(e){const t=this.getLayer(e);return t&&t.slot||null}setSlot(e,t){return this.style.setSlot(e,t),this.style.mergeLayers(),this._update(!0)}addImport(e,t){return this.style.addImport(e,t),this}updateImport(e,t){return"string"!=typeof t&&t.id!==e?(this.removeImport(e),this.addImport(t)):(this.style.updateImport(e,t),this._update(!0))}removeImport(e){return this.style.removeImport(e),this}moveImport(e,t){return this.style.moveImport(e,t),this._update(!0)}moveLayer(e,t){return this._isValidId(e)?(this.style.moveLayer(e,t),this._update(!0)):this}removeLayer(e){return this._isValidId(e)?(this.style.removeLayer(e),this._update(!0)):this}getLayer(e){if(!this._isValidId(e))return null;const t=this.style.getOwnLayer(e);return t?"custom"===t.type?t.implementation:t.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(e,t,n){return this._isValidId(e)?(this.style.setLayerZoomRange(e,t,n),this._update(!0)):this}setFilter(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._isValidId(e)?(this.style.setFilter(e,t,n),this._update(!0)):this}getFilter(e){return this._isValidId(e)?this.style.getFilter(e):null}setPaintProperty(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this._isValidId(e)?(this.style.setPaintProperty(e,t,n,r),this._update(!0)):this}getPaintProperty(e,t){return this._isValidId(e)?this.style.getPaintProperty(e,t):null}setLayoutProperty(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this._isValidId(e)?(this.style.setLayoutProperty(e,t,n,r),this._update(!0)):this}getLayoutProperty(e,t){return this._isValidId(e)?this.style.getLayoutProperty(e,t):null}getSchema(e){return this.style.getSchema(e)}setSchema(e,t){return this.style.setSchema(e,t),this._update(!0)}getConfig(e){return this.style.getConfig(e)}setConfig(e,t){return this.style.setConfig(e,t),this._update(!0)}getConfigProperty(e,t){return this.style.getConfigProperty(e,t)}setConfigProperty(e,t,n){return this.style.setConfigProperty(e,t,n),this._update(!0)}setLights(e){if(this._lazyInitEmptyStyle(),e&&1===e.length&&"flat"===e[0].type){const t=e[0];t.properties?this.style.setFlatLight(t.properties,t.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(e),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const e=this.style.getLights()||[];return 0===e.length&&e.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),e}setLight(e){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:e}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(e){return this._lazyInitEmptyStyle(),!e&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(e),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(e){return this._lazyInitEmptyStyle(),this.style.setFog(e),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setColorTheme(e){return this._lazyInitEmptyStyle(),this.style.setColorTheme(e),this._update(!0)}setCamera(e){return this.style.setCamera(e),this._triggerCameraUpdate(e)}_triggerCameraUpdate(e){return this._update(this.transform.setOrthographicProjectionAtLowPitch("orthographic"===e["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.bK.convert(t),this.transform):0}setFeatureState(e,t){return this._isValidId(e.source)?(this.style.setFeatureState(e,t),this._update()):this}removeFeatureState(e,t){return this._isValidId(e.source)?(this.style.removeFeatureState(e,t),this._update()):this}getFeatureState(e){return this._isValidId(e.source)?this.style.getFeatureState(e):null}_updateContainerDimensions(){if(!this._container)return;const e=this._container.getBoundingClientRect().width||400,t=this._container.getBoundingClientRect().height||300;let n,r,i,o=this._container;for(;o&&(!r||!i);){const e=window.getComputedStyle(o).transform;e&&"none"!==e&&(n=e.match(/matrix.*\((.+)\)/)[1].split(", "),n[0]&&"0"!==n[0]&&"1"!==n[0]&&(r=n[0]),n[3]&&"0"!==n[3]&&"1"!==n[3]&&(i=n[3])),o=o.parentElement}this._containerWidth=r?Math.abs(e/r):e,this._containerHeight=i?Math.abs(t/i):t}_detectMissingCSS(){"rgb(250, 128, 114)"!==window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=l("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=l("div","mapboxgl-canvas-container",e);this._canvas=l("canvas","mapboxgl-canvas",t),this._interactive&&(t.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const n=this._controlContainer=l("div","mapboxgl-control-container",e),r=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach((e=>{r[e]=l("div",`mapboxgl-ctrl-${e}`,n)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,n){const r=e.q.devicePixelRatio||1;this._canvas.width=r*Math.ceil(t),this._canvas.height=r*Math.ceil(n),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${n}px`}_addMarker(e){this._markers.push(e)}_removeMarker(e){const t=this._markers.indexOf(e);-1!==t&&this._markers.splice(t,1)}_addPopup(e){this._popups.push(e)}_removePopup(e){const t=this._popups.indexOf(e);-1!==t&&this._popups.splice(t,1)}_setupPainter(){const t=e.l({},s.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl2",t);n?(V(n,!0),this.painter=new Sa(n,this._contextCreateOptions,this.transform,this._tp),this.on("data",(e=>{"source"===e.dataType&&this.painter.setTileLoadedFlag(!0)})),e.m.testSupport(n)):this.fire(new e.t(new Error("Failed to initialize WebGL")))}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.x("webglcontextlost",{originalEvent:t}))}_contextRestored(t){this._setupPainter(),this.resize(),this._update(),this.fire(new e.x("webglcontextrestored",{originalEvent:t}))}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_requestDomTask(e){!this.loaded()||this.loaded()&&!this.isMoving()?e():this._domRenderTaskQueue.add(e)}_render(t){let i;this.fire(new e.x("renderstart")),++this._frameId;const o=this.painter.context.extTimerQuery,a=e.q.now(),s=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(i=s.createQuery(),s.beginQuery(o.TIME_ELAPSED_EXT,i)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),this._removed)return;this._updateProjectionTransition();const l=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,n=this.transform.pitch,r=e.q.now(),i=new e.a3(t,{now:r,fadeDuration:l,pitch:n,transition:this.style.transition});this.style.update(i)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let c=!1;this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),c=this._updateAverageElevation(a),this.style.updateSources(this.transform),this._forceMarkerAndPopupUpdate()):c=this._updateAverageElevation(a);const u=this.style&&this.style._updatePlacement(this.painter,this.painter.transform,this.showCollisionBoxes,l,this._crossSourceCollisions,this.painter.replacementSource);if(u&&(this._placementDirty=u.needsRerender),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:l,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new e.x("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,r.mark(n.load),this.fire(new e.x("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),i){const t=e.q.now()-a;s.endQuery(o.TIME_ELAPSED_EXT),setTimeout((()=>{const n=s.getQueryParameter(i,s.QUERY_RESULT)/1e6;s.deleteQuery(i),this.fire(new e.x("gpu-timing-frame",{cpuTime:t,gpuTime:n}))}),50)}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout((()=>{const n=this.painter.queryGpuTimers(t);this.fire(new e.x("gpu-timing-layer",{layerTimes:n}))}),50)}if(this.listens("gpu-timing-deferred-render")){const t=this.painter.collectDeferredRenderGpuQueries();setTimeout((()=>{const n=this.painter.queryGpuTimeDeferredRender(t);this.fire(new e.x("gpu-timing-deferred-render",{gpuTime:n}))}),50)}const h=this._sourcesDirty||this._styleDirty||this._placementDirty||c;if(h||this._repaint)this.triggerRepaint();else{const t=this.idle();if(t&&(c=this._updateAverageElevation(a,!0)),c)this.triggerRepaint();else if(this._triggerFrame(!1),t&&(this.fire(new e.x("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const t=this._calculateSpeedIndex();this.fire(new e.x("speedindexcompleted",{speedIndex:t})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||h||(this._fullyLoaded=!0,r.mark(n.fullLoad),this._performanceMetricsCollection&&F(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(e){for(const t of this._markers)e&&!this.getRenderWorldCopies()&&(t._lngLat=t._lngLat.wrap()),t._update();for(const t of this._popups)!e||this.getRenderWorldCopies()||t._trackPointer||(t._lngLat=t._lngLat.wrap()),t._update()}_updateAverageElevation(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e=>(this.transform.averageElevation=e,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&n(0);const r=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(r||(t||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){const t=this.transform.averageElevation;let i=this.transform.sampleAverageElevation();null!=this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(i)?i=0:this._averageElevationLastSampledAt=e;const o=Math.abs(t-i);if(o>1){if(this._isInitialLoad||r)return this._averageElevation.jumpTo(i),n(i);this._averageElevation.easeTo(i,e,300)}else if(o>1e-4)return this._averageElevation.jumpTo(i),n(i)}return!!this._averageElevation.isEasing(e)&&n(this._averageElevation.getValue(e))}_authenticate(){N(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(t=>{if(t&&(t.message===w||401===t.status)){const t=this.painter.context.gl;V(t,!1),this._logoControl instanceof As&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new e.t(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}})),L(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(()=>{}))}_postStyleLoadEvent(){this.style.globalId&&D(this._requestManager._customAccessToken,{map:this,skuToken:this._requestManager._skuToken,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_updateTerrain(){const e=this._isDragging();this.painter.updateTerrain(this.style,e)}_calculateSpeedIndex(){const e=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());const n=this.painter.context.gl,r=n.createFramebuffer();function i(e){n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e,0);const t=new Uint8Array(n.drawingBufferWidth*n.drawingBufferHeight*4);return n.readPixels(0,0,n.drawingBufferWidth,n.drawingBufferHeight,n.RGBA,n.UNSIGNED_BYTE,t),t}return n.bindFramebuffer(n.FRAMEBUFFER,r),this._canvasPixelComparison(i(e),t.canvasCopies.map(i),t.timeStamps)}_canvasPixelComparison(e,t,n){let r=n[1]-n[0];const i=e.length/4;for(let o=0;o{const t=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,t&&this._render(e)})))}_preloadTiles(t){const n=this.style?this.style.getSourceCaches():[];return e.bf(n,((e,n)=>e._preloadTiles(t,n)),(()=>{this.triggerRepaint()})),this}_onWindowOnline(){this._update()}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update()}_onVisibilityChange(){"hidden"===document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._tp.refreshUI(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(e){this._showParseStatus!==e&&(this._showParseStatus=e,this._tp.refreshUI(),this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(e){this._showTerrainWireframe!==e&&(this._showTerrainWireframe=e,this._tp.refreshUI(),this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(e){this._showLayers2DWireframe!==e&&(this._showLayers2DWireframe=e,this._tp.refreshUI(),this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(e){this._showLayers3DWireframe!==e&&(this._showLayers3DWireframe=e,this._tp.refreshUI(),this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(e){this._speedIndexTiming!==e&&(this._speedIndexTiming=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._tp.refreshUI(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,this._tp.refreshUI(),e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._tp.refreshUI(),this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this._tp.refreshUI(),this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(e){this._showTileAABBs!==e&&(this._showTileAABBs=e,this._tp.refreshUI(),e&&this._update())}_setCacheLimits(t,n){e.dy(t,n)}get version(){return t}},NavigationControl:class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=e.l({},Rs,t),this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(e.aJ(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(e=>{this._map&&this._map.zoomIn({},{originalEvent:e})})),l("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(e=>{this._map&&this._map.zoomOut({},{originalEvent:e})})),l("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.aJ(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(e=>{const t=this._map;t&&(this.options.visualizePitch?t.resetNorthPitch({},{originalEvent:e}):t.resetNorth({},{originalEvent:e}))})),this._compassIcon=l("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const e=this._map;if(!e)return;const t=e.getZoom(),n=t===e.getMaxZoom(),r=t===e.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())}_rotateCompassArrow(){const e=this._map;if(!e)return;const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(e.transform.pitch*(Math.PI/180)),.5)}) rotateX(${e.transform.pitch}deg) rotateZ(${e.transform.angle*(180/Math.PI)}deg)`:`rotate(${e.transform.angle*(180/Math.PI)}deg)`;e._requestDomTask((()=>{this._compassIcon&&(this._compassIcon.style.transform=t)}))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),e.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&e.on("pitch",this._rotateCompassArrow),e.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Ls(e,this._compass,this.options.visualizePitch)),this._container}onRemove(){const e=this._map;e&&(this._container.remove(),this.options.showZoom&&e.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&e.off("pitch",this._rotateCompassArrow),e.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(e,t){const n=l("button",e,this._container);return n.type="button",n.addEventListener("click",t),n}_setButtonTitle(e,t){if(!this._map)return;const n=this._map._getUIString(`NavigationControl.${t}`);e.setAttribute("aria-label",n),e.firstElementChild&&e.firstElementChild.setAttribute("title",n)}},GeolocateControl:class extends e.E{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();const n=navigator.geolocation;this.options=e.l({geolocation:n},Fs,t),e.aJ(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Ma(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(e){return this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(e){var t=this;const n=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!!t.options.geolocation;t._supportsGeolocation=n,e(n)};void 0!==this._supportsGeolocation?e(this._supportsGeolocation):void 0!==navigator.permissions?navigator.permissions.query({name:"geolocation"}).then((e=>n("denied"!==e.state))).catch((()=>n())):n()}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),n=e.coords;return!!t&&(n.longitudet.getEast()||n.latitudet.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.x("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.x("geolocate",t)),this._finish()}}_updateCamera(t){const n=new e.bK(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,i=this._map.getBearing(),o=e.l({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(r),o,{geolocateSource:!0})}_updateMarker(t){if(t){const n=new e.bK(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map.transform,n=e.bD(1,t._center.lat)*t.worldSize,r=Math.ceil(2*this._accuracy*n);this._circleElement.style.width=`${r}px`,this._circleElement.style.height=`${r}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.x("error",t)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(t){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=l("button","mapboxgl-ctrl-geolocate",this._container),l("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=l("div","mapboxgl-user-location"),this._dotElement.appendChild(l("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(l("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Os({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=l("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Os({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new e.x("trackuserlocationend")))}))}}_onDeviceOrientation(e){this._userLocationDotMarker&&(e.webkitCompassHeading?this._heading=e.webkitCompassHeading:!0===e.absolute&&(this._heading=-1*e.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.x("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.x("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.x("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(e={maximumAge:6e5,timeout:0},this._noTimeout=!0):(e=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,e),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const e=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation)};"undefined"!=typeof DeviceMotionEvent&&"function"==typeof DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((t=>{"granted"===t&&e()})).catch(console.error):e()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Ms,ScaleControl:class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=e.l({},Bs,t),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch(e){return!1}}(),e.aJ(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const e=this.options.maxWidth||100,t=this._map,n=t._containerHeight/2,r=t._containerWidth/2-e/2,i=t.unproject([r,n]),o=t.unproject([r+e,n]),a=i.distanceTo(o);if("imperial"===this.options.unit){const t=3.2808*a;t>5280?this._setScale(e,t/5280,"mile"):this._setScale(e,t,"foot")}else"nautical"===this.options.unit?this._setScale(e,a/1852,"nautical-mile"):a>=1e3?this._setScale(e,a/1e3,"kilometer"):this._setScale(e,a,"meter")}_setScale(e,t,n){this._map._requestDomTask((()=>{const r=function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(n),t*n}(t),i=r/t;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==n?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:n}).format(r):`${r} ${Ns[n]}`,this._container.style.width=e*i+"px"}))}onAdd(e){return this._map=e,this._language=e.getLanguage(),this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(e){this._language=e,this._update()}setUnit(e){this.options.unit=e,this._update()}},FullscreenControl:class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),e.aJ(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const e=this._fullscreenButton=l("button","mapboxgl-ctrl-fullscreen",this._controlContainer);l("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",e)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends e.E{constructor(t){super(),this.options=e.l(Object.create(js),t),e.aJ(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(t&&t.className?t.className.trim().split(/\s+/):[])}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&t.on("preclick",this._onClose),this.options.closeOnMove&&t.on("move",this._onClose),t.on("remove",this.remove),this._update(),t._addPopup(this),this._focusFirstElement(),this._trackPointer?(t.on("mousemove",this._onMouseEvent),t.on("mouseup",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")):t.on("move",this._update),this.fire(new e.x("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const t=this._map;return t&&(t.off("move",this._update),t.off("move",this._onClose),t.off("preclick",this._onClose),t.off("click",this._onClose),t.off("remove",this.remove),t.off("mousemove",this._onMouseEvent),t.off("mouseup",this._onMouseEvent),t.off("drag",this._onMouseEvent),t._canvasContainer&&t._canvasContainer.classList.remove("mapboxgl-track-pointer"),t._removePopup(this),this._map=void 0),this.fire(new e.x("close")),this}getLngLat(){return this._lngLat}setLngLat(t){this._lngLat=e.bK.convert(t),this._pos=null,this._trackPointer=!1,this._update();const n=this._map;return n&&(n.on("move",this._update),n.off("mousemove",this._onMouseEvent),n._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const e=this._map;return e&&(e.off("move",this._update),e.on("mousemove",this._onMouseEvent),e.on("drag",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){const t=document.createDocumentFragment(),n=document.createElement("body");let r;for(n.innerHTML=e;r=n.firstChild,r;)t.appendChild(r);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){let t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=l("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(e),this.options.closeButton){const e=this._closeButton=l("button","mapboxgl-popup-close-button",t);e.type="button",e.setAttribute("aria-label","Close popup"),e.setAttribute("aria-hidden","true"),e.innerHTML="×",e.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(e){return this._classList.add(e),this._updateClassList(),this}removeClassName(e){return this._classList.delete(e),this._updateClassList(),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){let t;return this._classList.delete(e)?t=!1:(this._classList.add(e),t=!0),this._updateClassList(),t}_onMouseEvent(e){this._update(e.point)}_getAnchor(e){if(this.options.anchor)return this.options.anchor;const t=this._map,n=this._container,r=this._pos;if(!t||!n||!r)return"bottom";const i=n.offsetWidth,o=n.offsetHeight,a=r.xt.transform.width-i/2;if(r.y+et.transform.height-o){if(a)return"bottom-left";if(s)return"bottom-right"}return a?"left":s?"right":"bottom"}_updateClassList(){const e=this._container;if(!e)return;const t=[...this._classList];t.push("mapboxgl-popup"),this._anchor&&t.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),e.className=t.join(" ")}_update(t){const n=this._map,r=this._content;if(!n||!this._lngLat&&!this._trackPointer||!r)return;let i=this._container;if(i||(i=this._container=l("div","mapboxgl-popup",n.getContainer()),this._tip=l("div","mapboxgl-popup-tip",i),i.appendChild(r)),this.options.maxWidth&&i.style.maxWidth!==this.options.maxWidth&&(i.style.maxWidth=this.options.maxWidth),n.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=zs(this._lngLat,this._pos,n.transform)),!this._trackPointer||t){const r=this._pos=this._trackPointer&&t instanceof e.P?t:n.project(this._lngLat),i=Us(this.options.offset),o=this._anchor=this._getAnchor(i.y),a=Us(this.options.offset,o),s=r.add(a).round();n._requestDomTask((()=>{this._container&&o&&(this._container.style.transform=`${Ds[o]} translate(${s.x}px,${s.y}px)`)}))}if(!this._marker&&n._showingGlobe()){const t=e.dz(n.transform,this._lngLat)?0:1;this._setOpacity(t)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(Vs);e&&e.focus()}_onClose(){this.remove()}_setOpacity(e){this._container&&(this._container.style.opacity=`${e}`),this._content&&(this._content.style.pointerEvents=e?"auto":"none")}},Marker:Os,Style:ur,LngLat:e.bK,LngLatBounds:e.as,Point:e.P,MercatorCoordinate:e.a5,FreeCameraOptions:Vn,Evented:e.E,config:e.e,prewarm:e.dE,clearPrewarmedResources:e.dF,get accessToken(){return e.e.ACCESS_TOKEN},set accessToken(t){e.e.ACCESS_TOKEN=t},get baseApiUrl(){return e.e.API_URL},set baseApiUrl(t){e.e.API_URL=t},get workerCount(){return e.dG.workerCount},set workerCount(t){e.dG.workerCount=t},get maxParallelImageRequests(){return e.e.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.e.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage(t){e.dH(t)},get workerUrl(){return e.dI.workerUrl},set workerUrl(t){e.dI.workerUrl=t},get workerClass(){return e.dI.workerClass},set workerClass(t){e.dI.workerClass=t},get workerParams(){return e.dI.workerParams},set workerParams(t){e.dI.workerParams=t},get dracoUrl(){return e.dJ()},set dracoUrl(t){e.dK(t)},get meshoptUrl(){return e.dL()},set meshoptUrl(t){e.dM(t)},setNow:e.q.setNow,restoreNow:e.q.restoreNow}})),n}()},1174:(e,t)=>{var n=function(){},r="+",i="0",o="23456789CFGHJMPQRVWX",a=90,s=180,l=10,c=[20,1,.05,.0025,125e-6],u=125e-6;n.prototype.isValid=function(e){if(!e)return!1;if(-1==e.indexOf(r))return!1;if(e.indexOf(r)!=e.lastIndexOf(r))return!1;if(1==e.length)return!1;if(e.indexOf(r)>8||e.indexOf(r)%2==1)return!1;if(e.indexOf(i)>-1){if(0==e.indexOf(i))return!1;var t=e.match(new RegExp("(0+)","g"));if(t.length>1||t[0].length%2==1||t[0].length>6)return!1;if(e.charAt(e.length-1)!=r)return!1}if(e.length-e.indexOf(r)-1==1)return!1;for(var n=0,a=(e=e.replace(new RegExp("\\++"),"").replace(new RegExp("0+"),"")).length;n=0&&e.indexOf(r)<8)},n.prototype.isFull=function(e){if(!this.isValid(e))return!1;if(this.isShort(e))return!1;if(20*o.indexOf(e.charAt(0).toUpperCase())>=180)return!1;if(e.length>1&&20*o.indexOf(e.charAt(1).toUpperCase())>=360)return!1;return!0},n.prototype.encode=function(e,t,n){if("undefined"==typeof n&&(n=l),n<2||n<8&&n%2==1)throw"IllegalArgumentException: Invalid Open Location Code length";e=h(e),t=f(t),90==e&&(e-=d(n));var r=p(e,t,Math.min(n,l));return n>l&&(r+=m(e,t,n-l)),r},n.prototype.decode=function(e){if(!this.isFull(e))throw"IllegalArgumentException: Passed Open Location Code is not a valid full code: "+e;e=(e=(e=e.replace(r,"")).replace(new RegExp("0+"),"")).toUpperCase();var t=g(e.substring(0,l));if(e.length<=l)return t;var n=y(e.substring(l));return v(t.latitudeLo+n.latitudeLo,t.longitudeLo+n.longitudeLo,t.latitudeLo+n.latitudeHi,t.longitudeLo+n.longitudeHi,t.codeLength+n.codeLength)},n.prototype.recoverNearest=function(e,t,n){if(!this.isShort(e)){if(this.isFull(e))return e;throw"ValueError: Passed short code is not valid: "+e}t=h(t),n=f(n);var i=8-(e=e.toUpperCase()).indexOf(r),o=Math.pow(20,2-i/2),a=o/2,s=Math.floor(t/o)*o,l=Math.floor(n/o)*o,c=this.decode(this.encode(s,l).substr(0,i)+e),u=c.latitudeCenter-t;return u>a?c.latitudeCenter-=o:u<-a&&(c.latitudeCenter+=o),(u=c.longitudeCenter-n)>a?c.longitudeCenter-=o:u<-a&&(c.longitudeCenter+=o),this.encode(c.latitudeCenter,c.longitudeCenter,c.codeLength)},n.prototype.shorten=function(e,t,n){if(!this.isFull(e))throw"ValueError: Passed code is not valid and full: "+e;if(-1!=e.indexOf(i))throw"ValueError: Cannot shorten padded codes: "+e;e=e.toUpperCase();var r=this.decode(e);if(r.codeLength<6)throw"ValueError: Code length must be at least 6";t=h(t),n=f(n);for(var o=Math.max(Math.abs(r.latitudeCenter-t),Math.abs(r.longitudeCenter-n)),a=c.length-2;a>=1;a--)if(o<.3*c[a])return e.substring(2*(a+1));return e};var h=function(e){return Math.min(90,Math.max(-90,e))},d=function(e){return e<=10?Math.pow(20,Math.floor(e/-2+2)):Math.pow(20,-3)/Math.pow(5,e-10)},f=function(e){for(;e<-180;)e+=360;for(;e>=180;)e-=360;return e},p=function(e,t,n){for(var l="",u=e+a,h=t+s,d=0;d=this._config.preview;if(r)t.postMessage({results:s,workerId:a.WORKER_ID,finished:c});else if(b(this._config.chunk)&&!n){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);s=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),this._completed||!c||!b(this._config.complete)||s&&s.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||s&&s.meta.paused||this._nextChunk(),s}this._halted=!0},this._sendError=function(e){b(this._config.error)?this._config.error(e):r&&this._config.error&&t.postMessage({workerId:a.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=a.RemoteChunkSize),l.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var r in e)t.setRequestHeader(r,e[r])}if(this._config.chunkSize){var i=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+i)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var n=t.statusText||e;this._sendError(new Error(n))}}function u(e){var t,n;(e=e||{}).chunkSize||(e.chunkSize=a.LocalChunkSize),l.call(this,e);var r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function h(e){var t;l.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,n=this._config.chunkSize;return n?(e=t.substring(0,n),t=t.substring(n)):(e=t,t=""),this._finished=!t,this.parseChunk(e)}}}function d(e){l.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=x((function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}}),this),this._streamError=x((function(e){this._streamCleanUp(),this._sendError(e)}),this),this._streamEnd=x((function(){this._streamCleanUp(),r=!0,this._streamData("")}),this),this._streamCleanUp=x((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function f(e){var t,n,r,i=Math.pow(2,53),o=-i,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,l=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,c=this,u=0,h=0,d=!1,f=!1,g=[],_={data:[],errors:[],meta:{}};if(b(e.step)){var y=e.step;e.step=function(t){if(_=t,S())w();else{if(w(),0===_.data.length)return;u+=t.data.length,e.preview&&u>e.preview?n.abort():(_.data=_.data[0],y(_,c))}}}function x(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function w(){return _&&r&&(A("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines&&(_.data=_.data.filter((function(e){return!x(e)}))),S()&&function(){if(_)if(Array.isArray(_.data[0])){for(var t=0;S()&&t<_.data.length;t++)_.data[t].forEach(n);_.data.splice(0,1)}else _.data.forEach(n);function n(t,n){b(e.transformHeader)&&(t=e.transformHeader(t,n)),g.push(t)}}(),function(){if(!_||!e.header&&!e.dynamicTyping&&!e.transform)return _;function t(t,n){var r,i=e.header?{}:[];for(r=0;r=g.length?"__parsed_extra":g[r]),e.transform&&(a=e.transform(a,o)),a=M(o,a),"__parsed_extra"===o?(i[o]=i[o]||[],i[o].push(a)):i[o]=a}return e.header&&(r>g.length?A("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+r,h+n):r=r.length/2?"\r\n":"\r"}(i,l)),r=!1,e.delimiter)b(e.delimiter)&&(e.delimiter=e.delimiter(i),_.meta.delimiter=e.delimiter);else{var c=function(t,n,r,i,o){var s,l,c,u;o=o||[",","\t","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var h=0;h=s)return W(!0)}else for(N=u,u++;;){if(-1===(N=a.indexOf(t,N+1)))return f||w.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:x.length,index:u}),G();if(N===m-1)return G(a.substring(u,N).replace(B,t));if(t!==c||a[N+1]!==c){if(t===c||0===N||a[N-1]!==c){-1!==O&&O=s)return W(!0);break}w.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:x.length,index:u}),N++}}else N++}return G();function U(e){x.push(e),M=u}function $(e){var t=0;if(-1!==e){var n=a.substring(N+1,e);n&&""===n.trim()&&(t=n.length)}return t}function G(e){return f||(void 0===e&&(e=a.substring(u)),S.push(e),u=m,U(S),v&&H()),W()}function q(e){u=e,U(S),S=[],F=a.indexOf(r,u)}function W(e){return{data:x,errors:w,meta:{delimiter:n,linebreak:r,aborted:h,truncated:!!e,cursor:M+(d||0)}}}function H(){o(W()),x=[],w=[]}},this.abort=function(){h=!0},this.getCharIndex=function(){return u}}function g(e){var t=e.data,n=i[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var o={abort:function(){r=!0,_(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(b(n.userStep)){for(var a=0;a{"use strict";var r=n(5043),i=n(8853);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n

' + placeName[0]+ '
' + placeName.splice(1, placeName.length).join(',') + '
';\n }\n },\n \n _headers: {},\n\n /**\n * Add the geocoder to a container. The container can be either a `mapboxgl.Map`, an `HTMLElement` or a CSS selector string.\n *\n * If the container is a [`mapboxgl.Map`](https://docs.mapbox.com/mapbox-gl-js/api/map/), this function will behave identically to [`Map.addControl(geocoder)`](https://docs.mapbox.com/mapbox-gl-js/api/map/#map#addcontrol).\n * If the container is an instance of [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement), then the geocoder will be appended as a child of that [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement).\n * If the container is a [CSS selector string](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors), the geocoder will be appended to the element returned from the query.\n *\n * This function will throw an error if the container is none of the above.\n * It will also throw an error if the referenced HTML element cannot be found in the `document.body`.\n *\n * For example, if the HTML body contains the element `
`, the following script will append the geocoder to `#geocoder-container`:\n *\n * ```javascript\n * var geocoder = new MapboxGeocoder({ accessToken: mapboxgl.accessToken });\n * geocoder.addTo('#geocoder-container');\n * ```\n * @param {String|HTMLElement|mapboxgl.Map} container A reference to the container to which to add the geocoder\n */\n addTo: function(container){\n\n function addToExistingContainer (geocoder, container) {\n if (!document.body.contains(container)) {\n throw new Error(\"Element provided to #addTo() exists, but is not in the DOM\")\n }\n const el = geocoder.onAdd(); //returns the input elements, which are then added to the requested html container\n container.appendChild(el);\n }\n\n // if the container is a map, add the control like normal\n if (container._controlContainer){\n // it's a mapbox-gl map, add like normal\n container.addControl(this);\n }\n // if the container is an HTMLElement, then set the parent to be that element\n else if (container instanceof HTMLElement) {\n addToExistingContainer(this, container);\n }\n // if the container is a string, treat it as a CSS query\n else if (typeof container == 'string'){\n const parent = document.querySelectorAll(container);\n if (parent.length === 0){\n throw new Error(\"Element \", container, \"not found.\")\n }\n\n if (parent.length > 1){\n throw new Error(\"Geocoder can only be added to a single html element\")\n }\n\n addToExistingContainer(this, parent[0]);\n }else{\n throw new Error(\"Error: addTo must be a mapbox-gl-js map, an html element, or a CSS selector query for a single html element\")\n }\n },\n\n onAdd: function(map) {\n if (map && typeof map != 'string'){\n this._map = map;\n }\n\n this.setLanguage();\n\n if (!this.options.localGeocoderOnly){\n this.geocoderService = mbxGeocoder(\n MapboxClient({\n accessToken: this.options.accessToken,\n origin: this.options.origin\n })\n );\n }\n\n if (this.options.localGeocoderOnly && !this.options.localGeocoder){\n throw new Error(\"A localGeocoder function must be specified to use localGeocoderOnly mode\")\n }\n\n this.eventManager = new MapboxEventManager(this.options);\n\n this._onChange = this._onChange.bind(this);\n this._onKeyDown = this._onKeyDown.bind(this);\n this._onPaste = this._onPaste.bind(this);\n this._onBlur = this._onBlur.bind(this);\n this._showButton = this._showButton.bind(this);\n this._hideButton = this._hideButton.bind(this);\n this._onQueryResult = this._onQueryResult.bind(this);\n this.clear = this.clear.bind(this);\n this._updateProximity = this._updateProximity.bind(this);\n this._collapse = this._collapse.bind(this);\n this._unCollapse = this._unCollapse.bind(this);\n this._clear = this._clear.bind(this);\n this._clearOnBlur = this._clearOnBlur.bind(this);\n this._geolocateUser = this._geolocateUser.bind(this);\n\n var el = (this.container = document.createElement('div'));\n el.className = 'mapboxgl-ctrl-geocoder mapboxgl-ctrl';\n\n var searchIcon = this.createIcon('search', '')\n\n this._inputEl = document.createElement('input');\n this._inputEl.type = 'text';\n this._inputEl.className = 'mapboxgl-ctrl-geocoder--input';\n\n this.setPlaceholder();\n\n if (this.options.collapsed) {\n this._collapse();\n this.container.addEventListener('mouseenter', this._unCollapse);\n this.container.addEventListener('mouseleave', this._collapse);\n this._inputEl.addEventListener('focus', this._unCollapse);\n }\n\n if (this.options.collapsed || this.options.clearOnBlur) {\n this._inputEl.addEventListener('blur', this._onBlur);\n }\n\n this._inputEl.addEventListener('keydown', debounce(this._onKeyDown, 200));\n this._inputEl.addEventListener('paste', this._onPaste);\n this._inputEl.addEventListener('change', this._onChange);\n this.container.addEventListener('mouseenter', this._showButton);\n this.container.addEventListener('mouseleave', this._hideButton);\n this._inputEl.addEventListener('keyup', function(e){\n this.eventManager.keyevent(e, this);\n }.bind(this));\n\n var actions = document.createElement('div');\n actions.classList.add('mapboxgl-ctrl-geocoder--pin-right');\n\n this._clearEl = document.createElement('button');\n this._clearEl.setAttribute('aria-label', 'Clear');\n this._clearEl.addEventListener('click', this.clear);\n this._clearEl.className = 'mapboxgl-ctrl-geocoder--button';\n\n var buttonIcon = this.createIcon('close', '')\n this._clearEl.appendChild(buttonIcon);\n\n this._loadingEl = this.createIcon('loading', '');\n\n actions.appendChild(this._clearEl);\n actions.appendChild(this._loadingEl);\n\n el.appendChild(searchIcon);\n el.appendChild(this._inputEl);\n el.appendChild(actions);\n\n if (this.options.enableGeolocation && this.geolocation.isSupport()) {\n this._geolocateEl = document.createElement('button');\n this._geolocateEl.setAttribute('aria-label', 'Geolocate');\n this._geolocateEl.addEventListener('click', this._geolocateUser);\n this._geolocateEl.className = 'mapboxgl-ctrl-geocoder--button';\n\n var geolocateIcon = this.createIcon('geolocate', '');\n this._geolocateEl.appendChild(geolocateIcon);\n\n actions.appendChild(this._geolocateEl);\n this._showGeolocateButton();\n }\n\n var typeahead = this._typeahead = new Typeahead(this._inputEl, [], {\n filter: false,\n minLength: this.options.minLength,\n limit: this.options.limit\n });\n\n this.setRenderFunction(this.options.render);\n typeahead.getItemValue = this.options.getItemValue;\n\n // Add support for footer.\n var parentDraw = typeahead.list.draw;\n var footerNode = this._footerNode = getFooterNode();\n typeahead.list.draw = function() {\n parentDraw.call(this);\n\n footerNode.addEventListener('mousedown', function() {\n this.selectingListItem = true;\n }.bind(this));\n \n footerNode.addEventListener('mouseup', function() {\n this.selectingListItem = false;\n }.bind(this));\n\n this.element.appendChild(footerNode);\n };\n\n this.mapMarker = null;\n this._handleMarker = this._handleMarker.bind(this);\n if (this._map){\n if (this.options.trackProximity ) {\n this._updateProximity();\n this._map.on('moveend', this._updateProximity);\n }\n this._mapboxgl = this.options.mapboxgl;\n if (!this._mapboxgl && this.options.marker) {\n // eslint-disable-next-line no-console\n console.error(\"No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl.\");\n this.options.marker = false;\n }\n }\n return el;\n },\n\n _geolocateUser: function () {\n this._hideGeolocateButton();\n this._showLoadingIcon();\n\n this.geolocation.getCurrentPosition().then(function(geolocationPosition) {\n this._hideLoadingIcon();\n\n const geojson = {\n geometry: {\n type: 'Point',\n coordinates: [geolocationPosition.coords.longitude, geolocationPosition.coords.latitude]\n }\n };\n\n this._handleMarker(geojson);\n this._fly(geojson);\n\n this._typeahead.clear();\n this._typeahead.selected = true;\n this.lastSelected = JSON.stringify(geojson);\n this._showClearButton();\n this.fresh = false;\n\n const config = {\n limit: 1,\n language: [this.options.language],\n query: geojson.geometry.coordinates,\n types: [\"address\"]\n };\n\n if (this.options.localGeocoderOnly) {\n const text = geojson.geometry.coordinates[0] + ',' + geojson.geometry.coordinates[1]\n this._setInputValue(text);\n\n this._eventEmitter.emit('result', { result: geojson });\n } else {\n this.geocoderService.reverseGeocode(config).send().then(function (resp) {\n const feature = resp.body.features[0];\n \n if (feature) {\n const locationText = utils.transformFeatureToGeolocationText(feature, this.options.addressAccuracy);\n this._setInputValue(locationText);\n \n feature.user_coordinates = geojson.geometry.coordinates;\n this._eventEmitter.emit('result', { result: feature });\n } else {\n this._eventEmitter.emit('result', { result: { user_coordinates: geojson.geometry.coordinates } });\n }\n }.bind(this));\n }\n }.bind(this)).catch(function(error) {\n if (error.code === 1) {\n this._renderUserDeniedGeolocationError();\n } else {\n this._renderLocationError();\n }\n\n this._hideLoadingIcon();\n this._showGeolocateButton();\n this._hideAttribution();\n }.bind(this));\n },\n\n createIcon: function(name, path) {\n var icon = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n icon.setAttribute('class', 'mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-' + name);\n icon.setAttribute('viewBox', '0 0 18 18');\n icon.setAttribute('xml:space','preserve');\n icon.setAttribute('width', 18);\n icon.setAttribute('height', 18);\n icon.innerHTML = path;\n return icon;\n },\n\n onRemove: function() {\n this.container.parentNode.removeChild(this.container);\n\n if (this.options.trackProximity && this._map) {\n this._map.off('moveend', this._updateProximity);\n }\n\n this._removeMarker();\n\n this._map = null;\n\n return this;\n },\n\n _setInputValue: function (value) {\n this._inputEl.value = value;\n \n setTimeout(function () {\n this._inputEl.focus();\n this._inputEl.scrollLeft = 0;\n this._inputEl.setSelectionRange(0, 0);\n }.bind(this), 1);\n },\n\n _onPaste: function(e){\n var value = (e.clipboardData || window.clipboardData).getData('text');\n if (value.length >= this.options.minLength) {\n this._geocode(value);\n }\n },\n\n _onKeyDown: function(e) {\n var ESC_KEY_CODE = 27,\n TAB_KEY_CODE = 9;\n\n if (e.keyCode === ESC_KEY_CODE && this.options.clearAndBlurOnEsc) {\n this._clear(e);\n return this._inputEl.blur();\n }\n\n // if target has shadowRoot, then get the actual active element inside the shadowRoot\n var target = e.target && e.target.shadowRoot\n ? e.target.shadowRoot.activeElement\n : e.target;\n var value = target ? target.value : '';\n\n if (!value) {\n this.fresh = true;\n // the user has removed all the text\n if (e.keyCode !== TAB_KEY_CODE) this.clear(e);\n this._showGeolocateButton();\n return this._hideClearButton();\n }\n\n this._hideGeolocateButton();\n\n // TAB, ESC, LEFT, RIGHT, ENTER, UP, DOWN\n if ((e.metaKey || [TAB_KEY_CODE, ESC_KEY_CODE, 37, 39, 13, 38, 40].indexOf(e.keyCode) !== -1))\n return;\n\n if (target.value.length >= this.options.minLength) {\n this._geocode(target.value);\n }\n },\n\n _showButton: function() {\n if (this._typeahead.selected) this._showClearButton();\n },\n\n _hideButton: function() {\n if (this._typeahead.selected) this._hideClearButton();\n },\n\n _showClearButton: function() {\n this._clearEl.style.display = 'block';\n },\n\n _hideClearButton: function() {\n this._clearEl.style.display = 'none'\n },\n\n _showGeolocateButton: function() {\n if (this._geolocateEl && this.geolocation.isSupport()) {\n this._geolocateEl.style.display = 'block';\n }\n },\n\n _hideGeolocateButton: function() {\n if (this._geolocateEl) {\n this._geolocateEl.style.display = 'none';\n }\n },\n\n _showLoadingIcon: function() {\n this._loadingEl.style.display = 'block';\n },\n \n _hideLoadingIcon: function() {\n this._loadingEl.style.display = 'none';\n },\n\n _showAttribution: function() {\n this._footerNode.style.display = 'block'\n },\n \n _hideAttribution: function() {\n this._footerNode.style.display = 'none'\n },\n\n _onBlur: function(e) {\n if (this.options.clearOnBlur) {\n this._clearOnBlur(e);\n }\n if (this.options.collapsed) {\n this._collapse();\n }\n },\n _onChange: function() {\n var selected = this._typeahead.selected;\n if (selected && JSON.stringify(selected) !== this.lastSelected) {\n this._hideClearButton();\n if (this.options.flyTo) {\n this._fly(selected);\n }\n if (this.options.marker && this._mapboxgl){\n this._handleMarker(selected);\n }\n\n // After selecting a feature, re-focus the textarea and set\n // cursor at start.\n this._inputEl.focus();\n this._inputEl.scrollLeft = 0;\n this._inputEl.setSelectionRange(0, 0);\n this.lastSelected = JSON.stringify(selected);\n this._eventEmitter.emit('result', { result: selected });\n this.eventManager.select(selected, this);\n }\n },\n\n _fly: function(selected) {\n var flyOptions;\n if (selected.properties && exceptions[selected.properties.short_code]) {\n // Certain geocoder search results return (and therefore zoom to fit)\n // an unexpectedly large bounding box: for example, both Russia and the\n // USA span both sides of -180/180, or France includes the island of\n // Reunion in the Indian Ocean. An incomplete list of these exceptions\n // at ./exceptions.json provides \"reasonable\" bounding boxes as a\n // short-term solution; this may be amended as necessary.\n flyOptions = extend({}, this.options.flyTo);\n if (this._map){\n this._map.fitBounds(exceptions[selected.properties.short_code].bbox, flyOptions);\n }\n } else if (selected.bbox) {\n var bbox = selected.bbox;\n flyOptions = extend({}, this.options.flyTo);\n if (this._map){\n this._map.fitBounds([[bbox[0], bbox[1]], [bbox[2], bbox[3]]], flyOptions);\n }\n } else {\n var defaultFlyOptions = {\n zoom: this.options.zoom\n }\n flyOptions = extend({}, defaultFlyOptions, this.options.flyTo);\n // ensure that center is not overriden by custom options\n if (selected.center) {\n flyOptions.center = selected.center;\n } else if (selected.geometry && selected.geometry.type && selected.geometry.type === 'Point' && selected.geometry.coordinates) {\n flyOptions.center = selected.geometry.coordinates;\n }\n\n if (this._map){\n this._map.flyTo(flyOptions);\n }\n }\n },\n\n _requestType: function(options, search) {\n var type;\n if (options.localGeocoderOnly) {\n type = GEOCODE_REQUEST_TYPE.LOCAL;\n } else if (options.reverseGeocode && utils.REVERSE_GEOCODE_COORD_RGX.test(search)) {\n type = GEOCODE_REQUEST_TYPE.REVERSE;\n } else {\n type = GEOCODE_REQUEST_TYPE.FORWARD;\n }\n return type;\n },\n\n _setupConfig: function(requestType, search) {\n // Possible config properties to pass to client\n const keys = [\n 'bbox',\n 'limit',\n 'proximity',\n 'countries',\n 'types',\n 'language',\n 'reverseMode',\n 'mode',\n 'autocomplete',\n 'fuzzyMatch',\n 'routing',\n 'worldview'\n ];\n const spacesOrCommaRgx = /[\\s,]+/;\n\n var self = this;\n var config = keys.reduce(function(config, key) {\n // don't include undefined/null params, but allow boolean, among other, values\n if (self.options[key] === undefined || self.options[key] === null) {\n return config;\n }\n\n // countries, types, and language need to be passed in as arrays to client\n // https://github.com/mapbox/mapbox-sdk-js/blob/master/services/geocoding.js#L38-L47\n ['countries', 'types', 'language'].indexOf(key) > -1\n ? (config[key] = self.options[key].split(spacesOrCommaRgx))\n : (config[key] = self.options[key]);\n\n const isCoordKey =\n typeof self.options[key].longitude === 'number' &&\n typeof self.options[key].latitude === 'number';\n\n if (key === 'proximity' && isCoordKey) {\n const lng = self.options[key].longitude;\n const lat = self.options[key].latitude;\n\n config[key] = [lng, lat];\n }\n\n return config;\n }, {});\n\n switch (requestType) {\n case GEOCODE_REQUEST_TYPE.REVERSE: {\n var coords = search.split(spacesOrCommaRgx).map(function(c) {\n return parseFloat(c, 10);\n })\n if (!self.options.flipCoordinates) {\n coords.reverse();\n }\n\n // client only accepts one type for reverseGeocode, so\n // use first config type if one, if not default to poi\n config.types ? [config.types[0]] : [\"poi\"];\n config = extend(config, { query: coords, limit: 1 });\n\n // Remove config options not supported by the reverseGeocoder\n ['proximity', 'autocomplete', 'fuzzyMatch', 'bbox'].forEach(function(key) {\n if (key in config) {\n delete config[key]\n }\n });\n } break;\n case GEOCODE_REQUEST_TYPE.FORWARD: {\n // Ensure that any reverse geocoding looking request is cleaned up\n // to be processed as only a forward geocoding request by the server.\n const trimmedSearch = search.trim();\n const reverseGeocodeCoordRgx = /^(-?\\d{1,3}(\\.\\d{0,256})?)[, ]+(-?\\d{1,3}(\\.\\d{0,256})?)?$/;\n if (reverseGeocodeCoordRgx.test(trimmedSearch)) {\n search = search.replace(/,/g, ' ');\n }\n config = extend(config, { query: search });\n } break;\n }\n\n config.session_token = this.eventManager.getSessionId();\n\n return config;\n },\n\n _geocode: function(searchInput) {\n this.inputString = searchInput;\n this._showLoadingIcon();\n this._eventEmitter.emit('loading', { query: searchInput });\n\n const requestType = this._requestType(this.options, searchInput);\n const config = this._setupConfig(requestType, searchInput);\n\n var request;\n switch (requestType) {\n case GEOCODE_REQUEST_TYPE.LOCAL:\n request = Promise.resolve();\n break;\n case GEOCODE_REQUEST_TYPE.FORWARD:\n request = this.geocoderService.forwardGeocode(config).send();\n break;\n case GEOCODE_REQUEST_TYPE.REVERSE:\n request = this.geocoderService.reverseGeocode(config).send();\n break;\n }\n\n var localGeocoderRes = this.options.localGeocoder ? this.options.localGeocoder(searchInput) || [] : [];\n var externalGeocoderRes = [];\n\n var geocoderError = null;\n request.catch(function(error) {\n geocoderError = error;\n }.bind(this))\n .then(\n function(response) {\n this._hideLoadingIcon();\n var res = {};\n\n if (!response){\n res = {\n type: 'FeatureCollection',\n features: []\n }\n } else if (response.statusCode == '200') {\n res = response.body;\n res.request = response.request;\n res.headers = response.headers;\n this._headers = response.headers;\n }\n\n res.config = config;\n\n if (this.fresh){\n this.eventManager.start(this);\n this.fresh = false;\n }\n\n // Tag Mapbox as the source for Geocoding API results, to differentiate from local or external geocoder federated results\n if (res.features && res.features.length) {\n res.features.map(function (feature) {\n feature._source = 'mapbox';\n })\n }\n\n // supplement Mapbox Geocoding API results with locally populated results\n res.features = res.features\n ? localGeocoderRes.concat(res.features)\n : localGeocoderRes;\n\n if (this.options.externalGeocoder) {\n\n externalGeocoderRes = this.options.externalGeocoder(searchInput, res.features) || Promise.resolve([]);\n // supplement Mapbox Geocoding API results with features returned by a promise\n return externalGeocoderRes.then(function(features) {\n res.features = res.features ? features.concat(res.features) : features;\n return res;\n }, function(){\n // on error, display the original result\n return res;\n });\n }\n return res;\n\n }.bind(this)).then(\n function(res) {\n if (geocoderError) {\n throw geocoderError;\n }\n\n // apply results filter if provided\n if (this.options.filter && res.features.length) {\n res.features = res.features.filter(this.options.filter);\n }\n\n if (res.features.length) {\n this._showClearButton();\n this._hideGeolocateButton();\n this._showAttribution();\n this._eventEmitter.emit('results', res);\n this._typeahead.update(res.features);\n } else {\n this._hideClearButton();\n this._hideAttribution();\n this._typeahead.selected = null;\n this._renderNoResults();\n this._eventEmitter.emit('results', res);\n }\n\n }.bind(this)\n ).catch(\n function(err) {\n this._hideLoadingIcon();\n this._hideAttribution();\n\n // in the event of an error in the Mapbox Geocoding API still display results from the localGeocoder\n if ((localGeocoderRes.length && this.options.localGeocoder) || (externalGeocoderRes.length && this.options.externalGeocoder) ) {\n this._showClearButton();\n this._hideGeolocateButton();\n this._typeahead.update(localGeocoderRes);\n } else {\n this._hideClearButton();\n this._typeahead.selected = null;\n this._renderError();\n }\n\n this._eventEmitter.emit('results', { features: localGeocoderRes });\n this._eventEmitter.emit('error', { error: err });\n }.bind(this)\n );\n\n return request;\n },\n\n /**\n * Shared logic for clearing input\n * @param {Event} [ev] the event that triggered the clear, if available\n * @private\n *\n */\n _clear: function(ev) {\n if (ev) ev.preventDefault();\n this._inputEl.value = '';\n this._typeahead.selected = null;\n this._typeahead.clear();\n this.eventManager.sessionIncrementer++;\n this._onChange();\n this._hideClearButton();\n this._showGeolocateButton();\n this._removeMarker();\n this.lastSelected = null;\n this._eventEmitter.emit('clear');\n this.fresh = true;\n },\n\n /**\n * Clear and then focus the input.\n * @param {Event} [ev] the event that triggered the clear, if available\n *\n */\n clear: function(ev) {\n this._clear(ev);\n this._inputEl.focus();\n },\n\n\n /**\n * Clear the input, without refocusing it. Used to implement clearOnBlur\n * constructor option.\n * @param {Event} [ev] the blur event\n * @private\n */\n _clearOnBlur: function(ev) {\n var ctx = this;\n\n /*\n * If relatedTarget is not found, assume user targeted the suggestions list.\n * In that case, do not clear on blur. There are other edge cases where\n * ev.relatedTarget could be null. Clicking on list always results in null\n * relatedtarget because of upstream behavior in `suggestions`.\n *\n * The ideal solution would be to check if ev.relatedTarget is a child of\n * the list. See issue #258 for details on why we can't do that yet.\n */\n if (ev.relatedTarget) {\n ctx._clear(ev);\n }\n },\n\n _onQueryResult: function(response) {\n var results = response.body;\n if (!results.features.length) return;\n var result = results.features[0];\n this._typeahead.selected = result;\n this._inputEl.value = result.place_name;\n this._onChange();\n },\n\n _updateProximity: function() {\n // proximity is designed for local scale, if the user is looking at the whole world,\n // it doesn't make sense to factor in the arbitrary centre of the map\n if (!this._map || !this.options.trackProximity){\n return;\n }\n if (this._map.getZoom() > 9) {\n var center = this._map.getCenter().wrap();\n this.setProximity({ longitude: center.lng, latitude: center.lat }, false);\n } else {\n this.setProximity(null, false);\n }\n },\n\n _collapse: function() {\n // do not collapse if input is in focus\n if (!this._inputEl.value && this._inputEl !== document.activeElement) this.container.classList.add('mapboxgl-ctrl-geocoder--collapsed');\n },\n\n _unCollapse: function() {\n this.container.classList.remove('mapboxgl-ctrl-geocoder--collapsed');\n },\n\n /**\n * Set & query the input\n * @param {string} searchInput location name or other search input\n * @returns {MapboxGeocoder} this\n */\n query: function(searchInput) {\n this._geocode(searchInput).then(this._onQueryResult);\n return this;\n },\n\n _renderError: function(){\n var errorMessage = \"
There was an error reaching the server
\"\n this._renderMessage(errorMessage);\n },\n\n _renderLocationError: function(){\n var errorMessage = \"
A location error has occurred
\"\n this._renderMessage(errorMessage);\n },\n\n _renderNoResults: function(){\n var errorMessage = \"
No results found
\";\n this._renderMessage(errorMessage);\n },\n\n _renderUserDeniedGeolocationError: function() {\n var errorMessage = \"
Geolocation permission denied
\"\n this._renderMessage(errorMessage);\n },\n\n _renderMessage: function(msg){\n this._typeahead.update([]);\n this._typeahead.selected = null;\n this._typeahead.clear();\n this._typeahead.renderError(msg);\n },\n\n /**\n * Get the text to use as the search bar placeholder\n *\n * If placeholder is provided in options, then use options.placeholder\n * Otherwise, if language is provided in options, then use the localized string of the first language if available\n * Otherwise use the default\n *\n * @returns {String} the value to use as the search bar placeholder\n * @private\n */\n _getPlaceholderText: function(){\n if (this.options.placeholder) return this.options.placeholder;\n if (this.options.language){\n var firstLanguage = this.options.language.split(\",\")[0];\n var language = subtag.language(firstLanguage);\n var localizedValue = localization.placeholder[language];\n if (localizedValue) return localizedValue;\n }\n return 'Search';\n },\n\n /**\n * Set input\n * @param {string} searchInput location name or other search input\n * @param {boolean} [showSuggestions=false] display suggestion on setInput call\n * @returns {MapboxGeocoder} this\n */\n setInput: function(searchInput, showSuggestions) {\n if (showSuggestions === undefined) {\n showSuggestions = false\n }\n // Set input value to passed value and clear everything else.\n this._inputEl.value = searchInput;\n this._typeahead.selected = null;\n this._typeahead.clear();\n if (searchInput.length >= this.options.minLength) {\n showSuggestions ? this._geocode(searchInput) : this._onChange();\n }\n return this;\n },\n\n /**\n * Set proximity\n * @param {Object|'ip'} proximity The new `options.proximity` value. This is a geographical point given as an object with `latitude` and `longitude` properties or the string 'ip'.\n * @param {Boolean} disableTrackProximity If true, sets `trackProximity` to false. True by default to prevent `trackProximity` from unintentionally overriding an explicitly set proximity value.\n * @returns {MapboxGeocoder} this\n */\n setProximity: function(proximity, disableTrackProximity = true) {\n this.options.proximity = proximity;\n if (disableTrackProximity) {\n this.options.trackProximity = false;\n }\n return this;\n },\n\n /**\n * Get proximity\n * @returns {Object} The geocoder proximity\n */\n getProximity: function() {\n return this.options.proximity;\n },\n\n /**\n * Set the render function used in the results dropdown\n * @param {Function} fn The function to use as a render function. This function accepts a single [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) object as input and returns a string.\n * @returns {MapboxGeocoder} this\n */\n setRenderFunction: function(fn){\n if (fn && typeof(fn) == \"function\"){\n this._typeahead.render = fn;\n }\n return this;\n },\n\n /**\n * Get the function used to render the results dropdown\n *\n * @returns {Function} the render function\n */\n getRenderFunction: function(){\n return this._typeahead.render;\n },\n\n /**\n * Get the language to use in UI elements and when making search requests\n *\n * Look first at the explicitly set options otherwise use the browser's language settings\n * @param {String} language Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas.\n * @returns {MapboxGeocoder} this\n */\n setLanguage: function(language){\n var browserLocale = navigator.language || navigator.userLanguage || navigator.browserLanguage;\n this.options.language = language || this.options.language || browserLocale;\n return this;\n },\n\n /**\n * Get the language to use in UI elements and when making search requests\n * @returns {String} The language(s) used by the plugin, if any\n */\n getLanguage: function(){\n return this.options.language;\n },\n\n /**\n * Get the zoom level the map will move to when there is no bounding box on the selected result\n * @returns {Number} the map zoom\n */\n getZoom: function(){\n return this.options.zoom;\n },\n\n /**\n * Set the zoom level\n * @param {Number} zoom The zoom level that the map should animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`.\n * @returns {MapboxGeocoder} this\n */\n setZoom: function(zoom){\n this.options.zoom = zoom;\n return this;\n },\n\n /**\n * Get the parameters used to fly to the selected response, if any\n * @returns {Boolean|Object} The `flyTo` option\n */\n getFlyTo: function(){\n return this.options.flyTo;\n },\n\n /**\n * Set the flyTo options\n * @param {Boolean|Object} flyTo If false, animating the map to a selected result is disabled. If true, animating the map will use the default animation parameters. If an object, it will be passed as `options` to the map [`flyTo`](https://docs.mapbox.com/mapbox-gl-js/api/#map#flyto) or [`fitBounds`](https://docs.mapbox.com/mapbox-gl-js/api/#map#fitbounds) method providing control over the animation of the transition.\n */\n setFlyTo: function(flyTo){\n this.options.flyTo = flyTo;\n return this;\n },\n\n /**\n * Get the value of the placeholder string\n * @returns {String} The input element's placeholder value\n */\n getPlaceholder: function(){\n return this.options.placeholder;\n },\n\n /**\n * Set the value of the input element's placeholder\n * @param {String} placeholder the text to use as the input element's placeholder\n * @returns {MapboxGeocoder} this\n */\n setPlaceholder: function(placeholder){\n this.options.placeholder = (placeholder) ? placeholder : this._getPlaceholderText();\n this._inputEl.placeholder = this.options.placeholder;\n this._inputEl.setAttribute('aria-label', this.options.placeholder);\n return this\n },\n\n /**\n * Get the bounding box used by the plugin\n * @returns {Array} the bounding box, if any\n */\n getBbox: function(){\n return this.options.bbox;\n },\n\n /**\n * Set the bounding box to limit search results to\n * @param {Array} bbox a bounding box given as an array in the format [minX, minY, maxX, maxY].\n * @returns {MapboxGeocoder} this\n */\n setBbox: function(bbox){\n this.options.bbox = bbox;\n return this;\n },\n\n /**\n * Get a list of the countries to limit search results to\n * @returns {String} a comma separated list of countries to limit to, if any\n */\n getCountries: function(){\n return this.options.countries;\n },\n\n /**\n * Set the countries to limit search results to\n * @param {String} countries a comma separated list of countries to limit to\n * @returns {MapboxGeocoder} this\n */\n setCountries: function(countries){\n this.options.countries = countries;\n return this;\n },\n\n /**\n * Get a list of the types to limit search results to\n * @returns {String} a comma separated list of types to limit to\n */\n getTypes: function(){\n return this.options.types;\n },\n\n /**\n * Set the types to limit search results to\n * @param {String} countries a comma separated list of types to limit to\n * @returns {MapboxGeocoder} this\n */\n setTypes: function(types){\n this.options.types = types;\n return this;\n },\n\n /**\n * Get the minimum number of characters typed to trigger results used in the plugin\n * @returns {Number} The minimum length in characters before a search is triggered\n */\n getMinLength: function(){\n return this.options.minLength;\n },\n\n /**\n * Set the minimum number of characters typed to trigger results used by the plugin\n * @param {Number} minLength the minimum length in characters\n * @returns {MapboxGeocoder} this\n */\n setMinLength: function(minLength){\n this.options.minLength = minLength;\n if (this._typeahead) this._typeahead.options.minLength = minLength;\n return this;\n },\n\n /**\n * Get the limit value for the number of results to display used by the plugin\n * @returns {Number} The limit value for the number of results to display used by the plugin\n */\n getLimit: function(){\n return this.options.limit;\n },\n\n /**\n * Set the limit value for the number of results to display used by the plugin\n * @param {Number} limit the number of search results to return\n * @returns {MapboxGeocoder}\n */\n setLimit: function(limit){\n this.options.limit = limit;\n if (this._typeahead) this._typeahead.options.limit = limit;\n return this;\n },\n\n /**\n * Get the filter function used by the plugin\n * @returns {Function} the filter function\n */\n getFilter: function(){\n return this.options.filter;\n },\n\n /**\n * Set the filter function used by the plugin.\n * @param {Function} filter A function which accepts a Feature in the [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) format to filter out results from the Geocoding API response before they are included in the suggestions list. Return `true` to keep the item, `false` otherwise.\n * @returns {MapboxGeocoder} this\n */\n setFilter: function(filter){\n this.options.filter = filter;\n return this;\n },\n\n /**\n * Set the geocoding endpoint used by the plugin.\n * @param {Function} origin A function which accepts an HTTPS URL to specify the endpoint to query results from.\n * @returns {MapboxGeocoder} this\n */\n setOrigin: function(origin){\n this.options.origin = origin;\n this.geocoderService = mbxGeocoder(\n MapboxClient({\n accessToken: this.options.accessToken,\n origin: this.options.origin\n })\n );\n return this;\n },\n\n /**\n * Get the geocoding endpoint the plugin is currently set to\n * @returns {Function} the endpoint URL\n */\n getOrigin: function(){\n return this.options.origin;\n },\n\n /**\n * Set the accessToken option used for the geocoding request endpoint.\n * @param {String} accessToken value\n * @returns {MapboxGeocoder} this\n */\n setAccessToken: function(accessToken){\n this.options.accessToken = accessToken;\n this.geocoderService = mbxGeocoder(\n MapboxClient({\n accessToken: this.options.accessToken,\n origin: this.options.origin\n })\n );\n return this;\n },\n\n /**\n * Set the autocomplete option used for geocoding requests\n * @param {Boolean} value The boolean value to set autocomplete to\n * @returns\n */\n setAutocomplete: function(value){\n this.options.autocomplete = value;\n return this;\n },\n\n /**\n * Get the current autocomplete parameter value used for requests\n * @returns {Boolean} The autocomplete parameter value\n */\n getAutocomplete: function(){\n return this.options.autocomplete\n },\n\n /**\n * Set the fuzzyMatch option used for approximate matching in geocoding requests\n * @param {Boolean} value The boolean value to set fuzzyMatch to\n * @returns\n */\n setFuzzyMatch: function(value){\n this.options.fuzzyMatch = value;\n return this;\n },\n\n /**\n * Get the current fuzzyMatch parameter value used for requests\n * @returns {Boolean} The fuzzyMatch parameter value\n */\n getFuzzyMatch: function(){\n return this.options.fuzzyMatch\n },\n\n /**\n * Set the routing parameter used to ask for routable point metadata in geocoding requests\n * @param {Boolean} value The boolean value to set routing to\n * @returns\n */\n setRouting: function(value){\n this.options.routing = value;\n return this;\n },\n\n /**\n * Get the current routing parameter value used for requests\n * @returns {Boolean} The routing parameter value\n */\n getRouting: function(){\n return this.options.routing\n },\n\n /**\n * Set the worldview parameter\n * @param {String} code The country code representing the worldview (e.g. \"us\" | \"cn\" | \"jp\", \"in\")\n * @returns\n */\n setWorldview: function(code){\n this.options.worldview = code;\n return this;\n },\n\n /**\n * Get the current worldview parameter value used for requests\n * @returns {String} The worldview parameter value\n */\n getWorldview: function(){\n return this.options.worldview\n },\n\n /**\n * Handle the placement of a result marking the selected result\n * @private\n * @param {Object} selected the selected geojson feature\n * @returns {MapboxGeocoder} this\n */\n _handleMarker: function(selected){\n // clean up any old marker that might be present\n if (!this._map){\n return;\n }\n this._removeMarker();\n var defaultMarkerOptions = {\n color: '#4668F2'\n }\n var markerOptions = extend({}, defaultMarkerOptions, this.options.marker)\n this.mapMarker = new this._mapboxgl.Marker(markerOptions);\n if (selected.center) {\n this.mapMarker\n .setLngLat(selected.center)\n .addTo(this._map);\n } else if (selected.geometry && selected.geometry.type && selected.geometry.type === 'Point' && selected.geometry.coordinates) {\n this.mapMarker\n .setLngLat(selected.geometry.coordinates)\n .addTo(this._map);\n }\n return this;\n },\n\n /**\n * Handle the removal of a result marker\n * @private\n */\n _removeMarker: function(){\n if (this.mapMarker){\n this.mapMarker.remove();\n this.mapMarker = null;\n }\n },\n\n /**\n * Subscribe to events that happen within the plugin.\n * @param {String} type name of event. Available events and the data passed into their respective event objects are:\n *\n * - __clear__ `Emitted when the input is cleared`\n * - __loading__ `{ query } Emitted when the geocoder is looking up a query`\n * - __results__ `{ results } Fired when the geocoder returns a response`\n * - __result__ `{ result } Fired when input is set`\n * - __error__ `{ error } Error as string`\n * @param {Function} fn function that's called when the event is emitted.\n * @returns {MapboxGeocoder} this;\n */\n on: function(type, fn) {\n this._eventEmitter.on(type, fn);\n return this;\n },\n\n /**\n * Remove an event\n * @returns {MapboxGeocoder} this\n * @param {String} type Event name.\n * @param {Function} fn Function that should unsubscribe to the event emitted.\n */\n off: function(type, fn) {\n this._eventEmitter.removeListener(type, fn);\n this.eventManager.remove();\n return this;\n }\n};\n\nmodule.exports = MapboxGeocoder;\n","'use strict';\n\n/**\n * Localized values for the placeholder string\n * \n * @private\n */\nvar placeholder = {\n // list drawn from https://docs.mapbox.com/api/search/#language-coverage\n 'de': 'Suche', // german\n 'it': 'Ricerca', //italian\n 'en': 'Search', // english\n 'nl': 'Zoeken', //dutch\n 'fr': 'Chercher', //french\n 'ca': 'Cerca', //catalan\n 'he': 'לחפש', //hebrew\n 'ja': 'サーチ', //japanese\n 'lv': 'Meklēt', //latvian\n 'pt': 'Procurar', //portuguese \n 'sr': 'Претрага', //serbian\n 'zh': '搜索', //chinese-simplified\n 'cs': 'Vyhledávání', //czech\n 'hu': 'Keresés', //hungarian\n 'ka': 'ძიება', // georgian\n 'nb': 'Søke', //norwegian\n 'sk': 'Vyhľadávanie', //slovak\n 'th': 'ค้นหา', //thai\n 'fi': 'Hae',//finnish\n 'is': 'Leita',//icelandic\n 'ko': '수색',//korean\n 'pl': 'Szukaj', //polish\n 'sl': 'Iskanje', //slovenian\n 'fa': 'جستجو', //persian(aka farsi)\n 'ru': 'Поиск'//russian\n}\n\nmodule.exports = {placeholder: placeholder};\n","/**\n * This function transforms the feature from reverse geocoding to plain text with specified accuracy\n * @param {object} feature \n * @param {string} accuracy \n * @returns \n */\nfunction transformFeatureToGeolocationText(feature, accuracy) {\n const addrInfo = getAddressInfo(feature);\n\n const addressAccuracy = ['address', 'street', 'place', 'country'];\n var currentAccuracy;\n\n if (typeof accuracy === 'function') {\n return accuracy(addrInfo)\n }\n\n const accuracyIndex = addressAccuracy.indexOf(accuracy);\n\n if (accuracyIndex === -1) {\n currentAccuracy = addressAccuracy;\n } else {\n currentAccuracy = addressAccuracy.slice(accuracyIndex);\n }\n\n return currentAccuracy.reduce(function(acc, name) {\n if (!addrInfo[name]) {\n return acc;\n }\n\n if (acc !== '') {\n acc = acc + ', ';\n }\n\n return acc + addrInfo[name];\n }, '');\n}\n/**\n * This function transforms the feature from reverse geocoding to AddressInfo object\n * @param {object} feature \n * @returns {object}\n */\nfunction getAddressInfo(feature) {\n const houseNumber = feature.address || '';\n const street = feature.text || '';\n const placeName = feature.place_name || '';\n const address = placeName.split(',')[0];\n\n const addrInfo = {\n address: address,\n houseNumber: houseNumber,\n street: street,\n placeName: placeName,\n }\n\n feature.context.forEach(function (context) {\n const layer = context.id.split('.')[0];\n addrInfo[layer] = context.text;\n });\n\n return addrInfo;\n}\n\nconst REVERSE_GEOCODE_COORD_RGX = /^[ ]*(-?\\d{1,3}(\\.\\d{0,256})?)[, ]+(-?\\d{1,3}(\\.\\d{0,256})?)[ ]*$/;\n\nmodule.exports = {\n transformFeatureToGeolocationText: transformFeatureToGeolocationText,\n getAddressInfo: getAddressInfo,\n REVERSE_GEOCODE_COORD_RGX: REVERSE_GEOCODE_COORD_RGX,\n}","'use strict';\n\nvar client = require('./lib/client');\n\nmodule.exports = client;\n","'use strict';\n\nvar browser = require('./browser-layer');\nvar MapiClient = require('../classes/mapi-client');\n\nfunction BrowserClient(options) {\n MapiClient.call(this, options);\n}\nBrowserClient.prototype = Object.create(MapiClient.prototype);\nBrowserClient.prototype.constructor = BrowserClient;\n\nBrowserClient.prototype.sendRequest = browser.browserSend;\nBrowserClient.prototype.abortRequest = browser.browserAbort;\n\n/**\n * Create a client for the browser.\n *\n * @param {Object} options\n * @param {string} options.accessToken\n * @param {string} [options.origin]\n * @returns {MapiClient}\n */\nfunction createBrowserClient(options) {\n return new BrowserClient(options);\n}\n\nmodule.exports = createBrowserClient;\n","'use strict';\n\nvar MapiResponse = require('../classes/mapi-response');\nvar MapiError = require('../classes/mapi-error');\nvar constants = require('../constants');\nvar parseHeaders = require('../helpers/parse-headers');\n\n// Keys are request IDs, values are XHRs.\nvar requestsUnderway = {};\n\nfunction browserAbort(request) {\n var xhr = requestsUnderway[request.id];\n if (!xhr) return;\n xhr.abort();\n delete requestsUnderway[request.id];\n}\n\nfunction createResponse(request, xhr) {\n return new MapiResponse(request, {\n body: xhr.response,\n headers: parseHeaders(xhr.getAllResponseHeaders()),\n statusCode: xhr.status\n });\n}\n\nfunction normalizeBrowserProgressEvent(event) {\n var total = event.total;\n var transferred = event.loaded;\n var percent = (100 * transferred) / total;\n return {\n total: total,\n transferred: transferred,\n percent: percent\n };\n}\n\nfunction sendRequestXhr(request, xhr) {\n return new Promise(function(resolve, reject) {\n xhr.onprogress = function(event) {\n request.emitter.emit(\n constants.EVENT_PROGRESS_DOWNLOAD,\n normalizeBrowserProgressEvent(event)\n );\n };\n\n var file = request.file;\n if (file) {\n xhr.upload.onprogress = function(event) {\n request.emitter.emit(\n constants.EVENT_PROGRESS_UPLOAD,\n normalizeBrowserProgressEvent(event)\n );\n };\n }\n\n xhr.onerror = function(error) {\n reject(error);\n };\n\n xhr.onabort = function() {\n var mapiError = new MapiError({\n request: request,\n type: constants.ERROR_REQUEST_ABORTED\n });\n reject(mapiError);\n };\n\n xhr.onload = function() {\n delete requestsUnderway[request.id];\n if (xhr.status < 200 || xhr.status >= 400) {\n var mapiError = new MapiError({\n request: request,\n body: xhr.response,\n statusCode: xhr.status\n });\n reject(mapiError);\n return;\n }\n resolve(xhr);\n };\n\n var body = request.body;\n\n // matching service needs to send a www-form-urlencoded request\n if (typeof body === 'string') {\n xhr.send(body);\n } else if (body) {\n xhr.send(JSON.stringify(body));\n } else if (file) {\n xhr.send(file);\n } else {\n xhr.send();\n }\n\n requestsUnderway[request.id] = xhr;\n }).then(function(xhr) {\n return createResponse(request, xhr);\n });\n}\n\n// The accessToken argument gives this function flexibility\n// for Mapbox's internal client.\nfunction createRequestXhr(request, accessToken) {\n var url = request.url(accessToken);\n var xhr = new window.XMLHttpRequest();\n xhr.open(request.method, url);\n Object.keys(request.headers).forEach(function(key) {\n xhr.setRequestHeader(key, request.headers[key]);\n });\n return xhr;\n}\n\nfunction browserSend(request) {\n return Promise.resolve().then(function() {\n var xhr = createRequestXhr(request, request.client.accessToken);\n return sendRequestXhr(request, xhr);\n });\n}\n\nmodule.exports = {\n browserAbort: browserAbort,\n sendRequestXhr: sendRequestXhr,\n browserSend: browserSend,\n createRequestXhr: createRequestXhr\n};\n","'use strict';\n\nvar parseToken = require('@mapbox/parse-mapbox-token');\nvar MapiRequest = require('./mapi-request');\nvar constants = require('../constants');\n\n/**\n * A low-level Mapbox API client. Use it to create service clients\n * that share the same configuration.\n *\n * Services and `MapiRequest`s use the underlying `MapiClient` to\n * determine how to create, send, and abort requests in a way\n * that is appropriate to the configuration and environment\n * (Node or the browser).\n *\n * @class MapiClient\n * @property {string} accessToken - The Mapbox access token assigned\n * to this client.\n * @property {string} [origin] - The origin\n * to use for API requests. Defaults to https://api.mapbox.com.\n */\n\nfunction MapiClient(options) {\n if (!options || !options.accessToken) {\n throw new Error('Cannot create a client without an access token');\n }\n // Try parsing the access token to determine right away if it's valid.\n parseToken(options.accessToken);\n\n this.accessToken = options.accessToken;\n this.origin = options.origin || constants.API_ORIGIN;\n}\n\nMapiClient.prototype.createRequest = function createRequest(requestOptions) {\n return new MapiRequest(this, requestOptions);\n};\n\nmodule.exports = MapiClient;\n","'use strict';\n\nvar constants = require('../constants');\n\n/**\n * A Mapbox API error.\n *\n * If there's an error during the API transaction,\n * the Promise returned by `MapiRequest`'s [`send`](#send)\n * method should reject with a `MapiError`.\n *\n * @class MapiError\n * @hideconstructor\n * @property {MapiRequest} request - The errored request.\n * @property {string} type - The type of error. Usually this is `'HttpError'`.\n * If the request was aborted, so the error was\n * not sent from the server, the type will be\n * `'RequestAbortedError'`.\n * @property {number} [statusCode] - The numeric status code of\n * the HTTP response.\n * @property {Object | string} [body] - If the server sent a response body,\n * this property exposes that response, parsed as JSON if possible.\n * @property {string} [message] - Whatever message could be derived from the\n * call site and HTTP response.\n *\n * @param {MapiRequest} options.request\n * @param {number} [options.statusCode]\n * @param {string} [options.body]\n * @param {string} [options.message]\n * @param {string} [options.type]\n */\nfunction MapiError(options) {\n var errorType = options.type || constants.ERROR_HTTP;\n\n var body;\n if (options.body) {\n try {\n body = JSON.parse(options.body);\n } catch (e) {\n body = options.body;\n }\n } else {\n body = null;\n }\n\n var message = options.message || null;\n if (!message) {\n if (typeof body === 'string') {\n message = body;\n } else if (body && typeof body.message === 'string') {\n message = body.message;\n } else if (errorType === constants.ERROR_REQUEST_ABORTED) {\n message = 'Request aborted';\n }\n }\n\n this.message = message;\n this.type = errorType;\n this.statusCode = options.statusCode || null;\n this.request = options.request;\n this.body = body;\n}\n\nmodule.exports = MapiError;\n","'use strict';\n\nvar parseToken = require('@mapbox/parse-mapbox-token');\nvar xtend = require('xtend');\nvar EventEmitter = require('eventemitter3');\nvar urlUtils = require('../helpers/url-utils');\nvar constants = require('../constants');\n\nvar requestId = 1;\n\n/**\n * A Mapbox API request.\n *\n * Note that creating a `MapiRequest` does *not* send the request automatically.\n * Use the request's `send` method to send it off and get a `Promise`.\n *\n * The `emitter` property is an `EventEmitter` that emits the following events:\n *\n * - `'response'` - Listeners will be called with a `MapiResponse`.\n * - `'error'` - Listeners will be called with a `MapiError`.\n * - `'downloadProgress'` - Listeners will be called with `ProgressEvents`.\n * - `'uploadProgress'` - Listeners will be called with `ProgressEvents`.\n * Upload events are only available when the request includes a file.\n *\n * @class MapiRequest\n * @property {EventEmitter} emitter - An event emitter. See above.\n * @property {MapiClient} client - This request's `MapiClient`.\n * @property {MapiResponse|null} response - If this request has been sent and received\n * a response, the response is available on this property.\n * @property {MapiError|Error|null} error - If this request has been sent and\n * received an error in response, the error is available on this property.\n * @property {boolean} aborted - If the request has been aborted\n * (via [`abort`](#abort)), this property will be `true`.\n * @property {boolean} sent - If the request has been sent, this property will\n * be `true`. You cannot send the same request twice, so if you need to create\n * a new request that is the equivalent of an existing one, use\n * [`clone`](#clone).\n * @property {string} path - The request's path, including colon-prefixed route\n * parameters.\n * @property {string} origin - The request's origin.\n * @property {string} method - The request's HTTP method.\n * @property {Object} query - A query object, which will be transformed into\n * a URL query string.\n * @property {Object} params - A route parameters object, whose values will\n * be interpolated the path.\n * @property {Object} headers - The request's headers.\n * @property {Object|string|null} body - Data to send with the request.\n * If the request has a body, it will also be sent with the header\n * `'Content-Type: application/json'`.\n * @property {Blob|ArrayBuffer|string|ReadStream} file - A file to\n * send with the request. The browser client accepts Blobs and ArrayBuffers;\n * the Node client accepts strings (filepaths) and ReadStreams.\n * @property {string} encoding - The encoding of the response.\n * @property {string} sendFileAs - The method to send the `file`. Options are\n * `data` (x-www-form-urlencoded) or `form` (multipart/form-data).\n */\n\n/**\n * @ignore\n * @param {MapiClient} client\n * @param {Object} options\n * @param {string} options.method\n * @param {string} options.path\n * @param {Object} [options.query={}]\n * @param {Object} [options.params={}]\n * @param {string} [options.origin]\n * @param {Object} [options.headers]\n * @param {Object} [options.body=null]\n * @param {Blob|ArrayBuffer|string|ReadStream} [options.file=null]\n * @param {string} [options.encoding=utf8]\n */\nfunction MapiRequest(client, options) {\n if (!client) {\n throw new Error('MapiRequest requires a client');\n }\n if (!options || !options.path || !options.method) {\n throw new Error(\n 'MapiRequest requires an options object with path and method properties'\n );\n }\n\n var defaultHeaders = {};\n if (options.body) {\n defaultHeaders['content-type'] = 'application/json';\n }\n\n var headersWithDefaults = xtend(defaultHeaders, options.headers);\n\n // Disallows duplicate header names of mixed case,\n // e.g. Content-Type and content-type.\n var headers = Object.keys(headersWithDefaults).reduce(function(memo, name) {\n memo[name.toLowerCase()] = headersWithDefaults[name];\n return memo;\n }, {});\n\n this.id = requestId++;\n this._options = options;\n\n this.emitter = new EventEmitter();\n this.client = client;\n this.response = null;\n this.error = null;\n this.sent = false;\n this.aborted = false;\n this.path = options.path;\n this.method = options.method;\n this.origin = options.origin || client.origin;\n this.query = options.query || {};\n this.params = options.params || {};\n this.body = options.body || null;\n this.file = options.file || null;\n this.encoding = options.encoding || 'utf8';\n this.sendFileAs = options.sendFileAs || null;\n this.headers = headers;\n}\n\n/**\n * Get the URL of the request.\n *\n * @param {string} [accessToken] - By default, the access token of the request's\n * client is used.\n * @return {string}\n */\nMapiRequest.prototype.url = function url(accessToken) {\n var url = urlUtils.prependOrigin(this.path, this.origin);\n url = urlUtils.appendQueryObject(url, this.query);\n var routeParams = this.params;\n var actualAccessToken =\n accessToken == null ? this.client.accessToken : accessToken;\n if (actualAccessToken) {\n url = urlUtils.appendQueryParam(url, 'access_token', actualAccessToken);\n var accessTokenOwnerId = parseToken(actualAccessToken).user;\n routeParams = xtend({ ownerId: accessTokenOwnerId }, routeParams);\n }\n url = urlUtils.interpolateRouteParams(url, routeParams);\n return url;\n};\n\n/**\n * Send the request. Returns a Promise that resolves with a `MapiResponse`.\n * You probably want to use `response.body`.\n *\n * `send` only retrieves the first page of paginated results. You can get\n * the next page by using the `MapiResponse`'s [`nextPage`](#nextpage)\n * function, or iterate through all pages using [`eachPage`](#eachpage)\n * instead of `send`.\n *\n * @returns {Promise}\n */\nMapiRequest.prototype.send = function send() {\n var self = this;\n\n if (self.sent) {\n throw new Error(\n 'This request has already been sent. Check the response and error properties. Create a new request with clone().'\n );\n }\n self.sent = true;\n\n return self.client.sendRequest(self).then(\n function(response) {\n self.response = response;\n self.emitter.emit(constants.EVENT_RESPONSE, response);\n return response;\n },\n function(error) {\n self.error = error;\n self.emitter.emit(constants.EVENT_ERROR, error);\n throw error;\n }\n );\n};\n\n/**\n * Abort the request.\n *\n * Any pending `Promise` returned by [`send`](#send) will be rejected with\n * an error with `type: 'RequestAbortedError'`. If you've created a request\n * that might be aborted, you need to catch and handle such errors.\n *\n * This method will also abort any requests created while fetching subsequent\n * pages via [`eachPage`](#eachpage).\n *\n * If the request has not been sent or has already been aborted, nothing\n * will happen.\n */\nMapiRequest.prototype.abort = function abort() {\n if (this._nextPageRequest) {\n this._nextPageRequest.abort();\n delete this._nextPageRequest;\n }\n\n if (this.response || this.error || this.aborted) return;\n\n this.aborted = true;\n this.client.abortRequest(this);\n};\n\n/**\n * Invoke a callback for each page of a paginated API response.\n *\n * The callback should have the following signature:\n *\n * ```js\n * (\n * error: MapiError,\n * response: MapiResponse,\n * next: () => void\n * ) => void\n * ```\n *\n * **The next page will not be fetched until you've invoked the\n * `next` callback**, indicating that you're ready for it.\n *\n * @param {Function} callback\n */\nMapiRequest.prototype.eachPage = function eachPage(callback) {\n var self = this;\n\n function handleResponse(response) {\n function getNextPage() {\n delete self._nextPageRequest;\n var nextPageRequest = response.nextPage();\n if (nextPageRequest) {\n self._nextPageRequest = nextPageRequest;\n getPage(nextPageRequest);\n }\n }\n callback(null, response, getNextPage);\n }\n\n function handleError(error) {\n callback(error, null, function() {});\n }\n\n function getPage(request) {\n request.send().then(handleResponse, handleError);\n }\n getPage(this);\n};\n\n/**\n * Clone this request.\n *\n * Each request can only be sent *once*. So if you'd like to send the\n * same request again, clone it and send away.\n *\n * @returns {MapiRequest} - A new `MapiRequest` configured just like this one.\n */\nMapiRequest.prototype.clone = function clone() {\n return this._extend();\n};\n\n/**\n * @ignore\n */\nMapiRequest.prototype._extend = function _extend(options) {\n var extendedOptions = xtend(this._options, options);\n return new MapiRequest(this.client, extendedOptions);\n};\n\nmodule.exports = MapiRequest;\n","'use strict';\n\nvar parseLinkHeader = require('../helpers/parse-link-header');\n\n/**\n * A Mapbox API response.\n *\n * @class MapiResponse\n * @property {Object} body - The response body, parsed as JSON.\n * @property {string} rawBody - The raw response body.\n * @property {number} statusCode - The response's status code.\n * @property {Object} headers - The parsed response headers.\n * @property {Object} links - The parsed response links.\n * @property {MapiRequest} request - The response's originating `MapiRequest`.\n */\n\n/**\n * @ignore\n * @param {MapiRequest} request\n * @param {Object} responseData\n * @param {Object} responseData.headers\n * @param {string} responseData.body\n * @param {number} responseData.statusCode\n */\nfunction MapiResponse(request, responseData) {\n this.request = request;\n this.headers = responseData.headers;\n this.rawBody = responseData.body;\n this.statusCode = responseData.statusCode;\n try {\n this.body = JSON.parse(responseData.body || '{}');\n } catch (parseError) {\n this.body = responseData.body;\n }\n this.links = parseLinkHeader(this.headers.link);\n}\n\n/**\n * Check if there is a next page that you can fetch.\n *\n * @returns {boolean}\n */\nMapiResponse.prototype.hasNextPage = function hasNextPage() {\n return !!this.links.next;\n};\n\n/**\n * Create a request for the next page, if there is one.\n * If there is no next page, returns `null`.\n *\n * @returns {MapiRequest | null}\n */\nMapiResponse.prototype.nextPage = function nextPage() {\n if (!this.hasNextPage()) return null;\n return this.request._extend({\n path: this.links.next.url\n });\n};\n\nmodule.exports = MapiResponse;\n","'use strict';\n\nmodule.exports = {\n API_ORIGIN: 'https://api.mapbox.com',\n EVENT_PROGRESS_DOWNLOAD: 'downloadProgress',\n EVENT_PROGRESS_UPLOAD: 'uploadProgress',\n EVENT_ERROR: 'error',\n EVENT_RESPONSE: 'response',\n ERROR_HTTP: 'HttpError',\n ERROR_REQUEST_ABORTED: 'RequestAbortedError'\n};\n","'use strict';\n\nfunction parseSingleHeader(raw) {\n var boundary = raw.indexOf(':');\n var name = raw\n .substring(0, boundary)\n .trim()\n .toLowerCase();\n var value = raw.substring(boundary + 1).trim();\n return {\n name: name,\n value: value\n };\n}\n\n/**\n * Parse raw headers into an object with lowercase properties.\n * Does not fully parse headings into more complete data structure,\n * as larger libraries might do. Also does not deal with duplicate\n * headers because Node doesn't seem to deal with those well, so\n * we shouldn't let the browser either, for consistency.\n *\n * @param {string} raw\n * @returns {Object}\n */\nfunction parseHeaders(raw) {\n var headers = {};\n if (!raw) {\n return headers;\n }\n\n raw\n .trim()\n .split(/[\\r|\\n]+/)\n .forEach(function(rawHeader) {\n var parsed = parseSingleHeader(rawHeader);\n headers[parsed.name] = parsed.value;\n });\n\n return headers;\n}\n\nmodule.exports = parseHeaders;\n","'use strict';\n\n// Like https://github.com/thlorenz/lib/parse-link-header but without any\n// additional dependencies.\n\nfunction parseParam(param) {\n var parts = param.match(/\\s*(.+)\\s*=\\s*\"?([^\"]+)\"?/);\n if (!parts) return null;\n\n return {\n key: parts[1],\n value: parts[2]\n };\n}\n\nfunction parseLink(link) {\n var parts = link.match(/]*)>(.*)/);\n if (!parts) return null;\n\n var linkUrl = parts[1];\n var linkParams = parts[2].split(';');\n var rel = null;\n var parsedLinkParams = linkParams.reduce(function(result, param) {\n var parsed = parseParam(param);\n if (!parsed) return result;\n if (parsed.key === 'rel') {\n if (!rel) {\n rel = parsed.value;\n }\n return result;\n }\n result[parsed.key] = parsed.value;\n return result;\n }, {});\n if (!rel) return null;\n\n return {\n url: linkUrl,\n rel: rel,\n params: parsedLinkParams\n };\n}\n\n/**\n * Parse a Link header.\n *\n * @param {string} linkHeader\n * @returns {{\n * [string]: {\n * url: string,\n * params: { [string]: string }\n * }\n * }}\n */\nfunction parseLinkHeader(linkHeader) {\n if (!linkHeader) return {};\n\n return linkHeader.split(/,\\s*>} [value] - Provide an array\n * if the value is a list and commas between values need to be\n * preserved, unencoded.\n * @returns {string} - Modified URL.\n */\nfunction appendQueryParam(url, key, value) {\n if (value === false || value === null) {\n return url;\n }\n var punctuation = /\\?/.test(url) ? '&' : '?';\n var query = encodeURIComponent(key);\n if (value !== undefined && value !== '' && value !== true) {\n query += '=' + encodeValue(value);\n }\n return '' + url + punctuation + query;\n}\n\n/**\n * Derive a query string from an object and append it\n * to a URL.\n *\n * @param {string} url\n * @param {Object} [queryObject] - Values should be primitives.\n * @returns {string} - Modified URL.\n */\nfunction appendQueryObject(url, queryObject) {\n if (!queryObject) {\n return url;\n }\n\n var result = url;\n Object.keys(queryObject).forEach(function(key) {\n var value = queryObject[key];\n if (value === undefined) {\n return;\n }\n if (Array.isArray(value)) {\n value = value\n .filter(function(v) {\n return v !== null && v !== undefined;\n })\n .join(',');\n }\n result = appendQueryParam(result, key, value);\n });\n return result;\n}\n\n/**\n * Prepend an origin to a URL. If the URL already has an\n * origin, do nothing.\n *\n * @param {string} url\n * @param {string} origin\n * @returns {string} - Modified URL.\n */\nfunction prependOrigin(url, origin) {\n if (!origin) {\n return url;\n }\n\n if (url.slice(0, 4) === 'http') {\n return url;\n }\n\n var delimiter = url[0] === '/' ? '' : '/';\n return '' + origin.replace(/\\/$/, '') + delimiter + url;\n}\n\n/**\n * Interpolate values into a route with express-style,\n * colon-prefixed route parameters.\n *\n * @param {string} route\n * @param {Object} [params] - Values should be primitives\n * or arrays of primitives. Provide an array if the value\n * is a list and commas between values need to be\n * preserved, unencoded.\n * @returns {string} - Modified URL.\n */\nfunction interpolateRouteParams(route, params) {\n if (!params) {\n return route;\n }\n return route.replace(/\\/:([a-zA-Z0-9]+)/g, function(_, paramId) {\n var value = params[paramId];\n if (value === undefined) {\n throw new Error('Unspecified route parameter ' + paramId);\n }\n var preppedValue = encodeValue(value);\n return '/' + preppedValue;\n });\n}\n\nmodule.exports = {\n appendQueryObject: appendQueryObject,\n appendQueryParam: appendQueryParam,\n prependOrigin: prependOrigin,\n interpolateRouteParams: interpolateRouteParams\n};\n","'use strict';\n\nvar xtend = require('xtend');\nvar v = require('./service-helpers/validator');\nvar pick = require('./service-helpers/pick');\nvar stringifyBooleans = require('./service-helpers/stringify-booleans');\nvar createServiceFactory = require('./service-helpers/create-service-factory');\n\n/**\n * Geocoding API service.\n *\n * Learn more about this service and its responses in\n * [the HTTP service documentation](https://docs.mapbox.com/api/search/#geocoding).\n */\nvar Geocoding = {};\n\nvar featureTypes = [\n 'country',\n 'region',\n 'postcode',\n 'district',\n 'place',\n 'locality',\n 'neighborhood',\n 'address',\n 'poi',\n 'poi.landmark'\n];\n\n/**\n * Search for a place.\n *\n * See the [public documentation](https://docs.mapbox.com/api/search/#forward-geocoding).\n *\n * @param {Object} config\n * @param {string} config.query - A place name.\n * @param {'mapbox.places'|'mapbox.places-permanent'} [config.mode=\"mapbox.places\"] - Either `mapbox.places` for ephemeral geocoding, or `mapbox.places-permanent` for storing results and batch geocoding.\n * @param {Array} [config.countries] - Limits results to the specified countries.\n * Each item in the array should be an [ISO 3166 alpha 2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).\n * @param {Coordinates|'ip'} [config.proximity] - Bias local results based on a provided coordinate location or a user's IP address.\n * @param {Array<'country'|'region'|'postcode'|'district'|'place'|'locality'|'neighborhood'|'address'|'poi'|'poi.landmark'>} [config.types] - Filter results by feature types.\n * @param {boolean} [config.autocomplete=true] - Return autocomplete results or not.\n * @param {BoundingBox} [config.bbox] - Limit results to a bounding box.\n * @param {number} [config.limit=5] - Limit the number of results returned.\n * @param {Array} [config.language] - Specify the language to use for response text and, for forward geocoding, query result weighting.\n * Options are [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) comprised of a mandatory\n * [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and optionally one or more IETF subtags for country or script.\n * @param {boolean} [config.routing=false] - Specify whether to request additional metadata about the recommended navigation destination. Only applicable for address features.\n * @param {boolean} [config.fuzzyMatch=true] - Specify whether the Geocoding API should attempt approximate, as well as exact, matching.\n * @param {String} [config.worldview=\"us\"] - Filter results to geographic features whose characteristics are defined differently by audiences belonging to various regional, cultural, or political groups.\n * @param {String} [config.session_token] - A unique session identifier generated by the client.\n * @return {MapiRequest}\n *\n * @example\n * geocodingClient.forwardGeocode({\n * query: 'Paris, France',\n * limit: 2\n * })\n * .send()\n * .then(response => {\n * const match = response.body;\n * });\n *\n * @example\n * // geocoding with proximity\n * geocodingClient.forwardGeocode({\n * query: 'Paris, France',\n * proximity: [-95.4431142, 33.6875431]\n * })\n * .send()\n * .then(response => {\n * const match = response.body;\n * });\n *\n * // geocoding with countries\n * geocodingClient.forwardGeocode({\n * query: 'Paris, France',\n * countries: ['fr']\n * })\n * .send()\n * .then(response => {\n * const match = response.body;\n * });\n *\n * // geocoding with bounding box\n * geocodingClient.forwardGeocode({\n * query: 'Paris, France',\n * bbox: [2.14, 48.72, 2.55, 48.96]\n * })\n * .send()\n * .then(response => {\n * const match = response.body;\n * });\n */\nGeocoding.forwardGeocode = function(config) {\n v.assertShape({\n query: v.required(v.string),\n mode: v.oneOf('mapbox.places', 'mapbox.places-permanent'),\n countries: v.arrayOf(v.string),\n proximity: v.oneOf(v.coordinates, 'ip'),\n types: v.arrayOf(v.oneOf(featureTypes)),\n autocomplete: v.boolean,\n bbox: v.arrayOf(v.number),\n limit: v.number,\n language: v.arrayOf(v.string),\n routing: v.boolean,\n fuzzyMatch: v.boolean,\n worldview: v.string,\n session_token: v.string\n })(config);\n\n config.mode = config.mode || 'mapbox.places';\n\n var query = stringifyBooleans(\n xtend(\n { country: config.countries },\n pick(config, [\n 'proximity',\n 'types',\n 'autocomplete',\n 'bbox',\n 'limit',\n 'language',\n 'routing',\n 'fuzzyMatch',\n 'worldview',\n 'session_token'\n ])\n )\n );\n\n return this.client.createRequest({\n method: 'GET',\n path: '/geocoding/v5/:mode/:query.json',\n params: pick(config, ['mode', 'query']),\n query: query\n });\n};\n\n/**\n * Search for places near coordinates.\n *\n * See the [public documentation](https://docs.mapbox.com/api/search/#reverse-geocoding).\n *\n * @param {Object} config\n * @param {Coordinates} config.query - Coordinates at which features will be searched.\n * @param {'mapbox.places'|'mapbox.places-permanent'} [config.mode=\"mapbox.places\"] - Either `mapbox.places` for ephemeral geocoding, or `mapbox.places-permanent` for storing results and batch geocoding.\n * @param {Array} [config.countries] - Limits results to the specified countries.\n * Each item in the array should be an [ISO 3166 alpha 2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).\n * @param {Array<'country'|'region'|'postcode'|'district'|'place'|'locality'|'neighborhood'|'address'|'poi'|'poi.landmark'>} [config.types] - Filter results by feature types.\n * @param {BoundingBox} [config.bbox] - Limit results to a bounding box.\n * @param {number} [config.limit=1] - Limit the number of results returned. If using this option, you must provide a single item for `types`.\n * @param {Array} [config.language] - Specify the language to use for response text and, for forward geocoding, query result weighting.\n * Options are [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) comprised of a mandatory\n * [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and optionally one or more IETF subtags for country or script.\n * @param {'distance'|'score'} [config.reverseMode='distance'] - Set the factors that are used to sort nearby results.\n * @param {boolean} [config.routing=false] - Specify whether to request additional metadata about the recommended navigation destination. Only applicable for address features.\n * @param {String} [config.worldview=\"us\"] - Filter results to geographic features whose characteristics are defined differently by audiences belonging to various regional, cultural, or political groups.\n * @param {String} [config.session_token] - A unique session identifier generated by the client.\n * @return {MapiRequest}\n *\n * @example\n * geocodingClient.reverseGeocode({\n * query: [-95.4431142, 33.6875431]\n * })\n * .send()\n * .then(response => {\n * // GeoJSON document with geocoding matches\n * const match = response.body;\n * });\n */\nGeocoding.reverseGeocode = function(config) {\n v.assertShape({\n query: v.required(v.coordinates),\n mode: v.oneOf('mapbox.places', 'mapbox.places-permanent'),\n countries: v.arrayOf(v.string),\n types: v.arrayOf(v.oneOf(featureTypes)),\n bbox: v.arrayOf(v.number),\n limit: v.number,\n language: v.arrayOf(v.string),\n reverseMode: v.oneOf('distance', 'score'),\n routing: v.boolean,\n worldview: v.string,\n session_token: v.string\n })(config);\n\n config.mode = config.mode || 'mapbox.places';\n\n var query = stringifyBooleans(\n xtend(\n { country: config.countries },\n pick(config, [\n 'country',\n 'types',\n 'bbox',\n 'limit',\n 'language',\n 'reverseMode',\n 'routing',\n 'worldview',\n 'session_token'\n ])\n )\n );\n\n return this.client.createRequest({\n method: 'GET',\n path: '/geocoding/v5/:mode/:query.json',\n params: pick(config, ['mode', 'query']),\n query: query\n });\n};\n\nmodule.exports = createServiceFactory(Geocoding);\n","'use strict';\n\nvar MapiClient = require('../../lib/classes/mapi-client');\n// This will create the environment-appropriate client.\nvar createClient = require('../../lib/client');\n\nfunction createServiceFactory(ServicePrototype) {\n return function(clientOrConfig) {\n var client;\n if (MapiClient.prototype.isPrototypeOf(clientOrConfig)) {\n client = clientOrConfig;\n } else {\n client = createClient(clientOrConfig);\n }\n var service = Object.create(ServicePrototype);\n service.client = client;\n return service;\n };\n}\n\nmodule.exports = createServiceFactory;\n","'use strict';\n\nfunction objectMap(obj, cb) {\n return Object.keys(obj).reduce(function(result, key) {\n result[key] = cb(key, obj[key]);\n return result;\n }, {});\n}\n\nmodule.exports = objectMap;\n","'use strict';\n\n/**\n * Create a new object by picking properties off an existing object.\n * The second param can be overloaded as a callback for\n * more fine grained picking of properties.\n * @param {Object} source\n * @param {Array|function(string, Object):boolean} keys\n * @returns {Object}\n */\nfunction pick(source, keys) {\n var filter = function(key, val) {\n return keys.indexOf(key) !== -1 && val !== undefined;\n };\n\n if (typeof keys === 'function') {\n filter = keys;\n }\n\n return Object.keys(source)\n .filter(function(key) {\n return filter(key, source[key]);\n })\n .reduce(function(result, key) {\n result[key] = source[key];\n return result;\n }, {});\n}\n\nmodule.exports = pick;\n","'use strict';\n\nvar objectMap = require('./object-map');\n\n/**\n * Stringify all the boolean values in an object, so true becomes \"true\".\n *\n * @param {Object} obj\n * @returns {Object}\n */\nfunction stringifyBoolean(obj) {\n return objectMap(obj, function(_, value) {\n return typeof value === 'boolean' ? JSON.stringify(value) : value;\n });\n}\n\nmodule.exports = stringifyBoolean;\n","'use strict';\n\nvar xtend = require('xtend');\nvar v = require('@mapbox/fusspot');\n\nfunction file(value) {\n // If we're in a browser so Blob is available, the file must be that.\n // In Node, however, it could be a filepath or a pipeable (Readable) stream.\n if (typeof window !== 'undefined') {\n if (value instanceof global.Blob || value instanceof global.ArrayBuffer) {\n return;\n }\n return 'Blob or ArrayBuffer';\n }\n if (typeof value === 'string' || value.pipe !== undefined) {\n return;\n }\n return 'Filename or Readable stream';\n}\n\nfunction assertShape(validatorObj, apiName) {\n return v.assert(v.strictShape(validatorObj), apiName);\n}\n\nfunction date(value) {\n var msg = 'date';\n if (typeof value === 'boolean') {\n return msg;\n }\n try {\n var date = new Date(value);\n if (date.getTime && isNaN(date.getTime())) {\n return msg;\n }\n } catch (e) {\n return msg;\n }\n}\n\nfunction coordinates(value) {\n return v.tuple(v.number, v.number)(value);\n}\n\nmodule.exports = xtend(v, {\n file: file,\n date: date,\n coordinates: coordinates,\n assertShape: assertShape\n});\n","'use strict';\n\nvar base64 = require('base-64');\n\nvar tokenCache = {};\n\nfunction parseToken(token) {\n if (tokenCache[token]) {\n return tokenCache[token];\n }\n\n var parts = token.split('.');\n var usage = parts[0];\n var rawPayload = parts[1];\n if (!rawPayload) {\n throw new Error('Invalid token');\n }\n\n var parsedPayload = parsePaylod(rawPayload);\n\n var result = {\n usage: usage,\n user: parsedPayload.u\n };\n if (has(parsedPayload, 'a')) result.authorization = parsedPayload.a;\n if (has(parsedPayload, 'exp')) result.expires = parsedPayload.exp * 1000;\n if (has(parsedPayload, 'iat')) result.created = parsedPayload.iat * 1000;\n if (has(parsedPayload, 'scopes')) result.scopes = parsedPayload.scopes;\n if (has(parsedPayload, 'client')) result.client = parsedPayload.client;\n if (has(parsedPayload, 'll')) result.lastLogin = parsedPayload.ll;\n if (has(parsedPayload, 'iu')) result.impersonator = parsedPayload.iu;\n\n tokenCache[token] = result;\n return result;\n}\n\nfunction parsePaylod(rawPayload) {\n try {\n return JSON.parse(base64.decode(rawPayload));\n } catch (parseError) {\n throw new Error('Invalid token');\n }\n}\n\nfunction has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nmodule.exports = parseToken;\n","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2\"\n}), 'DragIndicator');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z\"\n}), 'Layers');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2\"\n}), 'MoreVert');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6\"\n}), 'Settings');","\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)([/*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14\"\n}, \"0\"), /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M12 10h-2v2H9v-2H7V9h2V7h1v2h2z\"\n}, \"1\")], 'ZoomIn');","\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _utils.createSvgIcon;\n }\n});\nvar _utils = require(\"@mui/material/utils\");","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport SystemDefaultPropsProvider, { useDefaultProps as useSystemDefaultProps } from '@mui/system/DefaultPropsProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction DefaultPropsProvider(props) {\n return /*#__PURE__*/_jsx(SystemDefaultPropsProvider, _extends({}, props));\n}\nprocess.env.NODE_ENV !== \"production\" ? DefaultPropsProvider.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * @ignore\n */\n children: PropTypes.node,\n /**\n * @ignore\n */\n value: PropTypes.object.isRequired\n} : void 0;\nexport default DefaultPropsProvider;\nexport function useDefaultProps(params) {\n return useSystemDefaultProps(params);\n}","const blue = {\n 50: '#e3f2fd',\n 100: '#bbdefb',\n 200: '#90caf9',\n 300: '#64b5f6',\n 400: '#42a5f5',\n 500: '#2196f3',\n 600: '#1e88e5',\n 700: '#1976d2',\n 800: '#1565c0',\n 900: '#0d47a1',\n A100: '#82b1ff',\n A200: '#448aff',\n A400: '#2979ff',\n A700: '#2962ff'\n};\nexport default blue;","const common = {\n black: '#000',\n white: '#fff'\n};\nexport default common;","const grey = {\n 50: '#fafafa',\n 100: '#f5f5f5',\n 200: '#eeeeee',\n 300: '#e0e0e0',\n 400: '#bdbdbd',\n 500: '#9e9e9e',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#f5f5f5',\n A200: '#eeeeee',\n A400: '#bdbdbd',\n A700: '#616161'\n};\nexport default grey;","const purple = {\n 50: '#f3e5f5',\n 100: '#e1bee7',\n 200: '#ce93d8',\n 300: '#ba68c8',\n 400: '#ab47bc',\n 500: '#9c27b0',\n 600: '#8e24aa',\n 700: '#7b1fa2',\n 800: '#6a1b9a',\n 900: '#4a148c',\n A100: '#ea80fc',\n A200: '#e040fb',\n A400: '#d500f9',\n A700: '#aa00ff'\n};\nexport default purple;","const red = {\n 50: '#ffebee',\n 100: '#ffcdd2',\n 200: '#ef9a9a',\n 300: '#e57373',\n 400: '#ef5350',\n 500: '#f44336',\n 600: '#e53935',\n 700: '#d32f2f',\n 800: '#c62828',\n 900: '#b71c1c',\n A100: '#ff8a80',\n A200: '#ff5252',\n A400: '#ff1744',\n A700: '#d50000'\n};\nexport default red;","const orange = {\n 50: '#fff3e0',\n 100: '#ffe0b2',\n 200: '#ffcc80',\n 300: '#ffb74d',\n 400: '#ffa726',\n 500: '#ff9800',\n 600: '#fb8c00',\n 700: '#f57c00',\n 800: '#ef6c00',\n 900: '#e65100',\n A100: '#ffd180',\n A200: '#ffab40',\n A400: '#ff9100',\n A700: '#ff6d00'\n};\nexport default orange;","const lightBlue = {\n 50: '#e1f5fe',\n 100: '#b3e5fc',\n 200: '#81d4fa',\n 300: '#4fc3f7',\n 400: '#29b6f6',\n 500: '#03a9f4',\n 600: '#039be5',\n 700: '#0288d1',\n 800: '#0277bd',\n 900: '#01579b',\n A100: '#80d8ff',\n A200: '#40c4ff',\n A400: '#00b0ff',\n A700: '#0091ea'\n};\nexport default lightBlue;","const green = {\n 50: '#e8f5e9',\n 100: '#c8e6c9',\n 200: '#a5d6a7',\n 300: '#81c784',\n 400: '#66bb6a',\n 500: '#4caf50',\n 600: '#43a047',\n 700: '#388e3c',\n 800: '#2e7d32',\n 900: '#1b5e20',\n A100: '#b9f6ca',\n A200: '#69f0ae',\n A400: '#00e676',\n A700: '#00c853'\n};\nexport default green;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _formatMuiErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\nconst _excluded = [\"mode\", \"contrastThreshold\", \"tonalOffset\"];\nimport deepmerge from '@mui/utils/deepmerge';\nimport { darken, getContrastRatio, lighten } from '@mui/system/colorManipulator';\nimport common from '../colors/common';\nimport grey from '../colors/grey';\nimport purple from '../colors/purple';\nimport red from '../colors/red';\nimport orange from '../colors/orange';\nimport blue from '../colors/blue';\nimport lightBlue from '../colors/lightBlue';\nimport green from '../colors/green';\nexport const light = {\n // The colors used to style the text.\n text: {\n // The most important text.\n primary: 'rgba(0, 0, 0, 0.87)',\n // Secondary text.\n secondary: 'rgba(0, 0, 0, 0.6)',\n // Disabled text have even lower visual prominence.\n disabled: 'rgba(0, 0, 0, 0.38)'\n },\n // The color used to divide different elements.\n divider: 'rgba(0, 0, 0, 0.12)',\n // The background colors used to style the surfaces.\n // Consistency between these values is important.\n background: {\n paper: common.white,\n default: common.white\n },\n // The colors used to style the action elements.\n action: {\n // The color of an active action like an icon button.\n active: 'rgba(0, 0, 0, 0.54)',\n // The color of an hovered action.\n hover: 'rgba(0, 0, 0, 0.04)',\n hoverOpacity: 0.04,\n // The color of a selected action.\n selected: 'rgba(0, 0, 0, 0.08)',\n selectedOpacity: 0.08,\n // The color of a disabled action.\n disabled: 'rgba(0, 0, 0, 0.26)',\n // The background color of a disabled action.\n disabledBackground: 'rgba(0, 0, 0, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(0, 0, 0, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.12\n }\n};\nexport const dark = {\n text: {\n primary: common.white,\n secondary: 'rgba(255, 255, 255, 0.7)',\n disabled: 'rgba(255, 255, 255, 0.5)',\n icon: 'rgba(255, 255, 255, 0.5)'\n },\n divider: 'rgba(255, 255, 255, 0.12)',\n background: {\n paper: '#121212',\n default: '#121212'\n },\n action: {\n active: common.white,\n hover: 'rgba(255, 255, 255, 0.08)',\n hoverOpacity: 0.08,\n selected: 'rgba(255, 255, 255, 0.16)',\n selectedOpacity: 0.16,\n disabled: 'rgba(255, 255, 255, 0.3)',\n disabledBackground: 'rgba(255, 255, 255, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(255, 255, 255, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.24\n }\n};\nfunction addLightOrDark(intent, direction, shade, tonalOffset) {\n const tonalOffsetLight = tonalOffset.light || tonalOffset;\n const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;\n if (!intent[direction]) {\n if (intent.hasOwnProperty(shade)) {\n intent[direction] = intent[shade];\n } else if (direction === 'light') {\n intent.light = lighten(intent.main, tonalOffsetLight);\n } else if (direction === 'dark') {\n intent.dark = darken(intent.main, tonalOffsetDark);\n }\n }\n}\nfunction getDefaultPrimary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: blue[200],\n light: blue[50],\n dark: blue[400]\n };\n }\n return {\n main: blue[700],\n light: blue[400],\n dark: blue[800]\n };\n}\nfunction getDefaultSecondary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: purple[200],\n light: purple[50],\n dark: purple[400]\n };\n }\n return {\n main: purple[500],\n light: purple[300],\n dark: purple[700]\n };\n}\nfunction getDefaultError(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: red[500],\n light: red[300],\n dark: red[700]\n };\n }\n return {\n main: red[700],\n light: red[400],\n dark: red[800]\n };\n}\nfunction getDefaultInfo(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: lightBlue[400],\n light: lightBlue[300],\n dark: lightBlue[700]\n };\n }\n return {\n main: lightBlue[700],\n light: lightBlue[500],\n dark: lightBlue[900]\n };\n}\nfunction getDefaultSuccess(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: green[400],\n light: green[300],\n dark: green[700]\n };\n }\n return {\n main: green[800],\n light: green[500],\n dark: green[900]\n };\n}\nfunction getDefaultWarning(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: orange[400],\n light: orange[300],\n dark: orange[700]\n };\n }\n return {\n main: '#ed6c02',\n // closest to orange[800] that pass 3:1.\n light: orange[500],\n dark: orange[900]\n };\n}\nexport default function createPalette(palette) {\n const {\n mode = 'light',\n contrastThreshold = 3,\n tonalOffset = 0.2\n } = palette,\n other = _objectWithoutPropertiesLoose(palette, _excluded);\n const primary = palette.primary || getDefaultPrimary(mode);\n const secondary = palette.secondary || getDefaultSecondary(mode);\n const error = palette.error || getDefaultError(mode);\n const info = palette.info || getDefaultInfo(mode);\n const success = palette.success || getDefaultSuccess(mode);\n const warning = palette.warning || getDefaultWarning(mode);\n\n // Use the same logic as\n // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59\n // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54\n function getContrastText(background) {\n const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;\n if (process.env.NODE_ENV !== 'production') {\n const contrast = getContrastRatio(background, contrastText);\n if (contrast < 3) {\n console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\\n'));\n }\n }\n return contrastText;\n }\n const augmentColor = ({\n color,\n name,\n mainShade = 500,\n lightShade = 300,\n darkShade = 700\n }) => {\n color = _extends({}, color);\n if (!color.main && color[mainShade]) {\n color.main = color[mainShade];\n }\n if (!color.hasOwnProperty('main')) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\nThe color object needs to have a \\`main\\` property or a \\`${mainShade}\\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));\n }\n if (typeof color.main !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n\\`color.main\\` should be a string, but \\`${JSON.stringify(color.main)}\\` was provided instead.\n\nDid you intend to use one of the following approaches?\n\nimport { green } from \"@mui/material/colors\";\n\nconst theme1 = createTheme({ palette: {\n primary: green,\n} });\n\nconst theme2 = createTheme({ palette: {\n primary: { main: green[500] },\n} });` : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));\n }\n addLightOrDark(color, 'light', lightShade, tonalOffset);\n addLightOrDark(color, 'dark', darkShade, tonalOffset);\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n return color;\n };\n const modes = {\n dark,\n light\n };\n if (process.env.NODE_ENV !== 'production') {\n if (!modes[mode]) {\n console.error(`MUI: The palette mode \\`${mode}\\` is not supported.`);\n }\n }\n const paletteOutput = deepmerge(_extends({\n // A collection of common colors.\n common: _extends({}, common),\n // prevent mutable object.\n // The palette mode, can be light or dark.\n mode,\n // The colors used to represent primary interface elements for a user.\n primary: augmentColor({\n color: primary,\n name: 'primary'\n }),\n // The colors used to represent secondary interface elements for a user.\n secondary: augmentColor({\n color: secondary,\n name: 'secondary',\n mainShade: 'A400',\n lightShade: 'A200',\n darkShade: 'A700'\n }),\n // The colors used to represent interface elements that the user should be made aware of.\n error: augmentColor({\n color: error,\n name: 'error'\n }),\n // The colors used to represent potentially dangerous actions or important messages.\n warning: augmentColor({\n color: warning,\n name: 'warning'\n }),\n // The colors used to present information to the user that is neutral and not necessarily important.\n info: augmentColor({\n color: info,\n name: 'info'\n }),\n // The colors used to indicate the successful completion of an action that user triggered.\n success: augmentColor({\n color: success,\n name: 'success'\n }),\n // The grey colors.\n grey,\n // Used by `getContrastText()` to maximize the contrast between\n // the background and the text.\n contrastThreshold,\n // Takes a background color and returns the text color that maximizes the contrast.\n getContrastText,\n // Generate a rich color object.\n augmentColor,\n // Used by the functions below to shift a color's luminance by approximately\n // two indexes within its tonal palette.\n // E.g., shift from Red 500 to Red 300 or Red 700.\n tonalOffset\n }, modes[mode]), other);\n return paletteOutput;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"fontFamily\", \"fontSize\", \"fontWeightLight\", \"fontWeightRegular\", \"fontWeightMedium\", \"fontWeightBold\", \"htmlFontSize\", \"allVariants\", \"pxToRem\"];\nimport deepmerge from '@mui/utils/deepmerge';\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\nconst caseAllCaps = {\n textTransform: 'uppercase'\n};\nconst defaultFontFamily = '\"Roboto\", \"Helvetica\", \"Arial\", sans-serif';\n\n/**\n * @see @link{https://m2.material.io/design/typography/the-type-system.html}\n * @see @link{https://m2.material.io/design/typography/understanding-typography.html}\n */\nexport default function createTypography(palette, typography) {\n const _ref = typeof typography === 'function' ? typography(palette) : typography,\n {\n fontFamily = defaultFontFamily,\n // The default font size of the Material Specification.\n fontSize = 14,\n // px\n fontWeightLight = 300,\n fontWeightRegular = 400,\n fontWeightMedium = 500,\n fontWeightBold = 700,\n // Tell MUI what's the font-size on the html element.\n // 16px is the default font-size used by browsers.\n htmlFontSize = 16,\n // Apply the CSS properties to all the variants.\n allVariants,\n pxToRem: pxToRem2\n } = _ref,\n other = _objectWithoutPropertiesLoose(_ref, _excluded);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof fontSize !== 'number') {\n console.error('MUI: `fontSize` is required to be a number.');\n }\n if (typeof htmlFontSize !== 'number') {\n console.error('MUI: `htmlFontSize` is required to be a number.');\n }\n }\n const coef = fontSize / 14;\n const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);\n const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends({\n fontFamily,\n fontWeight,\n fontSize: pxToRem(size),\n // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/\n lineHeight\n }, fontFamily === defaultFontFamily ? {\n letterSpacing: `${round(letterSpacing / size)}em`\n } : {}, casing, allVariants);\n const variants = {\n h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),\n h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),\n h3: buildVariant(fontWeightRegular, 48, 1.167, 0),\n h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),\n h5: buildVariant(fontWeightRegular, 24, 1.334, 0),\n h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),\n subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),\n subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),\n body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),\n body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),\n button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),\n caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),\n overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),\n // TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.\n inherit: {\n fontFamily: 'inherit',\n fontWeight: 'inherit',\n fontSize: 'inherit',\n lineHeight: 'inherit',\n letterSpacing: 'inherit'\n }\n };\n return deepmerge(_extends({\n htmlFontSize,\n pxToRem,\n fontFamily,\n fontSize,\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold\n }, variants), other, {\n clone: false // No need to clone deep\n });\n}","const shadowKeyUmbraOpacity = 0.2;\nconst shadowKeyPenumbraOpacity = 0.14;\nconst shadowAmbientShadowOpacity = 0.12;\nfunction createShadow(...px) {\n return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(',');\n}\n\n// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss\nconst shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];\nexport default shadows;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"duration\", \"easing\", \"delay\"];\n// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves\n// to learn the context in which each easing should be used.\nexport const easing = {\n // This is the most common easing curve.\n easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n // Objects enter the screen at full velocity from off-screen and\n // slowly decelerate to a resting point.\n easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',\n // Objects leave the screen at full velocity. They do not decelerate when off-screen.\n easeIn: 'cubic-bezier(0.4, 0, 1, 1)',\n // The sharp curve is used by objects that may return to the screen at any time.\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'\n};\n\n// Follow https://m2.material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\nexport const duration = {\n shortest: 150,\n shorter: 200,\n short: 250,\n // most basic recommended timing\n standard: 300,\n // this is to be used in complex animations\n complex: 375,\n // recommended when something is entering screen\n enteringScreen: 225,\n // recommended when something is leaving screen\n leavingScreen: 195\n};\nfunction formatMs(milliseconds) {\n return `${Math.round(milliseconds)}ms`;\n}\nfunction getAutoHeightDuration(height) {\n if (!height) {\n return 0;\n }\n const constant = height / 36;\n\n // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10\n return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);\n}\nexport default function createTransitions(inputTransitions) {\n const mergedEasing = _extends({}, easing, inputTransitions.easing);\n const mergedDuration = _extends({}, duration, inputTransitions.duration);\n const create = (props = ['all'], options = {}) => {\n const {\n duration: durationOption = mergedDuration.standard,\n easing: easingOption = mergedEasing.easeInOut,\n delay = 0\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n if (process.env.NODE_ENV !== 'production') {\n const isString = value => typeof value === 'string';\n // IE11 support, replace with Number.isNaN\n // eslint-disable-next-line no-restricted-globals\n const isNumber = value => !isNaN(parseFloat(value));\n if (!isString(props) && !Array.isArray(props)) {\n console.error('MUI: Argument \"props\" must be a string or Array.');\n }\n if (!isNumber(durationOption) && !isString(durationOption)) {\n console.error(`MUI: Argument \"duration\" must be a number or a string but found ${durationOption}.`);\n }\n if (!isString(easingOption)) {\n console.error('MUI: Argument \"easing\" must be a string.');\n }\n if (!isNumber(delay) && !isString(delay)) {\n console.error('MUI: Argument \"delay\" must be a number or a string.');\n }\n if (typeof options !== 'object') {\n console.error(['MUI: Secong argument of transition.create must be an object.', \"Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`\"].join('\\n'));\n }\n if (Object.keys(other).length !== 0) {\n console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(',')}].`);\n }\n }\n return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');\n };\n return _extends({\n getAutoHeightDuration,\n create\n }, inputTransitions, {\n easing: mergedEasing,\n duration: mergedDuration\n });\n}","// We need to centralize the zIndex definitions as they work\n// like global values in the browser.\nconst zIndex = {\n mobileStepper: 1000,\n fab: 1050,\n speedDial: 1050,\n appBar: 1100,\n drawer: 1200,\n modal: 1300,\n snackbar: 1400,\n tooltip: 1500\n};\nexport default zIndex;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _formatMuiErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\nconst _excluded = [\"breakpoints\", \"mixins\", \"spacing\", \"palette\", \"transitions\", \"typography\", \"shape\"];\nimport deepmerge from '@mui/utils/deepmerge';\nimport styleFunctionSx, { unstable_defaultSxConfig as defaultSxConfig } from '@mui/system/styleFunctionSx';\nimport systemCreateTheme from '@mui/system/createTheme';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport createMixins from './createMixins';\nimport createPalette from './createPalette';\nimport createTypography from './createTypography';\nimport shadows from './shadows';\nimport createTransitions from './createTransitions';\nimport zIndex from './zIndex';\nfunction createTheme(options = {}, ...args) {\n const {\n mixins: mixinsInput = {},\n palette: paletteInput = {},\n transitions: transitionsInput = {},\n typography: typographyInput = {}\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n if (options.vars) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`vars\\` is a private field used for CSS variables support.\nPlease use another name.` : _formatMuiErrorMessage(18));\n }\n const palette = createPalette(paletteInput);\n const systemTheme = systemCreateTheme(options);\n let muiTheme = deepmerge(systemTheme, {\n mixins: createMixins(systemTheme.breakpoints, mixinsInput),\n palette,\n // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.\n shadows: shadows.slice(),\n typography: createTypography(palette, typographyInput),\n transitions: createTransitions(transitionsInput),\n zIndex: _extends({}, zIndex)\n });\n muiTheme = deepmerge(muiTheme, other);\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n if (process.env.NODE_ENV !== 'production') {\n // TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.\n const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];\n const traverse = (node, component) => {\n let key;\n\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\n for (key in node) {\n const child = node[key];\n if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n const stateClass = generateUtilityClass('', key);\n console.error([`MUI: The \\`${component}\\` component increases ` + `the CSS specificity of the \\`${key}\\` internal state.`, 'You can not override it like this: ', JSON.stringify(node, null, 2), '', `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({\n root: {\n [`&.${stateClass}`]: child\n }\n }, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\\n'));\n }\n // Remove the style to prevent global conflicts.\n node[key] = {};\n }\n }\n };\n Object.keys(muiTheme.components).forEach(component => {\n const styleOverrides = muiTheme.components[component].styleOverrides;\n if (styleOverrides && component.indexOf('Mui') === 0) {\n traverse(styleOverrides, component);\n }\n });\n }\n muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);\n muiTheme.unstable_sx = function sx(props) {\n return styleFunctionSx({\n sx: props,\n theme: this\n });\n };\n return muiTheme;\n}\nlet warnedOnce = false;\nexport function createMuiTheme(...args) {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnce) {\n warnedOnce = true;\n console.error(['MUI: the createMuiTheme function was renamed to createTheme.', '', \"You should use `import { createTheme } from '@mui/material/styles'`\"].join('\\n'));\n }\n }\n return createTheme(...args);\n}\nexport default createTheme;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function createMixins(breakpoints, mixins) {\n return _extends({\n toolbar: {\n minHeight: 56,\n [breakpoints.up('xs')]: {\n '@media (orientation: landscape)': {\n minHeight: 48\n }\n },\n [breakpoints.up('sm')]: {\n minHeight: 64\n }\n }\n }, mixins);\n}","'use client';\n\nimport createTheme from './createTheme';\nconst defaultTheme = createTheme();\nexport default defaultTheme;","export default '$$material';","import slotShouldForwardProp from './slotShouldForwardProp';\nconst rootShouldForwardProp = prop => slotShouldForwardProp(prop) && prop !== 'classes';\nexport default rootShouldForwardProp;","// copied from @mui/system/createStyled\nfunction slotShouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nexport default slotShouldForwardProp;","'use client';\n\nimport createStyled from '@mui/system/createStyled';\nimport defaultTheme from './defaultTheme';\nimport THEME_ID from './identifier';\nimport rootShouldForwardProp from './rootShouldForwardProp';\nexport { default as slotShouldForwardProp } from './slotShouldForwardProp';\nexport { default as rootShouldForwardProp } from './rootShouldForwardProp';\nconst styled = createStyled({\n themeId: THEME_ID,\n defaultTheme,\n rootShouldForwardProp\n});\nexport default styled;","import capitalize from '@mui/utils/capitalize';\nexport default capitalize;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getSvgIconUtilityClass(slot) {\n return generateUtilityClass('MuiSvgIcon', slot);\n}\nconst svgIconClasses = generateUtilityClasses('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);\nexport default svgIconClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"className\", \"color\", \"component\", \"fontSize\", \"htmlColor\", \"inheritViewBox\", \"titleAccess\", \"viewBox\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport capitalize from '../utils/capitalize';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport styled from '../styles/styled';\nimport { getSvgIconUtilityClass } from './svgIconClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n color,\n fontSize,\n classes\n } = ownerState;\n const slots = {\n root: ['root', color !== 'inherit' && `color${capitalize(color)}`, `fontSize${capitalize(fontSize)}`]\n };\n return composeClasses(slots, getSvgIconUtilityClass, classes);\n};\nconst SvgIconRoot = styled('svg', {\n name: 'MuiSvgIcon',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.color !== 'inherit' && styles[`color${capitalize(ownerState.color)}`], styles[`fontSize${capitalize(ownerState.fontSize)}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette2, _palette3;\n return {\n userSelect: 'none',\n width: '1em',\n height: '1em',\n display: 'inline-block',\n // the will define the property that has `currentColor`\n // for example heroicons uses fill=\"none\" and stroke=\"currentColor\"\n fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',\n flexShrink: 0,\n transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {\n duration: (_theme$transitions2 = theme.transitions) == null || (_theme$transitions2 = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2.shorter\n }),\n fontSize: {\n inherit: 'inherit',\n small: ((_theme$typography = theme.typography) == null || (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',\n medium: ((_theme$typography2 = theme.typography) == null || (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',\n large: ((_theme$typography3 = theme.typography) == null || (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'\n }[ownerState.fontSize],\n // TODO v5 deprecate, v6 remove for sx\n color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null || (_palette = _palette[ownerState.color]) == null ? void 0 : _palette.main) != null ? _palette$ownerState$c : {\n action: (_palette2 = (theme.vars || theme).palette) == null || (_palette2 = _palette2.action) == null ? void 0 : _palette2.active,\n disabled: (_palette3 = (theme.vars || theme).palette) == null || (_palette3 = _palette3.action) == null ? void 0 : _palette3.disabled,\n inherit: undefined\n }[ownerState.color]\n };\n});\nconst SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiSvgIcon'\n });\n const {\n children,\n className,\n color = 'inherit',\n component = 'svg',\n fontSize = 'medium',\n htmlColor,\n inheritViewBox = false,\n titleAccess,\n viewBox = '0 0 24 24'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const hasSvgAsChild = /*#__PURE__*/React.isValidElement(children) && children.type === 'svg';\n const ownerState = _extends({}, props, {\n color,\n component,\n fontSize,\n instanceFontSize: inProps.fontSize,\n inheritViewBox,\n viewBox,\n hasSvgAsChild\n });\n const more = {};\n if (!inheritViewBox) {\n more.viewBox = viewBox;\n }\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(SvgIconRoot, _extends({\n as: component,\n className: clsx(classes.root, className),\n focusable: \"false\",\n color: htmlColor,\n \"aria-hidden\": titleAccess ? undefined : true,\n role: titleAccess ? 'img' : undefined,\n ref: ref\n }, more, other, hasSvgAsChild && children.props, {\n ownerState: ownerState,\n children: [hasSvgAsChild ? children.props.children : children, titleAccess ? /*#__PURE__*/_jsx(\"title\", {\n children: titleAccess\n }) : null]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? SvgIcon.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * Node passed into the SVG element.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n * You can use the `htmlColor` prop to apply a color attribute to the SVG element.\n * @default 'inherit'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'action', 'disabled', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.\n * @default 'medium'\n */\n fontSize: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'large', 'medium', 'small']), PropTypes.string]),\n /**\n * Applies a color attribute to the SVG element.\n */\n htmlColor: PropTypes.string,\n /**\n * If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`\n * prop will be ignored.\n * Useful when you want to reference a custom `component` and have `SvgIcon` pass that\n * `component`'s viewBox to the root node.\n * @default false\n */\n inheritViewBox: PropTypes.bool,\n /**\n * The shape-rendering attribute. The behavior of the different options is described on the\n * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).\n * If you are having issues with blurry icons you should investigate this prop.\n */\n shapeRendering: PropTypes.string,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Provides a human-readable title for the element that contains it.\n * https://www.w3.org/TR/SVG-access/#Equivalent\n */\n titleAccess: PropTypes.string,\n /**\n * Allows you to redefine what the coordinates without units mean inside an SVG element.\n * For example, if the SVG element is 500 (width) by 200 (height),\n * and you pass viewBox=\"0 0 50 20\",\n * this means that the coordinates inside the SVG will go from the top left corner (0,0)\n * to bottom right (50,20) and each unit will be worth 10px.\n * @default '0 0 24 24'\n */\n viewBox: PropTypes.string\n} : void 0;\nSvgIcon.muiName = 'SvgIcon';\nexport default SvgIcon;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport SvgIcon from '../SvgIcon';\n\n/**\n * Private module reserved for @mui packages.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function createSvgIcon(path, displayName) {\n function Component(props, ref) {\n return /*#__PURE__*/_jsx(SvgIcon, _extends({\n \"data-testid\": `${displayName}Icon`,\n ref: ref\n }, props, {\n children: path\n }));\n }\n if (process.env.NODE_ENV !== 'production') {\n // Need to set `displayName` on the inner component for React.memo.\n // React prior to 16.14 ignores `displayName` on the wrapper.\n Component.displayName = `${displayName}Icon`;\n }\n Component.muiName = SvgIcon.muiName;\n return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));\n}","import debounce from '@mui/utils/debounce';\nexport default debounce;","import createChainedFunction from '@mui/utils/createChainedFunction';\nexport default createChainedFunction;","import deprecatedPropType from '@mui/utils/deprecatedPropType';\nexport default deprecatedPropType;","export default function deprecatedPropType(validator, reason) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n return (props, propName, componentName, location, propFullName) => {\n const componentNameSafe = componentName || '<>';\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The ${location} \\`${propFullNameSafe}\\` of ` + `\\`${componentNameSafe}\\` is deprecated. ${reason}`);\n }\n return null;\n };\n}","import requirePropFactory from '@mui/utils/requirePropFactory';\nexport default requirePropFactory;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function requirePropFactory(componentNameInError, Component) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n\n // eslint-disable-next-line react/forbid-foreign-prop-types\n const prevPropTypes = Component ? _extends({}, Component.propTypes) : null;\n const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {\n const propFullNameSafe = propFullName || propName;\n const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];\n if (defaultTypeChecker) {\n const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);\n if (typeCheckerResult) {\n return typeCheckerResult;\n }\n }\n if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {\n return new Error(`The prop \\`${propFullNameSafe}\\` of ` + `\\`${componentNameInError}\\` can only be used together with the \\`${requiredProp}\\` prop.`);\n }\n return null;\n };\n return requireProp;\n}","import setRef from '@mui/utils/setRef';\nexport default setRef;","'use client';\n\nimport useId from '@mui/utils/useId';\nexport default useId;","import unsupportedProp from '@mui/utils/unsupportedProp';\nexport default unsupportedProp;","export default function unsupportedProp(props, propName, componentName, location, propFullName) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The prop \\`${propFullNameSafe}\\` is not supported. Please remove it.`);\n }\n return null;\n}","'use client';\n\nimport { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/utils';\nexport { default as capitalize } from './capitalize';\nexport { default as createChainedFunction } from './createChainedFunction';\nexport { default as createSvgIcon } from './createSvgIcon';\nexport { default as debounce } from './debounce';\nexport { default as deprecatedPropType } from './deprecatedPropType';\nexport { default as isMuiElement } from './isMuiElement';\nexport { default as ownerDocument } from './ownerDocument';\nexport { default as ownerWindow } from './ownerWindow';\nexport { default as requirePropFactory } from './requirePropFactory';\nexport { default as setRef } from './setRef';\nexport { default as unstable_useEnhancedEffect } from './useEnhancedEffect';\nexport { default as unstable_useId } from './useId';\nexport { default as unsupportedProp } from './unsupportedProp';\nexport { default as useControlled } from './useControlled';\nexport { default as useEventCallback } from './useEventCallback';\nexport { default as useForkRef } from './useForkRef';\nexport { default as useIsFocusVisible } from './useIsFocusVisible';\n// TODO: remove this export once ClassNameGenerator is stable\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const unstable_ClassNameGenerator = {\n configure: generator => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', \"You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead\", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\\n'));\n }\n ClassNameGenerator.configure(generator);\n }\n};","import isMuiElement from '@mui/utils/isMuiElement';\nexport default isMuiElement;","import * as React from 'react';\nexport default function isMuiElement(element, muiNames) {\n var _muiName, _element$type;\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName\n // relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45\n // eslint-disable-next-line no-underscore-dangle\n (_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;\n}","import ownerDocument from '@mui/utils/ownerDocument';\nexport default ownerDocument;","import ownerWindow from '@mui/utils/ownerWindow';\nexport default ownerWindow;","'use client';\n\nimport useControlled from '@mui/utils/useControlled';\nexport default useControlled;","'use client';\n\nimport useEnhancedEffect from '@mui/utils/useEnhancedEffect';\nexport default useEnhancedEffect;","'use client';\n\nimport useEventCallback from '@mui/utils/useEventCallback';\nexport default useEventCallback;","'use client';\n\nimport useForkRef from '@mui/utils/useForkRef';\nexport default useForkRef;","'use client';\n\nimport useIsFocusVisible from '@mui/utils/useIsFocusVisible';\nexport default useIsFocusVisible;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { Global } from '@emotion/react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction isEmpty(obj) {\n return obj === undefined || obj === null || Object.keys(obj).length === 0;\n}\nexport default function GlobalStyles(props) {\n const {\n styles,\n defaultTheme = {}\n } = props;\n const globalStyles = typeof styles === 'function' ? themeInput => styles(isEmpty(themeInput) ? defaultTheme : themeInput) : styles;\n return /*#__PURE__*/_jsx(Global, {\n styles: globalStyles\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GlobalStyles.propTypes = {\n defaultTheme: PropTypes.object,\n styles: PropTypes.oneOfType([PropTypes.array, PropTypes.string, PropTypes.object, PropTypes.func])\n} : void 0;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\n\n// prepend: true moves MUI styles to the top of the so they're loaded first.\n// It allows developers to easily override MUI styles with other styling solutions, like CSS modules.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nlet cache;\nif (typeof document === 'object') {\n cache = createCache({\n key: 'css',\n prepend: true\n });\n}\nexport default function StyledEngineProvider(props) {\n const {\n injectFirst,\n children\n } = props;\n return injectFirst && cache ? /*#__PURE__*/_jsx(CacheProvider, {\n value: cache,\n children: children\n }) : children;\n}\nprocess.env.NODE_ENV !== \"production\" ? StyledEngineProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * By default, the styles are injected last in the element of the page.\n * As a result, they gain more specificity than any other style sheet.\n * If you want to override MUI's styles, set this prop.\n */\n injectFirst: PropTypes.bool\n} : void 0;","/**\n * @mui/styled-engine v5.16.6\n *\n * @license MIT\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use client';\n\n/* eslint-disable no-underscore-dangle */\nimport emStyled from '@emotion/styled';\nexport default function styled(tag, options) {\n const stylesFactory = emStyled(tag, options);\n if (process.env.NODE_ENV !== 'production') {\n return (...styles) => {\n const component = typeof tag === 'string' ? `\"${tag}\"` : 'component';\n if (styles.length === 0) {\n console.error([`MUI: Seems like you called \\`styled(${component})()\\` without a \\`style\\` argument.`, 'You must provide a `styles` argument: `styled(\"div\")(styleYouForgotToPass)`.'].join('\\n'));\n } else if (styles.some(style => style === undefined)) {\n console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);\n }\n return stylesFactory(...styles);\n };\n }\n return stylesFactory;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const internal_processStyles = (tag, processor) => {\n // Emotion attaches all the styles as `__emotion_styles`.\n // Ref: https://github.com/emotion-js/emotion/blob/16d971d0da229596d6bcc39d282ba9753c9ee7cf/packages/styled/src/base.js#L186\n if (Array.isArray(tag.__emotion_styles)) {\n tag.__emotion_styles = processor(tag.__emotion_styles);\n }\n};\nexport { ThemeContext, keyframes, css } from '@emotion/react';\nexport { default as StyledEngineProvider } from './StyledEngineProvider';\nexport { default as GlobalStyles } from './GlobalStyles';","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.alpha = alpha;\nexports.blend = blend;\nexports.colorChannel = void 0;\nexports.darken = darken;\nexports.decomposeColor = decomposeColor;\nexports.emphasize = emphasize;\nexports.getContrastRatio = getContrastRatio;\nexports.getLuminance = getLuminance;\nexports.hexToRgb = hexToRgb;\nexports.hslToRgb = hslToRgb;\nexports.lighten = lighten;\nexports.private_safeAlpha = private_safeAlpha;\nexports.private_safeColorChannel = void 0;\nexports.private_safeDarken = private_safeDarken;\nexports.private_safeEmphasize = private_safeEmphasize;\nexports.private_safeLighten = private_safeLighten;\nexports.recomposeColor = recomposeColor;\nexports.rgbToHex = rgbToHex;\nvar _formatMuiErrorMessage2 = _interopRequireDefault(require(\"@mui/utils/formatMuiErrorMessage\"));\nvar _clamp = _interopRequireDefault(require(\"@mui/utils/clamp\"));\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clampWrapper(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n return (0, _clamp.default)(value, min, max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\nfunction hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nfunction decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : (0, _formatMuiErrorMessage2.default)(9, color));\n }\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : (0, _formatMuiErrorMessage2.default)(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\nconst colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');\n};\nexports.colorChannel = colorChannel;\nconst private_safeColorChannel = (color, warning) => {\n try {\n return colorChannel(color);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n};\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nexports.private_safeColorChannel = private_safeColorChannel;\nfunction recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.indexOf('color') !== -1) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n return `${type}(${values})`;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\nfunction rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\nfunction hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nfunction getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nfunction getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction alpha(color, value) {\n color = decomposeColor(color);\n value = clampWrapper(value);\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n return recomposeColor(color);\n}\nfunction private_safeAlpha(color, value, warning) {\n try {\n return alpha(color, value);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeDarken(color, coefficient, warning) {\n try {\n return darken(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeLighten(color, coefficient, warning) {\n try {\n return lighten(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nfunction private_safeEmphasize(color, coefficient, warning) {\n try {\n return emphasize(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Blend a transparent overlay color with a background color, resulting in a single\n * RGB color.\n * @param {string} background - CSS color\n * @param {string} overlay - CSS color\n * @param {number} opacity - Opacity multiplier in the range 0 - 1\n * @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.\n */\nfunction blend(background, overlay, opacity, gamma = 1.0) {\n const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);\n const backgroundColor = decomposeColor(background);\n const overlayColor = decomposeColor(overlay);\n const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];\n return recomposeColor({\n type: 'rgb',\n values: rgb\n });\n}","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createStyled;\nexports.shouldForwardProp = shouldForwardProp;\nexports.systemDefaultTheme = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _styledEngine = _interopRequireWildcard(require(\"@mui/styled-engine\"));\nvar _deepmerge = require(\"@mui/utils/deepmerge\");\nvar _capitalize = _interopRequireDefault(require(\"@mui/utils/capitalize\"));\nvar _getDisplayName = _interopRequireDefault(require(\"@mui/utils/getDisplayName\"));\nvar _createTheme = _interopRequireDefault(require(\"./createTheme\"));\nvar _styleFunctionSx = _interopRequireDefault(require(\"./styleFunctionSx\"));\nconst _excluded = [\"ownerState\"],\n _excluded2 = [\"variants\"],\n _excluded3 = [\"name\", \"slot\", \"skipVariantsResolver\", \"skipSx\", \"overridesResolver\"];\n/* eslint-disable no-underscore-dangle */\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\n// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40\nfunction isStringTag(tag) {\n return typeof tag === 'string' &&\n // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96;\n}\n\n// Update /system/styled/#api in case if this changes\nfunction shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nconst systemDefaultTheme = exports.systemDefaultTheme = (0, _createTheme.default)();\nconst lowercaseFirstLetter = string => {\n if (!string) {\n return string;\n }\n return string.charAt(0).toLowerCase() + string.slice(1);\n};\nfunction resolveTheme({\n defaultTheme,\n theme,\n themeId\n}) {\n return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;\n}\nfunction defaultOverridesResolver(slot) {\n if (!slot) {\n return null;\n }\n return (props, styles) => styles[slot];\n}\nfunction processStyleArg(callableStyle, _ref) {\n let {\n ownerState\n } = _ref,\n props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);\n const resolvedStylesArg = typeof callableStyle === 'function' ? callableStyle((0, _extends2.default)({\n ownerState\n }, props)) : callableStyle;\n if (Array.isArray(resolvedStylesArg)) {\n return resolvedStylesArg.flatMap(resolvedStyle => processStyleArg(resolvedStyle, (0, _extends2.default)({\n ownerState\n }, props)));\n }\n if (!!resolvedStylesArg && typeof resolvedStylesArg === 'object' && Array.isArray(resolvedStylesArg.variants)) {\n const {\n variants = []\n } = resolvedStylesArg,\n otherStyles = (0, _objectWithoutPropertiesLoose2.default)(resolvedStylesArg, _excluded2);\n let result = otherStyles;\n variants.forEach(variant => {\n let isMatch = true;\n if (typeof variant.props === 'function') {\n isMatch = variant.props((0, _extends2.default)({\n ownerState\n }, props, ownerState));\n } else {\n Object.keys(variant.props).forEach(key => {\n if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {\n isMatch = false;\n }\n });\n }\n if (isMatch) {\n if (!Array.isArray(result)) {\n result = [result];\n }\n result.push(typeof variant.style === 'function' ? variant.style((0, _extends2.default)({\n ownerState\n }, props, ownerState)) : variant.style);\n }\n });\n return result;\n }\n return resolvedStylesArg;\n}\nfunction createStyled(input = {}) {\n const {\n themeId,\n defaultTheme = systemDefaultTheme,\n rootShouldForwardProp = shouldForwardProp,\n slotShouldForwardProp = shouldForwardProp\n } = input;\n const systemSx = props => {\n return (0, _styleFunctionSx.default)((0, _extends2.default)({}, props, {\n theme: resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }))\n }));\n };\n systemSx.__mui_systemSx = true;\n return (tag, inputOptions = {}) => {\n // Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.\n (0, _styledEngine.internal_processStyles)(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));\n const {\n name: componentName,\n slot: componentSlot,\n skipVariantsResolver: inputSkipVariantsResolver,\n skipSx: inputSkipSx,\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))\n } = inputOptions,\n options = (0, _objectWithoutPropertiesLoose2.default)(inputOptions, _excluded3);\n\n // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.\n const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;\n const skipSx = inputSkipSx || false;\n let label;\n if (process.env.NODE_ENV !== 'production') {\n if (componentName) {\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;\n }\n }\n let shouldForwardPropOption = shouldForwardProp;\n\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n if (componentSlot === 'Root' || componentSlot === 'root') {\n shouldForwardPropOption = rootShouldForwardProp;\n } else if (componentSlot) {\n // any other slot specified\n shouldForwardPropOption = slotShouldForwardProp;\n } else if (isStringTag(tag)) {\n // for string (html) tag, preserve the behavior in emotion & styled-components.\n shouldForwardPropOption = undefined;\n }\n const defaultStyledResolver = (0, _styledEngine.default)(tag, (0, _extends2.default)({\n shouldForwardProp: shouldForwardPropOption,\n label\n }, options));\n const transformStyleArg = stylesArg => {\n // On the server Emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg || (0, _deepmerge.isPlainObject)(stylesArg)) {\n return props => processStyleArg(stylesArg, (0, _extends2.default)({}, props, {\n theme: resolveTheme({\n theme: props.theme,\n defaultTheme,\n themeId\n })\n }));\n }\n return stylesArg;\n };\n const muiStyledResolver = (styleArg, ...expressions) => {\n let transformedStyleArg = transformStyleArg(styleArg);\n const expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : [];\n if (componentName && overridesResolver) {\n expressionsWithDefaultTheme.push(props => {\n const theme = resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }));\n if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) {\n return null;\n }\n const styleOverrides = theme.components[componentName].styleOverrides;\n const resolvedStyleOverrides = {};\n // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly\n Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {\n resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, (0, _extends2.default)({}, props, {\n theme\n }));\n });\n return overridesResolver(props, resolvedStyleOverrides);\n });\n }\n if (componentName && !skipVariantsResolver) {\n expressionsWithDefaultTheme.push(props => {\n var _theme$components;\n const theme = resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }));\n const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;\n return processStyleArg({\n variants: themeVariants\n }, (0, _extends2.default)({}, props, {\n theme\n }));\n });\n }\n if (!skipSx) {\n expressionsWithDefaultTheme.push(systemSx);\n }\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;\n if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {\n const placeholders = new Array(numOfCustomFnsApplied).fill('');\n // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.\n transformedStyleArg = [...styleArg, ...placeholders];\n transformedStyleArg.raw = [...styleArg.raw, ...placeholders];\n }\n const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);\n if (process.env.NODE_ENV !== 'production') {\n let displayName;\n if (componentName) {\n displayName = `${componentName}${(0, _capitalize.default)(componentSlot || '')}`;\n }\n if (displayName === undefined) {\n displayName = `Styled(${(0, _getDisplayName.default)(tag)})`;\n }\n Component.displayName = displayName;\n }\n if (tag.muiName) {\n Component.muiName = tag.muiName;\n }\n return Component;\n };\n if (defaultStyledResolver.withConfig) {\n muiStyledResolver.withConfig = defaultStyledResolver.withConfig;\n }\n return muiStyledResolver;\n };\n}","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport resolveProps from '@mui/utils/resolveProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PropsContext = /*#__PURE__*/React.createContext(undefined);\nfunction DefaultPropsProvider({\n value,\n children\n}) {\n return /*#__PURE__*/_jsx(PropsContext.Provider, {\n value: value,\n children: children\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? DefaultPropsProvider.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * @ignore\n */\n children: PropTypes.node,\n /**\n * @ignore\n */\n value: PropTypes.object\n} : void 0;\nfunction getThemeProps(params) {\n const {\n theme,\n name,\n props\n } = params;\n if (!theme || !theme.components || !theme.components[name]) {\n return props;\n }\n const config = theme.components[name];\n if (config.defaultProps) {\n // compatible with v5 signature\n return resolveProps(config.defaultProps, props);\n }\n if (!config.styleOverrides && !config.variants) {\n // v6 signature, no property 'defaultProps'\n return resolveProps(config, props);\n }\n return props;\n}\nexport function useDefaultProps({\n props,\n name\n}) {\n const ctx = React.useContext(PropsContext);\n return getThemeProps({\n props,\n name,\n theme: {\n components: ctx\n }\n });\n}\nexport default DefaultPropsProvider;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport PropTypes from 'prop-types';\nimport deepmerge from '@mui/utils/deepmerge';\nimport merge from './merge';\n\n// The breakpoint **start** at this value.\n// For instance with the first breakpoint xs: [xs, sm[.\nexport const values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n};\nconst defaultBreakpoints = {\n // Sorted ASC by size. That's important.\n // It can't be configured as it's used statically for propTypes.\n keys: ['xs', 'sm', 'md', 'lg', 'xl'],\n up: key => `@media (min-width:${values[key]}px)`\n};\nexport function handleBreakpoints(props, propValue, styleFromPropValue) {\n const theme = props.theme || {};\n if (Array.isArray(propValue)) {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return propValue.reduce((acc, item, index) => {\n acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);\n return acc;\n }, {});\n }\n if (typeof propValue === 'object') {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return Object.keys(propValue).reduce((acc, breakpoint) => {\n // key is breakpoint\n if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {\n const mediaKey = themeBreakpoints.up(breakpoint);\n acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);\n } else {\n const cssKey = breakpoint;\n acc[cssKey] = propValue[cssKey];\n }\n return acc;\n }, {});\n }\n const output = styleFromPropValue(propValue);\n return output;\n}\nfunction breakpoints(styleFunction) {\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const newStyleFunction = props => {\n const theme = props.theme || {};\n const base = styleFunction(props);\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n const extended = themeBreakpoints.keys.reduce((acc, key) => {\n if (props[key]) {\n acc = acc || {};\n acc[themeBreakpoints.up(key)] = styleFunction(_extends({\n theme\n }, props[key]));\n }\n return acc;\n }, null);\n return merge(base, extended);\n };\n newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends({}, styleFunction.propTypes, {\n xs: PropTypes.object,\n sm: PropTypes.object,\n md: PropTypes.object,\n lg: PropTypes.object,\n xl: PropTypes.object\n }) : {};\n newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl', ...styleFunction.filterProps];\n return newStyleFunction;\n}\nexport function createEmptyBreakpointObject(breakpointsInput = {}) {\n var _breakpointsInput$key;\n const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {\n const breakpointStyleKey = breakpointsInput.up(key);\n acc[breakpointStyleKey] = {};\n return acc;\n }, {});\n return breakpointsInOrder || {};\n}\nexport function removeUnusedBreakpoints(breakpointKeys, style) {\n return breakpointKeys.reduce((acc, key) => {\n const breakpointOutput = acc[key];\n const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;\n if (isBreakpointUnused) {\n delete acc[key];\n }\n return acc;\n }, style);\n}\nexport function mergeBreakpointsInOrder(breakpointsInput, ...styles) {\n const emptyBreakpoints = createEmptyBreakpointObject(breakpointsInput);\n const mergedOutput = [emptyBreakpoints, ...styles].reduce((prev, next) => deepmerge(prev, next), {});\n return removeUnusedBreakpoints(Object.keys(emptyBreakpoints), mergedOutput);\n}\n\n// compute base for responsive values; e.g.,\n// [1,2,3] => {xs: true, sm: true, md: true}\n// {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true}\nexport function computeBreakpointsBase(breakpointValues, themeBreakpoints) {\n // fixed value\n if (typeof breakpointValues !== 'object') {\n return {};\n }\n const base = {};\n const breakpointsKeys = Object.keys(themeBreakpoints);\n if (Array.isArray(breakpointValues)) {\n breakpointsKeys.forEach((breakpoint, i) => {\n if (i < breakpointValues.length) {\n base[breakpoint] = true;\n }\n });\n } else {\n breakpointsKeys.forEach(breakpoint => {\n if (breakpointValues[breakpoint] != null) {\n base[breakpoint] = true;\n }\n });\n }\n return base;\n}\nexport function resolveBreakpointValues({\n values: breakpointValues,\n breakpoints: themeBreakpoints,\n base: customBase\n}) {\n const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);\n const keys = Object.keys(base);\n if (keys.length === 0) {\n return breakpointValues;\n }\n let previous;\n return keys.reduce((acc, breakpoint, i) => {\n if (Array.isArray(breakpointValues)) {\n acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];\n previous = i;\n } else if (typeof breakpointValues === 'object') {\n acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];\n previous = breakpoint;\n } else {\n acc[breakpoint] = breakpointValues;\n }\n return acc;\n }, {});\n}\nexport default breakpoints;","/**\n * A universal utility to style components with multiple color modes. Always use it from the theme object.\n * It works with:\n * - [Basic theme](https://mui.com/material-ui/customization/dark-mode/)\n * - [CSS theme variables](https://mui.com/material-ui/experimental-api/css-theme-variables/overview/)\n * - Zero-runtime engine\n *\n * Tips: Use an array over object spread and place `theme.applyStyles()` last.\n *\n * ✅ [{ background: '#e5e5e5' }, theme.applyStyles('dark', { background: '#1c1c1c' })]\n *\n * 🚫 { background: '#e5e5e5', ...theme.applyStyles('dark', { background: '#1c1c1c' })}\n *\n * @example\n * 1. using with `styled`:\n * ```jsx\n * const Component = styled('div')(({ theme }) => [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ]);\n * ```\n *\n * @example\n * 2. using with `sx` prop:\n * ```jsx\n * [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ]}\n * />\n * ```\n *\n * @example\n * 3. theming a component:\n * ```jsx\n * extendTheme({\n * components: {\n * MuiButton: {\n * styleOverrides: {\n * root: ({ theme }) => [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ],\n * },\n * }\n * }\n * })\n *```\n */\nexport default function applyStyles(key, styles) {\n // @ts-expect-error this is 'any' type\n const theme = this;\n if (theme.vars && typeof theme.getColorSchemeSelector === 'function') {\n // If CssVarsProvider is used as a provider,\n // returns '* :where([data-mui-color-scheme=\"light|dark\"]) &'\n const selector = theme.getColorSchemeSelector(key).replace(/(\\[[^\\]]+\\])/, '*:where($1)');\n return {\n [selector]: styles\n };\n }\n if (theme.palette.mode === key) {\n return styles;\n }\n return {};\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"values\", \"unit\", \"step\"];\n// Sorted ASC by size. That's important.\n// It can't be configured as it's used statically for propTypes.\nexport const breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];\nconst sortBreakpointsValues = values => {\n const breakpointsAsArray = Object.keys(values).map(key => ({\n key,\n val: values[key]\n })) || [];\n // Sort in ascending order\n breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);\n return breakpointsAsArray.reduce((acc, obj) => {\n return _extends({}, acc, {\n [obj.key]: obj.val\n });\n }, {});\n};\n\n// Keep in mind that @media is inclusive by the CSS specification.\nexport default function createBreakpoints(breakpoints) {\n const {\n // The breakpoint **start** at this value.\n // For instance with the first breakpoint xs: [xs, sm).\n values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n },\n unit = 'px',\n step = 5\n } = breakpoints,\n other = _objectWithoutPropertiesLoose(breakpoints, _excluded);\n const sortedValues = sortBreakpointsValues(values);\n const keys = Object.keys(sortedValues);\n function up(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (min-width:${value}${unit})`;\n }\n function down(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (max-width:${value - step / 100}${unit})`;\n }\n function between(start, end) {\n const endIndex = keys.indexOf(end);\n return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;\n }\n function only(key) {\n if (keys.indexOf(key) + 1 < keys.length) {\n return between(key, keys[keys.indexOf(key) + 1]);\n }\n return up(key);\n }\n function not(key) {\n // handle first and last key separately, for better readability\n const keyIndex = keys.indexOf(key);\n if (keyIndex === 0) {\n return up(keys[1]);\n }\n if (keyIndex === keys.length - 1) {\n return down(keys[keyIndex]);\n }\n return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');\n }\n return _extends({\n keys,\n values: sortedValues,\n up,\n down,\n between,\n only,\n not,\n unit\n }, other);\n}","const shape = {\n borderRadius: 4\n};\nexport default shape;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"breakpoints\", \"palette\", \"spacing\", \"shape\"];\nimport deepmerge from '@mui/utils/deepmerge';\nimport createBreakpoints from './createBreakpoints';\nimport shape from './shape';\nimport createSpacing from './createSpacing';\nimport styleFunctionSx from '../styleFunctionSx/styleFunctionSx';\nimport defaultSxConfig from '../styleFunctionSx/defaultSxConfig';\nimport applyStyles from './applyStyles';\nfunction createTheme(options = {}, ...args) {\n const {\n breakpoints: breakpointsInput = {},\n palette: paletteInput = {},\n spacing: spacingInput,\n shape: shapeInput = {}\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n const breakpoints = createBreakpoints(breakpointsInput);\n const spacing = createSpacing(spacingInput);\n let muiTheme = deepmerge({\n breakpoints,\n direction: 'ltr',\n components: {},\n // Inject component definitions.\n palette: _extends({\n mode: 'light'\n }, paletteInput),\n spacing,\n shape: _extends({}, shape, shapeInput)\n }, other);\n muiTheme.applyStyles = applyStyles;\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);\n muiTheme.unstable_sx = function sx(props) {\n return styleFunctionSx({\n sx: props,\n theme: this\n });\n };\n return muiTheme;\n}\nexport default createTheme;","import { createUnarySpacing } from '../spacing';\n\n// The different signatures imply different meaning for their arguments that can't be expressed structurally.\n// We express the difference with variable names.\n\nexport default function createSpacing(spacingInput = 8) {\n // Already transformed.\n if (spacingInput.mui) {\n return spacingInput;\n }\n\n // Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.\n // Smaller components, such as icons, can align to a 4dp grid.\n // https://m2.material.io/design/layout/understanding-layout.html\n const transform = createUnarySpacing({\n spacing: spacingInput\n });\n const spacing = (...argsInput) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!(argsInput.length <= 4)) {\n console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);\n }\n }\n const args = argsInput.length === 0 ? [1] : argsInput;\n return args.map(argument => {\n const output = transform(argument);\n return typeof output === 'number' ? `${output}px` : output;\n }).join(' ');\n };\n spacing.mui = true;\n return spacing;\n}","import deepmerge from '@mui/utils/deepmerge';\nfunction merge(acc, item) {\n if (!item) {\n return acc;\n }\n return deepmerge(acc, item, {\n clone: false // No need to clone deep, it's way faster.\n });\n}\nexport default merge;","import responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nimport { getPath } from './style';\nimport merge from './merge';\nimport memoize from './memoize';\nconst properties = {\n m: 'margin',\n p: 'padding'\n};\nconst directions = {\n t: 'Top',\n r: 'Right',\n b: 'Bottom',\n l: 'Left',\n x: ['Left', 'Right'],\n y: ['Top', 'Bottom']\n};\nconst aliases = {\n marginX: 'mx',\n marginY: 'my',\n paddingX: 'px',\n paddingY: 'py'\n};\n\n// memoize() impact:\n// From 300,000 ops/sec\n// To 350,000 ops/sec\nconst getCssProperties = memoize(prop => {\n // It's not a shorthand notation.\n if (prop.length > 2) {\n if (aliases[prop]) {\n prop = aliases[prop];\n } else {\n return [prop];\n }\n }\n const [a, b] = prop.split('');\n const property = properties[a];\n const direction = directions[b] || '';\n return Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];\n});\nexport const marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd'];\nexport const paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];\nconst spacingKeys = [...marginKeys, ...paddingKeys];\nexport function createUnaryUnit(theme, themeKey, defaultValue, propName) {\n var _getPath;\n const themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;\n if (typeof themeSpacing === 'number') {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (typeof abs !== 'number') {\n console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);\n }\n }\n return themeSpacing * abs;\n };\n }\n if (Array.isArray(themeSpacing)) {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!Number.isInteger(abs)) {\n console.error([`MUI: The \\`theme.${themeKey}\\` array type cannot be combined with non integer values.` + `You should either use an integer value that can be used as index, or define the \\`theme.${themeKey}\\` as a number.`].join('\\n'));\n } else if (abs > themeSpacing.length - 1) {\n console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join('\\n'));\n }\n }\n return themeSpacing[abs];\n };\n }\n if (typeof themeSpacing === 'function') {\n return themeSpacing;\n }\n if (process.env.NODE_ENV !== 'production') {\n console.error([`MUI: The \\`theme.${themeKey}\\` value (${themeSpacing}) is invalid.`, 'It should be a number, an array or a function.'].join('\\n'));\n }\n return () => undefined;\n}\nexport function createUnarySpacing(theme) {\n return createUnaryUnit(theme, 'spacing', 8, 'spacing');\n}\nexport function getValue(transformer, propValue) {\n if (typeof propValue === 'string' || propValue == null) {\n return propValue;\n }\n const abs = Math.abs(propValue);\n const transformed = transformer(abs);\n if (propValue >= 0) {\n return transformed;\n }\n if (typeof transformed === 'number') {\n return -transformed;\n }\n return `-${transformed}`;\n}\nexport function getStyleFromPropValue(cssProperties, transformer) {\n return propValue => cssProperties.reduce((acc, cssProperty) => {\n acc[cssProperty] = getValue(transformer, propValue);\n return acc;\n }, {});\n}\nfunction resolveCssProperty(props, keys, prop, transformer) {\n // Using a hash computation over an array iteration could be faster, but with only 28 items,\n // it's doesn't worth the bundle size.\n if (keys.indexOf(prop) === -1) {\n return null;\n }\n const cssProperties = getCssProperties(prop);\n const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);\n const propValue = props[prop];\n return handleBreakpoints(props, propValue, styleFromPropValue);\n}\nfunction style(props, keys) {\n const transformer = createUnarySpacing(props.theme);\n return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(merge, {});\n}\nexport function margin(props) {\n return style(props, marginKeys);\n}\nmargin.propTypes = process.env.NODE_ENV !== 'production' ? marginKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nmargin.filterProps = marginKeys;\nexport function padding(props) {\n return style(props, paddingKeys);\n}\npadding.propTypes = process.env.NODE_ENV !== 'production' ? paddingKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\npadding.filterProps = paddingKeys;\nfunction spacing(props) {\n return style(props, spacingKeys);\n}\nspacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nspacing.filterProps = spacingKeys;\nexport default spacing;","export default function memoize(fn) {\n const cache = {};\n return arg => {\n if (cache[arg] === undefined) {\n cache[arg] = fn(arg);\n }\n return cache[arg];\n };\n}","import capitalize from '@mui/utils/capitalize';\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nexport function getPath(obj, path, checkVars = true) {\n if (!path || typeof path !== 'string') {\n return null;\n }\n\n // Check if CSS variables are used\n if (obj && obj.vars && checkVars) {\n const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);\n if (val != null) {\n return val;\n }\n }\n return path.split('.').reduce((acc, item) => {\n if (acc && acc[item] != null) {\n return acc[item];\n }\n return null;\n }, obj);\n}\nexport function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {\n let value;\n if (typeof themeMapping === 'function') {\n value = themeMapping(propValueFinal);\n } else if (Array.isArray(themeMapping)) {\n value = themeMapping[propValueFinal] || userValue;\n } else {\n value = getPath(themeMapping, propValueFinal) || userValue;\n }\n if (transform) {\n value = transform(value, userValue, themeMapping);\n }\n return value;\n}\nfunction style(options) {\n const {\n prop,\n cssProperty = options.prop,\n themeKey,\n transform\n } = options;\n\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const fn = props => {\n if (props[prop] == null) {\n return null;\n }\n const propValue = props[prop];\n const theme = props.theme;\n const themeMapping = getPath(theme, themeKey) || {};\n const styleFromPropValue = propValueFinal => {\n let value = getStyleValue(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return handleBreakpoints(props, propValue, styleFromPropValue);\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? {\n [prop]: responsivePropType\n } : {};\n fn.filterProps = [prop];\n return fn;\n}\nexport default style;","import merge from './merge';\nfunction compose(...styles) {\n const handlers = styles.reduce((acc, style) => {\n style.filterProps.forEach(prop => {\n acc[prop] = style;\n });\n return acc;\n }, {});\n\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const fn = props => {\n return Object.keys(props).reduce((acc, prop) => {\n if (handlers[prop]) {\n return merge(acc, handlers[prop](props));\n }\n return acc;\n }, {});\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce((acc, style) => Object.assign(acc, style.propTypes), {}) : {};\n fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);\n return fn;\n}\nexport default compose;","import responsivePropType from './responsivePropType';\nimport style from './style';\nimport compose from './compose';\nimport { createUnaryUnit, getValue } from './spacing';\nimport { handleBreakpoints } from './breakpoints';\nexport function borderTransform(value) {\n if (typeof value !== 'number') {\n return value;\n }\n return `${value}px solid`;\n}\nfunction createBorderStyle(prop, transform) {\n return style({\n prop,\n themeKey: 'borders',\n transform\n });\n}\nexport const border = createBorderStyle('border', borderTransform);\nexport const borderTop = createBorderStyle('borderTop', borderTransform);\nexport const borderRight = createBorderStyle('borderRight', borderTransform);\nexport const borderBottom = createBorderStyle('borderBottom', borderTransform);\nexport const borderLeft = createBorderStyle('borderLeft', borderTransform);\nexport const borderColor = createBorderStyle('borderColor');\nexport const borderTopColor = createBorderStyle('borderTopColor');\nexport const borderRightColor = createBorderStyle('borderRightColor');\nexport const borderBottomColor = createBorderStyle('borderBottomColor');\nexport const borderLeftColor = createBorderStyle('borderLeftColor');\nexport const outline = createBorderStyle('outline', borderTransform);\nexport const outlineColor = createBorderStyle('outlineColor');\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const borderRadius = props => {\n if (props.borderRadius !== undefined && props.borderRadius !== null) {\n const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4, 'borderRadius');\n const styleFromPropValue = propValue => ({\n borderRadius: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.borderRadius, styleFromPropValue);\n }\n return null;\n};\nborderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {\n borderRadius: responsivePropType\n} : {};\nborderRadius.filterProps = ['borderRadius'];\nconst borders = compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius, outline, outlineColor);\nexport default borders;","import style from './style';\nimport compose from './compose';\nimport { createUnaryUnit, getValue } from './spacing';\nimport { handleBreakpoints } from './breakpoints';\nimport responsivePropType from './responsivePropType';\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const gap = props => {\n if (props.gap !== undefined && props.gap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap');\n const styleFromPropValue = propValue => ({\n gap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.gap, styleFromPropValue);\n }\n return null;\n};\ngap.propTypes = process.env.NODE_ENV !== 'production' ? {\n gap: responsivePropType\n} : {};\ngap.filterProps = ['gap'];\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const columnGap = props => {\n if (props.columnGap !== undefined && props.columnGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap');\n const styleFromPropValue = propValue => ({\n columnGap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.columnGap, styleFromPropValue);\n }\n return null;\n};\ncolumnGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n columnGap: responsivePropType\n} : {};\ncolumnGap.filterProps = ['columnGap'];\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const rowGap = props => {\n if (props.rowGap !== undefined && props.rowGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap');\n const styleFromPropValue = propValue => ({\n rowGap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.rowGap, styleFromPropValue);\n }\n return null;\n};\nrowGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n rowGap: responsivePropType\n} : {};\nrowGap.filterProps = ['rowGap'];\nexport const gridColumn = style({\n prop: 'gridColumn'\n});\nexport const gridRow = style({\n prop: 'gridRow'\n});\nexport const gridAutoFlow = style({\n prop: 'gridAutoFlow'\n});\nexport const gridAutoColumns = style({\n prop: 'gridAutoColumns'\n});\nexport const gridAutoRows = style({\n prop: 'gridAutoRows'\n});\nexport const gridTemplateColumns = style({\n prop: 'gridTemplateColumns'\n});\nexport const gridTemplateRows = style({\n prop: 'gridTemplateRows'\n});\nexport const gridTemplateAreas = style({\n prop: 'gridTemplateAreas'\n});\nexport const gridArea = style({\n prop: 'gridArea'\n});\nconst grid = compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);\nexport default grid;","import style from './style';\nimport compose from './compose';\nexport function paletteTransform(value, userValue) {\n if (userValue === 'grey') {\n return userValue;\n }\n return value;\n}\nexport const color = style({\n prop: 'color',\n themeKey: 'palette',\n transform: paletteTransform\n});\nexport const bgcolor = style({\n prop: 'bgcolor',\n cssProperty: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nexport const backgroundColor = style({\n prop: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nconst palette = compose(color, bgcolor, backgroundColor);\nexport default palette;","import style from './style';\nimport compose from './compose';\nimport { handleBreakpoints, values as breakpointsValues } from './breakpoints';\nexport function sizingTransform(value) {\n return value <= 1 && value !== 0 ? `${value * 100}%` : value;\n}\nexport const width = style({\n prop: 'width',\n transform: sizingTransform\n});\nexport const maxWidth = props => {\n if (props.maxWidth !== undefined && props.maxWidth !== null) {\n const styleFromPropValue = propValue => {\n var _props$theme, _props$theme2;\n const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || breakpointsValues[propValue];\n if (!breakpoint) {\n return {\n maxWidth: sizingTransform(propValue)\n };\n }\n if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {\n return {\n maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`\n };\n }\n return {\n maxWidth: breakpoint\n };\n };\n return handleBreakpoints(props, props.maxWidth, styleFromPropValue);\n }\n return null;\n};\nmaxWidth.filterProps = ['maxWidth'];\nexport const minWidth = style({\n prop: 'minWidth',\n transform: sizingTransform\n});\nexport const height = style({\n prop: 'height',\n transform: sizingTransform\n});\nexport const maxHeight = style({\n prop: 'maxHeight',\n transform: sizingTransform\n});\nexport const minHeight = style({\n prop: 'minHeight',\n transform: sizingTransform\n});\nexport const sizeWidth = style({\n prop: 'size',\n cssProperty: 'width',\n transform: sizingTransform\n});\nexport const sizeHeight = style({\n prop: 'size',\n cssProperty: 'height',\n transform: sizingTransform\n});\nexport const boxSizing = style({\n prop: 'boxSizing'\n});\nconst sizing = compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);\nexport default sizing;","import { padding, margin } from '../spacing';\nimport { borderRadius, borderTransform } from '../borders';\nimport { gap, rowGap, columnGap } from '../cssGrid';\nimport { paletteTransform } from '../palette';\nimport { maxWidth, sizingTransform } from '../sizing';\nconst defaultSxConfig = {\n // borders\n border: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderTop: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderRight: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderBottom: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderLeft: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderColor: {\n themeKey: 'palette'\n },\n borderTopColor: {\n themeKey: 'palette'\n },\n borderRightColor: {\n themeKey: 'palette'\n },\n borderBottomColor: {\n themeKey: 'palette'\n },\n borderLeftColor: {\n themeKey: 'palette'\n },\n outline: {\n themeKey: 'borders',\n transform: borderTransform\n },\n outlineColor: {\n themeKey: 'palette'\n },\n borderRadius: {\n themeKey: 'shape.borderRadius',\n style: borderRadius\n },\n // palette\n color: {\n themeKey: 'palette',\n transform: paletteTransform\n },\n bgcolor: {\n themeKey: 'palette',\n cssProperty: 'backgroundColor',\n transform: paletteTransform\n },\n backgroundColor: {\n themeKey: 'palette',\n transform: paletteTransform\n },\n // spacing\n p: {\n style: padding\n },\n pt: {\n style: padding\n },\n pr: {\n style: padding\n },\n pb: {\n style: padding\n },\n pl: {\n style: padding\n },\n px: {\n style: padding\n },\n py: {\n style: padding\n },\n padding: {\n style: padding\n },\n paddingTop: {\n style: padding\n },\n paddingRight: {\n style: padding\n },\n paddingBottom: {\n style: padding\n },\n paddingLeft: {\n style: padding\n },\n paddingX: {\n style: padding\n },\n paddingY: {\n style: padding\n },\n paddingInline: {\n style: padding\n },\n paddingInlineStart: {\n style: padding\n },\n paddingInlineEnd: {\n style: padding\n },\n paddingBlock: {\n style: padding\n },\n paddingBlockStart: {\n style: padding\n },\n paddingBlockEnd: {\n style: padding\n },\n m: {\n style: margin\n },\n mt: {\n style: margin\n },\n mr: {\n style: margin\n },\n mb: {\n style: margin\n },\n ml: {\n style: margin\n },\n mx: {\n style: margin\n },\n my: {\n style: margin\n },\n margin: {\n style: margin\n },\n marginTop: {\n style: margin\n },\n marginRight: {\n style: margin\n },\n marginBottom: {\n style: margin\n },\n marginLeft: {\n style: margin\n },\n marginX: {\n style: margin\n },\n marginY: {\n style: margin\n },\n marginInline: {\n style: margin\n },\n marginInlineStart: {\n style: margin\n },\n marginInlineEnd: {\n style: margin\n },\n marginBlock: {\n style: margin\n },\n marginBlockStart: {\n style: margin\n },\n marginBlockEnd: {\n style: margin\n },\n // display\n displayPrint: {\n cssProperty: false,\n transform: value => ({\n '@media print': {\n display: value\n }\n })\n },\n display: {},\n overflow: {},\n textOverflow: {},\n visibility: {},\n whiteSpace: {},\n // flexbox\n flexBasis: {},\n flexDirection: {},\n flexWrap: {},\n justifyContent: {},\n alignItems: {},\n alignContent: {},\n order: {},\n flex: {},\n flexGrow: {},\n flexShrink: {},\n alignSelf: {},\n justifyItems: {},\n justifySelf: {},\n // grid\n gap: {\n style: gap\n },\n rowGap: {\n style: rowGap\n },\n columnGap: {\n style: columnGap\n },\n gridColumn: {},\n gridRow: {},\n gridAutoFlow: {},\n gridAutoColumns: {},\n gridAutoRows: {},\n gridTemplateColumns: {},\n gridTemplateRows: {},\n gridTemplateAreas: {},\n gridArea: {},\n // positions\n position: {},\n zIndex: {\n themeKey: 'zIndex'\n },\n top: {},\n right: {},\n bottom: {},\n left: {},\n // shadows\n boxShadow: {\n themeKey: 'shadows'\n },\n // sizing\n width: {\n transform: sizingTransform\n },\n maxWidth: {\n style: maxWidth\n },\n minWidth: {\n transform: sizingTransform\n },\n height: {\n transform: sizingTransform\n },\n maxHeight: {\n transform: sizingTransform\n },\n minHeight: {\n transform: sizingTransform\n },\n boxSizing: {},\n // typography\n fontFamily: {\n themeKey: 'typography'\n },\n fontSize: {\n themeKey: 'typography'\n },\n fontStyle: {\n themeKey: 'typography'\n },\n fontWeight: {\n themeKey: 'typography'\n },\n letterSpacing: {},\n textTransform: {},\n lineHeight: {},\n textAlign: {},\n typography: {\n cssProperty: false,\n themeKey: 'typography'\n }\n};\nexport default defaultSxConfig;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"sx\"];\nimport { isPlainObject } from '@mui/utils/deepmerge';\nimport defaultSxConfig from './defaultSxConfig';\nconst splitProps = props => {\n var _props$theme$unstable, _props$theme;\n const result = {\n systemProps: {},\n otherProps: {}\n };\n const config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig;\n Object.keys(props).forEach(prop => {\n if (config[prop]) {\n result.systemProps[prop] = props[prop];\n } else {\n result.otherProps[prop] = props[prop];\n }\n });\n return result;\n};\nexport default function extendSxProp(props) {\n const {\n sx: inSx\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n systemProps,\n otherProps\n } = splitProps(other);\n let finalSx;\n if (Array.isArray(inSx)) {\n finalSx = [systemProps, ...inSx];\n } else if (typeof inSx === 'function') {\n finalSx = (...args) => {\n const result = inSx(...args);\n if (!isPlainObject(result)) {\n return systemProps;\n }\n return _extends({}, systemProps, result);\n };\n } else {\n finalSx = _extends({}, systemProps, inSx);\n }\n return _extends({}, otherProps, {\n sx: finalSx\n });\n}","import capitalize from '@mui/utils/capitalize';\nimport merge from '../merge';\nimport { getPath, getStyleValue as getValue } from '../style';\nimport { handleBreakpoints, createEmptyBreakpointObject, removeUnusedBreakpoints } from '../breakpoints';\nimport defaultSxConfig from './defaultSxConfig';\nfunction objectsHaveSameKeys(...objects) {\n const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);\n const union = new Set(allKeys);\n return objects.every(object => union.size === Object.keys(object).length);\n}\nfunction callIfFn(maybeFn, arg) {\n return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function unstable_createStyleFunctionSx() {\n function getThemeValue(prop, val, theme, config) {\n const props = {\n [prop]: val,\n theme\n };\n const options = config[prop];\n if (!options) {\n return {\n [prop]: val\n };\n }\n const {\n cssProperty = prop,\n themeKey,\n transform,\n style\n } = options;\n if (val == null) {\n return null;\n }\n\n // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123\n if (themeKey === 'typography' && val === 'inherit') {\n return {\n [prop]: val\n };\n }\n const themeMapping = getPath(theme, themeKey) || {};\n if (style) {\n return style(props);\n }\n const styleFromPropValue = propValueFinal => {\n let value = getValue(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return handleBreakpoints(props, val, styleFromPropValue);\n }\n function styleFunctionSx(props) {\n var _theme$unstable_sxCon;\n const {\n sx,\n theme = {}\n } = props || {};\n if (!sx) {\n return null; // Emotion & styled-components will neglect null\n }\n const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig;\n\n /*\n * Receive `sxInput` as object or callback\n * and then recursively check keys & values to create media query object styles.\n * (the result will be used in `styled`)\n */\n function traverse(sxInput) {\n let sxObject = sxInput;\n if (typeof sxInput === 'function') {\n sxObject = sxInput(theme);\n } else if (typeof sxInput !== 'object') {\n // value\n return sxInput;\n }\n if (!sxObject) {\n return null;\n }\n const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);\n const breakpointsKeys = Object.keys(emptyBreakpoints);\n let css = emptyBreakpoints;\n Object.keys(sxObject).forEach(styleKey => {\n const value = callIfFn(sxObject[styleKey], theme);\n if (value !== null && value !== undefined) {\n if (typeof value === 'object') {\n if (config[styleKey]) {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n } else {\n const breakpointsValues = handleBreakpoints({\n theme\n }, value, x => ({\n [styleKey]: x\n }));\n if (objectsHaveSameKeys(breakpointsValues, value)) {\n css[styleKey] = styleFunctionSx({\n sx: value,\n theme\n });\n } else {\n css = merge(css, breakpointsValues);\n }\n }\n } else {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n }\n }\n });\n return removeUnusedBreakpoints(breakpointsKeys, css);\n }\n return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);\n }\n return styleFunctionSx;\n}\nconst styleFunctionSx = unstable_createStyleFunctionSx();\nstyleFunctionSx.filterProps = ['sx'];\nexport default styleFunctionSx;","const defaultGenerator = componentName => componentName;\nconst createClassNameGenerator = () => {\n let generate = defaultGenerator;\n return {\n configure(generator) {\n generate = generator;\n },\n generate(componentName) {\n return generate(componentName);\n },\n reset() {\n generate = defaultGenerator;\n }\n };\n};\nconst ClassNameGenerator = createClassNameGenerator();\nexport default ClassNameGenerator;","import _formatMuiErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\n// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.\n//\n// A strict capitalization should uppercase the first letter of each word in the sentence.\n// We only handle the first word.\nexport default function capitalize(string) {\n if (typeof string !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`capitalize(string)\\` expects a string argument.` : _formatMuiErrorMessage(7));\n }\n return string.charAt(0).toUpperCase() + string.slice(1);\n}","function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}\nexport default clamp;","export default function composeClasses(slots, getUtilityClass, classes = undefined) {\n const output = {};\n Object.keys(slots).forEach(\n // `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.\n // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208\n slot => {\n output[slot] = slots[slot].reduce((acc, key) => {\n if (key) {\n const utilityClass = getUtilityClass(key);\n if (utilityClass !== '') {\n acc.push(utilityClass);\n }\n if (classes && classes[key]) {\n acc.push(classes[key]);\n }\n }\n return acc;\n }, []).join(' ');\n });\n return output;\n}","/**\n * Safe chained function.\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n */\nexport default function createChainedFunction(...funcs) {\n return funcs.reduce((acc, func) => {\n if (func == null) {\n return acc;\n }\n return function chainedFunction(...args) {\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, () => {});\n}","// Corresponds to 10 frames at 60 Hz.\n// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.\nexport default function debounce(func, wait = 166) {\n let timeout;\n function debounced(...args) {\n const later = () => {\n // @ts-ignore\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n return debounced;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js\nexport function isPlainObject(item) {\n if (typeof item !== 'object' || item === null) {\n return false;\n }\n const prototype = Object.getPrototypeOf(item);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);\n}\nfunction deepClone(source) {\n if (!isPlainObject(source)) {\n return source;\n }\n const output = {};\n Object.keys(source).forEach(key => {\n output[key] = deepClone(source[key]);\n });\n return output;\n}\nexport default function deepmerge(target, source, options = {\n clone: true\n}) {\n const output = options.clone ? _extends({}, target) : target;\n if (isPlainObject(target) && isPlainObject(source)) {\n Object.keys(source).forEach(key => {\n if (isPlainObject(source[key]) &&\n // Avoid prototype pollution\n Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {\n // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.\n output[key] = deepmerge(target[key], source[key], options);\n } else if (options.clone) {\n output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];\n } else {\n output[key] = source[key];\n }\n });\n }\n return output;\n}","/**\n * WARNING: Don't import this directly.\n * Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.\n * @param {number} code\n */\nexport default function formatMuiErrorMessage(code) {\n // Apply babel-plugin-transform-template-literals in loose mode\n // loose mode is safe if we're concatenating primitives\n // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose\n /* eslint-disable prefer-template */\n let url = 'https://mui.com/production-error/?code=' + code;\n for (let i = 1; i < arguments.length; i += 1) {\n // rest params over-transpile for this case\n // eslint-disable-next-line prefer-rest-params\n url += '&args[]=' + encodeURIComponent(arguments[i]);\n }\n return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';\n /* eslint-enable prefer-template */\n}","import ClassNameGenerator from '../ClassNameGenerator';\nexport const globalStateClasses = {\n active: 'active',\n checked: 'checked',\n completed: 'completed',\n disabled: 'disabled',\n error: 'error',\n expanded: 'expanded',\n focused: 'focused',\n focusVisible: 'focusVisible',\n open: 'open',\n readOnly: 'readOnly',\n required: 'required',\n selected: 'selected'\n};\nexport default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {\n const globalStateClass = globalStateClasses[slot];\n return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;\n}\nexport function isGlobalState(slot) {\n return globalStateClasses[slot] !== undefined;\n}","import generateUtilityClass from '../generateUtilityClass';\nexport default function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {\n const result = {};\n slots.forEach(slot => {\n result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);\n });\n return result;\n}","import { ForwardRef, Memo } from 'react-is';\n\n// Simplified polyfill for IE11 support\n// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3\nconst fnNameMatchRegex = /^\\s*function(?:\\s|\\s*\\/\\*.*\\*\\/\\s*)+([^(\\s/]*)\\s*/;\nexport function getFunctionName(fn) {\n const match = `${fn}`.match(fnNameMatchRegex);\n const name = match && match[1];\n return name || '';\n}\nfunction getFunctionComponentName(Component, fallback = '') {\n return Component.displayName || Component.name || getFunctionName(Component) || fallback;\n}\nfunction getWrappedName(outerType, innerType, wrapperName) {\n const functionName = getFunctionComponentName(innerType);\n return outerType.displayName || (functionName !== '' ? `${wrapperName}(${functionName})` : wrapperName);\n}\n\n/**\n * cherry-pick from\n * https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js\n * originally forked from recompose/getDisplayName with added IE11 support\n */\nexport default function getDisplayName(Component) {\n if (Component == null) {\n return undefined;\n }\n if (typeof Component === 'string') {\n return Component;\n }\n if (typeof Component === 'function') {\n return getFunctionComponentName(Component, 'Component');\n }\n\n // TypeScript can't have components as objects but they exist in the form of `memo` or `Suspense`\n if (typeof Component === 'object') {\n switch (Component.$$typeof) {\n case ForwardRef:\n return getWrappedName(Component, Component.render, 'ForwardRef');\n case Memo:\n return getWrappedName(Component, Component.type, 'memo');\n default:\n return undefined;\n }\n }\n return undefined;\n}","export default function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}","import ownerDocument from '../ownerDocument';\nexport default function ownerWindow(node) {\n const doc = ownerDocument(node);\n return doc.defaultView || window;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\n/**\n * Add keys, values of `defaultProps` that does not exist in `props`\n * @param {object} defaultProps\n * @param {object} props\n * @returns {object} resolved props\n */\nexport default function resolveProps(defaultProps, props) {\n const output = _extends({}, props);\n Object.keys(defaultProps).forEach(propName => {\n if (propName.toString().match(/^(components|slots)$/)) {\n output[propName] = _extends({}, defaultProps[propName], output[propName]);\n } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {\n const defaultSlotProps = defaultProps[propName] || {};\n const slotProps = props[propName];\n output[propName] = {};\n if (!slotProps || !Object.keys(slotProps)) {\n // Reduce the iteration if the slot props is empty\n output[propName] = defaultSlotProps;\n } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {\n // Reduce the iteration if the default slot props is empty\n output[propName] = slotProps;\n } else {\n output[propName] = _extends({}, slotProps);\n Object.keys(defaultSlotProps).forEach(slotPropName => {\n output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);\n });\n }\n } else if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n });\n return output;\n}","/**\n * TODO v5: consider making it private\n *\n * passes {value} to {ref}\n *\n * WARNING: Be sure to only call this inside a callback that is passed as a ref.\n * Otherwise, make sure to cleanup the previous {ref} if it changes. See\n * https://github.com/mui/material-ui/issues/13539\n *\n * Useful if you want to expose the ref of an inner component to the public API\n * while still using it inside the component.\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\n */\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","'use client';\n\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && !Object.is(defaultValue, defaultProp)) {\n console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.\n * This is useful for effects that are only needed for client-side rendering but not for SSR.\n *\n * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * and confirm it doesn't apply to your use-case.\n */\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;","'use client';\n\nimport * as React from 'react';\nimport useEnhancedEffect from '../useEnhancedEffect';\n\n/**\n * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892\n * See RFC in https://github.com/reactjs/rfcs/pull/220\n */\n\nfunction useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useRef((...args) =>\n // @ts-expect-error hide `this`\n (0, ref.current)(...args)).current;\n}\nexport default useEventCallback;","'use client';\n\nimport * as React from 'react';\nimport setRef from '../setRef';\nexport default function useForkRef(...refs) {\n /**\n * This will create a new function if the refs passed to this hook change and are all defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior.\n */\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return instance => {\n refs.forEach(ref => {\n setRef(ref, instance);\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}","'use client';\n\nimport * as React from 'react';\nlet globalId = 0;\nfunction useGlobalId(idOverride) {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`mui-${globalId}`);\n }\n }, [defaultId]);\n return id;\n}\n\n// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseId = React['useId'.toString()];\n/**\n *\n * @example
\n * @param idOverride\n * @returns {string}\n */\nexport default function useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride);\n}","'use client';\n\n// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nimport { Timeout } from '../useTimeout/useTimeout';\nlet hadKeyboardEvent = true;\nlet hadFocusVisibleRecently = false;\nconst hadFocusVisibleRecentlyTimeout = new Timeout();\nconst inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @returns {boolean}\n */\nfunction focusTriggersKeyboardModality(node) {\n const {\n type,\n tagName\n } = node;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n if (node.isContentEditable) {\n return true;\n }\n return false;\n}\n\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n hadKeyboardEvent = true;\n}\n\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\nfunction isFocusVisible(event) {\n const {\n target\n } = event;\n try {\n return target.matches(':focus-visible');\n } catch (error) {\n // Browsers not implementing :focus-visible will throw a SyntaxError.\n // We use our own heuristic for those browsers.\n // Rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n }\n\n // No need for validFocusTarget check. The user does that by attaching it to\n // focusable events only.\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\nexport default function useIsFocusVisible() {\n const ref = React.useCallback(node => {\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n const isFocusVisibleRef = React.useRef(false);\n\n /**\n * Should be called if a blur event is fired\n */\n function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n hadFocusVisibleRecentlyTimeout.start(100, () => {\n hadFocusVisibleRecently = false;\n });\n isFocusVisibleRef.current = false;\n return true;\n }\n return false;\n }\n\n /**\n * Should be called if a blur event is fired\n */\n function handleFocusVisible(event) {\n if (isFocusVisible(event)) {\n isFocusVisibleRef.current = true;\n return true;\n }\n return false;\n }\n return {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref\n };\n}","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized lazily with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useLazyRef(sortColumns, columns)\n */\nexport default function useLazyRef(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","'use client';\n\nimport * as React from 'react';\nconst EMPTY = [];\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport default function useOnMount(fn) {\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport useLazyRef from '../useLazyRef/useLazyRef';\nimport useOnMount from '../useOnMount/useOnMount';\nexport class Timeout {\n constructor() {\n this.currentId = null;\n this.clear = () => {\n if (this.currentId !== null) {\n clearTimeout(this.currentId);\n this.currentId = null;\n }\n };\n this.disposeEffect = () => {\n return this.clear;\n };\n }\n static create() {\n return new Timeout();\n }\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = null;\n fn();\n }, delay);\n }\n}\nexport default function useTimeout() {\n const timeout = useLazyRef(Timeout.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */\n;(function(root) {\n\n\t// Detect free variables `exports`.\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`.\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code, and use\n\t// it as `root`.\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar InvalidCharacterError = function(message) {\n\t\tthis.message = message;\n\t};\n\tInvalidCharacterError.prototype = new Error;\n\tInvalidCharacterError.prototype.name = 'InvalidCharacterError';\n\n\tvar error = function(message) {\n\t\t// Note: the error messages used throughout this file match those used by\n\t\t// the native `atob`/`btoa` implementation in Chromium.\n\t\tthrow new InvalidCharacterError(message);\n\t};\n\n\tvar TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\t// http://whatwg.org/html/common-microsyntaxes.html#space-character\n\tvar REGEX_SPACE_CHARACTERS = /[\\t\\n\\f\\r ]/g;\n\n\t// `decode` is designed to be fully compatible with `atob` as described in the\n\t// HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob\n\t// The optimized base64-decoding algorithm used is based on @atk’s excellent\n\t// implementation. https://gist.github.com/atk/1020396\n\tvar decode = function(input) {\n\t\tinput = String(input)\n\t\t\t.replace(REGEX_SPACE_CHARACTERS, '');\n\t\tvar length = input.length;\n\t\tif (length % 4 == 0) {\n\t\t\tinput = input.replace(/==?$/, '');\n\t\t\tlength = input.length;\n\t\t}\n\t\tif (\n\t\t\tlength % 4 == 1 ||\n\t\t\t// http://whatwg.org/C#alphanumeric-ascii-characters\n\t\t\t/[^+a-zA-Z0-9/]/.test(input)\n\t\t) {\n\t\t\terror(\n\t\t\t\t'Invalid character: the string to be decoded is not correctly encoded.'\n\t\t\t);\n\t\t}\n\t\tvar bitCounter = 0;\n\t\tvar bitStorage;\n\t\tvar buffer;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\twhile (++position < length) {\n\t\t\tbuffer = TABLE.indexOf(input.charAt(position));\n\t\t\tbitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;\n\t\t\t// Unless this is the first of a group of 4 characters…\n\t\t\tif (bitCounter++ % 4) {\n\t\t\t\t// …convert the first 8 bits to a single ASCII character.\n\t\t\t\toutput += String.fromCharCode(\n\t\t\t\t\t0xFF & bitStorage >> (-2 * bitCounter & 6)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t};\n\n\t// `encode` is designed to be fully compatible with `btoa` as described in the\n\t// HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa\n\tvar encode = function(input) {\n\t\tinput = String(input);\n\t\tif (/[^\\0-\\xFF]/.test(input)) {\n\t\t\t// Note: no need to special-case astral symbols here, as surrogates are\n\t\t\t// matched, and the input is supposed to only contain ASCII anyway.\n\t\t\terror(\n\t\t\t\t'The string to be encoded contains characters outside of the ' +\n\t\t\t\t'Latin1 range.'\n\t\t\t);\n\t\t}\n\t\tvar padding = input.length % 3;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\tvar a;\n\t\tvar b;\n\t\tvar c;\n\t\tvar d;\n\t\tvar buffer;\n\t\t// Make sure any padding is handled outside of the loop.\n\t\tvar length = input.length - padding;\n\n\t\twhile (++position < length) {\n\t\t\t// Read three bytes, i.e. 24 bits.\n\t\t\ta = input.charCodeAt(position) << 16;\n\t\t\tb = input.charCodeAt(++position) << 8;\n\t\t\tc = input.charCodeAt(++position);\n\t\t\tbuffer = a + b + c;\n\t\t\t// Turn the 24 bits into four chunks of 6 bits each, and append the\n\t\t\t// matching character for each of them to the output.\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 18 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 12 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 6 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer & 0x3F)\n\t\t\t);\n\t\t}\n\n\t\tif (padding == 2) {\n\t\t\ta = input.charCodeAt(position) << 8;\n\t\t\tb = input.charCodeAt(++position);\n\t\t\tbuffer = a + b;\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 10) +\n\t\t\t\tTABLE.charAt((buffer >> 4) & 0x3F) +\n\t\t\t\tTABLE.charAt((buffer << 2) & 0x3F) +\n\t\t\t\t'='\n\t\t\t);\n\t\t} else if (padding == 1) {\n\t\t\tbuffer = input.charCodeAt(position);\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 2) +\n\t\t\t\tTABLE.charAt((buffer << 4) & 0x3F) +\n\t\t\t\t'=='\n\t\t\t);\n\t\t}\n\n\t\treturn output;\n\t};\n\n\tvar base64 = {\n\t\t'encode': encode,\n\t\t'decode': decode,\n\t\t'version': '0.1.0'\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn base64;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = base64;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (var key in base64) {\n\t\t\t\tbase64.hasOwnProperty(key) && (freeExports[key] = base64[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.base64 = base64;\n\t}\n\n}(this));\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","/*\n * Fuzzy\n * https://github.com/myork/fuzzy\n *\n * Copyright (c) 2012 Matt York\n * Licensed under the MIT license.\n */\n\n(function() {\n\nvar root = this;\n\nvar fuzzy = {};\n\n// Use in node or in browser\nif (typeof exports !== 'undefined') {\n module.exports = fuzzy;\n} else {\n root.fuzzy = fuzzy;\n}\n\n// Return all elements of `array` that have a fuzzy\n// match against `pattern`.\nfuzzy.simpleFilter = function(pattern, array) {\n return array.filter(function(str) {\n return fuzzy.test(pattern, str);\n });\n};\n\n// Does `pattern` fuzzy match `str`?\nfuzzy.test = function(pattern, str) {\n return fuzzy.match(pattern, str) !== null;\n};\n\n// If `pattern` matches `str`, wrap each matching character\n// in `opts.pre` and `opts.post`. If no match, return null\nfuzzy.match = function(pattern, str, opts) {\n opts = opts || {};\n var patternIdx = 0\n , result = []\n , len = str.length\n , totalScore = 0\n , currScore = 0\n // prefix\n , pre = opts.pre || ''\n // suffix\n , post = opts.post || ''\n // String to compare against. This might be a lowercase version of the\n // raw string\n , compareString = opts.caseSensitive && str || str.toLowerCase()\n , ch;\n\n pattern = opts.caseSensitive && pattern || pattern.toLowerCase();\n\n // For each character in the string, either add it to the result\n // or wrap in template if it's the next string in the pattern\n for(var idx = 0; idx < len; idx++) {\n ch = str[idx];\n if(compareString[idx] === pattern[patternIdx]) {\n ch = pre + ch + post;\n patternIdx += 1;\n\n // consecutive characters should increase the score more than linearly\n currScore += 1 + currScore;\n } else {\n currScore = 0;\n }\n totalScore += currScore;\n result[result.length] = ch;\n }\n\n // return rendered string if we have a match for every char\n if(patternIdx === pattern.length) {\n // if the string is an exact match with pattern, totalScore should be maxed\n totalScore = (compareString === pattern) ? Infinity : totalScore;\n return {rendered: result.join(''), score: totalScore};\n }\n\n return null;\n};\n\n// The normal entry point. Filters `arr` for matches against `pattern`.\n// It returns an array with matching values of the type:\n//\n// [{\n// string: 'lah' // The rendered string\n// , index: 2 // The index of the element in `arr`\n// , original: 'blah' // The original element in `arr`\n// }]\n//\n// `opts` is an optional argument bag. Details:\n//\n// opts = {\n// // string to put before a matching character\n// pre: ''\n//\n// // string to put after matching character\n// , post: ''\n//\n// // Optional function. Input is an entry in the given arr`,\n// // output should be the string to test `pattern` against.\n// // In this example, if `arr = [{crying: 'koala'}]` we would return\n// // 'koala'.\n// , extract: function(arg) { return arg.crying; }\n// }\nfuzzy.filter = function(pattern, arr, opts) {\n if(!arr || arr.length === 0) {\n return [];\n }\n if (typeof pattern !== 'string') {\n return arr;\n }\n opts = opts || {};\n return arr\n .reduce(function(prev, element, idx, arr) {\n var str = element;\n if(opts.extract) {\n str = opts.extract(element);\n }\n var rendered = fuzzy.match(pattern, str, opts);\n if(rendered != null) {\n prev[prev.length] = {\n string: rendered.rendered\n , score: rendered.score\n , index: idx\n , original: element\n };\n }\n return prev;\n }, [])\n\n // Sort by score. Browsers are inconsistent wrt stable/unstable\n // sorting, so force stable by using the index in the case of tie.\n // See http://ofb.net/~sethml/is-sort-stable.html\n .sort(function(a,b) {\n var compare = b.score - a.score;\n if(compare) return compare;\n return a.index - b.index;\n });\n};\n\n\n}());\n\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\nvar toString = Object.prototype.toString;\n\nmodule.exports = function (x) {\n\tvar prototype;\n\treturn toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));\n};\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '

fred, barney, & pebbles

'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '\n * \n */\n get workerUrl(): string {\n return WorkerClass.workerUrl;\n },\n\n set workerUrl(url: string) {\n WorkerClass.workerUrl = url;\n },\n\n /**\n * Provides an interface for external module bundlers such as Webpack or Rollup to package\n * mapbox-gl's WebWorker into a separate class and integrate it with the library.\n *\n * Takes precedence over `mapboxgl.workerUrl`.\n *\n * @var {Object} workerClass\n * @returns {Object | null} A class that implements the `Worker` interface.\n * @example\n * import mapboxgl from 'mapbox-gl/dist/mapbox-gl-csp';\n * import MapboxGLWorker from 'mapbox-gl/dist/mapbox-gl-csp-worker';\n *\n * mapboxgl.workerClass = MapboxGLWorker;\n */\n get workerClass(): Class {\n return WorkerClass.workerClass;\n },\n\n set workerClass(klass: Class) {\n WorkerClass.workerClass = klass;\n },\n\n get workerParams(): WorkerOptions {\n return WorkerClass.workerParams;\n },\n\n set workerParams(params: WorkerOptions) {\n WorkerClass.workerParams = params;\n },\n\n /**\n * Provides an interface for loading Draco decoding library (draco_decoder_gltf.wasm v1.5.6) from a self-hosted URL.\n * This needs to be set only once, and before any call to `new mapboxgl.Map(..)` takes place.\n * This is useful if your site needs to operate in a strict CSP (Content Security Policy) environment\n * wherein you are not allowed to load JavaScript code from a [`Blob` URL](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL), which is default behavior.\n *\n * See our documentation on [CSP Directives](https://docs.mapbox.com/mapbox-gl-js/api/#csp-directives) for more details.\n *\n * @var {string} dracoUrl\n * @returns {string} A URL hosting Google Draco decoding library (`draco_wasm_wrapper_gltf.js` and `draco_decoder_gltf.wasm`).\n * @example\n * \n * \n */\n get dracoUrl(): string {\n return getDracoUrl();\n },\n\n set dracoUrl(url: string) {\n setDracoUrl(url);\n },\n\n get meshoptUrl(): string {\n return getMeshoptUrl();\n },\n\n set meshoptUrl(url: string) {\n setMeshoptUrl(url);\n },\n\n /**\n * Sets the time used by Mapbox GL JS internally for all animations. Useful for generating videos from Mapbox GL JS.\n *\n * @var {number} time\n */\n setNow: browser.setNow,\n\n /**\n * Restores the internal animation timing to follow regular computer time (`performance.now()`).\n */\n restoreNow: browser.restoreNow\n};\n\n//This gets automatically stripped out in production builds.\nDebug.extend(exported, {isSafari, getPerformanceMetrics: PerformanceUtils.getPerformanceMetrics, getPerformanceMetricsAsync: WorkerPerformanceUtils.getPerformanceMetricsAsync});\n\n/**\n * Gets the version of Mapbox GL JS in use as specified in `package.json`,\n * `CHANGELOG.md`, and the GitHub release.\n *\n * @var {string} version\n * @example\n * console.log(`Mapbox GL JS v${mapboxgl.version}`);\n */\n\n/**\n * Test whether the browser [supports Mapbox GL JS](https://www.mapbox.com/help/mapbox-browser-support/#mapbox-gl-js).\n *\n * @function supported\n * @param {Object} [options]\n * @param {boolean} [options.failIfMajorPerformanceCaveat=false] If `true`,\n * the function will return `false` if the performance of Mapbox GL JS would\n * be dramatically worse than expected (for example, a software WebGL renderer\n * would be used).\n * @return {boolean}\n * @example\n * // Show an alert if the browser does not support Mapbox GL\n * if (!mapboxgl.supported()) {\n * alert('Your browser does not support Mapbox GL');\n * }\n * @see [Example: Check for browser support](https://www.mapbox.com/mapbox-gl-js/example/check-for-support/)\n */\n\n/**\n * Sets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text).\n * Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left. Mapbox Studio loads this plugin by default.\n *\n * @function setRTLTextPlugin\n * @param {string} pluginURL URL pointing to the Mapbox RTL text plugin source.\n * @param {Function} callback Called with an error argument if there is an error, or no arguments if the plugin loads successfully.\n * @param {boolean} lazy If set to `true`, MapboxGL will defer loading the plugin until right-to-left text is encountered, and\n * right-to-left text will be rendered only after the plugin finishes loading.\n * @example\n * mapboxgl.setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js');\n * @see [Example: Add support for right-to-left scripts](https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-rtl-text/)\n */\n\n/**\n * Gets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text) status.\n * The status can be `unavailable` (not requested or removed), `loading`, `loaded`, or `error`.\n * If the status is `loaded` and the plugin is requested again, an error will be thrown.\n *\n * @function getRTLTextPluginStatus\n * @example\n * const pluginStatus = mapboxgl.getRTLTextPluginStatus();\n */\n\nexport default exported;\n\n// canary assert: used to confirm that asserts have been removed from production build\nassert(true, 'canary assert');\n","import * as DOM from '../../util/dom';\nimport {bindAll, warnOnce} from '../../util/util';\n\nimport type {Map, IControl} from '../map';\n\nexport type FullscreenControlOptions = {\n container?: HTMLElement | null;\n};\n\n/**\n * A `FullscreenControl` control contains a button for toggling the map in and out of fullscreen mode. See the `requestFullScreen` [compatibility table](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen#browser_compatibility) for supported browsers.\n * Add this control to a map using {@link Map#addControl}.\n *\n * @implements {IControl}\n * @param {Object} [options]\n * @param {HTMLElement} [options.container] `container` is the [compatible DOM element](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen#Compatible_elements) which should be made full screen. By default, the map container element will be made full screen.\n *\n * @example\n * map.addControl(new mapboxgl.FullscreenControl({container: document.querySelector('body')}));\n * @see [Example: View a fullscreen map](https://www.mapbox.com/mapbox-gl-js/example/fullscreen/)\n */\n\nclass FullscreenControl implements IControl {\n _map: Map;\n _controlContainer: HTMLElement;\n _fullscreen: boolean;\n _fullscreenchange: string;\n _fullscreenButton: HTMLElement;\n _container: HTMLElement;\n\n constructor(options: FullscreenControlOptions | null = {}) {\n this._fullscreen = false;\n if (options && options.container) {\n if (options.container instanceof HTMLElement) {\n this._container = options.container;\n } else {\n warnOnce('Full screen control \\'container\\' must be a DOM element.');\n }\n }\n bindAll([\n '_onClickFullscreen',\n '_changeIcon'\n ], this);\n if ('onfullscreenchange' in document) {\n this._fullscreenchange = 'fullscreenchange';\n } else if ('onwebkitfullscreenchange' in document) {\n this._fullscreenchange = 'webkitfullscreenchange';\n }\n }\n\n onAdd(map: Map): HTMLElement {\n this._map = map;\n if (!this._container) this._container = this._map.getContainer();\n this._controlContainer = DOM.create('div', `mapboxgl-ctrl mapboxgl-ctrl-group`);\n if (this._checkFullscreenSupport()) {\n this._setupUI();\n } else {\n this._controlContainer.style.display = 'none';\n warnOnce('This device does not support fullscreen mode.');\n }\n return this._controlContainer;\n }\n\n onRemove() {\n this._controlContainer.remove();\n this._map = (null as any);\n document.removeEventListener(this._fullscreenchange, this._changeIcon);\n }\n\n _checkFullscreenSupport(): boolean {\n return !!(\n document.fullscreenEnabled ||\n (document as any).webkitFullscreenEnabled\n );\n }\n\n _setupUI() {\n const button = this._fullscreenButton = DOM.create('button', (`mapboxgl-ctrl-fullscreen`), this._controlContainer);\n DOM.create('span', `mapboxgl-ctrl-icon`, button).setAttribute('aria-hidden', 'true');\n // @ts-expect-error - TS2339 - Property 'type' does not exist on type 'HTMLElement'.\n button.type = 'button';\n this._updateTitle();\n this._fullscreenButton.addEventListener('click', this._onClickFullscreen);\n document.addEventListener(this._fullscreenchange, this._changeIcon);\n }\n\n _updateTitle() {\n const title = this._getTitle();\n this._fullscreenButton.setAttribute(\"aria-label\", title);\n if (this._fullscreenButton.firstElementChild) this._fullscreenButton.firstElementChild.setAttribute('title', title);\n }\n\n _getTitle(): string {\n return this._map._getUIString(this._isFullscreen() ? 'FullscreenControl.Exit' : 'FullscreenControl.Enter');\n }\n\n _isFullscreen(): boolean {\n return this._fullscreen;\n }\n\n _changeIcon() {\n const fullscreenElement =\n document.fullscreenElement ||\n (document as any).webkitFullscreenElement;\n\n if ((fullscreenElement === this._container) !== this._fullscreen) {\n this._fullscreen = !this._fullscreen;\n this._fullscreenButton.classList.toggle(`mapboxgl-ctrl-shrink`);\n this._fullscreenButton.classList.toggle(`mapboxgl-ctrl-fullscreen`);\n this._updateTitle();\n }\n }\n\n _onClickFullscreen() {\n if (this._isFullscreen()) {\n if (document.exitFullscreen) {\n (document as any).exitFullscreen();\n } else if ((document as any).webkitCancelFullScreen) {\n (document as any).webkitCancelFullScreen();\n }\n } else if (this._container.requestFullscreen) {\n this._container.requestFullscreen();\n } else if ((this._container as any).webkitRequestFullscreen) {\n (this._container as any).webkitRequestFullscreen();\n }\n }\n}\n\nexport default FullscreenControl;\n","//\n// Our custom intro provides a specialized \"define()\" function, called by the\n// AMD modules below, that sets up the worker blob URL and then executes the\n// main module, storing its exported value as 'mapboxgl'\n\n// The three \"chunks\" imported here are produced by a first Rollup pass,\n// which outputs them as AMD modules.\n\n// Shared dependencies, i.e.:\n/*\ndefine(['exports'], function (exports) {\n // Code for all common dependencies\n // Each module's exports are attached attached to 'exports' (with\n // names rewritten to avoid collisions, etc.)\n})\n*/\nimport './build/mapboxgl/shared';\n\n// Worker and its unique dependencies, i.e.:\n/*\ndefine(['./shared.js'], function (__shared__js) {\n // Code for worker script and its unique dependencies.\n // Expects the output of 'shared' module to be passed in as an argument,\n // since all references to common deps look like, e.g.,\n // __shared__js.shapeText().\n});\n*/\n// When this wrapper function is passed to our custom define() above,\n// it gets stringified, together with the shared wrapper (using\n// Function.toString()), and the resulting string of code is made into a\n// Blob URL that gets used by the main module to create the web workers.\nimport './build/mapboxgl/worker';\n\n// Main module and its unique dependencies\n/*\ndefine(['./shared.js'], function (__shared__js) {\n // Code for main GL JS module and its unique dependencies.\n // Expects the output of 'shared' module to be passed in as an argument,\n // since all references to common deps look like, e.g.,\n // __shared__js.shapeText().\n //\n // Returns the actual mapboxgl (i.e. src/index.js)\n});\n*/\nimport './build/mapboxgl/index';\n\nexport default mapboxgl;\n","// Copyright 2014 Google Inc. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the 'License');\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an 'AS IS' BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n Convert locations to and from short codes.\n\n Open Location Codes are short, 10-11 character codes that can be used instead\n of street addresses. The codes can be generated and decoded offline, and use\n a reduced character set that minimises the chance of codes including words.\n\n Codes are able to be shortened relative to a nearby location. This means that\n in many cases, only four to seven characters of the code are needed.\n To recover the original code, the same location is not required, as long as\n a nearby location is provided.\n\n Codes represent rectangular areas rather than points, and the longer the\n code, the smaller the area. A 10 character code represents a 13.5x13.5\n meter area (at the equator. An 11 character code represents approximately\n a 2.8x3.5 meter area.\n\n Two encoding algorithms are used. The first 10 characters are pairs of\n characters, one for latitude and one for latitude, using base 20. Each pair\n reduces the area of the code by a factor of 400. Only even code lengths are\n sensible, since an odd-numbered length would have sides in a ratio of 20:1.\n\n At position 11, the algorithm changes so that each character selects one\n position from a 4x5 grid. This allows single-character refinements.\n\n Examples:\n \n var OpenLocationCode = require('open-location-code').OpenLocationCode;\n\tvar openLocationCode = new OpenLocationCode();\n \n // Encode a location, default accuracy:\n\tvar code = openLocationCode.encode(47.365590, 8.524997);\n\tconsole.log(code);\n \n // Encode a location using one stage of additional refinement:\n code = openLocationCode.encode(47.365590, 8.524997, 11);\n console.log(code);\n \n //Decode a full code:\n\tvar coord = openLocationCode.decode(code);\n var msg = 'Center is ' + coord.latitudeCenter + ',' + coord.longitudeCenter;\n\tconsole.log(msg);\n \n // Attempt to trim the first characters from a code:\n\tvar shortCode = openLocationCode.shorten('8FVC9G8F+6X', 47.5, 8.5);\n\tconsole.log(shortCode);\n\n // Recover the full code from a short code:\n var nearestCode = openLocationCode.recoverNearest('9G8F+6X', 47.4, 8.6);\n\tconsole.log(nearestCode);\n nearestCode = openLocationCode.recoverNearest('8F+6X', 47.4, 8.6);\n console.log(nearestCode);\n \n */\n\n \nvar OpenLocationCode = function () {};\n\n // A separator used to break the code into two parts to aid memorability.\n var SEPARATOR_ = '+';\n\n // The number of characters to place before the separator.\n var SEPARATOR_POSITION_ = 8;\n\n // The character used to pad codes.\n var PADDING_CHARACTER_ = '0';\n\n // The character set used to encode the values.\n var CODE_ALPHABET_ = '23456789CFGHJMPQRVWX';\n\n // The base to use to convert numbers to/from.\n var ENCODING_BASE_ = CODE_ALPHABET_.length;\n\n // The maximum value for latitude in degrees.\n var LATITUDE_MAX_ = 90;\n\n // The maximum value for longitude in degrees.\n var LONGITUDE_MAX_ = 180;\n\n // Maxiumum code length using lat/lng pair encoding. The area of such a\n // code is approximately 13x13 meters (at the equator), and should be suitable\n // for identifying buildings. This excludes prefix and separator characters.\n var PAIR_CODE_LENGTH_ = 10;\n\n // The resolution values in degrees for each position in the lat/lng pair\n // encoding. These give the place value of each position, and therefore the\n // dimensions of the resulting area.\n var PAIR_RESOLUTIONS_ = [20.0, 1.0, .05, .0025, .000125];\n\n // Number of columns in the grid refinement method.\n var GRID_COLUMNS_ = 4;\n\n // Number of rows in the grid refinement method.\n var GRID_ROWS_ = 5;\n\n // Size of the initial grid in degrees.\n var GRID_SIZE_DEGREES_ = 0.000125;\n\n // Minimum length of a code that can be shortened.\n var MIN_TRIMMABLE_CODE_LEN_ = 6;\n\n /**\n Determines if a code is valid.\n\n To be valid, all characters must be from the Open Location Code character\n set with at most one separator. The separator can be in any even-numbered\n position up to the eighth digit.\n */\n OpenLocationCode.prototype.isValid = function(code) {\n if (!code) {\n return false;\n }\n // The separator is required.\n if (code.indexOf(SEPARATOR_) == -1) {\n return false;\n }\n if (code.indexOf(SEPARATOR_) != code.lastIndexOf(SEPARATOR_)) {\n return false;\n }\n // Is it the only character?\n if (code.length == 1) {\n return false;\n }\n // Is it in an illegal position?\n if (code.indexOf(SEPARATOR_) > SEPARATOR_POSITION_ ||\n code.indexOf(SEPARATOR_) % 2 == 1) {\n return false;\n }\n // We can have an even number of padding characters before the separator,\n // but then it must be the final character.\n if (code.indexOf(PADDING_CHARACTER_) > -1) {\n // Not allowed to start with them!\n if (code.indexOf(PADDING_CHARACTER_) == 0) {\n return false;\n }\n // There can only be one group and it must have even length.\n var padMatch = code.match(new RegExp('(' + PADDING_CHARACTER_ + '+)', 'g'));\n if (padMatch.length > 1 || padMatch[0].length % 2 == 1 ||\n padMatch[0].length > SEPARATOR_POSITION_ - 2) {\n return false;\n }\n // If the code is long enough to end with a separator, make sure it does.\n if (code.charAt(code.length - 1) != SEPARATOR_) {\n return false;\n }\n }\n // If there are characters after the separator, make sure there isn't just\n // one of them (not legal).\n if (code.length - code.indexOf(SEPARATOR_) - 1 == 1) {\n return false;\n }\n\n // Strip the separator and any padding characters.\n code = code.replace(new RegExp('\\\\' + SEPARATOR_ + '+'), '')\n .replace(new RegExp(PADDING_CHARACTER_ + '+'), '');\n // Check the code contains only valid characters.\n for (var i = 0, len = code.length; i < len; i++) {\n var character = code.charAt(i).toUpperCase();\n if (character != SEPARATOR_ && CODE_ALPHABET_.indexOf(character) == -1) {\n return false;\n }\n }\n return true;\n };\n\n /**\n Determines if a code is a valid short code.\n\n A short Open Location Code is a sequence created by removing four or more\n digits from an Open Location Code. It must include a separator\n character.\n */\n OpenLocationCode.prototype.isShort = function(code) {\n // Check it's valid.\n if (!this.isValid(code)) {\n return false;\n }\n // If there are less characters than expected before the SEPARATOR.\n if (code.indexOf(SEPARATOR_) >= 0 &&\n code.indexOf(SEPARATOR_) < SEPARATOR_POSITION_) {\n return true;\n }\n return false;\n };\n\n /**\n Determines if a code is a valid full Open Location Code.\n\n Not all possible combinations of Open Location Code characters decode to\n valid latitude and longitude values. This checks that a code is valid\n and also that the latitude and longitude values are legal. If the prefix\n character is present, it must be the first character. If the separator\n character is present, it must be after four characters.\n */\n OpenLocationCode.prototype.isFull = function(code) {\n if (!this.isValid(code)) {\n return false;\n }\n // If it's short, it's not full.\n if (this.isShort(code)) {\n return false;\n }\n\n // Work out what the first latitude character indicates for latitude.\n var firstLatValue = CODE_ALPHABET_.indexOf(\n code.charAt(0).toUpperCase()) * ENCODING_BASE_;\n if (firstLatValue >= LATITUDE_MAX_ * 2) {\n // The code would decode to a latitude of >= 90 degrees.\n return false;\n }\n if (code.length > 1) {\n // Work out what the first longitude character indicates for longitude.\n var firstLngValue = CODE_ALPHABET_.indexOf(\n code.charAt(1).toUpperCase()) * ENCODING_BASE_;\n if (firstLngValue >= LONGITUDE_MAX_ * 2) {\n // The code would decode to a longitude of >= 180 degrees.\n return false;\n }\n }\n return true;\n };\n\n /**\n Encode a location into an Open Location Code.\n\n Produces a code of the specified length, or the default length if no length\n is provided.\n\n The length determines the accuracy of the code. The default length is\n 10 characters, returning a code of approximately 13.5x13.5 meters. Longer\n codes represent smaller areas, but lengths > 14 are sub-centimetre and so\n 11 or 12 are probably the limit of useful codes.\n\n Args:\n latitude: A latitude in signed decimal degrees. Will be clipped to the\n range -90 to 90.\n longitude: A longitude in signed decimal degrees. Will be normalised to\n the range -180 to 180.\n codeLength: The number of significant digits in the output code, not\n including any separator characters.\n */\n OpenLocationCode.prototype.encode = function(latitude,\n longitude, codeLength) {\n if (typeof codeLength == 'undefined') {\n codeLength = PAIR_CODE_LENGTH_;\n }\n if (codeLength < 2 ||\n (codeLength < SEPARATOR_POSITION_ && codeLength % 2 == 1)) {\n throw 'IllegalArgumentException: Invalid Open Location Code length';\n }\n // Ensure that latitude and longitude are valid.\n latitude = clipLatitude(latitude);\n longitude = normalizeLongitude(longitude);\n // Latitude 90 needs to be adjusted to be just less, so the returned code\n // can also be decoded.\n if (latitude == 90) {\n latitude = latitude - computeLatitudePrecision(codeLength);\n }\n var code = encodePairs(\n latitude, longitude, Math.min(codeLength, PAIR_CODE_LENGTH_));\n // If the requested length indicates we want grid refined codes.\n if (codeLength > PAIR_CODE_LENGTH_) {\n code += encodeGrid(\n latitude, longitude, codeLength - PAIR_CODE_LENGTH_);\n }\n return code;\n };\n\n /**\n Decodes an Open Location Code into the location coordinates.\n\n Returns a CodeArea object that includes the coordinates of the bounding\n box - the lower left, center and upper right.\n\n Args:\n code: The Open Location Code to decode.\n\n Returns:\n A CodeArea object that provides the latitude and longitude of two of the\n corners of the area, the center, and the length of the original code.\n */\n OpenLocationCode.prototype.decode = function(code) {\n if (!this.isFull(code)) {\n throw ('IllegalArgumentException: ' +\n 'Passed Open Location Code is not a valid full code: ' + code);\n }\n // Strip out separator character (we've already established the code is\n // valid so the maximum is one), padding characters and convert to upper\n // case.\n code = code.replace(SEPARATOR_, '');\n code = code.replace(new RegExp(PADDING_CHARACTER_ + '+'), '');\n code = code.toUpperCase();\n // Decode the lat/lng pair component.\n var codeArea = decodePairs(code.substring(0, PAIR_CODE_LENGTH_));\n // If there is a grid refinement component, decode that.\n if (code.length <= PAIR_CODE_LENGTH_) {\n return codeArea;\n }\n var gridArea = decodeGrid(code.substring(PAIR_CODE_LENGTH_));\n return CodeArea(\n codeArea.latitudeLo + gridArea.latitudeLo,\n codeArea.longitudeLo + gridArea.longitudeLo,\n codeArea.latitudeLo + gridArea.latitudeHi,\n codeArea.longitudeLo + gridArea.longitudeHi,\n codeArea.codeLength + gridArea.codeLength);\n };\n\n /**\n Recover the nearest matching code to a specified location.\n\n Given a short Open Location Code of between four and seven characters,\n this recovers the nearest matching full code to the specified location.\n\n The number of characters that will be prepended to the short code, depends\n on the length of the short code and whether it starts with the separator.\n\n If it starts with the separator, four characters will be prepended. If it\n does not, the characters that will be prepended to the short code, where S\n is the supplied short code and R are the computed characters, are as\n follows:\n SSSS -> RRRR.RRSSSS\n SSSSS -> RRRR.RRSSSSS\n SSSSSS -> RRRR.SSSSSS\n SSSSSSS -> RRRR.SSSSSSS\n Note that short codes with an odd number of characters will have their\n last character decoded using the grid refinement algorithm.\n\n Args:\n shortCode: A valid short OLC character sequence.\n referenceLatitude: The latitude (in signed decimal degrees) to use to\n find the nearest matching full code.\n referenceLongitude: The longitude (in signed decimal degrees) to use\n to find the nearest matching full code.\n\n Returns:\n The nearest full Open Location Code to the reference location that matches\n the short code. Note that the returned code may not have the same\n computed characters as the reference location. This is because it returns\n the nearest match, not necessarily the match within the same cell. If the\n passed code was not a valid short code, but was a valid full code, it is\n returned unchanged.\n */\n OpenLocationCode.prototype.recoverNearest = function(\n shortCode, referenceLatitude, referenceLongitude) {\n if (!this.isShort(shortCode)) {\n if (this.isFull(shortCode)) {\n return shortCode;\n } else {\n throw 'ValueError: Passed short code is not valid: ' + shortCode;\n }\n }\n // Ensure that latitude and longitude are valid.\n referenceLatitude = clipLatitude(referenceLatitude);\n referenceLongitude = normalizeLongitude(referenceLongitude);\n\n // Clean up the passed code.\n shortCode = shortCode.toUpperCase();\n // Compute the number of digits we need to recover.\n var paddingLength = SEPARATOR_POSITION_ - shortCode.indexOf(SEPARATOR_);\n // The resolution (height and width) of the padded area in degrees.\n var resolution = Math.pow(20, 2 - (paddingLength / 2));\n // Distance from the center to an edge (in degrees).\n var areaToEdge = resolution / 2.0;\n\n // Now round down the reference latitude and longitude to the resolution.\n var roundedLatitude = Math.floor(referenceLatitude / resolution) *\n resolution;\n var roundedLongitude = Math.floor(referenceLongitude / resolution) *\n resolution;\n\n // Use the reference location to pad the supplied short code and decode it.\n var codeArea = this.decode(\n this.encode(roundedLatitude, roundedLongitude).substr(0, paddingLength)\n + shortCode);\n // How many degrees latitude is the code from the reference? If it is more\n // than half the resolution, we need to move it east or west.\n var degreesDifference = codeArea.latitudeCenter - referenceLatitude;\n if (degreesDifference > areaToEdge) {\n // If the center of the short code is more than half a cell east,\n // then the best match will be one position west.\n codeArea.latitudeCenter -= resolution;\n } else if (degreesDifference < -areaToEdge) {\n // If the center of the short code is more than half a cell west,\n // then the best match will be one position east.\n codeArea.latitudeCenter += resolution;\n }\n\n // How many degrees longitude is the code from the reference?\n degreesDifference = codeArea.longitudeCenter - referenceLongitude;\n if (degreesDifference > areaToEdge) {\n codeArea.longitudeCenter -= resolution;\n } else if (degreesDifference < -areaToEdge) {\n codeArea.longitudeCenter += resolution;\n }\n\n return this.encode(\n codeArea.latitudeCenter, codeArea.longitudeCenter, codeArea.codeLength);\n };\n\n /**\n Remove characters from the start of an OLC code.\n\n This uses a reference location to determine how many initial characters\n can be removed from the OLC code. The number of characters that can be\n removed depends on the distance between the code center and the reference\n location.\n\n The minimum number of characters that will be removed is four. If more than\n four characters can be removed, the additional characters will be replaced\n with the padding character. At most eight characters will be removed.\n\n The reference location must be within 50% of the maximum range. This ensures\n that the shortened code will be able to be recovered using slightly different\n locations.\n\n Args:\n code: A full, valid code to shorten.\n latitude: A latitude, in signed decimal degrees, to use as the reference\n point.\n longitude: A longitude, in signed decimal degrees, to use as the reference\n point.\n\n Returns:\n Either the original code, if the reference location was not close enough,\n or the .\n */\n OpenLocationCode.prototype.shorten = function(\n code, latitude, longitude) {\n if (!this.isFull(code)) {\n throw 'ValueError: Passed code is not valid and full: ' + code;\n }\n if (code.indexOf(PADDING_CHARACTER_) != -1) {\n throw 'ValueError: Cannot shorten padded codes: ' + code;\n }\n var code = code.toUpperCase();\n var codeArea = this.decode(code);\n if (codeArea.codeLength < MIN_TRIMMABLE_CODE_LEN_) {\n throw 'ValueError: Code length must be at least ' +\n MIN_TRIMMABLE_CODE_LEN_;\n }\n // Ensure that latitude and longitude are valid.\n latitude = clipLatitude(latitude);\n longitude = normalizeLongitude(longitude);\n // How close are the latitude and longitude to the code center.\n var range = Math.max(\n Math.abs(codeArea.latitudeCenter - latitude),\n Math.abs(codeArea.longitudeCenter - longitude));\n for (var i = PAIR_RESOLUTIONS_.length - 2; i >= 1; i--) {\n // Check if we're close enough to shorten. The range must be less than 1/2\n // the resolution to shorten at all, and we want to allow some safety, so\n // use 0.3 instead of 0.5 as a multiplier.\n if (range < (PAIR_RESOLUTIONS_[i] * 0.3)) {\n // Trim it.\n return code.substring((i + 1) * 2);\n }\n }\n return code;\n };\n\n /**\n Clip a latitude into the range -90 to 90.\n\n Args:\n latitude: A latitude in signed decimal degrees.\n */\n var clipLatitude = function(latitude) {\n return Math.min(90, Math.max(-90, latitude));\n };\n\n /**\n Compute the latitude precision value for a given code length. Lengths <=\n 10 have the same precision for latitude and longitude, but lengths > 10\n have different precisions due to the grid method having fewer columns than\n rows.\n */\n var computeLatitudePrecision = function(codeLength) {\n if (codeLength <= 10) {\n return Math.pow(20, Math.floor(codeLength / -2 + 2));\n }\n return Math.pow(20, -3) / Math.pow(GRID_ROWS_, codeLength - 10);\n };\n\n /**\n Normalize a longitude into the range -180 to 180, not including 180.\n\n Args:\n longitude: A longitude in signed decimal degrees.\n */\n var normalizeLongitude = function(longitude) {\n while (longitude < -180) {\n longitude = longitude + 360;\n }\n while (longitude >= 180) {\n longitude = longitude - 360;\n }\n return longitude;\n };\n\n /**\n Encode a location into a sequence of OLC lat/lng pairs.\n\n This uses pairs of characters (longitude and latitude in that order) to\n represent each step in a 20x20 grid. Each code, therefore, has 1/400th\n the area of the previous code.\n\n Args:\n latitude: A latitude in signed decimal degrees.\n longitude: A longitude in signed decimal degrees.\n codeLength: The number of significant digits in the output code, not\n including any separator characters.\n */\n var encodePairs = function(latitude, longitude, codeLength) {\n var code = '';\n // Adjust latitude and longitude so they fall into positive ranges.\n var adjustedLatitude = latitude + LATITUDE_MAX_;\n var adjustedLongitude = longitude + LONGITUDE_MAX_;\n // Count digits - can't use string length because it may include a separator\n // character.\n var digitCount = 0;\n while (digitCount < codeLength) {\n // Provides the value of digits in this place in decimal degrees.\n var placeValue = PAIR_RESOLUTIONS_[Math.floor(digitCount / 2)];\n // Do the latitude - gets the digit for this place and subtracts that for\n // the next digit.\n var digitValue = Math.floor(adjustedLatitude / placeValue);\n adjustedLatitude -= digitValue * placeValue;\n code += CODE_ALPHABET_.charAt(digitValue);\n digitCount += 1;\n // And do the longitude - gets the digit for this place and subtracts that\n // for the next digit.\n digitValue = Math.floor(adjustedLongitude / placeValue);\n adjustedLongitude -= digitValue * placeValue;\n code += CODE_ALPHABET_.charAt(digitValue);\n digitCount += 1;\n // Should we add a separator here?\n if (digitCount == SEPARATOR_POSITION_ && digitCount < codeLength) {\n code += SEPARATOR_;\n }\n }\n if (code.length < SEPARATOR_POSITION_) {\n code = code + Array(SEPARATOR_POSITION_ - code.length + 1).join(PADDING_CHARACTER_);\n }\n if (code.length == SEPARATOR_POSITION_) {\n code = code + SEPARATOR_;\n }\n return code;\n };\n\n /**\n Encode a location using the grid refinement method into an OLC string.\n\n The grid refinement method divides the area into a grid of 4x5, and uses a\n single character to refine the area. This allows default accuracy OLC codes\n to be refined with just a single character.\n\n Args:\n latitude: A latitude in signed decimal degrees.\n longitude: A longitude in signed decimal degrees.\n codeLength: The number of characters required.\n */\n var encodeGrid = function(latitude, longitude, codeLength) {\n var code = '';\n var latPlaceValue = GRID_SIZE_DEGREES_;\n var lngPlaceValue = GRID_SIZE_DEGREES_;\n // Adjust latitude and longitude so they fall into positive ranges and\n // get the offset for the required places.\n var adjustedLatitude = (latitude + LATITUDE_MAX_) % latPlaceValue;\n var adjustedLongitude = (longitude + LONGITUDE_MAX_) % lngPlaceValue;\n for (var i = 0; i < codeLength; i++) {\n // Work out the row and column.\n var row = Math.floor(adjustedLatitude / (latPlaceValue / GRID_ROWS_));\n var col = Math.floor(adjustedLongitude / (lngPlaceValue / GRID_COLUMNS_));\n latPlaceValue /= GRID_ROWS_;\n lngPlaceValue /= GRID_COLUMNS_;\n adjustedLatitude -= row * latPlaceValue;\n adjustedLongitude -= col * lngPlaceValue;\n code += CODE_ALPHABET_.charAt(row * GRID_COLUMNS_ + col);\n }\n return code;\n };\n\n /**\n Decode an OLC code made up of lat/lng pairs.\n\n This decodes an OLC code made up of alternating latitude and longitude\n characters, encoded using base 20.\n\n Args:\n code: A valid OLC code, presumed to be full, but with the separator\n removed.\n */\n var decodePairs = function(code) {\n // Get the latitude and longitude values. These will need correcting from\n // positive ranges.\n var latitude = decodePairsSequence(code, 0);\n var longitude = decodePairsSequence(code, 1);\n // Correct the values and set them into the CodeArea object.\n return new CodeArea(\n latitude[0] - LATITUDE_MAX_,\n longitude[0] - LONGITUDE_MAX_,\n latitude[1] - LATITUDE_MAX_,\n longitude[1] - LONGITUDE_MAX_,\n code.length);\n };\n\n /**\n Decode either a latitude or longitude sequence.\n\n This decodes the latitude or longitude sequence of a lat/lng pair encoding.\n Starting at the character at position offset, every second character is\n decoded and the value returned.\n\n Args:\n code: A valid OLC code, presumed to be full, with the separator removed.\n offset: The character to start from.\n\n Returns:\n A pair of the low and high values. The low value comes from decoding the\n characters. The high value is the low value plus the resolution of the\n last position. Both values are offset into positive ranges and will need\n to be corrected before use.\n */\n var decodePairsSequence = function(code, offset) {\n var i = 0;\n var value = 0;\n while (i * 2 + offset < code.length) {\n value += CODE_ALPHABET_.indexOf(code.charAt(i * 2 + offset)) *\n PAIR_RESOLUTIONS_[i];\n i += 1;\n }\n return [value, value + PAIR_RESOLUTIONS_[i - 1]];\n };\n\n /**\n Decode the grid refinement portion of an OLC code.\n\n This decodes an OLC code using the grid refinement method.\n\n Args:\n code: A valid OLC code sequence that is only the grid refinement\n portion. This is the portion of a code starting at position 11.\n */\n var decodeGrid = function(code) {\n var latitudeLo = 0.0;\n var longitudeLo = 0.0;\n var latPlaceValue = GRID_SIZE_DEGREES_;\n var lngPlaceValue = GRID_SIZE_DEGREES_;\n var i = 0;\n while (i < code.length) {\n var codeIndex = CODE_ALPHABET_.indexOf(code.charAt(i));\n var row = Math.floor(codeIndex / GRID_COLUMNS_);\n var col = codeIndex % GRID_COLUMNS_;\n\n latPlaceValue /= GRID_ROWS_;\n lngPlaceValue /= GRID_COLUMNS_;\n\n latitudeLo += row * latPlaceValue;\n longitudeLo += col * lngPlaceValue;\n i += 1;\n }\n return CodeArea(\n latitudeLo, longitudeLo, latitudeLo + latPlaceValue,\n longitudeLo + lngPlaceValue, code.length);\n };\n \n /**\n Coordinates of a decoded Open Location Code.\n\n The coordinates include the latitude and longitude of the lower left and\n upper right corners and the center of the bounding box for the area the\n code represents.\n\n Attributes:\n latitude_lo: The latitude of the SW corner in degrees.\n longitude_lo: The longitude of the SW corner in degrees.\n latitude_hi: The latitude of the NE corner in degrees.\n longitude_hi: The longitude of the NE corner in degrees.\n latitude_center: The latitude of the center in degrees.\n longitude_center: The longitude of the center in degrees.\n code_length: The number of significant characters that were in the code.\n This excludes the separator.\n */\n var CodeArea = OpenLocationCode.prototype.CodeArea = function(\n latitudeLo, longitudeLo, latitudeHi, longitudeHi, codeLength) {\n return new CodeAreaFn.init(\n latitudeLo, longitudeLo, latitudeHi, longitudeHi, codeLength);\n };\n \n var CodeAreaFn = {\n init: function(\n latitudeLo, longitudeLo, latitudeHi, longitudeHi, codeLength) {\n this.latitudeLo = latitudeLo;\n this.longitudeLo = longitudeLo;\n this.latitudeHi = latitudeHi;\n this.longitudeHi = longitudeHi;\n this.codeLength = codeLength;\n this.latitudeCenter = Math.min(\n latitudeLo + (latitudeHi - latitudeLo) / 2, LATITUDE_MAX_);\n this.longitudeCenter = Math.min(\n longitudeLo + (longitudeHi - longitudeLo) / 2, LONGITUDE_MAX_);\n }\n };\n\n\nexports.OpenLocationCode = OpenLocationCode;","/* @license\nPapa Parse\nv5.4.1\nhttps://github.com/mholt/PapaParse\nLicense: MIT\n*/\n!function(e,t){\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof module&&\"undefined\"!=typeof exports?module.exports=t():e.Papa=t()}(this,function s(){\"use strict\";var f=\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:void 0!==f?f:{};var n=!f.document&&!!f.postMessage,o=f.IS_PAPA_WORKER||!1,a={},u=0,b={parse:function(e,t){var r=(t=t||{}).dynamicTyping||!1;J(r)&&(t.dynamicTypingFunction=r,r={});if(t.dynamicTyping=r,t.transform=!!J(t.transform)&&t.transform,t.worker&&b.WORKERS_SUPPORTED){var i=function(){if(!b.WORKERS_SUPPORTED)return!1;var e=(r=f.URL||f.webkitURL||null,i=s.toString(),b.BLOB_URL||(b.BLOB_URL=r.createObjectURL(new Blob([\"var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; \",\"(\",i,\")();\"],{type:\"text/javascript\"})))),t=new f.Worker(e);var r,i;return t.onmessage=_,t.id=u++,a[t.id]=t}();return i.userStep=t.step,i.userChunk=t.chunk,i.userComplete=t.complete,i.userError=t.error,t.step=J(t.step),t.chunk=J(t.chunk),t.complete=J(t.complete),t.error=J(t.error),delete t.worker,void i.postMessage({input:e,config:t,workerId:i.id})}var n=null;b.NODE_STREAM_INPUT,\"string\"==typeof e?(e=function(e){if(65279===e.charCodeAt(0))return e.slice(1);return e}(e),n=t.download?new l(t):new p(t)):!0===e.readable&&J(e.read)&&J(e.on)?n=new g(t):(f.File&&e instanceof File||e instanceof Object)&&(n=new c(t));return n.stream(e)},unparse:function(e,t){var n=!1,_=!0,m=\",\",y=\"\\r\\n\",s='\"',a=s+s,r=!1,i=null,o=!1;!function(){if(\"object\"!=typeof t)return;\"string\"!=typeof t.delimiter||b.BAD_DELIMITERS.filter(function(e){return-1!==t.delimiter.indexOf(e)}).length||(m=t.delimiter);(\"boolean\"==typeof t.quotes||\"function\"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes);\"boolean\"!=typeof t.skipEmptyLines&&\"string\"!=typeof t.skipEmptyLines||(r=t.skipEmptyLines);\"string\"==typeof t.newline&&(y=t.newline);\"string\"==typeof t.quoteChar&&(s=t.quoteChar);\"boolean\"==typeof t.header&&(_=t.header);if(Array.isArray(t.columns)){if(0===t.columns.length)throw new Error(\"Option columns is empty\");i=t.columns}void 0!==t.escapeChar&&(a=t.escapeChar+s);(\"boolean\"==typeof t.escapeFormulae||t.escapeFormulae instanceof RegExp)&&(o=t.escapeFormulae instanceof RegExp?t.escapeFormulae:/^[=+\\-@\\t\\r].*$/)}();var u=new RegExp(Q(s),\"g\");\"string\"==typeof e&&(e=JSON.parse(e));if(Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return h(null,e,r);if(\"object\"==typeof e[0])return h(i||Object.keys(e[0]),e,r)}else if(\"object\"==typeof e)return\"string\"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||i),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:\"object\"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||\"object\"==typeof e.data[0]||(e.data=[e.data])),h(e.fields||[],e.data||[],r);throw new Error(\"Unable to serialize unrecognized input\");function h(e,t,r){var i=\"\";\"string\"==typeof e&&(e=JSON.parse(e)),\"string\"==typeof t&&(t=JSON.parse(t));var n=Array.isArray(e)&&0=this._config.preview;if(o)f.postMessage({results:n,workerId:b.WORKER_ID,finished:a});else if(J(this._config.chunk)&&!t){if(this._config.chunk(n,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);n=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n.data),this._completeResults.errors=this._completeResults.errors.concat(n.errors),this._completeResults.meta=n.meta),this._completed||!a||!J(this._config.complete)||n&&n.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a||n&&n.meta.paused||this._nextChunk(),n}this._halted=!0},this._sendError=function(e){J(this._config.error)?this._config.error(e):o&&this._config.error&&f.postMessage({workerId:b.WORKER_ID,error:e,finished:!1})}}function l(e){var i;(e=e||{}).chunkSize||(e.chunkSize=b.RemoteChunkSize),h.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(i=new XMLHttpRequest,this._config.withCredentials&&(i.withCredentials=this._config.withCredentials),n||(i.onload=v(this._chunkLoaded,this),i.onerror=v(this._chunkError,this)),i.open(this._config.downloadRequestBody?\"POST\":\"GET\",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var t in e)i.setRequestHeader(t,e[t])}if(this._config.chunkSize){var r=this._start+this._config.chunkSize-1;i.setRequestHeader(\"Range\",\"bytes=\"+this._start+\"-\"+r)}try{i.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===i.status&&this._chunkError()}},this._chunkLoaded=function(){4===i.readyState&&(i.status<200||400<=i.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:i.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader(\"Content-Range\");if(null===t)return-1;return parseInt(t.substring(t.lastIndexOf(\"/\")+1))}(i),this.parseChunk(i.responseText)))},this._chunkError=function(e){var t=i.statusText||e;this._sendError(new Error(t))}}function c(e){var i,n;(e=e||{}).chunkSize||(e.chunkSize=b.LocalChunkSize),h.call(this,e);var s=\"undefined\"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,s?((i=new FileReader).onload=v(this._chunkLoaded,this),i.onerror=v(this._chunkError,this)):i=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(i.error)}}function p(e){var r;h.call(this,e=e||{}),this.stream=function(e){return r=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,t=this._config.chunkSize;return t?(e=r.substring(0,t),r=r.substring(t)):(e=r,r=\"\"),this._finished=!r,this.parseChunk(e)}}}function g(e){h.call(this,e=e||{});var t=[],r=!0,i=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on(\"data\",this._streamData),this._input.on(\"end\",this._streamEnd),this._input.on(\"error\",this._streamError)},this._checkIsFinished=function(){i&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r=!0},this._streamData=v(function(e){try{t.push(\"string\"==typeof e?e:e.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=v(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=v(function(){this._streamCleanUp(),i=!0,this._streamData(\"\")},this),this._streamCleanUp=v(function(){this._input.removeListener(\"data\",this._streamData),this._input.removeListener(\"end\",this._streamEnd),this._input.removeListener(\"error\",this._streamError)},this)}function r(m){var a,o,u,i=Math.pow(2,53),n=-i,s=/^\\s*-?(\\d+\\.?|\\.\\d+|\\d+\\.\\d+)([eE][-+]?\\d+)?\\s*$/,h=/^((\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z)))$/,t=this,r=0,f=0,d=!1,e=!1,l=[],c={data:[],errors:[],meta:{}};if(J(m.step)){var p=m.step;m.step=function(e){if(c=e,_())g();else{if(g(),0===c.data.length)return;r+=e.data.length,m.preview&&r>m.preview?o.abort():(c.data=c.data[0],p(c,t))}}}function y(e){return\"greedy\"===m.skipEmptyLines?\"\"===e.join(\"\").trim():1===e.length&&0===e[0].length}function g(){return c&&u&&(k(\"Delimiter\",\"UndetectableDelimiter\",\"Unable to auto-detect delimiting character; defaulted to '\"+b.DefaultDelimiter+\"'\"),u=!1),m.skipEmptyLines&&(c.data=c.data.filter(function(e){return!y(e)})),_()&&function(){if(!c)return;function e(e,t){J(m.transformHeader)&&(e=m.transformHeader(e,t)),l.push(e)}if(Array.isArray(c.data[0])){for(var t=0;_()&&t=l.length?\"__parsed_extra\":l[r]),m.transform&&(s=m.transform(s,n)),s=v(n,s),\"__parsed_extra\"===n?(i[n]=i[n]||[],i[n].push(s)):i[n]=s}return m.header&&(r>l.length?k(\"FieldMismatch\",\"TooManyFields\",\"Too many fields: expected \"+l.length+\" fields but parsed \"+r,f+t):r=i.length/2?\"\\r\\n\":\"\\r\"}(e,i)),u=!1,m.delimiter)J(m.delimiter)&&(m.delimiter=m.delimiter(e),c.meta.delimiter=m.delimiter);else{var n=function(e,t,r,i,n){var s,a,o,u;n=n||[\",\",\"\\t\",\"|\",\";\",b.RECORD_SEP,b.UNIT_SEP];for(var h=0;h=N)return L(!0)}else for(S=W,W++;;){if(-1===(S=i.indexOf(z,S+1)))return r||h.push({type:\"Quotes\",code:\"MissingQuotes\",message:\"Quoted field unterminated\",row:u.length,index:W}),T();if(S===n-1)return T(i.substring(W,S).replace(C,z));if(z!==K||i[S+1]!==K){if(z===K||0===S||i[S-1]!==K){-1!==w&&w=N)return L(!0);break}h.push({type:\"Quotes\",code:\"InvalidQuotes\",message:\"Trailing quote on quoted field is malformed\",row:u.length,index:W}),S++}}else S++}return T();function I(e){u.push(e),d=W}function A(e){var t=0;if(-1!==e){var r=i.substring(S+1,e);r&&\"\"===r.trim()&&(t=r.length)}return t}function T(e){return r||(void 0===e&&(e=i.substring(W)),f.push(e),W=n,I(f),o&&F()),L()}function D(e){W=e,I(f),f=[],R=i.indexOf(P,W)}function L(e){return{data:u,errors:h,meta:{delimiter:M,linebreak:P,aborted:H,truncated:!!e,cursor:d+(t||0)}}}function F(){q(L()),u=[],h=[]}},this.abort=function(){H=!0},this.getCharIndex=function(){return W}}function _(e){var t=e.data,r=a[t.workerId],i=!1;if(t.error)r.userError(t.error,t.file);else if(t.results&&t.results.data){var n={abort:function(){i=!0,m(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(J(r.userStep)){for(var s=0;sb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&Ng(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=Lg(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Tg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Rg(f.type,f.key,f.props,null,a.mode,h),h.ref=Lg(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=Sg(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);Mg(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=Qg(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(a){var b=Wg.current;E(Wg);a._currentValue=b}function bh(a,b,c){for(;null!==a;){var d=a.alternate;(a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|=b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b);if(a===c)break;a=a.return}}\nfunction ch(a,b){Xg=a;Zg=Yg=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(dh=!0),a.firstContext=null)}function eh(a){var b=a._currentValue;if(Zg!==a)if(a={context:a,memoizedValue:b,next:null},null===Yg){if(null===Xg)throw Error(p(308));Yg=a;Xg.dependencies={lanes:0,firstContext:a}}else Yg=Yg.next=a;return b}var fh=null;function gh(a){null===fh?fh=[a]:fh.push(a)}\nfunction hh(a,b,c,d){var e=b.interleaved;null===e?(c.next=c,gh(b)):(c.next=e.next,e.next=c);b.interleaved=c;return ih(a,d)}function ih(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}var jh=!1;function kh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}\nfunction lh(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function mh(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}\nfunction nh(a,b,c){var d=a.updateQueue;if(null===d)return null;d=d.shared;if(0!==(K&2)){var e=d.pending;null===e?b.next=b:(b.next=e.next,e.next=b);d.pending=b;return ih(a,c)}e=d.interleaved;null===e?(b.next=b,gh(d)):(b.next=e.next,e.next=b);d.interleaved=b;return ih(a,c)}function oh(a,b,c){b=b.updateQueue;if(null!==b&&(b=b.shared,0!==(c&4194240))){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nfunction ph(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=\nb;c.lastBaseUpdate=b}\nfunction qh(a,b,c,d){var e=a.updateQueue;jh=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var m=a.alternate;null!==m&&(m=m.updateQueue,h=m.lastBaseUpdate,h!==g&&(null===h?m.firstBaseUpdate=l:h.next=l,m.lastBaseUpdate=k))}if(null!==f){var q=e.baseState;g=0;m=l=k=null;h=f;do{var r=h.lane,y=h.eventTime;if((d&r)===r){null!==m&&(m=m.next={eventTime:y,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,\nnext:null});a:{var n=a,t=h;r=b;y=c;switch(t.tag){case 1:n=t.payload;if(\"function\"===typeof n){q=n.call(y,q,r);break a}q=n;break a;case 3:n.flags=n.flags&-65537|128;case 0:n=t.payload;r=\"function\"===typeof n?n.call(y,q,r):n;if(null===r||void 0===r)break a;q=A({},q,r);break a;case 2:jh=!0}}null!==h.callback&&0!==h.lane&&(a.flags|=64,r=e.effects,null===r?e.effects=[h]:r.push(h))}else y={eventTime:y,lane:r,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===m?(l=m=y,k=q):m=m.next=y,g|=r;\nh=h.next;if(null===h)if(h=e.shared.pending,null===h)break;else r=h,h=r.next,r.next=null,e.lastBaseUpdate=r,e.shared.pending=null}while(1);null===m&&(k=q);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=m;b=e.shared.interleaved;if(null!==b){e=b;do g|=e.lane,e=e.next;while(e!==b)}else null===f&&(e.shared.lanes=0);rh|=g;a.lanes=g;a.memoizedState=q}}\nfunction sh(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;bc?c:4;a(!0);var d=Gh.transition;Gh.transition={};try{a(!1),b()}finally{C=c,Gh.transition=d}}function wi(){return Uh().memoizedState}\nfunction xi(a,b,c){var d=yi(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,c);else if(c=hh(a,b,c,d),null!==c){var e=R();gi(c,a,d,e);Bi(c,b,d)}}\nfunction ii(a,b,c){var d=yi(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,gh(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=hh(a,b,e,d);null!==c&&(e=R(),gi(c,a,d,e),Bi(c,b,d))}}\nfunction zi(a){var b=a.alternate;return a===M||null!==b&&b===M}function Ai(a,b){Jh=Ih=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Bi(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(a,b){Th().memoizedState=[a,void 0===b?null:b];return a},useContext:eh,useEffect:mi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ki(4194308,\n4,pi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ki(4194308,4,a,b)},useInsertionEffect:function(a,b){return ki(4,2,a,b)},useMemo:function(a,b){var c=Th();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Th();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=xi.bind(null,M,a);return[d.memoizedState,a]},useRef:function(a){var b=\nTh();a={current:a};return b.memoizedState=a},useState:hi,useDebugValue:ri,useDeferredValue:function(a){return Th().memoizedState=a},useTransition:function(){var a=hi(!1),b=a[0];a=vi.bind(null,a[1]);Th().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=M,e=Th();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===Q)throw Error(p(349));0!==(Hh&30)||di(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;mi(ai.bind(null,d,\nf,a),[a]);d.flags|=2048;bi(9,ci.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=Th(),b=Q.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Kh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;zj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eGj&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304)}else{if(!d)if(a=Ch(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Dj(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Gj&&1073741824!==c&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=L.current,G(L,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Hj(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(fj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Ij(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return zh(),E(Wf),E(H),Eh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Bh(b),null;case 13:E(L);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(L),null;case 4:return zh(),null;case 10:return ah(b.type._context),null;case 22:case 23:return Hj(),\nnull;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Lj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Mj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Nj=!1;\nfunction Oj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Ci(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Nj;Nj=!1;return n}\nfunction Pj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Mj(b,c,f)}e=e.next}while(e!==d)}}function Qj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Rj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Sj(a){var b=a.alternate;null!==b&&(a.alternate=null,Sj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Tj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Uj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Tj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Vj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Vj(a,b,c),a=a.sibling;null!==a;)Vj(a,b,c),a=a.sibling}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}var X=null,Xj=!1;function Yj(a,b,c){for(c=c.child;null!==c;)Zj(a,b,c),c=c.sibling}\nfunction Zj(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Lj(c,b);case 6:var d=X,e=Xj;X=null;Yj(a,b,c);X=d;Xj=e;null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Xj;X=c.stateNode.containerInfo;Xj=!0;\nYj(a,b,c);X=d;Xj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Mj(c,b,g):0!==(f&4)&&Mj(c,b,g));e=e.next}while(e!==d)}Yj(a,b,c);break;case 1:if(!U&&(Lj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Yj(a,b,c);break;case 21:Yj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Yj(a,b,c),U=d):Yj(a,b,c);break;default:Yj(a,b,c)}}function ak(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Kj);b.forEach(function(b){var d=bk.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction ck(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*lk(d/1960))-d;if(10a?16:a;if(null===wk)var d=!1;else{a=wk;wk=null;xk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-fk?Kk(a,0):rk|=c);Dk(a,b)}function Yk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=R();a=ih(a,b);null!==a&&(Ac(a,b,c),Dk(a,c))}function uj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Yk(a,c)}\nfunction bk(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Yk(a,c)}var Vk;\nVk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)dh=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return dh=!1,yj(a,b,c);dh=0!==(a.flags&131072)?!0:!1}else dh=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;ij(a,b);a=b.pendingProps;var e=Yf(b,H.current);ch(b,c);e=Nh(null,b,d,a,e,c);var f=Sh();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,kh(b),e.updater=Ei,b.stateNode=e,e._reactInternals=b,Ii(b,d,a,c),b=jj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Xi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{ij(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=Zk(d);a=Ci(d,a);switch(e){case 0:b=cj(null,b,d,a,c);break a;case 1:b=hj(null,b,d,a,c);break a;case 11:b=Yi(null,b,d,a,c);break a;case 14:b=$i(null,b,d,Ci(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),cj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),hj(a,b,d,e,c);case 3:a:{kj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;lh(a,b);qh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ji(Error(p(423)),b);b=lj(a,b,d,c,e);break a}else if(d!==e){e=Ji(Error(p(424)),b);b=lj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Vg(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=Zi(a,b,c);break a}Xi(a,b,d,c)}b=b.child}return b;case 5:return Ah(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\ngj(a,b),Xi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return oj(a,b,c);case 4:return yh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Ug(b,null,d,c):Xi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),Yi(a,b,d,e,c);case 7:return Xi(a,b,b.pendingProps,c),b.child;case 8:return Xi(a,b,b.pendingProps.children,c),b.child;case 12:return Xi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Wg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=Zi(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=mh(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);bh(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);bh(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Xi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,ch(b,c),e=eh(e),d=d(e),b.flags|=1,Xi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Ci(d,b.pendingProps),e=Ci(d.type,e),$i(a,b,d,e,c);case 15:return bj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),ij(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,ch(b,c),Gi(b,d,e),Ii(b,d,e,c),jj(null,b,d,!0,a,c);case 19:return xj(a,b,c);case 22:return dj(a,b,c)}throw Error(p(156,b.tag));};function Fk(a,b){return ac(a,b)}\nfunction $k(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new $k(a,b,c,d)}function aj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction Zk(a){if(\"function\"===typeof a)return aj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction Pg(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction Rg(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)aj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Tg(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return pj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Tg(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function pj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function Qg(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction Sg(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction al(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function bl(a,b,c,d,e,f,g,h,k){a=new al(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};kh(f);return a}function cl(a,b,c){var d=3>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","!function(root, name, make) {\r\n if (typeof module != 'undefined' && module.exports) module.exports = make()\r\n else root[name] = make()\r\n}(this, 'subtag', function() {\r\n\r\n var empty = ''\r\n var pattern = /^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/\r\n\r\n function match(tag) {\r\n return tag.match(pattern) || []\r\n }\r\n\r\n function split(tag) {\r\n return match(tag).filter(function(v, i) { return v && i })\r\n }\r\n\r\n function api(tag) {\r\n tag = match(tag)\r\n return {\r\n language: tag[1] || empty,\r\n extlang: tag[2] || empty,\r\n script: tag[3] || empty,\r\n region: tag[4] || empty\r\n }\r\n }\r\n\r\n function expose(target, key, value) {\r\n Object.defineProperty(target, key, {\r\n value: value,\r\n enumerable: true\r\n })\r\n }\r\n\r\n function part(position, pattern, type) {\r\n function method(tag) {\r\n return match(tag)[position] || empty\r\n }\r\n expose(method, 'pattern', pattern)\r\n expose(api, type, method)\r\n }\r\n\r\n part(1, /^[a-zA-Z]{2,3}$/, 'language')\r\n part(2, /^[a-zA-Z]{3}$/, 'extlang')\r\n part(3, /^[a-zA-Z]{4}$/, 'script')\r\n part(4, /^[a-zA-Z]{2}$|^[0-9]{3}$/, 'region')\r\n\r\n expose(api, 'split', split)\r\n\r\n return api\r\n});\r\n","'use strict';\n\n/**\n * A typeahead component for inputs\n * @class Suggestions\n *\n * @param {HTMLInputElement} el A valid HTML input element\n * @param {Array} data An array of data used for results\n * @param {Object} options\n * @param {Number} [options.limit=5] Max number of results to display in the auto suggest list.\n * @param {Number} [options.minLength=2] Number of characters typed into an input to trigger suggestions.\n * @param {Boolean} [options.hideOnBlur=true] If `true`, hides the suggestions when focus is lost.\n * @return {Suggestions} `this`\n * @example\n * // in the browser\n * var input = document.querySelector('input');\n * var data = [\n * 'Roy Eldridge',\n * 'Roy Hargrove',\n * 'Rex Stewart'\n * ];\n *\n * new Suggestions(input, data);\n *\n * // with options\n * var input = document.querySelector('input');\n * var data = [{\n * name: 'Roy Eldridge',\n * year: 1911\n * }, {\n * name: 'Roy Hargrove',\n * year: 1969\n * }, {\n * name: 'Rex Stewart',\n * year: 1907\n * }];\n *\n * var typeahead = new Suggestions(input, data, {\n * filter: false, // Disable filtering\n * minLength: 3, // Number of characters typed into an input to trigger suggestions.\n * limit: 3, // Max number of results to display.\n * hideOnBlur: false // Don't hide results when input loses focus\n * });\n *\n * // As we're passing an object of an arrays as data, override\n * // `getItemValue` by specifying the specific property to search on.\n * typeahead.getItemValue = function(item) { return item.name };\n *\n * input.addEventListener('change', function() {\n * console.log(typeahead.selected); // Current selected item.\n * });\n *\n * // With browserify\n * var Suggestions = require('suggestions');\n *\n * new Suggestions(input, data);\n */\nvar Suggestions = require('./src/suggestions');\nmodule.exports = Suggestions;\n\nif (typeof window !== 'undefined') {\n window.Suggestions = Suggestions;\n}\n","'use strict';\n\nvar List = function(component) {\n this.component = component;\n this.items = [];\n this.active = 0;\n this.wrapper = document.createElement('div');\n this.wrapper.className = 'suggestions-wrapper';\n this.element = document.createElement('ul');\n this.element.className = 'suggestions';\n this.wrapper.appendChild(this.element);\n\n // selectingListItem is set to true in the time between the mousedown and mouseup when clicking an item in the list\n // mousedown on a list item will cause the input to blur which normally hides the list, so this flag is used to keep\n // the list open until the mouseup\n this.selectingListItem = false;\n\n component.el.parentNode.insertBefore(this.wrapper, component.el.nextSibling);\n return this;\n};\n\nList.prototype.show = function() {\n this.element.style.display = 'block';\n};\n\nList.prototype.hide = function() {\n this.element.style.display = 'none';\n};\n\nList.prototype.add = function(item) {\n this.items.push(item);\n};\n\nList.prototype.clear = function() {\n this.items = [];\n this.active = 0;\n};\n\nList.prototype.isEmpty = function() {\n return !this.items.length;\n};\n\nList.prototype.isVisible = function() {\n return this.element.style.display === 'block';\n};\n\nList.prototype.draw = function() {\n this.element.innerHTML = '';\n\n if (this.items.length === 0) {\n this.hide();\n return;\n }\n\n for (var i = 0; i < this.items.length; i++) {\n this.drawItem(this.items[i], this.active === i);\n }\n\n this.show();\n};\n\nList.prototype.drawItem = function(item, active) {\n var li = document.createElement('li'),\n a = document.createElement('a');\n\n if (active) li.className += ' active';\n\n a.innerHTML = item.string;\n\n li.appendChild(a);\n this.element.appendChild(li);\n\n li.addEventListener('mousedown', function() {\n this.selectingListItem = true;\n }.bind(this));\n\n li.addEventListener('mouseup', function() {\n this.handleMouseUp.call(this, item);\n }.bind(this));\n};\n\nList.prototype.handleMouseUp = function(item) {\n this.selectingListItem = false;\n this.component.value(item.original);\n this.clear();\n this.draw();\n};\n\nList.prototype.move = function(index) {\n this.active = index;\n this.draw();\n};\n\nList.prototype.previous = function() {\n this.move(this.active === 0 ? this.items.length - 1 : this.active - 1);\n};\n\nList.prototype.next = function() {\n this.move(this.active === this.items.length - 1 ? 0 : this.active + 1);\n};\n\nList.prototype.drawError = function(msg){\n var li = document.createElement('li');\n\n li.innerHTML = msg;\n\n this.element.appendChild(li);\n this.show();\n}\n\nmodule.exports = List;\n","'use strict';\n\nvar extend = require('xtend');\nvar fuzzy = require('fuzzy');\nvar List = require('./list');\n\nvar Suggestions = function(el, data, options) {\n options = options || {};\n\n this.options = extend({\n minLength: 2,\n limit: 5,\n filter: true,\n hideOnBlur: true\n }, options);\n\n this.el = el;\n this.data = data || [];\n this.list = new List(this);\n\n this.query = '';\n this.selected = null;\n\n this.list.draw();\n\n this.el.addEventListener('keyup', function(e) {\n this.handleKeyUp(e.keyCode);\n }.bind(this), false);\n\n this.el.addEventListener('keydown', function(e) {\n this.handleKeyDown(e);\n }.bind(this));\n\n this.el.addEventListener('focus', function() {\n this.handleFocus();\n }.bind(this));\n\n this.el.addEventListener('blur', function() {\n this.handleBlur();\n }.bind(this));\n\n this.el.addEventListener('paste', function(e) {\n this.handlePaste(e);\n }.bind(this));\n\n // use user-provided render function if given, otherwise just use the default\n this.render = (this.options.render) ? this.options.render.bind(this) : this.render.bind(this)\n\n this.getItemValue = (this.options.getItemValue) ? this.options.getItemValue.bind(this) : this.getItemValue.bind(this);\n\n return this;\n};\n\nSuggestions.prototype.handleKeyUp = function(keyCode) {\n // 40 - DOWN\n // 38 - UP\n // 27 - ESC\n // 13 - ENTER\n // 9 - TAB\n\n if (keyCode === 40 ||\n keyCode === 38 ||\n keyCode === 27 ||\n keyCode === 13 ||\n keyCode === 9) return;\n\n this.handleInputChange(this.el.value);\n};\n\nSuggestions.prototype.handleKeyDown = function(e) {\n switch (e.keyCode) {\n case 13: // ENTER\n case 9: // TAB\n if (!this.list.isEmpty()) {\n if (this.list.isVisible()) {\n e.preventDefault();\n }\n this.value(this.list.items[this.list.active].original);\n this.list.hide();\n }\n break;\n case 27: // ESC\n if (!this.list.isEmpty()) this.list.hide();\n break;\n case 38: // UP\n this.list.previous();\n break;\n case 40: // DOWN\n this.list.next();\n break;\n }\n};\n\nSuggestions.prototype.handleBlur = function() {\n if (!this.list.selectingListItem && this.options.hideOnBlur) {\n this.list.hide();\n }\n};\n\nSuggestions.prototype.handlePaste = function(e) {\n if (e.clipboardData) {\n this.handleInputChange(e.clipboardData.getData('Text'));\n } else {\n var self = this;\n setTimeout(function () {\n self.handleInputChange(e.target.value);\n }, 100);\n }\n};\n\nSuggestions.prototype.handleInputChange = function(query) {\n this.query = this.normalize(query);\n\n this.list.clear();\n\n if (this.query.length < this.options.minLength) {\n this.list.draw();\n return;\n }\n\n this.getCandidates(function(data) {\n for (var i = 0; i < data.length; i++) {\n this.list.add(data[i]);\n if (i === (this.options.limit - 1)) break;\n }\n this.list.draw();\n }.bind(this));\n};\n\nSuggestions.prototype.handleFocus = function() {\n if (!this.list.isEmpty()) this.list.show();\n this.list.selectingListItem = false;\n};\n\n/**\n * Update data previously passed\n *\n * @param {Array} revisedData\n */\nSuggestions.prototype.update = function(revisedData) {\n this.data = revisedData;\n this.handleKeyUp();\n};\n\n/**\n * Clears data\n */\nSuggestions.prototype.clear = function() {\n this.data = [];\n this.list.clear();\n};\n\n/**\n * Normalize the results list and input value for matching\n *\n * @param {String} value\n * @return {String}\n */\nSuggestions.prototype.normalize = function(value) {\n value = value.toLowerCase();\n return value;\n};\n\n/**\n * Evaluates whether an array item qualifies as a match with the current query\n *\n * @param {String} candidate a possible item from the array passed\n * @param {String} query the current query\n * @return {Boolean}\n */\nSuggestions.prototype.match = function(candidate, query) {\n return candidate.indexOf(query) > -1;\n};\n\nSuggestions.prototype.value = function(value) {\n this.selected = value;\n this.el.value = this.getItemValue(value);\n\n if (document.createEvent) {\n var e = document.createEvent('HTMLEvents');\n e.initEvent('change', true, false);\n this.el.dispatchEvent(e);\n } else {\n this.el.fireEvent('onchange');\n }\n};\n\nSuggestions.prototype.getCandidates = function(callback) {\n var options = {\n pre: '',\n post: '',\n extract: function(d) { return this.getItemValue(d); }.bind(this)\n };\n var results;\n if(this.options.filter){\n results = fuzzy.filter(this.query, this.data, options);\n\n results = results.map(function(item){\n return {\n original: item.original,\n string: this.render(item.original, item.string)\n };\n }.bind(this))\n }else{\n results = this.data.map(function(d) {\n var renderedString = this.render(d);\n return {\n original: d,\n string: renderedString\n };\n }.bind(this));\n }\n callback(results);\n};\n\n/**\n * For a given item in the data array, return what should be used as the candidate string\n *\n * @param {Object|String} item an item from the data array\n * @return {String} item\n */\nSuggestions.prototype.getItemValue = function(item) {\n return item;\n};\n\n/**\n * For a given item in the data array, return a string of html that should be rendered in the dropdown\n * @param {Object|String} item an item from the data array\n * @param {String} sourceFormatting a string that has pre-formatted html that should be passed directly through the render function \n * @return {String} html\n */\nSuggestions.prototype.render = function(item, sourceFormatting) {\n if (sourceFormatting){\n // use existing formatting on the source string\n return sourceFormatting;\n }\n var boldString = (item.original) ? this.getItemValue(item.original) : this.getItemValue(item);\n var indexString = this.normalize(boldString);\n var indexOfQuery = indexString.lastIndexOf(this.query);\n while (indexOfQuery > -1) {\n var endIndexOfQuery = indexOfQuery + this.query.length;\n boldString = boldString.slice(0, indexOfQuery) + '' + boldString.slice(indexOfQuery, endIndexOfQuery) + '' + boldString.slice(endIndexOfQuery);\n indexOfQuery = indexString.slice(0, indexOfQuery).lastIndexOf(this.query);\n }\n return boldString\n}\n\n/**\n * Render an custom error message in the suggestions list\n * @param {String} msg An html string to render as an error message\n */\nSuggestions.prototype.renderError = function(msg){\n this.list.drawError(msg);\n}\n\nmodule.exports = Suggestions;\n","module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n","function _extends() {\n return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _extends.apply(null, arguments);\n}\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(e) {\n return e && e.__esModule ? e : {\n \"default\": e\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.includes(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nmodule.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.includes(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nlet nanoid = (size = 21) =>\n crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {\n byte &= 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte > 62) {\n id += '-'\n } else {\n id += '_'\n }\n return id\n }, '')\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"static/js/\" + chunkId + \".\" + \"1b384830\" + \".chunk.js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var inProgress = {};\nvar dataWebpackPrefix = \"map-visualization-app:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"/UBEMViewer/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t792: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmap_visualization_app\"] = self[\"webpackChunkmap_visualization_app\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","import * as React from 'react';\nconst ThemeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'ThemeContext';\n}\nexport default ThemeContext;","import * as React from 'react';\nimport ThemeContext from './ThemeContext';\nexport default function useTheme() {\n const theme = React.useContext(ThemeContext);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n return theme;\n}","const hasSymbol = typeof Symbol === 'function' && Symbol.for;\nexport default hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp } from '@mui/utils';\nimport ThemeContext from '../useTheme/ThemeContext';\nimport useTheme from '../useTheme';\nimport nested from './nested';\n\n// To support composition of theme.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction mergeOuterLocalTheme(outerTheme, localTheme) {\n if (typeof localTheme === 'function') {\n const mergedTheme = localTheme(outerTheme);\n if (process.env.NODE_ENV !== 'production') {\n if (!mergedTheme) {\n console.error(['MUI: You should return an object from your theme function, i.e.', ' ({})} />'].join('\\n'));\n }\n }\n return mergedTheme;\n }\n return _extends({}, outerTheme, localTheme);\n}\n\n/**\n * This component takes a `theme` prop.\n * It makes the `theme` available down the React tree thanks to React context.\n * This component should preferably be used at **the root of your component tree**.\n */\nfunction ThemeProvider(props) {\n const {\n children,\n theme: localTheme\n } = props;\n const outerTheme = useTheme();\n if (process.env.NODE_ENV !== 'production') {\n if (outerTheme === null && typeof localTheme === 'function') {\n console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\\n'));\n }\n }\n const theme = React.useMemo(() => {\n const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);\n if (output != null) {\n output[nested] = outerTheme !== null;\n }\n return output;\n }, [localTheme, outerTheme]);\n return /*#__PURE__*/_jsx(ThemeContext.Provider, {\n value: theme,\n children: children\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;\n}\nexport default ThemeProvider;","'use client';\n\nimport * as React from 'react';\nimport { ThemeContext } from '@mui/styled-engine';\nfunction isObjectEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction useTheme(defaultTheme = null) {\n const contextTheme = React.useContext(ThemeContext);\n return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;\n}\nexport default useTheme;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"value\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst RtlContext = /*#__PURE__*/React.createContext();\nfunction RtlProvider(_ref) {\n let {\n value\n } = _ref,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n return /*#__PURE__*/_jsx(RtlContext.Provider, _extends({\n value: value != null ? value : true\n }, props));\n}\nprocess.env.NODE_ENV !== \"production\" ? RtlProvider.propTypes = {\n children: PropTypes.node,\n value: PropTypes.bool\n} : void 0;\nexport const useRtl = () => {\n const value = React.useContext(RtlContext);\n return value != null ? value : false;\n};\nexport default RtlProvider;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { ThemeProvider as MuiThemeProvider, useTheme as usePrivateTheme } from '@mui/private-theming';\nimport exactProp from '@mui/utils/exactProp';\nimport { ThemeContext as StyledEngineThemeContext } from '@mui/styled-engine';\nimport useThemeWithoutDefault from '../useThemeWithoutDefault';\nimport RtlProvider from '../RtlProvider';\nimport DefaultPropsProvider from '../DefaultPropsProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst EMPTY_THEME = {};\nfunction useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {\n return React.useMemo(() => {\n const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;\n if (typeof localTheme === 'function') {\n const mergedTheme = localTheme(resolvedTheme);\n const result = themeId ? _extends({}, upperTheme, {\n [themeId]: mergedTheme\n }) : mergedTheme;\n // must return a function for the private theme to NOT merge with the upper theme.\n // see the test case \"use provided theme from a callback\" in ThemeProvider.test.js\n if (isPrivate) {\n return () => result;\n }\n return result;\n }\n return themeId ? _extends({}, upperTheme, {\n [themeId]: localTheme\n }) : _extends({}, upperTheme, localTheme);\n }, [themeId, upperTheme, localTheme, isPrivate]);\n}\n\n/**\n * This component makes the `theme` available down the React tree.\n * It should preferably be used at **the root of your component tree**.\n *\n * // existing use case\n * // theme scoping\n */\nfunction ThemeProvider(props) {\n const {\n children,\n theme: localTheme,\n themeId\n } = props;\n const upperTheme = useThemeWithoutDefault(EMPTY_THEME);\n const upperPrivateTheme = usePrivateTheme() || EMPTY_THEME;\n if (process.env.NODE_ENV !== 'production') {\n if (upperTheme === null && typeof localTheme === 'function' || themeId && upperTheme && !upperTheme[themeId] && typeof localTheme === 'function') {\n console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\\n'));\n }\n }\n const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);\n const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);\n const rtlValue = engineTheme.direction === 'rtl';\n return /*#__PURE__*/_jsx(MuiThemeProvider, {\n theme: privateTheme,\n children: /*#__PURE__*/_jsx(StyledEngineThemeContext.Provider, {\n value: engineTheme,\n children: /*#__PURE__*/_jsx(RtlProvider, {\n value: rtlValue,\n children: /*#__PURE__*/_jsx(DefaultPropsProvider, {\n value: engineTheme == null ? void 0 : engineTheme.components,\n children: children\n })\n })\n })\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired,\n /**\n * The design system's unique id for getting the corresponded theme when there are multiple design systems.\n */\n themeId: PropTypes.string\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;\n}\nexport default ThemeProvider;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"theme\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { ThemeProvider as SystemThemeProvider } from '@mui/system';\nimport THEME_ID from './identifier';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function ThemeProvider(_ref) {\n let {\n theme: themeInput\n } = _ref,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n const scopedTheme = themeInput[THEME_ID];\n return /*#__PURE__*/_jsx(SystemThemeProvider, _extends({}, props, {\n themeId: scopedTheme ? THEME_ID : undefined,\n theme: scopedTheme || themeInput\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired\n} : void 0;","// Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61\nconst getOverlayAlpha = elevation => {\n let alphaValue;\n if (elevation < 1) {\n alphaValue = 5.11916 * elevation ** 2;\n } else {\n alphaValue = 4.5 * Math.log(elevation + 1) + 2;\n }\n return (alphaValue / 100).toFixed(2);\n};\nexport default getOverlayAlpha;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getPaperUtilityClass(slot) {\n return generateUtilityClass('MuiPaper', slot);\n}\nconst paperClasses = generateUtilityClasses('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']);\nexport default paperClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"component\", \"elevation\", \"square\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport integerPropType from '@mui/utils/integerPropType';\nimport chainPropTypes from '@mui/utils/chainPropTypes';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { alpha } from '@mui/system/colorManipulator';\nimport styled from '../styles/styled';\nimport getOverlayAlpha from '../styles/getOverlayAlpha';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport useTheme from '../styles/useTheme';\nimport { getPaperUtilityClass } from './paperClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n square,\n elevation,\n variant,\n classes\n } = ownerState;\n const slots = {\n root: ['root', variant, !square && 'rounded', variant === 'elevation' && `elevation${elevation}`]\n };\n return composeClasses(slots, getPaperUtilityClass, classes);\n};\nconst PaperRoot = styled('div', {\n name: 'MuiPaper',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === 'elevation' && styles[`elevation${ownerState.elevation}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$vars$overlays;\n return _extends({\n backgroundColor: (theme.vars || theme).palette.background.paper,\n color: (theme.vars || theme).palette.text.primary,\n transition: theme.transitions.create('box-shadow')\n }, !ownerState.square && {\n borderRadius: theme.shape.borderRadius\n }, ownerState.variant === 'outlined' && {\n border: `1px solid ${(theme.vars || theme).palette.divider}`\n }, ownerState.variant === 'elevation' && _extends({\n boxShadow: (theme.vars || theme).shadows[ownerState.elevation]\n }, !theme.vars && theme.palette.mode === 'dark' && {\n backgroundImage: `linear-gradient(${alpha('#fff', getOverlayAlpha(ownerState.elevation))}, ${alpha('#fff', getOverlayAlpha(ownerState.elevation))})`\n }, theme.vars && {\n backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation]\n }));\n});\nconst Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiPaper'\n });\n const {\n className,\n component = 'div',\n elevation = 1,\n square = false,\n variant = 'elevation'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n component,\n elevation,\n square,\n variant\n });\n const classes = useUtilityClasses(ownerState);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const theme = useTheme();\n if (theme.shadows[elevation] === undefined) {\n console.error([`MUI: The elevation provided is not available in the theme.`, `Please make sure that \\`theme.shadows[${elevation}]\\` is defined.`].join('\\n'));\n }\n }\n return /*#__PURE__*/_jsx(PaperRoot, _extends({\n as: component,\n ownerState: ownerState,\n className: clsx(classes.root, className),\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Paper.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * Shadow depth, corresponds to `dp` in the spec.\n * It accepts values between 0 and 24 inclusive.\n * @default 1\n */\n elevation: chainPropTypes(integerPropType, props => {\n const {\n elevation,\n variant\n } = props;\n if (elevation > 0 && variant === 'outlined') {\n return new Error(`MUI: Combining \\`elevation={${elevation}}\\` with \\`variant=\"${variant}\"\\` has no effect. Either use \\`elevation={0}\\` or use a different \\`variant\\`.`);\n }\n return null;\n }),\n /**\n * If `true`, rounded corners are disabled.\n * @default false\n */\n square: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The variant to use.\n * @default 'elevation'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['elevation', 'outlined']), PropTypes.string])\n} : void 0;\nexport default Paper;","'use client';\n\nimport createTheme from './createTheme';\nimport useThemeWithoutDefault from './useThemeWithoutDefault';\nexport const systemDefaultTheme = createTheme();\nfunction useTheme(defaultTheme = systemDefaultTheme) {\n return useThemeWithoutDefault(defaultTheme);\n}\nexport default useTheme;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { GlobalStyles as MuiGlobalStyles } from '@mui/styled-engine';\nimport useTheme from '../useTheme';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction GlobalStyles({\n styles,\n themeId,\n defaultTheme = {}\n}) {\n const upperTheme = useTheme(defaultTheme);\n const globalStyles = typeof styles === 'function' ? styles(themeId ? upperTheme[themeId] || upperTheme : upperTheme) : styles;\n return /*#__PURE__*/_jsx(MuiGlobalStyles, {\n styles: globalStyles\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GlobalStyles.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * @ignore\n */\n defaultTheme: PropTypes.object,\n /**\n * @ignore\n */\n styles: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.array, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),\n /**\n * @ignore\n */\n themeId: PropTypes.string\n} : void 0;\nexport default GlobalStyles;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { GlobalStyles as SystemGlobalStyles } from '@mui/system';\nimport defaultTheme from '../styles/defaultTheme';\nimport THEME_ID from '../styles/identifier';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction GlobalStyles(props) {\n return /*#__PURE__*/_jsx(SystemGlobalStyles, _extends({}, props, {\n defaultTheme: defaultTheme,\n themeId: THEME_ID\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? GlobalStyles.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The styles you want to apply globally.\n */\n styles: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.array, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool])\n} : void 0;\nexport default GlobalStyles;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport GlobalStyles from '../GlobalStyles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const html = (theme, enableColorScheme) => _extends({\n WebkitFontSmoothing: 'antialiased',\n // Antialiasing.\n MozOsxFontSmoothing: 'grayscale',\n // Antialiasing.\n // Change from `box-sizing: content-box` so that `width`\n // is not affected by `padding` or `border`.\n boxSizing: 'border-box',\n // Fix font resize problem in iOS\n WebkitTextSizeAdjust: '100%'\n}, enableColorScheme && !theme.vars && {\n colorScheme: theme.palette.mode\n});\nexport const body = theme => _extends({\n color: (theme.vars || theme).palette.text.primary\n}, theme.typography.body1, {\n backgroundColor: (theme.vars || theme).palette.background.default,\n '@media print': {\n // Save printer ink.\n backgroundColor: (theme.vars || theme).palette.common.white\n }\n});\nexport const styles = (theme, enableColorScheme = false) => {\n var _theme$components;\n const colorSchemeStyles = {};\n if (enableColorScheme && theme.colorSchemes) {\n Object.entries(theme.colorSchemes).forEach(([key, scheme]) => {\n var _scheme$palette;\n colorSchemeStyles[theme.getColorSchemeSelector(key).replace(/\\s*&/, '')] = {\n colorScheme: (_scheme$palette = scheme.palette) == null ? void 0 : _scheme$palette.mode\n };\n });\n }\n let defaultStyles = _extends({\n html: html(theme, enableColorScheme),\n '*, *::before, *::after': {\n boxSizing: 'inherit'\n },\n 'strong, b': {\n fontWeight: theme.typography.fontWeightBold\n },\n body: _extends({\n margin: 0\n }, body(theme), {\n // Add support for document.body.requestFullScreen().\n // Other elements, if background transparent, are not supported.\n '&::backdrop': {\n backgroundColor: (theme.vars || theme).palette.background.default\n }\n })\n }, colorSchemeStyles);\n const themeOverrides = (_theme$components = theme.components) == null || (_theme$components = _theme$components.MuiCssBaseline) == null ? void 0 : _theme$components.styleOverrides;\n if (themeOverrides) {\n defaultStyles = [defaultStyles, themeOverrides];\n }\n return defaultStyles;\n};\n\n/**\n * Kickstart an elegant, consistent, and simple baseline to build upon.\n */\nfunction CssBaseline(inProps) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiCssBaseline'\n });\n const {\n children,\n enableColorScheme = false\n } = props;\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(GlobalStyles, {\n styles: theme => styles(theme, enableColorScheme)\n }), children]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? CssBaseline.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * You can wrap a node.\n */\n children: PropTypes.node,\n /**\n * Enable `color-scheme` CSS property to use `theme.palette.mode`.\n * For more details, check out https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme\n * For browser support, check out https://caniuse.com/?search=color-scheme\n * @default false\n */\n enableColorScheme: PropTypes.bool\n} : void 0;\nexport default CssBaseline;","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","import React from 'react';\nexport default React.createContext(null);","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `
` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","function _assertThisInitialized(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n}\nexport { _assertThisInitialized as default };","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction Ripple(props) {\n const {\n className,\n classes,\n pulsate = false,\n rippleX,\n rippleY,\n rippleSize,\n in: inProp,\n onExited,\n timeout\n } = props;\n const [leaving, setLeaving] = React.useState(false);\n const rippleClassName = clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);\n const rippleStyles = {\n width: rippleSize,\n height: rippleSize,\n top: -(rippleSize / 2) + rippleY,\n left: -(rippleSize / 2) + rippleX\n };\n const childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);\n if (!inProp && !leaving) {\n setLeaving(true);\n }\n React.useEffect(() => {\n if (!inProp && onExited != null) {\n // react-transition-group#onExited\n const timeoutId = setTimeout(onExited, timeout);\n return () => {\n clearTimeout(timeoutId);\n };\n }\n return undefined;\n }, [onExited, inProp, timeout]);\n return /*#__PURE__*/_jsx(\"span\", {\n className: rippleClassName,\n style: rippleStyles,\n children: /*#__PURE__*/_jsx(\"span\", {\n className: childClassName\n })\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? Ripple.propTypes = {\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n /**\n * @ignore - injected from TransitionGroup\n */\n in: PropTypes.bool,\n /**\n * @ignore - injected from TransitionGroup\n */\n onExited: PropTypes.func,\n /**\n * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.\n */\n pulsate: PropTypes.bool,\n /**\n * Diameter of the ripple.\n */\n rippleSize: PropTypes.number,\n /**\n * Horizontal position of the ripple center.\n */\n rippleX: PropTypes.number,\n /**\n * Vertical position of the ripple center.\n */\n rippleY: PropTypes.number,\n /**\n * exit delay\n */\n timeout: PropTypes.number.isRequired\n} : void 0;\nexport default Ripple;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getTouchRippleUtilityClass(slot) {\n return generateUtilityClass('MuiTouchRipple', slot);\n}\nconst touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);\nexport default touchRippleClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"center\", \"classes\", \"className\"];\nlet _ = t => t,\n _t,\n _t2,\n _t3,\n _t4;\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { TransitionGroup } from 'react-transition-group';\nimport clsx from 'clsx';\nimport { keyframes } from '@mui/system';\nimport useTimeout from '@mui/utils/useTimeout';\nimport styled from '../styles/styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport Ripple from './Ripple';\nimport touchRippleClasses from './touchRippleClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst DURATION = 550;\nexport const DELAY_RIPPLE = 80;\nconst enterKeyframe = keyframes(_t || (_t = _`\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n`));\nconst exitKeyframe = keyframes(_t2 || (_t2 = _`\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n`));\nconst pulsateKeyframe = keyframes(_t3 || (_t3 = _`\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n`));\nexport const TouchRippleRoot = styled('span', {\n name: 'MuiTouchRipple',\n slot: 'Root'\n})({\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 0,\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: 'inherit'\n});\n\n// This `styled()` function invokes keyframes. `styled-components` only supports keyframes\n// in string templates. Do not convert these styles in JS object as it will break.\nexport const TouchRippleRipple = styled(Ripple, {\n name: 'MuiTouchRipple',\n slot: 'Ripple'\n})(_t4 || (_t4 = _`\n opacity: 0;\n position: absolute;\n\n &.${0} {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ${0};\n animation-duration: ${0}ms;\n animation-timing-function: ${0};\n }\n\n &.${0} {\n animation-duration: ${0}ms;\n }\n\n & .${0} {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & .${0} {\n opacity: 0;\n animation-name: ${0};\n animation-duration: ${0}ms;\n animation-timing-function: ${0};\n }\n\n & .${0} {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ${0};\n animation-duration: 2500ms;\n animation-timing-function: ${0};\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n`), touchRippleClasses.rippleVisible, enterKeyframe, DURATION, ({\n theme\n}) => theme.transitions.easing.easeInOut, touchRippleClasses.ripplePulsate, ({\n theme\n}) => theme.transitions.duration.shorter, touchRippleClasses.child, touchRippleClasses.childLeaving, exitKeyframe, DURATION, ({\n theme\n}) => theme.transitions.easing.easeInOut, touchRippleClasses.childPulsate, pulsateKeyframe, ({\n theme\n}) => theme.transitions.easing.easeInOut);\n\n/**\n * @ignore - internal component.\n *\n * TODO v5: Make private\n */\nconst TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiTouchRipple'\n });\n const {\n center: centerProp = false,\n classes = {},\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [ripples, setRipples] = React.useState([]);\n const nextKey = React.useRef(0);\n const rippleCallback = React.useRef(null);\n React.useEffect(() => {\n if (rippleCallback.current) {\n rippleCallback.current();\n rippleCallback.current = null;\n }\n }, [ripples]);\n\n // Used to filter out mouse emulated events on mobile.\n const ignoringMouseDown = React.useRef(false);\n // We use a timer in order to only show the ripples for touch \"click\" like events.\n // We don't want to display the ripple for touch scroll events.\n const startTimer = useTimeout();\n\n // This is the hook called once the previous timeout is ready.\n const startTimerCommit = React.useRef(null);\n const container = React.useRef(null);\n const startCommit = React.useCallback(params => {\n const {\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n } = params;\n setRipples(oldRipples => [...oldRipples, /*#__PURE__*/_jsx(TouchRippleRipple, {\n classes: {\n ripple: clsx(classes.ripple, touchRippleClasses.ripple),\n rippleVisible: clsx(classes.rippleVisible, touchRippleClasses.rippleVisible),\n ripplePulsate: clsx(classes.ripplePulsate, touchRippleClasses.ripplePulsate),\n child: clsx(classes.child, touchRippleClasses.child),\n childLeaving: clsx(classes.childLeaving, touchRippleClasses.childLeaving),\n childPulsate: clsx(classes.childPulsate, touchRippleClasses.childPulsate)\n },\n timeout: DURATION,\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize\n }, nextKey.current)]);\n nextKey.current += 1;\n rippleCallback.current = cb;\n }, [classes]);\n const start = React.useCallback((event = {}, options = {}, cb = () => {}) => {\n const {\n pulsate = false,\n center = centerProp || options.pulsate,\n fakeElement = false // For test purposes\n } = options;\n if ((event == null ? void 0 : event.type) === 'mousedown' && ignoringMouseDown.current) {\n ignoringMouseDown.current = false;\n return;\n }\n if ((event == null ? void 0 : event.type) === 'touchstart') {\n ignoringMouseDown.current = true;\n }\n const element = fakeElement ? null : container.current;\n const rect = element ? element.getBoundingClientRect() : {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n };\n\n // Get the size of the ripple\n let rippleX;\n let rippleY;\n let rippleSize;\n if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {\n rippleX = Math.round(rect.width / 2);\n rippleY = Math.round(rect.height / 2);\n } else {\n const {\n clientX,\n clientY\n } = event.touches && event.touches.length > 0 ? event.touches[0] : event;\n rippleX = Math.round(clientX - rect.left);\n rippleY = Math.round(clientY - rect.top);\n }\n if (center) {\n rippleSize = Math.sqrt((2 * rect.width ** 2 + rect.height ** 2) / 3);\n\n // For some reason the animation is broken on Mobile Chrome if the size is even.\n if (rippleSize % 2 === 0) {\n rippleSize += 1;\n }\n } else {\n const sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;\n const sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;\n rippleSize = Math.sqrt(sizeX ** 2 + sizeY ** 2);\n }\n\n // Touche devices\n if (event != null && event.touches) {\n // check that this isn't another touchstart due to multitouch\n // otherwise we will only clear a single timer when unmounting while two\n // are running\n if (startTimerCommit.current === null) {\n // Prepare the ripple effect.\n startTimerCommit.current = () => {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n };\n // Delay the execution of the ripple effect.\n // We have to make a tradeoff with this delay value.\n startTimer.start(DELAY_RIPPLE, () => {\n if (startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n }\n });\n }\n } else {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n }\n }, [centerProp, startCommit, startTimer]);\n const pulsate = React.useCallback(() => {\n start({}, {\n pulsate: true\n });\n }, [start]);\n const stop = React.useCallback((event, cb) => {\n startTimer.clear();\n\n // The touch interaction occurs too quickly.\n // We still want to show ripple effect.\n if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n startTimer.start(0, () => {\n stop(event, cb);\n });\n return;\n }\n startTimerCommit.current = null;\n setRipples(oldRipples => {\n if (oldRipples.length > 0) {\n return oldRipples.slice(1);\n }\n return oldRipples;\n });\n rippleCallback.current = cb;\n }, [startTimer]);\n React.useImperativeHandle(ref, () => ({\n pulsate,\n start,\n stop\n }), [pulsate, start, stop]);\n return /*#__PURE__*/_jsx(TouchRippleRoot, _extends({\n className: clsx(touchRippleClasses.root, classes.root, className),\n ref: container\n }, other, {\n children: /*#__PURE__*/_jsx(TransitionGroup, {\n component: null,\n exit: true,\n children: ripples\n })\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? TouchRipple.propTypes = {\n /**\n * If `true`, the ripple starts at the center of the component\n * rather than at the point of interaction.\n */\n center: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string\n} : void 0;\nexport default TouchRipple;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getButtonBaseUtilityClass(slot) {\n return generateUtilityClass('MuiButtonBase', slot);\n}\nconst buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);\nexport default buttonBaseClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"action\", \"centerRipple\", \"children\", \"className\", \"component\", \"disabled\", \"disableRipple\", \"disableTouchRipple\", \"focusRipple\", \"focusVisibleClassName\", \"LinkComponent\", \"onBlur\", \"onClick\", \"onContextMenu\", \"onDragLeave\", \"onFocus\", \"onFocusVisible\", \"onKeyDown\", \"onKeyUp\", \"onMouseDown\", \"onMouseLeave\", \"onMouseUp\", \"onTouchEnd\", \"onTouchMove\", \"onTouchStart\", \"tabIndex\", \"TouchRippleProps\", \"touchRippleRef\", \"type\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport refType from '@mui/utils/refType';\nimport elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';\nimport composeClasses from '@mui/utils/composeClasses';\nimport styled from '../styles/styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport useForkRef from '../utils/useForkRef';\nimport useEventCallback from '../utils/useEventCallback';\nimport useIsFocusVisible from '../utils/useIsFocusVisible';\nimport TouchRipple from './TouchRipple';\nimport buttonBaseClasses, { getButtonBaseUtilityClass } from './buttonBaseClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n disabled,\n focusVisible,\n focusVisibleClassName,\n classes\n } = ownerState;\n const slots = {\n root: ['root', disabled && 'disabled', focusVisible && 'focusVisible']\n };\n const composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);\n if (focusVisible && focusVisibleClassName) {\n composedClasses.root += ` ${focusVisibleClassName}`;\n }\n return composedClasses;\n};\nexport const ButtonBaseRoot = styled('button', {\n name: 'MuiButtonBase',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n boxSizing: 'border-box',\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n MozAppearance: 'none',\n // Reset\n WebkitAppearance: 'none',\n // Reset\n textDecoration: 'none',\n // So we take precedent over the style of a native element.\n color: 'inherit',\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n },\n [`&.${buttonBaseClasses.disabled}`]: {\n pointerEvents: 'none',\n // Disable link interactions\n cursor: 'default'\n },\n '@media print': {\n colorAdjust: 'exact'\n }\n});\n\n/**\n * `ButtonBase` contains as few styles as possible.\n * It aims to be a simple building block for creating a button.\n * It contains a load of style reset and some focus/ripple logic.\n */\nconst ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiButtonBase'\n });\n const {\n action,\n centerRipple = false,\n children,\n className,\n component = 'button',\n disabled = false,\n disableRipple = false,\n disableTouchRipple = false,\n focusRipple = false,\n LinkComponent = 'a',\n onBlur,\n onClick,\n onContextMenu,\n onDragLeave,\n onFocus,\n onFocusVisible,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n tabIndex = 0,\n TouchRippleProps,\n touchRippleRef,\n type\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const buttonRef = React.useRef(null);\n const rippleRef = React.useRef(null);\n const handleRippleRef = useForkRef(rippleRef, touchRippleRef);\n const {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref: focusVisibleRef\n } = useIsFocusVisible();\n const [focusVisible, setFocusVisible] = React.useState(false);\n if (disabled && focusVisible) {\n setFocusVisible(false);\n }\n React.useImperativeHandle(action, () => ({\n focusVisible: () => {\n setFocusVisible(true);\n buttonRef.current.focus();\n }\n }), []);\n const [mountedState, setMountedState] = React.useState(false);\n React.useEffect(() => {\n setMountedState(true);\n }, []);\n const enableTouchRipple = mountedState && !disableRipple && !disabled;\n React.useEffect(() => {\n if (focusVisible && focusRipple && !disableRipple && mountedState) {\n rippleRef.current.pulsate();\n }\n }, [disableRipple, focusRipple, focusVisible, mountedState]);\n function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {\n return useEventCallback(event => {\n if (eventCallback) {\n eventCallback(event);\n }\n const ignore = skipRippleAction;\n if (!ignore && rippleRef.current) {\n rippleRef.current[rippleAction](event);\n }\n return true;\n });\n }\n const handleMouseDown = useRippleHandler('start', onMouseDown);\n const handleContextMenu = useRippleHandler('stop', onContextMenu);\n const handleDragLeave = useRippleHandler('stop', onDragLeave);\n const handleMouseUp = useRippleHandler('stop', onMouseUp);\n const handleMouseLeave = useRippleHandler('stop', event => {\n if (focusVisible) {\n event.preventDefault();\n }\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n });\n const handleTouchStart = useRippleHandler('start', onTouchStart);\n const handleTouchEnd = useRippleHandler('stop', onTouchEnd);\n const handleTouchMove = useRippleHandler('stop', onTouchMove);\n const handleBlur = useRippleHandler('stop', event => {\n handleBlurVisible(event);\n if (isFocusVisibleRef.current === false) {\n setFocusVisible(false);\n }\n if (onBlur) {\n onBlur(event);\n }\n }, false);\n const handleFocus = useEventCallback(event => {\n // Fix for https://github.com/facebook/react/issues/7769\n if (!buttonRef.current) {\n buttonRef.current = event.currentTarget;\n }\n handleFocusVisible(event);\n if (isFocusVisibleRef.current === true) {\n setFocusVisible(true);\n if (onFocusVisible) {\n onFocusVisible(event);\n }\n }\n if (onFocus) {\n onFocus(event);\n }\n });\n const isNonNativeButton = () => {\n const button = buttonRef.current;\n return component && component !== 'button' && !(button.tagName === 'A' && button.href);\n };\n\n /**\n * IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat\n */\n const keydownRef = React.useRef(false);\n const handleKeyDown = useEventCallback(event => {\n // Check if key is already down to avoid repeats being counted as multiple activations\n if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {\n keydownRef.current = true;\n rippleRef.current.stop(event, () => {\n rippleRef.current.start(event);\n });\n }\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {\n event.preventDefault();\n }\n if (onKeyDown) {\n onKeyDown(event);\n }\n\n // Keyboard accessibility for non interactive elements\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {\n event.preventDefault();\n if (onClick) {\n onClick(event);\n }\n }\n });\n const handleKeyUp = useEventCallback(event => {\n // calling preventDefault in keyUp on a \n *
\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n if (this.props.unmountOnExit || this.props.mountOnEnter) {\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749\n // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.\n // To make the animation happen, we have to separate each rendering and avoid being processed as batched.\n\n if (node) forceReflow(node);\n }\n\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","export const reflow = node => node.scrollTop;\nexport function getTransitionProps(props, options) {\n var _style$transitionDura, _style$transitionTimi;\n const {\n timeout,\n easing,\n style = {}\n } = props;\n return {\n duration: (_style$transitionDura = style.transitionDuration) != null ? _style$transitionDura : typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,\n easing: (_style$transitionTimi = style.transitionTimingFunction) != null ? _style$transitionTimi : typeof easing === 'object' ? easing[options.mode] : easing,\n delay: style.transitionDelay\n };\n}","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"addEndListener\", \"appear\", \"children\", \"easing\", \"in\", \"onEnter\", \"onEntered\", \"onEntering\", \"onExit\", \"onExited\", \"onExiting\", \"style\", \"timeout\", \"TransitionComponent\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport useTimeout from '@mui/utils/useTimeout';\nimport elementAcceptingRef from '@mui/utils/elementAcceptingRef';\nimport { Transition } from 'react-transition-group';\nimport useTheme from '../styles/useTheme';\nimport { getTransitionProps, reflow } from '../transitions/utils';\nimport useForkRef from '../utils/useForkRef';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction getScale(value) {\n return `scale(${value}, ${value ** 2})`;\n}\nconst styles = {\n entering: {\n opacity: 1,\n transform: getScale(1)\n },\n entered: {\n opacity: 1,\n transform: 'none'\n }\n};\n\n/*\n TODO v6: remove\n Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.\n */\nconst isWebKit154 = typeof navigator !== 'undefined' && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\\/)15(.|_)4/i.test(navigator.userAgent);\n\n/**\n * The Grow transition is used by the [Tooltip](/material-ui/react-tooltip/) and\n * [Popover](/material-ui/react-popover/) components.\n * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.\n */\nconst Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {\n const {\n addEndListener,\n appear = true,\n children,\n easing,\n in: inProp,\n onEnter,\n onEntered,\n onEntering,\n onExit,\n onExited,\n onExiting,\n style,\n timeout = 'auto',\n // eslint-disable-next-line react/prop-types\n TransitionComponent = Transition\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const timer = useTimeout();\n const autoTimeout = React.useRef();\n const theme = useTheme();\n const nodeRef = React.useRef(null);\n const handleRef = useForkRef(nodeRef, children.ref, ref);\n const normalizedTransitionCallback = callback => maybeIsAppearing => {\n if (callback) {\n const node = nodeRef.current;\n\n // onEnterXxx and onExitXxx callbacks have a different arguments.length value.\n if (maybeIsAppearing === undefined) {\n callback(node);\n } else {\n callback(node, maybeIsAppearing);\n }\n }\n };\n const handleEntering = normalizedTransitionCallback(onEntering);\n const handleEnter = normalizedTransitionCallback((node, isAppearing) => {\n reflow(node); // So the animation always start from the start.\n\n const {\n duration: transitionDuration,\n delay,\n easing: transitionTimingFunction\n } = getTransitionProps({\n style,\n timeout,\n easing\n }, {\n mode: 'enter'\n });\n let duration;\n if (timeout === 'auto') {\n duration = theme.transitions.getAutoHeightDuration(node.clientHeight);\n autoTimeout.current = duration;\n } else {\n duration = transitionDuration;\n }\n node.style.transition = [theme.transitions.create('opacity', {\n duration,\n delay\n }), theme.transitions.create('transform', {\n duration: isWebKit154 ? duration : duration * 0.666,\n delay,\n easing: transitionTimingFunction\n })].join(',');\n if (onEnter) {\n onEnter(node, isAppearing);\n }\n });\n const handleEntered = normalizedTransitionCallback(onEntered);\n const handleExiting = normalizedTransitionCallback(onExiting);\n const handleExit = normalizedTransitionCallback(node => {\n const {\n duration: transitionDuration,\n delay,\n easing: transitionTimingFunction\n } = getTransitionProps({\n style,\n timeout,\n easing\n }, {\n mode: 'exit'\n });\n let duration;\n if (timeout === 'auto') {\n duration = theme.transitions.getAutoHeightDuration(node.clientHeight);\n autoTimeout.current = duration;\n } else {\n duration = transitionDuration;\n }\n node.style.transition = [theme.transitions.create('opacity', {\n duration,\n delay\n }), theme.transitions.create('transform', {\n duration: isWebKit154 ? duration : duration * 0.666,\n delay: isWebKit154 ? delay : delay || duration * 0.333,\n easing: transitionTimingFunction\n })].join(',');\n node.style.opacity = 0;\n node.style.transform = getScale(0.75);\n if (onExit) {\n onExit(node);\n }\n });\n const handleExited = normalizedTransitionCallback(onExited);\n const handleAddEndListener = next => {\n if (timeout === 'auto') {\n timer.start(autoTimeout.current || 0, next);\n }\n if (addEndListener) {\n // Old call signature before `react-transition-group` implemented `nodeRef`\n addEndListener(nodeRef.current, next);\n }\n };\n return /*#__PURE__*/_jsx(TransitionComponent, _extends({\n appear: appear,\n in: inProp,\n nodeRef: nodeRef,\n onEnter: handleEnter,\n onEntered: handleEntered,\n onEntering: handleEntering,\n onExit: handleExit,\n onExited: handleExited,\n onExiting: handleExiting,\n addEndListener: handleAddEndListener,\n timeout: timeout === 'auto' ? null : timeout\n }, other, {\n children: (state, childProps) => {\n return /*#__PURE__*/React.cloneElement(children, _extends({\n style: _extends({\n opacity: 0,\n transform: getScale(0.75),\n visibility: state === 'exited' && !inProp ? 'hidden' : undefined\n }, styles[state], style, children.props.style),\n ref: handleRef\n }, childProps));\n }\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? Grow.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * Add a custom transition end trigger. Called with the transitioning DOM\n * node and a done callback. Allows for more fine grained transition end\n * logic. Note: Timeouts are still used as a fallback if provided.\n */\n addEndListener: PropTypes.func,\n /**\n * Perform the enter transition when it first mounts if `in` is also `true`.\n * Set this to `false` to disable this behavior.\n * @default true\n */\n appear: PropTypes.bool,\n /**\n * A single child content element.\n */\n children: elementAcceptingRef.isRequired,\n /**\n * The transition timing function.\n * You may specify a single easing or a object containing enter and exit values.\n */\n easing: PropTypes.oneOfType([PropTypes.shape({\n enter: PropTypes.string,\n exit: PropTypes.string\n }), PropTypes.string]),\n /**\n * If `true`, the component will transition in.\n */\n in: PropTypes.bool,\n /**\n * @ignore\n */\n onEnter: PropTypes.func,\n /**\n * @ignore\n */\n onEntered: PropTypes.func,\n /**\n * @ignore\n */\n onEntering: PropTypes.func,\n /**\n * @ignore\n */\n onExit: PropTypes.func,\n /**\n * @ignore\n */\n onExited: PropTypes.func,\n /**\n * @ignore\n */\n onExiting: PropTypes.func,\n /**\n * @ignore\n */\n style: PropTypes.object,\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n *\n * Set to 'auto' to automatically calculate transition time based on height.\n * @default 'auto'\n */\n timeout: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })])\n} : void 0;\nGrow.muiSupportAuto = true;\nexport default Grow;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getSnackbarContentUtilityClass(slot) {\n return generateUtilityClass('MuiSnackbarContent', slot);\n}\nconst snackbarContentClasses = generateUtilityClasses('MuiSnackbarContent', ['root', 'message', 'action']);\nexport default snackbarContentClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"action\", \"className\", \"message\", \"role\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { emphasize } from '@mui/system/colorManipulator';\nimport styled from '../styles/styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport Paper from '../Paper';\nimport { getSnackbarContentUtilityClass } from './snackbarContentClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root'],\n action: ['action'],\n message: ['message']\n };\n return composeClasses(slots, getSnackbarContentUtilityClass, classes);\n};\nconst SnackbarContentRoot = styled(Paper, {\n name: 'MuiSnackbarContent',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})(({\n theme\n}) => {\n const emphasis = theme.palette.mode === 'light' ? 0.8 : 0.98;\n const backgroundColor = emphasize(theme.palette.background.default, emphasis);\n return _extends({}, theme.typography.body2, {\n color: theme.vars ? theme.vars.palette.SnackbarContent.color : theme.palette.getContrastText(backgroundColor),\n backgroundColor: theme.vars ? theme.vars.palette.SnackbarContent.bg : backgroundColor,\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n padding: '6px 16px',\n borderRadius: (theme.vars || theme).shape.borderRadius,\n flexGrow: 1,\n [theme.breakpoints.up('sm')]: {\n flexGrow: 'initial',\n minWidth: 288\n }\n });\n});\nconst SnackbarContentMessage = styled('div', {\n name: 'MuiSnackbarContent',\n slot: 'Message',\n overridesResolver: (props, styles) => styles.message\n})({\n padding: '8px 0'\n});\nconst SnackbarContentAction = styled('div', {\n name: 'MuiSnackbarContent',\n slot: 'Action',\n overridesResolver: (props, styles) => styles.action\n})({\n display: 'flex',\n alignItems: 'center',\n marginLeft: 'auto',\n paddingLeft: 16,\n marginRight: -8\n});\nconst SnackbarContent = /*#__PURE__*/React.forwardRef(function SnackbarContent(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiSnackbarContent'\n });\n const {\n action,\n className,\n message,\n role = 'alert'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = props;\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(SnackbarContentRoot, _extends({\n role: role,\n square: true,\n elevation: 6,\n className: clsx(classes.root, className),\n ownerState: ownerState,\n ref: ref\n }, other, {\n children: [/*#__PURE__*/_jsx(SnackbarContentMessage, {\n className: classes.message,\n ownerState: ownerState,\n children: message\n }), action ? /*#__PURE__*/_jsx(SnackbarContentAction, {\n className: classes.action,\n ownerState: ownerState,\n children: action\n }) : null]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? SnackbarContent.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The action to display. It renders after the message, at the end of the snackbar.\n */\n action: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The message to display.\n */\n message: PropTypes.node,\n /**\n * The ARIA role attribute of the element.\n * @default 'alert'\n */\n role: PropTypes /* @typescript-to-proptypes-ignore */.string,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default SnackbarContent;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getSnackbarUtilityClass(slot) {\n return generateUtilityClass('MuiSnackbar', slot);\n}\nconst snackbarClasses = generateUtilityClasses('MuiSnackbar', ['root', 'anchorOriginTopCenter', 'anchorOriginBottomCenter', 'anchorOriginTopRight', 'anchorOriginBottomRight', 'anchorOriginTopLeft', 'anchorOriginBottomLeft']);\nexport default snackbarClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"onEnter\", \"onExited\"],\n _excluded2 = [\"action\", \"anchorOrigin\", \"autoHideDuration\", \"children\", \"className\", \"ClickAwayListenerProps\", \"ContentProps\", \"disableWindowBlurListener\", \"message\", \"onBlur\", \"onClose\", \"onFocus\", \"onMouseEnter\", \"onMouseLeave\", \"open\", \"resumeHideDuration\", \"TransitionComponent\", \"transitionDuration\", \"TransitionProps\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport composeClasses from '@mui/utils/composeClasses';\nimport useSlotProps from '@mui/utils/useSlotProps';\nimport useSnackbar from './useSnackbar';\nimport ClickAwayListener from '../ClickAwayListener';\nimport { styled, useTheme } from '../styles';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport capitalize from '../utils/capitalize';\nimport Grow from '../Grow';\nimport SnackbarContent from '../SnackbarContent';\nimport { getSnackbarUtilityClass } from './snackbarClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n anchorOrigin\n } = ownerState;\n const slots = {\n root: ['root', `anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}`]\n };\n return composeClasses(slots, getSnackbarUtilityClass, classes);\n};\nconst SnackbarRoot = styled('div', {\n name: 'MuiSnackbar',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[`anchorOrigin${capitalize(ownerState.anchorOrigin.vertical)}${capitalize(ownerState.anchorOrigin.horizontal)}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n const center = {\n left: '50%',\n right: 'auto',\n transform: 'translateX(-50%)'\n };\n return _extends({\n zIndex: (theme.vars || theme).zIndex.snackbar,\n position: 'fixed',\n display: 'flex',\n left: 8,\n right: 8,\n justifyContent: 'center',\n alignItems: 'center'\n }, ownerState.anchorOrigin.vertical === 'top' ? {\n top: 8\n } : {\n bottom: 8\n }, ownerState.anchorOrigin.horizontal === 'left' && {\n justifyContent: 'flex-start'\n }, ownerState.anchorOrigin.horizontal === 'right' && {\n justifyContent: 'flex-end'\n }, {\n [theme.breakpoints.up('sm')]: _extends({}, ownerState.anchorOrigin.vertical === 'top' ? {\n top: 24\n } : {\n bottom: 24\n }, ownerState.anchorOrigin.horizontal === 'center' && center, ownerState.anchorOrigin.horizontal === 'left' && {\n left: 24,\n right: 'auto'\n }, ownerState.anchorOrigin.horizontal === 'right' && {\n right: 24,\n left: 'auto'\n })\n });\n});\nconst Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiSnackbar'\n });\n const theme = useTheme();\n const defaultTransitionDuration = {\n enter: theme.transitions.duration.enteringScreen,\n exit: theme.transitions.duration.leavingScreen\n };\n const {\n action,\n anchorOrigin: {\n vertical,\n horizontal\n } = {\n vertical: 'bottom',\n horizontal: 'left'\n },\n autoHideDuration = null,\n children,\n className,\n ClickAwayListenerProps,\n ContentProps,\n disableWindowBlurListener = false,\n message,\n open,\n TransitionComponent = Grow,\n transitionDuration = defaultTransitionDuration,\n TransitionProps: {\n onEnter,\n onExited\n } = {}\n } = props,\n TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded),\n other = _objectWithoutPropertiesLoose(props, _excluded2);\n const ownerState = _extends({}, props, {\n anchorOrigin: {\n vertical,\n horizontal\n },\n autoHideDuration,\n disableWindowBlurListener,\n TransitionComponent,\n transitionDuration\n });\n const classes = useUtilityClasses(ownerState);\n const {\n getRootProps,\n onClickAway\n } = useSnackbar(_extends({}, ownerState));\n const [exited, setExited] = React.useState(true);\n const rootProps = useSlotProps({\n elementType: SnackbarRoot,\n getSlotProps: getRootProps,\n externalForwardedProps: other,\n ownerState,\n additionalProps: {\n ref\n },\n className: [classes.root, className]\n });\n const handleExited = node => {\n setExited(true);\n if (onExited) {\n onExited(node);\n }\n };\n const handleEnter = (node, isAppearing) => {\n setExited(false);\n if (onEnter) {\n onEnter(node, isAppearing);\n }\n };\n\n // So we only render active snackbars.\n if (!open && exited) {\n return null;\n }\n return /*#__PURE__*/_jsx(ClickAwayListener, _extends({\n onClickAway: onClickAway\n }, ClickAwayListenerProps, {\n children: /*#__PURE__*/_jsx(SnackbarRoot, _extends({}, rootProps, {\n children: /*#__PURE__*/_jsx(TransitionComponent, _extends({\n appear: true,\n in: open,\n timeout: transitionDuration,\n direction: vertical === 'top' ? 'down' : 'up',\n onEnter: handleEnter,\n onExited: handleExited\n }, TransitionProps, {\n children: children || /*#__PURE__*/_jsx(SnackbarContent, _extends({\n message: message,\n action: action\n }, ContentProps))\n }))\n }))\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? Snackbar.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The action to display. It renders after the message, at the end of the snackbar.\n */\n action: PropTypes.node,\n /**\n * The anchor of the `Snackbar`.\n * On smaller screens, the component grows to occupy all the available width,\n * the horizontal alignment is ignored.\n * @default { vertical: 'bottom', horizontal: 'left' }\n */\n anchorOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['center', 'left', 'right']).isRequired,\n vertical: PropTypes.oneOf(['bottom', 'top']).isRequired\n }),\n /**\n * The number of milliseconds to wait before automatically calling the\n * `onClose` function. `onClose` should then set the state of the `open`\n * prop to hide the Snackbar. This behavior is disabled by default with\n * the `null` value.\n * @default null\n */\n autoHideDuration: PropTypes.number,\n /**\n * Replace the `SnackbarContent` component.\n */\n children: PropTypes.element,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * Props applied to the `ClickAwayListener` element.\n */\n ClickAwayListenerProps: PropTypes.object,\n /**\n * Props applied to the [`SnackbarContent`](/material-ui/api/snackbar-content/) element.\n */\n ContentProps: PropTypes.object,\n /**\n * If `true`, the `autoHideDuration` timer will expire even if the window is not focused.\n * @default false\n */\n disableWindowBlurListener: PropTypes.bool,\n /**\n * When displaying multiple consecutive snackbars using a single parent-rendered\n * ``, add the `key` prop to ensure independent treatment of each message.\n * For instance, use ``. Otherwise, messages might update\n * in place, and features like `autoHideDuration` could be affected.\n */\n key: () => null,\n /**\n * The message to display.\n */\n message: PropTypes.node,\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n /**\n * Callback fired when the component requests to be closed.\n * Typically `onClose` is used to set state in the parent component,\n * which is used to control the `Snackbar` `open` prop.\n * The `reason` parameter can optionally be used to control the response to `onClose`,\n * for example ignoring `clickaway`.\n *\n * @param {React.SyntheticEvent | Event} event The event source of the callback.\n * @param {string} reason Can be: `\"timeout\"` (`autoHideDuration` expired), `\"clickaway\"`, or `\"escapeKeyDown\"`.\n */\n onClose: PropTypes.func,\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n /**\n * @ignore\n */\n onMouseEnter: PropTypes.func,\n /**\n * @ignore\n */\n onMouseLeave: PropTypes.func,\n /**\n * If `true`, the component is shown.\n */\n open: PropTypes.bool,\n /**\n * The number of milliseconds to wait before dismissing after user interaction.\n * If `autoHideDuration` prop isn't specified, it does nothing.\n * If `autoHideDuration` prop is specified but `resumeHideDuration` isn't,\n * we default to `autoHideDuration / 2` ms.\n */\n resumeHideDuration: PropTypes.number,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The component used for the transition.\n * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.\n * @default Grow\n */\n TransitionComponent: PropTypes.elementType,\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n * @default {\n * enter: theme.transitions.duration.enteringScreen,\n * exit: theme.transitions.duration.leavingScreen,\n * }\n */\n transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })]),\n /**\n * Props applied to the transition element.\n * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.\n * @default {}\n */\n TransitionProps: PropTypes.object\n} : void 0;\nexport default Snackbar;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"elementType\", \"ownerState\", \"externalForwardedProps\", \"getSlotOwnerState\", \"internalForwardedProps\"],\n _excluded2 = [\"component\", \"slots\", \"slotProps\"],\n _excluded3 = [\"component\"];\nimport useForkRef from '@mui/utils/useForkRef';\nimport appendOwnerState from '@mui/utils/appendOwnerState';\nimport resolveComponentProps from '@mui/utils/resolveComponentProps';\nimport mergeSlotProps from '@mui/utils/mergeSlotProps';\n/**\n * An internal function to create a Material UI slot.\n *\n * This is an advanced version of Base UI `useSlotProps` because Material UI allows leaf component to be customized via `component` prop\n * while Base UI does not need to support leaf component customization.\n *\n * @param {string} name: name of the slot\n * @param {object} parameters\n * @returns {[Slot, slotProps]} The slot's React component and the slot's props\n *\n * Note: the returned slot's props\n * - will never contain `component` prop.\n * - might contain `as` prop.\n */\nexport default function useSlot(\n/**\n * The slot's name. All Material UI components should have `root` slot.\n *\n * If the name is `root`, the logic behaves differently from other slots,\n * e.g. the `externalForwardedProps` are spread to `root` slot but not other slots.\n */\nname, parameters) {\n const {\n className,\n elementType: initialElementType,\n ownerState,\n externalForwardedProps,\n getSlotOwnerState,\n internalForwardedProps\n } = parameters,\n useSlotPropsParams = _objectWithoutPropertiesLoose(parameters, _excluded);\n const {\n component: rootComponent,\n slots = {\n [name]: undefined\n },\n slotProps = {\n [name]: undefined\n }\n } = externalForwardedProps,\n other = _objectWithoutPropertiesLoose(externalForwardedProps, _excluded2);\n const elementType = slots[name] || initialElementType;\n\n // `slotProps[name]` can be a callback that receives the component's ownerState.\n // `resolvedComponentsProps` is always a plain object.\n const resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState);\n const _mergeSlotProps = mergeSlotProps(_extends({\n className\n }, useSlotPropsParams, {\n externalForwardedProps: name === 'root' ? other : undefined,\n externalSlotProps: resolvedComponentsProps\n })),\n {\n props: {\n component: slotComponent\n },\n internalRef\n } = _mergeSlotProps,\n mergedProps = _objectWithoutPropertiesLoose(_mergeSlotProps.props, _excluded3);\n const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, parameters.ref);\n const slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};\n const finalOwnerState = _extends({}, ownerState, slotOwnerState);\n const LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;\n const props = appendOwnerState(elementType, _extends({}, name === 'root' && !rootComponent && !slots[name] && internalForwardedProps, name !== 'root' && !slots[name] && internalForwardedProps, mergedProps, LeafComponent && {\n as: LeafComponent\n }, {\n ref\n }), finalOwnerState);\n Object.keys(slotOwnerState).forEach(propName => {\n delete props[propName];\n });\n return [elementType, props];\n}","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getAlertUtilityClass(slot) {\n return generateUtilityClass('MuiAlert', slot);\n}\nconst alertClasses = generateUtilityClasses('MuiAlert', ['root', 'action', 'icon', 'message', 'filled', 'colorSuccess', 'colorInfo', 'colorWarning', 'colorError', 'filledSuccess', 'filledInfo', 'filledWarning', 'filledError', 'outlined', 'outlinedSuccess', 'outlinedInfo', 'outlinedWarning', 'outlinedError', 'standard', 'standardSuccess', 'standardInfo', 'standardWarning', 'standardError']);\nexport default alertClasses;","'use client';\n\nimport * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z\"\n}), 'SuccessOutlined');","'use client';\n\nimport * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z\"\n}), 'ReportProblemOutlined');","'use client';\n\nimport * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"\n}), 'ErrorOutline');","'use client';\n\nimport * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z\"\n}), 'InfoOutlined');","'use client';\n\nimport * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n\n/**\n * @ignore - internal component.\n *\n * Alias to `Clear`.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"action\", \"children\", \"className\", \"closeText\", \"color\", \"components\", \"componentsProps\", \"icon\", \"iconMapping\", \"onClose\", \"role\", \"severity\", \"slotProps\", \"slots\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { darken, lighten } from '@mui/system/colorManipulator';\nimport { styled } from '../zero-styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport useSlot from '../utils/useSlot';\nimport capitalize from '../utils/capitalize';\nimport Paper from '../Paper';\nimport alertClasses, { getAlertUtilityClass } from './alertClasses';\nimport IconButton from '../IconButton';\nimport SuccessOutlinedIcon from '../internal/svg-icons/SuccessOutlined';\nimport ReportProblemOutlinedIcon from '../internal/svg-icons/ReportProblemOutlined';\nimport ErrorOutlineIcon from '../internal/svg-icons/ErrorOutline';\nimport InfoOutlinedIcon from '../internal/svg-icons/InfoOutlined';\nimport CloseIcon from '../internal/svg-icons/Close';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n variant,\n color,\n severity,\n classes\n } = ownerState;\n const slots = {\n root: ['root', `color${capitalize(color || severity)}`, `${variant}${capitalize(color || severity)}`, `${variant}`],\n icon: ['icon'],\n message: ['message'],\n action: ['action']\n };\n return composeClasses(slots, getAlertUtilityClass, classes);\n};\nconst AlertRoot = styled(Paper, {\n name: 'MuiAlert',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[ownerState.variant], styles[`${ownerState.variant}${capitalize(ownerState.color || ownerState.severity)}`]];\n }\n})(({\n theme\n}) => {\n const getColor = theme.palette.mode === 'light' ? darken : lighten;\n const getBackgroundColor = theme.palette.mode === 'light' ? lighten : darken;\n return _extends({}, theme.typography.body2, {\n backgroundColor: 'transparent',\n display: 'flex',\n padding: '6px 16px',\n variants: [...Object.entries(theme.palette).filter(([, value]) => value.main && value.light).map(([color]) => ({\n props: {\n colorSeverity: color,\n variant: 'standard'\n },\n style: {\n color: theme.vars ? theme.vars.palette.Alert[`${color}Color`] : getColor(theme.palette[color].light, 0.6),\n backgroundColor: theme.vars ? theme.vars.palette.Alert[`${color}StandardBg`] : getBackgroundColor(theme.palette[color].light, 0.9),\n [`& .${alertClasses.icon}`]: theme.vars ? {\n color: theme.vars.palette.Alert[`${color}IconColor`]\n } : {\n color: theme.palette[color].main\n }\n }\n })), ...Object.entries(theme.palette).filter(([, value]) => value.main && value.light).map(([color]) => ({\n props: {\n colorSeverity: color,\n variant: 'outlined'\n },\n style: {\n color: theme.vars ? theme.vars.palette.Alert[`${color}Color`] : getColor(theme.palette[color].light, 0.6),\n border: `1px solid ${(theme.vars || theme).palette[color].light}`,\n [`& .${alertClasses.icon}`]: theme.vars ? {\n color: theme.vars.palette.Alert[`${color}IconColor`]\n } : {\n color: theme.palette[color].main\n }\n }\n })), ...Object.entries(theme.palette).filter(([, value]) => value.main && value.dark).map(([color]) => ({\n props: {\n colorSeverity: color,\n variant: 'filled'\n },\n style: _extends({\n fontWeight: theme.typography.fontWeightMedium\n }, theme.vars ? {\n color: theme.vars.palette.Alert[`${color}FilledColor`],\n backgroundColor: theme.vars.palette.Alert[`${color}FilledBg`]\n } : {\n backgroundColor: theme.palette.mode === 'dark' ? theme.palette[color].dark : theme.palette[color].main,\n color: theme.palette.getContrastText(theme.palette[color].main)\n })\n }))]\n });\n});\nconst AlertIcon = styled('div', {\n name: 'MuiAlert',\n slot: 'Icon',\n overridesResolver: (props, styles) => styles.icon\n})({\n marginRight: 12,\n padding: '7px 0',\n display: 'flex',\n fontSize: 22,\n opacity: 0.9\n});\nconst AlertMessage = styled('div', {\n name: 'MuiAlert',\n slot: 'Message',\n overridesResolver: (props, styles) => styles.message\n})({\n padding: '8px 0',\n minWidth: 0,\n overflow: 'auto'\n});\nconst AlertAction = styled('div', {\n name: 'MuiAlert',\n slot: 'Action',\n overridesResolver: (props, styles) => styles.action\n})({\n display: 'flex',\n alignItems: 'flex-start',\n padding: '4px 0 0 16px',\n marginLeft: 'auto',\n marginRight: -8\n});\nconst defaultIconMapping = {\n success: /*#__PURE__*/_jsx(SuccessOutlinedIcon, {\n fontSize: \"inherit\"\n }),\n warning: /*#__PURE__*/_jsx(ReportProblemOutlinedIcon, {\n fontSize: \"inherit\"\n }),\n error: /*#__PURE__*/_jsx(ErrorOutlineIcon, {\n fontSize: \"inherit\"\n }),\n info: /*#__PURE__*/_jsx(InfoOutlinedIcon, {\n fontSize: \"inherit\"\n })\n};\nconst Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiAlert'\n });\n const {\n action,\n children,\n className,\n closeText = 'Close',\n color,\n components = {},\n componentsProps = {},\n icon,\n iconMapping = defaultIconMapping,\n onClose,\n role = 'alert',\n severity = 'success',\n slotProps = {},\n slots = {},\n variant = 'standard'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n color,\n severity,\n variant,\n colorSeverity: color || severity\n });\n const classes = useUtilityClasses(ownerState);\n const externalForwardedProps = {\n slots: _extends({\n closeButton: components.CloseButton,\n closeIcon: components.CloseIcon\n }, slots),\n slotProps: _extends({}, componentsProps, slotProps)\n };\n const [CloseButtonSlot, closeButtonProps] = useSlot('closeButton', {\n elementType: IconButton,\n externalForwardedProps,\n ownerState\n });\n const [CloseIconSlot, closeIconProps] = useSlot('closeIcon', {\n elementType: CloseIcon,\n externalForwardedProps,\n ownerState\n });\n return /*#__PURE__*/_jsxs(AlertRoot, _extends({\n role: role,\n elevation: 0,\n ownerState: ownerState,\n className: clsx(classes.root, className),\n ref: ref\n }, other, {\n children: [icon !== false ? /*#__PURE__*/_jsx(AlertIcon, {\n ownerState: ownerState,\n className: classes.icon,\n children: icon || iconMapping[severity] || defaultIconMapping[severity]\n }) : null, /*#__PURE__*/_jsx(AlertMessage, {\n ownerState: ownerState,\n className: classes.message,\n children: children\n }), action != null ? /*#__PURE__*/_jsx(AlertAction, {\n ownerState: ownerState,\n className: classes.action,\n children: action\n }) : null, action == null && onClose ? /*#__PURE__*/_jsx(AlertAction, {\n ownerState: ownerState,\n className: classes.action,\n children: /*#__PURE__*/_jsx(CloseButtonSlot, _extends({\n size: \"small\",\n \"aria-label\": closeText,\n title: closeText,\n color: \"inherit\",\n onClick: onClose\n }, closeButtonProps, {\n children: /*#__PURE__*/_jsx(CloseIconSlot, _extends({\n fontSize: \"small\"\n }, closeIconProps))\n }))\n }) : null]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? Alert.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The action to display. It renders after the message, at the end of the alert.\n */\n action: PropTypes.node,\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * Override the default label for the *close popup* icon button.\n *\n * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).\n * @default 'Close'\n */\n closeText: PropTypes.string,\n /**\n * The color of the component. Unless provided, the value is taken from the `severity` prop.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['error', 'info', 'success', 'warning']), PropTypes.string]),\n /**\n * The components used for each slot inside.\n *\n * @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).\n *\n * @default {}\n */\n components: PropTypes.shape({\n CloseButton: PropTypes.elementType,\n CloseIcon: PropTypes.elementType\n }),\n /**\n * The extra props for the slot components.\n * You can override the existing props or add new ones.\n *\n * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).\n *\n * @default {}\n */\n componentsProps: PropTypes.shape({\n closeButton: PropTypes.object,\n closeIcon: PropTypes.object\n }),\n /**\n * Override the icon displayed before the children.\n * Unless provided, the icon is mapped to the value of the `severity` prop.\n * Set to `false` to remove the `icon`.\n */\n icon: PropTypes.node,\n /**\n * The component maps the `severity` prop to a range of different icons,\n * for instance success to ``.\n * If you wish to change this mapping, you can provide your own.\n * Alternatively, you can use the `icon` prop to override the icon displayed.\n */\n iconMapping: PropTypes.shape({\n error: PropTypes.node,\n info: PropTypes.node,\n success: PropTypes.node,\n warning: PropTypes.node\n }),\n /**\n * Callback fired when the component requests to be closed.\n * When provided and no `action` prop is set, a close icon button is displayed that triggers the callback when clicked.\n * @param {React.SyntheticEvent} event The event source of the callback.\n */\n onClose: PropTypes.func,\n /**\n * The ARIA role attribute of the element.\n * @default 'alert'\n */\n role: PropTypes.string,\n /**\n * The severity of the alert. This defines the color and icon used.\n * @default 'success'\n */\n severity: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['error', 'info', 'success', 'warning']), PropTypes.string]),\n /**\n * The props used for each slot inside.\n * @default {}\n */\n slotProps: PropTypes.shape({\n closeButton: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n closeIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n }),\n /**\n * The components used for each slot inside.\n * @default {}\n */\n slots: PropTypes.shape({\n closeButton: PropTypes.elementType,\n closeIcon: PropTypes.elementType\n }),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The variant to use.\n * @default 'standard'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['filled', 'outlined', 'standard']), PropTypes.string])\n} : void 0;\nexport default Alert;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"component\"];\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport styled from '@mui/styled-engine';\nimport styleFunctionSx, { extendSxProp } from './styleFunctionSx';\nimport useTheme from './useTheme';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function createBox(options = {}) {\n const {\n themeId,\n defaultTheme,\n defaultClassName = 'MuiBox-root',\n generateClassName\n } = options;\n const BoxRoot = styled('div', {\n shouldForwardProp: prop => prop !== 'theme' && prop !== 'sx' && prop !== 'as'\n })(styleFunctionSx);\n const Box = /*#__PURE__*/React.forwardRef(function Box(inProps, ref) {\n const theme = useTheme(defaultTheme);\n const _extendSxProp = extendSxProp(inProps),\n {\n className,\n component = 'div'\n } = _extendSxProp,\n other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded);\n return /*#__PURE__*/_jsx(BoxRoot, _extends({\n as: component,\n ref: ref,\n className: clsx(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),\n theme: themeId ? theme[themeId] || theme : theme\n }, other));\n });\n return Box;\n}","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nconst boxClasses = generateUtilityClasses('MuiBox', ['root']);\nexport default boxClasses;","'use client';\n\nimport { createBox } from '@mui/system';\nimport PropTypes from 'prop-types';\nimport { unstable_ClassNameGenerator as ClassNameGenerator } from '../className';\nimport { createTheme } from '../styles';\nimport THEME_ID from '../styles/identifier';\nimport boxClasses from './boxClasses';\nconst defaultTheme = createTheme();\nconst Box = createBox({\n themeId: THEME_ID,\n defaultTheme,\n defaultClassName: boxClasses.root,\n generateClassName: ClassNameGenerator.generate\n});\nprocess.env.NODE_ENV !== \"production\" ? Box.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * @ignore\n */\n children: PropTypes.node,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default Box;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getButtonUtilityClass(slot) {\n return generateUtilityClass('MuiButton', slot);\n}\nconst buttonClasses = generateUtilityClasses('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'textSuccess', 'textError', 'textInfo', 'textWarning', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'outlinedSuccess', 'outlinedError', 'outlinedInfo', 'outlinedWarning', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'containedSuccess', 'containedError', 'containedInfo', 'containedWarning', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorError', 'colorInfo', 'colorWarning', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'icon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);\nexport default buttonClasses;","import * as React from 'react';\n/**\n * @ignore - internal component.\n */\nconst ButtonGroupContext = /*#__PURE__*/React.createContext({});\nif (process.env.NODE_ENV !== 'production') {\n ButtonGroupContext.displayName = 'ButtonGroupContext';\n}\nexport default ButtonGroupContext;","import * as React from 'react';\n/**\n * @ignore - internal component.\n */\nconst ButtonGroupButtonContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== 'production') {\n ButtonGroupButtonContext.displayName = 'ButtonGroupButtonContext';\n}\nexport default ButtonGroupButtonContext;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"children\", \"color\", \"component\", \"className\", \"disabled\", \"disableElevation\", \"disableFocusRipple\", \"endIcon\", \"focusVisibleClassName\", \"fullWidth\", \"size\", \"startIcon\", \"type\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport resolveProps from '@mui/utils/resolveProps';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { alpha } from '@mui/system/colorManipulator';\nimport styled, { rootShouldForwardProp } from '../styles/styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport ButtonBase from '../ButtonBase';\nimport capitalize from '../utils/capitalize';\nimport buttonClasses, { getButtonUtilityClass } from './buttonClasses';\nimport ButtonGroupContext from '../ButtonGroup/ButtonGroupContext';\nimport ButtonGroupButtonContext from '../ButtonGroup/ButtonGroupButtonContext';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n color,\n disableElevation,\n fullWidth,\n size,\n variant,\n classes\n } = ownerState;\n const slots = {\n root: ['root', variant, `${variant}${capitalize(color)}`, `size${capitalize(size)}`, `${variant}Size${capitalize(size)}`, `color${capitalize(color)}`, disableElevation && 'disableElevation', fullWidth && 'fullWidth'],\n label: ['label'],\n startIcon: ['icon', 'startIcon', `iconSize${capitalize(size)}`],\n endIcon: ['icon', 'endIcon', `iconSize${capitalize(size)}`]\n };\n const composedClasses = composeClasses(slots, getButtonUtilityClass, classes);\n return _extends({}, classes, composedClasses);\n};\nconst commonIconStyles = ownerState => _extends({}, ownerState.size === 'small' && {\n '& > *:nth-of-type(1)': {\n fontSize: 18\n }\n}, ownerState.size === 'medium' && {\n '& > *:nth-of-type(1)': {\n fontSize: 20\n }\n}, ownerState.size === 'large' && {\n '& > *:nth-of-type(1)': {\n fontSize: 22\n }\n});\nconst ButtonRoot = styled(ButtonBase, {\n shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',\n name: 'MuiButton',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[ownerState.variant], styles[`${ownerState.variant}${capitalize(ownerState.color)}`], styles[`size${capitalize(ownerState.size)}`], styles[`${ownerState.variant}Size${capitalize(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit, ownerState.disableElevation && styles.disableElevation, ownerState.fullWidth && styles.fullWidth];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$palette$getCon, _theme$palette;\n const inheritContainedBackgroundColor = theme.palette.mode === 'light' ? theme.palette.grey[300] : theme.palette.grey[800];\n const inheritContainedHoverBackgroundColor = theme.palette.mode === 'light' ? theme.palette.grey.A100 : theme.palette.grey[700];\n return _extends({}, theme.typography.button, {\n minWidth: 64,\n padding: '6px 16px',\n borderRadius: (theme.vars || theme).shape.borderRadius,\n transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color', 'color'], {\n duration: theme.transitions.duration.short\n }),\n '&:hover': _extends({\n textDecoration: 'none',\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }, ownerState.variant === 'outlined' && ownerState.color !== 'inherit' && {\n border: `1px solid ${(theme.vars || theme).palette[ownerState.color].main}`,\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }, ownerState.variant === 'contained' && {\n backgroundColor: theme.vars ? theme.vars.palette.Button.inheritContainedHoverBg : inheritContainedHoverBackgroundColor,\n boxShadow: (theme.vars || theme).shadows[4],\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n boxShadow: (theme.vars || theme).shadows[2],\n backgroundColor: (theme.vars || theme).palette.grey[300]\n }\n }, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {\n backgroundColor: (theme.vars || theme).palette[ownerState.color].dark,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: (theme.vars || theme).palette[ownerState.color].main\n }\n }),\n '&:active': _extends({}, ownerState.variant === 'contained' && {\n boxShadow: (theme.vars || theme).shadows[8]\n }),\n [`&.${buttonClasses.focusVisible}`]: _extends({}, ownerState.variant === 'contained' && {\n boxShadow: (theme.vars || theme).shadows[6]\n }),\n [`&.${buttonClasses.disabled}`]: _extends({\n color: (theme.vars || theme).palette.action.disabled\n }, ownerState.variant === 'outlined' && {\n border: `1px solid ${(theme.vars || theme).palette.action.disabledBackground}`\n }, ownerState.variant === 'contained' && {\n color: (theme.vars || theme).palette.action.disabled,\n boxShadow: (theme.vars || theme).shadows[0],\n backgroundColor: (theme.vars || theme).palette.action.disabledBackground\n })\n }, ownerState.variant === 'text' && {\n padding: '6px 8px'\n }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {\n color: (theme.vars || theme).palette[ownerState.color].main\n }, ownerState.variant === 'outlined' && {\n padding: '5px 15px',\n border: '1px solid currentColor'\n }, ownerState.variant === 'outlined' && ownerState.color !== 'inherit' && {\n color: (theme.vars || theme).palette[ownerState.color].main,\n border: theme.vars ? `1px solid rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.5)` : `1px solid ${alpha(theme.palette[ownerState.color].main, 0.5)}`\n }, ownerState.variant === 'contained' && {\n color: theme.vars ?\n // this is safe because grey does not change between default light/dark mode\n theme.vars.palette.text.primary : (_theme$palette$getCon = (_theme$palette = theme.palette).getContrastText) == null ? void 0 : _theme$palette$getCon.call(_theme$palette, theme.palette.grey[300]),\n backgroundColor: theme.vars ? theme.vars.palette.Button.inheritContainedBg : inheritContainedBackgroundColor,\n boxShadow: (theme.vars || theme).shadows[2]\n }, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {\n color: (theme.vars || theme).palette[ownerState.color].contrastText,\n backgroundColor: (theme.vars || theme).palette[ownerState.color].main\n }, ownerState.color === 'inherit' && {\n color: 'inherit',\n borderColor: 'currentColor'\n }, ownerState.size === 'small' && ownerState.variant === 'text' && {\n padding: '4px 5px',\n fontSize: theme.typography.pxToRem(13)\n }, ownerState.size === 'large' && ownerState.variant === 'text' && {\n padding: '8px 11px',\n fontSize: theme.typography.pxToRem(15)\n }, ownerState.size === 'small' && ownerState.variant === 'outlined' && {\n padding: '3px 9px',\n fontSize: theme.typography.pxToRem(13)\n }, ownerState.size === 'large' && ownerState.variant === 'outlined' && {\n padding: '7px 21px',\n fontSize: theme.typography.pxToRem(15)\n }, ownerState.size === 'small' && ownerState.variant === 'contained' && {\n padding: '4px 10px',\n fontSize: theme.typography.pxToRem(13)\n }, ownerState.size === 'large' && ownerState.variant === 'contained' && {\n padding: '8px 22px',\n fontSize: theme.typography.pxToRem(15)\n }, ownerState.fullWidth && {\n width: '100%'\n });\n}, ({\n ownerState\n}) => ownerState.disableElevation && {\n boxShadow: 'none',\n '&:hover': {\n boxShadow: 'none'\n },\n [`&.${buttonClasses.focusVisible}`]: {\n boxShadow: 'none'\n },\n '&:active': {\n boxShadow: 'none'\n },\n [`&.${buttonClasses.disabled}`]: {\n boxShadow: 'none'\n }\n});\nconst ButtonStartIcon = styled('span', {\n name: 'MuiButton',\n slot: 'StartIcon',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.startIcon, styles[`iconSize${capitalize(ownerState.size)}`]];\n }\n})(({\n ownerState\n}) => _extends({\n display: 'inherit',\n marginRight: 8,\n marginLeft: -4\n}, ownerState.size === 'small' && {\n marginLeft: -2\n}, commonIconStyles(ownerState)));\nconst ButtonEndIcon = styled('span', {\n name: 'MuiButton',\n slot: 'EndIcon',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.endIcon, styles[`iconSize${capitalize(ownerState.size)}`]];\n }\n})(({\n ownerState\n}) => _extends({\n display: 'inherit',\n marginRight: -4,\n marginLeft: 8\n}, ownerState.size === 'small' && {\n marginRight: -2\n}, commonIconStyles(ownerState)));\nconst Button = /*#__PURE__*/React.forwardRef(function Button(inProps, ref) {\n // props priority: `inProps` > `contextProps` > `themeDefaultProps`\n const contextProps = React.useContext(ButtonGroupContext);\n const buttonGroupButtonContextPositionClassName = React.useContext(ButtonGroupButtonContext);\n const resolvedProps = resolveProps(contextProps, inProps);\n const props = useDefaultProps({\n props: resolvedProps,\n name: 'MuiButton'\n });\n const {\n children,\n color = 'primary',\n component = 'button',\n className,\n disabled = false,\n disableElevation = false,\n disableFocusRipple = false,\n endIcon: endIconProp,\n focusVisibleClassName,\n fullWidth = false,\n size = 'medium',\n startIcon: startIconProp,\n type,\n variant = 'text'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n color,\n component,\n disabled,\n disableElevation,\n disableFocusRipple,\n fullWidth,\n size,\n type,\n variant\n });\n const classes = useUtilityClasses(ownerState);\n const startIcon = startIconProp && /*#__PURE__*/_jsx(ButtonStartIcon, {\n className: classes.startIcon,\n ownerState: ownerState,\n children: startIconProp\n });\n const endIcon = endIconProp && /*#__PURE__*/_jsx(ButtonEndIcon, {\n className: classes.endIcon,\n ownerState: ownerState,\n children: endIconProp\n });\n const positionClassName = buttonGroupButtonContextPositionClassName || '';\n return /*#__PURE__*/_jsxs(ButtonRoot, _extends({\n ownerState: ownerState,\n className: clsx(contextProps.className, classes.root, className, positionClassName),\n component: component,\n disabled: disabled,\n focusRipple: !disableFocusRipple,\n focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),\n ref: ref,\n type: type\n }, other, {\n classes: classes,\n children: [startIcon, children, endIcon]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? Button.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n * @default 'primary'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'primary', 'secondary', 'success', 'error', 'info', 'warning']), PropTypes.string]),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * If `true`, the component is disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, no elevation is used.\n * @default false\n */\n disableElevation: PropTypes.bool,\n /**\n * If `true`, the keyboard focus ripple is disabled.\n * @default false\n */\n disableFocusRipple: PropTypes.bool,\n /**\n * If `true`, the ripple effect is disabled.\n *\n * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure\n * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.\n * @default false\n */\n disableRipple: PropTypes.bool,\n /**\n * Element placed after the children.\n */\n endIcon: PropTypes.node,\n /**\n * @ignore\n */\n focusVisibleClassName: PropTypes.string,\n /**\n * If `true`, the button will take up the full width of its container.\n * @default false\n */\n fullWidth: PropTypes.bool,\n /**\n * The URL to link to when the button is clicked.\n * If defined, an `a` element will be used as the root node.\n */\n href: PropTypes.string,\n /**\n * The size of the component.\n * `small` is equivalent to the dense button styling.\n * @default 'medium'\n */\n size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['small', 'medium', 'large']), PropTypes.string]),\n /**\n * Element placed before the children.\n */\n startIcon: PropTypes.node,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * @ignore\n */\n type: PropTypes.oneOfType([PropTypes.oneOf(['button', 'reset', 'submit']), PropTypes.string]),\n /**\n * The variant to use.\n * @default 'text'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['contained', 'outlined', 'text']), PropTypes.string])\n} : void 0;\nexport default Button;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getTypographyUtilityClass(slot) {\n return generateUtilityClass('MuiTypography', slot);\n}\nconst typographyClasses = generateUtilityClasses('MuiTypography', ['root', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'inherit', 'button', 'caption', 'overline', 'alignLeft', 'alignRight', 'alignCenter', 'alignJustify', 'noWrap', 'gutterBottom', 'paragraph']);\nexport default typographyClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"align\", \"className\", \"component\", \"gutterBottom\", \"noWrap\", \"paragraph\", \"variant\", \"variantMapping\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { extendSxProp } from '@mui/system/styleFunctionSx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport styled from '../styles/styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport capitalize from '../utils/capitalize';\nimport { getTypographyUtilityClass } from './typographyClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n align,\n gutterBottom,\n noWrap,\n paragraph,\n variant,\n classes\n } = ownerState;\n const slots = {\n root: ['root', variant, ownerState.align !== 'inherit' && `align${capitalize(align)}`, gutterBottom && 'gutterBottom', noWrap && 'noWrap', paragraph && 'paragraph']\n };\n return composeClasses(slots, getTypographyUtilityClass, classes);\n};\nexport const TypographyRoot = styled('span', {\n name: 'MuiTypography',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== 'inherit' && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n margin: 0\n}, ownerState.variant === 'inherit' && {\n // Some elements, like \r\n {/* \r\n Demo Data\r\n */}\r\n \r\n {/* Demo data link styled as clickable text */}\r\n \r\n preview demo data\r\n \r\n
made in ithaca, ny with ❤️
\r\n
V 1.7
\r\n {/*
Release Notes
*/}\r\n
\r\n ) : (\r\n showFileUploadCard && (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n File Upload\r\n \r\n {canClose && (\r\n \r\n \r\n \r\n )}\r\n \r\n\r\n \r\n Manage GeoJSON files here\r\n \r\n\r\n \r\n \r\n {fileList.map((file, index) => (\r\n \r\n \r\n handleRemoveFile(index)}\r\n disabled={isLoading}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ))}\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n Upload\r\n \r\n \r\n {isLoading ? (\r\n \r\n ) : (\r\n \"OK\"\r\n )}\r\n \r\n \r\n \r\n
\r\n )\r\n )}\r\n
\r\n );\r\n}\r\n\r\nexport default FileUploadCard;\r\n","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getDividerUtilityClass(slot) {\n return generateUtilityClass('MuiDivider', slot);\n}\nconst dividerClasses = generateUtilityClasses('MuiDivider', ['root', 'absolute', 'fullWidth', 'inset', 'middle', 'flexItem', 'light', 'vertical', 'withChildren', 'withChildrenVertical', 'textAlignRight', 'textAlignLeft', 'wrapper', 'wrapperVertical']);\nexport default dividerClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"absolute\", \"children\", \"className\", \"component\", \"flexItem\", \"light\", \"orientation\", \"role\", \"textAlign\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { alpha } from '@mui/system/colorManipulator';\nimport styled from '../styles/styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport { getDividerUtilityClass } from './dividerClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n absolute,\n children,\n classes,\n flexItem,\n light,\n orientation,\n textAlign,\n variant\n } = ownerState;\n const slots = {\n root: ['root', absolute && 'absolute', variant, light && 'light', orientation === 'vertical' && 'vertical', flexItem && 'flexItem', children && 'withChildren', children && orientation === 'vertical' && 'withChildrenVertical', textAlign === 'right' && orientation !== 'vertical' && 'textAlignRight', textAlign === 'left' && orientation !== 'vertical' && 'textAlignLeft'],\n wrapper: ['wrapper', orientation === 'vertical' && 'wrapperVertical']\n };\n return composeClasses(slots, getDividerUtilityClass, classes);\n};\nconst DividerRoot = styled('div', {\n name: 'MuiDivider',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.absolute && styles.absolute, styles[ownerState.variant], ownerState.light && styles.light, ownerState.orientation === 'vertical' && styles.vertical, ownerState.flexItem && styles.flexItem, ownerState.children && styles.withChildren, ownerState.children && ownerState.orientation === 'vertical' && styles.withChildrenVertical, ownerState.textAlign === 'right' && ownerState.orientation !== 'vertical' && styles.textAlignRight, ownerState.textAlign === 'left' && ownerState.orientation !== 'vertical' && styles.textAlignLeft];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n margin: 0,\n // Reset browser default style.\n flexShrink: 0,\n borderWidth: 0,\n borderStyle: 'solid',\n borderColor: (theme.vars || theme).palette.divider,\n borderBottomWidth: 'thin'\n}, ownerState.absolute && {\n position: 'absolute',\n bottom: 0,\n left: 0,\n width: '100%'\n}, ownerState.light && {\n borderColor: theme.vars ? `rgba(${theme.vars.palette.dividerChannel} / 0.08)` : alpha(theme.palette.divider, 0.08)\n}, ownerState.variant === 'inset' && {\n marginLeft: 72\n}, ownerState.variant === 'middle' && ownerState.orientation === 'horizontal' && {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2)\n}, ownerState.variant === 'middle' && ownerState.orientation === 'vertical' && {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n}, ownerState.orientation === 'vertical' && {\n height: '100%',\n borderBottomWidth: 0,\n borderRightWidth: 'thin'\n}, ownerState.flexItem && {\n alignSelf: 'stretch',\n height: 'auto'\n}), ({\n ownerState\n}) => _extends({}, ownerState.children && {\n display: 'flex',\n whiteSpace: 'nowrap',\n textAlign: 'center',\n border: 0,\n borderTopStyle: 'solid',\n borderLeftStyle: 'solid',\n '&::before, &::after': {\n content: '\"\"',\n alignSelf: 'center'\n }\n}), ({\n theme,\n ownerState\n}) => _extends({}, ownerState.children && ownerState.orientation !== 'vertical' && {\n '&::before, &::after': {\n width: '100%',\n borderTop: `thin solid ${(theme.vars || theme).palette.divider}`,\n borderTopStyle: 'inherit'\n }\n}), ({\n theme,\n ownerState\n}) => _extends({}, ownerState.children && ownerState.orientation === 'vertical' && {\n flexDirection: 'column',\n '&::before, &::after': {\n height: '100%',\n borderLeft: `thin solid ${(theme.vars || theme).palette.divider}`,\n borderLeftStyle: 'inherit'\n }\n}), ({\n ownerState\n}) => _extends({}, ownerState.textAlign === 'right' && ownerState.orientation !== 'vertical' && {\n '&::before': {\n width: '90%'\n },\n '&::after': {\n width: '10%'\n }\n}, ownerState.textAlign === 'left' && ownerState.orientation !== 'vertical' && {\n '&::before': {\n width: '10%'\n },\n '&::after': {\n width: '90%'\n }\n}));\nconst DividerWrapper = styled('span', {\n name: 'MuiDivider',\n slot: 'Wrapper',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.wrapper, ownerState.orientation === 'vertical' && styles.wrapperVertical];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n display: 'inline-block',\n paddingLeft: `calc(${theme.spacing(1)} * 1.2)`,\n paddingRight: `calc(${theme.spacing(1)} * 1.2)`\n}, ownerState.orientation === 'vertical' && {\n paddingTop: `calc(${theme.spacing(1)} * 1.2)`,\n paddingBottom: `calc(${theme.spacing(1)} * 1.2)`\n}));\nconst Divider = /*#__PURE__*/React.forwardRef(function Divider(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiDivider'\n });\n const {\n absolute = false,\n children,\n className,\n component = children ? 'div' : 'hr',\n flexItem = false,\n light = false,\n orientation = 'horizontal',\n role = component !== 'hr' ? 'separator' : undefined,\n textAlign = 'center',\n variant = 'fullWidth'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n absolute,\n component,\n flexItem,\n light,\n orientation,\n role,\n textAlign,\n variant\n });\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(DividerRoot, _extends({\n as: component,\n className: clsx(classes.root, className),\n role: role,\n ref: ref,\n ownerState: ownerState\n }, other, {\n children: children ? /*#__PURE__*/_jsx(DividerWrapper, {\n className: classes.wrapper,\n ownerState: ownerState,\n children: children\n }) : null\n }));\n});\n\n/**\n * The following flag is used to ensure that this component isn't tabbable i.e.\n * does not get highlight/focus inside of MUI List.\n */\nDivider.muiSkipListHighlight = true;\nprocess.env.NODE_ENV !== \"production\" ? Divider.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * Absolutely position the element.\n * @default false\n */\n absolute: PropTypes.bool,\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * If `true`, a vertical divider will have the correct height when used in flex container.\n * (By default, a vertical divider will have a calculated height of `0px` if it is the child of a flex container.)\n * @default false\n */\n flexItem: PropTypes.bool,\n /**\n * If `true`, the divider will have a lighter color.\n * @default false\n * @deprecated Use (or any opacity or color) instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)\n */\n light: PropTypes.bool,\n /**\n * The component orientation.\n * @default 'horizontal'\n */\n orientation: PropTypes.oneOf(['horizontal', 'vertical']),\n /**\n * @ignore\n */\n role: PropTypes /* @typescript-to-proptypes-ignore */.string,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The text alignment.\n * @default 'center'\n */\n textAlign: PropTypes.oneOf(['center', 'left', 'right']),\n /**\n * The variant to use.\n * @default 'fullWidth'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['fullWidth', 'inset', 'middle']), PropTypes.string])\n} : void 0;\nexport default Divider;","// A change of the browser zoom change the scrollbar size.\n// Credit https://github.com/twbs/bootstrap/blob/488fd8afc535ca3a6ad4dc581f5e89217b6a36ac/js/src/util/scrollbar.js#L14-L18\nexport default function getScrollbarSize(doc) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = doc.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n}","import getScrollbarSize from '@mui/utils/getScrollbarSize';\nexport default getScrollbarSize;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"actions\", \"autoFocus\", \"autoFocusItem\", \"children\", \"className\", \"disabledItemsFocusable\", \"disableListWrap\", \"onKeyDown\", \"variant\"];\nimport * as React from 'react';\nimport { isFragment } from 'react-is';\nimport PropTypes from 'prop-types';\nimport ownerDocument from '../utils/ownerDocument';\nimport List from '../List';\nimport getScrollbarSize from '../utils/getScrollbarSize';\nimport useForkRef from '../utils/useForkRef';\nimport useEnhancedEffect from '../utils/useEnhancedEffect';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction nextItem(list, item, disableListWrap) {\n if (list === item) {\n return list.firstChild;\n }\n if (item && item.nextElementSibling) {\n return item.nextElementSibling;\n }\n return disableListWrap ? null : list.firstChild;\n}\nfunction previousItem(list, item, disableListWrap) {\n if (list === item) {\n return disableListWrap ? list.firstChild : list.lastChild;\n }\n if (item && item.previousElementSibling) {\n return item.previousElementSibling;\n }\n return disableListWrap ? null : list.lastChild;\n}\nfunction textCriteriaMatches(nextFocus, textCriteria) {\n if (textCriteria === undefined) {\n return true;\n }\n let text = nextFocus.innerText;\n if (text === undefined) {\n // jsdom doesn't support innerText\n text = nextFocus.textContent;\n }\n text = text.trim().toLowerCase();\n if (text.length === 0) {\n return false;\n }\n if (textCriteria.repeating) {\n return text[0] === textCriteria.keys[0];\n }\n return text.indexOf(textCriteria.keys.join('')) === 0;\n}\nfunction moveFocus(list, currentFocus, disableListWrap, disabledItemsFocusable, traversalFunction, textCriteria) {\n let wrappedOnce = false;\n let nextFocus = traversalFunction(list, currentFocus, currentFocus ? disableListWrap : false);\n while (nextFocus) {\n // Prevent infinite loop.\n if (nextFocus === list.firstChild) {\n if (wrappedOnce) {\n return false;\n }\n wrappedOnce = true;\n }\n\n // Same logic as useAutocomplete.js\n const nextFocusDisabled = disabledItemsFocusable ? false : nextFocus.disabled || nextFocus.getAttribute('aria-disabled') === 'true';\n if (!nextFocus.hasAttribute('tabindex') || !textCriteriaMatches(nextFocus, textCriteria) || nextFocusDisabled) {\n // Move to the next element.\n nextFocus = traversalFunction(list, nextFocus, disableListWrap);\n } else {\n nextFocus.focus();\n return true;\n }\n }\n return false;\n}\n\n/**\n * A permanently displayed menu following https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/.\n * It's exposed to help customization of the [`Menu`](/material-ui/api/menu/) component if you\n * use it separately you need to move focus into the component manually. Once\n * the focus is placed inside the component it is fully keyboard accessible.\n */\nconst MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {\n const {\n // private\n // eslint-disable-next-line react/prop-types\n actions,\n autoFocus = false,\n autoFocusItem = false,\n children,\n className,\n disabledItemsFocusable = false,\n disableListWrap = false,\n onKeyDown,\n variant = 'selectedMenu'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const listRef = React.useRef(null);\n const textCriteriaRef = React.useRef({\n keys: [],\n repeating: true,\n previousKeyMatched: true,\n lastTime: null\n });\n useEnhancedEffect(() => {\n if (autoFocus) {\n listRef.current.focus();\n }\n }, [autoFocus]);\n React.useImperativeHandle(actions, () => ({\n adjustStyleForScrollbar: (containerElement, {\n direction\n }) => {\n // Let's ignore that piece of logic if users are already overriding the width\n // of the menu.\n const noExplicitWidth = !listRef.current.style.width;\n if (containerElement.clientHeight < listRef.current.clientHeight && noExplicitWidth) {\n const scrollbarSize = `${getScrollbarSize(ownerDocument(containerElement))}px`;\n listRef.current.style[direction === 'rtl' ? 'paddingLeft' : 'paddingRight'] = scrollbarSize;\n listRef.current.style.width = `calc(100% + ${scrollbarSize})`;\n }\n return listRef.current;\n }\n }), []);\n const handleKeyDown = event => {\n const list = listRef.current;\n const key = event.key;\n /**\n * @type {Element} - will always be defined since we are in a keydown handler\n * attached to an element. A keydown event is either dispatched to the activeElement\n * or document.body or document.documentElement. Only the first case will\n * trigger this specific handler.\n */\n const currentFocus = ownerDocument(list).activeElement;\n if (key === 'ArrowDown') {\n // Prevent scroll of the page\n event.preventDefault();\n moveFocus(list, currentFocus, disableListWrap, disabledItemsFocusable, nextItem);\n } else if (key === 'ArrowUp') {\n event.preventDefault();\n moveFocus(list, currentFocus, disableListWrap, disabledItemsFocusable, previousItem);\n } else if (key === 'Home') {\n event.preventDefault();\n moveFocus(list, null, disableListWrap, disabledItemsFocusable, nextItem);\n } else if (key === 'End') {\n event.preventDefault();\n moveFocus(list, null, disableListWrap, disabledItemsFocusable, previousItem);\n } else if (key.length === 1) {\n const criteria = textCriteriaRef.current;\n const lowerKey = key.toLowerCase();\n const currTime = performance.now();\n if (criteria.keys.length > 0) {\n // Reset\n if (currTime - criteria.lastTime > 500) {\n criteria.keys = [];\n criteria.repeating = true;\n criteria.previousKeyMatched = true;\n } else if (criteria.repeating && lowerKey !== criteria.keys[0]) {\n criteria.repeating = false;\n }\n }\n criteria.lastTime = currTime;\n criteria.keys.push(lowerKey);\n const keepFocusOnCurrent = currentFocus && !criteria.repeating && textCriteriaMatches(currentFocus, criteria);\n if (criteria.previousKeyMatched && (keepFocusOnCurrent || moveFocus(list, currentFocus, false, disabledItemsFocusable, nextItem, criteria))) {\n event.preventDefault();\n } else {\n criteria.previousKeyMatched = false;\n }\n }\n if (onKeyDown) {\n onKeyDown(event);\n }\n };\n const handleRef = useForkRef(listRef, ref);\n\n /**\n * the index of the item should receive focus\n * in a `variant=\"selectedMenu\"` it's the first `selected` item\n * otherwise it's the very first item.\n */\n let activeItemIndex = -1;\n // since we inject focus related props into children we have to do a lookahead\n // to check if there is a `selected` item. We're looking for the last `selected`\n // item and use the first valid item as a fallback\n React.Children.forEach(children, (child, index) => {\n if (! /*#__PURE__*/React.isValidElement(child)) {\n if (activeItemIndex === index) {\n activeItemIndex += 1;\n if (activeItemIndex >= children.length) {\n // there are no focusable items within the list.\n activeItemIndex = -1;\n }\n }\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (isFragment(child)) {\n console.error([\"MUI: The Menu component doesn't accept a Fragment as a child.\", 'Consider providing an array instead.'].join('\\n'));\n }\n }\n if (!child.props.disabled) {\n if (variant === 'selectedMenu' && child.props.selected) {\n activeItemIndex = index;\n } else if (activeItemIndex === -1) {\n activeItemIndex = index;\n }\n }\n if (activeItemIndex === index && (child.props.disabled || child.props.muiSkipListHighlight || child.type.muiSkipListHighlight)) {\n activeItemIndex += 1;\n if (activeItemIndex >= children.length) {\n // there are no focusable items within the list.\n activeItemIndex = -1;\n }\n }\n });\n const items = React.Children.map(children, (child, index) => {\n if (index === activeItemIndex) {\n const newChildProps = {};\n if (autoFocusItem) {\n newChildProps.autoFocus = true;\n }\n if (child.props.tabIndex === undefined && variant === 'selectedMenu') {\n newChildProps.tabIndex = 0;\n }\n return /*#__PURE__*/React.cloneElement(child, newChildProps);\n }\n return child;\n });\n return /*#__PURE__*/_jsx(List, _extends({\n role: \"menu\",\n ref: handleRef,\n className: className,\n onKeyDown: handleKeyDown,\n tabIndex: autoFocus ? 0 : -1\n }, other, {\n children: items\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? MenuList.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * If `true`, will focus the `[role=\"menu\"]` container and move into tab order.\n * @default false\n */\n autoFocus: PropTypes.bool,\n /**\n * If `true`, will focus the first menuitem if `variant=\"menu\"` or selected item\n * if `variant=\"selectedMenu\"`.\n * @default false\n */\n autoFocusItem: PropTypes.bool,\n /**\n * MenuList contents, normally `MenuItem`s.\n */\n children: PropTypes.node,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * If `true`, will allow focus on disabled items.\n * @default false\n */\n disabledItemsFocusable: PropTypes.bool,\n /**\n * If `true`, the menu items will not wrap focus.\n * @default false\n */\n disableListWrap: PropTypes.bool,\n /**\n * @ignore\n */\n onKeyDown: PropTypes.func,\n /**\n * The variant to use. Use `menu` to prevent selected items from impacting the initial focus\n * and the vertical alignment relative to the anchor element.\n * @default 'selectedMenu'\n */\n variant: PropTypes.oneOf(['menu', 'selectedMenu'])\n} : void 0;\nexport default MenuList;","'use client';\n\n/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex */\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp, elementAcceptingRef, unstable_useForkRef as useForkRef, unstable_ownerDocument as ownerDocument } from '@mui/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n// Inspired by https://github.com/focus-trap/tabbable\nconst candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable=\"false\"])'].join(',');\nfunction getTabIndex(node) {\n const tabindexAttr = parseInt(node.getAttribute('tabindex') || '', 10);\n if (!Number.isNaN(tabindexAttr)) {\n return tabindexAttr;\n }\n\n // Browsers do not return `tabIndex` correctly for contentEditable nodes;\n // https://bugs.chromium.org/p/chromium/issues/detail?id=661108&q=contenteditable%20tabindex&can=2\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n // in Chrome,
,