diff --git a/assets/backend_bg.wasm b/assets/backend_bg.wasm index 256639a..130b4a4 100644 Binary files a/assets/backend_bg.wasm and b/assets/backend_bg.wasm differ diff --git a/assets/index-38804ddd.css b/assets/index-78fdc93e.css similarity index 95% rename from assets/index-38804ddd.css rename to assets/index-78fdc93e.css index e48cec0..5bd70c2 100644 --- a/assets/index-38804ddd.css +++ b/assets/index-78fdc93e.css @@ -1,4 +1,4 @@ @charset "UTF-8";/*! * Pico CSS ✨ v2.0.3 (https://picocss.com) * Copyright 2019-2024 - Licensed under MIT -*/:root{--pico-font-family-emoji:"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--pico-font-family-sans-serif:system-ui,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,Helvetica,Arial,"Helvetica Neue",sans-serif,var(--pico-font-family-emoji);--pico-font-family-monospace:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace,var(--pico-font-family-emoji);--pico-font-family:var(--pico-font-family-sans-serif);--pico-line-height:1.5;--pico-font-weight:400;--pico-font-size:100%;--pico-text-underline-offset:.1rem;--pico-border-radius:.25rem;--pico-border-width:.0625rem;--pico-outline-width:.125rem;--pico-transition:.2s ease-in-out;--pico-spacing:1rem;--pico-typography-spacing-vertical:1rem;--pico-block-spacing-vertical:var(--pico-spacing);--pico-block-spacing-horizontal:var(--pico-spacing);--pico-grid-column-gap:var(--pico-spacing);--pico-grid-row-gap:var(--pico-spacing);--pico-form-element-spacing-vertical:.75rem;--pico-form-element-spacing-horizontal:1rem;--pico-group-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-primary-focus);--pico-group-box-shadow-focus-with-input:0 0 0 .0625rem var(--pico-form-element-border-color);--pico-modal-overlay-backdrop-filter:blur(.375rem);--pico-nav-element-spacing-vertical:1rem;--pico-nav-element-spacing-horizontal:.5rem;--pico-nav-link-spacing-vertical:.5rem;--pico-nav-link-spacing-horizontal:.5rem;--pico-nav-breadcrumb-divider:">";--pico-icon-checkbox:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-minus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");--pico-icon-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-date:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");--pico-icon-time:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-search:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");--pico-icon-close:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");--pico-icon-loading:url("data:image/svg+xml,%3Csvg fill='none' height='24' width='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' %3E%3Cstyle%3E g %7B animation: rotate 2s linear infinite; transform-origin: center center; %7D circle %7B stroke-dasharray: 75,100; stroke-dashoffset: -5; animation: dash 1.5s ease-in-out infinite; stroke-linecap: round; %7D @keyframes rotate %7B 0%25 %7B transform: rotate(0deg); %7D 100%25 %7B transform: rotate(360deg); %7D %7D @keyframes dash %7B 0%25 %7B stroke-dasharray: 1,100; stroke-dashoffset: 0; %7D 50%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -17.5; %7D 100%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -62; %7D %7D %3C/style%3E%3Cg%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='rgb(136, 145, 164)' stroke-width='4' /%3E%3C/g%3E%3C/svg%3E")}@media (min-width:576px){:root{--pico-font-size:106.25%}}@media (min-width:768px){:root{--pico-font-size:112.5%}}@media (min-width:1024px){:root{--pico-font-size:118.75%}}@media (min-width:1280px){:root{--pico-font-size:125%}}@media (min-width:1536px){:root{--pico-font-size:131.25%}}a,a.contrast,a.secondary{--pico-text-decoration:underline}small{--pico-font-size:.875em}h1,h2,h3,h4,h5,h6{--pico-font-weight:700}h1{--pico-font-size:2rem;--pico-line-height:1.125;--pico-typography-spacing-top:3rem}h2{--pico-font-size:1.75rem;--pico-line-height:1.15;--pico-typography-spacing-top:2.625rem}h3{--pico-font-size:1.5rem;--pico-line-height:1.175;--pico-typography-spacing-top:2.25rem}h4{--pico-font-size:1.25rem;--pico-line-height:1.2;--pico-typography-spacing-top:1.874rem}h5{--pico-font-size:1.125rem;--pico-line-height:1.225;--pico-typography-spacing-top:1.6875rem}h6{--pico-font-size:1rem;--pico-line-height:1.25;--pico-typography-spacing-top:1.5rem}tfoot td,tfoot th,thead td,thead th{--pico-font-weight:600;--pico-border-width:.1875rem}code,kbd,pre,samp{--pico-font-family:var(--pico-font-family-monospace)}kbd{--pico-font-weight:bolder}:where(select,textarea),input:not([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-outline-width:.0625rem}[type=search]{--pico-border-radius:5rem}[type=checkbox],[type=radio]{--pico-border-width:.125rem}[type=checkbox][role=switch]{--pico-border-width:.1875rem}details.dropdown summary:not([role=button]){--pico-outline-width:.0625rem}nav details.dropdown summary:focus-visible{--pico-outline-width:.125rem}[role=search]{--pico-border-radius:5rem}[role=group]:has(button.secondary:focus,[type=submit].secondary:focus,[type=button].secondary:focus,[role=button].secondary:focus),[role=search]:has(button.secondary:focus,[type=submit].secondary:focus,[type=button].secondary:focus,[role=button].secondary:focus){--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}[role=group]:has(button.contrast:focus,[type=submit].contrast:focus,[type=button].contrast:focus,[role=button].contrast:focus),[role=search]:has(button.contrast:focus,[type=submit].contrast:focus,[type=button].contrast:focus,[role=button].contrast:focus){--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-contrast-focus)}[role=group] [role=button],[role=group] [type=button],[role=group] [type=submit],[role=group] button,[role=search] [role=button],[role=search] [type=button],[role=search] [type=submit],[role=search] button{--pico-form-element-spacing-horizontal:2rem}details summary[role=button]:not(.outline):after{filter:brightness(0) invert(1)}[aria-busy=true]:not(input,select,textarea):is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0) invert(1)}:root:not([data-theme=dark]),[data-theme=light]{--pico-background-color:#fff;--pico-color:#373c44;--pico-text-selection-color:rgba(0, 166, 110, .25);--pico-muted-color:#646b79;--pico-muted-border-color:#e7eaf0;--pico-primary:#007a50;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 122, 80, .5);--pico-primary-hover:#005f3d;--pico-primary-hover-background:#006d46;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 166, 110, .5);--pico-primary-inverse:#fff;--pico-secondary:#5d6b89;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(93, 107, 137, .5);--pico-secondary-hover:#48536b;--pico-secondary-hover-background:#48536b;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(93, 107, 137, .25);--pico-secondary-inverse:#fff;--pico-contrast:#181c25;--pico-contrast-background:#181c25;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(24, 28, 37, .5);--pico-contrast-hover:#000;--pico-contrast-hover-background:#000;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-secondary-hover);--pico-contrast-focus:rgba(93, 107, 137, .25);--pico-contrast-inverse:#fff;--pico-box-shadow:.0145rem .029rem .174rem rgba(129, 145, 181, .01698),.0335rem .067rem .402rem rgba(129, 145, 181, .024),.0625rem .125rem .75rem rgba(129, 145, 181, .03),.1125rem .225rem 1.35rem rgba(129, 145, 181, .036),.2085rem .417rem 2.502rem rgba(129, 145, 181, .04302),.5rem 1rem 6rem rgba(129, 145, 181, .06),0 0 0 .0625rem rgba(129, 145, 181, .015);--pico-h1-color:#2d3138;--pico-h2-color:#373c44;--pico-h3-color:#424751;--pico-h4-color:#4d535e;--pico-h5-color:#5c6370;--pico-h6-color:#646b79;--pico-mark-background-color:#fde7c0;--pico-mark-color:#0f1114;--pico-ins-color:#1d6a54;--pico-del-color:#883935;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#f3f5f7;--pico-code-color:#646b79;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#fbfcfc;--pico-form-element-selected-background-color:#dfe3eb;--pico-form-element-border-color:#cfd5e2;--pico-form-element-color:#23262c;--pico-form-element-placeholder-color:var(--pico-muted-color);--pico-form-element-active-background-color:#fff;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#b86a6b;--pico-form-element-invalid-active-border-color:#c84f48;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#4c9b8a;--pico-form-element-valid-active-border-color:#279977;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#bfc7d9;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#dfe3eb;--pico-range-active-border-color:#bfc7d9;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:var(--pico-background-color);--pico-card-border-color:var(--pico-muted-border-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#fbfcfc;--pico-dropdown-background-color:#fff;--pico-dropdown-border-color:#eff1f4;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#eff1f4;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(232, 234, 237, .75);--pico-progress-background-color:#dfe3eb;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(76, 155, 138)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(200, 79, 72)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:light}:root:not([data-theme=dark]) input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]),[data-theme=light] input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}@media only screen and (prefers-color-scheme:dark){:root:not([data-theme]){--pico-background-color:#13171f;--pico-color:#c2c7d0;--pico-text-selection-color:rgba(0, 180, 120, .1875);--pico-muted-color:#7b8495;--pico-muted-border-color:#202632;--pico-primary:#00b478;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 180, 120, .5);--pico-primary-hover:#00cc88;--pico-primary-hover-background:#00895a;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 180, 120, .375);--pico-primary-inverse:#fff;--pico-secondary:#969eaf;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(150, 158, 175, .5);--pico-secondary-hover:#b3b9c5;--pico-secondary-hover-background:#5d6b89;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(144, 158, 190, .25);--pico-secondary-inverse:#fff;--pico-contrast:#dfe3eb;--pico-contrast-background:#eff1f4;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(223, 227, 235, .5);--pico-contrast-hover:#fff;--pico-contrast-hover-background:#fff;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-contrast-hover);--pico-contrast-focus:rgba(207, 213, 226, .25);--pico-contrast-inverse:#000;--pico-box-shadow:.0145rem .029rem .174rem rgba(7, 9, 12, .01698),.0335rem .067rem .402rem rgba(7, 9, 12, .024),.0625rem .125rem .75rem rgba(7, 9, 12, .03),.1125rem .225rem 1.35rem rgba(7, 9, 12, .036),.2085rem .417rem 2.502rem rgba(7, 9, 12, .04302),.5rem 1rem 6rem rgba(7, 9, 12, .06),0 0 0 .0625rem rgba(7, 9, 12, .015);--pico-h1-color:#f0f1f3;--pico-h2-color:#e0e3e7;--pico-h3-color:#c2c7d0;--pico-h4-color:#b3b9c5;--pico-h5-color:#a4acba;--pico-h6-color:#8891a4;--pico-mark-background-color:#014063;--pico-mark-color:#fff;--pico-ins-color:#62af9a;--pico-del-color:#ce7e7b;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#1a1f28;--pico-code-color:#8891a4;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#1c212c;--pico-form-element-selected-background-color:#2a3140;--pico-form-element-border-color:#2a3140;--pico-form-element-color:#e0e3e7;--pico-form-element-placeholder-color:#8891a4;--pico-form-element-active-background-color:#1a1f28;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#964a50;--pico-form-element-invalid-active-border-color:#b7403b;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#2a7b6f;--pico-form-element-valid-active-border-color:#16896a;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#333c4e;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#202632;--pico-range-active-border-color:#2a3140;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:#181c25;--pico-card-border-color:var(--pico-card-background-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#1a1f28;--pico-dropdown-background-color:#181c25;--pico-dropdown-border-color:#202632;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#202632;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(8, 9, 10, .75);--pico-progress-background-color:#202632;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(42, 123, 111)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(150, 74, 80)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:dark}:root:not([data-theme]) input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}:root:not([data-theme]) details summary[role=button].contrast:not(.outline):after{filter:brightness(0)}:root:not([data-theme]) [aria-busy=true]:not(input,select,textarea).contrast:is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0)}}[data-theme=dark]{--pico-background-color:#13171f;--pico-color:#c2c7d0;--pico-text-selection-color:rgba(0, 180, 120, .1875);--pico-muted-color:#7b8495;--pico-muted-border-color:#202632;--pico-primary:#00b478;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 180, 120, .5);--pico-primary-hover:#00cc88;--pico-primary-hover-background:#00895a;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 180, 120, .375);--pico-primary-inverse:#fff;--pico-secondary:#969eaf;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(150, 158, 175, .5);--pico-secondary-hover:#b3b9c5;--pico-secondary-hover-background:#5d6b89;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(144, 158, 190, .25);--pico-secondary-inverse:#fff;--pico-contrast:#dfe3eb;--pico-contrast-background:#eff1f4;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(223, 227, 235, .5);--pico-contrast-hover:#fff;--pico-contrast-hover-background:#fff;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-contrast-hover);--pico-contrast-focus:rgba(207, 213, 226, .25);--pico-contrast-inverse:#000;--pico-box-shadow:.0145rem .029rem .174rem rgba(7, 9, 12, .01698),.0335rem .067rem .402rem rgba(7, 9, 12, .024),.0625rem .125rem .75rem rgba(7, 9, 12, .03),.1125rem .225rem 1.35rem rgba(7, 9, 12, .036),.2085rem .417rem 2.502rem rgba(7, 9, 12, .04302),.5rem 1rem 6rem rgba(7, 9, 12, .06),0 0 0 .0625rem rgba(7, 9, 12, .015);--pico-h1-color:#f0f1f3;--pico-h2-color:#e0e3e7;--pico-h3-color:#c2c7d0;--pico-h4-color:#b3b9c5;--pico-h5-color:#a4acba;--pico-h6-color:#8891a4;--pico-mark-background-color:#014063;--pico-mark-color:#fff;--pico-ins-color:#62af9a;--pico-del-color:#ce7e7b;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#1a1f28;--pico-code-color:#8891a4;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#1c212c;--pico-form-element-selected-background-color:#2a3140;--pico-form-element-border-color:#2a3140;--pico-form-element-color:#e0e3e7;--pico-form-element-placeholder-color:#8891a4;--pico-form-element-active-background-color:#1a1f28;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#964a50;--pico-form-element-invalid-active-border-color:#b7403b;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#2a7b6f;--pico-form-element-valid-active-border-color:#16896a;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#333c4e;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#202632;--pico-range-active-border-color:#2a3140;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:#181c25;--pico-card-border-color:var(--pico-card-background-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#1a1f28;--pico-dropdown-background-color:#181c25;--pico-dropdown-border-color:#202632;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#202632;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(8, 9, 10, .75);--pico-progress-background-color:#202632;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(42, 123, 111)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(150, 74, 80)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:dark}[data-theme=dark] input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}[data-theme=dark] details summary[role=button].contrast:not(.outline):after{filter:brightness(0)}[data-theme=dark] [aria-busy=true]:not(input,select,textarea).contrast:is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0)}[type=checkbox],[type=radio],[type=range],progress{accent-color:var(--pico-primary)}*,:after,:before{box-sizing:border-box;background-repeat:no-repeat}:after,:before{text-decoration:inherit;vertical-align:inherit}:where(:root){-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--pico-background-color);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:var(--pico-font-size);line-height:var(--pico-line-height);font-family:var(--pico-font-family);text-underline-offset:var(--pico-text-underline-offset);text-rendering:optimizeLegibility;overflow-wrap:break-word;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{width:100%;margin:0}main{display:block}body>footer,body>header,body>main{padding-block:var(--pico-block-spacing-vertical)}section{margin-bottom:var(--pico-block-spacing-vertical)}.container,.container-fluid{width:100%;margin-right:auto;margin-left:auto;padding-right:var(--pico-spacing);padding-left:var(--pico-spacing)}@media (min-width:576px){.container{max-width:510px;padding-right:0;padding-left:0}}@media (min-width:768px){.container{max-width:700px}}@media (min-width:1024px){.container{max-width:950px}}@media (min-width:1280px){.container{max-width:1200px}}@media (min-width:1536px){.container{max-width:1450px}}.grid{grid-column-gap:var(--pico-grid-column-gap);grid-row-gap:var(--pico-grid-row-gap);display:grid;grid-template-columns:1fr}@media (min-width:768px){.grid{grid-template-columns:repeat(auto-fit,minmax(0%,1fr))}}.grid>*{min-width:0}.overflow-auto{overflow:auto}b,strong{font-weight:bolder}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}address,blockquote,dl,ol,p,pre,table,ul{margin-top:0;margin-bottom:var(--pico-typography-spacing-vertical);color:var(--pico-color);font-style:normal;font-weight:var(--pico-font-weight)}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:var(--pico-typography-spacing-vertical);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:var(--pico-font-size);line-height:var(--pico-line-height);font-family:var(--pico-font-family)}h1{--pico-color:var(--pico-h1-color)}h2{--pico-color:var(--pico-h2-color)}h3{--pico-color:var(--pico-h3-color)}h4{--pico-color:var(--pico-h4-color)}h5{--pico-color:var(--pico-h5-color)}h6{--pico-color:var(--pico-h6-color)}:where(article,address,blockquote,dl,figure,form,ol,p,pre,table,ul)~:is(h1,h2,h3,h4,h5,h6){margin-top:var(--pico-typography-spacing-top)}p{margin-bottom:var(--pico-typography-spacing-vertical)}hgroup{margin-bottom:var(--pico-typography-spacing-vertical)}hgroup>*{margin-top:0;margin-bottom:0}hgroup>:not(:first-child):last-child{--pico-color:var(--pico-muted-color);--pico-font-weight:unset;font-size:1rem}:where(ol,ul) li{margin-bottom:calc(var(--pico-typography-spacing-vertical) * .25)}:where(dl,ol,ul) :where(dl,ol,ul){margin:0;margin-top:calc(var(--pico-typography-spacing-vertical) * .25)}ul li{list-style:square}mark{padding:.125rem .25rem;background-color:var(--pico-mark-background-color);color:var(--pico-mark-color);vertical-align:baseline}blockquote{display:block;margin:var(--pico-typography-spacing-vertical) 0;padding:var(--pico-spacing);border-right:none;border-left:.25rem solid var(--pico-blockquote-border-color);border-inline-start:.25rem solid var(--pico-blockquote-border-color);border-inline-end:none}blockquote footer{margin-top:calc(var(--pico-typography-spacing-vertical) * .5);color:var(--pico-blockquote-footer-color)}abbr[title]{border-bottom:1px dotted;text-decoration:none;cursor:help}ins{color:var(--pico-ins-color);text-decoration:none}del{color:var(--pico-del-color)}::-moz-selection{background-color:var(--pico-text-selection-color)}::selection{background-color:var(--pico-text-selection-color)}:where(a:not([role=button])),[role=link]{--pico-color:var(--pico-primary);--pico-background-color:transparent;--pico-underline:var(--pico-primary-underline);outline:0;background-color:var(--pico-background-color);color:var(--pico-color);-webkit-text-decoration:var(--pico-text-decoration);text-decoration:var(--pico-text-decoration);text-decoration-color:var(--pico-underline);text-underline-offset:.125em;transition:background-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition),-webkit-text-decoration var(--pico-transition);transition:background-color var(--pico-transition),color var(--pico-transition),text-decoration var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),color var(--pico-transition),text-decoration var(--pico-transition),box-shadow var(--pico-transition),-webkit-text-decoration var(--pico-transition)}:where(a:not([role=button])):is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-primary-hover);--pico-underline:var(--pico-primary-hover-underline);--pico-text-decoration:underline}:where(a:not([role=button])):focus-visible,[role=link]:focus-visible{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}:where(a:not([role=button])).secondary,[role=link].secondary{--pico-color:var(--pico-secondary);--pico-underline:var(--pico-secondary-underline)}:where(a:not([role=button])).secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link].secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-secondary-hover);--pico-underline:var(--pico-secondary-hover-underline)}:where(a:not([role=button])).contrast,[role=link].contrast{--pico-color:var(--pico-contrast);--pico-underline:var(--pico-contrast-underline)}:where(a:not([role=button])).contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link].contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-contrast-hover);--pico-underline:var(--pico-contrast-hover-underline)}a[role=button]{display:inline-block}button{margin:0;overflow:visible;font-family:inherit;text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[role=button],[type=button],[type=file]::file-selector-button,[type=reset],[type=submit],button{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);--pico-color:var(--pico-primary-inverse);--pico-box-shadow:var(--pico-button-box-shadow, 0 0 0 rgba(0, 0, 0, 0));padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);border:var(--pico-border-width) solid var(--pico-border-color);border-radius:var(--pico-border-radius);outline:0;background-color:var(--pico-background-color);box-shadow:var(--pico-box-shadow);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:1rem;line-height:var(--pico-line-height);text-align:center;text-decoration:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}[role=button]:is(:hover,:active,:focus),[role=button]:is([aria-current]:not([aria-current=false])),[type=button]:is(:hover,:active,:focus),[type=button]:is([aria-current]:not([aria-current=false])),[type=file]::file-selector-button:is(:hover,:active,:focus),[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])),[type=reset]:is(:hover,:active,:focus),[type=reset]:is([aria-current]:not([aria-current=false])),[type=submit]:is(:hover,:active,:focus),[type=submit]:is([aria-current]:not([aria-current=false])),button:is(:hover,:active,:focus),button:is([aria-current]:not([aria-current=false])){--pico-background-color:var(--pico-primary-hover-background);--pico-border-color:var(--pico-primary-hover-border);--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0));--pico-color:var(--pico-primary-inverse)}[role=button]:focus,[role=button]:is([aria-current]:not([aria-current=false])):focus,[type=button]:focus,[type=button]:is([aria-current]:not([aria-current=false])):focus,[type=file]::file-selector-button:focus,[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])):focus,[type=reset]:focus,[type=reset]:is([aria-current]:not([aria-current=false])):focus,[type=submit]:focus,[type=submit]:is([aria-current]:not([aria-current=false])):focus,button:focus,button:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}[type=button],[type=reset],[type=submit]{margin-bottom:var(--pico-spacing)}:is(button,[type=submit],[type=button],[role=button]).secondary,[type=file]::file-selector-button,[type=reset]{--pico-background-color:var(--pico-secondary-background);--pico-border-color:var(--pico-secondary-border);--pico-color:var(--pico-secondary-inverse);cursor:pointer}:is(button,[type=submit],[type=button],[role=button]).secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=file]::file-selector-button:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:var(--pico-secondary-hover-background);--pico-border-color:var(--pico-secondary-hover-border);--pico-color:var(--pico-secondary-inverse)}:is(button,[type=submit],[type=button],[role=button]).secondary:focus,:is(button,[type=submit],[type=button],[role=button]).secondary:is([aria-current]:not([aria-current=false])):focus,[type=file]::file-selector-button:focus,[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])):focus,[type=reset]:focus,[type=reset]:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}:is(button,[type=submit],[type=button],[role=button]).contrast{--pico-background-color:var(--pico-contrast-background);--pico-border-color:var(--pico-contrast-border);--pico-color:var(--pico-contrast-inverse)}:is(button,[type=submit],[type=button],[role=button]).contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:var(--pico-contrast-hover-background);--pico-border-color:var(--pico-contrast-hover-border);--pico-color:var(--pico-contrast-inverse)}:is(button,[type=submit],[type=button],[role=button]).contrast:focus,:is(button,[type=submit],[type=button],[role=button]).contrast:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-contrast-focus)}:is(button,[type=submit],[type=button],[role=button]).outline,[type=reset].outline{--pico-background-color:transparent;--pico-color:var(--pico-primary);--pico-border-color:var(--pico-primary)}:is(button,[type=submit],[type=button],[role=button]).outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset].outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:transparent;--pico-color:var(--pico-primary-hover);--pico-border-color:var(--pico-primary-hover)}:is(button,[type=submit],[type=button],[role=button]).outline.secondary,[type=reset].outline{--pico-color:var(--pico-secondary);--pico-border-color:var(--pico-secondary)}:is(button,[type=submit],[type=button],[role=button]).outline.secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset].outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-secondary-hover);--pico-border-color:var(--pico-secondary-hover)}:is(button,[type=submit],[type=button],[role=button]).outline.contrast{--pico-color:var(--pico-contrast);--pico-border-color:var(--pico-contrast)}:is(button,[type=submit],[type=button],[role=button]).outline.contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-contrast-hover);--pico-border-color:var(--pico-contrast-hover)}:where(button,[type=submit],[type=reset],[type=button],[role=button])[disabled],:where(fieldset[disabled]) :is(button,[type=submit],[type=button],[type=reset],[role=button]){opacity:.5;pointer-events:none}:where(table){width:100%;border-collapse:collapse;border-spacing:0;text-indent:0}td,th{padding:calc(var(--pico-spacing)/ 2) var(--pico-spacing);border-bottom:var(--pico-border-width) solid var(--pico-table-border-color);background-color:var(--pico-background-color);color:var(--pico-color);font-weight:var(--pico-font-weight);text-align:left;text-align:start}tfoot td,tfoot th{border-top:var(--pico-border-width) solid var(--pico-table-border-color);border-bottom:0}table.striped tbody tr:nth-child(odd) td,table.striped tbody tr:nth-child(odd) th{background-color:var(--pico-table-row-stripped-background-color)}:where(audio,canvas,iframe,img,svg,video){vertical-align:middle}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}:where(iframe){border-style:none}img{max-width:100%;height:auto;border-style:none}:where(svg:not([fill])){fill:currentColor}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-size:.875em;font-family:var(--pico-font-family)}pre code{font-size:inherit;font-family:inherit}pre{-ms-overflow-style:scrollbar;overflow:auto}code,kbd,pre{border-radius:var(--pico-border-radius);background:var(--pico-code-background-color);color:var(--pico-code-color);font-weight:var(--pico-font-weight);line-height:initial}code,kbd{display:inline-block;padding:.375rem}pre{display:block;margin-bottom:var(--pico-spacing);overflow-x:auto}pre>code{display:block;padding:var(--pico-spacing);background:0 0;line-height:var(--pico-line-height)}kbd{background-color:var(--pico-code-kbd-background-color);color:var(--pico-code-kbd-color);vertical-align:baseline}figure{display:block;margin:0;padding:0}figure figcaption{padding:calc(var(--pico-spacing) * .5) 0;color:var(--pico-muted-color)}hr{height:0;margin:var(--pico-typography-spacing-vertical) 0;border:0;border-top:1px solid var(--pico-muted-border-color);color:inherit}[hidden],template{display:none!important}canvas{display:inline-block}input,optgroup,select,textarea{margin:0;font-size:1rem;line-height:var(--pico-line-height);font-family:inherit;letter-spacing:inherit}input{overflow:visible}select{text-transform:none}legend{max-width:100%;padding:0;color:inherit;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{padding:0}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}::-moz-focus-inner{padding:0;border-style:none}:-moz-focusring{outline:0}:-moz-ui-invalid{box-shadow:none}::-ms-expand{display:none}[type=file],[type=range]{padding:0;border-width:0}input:not([type=checkbox],[type=radio],[type=range]){height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2)}fieldset{width:100%;margin:0;margin-bottom:var(--pico-spacing);padding:0;border:0}fieldset legend,label{display:block;margin-bottom:calc(var(--pico-spacing) * .375);color:var(--pico-color);font-weight:var(--pico-form-label-font-weight,var(--pico-font-weight))}fieldset legend{margin-bottom:calc(var(--pico-spacing) * .5)}button[type=submit],input:not([type=checkbox],[type=radio]),select,textarea{width:100%}input:not([type=checkbox],[type=radio],[type=range],[type=file]),select,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal)}input,select,textarea{--pico-background-color:var(--pico-form-element-background-color);--pico-border-color:var(--pico-form-element-border-color);--pico-color:var(--pico-form-element-color);--pico-box-shadow:none;border:var(--pico-border-width) solid var(--pico-border-color);border-radius:var(--pico-border-radius);outline:0;background-color:var(--pico-background-color);box-shadow:var(--pico-box-shadow);color:var(--pico-color);font-weight:var(--pico-font-weight);transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}:where(select,textarea):not([readonly]):is(:active,:focus),input:not([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[readonly]):is(:active,:focus){--pico-background-color:var(--pico-form-element-active-background-color)}:where(select,textarea):not([readonly]):is(:active,:focus),input:not([type=submit],[type=button],[type=reset],[role=switch],[readonly]):is(:active,:focus){--pico-border-color:var(--pico-form-element-active-border-color)}:where(select,textarea):not([readonly]):focus,input:not([type=submit],[type=button],[type=reset],[type=range],[type=file],[readonly]):focus{--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-focus-color)}:where(fieldset[disabled]) :is(input:not([type=submit],[type=button],[type=reset]),select,textarea),input:not([type=submit],[type=button],[type=reset])[disabled],label[aria-disabled=true],select[disabled],textarea[disabled]{opacity:var(--pico-form-element-disabled-opacity);pointer-events:none}label[aria-disabled=true] input[disabled]{opacity:1}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid]{padding-right:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem)!important;padding-left:var(--pico-form-element-spacing-horizontal);padding-inline-start:var(--pico-form-element-spacing-horizontal)!important;padding-inline-end:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem)!important;background-position:center right .75rem;background-size:1rem auto;background-repeat:no-repeat}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid=false]:not(select){background-image:var(--pico-icon-valid)}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid=true]:not(select){background-image:var(--pico-icon-invalid)}:where(input,select,textarea)[aria-invalid=false]{--pico-border-color:var(--pico-form-element-valid-border-color)}:where(input,select,textarea)[aria-invalid=false]:is(:active,:focus){--pico-border-color:var(--pico-form-element-valid-active-border-color)!important}:where(input,select,textarea)[aria-invalid=false]:is(:active,:focus):not([type=checkbox],[type=radio]){--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-valid-focus-color)!important}:where(input,select,textarea)[aria-invalid=true]{--pico-border-color:var(--pico-form-element-invalid-border-color)}:where(input,select,textarea)[aria-invalid=true]:is(:active,:focus){--pico-border-color:var(--pico-form-element-invalid-active-border-color)!important}:where(input,select,textarea)[aria-invalid=true]:is(:active,:focus):not([type=checkbox],[type=radio]){--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-invalid-focus-color)!important}[dir=rtl] :where(input,select,textarea):not([type=checkbox],[type=radio]):is([aria-invalid],[aria-invalid=true],[aria-invalid=false]){background-position:center left .75rem}input::-webkit-input-placeholder,input::placeholder,select:invalid,textarea::-webkit-input-placeholder,textarea::placeholder{color:var(--pico-form-element-placeholder-color);opacity:1}input:not([type=checkbox],[type=radio]),select,textarea{margin-bottom:var(--pico-spacing)}select::-ms-expand{border:0;background-color:transparent}select:not([multiple],[size]){padding-right:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem);padding-left:var(--pico-form-element-spacing-horizontal);padding-inline-start:var(--pico-form-element-spacing-horizontal);padding-inline-end:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem);background-image:var(--pico-icon-chevron);background-position:center right .75rem;background-size:1rem auto;background-repeat:no-repeat}select[multiple] option:checked{background:var(--pico-form-element-selected-background-color)}[dir=rtl] select:not([multiple],[size]){background-position:center left .75rem}textarea{display:block;resize:vertical}textarea[aria-invalid]{--pico-icon-height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2);background-position:top right .75rem!important;background-size:1rem var(--pico-icon-height)!important}:where(input,select,textarea,fieldset,.grid)+small{display:block;width:100%;margin-top:calc(var(--pico-spacing) * -.75);margin-bottom:var(--pico-spacing);color:var(--pico-muted-color)}:where(input,select,textarea,fieldset,.grid)[aria-invalid=false]+small{color:var(--pico-ins-color)}:where(input,select,textarea,fieldset,.grid)[aria-invalid=true]+small{color:var(--pico-del-color)}label>:where(input,select,textarea){margin-top:calc(var(--pico-spacing) * .25)}label:has([type=checkbox],[type=radio]){width:-moz-fit-content;width:fit-content;cursor:pointer}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:1.25em;height:1.25em;margin-top:-.125em;margin-inline-end:.5em;border-width:var(--pico-border-width);vertical-align:middle;cursor:pointer}[type=checkbox]::-ms-check,[type=radio]::-ms-check{display:none}[type=checkbox]:checked,[type=checkbox]:checked:active,[type=checkbox]:checked:focus,[type=radio]:checked,[type=radio]:checked:active,[type=radio]:checked:focus{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);background-image:var(--pico-icon-checkbox);background-position:center;background-size:.75em auto;background-repeat:no-repeat}[type=checkbox]~label,[type=radio]~label{display:inline-block;margin-bottom:0;cursor:pointer}[type=checkbox]~label:not(:last-of-type),[type=radio]~label:not(:last-of-type){margin-inline-end:1em}[type=checkbox]:indeterminate{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);background-image:var(--pico-icon-minus);background-position:center;background-size:.75em auto;background-repeat:no-repeat}[type=radio]{border-radius:50%}[type=radio]:checked,[type=radio]:checked:active,[type=radio]:checked:focus{--pico-background-color:var(--pico-primary-inverse);border-width:.35em;background-image:none}[type=checkbox][role=switch]{--pico-background-color:var(--pico-switch-background-color);--pico-color:var(--pico-switch-color);width:2.25em;height:1.25em;border:var(--pico-border-width) solid var(--pico-border-color);border-radius:1.25em;background-color:var(--pico-background-color);line-height:1.25em}[type=checkbox][role=switch]:not([aria-invalid]){--pico-border-color:var(--pico-switch-background-color)}[type=checkbox][role=switch]:before{display:block;width:calc(1.25em - var(--pico-border-width) * 2);height:100%;border-radius:50%;background-color:var(--pico-color);box-shadow:var(--pico-switch-thumb-box-shadow);content:"";transition:margin .1s ease-in-out}[type=checkbox][role=switch]:focus{--pico-background-color:var(--pico-switch-background-color);--pico-border-color:var(--pico-switch-background-color)}[type=checkbox][role=switch]:checked{--pico-background-color:var(--pico-switch-checked-background-color);--pico-border-color:var(--pico-switch-checked-background-color);background-image:none}[type=checkbox][role=switch]:checked:before{margin-inline-start:calc(1.125em - var(--pico-border-width))}[type=checkbox][role=switch][disabled]{--pico-background-color:var(--pico-border-color)}[type=checkbox][aria-invalid=false]:checked,[type=checkbox][aria-invalid=false]:checked:active,[type=checkbox][aria-invalid=false]:checked:focus,[type=checkbox][role=switch][aria-invalid=false]:checked,[type=checkbox][role=switch][aria-invalid=false]:checked:active,[type=checkbox][role=switch][aria-invalid=false]:checked:focus{--pico-background-color:var(--pico-form-element-valid-border-color)}[type=checkbox]:checked:active[aria-invalid=true],[type=checkbox]:checked:focus[aria-invalid=true],[type=checkbox]:checked[aria-invalid=true],[type=checkbox][role=switch]:checked:active[aria-invalid=true],[type=checkbox][role=switch]:checked:focus[aria-invalid=true],[type=checkbox][role=switch]:checked[aria-invalid=true]{--pico-background-color:var(--pico-form-element-invalid-border-color)}[type=checkbox][aria-invalid=false]:checked,[type=checkbox][aria-invalid=false]:checked:active,[type=checkbox][aria-invalid=false]:checked:focus,[type=checkbox][role=switch][aria-invalid=false]:checked,[type=checkbox][role=switch][aria-invalid=false]:checked:active,[type=checkbox][role=switch][aria-invalid=false]:checked:focus,[type=radio][aria-invalid=false]:checked,[type=radio][aria-invalid=false]:checked:active,[type=radio][aria-invalid=false]:checked:focus{--pico-border-color:var(--pico-form-element-valid-border-color)}[type=checkbox]:checked:active[aria-invalid=true],[type=checkbox]:checked:focus[aria-invalid=true],[type=checkbox]:checked[aria-invalid=true],[type=checkbox][role=switch]:checked:active[aria-invalid=true],[type=checkbox][role=switch]:checked:focus[aria-invalid=true],[type=checkbox][role=switch]:checked[aria-invalid=true],[type=radio]:checked:active[aria-invalid=true],[type=radio]:checked:focus[aria-invalid=true],[type=radio]:checked[aria-invalid=true]{--pico-border-color:var(--pico-form-element-invalid-border-color)}[type=color]::-webkit-color-swatch-wrapper{padding:0}[type=color]::-moz-focus-inner{padding:0}[type=color]::-webkit-color-swatch{border:0;border-radius:calc(var(--pico-border-radius) * .5)}[type=color]::-moz-color-swatch{border:0;border-radius:calc(var(--pico-border-radius) * .5)}input:not([type=checkbox],[type=radio],[type=range],[type=file]):is([type=date],[type=datetime-local],[type=month],[type=time],[type=week]){--pico-icon-position:.75rem;--pico-icon-width:1rem;padding-right:calc(var(--pico-icon-width) + var(--pico-icon-position));background-image:var(--pico-icon-date);background-position:center right var(--pico-icon-position);background-size:var(--pico-icon-width) auto;background-repeat:no-repeat}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=time]{background-image:var(--pico-icon-time)}[type=date]::-webkit-calendar-picker-indicator,[type=datetime-local]::-webkit-calendar-picker-indicator,[type=month]::-webkit-calendar-picker-indicator,[type=time]::-webkit-calendar-picker-indicator,[type=week]::-webkit-calendar-picker-indicator{width:var(--pico-icon-width);margin-right:calc(var(--pico-icon-width) * -1);margin-left:var(--pico-icon-position);opacity:0}@-moz-document url-prefix(){[type=date],[type=datetime-local],[type=month],[type=time],[type=week]{padding-right:var(--pico-form-element-spacing-horizontal)!important;background-image:none!important}}[dir=rtl] :is([type=date],[type=datetime-local],[type=month],[type=time],[type=week]){text-align:right}[type=file]{--pico-color:var(--pico-muted-color);margin-left:calc(var(--pico-outline-width) * -1);padding:calc(var(--pico-form-element-spacing-vertical) * .5) 0;padding-left:var(--pico-outline-width);border:0;border-radius:0;background:0 0}[type=file]::file-selector-button{margin-right:calc(var(--pico-spacing)/ 2);padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal)}[type=file]:is(:hover,:active,:focus)::file-selector-button{--pico-background-color:var(--pico-secondary-hover-background);--pico-border-color:var(--pico-secondary-hover-border)}[type=file]:focus::file-selector-button{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:1.25rem;background:0 0}[type=range]::-webkit-slider-runnable-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-webkit-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-moz-range-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-moz-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-ms-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-ms-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-webkit-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]::-moz-range-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-moz-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]::-ms-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-ms-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]:active,[type=range]:focus-within{--pico-range-border-color:var(--pico-range-active-border-color);--pico-range-thumb-color:var(--pico-range-thumb-active-color)}[type=range]:active::-webkit-slider-thumb{transform:scale(1.25)}[type=range]:active::-moz-range-thumb{transform:scale(1.25)}[type=range]:active::-ms-thumb{transform:scale(1.25)}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search]{padding-inline-start:calc(var(--pico-form-element-spacing-horizontal) + 1.75rem);background-image:var(--pico-icon-search);background-position:center left calc(var(--pico-form-element-spacing-horizontal) + .125rem);background-size:1rem auto;background-repeat:no-repeat}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid]{padding-inline-start:calc(var(--pico-form-element-spacing-horizontal) + 1.75rem)!important;background-position:center left 1.125rem,center right .75rem}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid=false]{background-image:var(--pico-icon-search),var(--pico-icon-valid)}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid=true]{background-image:var(--pico-icon-search),var(--pico-icon-invalid)}[dir=rtl] :where(input):not([type=checkbox],[type=radio],[type=range],[type=file])[type=search]{background-position:center right 1.125rem}[dir=rtl] :where(input):not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid]{background-position:center right 1.125rem,center left .75rem}details{display:block;margin-bottom:var(--pico-spacing)}details summary{line-height:1rem;list-style-type:none;cursor:pointer;transition:color var(--pico-transition)}details summary:not([role]){color:var(--pico-accordion-close-summary-color)}details summary::-webkit-details-marker{display:none}details summary::marker{display:none}details summary::-moz-list-bullet{list-style-type:none}details summary:after{display:block;width:1rem;height:1rem;margin-inline-start:calc(var(--pico-spacing,1rem) * .5);float:right;transform:rotate(-90deg);background-image:var(--pico-icon-chevron);background-position:right center;background-size:1rem auto;background-repeat:no-repeat;content:"";transition:transform var(--pico-transition)}details summary:focus{outline:0}details summary:focus:not([role]){color:var(--pico-accordion-active-summary-color)}details summary:focus-visible:not([role]){outline:var(--pico-outline-width) solid var(--pico-primary-focus);outline-offset:calc(var(--pico-spacing,1rem) * .5);color:var(--pico-primary)}details summary[role=button]{width:100%;text-align:left}details summary[role=button]:after{height:calc(1rem * var(--pico-line-height,1.5))}details[open]>summary{margin-bottom:var(--pico-spacing)}details[open]>summary:not([role]):not(:focus){color:var(--pico-accordion-open-summary-color)}details[open]>summary:after{transform:rotate(0)}[dir=rtl] details summary{text-align:right}[dir=rtl] details summary:after{float:left;background-position:left center}article{margin-bottom:var(--pico-block-spacing-vertical);padding:var(--pico-block-spacing-vertical) var(--pico-block-spacing-horizontal);border-radius:var(--pico-border-radius);background:var(--pico-card-background-color);box-shadow:var(--pico-card-box-shadow)}article>footer,article>header{margin-right:calc(var(--pico-block-spacing-horizontal) * -1);margin-left:calc(var(--pico-block-spacing-horizontal) * -1);padding:calc(var(--pico-block-spacing-vertical) * .66) var(--pico-block-spacing-horizontal);background-color:var(--pico-card-sectioning-background-color)}article>header{margin-top:calc(var(--pico-block-spacing-vertical) * -1);margin-bottom:var(--pico-block-spacing-vertical);border-bottom:var(--pico-border-width) solid var(--pico-card-border-color);border-top-right-radius:var(--pico-border-radius);border-top-left-radius:var(--pico-border-radius)}article>footer{margin-top:var(--pico-block-spacing-vertical);margin-bottom:calc(var(--pico-block-spacing-vertical) * -1);border-top:var(--pico-border-width) solid var(--pico-card-border-color);border-bottom-right-radius:var(--pico-border-radius);border-bottom-left-radius:var(--pico-border-radius)}details.dropdown{position:relative;border-bottom:none}details.dropdown summary:after,details.dropdown>a:after,details.dropdown>button:after{display:block;width:1rem;height:calc(1rem * var(--pico-line-height,1.5));margin-inline-start:.25rem;float:right;transform:rotate(0) translate(.2rem);background-image:var(--pico-icon-chevron);background-position:right center;background-size:1rem auto;background-repeat:no-repeat;content:""}nav details.dropdown{margin-bottom:0}details.dropdown summary:not([role]){height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2);padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);border:var(--pico-border-width) solid var(--pico-form-element-border-color);border-radius:var(--pico-border-radius);background-color:var(--pico-form-element-background-color);color:var(--pico-form-element-placeholder-color);line-height:inherit;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}details.dropdown summary:not([role]):active,details.dropdown summary:not([role]):focus{border-color:var(--pico-form-element-active-border-color);background-color:var(--pico-form-element-active-background-color)}details.dropdown summary:not([role]):focus{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-focus-color)}details.dropdown summary:not([role]):focus-visible{outline:0}details.dropdown summary:not([role])[aria-invalid=false]{--pico-form-element-border-color:var(--pico-form-element-valid-border-color);--pico-form-element-active-border-color:var(--pico-form-element-valid-focus-color);--pico-form-element-focus-color:var(--pico-form-element-valid-focus-color)}details.dropdown summary:not([role])[aria-invalid=true]{--pico-form-element-border-color:var(--pico-form-element-invalid-border-color);--pico-form-element-active-border-color:var(--pico-form-element-invalid-focus-color);--pico-form-element-focus-color:var(--pico-form-element-invalid-focus-color)}nav details.dropdown{display:inline;margin:calc(var(--pico-nav-element-spacing-vertical) * -1) 0}nav details.dropdown summary:after{transform:rotate(0) translate(0)}nav details.dropdown summary:not([role]){height:calc(1rem * var(--pico-line-height) + var(--pico-nav-link-spacing-vertical) * 2);padding:calc(var(--pico-nav-link-spacing-vertical) - var(--pico-border-width) * 2) var(--pico-nav-link-spacing-horizontal)}nav details.dropdown summary:not([role]):focus-visible{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}details.dropdown summary+ul{display:flex;z-index:99;position:absolute;left:0;flex-direction:column;width:100%;min-width:-moz-fit-content;min-width:fit-content;margin:0;margin-top:var(--pico-outline-width);padding:0;border:var(--pico-border-width) solid var(--pico-dropdown-border-color);border-radius:var(--pico-border-radius);background-color:var(--pico-dropdown-background-color);box-shadow:var(--pico-dropdown-box-shadow);color:var(--pico-dropdown-color);white-space:nowrap;opacity:0;transition:opacity var(--pico-transition),transform 0s ease-in-out 1s}details.dropdown summary+ul[dir=rtl]{right:0;left:auto}details.dropdown summary+ul li{width:100%;margin-bottom:0;padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal);list-style:none}details.dropdown summary+ul li:first-of-type{margin-top:calc(var(--pico-form-element-spacing-vertical) * .5)}details.dropdown summary+ul li:last-of-type{margin-bottom:calc(var(--pico-form-element-spacing-vertical) * .5)}details.dropdown summary+ul li a{display:block;margin:calc(var(--pico-form-element-spacing-vertical) * -.5) calc(var(--pico-form-element-spacing-horizontal) * -1);padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal);overflow:hidden;border-radius:0;color:var(--pico-dropdown-color);text-decoration:none;text-overflow:ellipsis}details.dropdown summary+ul li a:active,details.dropdown summary+ul li a:focus,details.dropdown summary+ul li a:focus-visible,details.dropdown summary+ul li a:hover,details.dropdown summary+ul li a[aria-current]:not([aria-current=false]){background-color:var(--pico-dropdown-hover-background-color)}details.dropdown summary+ul li label{width:100%}details.dropdown summary+ul li:has(label):hover{background-color:var(--pico-dropdown-hover-background-color)}details.dropdown[open] summary{margin-bottom:0}details.dropdown[open] summary+ul{transform:scaleY(1);opacity:1;transition:opacity var(--pico-transition),transform 0s ease-in-out 0s}details.dropdown[open] summary:before{display:block;z-index:1;position:fixed;width:100vw;height:100vh;top:0;right:0;bottom:0;left:0;background:0 0;content:"";cursor:default}label>details.dropdown{margin-top:calc(var(--pico-spacing) * .25)}[role=group],[role=search]{display:inline-flex;position:relative;width:100%;margin-bottom:var(--pico-spacing);border-radius:var(--pico-border-radius);box-shadow:var(--pico-group-box-shadow,0 0 0 transparent);vertical-align:middle;transition:box-shadow var(--pico-transition)}[role=group] input:not([type=checkbox],[type=radio]),[role=group] select,[role=group]>*,[role=search] input:not([type=checkbox],[type=radio]),[role=search] select,[role=search]>*{position:relative;flex:1 1 auto;margin-bottom:0}[role=group] input:not([type=checkbox],[type=radio]):not(:first-child),[role=group] select:not(:first-child),[role=group]>:not(:first-child),[role=search] input:not([type=checkbox],[type=radio]):not(:first-child),[role=search] select:not(:first-child),[role=search]>:not(:first-child){margin-left:0;border-top-left-radius:0;border-bottom-left-radius:0}[role=group] input:not([type=checkbox],[type=radio]):not(:last-child),[role=group] select:not(:last-child),[role=group]>:not(:last-child),[role=search] input:not([type=checkbox],[type=radio]):not(:last-child),[role=search] select:not(:last-child),[role=search]>:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}[role=group] input:not([type=checkbox],[type=radio]):focus,[role=group] select:focus,[role=group]>:focus,[role=search] input:not([type=checkbox],[type=radio]):focus,[role=search] select:focus,[role=search]>:focus{z-index:2}[role=group] [role=button]:not(:first-child),[role=group] [type=button]:not(:first-child),[role=group] [type=reset]:not(:first-child),[role=group] [type=submit]:not(:first-child),[role=group] button:not(:first-child),[role=group] input:not([type=checkbox],[type=radio]):not(:first-child),[role=group] select:not(:first-child),[role=search] [role=button]:not(:first-child),[role=search] [type=button]:not(:first-child),[role=search] [type=reset]:not(:first-child),[role=search] [type=submit]:not(:first-child),[role=search] button:not(:first-child),[role=search] input:not([type=checkbox],[type=radio]):not(:first-child),[role=search] select:not(:first-child){margin-left:calc(var(--pico-border-width) * -1)}[role=group] [role=button],[role=group] [type=button],[role=group] [type=reset],[role=group] [type=submit],[role=group] button,[role=search] [role=button],[role=search] [type=button],[role=search] [type=reset],[role=search] [type=submit],[role=search] button{width:auto}@supports selector(:has(*)){[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus),[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus){--pico-group-box-shadow:var(--pico-group-box-shadow-focus-with-button)}[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) input:not([type=checkbox],[type=radio]),[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) select,[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) input:not([type=checkbox],[type=radio]),[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) select{border-color:transparent}[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus),[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus){--pico-group-box-shadow:var(--pico-group-box-shadow-focus-with-input)}[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [role=button],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=button],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=submit],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) button,[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [role=button],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=button],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=submit],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) button{--pico-button-box-shadow:0 0 0 var(--pico-border-width) var(--pico-primary-border);--pico-button-hover-box-shadow:0 0 0 var(--pico-border-width) var(--pico-primary-hover-border)}[role=group] [role=button]:focus,[role=group] [type=button]:focus,[role=group] [type=reset]:focus,[role=group] [type=submit]:focus,[role=group] button:focus,[role=search] [role=button]:focus,[role=search] [type=button]:focus,[role=search] [type=reset]:focus,[role=search] [type=submit]:focus,[role=search] button:focus{box-shadow:none}}[role=search]>:first-child{border-top-left-radius:5rem;border-bottom-left-radius:5rem}[role=search]>:last-child{border-top-right-radius:5rem;border-bottom-right-radius:5rem}[aria-busy=true]:not(input,select,textarea,html){white-space:nowrap}[aria-busy=true]:not(input,select,textarea,html):before{display:inline-block;width:1em;height:1em;background-image:var(--pico-icon-loading);background-size:1rem auto;background-repeat:no-repeat;content:"";vertical-align:-.125em}[aria-busy=true]:not(input,select,textarea,html):not(:empty):before{margin-inline-end:calc(var(--pico-spacing) * .5)}[aria-busy=true]:not(input,select,textarea,html):empty{text-align:center}[role=button][aria-busy=true],[type=button][aria-busy=true],[type=reset][aria-busy=true],[type=submit][aria-busy=true],a[aria-busy=true],button[aria-busy=true]{pointer-events:none}:root{--pico-scrollbar-width:0px}dialog{display:flex;z-index:999;position:fixed;top:0;right:0;bottom:0;left:0;align-items:center;justify-content:center;width:inherit;min-width:100%;height:inherit;min-height:100%;padding:0;border:0;-webkit-backdrop-filter:var(--pico-modal-overlay-backdrop-filter);backdrop-filter:var(--pico-modal-overlay-backdrop-filter);background-color:var(--pico-modal-overlay-background-color);color:var(--pico-color)}dialog article{width:100%;max-height:calc(100vh - var(--pico-spacing) * 2);margin:var(--pico-spacing);overflow:auto}@media (min-width:576px){dialog article{max-width:510px}}@media (min-width:768px){dialog article{max-width:700px}}dialog article>header>*{margin-bottom:0}dialog article>header .close,dialog article>header :is(a,button)[rel=prev]{margin:0;margin-left:var(--pico-spacing);padding:0;float:right}dialog article>footer{text-align:right}dialog article>footer [role=button],dialog article>footer button{margin-bottom:0}dialog article>footer [role=button]:not(:first-of-type),dialog article>footer button:not(:first-of-type){margin-left:calc(var(--pico-spacing) * .5)}dialog article .close,dialog article :is(a,button)[rel=prev]{display:block;width:1rem;height:1rem;margin-top:calc(var(--pico-spacing) * -1);margin-bottom:var(--pico-spacing);margin-left:auto;border:none;background-image:var(--pico-icon-close);background-position:center;background-size:auto 1rem;background-repeat:no-repeat;background-color:transparent;opacity:.5;transition:opacity var(--pico-transition)}dialog article .close:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),dialog article :is(a,button)[rel=prev]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){opacity:1}dialog:not([open]),dialog[open=false]{display:none}.modal-is-open{padding-right:var(--pico-scrollbar-width,0);overflow:hidden;pointer-events:none;touch-action:none}.modal-is-open dialog{pointer-events:auto;touch-action:auto}:where(.modal-is-opening,.modal-is-closing) dialog,:where(.modal-is-opening,.modal-is-closing) dialog>article{animation-duration:.2s;animation-timing-function:ease-in-out;animation-fill-mode:both}:where(.modal-is-opening,.modal-is-closing) dialog{animation-duration:.8s;animation-name:modal-overlay}:where(.modal-is-opening,.modal-is-closing) dialog>article{animation-delay:.2s;animation-name:modal}.modal-is-closing dialog,.modal-is-closing dialog>article{animation-delay:0s;animation-direction:reverse}@keyframes modal-overlay{0%{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:transparent}}@keyframes modal{0%{transform:translateY(-100%);opacity:0}}:where(nav li):before{float:left;content:"​"}nav,nav ul{display:flex}nav{justify-content:space-between;overflow:visible}nav ol,nav ul{align-items:center;margin-bottom:0;padding:0;list-style:none}nav ol:first-of-type,nav ul:first-of-type{margin-left:calc(var(--pico-nav-element-spacing-horizontal) * -1)}nav ol:last-of-type,nav ul:last-of-type{margin-right:calc(var(--pico-nav-element-spacing-horizontal) * -1)}nav li{display:inline-block;margin:0;padding:var(--pico-nav-element-spacing-vertical) var(--pico-nav-element-spacing-horizontal)}nav li :where(a,[role=link]){display:inline-block;margin:calc(var(--pico-nav-link-spacing-vertical) * -1) calc(var(--pico-nav-link-spacing-horizontal) * -1);padding:var(--pico-nav-link-spacing-vertical) var(--pico-nav-link-spacing-horizontal);border-radius:var(--pico-border-radius)}nav li :where(a,[role=link]):not(:hover){text-decoration:none}nav li [role=button],nav li button,nav li input:not([type=checkbox],[type=radio],[type=range],[type=file]),nav li select{height:auto;margin-right:inherit;margin-bottom:0;margin-left:inherit;padding:calc(var(--pico-nav-link-spacing-vertical) - var(--pico-border-width) * 2) var(--pico-nav-link-spacing-horizontal)}nav[aria-label=breadcrumb]{align-items:center;justify-content:start}nav[aria-label=breadcrumb] ul li:not(:first-child){margin-inline-start:var(--pico-nav-link-spacing-horizontal)}nav[aria-label=breadcrumb] ul li a{margin:calc(var(--pico-nav-link-spacing-vertical) * -1) 0;margin-inline-start:calc(var(--pico-nav-link-spacing-horizontal) * -1)}nav[aria-label=breadcrumb] ul li:not(:last-child):after{display:inline-block;position:absolute;width:calc(var(--pico-nav-link-spacing-horizontal) * 4);margin:0 calc(var(--pico-nav-link-spacing-horizontal) * -1);content:var(--pico-nav-breadcrumb-divider);color:var(--pico-muted-color);text-align:center;text-decoration:none;white-space:nowrap}nav[aria-label=breadcrumb] a[aria-current]:not([aria-current=false]){background-color:transparent;color:inherit;text-decoration:none;pointer-events:none}aside li,aside nav,aside ol,aside ul{display:block}aside li{padding:calc(var(--pico-nav-element-spacing-vertical) * .5) var(--pico-nav-element-spacing-horizontal)}aside li a{display:block}aside li [role=button]{margin:inherit}[dir=rtl] nav[aria-label=breadcrumb] ul li:not(:last-child) :after{content:"\\"}progress{display:inline-block;vertical-align:baseline}progress{-webkit-appearance:none;-moz-appearance:none;display:inline-block;appearance:none;width:100%;height:.5rem;margin-bottom:calc(var(--pico-spacing) * .5);overflow:hidden;border:0;border-radius:var(--pico-border-radius);background-color:var(--pico-progress-background-color);color:var(--pico-progress-color)}progress::-webkit-progress-bar{border-radius:var(--pico-border-radius);background:0 0}progress[value]::-webkit-progress-value{background-color:var(--pico-progress-color);-webkit-transition:inline-size var(--pico-transition);transition:inline-size var(--pico-transition)}progress::-moz-progress-bar{background-color:var(--pico-progress-color)}@media (prefers-reduced-motion:no-preference){progress:indeterminate{background:var(--pico-progress-background-color) linear-gradient(to right,var(--pico-progress-color) 30%,var(--pico-progress-background-color) 30%) top left/150% 150% no-repeat;animation:progress-indeterminate 1s linear infinite}progress:indeterminate[value]::-webkit-progress-value{background-color:transparent}progress:indeterminate::-moz-progress-bar{background-color:transparent}}@media (prefers-reduced-motion:no-preference){[dir=rtl] progress:indeterminate{animation-direction:reverse}}@keyframes progress-indeterminate{0%{background-position:200% 0}to{background-position:-200% 0}}[data-tooltip]{position:relative}[data-tooltip]:not(a,button,input){border-bottom:1px dotted;text-decoration:none;cursor:help}[data-tooltip]:after,[data-tooltip]:before,[data-tooltip][data-placement=top]:after,[data-tooltip][data-placement=top]:before{display:block;z-index:99;position:absolute;bottom:100%;left:50%;padding:.25rem .5rem;overflow:hidden;transform:translate(-50%,-.25rem);border-radius:var(--pico-border-radius);background:var(--pico-tooltip-background-color);content:attr(data-tooltip);color:var(--pico-tooltip-color);font-style:normal;font-weight:var(--pico-font-weight);font-size:.875rem;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;opacity:0;pointer-events:none}[data-tooltip]:after,[data-tooltip][data-placement=top]:after{padding:0;transform:translate(-50%);border-top:.3rem solid;border-right:.3rem solid transparent;border-left:.3rem solid transparent;border-radius:0;background-color:transparent;content:"";color:var(--pico-tooltip-background-color)}[data-tooltip][data-placement=bottom]:after,[data-tooltip][data-placement=bottom]:before{top:100%;bottom:auto;transform:translate(-50%,.25rem)}[data-tooltip][data-placement=bottom]:after{transform:translate(-50%,-.3rem);border:.3rem solid transparent;border-bottom:.3rem solid}[data-tooltip][data-placement=left]:after,[data-tooltip][data-placement=left]:before{top:50%;right:100%;bottom:auto;left:auto;transform:translate(-.25rem,-50%)}[data-tooltip][data-placement=left]:after{transform:translate(.3rem,-50%);border:.3rem solid transparent;border-left:.3rem solid}[data-tooltip][data-placement=right]:after,[data-tooltip][data-placement=right]:before{top:50%;right:auto;bottom:auto;left:100%;transform:translate(.25rem,-50%)}[data-tooltip][data-placement=right]:after{transform:translate(-.3rem,-50%);border:.3rem solid transparent;border-right:.3rem solid}[data-tooltip]:focus:after,[data-tooltip]:focus:before,[data-tooltip]:hover:after,[data-tooltip]:hover:before{opacity:1}@media (hover:hover) and (pointer:fine){[data-tooltip]:focus:after,[data-tooltip]:focus:before,[data-tooltip]:hover:after,[data-tooltip]:hover:before{--pico-tooltip-slide-to:translate(-50%, -.25rem);transform:translate(-50%,.75rem);animation-duration:.2s;animation-fill-mode:forwards;animation-name:tooltip-slide;opacity:0}[data-tooltip]:focus:after,[data-tooltip]:hover:after{--pico-tooltip-caret-slide-to:translate(-50%, 0rem);transform:translate(-50%,-.25rem);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=bottom]:focus:after,[data-tooltip][data-placement=bottom]:focus:before,[data-tooltip][data-placement=bottom]:hover:after,[data-tooltip][data-placement=bottom]:hover:before{--pico-tooltip-slide-to:translate(-50%, .25rem);transform:translate(-50%,-.75rem);animation-name:tooltip-slide}[data-tooltip][data-placement=bottom]:focus:after,[data-tooltip][data-placement=bottom]:hover:after{--pico-tooltip-caret-slide-to:translate(-50%, -.3rem);transform:translate(-50%,-.5rem);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=left]:focus:after,[data-tooltip][data-placement=left]:focus:before,[data-tooltip][data-placement=left]:hover:after,[data-tooltip][data-placement=left]:hover:before{--pico-tooltip-slide-to:translate(-.25rem, -50%);transform:translate(.75rem,-50%);animation-name:tooltip-slide}[data-tooltip][data-placement=left]:focus:after,[data-tooltip][data-placement=left]:hover:after{--pico-tooltip-caret-slide-to:translate(.3rem, -50%);transform:translate(.05rem,-50%);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=right]:focus:after,[data-tooltip][data-placement=right]:focus:before,[data-tooltip][data-placement=right]:hover:after,[data-tooltip][data-placement=right]:hover:before{--pico-tooltip-slide-to:translate(.25rem, -50%);transform:translate(-.75rem,-50%);animation-name:tooltip-slide}[data-tooltip][data-placement=right]:focus:after,[data-tooltip][data-placement=right]:hover:after{--pico-tooltip-caret-slide-to:translate(-.3rem, -50%);transform:translate(-.05rem,-50%);animation-name:tooltip-caret-slide}}@keyframes tooltip-slide{to{transform:var(--pico-tooltip-slide-to);opacity:1}}@keyframes tooltip-caret-slide{50%{opacity:0}to{transform:var(--pico-tooltip-caret-slide-to);opacity:1}}[aria-controls]{cursor:pointer}[aria-disabled=true],[disabled]{cursor:not-allowed}[aria-hidden=false][hidden]{display:initial}[aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);position:absolute}[tabindex],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation}[dir=rtl]{direction:rtl}@media (prefers-reduced-motion:reduce){:not([aria-busy=true]),:not([aria-busy=true]):after,:not([aria-busy=true]):before{background-attachment:initial!important;animation-duration:1ms!important;animation-delay:-1ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-delay:0s!important;transition-duration:0s!important}}.ctrl-btn-center.svelte-1s83zbq{display:grid!important;height:100%;width:100%;place-items:center}.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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.5'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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.5'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%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.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%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}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%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){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%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")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-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}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;top:0;right:0;bottom:0;left:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}.expand-map.svelte-p00lfq{position:absolute;top:0;bottom:0;left:0;right:0}div.svelte-k43lgc{float:left}.left.svelte-k43lgc{width:25%;height:100vh;overflow:scroll;padding:8px}.main.svelte-k43lgc{width:75%}span.svelte-kzgqtg{display:block;float:left;height:16px;width:30px;margin-right:5px;border:1px solid #999}div.svelte-1uuov7f{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.5);display:flex;justify-content:center;align-items:center;z-index:999;color:#fff;font-size:32px}table.svelte-lh2o9l{border:solid}.dot.svelte-1cqsh0e{width:30px;height:30px;border-radius:50%;display:inline-block;background-color:#00f;text-align:center;color:#fff;font-weight:700} +*/:root{--pico-font-family-emoji:"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--pico-font-family-sans-serif:system-ui,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,Helvetica,Arial,"Helvetica Neue",sans-serif,var(--pico-font-family-emoji);--pico-font-family-monospace:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace,var(--pico-font-family-emoji);--pico-font-family:var(--pico-font-family-sans-serif);--pico-line-height:1.5;--pico-font-weight:400;--pico-font-size:100%;--pico-text-underline-offset:.1rem;--pico-border-radius:.25rem;--pico-border-width:.0625rem;--pico-outline-width:.125rem;--pico-transition:.2s ease-in-out;--pico-spacing:1rem;--pico-typography-spacing-vertical:1rem;--pico-block-spacing-vertical:var(--pico-spacing);--pico-block-spacing-horizontal:var(--pico-spacing);--pico-grid-column-gap:var(--pico-spacing);--pico-grid-row-gap:var(--pico-spacing);--pico-form-element-spacing-vertical:.75rem;--pico-form-element-spacing-horizontal:1rem;--pico-group-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-primary-focus);--pico-group-box-shadow-focus-with-input:0 0 0 .0625rem var(--pico-form-element-border-color);--pico-modal-overlay-backdrop-filter:blur(.375rem);--pico-nav-element-spacing-vertical:1rem;--pico-nav-element-spacing-horizontal:.5rem;--pico-nav-link-spacing-vertical:.5rem;--pico-nav-link-spacing-horizontal:.5rem;--pico-nav-breadcrumb-divider:">";--pico-icon-checkbox:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-minus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");--pico-icon-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-date:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");--pico-icon-time:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-search:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");--pico-icon-close:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");--pico-icon-loading:url("data:image/svg+xml,%3Csvg fill='none' height='24' width='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' %3E%3Cstyle%3E g %7B animation: rotate 2s linear infinite; transform-origin: center center; %7D circle %7B stroke-dasharray: 75,100; stroke-dashoffset: -5; animation: dash 1.5s ease-in-out infinite; stroke-linecap: round; %7D @keyframes rotate %7B 0%25 %7B transform: rotate(0deg); %7D 100%25 %7B transform: rotate(360deg); %7D %7D @keyframes dash %7B 0%25 %7B stroke-dasharray: 1,100; stroke-dashoffset: 0; %7D 50%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -17.5; %7D 100%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -62; %7D %7D %3C/style%3E%3Cg%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='rgb(136, 145, 164)' stroke-width='4' /%3E%3C/g%3E%3C/svg%3E")}@media (min-width:576px){:root{--pico-font-size:106.25%}}@media (min-width:768px){:root{--pico-font-size:112.5%}}@media (min-width:1024px){:root{--pico-font-size:118.75%}}@media (min-width:1280px){:root{--pico-font-size:125%}}@media (min-width:1536px){:root{--pico-font-size:131.25%}}a,a.contrast,a.secondary{--pico-text-decoration:underline}small{--pico-font-size:.875em}h1,h2,h3,h4,h5,h6{--pico-font-weight:700}h1{--pico-font-size:2rem;--pico-line-height:1.125;--pico-typography-spacing-top:3rem}h2{--pico-font-size:1.75rem;--pico-line-height:1.15;--pico-typography-spacing-top:2.625rem}h3{--pico-font-size:1.5rem;--pico-line-height:1.175;--pico-typography-spacing-top:2.25rem}h4{--pico-font-size:1.25rem;--pico-line-height:1.2;--pico-typography-spacing-top:1.874rem}h5{--pico-font-size:1.125rem;--pico-line-height:1.225;--pico-typography-spacing-top:1.6875rem}h6{--pico-font-size:1rem;--pico-line-height:1.25;--pico-typography-spacing-top:1.5rem}tfoot td,tfoot th,thead td,thead th{--pico-font-weight:600;--pico-border-width:.1875rem}code,kbd,pre,samp{--pico-font-family:var(--pico-font-family-monospace)}kbd{--pico-font-weight:bolder}:where(select,textarea),input:not([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-outline-width:.0625rem}[type=search]{--pico-border-radius:5rem}[type=checkbox],[type=radio]{--pico-border-width:.125rem}[type=checkbox][role=switch]{--pico-border-width:.1875rem}details.dropdown summary:not([role=button]){--pico-outline-width:.0625rem}nav details.dropdown summary:focus-visible{--pico-outline-width:.125rem}[role=search]{--pico-border-radius:5rem}[role=group]:has(button.secondary:focus,[type=submit].secondary:focus,[type=button].secondary:focus,[role=button].secondary:focus),[role=search]:has(button.secondary:focus,[type=submit].secondary:focus,[type=button].secondary:focus,[role=button].secondary:focus){--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}[role=group]:has(button.contrast:focus,[type=submit].contrast:focus,[type=button].contrast:focus,[role=button].contrast:focus),[role=search]:has(button.contrast:focus,[type=submit].contrast:focus,[type=button].contrast:focus,[role=button].contrast:focus){--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-contrast-focus)}[role=group] [role=button],[role=group] [type=button],[role=group] [type=submit],[role=group] button,[role=search] [role=button],[role=search] [type=button],[role=search] [type=submit],[role=search] button{--pico-form-element-spacing-horizontal:2rem}details summary[role=button]:not(.outline):after{filter:brightness(0) invert(1)}[aria-busy=true]:not(input,select,textarea):is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0) invert(1)}:root:not([data-theme=dark]),[data-theme=light]{--pico-background-color:#fff;--pico-color:#373c44;--pico-text-selection-color:rgba(0, 166, 110, .25);--pico-muted-color:#646b79;--pico-muted-border-color:#e7eaf0;--pico-primary:#007a50;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 122, 80, .5);--pico-primary-hover:#005f3d;--pico-primary-hover-background:#006d46;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 166, 110, .5);--pico-primary-inverse:#fff;--pico-secondary:#5d6b89;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(93, 107, 137, .5);--pico-secondary-hover:#48536b;--pico-secondary-hover-background:#48536b;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(93, 107, 137, .25);--pico-secondary-inverse:#fff;--pico-contrast:#181c25;--pico-contrast-background:#181c25;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(24, 28, 37, .5);--pico-contrast-hover:#000;--pico-contrast-hover-background:#000;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-secondary-hover);--pico-contrast-focus:rgba(93, 107, 137, .25);--pico-contrast-inverse:#fff;--pico-box-shadow:.0145rem .029rem .174rem rgba(129, 145, 181, .01698),.0335rem .067rem .402rem rgba(129, 145, 181, .024),.0625rem .125rem .75rem rgba(129, 145, 181, .03),.1125rem .225rem 1.35rem rgba(129, 145, 181, .036),.2085rem .417rem 2.502rem rgba(129, 145, 181, .04302),.5rem 1rem 6rem rgba(129, 145, 181, .06),0 0 0 .0625rem rgba(129, 145, 181, .015);--pico-h1-color:#2d3138;--pico-h2-color:#373c44;--pico-h3-color:#424751;--pico-h4-color:#4d535e;--pico-h5-color:#5c6370;--pico-h6-color:#646b79;--pico-mark-background-color:#fde7c0;--pico-mark-color:#0f1114;--pico-ins-color:#1d6a54;--pico-del-color:#883935;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#f3f5f7;--pico-code-color:#646b79;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#fbfcfc;--pico-form-element-selected-background-color:#dfe3eb;--pico-form-element-border-color:#cfd5e2;--pico-form-element-color:#23262c;--pico-form-element-placeholder-color:var(--pico-muted-color);--pico-form-element-active-background-color:#fff;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#b86a6b;--pico-form-element-invalid-active-border-color:#c84f48;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#4c9b8a;--pico-form-element-valid-active-border-color:#279977;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#bfc7d9;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#dfe3eb;--pico-range-active-border-color:#bfc7d9;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:var(--pico-background-color);--pico-card-border-color:var(--pico-muted-border-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#fbfcfc;--pico-dropdown-background-color:#fff;--pico-dropdown-border-color:#eff1f4;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#eff1f4;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(232, 234, 237, .75);--pico-progress-background-color:#dfe3eb;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(76, 155, 138)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(200, 79, 72)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:light}:root:not([data-theme=dark]) input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]),[data-theme=light] input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}@media only screen and (prefers-color-scheme:dark){:root:not([data-theme]){--pico-background-color:#13171f;--pico-color:#c2c7d0;--pico-text-selection-color:rgba(0, 180, 120, .1875);--pico-muted-color:#7b8495;--pico-muted-border-color:#202632;--pico-primary:#00b478;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 180, 120, .5);--pico-primary-hover:#00cc88;--pico-primary-hover-background:#00895a;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 180, 120, .375);--pico-primary-inverse:#fff;--pico-secondary:#969eaf;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(150, 158, 175, .5);--pico-secondary-hover:#b3b9c5;--pico-secondary-hover-background:#5d6b89;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(144, 158, 190, .25);--pico-secondary-inverse:#fff;--pico-contrast:#dfe3eb;--pico-contrast-background:#eff1f4;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(223, 227, 235, .5);--pico-contrast-hover:#fff;--pico-contrast-hover-background:#fff;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-contrast-hover);--pico-contrast-focus:rgba(207, 213, 226, .25);--pico-contrast-inverse:#000;--pico-box-shadow:.0145rem .029rem .174rem rgba(7, 9, 12, .01698),.0335rem .067rem .402rem rgba(7, 9, 12, .024),.0625rem .125rem .75rem rgba(7, 9, 12, .03),.1125rem .225rem 1.35rem rgba(7, 9, 12, .036),.2085rem .417rem 2.502rem rgba(7, 9, 12, .04302),.5rem 1rem 6rem rgba(7, 9, 12, .06),0 0 0 .0625rem rgba(7, 9, 12, .015);--pico-h1-color:#f0f1f3;--pico-h2-color:#e0e3e7;--pico-h3-color:#c2c7d0;--pico-h4-color:#b3b9c5;--pico-h5-color:#a4acba;--pico-h6-color:#8891a4;--pico-mark-background-color:#014063;--pico-mark-color:#fff;--pico-ins-color:#62af9a;--pico-del-color:#ce7e7b;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#1a1f28;--pico-code-color:#8891a4;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#1c212c;--pico-form-element-selected-background-color:#2a3140;--pico-form-element-border-color:#2a3140;--pico-form-element-color:#e0e3e7;--pico-form-element-placeholder-color:#8891a4;--pico-form-element-active-background-color:#1a1f28;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#964a50;--pico-form-element-invalid-active-border-color:#b7403b;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#2a7b6f;--pico-form-element-valid-active-border-color:#16896a;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#333c4e;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#202632;--pico-range-active-border-color:#2a3140;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:#181c25;--pico-card-border-color:var(--pico-card-background-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#1a1f28;--pico-dropdown-background-color:#181c25;--pico-dropdown-border-color:#202632;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#202632;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(8, 9, 10, .75);--pico-progress-background-color:#202632;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(42, 123, 111)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(150, 74, 80)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:dark}:root:not([data-theme]) input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}:root:not([data-theme]) details summary[role=button].contrast:not(.outline):after{filter:brightness(0)}:root:not([data-theme]) [aria-busy=true]:not(input,select,textarea).contrast:is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0)}}[data-theme=dark]{--pico-background-color:#13171f;--pico-color:#c2c7d0;--pico-text-selection-color:rgba(0, 180, 120, .1875);--pico-muted-color:#7b8495;--pico-muted-border-color:#202632;--pico-primary:#00b478;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 180, 120, .5);--pico-primary-hover:#00cc88;--pico-primary-hover-background:#00895a;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 180, 120, .375);--pico-primary-inverse:#fff;--pico-secondary:#969eaf;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(150, 158, 175, .5);--pico-secondary-hover:#b3b9c5;--pico-secondary-hover-background:#5d6b89;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(144, 158, 190, .25);--pico-secondary-inverse:#fff;--pico-contrast:#dfe3eb;--pico-contrast-background:#eff1f4;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(223, 227, 235, .5);--pico-contrast-hover:#fff;--pico-contrast-hover-background:#fff;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-contrast-hover);--pico-contrast-focus:rgba(207, 213, 226, .25);--pico-contrast-inverse:#000;--pico-box-shadow:.0145rem .029rem .174rem rgba(7, 9, 12, .01698),.0335rem .067rem .402rem rgba(7, 9, 12, .024),.0625rem .125rem .75rem rgba(7, 9, 12, .03),.1125rem .225rem 1.35rem rgba(7, 9, 12, .036),.2085rem .417rem 2.502rem rgba(7, 9, 12, .04302),.5rem 1rem 6rem rgba(7, 9, 12, .06),0 0 0 .0625rem rgba(7, 9, 12, .015);--pico-h1-color:#f0f1f3;--pico-h2-color:#e0e3e7;--pico-h3-color:#c2c7d0;--pico-h4-color:#b3b9c5;--pico-h5-color:#a4acba;--pico-h6-color:#8891a4;--pico-mark-background-color:#014063;--pico-mark-color:#fff;--pico-ins-color:#62af9a;--pico-del-color:#ce7e7b;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#1a1f28;--pico-code-color:#8891a4;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#1c212c;--pico-form-element-selected-background-color:#2a3140;--pico-form-element-border-color:#2a3140;--pico-form-element-color:#e0e3e7;--pico-form-element-placeholder-color:#8891a4;--pico-form-element-active-background-color:#1a1f28;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#964a50;--pico-form-element-invalid-active-border-color:#b7403b;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#2a7b6f;--pico-form-element-valid-active-border-color:#16896a;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#333c4e;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#202632;--pico-range-active-border-color:#2a3140;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:#181c25;--pico-card-border-color:var(--pico-card-background-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#1a1f28;--pico-dropdown-background-color:#181c25;--pico-dropdown-border-color:#202632;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#202632;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(8, 9, 10, .75);--pico-progress-background-color:#202632;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(42, 123, 111)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(150, 74, 80)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:dark}[data-theme=dark] input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}[data-theme=dark] details summary[role=button].contrast:not(.outline):after{filter:brightness(0)}[data-theme=dark] [aria-busy=true]:not(input,select,textarea).contrast:is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0)}[type=checkbox],[type=radio],[type=range],progress{accent-color:var(--pico-primary)}*,:after,:before{box-sizing:border-box;background-repeat:no-repeat}:after,:before{text-decoration:inherit;vertical-align:inherit}:where(:root){-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--pico-background-color);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:var(--pico-font-size);line-height:var(--pico-line-height);font-family:var(--pico-font-family);text-underline-offset:var(--pico-text-underline-offset);text-rendering:optimizeLegibility;overflow-wrap:break-word;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{width:100%;margin:0}main{display:block}body>footer,body>header,body>main{padding-block:var(--pico-block-spacing-vertical)}section{margin-bottom:var(--pico-block-spacing-vertical)}.container,.container-fluid{width:100%;margin-right:auto;margin-left:auto;padding-right:var(--pico-spacing);padding-left:var(--pico-spacing)}@media (min-width:576px){.container{max-width:510px;padding-right:0;padding-left:0}}@media (min-width:768px){.container{max-width:700px}}@media (min-width:1024px){.container{max-width:950px}}@media (min-width:1280px){.container{max-width:1200px}}@media (min-width:1536px){.container{max-width:1450px}}.grid{grid-column-gap:var(--pico-grid-column-gap);grid-row-gap:var(--pico-grid-row-gap);display:grid;grid-template-columns:1fr}@media (min-width:768px){.grid{grid-template-columns:repeat(auto-fit,minmax(0%,1fr))}}.grid>*{min-width:0}.overflow-auto{overflow:auto}b,strong{font-weight:bolder}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}address,blockquote,dl,ol,p,pre,table,ul{margin-top:0;margin-bottom:var(--pico-typography-spacing-vertical);color:var(--pico-color);font-style:normal;font-weight:var(--pico-font-weight)}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:var(--pico-typography-spacing-vertical);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:var(--pico-font-size);line-height:var(--pico-line-height);font-family:var(--pico-font-family)}h1{--pico-color:var(--pico-h1-color)}h2{--pico-color:var(--pico-h2-color)}h3{--pico-color:var(--pico-h3-color)}h4{--pico-color:var(--pico-h4-color)}h5{--pico-color:var(--pico-h5-color)}h6{--pico-color:var(--pico-h6-color)}:where(article,address,blockquote,dl,figure,form,ol,p,pre,table,ul)~:is(h1,h2,h3,h4,h5,h6){margin-top:var(--pico-typography-spacing-top)}p{margin-bottom:var(--pico-typography-spacing-vertical)}hgroup{margin-bottom:var(--pico-typography-spacing-vertical)}hgroup>*{margin-top:0;margin-bottom:0}hgroup>:not(:first-child):last-child{--pico-color:var(--pico-muted-color);--pico-font-weight:unset;font-size:1rem}:where(ol,ul) li{margin-bottom:calc(var(--pico-typography-spacing-vertical) * .25)}:where(dl,ol,ul) :where(dl,ol,ul){margin:0;margin-top:calc(var(--pico-typography-spacing-vertical) * .25)}ul li{list-style:square}mark{padding:.125rem .25rem;background-color:var(--pico-mark-background-color);color:var(--pico-mark-color);vertical-align:baseline}blockquote{display:block;margin:var(--pico-typography-spacing-vertical) 0;padding:var(--pico-spacing);border-right:none;border-left:.25rem solid var(--pico-blockquote-border-color);border-inline-start:.25rem solid var(--pico-blockquote-border-color);border-inline-end:none}blockquote footer{margin-top:calc(var(--pico-typography-spacing-vertical) * .5);color:var(--pico-blockquote-footer-color)}abbr[title]{border-bottom:1px dotted;text-decoration:none;cursor:help}ins{color:var(--pico-ins-color);text-decoration:none}del{color:var(--pico-del-color)}::-moz-selection{background-color:var(--pico-text-selection-color)}::selection{background-color:var(--pico-text-selection-color)}:where(a:not([role=button])),[role=link]{--pico-color:var(--pico-primary);--pico-background-color:transparent;--pico-underline:var(--pico-primary-underline);outline:0;background-color:var(--pico-background-color);color:var(--pico-color);-webkit-text-decoration:var(--pico-text-decoration);text-decoration:var(--pico-text-decoration);text-decoration-color:var(--pico-underline);text-underline-offset:.125em;transition:background-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition),-webkit-text-decoration var(--pico-transition);transition:background-color var(--pico-transition),color var(--pico-transition),text-decoration var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),color var(--pico-transition),text-decoration var(--pico-transition),box-shadow var(--pico-transition),-webkit-text-decoration var(--pico-transition)}:where(a:not([role=button])):is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-primary-hover);--pico-underline:var(--pico-primary-hover-underline);--pico-text-decoration:underline}:where(a:not([role=button])):focus-visible,[role=link]:focus-visible{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}:where(a:not([role=button])).secondary,[role=link].secondary{--pico-color:var(--pico-secondary);--pico-underline:var(--pico-secondary-underline)}:where(a:not([role=button])).secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link].secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-secondary-hover);--pico-underline:var(--pico-secondary-hover-underline)}:where(a:not([role=button])).contrast,[role=link].contrast{--pico-color:var(--pico-contrast);--pico-underline:var(--pico-contrast-underline)}:where(a:not([role=button])).contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link].contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-contrast-hover);--pico-underline:var(--pico-contrast-hover-underline)}a[role=button]{display:inline-block}button{margin:0;overflow:visible;font-family:inherit;text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[role=button],[type=button],[type=file]::file-selector-button,[type=reset],[type=submit],button{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);--pico-color:var(--pico-primary-inverse);--pico-box-shadow:var(--pico-button-box-shadow, 0 0 0 rgba(0, 0, 0, 0));padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);border:var(--pico-border-width) solid var(--pico-border-color);border-radius:var(--pico-border-radius);outline:0;background-color:var(--pico-background-color);box-shadow:var(--pico-box-shadow);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:1rem;line-height:var(--pico-line-height);text-align:center;text-decoration:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}[role=button]:is(:hover,:active,:focus),[role=button]:is([aria-current]:not([aria-current=false])),[type=button]:is(:hover,:active,:focus),[type=button]:is([aria-current]:not([aria-current=false])),[type=file]::file-selector-button:is(:hover,:active,:focus),[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])),[type=reset]:is(:hover,:active,:focus),[type=reset]:is([aria-current]:not([aria-current=false])),[type=submit]:is(:hover,:active,:focus),[type=submit]:is([aria-current]:not([aria-current=false])),button:is(:hover,:active,:focus),button:is([aria-current]:not([aria-current=false])){--pico-background-color:var(--pico-primary-hover-background);--pico-border-color:var(--pico-primary-hover-border);--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0));--pico-color:var(--pico-primary-inverse)}[role=button]:focus,[role=button]:is([aria-current]:not([aria-current=false])):focus,[type=button]:focus,[type=button]:is([aria-current]:not([aria-current=false])):focus,[type=file]::file-selector-button:focus,[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])):focus,[type=reset]:focus,[type=reset]:is([aria-current]:not([aria-current=false])):focus,[type=submit]:focus,[type=submit]:is([aria-current]:not([aria-current=false])):focus,button:focus,button:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}[type=button],[type=reset],[type=submit]{margin-bottom:var(--pico-spacing)}:is(button,[type=submit],[type=button],[role=button]).secondary,[type=file]::file-selector-button,[type=reset]{--pico-background-color:var(--pico-secondary-background);--pico-border-color:var(--pico-secondary-border);--pico-color:var(--pico-secondary-inverse);cursor:pointer}:is(button,[type=submit],[type=button],[role=button]).secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=file]::file-selector-button:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:var(--pico-secondary-hover-background);--pico-border-color:var(--pico-secondary-hover-border);--pico-color:var(--pico-secondary-inverse)}:is(button,[type=submit],[type=button],[role=button]).secondary:focus,:is(button,[type=submit],[type=button],[role=button]).secondary:is([aria-current]:not([aria-current=false])):focus,[type=file]::file-selector-button:focus,[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])):focus,[type=reset]:focus,[type=reset]:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}:is(button,[type=submit],[type=button],[role=button]).contrast{--pico-background-color:var(--pico-contrast-background);--pico-border-color:var(--pico-contrast-border);--pico-color:var(--pico-contrast-inverse)}:is(button,[type=submit],[type=button],[role=button]).contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:var(--pico-contrast-hover-background);--pico-border-color:var(--pico-contrast-hover-border);--pico-color:var(--pico-contrast-inverse)}:is(button,[type=submit],[type=button],[role=button]).contrast:focus,:is(button,[type=submit],[type=button],[role=button]).contrast:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-contrast-focus)}:is(button,[type=submit],[type=button],[role=button]).outline,[type=reset].outline{--pico-background-color:transparent;--pico-color:var(--pico-primary);--pico-border-color:var(--pico-primary)}:is(button,[type=submit],[type=button],[role=button]).outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset].outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:transparent;--pico-color:var(--pico-primary-hover);--pico-border-color:var(--pico-primary-hover)}:is(button,[type=submit],[type=button],[role=button]).outline.secondary,[type=reset].outline{--pico-color:var(--pico-secondary);--pico-border-color:var(--pico-secondary)}:is(button,[type=submit],[type=button],[role=button]).outline.secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset].outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-secondary-hover);--pico-border-color:var(--pico-secondary-hover)}:is(button,[type=submit],[type=button],[role=button]).outline.contrast{--pico-color:var(--pico-contrast);--pico-border-color:var(--pico-contrast)}:is(button,[type=submit],[type=button],[role=button]).outline.contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-contrast-hover);--pico-border-color:var(--pico-contrast-hover)}:where(button,[type=submit],[type=reset],[type=button],[role=button])[disabled],:where(fieldset[disabled]) :is(button,[type=submit],[type=button],[type=reset],[role=button]){opacity:.5;pointer-events:none}:where(table){width:100%;border-collapse:collapse;border-spacing:0;text-indent:0}td,th{padding:calc(var(--pico-spacing)/ 2) var(--pico-spacing);border-bottom:var(--pico-border-width) solid var(--pico-table-border-color);background-color:var(--pico-background-color);color:var(--pico-color);font-weight:var(--pico-font-weight);text-align:left;text-align:start}tfoot td,tfoot th{border-top:var(--pico-border-width) solid var(--pico-table-border-color);border-bottom:0}table.striped tbody tr:nth-child(odd) td,table.striped tbody tr:nth-child(odd) th{background-color:var(--pico-table-row-stripped-background-color)}:where(audio,canvas,iframe,img,svg,video){vertical-align:middle}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}:where(iframe){border-style:none}img{max-width:100%;height:auto;border-style:none}:where(svg:not([fill])){fill:currentColor}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-size:.875em;font-family:var(--pico-font-family)}pre code{font-size:inherit;font-family:inherit}pre{-ms-overflow-style:scrollbar;overflow:auto}code,kbd,pre{border-radius:var(--pico-border-radius);background:var(--pico-code-background-color);color:var(--pico-code-color);font-weight:var(--pico-font-weight);line-height:initial}code,kbd{display:inline-block;padding:.375rem}pre{display:block;margin-bottom:var(--pico-spacing);overflow-x:auto}pre>code{display:block;padding:var(--pico-spacing);background:0 0;line-height:var(--pico-line-height)}kbd{background-color:var(--pico-code-kbd-background-color);color:var(--pico-code-kbd-color);vertical-align:baseline}figure{display:block;margin:0;padding:0}figure figcaption{padding:calc(var(--pico-spacing) * .5) 0;color:var(--pico-muted-color)}hr{height:0;margin:var(--pico-typography-spacing-vertical) 0;border:0;border-top:1px solid var(--pico-muted-border-color);color:inherit}[hidden],template{display:none!important}canvas{display:inline-block}input,optgroup,select,textarea{margin:0;font-size:1rem;line-height:var(--pico-line-height);font-family:inherit;letter-spacing:inherit}input{overflow:visible}select{text-transform:none}legend{max-width:100%;padding:0;color:inherit;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{padding:0}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}::-moz-focus-inner{padding:0;border-style:none}:-moz-focusring{outline:0}:-moz-ui-invalid{box-shadow:none}::-ms-expand{display:none}[type=file],[type=range]{padding:0;border-width:0}input:not([type=checkbox],[type=radio],[type=range]){height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2)}fieldset{width:100%;margin:0;margin-bottom:var(--pico-spacing);padding:0;border:0}fieldset legend,label{display:block;margin-bottom:calc(var(--pico-spacing) * .375);color:var(--pico-color);font-weight:var(--pico-form-label-font-weight,var(--pico-font-weight))}fieldset legend{margin-bottom:calc(var(--pico-spacing) * .5)}button[type=submit],input:not([type=checkbox],[type=radio]),select,textarea{width:100%}input:not([type=checkbox],[type=radio],[type=range],[type=file]),select,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal)}input,select,textarea{--pico-background-color:var(--pico-form-element-background-color);--pico-border-color:var(--pico-form-element-border-color);--pico-color:var(--pico-form-element-color);--pico-box-shadow:none;border:var(--pico-border-width) solid var(--pico-border-color);border-radius:var(--pico-border-radius);outline:0;background-color:var(--pico-background-color);box-shadow:var(--pico-box-shadow);color:var(--pico-color);font-weight:var(--pico-font-weight);transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}:where(select,textarea):not([readonly]):is(:active,:focus),input:not([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[readonly]):is(:active,:focus){--pico-background-color:var(--pico-form-element-active-background-color)}:where(select,textarea):not([readonly]):is(:active,:focus),input:not([type=submit],[type=button],[type=reset],[role=switch],[readonly]):is(:active,:focus){--pico-border-color:var(--pico-form-element-active-border-color)}:where(select,textarea):not([readonly]):focus,input:not([type=submit],[type=button],[type=reset],[type=range],[type=file],[readonly]):focus{--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-focus-color)}:where(fieldset[disabled]) :is(input:not([type=submit],[type=button],[type=reset]),select,textarea),input:not([type=submit],[type=button],[type=reset])[disabled],label[aria-disabled=true],select[disabled],textarea[disabled]{opacity:var(--pico-form-element-disabled-opacity);pointer-events:none}label[aria-disabled=true] input[disabled]{opacity:1}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid]{padding-right:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem)!important;padding-left:var(--pico-form-element-spacing-horizontal);padding-inline-start:var(--pico-form-element-spacing-horizontal)!important;padding-inline-end:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem)!important;background-position:center right .75rem;background-size:1rem auto;background-repeat:no-repeat}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid=false]:not(select){background-image:var(--pico-icon-valid)}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid=true]:not(select){background-image:var(--pico-icon-invalid)}:where(input,select,textarea)[aria-invalid=false]{--pico-border-color:var(--pico-form-element-valid-border-color)}:where(input,select,textarea)[aria-invalid=false]:is(:active,:focus){--pico-border-color:var(--pico-form-element-valid-active-border-color)!important}:where(input,select,textarea)[aria-invalid=false]:is(:active,:focus):not([type=checkbox],[type=radio]){--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-valid-focus-color)!important}:where(input,select,textarea)[aria-invalid=true]{--pico-border-color:var(--pico-form-element-invalid-border-color)}:where(input,select,textarea)[aria-invalid=true]:is(:active,:focus){--pico-border-color:var(--pico-form-element-invalid-active-border-color)!important}:where(input,select,textarea)[aria-invalid=true]:is(:active,:focus):not([type=checkbox],[type=radio]){--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-invalid-focus-color)!important}[dir=rtl] :where(input,select,textarea):not([type=checkbox],[type=radio]):is([aria-invalid],[aria-invalid=true],[aria-invalid=false]){background-position:center left .75rem}input::-webkit-input-placeholder,input::placeholder,select:invalid,textarea::-webkit-input-placeholder,textarea::placeholder{color:var(--pico-form-element-placeholder-color);opacity:1}input:not([type=checkbox],[type=radio]),select,textarea{margin-bottom:var(--pico-spacing)}select::-ms-expand{border:0;background-color:transparent}select:not([multiple],[size]){padding-right:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem);padding-left:var(--pico-form-element-spacing-horizontal);padding-inline-start:var(--pico-form-element-spacing-horizontal);padding-inline-end:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem);background-image:var(--pico-icon-chevron);background-position:center right .75rem;background-size:1rem auto;background-repeat:no-repeat}select[multiple] option:checked{background:var(--pico-form-element-selected-background-color)}[dir=rtl] select:not([multiple],[size]){background-position:center left .75rem}textarea{display:block;resize:vertical}textarea[aria-invalid]{--pico-icon-height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2);background-position:top right .75rem!important;background-size:1rem var(--pico-icon-height)!important}:where(input,select,textarea,fieldset,.grid)+small{display:block;width:100%;margin-top:calc(var(--pico-spacing) * -.75);margin-bottom:var(--pico-spacing);color:var(--pico-muted-color)}:where(input,select,textarea,fieldset,.grid)[aria-invalid=false]+small{color:var(--pico-ins-color)}:where(input,select,textarea,fieldset,.grid)[aria-invalid=true]+small{color:var(--pico-del-color)}label>:where(input,select,textarea){margin-top:calc(var(--pico-spacing) * .25)}label:has([type=checkbox],[type=radio]){width:-moz-fit-content;width:fit-content;cursor:pointer}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:1.25em;height:1.25em;margin-top:-.125em;margin-inline-end:.5em;border-width:var(--pico-border-width);vertical-align:middle;cursor:pointer}[type=checkbox]::-ms-check,[type=radio]::-ms-check{display:none}[type=checkbox]:checked,[type=checkbox]:checked:active,[type=checkbox]:checked:focus,[type=radio]:checked,[type=radio]:checked:active,[type=radio]:checked:focus{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);background-image:var(--pico-icon-checkbox);background-position:center;background-size:.75em auto;background-repeat:no-repeat}[type=checkbox]~label,[type=radio]~label{display:inline-block;margin-bottom:0;cursor:pointer}[type=checkbox]~label:not(:last-of-type),[type=radio]~label:not(:last-of-type){margin-inline-end:1em}[type=checkbox]:indeterminate{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);background-image:var(--pico-icon-minus);background-position:center;background-size:.75em auto;background-repeat:no-repeat}[type=radio]{border-radius:50%}[type=radio]:checked,[type=radio]:checked:active,[type=radio]:checked:focus{--pico-background-color:var(--pico-primary-inverse);border-width:.35em;background-image:none}[type=checkbox][role=switch]{--pico-background-color:var(--pico-switch-background-color);--pico-color:var(--pico-switch-color);width:2.25em;height:1.25em;border:var(--pico-border-width) solid var(--pico-border-color);border-radius:1.25em;background-color:var(--pico-background-color);line-height:1.25em}[type=checkbox][role=switch]:not([aria-invalid]){--pico-border-color:var(--pico-switch-background-color)}[type=checkbox][role=switch]:before{display:block;width:calc(1.25em - var(--pico-border-width) * 2);height:100%;border-radius:50%;background-color:var(--pico-color);box-shadow:var(--pico-switch-thumb-box-shadow);content:"";transition:margin .1s ease-in-out}[type=checkbox][role=switch]:focus{--pico-background-color:var(--pico-switch-background-color);--pico-border-color:var(--pico-switch-background-color)}[type=checkbox][role=switch]:checked{--pico-background-color:var(--pico-switch-checked-background-color);--pico-border-color:var(--pico-switch-checked-background-color);background-image:none}[type=checkbox][role=switch]:checked:before{margin-inline-start:calc(1.125em - var(--pico-border-width))}[type=checkbox][role=switch][disabled]{--pico-background-color:var(--pico-border-color)}[type=checkbox][aria-invalid=false]:checked,[type=checkbox][aria-invalid=false]:checked:active,[type=checkbox][aria-invalid=false]:checked:focus,[type=checkbox][role=switch][aria-invalid=false]:checked,[type=checkbox][role=switch][aria-invalid=false]:checked:active,[type=checkbox][role=switch][aria-invalid=false]:checked:focus{--pico-background-color:var(--pico-form-element-valid-border-color)}[type=checkbox]:checked:active[aria-invalid=true],[type=checkbox]:checked:focus[aria-invalid=true],[type=checkbox]:checked[aria-invalid=true],[type=checkbox][role=switch]:checked:active[aria-invalid=true],[type=checkbox][role=switch]:checked:focus[aria-invalid=true],[type=checkbox][role=switch]:checked[aria-invalid=true]{--pico-background-color:var(--pico-form-element-invalid-border-color)}[type=checkbox][aria-invalid=false]:checked,[type=checkbox][aria-invalid=false]:checked:active,[type=checkbox][aria-invalid=false]:checked:focus,[type=checkbox][role=switch][aria-invalid=false]:checked,[type=checkbox][role=switch][aria-invalid=false]:checked:active,[type=checkbox][role=switch][aria-invalid=false]:checked:focus,[type=radio][aria-invalid=false]:checked,[type=radio][aria-invalid=false]:checked:active,[type=radio][aria-invalid=false]:checked:focus{--pico-border-color:var(--pico-form-element-valid-border-color)}[type=checkbox]:checked:active[aria-invalid=true],[type=checkbox]:checked:focus[aria-invalid=true],[type=checkbox]:checked[aria-invalid=true],[type=checkbox][role=switch]:checked:active[aria-invalid=true],[type=checkbox][role=switch]:checked:focus[aria-invalid=true],[type=checkbox][role=switch]:checked[aria-invalid=true],[type=radio]:checked:active[aria-invalid=true],[type=radio]:checked:focus[aria-invalid=true],[type=radio]:checked[aria-invalid=true]{--pico-border-color:var(--pico-form-element-invalid-border-color)}[type=color]::-webkit-color-swatch-wrapper{padding:0}[type=color]::-moz-focus-inner{padding:0}[type=color]::-webkit-color-swatch{border:0;border-radius:calc(var(--pico-border-radius) * .5)}[type=color]::-moz-color-swatch{border:0;border-radius:calc(var(--pico-border-radius) * .5)}input:not([type=checkbox],[type=radio],[type=range],[type=file]):is([type=date],[type=datetime-local],[type=month],[type=time],[type=week]){--pico-icon-position:.75rem;--pico-icon-width:1rem;padding-right:calc(var(--pico-icon-width) + var(--pico-icon-position));background-image:var(--pico-icon-date);background-position:center right var(--pico-icon-position);background-size:var(--pico-icon-width) auto;background-repeat:no-repeat}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=time]{background-image:var(--pico-icon-time)}[type=date]::-webkit-calendar-picker-indicator,[type=datetime-local]::-webkit-calendar-picker-indicator,[type=month]::-webkit-calendar-picker-indicator,[type=time]::-webkit-calendar-picker-indicator,[type=week]::-webkit-calendar-picker-indicator{width:var(--pico-icon-width);margin-right:calc(var(--pico-icon-width) * -1);margin-left:var(--pico-icon-position);opacity:0}@-moz-document url-prefix(){[type=date],[type=datetime-local],[type=month],[type=time],[type=week]{padding-right:var(--pico-form-element-spacing-horizontal)!important;background-image:none!important}}[dir=rtl] :is([type=date],[type=datetime-local],[type=month],[type=time],[type=week]){text-align:right}[type=file]{--pico-color:var(--pico-muted-color);margin-left:calc(var(--pico-outline-width) * -1);padding:calc(var(--pico-form-element-spacing-vertical) * .5) 0;padding-left:var(--pico-outline-width);border:0;border-radius:0;background:0 0}[type=file]::file-selector-button{margin-right:calc(var(--pico-spacing)/ 2);padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal)}[type=file]:is(:hover,:active,:focus)::file-selector-button{--pico-background-color:var(--pico-secondary-hover-background);--pico-border-color:var(--pico-secondary-hover-border)}[type=file]:focus::file-selector-button{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:1.25rem;background:0 0}[type=range]::-webkit-slider-runnable-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-webkit-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-moz-range-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-moz-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-ms-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-ms-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-webkit-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]::-moz-range-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-moz-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]::-ms-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-ms-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]:active,[type=range]:focus-within{--pico-range-border-color:var(--pico-range-active-border-color);--pico-range-thumb-color:var(--pico-range-thumb-active-color)}[type=range]:active::-webkit-slider-thumb{transform:scale(1.25)}[type=range]:active::-moz-range-thumb{transform:scale(1.25)}[type=range]:active::-ms-thumb{transform:scale(1.25)}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search]{padding-inline-start:calc(var(--pico-form-element-spacing-horizontal) + 1.75rem);background-image:var(--pico-icon-search);background-position:center left calc(var(--pico-form-element-spacing-horizontal) + .125rem);background-size:1rem auto;background-repeat:no-repeat}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid]{padding-inline-start:calc(var(--pico-form-element-spacing-horizontal) + 1.75rem)!important;background-position:center left 1.125rem,center right .75rem}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid=false]{background-image:var(--pico-icon-search),var(--pico-icon-valid)}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid=true]{background-image:var(--pico-icon-search),var(--pico-icon-invalid)}[dir=rtl] :where(input):not([type=checkbox],[type=radio],[type=range],[type=file])[type=search]{background-position:center right 1.125rem}[dir=rtl] :where(input):not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid]{background-position:center right 1.125rem,center left .75rem}details{display:block;margin-bottom:var(--pico-spacing)}details summary{line-height:1rem;list-style-type:none;cursor:pointer;transition:color var(--pico-transition)}details summary:not([role]){color:var(--pico-accordion-close-summary-color)}details summary::-webkit-details-marker{display:none}details summary::marker{display:none}details summary::-moz-list-bullet{list-style-type:none}details summary:after{display:block;width:1rem;height:1rem;margin-inline-start:calc(var(--pico-spacing,1rem) * .5);float:right;transform:rotate(-90deg);background-image:var(--pico-icon-chevron);background-position:right center;background-size:1rem auto;background-repeat:no-repeat;content:"";transition:transform var(--pico-transition)}details summary:focus{outline:0}details summary:focus:not([role]){color:var(--pico-accordion-active-summary-color)}details summary:focus-visible:not([role]){outline:var(--pico-outline-width) solid var(--pico-primary-focus);outline-offset:calc(var(--pico-spacing,1rem) * .5);color:var(--pico-primary)}details summary[role=button]{width:100%;text-align:left}details summary[role=button]:after{height:calc(1rem * var(--pico-line-height,1.5))}details[open]>summary{margin-bottom:var(--pico-spacing)}details[open]>summary:not([role]):not(:focus){color:var(--pico-accordion-open-summary-color)}details[open]>summary:after{transform:rotate(0)}[dir=rtl] details summary{text-align:right}[dir=rtl] details summary:after{float:left;background-position:left center}article{margin-bottom:var(--pico-block-spacing-vertical);padding:var(--pico-block-spacing-vertical) var(--pico-block-spacing-horizontal);border-radius:var(--pico-border-radius);background:var(--pico-card-background-color);box-shadow:var(--pico-card-box-shadow)}article>footer,article>header{margin-right:calc(var(--pico-block-spacing-horizontal) * -1);margin-left:calc(var(--pico-block-spacing-horizontal) * -1);padding:calc(var(--pico-block-spacing-vertical) * .66) var(--pico-block-spacing-horizontal);background-color:var(--pico-card-sectioning-background-color)}article>header{margin-top:calc(var(--pico-block-spacing-vertical) * -1);margin-bottom:var(--pico-block-spacing-vertical);border-bottom:var(--pico-border-width) solid var(--pico-card-border-color);border-top-right-radius:var(--pico-border-radius);border-top-left-radius:var(--pico-border-radius)}article>footer{margin-top:var(--pico-block-spacing-vertical);margin-bottom:calc(var(--pico-block-spacing-vertical) * -1);border-top:var(--pico-border-width) solid var(--pico-card-border-color);border-bottom-right-radius:var(--pico-border-radius);border-bottom-left-radius:var(--pico-border-radius)}details.dropdown{position:relative;border-bottom:none}details.dropdown summary:after,details.dropdown>a:after,details.dropdown>button:after{display:block;width:1rem;height:calc(1rem * var(--pico-line-height,1.5));margin-inline-start:.25rem;float:right;transform:rotate(0) translate(.2rem);background-image:var(--pico-icon-chevron);background-position:right center;background-size:1rem auto;background-repeat:no-repeat;content:""}nav details.dropdown{margin-bottom:0}details.dropdown summary:not([role]){height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2);padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);border:var(--pico-border-width) solid var(--pico-form-element-border-color);border-radius:var(--pico-border-radius);background-color:var(--pico-form-element-background-color);color:var(--pico-form-element-placeholder-color);line-height:inherit;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}details.dropdown summary:not([role]):active,details.dropdown summary:not([role]):focus{border-color:var(--pico-form-element-active-border-color);background-color:var(--pico-form-element-active-background-color)}details.dropdown summary:not([role]):focus{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-focus-color)}details.dropdown summary:not([role]):focus-visible{outline:0}details.dropdown summary:not([role])[aria-invalid=false]{--pico-form-element-border-color:var(--pico-form-element-valid-border-color);--pico-form-element-active-border-color:var(--pico-form-element-valid-focus-color);--pico-form-element-focus-color:var(--pico-form-element-valid-focus-color)}details.dropdown summary:not([role])[aria-invalid=true]{--pico-form-element-border-color:var(--pico-form-element-invalid-border-color);--pico-form-element-active-border-color:var(--pico-form-element-invalid-focus-color);--pico-form-element-focus-color:var(--pico-form-element-invalid-focus-color)}nav details.dropdown{display:inline;margin:calc(var(--pico-nav-element-spacing-vertical) * -1) 0}nav details.dropdown summary:after{transform:rotate(0) translate(0)}nav details.dropdown summary:not([role]){height:calc(1rem * var(--pico-line-height) + var(--pico-nav-link-spacing-vertical) * 2);padding:calc(var(--pico-nav-link-spacing-vertical) - var(--pico-border-width) * 2) var(--pico-nav-link-spacing-horizontal)}nav details.dropdown summary:not([role]):focus-visible{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}details.dropdown summary+ul{display:flex;z-index:99;position:absolute;left:0;flex-direction:column;width:100%;min-width:-moz-fit-content;min-width:fit-content;margin:0;margin-top:var(--pico-outline-width);padding:0;border:var(--pico-border-width) solid var(--pico-dropdown-border-color);border-radius:var(--pico-border-radius);background-color:var(--pico-dropdown-background-color);box-shadow:var(--pico-dropdown-box-shadow);color:var(--pico-dropdown-color);white-space:nowrap;opacity:0;transition:opacity var(--pico-transition),transform 0s ease-in-out 1s}details.dropdown summary+ul[dir=rtl]{right:0;left:auto}details.dropdown summary+ul li{width:100%;margin-bottom:0;padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal);list-style:none}details.dropdown summary+ul li:first-of-type{margin-top:calc(var(--pico-form-element-spacing-vertical) * .5)}details.dropdown summary+ul li:last-of-type{margin-bottom:calc(var(--pico-form-element-spacing-vertical) * .5)}details.dropdown summary+ul li a{display:block;margin:calc(var(--pico-form-element-spacing-vertical) * -.5) calc(var(--pico-form-element-spacing-horizontal) * -1);padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal);overflow:hidden;border-radius:0;color:var(--pico-dropdown-color);text-decoration:none;text-overflow:ellipsis}details.dropdown summary+ul li a:active,details.dropdown summary+ul li a:focus,details.dropdown summary+ul li a:focus-visible,details.dropdown summary+ul li a:hover,details.dropdown summary+ul li a[aria-current]:not([aria-current=false]){background-color:var(--pico-dropdown-hover-background-color)}details.dropdown summary+ul li label{width:100%}details.dropdown summary+ul li:has(label):hover{background-color:var(--pico-dropdown-hover-background-color)}details.dropdown[open] summary{margin-bottom:0}details.dropdown[open] summary+ul{transform:scaleY(1);opacity:1;transition:opacity var(--pico-transition),transform 0s ease-in-out 0s}details.dropdown[open] summary:before{display:block;z-index:1;position:fixed;width:100vw;height:100vh;top:0;right:0;bottom:0;left:0;background:0 0;content:"";cursor:default}label>details.dropdown{margin-top:calc(var(--pico-spacing) * .25)}[role=group],[role=search]{display:inline-flex;position:relative;width:100%;margin-bottom:var(--pico-spacing);border-radius:var(--pico-border-radius);box-shadow:var(--pico-group-box-shadow,0 0 0 transparent);vertical-align:middle;transition:box-shadow var(--pico-transition)}[role=group] input:not([type=checkbox],[type=radio]),[role=group] select,[role=group]>*,[role=search] input:not([type=checkbox],[type=radio]),[role=search] select,[role=search]>*{position:relative;flex:1 1 auto;margin-bottom:0}[role=group] input:not([type=checkbox],[type=radio]):not(:first-child),[role=group] select:not(:first-child),[role=group]>:not(:first-child),[role=search] input:not([type=checkbox],[type=radio]):not(:first-child),[role=search] select:not(:first-child),[role=search]>:not(:first-child){margin-left:0;border-top-left-radius:0;border-bottom-left-radius:0}[role=group] input:not([type=checkbox],[type=radio]):not(:last-child),[role=group] select:not(:last-child),[role=group]>:not(:last-child),[role=search] input:not([type=checkbox],[type=radio]):not(:last-child),[role=search] select:not(:last-child),[role=search]>:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}[role=group] input:not([type=checkbox],[type=radio]):focus,[role=group] select:focus,[role=group]>:focus,[role=search] input:not([type=checkbox],[type=radio]):focus,[role=search] select:focus,[role=search]>:focus{z-index:2}[role=group] [role=button]:not(:first-child),[role=group] [type=button]:not(:first-child),[role=group] [type=reset]:not(:first-child),[role=group] [type=submit]:not(:first-child),[role=group] button:not(:first-child),[role=group] input:not([type=checkbox],[type=radio]):not(:first-child),[role=group] select:not(:first-child),[role=search] [role=button]:not(:first-child),[role=search] [type=button]:not(:first-child),[role=search] [type=reset]:not(:first-child),[role=search] [type=submit]:not(:first-child),[role=search] button:not(:first-child),[role=search] input:not([type=checkbox],[type=radio]):not(:first-child),[role=search] select:not(:first-child){margin-left:calc(var(--pico-border-width) * -1)}[role=group] [role=button],[role=group] [type=button],[role=group] [type=reset],[role=group] [type=submit],[role=group] button,[role=search] [role=button],[role=search] [type=button],[role=search] [type=reset],[role=search] [type=submit],[role=search] button{width:auto}@supports selector(:has(*)){[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus),[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus){--pico-group-box-shadow:var(--pico-group-box-shadow-focus-with-button)}[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) input:not([type=checkbox],[type=radio]),[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) select,[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) input:not([type=checkbox],[type=radio]),[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) select{border-color:transparent}[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus),[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus){--pico-group-box-shadow:var(--pico-group-box-shadow-focus-with-input)}[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [role=button],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=button],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=submit],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) button,[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [role=button],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=button],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=submit],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) button{--pico-button-box-shadow:0 0 0 var(--pico-border-width) var(--pico-primary-border);--pico-button-hover-box-shadow:0 0 0 var(--pico-border-width) var(--pico-primary-hover-border)}[role=group] [role=button]:focus,[role=group] [type=button]:focus,[role=group] [type=reset]:focus,[role=group] [type=submit]:focus,[role=group] button:focus,[role=search] [role=button]:focus,[role=search] [type=button]:focus,[role=search] [type=reset]:focus,[role=search] [type=submit]:focus,[role=search] button:focus{box-shadow:none}}[role=search]>:first-child{border-top-left-radius:5rem;border-bottom-left-radius:5rem}[role=search]>:last-child{border-top-right-radius:5rem;border-bottom-right-radius:5rem}[aria-busy=true]:not(input,select,textarea,html){white-space:nowrap}[aria-busy=true]:not(input,select,textarea,html):before{display:inline-block;width:1em;height:1em;background-image:var(--pico-icon-loading);background-size:1rem auto;background-repeat:no-repeat;content:"";vertical-align:-.125em}[aria-busy=true]:not(input,select,textarea,html):not(:empty):before{margin-inline-end:calc(var(--pico-spacing) * .5)}[aria-busy=true]:not(input,select,textarea,html):empty{text-align:center}[role=button][aria-busy=true],[type=button][aria-busy=true],[type=reset][aria-busy=true],[type=submit][aria-busy=true],a[aria-busy=true],button[aria-busy=true]{pointer-events:none}:root{--pico-scrollbar-width:0px}dialog{display:flex;z-index:999;position:fixed;top:0;right:0;bottom:0;left:0;align-items:center;justify-content:center;width:inherit;min-width:100%;height:inherit;min-height:100%;padding:0;border:0;-webkit-backdrop-filter:var(--pico-modal-overlay-backdrop-filter);backdrop-filter:var(--pico-modal-overlay-backdrop-filter);background-color:var(--pico-modal-overlay-background-color);color:var(--pico-color)}dialog article{width:100%;max-height:calc(100vh - var(--pico-spacing) * 2);margin:var(--pico-spacing);overflow:auto}@media (min-width:576px){dialog article{max-width:510px}}@media (min-width:768px){dialog article{max-width:700px}}dialog article>header>*{margin-bottom:0}dialog article>header .close,dialog article>header :is(a,button)[rel=prev]{margin:0;margin-left:var(--pico-spacing);padding:0;float:right}dialog article>footer{text-align:right}dialog article>footer [role=button],dialog article>footer button{margin-bottom:0}dialog article>footer [role=button]:not(:first-of-type),dialog article>footer button:not(:first-of-type){margin-left:calc(var(--pico-spacing) * .5)}dialog article .close,dialog article :is(a,button)[rel=prev]{display:block;width:1rem;height:1rem;margin-top:calc(var(--pico-spacing) * -1);margin-bottom:var(--pico-spacing);margin-left:auto;border:none;background-image:var(--pico-icon-close);background-position:center;background-size:auto 1rem;background-repeat:no-repeat;background-color:transparent;opacity:.5;transition:opacity var(--pico-transition)}dialog article .close:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),dialog article :is(a,button)[rel=prev]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){opacity:1}dialog:not([open]),dialog[open=false]{display:none}.modal-is-open{padding-right:var(--pico-scrollbar-width,0);overflow:hidden;pointer-events:none;touch-action:none}.modal-is-open dialog{pointer-events:auto;touch-action:auto}:where(.modal-is-opening,.modal-is-closing) dialog,:where(.modal-is-opening,.modal-is-closing) dialog>article{animation-duration:.2s;animation-timing-function:ease-in-out;animation-fill-mode:both}:where(.modal-is-opening,.modal-is-closing) dialog{animation-duration:.8s;animation-name:modal-overlay}:where(.modal-is-opening,.modal-is-closing) dialog>article{animation-delay:.2s;animation-name:modal}.modal-is-closing dialog,.modal-is-closing dialog>article{animation-delay:0s;animation-direction:reverse}@keyframes modal-overlay{0%{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:transparent}}@keyframes modal{0%{transform:translateY(-100%);opacity:0}}:where(nav li):before{float:left;content:"​"}nav,nav ul{display:flex}nav{justify-content:space-between;overflow:visible}nav ol,nav ul{align-items:center;margin-bottom:0;padding:0;list-style:none}nav ol:first-of-type,nav ul:first-of-type{margin-left:calc(var(--pico-nav-element-spacing-horizontal) * -1)}nav ol:last-of-type,nav ul:last-of-type{margin-right:calc(var(--pico-nav-element-spacing-horizontal) * -1)}nav li{display:inline-block;margin:0;padding:var(--pico-nav-element-spacing-vertical) var(--pico-nav-element-spacing-horizontal)}nav li :where(a,[role=link]){display:inline-block;margin:calc(var(--pico-nav-link-spacing-vertical) * -1) calc(var(--pico-nav-link-spacing-horizontal) * -1);padding:var(--pico-nav-link-spacing-vertical) var(--pico-nav-link-spacing-horizontal);border-radius:var(--pico-border-radius)}nav li :where(a,[role=link]):not(:hover){text-decoration:none}nav li [role=button],nav li button,nav li input:not([type=checkbox],[type=radio],[type=range],[type=file]),nav li select{height:auto;margin-right:inherit;margin-bottom:0;margin-left:inherit;padding:calc(var(--pico-nav-link-spacing-vertical) - var(--pico-border-width) * 2) var(--pico-nav-link-spacing-horizontal)}nav[aria-label=breadcrumb]{align-items:center;justify-content:start}nav[aria-label=breadcrumb] ul li:not(:first-child){margin-inline-start:var(--pico-nav-link-spacing-horizontal)}nav[aria-label=breadcrumb] ul li a{margin:calc(var(--pico-nav-link-spacing-vertical) * -1) 0;margin-inline-start:calc(var(--pico-nav-link-spacing-horizontal) * -1)}nav[aria-label=breadcrumb] ul li:not(:last-child):after{display:inline-block;position:absolute;width:calc(var(--pico-nav-link-spacing-horizontal) * 4);margin:0 calc(var(--pico-nav-link-spacing-horizontal) * -1);content:var(--pico-nav-breadcrumb-divider);color:var(--pico-muted-color);text-align:center;text-decoration:none;white-space:nowrap}nav[aria-label=breadcrumb] a[aria-current]:not([aria-current=false]){background-color:transparent;color:inherit;text-decoration:none;pointer-events:none}aside li,aside nav,aside ol,aside ul{display:block}aside li{padding:calc(var(--pico-nav-element-spacing-vertical) * .5) var(--pico-nav-element-spacing-horizontal)}aside li a{display:block}aside li [role=button]{margin:inherit}[dir=rtl] nav[aria-label=breadcrumb] ul li:not(:last-child) :after{content:"\\"}progress{display:inline-block;vertical-align:baseline}progress{-webkit-appearance:none;-moz-appearance:none;display:inline-block;appearance:none;width:100%;height:.5rem;margin-bottom:calc(var(--pico-spacing) * .5);overflow:hidden;border:0;border-radius:var(--pico-border-radius);background-color:var(--pico-progress-background-color);color:var(--pico-progress-color)}progress::-webkit-progress-bar{border-radius:var(--pico-border-radius);background:0 0}progress[value]::-webkit-progress-value{background-color:var(--pico-progress-color);-webkit-transition:inline-size var(--pico-transition);transition:inline-size var(--pico-transition)}progress::-moz-progress-bar{background-color:var(--pico-progress-color)}@media (prefers-reduced-motion:no-preference){progress:indeterminate{background:var(--pico-progress-background-color) linear-gradient(to right,var(--pico-progress-color) 30%,var(--pico-progress-background-color) 30%) top left/150% 150% no-repeat;animation:progress-indeterminate 1s linear infinite}progress:indeterminate[value]::-webkit-progress-value{background-color:transparent}progress:indeterminate::-moz-progress-bar{background-color:transparent}}@media (prefers-reduced-motion:no-preference){[dir=rtl] progress:indeterminate{animation-direction:reverse}}@keyframes progress-indeterminate{0%{background-position:200% 0}to{background-position:-200% 0}}[data-tooltip]{position:relative}[data-tooltip]:not(a,button,input){border-bottom:1px dotted;text-decoration:none;cursor:help}[data-tooltip]:after,[data-tooltip]:before,[data-tooltip][data-placement=top]:after,[data-tooltip][data-placement=top]:before{display:block;z-index:99;position:absolute;bottom:100%;left:50%;padding:.25rem .5rem;overflow:hidden;transform:translate(-50%,-.25rem);border-radius:var(--pico-border-radius);background:var(--pico-tooltip-background-color);content:attr(data-tooltip);color:var(--pico-tooltip-color);font-style:normal;font-weight:var(--pico-font-weight);font-size:.875rem;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;opacity:0;pointer-events:none}[data-tooltip]:after,[data-tooltip][data-placement=top]:after{padding:0;transform:translate(-50%);border-top:.3rem solid;border-right:.3rem solid transparent;border-left:.3rem solid transparent;border-radius:0;background-color:transparent;content:"";color:var(--pico-tooltip-background-color)}[data-tooltip][data-placement=bottom]:after,[data-tooltip][data-placement=bottom]:before{top:100%;bottom:auto;transform:translate(-50%,.25rem)}[data-tooltip][data-placement=bottom]:after{transform:translate(-50%,-.3rem);border:.3rem solid transparent;border-bottom:.3rem solid}[data-tooltip][data-placement=left]:after,[data-tooltip][data-placement=left]:before{top:50%;right:100%;bottom:auto;left:auto;transform:translate(-.25rem,-50%)}[data-tooltip][data-placement=left]:after{transform:translate(.3rem,-50%);border:.3rem solid transparent;border-left:.3rem solid}[data-tooltip][data-placement=right]:after,[data-tooltip][data-placement=right]:before{top:50%;right:auto;bottom:auto;left:100%;transform:translate(.25rem,-50%)}[data-tooltip][data-placement=right]:after{transform:translate(-.3rem,-50%);border:.3rem solid transparent;border-right:.3rem solid}[data-tooltip]:focus:after,[data-tooltip]:focus:before,[data-tooltip]:hover:after,[data-tooltip]:hover:before{opacity:1}@media (hover:hover) and (pointer:fine){[data-tooltip]:focus:after,[data-tooltip]:focus:before,[data-tooltip]:hover:after,[data-tooltip]:hover:before{--pico-tooltip-slide-to:translate(-50%, -.25rem);transform:translate(-50%,.75rem);animation-duration:.2s;animation-fill-mode:forwards;animation-name:tooltip-slide;opacity:0}[data-tooltip]:focus:after,[data-tooltip]:hover:after{--pico-tooltip-caret-slide-to:translate(-50%, 0rem);transform:translate(-50%,-.25rem);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=bottom]:focus:after,[data-tooltip][data-placement=bottom]:focus:before,[data-tooltip][data-placement=bottom]:hover:after,[data-tooltip][data-placement=bottom]:hover:before{--pico-tooltip-slide-to:translate(-50%, .25rem);transform:translate(-50%,-.75rem);animation-name:tooltip-slide}[data-tooltip][data-placement=bottom]:focus:after,[data-tooltip][data-placement=bottom]:hover:after{--pico-tooltip-caret-slide-to:translate(-50%, -.3rem);transform:translate(-50%,-.5rem);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=left]:focus:after,[data-tooltip][data-placement=left]:focus:before,[data-tooltip][data-placement=left]:hover:after,[data-tooltip][data-placement=left]:hover:before{--pico-tooltip-slide-to:translate(-.25rem, -50%);transform:translate(.75rem,-50%);animation-name:tooltip-slide}[data-tooltip][data-placement=left]:focus:after,[data-tooltip][data-placement=left]:hover:after{--pico-tooltip-caret-slide-to:translate(.3rem, -50%);transform:translate(.05rem,-50%);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=right]:focus:after,[data-tooltip][data-placement=right]:focus:before,[data-tooltip][data-placement=right]:hover:after,[data-tooltip][data-placement=right]:hover:before{--pico-tooltip-slide-to:translate(.25rem, -50%);transform:translate(-.75rem,-50%);animation-name:tooltip-slide}[data-tooltip][data-placement=right]:focus:after,[data-tooltip][data-placement=right]:hover:after{--pico-tooltip-caret-slide-to:translate(-.3rem, -50%);transform:translate(-.05rem,-50%);animation-name:tooltip-caret-slide}}@keyframes tooltip-slide{to{transform:var(--pico-tooltip-slide-to);opacity:1}}@keyframes tooltip-caret-slide{50%{opacity:0}to{transform:var(--pico-tooltip-caret-slide-to);opacity:1}}[aria-controls]{cursor:pointer}[aria-disabled=true],[disabled]{cursor:not-allowed}[aria-hidden=false][hidden]{display:initial}[aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);position:absolute}[tabindex],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation}[dir=rtl]{direction:rtl}@media (prefers-reduced-motion:reduce){:not([aria-busy=true]),:not([aria-busy=true]):after,:not([aria-busy=true]):before{background-attachment:initial!important;animation-duration:1ms!important;animation-delay:-1ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-delay:0s!important;transition-duration:0s!important}}.ctrl-btn-center.svelte-1s83zbq{display:grid!important;height:100%;width:100%;place-items:center}.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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.5'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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.5'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%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.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%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}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%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){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%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")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-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}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;top:0;right:0;bottom:0;left:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}.expand-map.svelte-p00lfq{position:absolute;top:0;bottom:0;left:0;right:0}svg.svelte-d2loi5{display:block;fill:#e15042}li.svelte-ltkwvy.svelte-ltkwvy{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content}li.svelte-ltkwvy.svelte-ltkwvy:first-child{padding-top:10px}li.svelte-ltkwvy.svelte-ltkwvy:last-child{padding-bottom:10px}li.selected.svelte-ltkwvy.svelte-ltkwvy{background-color:#f3f6ff}li.selected.svelte-ltkwvy.svelte-ltkwvy{animation:svelte-ltkwvy-backAndForth 5s linear infinite}li.selected.svelte-ltkwvy .primary.svelte-ltkwvy{color:#2b8bfb}li.svelte-ltkwvy>img.svelte-ltkwvy{align-self:center;justify-self:center;opacity:.75}.texts.svelte-ltkwvy.svelte-ltkwvy{padding:0 17px 0 0}.texts.svelte-ltkwvy>.svelte-ltkwvy{white-space:nowrap;display:block;min-width:fit-content}.primary.svelte-ltkwvy.svelte-ltkwvy{font-weight:600}.secondary.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7;padding-left:4px}.line2.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7}@keyframes svelte-ltkwvy-backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}div.svelte-7cmwmc{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;display:flex;align-items:center}svg.svelte-7cmwmc{animation:svelte-7cmwmc-rotate .8s infinite cubic-bezier(.45,.05,.55,.95)}@keyframes svelte-7cmwmc-rotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}svg.svelte-gzo3ar.svelte-gzo3ar{display:block;fill:#6b7c93;stroke:#6b7c93}.list-icon.svelte-gzo3ar.svelte-gzo3ar{grid-row:1/3;align-self:center;margin:8px}.in-map.svelte-gzo3ar.svelte-gzo3ar{height:30px}.maplibregl-canvas-container .marker-selected{z-index:1}.maplibregl-canvas-container svg.svelte-gzo3ar path.svelte-gzo3ar,.leaflet-map-pane svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#3170fe;stroke:#3170fe}.marker-selected svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#98b7ff;stroke:#3170fe}.marker-reverse svg.svelte-gzo3ar path.svelte-gzo3ar{fill:silver;stroke:gray}.marker-interactive{cursor:pointer!important}.maptiler-gc-popup>.maplibregl-popup-content{padding:2px 8px}svg.svelte-en2qvf{display:block;fill:var(--color-icon-button)}svg.svelte-1bpbt60{display:block;stroke:var(--color-icon-button)}form.svelte-zh3kmv.svelte-zh3kmv{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text:#444952;--color-icon-button:#444952}form.svelte-zh3kmv.svelte-zh3kmv,form.svelte-zh3kmv .svelte-zh3kmv,form.svelte-zh3kmv .svelte-zh3kmv:after,form.svelte-zh3kmv .svelte-zh3kmv:before{box-sizing:border-box}form.can-collapse.svelte-zh3kmv.svelte-zh3kmv{max-width:29px}form.svelte-zh3kmv.svelte-zh3kmv,form.svelte-zh3kmv.svelte-zh3kmv:focus-within,form.svelte-zh3kmv.svelte-zh3kmv:hover{width:270px;max-width:270px}input.svelte-zh3kmv.svelte-zh3kmv{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input.svelte-zh3kmv.svelte-zh3kmv:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul.svelte-zh3kmv.svelte-zh3kmv,div.error.svelte-zh3kmv.svelte-zh3kmv,div.no-results.svelte-zh3kmv.svelte-zh3kmv{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul.svelte-zh3kmv.svelte-zh3kmv{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error.svelte-zh3kmv.svelte-zh3kmv,div.no-results.svelte-zh3kmv.svelte-zh3kmv{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error.svelte-zh3kmv.svelte-zh3kmv{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error.svelte-zh3kmv div.svelte-zh3kmv{flex-grow:1}div.error.svelte-zh3kmv svg{flex-shrink:0;width:20px;height:20px}div.error.svelte-zh3kmv button.svelte-zh3kmv{flex-shrink:0}div.error.svelte-zh3kmv button.svelte-zh3kmv>svg{width:13px;fill:#e25041}div.error.svelte-zh3kmv button.svelte-zh3kmv:hover svg,div.error.svelte-zh3kmv button.svelte-zh3kmv:active svg{fill:#444952}div.no-results.svelte-zh3kmv.svelte-zh3kmv{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results.svelte-zh3kmv svg{margin-top:4px;flex-shrink:0;width:20px;height:20px;width:30px;height:30px}.maplibregl-ctrl-bottom-left ul.svelte-zh3kmv.svelte-zh3kmv,.maplibregl-ctrl-bottom-right ul.svelte-zh3kmv.svelte-zh3kmv{top:auto;bottom:100%}button.svelte-zh3kmv.svelte-zh3kmv{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button.svelte-zh3kmv.svelte-zh3kmv:hover{background-color:transparent}button.svelte-zh3kmv:hover svg,button.svelte-zh3kmv:active svg{fill:#2b8bfb}.input-group.svelte-zh3kmv.svelte-zh3kmv{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group.svelte-zh3kmv.svelte-zh3kmv:focus-within{outline:#2b8bfb solid 2px}.search-button.svelte-zh3kmv.svelte-zh3kmv{flex-shrink:0}.maplibregl-ctrl-geocoder:not(.maptiler-ctrl) .search-button svg{width:12px!important;transform:translate(.5px)}.clear-button-container.svelte-zh3kmv.svelte-zh3kmv{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable.svelte-zh3kmv.svelte-zh3kmv{display:flex;flex-shrink:0}.maplibregl-ctrl-geocoder{position:relative;z-index:3}.maptiler-ctrl:not(:empty){box-shadow:none}.maptiler-ctrl .input-group.svelte-zh3kmv.svelte-zh3kmv{padding-inline:8px;border:white solid 2px}.maptiler-ctrl .input-group.svelte-zh3kmv.svelte-zh3kmv:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}.maptiler-ctrl form.can-collapse.svelte-zh3kmv.svelte-zh3kmv{max-width:33px}.maptiler-ctrl form.svelte-zh3kmv.svelte-zh3kmv,.maptiler-ctrl form.svelte-zh3kmv.svelte-zh3kmv:focus-within,.maptiler-ctrl form.svelte-zh3kmv.svelte-zh3kmv:hover{width:270px;max-width:270px}div.svelte-ixhnie{position:absolute;top:20px;left:50px}div.svelte-k43lgc{float:left}.left.svelte-k43lgc{width:25%;height:100vh;overflow:scroll;padding:8px}.main.svelte-k43lgc{width:75%}span.svelte-kzgqtg{display:block;float:left;height:16px;width:30px;margin-right:5px;border:1px solid #999}div.svelte-1uuov7f{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.5);display:flex;justify-content:center;align-items:center;z-index:999;color:#fff;font-size:32px}table.svelte-lh2o9l{border:solid}.dot.svelte-1cqsh0e{width:30px;height:30px;border-radius:50%;display:inline-block;background-color:#00f;text-align:center;color:#fff;font-weight:700} diff --git a/assets/main-11b99b21.js b/assets/main-11b99b21.js deleted file mode 100644 index c00482f..0000000 --- a/assets/main-11b99b21.js +++ /dev/null @@ -1,619 +0,0 @@ -var e_=Object.defineProperty;var t_=(f,l,h)=>l in f?e_(f,l,{enumerable:!0,configurable:!0,writable:!0,value:h}):f[l]=h;var sr=(f,l,h)=>(t_(f,typeof l!="symbol"?l+"":l,h),h);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const y of document.querySelectorAll('link[rel="modulepreload"]'))p(y);new MutationObserver(y=>{for(const b of y)if(b.type==="childList")for(const x of b.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&p(x)}).observe(document,{childList:!0,subtree:!0});function h(y){const b={};return y.integrity&&(b.integrity=y.integrity),y.referrerPolicy&&(b.referrerPolicy=y.referrerPolicy),y.crossOrigin==="use-credentials"?b.credentials="include":y.crossOrigin==="anonymous"?b.credentials="omit":b.credentials="same-origin",b}function p(y){if(y.ep)return;y.ep=!0;const b=h(y);fetch(y.href,b)}})();function Wt(){}function i_(f,l){for(const h in l)f[h]=l[h];return f}function Tf(f){return f()}function Sp(){return Object.create(null)}function Jr(f){f.forEach(Tf)}function pu(f){return typeof f=="function"}function Yt(f,l){return f!=f?l==l:f!==l||f&&typeof f=="object"||typeof f=="function"}function r_(f){return Object.keys(f).length===0}function If(f,...l){if(f==null){for(const p of l)p(void 0);return Wt}const h=f.subscribe(...l);return h.unsubscribe?()=>h.unsubscribe():h}function n_(f){let l;return If(f,h=>l=h)(),l}function Dt(f,l,h){f.$$.on_destroy.push(If(l,h))}function an(f,l,h,p){if(f){const y=kf(f,l,h,p);return f[0](y)}}function kf(f,l,h,p){return f[1]&&p?i_(h.ctx.slice(),f[1](p(l))):h.ctx}function ln(f,l,h,p){if(f[2]&&p){const y=f[2](p(h));if(l.dirty===void 0)return y;if(typeof y=="object"){const b=[],x=Math.max(l.dirty.length,y.length);for(let a=0;a32){const l=[],h=f.ctx.length/32;for(let p=0;pf.removeEventListener(l,h,p)}function Ht(f,l,h){h==null?f.removeAttribute(l):f.getAttribute(l)!==h&&f.setAttribute(l,h)}function o_(f){return f===""?null:+f}function a_(f){return Array.from(f.childNodes)}function An(f,l){l=""+l,f.data!==l&&(f.data=l)}function jl(f,l){f.value=l??""}function Er(f,l,h,p){h==null?f.style.removeProperty(l):f.style.setProperty(l,h,p?"important":"")}function Ip(f,l,h){for(let p=0;p{const y=f.$$.callbacks[l];if(y){const b=c_(l,h,{cancelable:p});return y.slice().forEach(x=>{x.call(f,b)}),!b.defaultPrevented}return!0}}function Cf(f,l){return Hl().$$.context.set(f,l),l}function u_(f){return Hl().$$.context.get(f)}function lr(f,l){const h=f.$$.callbacks[l.type];h&&h.slice().forEach(p=>p.call(this,l))}const Ta=[],Yr=[];let ka=[];const Ah=[],Mf=Promise.resolve();let Eh=!1;function Af(){Eh||(Eh=!0,Mf.then(Ef))}function h_(){return Af(),Mf}function cu(f){ka.push(f)}function Ca(f){Ah.push(f)}const wh=new Set;let ba=0;function Ef(){if(ba!==0)return;const f=ql;do{try{for(;baf.indexOf(p)===-1?l.push(p):h.push(p)),h.forEach(p=>p()),ka=l}const au=new Set;let bo;function yr(){bo={r:0,c:[],p:bo}}function vr(){bo.r||Jr(bo.c),bo=bo.p}function Be(f,l){f&&f.i&&(au.delete(f),f.i(l))}function Ge(f,l,h,p){if(f&&f.o){if(au.has(f))return;au.add(f),bo.c.push(()=>{au.delete(f),p&&(h&&f.d(1),p())}),f.o(l)}else p&&p()}function sn(f){return(f==null?void 0:f.length)!==void 0?f:Array.from(f)}function Ma(f,l,h){const p=f.$$.props[l];p!==void 0&&(f.$$.bound[p]=h,h(f.$$.ctx[p]))}function It(f){f&&f.c()}function wt(f,l,h){const{fragment:p,after_update:y}=f.$$;p&&p.m(l,h),cu(()=>{const b=f.$$.on_mount.map(Tf).filter(pu);f.$$.on_destroy?f.$$.on_destroy.push(...b):Jr(b),f.$$.on_mount=[]}),y.forEach(cu)}function St(f,l){const h=f.$$;h.fragment!==null&&(p_(h.after_update),Jr(h.on_destroy),h.fragment&&h.fragment.d(l),h.on_destroy=h.fragment=null,h.ctx=[])}function f_(f,l){f.$$.dirty[0]===-1&&(Ta.push(f),Af(),f.$$.dirty.fill(0)),f.$$.dirty[l/31|0]|=1<{const de=Ie.length?Ie[0]:X;return L.ctx&&y(L.ctx[j],L.ctx[j]=de)&&(!L.skip_bound&&L.bound[j]&&L.bound[j](de),F&&f_(f,j)),X}):[],L.update(),F=!0,Jr(L.before_update),L.fragment=p?p(L.ctx):!1,l.target){if(l.hydrate){const j=a_(l.target);L.fragment&&L.fragment.l(j),j.forEach(Fe)}else L.fragment&&L.fragment.c();l.intro&&Be(f.$$.fragment),wt(f,l.target,l.anchor),Ef()}Vl(M)}class li{constructor(){sr(this,"$$");sr(this,"$$set")}$destroy(){St(this,1),this.$destroy=Wt}$on(l,h){if(!pu(h))return Wt;const p=this.$$.callbacks[l]||(this.$$.callbacks[l]=[]);return p.push(h),()=>{const y=p.indexOf(h);y!==-1&&p.splice(y,1)}}$set(l){this.$$set&&!r_(l)&&(this.$$.skip_bound=!0,this.$$set(l),this.$$.skip_bound=!1)}}const m_="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(m_);let Zt;const Pf=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Pf.decode();let Bl=null;function Nl(){return(Bl===null||Bl.byteLength===0)&&(Bl=new Uint8Array(Zt.memory.buffer)),Bl}function Gs(f,l){return f=f>>>0,Pf.decode(Nl().subarray(f,f+l))}const xs=new Array(128).fill(void 0);xs.push(void 0,null,!0,!1);let Ul=xs.length;function vs(f){Ul===xs.length&&xs.push(xs.length+1);const l=Ul;return Ul=xs[l],xs[l]=f,l}function Si(f){return xs[f]}function g_(f){f<132||(xs[f]=Ul,Ul=f)}function Ia(f){const l=Si(f);return g_(f),l}function Sh(f){return f==null}let Fl=null;function zf(){return(Fl===null||Fl.byteLength===0)&&(Fl=new Float64Array(Zt.memory.buffer)),Fl}let Ol=null;function _i(){return(Ol===null||Ol.byteLength===0)&&(Ol=new Int32Array(Zt.memory.buffer)),Ol}let wo=0;const lu=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},__=typeof lu.encodeInto=="function"?function(f,l){return lu.encodeInto(f,l)}:function(f,l){const h=lu.encode(f);return l.set(h),{read:f.length,written:h.length}};function Th(f,l,h){if(h===void 0){const a=lu.encode(f),M=l(a.length,1)>>>0;return Nl().subarray(M,M+a.length).set(a),wo=a.length,M}let p=f.length,y=l(p,1)>>>0;const b=Nl();let x=0;for(;x127)break;b[y+x]=a}if(x!==p){x!==0&&(f=f.slice(x)),y=h(y,p,p=x+f.length*3,1)>>>0;const a=Nl().subarray(y+x,y+p),M=__(f,a);x+=M.written}return wo=x,y}function Ph(f){const l=typeof f;if(l=="number"||l=="boolean"||f==null)return`${f}`;if(l=="string")return`"${f}"`;if(l=="symbol"){const y=f.description;return y==null?"Symbol":`Symbol(${y})`}if(l=="function"){const y=f.name;return typeof y=="string"&&y.length>0?`Function(${y})`:"Function"}if(Array.isArray(f)){const y=f.length;let b="[";y>0&&(b+=Ph(f[0]));for(let x=1;x1)p=h[1];else return toString.call(f);if(p=="Object")try{return"Object("+JSON.stringify(f)+")"}catch{return"Object"}return f instanceof Error?`${f.name}: ${f.message} -${f.stack}`:p}function y_(f,l){const h=l(f.length*1,1)>>>0;return Nl().set(f,h/1),wo=f.length,h}function v_(f,l){return f=f>>>0,zf().subarray(f/8,f/8+l)}class x_{__destroy_into_raw(){const l=this.__wbg_ptr;return this.__wbg_ptr=0,l}free(){const l=this.__destroy_into_raw();Zt.__wbg_mapmodel_free(l)}constructor(l,h){try{const x=Zt.__wbindgen_add_to_stack_pointer(-16),a=y_(l,Zt.__wbindgen_malloc),M=wo;Zt.mapmodel_new(x,a,M,h);var p=_i()[x/4+0],y=_i()[x/4+1],b=_i()[x/4+2];if(b)throw Ia(y);return this.__wbg_ptr=p>>>0,this}finally{Zt.__wbindgen_add_to_stack_pointer(16)}}render(){let l,h;try{const L=Zt.__wbindgen_add_to_stack_pointer(-16);Zt.mapmodel_render(L,this.__wbg_ptr);var p=_i()[L/4+0],y=_i()[L/4+1],b=_i()[L/4+2],x=_i()[L/4+3],a=p,M=y;if(x)throw a=0,M=0,Ia(b);return l=a,h=M,Gs(a,M)}finally{Zt.__wbindgen_add_to_stack_pointer(16),Zt.__wbindgen_free(l,h,1)}}compareRoute(l){let h,p;try{const F=Zt.__wbindgen_add_to_stack_pointer(-16);Zt.mapmodel_compareRoute(F,this.__wbg_ptr,vs(l));var y=_i()[F/4+0],b=_i()[F/4+1],x=_i()[F/4+2],a=_i()[F/4+3],M=y,L=b;if(a)throw M=0,L=0,Ia(x);return h=M,p=L,Gs(M,L)}finally{Zt.__wbindgen_add_to_stack_pointer(16),Zt.__wbindgen_free(h,p,1)}}makeHeatmap(){let l,h;try{const L=Zt.__wbindgen_add_to_stack_pointer(-16);Zt.mapmodel_makeHeatmap(L,this.__wbg_ptr);var p=_i()[L/4+0],y=_i()[L/4+1],b=_i()[L/4+2],x=_i()[L/4+3],a=p,M=y;if(x)throw a=0,M=0,Ia(b);return l=a,h=M,Gs(a,M)}finally{Zt.__wbindgen_add_to_stack_pointer(16),Zt.__wbindgen_free(l,h,1)}}getInvertedBoundary(){let l,h;try{const L=Zt.__wbindgen_add_to_stack_pointer(-16);Zt.mapmodel_getInvertedBoundary(L,this.__wbg_ptr);var p=_i()[L/4+0],y=_i()[L/4+1],b=_i()[L/4+2],x=_i()[L/4+3],a=p,M=y;if(x)throw a=0,M=0,Ia(b);return l=a,h=M,Gs(a,M)}finally{Zt.__wbindgen_add_to_stack_pointer(16),Zt.__wbindgen_free(l,h,1)}}getBounds(){try{const y=Zt.__wbindgen_add_to_stack_pointer(-16);Zt.mapmodel_getBounds(y,this.__wbg_ptr);var l=_i()[y/4+0],h=_i()[y/4+1],p=v_(l,h).slice();return Zt.__wbindgen_free(l,h*8,8),p}finally{Zt.__wbindgen_add_to_stack_pointer(16)}}}async function b_(f,l){if(typeof Response=="function"&&f instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(f,l)}catch(p){if(f.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",p);else throw p}const h=await f.arrayBuffer();return await WebAssembly.instantiate(h,l)}else{const h=await WebAssembly.instantiate(f,l);return h instanceof WebAssembly.Instance?{instance:h,module:f}:h}}function w_(){const f={};return f.wbg={},f.wbg.__wbindgen_string_new=function(l,h){const p=Gs(l,h);return vs(p)},f.wbg.__wbindgen_error_new=function(l,h){const p=new Error(Gs(l,h));return vs(p)},f.wbg.__wbindgen_is_object=function(l){const h=Si(l);return typeof h=="object"&&h!==null},f.wbg.__wbindgen_is_undefined=function(l){return Si(l)===void 0},f.wbg.__wbindgen_in=function(l,h){return Si(l)in Si(h)},f.wbg.__wbindgen_object_drop_ref=function(l){Ia(l)},f.wbg.__wbindgen_number_get=function(l,h){const p=Si(h),y=typeof p=="number"?p:void 0;zf()[l/8+1]=Sh(y)?0:y,_i()[l/4+0]=!Sh(y)},f.wbg.__wbindgen_jsval_loose_eq=function(l,h){return Si(l)==Si(h)},f.wbg.__wbindgen_boolean_get=function(l){const h=Si(l);return typeof h=="boolean"?h?1:0:2},f.wbg.__wbindgen_string_get=function(l,h){const p=Si(h),y=typeof p=="string"?p:void 0;var b=Sh(y)?0:Th(y,Zt.__wbindgen_malloc,Zt.__wbindgen_realloc),x=wo;_i()[l/4+1]=x,_i()[l/4+0]=b},f.wbg.__wbindgen_object_clone_ref=function(l){const h=Si(l);return vs(h)},f.wbg.__wbg_getwithrefkey_3b3c46ba20582127=function(l,h){const p=Si(l)[Si(h)];return vs(p)},f.wbg.__wbg_debug_34c9290896ec9856=function(l){console.debug(Si(l))},f.wbg.__wbg_error_e60eff06f24ab7a4=function(l){console.error(Si(l))},f.wbg.__wbg_info_d7d58472d0bab115=function(l){console.info(Si(l))},f.wbg.__wbg_log_a4530b4fe289336f=function(l){console.log(Si(l))},f.wbg.__wbg_warn_f260f49434e45e62=function(l){console.warn(Si(l))},f.wbg.__wbg_instanceof_ArrayBuffer_e7d53d51371448e2=function(l){let h;try{h=Si(l)instanceof ArrayBuffer}catch{h=!1}return h},f.wbg.__wbg_buffer_a448f833075b71ba=function(l){const h=Si(l).buffer;return vs(h)},f.wbg.__wbg_new_8f67e318f15d7254=function(l){const h=new Uint8Array(Si(l));return vs(h)},f.wbg.__wbg_set_2357bf09366ee480=function(l,h,p){Si(l).set(Si(h),p>>>0)},f.wbg.__wbg_length_1d25fa9e4ac21ce7=function(l){return Si(l).length},f.wbg.__wbg_instanceof_Uint8Array_bced6f43aed8c1aa=function(l){let h;try{h=Si(l)instanceof Uint8Array}catch{h=!1}return h},f.wbg.__wbg_new_abda76e883ba8a5f=function(){const l=new Error;return vs(l)},f.wbg.__wbg_stack_658279fe44541cf6=function(l,h){const p=Si(h).stack,y=Th(p,Zt.__wbindgen_malloc,Zt.__wbindgen_realloc),b=wo;_i()[l/4+1]=b,_i()[l/4+0]=y},f.wbg.__wbg_error_f851667af71bcfc6=function(l,h){let p,y;try{p=l,y=h,console.error(Gs(l,h))}finally{Zt.__wbindgen_free(p,y,1)}},f.wbg.__wbindgen_debug_string=function(l,h){const p=Ph(Si(h)),y=Th(p,Zt.__wbindgen_malloc,Zt.__wbindgen_realloc),b=wo;_i()[l/4+1]=b,_i()[l/4+0]=y},f.wbg.__wbindgen_throw=function(l,h){throw new Error(Gs(l,h))},f.wbg.__wbindgen_memory=function(){const l=Zt.memory;return vs(l)},f}function S_(f,l){return Zt=f.exports,Lf.__wbindgen_wasm_module=l,Fl=null,Ol=null,Bl=null,Zt}async function Lf(f){if(Zt!==void 0)return Zt;typeof f>"u"&&(f="/severance_snape/assets/backend_bg.wasm");const l=w_();(typeof f=="string"||typeof Request=="function"&&f instanceof Request||typeof URL=="function"&&f instanceof URL)&&(f=fetch(f));const{instance:h,module:p}=await b_(await f,l);return S_(h,p)}const wa=[];function Ih(f,l){return{subscribe:cr(f,l).subscribe}}function cr(f,l=Wt){let h;const p=new Set;function y(a){if(Yt(f,a)&&(f=a,h)){const M=!wa.length;for(const L of p)L[1](),wa.push(L,f);if(M){for(let L=0;L{p.delete(L),p.size===0&&h&&(h(),h=null)}}return{set:y,update:b,subscribe:x}}let T_=Date.now();function Kl(f){return`${f}-${T_++}`}const Fh=Symbol.for("svelte-maplibre");function Ea(){return u_(Fh)}function I_(f){let l=new WeakMap;return h=>{var x;let p=l.get(h.originalEvent);if(p!==void 0)return p;let b=(x=h.target.queryRenderedFeatures(h.point).find(a=>{var M;return(M=f.get(a.layer.id))==null?void 0:M.interactive}))==null?void 0:x.layer.id;return l.set(h.originalEvent,b),b}}function k_(){let f=new Map;return Cf(Fh,{map:cr(null),source:Ih(null),layer:Ih(null),popupTarget:Ih(null),cluster:cr(),loadedImages:cr(new Set),minzoom:cr(0),maxzoom:cr(24),layerEvent:cr(null),layerInfo:f,eventTopMost:I_(f)})}function Cp(f){return{subscribe:f.subscribe}}function Oh({key:f,setPopupTarget:l=!1,setCluster:h=!1,setMouseEvent:p=!1}){let y=Ea(),b=cr(null),x=Cp(b),a={...y,[f]:Cp(b)};if(l&&(a.popupTarget=x),p){let M=cr(null);a.layerEvent=M,y.layerEvent=M}return h&&(a.cluster=cr()),Cf(Fh,a),{...y,self:b}}function C_(){return Oh({key:"source",setCluster:!0})}function M_(f=!0){return Oh({key:"layer",setPopupTarget:f,setMouseEvent:f})}function A_(){return Oh({key:"popupTarget",setPopupTarget:!0,setMouseEvent:!0})}function E_(f){return"layerType"in f&&f.layerType==="deckgl"}var Df=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rf(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}function Bf(f){if(f.__esModule)return f;var l=f.default;if(typeof l=="function"){var h=function p(){return this instanceof p?Reflect.construct(l,arguments,this.constructor):l.apply(this,arguments)};h.prototype=l.prototype}else h={};return Object.defineProperty(h,"__esModule",{value:!0}),Object.keys(f).forEach(function(p){var y=Object.getOwnPropertyDescriptor(f,p);Object.defineProperty(h,p,y.get?y:{enumerable:!0,get:function(){return f[p]}})}),h}var Ff={exports:{}};/** - * MapLibre GL JS - * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.0.1/LICENSE.txt - */(function(f,l){(function(h,p){f.exports=p()})(Df,function(){var h={},p={};function y(x,a,M){if(p[x]=M,x==="index"){var L="var sharedModule = {}; ("+p.shared+")(sharedModule); ("+p.worker+")(sharedModule);",F={};return p.shared(F),p.index(h,F),typeof window<"u"&&h.setWorkerUrl(window.URL.createObjectURL(new Blob([L],{type:"text/javascript"}))),h}}y("shared",["exports"],function(x){function a(i,e,r,s){return new(r||(r=Promise))(function(c,g){function _(k){try{S(s.next(k))}catch(A){g(A)}}function v(k){try{S(s.throw(k))}catch(A){g(A)}}function S(k){var A;k.done?c(k.value):(A=k.value,A instanceof r?A:new r(function(E){E(A)})).then(_,v)}S((s=s.apply(i,e||[])).next())})}function M(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var L=F;function F(i,e){this.x=i,this.y=e}F.prototype={clone:function(){return new F(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},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(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),s=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=s,this},_rotateAround:function(i,e){var r=Math.cos(i),s=Math.sin(i),c=e.y+s*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-s*(this.y-e.y),this.y=c,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},F.convert=function(i){return i instanceof F?i:Array.isArray(i)?new F(i[0],i[1]):i};var j=M(L),X=Ie;function Ie(i,e,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(s-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=s}Ie.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var c=this.sampleCurveX(r)-i;if(Math.abs(c)c?_=r:v=r,r=.5*(v-_)+_;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var de=M(X);let Te,ye;function xe(){return Te==null&&(Te=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Te}function Q(){if(ye==null&&(ye=!1,xe())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let s=0;s<5*5;s++){const c=4*s;e.fillStyle=`rgb(${c},${c+1},${c+2})`,e.fillRect(s%5,Math.floor(s/5),1,1)}const r=e.getImageData(0,0,5,5).data;for(let s=0;s<5*5*4;s++)if(s%4!=3&&r[s]!==s){ye=!0;break}}}return ye||!1}function $(i,e,r,s){const c=new de(i,e,r,s);return function(g){return c.solve(g)}}const ne=$(.25,.1,.25,1);function me(i,e,r){return Math.min(r,Math.max(e,i))}function Ue(i,e,r){const s=r-e,c=((i-e)%s+s)%s+e;return c===e?r:c}function Ee(i,...e){for(const r of e)for(const s in r)i[s]=r[s];return i}let be=1;function Se(i,e,r){const s={};for(const c in i)s[c]=e.call(r||this,i[c],c,i);return s}function at(i,e,r){const s={};for(const c in i)e.call(r||this,i[c],c,i)&&(s[c]=i[c]);return s}function ge(i){return Array.isArray(i)?i.map(ge):typeof i=="object"&&i?Se(i,ge):i}const De={};function ft(i){De[i]||(typeof console<"u"&&console.warn(i),De[i]=!0)}function kt(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function $t(i){let e=0;for(let r,s,c=0,g=i.length,_=g-1;c"u")throw new Error("VideoFrame not supported");const g=new VideoFrame(i,{timestamp:0});try{const _=g==null?void 0:g.format;if(!_||!_.startsWith("BGR")&&!_.startsWith("RGB"))throw new Error(`Unrecognized format ${_}`);const v=_.startsWith("BGR"),S=new Uint8ClampedArray(s*c*4);if(yield g.copyTo(S,function(k,A,E,R,O){const N=4*Math.max(-A,0),q=(Math.max(0,E)-E)*R*4+N,K=4*R,te=Math.max(0,A),he=Math.max(0,E);return{rect:{x:te,y:he,width:Math.min(k.width,A+R)-te,height:Math.min(k.height,E+O)-he},layout:[{offset:q,stride:K}]}}(i,e,r,s,c)),v)for(let k=0;knt(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Nt=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){const s=vi(i.url);if(s)return s(i,e);if(nt(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"getResource",data:i,targetMapId:xi},e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(Tt())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(s,c){return a(this,void 0,void 0,function*(){const g=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,cache:s.cache,referrer:Tt(),signal:c.signal});s.type==="json"&&g.headers.set("Accept","application/json");const _=yield fetch(g);if(!_.ok){const k=yield _.blob();throw new He(_.status,_.statusText,s.url,k)}const v=s.type==="arrayBuffer"||s.type==="image"?_.arrayBuffer():s.type==="json"?_.json():_.text(),S=yield v;if(c.signal.aborted)throw hi();return{data:S,cacheControl:_.headers.get("Cache-Control"),expires:_.headers.get("Expires")}})}(i,e);if(nt(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"getResource",data:i,mustQueue:!0,targetMapId:xi},e)}var r;return function(s,c){return new Promise((g,_)=>{const v=new XMLHttpRequest;v.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(v.responseType="arraybuffer");for(const S in s.headers)v.setRequestHeader(S,s.headers[S]);s.type==="json"&&(v.responseType="text",v.setRequestHeader("Accept","application/json")),v.withCredentials=s.credentials==="include",v.onerror=()=>{_(new Error(v.statusText))},v.onload=()=>{if(!c.signal.aborted)if((v.status>=200&&v.status<300||v.status===0)&&v.response!==null){let S=v.response;if(s.type==="json")try{S=JSON.parse(v.response)}catch(k){return void _(k)}g({data:S,cacheControl:v.getResponseHeader("Cache-Control"),expires:v.getResponseHeader("Expires")})}else{const S=new Blob([v.response],{type:v.getResponseHeader("Content-Type")});_(new He(v.status,v.statusText,s.url,S))}},c.signal.addEventListener("abort",()=>{v.abort(),_(hi())}),v.send(s.body)})}(i,e)};function Ni(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function Ur(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function $e(i,e,r){if(r&&r[i]){const s=r[i].indexOf(e);s!==-1&&r[i].splice(s,1)}}class Ne{constructor(e,r={}){Ee(this,r),this.type=e}}class Qt extends Ne{constructor(e,r={}){super("error",Ee({error:e},r))}}class Di{on(e,r){return this._listeners=this._listeners||{},Ur(e,r,this._listeners),this}off(e,r){return $e(e,r,this._listeners),$e(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Ur(e,r,this._oneTimeListeners),this):new Promise(s=>this.once(e,s))}fire(e,r){typeof e=="string"&&(e=new Ne(e,r||{}));const s=e.type;if(this.listens(s)){e.target=this;const c=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const v of c)v.call(this,e);const g=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const v of g)$e(s,v,this._oneTimeListeners),v.call(this,e);const _=this._eventedParent;_&&(Ee(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),_.fire(e))}else e instanceof Qt&&console.error(e.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,r){return this._eventedParent=e,this._eventedParentData=r,this}}var we={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},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:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const ur=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function On(i,e){const r={};for(const s in i)s!=="ref"&&(r[s]=i[s]);return ur.forEach(s=>{s in e&&(r[s]=e[s])}),r}function Ut(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const oe=[hr,Ye,Lt,At,Ui,Gi,xn,U(Ct),Y,D,B];function ae(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!ae(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of oe)if(!ae(r,e))return null}}return`Expected ${G(i)} but found ${G(e)} instead.`}function ue(i,e){return e.some(r=>r.kind===i.kind)}function re(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function pe(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const ze=.96422,Ce=.82521,Me=4/29,mt=6/29,_t=3*mt*mt,Mt=mt*mt*mt,bt=Math.PI/180,jt=180/Math.PI;function ri(i){return(i%=360)<0&&(i+=360),i}function bi([i,e,r,s]){let c,g;const _=Et((.2225045*(i=ji(i))+.7168786*(e=ji(e))+.0606169*(r=ji(r)))/1);i===e&&e===r?c=g=_:(c=Et((.4360747*i+.3850649*e+.1430804*r)/ze),g=Et((.0139322*i+.0971045*e+.7141733*r)/Ce));const v=116*_-16;return[v<0?0:v,500*(c-_),200*(_-g),s]}function ji(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Et(i){return i>Mt?Math.pow(i,1/3):i/_t+Me}function Ci([i,e,r,s]){let c=(i+16)/116,g=isNaN(e)?c:c+e/500,_=isNaN(r)?c:c-r/200;return c=1*xr(c),g=ze*xr(g),_=Ce*xr(_),[Hi(3.1338561*g-1.6168667*c-.4906146*_),Hi(-.9787684*g+1.9161415*c+.033454*_),Hi(.0719453*g-.2289914*c+1.4052427*_),s]}function Hi(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function xr(i){return i>mt?i*i*i:_t*(i-Me)}function Pr(i){return parseInt(i.padEnd(2,i),16)/255}function ir(i,e){return bn(e?i/100:i,0,1)}function bn(i,e,r){return Math.min(Math.max(e,i),r)}function $l(i){return!i.some(Number.isNaN)}const _u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class ti{constructor(e,r,s,c=1,g=!0){this.r=e,this.g=r,this.b=s,this.a=c,g||(this.r*=c,this.g*=c,this.b*=c,c||this.overwriteGetter("rgb",[e,r,s,c]))}static parse(e){if(e instanceof ti)return e;if(typeof e!="string")return;const r=function(s){if((s=s.toLowerCase().trim())==="transparent")return[0,0,0,0];const c=_u[s];if(c){const[_,v,S]=c;return[_/255,v/255,S/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const _=s.length<6?1:2;let v=1;return[Pr(s.slice(v,v+=_)),Pr(s.slice(v,v+=_)),Pr(s.slice(v,v+=_)),Pr(s.slice(v,v+_)||"ff")]}if(s.startsWith("rgb")){const _=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(_){const[v,S,k,A,E,R,O,N,q,K,te,he]=_,ie=[A||" ",O||" ",K].join("");if(ie===" "||ie===" /"||ie===",,"||ie===",,,"){const le=[k,R,q].join(""),ke=le==="%%%"?100:le===""?255:0;if(ke){const Pe=[bn(+S/ke,0,1),bn(+E/ke,0,1),bn(+N/ke,0,1),te?ir(+te,he):1];if($l(Pe))return Pe}}return}}const g=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(g){const[_,v,S,k,A,E,R,O,N]=g,q=[S||" ",A||" ",R].join("");if(q===" "||q===" /"||q===",,"||q===",,,"){const K=[+v,bn(+k,0,100),bn(+E,0,100),O?ir(+O,N):1];if($l(K))return function([te,he,ie,le]){function ke(Pe){const it=(Pe+te/30)%12,ct=he*Math.min(ie,1-ie);return ie-ct*Math.max(-1,Math.min(it-3,9-it,1))}return te=ri(te),he/=100,ie/=100,[ke(0),ke(8),ke(4),le]}(K)}}}(e);return r?new ti(...r,!1):void 0}get rgb(){const{r:e,g:r,b:s,a:c}=this,g=c||1/0;return this.overwriteGetter("rgb",[e/g,r/g,s/g,c])}get hcl(){return this.overwriteGetter("hcl",function(e){const[r,s,c,g]=bi(e),_=Math.sqrt(s*s+c*c);return[Math.round(1e4*_)?ri(Math.atan2(c,s)*jt):NaN,_,r,g]}(this.rgb))}get lab(){return this.overwriteGetter("lab",bi(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,s,c]=this.rgb;return`rgba(${[e,r,s].map(g=>Math.round(255*g)).join(",")},${c})`}}ti.black=new ti(0,0,0,1),ti.white=new ti(1,1,1,1),ti.transparent=new ti(0,0,0,0),ti.red=new ti(1,0,0,1);class La{constructor(e,r,s){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Da{constructor(e,r,s,c,g){this.text=e,this.image=r,this.scale=s,this.fontStack=c,this.textColor=g}}class qr{constructor(e){this.sections=e}static fromString(e){return new qr([new Da(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof qr?e:qr.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class zr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof zr)return e;if(typeof e=="number")return new zr([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new zr(e)}}toString(){return JSON.stringify(this.values)}}const Xs=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Qr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Qr)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[i,e,r,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[i,e,r,s]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Co(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof ti||i instanceof La||i instanceof qr||i instanceof zr||i instanceof Qr||i instanceof $r)return!0;if(Array.isArray(i)){for(const e of i)if(!Co(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!Co(i[e]))return!1;return!0}return!1}function qi(i){if(i===null)return hr;if(typeof i=="string")return Lt;if(typeof i=="boolean")return At;if(typeof i=="number")return Ye;if(i instanceof ti)return Ui;if(i instanceof La)return es;if(i instanceof qr)return Gi;if(i instanceof zr)return Y;if(i instanceof Qr)return B;if(i instanceof $r)return D;if(Array.isArray(i)){const e=i.length;let r;for(const s of i){const c=qi(s);if(r){if(r===c)continue;r=Ct;break}r=c}return U(r||Ct,e)}return xn}function Ks(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof ti||i instanceof qr||i instanceof zr||i instanceof Qr||i instanceof $r?i.toString():JSON.stringify(i)}class Vn{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Co(e[1]))return r.error("invalid value");const s=e[1];let c=qi(s);const g=r.expectedType;return c.kind!=="array"||c.N!==0||!g||g.kind!=="array"||typeof g.N=="number"&&g.N!==0||(c=g),new Vn(c,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Ii{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Mo={string:Lt,number:Ye,boolean:At,object:xn};class Zr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let s,c=1;const g=e[0];if(g==="array"){let v,S;if(e.length>2){const k=e[1];if(typeof k!="string"||!(k in Mo)||k==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);v=Mo[k],c++}else v=Ct;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);S=e[2],c++}s=U(v,S)}else{if(!Mo[g])throw new Error(`Types doesn't contain name = ${g}`);s=Mo[g]}const _=[];for(;ce.outputDefined())}}const Ao={"to-boolean":At,"to-color":Ui,"to-number":Ye,"to-string":Lt};class wn{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[0];if(!Ao[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&e.length!==2)return r.error("Expected one argument.");const c=Ao[s],g=[];for(let _=1;_4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:ks(r[0],r[1],r[2],r[3]),!s))return new ti(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Ii(s||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const s of this.args){r=s.evaluate(e);const c=zr.parse(r);if(c)return c}throw new Ii(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const s of this.args){r=s.evaluate(e);const c=Qr.parse(r);if(c)return c}throw new Ii(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const s of this.args){if(r=s.evaluate(e),r===null)return 0;const c=Number(r);if(!isNaN(c))return c}throw new Ii(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return qr.fromString(Ks(this.args[0].evaluate(e)));case"resolvedImage":return $r.fromString(Ks(this.args[0].evaluate(e)));default:return Ks(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const Ys=["Unknown","Point","LineString","Polygon"];class ii{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ys[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||{}}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=ti.parse(e)),r}}class Eo{constructor(e,r,s=[],c,g=new Ws,_=[]){this.registry=e,this.path=s,this.key=s.map(v=>`[${v}]`).join(""),this.scope=g,this.errors=_,this.expectedType=c,this._isConstant=r}parse(e,r,s,c,g={}){return r?this.concat(r,s,c)._parse(e,g):this._parse(e,g)}_parse(e,r){function s(c,g,_){return _==="assert"?new Zr(g,[c]):_==="coerce"?new wn(g,[c]):c}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const c=e[0];if(typeof c!="string")return this.error(`Expression name must be a string, but found ${typeof c} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const g=this.registry[c];if(g){let _=g.parse(e,this);if(!_)return null;if(this.expectedType){const v=this.expectedType,S=_.type;if(v.kind!=="string"&&v.kind!=="number"&&v.kind!=="boolean"&&v.kind!=="object"&&v.kind!=="array"||S.kind!=="value")if(v.kind!=="color"&&v.kind!=="formatted"&&v.kind!=="resolvedImage"||S.kind!=="value"&&S.kind!=="string")if(v.kind!=="padding"||S.kind!=="value"&&S.kind!=="number"&&S.kind!=="array")if(v.kind!=="variableAnchorOffsetCollection"||S.kind!=="value"&&S.kind!=="array"){if(this.checkSubtype(v,S))return null}else _=s(_,v,r.typeAnnotation||"coerce");else _=s(_,v,r.typeAnnotation||"coerce");else _=s(_,v,r.typeAnnotation||"coerce");else _=s(_,v,r.typeAnnotation||"assert")}if(!(_ instanceof Vn)&&_.type.kind!=="resolvedImage"&&this._isConstant(_)){const v=new ii;try{_=new Vn(_.type,_.evaluate(v))}catch(S){return this.error(S.message),null}}return _}return this.error(`Unknown expression "${c}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,s){const c=typeof e=="number"?this.path.concat(e):this.path,g=s?this.scope.concat(s):this.scope;return new Eo(this.registry,this._isConstant,c,r||null,g,this.errors)}error(e,...r){const s=`${this.key}${r.map(c=>`[${c}]`).join("")}`;this.errors.push(new jr(s,e))}checkSubtype(e,r){const s=ae(e,r);return s&&this.error(s),s}}class Cs{constructor(e,r,s){this.type=es,this.locale=s,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const s=e[1];if(typeof s!="object"||Array.isArray(s))return r.error("Collator options argument must be an object.");const c=r.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,At);if(!c)return null;const g=r.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,At);if(!g)return null;let _=null;return s.locale&&(_=r.parse(s.locale,1,Lt),!_)?null:new Cs(c,g,_)}evaluate(e){return new La(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const Nn=8192;function Po(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function Js(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function yu(i,e){const r=(180+i[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,c=Math.pow(2,e.z);return[Math.round(r*c*Nn),Math.round(s*c*Nn)]}function ec(i,e,r){const s=i[0]-e[0],c=i[1]-e[1],g=i[0]-r[0],_=i[1]-r[1];return s*_-g*c==0&&s*g<=0&&c*_<=0}function zo(i,e){let r=!1;for(let _=0,v=e.length;_(s=i)[1]!=(g=S[k+1])[1]>s[1]&&s[0]<(g[0]-c[0])*(s[1]-c[1])/(g[1]-c[1])+c[0]&&(r=!r)}}var s,c,g;return r}function vu(i,e){for(let r=0;r0&&v<0||_<0&&v>0}function xu(i,e,r){for(const k of r)for(let A=0;Ar[2]){const c=.5*s;let g=i[0]-r[0]>c?-s:r[0]-i[0]>c?s:0;g===0&&(g=i[0]-r[2]>c?-s:r[2]-i[0]>c?s:0),i[0]+=g}Po(e,i)}function Do(i,e,r,s){const c=Math.pow(2,s.z)*Nn,g=[s.x*Nn,s.y*Nn],_=[];for(const v of i)for(const S of v){const k=[S.x+g[0],S.y+g[1]];sc(k,e,r,c),_.push(k)}return _}function oc(i,e,r,s){const c=Math.pow(2,s.z)*Nn,g=[s.x*Nn,s.y*Nn],_=[];for(const S of i){const k=[];for(const A of S){const E=[A.x+g[0],A.y+g[1]];Po(e,E),k.push(E)}_.push(k)}if(e[2]-e[0]<=c/2){(v=e)[0]=v[1]=1/0,v[2]=v[3]=-1/0;for(const S of _)for(const k of S)sc(k,e,r,c)}var v;return _}class ts{constructor(e,r){this.type=At,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Co(e[1])){const s=e[1];if(s.type==="FeatureCollection"){const c=[];for(const g of s.features){const{type:_,coordinates:v}=g.geometry;_==="Polygon"&&c.push(v),_==="MultiPolygon"&&c.push(...v)}if(c.length)return new ts(s,{type:"MultiPolygon",coordinates:c})}else if(s.type==="Feature"){const c=s.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new ts(s,s.geometry)}else if(s.type==="Polygon"||s.type==="MultiPolygon")return new ts(s,s)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(r,s){const c=[1/0,1/0,-1/0,-1/0],g=[1/0,1/0,-1/0,-1/0],_=r.canonicalID();if(s.type==="Polygon"){const v=Lo(s.coordinates,g,_),S=Do(r.geometry(),c,g,_);if(!Js(c,g))return!1;for(const k of S)if(!zo(k,v))return!1}if(s.type==="MultiPolygon"){const v=nc(s.coordinates,g,_),S=Do(r.geometry(),c,g,_);if(!Js(c,g))return!1;for(const k of S)if(!vu(k,v))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(r,s){const c=[1/0,1/0,-1/0,-1/0],g=[1/0,1/0,-1/0,-1/0],_=r.canonicalID();if(s.type==="Polygon"){const v=Lo(s.coordinates,g,_),S=oc(r.geometry(),c,g,_);if(!Js(c,g))return!1;for(const k of S)if(!ic(k,v))return!1}if(s.type==="MultiPolygon"){const v=nc(s.coordinates,g,_),S=oc(r.geometry(),c,g,_);if(!Js(c,g))return!1;for(const k of S)if(!rc(k,v))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class Ro{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const s=e[1];return r.scope.has(s)?new Ro(s,r.scope.get(s)):r.error(`Unknown variable "${s}". Make sure "${s}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Gr{constructor(e,r,s,c){this.name=e,this.type=r,this._evaluate=s,this.args=c}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){const s=e[0],c=Gr.definitions[s];if(!c)return r.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0);const g=Array.isArray(c)?c[0]:c.type,_=Array.isArray(c)?[[c[1],c[2]]]:c.overloads,v=_.filter(([k])=>!Array.isArray(k)||k.length===e.length-1);let S=null;for(const[k,A]of v){S=new Eo(r.registry,Qs,r.path,null,r.scope);const E=[];let R=!1;for(let O=1;O{return R=E,Array.isArray(R)?`(${R.map(G).join(", ")})`:`(${G(R.type)}...)`;var R}).join(" | "),A=[];for(let E=1;E{r=e?r&&Qs(s):r&&s instanceof Vn}),!!r&&Bo(i)&&eo(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Bo(i){if(i instanceof Gr&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof ts)return!1;let e=!0;return i.eachChild(r=>{e&&!Bo(r)&&(e=!1)}),e}function $s(i){if(i instanceof Gr&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!$s(r)&&(e=!1)}),e}function eo(i,e){if(i instanceof Gr&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(s=>{r&&!eo(s,e)&&(r=!1)}),r}function to(i,e){const r=i.length-1;let s,c,g=0,_=r,v=0;for(;g<=_;)if(v=Math.floor((g+_)/2),s=i[v],c=i[v+1],s<=e){if(v===r||ee))throw new Ii("Input is not a number.");_=v-1}return 0}class io{constructor(e,r,s){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[c,g]of s)this.labels.push(c),this.outputs.push(g)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const s=r.parse(e[1],1,Ye);if(!s)return null;const c=[];let g=null;r.expectedType&&r.expectedType.kind!=="value"&&(g=r.expectedType);for(let _=1;_=v)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',k);const E=r.parse(S,A,g);if(!E)return null;g=g||E.type,c.push([v,E])}return new io(g,s,c)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const c=this.input.evaluate(e);if(c<=r[0])return s[0].evaluate(e);const g=r.length;return c>=r[g-1]?s[g-1].evaluate(e):s[to(r,c)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function bu(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var wu=ac;function ac(i,e,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(s-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=s}ac.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var c=this.sampleCurveX(r)-i;if(Math.abs(c)c?_=r:v=r,r=.5*(v-_)+_;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var Su=bu(wu);function is(i,e,r){return i+r*(e-i)}function Fo(i,e,r){return i.map((s,c)=>is(s,e[c],r))}const br={number:is,color:function(i,e,r,s="rgb"){switch(s){case"rgb":{const[c,g,_,v]=Fo(i.rgb,e.rgb,r);return new ti(c,g,_,v,!1)}case"hcl":{const[c,g,_,v]=i.hcl,[S,k,A,E]=e.hcl;let R,O;if(isNaN(c)||isNaN(S))isNaN(c)?isNaN(S)?R=NaN:(R=S,_!==1&&_!==0||(O=k)):(R=c,A!==1&&A!==0||(O=g));else{let he=S-c;S>c&&he>180?he-=360:S180&&(he+=360),R=c+r*he}const[N,q,K,te]=function([he,ie,le,ke]){return he=isNaN(he)?0:he*bt,Ci([le,Math.cos(he)*ie,Math.sin(he)*ie,ke])}([R,O??is(g,k,r),is(_,A,r),is(v,E,r)]);return new ti(N,q,K,te,!1)}case"lab":{const[c,g,_,v]=Ci(Fo(i.lab,e.lab,r));return new ti(c,g,_,v,!1)}}},array:Fo,padding:function(i,e,r){return new zr(Fo(i.values,e.values,r))},variableAnchorOffsetCollection:function(i,e,r){const s=i.values,c=e.values;if(s.length!==c.length)throw new Ii(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);const g=[];for(let _=0;_typeof A!="number"||A<0||A>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);c={name:"cubic-bezier",controlPoints:k}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(g=r.parse(g,2,Ye),!g)return null;const v=[];let S=null;s==="interpolate-hcl"||s==="interpolate-lab"?S=Ui:r.expectedType&&r.expectedType.kind!=="value"&&(S=r.expectedType);for(let k=0;k<_.length;k+=2){const A=_[k],E=_[k+1],R=k+3,O=k+4;if(typeof A!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',R);if(v.length&&v[v.length-1][0]>=A)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',R);const N=r.parse(E,O,S);if(!N)return null;S=S||N.type,v.push([A,N])}return pe(S,Ye)||pe(S,Ui)||pe(S,Y)||pe(S,B)||pe(S,U(Ye))?new dr(S,s,c,g,v):r.error(`Type ${G(S)} is not interpolatable.`)}evaluate(e){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(e);const c=this.input.evaluate(e);if(c<=r[0])return s[0].evaluate(e);const g=r.length;if(c>=r[g-1])return s[g-1].evaluate(e);const _=to(r,c),v=dr.interpolationFactor(this.interpolation,c,r[_],r[_+1]),S=s[_].evaluate(e),k=s[_+1].evaluate(e);switch(this.operator){case"interpolate":return br[this.type.kind](S,k,v);case"interpolate-hcl":return br.color(S,k,v,"hcl");case"interpolate-lab":return br.color(S,k,v,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Xt(i,e,r,s){const c=s-r,g=i-r;return c===0?0:e===1?g/c:(Math.pow(e,g)-1)/(Math.pow(e,c)-1)}class Oo{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let s=null;const c=r.expectedType;c&&c.kind!=="value"&&(s=c);const g=[];for(const v of e.slice(1)){const S=r.parse(v,1+g.length,s,void 0,{typeAnnotation:"omit"});if(!S)return null;s=s||S.type,g.push(S)}if(!s)throw new Error("No output type");const _=c&&g.some(v=>ae(c,v.type));return new Oo(_?Ct:s,g)}evaluate(e){let r,s=null,c=0;for(const g of this.args)if(c++,s=g.evaluate(e),s&&s instanceof $r&&!s.available&&(r||(r=s.name),s=null,c===this.args.length&&(s=r)),s!==null)break;return s}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Vo{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const s=[];for(let g=1;g=s.length)throw new Ii(`Array index out of bounds: ${r} > ${s.length-1}.`);if(r!==Math.floor(r))throw new Ii(`Array index must be an integer, but found ${r} instead.`);return s[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Ba{constructor(e,r){this.type=At,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,Ct),c=r.parse(e[2],2,Ct);return s&&c?ue(s.type,[At,Lt,Ye,hr,Ct])?new Ba(s,c):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${G(s.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!s)return!1;if(!re(r,["boolean","string","number","null"]))throw new Ii(`Expected first argument to be of type boolean, string, number or null, but found ${G(qi(r))} instead.`);if(!re(s,["string","array"]))throw new Ii(`Expected second argument to be of type array or string, but found ${G(qi(s))} instead.`);return s.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class No{constructor(e,r,s){this.type=Ye,this.needle=e,this.haystack=r,this.fromIndex=s}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,Ct),c=r.parse(e[2],2,Ct);if(!s||!c)return null;if(!ue(s.type,[At,Lt,Ye,hr,Ct]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${G(s.type)} instead`);if(e.length===4){const g=r.parse(e[3],3,Ye);return g?new No(s,c,g):null}return new No(s,c)}evaluate(e){const r=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!re(r,["boolean","string","number","null"]))throw new Ii(`Expected first argument to be of type boolean, string, number or null, but found ${G(qi(r))} instead.`);if(!re(s,["string","array"]))throw new Ii(`Expected second argument to be of type array or string, but found ${G(qi(s))} instead.`);if(this.fromIndex){const c=this.fromIndex.evaluate(e);return s.indexOf(r,c)}return s.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Fa{constructor(e,r,s,c,g,_){this.inputType=e,this.type=r,this.input=s,this.cases=c,this.outputs=g,this.otherwise=_}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let s,c;r.expectedType&&r.expectedType.kind!=="value"&&(c=r.expectedType);const g={},_=[];for(let k=2;kNumber.MAX_SAFE_INTEGER)return R.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof N=="number"&&Math.floor(N)!==N)return R.error("Numeric branch labels must be integer values.");if(s){if(R.checkSubtype(s,qi(N)))return null}else s=qi(N);if(g[String(N)]!==void 0)return R.error("Branch labels must be unique.");g[String(N)]=_.length}const O=r.parse(E,k,c);if(!O)return null;c=c||O.type,_.push(O)}const v=r.parse(e[1],1,Ct);if(!v)return null;const S=r.parse(e[e.length-1],e.length-1,c);return S?v.type.kind!=="value"&&r.concat(1).checkSubtype(s,v.type)?null:new Fa(s,c,v,g,_,S):null}evaluate(e){const r=this.input.evaluate(e);return(qi(r)===this.inputType&&this.outputs[this.cases[r]]||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()}}class Oa{constructor(e,r,s){this.type=e,this.branches=r,this.otherwise=s}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let s;r.expectedType&&r.expectedType.kind!=="value"&&(s=r.expectedType);const c=[];for(let _=1;_r.outputDefined())&&this.otherwise.outputDefined()}}class Uo{constructor(e,r,s,c){this.type=e,this.input=r,this.beginIndex=s,this.endIndex=c}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=r.parse(e[1],1,Ct),c=r.parse(e[2],2,Ye);if(!s||!c)return null;if(!ue(s.type,[U(Ct),Lt,Ct]))return r.error(`Expected first argument to be of type array or string, but found ${G(s.type)} instead`);if(e.length===4){const g=r.parse(e[3],3,Ye);return g?new Uo(s.type,s,c,g):null}return new Uo(s.type,s,c)}evaluate(e){const r=this.input.evaluate(e),s=this.beginIndex.evaluate(e);if(!re(r,["string","array"]))throw new Ii(`Expected first argument to be of type array or string, but found ${G(qi(r))} instead.`);if(this.endIndex){const c=this.endIndex.evaluate(e);return r.slice(s,c)}return r.slice(s)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function lc(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function cc(i,e,r,s){return s.compare(e,r)===0}function Ms(i,e,r){const s=i!=="=="&&i!=="!=";return class Of{constructor(g,_,v){this.type=At,this.lhs=g,this.rhs=_,this.collator=v,this.hasUntypedArgument=g.type.kind==="value"||_.type.kind==="value"}static parse(g,_){if(g.length!==3&&g.length!==4)return _.error("Expected two or three arguments.");const v=g[0];let S=_.parse(g[1],1,Ct);if(!S)return null;if(!lc(v,S.type))return _.concat(1).error(`"${v}" comparisons are not supported for type '${G(S.type)}'.`);let k=_.parse(g[2],2,Ct);if(!k)return null;if(!lc(v,k.type))return _.concat(2).error(`"${v}" comparisons are not supported for type '${G(k.type)}'.`);if(S.type.kind!==k.type.kind&&S.type.kind!=="value"&&k.type.kind!=="value")return _.error(`Cannot compare types '${G(S.type)}' and '${G(k.type)}'.`);s&&(S.type.kind==="value"&&k.type.kind!=="value"?S=new Zr(k.type,[S]):S.type.kind!=="value"&&k.type.kind==="value"&&(k=new Zr(S.type,[k])));let A=null;if(g.length===4){if(S.type.kind!=="string"&&k.type.kind!=="string"&&S.type.kind!=="value"&&k.type.kind!=="value")return _.error("Cannot use collator to compare non-string types.");if(A=_.parse(g[3],3,es),!A)return null}return new Of(S,k,A)}evaluate(g){const _=this.lhs.evaluate(g),v=this.rhs.evaluate(g);if(s&&this.hasUntypedArgument){const S=qi(_),k=qi(v);if(S.kind!==k.kind||S.kind!=="string"&&S.kind!=="number")throw new Ii(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${S.kind}, ${k.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const S=qi(_),k=qi(v);if(S.kind!=="string"||k.kind!=="string")return e(g,_,v)}return this.collator?r(g,_,v,this.collator.evaluate(g)):e(g,_,v)}eachChild(g){g(this.lhs),g(this.rhs),this.collator&&g(this.collator)}outputDefined(){return!0}}}const Tu=Ms("==",function(i,e,r){return e===r},cc),Iu=Ms("!=",function(i,e,r){return e!==r},function(i,e,r,s){return!cc(0,e,r,s)}),ku=Ms("<",function(i,e,r){return e",function(i,e,r){return e>r},function(i,e,r,s){return s.compare(e,r)>0}),Mu=Ms("<=",function(i,e,r){return e<=r},function(i,e,r,s){return s.compare(e,r)<=0}),Au=Ms(">=",function(i,e,r){return e>=r},function(i,e,r,s){return s.compare(e,r)>=0});class Va{constructor(e,r,s,c,g){this.type=Lt,this.number=e,this.locale=r,this.currency=s,this.minFractionDigits=c,this.maxFractionDigits=g}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const s=r.parse(e[1],1,Ye);if(!s)return null;const c=e[2];if(typeof c!="object"||Array.isArray(c))return r.error("NumberFormat options argument must be an object.");let g=null;if(c.locale&&(g=r.parse(c.locale,1,Lt),!g))return null;let _=null;if(c.currency&&(_=r.parse(c.currency,1,Lt),!_))return null;let v=null;if(c["min-fraction-digits"]&&(v=r.parse(c["min-fraction-digits"],1,Ye),!v))return null;let S=null;return c["max-fraction-digits"]&&(S=r.parse(c["max-fraction-digits"],1,Ye),!S)?null:new Va(s,g,_,v,S)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class jo{constructor(e){this.type=Gi,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const s=e[1];if(!Array.isArray(s)&&typeof s=="object")return r.error("First argument must be an image or text section.");const c=[];let g=!1;for(let _=1;_<=e.length-1;++_){const v=e[_];if(g&&typeof v=="object"&&!Array.isArray(v)){g=!1;let S=null;if(v["font-scale"]&&(S=r.parse(v["font-scale"],1,Ye),!S))return null;let k=null;if(v["text-font"]&&(k=r.parse(v["text-font"],1,U(Lt)),!k))return null;let A=null;if(v["text-color"]&&(A=r.parse(v["text-color"],1,Ui),!A))return null;const E=c[c.length-1];E.scale=S,E.font=k,E.textColor=A}else{const S=r.parse(e[_],1,Ct);if(!S)return null;const k=S.type.kind;if(k!=="string"&&k!=="value"&&k!=="null"&&k!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");g=!0,c.push({content:S,scale:null,font:null,textColor:null})}}return new jo(c)}evaluate(e){return new qr(this.sections.map(r=>{const s=r.content.evaluate(e);return qi(s)===D?new Da("",s,null,null,null):new Da(Ks(s),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class Na{constructor(e){this.type=D,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const s=r.parse(e[1],1,Lt);return s?new Na(s):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),s=$r.fromString(r);return s&&e.availableImages&&(s.available=e.availableImages.indexOf(r)>-1),s}eachChild(e){e(this.input)}outputDefined(){return!1}}class Ua{constructor(e){this.type=Ye,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const s=r.parse(e[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${G(s.type)} instead.`):new Ua(s):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Ii(`Expected value to be of type string or array, but found ${G(qi(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const As={"==":Tu,"!=":Iu,">":Cu,"<":ku,">=":Au,"<=":Mu,array:Zr,at:Ra,boolean:Zr,case:Oa,coalesce:Oo,collator:Cs,format:jo,image:Na,in:Ba,"index-of":No,interpolate:dr,"interpolate-hcl":dr,"interpolate-lab":dr,length:Ua,let:Vo,literal:Vn,match:Fa,number:Zr,"number-format":Va,object:Zr,slice:Uo,step:io,string:Zr,"to-boolean":wn,"to-color":wn,"to-number":wn,"to-string":wn,var:Ro,within:ts};function uc(i,[e,r,s,c]){e=e.evaluate(i),r=r.evaluate(i),s=s.evaluate(i);const g=c?c.evaluate(i):1,_=ks(e,r,s,g);if(_)throw new Ii(_);return new ti(e/255,r/255,s/255,g,!1)}function hc(i,e){return i in e}function ja(i,e){const r=e[i];return r===void 0?null:r}function rs(i){return{type:i}}function dc(i){return{result:"success",value:i}}function Es(i){return{result:"error",value:i}}function Ps(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function pc(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function qa(i){return!!i.expression&&i.expression.interpolated}function Gt(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function qo(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Eu(i){return i}function fc(i,e){const r=e.type==="color",s=i.stops&&typeof i.stops[0][0]=="object",c=s||!(s||i.property!==void 0),g=i.type||(qa(e)?"exponential":"interval");if(r||e.type==="padding"){const A=r?ti.parse:zr.parse;(i=vn({},i)).stops&&(i.stops=i.stops.map(E=>[E[0],A(E[1])])),i.default=A(i.default?i.default:e.default)}if(i.colorSpace&&(_=i.colorSpace)!=="rgb"&&_!=="hcl"&&_!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var _;let v,S,k;if(g==="exponential")v=qt;else if(g==="interval")v=Pu;else if(g==="categorical"){v=Ri,S=Object.create(null);for(const A of i.stops)S[A[0]]=A[1];k=typeof i.stops[0][0]}else{if(g!=="identity")throw new Error(`Unknown function type "${g}"`);v=Za}if(s){const A={},E=[];for(let N=0;NN[0]),evaluate:({zoom:N},q)=>qt({stops:R,base:i.base},e,N).evaluate(N,q)}}if(c){const A=g==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:A,interpolationFactor:dr.interpolationFactor.bind(void 0,A),zoomStops:i.stops.map(E=>E[0]),evaluate:({zoom:E})=>v(i,e,E,S,k)}}return{kind:"source",evaluate(A,E){const R=E&&E.properties?E.properties[i.property]:void 0;return R===void 0?ro(i.default,e.default):v(i,e,R,S,k)}}}function ro(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function Ri(i,e,r,s,c){return ro(typeof r===c?s[r]:void 0,i.default,e.default)}function Pu(i,e,r){if(Gt(r)!=="number")return ro(i.default,e.default);const s=i.stops.length;if(s===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[s-1][0])return i.stops[s-1][1];const c=to(i.stops.map(g=>g[0]),r);return i.stops[c][1]}function qt(i,e,r){const s=i.base!==void 0?i.base:1;if(Gt(r)!=="number")return ro(i.default,e.default);const c=i.stops.length;if(c===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[c-1][0])return i.stops[c-1][1];const g=to(i.stops.map(A=>A[0]),r),_=function(A,E,R,O){const N=O-R,q=A-R;return N===0?0:E===1?q/N:(Math.pow(E,q)-1)/(Math.pow(E,N)-1)}(r,s,i.stops[g][0],i.stops[g+1][0]),v=i.stops[g][1],S=i.stops[g+1][1],k=br[e.type]||Eu;return typeof v.evaluate=="function"?{evaluate(...A){const E=v.evaluate.apply(void 0,A),R=S.evaluate.apply(void 0,A);if(E!==void 0&&R!==void 0)return k(E,R,_,i.colorSpace)}}:k(v,S,_,i.colorSpace)}function Za(i,e,r){switch(e.type){case"color":r=ti.parse(r);break;case"formatted":r=qr.fromString(r.toString());break;case"resolvedImage":r=$r.fromString(r.toString());break;case"padding":r=zr.parse(r);break;default:Gt(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return ro(r,i.default,e.default)}Gr.register(As,{error:[{kind:"error"},[Lt],(i,[e])=>{throw new Ii(e.evaluate(i))}],typeof:[Lt,[Ct],(i,[e])=>G(qi(e.evaluate(i)))],"to-rgba":[U(Ye,4),[Ui],(i,[e])=>{const[r,s,c,g]=e.evaluate(i).rgb;return[255*r,255*s,255*c,g]}],rgb:[Ui,[Ye,Ye,Ye],uc],rgba:[Ui,[Ye,Ye,Ye,Ye],uc],has:{type:At,overloads:[[[Lt],(i,[e])=>hc(e.evaluate(i),i.properties())],[[Lt,xn],(i,[e,r])=>hc(e.evaluate(i),r.evaluate(i))]]},get:{type:Ct,overloads:[[[Lt],(i,[e])=>ja(e.evaluate(i),i.properties())],[[Lt,xn],(i,[e,r])=>ja(e.evaluate(i),r.evaluate(i))]]},"feature-state":[Ct,[Lt],(i,[e])=>ja(e.evaluate(i),i.featureState||{})],properties:[xn,[],i=>i.properties()],"geometry-type":[Lt,[],i=>i.geometryType()],id:[Ct,[],i=>i.id()],zoom:[Ye,[],i=>i.globals.zoom],"heatmap-density":[Ye,[],i=>i.globals.heatmapDensity||0],"line-progress":[Ye,[],i=>i.globals.lineProgress||0],accumulated:[Ct,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Ye,rs(Ye),(i,e)=>{let r=0;for(const s of e)r+=s.evaluate(i);return r}],"*":[Ye,rs(Ye),(i,e)=>{let r=1;for(const s of e)r*=s.evaluate(i);return r}],"-":{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[Ye],(i,[e])=>-e.evaluate(i)]]},"/":[Ye,[Ye,Ye],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[Ye,[Ye,Ye],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[Ye,[],()=>Math.LN2],pi:[Ye,[],()=>Math.PI],e:[Ye,[],()=>Math.E],"^":[Ye,[Ye,Ye],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[Ye,[Ye],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Ye,[Ye],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Ye,[Ye],(i,[e])=>Math.log(e.evaluate(i))],log2:[Ye,[Ye],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Ye,[Ye],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Ye,[Ye],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Ye,[Ye],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Ye,[Ye],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Ye,[Ye],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Ye,[Ye],(i,[e])=>Math.atan(e.evaluate(i))],min:[Ye,rs(Ye),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[Ye,rs(Ye),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[Ye,[Ye],(i,[e])=>Math.abs(e.evaluate(i))],round:[Ye,[Ye],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ye,[Ye],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Ye,[Ye],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[At,[Lt,Ct],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[At,[Ct],(i,[e])=>i.id()===e.value],"filter-type-==":[At,[Lt],(i,[e])=>i.geometryType()===e.value],"filter-<":[At,[Lt,Ct],(i,[e,r])=>{const s=i.properties()[e.value],c=r.value;return typeof s==typeof c&&s{const r=i.id(),s=e.value;return typeof r==typeof s&&r":[At,[Lt,Ct],(i,[e,r])=>{const s=i.properties()[e.value],c=r.value;return typeof s==typeof c&&s>c}],"filter-id->":[At,[Ct],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>s}],"filter-<=":[At,[Lt,Ct],(i,[e,r])=>{const s=i.properties()[e.value],c=r.value;return typeof s==typeof c&&s<=c}],"filter-id-<=":[At,[Ct],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r<=s}],"filter->=":[At,[Lt,Ct],(i,[e,r])=>{const s=i.properties()[e.value],c=r.value;return typeof s==typeof c&&s>=c}],"filter-id->=":[At,[Ct],(i,[e])=>{const r=i.id(),s=e.value;return typeof r==typeof s&&r>=s}],"filter-has":[At,[Ct],(i,[e])=>e.value in i.properties()],"filter-has-id":[At,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[At,[U(Lt)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[At,[U(Ct)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[At,[Lt,U(Ct)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[At,[Lt,U(Ct)],(i,[e,r])=>function(s,c,g,_){for(;g<=_;){const v=g+_>>1;if(c[v]===s)return!0;c[v]>s?_=v-1:g=v+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:At,overloads:[[[At,At],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[rs(At),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:At,overloads:[[[At,At],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[rs(At),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[At,[At],(i,[e])=>!e.evaluate(i)],"is-supported-script":[At,[Lt],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[Lt,[Lt],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[Lt,[Lt],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[Lt,rs(Ct),(i,e)=>e.map(r=>Ks(r.evaluate(i))).join("")],"resolved-locale":[Lt,[es],(i,[e])=>e.evaluate(i).resolvedLocale()]});class di{constructor(e,r){var s;this.expression=e,this._warningHistory={},this._evaluator=new ii,this._defaultValue=r?(s=r).type==="color"&&qo(s.default)?new ti(0,0,0,0):s.type==="color"?ti.parse(s.default)||null:s.type==="padding"?zr.parse(s.default)||null:s.type==="variableAnchorOffsetCollection"?Qr.parse(s.default)||null:s.default===void 0?null:s.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,s,c,g,_){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=s,this._evaluator.canonical=c,this._evaluator.availableImages=g||null,this._evaluator.formattedSection=_,this.expression.evaluate(this._evaluator)}evaluate(e,r,s,c,g,_){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=s||null,this._evaluator.canonical=c,this._evaluator.availableImages=g||null,this._evaluator.formattedSection=_||null;try{const v=this.expression.evaluate(this._evaluator);if(v==null||typeof v=="number"&&v!=v)return this._defaultValue;if(this._enumValues&&!(v in this._enumValues))throw new Ii(`Expected value to be one of ${Object.keys(this._enumValues).map(S=>JSON.stringify(S)).join(", ")}, but found ${JSON.stringify(v)} instead.`);return v}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console<"u"&&console.warn(v.message)),this._defaultValue}}}function ci(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in As}function ns(i,e){const r=new Eo(As,Qs,[],e?function(c){const g={color:Ui,string:Lt,number:Ye,enum:Lt,boolean:At,formatted:Gi,padding:Y,resolvedImage:D,variableAnchorOffsetCollection:B};return c.type==="array"?U(g[c.value]||Ct,c.length):g[c.type]}(e):void 0),s=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?dc(new di(s,e)):Es(r.errors)}class Zo{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!$s(r.expression)}evaluateWithoutErrorHandling(e,r,s,c,g,_){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,c,g,_)}evaluate(e,r,s,c,g,_){return this._styleExpression.evaluate(e,r,s,c,g,_)}}class Ga{constructor(e,r,s,c){this.kind=e,this.zoomStops=s,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!$s(r.expression),this.interpolationType=c}evaluateWithoutErrorHandling(e,r,s,c,g,_){return this._styleExpression.evaluateWithoutErrorHandling(e,r,s,c,g,_)}evaluate(e,r,s,c,g,_){return this._styleExpression.evaluate(e,r,s,c,g,_)}interpolationFactor(e,r,s){return this.interpolationType?dr.interpolationFactor(this.interpolationType,e,r,s):0}}function mc(i,e){const r=ns(i,e);if(r.result==="error")return r;const s=r.value.expression,c=Bo(s);if(!c&&!Ps(e))return Es([new jr("","data expressions not supported")]);const g=eo(s,["zoom"]);if(!g&&!pc(e))return Es([new jr("","zoom expressions not supported")]);const _=Ho(s);return _||g?_ instanceof jr?Es([_]):_ instanceof dr&&!qa(e)?Es([new jr("",'"interpolate" expressions cannot be used with this property')]):dc(_?new Ga(c?"camera":"composite",r.value,_.labels,_ instanceof dr?_.interpolation:void 0):new Zo(c?"constant":"source",r.value)):Es([new jr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Go{constructor(e,r){this._parameters=e,this._specification=r,vn(this,fc(this._parameters,this._specification))}static deserialize(e){return new Go(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Ho(i){let e=null;if(i instanceof Vo)e=Ho(i.result);else if(i instanceof Oo){for(const r of i.args)if(e=Ho(r),e)break}else(i instanceof io||i instanceof dr)&&i.input instanceof Gr&&i.input.name==="zoom"&&(e=i);return e instanceof jr||i.eachChild(r=>{const s=Ho(r);s instanceof jr?e=s:!e&&s?e=new jr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&s&&e!==s&&(e=new jr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Wo(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!Wo(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const gc={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Xo(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Wo(i)||(i=Yo(i));const e=ns(i,gc);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,s,c)=>e.value.evaluate(r,s,{},c),needGeometry:Ko(i)}}function _c(i,e){return ie?1:0}function Ko(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?Ha(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(Yo))):e==="all"?["all"].concat(i.slice(1).map(Yo)):e==="none"?["all"].concat(i.slice(1).map(Yo).map(Jo)):e==="in"?yc(i[1],i.slice(2)):e==="!in"?Jo(yc(i[1],i.slice(2))):e==="has"?vc(i[1]):e==="!has"?Jo(vc(i[1])):e!=="within"||i;var r}function Ha(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function yc(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(_c)]]:["filter-in-small",i,["literal",e]]}}function vc(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Jo(i){return["!",i]}function Wa(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let c="[";for(const g of i)c+=`${Wa(g)},`;return`${c}]`}const r=Object.keys(i).sort();let s="{";for(let c=0;cs.maximum?[new We(e,r,`${r} is greater than the maximum value ${s.maximum}`)]:[]}function bc(i){const e=i.valueSpec,r=Mi(i.value.type);let s,c,g,_={};const v=r!=="categorical"&&i.value.property===void 0,S=!v,k=Gt(i.value.stops)==="array"&&Gt(i.value.stops[0])==="array"&&Gt(i.value.stops[0][0])==="object",A=wr({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(O){if(r==="identity")return[new We(O.key,O.value,'identity function may not have a "stops" property')];let N=[];const q=O.value;return N=N.concat(Xa({key:O.key,value:q,valueSpec:O.valueSpec,validateSpec:O.validateSpec,style:O.style,styleSpec:O.styleSpec,arrayElementValidator:E})),Gt(q)==="array"&&q.length===0&&N.push(new We(O.key,q,"array must have at least one stop")),N},default:function(O){return O.validateSpec({key:O.key,value:O.value,valueSpec:e,validateSpec:O.validateSpec,style:O.style,styleSpec:O.styleSpec})}}});return r==="identity"&&v&&A.push(new We(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||A.push(new We(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!qa(i.valueSpec)&&A.push(new We(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(S&&!Ps(i.valueSpec)?A.push(new We(i.key,i.value,"property functions not supported")):v&&!pc(i.valueSpec)&&A.push(new We(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!k||i.value.property!==void 0||A.push(new We(i.key,i.value,'"property" property is required')),A;function E(O){let N=[];const q=O.value,K=O.key;if(Gt(q)!=="array")return[new We(K,q,`array expected, ${Gt(q)} found`)];if(q.length!==2)return[new We(K,q,`array length 2 expected, length ${q.length} found`)];if(k){if(Gt(q[0])!=="object")return[new We(K,q,`object expected, ${Gt(q[0])} found`)];if(q[0].zoom===void 0)return[new We(K,q,"object stop key must have zoom")];if(q[0].value===void 0)return[new We(K,q,"object stop key must have value")];if(g&&g>Mi(q[0].zoom))return[new We(K,q[0].zoom,"stop zoom values must appear in ascending order")];Mi(q[0].zoom)!==g&&(g=Mi(q[0].zoom),c=void 0,_={}),N=N.concat(wr({key:`${K}[0]`,value:q[0],valueSpec:{zoom:{}},validateSpec:O.validateSpec,style:O.style,styleSpec:O.styleSpec,objectElementValidators:{zoom:Qo,value:R}}))}else N=N.concat(R({key:`${K}[0]`,value:q[0],valueSpec:{},validateSpec:O.validateSpec,style:O.style,styleSpec:O.styleSpec},q));return ci(Un(q[1]))?N.concat([new We(`${K}[1]`,q[1],"expressions are not allowed in function stops.")]):N.concat(O.validateSpec({key:`${K}[1]`,value:q[1],valueSpec:e,validateSpec:O.validateSpec,style:O.style,styleSpec:O.styleSpec}))}function R(O,N){const q=Gt(O.value),K=Mi(O.value),te=O.value!==null?O.value:N;if(s){if(q!==s)return[new We(O.key,te,`${q} stop domain type must match previous stop domain type ${s}`)]}else s=q;if(q!=="number"&&q!=="string"&&q!=="boolean")return[new We(O.key,te,"stop domain value must be a number, string, or boolean")];if(q!=="number"&&r!=="categorical"){let he=`number expected, ${q} found`;return Ps(e)&&r===void 0&&(he+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new We(O.key,te,he)]}return r!=="categorical"||q!=="number"||isFinite(K)&&Math.floor(K)===K?r!=="categorical"&&q==="number"&&c!==void 0&&Knew We(`${i.key}${s.key}`,i.value,s.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new We(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!$s(r))return[new We(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!$s(r))return[new We(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!eo(r,["zoom","feature-state"]))return[new We(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Bo(r))return[new We(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function qn(i){const e=i.key,r=i.value,s=i.valueSpec,c=[];return Array.isArray(s.values)?s.values.indexOf(Mi(r))===-1&&c.push(new We(e,r,`expected one of [${s.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(s.values).indexOf(Mi(r))===-1&&c.push(new We(e,r,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(r)} found`)),c}function zs(i){return Wo(Un(i.value))?jn(vn({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):$o(i)}function $o(i){const e=i.value,r=i.key;if(Gt(e)!=="array")return[new We(r,e,`array expected, ${Gt(e)} found`)];const s=i.styleSpec;let c,g=[];if(e.length<1)return[new We(r,e,"filter array must have at least 1 element")];switch(g=g.concat(qn({key:`${r}[0]`,value:e[0],valueSpec:s.filter_operator,style:i.style,styleSpec:i.styleSpec})),Mi(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Mi(e[1])==="$type"&&g.push(new We(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&g.push(new We(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(c=Gt(e[1]),c!=="string"&&g.push(new We(`${r}[1]`,e[1],`string expected, ${c} found`)));for(let _=2;_{k in r&&e.push(new We(s,r[k],`"${k}" is prohibited for ref layers`))}),c.layers.forEach(k=>{Mi(k.id)===v&&(S=k)}),S?S.ref?e.push(new We(s,r.ref,"ref cannot reference another ref layer")):_=Mi(S.type):e.push(new We(s,r.ref,`ref layer "${v}" not found`))}else if(_!=="background")if(r.source){const S=c.sources&&c.sources[r.source],k=S&&Mi(S.type);S?k==="vector"&&_==="raster"?e.push(new We(s,r.source,`layer "${r.id}" requires a raster source`)):k!=="raster-dem"&&_==="hillshade"?e.push(new We(s,r.source,`layer "${r.id}" requires a raster-dem source`)):k==="raster"&&_!=="raster"?e.push(new We(s,r.source,`layer "${r.id}" requires a vector source`)):k!=="vector"||r["source-layer"]?k==="raster-dem"&&_!=="hillshade"?e.push(new We(s,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):_!=="line"||!r.paint||!r.paint["line-gradient"]||k==="geojson"&&S.lineMetrics||e.push(new We(s,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new We(s,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new We(s,r.source,`source "${r.source}" not found`))}else e.push(new We(s,r,'missing required property "source"'));return e=e.concat(wr({key:s,value:r,valueSpec:g.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${s}.type`,value:r.type,valueSpec:g.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:zs,layout:S=>wr({layer:r,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,validateSpec:S.validateSpec,objectElementValidators:{"*":k=>no(vn({layerType:_},k))}}),paint:S=>wr({layer:r,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,validateSpec:S.validateSpec,objectElementValidators:{"*":k=>Ya(vn({layerType:_},k))}})}})),e}function ss(i){const e=i.value,r=i.key,s=Gt(e);return s!=="string"?[new We(r,e,`string expected, ${s} found`)]:[]}const Sc={promoteId:function({key:i,value:e}){if(Gt(e)==="string")return ss({key:i,value:e});{const r=[];for(const s in e)r.push(...ss({key:`${i}.${s}`,value:e[s]}));return r}}};function Tc(i){const e=i.value,r=i.key,s=i.styleSpec,c=i.style,g=i.validateSpec;if(!e.type)return[new We(r,e,'"type" is required')];const _=Mi(e.type);let v;switch(_){case"vector":case"raster":return v=wr({key:r,value:e,valueSpec:s[`source_${_.replace("-","_")}`],style:i.style,styleSpec:s,objectElementValidators:Sc,validateSpec:g}),v;case"raster-dem":return v=function(S){var k;const A=(k=S.sourceName)!==null&&k!==void 0?k:"",E=S.value,R=S.styleSpec,O=R.source_raster_dem,N=S.style;let q=[];const K=Gt(E);if(E===void 0)return q;if(K!=="object")return q.push(new We("source_raster_dem",E,`object expected, ${K} found`)),q;const te=Mi(E.encoding)==="custom",he=["redFactor","greenFactor","blueFactor","baseShift"],ie=S.value.encoding?`"${S.value.encoding}"`:"Default";for(const le in E)!te&&he.includes(le)?q.push(new We(le,E[le],`In "${A}": "${le}" is only valid when "encoding" is set to "custom". ${ie} encoding found`)):O[le]?q=q.concat(S.validateSpec({key:le,value:E[le],valueSpec:O[le],validateSpec:S.validateSpec,style:N,styleSpec:R})):q.push(new We(le,E[le],`unknown property "${le}"`));return q}({sourceName:r,value:e,style:i.style,styleSpec:s,validateSpec:g}),v;case"geojson":if(v=wr({key:r,value:e,valueSpec:s.source_geojson,style:c,styleSpec:s,validateSpec:g,objectElementValidators:Sc}),e.cluster)for(const S in e.clusterProperties){const[k,A]=e.clusterProperties[S],E=typeof k=="string"?[k,["accumulated"],["get",S]]:k;v.push(...jn({key:`${r}.${S}.map`,value:A,validateSpec:g,expressionContext:"cluster-map"})),v.push(...jn({key:`${r}.${S}.reduce`,value:E,validateSpec:g,expressionContext:"cluster-reduce"}))}return v;case"video":return wr({key:r,value:e,valueSpec:s.source_video,style:c,validateSpec:g,styleSpec:s});case"image":return wr({key:r,value:e,valueSpec:s.source_image,style:c,validateSpec:g,styleSpec:s});case"canvas":return[new We(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return qn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:c,validateSpec:g,styleSpec:s})}}function Ic(i){const e=i.value,r=i.styleSpec,s=r.light,c=i.style;let g=[];const _=Gt(e);if(e===void 0)return g;if(_!=="object")return g=g.concat([new We("light",e,`object expected, ${_} found`)]),g;for(const v in e){const S=v.match(/^(.*)-transition$/);g=g.concat(S&&s[S[1]]&&s[S[1]].transition?i.validateSpec({key:v,value:e[v],valueSpec:r.transition,validateSpec:i.validateSpec,style:c,styleSpec:r}):s[v]?i.validateSpec({key:v,value:e[v],valueSpec:s[v],validateSpec:i.validateSpec,style:c,styleSpec:r}):[new We(v,e[v],`unknown property "${v}"`)])}return g}function so(i){const e=i.value,r=i.styleSpec,s=r.sky,c=i.style,g=Gt(e);if(e===void 0)return[];if(g!=="object")return[new We("sky",e,`object expected, ${g} found`)];let _=[];for(const v in e)_=_.concat(s[v]?os({key:v,value:e[v],valueSpec:s[v],style:c,styleSpec:r}):[new We(v,e[v],`unknown property "${v}"`)]);return _}function oo(i){const e=i.value,r=i.styleSpec,s=r.terrain,c=i.style;let g=[];const _=Gt(e);if(e===void 0)return g;if(_!=="object")return g=g.concat([new We("terrain",e,`object expected, ${_} found`)]),g;for(const v in e)g=g.concat(s[v]?i.validateSpec({key:v,value:e[v],valueSpec:s[v],validateSpec:i.validateSpec,style:c,styleSpec:r}):[new We(v,e[v],`unknown property "${v}"`)]);return g}function Lr(i){let e=[];const r=i.value,s=i.key;if(Array.isArray(r)){const c=[],g=[];for(const _ in r)r[_].id&&c.includes(r[_].id)&&e.push(new We(s,r,`all the sprites' ids must be unique, but ${r[_].id} is duplicated`)),c.push(r[_].id),r[_].url&&g.includes(r[_].url)&&e.push(new We(s,r,`all the sprites' URLs must be unique, but ${r[_].url} is duplicated`)),g.push(r[_].url),e=e.concat(wr({key:`${s}[${_}]`,value:r[_],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return ss({key:s,value:r})}const Ls={"*":()=>[],array:Xa,boolean:function(i){const e=i.value,r=i.key,s=Gt(e);return s!=="boolean"?[new We(r,e,`boolean expected, ${s} found`)]:[]},number:Qo,color:function(i){const e=i.key,r=i.value,s=Gt(r);return s!=="string"?[new We(e,r,`color expected, ${s} found`)]:ti.parse(String(r))?[]:[new We(e,r,`color expected, "${r}" found`)]},constants:xc,enum:qn,filter:zs,function:bc,layer:wc,object:wr,source:Tc,light:Ic,sky:so,terrain:oo,string:ss,formatted:function(i){return ss(i).length===0?[]:jn(i)},resolvedImage:function(i){return ss(i).length===0?[]:jn(i)},padding:function(i){const e=i.key,r=i.value;if(Gt(r)==="array"){if(r.length<1||r.length>4)return[new We(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const s={type:"number"};let c=[];for(let g=0;g[]}})),i.constants&&(r=r.concat(xc({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:os}))),Ja(r)}function Dr(i){return function(e){return i({...e,validateSpec:os})}}function Ja(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function en(i){return function(...e){return Ja(i.apply(this,e))}}hn.source=en(Dr(Tc)),hn.sprite=en(Dr(Lr)),hn.glyphs=en(Dr(kc)),hn.light=en(Dr(Ic)),hn.sky=en(Dr(so)),hn.terrain=en(Dr(oo)),hn.layer=en(Dr(wc)),hn.filter=en(Dr(zs)),hn.paintProperty=en(Dr(Ya)),hn.layoutProperty=en(Dr(no));const ao=hn,Qa=ao.light,Lu=ao.paintProperty,lo=ao.layoutProperty;function Cc(i,e){let r=!1;if(e&&e.length)for(const s of e)i.fire(new Qt(new Error(s.message))),r=!0;return r}class as{constructor(e,r,s){const c=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const _=new Int32Array(this.arrayBuffer);e=_[0],this.d=(r=_[1])+2*(s=_[2]);for(let S=0;S=E[N+0]&&c>=E[N+1])?(v[O]=!0,_.push(A[O])):v[O]=!1}}}}_forEachCell(e,r,s,c,g,_,v,S){const k=this._convertToCellCoord(e),A=this._convertToCellCoord(r),E=this._convertToCellCoord(s),R=this._convertToCellCoord(c);for(let O=k;O<=E;O++)for(let N=A;N<=R;N++){const q=this.d*N+O;if((!S||S(this._convertFromCellCoord(O),this._convertFromCellCoord(N),this._convertFromCellCoord(O+1),this._convertFromCellCoord(N+1)))&&g.call(this,e,r,s,c,q,_,v,S))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,r=3+this.cells.length+1+1;let s=0;for(let _=0;_=0)continue;const _=i[g];c[g]=Pn[s].shallow.indexOf(g)>=0?_:Ds(_,e)}i instanceof Error&&(c.message=i.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return s!=="Object"&&(c.$name=s),c}throw new Error("can't serialize object of type "+typeof i)}function co(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||i instanceof Error||$a(i)||Vt(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(co);if(typeof i=="object"){const e=i.$name||"Object";if(!Pn[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=Pn[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const s=Object.create(r.prototype);for(const c of Object.keys(i)){if(c==="$name")continue;const g=i[c];s[c]=Pn[e].shallow.indexOf(c)>=0?g:co(g)}return s}throw new Error("can't deserialize object of type "+typeof i)}class ea{constructor(){this.first=!0}update(e,r){const s=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=s,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=s,!0):(this.lastFloorZoom>s?(this.lastIntegerZoom=s+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function ta(i){for(const e of i)if(ia(e.charCodeAt(0)))return!0;return!1}function Mc(i){for(const e of i)if(!Ac(e.charCodeAt(0)))return!1;return!0}function Ac(i){return!(et.Arabic(i)||et["Arabic Supplement"](i)||et["Arabic Extended-A"](i)||et["Arabic Presentation Forms-A"](i)||et["Arabic Presentation Forms-B"](i))}function ia(i){return!(i!==746&&i!==747&&(i<4352||!(et["Bopomofo Extended"](i)||et.Bopomofo(i)||et["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||et["CJK Compatibility Ideographs"](i)||et["CJK Compatibility"](i)||et["CJK Radicals Supplement"](i)||et["CJK Strokes"](i)||!(!et["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||et["CJK Unified Ideographs Extension A"](i)||et["CJK Unified Ideographs"](i)||et["Enclosed CJK Letters and Months"](i)||et["Hangul Compatibility Jamo"](i)||et["Hangul Jamo Extended-A"](i)||et["Hangul Jamo Extended-B"](i)||et["Hangul Jamo"](i)||et["Hangul Syllables"](i)||et.Hiragana(i)||et["Ideographic Description Characters"](i)||et.Kanbun(i)||et["Kangxi Radicals"](i)||et["Katakana Phonetic Extensions"](i)||et.Katakana(i)&&i!==12540||!(!et["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!et["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||et["Unified Canadian Aboriginal Syllabics"](i)||et["Unified Canadian Aboriginal Syllabics Extended"](i)||et["Vertical Forms"](i)||et["Yijing Hexagram Symbols"](i)||et["Yi Syllables"](i)||et["Yi Radicals"](i))))}function ra(i){return!(ia(i)||function(e){return!!(et["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||et["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||et["Letterlike Symbols"](e)||et["Number Forms"](e)||et["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||et["Control Pictures"](e)&&e!==9251||et["Optical Character Recognition"](e)||et["Enclosed Alphanumerics"](e)||et["Geometric Shapes"](e)||et["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||et["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||et["CJK Symbols and Punctuation"](e)||et.Katakana(e)||et["Private Use Area"](e)||et["CJK Compatibility Forms"](e)||et["Small Form Variants"](e)||et["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function el(i){return i>=1424&&i<=2303||et["Arabic Presentation Forms-A"](i)||et["Arabic Presentation Forms-B"](i)}function Du(i,e){return!(!e&&el(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||et.Khmer(i))}function Ec(i){for(const e of i)if(el(e.charCodeAt(0)))return!0;return!1}const ls=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(i){this.pluginStatus=i.pluginStatus,this.pluginURL=i.pluginURL}setMethods(i){this.applyArabicShaping=i.applyArabicShaping,this.processBidirectionalText=i.processBidirectionalText,this.processStyledBidirectionalText=i.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class pi{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ea,this.transition={})}isSupportedScript(e){return function(r,s){for(const c of r)if(!Du(c.charCodeAt(0),s))return!1;return!0}(e,ls.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),s=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*s}:{fromScale:.5,toScale:1,t:1-(1-s)*r}}}class uo{constructor(e,r){this.property=e,this.value=r,this.expression=function(s,c){if(qo(s))return new Go(s,c);if(ci(s)){const g=mc(s,c);if(g.result==="error")throw new Error(g.value.map(_=>`${_.key}: ${_.message}`).join(", "));return g.value}{let g=s;return c.type==="color"&&typeof s=="string"?g=ti.parse(s):c.type!=="padding"||typeof s!="number"&&!Array.isArray(s)?c.type==="variableAnchorOffsetCollection"&&Array.isArray(s)&&(g=Qr.parse(s)):g=zr.parse(s),{kind:"constant",evaluate:()=>g}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,s){return this.property.possiblyEvaluate(this,e,r,s)}}class na{constructor(e){this.property=e,this.value=new uo(e,void 0)}transitioned(e,r){return new zc(this.property,this.value,r,Ee({},e.transition,this.transition),e.now)}untransitioned(){return new zc(this.property,this.value,null,{},0)}}class Pc{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return ge(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new na(this._values[e].property)),this._values[e].value=new uo(this._values[e].property,r===null?void 0:ge(r))}getTransition(e){return ge(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new na(this._values[e].property)),this._values[e].transition=ge(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s);const c=this.getTransition(r);c!==void 0&&(e[`${r}-transition`]=c)}return e}transitioned(e,r){const s=new tl(this._properties);for(const c of Object.keys(this._values))s._values[c]=this._values[c].transitioned(e,r._values[c]);return s}untransitioned(){const e=new tl(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class zc{constructor(e,r,s,c,g){this.property=e,this.value=r,this.begin=g+c.delay||0,this.end=this.begin+c.duration||0,e.specification.transition&&(c.delay||c.duration)&&(this.prior=s)}possiblyEvaluate(e,r,s){const c=e.now||0,g=this.value.possiblyEvaluate(e,r,s),_=this.prior;if(_){if(c>this.end)return this.prior=null,g;if(this.value.isDataDriven())return this.prior=null,g;if(c=1)return 1;const k=S*S,A=k*S;return 4*(S<.5?A:3*(S-k)+A-.75)}(v))}}return g}}class tl{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,s){const c=new ho(this._properties);for(const g of Object.keys(this._values))c._values[g]=this._values[g].possiblyEvaluate(e,r,s);return c}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Lc{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return ge(this._values[e].value)}setValue(e,r){this._values[e]=new uo(this._values[e].property,r===null?void 0:ge(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const s=this.getValue(r);s!==void 0&&(e[r]=s)}return e}possiblyEvaluate(e,r,s){const c=new ho(this._properties);for(const g of Object.keys(this._values))c._values[g]=this._values[g].possiblyEvaluate(e,r,s);return c}}class dn{constructor(e,r,s){this.property=e,this.value=r,this.parameters=s}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,s,c){return this.property.evaluate(this.value,this.parameters,e,r,s,c)}}class ho{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class ht{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,s){const c=br[this.specification.type];return c?c(e,r,s):e}}class xt{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,s,c){return new dn(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},s,c)}:e.expression,r)}interpolate(e,r,s){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new dn(this,{kind:"constant",value:void 0},e.parameters);const c=br[this.specification.type];if(c){const g=c(e.value.value,r.value.value,s);return new dn(this,{kind:"constant",value:g},e.parameters)}return e}evaluate(e,r,s,c,g,_){return e.kind==="constant"?e.value:e.evaluate(r,s,c,g,_)}}class Rs extends xt{possiblyEvaluate(e,r,s,c){if(e.value===void 0)return new dn(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const g=e.expression.evaluate(r,null,{},s,c),_=e.property.specification.type==="resolvedImage"&&typeof g!="string"?g.name:g,v=this._calculate(_,_,_,r);return new dn(this,{kind:"constant",value:v},r)}if(e.expression.kind==="camera"){const g=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new dn(this,{kind:"constant",value:g},r)}return new dn(this,e.expression,r)}evaluate(e,r,s,c,g,_){if(e.kind==="source"){const v=e.evaluate(r,s,c,g,_);return this._calculate(v,v,v,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},s,c),e.evaluate({zoom:Math.floor(r.zoom)},s,c),e.evaluate({zoom:Math.floor(r.zoom)+1},s,c),r):e.value}_calculate(e,r,s,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class il{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,c){if(e.value!==void 0){if(e.expression.kind==="constant"){const g=e.expression.evaluate(r,null,{},s,c);return this._calculate(g,g,g,r)}return this._calculate(e.expression.evaluate(new pi(Math.floor(r.zoom-1),r)),e.expression.evaluate(new pi(Math.floor(r.zoom),r)),e.expression.evaluate(new pi(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,s,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:s,to:r}}interpolate(e){return e}}class rl{constructor(e){this.specification=e}possiblyEvaluate(e,r,s,c){return!!e.expression.evaluate(r,null,{},s,c)}interpolate(){return!1}}class Sr{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const s=e[r];s.specification.overridable&&this.overridableProperties.push(r);const c=this.defaultPropertyValues[r]=new uo(s,void 0),g=this.defaultTransitionablePropertyValues[r]=new na(s);this.defaultTransitioningPropertyValues[r]=g.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=c.possiblyEvaluate({})}}}rt("DataDrivenProperty",xt),rt("DataConstantProperty",ht),rt("CrossFadedDataDrivenProperty",Rs),rt("CrossFadedProperty",il),rt("ColorRampProperty",rl);const nl="-transition";class pn extends Di{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Lc(r.layout)),r.paint)){this._transitionablePaint=new Pc(r.paint);for(const s in e.paint)this.setPaintProperty(s,e.paint[s],{validate:!1});for(const s in e.layout)this.setLayoutProperty(s,e.layout[s],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ho(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,s={}){r!=null&&this._validate(lo,`layers.${this.id}.layout.${e}`,e,r,s)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(nl)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,s={}){if(r!=null&&this._validate(Lu,`layers.${this.id}.paint.${e}`,e,r,s))return!1;if(e.endsWith(nl))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const c=this._transitionablePaint._values[e],g=c.property.specification["property-type"]==="cross-faded-data-driven",_=c.value.isDataDriven(),v=c.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const S=this._transitionablePaint._values[e].value;return S.isDataDriven()||_||g||this._handleOverridablePaintPropertyUpdate(e,v,S)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,s){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const e={id:this.id,type:this.type,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()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),at(e,(r,s)=>!(r===void 0||s==="layout"&&!Object.keys(r).length||s==="paint"&&!Object.keys(r).length))}_validate(e,r,s,c,g={}){return(!g||g.validate!==!1)&&Cc(this,e.call(ao,{key:r,layerType:this.type,objectKey:s,value:c,styleSpec:we,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof dn&&Ps(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const Ru={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class po{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ai{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_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 r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Bi(i,e=1){let r=0,s=0;return{members:i.map(c=>{const g=Ru[c.type].BYTES_PER_ELEMENT,_=r=Dc(r,Math.max(e,g)),v=c.components||1;return s=Math.max(s,g),r+=g*v,{name:c.name,type:c.type,components:v,offset:_}}),size:Dc(r,Math.max(s,e)),alignment:e}}function Dc(i,e){return Math.ceil(i/e)*e}class Sn extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const c=2*e;return this.int16[c+0]=r,this.int16[c+1]=s,e}}Sn.prototype.bytesPerElement=4,rt("StructArrayLayout2i4",Sn);class sa extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,s)}emplace(e,r,s,c){const g=3*e;return this.int16[g+0]=r,this.int16[g+1]=s,this.int16[g+2]=c,e}}sa.prototype.bytesPerElement=6,rt("StructArrayLayout3i6",sa);class sl extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,c){const g=this.length;return this.resize(g+1),this.emplace(g,e,r,s,c)}emplace(e,r,s,c,g){const _=4*e;return this.int16[_+0]=r,this.int16[_+1]=s,this.int16[_+2]=c,this.int16[_+3]=g,e}}sl.prototype.bytesPerElement=8,rt("StructArrayLayout4i8",sl);class ol extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,c,g,_){const v=this.length;return this.resize(v+1),this.emplace(v,e,r,s,c,g,_)}emplace(e,r,s,c,g,_,v){const S=6*e;return this.int16[S+0]=r,this.int16[S+1]=s,this.int16[S+2]=c,this.int16[S+3]=g,this.int16[S+4]=_,this.int16[S+5]=v,e}}ol.prototype.bytesPerElement=12,rt("StructArrayLayout2i4i12",ol);class al extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,c,g,_){const v=this.length;return this.resize(v+1),this.emplace(v,e,r,s,c,g,_)}emplace(e,r,s,c,g,_,v){const S=4*e,k=8*e;return this.int16[S+0]=r,this.int16[S+1]=s,this.uint8[k+4]=c,this.uint8[k+5]=g,this.uint8[k+6]=_,this.uint8[k+7]=v,e}}al.prototype.bytesPerElement=8,rt("StructArrayLayout2i4ub8",al);class Bs extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const c=2*e;return this.float32[c+0]=r,this.float32[c+1]=s,e}}Bs.prototype.bytesPerElement=8,rt("StructArrayLayout2f8",Bs);class ll extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,c,g,_,v,S,k,A){const E=this.length;return this.resize(E+1),this.emplace(E,e,r,s,c,g,_,v,S,k,A)}emplace(e,r,s,c,g,_,v,S,k,A,E){const R=10*e;return this.uint16[R+0]=r,this.uint16[R+1]=s,this.uint16[R+2]=c,this.uint16[R+3]=g,this.uint16[R+4]=_,this.uint16[R+5]=v,this.uint16[R+6]=S,this.uint16[R+7]=k,this.uint16[R+8]=A,this.uint16[R+9]=E,e}}ll.prototype.bytesPerElement=20,rt("StructArrayLayout10ui20",ll);class cl extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,c,g,_,v,S,k,A,E,R){const O=this.length;return this.resize(O+1),this.emplace(O,e,r,s,c,g,_,v,S,k,A,E,R)}emplace(e,r,s,c,g,_,v,S,k,A,E,R,O){const N=12*e;return this.int16[N+0]=r,this.int16[N+1]=s,this.int16[N+2]=c,this.int16[N+3]=g,this.uint16[N+4]=_,this.uint16[N+5]=v,this.uint16[N+6]=S,this.uint16[N+7]=k,this.int16[N+8]=A,this.int16[N+9]=E,this.int16[N+10]=R,this.int16[N+11]=O,e}}cl.prototype.bytesPerElement=24,rt("StructArrayLayout4i4ui4i24",cl);class zn extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,s)}emplace(e,r,s,c){const g=3*e;return this.float32[g+0]=r,this.float32[g+1]=s,this.float32[g+2]=c,e}}zn.prototype.bytesPerElement=12,rt("StructArrayLayout3f12",zn);class oa extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}oa.prototype.bytesPerElement=4,rt("StructArrayLayout1ul4",oa);class fo extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s,c,g,_,v,S,k){const A=this.length;return this.resize(A+1),this.emplace(A,e,r,s,c,g,_,v,S,k)}emplace(e,r,s,c,g,_,v,S,k,A){const E=10*e,R=5*e;return this.int16[E+0]=r,this.int16[E+1]=s,this.int16[E+2]=c,this.int16[E+3]=g,this.int16[E+4]=_,this.int16[E+5]=v,this.uint32[R+3]=S,this.uint16[E+8]=k,this.uint16[E+9]=A,e}}fo.prototype.bytesPerElement=20,rt("StructArrayLayout6i1ul2ui20",fo);class aa extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,c,g,_){const v=this.length;return this.resize(v+1),this.emplace(v,e,r,s,c,g,_)}emplace(e,r,s,c,g,_,v){const S=6*e;return this.int16[S+0]=r,this.int16[S+1]=s,this.int16[S+2]=c,this.int16[S+3]=g,this.int16[S+4]=_,this.int16[S+5]=v,e}}aa.prototype.bytesPerElement=12,rt("StructArrayLayout2i2i2i12",aa);class mo extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,s,c,g){const _=this.length;return this.resize(_+1),this.emplace(_,e,r,s,c,g)}emplace(e,r,s,c,g,_){const v=4*e,S=8*e;return this.float32[v+0]=r,this.float32[v+1]=s,this.float32[v+2]=c,this.int16[S+6]=g,this.int16[S+7]=_,e}}mo.prototype.bytesPerElement=16,rt("StructArrayLayout2f1f2i16",mo);class ul extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,c){const g=this.length;return this.resize(g+1),this.emplace(g,e,r,s,c)}emplace(e,r,s,c,g){const _=12*e,v=3*e;return this.uint8[_+0]=r,this.uint8[_+1]=s,this.float32[v+1]=c,this.float32[v+2]=g,e}}ul.prototype.bytesPerElement=12,rt("StructArrayLayout2ub2f12",ul);class cs extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,s)}emplace(e,r,s,c){const g=3*e;return this.uint16[g+0]=r,this.uint16[g+1]=s,this.uint16[g+2]=c,e}}cs.prototype.bytesPerElement=6,rt("StructArrayLayout3ui6",cs);class us extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,c,g,_,v,S,k,A,E,R,O,N,q,K,te){const he=this.length;return this.resize(he+1),this.emplace(he,e,r,s,c,g,_,v,S,k,A,E,R,O,N,q,K,te)}emplace(e,r,s,c,g,_,v,S,k,A,E,R,O,N,q,K,te,he){const ie=24*e,le=12*e,ke=48*e;return this.int16[ie+0]=r,this.int16[ie+1]=s,this.uint16[ie+2]=c,this.uint16[ie+3]=g,this.uint32[le+2]=_,this.uint32[le+3]=v,this.uint32[le+4]=S,this.uint16[ie+10]=k,this.uint16[ie+11]=A,this.uint16[ie+12]=E,this.float32[le+7]=R,this.float32[le+8]=O,this.uint8[ke+36]=N,this.uint8[ke+37]=q,this.uint8[ke+38]=K,this.uint32[le+10]=te,this.int16[ie+22]=he,e}}us.prototype.bytesPerElement=48,rt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",us);class hl extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,c,g,_,v,S,k,A,E,R,O,N,q,K,te,he,ie,le,ke,Pe,it,ct,tt,Qe,Xe,ot){const Ke=this.length;return this.resize(Ke+1),this.emplace(Ke,e,r,s,c,g,_,v,S,k,A,E,R,O,N,q,K,te,he,ie,le,ke,Pe,it,ct,tt,Qe,Xe,ot)}emplace(e,r,s,c,g,_,v,S,k,A,E,R,O,N,q,K,te,he,ie,le,ke,Pe,it,ct,tt,Qe,Xe,ot,Ke){const je=32*e,gt=16*e;return this.int16[je+0]=r,this.int16[je+1]=s,this.int16[je+2]=c,this.int16[je+3]=g,this.int16[je+4]=_,this.int16[je+5]=v,this.int16[je+6]=S,this.int16[je+7]=k,this.uint16[je+8]=A,this.uint16[je+9]=E,this.uint16[je+10]=R,this.uint16[je+11]=O,this.uint16[je+12]=N,this.uint16[je+13]=q,this.uint16[je+14]=K,this.uint16[je+15]=te,this.uint16[je+16]=he,this.uint16[je+17]=ie,this.uint16[je+18]=le,this.uint16[je+19]=ke,this.uint16[je+20]=Pe,this.uint16[je+21]=it,this.uint16[je+22]=ct,this.uint32[gt+12]=tt,this.float32[gt+13]=Qe,this.float32[gt+14]=Xe,this.uint16[je+30]=ot,this.uint16[je+31]=Ke,e}}hl.prototype.bytesPerElement=64,rt("StructArrayLayout8i15ui1ul2f2ui64",hl);class go extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}go.prototype.bytesPerElement=4,rt("StructArrayLayout1f4",go);class hs extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,s)}emplace(e,r,s,c){const g=3*e;return this.uint16[6*e+0]=r,this.float32[g+1]=s,this.float32[g+2]=c,e}}hs.prototype.bytesPerElement=12,rt("StructArrayLayout1ui2f12",hs);class dl extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,s)}emplace(e,r,s,c){const g=4*e;return this.uint32[2*e+0]=r,this.uint16[g+2]=s,this.uint16[g+3]=c,e}}dl.prototype.bytesPerElement=8,rt("StructArrayLayout1ul2ui8",dl);class pl extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const s=this.length;return this.resize(s+1),this.emplace(s,e,r)}emplace(e,r,s){const c=2*e;return this.uint16[c+0]=r,this.uint16[c+1]=s,e}}pl.prototype.bytesPerElement=4,rt("StructArrayLayout2ui4",pl);class la extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}la.prototype.bytesPerElement=2,rt("StructArrayLayout1ui2",la);class fl extends Ai{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,s,c){const g=this.length;return this.resize(g+1),this.emplace(g,e,r,s,c)}emplace(e,r,s,c,g){const _=4*e;return this.float32[_+0]=r,this.float32[_+1]=s,this.float32[_+2]=c,this.float32[_+3]=g,e}}fl.prototype.bytesPerElement=16,rt("StructArrayLayout4f16",fl);class d extends po{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new j(this.anchorPointX,this.anchorPointY)}}d.prototype.size=20;class t extends fo{get(e){return new d(this,e)}}rt("CollisionBoxArray",t);class n extends po{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}n.prototype.size=48;class o extends us{get(e){return new n(this,e)}}rt("PlacedSymbolArray",o);class u extends po{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}u.prototype.size=64;class m extends hl{get(e){return new u(this,e)}}rt("SymbolInstanceArray",m);class w extends go{getoffsetX(e){return this.float32[1*e+0]}}rt("GlyphOffsetArray",w);class T extends sa{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}rt("SymbolLineVertexArray",T);class I extends po{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}I.prototype.size=12;class C extends hs{get(e){return new I(this,e)}}rt("TextAnchorOffsetArray",C);class P extends po{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]}}P.prototype.size=8;class z extends dl{get(e){return new P(this,e)}}rt("FeatureIndexArray",z);class V extends Sn{}class H extends Sn{}class W extends Sn{}class J extends ol{}class Z extends al{}class se extends Bs{}class fe extends ll{}class ee extends cl{}class ce extends zn{}class ve extends oa{}class _e extends aa{}class Ae extends ul{}class Re extends cs{}class Le extends pl{}const Ze=Bi([{name:"a_pos",components:2,type:"Int16"}],4),{members:st}=Ze;class vt{constructor(e=[]){this.segments=e}prepareSegment(e,r,s,c){let g=this.segments[this.segments.length-1];return e>vt.MAX_VERTEX_ARRAY_LENGTH&&ft(`Max vertices per segment is ${vt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!g||g.vertexLength+e>vt.MAX_VERTEX_ARRAY_LENGTH||g.sortKey!==c)&&(g={vertexOffset:r.length,primitiveOffset:s.length,vertexLength:0,primitiveLength:0},c!==void 0&&(g.sortKey=c),this.segments.push(g)),g}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,s,c){return new vt([{vertexOffset:e,primitiveOffset:r,vertexLength:s,primitiveLength:c,vaos:{},sortKey:0}])}}function Je(i,e){return 256*(i=me(Math.floor(i),0,255))+me(Math.floor(e),0,255)}vt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,rt("SegmentVector",vt);const yt=Bi([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var lt={exports:{}},fi={exports:{}};fi.exports=function(i,e){var r,s,c,g,_,v,S,k;for(s=i.length-(r=3&i.length),c=e,_=3432918353,v=461845907,k=0;k>>16)*_&65535)<<16)&4294967295)<<15|S>>>17))*v+(((S>>>16)*v&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(g>>>16)&65535)<<16);switch(S=0,r){case 3:S^=(255&i.charCodeAt(k+2))<<16;case 2:S^=(255&i.charCodeAt(k+1))<<8;case 1:c^=S=(65535&(S=(S=(65535&(S^=255&i.charCodeAt(k)))*_+(((S>>>16)*_&65535)<<16)&4294967295)<<15|S>>>17))*v+(((S>>>16)*v&65535)<<16)&4294967295}return c^=i.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0};var Bt=fi.exports,Pt={exports:{}};Pt.exports=function(i,e){for(var r,s=i.length,c=e^s,g=0;s>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(g)|(255&i.charCodeAt(++g))<<8|(255&i.charCodeAt(++g))<<16|(255&i.charCodeAt(++g))<<24))+((1540483477*(r>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),s-=4,++g;switch(s){case 3:c^=(255&i.charCodeAt(g+2))<<16;case 2:c^=(255&i.charCodeAt(g+1))<<8;case 1:c=1540483477*(65535&(c^=255&i.charCodeAt(g)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0};var Ft=Bt,Fi=Pt.exports;lt.exports=Ft,lt.exports.murmur3=Ft,lt.exports.murmur2=Fi;var ni=M(lt.exports);class Tr{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,s,c){this.ids.push(rr(e)),this.positions.push(r,s,c)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=rr(e);let s=0,c=this.ids.length-1;for(;s>1;this.ids[_]>=r?c=_:s=_+1}const g=[];for(;this.ids[s]===r;)g.push({index:this.positions[3*s],start:this.positions[3*s+1],end:this.positions[3*s+2]}),s++;return g}static serialize(e,r){const s=new Float64Array(e.ids),c=new Uint32Array(e.positions);return Ei(s,c,0,s.length-1),r&&r.push(s.buffer,c.buffer),{ids:s,positions:c}}static deserialize(e){const r=new Tr;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function rr(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:ni(String(i))}function Ei(i,e,r,s){for(;r>1];let g=r-1,_=s+1;for(;;){do g++;while(i[g]c);if(g>=_)break;pr(i,g,_),pr(e,3*g,3*_),pr(e,3*g+1,3*_+1),pr(e,3*g+2,3*_+2)}_-r`u_${c}`),this.type=s}setUniform(e,r,s){e.set(s.constantOr(this.value))}getBinding(e,r,s){return this.type==="color"?new Fs(e,r):new tn(e,r)}}class Oi{constructor(e,r){this.uniformNames=r.map(s=>`u_${s}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,s,c){const g=c==="u_pattern_to"?this.patternTo:c==="u_pattern_from"?this.patternFrom:c==="u_pixel_ratio_to"?this.pixelRatioTo:c==="u_pixel_ratio_from"?this.pixelRatioFrom:null;g&&e.set(g)}getBinding(e,r,s){return s.substr(0,9)==="u_pattern"?new Zn(e,r):new tn(e,r)}}class Pi{constructor(e,r,s,c){this.expression=e,this.type=s,this.maxValue=0,this.paintVertexAttributes=r.map(g=>({name:`a_${g}`,type:"Float32",components:s==="color"?2:1,offset:0})),this.paintVertexArray=new c}populatePaintArray(e,r,s,c,g){const _=this.paintVertexArray.length,v=this.expression.evaluate(new pi(0),r,{},c,[],g);this.paintVertexArray.resize(e),this._setPaintValue(_,e,v)}updatePaintArray(e,r,s,c){const g=this.expression.evaluate({zoom:0},s,c);this._setPaintValue(e,r,g)}_setPaintValue(e,r,s){if(this.type==="color"){const c=Gn(s);for(let g=e;g`u_${v}_t`),this.type=s,this.useIntegerZoom=c,this.zoom=g,this.maxValue=0,this.paintVertexAttributes=r.map(v=>({name:`a_${v}`,type:"Float32",components:s==="color"?4:2,offset:0})),this.paintVertexArray=new _}populatePaintArray(e,r,s,c,g){const _=this.expression.evaluate(new pi(this.zoom),r,{},c,[],g),v=this.expression.evaluate(new pi(this.zoom+1),r,{},c,[],g),S=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(S,e,_,v)}updatePaintArray(e,r,s,c){const g=this.expression.evaluate({zoom:this.zoom},s,c),_=this.expression.evaluate({zoom:this.zoom+1},s,c);this._setPaintValue(e,r,g,_)}_setPaintValue(e,r,s,c){if(this.type==="color"){const g=Gn(s),_=Gn(c);for(let v=e;v`#define HAS_UNIFORM_${c}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const s=this.binders[r];if(s instanceof Pi||s instanceof Ir)for(let c=0;c!0){this.programConfigurations={};for(const c of e)this.programConfigurations[c.id]=new Xi(c,r,s);this.needsUpload=!1,this._featureMap=new Tr,this._bufferOffset=0}populatePaintArrays(e,r,s,c,g,_){for(const v in this.programConfigurations)this.programConfigurations[v].populatePaintArrays(e,r,c,g,_);r.id!==void 0&&this._featureMap.add(r.id,s,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,s,c){for(const g of s)this.needsUpload=this.programConfigurations[g.id].updatePaintArrays(e,this._featureMap,r,g,c)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Ki(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"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"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function Rc(i,e,r){const s={color:{source:Bs,composite:fl},number:{source:go,composite:Bs}},c=function(g){return{"line-pattern":{source:fe,composite:fe},"fill-pattern":{source:fe,composite:fe},"fill-extrusion-pattern":{source:fe,composite:fe}}[g]}(i);return c&&c[r]||s[e][r]}rt("ConstantBinder",Wi),rt("CrossFadedConstantBinder",Oi),rt("SourceExpressionBinder",Pi),rt("CrossFadedCompositeBinder",mi),rt("CompositeExpressionBinder",Ir),rt("ProgramConfiguration",Xi,{omit:["_buffers"]}),rt("ProgramConfigurationSet",nr);const zi=8192,ml=Math.pow(2,14)-1,Bc=-ml-1;function ds(i){const e=zi/i.extent,r=i.loadGeometry();for(let s=0;s_.x+1||S<_.y||S>_.y+1)&&ft("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function ps(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?ds(i):[]}}function Ln(i,e,r,s,c){i.emplaceBack(2*e+(s+1)/2,2*r+(c+1)/2)}class ca{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new H,this.indexArray=new Re,this.segments=new vt,this.programConfigurations=new nr(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){const c=this.layers[0],g=[];let _=null,v=!1;c.type==="circle"&&(_=c.layout.get("circle-sort-key"),v=!_.isConstant());for(const{feature:S,id:k,index:A,sourceLayerIndex:E}of e){const R=this.layers[0]._featureFilter.needGeometry,O=ps(S,R);if(!this.layers[0]._featureFilter.filter(new pi(this.zoom),O,s))continue;const N=v?_.evaluate(O,{},s):void 0,q={id:k,properties:S.properties,type:S.type,sourceLayerIndex:E,index:A,geometry:R?O.geometry:ds(S),patterns:{},sortKey:N};g.push(q)}v&&g.sort((S,k)=>S.sortKey-k.sortKey);for(const S of g){const{geometry:k,index:A,sourceLayerIndex:E}=S,R=e[A].feature;this.addFeature(S,k,A,s),r.featureIndex.insert(R,k,A,E,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,st),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,s,c){for(const g of r)for(const _ of g){const v=_.x,S=_.y;if(v<0||v>=zi||S<0||S>=zi)continue;const k=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),A=k.vertexLength;Ln(this.layoutVertexArray,v,S,-1,-1),Ln(this.layoutVertexArray,v,S,1,-1),Ln(this.layoutVertexArray,v,S,1,1),Ln(this.layoutVertexArray,v,S,-1,1),this.indexArray.emplaceBack(A,A+1,A+2),this.indexArray.emplaceBack(A,A+3,A+2),k.vertexLength+=4,k.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,{},c)}}function gl(i,e){for(let r=0;r1){if(_o(i,e))return!0;for(let s=0;s1?r:r.sub(e)._mult(c)._add(e))}function Kh(i,e){let r,s,c,g=!1;for(let _=0;_e.y!=c.y>e.y&&e.x<(c.x-s.x)*(e.y-s.y)/(c.y-s.y)+s.x&&(g=!g)}return g}function ha(i,e){let r=!1;for(let s=0,c=i.length-1;se.y!=_.y>e.y&&e.x<(_.x-g.x)*(e.y-g.y)/(_.y-g.y)+g.x&&(r=!r)}return r}function um(i,e,r){const s=r[0],c=r[2];if(i.xc.x&&e.x>c.x||i.yc.y&&e.y>c.y)return!1;const g=kt(i,e,r[0]);return g!==kt(i,e,r[1])||g!==kt(i,e,r[2])||g!==kt(i,e,r[3])}function _l(i,e,r){const s=e.paint.get(i).value;return s.kind==="constant"?s.value:r.programConfigurations.get(e.id).getMaxValue(i)}function Vc(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Nc(i,e,r,s,c){if(!e[0]&&!e[1])return i;const g=j.convert(e)._mult(c);r==="viewport"&&g._rotate(-s);const _=[];for(let v=0;v$h(K,q))}(k,S),O=E?A*v:A;for(const N of c)for(const q of N){const K=E?q:$h(q,S);let te=O;const he=Uc([],[q.x,q.y,0,1],S);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?te*=he[3]/_.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(te*=_.cameraToCenterDistance/he[3]),Fc(R,K,te))return!0}return!1}}function $h(i,e){const r=Uc([],[i.x,i.y,0,1],e);return new j(r[0]/r[3],r[1]/r[3])}class ed extends ca{}let td;rt("HeatmapBucket",ed,{omit:["layers"]});var fm={get paint(){return td=td||new Sr({"heatmap-radius":new xt(we.paint_heatmap["heatmap-radius"]),"heatmap-weight":new xt(we.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ht(we.paint_heatmap["heatmap-intensity"]),"heatmap-color":new rl(we.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ht(we.paint_heatmap["heatmap-opacity"])})}};function Ou(i,{width:e,height:r},s,c){if(c){if(c instanceof Uint8ClampedArray)c=new Uint8Array(c.buffer);else if(c.length!==e*r*s)throw new RangeError(`mismatched image size. expected: ${c.length} but got: ${e*r*s}`)}else c=new Uint8Array(e*r*s);return i.width=e,i.height=r,i.data=c,i}function id(i,{width:e,height:r},s){if(e===i.width&&r===i.height)return;const c=Ou({},{width:e,height:r},s);Vu(i,c,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},s),i.width=e,i.height=r,i.data=c.data}function Vu(i,e,r,s,c,g){if(c.width===0||c.height===0)return e;if(c.width>i.width||c.height>i.height||r.x>i.width-c.width||r.y>i.height-c.height)throw new RangeError("out of range source coordinates for image copy");if(c.width>e.width||c.height>e.height||s.x>e.width-c.width||s.y>e.height-c.height)throw new RangeError("out of range destination coordinates for image copy");const _=i.data,v=e.data;if(_===v)throw new Error("srcData equals dstData, so image is already copied");for(let S=0;S{e[i.evaluationKey]=S;const k=i.expression.evaluate(e);c.data[_+v+0]=Math.floor(255*k.r/k.a),c.data[_+v+1]=Math.floor(255*k.g/k.a),c.data[_+v+2]=Math.floor(255*k.b/k.a),c.data[_+v+3]=Math.floor(255*k.a)};if(i.clips)for(let _=0,v=0;_80*r){s=g=i[0],c=_=i[1];for(var N=r;Ng&&(g=v),S>_&&(_=S);k=(k=Math.max(g-s,_-c))!==0?32767/k:0}return xl(R,O,r,s,c,k,0),O}function sd(i,e,r,s,c){var g,_;if(c===qu(i,e,r,s)>0)for(g=e;g=e;g-=s)_=ld(g,i[g],i[g+1],_);return _&&qc(_,_.next)&&(wl(_),_=_.next),_}function yo(i,e){if(!i)return i;e||(e=i);var r,s=i;do if(r=!1,s.steiner||!qc(s,s.next)&&Vi(s.prev,s,s.next)!==0)s=s.next;else{if(wl(s),(s=e=s.prev)===s.next)break;r=!0}while(r||s!==e);return e}function xl(i,e,r,s,c,g,_){if(i){!_&&g&&function(A,E,R,O){var N=A;do N.z===0&&(N.z=Uu(N.x,N.y,E,R,O)),N.prevZ=N.prev,N.nextZ=N.next,N=N.next;while(N!==A);N.prevZ.nextZ=null,N.prevZ=null,function(q){var K,te,he,ie,le,ke,Pe,it,ct=1;do{for(te=q,q=null,le=null,ke=0;te;){for(ke++,he=te,Pe=0,K=0;K0||it>0&&he;)Pe!==0&&(it===0||!he||te.z<=he.z)?(ie=te,te=te.nextZ,Pe--):(ie=he,he=he.nextZ,it--),le?le.nextZ=ie:q=ie,ie.prevZ=le,le=ie;te=he}le.nextZ=null,ct*=2}while(ke>1)}(N)}(i,s,c,g);for(var v,S,k=i;i.prev!==i.next;)if(v=i.prev,S=i.next,g?bm(i,s,c,g):xm(i))e.push(v.i/r|0),e.push(i.i/r|0),e.push(S.i/r|0),wl(i),i=S.next,k=S.next;else if((i=S)===k){_?_===1?xl(i=wm(yo(i),e,r),e,r,s,c,g,2):_===2&&Sm(i,e,r,s,c,g):xl(yo(i),e,r,s,c,g,1);break}}}function xm(i){var e=i.prev,r=i,s=i.next;if(Vi(e,r,s)>=0)return!1;for(var c=e.x,g=r.x,_=s.x,v=e.y,S=r.y,k=s.y,A=cg?c>_?c:_:g>_?g:_,O=v>S?v>k?v:k:S>k?S:k,N=s.next;N!==e;){if(N.x>=A&&N.x<=R&&N.y>=E&&N.y<=O&&pa(c,v,g,S,_,k,N.x,N.y)&&Vi(N.prev,N,N.next)>=0)return!1;N=N.next}return!0}function bm(i,e,r,s){var c=i.prev,g=i,_=i.next;if(Vi(c,g,_)>=0)return!1;for(var v=c.x,S=g.x,k=_.x,A=c.y,E=g.y,R=_.y,O=vS?v>k?v:k:S>k?S:k,K=A>E?A>R?A:R:E>R?E:R,te=Uu(O,N,e,r,s),he=Uu(q,K,e,r,s),ie=i.prevZ,le=i.nextZ;ie&&ie.z>=te&&le&&le.z<=he;){if(ie.x>=O&&ie.x<=q&&ie.y>=N&&ie.y<=K&&ie!==c&&ie!==_&&pa(v,A,S,E,k,R,ie.x,ie.y)&&Vi(ie.prev,ie,ie.next)>=0||(ie=ie.prevZ,le.x>=O&&le.x<=q&&le.y>=N&&le.y<=K&&le!==c&&le!==_&&pa(v,A,S,E,k,R,le.x,le.y)&&Vi(le.prev,le,le.next)>=0))return!1;le=le.nextZ}for(;ie&&ie.z>=te;){if(ie.x>=O&&ie.x<=q&&ie.y>=N&&ie.y<=K&&ie!==c&&ie!==_&&pa(v,A,S,E,k,R,ie.x,ie.y)&&Vi(ie.prev,ie,ie.next)>=0)return!1;ie=ie.prevZ}for(;le&&le.z<=he;){if(le.x>=O&&le.x<=q&&le.y>=N&&le.y<=K&&le!==c&&le!==_&&pa(v,A,S,E,k,R,le.x,le.y)&&Vi(le.prev,le,le.next)>=0)return!1;le=le.nextZ}return!0}function wm(i,e,r){var s=i;do{var c=s.prev,g=s.next.next;!qc(c,g)&&od(c,s,s.next,g)&&bl(c,g)&&bl(g,c)&&(e.push(c.i/r|0),e.push(s.i/r|0),e.push(g.i/r|0),wl(s),wl(s.next),s=i=g),s=s.next}while(s!==i);return yo(s)}function Sm(i,e,r,s,c,g){var _=i;do{for(var v=_.next.next;v!==_.prev;){if(_.i!==v.i&&Mm(_,v)){var S=ad(_,v);return _=yo(_,_.next),S=yo(S,S.next),xl(_,e,r,s,c,g,0),void xl(S,e,r,s,c,g,0)}v=v.next}_=_.next}while(_!==i)}function Tm(i,e){return i.x-e.x}function Im(i,e){var r=function(c,g){var _,v=g,S=c.x,k=c.y,A=-1/0;do{if(k<=v.y&&k>=v.next.y&&v.next.y!==v.y){var E=v.x+(k-v.y)*(v.next.x-v.x)/(v.next.y-v.y);if(E<=S&&E>A&&(A=E,_=v.x=v.x&&v.x>=N&&S!==v.x&&pa(k_.x||v.x===_.x&&km(_,v)))&&(_=v,K=R)),v=v.next;while(v!==O);return _}(i,e);if(!r)return e;var s=ad(r,i);return yo(s,s.next),yo(r,r.next)}function km(i,e){return Vi(i.prev,i,e.prev)<0&&Vi(e.next,i,i.next)<0}function Uu(i,e,r,s,c){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*c|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*c|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Cm(i){var e=i,r=i;do(e.x=(i-_)*(g-v)&&(i-_)*(s-v)>=(r-_)*(e-v)&&(r-_)*(g-v)>=(c-_)*(s-v)}function Mm(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,s){var c=r;do{if(c.i!==r.i&&c.next.i!==r.i&&c.i!==s.i&&c.next.i!==s.i&&od(c,c.next,r,s))return!0;c=c.next}while(c!==r);return!1}(i,e)&&(bl(i,e)&&bl(e,i)&&function(r,s){var c=r,g=!1,_=(r.x+s.x)/2,v=(r.y+s.y)/2;do c.y>v!=c.next.y>v&&c.next.y!==c.y&&_<(c.next.x-c.x)*(v-c.y)/(c.next.y-c.y)+c.x&&(g=!g),c=c.next;while(c!==r);return g}(i,e)&&(Vi(i.prev,i,e.prev)||Vi(i,e.prev,e))||qc(i,e)&&Vi(i.prev,i,i.next)>0&&Vi(e.prev,e,e.next)>0)}function Vi(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function qc(i,e){return i.x===e.x&&i.y===e.y}function od(i,e,r,s){var c=Gc(Vi(i,e,r)),g=Gc(Vi(i,e,s)),_=Gc(Vi(r,s,i)),v=Gc(Vi(r,s,e));return c!==g&&_!==v||!(c!==0||!Zc(i,r,e))||!(g!==0||!Zc(i,s,e))||!(_!==0||!Zc(r,i,s))||!(v!==0||!Zc(r,e,s))}function Zc(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function Gc(i){return i>0?1:i<0?-1:0}function bl(i,e){return Vi(i.prev,i,i.next)<0?Vi(i,e,i.next)>=0&&Vi(i,i.prev,e)>=0:Vi(i,e,i.prev)<0||Vi(i,i.next,e)<0}function ad(i,e){var r=new ju(i.i,i.x,i.y),s=new ju(e.i,e.x,e.y),c=i.next,g=e.prev;return i.next=e,e.prev=i,r.next=c,c.prev=r,s.next=r,r.prev=s,g.next=s,s.prev=g,s}function ld(i,e,r,s){var c=new ju(i,e,r);return s?(c.next=s.next,c.prev=s,s.next.prev=c,s.next=c):(c.prev=c,c.next=c),c}function wl(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function ju(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function qu(i,e,r,s){for(var c=0,g=e,_=r-s;g0&&r.holes.push(s+=i[c-1].length)}return r};var cd=M(Nu.exports);function Am(i,e,r,s,c){ud(i,e,r||0,s||i.length-1,c||Em)}function ud(i,e,r,s,c){for(;s>r;){if(s-r>600){var g=s-r+1,_=e-r+1,v=Math.log(g),S=.5*Math.exp(2*v/3),k=.5*Math.sqrt(v*S*(g-S)/g)*(_-g/2<0?-1:1);ud(i,e,Math.max(r,Math.floor(e-_*S/g+k)),Math.min(s,Math.floor(e+(g-_)*S/g+k)),c)}var A=i[e],E=r,R=s;for(Sl(i,r,e),c(i[s],A)>0&&Sl(i,r,s);E0;)R--}c(i[r],A)===0?Sl(i,r,R):Sl(i,++R,s),R<=e&&(r=R+1),e<=R&&(s=R-1)}}function Sl(i,e,r){var s=i[e];i[e]=i[r],i[r]=s}function Em(i,e){return ie?1:0}function Zu(i,e){const r=i.length;if(r<=1)return[i];const s=[];let c,g;for(let _=0;_1)for(let _=0;_r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new W,this.indexArray=new Re,this.indexArray2=new Le,this.programConfigurations=new nr(e.layers,e.zoom),this.segments=new vt,this.segments2=new vt,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=Gu("fill",this.layers,r);const c=this.layers[0].layout.get("fill-sort-key"),g=!c.isConstant(),_=[];for(const{feature:v,id:S,index:k,sourceLayerIndex:A}of e){const E=this.layers[0]._featureFilter.needGeometry,R=ps(v,E);if(!this.layers[0]._featureFilter.filter(new pi(this.zoom),R,s))continue;const O=g?c.evaluate(R,{},s,r.availableImages):void 0,N={id:S,properties:v.properties,type:v.type,sourceLayerIndex:A,index:k,geometry:E?R.geometry:ds(v),patterns:{},sortKey:O};_.push(N)}g&&_.sort((v,S)=>v.sortKey-S.sortKey);for(const v of _){const{geometry:S,index:k,sourceLayerIndex:A}=v;if(this.hasPattern){const E=Hu("fill",this.layers,v,this.zoom,r);this.patternFeatures.push(E)}else this.addFeature(v,S,k,s,{});r.featureIndex.insert(e[k].feature,S,k,A,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const c of this.patternFeatures)this.addFeature(c,c.geometry,c.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,vm),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,r,s,c,g){for(const _ of Zu(r,500)){let v=0;for(const O of _)v+=O.length;const S=this.segments.prepareSegment(v,this.layoutVertexArray,this.indexArray),k=S.vertexLength,A=[],E=[];for(const O of _){if(O.length===0)continue;O!==_[0]&&E.push(A.length/2);const N=this.segments2.prepareSegment(O.length,this.layoutVertexArray,this.indexArray2),q=N.vertexLength;this.layoutVertexArray.emplaceBack(O[0].x,O[0].y),this.indexArray2.emplaceBack(q+O.length-1,q),A.push(O[0].x),A.push(O[0].y);for(let K=1;K>3}if(c--,s===1||s===2)g+=i.readSVarint(),_+=i.readSVarint(),s===1&&(e&&v.push(e),e=[]),e.push(new Fm(g,_));else{if(s!==7)throw new Error("unknown command "+s);e&&e.push(e[0].clone())}}return e&&v.push(e),v},fa.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,s=0,c=0,g=0,_=1/0,v=-1/0,S=1/0,k=-1/0;i.pos>3}if(s--,r===1||r===2)(c+=i.readSVarint())<_&&(_=c),c>v&&(v=c),(g+=i.readSVarint())k&&(k=g);else if(r!==7)throw new Error("unknown command "+r)}return[_,S,v,k]},fa.prototype.toGeoJSON=function(i,e,r){var s,c,g=this.extent*Math.pow(2,r),_=this.extent*i,v=this.extent*e,S=this.loadGeometry(),k=fa.types[this.type];function A(O){for(var N=0;N>3;c=_===1?s.readString():_===2?s.readFloat():_===3?s.readDouble():_===4?s.readVarint64():_===5?s.readVarint():_===6?s.readSVarint():_===7?s.readBoolean():null}return c}(r))}md.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new Nm(this._pbf,e,this.extent,this._keys,this._values)};var jm=fd;function qm(i,e,r){if(i===3){var s=new jm(r,r.readVarint()+r.pos);s.length&&(e[s.name]=s)}}Vs.VectorTile=function(i,e){this.layers=i.readFields(qm,{},e)},Vs.VectorTileFeature=pd,Vs.VectorTileLayer=fd;const Zm=Vs.VectorTileFeature.types,Xu=Math.pow(2,13);function Tl(i,e,r,s,c,g,_,v){i.emplaceBack(e,r,2*Math.floor(s*Xu)+_,c*Xu*2,g*Xu*2,Math.round(v))}class Ku{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new J,this.centroidVertexArray=new V,this.indexArray=new Re,this.programConfigurations=new nr(e.layers,e.zoom),this.segments=new vt,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.features=[],this.hasPattern=Gu("fill-extrusion",this.layers,r);for(const{feature:c,id:g,index:_,sourceLayerIndex:v}of e){const S=this.layers[0]._featureFilter.needGeometry,k=ps(c,S);if(!this.layers[0]._featureFilter.filter(new pi(this.zoom),k,s))continue;const A={id:g,sourceLayerIndex:v,index:_,geometry:S?k.geometry:ds(c),properties:c.properties,type:c.type,patterns:{}};this.hasPattern?this.features.push(Hu("fill-extrusion",this.layers,A,this.zoom,r)):this.addFeature(A,A.geometry,_,s,{}),r.featureIndex.insert(c,A.geometry,_,v,this.index,!0)}}addFeatures(e,r,s){for(const c of this.features){const{geometry:g}=c;this.addFeature(c,g,c.index,r,s)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Bm),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Rm.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,s,c,g){const _={x:0,y:0,vertexCount:0};for(const v of Zu(r,500)){let S=0;for(const N of v)S+=N.length;let k=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const N of v){if(N.length===0||Hm(N))continue;let q=0;for(let K=0;K=1){const he=N[K-1];if(!Gm(te,he)){k.vertexLength+4>vt.MAX_VERTEX_ARRAY_LENGTH&&(k=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const ie=te.sub(he)._perp()._unit(),le=he.dist(te);q+le>32768&&(q=0),Tl(this.layoutVertexArray,te.x,te.y,ie.x,ie.y,0,0,q),Tl(this.layoutVertexArray,te.x,te.y,ie.x,ie.y,0,1,q),_.x+=2*te.x,_.y+=2*te.y,_.vertexCount+=2,q+=le,Tl(this.layoutVertexArray,he.x,he.y,ie.x,ie.y,0,0,q),Tl(this.layoutVertexArray,he.x,he.y,ie.x,ie.y,0,1,q),_.x+=2*he.x,_.y+=2*he.y,_.vertexCount+=2;const ke=k.vertexLength;this.indexArray.emplaceBack(ke,ke+2,ke+1),this.indexArray.emplaceBack(ke+1,ke+2,ke+3),k.vertexLength+=4,k.primitiveLength+=2}}}}if(k.vertexLength+S>vt.MAX_VERTEX_ARRAY_LENGTH&&(k=this.segments.prepareSegment(S,this.layoutVertexArray,this.indexArray)),Zm[e.type]!=="Polygon")continue;const A=[],E=[],R=k.vertexLength;for(const N of v)if(N.length!==0){N!==v[0]&&E.push(A.length/2);for(let q=0;qzi)||i.y===e.y&&(i.y<0||i.y>zi)}function Hm(i){return i.every(e=>e.x<0)||i.every(e=>e.x>zi)||i.every(e=>e.y<0)||i.every(e=>e.y>zi)}let gd;rt("FillExtrusionBucket",Ku,{omit:["layers","features"]});var Wm={get paint(){return gd=gd||new Sr({"fill-extrusion-opacity":new ht(we["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new xt(we["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ht(we["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ht(we["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Rs(we["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new xt(we["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new xt(we["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ht(we["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Xm extends pn{constructor(e){super(e,Wm)}createBucket(e){return new Ku(e)}queryRadius(){return Vc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,s,c,g,_,v,S){const k=Nc(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),_.angle,v),A=this.paint.get("fill-extrusion-height").evaluate(r,s),E=this.paint.get("fill-extrusion-base").evaluate(r,s),R=function(N,q,K,te){const he=[];for(const ie of N){const le=[ie.x,ie.y,0,1];Uc(le,le,q),he.push(new j(le[0]/le[3],le[1]/le[3]))}return he}(k,S),O=function(N,q,K,te){const he=[],ie=[],le=te[8]*q,ke=te[9]*q,Pe=te[10]*q,it=te[11]*q,ct=te[8]*K,tt=te[9]*K,Qe=te[10]*K,Xe=te[11]*K;for(const ot of N){const Ke=[],je=[];for(const gt of ot){const dt=gt.x,Rt=gt.y,gi=te[0]*dt+te[4]*Rt+te[12],wi=te[1]*dt+te[5]*Rt+te[13],Ji=te[2]*dt+te[6]*Rt+te[14],rn=te[3]*dt+te[7]*Rt+te[15],Br=Ji+Pe,Zi=rn+it,ar=gi+ct,gr=wi+tt,Fr=Ji+Qe,Or=rn+Xe,Qi=new j((gi+le)/Zi,(wi+ke)/Zi);Qi.z=Br/Zi,Ke.push(Qi);const $i=new j(ar/Or,gr/Or);$i.z=Fr/Or,je.push($i)}he.push(Ke),ie.push(je)}return[he,ie]}(c,E,A,S);return function(N,q,K){let te=1/0;ua(K,q)&&(te=_d(K,q[0]));for(let he=0;her.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Z,this.layoutVertexArray2=new se,this.indexArray=new Re,this.programConfigurations=new nr(e.layers,e.zoom),this.segments=new vt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,s){this.hasPattern=Gu("line",this.layers,r);const c=this.layers[0].layout.get("line-sort-key"),g=!c.isConstant(),_=[];for(const{feature:v,id:S,index:k,sourceLayerIndex:A}of e){const E=this.layers[0]._featureFilter.needGeometry,R=ps(v,E);if(!this.layers[0]._featureFilter.filter(new pi(this.zoom),R,s))continue;const O=g?c.evaluate(R,{},s):void 0,N={id:S,properties:v.properties,type:v.type,sourceLayerIndex:A,index:k,geometry:E?R.geometry:ds(v),patterns:{},sortKey:O};_.push(N)}g&&_.sort((v,S)=>v.sortKey-S.sortKey);for(const v of _){const{geometry:S,index:k,sourceLayerIndex:A}=v;if(this.hasPattern){const E=Hu("line",this.layers,v,this.zoom,r);this.patternFeatures.push(E)}else this.addFeature(v,S,k,s,{});r.featureIndex.insert(e[k].feature,S,k,A,this.index)}}update(e,r,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,s)}addFeatures(e,r,s){for(const c of this.patternFeatures)this.addFeature(c,c.geometry,c.index,r,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Qm)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ym),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,s,c,g){const _=this.layers[0].layout,v=_.get("line-join").evaluate(e,{}),S=_.get("line-cap"),k=_.get("line-miter-limit"),A=_.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const E of r)this.addLine(E,e,v,S,k,A);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,g,c)}addLine(e,r,s,c,g,_){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let te=0;te=2&&e[S-1].equals(e[S-2]);)S--;let k=0;for(;k0;if(it&&te>k){const Xe=R.dist(O);if(Xe>2*A){const ot=R.sub(R.sub(O)._mult(A/Xe)._round());this.updateDistance(O,ot),this.addCurrentVertex(ot,q,0,0,E),O=ot}}const tt=O&&N;let Qe=tt?s:v?"butt":c;if(tt&&Qe==="round"&&(ke<_?Qe="miter":ke<=2&&(Qe="fakeround")),Qe==="miter"&&ke>g&&(Qe="bevel"),Qe==="bevel"&&(ke>2&&(Qe="flipbevel"),ke100)he=K.mult(-1);else{const Xe=ke*q.add(K).mag()/q.sub(K).mag();he._perp()._mult(Xe*(ct?-1:1))}this.addCurrentVertex(R,he,0,0,E),this.addCurrentVertex(R,he.mult(-1),0,0,E)}else if(Qe==="bevel"||Qe==="fakeround"){const Xe=-Math.sqrt(ke*ke-1),ot=ct?Xe:0,Ke=ct?0:Xe;if(O&&this.addCurrentVertex(R,q,ot,Ke,E),Qe==="fakeround"){const je=Math.round(180*Pe/Math.PI/20);for(let gt=1;gt2*A){const ot=R.add(N.sub(R)._mult(A/Xe)._round());this.updateDistance(R,ot),this.addCurrentVertex(ot,K,0,0,E),R=ot}}}}addCurrentVertex(e,r,s,c,g,_=!1){const v=r.y*c-r.x,S=-r.y-r.x*c;this.addHalfVertex(e,r.x+r.y*s,r.y-r.x*s,_,!1,s,g),this.addHalfVertex(e,v,S,_,!0,-c,g),this.distance>yd/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,s,c,g,_))}addHalfVertex({x:e,y:r},s,c,g,_,v,S){const k=.5*(this.lineClips?this.scaledDistance*(yd-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(g?1:0),(r<<1)+(_?1:0),Math.round(63*s)+128,Math.round(63*c)+128,1+(v===0?0:v<0?-1:1)|(63&k)<<2,k>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const A=S.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,A),S.primitiveLength++),_?this.e2=A:this.e1=A}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let vd,xd;rt("LineBucket",Yu,{omit:["layers","patternFeatures"]});var bd={get paint(){return xd=xd||new Sr({"line-opacity":new xt(we.paint_line["line-opacity"]),"line-color":new xt(we.paint_line["line-color"]),"line-translate":new ht(we.paint_line["line-translate"]),"line-translate-anchor":new ht(we.paint_line["line-translate-anchor"]),"line-width":new xt(we.paint_line["line-width"]),"line-gap-width":new xt(we.paint_line["line-gap-width"]),"line-offset":new xt(we.paint_line["line-offset"]),"line-blur":new xt(we.paint_line["line-blur"]),"line-dasharray":new il(we.paint_line["line-dasharray"]),"line-pattern":new Rs(we.paint_line["line-pattern"]),"line-gradient":new rl(we.paint_line["line-gradient"])})},get layout(){return vd=vd||new Sr({"line-cap":new ht(we.layout_line["line-cap"]),"line-join":new xt(we.layout_line["line-join"]),"line-miter-limit":new ht(we.layout_line["line-miter-limit"]),"line-round-limit":new ht(we.layout_line["line-round-limit"]),"line-sort-key":new xt(we.layout_line["line-sort-key"])})}};class tg extends xt{possiblyEvaluate(e,r){return r=new pi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,s,c){return r=Ee({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,s,c)}}let Hc;class ig extends pn{constructor(e){super(e,bd),this.gradientVersion=0,Hc||(Hc=new tg(bd.paint.properties["line-width"].specification),Hc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!function(s){return s._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof io,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=Hc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Yu(e)}queryRadius(e){const r=e,s=wd(_l("line-width",this,r),_l("line-gap-width",this,r)),c=_l("line-offset",this,r);return s/2+Math.abs(c)+Vc(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,s,c,g,_,v){const S=Nc(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),_.angle,v),k=v/2*wd(this.paint.get("line-width").evaluate(r,s),this.paint.get("line-gap-width").evaluate(r,s)),A=this.paint.get("line-offset").evaluate(r,s);return A&&(c=function(E,R){const O=[];for(let N=0;N=3){for(let K=0;K0?e+2*i:i}const rg=Bi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),ng=Bi([{name:"a_projected_pos",components:3,type:"Float32"}],4);Bi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const sg=Bi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Bi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Sd=Bi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),og=Bi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function ag(i,e,r){return i.sections.forEach(s=>{s.text=function(c,g,_){const v=g.layout.get("text-transform").evaluate(_,{});return v==="uppercase"?c=c.toLocaleUpperCase():v==="lowercase"&&(c=c.toLocaleLowerCase()),ls.applyArabicShaping&&(c=ls.applyArabicShaping(c)),c}(s.text,e,r)}),i}Bi([{name:"triangle",components:3,type:"Uint16"}]),Bi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{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"}]),Bi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{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",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Bi([{type:"Float32",name:"offsetX"}]),Bi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Bi([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const kl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Yi=24,Td=si,Id=function(i,e,r,s,c){var g,_,v=8*c-s-1,S=(1<>1,A=-7,E=r?c-1:0,R=r?-1:1,O=i[e+E];for(E+=R,g=O&(1<<-A)-1,O>>=-A,A+=v;A>0;g=256*g+i[e+E],E+=R,A-=8);for(_=g&(1<<-A)-1,g>>=-A,A+=s;A>0;_=256*_+i[e+E],E+=R,A-=8);if(g===0)g=1-k;else{if(g===S)return _?NaN:1/0*(O?-1:1);_+=Math.pow(2,s),g-=k}return(O?-1:1)*_*Math.pow(2,g-s)},kd=function(i,e,r,s,c,g){var _,v,S,k=8*g-c-1,A=(1<>1,R=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,O=s?0:g-1,N=s?1:-1,q=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(v=isNaN(e)?1:0,_=A):(_=Math.floor(Math.log(e)/Math.LN2),e*(S=Math.pow(2,-_))<1&&(_--,S*=2),(e+=_+E>=1?R/S:R*Math.pow(2,1-E))*S>=2&&(_++,S/=2),_+E>=A?(v=0,_=A):_+E>=1?(v=(e*S-1)*Math.pow(2,c),_+=E):(v=e*Math.pow(2,E-1)*Math.pow(2,c),_=0));c>=8;i[r+O]=255&v,O+=N,v/=256,c-=8);for(_=_<0;i[r+O]=255&_,O+=N,_/=256,k-=8);i[r+O-N]|=128*q};function si(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}si.Varint=0,si.Fixed64=1,si.Bytes=2,si.Fixed32=5;var Ju=4294967296,Cd=1/Ju,Md=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function fs(i){return i.type===si.Bytes?i.readVarint()+i.pos:i.pos+1}function ma(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function Ad(i,e,r){var s=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(s);for(var c=r.pos-1;c>=i;c--)r.buf[c+s]=r.buf[c]}function lg(i,e){for(var r=0;r>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function Ed(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}si.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos>3,g=this.pos;this.type=7&s,i(c,e,this),this.pos===g&&this.skip(s)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=Wc(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=Ed(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Wc(this.buf,this.pos)+Wc(this.buf,this.pos+4)*Ju;return this.pos+=8,i},readSFixed64:function(){var i=Wc(this.buf,this.pos)+Ed(this.buf,this.pos+4)*Ju;return this.pos+=8,i},readFloat:function(){var i=Id(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Id(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,s=this.buf;return e=127&(r=s[this.pos++]),r<128?e:(e|=(127&(r=s[this.pos++]))<<7,r<128?e:(e|=(127&(r=s[this.pos++]))<<14,r<128?e:(e|=(127&(r=s[this.pos++]))<<21,r<128?e:function(c,g,_){var v,S,k=_.buf;if(v=(112&(S=k[_.pos++]))>>4,S<128||(v|=(127&(S=k[_.pos++]))<<3,S<128)||(v|=(127&(S=k[_.pos++]))<<10,S<128)||(v|=(127&(S=k[_.pos++]))<<17,S<128)||(v|=(127&(S=k[_.pos++]))<<24,S<128)||(v|=(1&(S=k[_.pos++]))<<31,S<128))return ma(c,v,g);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=s[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&Md?function(r,s,c){return Md.decode(r.subarray(s,c))}(this.buf,e,i):function(r,s,c){for(var g="",_=s;_239?4:A>223?3:A>191?2:1;if(_+R>c)break;R===1?A<128&&(E=A):R===2?(192&(v=r[_+1]))==128&&(E=(31&A)<<6|63&v)<=127&&(E=null):R===3?(S=r[_+2],(192&(v=r[_+1]))==128&&(192&S)==128&&((E=(15&A)<<12|(63&v)<<6|63&S)<=2047||E>=55296&&E<=57343)&&(E=null)):R===4&&(S=r[_+2],k=r[_+3],(192&(v=r[_+1]))==128&&(192&S)==128&&(192&k)==128&&((E=(15&A)<<18|(63&v)<<12|(63&S)<<6|63&k)<=65535||E>=1114112)&&(E=null)),E===null?(E=65533,R=1):E>65535&&(E-=65536,g+=String.fromCharCode(E>>>10&1023|55296),E=56320|1023&E),g+=String.fromCharCode(E),_+=R}return g}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==si.Bytes)return i.push(this.readVarint(e));var r=fs(this);for(i=i||[];this.pos127;);else if(e===si.Bytes)this.pos=this.readVarint()+this.pos;else if(e===si.Fixed32)this.pos+=4;else{if(e!==si.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?function(e,r){var s,c;if(e>=0?(s=e%4294967296|0,c=e/4294967296|0):(c=~(-e/4294967296),4294967295^(s=~(-e%4294967296))?s=s+1|0:(s=0,c=c+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(g,_,v){v.buf[v.pos++]=127&g|128,g>>>=7,v.buf[v.pos++]=127&g|128,g>>>=7,v.buf[v.pos++]=127&g|128,g>>>=7,v.buf[v.pos++]=127&g|128,v.buf[v.pos]=127&(g>>>=7)}(s,0,r),function(g,_){var v=(7&g)<<4;_.buf[_.pos++]|=v|((g>>>=3)?128:0),g&&(_.buf[_.pos++]=127&g|((g>>>=7)?128:0),g&&(_.buf[_.pos++]=127&g|((g>>>=7)?128:0),g&&(_.buf[_.pos++]=127&g|((g>>>=7)?128:0),g&&(_.buf[_.pos++]=127&g|((g>>>=7)?128:0),g&&(_.buf[_.pos++]=127&g)))))}(c,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(s,c,g){for(var _,v,S=0;S55295&&_<57344){if(!v){_>56319||S+1===c.length?(s[g++]=239,s[g++]=191,s[g++]=189):v=_;continue}if(_<56320){s[g++]=239,s[g++]=191,s[g++]=189,v=_;continue}_=v-55296<<10|_-56320|65536,v=null}else v&&(s[g++]=239,s[g++]=191,s[g++]=189,v=null);_<128?s[g++]=_:(_<2048?s[g++]=_>>6|192:(_<65536?s[g++]=_>>12|224:(s[g++]=_>>18|240,s[g++]=_>>12&63|128),s[g++]=_>>6&63|128),s[g++]=63&_|128)}return g}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&Ad(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),kd(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),kd(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&Ad(r,s,this),this.pos=r-1,this.writeVarint(s),this.pos+=s},writeMessage:function(i,e,r){this.writeTag(i,si.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,lg,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,cg,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,dg,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,ug,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,hg,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,pg,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,fg,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,mg,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,gg,e)},writeBytesField:function(i,e){this.writeTag(i,si.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,si.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,si.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,si.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,si.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,si.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,si.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,si.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,si.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,si.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var Qu=M(Td);const $u=3;function _g(i,e,r){i===1&&r.readMessage(yg,e)}function yg(i,e,r){if(i===3){const{id:s,bitmap:c,width:g,height:_,left:v,top:S,advance:k}=r.readMessage(vg,{});e.push({id:s,bitmap:new vl({width:g+2*$u,height:_+2*$u},c),metrics:{width:g,height:_,left:v,top:S,advance:k}})}}function vg(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}const Pd=$u;function zd(i){let e=0,r=0;for(const _ of i)e+=_.w*_.h,r=Math.max(r,_.w);i.sort((_,v)=>v.h-_.h);const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let c=0,g=0;for(const _ of i)for(let v=s.length-1;v>=0;v--){const S=s[v];if(!(_.w>S.w||_.h>S.h)){if(_.x=S.x,_.y=S.y,g=Math.max(g,_.y+_.h),c=Math.max(c,_.x+_.w),_.w===S.w&&_.h===S.h){const k=s.pop();v=0&&s>=e&&Kc[this.text.charCodeAt(s)];s--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const s=new _a;return s.text=this.text.substring(e,r),s.sectionIndex=this.sectionIndex.slice(e,r),s.sections=this.sections,s}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(Ml.forText(e.scale,e.fontStack||r));const s=this.sections.length-1;for(let c=0;c=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Xc(i,e,r,s,c,g,_,v,S,k,A,E,R,O,N,q){const K=_a.fromFeature(i,c);let te;E===x.ah.vertical&&K.verticalizePunctuation();const{processBidirectionalText:he,processStyledBidirectionalText:ie}=ls;if(he&&K.sections.length===1){te=[];const Pe=he(K.toString(),th(K,k,g,e,s,O,N));for(const it of Pe){const ct=new _a;ct.text=it,ct.sections=K.sections;for(let tt=0;tt0&&gs>Wr&&(Wr=gs)}else{const gn=ct[Ot.fontStack],Kr=gn&&gn[_r];if(Kr&&Kr.rect)Dn=Kr.rect,Tn=Kr.metrics;else{const gs=it[Ot.fontStack],Ll=gs&&gs[_r];if(!Ll)continue;Tn=Ll.metrics}tr=($i-Ot.scale)*Yi}In?(Pe.verticalizable=!0,Cr.push({glyph:_r,imageName:Rn,x:gi,y:wi+tr,vertical:In,scale:Ot.scale,fontStack:Ot.fontStack,sectionIndex:Mr,metrics:Tn,rect:Dn}),gi+=ms*Ot.scale+gt):(Cr.push({glyph:_r,imageName:Rn,x:gi,y:wi+tr,vertical:In,scale:Ot.scale,fontStack:Ot.fontStack,sectionIndex:Mr,metrics:Tn,rect:Dn}),gi+=Tn.advance*Ot.scale+gt)}Cr.length!==0&&(Ji=Math.max(gi-gt,Ji),wg(Cr,0,Cr.length-1,Br,Wr)),gi=0;const Xr=Xe*$i+Wr;Vr.lineOffset=Math.max(Wr,kr),wi+=Xr,rn=Math.max(Xr,rn),++Zi}var ar;const gr=wi-Cl,{horizontalAlign:Fr,verticalAlign:Or}=ih(ot);(function(Qi,$i,kr,Vr,Cr,Wr,Xr,er,Ot){const Mr=($i-kr)*Cr;let _r=0;_r=Wr!==Xr?-er*Vr-Cl:(-Vr*Ot+.5)*Xr;for(const tr of Qi)for(const Tn of tr.positionedGlyphs)Tn.x+=Mr,Tn.y+=_r})(Pe.positionedLines,Br,Fr,Or,Ji,rn,Xe,gr,Qe.length),Pe.top+=-Or*gr,Pe.bottom=Pe.top+gr,Pe.left+=-Fr*Ji,Pe.right=Pe.left+Ji}(ke,e,r,s,te,_,v,S,E,k,R,q),!function(Pe){for(const it of Pe)if(it.positionedGlyphs.length!==0)return!1;return!0}(le)&&ke}const Kc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},xg={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Dd(i,e,r,s,c,g){if(e.imageName){const _=s[e.imageName];return _?_.displaySize[0]*e.scale*Yi/g+c:0}{const _=r[e.fontStack],v=_&&_[i];return v?v.metrics.advance*e.scale+c:0}}function Rd(i,e,r,s){const c=Math.pow(i-e,2);return s?i=0;let A=0;for(let R=0;R_.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Fu([]),this.placementViewportMatrix=Fu([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Vd(this.zoom,r["text-size"]),this.iconSizeData=Vd(this.zoom,r["icon-size"]);const s=this.layers[0].layout,c=s.get("symbol-sort-key"),g=s.get("symbol-z-order");this.canOverlap=rh(s,"text-overlap","text-allow-overlap")!=="never"||rh(s,"icon-overlap","icon-allow-overlap")!=="never"||s.get("text-ignore-placement")||s.get("icon-ignore-placement"),this.sortFeaturesByKey=g!=="viewport-y"&&!c.isConstant(),this.sortFeaturesByY=(g==="viewport-y"||g==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,s.get("symbol-placement")==="point"&&(this.writingModes=s.get("text-writing-mode").map(_=>x.ah[_])),this.stateDependentLayerIds=this.layers.filter(_=>_.isStateDependent()).map(_=>_.id),this.sourceID=e.sourceID}createArrays(){this.text=new sh(new nr(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new sh(new nr(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new w,this.lineVertexArray=new T,this.symbolInstances=new m,this.textAnchorOffsets=new C}calculateGlyphDependencies(e,r,s,c,g){for(let _=0;_0)&&(_.value.kind!=="constant"||_.value.value.length>0),A=S.value.kind!=="constant"||!!S.value.value||Object.keys(S.parameters).length>0,E=g.get("symbol-sort-key");if(this.features=[],!k&&!A)return;const R=r.iconDependencies,O=r.glyphDependencies,N=r.availableImages,q=new pi(this.zoom);for(const{feature:K,id:te,index:he,sourceLayerIndex:ie}of e){const le=c._featureFilter.needGeometry,ke=ps(K,le);if(!c._featureFilter.filter(q,ke,s))continue;let Pe,it;if(le||(ke.geometry=ds(K)),k){const tt=c.getValueAndResolveTokens("text-field",ke,s,N),Qe=qr.factory(tt);kg(Qe)&&(this.hasRTLText=!0),(!this.hasRTLText||ls.getRTLTextPluginStatus()==="unavailable"||this.hasRTLText&&ls.isParsed())&&(Pe=ag(Qe,c,ke))}if(A){const tt=c.getValueAndResolveTokens("icon-image",ke,s,N);it=tt instanceof $r?tt:$r.fromString(tt)}if(!Pe&&!it)continue;const ct=this.sortFeaturesByKey?E.evaluate(ke,{},s):void 0;if(this.features.push({id:te,text:Pe,icon:it,index:he,sourceLayerIndex:ie,geometry:ke.geometry,properties:K.properties,type:Tg[K.type],sortKey:ct}),it&&(R[it.name]=!0),Pe){const tt=_.evaluate(ke,{},s).join(","),Qe=g.get("text-rotation-alignment")!=="viewport"&&g.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(x.ah.vertical)>=0;for(const Xe of Pe.sections)if(Xe.image)R[Xe.image.name]=!0;else{const ot=ta(Pe.toString()),Ke=Xe.fontStack||tt,je=O[Ke]=O[Ke]||{};this.calculateGlyphDependencies(Xe.text,je,Qe,this.allowVerticalPlacement,ot)}}}g.get("symbol-placement")==="line"&&(this.features=function(K){const te={},he={},ie=[];let le=0;function ke(tt){ie.push(K[tt]),le++}function Pe(tt,Qe,Xe){const ot=he[tt];return delete he[tt],he[Qe]=ot,ie[ot].geometry[0].pop(),ie[ot].geometry[0]=ie[ot].geometry[0].concat(Xe[0]),ot}function it(tt,Qe,Xe){const ot=te[Qe];return delete te[Qe],te[tt]=ot,ie[ot].geometry[0].shift(),ie[ot].geometry[0]=Xe[0].concat(ie[ot].geometry[0]),ot}function ct(tt,Qe,Xe){const ot=Xe?Qe[0][Qe[0].length-1]:Qe[0][0];return`${tt}:${ot.x}:${ot.y}`}for(let tt=0;tttt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((K,te)=>K.sortKey-te.sortKey)}update(e,r,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,s),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,s))}isEmpty(){return this.symbolInstances.length===0&&!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.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const s=this.lineVertexArray.length;if(e.segment!==void 0){let c=e.dist(r[e.segment+1]),g=e.dist(r[e.segment]);const _={};for(let v=e.segment+1;v=0;v--)_[v]={x:r[v].x,y:r[v].y,tileUnitDistanceFromAnchor:g},v>0&&(g+=r[v-1].dist(r[v]));for(let v=0;v0}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}addIndicesForPlacedSymbol(e,r){const s=e.placedSymbolArray.get(r),c=s.vertexStartIndex+4*s.numGlyphs;for(let g=s.vertexStartIndex;gc[v]-c[S]||g[S]-g[v]),_}addToSortKeyRanges(e,r){const s=this.sortKeyRanges[this.sortKeyRanges.length-1];s&&s.sortKey===r?s.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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 r of this.symbolInstanceIndexes){const s=this.symbolInstances.get(r);this.featureSortOrder.push(s.featureIndex),[s.rightJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.leftJustifiedTextSymbolIndex].forEach((c,g,_)=>{c>=0&&_.indexOf(c)===g&&this.addIndicesForPlacedSymbol(this.text,c)}),s.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,s.verticalPlacedTextSymbolIndex),s.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.placedIconSymbolIndex),s.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Nd,Ud;rt("SymbolBucket",ya,{omit:["layers","collisionBoxArray","features","compareText"]}),ya.MAX_GLYPHS=65535,ya.addDynamicAttributes=nh;var ah={get paint(){return Ud=Ud||new Sr({"icon-opacity":new xt(we.paint_symbol["icon-opacity"]),"icon-color":new xt(we.paint_symbol["icon-color"]),"icon-halo-color":new xt(we.paint_symbol["icon-halo-color"]),"icon-halo-width":new xt(we.paint_symbol["icon-halo-width"]),"icon-halo-blur":new xt(we.paint_symbol["icon-halo-blur"]),"icon-translate":new ht(we.paint_symbol["icon-translate"]),"icon-translate-anchor":new ht(we.paint_symbol["icon-translate-anchor"]),"text-opacity":new xt(we.paint_symbol["text-opacity"]),"text-color":new xt(we.paint_symbol["text-color"],{runtimeType:Ui,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new xt(we.paint_symbol["text-halo-color"]),"text-halo-width":new xt(we.paint_symbol["text-halo-width"]),"text-halo-blur":new xt(we.paint_symbol["text-halo-blur"]),"text-translate":new ht(we.paint_symbol["text-translate"]),"text-translate-anchor":new ht(we.paint_symbol["text-translate-anchor"])})},get layout(){return Nd=Nd||new Sr({"symbol-placement":new ht(we.layout_symbol["symbol-placement"]),"symbol-spacing":new ht(we.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ht(we.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new xt(we.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ht(we.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ht(we.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ht(we.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ht(we.layout_symbol["icon-ignore-placement"]),"icon-optional":new ht(we.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ht(we.layout_symbol["icon-rotation-alignment"]),"icon-size":new xt(we.layout_symbol["icon-size"]),"icon-text-fit":new ht(we.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ht(we.layout_symbol["icon-text-fit-padding"]),"icon-image":new xt(we.layout_symbol["icon-image"]),"icon-rotate":new xt(we.layout_symbol["icon-rotate"]),"icon-padding":new xt(we.layout_symbol["icon-padding"]),"icon-keep-upright":new ht(we.layout_symbol["icon-keep-upright"]),"icon-offset":new xt(we.layout_symbol["icon-offset"]),"icon-anchor":new xt(we.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ht(we.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ht(we.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ht(we.layout_symbol["text-rotation-alignment"]),"text-field":new xt(we.layout_symbol["text-field"]),"text-font":new xt(we.layout_symbol["text-font"]),"text-size":new xt(we.layout_symbol["text-size"]),"text-max-width":new xt(we.layout_symbol["text-max-width"]),"text-line-height":new ht(we.layout_symbol["text-line-height"]),"text-letter-spacing":new xt(we.layout_symbol["text-letter-spacing"]),"text-justify":new xt(we.layout_symbol["text-justify"]),"text-radial-offset":new xt(we.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ht(we.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new xt(we.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new xt(we.layout_symbol["text-anchor"]),"text-max-angle":new ht(we.layout_symbol["text-max-angle"]),"text-writing-mode":new ht(we.layout_symbol["text-writing-mode"]),"text-rotate":new xt(we.layout_symbol["text-rotate"]),"text-padding":new ht(we.layout_symbol["text-padding"]),"text-keep-upright":new ht(we.layout_symbol["text-keep-upright"]),"text-transform":new xt(we.layout_symbol["text-transform"]),"text-offset":new xt(we.layout_symbol["text-offset"]),"text-allow-overlap":new ht(we.layout_symbol["text-allow-overlap"]),"text-overlap":new ht(we.layout_symbol["text-overlap"]),"text-ignore-placement":new ht(we.layout_symbol["text-ignore-placement"]),"text-optional":new ht(we.layout_symbol["text-optional"])})}};class jd{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:hr,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.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}}rt("FormatSectionOverride",jd,{omit:["defaultValue"]});class Jc extends pn{constructor(e){super(e,ah)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const s=this.layout.get("text-writing-mode");if(s){const c=[];for(const g of s)c.indexOf(g)<0&&c.push(g);this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,s,c){const g=this.layout.get(e).evaluate(r,{},s,c),_=this._unevaluatedLayout._values[e];return _.isDataDriven()||ci(_.value)||!g?g:function(v,S){return S.replace(/{([^{}]+)}/g,(k,A)=>v&&A in v?String(v[A]):"")}(r.properties,g)}createBucket(e){return new ya(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of ah.paint.overridableProperties){if(!Jc.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),s=new jd(r),c=new di(s,r.property.specification);let g=null;g=r.value.kind==="constant"||r.value.kind==="source"?new Zo("source",c):new Ga("composite",c,r.value.zoomStops),this.paint._values[e]=new dn(r.property,g,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,s){return!(!this.layout||r.isDataDriven()||s.isDataDriven())&&Jc.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const s=e.get("text-field"),c=ah.paint.properties[r];let g=!1;const _=v=>{for(const S of v)if(c.overrides&&c.overrides.hasOverride(S))return void(g=!0)};if(s.value.kind==="constant"&&s.value.value instanceof qr)_(s.value.value.sections);else if(s.value.kind==="source"){const v=k=>{g||(k instanceof Vn&&qi(k.value)===Gi?_(k.value.sections):k instanceof jo?_(k.sections):k.eachChild(v))},S=s.value;S._styleExpression&&v(S._styleExpression.expression)}return g}}let qd;var Cg={get paint(){return qd=qd||new Sr({"background-color":new ht(we.paint_background["background-color"]),"background-pattern":new il(we.paint_background["background-pattern"]),"background-opacity":new ht(we.paint_background["background-opacity"])})}};class Mg extends pn{constructor(e){super(e,Cg)}}let Zd;var Ag={get paint(){return Zd=Zd||new Sr({"raster-opacity":new ht(we.paint_raster["raster-opacity"]),"raster-hue-rotate":new ht(we.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ht(we.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ht(we.paint_raster["raster-brightness-max"]),"raster-saturation":new ht(we.paint_raster["raster-saturation"]),"raster-contrast":new ht(we.paint_raster["raster-contrast"]),"raster-resampling":new ht(we.paint_raster["raster-resampling"]),"raster-fade-duration":new ht(we.paint_raster["raster-fade-duration"])})}};class Eg extends pn{constructor(e){super(e,Ag)}}class Pg extends pn{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class zg{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const lh=63710088e-1;class js{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new js(Ue(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,s=this.lat*r,c=e.lat*r,g=Math.sin(s)*Math.sin(c)+Math.cos(s)*Math.cos(c)*Math.cos((e.lng-this.lng)*r);return lh*Math.acos(Math.min(g,1))}static convert(e){if(e instanceof js)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new js(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new js(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 [, ]")}}const Gd=2*Math.PI*lh;function Hd(i){return Gd*Math.cos(i*Math.PI/180)}function Wd(i){return(180+i)/360}function Xd(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Kd(i,e){return i/Hd(e)}function ch(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class Qc{constructor(e,r,s=0){this.x=+e,this.y=+r,this.z=+s}static fromLngLat(e,r=0){const s=js.convert(e);return new Qc(Wd(s.lng),Xd(s.lat),Kd(r,s.lat))}toLngLat(){return new js(360*this.x-180,ch(this.y))}toAltitude(){return this.z*Hd(ch(this.y))}meterInMercatorCoordinateUnits(){return 1/Gd*(e=ch(this.y),1/Math.cos(e*Math.PI/180));var e}}function Yd(i,e,r){var s=2*Math.PI*6378137/256/Math.pow(2,r);return[i*s-2*Math.PI*6378137/2,e*s-2*Math.PI*6378137/2]}class uh{constructor(e,r,s){if(e<0||e>25||s<0||s>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${s}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=r,this.y=s,this.key=El(0,e,e,r,s)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,s){const c=(_=this.y,v=this.z,S=Yd(256*(g=this.x),256*(_=Math.pow(2,v)-_-1),v),k=Yd(256*(g+1),256*(_+1),v),S[0]+","+S[1]+","+k[0]+","+k[1]);var g,_,v,S,k;const A=function(E,R,O){let N,q="";for(let K=E;K>0;K--)N=1<1?"@2x":"").replace(/{quadkey}/g,A).replace(/{bbox-epsg-3857}/g,c)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new j((e.x*r-this.x)*zi,(e.y*r-this.y)*zi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Jd{constructor(e,r){this.wrap=e,this.canonical=r,this.key=El(e,r.z,r.z,r.x,r.y)}}class mn{constructor(e,r,s,c,g){if(e= z; overscaledZ = ${e}; z = ${s}`);this.overscaledZ=e,this.wrap=r,this.canonical=new uh(s,+c,+g),this.key=El(r,e,s,c,g)}clone(){return new mn(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new mn(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new mn(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const s=this.canonical.z-e;return e>this.canonical.z?El(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):El(this.wrap*+r,e,e,this.canonical.x>>s,this.canonical.y>>s)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new mn(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,s=2*this.canonical.x,c=2*this.canonical.y;return[new mn(r,this.wrap,r,s,c),new mn(r,this.wrap,r,s+1,c),new mn(r,this.wrap,r,s,c+1),new mn(r,this.wrap,r,s+1,c+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.ythis.max&&(this.max=E),E=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,s){return e*this.redFactor+r*this.greenFactor+s*this.blueFactor-this.baseShift}getPixels(){return new fn({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,s){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let c=r*this.dim,g=r*this.dim+this.dim,_=s*this.dim,v=s*this.dim+this.dim;switch(r){case-1:c=g-1;break;case 1:g=c+1}switch(s){case-1:_=v-1;break;case 1:v=_+1}const S=-r*this.dim,k=-s*this.dim;for(let A=_;A=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class ep{constructor(e,r,s,c,g){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=s,e._y=c,this.properties=e.properties,this.id=g}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class tp{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new as(zi,16,0),this.grid3D=new as(zi,16,0),this.featureIndexArray=new z,this.promoteId=r}insert(e,r,s,c,g,_){const v=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(s,c,g);const S=_?this.grid3D:this.grid;for(let k=0;k=0&&E[3]>=0&&S.insert(v,E[0],E[1],E[2],E[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Vs.VectorTile(new Qu(this.rawTileData)).layers,this.sourceLayerCoder=new $d(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,s,c){this.loadVTLayers();const g=e.params||{},_=zi/e.tileSize/e.scale,v=Xo(g.filter),S=e.queryGeometry,k=e.queryPadding*_,A=rp(S),E=this.grid.query(A.minX-k,A.minY-k,A.maxX+k,A.maxY+k),R=rp(e.cameraQueryGeometry),O=this.grid3D.query(R.minX-k,R.minY-k,R.maxX+k,R.maxY+k,(K,te,he,ie)=>function(le,ke,Pe,it,ct){for(const Qe of le)if(ke<=Qe.x&&Pe<=Qe.y&&it>=Qe.x&&ct>=Qe.y)return!0;const tt=[new j(ke,Pe),new j(ke,ct),new j(it,ct),new j(it,Pe)];if(le.length>2){for(const Qe of tt)if(ha(le,Qe))return!0}for(let Qe=0;Qe(ie||(ie=ds(le)),ke.queryIntersectsFeature(S,le,Pe,ie,this.z,e.transform,_,e.pixelPosMatrix)))}return N}loadMatchingFeature(e,r,s,c,g,_,v,S,k,A,E){const R=this.bucketLayerIDs[r];if(_&&!function(K,te){for(let he=0;he=0)return!0;return!1}(_,R))return;const O=this.sourceLayerCoder.decode(s),N=this.vtLayers[O].feature(c);if(g.needGeometry){const K=ps(N,!0);if(!g.filter(new pi(this.tileID.overscaledZ),K,this.tileID.canonical))return}else if(!g.filter(new pi(this.tileID.overscaledZ),N))return;const q=this.getId(N,O);for(let K=0;K{const v=e instanceof ho?e.get(_):null;return v&&v.evaluate?v.evaluate(r,s,c):v})}function rp(i){let e=1/0,r=1/0,s=-1/0,c=-1/0;for(const g of i)e=Math.min(e,g.x),r=Math.min(r,g.y),s=Math.max(s,g.x),c=Math.max(c,g.y);return{minX:e,minY:r,maxX:s,maxY:c}}function Lg(i,e){return e-i}function np(i,e,r,s,c){const g=[];for(let _=0;_=s&&E.x>=s||(A.x>=s?A=new j(s,A.y+(s-A.x)/(E.x-A.x)*(E.y-A.y))._round():E.x>=s&&(E=new j(s,A.y+(s-A.x)/(E.x-A.x)*(E.y-A.y))._round()),A.y>=c&&E.y>=c||(A.y>=c?A=new j(A.x+(c-A.y)/(E.y-A.y)*(E.x-A.x),c)._round():E.y>=c&&(E=new j(A.x+(c-A.y)/(E.y-A.y)*(E.x-A.x),c)._round()),S&&A.equals(S[S.length-1])||(S=[A],g.push(S)),S.push(E)))))}}return g}rt("FeatureIndex",tp,{omit:["rawTileData","sourceLayerCoder"]});class qs extends j{constructor(e,r,s,c){super(e,r),this.angle=s,c!==void 0&&(this.segment=c)}clone(){return new qs(this.x,this.y,this.angle,this.segment)}}function sp(i,e,r,s,c){if(e.segment===void 0||r===0)return!0;let g=e,_=e.segment+1,v=0;for(;v>-r/2;){if(_--,_<0)return!1;v-=i[_].dist(g),g=i[_]}v+=i[_].dist(i[_+1]),_++;const S=[];let k=0;for(;vs;)k-=S.shift().angleDelta;if(k>c)return!1;_++,v+=A.dist(E)}return!0}function op(i){let e=0;for(let r=0;rk){const N=(k-S)/O,q=br.number(E.x,R.x,N),K=br.number(E.y,R.y,N),te=new qs(q,K,R.angleTo(E),A);return te._round(),!_||sp(i,te,v,_,e)?te:void 0}S+=O}}function Rg(i,e,r,s,c,g,_,v,S){const k=ap(s,g,_),A=lp(s,c),E=A*_,R=i[0].x===0||i[0].x===S||i[0].y===0||i[0].y===S;return e-E=0&&le=0&&ke=0&&R+k<=A){const Pe=new qs(le,ke,he,N);Pe._round(),s&&!sp(i,Pe,g,s,c)||O.push(Pe)}}E+=te}return v||O.length||_||(O=cp(i,E/2,r,s,c,g,_,!0,S)),O}rt("Anchor",qs);const va=Hr;function up(i,e,r,s){const c=[],g=i.image,_=g.pixelRatio,v=g.paddedRect.w-2*va,S=g.paddedRect.h-2*va,k=i.right-i.left,A=i.bottom-i.top,E=g.stretchX||[[0,v]],R=g.stretchY||[[0,S]],O=(Xe,ot)=>Xe+ot[1]-ot[0],N=E.reduce(O,0),q=R.reduce(O,0),K=v-N,te=S-q;let he=0,ie=N,le=0,ke=q,Pe=0,it=K,ct=0,tt=te;if(g.content&&s){const Xe=g.content;he=$c(E,0,Xe[0]),le=$c(R,0,Xe[1]),ie=$c(E,Xe[0],Xe[2]),ke=$c(R,Xe[1],Xe[3]),Pe=Xe[0]-he,ct=Xe[1]-le,it=Xe[2]-Xe[0]-ie,tt=Xe[3]-Xe[1]-ke}const Qe=(Xe,ot,Ke,je)=>{const gt=eu(Xe.stretch-he,ie,k,i.left),dt=tu(Xe.fixed-Pe,it,Xe.stretch,N),Rt=eu(ot.stretch-le,ke,A,i.top),gi=tu(ot.fixed-ct,tt,ot.stretch,q),wi=eu(Ke.stretch-he,ie,k,i.left),Ji=tu(Ke.fixed-Pe,it,Ke.stretch,N),rn=eu(je.stretch-le,ke,A,i.top),Br=tu(je.fixed-ct,tt,je.stretch,q),Zi=new j(gt,Rt),ar=new j(wi,Rt),gr=new j(wi,rn),Fr=new j(gt,rn),Or=new j(dt/_,gi/_),Qi=new j(Ji/_,Br/_),$i=e*Math.PI/180;if($i){const Cr=Math.sin($i),Wr=Math.cos($i),Xr=[Wr,-Cr,Cr,Wr];Zi._matMult(Xr),ar._matMult(Xr),Fr._matMult(Xr),gr._matMult(Xr)}const kr=Xe.stretch+Xe.fixed,Vr=ot.stretch+ot.fixed;return{tl:Zi,tr:ar,bl:Fr,br:gr,tex:{x:g.paddedRect.x+va+kr,y:g.paddedRect.y+va+Vr,w:Ke.stretch+Ke.fixed-kr,h:je.stretch+je.fixed-Vr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Or,pixelOffsetBR:Qi,minFontScaleX:it/_/k,minFontScaleY:tt/_/A,isSDF:r}};if(s&&(g.stretchX||g.stretchY)){const Xe=hp(E,K,N),ot=hp(R,te,q);for(let Ke=0;Ke0&&(N=Math.max(10,N),this.circleDiameter=N)}else{let E=_.top*v-S[0],R=_.bottom*v+S[2],O=_.left*v-S[3],N=_.right*v+S[1];const q=_.collisionPadding;if(q&&(O-=q[0]*v,E-=q[1]*v,N+=q[2]*v,R+=q[3]*v),A){const K=new j(O,E),te=new j(N,E),he=new j(O,R),ie=new j(N,R),le=A*Math.PI/180;K._rotate(le),te._rotate(le),he._rotate(le),ie._rotate(le),O=Math.min(K.x,te.x,he.x,ie.x),N=Math.max(K.x,te.x,he.x,ie.x),E=Math.min(K.y,te.y,he.y,ie.y),R=Math.max(K.y,te.y,he.y,ie.y)}e.emplaceBack(r.x,r.y,O,E,N,R,s,c,g)}this.boxEndIndex=e.length}}class Bg{constructor(e=[],r=Fg){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:s}=this,c=r[e];for(;e>0;){const g=e-1>>1,_=r[g];if(s(c,_)>=0)break;r[e]=_,e=g}r[e]=c}_down(e){const{data:r,compare:s}=this,c=this.length>>1,g=r[e];for(;e=0)break;r[e]=v,e=_}r[e]=g}}function Fg(i,e){return ie?1:0}function Og(i,e=1,r=!1){let s=1/0,c=1/0,g=-1/0,_=-1/0;const v=i[0];for(let O=0;Og)&&(g=N.x),(!O||N.y>_)&&(_=N.y)}const S=Math.min(g-s,_-c);let k=S/2;const A=new Bg([],Vg);if(S===0)return new j(s,c);for(let O=s;OE.d||!E.d)&&(E=O,r&&console.log("found best %d after %d probes",Math.round(1e4*O.d)/1e4,R)),O.max-E.d<=e||(k=O.h/2,A.push(new xa(O.p.x-k,O.p.y-k,k,i)),A.push(new xa(O.p.x+k,O.p.y-k,k,i)),A.push(new xa(O.p.x-k,O.p.y+k,k,i)),A.push(new xa(O.p.x+k,O.p.y+k,k,i)),R+=4)}return r&&(console.log(`num probes: ${R}`),console.log(`best distance: ${E.d}`)),E.p}function Vg(i,e){return e.max-i.max}function xa(i,e,r,s){this.p=new j(i,e),this.h=r,this.d=function(c,g){let _=!1,v=1/0;for(let S=0;Sc.y!=N.y>c.y&&c.x<(N.x-O.x)*(c.y-O.y)/(N.y-O.y)+O.x&&(_=!_),v=Math.min(v,Xh(c,O,N))}}return(_?1:-1)*Math.sqrt(v)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}var mr;x.ap=void 0,(mr=x.ap||(x.ap={}))[mr.center=1]="center",mr[mr.left=2]="left",mr[mr.right=3]="right",mr[mr.top=4]="top",mr[mr.bottom=5]="bottom",mr[mr["top-left"]=6]="top-left",mr[mr["top-right"]=7]="top-right",mr[mr["bottom-left"]=8]="bottom-left",mr[mr["bottom-right"]=9]="bottom-right";const Zs=7,hh=Number.POSITIVE_INFINITY;function dp(i,e){return e[1]!==hh?function(r,s,c){let g=0,_=0;switch(s=Math.abs(s),c=Math.abs(c),r){case"top-right":case"top-left":case"top":_=c-Zs;break;case"bottom-right":case"bottom-left":case"bottom":_=-c+Zs}switch(r){case"top-right":case"bottom-right":case"right":g=-s;break;case"top-left":case"bottom-left":case"left":g=s}return[g,_]}(i,e[0],e[1]):function(r,s){let c=0,g=0;s<0&&(s=0);const _=s/Math.SQRT2;switch(r){case"top-right":case"top-left":g=_-Zs;break;case"bottom-right":case"bottom-left":g=-_+Zs;break;case"bottom":g=-s+Zs;break;case"top":g=s-Zs}switch(r){case"top-right":case"bottom-right":c=-_;break;case"top-left":case"bottom-left":c=_;break;case"left":c=s;break;case"right":c=-s}return[c,g]}(i,e[0])}function pp(i,e,r){var s;const c=i.layout,g=(s=c.get("text-variable-anchor-offset"))===null||s===void 0?void 0:s.evaluate(e,{},r);if(g){const v=g.values,S=[];for(let k=0;kR*Yi);A.startsWith("top")?E[1]-=Zs:A.startsWith("bottom")&&(E[1]+=Zs),S[k+1]=E}return new Qr(S)}const _=c.get("text-variable-anchor");if(_){let v;v=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[c.get("text-radial-offset").evaluate(e,{},r)*Yi,hh]:c.get("text-offset").evaluate(e,{},r).map(k=>k*Yi);const S=[];for(const k of _)S.push(k,dp(k,v));return new Qr(S)}return null}function dh(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Ng(i,e,r,s,c,g,_,v,S,k,A){let E=g.textMaxSize.evaluate(e,{});E===void 0&&(E=_);const R=i.layers[0].layout,O=R.get("icon-offset").evaluate(e,{},A),N=mp(r.horizontal),q=_/24,K=i.tilePixelRatio*q,te=i.tilePixelRatio*E/24,he=i.tilePixelRatio*v,ie=i.tilePixelRatio*R.get("symbol-spacing"),le=R.get("text-padding")*i.tilePixelRatio,ke=function(je,gt,dt,Rt=1){const gi=je.get("icon-padding").evaluate(gt,{},dt),wi=gi&&gi.values;return[wi[0]*Rt,wi[1]*Rt,wi[2]*Rt,wi[3]*Rt]}(R,e,A,i.tilePixelRatio),Pe=R.get("text-max-angle")/180*Math.PI,it=R.get("text-rotation-alignment")!=="viewport"&&R.get("symbol-placement")!=="point",ct=R.get("icon-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",tt=R.get("symbol-placement"),Qe=ie/2,Xe=R.get("icon-text-fit");let ot;s&&Xe!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(ot=Od(s,r.vertical,Xe,R.get("icon-text-fit-padding"),O,q)),N&&(s=Od(s,N,Xe,R.get("icon-text-fit-padding"),O,q)));const Ke=(je,gt)=>{gt.x<0||gt.x>=zi||gt.y<0||gt.y>=zi||function(dt,Rt,gi,wi,Ji,rn,Br,Zi,ar,gr,Fr,Or,Qi,$i,kr,Vr,Cr,Wr,Xr,er,Ot,Mr,_r,tr,Tn){const Dn=dt.addToLineVertexArray(Rt,gi);let Rn,ms,In,gn,Kr=0,gs=0,Ll=0,vp=0,xh=-1,bh=-1;const _s={};let xp=ni("");if(dt.allowVerticalPlacement&&wi.vertical){const Ar=Zi.layout.get("text-rotate").evaluate(Ot,{},tr)+90;In=new iu(ar,Rt,gr,Fr,Or,wi.vertical,Qi,$i,kr,Ar),Br&&(gn=new iu(ar,Rt,gr,Fr,Or,Br,Cr,Wr,kr,Ar))}if(Ji){const Ar=Zi.layout.get("icon-rotate").evaluate(Ot,{}),_n=Zi.layout.get("icon-text-fit")!=="none",vo=up(Ji,Ar,_r,_n),Fn=Br?up(Br,Ar,_r,_n):void 0;ms=new iu(ar,Rt,gr,Fr,Or,Ji,Cr,Wr,!1,Ar),Kr=4*vo.length;const xo=dt.iconSizeData;let Wn=null;xo.kind==="source"?(Wn=[Hn*Zi.layout.get("icon-size").evaluate(Ot,{})],Wn[0]>Us&&ft(`${dt.layerIds[0]}: Value for "icon-size" is >= ${Al}. Reduce your "icon-size".`)):xo.kind==="composite"&&(Wn=[Hn*Mr.compositeIconSizes[0].evaluate(Ot,{},tr),Hn*Mr.compositeIconSizes[1].evaluate(Ot,{},tr)],(Wn[0]>Us||Wn[1]>Us)&&ft(`${dt.layerIds[0]}: Value for "icon-size" is >= ${Al}. Reduce your "icon-size".`)),dt.addSymbols(dt.icon,vo,Wn,er,Xr,Ot,x.ah.none,Rt,Dn.lineStartIndex,Dn.lineLength,-1,tr),xh=dt.icon.placedSymbolArray.length-1,Fn&&(gs=4*Fn.length,dt.addSymbols(dt.icon,Fn,Wn,er,Xr,Ot,x.ah.vertical,Rt,Dn.lineStartIndex,Dn.lineLength,-1,tr),bh=dt.icon.placedSymbolArray.length-1)}const bp=Object.keys(wi.horizontal);for(const Ar of bp){const _n=wi.horizontal[Ar];if(!Rn){xp=ni(_n.text);const Fn=Zi.layout.get("text-rotate").evaluate(Ot,{},tr);Rn=new iu(ar,Rt,gr,Fr,Or,_n,Qi,$i,kr,Fn)}const vo=_n.positionedLines.length===1;if(Ll+=fp(dt,Rt,_n,rn,Zi,kr,Ot,Vr,Dn,wi.vertical?x.ah.horizontal:x.ah.horizontalOnly,vo?bp:[Ar],_s,xh,Mr,tr),vo)break}wi.vertical&&(vp+=fp(dt,Rt,wi.vertical,rn,Zi,kr,Ot,Vr,Dn,x.ah.vertical,["vertical"],_s,bh,Mr,tr));const qg=Rn?Rn.boxStartIndex:dt.collisionBoxArray.length,Zg=Rn?Rn.boxEndIndex:dt.collisionBoxArray.length,Gg=In?In.boxStartIndex:dt.collisionBoxArray.length,Hg=In?In.boxEndIndex:dt.collisionBoxArray.length,Wg=ms?ms.boxStartIndex:dt.collisionBoxArray.length,Xg=ms?ms.boxEndIndex:dt.collisionBoxArray.length,Kg=gn?gn.boxStartIndex:dt.collisionBoxArray.length,Yg=gn?gn.boxEndIndex:dt.collisionBoxArray.length;let Bn=-1;const nu=(Ar,_n)=>Ar&&Ar.circleDiameter?Math.max(Ar.circleDiameter,_n):_n;Bn=nu(Rn,Bn),Bn=nu(In,Bn),Bn=nu(ms,Bn),Bn=nu(gn,Bn);const wp=Bn>-1?1:0;wp&&(Bn*=Tn/Yi),dt.glyphOffsetArray.length>=ya.MAX_GLYPHS&&ft("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ot.sortKey!==void 0&&dt.addToSortKeyRanges(dt.symbolInstances.length,Ot.sortKey);const Jg=pp(Zi,Ot,tr),[Qg,$g]=function(Ar,_n){const vo=Ar.length,Fn=_n==null?void 0:_n.values;if((Fn==null?void 0:Fn.length)>0)for(let xo=0;xo=0?_s.right:-1,_s.center>=0?_s.center:-1,_s.left>=0?_s.left:-1,_s.vertical||-1,xh,bh,xp,qg,Zg,Gg,Hg,Wg,Xg,Kg,Yg,gr,Ll,vp,Kr,gs,wp,0,Qi,Bn,Qg,$g)}(i,gt,je,r,s,c,ot,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,K,[le,le,le,le],it,S,he,ke,ct,O,e,g,k,A,_)};if(tt==="line")for(const je of np(e.geometry,0,0,zi,zi)){const gt=Rg(je,ie,Pe,r.vertical||N,s,24,te,i.overscaling,zi);for(const dt of gt)N&&Ug(i,N.text,Qe,dt)||Ke(je,dt)}else if(tt==="line-center"){for(const je of e.geometry)if(je.length>1){const gt=Dg(je,Pe,r.vertical||N,s,24,te);gt&&Ke(je,gt)}}else if(e.type==="Polygon")for(const je of Zu(e.geometry,0)){const gt=Og(je,16);Ke(je[0],new qs(gt.x,gt.y,0))}else if(e.type==="LineString")for(const je of e.geometry)Ke(je,new qs(je[0].x,je[0].y,0));else if(e.type==="Point")for(const je of e.geometry)for(const gt of je)Ke([gt],new qs(gt.x,gt.y,0))}function fp(i,e,r,s,c,g,_,v,S,k,A,E,R,O,N){const q=function(he,ie,le,ke,Pe,it,ct,tt){const Qe=ke.layout.get("text-rotate").evaluate(it,{})*Math.PI/180,Xe=[];for(const ot of ie.positionedLines)for(const Ke of ot.positionedGlyphs){if(!Ke.rect)continue;const je=Ke.rect||{};let gt=Pd+1,dt=!0,Rt=1,gi=0;const wi=(Pe||tt)&&Ke.vertical,Ji=Ke.metrics.advance*Ke.scale/2;if(tt&&ie.verticalizable&&(gi=ot.lineOffset/2-(Ke.imageName?-(Yi-Ke.metrics.width*Ke.scale)/2:(Ke.scale-1)*Yi)),Ke.imageName){const er=ct[Ke.imageName];dt=er.sdf,Rt=er.pixelRatio,gt=Hr/Rt}const rn=Pe?[Ke.x+Ji,Ke.y]:[0,0];let Br=Pe?[0,0]:[Ke.x+Ji+le[0],Ke.y+le[1]-gi],Zi=[0,0];wi&&(Zi=Br,Br=[0,0]);const ar=Ke.metrics.isDoubleResolution?2:1,gr=(Ke.metrics.left-gt)*Ke.scale-Ji+Br[0],Fr=(-Ke.metrics.top-gt)*Ke.scale+Br[1],Or=gr+je.w/ar*Ke.scale/Rt,Qi=Fr+je.h/ar*Ke.scale/Rt,$i=new j(gr,Fr),kr=new j(Or,Fr),Vr=new j(gr,Qi),Cr=new j(Or,Qi);if(wi){const er=new j(-Ji,Ji-Cl),Ot=-Math.PI/2,Mr=Yi/2-Ji,_r=new j(5-Cl-Mr,-(Ke.imageName?Mr:0)),tr=new j(...Zi);$i._rotateAround(Ot,er)._add(_r)._add(tr),kr._rotateAround(Ot,er)._add(_r)._add(tr),Vr._rotateAround(Ot,er)._add(_r)._add(tr),Cr._rotateAround(Ot,er)._add(_r)._add(tr)}if(Qe){const er=Math.sin(Qe),Ot=Math.cos(Qe),Mr=[Ot,-er,er,Ot];$i._matMult(Mr),kr._matMult(Mr),Vr._matMult(Mr),Cr._matMult(Mr)}const Wr=new j(0,0),Xr=new j(0,0);Xe.push({tl:$i,tr:kr,bl:Vr,br:Cr,tex:je,writingMode:ie.writingMode,glyphOffset:rn,sectionIndex:Ke.sectionIndex,isSDF:dt,pixelOffsetTL:Wr,pixelOffsetBR:Xr,minFontScaleX:0,minFontScaleY:0})}return Xe}(0,r,v,c,g,_,s,i.allowVerticalPlacement),K=i.textSizeData;let te=null;K.kind==="source"?(te=[Hn*c.layout.get("text-size").evaluate(_,{})],te[0]>Us&&ft(`${i.layerIds[0]}: Value for "text-size" is >= ${Al}. Reduce your "text-size".`)):K.kind==="composite"&&(te=[Hn*O.compositeTextSizes[0].evaluate(_,{},N),Hn*O.compositeTextSizes[1].evaluate(_,{},N)],(te[0]>Us||te[1]>Us)&&ft(`${i.layerIds[0]}: Value for "text-size" is >= ${Al}. Reduce your "text-size".`)),i.addSymbols(i.text,q,te,v,g,_,k,e,S.lineStartIndex,S.lineLength,R,N);for(const he of A)E[he]=i.text.placedSymbolArray.length-1;return 4*q.length}function mp(i){for(const e in i)return i[e];return null}function Ug(i,e,r,s){const c=i.compareText;if(e in c){const g=c[e];for(let _=g.length-1;_>=0;_--)if(s.dist(g[_])>4;if(c!==1)throw new Error(`Got v${c} data when expected v1.`);const g=gp[15&s];if(!g)throw new Error("Unrecognized array type.");const[_]=new Uint16Array(e,2,1),[v]=new Uint32Array(e,4,1);return new ph(v,_,g,e)}constructor(e,r=64,s=Float64Array,c){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=s,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const g=gp.indexOf(this.ArrayType),_=2*e*this.ArrayType.BYTES_PER_ELEMENT,v=e*this.IndexArrayType.BYTES_PER_ELEMENT,S=(8-v%8)%8;if(g<0)throw new Error(`Unexpected typed array class: ${s}.`);c&&c instanceof ArrayBuffer?(this.data=c,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+v+S,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+_+v+S),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+v+S,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+g]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=e,this.coords[this._pos++]=r,s}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return fh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,s,c){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:g,coords:_,nodeSize:v}=this,S=[0,g.length-1,0],k=[];for(;S.length;){const A=S.pop()||0,E=S.pop()||0,R=S.pop()||0;if(E-R<=v){for(let K=R;K<=E;K++){const te=_[2*K],he=_[2*K+1];te>=e&&te<=s&&he>=r&&he<=c&&k.push(g[K])}continue}const O=R+E>>1,N=_[2*O],q=_[2*O+1];N>=e&&N<=s&&q>=r&&q<=c&&k.push(g[O]),(A===0?e<=N:r<=q)&&(S.push(R),S.push(O-1),S.push(1-A)),(A===0?s>=N:c>=q)&&(S.push(O+1),S.push(E),S.push(1-A))}return k}within(e,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:g,nodeSize:_}=this,v=[0,c.length-1,0],S=[],k=s*s;for(;v.length;){const A=v.pop()||0,E=v.pop()||0,R=v.pop()||0;if(E-R<=_){for(let K=R;K<=E;K++)yp(g[2*K],g[2*K+1],e,r)<=k&&S.push(c[K]);continue}const O=R+E>>1,N=g[2*O],q=g[2*O+1];yp(N,q,e,r)<=k&&S.push(c[O]),(A===0?e-s<=N:r-s<=q)&&(v.push(R),v.push(O-1),v.push(1-A)),(A===0?e+s>=N:r+s>=q)&&(v.push(O+1),v.push(E),v.push(1-A))}return S}}function fh(i,e,r,s,c,g){if(c-s<=r)return;const _=s+c>>1;_p(i,e,_,s,c,g),fh(i,e,r,s,_-1,1-g),fh(i,e,r,_+1,c,1-g)}function _p(i,e,r,s,c,g){for(;c>s;){if(c-s>600){const k=c-s+1,A=r-s+1,E=Math.log(k),R=.5*Math.exp(2*E/3),O=.5*Math.sqrt(E*R*(k-R)/k)*(A-k/2<0?-1:1);_p(i,e,r,Math.max(s,Math.floor(r-A*R/k+O)),Math.min(c,Math.floor(r+(k-A)*R/k+O)),g)}const _=e[2*r+g];let v=s,S=c;for(Pl(i,e,s,r),e[2*c+g]>_&&Pl(i,e,s,c);v_;)S--}e[2*s+g]===_?Pl(i,e,s,S):(S++,Pl(i,e,S,c)),S<=r&&(s=S+1),r<=S&&(c=S-1)}}function Pl(i,e,r,s){mh(i,r,s),mh(e,2*r,2*s),mh(e,2*r+1,2*s+1)}function mh(i,e,r){const s=i[e];i[e]=i[r],i[r]=s}function yp(i,e,r,s){const c=i-r,g=e-s;return c*c+g*g}var gh;x.bc=void 0,(gh=x.bc||(x.bc={})).create="create",gh.load="load",gh.fullLoad="fullLoad";let ru=null,zl=[];const _h=1e3/60,yh="loadTime",vh="fullLoadTime",jg={mark(i){performance.mark(i)},frame(i){const e=i;ru!=null&&zl.push(e-ru),ru=e},clearMetrics(){ru=null,zl=[],performance.clearMeasures(yh),performance.clearMeasures(vh);for(const i in x.bc)performance.clearMarks(x.bc[i])},getPerformanceMetrics(){performance.measure(yh,x.bc.create,x.bc.load),performance.measure(vh,x.bc.create,x.bc.fullLoad);const i=performance.getEntriesByName(yh)[0].duration,e=performance.getEntriesByName(vh)[0].duration,r=zl.length,s=1/(zl.reduce((g,_)=>g+_,0)/r/1e3),c=zl.filter(g=>g>_h).reduce((g,_)=>g+(_-_h)/_h,0);return{loadTime:i,fullLoadTime:e,fps:s,percentDroppedFrames:c/(r+c)*100,totalFrames:r}}};x.$=vt,x.A=da,x.B=function(i){if(ut==null){const e=i.navigator?i.navigator.userAgent:null;ut=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return ut},x.C=class{constructor(i,e){this.target=i,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new zg(()=>this.process()),this.subscription=function(r,s,c,g){return r.addEventListener(s,c,!1),{unsubscribe:()=>{r.removeEventListener(s,c,!1)}}}(this.target,"message",r=>this.receive(r)),this.globalScope=nt(self)?i:window}registerMessageHandler(i,e){this.messageHandlers[i]=e}sendAsync(i,e){return new Promise((r,s)=>{const c=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[c]={resolve:r,reject:s},e&&e.signal.addEventListener("abort",()=>{delete this.resolveRejects[c];const v={id:c,type:"",origin:location.origin,targetMapId:i.targetMapId,sourceMapId:this.mapId};this.target.postMessage(v)},{once:!0});const g=[],_=Object.assign(Object.assign({},i),{id:c,sourceMapId:this.mapId,origin:location.origin,data:Ds(i.data,g)});this.target.postMessage(_,{transfer:g})})}receive(i){const e=i.data,r=e.id;if(!(e.origin!=="file://"&&location.origin!=="file://"&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type===""){delete this.tasks[r];const s=this.abortControllers[r];return delete this.abortControllers[r],void(s&&s.abort())}if(nt(self)||e.mustQueue)return this.tasks[r]=e,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,e)}}process(){if(this.taskQueue.length===0)return;const i=this.taskQueue.shift(),e=this.tasks[i];delete this.tasks[i],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(i,e)}processTask(i,e){return a(this,void 0,void 0,function*(){if(e.type===""){const c=this.resolveRejects[i];return delete this.resolveRejects[i],c?void(e.error?c.reject(co(e.error)):c.resolve(co(e.data))):void 0}if(!this.messageHandlers[e.type])return void this.completeTask(i,new Error(`Could not find a registered handler for ${e.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const r=co(e.data),s=new AbortController;this.abortControllers[i]=s;try{const c=yield this.messageHandlers[e.type](e.sourceMapId,r,s);this.completeTask(i,null,c)}catch(c){this.completeTask(i,c)}})}completeTask(i,e,r){const s=[];delete this.abortControllers[i];const c={id:i,type:"",sourceMapId:this.mapId,origin:location.origin,error:e?Ds(e):null,data:Ds(r,s)};this.target.postMessage(c,{transfer:s})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},x.D=ht,x.E=Di,x.F=function(){var i=new da(16);return da!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},x.G=xi,x.H=function(i,e,r){var s,c,g,_,v,S,k,A,E,R,O,N,q=r[0],K=r[1],te=r[2];return e===i?(i[12]=e[0]*q+e[4]*K+e[8]*te+e[12],i[13]=e[1]*q+e[5]*K+e[9]*te+e[13],i[14]=e[2]*q+e[6]*K+e[10]*te+e[14],i[15]=e[3]*q+e[7]*K+e[11]*te+e[15]):(c=e[1],g=e[2],_=e[3],v=e[4],S=e[5],k=e[6],A=e[7],E=e[8],R=e[9],O=e[10],N=e[11],i[0]=s=e[0],i[1]=c,i[2]=g,i[3]=_,i[4]=v,i[5]=S,i[6]=k,i[7]=A,i[8]=E,i[9]=R,i[10]=O,i[11]=N,i[12]=s*q+v*K+E*te+e[12],i[13]=c*q+S*K+R*te+e[13],i[14]=g*q+k*K+O*te+e[14],i[15]=_*q+A*K+N*te+e[15]),i},x.I=eh,x.J=function(i,e,r){var s=r[0],c=r[1],g=r[2];return i[0]=e[0]*s,i[1]=e[1]*s,i[2]=e[2]*s,i[3]=e[3]*s,i[4]=e[4]*c,i[5]=e[5]*c,i[6]=e[6]*c,i[7]=e[7]*c,i[8]=e[8]*g,i[9]=e[9]*g,i[10]=e[10]*g,i[11]=e[11]*g,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},x.K=Qh,x.L=function(i,e){const r={};for(let s=0;s{const e=window.document.createElement("video");return e.muted=!0,new Promise(r=>{e.onloadstart=()=>{r(e)};for(const s of i){const c=window.document.createElement("source");Ni(s)||(e.crossOrigin="Anonymous"),c.src=s,e.appendChild(c)}})},x.a3=function(){return be++},x.a4=t,x.a5=ya,x.a6=Xo,x.a7=ps,x.a8=pi,x.a9=ep,x.aA=ge,x.aB=function(i,e){if(!i)return[{command:"setStyle",args:[e]}];let r=[];try{if(!Ut(i.version,e.version))return[{command:"setStyle",args:[e]}];Ut(i.center,e.center)||r.push({command:"setCenter",args:[e.center]}),Ut(i.zoom,e.zoom)||r.push({command:"setZoom",args:[e.zoom]}),Ut(i.bearing,e.bearing)||r.push({command:"setBearing",args:[e.bearing]}),Ut(i.pitch,e.pitch)||r.push({command:"setPitch",args:[e.pitch]}),Ut(i.sprite,e.sprite)||r.push({command:"setSprite",args:[e.sprite]}),Ut(i.glyphs,e.glyphs)||r.push({command:"setGlyphs",args:[e.glyphs]}),Ut(i.transition,e.transition)||r.push({command:"setTransition",args:[e.transition]}),Ut(i.light,e.light)||r.push({command:"setLight",args:[e.light]}),Ut(i.terrain,e.terrain)||r.push({command:"setTerrain",args:[e.terrain]}),Ut(i.sky,e.sky)||r.push({command:"setSky",args:[e.sky]});const s={},c=[];(function(_,v,S,k){let A;for(A in v=v||{},_=_||{})Object.prototype.hasOwnProperty.call(_,A)&&(Object.prototype.hasOwnProperty.call(v,A)||Ss(A,S,k));for(A in v)Object.prototype.hasOwnProperty.call(v,A)&&(Object.prototype.hasOwnProperty.call(_,A)?Ut(_[A],v[A])||(_[A].type==="geojson"&&v[A].type==="geojson"&&Is(_,v,A)?or(S,{command:"setGeoJSONSourceData",args:[A,v[A].data]}):Ts(A,v,S,k)):yn(A,v,S))})(i.sources,e.sources,c,s);const g=[];i.layers&&i.layers.forEach(_=>{"source"in _&&s[_.source]?r.push({command:"removeLayer",args:[_.id]}):g.push(_)}),r=r.concat(c),function(_,v,S){v=v||[];const k=(_=_||[]).map(ko),A=v.map(ko),E=_.reduce($n,{}),R=v.reduce($n,{}),O=k.slice(),N=Object.create(null);let q,K,te,he,ie;for(let le=0,ke=0;le@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,s,c,g)=>{const _=c||g;return e[s]=!_||_.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},x.ab=function(i,e){const r=[];for(const s in i)s in e||r.push(s);return r},x.ac=me,x.ad=function(i,e,r){var s=Math.sin(r),c=Math.cos(r),g=e[0],_=e[1],v=e[2],S=e[3],k=e[4],A=e[5],E=e[6],R=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=g*c+k*s,i[1]=_*c+A*s,i[2]=v*c+E*s,i[3]=S*c+R*s,i[4]=k*c-g*s,i[5]=A*c-_*s,i[6]=E*c-v*s,i[7]=R*c-S*s,i},x.ae=function(i){var e=new da(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},x.af=Uc,x.ag=function(i,e){let r=0,s=0;if(i.kind==="constant")s=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:c,minZoom:g,maxZoom:_}=i,v=c?me(dr.interpolationFactor(c,e,g,_),0,1):0;i.kind==="camera"?s=br.number(i.minSize,i.maxSize,v):r=v}return{uSizeT:r,uSize:s}},x.ai=function(i,{uSize:e,uSizeT:r},{lowerSize:s,upperSize:c}){return i.kind==="source"?s/Hn:i.kind==="composite"?br.number(s/Hn,c/Hn,r):e},x.aj=nh,x.ak=function(i,e,r,s){const c=e.y-i.y,g=e.x-i.x,_=s.y-r.y,v=s.x-r.x,S=_*g-v*c;if(S===0)return null;const k=(v*(i.y-r.y)-_*(i.x-r.x))/S;return new j(i.x+k*g,i.y+k*c)},x.al=np,x.am=gl,x.an=Fu,x.ao=Yi,x.aq=rh,x.ar=function(i,e){var r=e[0],s=e[1],c=e[2],g=e[3],_=e[4],v=e[5],S=e[6],k=e[7],A=e[8],E=e[9],R=e[10],O=e[11],N=e[12],q=e[13],K=e[14],te=e[15],he=r*v-s*_,ie=r*S-c*_,le=r*k-g*_,ke=s*S-c*v,Pe=s*k-g*v,it=c*k-g*S,ct=A*q-E*N,tt=A*K-R*N,Qe=A*te-O*N,Xe=E*K-R*q,ot=E*te-O*q,Ke=R*te-O*K,je=he*Ke-ie*ot+le*Xe+ke*Qe-Pe*tt+it*ct;return je?(i[0]=(v*Ke-S*ot+k*Xe)*(je=1/je),i[1]=(c*ot-s*Ke-g*Xe)*je,i[2]=(q*it-K*Pe+te*ke)*je,i[3]=(R*Pe-E*it-O*ke)*je,i[4]=(S*Qe-_*Ke-k*tt)*je,i[5]=(r*Ke-c*Qe+g*tt)*je,i[6]=(K*le-N*it-te*ie)*je,i[7]=(A*it-R*le+O*ie)*je,i[8]=(_*ot-v*Qe+k*ct)*je,i[9]=(s*Qe-r*ot-g*ct)*je,i[10]=(N*Pe-q*le+te*he)*je,i[11]=(E*le-A*Pe-O*he)*je,i[12]=(v*tt-_*Xe-S*ct)*je,i[13]=(r*Xe-s*tt+c*ct)*je,i[14]=(q*ie-N*ke-K*he)*je,i[15]=(A*ke-E*ie+R*he)*je,i):null},x.as=dh,x.at=ih,x.au=ph,x.av=function(){const i={},e=we.$version;for(const r in we.$root){const s=we.$root[r];if(s.required){let c=null;c=r==="version"?e:s.type==="array"?[]:{},c!=null&&(i[r]=c)}}return i},x.aw=ea,x.ax=Tt,x.ay=function(i){i=i.slice();const e=Object.create(null);for(let r=0;rje*Yi)}let tt=_?"center":r.get("text-justify").evaluate(k,{},i.canonical);const Qe=r.get("symbol-placement"),Xe=Qe==="point"?r.get("text-max-width").evaluate(k,{},i.canonical)*Yi:0,ot=()=>{i.bucket.allowVerticalPlacement&&ta(le)&&(N.vertical=Xc(q,i.glyphMap,i.glyphPositions,i.imagePositions,A,Xe,g,it,"left",Pe,te,x.ah.vertical,!0,Qe,R,E))};if(!_&&ct){const Ke=new Set;if(tt==="auto")for(let gt=0;gta(void 0,void 0,void 0,function*(){if(i.byteLength===0)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(i)],{type:"image/png"});try{return createImageBitmap(e)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),x.e=Ee,x.f=i=>new Promise((e,r)=>{const s=new Image;s.onload=()=>{e(s),URL.revokeObjectURL(s.src),s.onload=null,window.requestAnimationFrame(()=>{s.src=Jt})},s.onerror=()=>r(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 c=new Blob([new Uint8Array(i)],{type:"image/png"});s.src=i.byteLength?URL.createObjectURL(c):Jt}),x.g=vi,x.h=(i,e)=>Nt(Ee(i,{type:"json"}),e),x.i=nt,x.j=Qt,x.k=Ne,x.l=(i,e)=>Nt(Ee(i,{type:"arrayBuffer"}),e),x.m=Nt,x.n=function(i){return new Qu(i).readFields(_g,[])},x.o=vl,x.p=zd,x.q=Sr,x.r=Qa,x.s=Ni,x.t=Cc,x.u=et,x.v=we,x.w=ft,x.x=ao,x.y=function([i,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(r),y:i*Math.sin(e)*Math.sin(r),z:i*Math.cos(r)}},x.z=br}),y("worker",["./shared"],function(x){class a{constructor(D){this.keyCache={},D&&this.replace(D)}replace(D){this._layerConfigs={},this._layers={},this.update(D,[])}update(D,B){for(const G of D){this._layerConfigs[G.id]=G;const oe=this._layers[G.id]=x.az(G);oe._featureFilter=x.a6(oe.filter),this.keyCache[G.id]&&delete this.keyCache[G.id]}for(const G of B)delete this.keyCache[G],delete this._layerConfigs[G],delete this._layers[G];this.familiesBySource={};const U=x.bg(Object.values(this._layerConfigs),this.keyCache);for(const G of U){const oe=G.map(Ce=>this._layers[Ce.id]),ae=oe[0];if(ae.visibility==="none")continue;const ue=ae.source||"";let re=this.familiesBySource[ue];re||(re=this.familiesBySource[ue]={});const pe=ae.sourceLayer||"_geojsonTileLayer";let ze=re[pe];ze||(ze=re[pe]=[]),ze.push(oe)}}}class M{constructor(D){const B={},U=[];for(const ue in D){const re=D[ue],pe=B[ue]={};for(const ze in re){const Ce=re[+ze];if(!Ce||Ce.bitmap.width===0||Ce.bitmap.height===0)continue;const Me={x:0,y:0,w:Ce.bitmap.width+2,h:Ce.bitmap.height+2};U.push(Me),pe[ze]={rect:Me,metrics:Ce.metrics}}}const{w:G,h:oe}=x.p(U),ae=new x.o({width:G||1,height:oe||1});for(const ue in D){const re=D[ue];for(const pe in re){const ze=re[+pe];if(!ze||ze.bitmap.width===0||ze.bitmap.height===0)continue;const Ce=B[ue][pe].rect;x.o.copy(ze.bitmap,ae,{x:0,y:0},{x:Ce.x+1,y:Ce.y+1},ze.bitmap)}}this.image=ae,this.positions=B}}x.bh("GlyphAtlas",M);class L{constructor(D){this.tileID=new x.Q(D.tileID.overscaledZ,D.tileID.wrap,D.tileID.canonical.z,D.tileID.canonical.x,D.tileID.canonical.y),this.uid=D.uid,this.zoom=D.zoom,this.pixelRatio=D.pixelRatio,this.tileSize=D.tileSize,this.source=D.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=D.showCollisionBoxes,this.collectResourceTiming=!!D.collectResourceTiming,this.returnDependencies=!!D.returnDependencies,this.promoteId=D.promoteId,this.inFlightDependencies=[]}parse(D,B,U,G){return x._(this,void 0,void 0,function*(){this.status="parsing",this.data=D,this.collisionBoxArray=new x.a4;const oe=new x.bi(Object.keys(D.layers).sort()),ae=new x.bj(this.tileID,this.promoteId);ae.bucketLayerIDs=[];const ue={},re={featureIndex:ae,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:U},pe=B.familiesBySource[this.source];for(const Et in pe){const Ci=D.layers[Et];if(!Ci)continue;Ci.version===1&&x.w(`Vector tile source "${this.source}" layer "${Et}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Hi=oe.encode(Et),xr=[];for(let Pr=0;Pr=ir.maxzoom||ir.visibility!=="none"&&(F(Pr,this.zoom,U),(ue[ir.id]=ir.createBucket({index:ae.bucketLayerIDs.length,layers:Pr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Hi,sourceID:this.source})).populate(xr,re,this.tileID.canonical),ae.bucketLayerIDs.push(Pr.map(bn=>bn.id)))}}const ze=x.aE(re.glyphDependencies,Et=>Object.keys(Et).map(Number));this.inFlightDependencies.forEach(Et=>Et==null?void 0:Et.abort()),this.inFlightDependencies=[];let Ce=Promise.resolve({});if(Object.keys(ze).length){const Et=new AbortController;this.inFlightDependencies.push(Et),Ce=G.sendAsync({type:"getGlyphs",data:{stacks:ze,source:this.source,tileID:this.tileID,type:"glyphs"}},Et)}const Me=Object.keys(re.iconDependencies);let mt=Promise.resolve({});if(Me.length){const Et=new AbortController;this.inFlightDependencies.push(Et),mt=G.sendAsync({type:"getImages",data:{icons:Me,source:this.source,tileID:this.tileID,type:"icons"}},Et)}const _t=Object.keys(re.patternDependencies);let Mt=Promise.resolve({});if(_t.length){const Et=new AbortController;this.inFlightDependencies.push(Et),Mt=G.sendAsync({type:"getImages",data:{icons:_t,source:this.source,tileID:this.tileID,type:"patterns"}},Et)}const[bt,jt,ri]=yield Promise.all([Ce,mt,Mt]),bi=new M(bt),ji=new x.bk(jt,ri);for(const Et in ue){const Ci=ue[Et];Ci instanceof x.a5?(F(Ci.layers,this.zoom,U),x.bl({bucket:Ci,glyphMap:bt,glyphPositions:bi.positions,imageMap:jt,imagePositions:ji.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Ci.hasPattern&&(Ci instanceof x.bm||Ci instanceof x.bn||Ci instanceof x.bo)&&(F(Ci.layers,this.zoom,U),Ci.addFeatures(re,this.tileID.canonical,ji.patternPositions))}return this.status="done",{buckets:Object.values(ue).filter(Et=>!Et.isEmpty()),featureIndex:ae,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:bi.image,imageAtlas:ji,glyphMap:this.returnDependencies?bt:null,iconMap:this.returnDependencies?jt:null,glyphPositions:this.returnDependencies?bi.positions:null}})}}function F(Y,D,B){const U=new x.a8(D);for(const G of Y)G.recalculate(U,B)}class j{constructor(D,B,U){this.actor=D,this.layerIndex=B,this.availableImages=U,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(D,B){return x._(this,void 0,void 0,function*(){const U=yield x.l(D.request,B);try{return{vectorTile:new x.bp.VectorTile(new x.bq(U.data)),rawData:U.data,cacheControl:U.cacheControl,expires:U.expires}}catch(G){const oe=new Uint8Array(U.data);let ae=`Unable to parse the tile at ${D.request.url}, `;throw ae+=oe[0]===31&&oe[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${G.messge}`,new Error(ae)}})}loadTile(D){return x._(this,void 0,void 0,function*(){const B=D.uid,U=!!(D&&D.request&&D.request.collectResourceTiming)&&new x.br(D.request),G=new L(D);this.loading[B]=G;const oe=new AbortController;G.abort=oe;try{const ae=yield this.loadVectorTile(D,oe);if(delete this.loading[B],!ae)return null;const ue=ae.rawData,re={};ae.expires&&(re.expires=ae.expires),ae.cacheControl&&(re.cacheControl=ae.cacheControl);const pe={};if(U){const Ce=U.finish();Ce&&(pe.resourceTiming=JSON.parse(JSON.stringify(Ce)))}G.vectorTile=ae.vectorTile;const ze=G.parse(ae.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[B]=G,this.fetching[B]={rawTileData:ue,cacheControl:re,resourceTiming:pe};try{const Ce=yield ze;return x.e({rawTileData:ue.slice(0)},Ce,re,pe)}finally{delete this.fetching[B]}}catch(ae){throw delete this.loading[B],G.status="done",this.loaded[B]=G,ae}})}reloadTile(D){return x._(this,void 0,void 0,function*(){const B=D.uid;if(!this.loaded||!this.loaded[B])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const U=this.loaded[B];if(U.showCollisionBoxes=D.showCollisionBoxes,U.status==="parsing"){const G=yield U.parse(U.vectorTile,this.layerIndex,this.availableImages,this.actor);let oe;if(this.fetching[B]){const{rawTileData:ae,cacheControl:ue,resourceTiming:re}=this.fetching[B];delete this.fetching[B],oe=x.e({rawTileData:ae.slice(0)},G,ue,re)}else oe=G;return oe}if(U.status==="done"&&U.vectorTile)return U.parse(U.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(D){return x._(this,void 0,void 0,function*(){const B=this.loading,U=D.uid;B&&B[U]&&B[U].abort&&(B[U].abort.abort(),delete B[U])})}removeTile(D){return x._(this,void 0,void 0,function*(){this.loaded&&this.loaded[D.uid]&&delete this.loaded[D.uid]})}}class X{constructor(){this.loaded={}}loadTile(D){return x._(this,void 0,void 0,function*(){const{uid:B,encoding:U,rawImageData:G,redFactor:oe,greenFactor:ae,blueFactor:ue,baseShift:re}=D,pe=G.width+2,ze=G.height+2,Ce=x.b(G)?new x.R({width:pe,height:ze},yield x.bs(G,-1,-1,pe,ze)):G,Me=new x.bt(B,Ce,U,oe,ae,ue,re);return this.loaded=this.loaded||{},this.loaded[B]=Me,Me})}removeTile(D){const B=this.loaded,U=D.uid;B&&B[U]&&delete B[U]}}function Ie(Y,D){if(Y.length!==0){de(Y[0],D);for(var B=1;B=Math.abs(ue)?B-re+ue:ue-re+B,B=re}B+U>=0!=!!D&&Y.reverse()}var Te=x.bu(function Y(D,B){var U,G=D&&D.type;if(G==="FeatureCollection")for(U=0;U>31}function $t(Y,D){for(var B=Y.loadGeometry(),U=Y.type,G=0,oe=0,ae=B.length,ue=0;ueY},Jt=Math.fround||(Ti=new Float32Array(1),Y=>(Ti[0]=+Y,Ti[0]));var Ti;const ei=3,zt=5,yi=6;class hi{constructor(D){this.options=Object.assign(Object.create(Vt),D),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(D){const{log:B,minZoom:U,maxZoom:G}=this.options;B&&console.time("total time");const oe=`prepare ${D.length} points`;B&&console.time(oe),this.points=D;const ae=[];for(let re=0;re=U;re--){const pe=+Date.now();ue=this.trees[re]=this._createTree(this._cluster(ue,re)),B&&console.log("z%d: %d clusters in %dms",re,ue.numItems,+Date.now()-pe)}return B&&console.timeEnd("total time"),this}getClusters(D,B){let U=((D[0]+180)%360+360)%360-180;const G=Math.max(-90,Math.min(90,D[1]));let oe=D[2]===180?180:((D[2]+180)%360+360)%360-180;const ae=Math.max(-90,Math.min(90,D[3]));if(D[2]-D[0]>=360)U=-180,oe=180;else if(U>oe){const Ce=this.getClusters([U,G,180,ae],B),Me=this.getClusters([-180,G,oe,ae],B);return Ce.concat(Me)}const ue=this.trees[this._limitZoom(B)],re=ue.range(xi(U),He(ae),xi(oe),He(G)),pe=ue.data,ze=[];for(const Ce of re){const Me=this.stride*Ce;ze.push(pe[Me+zt]>1?ki(pe,Me,this.clusterProps):this.points[pe[Me+ei]])}return ze}getChildren(D){const B=this._getOriginId(D),U=this._getOriginZoom(D),G="No cluster with the specified id.",oe=this.trees[U];if(!oe)throw new Error(G);const ae=oe.data;if(B*this.stride>=ae.length)throw new Error(G);const ue=this.options.radius/(this.options.extent*Math.pow(2,U-1)),re=oe.within(ae[B*this.stride],ae[B*this.stride+1],ue),pe=[];for(const ze of re){const Ce=ze*this.stride;ae[Ce+4]===D&&pe.push(ae[Ce+zt]>1?ki(ae,Ce,this.clusterProps):this.points[ae[Ce+ei]])}if(pe.length===0)throw new Error(G);return pe}getLeaves(D,B,U){const G=[];return this._appendLeaves(G,D,B=B||10,U=U||0,0),G}getTile(D,B,U){const G=this.trees[this._limitZoom(D)],oe=Math.pow(2,D),{extent:ae,radius:ue}=this.options,re=ue/ae,pe=(U-re)/oe,ze=(U+1+re)/oe,Ce={features:[]};return this._addTileFeatures(G.range((B-re)/oe,pe,(B+1+re)/oe,ze),G.data,B,U,oe,Ce),B===0&&this._addTileFeatures(G.range(1-re/oe,pe,1,ze),G.data,oe,U,oe,Ce),B===oe-1&&this._addTileFeatures(G.range(0,pe,re/oe,ze),G.data,-1,U,oe,Ce),Ce.features.length?Ce:null}getClusterExpansionZoom(D){let B=this._getOriginZoom(D)-1;for(;B<=this.options.maxZoom;){const U=this.getChildren(D);if(B++,U.length!==1)break;D=U[0].properties.cluster_id}return B}_appendLeaves(D,B,U,G,oe){const ae=this.getChildren(B);for(const ue of ae){const re=ue.properties;if(re&&re.cluster?oe+re.point_count<=G?oe+=re.point_count:oe=this._appendLeaves(D,re.cluster_id,U,G,oe):oe1;let ze,Ce,Me;if(pe)ze=vi(B,re,this.clusterProps),Ce=B[re],Me=B[re+1];else{const Mt=this.points[B[re+ei]];ze=Mt.properties;const[bt,jt]=Mt.geometry.coordinates;Ce=xi(bt),Me=He(jt)}const mt={type:1,geometry:[[Math.round(this.options.extent*(Ce*oe-U)),Math.round(this.options.extent*(Me*oe-G))]],tags:ze};let _t;_t=pe||this.options.generateId?B[re+ei]:this.points[B[re+ei]].id,_t!==void 0&&(mt.id=_t),ae.features.push(mt)}}_limitZoom(D){return Math.max(this.options.minZoom,Math.min(Math.floor(+D),this.options.maxZoom+1))}_cluster(D,B){const{radius:U,extent:G,reduce:oe,minPoints:ae}=this.options,ue=U/(G*Math.pow(2,B)),re=D.data,pe=[],ze=this.stride;for(let Ce=0;CeB&&(bt+=re[ri+zt])}if(bt>Mt&&bt>=ae){let jt,ri=Me*Mt,bi=mt*Mt,ji=-1;const Et=((Ce/ze|0)<<5)+(B+1)+this.points.length;for(const Ci of _t){const Hi=Ci*ze;if(re[Hi+2]<=B)continue;re[Hi+2]=B;const xr=re[Hi+zt];ri+=re[Hi]*xr,bi+=re[Hi+1]*xr,re[Hi+4]=Et,oe&&(jt||(jt=this._map(re,Ce,!0),ji=this.clusterProps.length,this.clusterProps.push(jt)),oe(jt,this._map(re,Hi)))}re[Ce+4]=Et,pe.push(ri/bt,bi/bt,1/0,Et,-1,bt),oe&&pe.push(ji)}else{for(let jt=0;jt1)for(const jt of _t){const ri=jt*ze;if(!(re[ri+2]<=B)){re[ri+2]=B;for(let bi=0;bi>5}_getOriginZoom(D){return(D-this.points.length)%32}_map(D,B,U){if(D[B+zt]>1){const ae=this.clusterProps[D[B+yi]];return U?Object.assign({},ae):ae}const G=this.points[D[B+ei]].properties,oe=this.options.map(G);return U&&oe===G?Object.assign({},oe):oe}}function ki(Y,D,B){return{type:"Feature",id:Y[D+ei],properties:vi(Y,D,B),geometry:{type:"Point",coordinates:[(U=Y[D],360*(U-.5)),Tt(Y[D+1])]}};var U}function vi(Y,D,B){const U=Y[D+zt],G=U>=1e4?`${Math.round(U/1e3)}k`:U>=1e3?Math.round(U/100)/10+"k":U,oe=Y[D+yi],ae=oe===-1?{}:Object.assign({},B[oe]);return Object.assign(ae,{cluster:!0,cluster_id:Y[D+ei],point_count:U,point_count_abbreviated:G})}function xi(Y){return Y/360+.5}function He(Y){const D=Math.sin(Y*Math.PI/180),B=.5-.25*Math.log((1+D)/(1-D))/Math.PI;return B<0?0:B>1?1:B}function Tt(Y){const D=(180-360*Y)*Math.PI/180;return 360*Math.atan(Math.exp(D))/Math.PI-90}function Nt(Y,D,B,U){for(var G,oe=U,ae=B-D>>1,ue=B-D,re=Y[D],pe=Y[D+1],ze=Y[B],Ce=Y[B+1],Me=D+3;Meoe)G=Me,oe=mt;else if(mt===oe){var _t=Math.abs(Me-ae);_tU&&(G-D>3&&Nt(Y,D,G,U),Y[G+2]=oe,B-G>3&&Nt(Y,G,B,U))}function Ni(Y,D,B,U,G,oe){var ae=G-B,ue=oe-U;if(ae!==0||ue!==0){var re=((Y-B)*ae+(D-U)*ue)/(ae*ae+ue*ue);re>1?(B=G,U=oe):re>0&&(B+=ae*re,U+=ue*re)}return(ae=Y-B)*ae+(ue=D-U)*ue}function Ur(Y,D,B,U){var G={id:Y===void 0?null:Y,type:D,geometry:B,tags:U,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(oe){var ae=oe.geometry,ue=oe.type;if(ue==="Point"||ue==="MultiPoint"||ue==="LineString")$e(oe,ae);else if(ue==="Polygon"||ue==="MultiLineString")for(var re=0;re0&&(ae+=U?(G*pe-re*oe)/2:Math.sqrt(Math.pow(re-G,2)+Math.pow(pe-oe,2))),G=re,oe=pe}var ze=D.length-3;D[2]=1,Nt(D,0,ze,B),D[ze+2]=1,D.size=Math.abs(ae),D.start=0,D.end=D.size}function we(Y,D,B,U){for(var G=0;G1?1:B}function Ut(Y,D,B,U,G,oe,ae,ue){if(U/=D,oe>=(B/=D)&&ae=U)return null;for(var re=[],pe=0;pe=B&&_t=U)){var Mt=[];if(Me==="Point"||Me==="MultiPoint")or(Ce,Mt,B,U,G);else if(Me==="LineString")yn(Ce,Mt,B,U,G,!1,ue.lineMetrics);else if(Me==="MultiLineString")Ts(Ce,Mt,B,U,G,!1);else if(Me==="Polygon")Ts(Ce,Mt,B,U,G,!0);else if(Me==="MultiPolygon")for(var bt=0;bt=B&&ae<=U&&(D.push(Y[oe]),D.push(Y[oe+1]),D.push(Y[oe+2]))}}function yn(Y,D,B,U,G,oe,ae){for(var ue,re,pe=Ss(Y),ze=G===0?Qn:ko,Ce=Y.start,Me=0;MeB&&(re=ze(pe,mt,_t,bt,jt,B),ae&&(pe.start=Ce+ue*re)):ri>U?bi=B&&(re=ze(pe,mt,_t,bt,jt,B),ji=!0),bi>U&&ri<=U&&(re=ze(pe,mt,_t,bt,jt,U),ji=!0),!oe&&ji&&(ae&&(pe.end=Ce+ue*re),D.push(pe),pe=Ss(Y)),ae&&(Ce+=ue)}var Et=Y.length-3;mt=Y[Et],_t=Y[Et+1],Mt=Y[Et+2],(ri=G===0?mt:_t)>=B&&ri<=U&&Is(pe,mt,_t,Mt),Et=pe.length-3,oe&&Et>=3&&(pe[Et]!==pe[0]||pe[Et+1]!==pe[1])&&Is(pe,pe[0],pe[1],pe[2]),pe.length&&D.push(pe)}function Ss(Y){var D=[];return D.size=Y.size,D.start=Y.start,D.end=Y.end,D}function Ts(Y,D,B,U,G,oe){for(var ae=0;aeae.maxX&&(ae.maxX=ze),Ce>ae.maxY&&(ae.maxY=Ce)}return ae}function hr(Y,D,B,U){var G=D.geometry,oe=D.type,ae=[];if(oe==="Point"||oe==="MultiPoint")for(var ue=0;ue0&&D.size<(G?ae:U))B.numPoints+=D.length/3;else{for(var ue=[],re=0;reae)&&(B.numSimplified++,ue.push(D[re]),ue.push(D[re+1])),B.numPoints++;G&&function(pe,ze){for(var Ce=0,Me=0,mt=pe.length,_t=mt-2;Me0===ze)for(Me=0,mt=pe.length;Me24)throw new Error("maxZoom should be in the 0-24 range");if(D.promoteId&&D.generateId)throw new Error("promoteId and generateId cannot be used together.");var U=function(G,oe){var ae=[];if(G.type==="FeatureCollection")for(var ue=0;ue1&&console.time("creation"),Me=this.tiles[Ce]=Ws(Y,D,B,U,re),this.tileCoords.push({z:D,x:B,y:U}),pe)){pe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",D,B,U,Me.numFeatures,Me.numPoints,Me.numSimplified),console.timeEnd("creation"));var mt="z"+D;this.stats[mt]=(this.stats[mt]||0)+1,this.total++}if(Me.source=Y,G){if(D===re.maxZoom||D===G)continue;var _t=1<1&&console.time("clipping");var Mt,bt,jt,ri,bi,ji,Et=.5*re.buffer/re.extent,Ci=.5-Et,Hi=.5+Et,xr=1+Et;Mt=bt=jt=ri=null,bi=Ut(Y,ze,B-Et,B+Hi,0,Me.minX,Me.maxX,re),ji=Ut(Y,ze,B+Ci,B+xr,0,Me.minX,Me.maxX,re),Y=null,bi&&(Mt=Ut(bi,ze,U-Et,U+Hi,1,Me.minY,Me.maxY,re),bt=Ut(bi,ze,U+Ci,U+xr,1,Me.minY,Me.maxY,re),bi=null),ji&&(jt=Ut(ji,ze,U-Et,U+Hi,1,Me.minY,Me.maxY,re),ri=Ut(ji,ze,U+Ci,U+xr,1,Me.minY,Me.maxY,re),ji=null),pe>1&&console.timeEnd("clipping"),ue.push(Mt||[],D+1,2*B,2*U),ue.push(bt||[],D+1,2*B,2*U+1),ue.push(jt||[],D+1,2*B+1,2*U),ue.push(ri||[],D+1,2*B+1,2*U+1)}}},Lt.prototype.getTile=function(Y,D,B){var U=this.options,G=U.extent,oe=U.debug;if(Y<0||Y>24)return null;var ae=1<1&&console.log("drilling down to z%d-%d-%d",Y,D,B);for(var re,pe=Y,ze=D,Ce=B;!re&&pe>0;)pe--,ze=Math.floor(ze/2),Ce=Math.floor(Ce/2),re=this.tiles[At(pe,ze,Ce)];return re&&re.source?(oe>1&&console.log("found parent tile z%d-%d-%d",pe,ze,Ce),oe>1&&console.time("drilling down"),this.splitTile(re.source,pe,ze,Ce,Y,D,B),oe>1&&console.timeEnd("drilling down"),this.tiles[ue]?vn(this.tiles[ue],G):null):null};class es extends j{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(D,B){return x._(this,void 0,void 0,function*(){const U=D.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const G=this._geoJSONIndex.getTile(U.z,U.x,U.y);if(!G)return null;const oe=new class{constructor(ue){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=x.W,this.length=ue.length,this._features=ue}feature(ue){return new class{constructor(re){this._feature=re,this.extent=x.W,this.type=re.type,this.properties=re.tags,"id"in re&&!isNaN(re.id)&&(this.id=parseInt(re.id,10))}loadGeometry(){if(this._feature.type===1){const re=[];for(const pe of this._feature.geometry)re.push([new x.P(pe[0],pe[1])]);return re}{const re=[];for(const pe of this._feature.geometry){const ze=[];for(const Ce of pe)ze.push(new x.P(Ce[0],Ce[1]));re.push(ze)}return re}}toGeoJSON(re,pe,ze){return ye.call(this,re,pe,ze)}}(this._features[ue])}}(G.features);let ae=ut(oe);return ae.byteOffset===0&&ae.byteLength===ae.buffer.byteLength||(ae=new Uint8Array(ae)),{vectorTile:oe,rawData:ae.buffer}})}loadData(D){var B;return x._(this,void 0,void 0,function*(){(B=this._pendingRequest)===null||B===void 0||B.abort();const U=!!(D&&D.request&&D.request.collectResourceTiming)&&new x.br(D.request);this._pendingRequest=new AbortController;try{let G=yield this.loadGeoJSON(D,this._pendingRequest);if(delete this._pendingRequest,typeof G!="object")throw new Error(`Input data given to '${D.source}' is not a valid GeoJSON object.`);if(Te(G,!0),D.filter){const ae=x.bx(D.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ae.result==="error")throw new Error(ae.value.map(re=>`${re.key}: ${re.message}`).join(", "));G={type:"FeatureCollection",features:G.features.filter(re=>ae.value.evaluate({zoom:0},re))}}this._geoJSONIndex=D.cluster?new hi(function({superclusterOptions:ae,clusterProperties:ue}){if(!ue||!ae)return ae;const re={},pe={},ze={accumulated:null,zoom:0},Ce={properties:null},Me=Object.keys(ue);for(const mt of Me){const[_t,Mt]=ue[mt],bt=x.bx(Mt),jt=x.bx(typeof _t=="string"?[_t,["accumulated"],["get",mt]]:_t);re[mt]=bt.value,pe[mt]=jt.value}return ae.map=mt=>{Ce.properties=mt;const _t={};for(const Mt of Me)_t[Mt]=re[Mt].evaluate(ze,Ce);return _t},ae.reduce=(mt,_t)=>{Ce.properties=_t;for(const Mt of Me)ze.accumulated=mt[Mt],mt[Mt]=pe[Mt].evaluate(ze,Ce)},ae}(D)).load(G.features):function(ae,ue){return new Lt(ae,ue)}(G,D.geojsonVtOptions),this.loaded={};const oe={};if(U){const ae=U.finish();ae&&(oe.resourceTiming={},oe.resourceTiming[D.source]=JSON.parse(JSON.stringify(ae)))}return oe}catch(G){if(delete this._pendingRequest,x.by(G))return{abandoned:!0};throw G}})}reloadTile(D){const B=this.loaded;return B&&B[D.uid]?super.reloadTile(D):this.loadTile(D)}loadGeoJSON(D,B){return x._(this,void 0,void 0,function*(){const{promoteId:U}=D;if(D.request){const G=yield x.h(D.request,B);return this._dataUpdateable=xn(G.data,U)?Ct(G.data,U):void 0,G.data}if(typeof D.data=="string")try{const G=JSON.parse(D.data);return this._dataUpdateable=xn(G,U)?Ct(G,U):void 0,G}catch{throw new Error(`Input data given to '${D.source}' is not a valid GeoJSON object.`)}if(!D.dataDiff)throw new Error(`Input data given to '${D.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${D.source}`);return function(G,oe,ae){var ue,re,pe,ze;if(oe.removeAll&&G.clear(),oe.remove)for(const Ce of oe.remove)G.delete(Ce);if(oe.add)for(const Ce of oe.add){const Me=Ui(Ce,ae);Me!=null&&G.set(Me,Ce)}if(oe.update)for(const Ce of oe.update){let Me=G.get(Ce.id);if(Me==null)continue;const mt=!Ce.removeAllProperties&&(((ue=Ce.removeProperties)===null||ue===void 0?void 0:ue.length)>0||((re=Ce.addOrUpdateProperties)===null||re===void 0?void 0:re.length)>0);if((Ce.newGeometry||Ce.removeAllProperties||mt)&&(Me=Object.assign({},Me),G.set(Ce.id,Me),mt&&(Me.properties=Object.assign({},Me.properties))),Ce.newGeometry&&(Me.geometry=Ce.newGeometry),Ce.removeAllProperties)Me.properties={};else if(((pe=Ce.removeProperties)===null||pe===void 0?void 0:pe.length)>0)for(const _t of Ce.removeProperties)Object.prototype.hasOwnProperty.call(Me.properties,_t)&&delete Me.properties[_t];if(((ze=Ce.addOrUpdateProperties)===null||ze===void 0?void 0:ze.length)>0)for(const{key:_t,value:Mt}of Ce.addOrUpdateProperties)Me.properties[_t]=Mt}}(this._dataUpdateable,D.dataDiff,U),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(D){return x._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(D){return this._geoJSONIndex.getClusterExpansionZoom(D.clusterId)}getClusterChildren(D){return this._geoJSONIndex.getChildren(D.clusterId)}getClusterLeaves(D){return this._geoJSONIndex.getLeaves(D.clusterId,D.limit,D.offset)}}class Gi{constructor(D){this.self=D,this.actor=new x.C(D),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(B,U)=>{if(this.externalWorkerSourceTypes[B])throw new Error(`Worker source with name "${B}" already registered.`);this.externalWorkerSourceTypes[B]=U},this.self.addProtocol=x.be,this.self.removeProtocol=x.bf,this.self.registerRTLTextPlugin=B=>{if(x.bz.isParsed())throw new Error("RTL text plugin already registered.");x.bz.setMethods(B)},this.actor.registerMessageHandler("loadDEMTile",(B,U)=>this._getDEMWorkerSource(B,U.source).loadTile(U)),this.actor.registerMessageHandler("removeDEMTile",(B,U)=>x._(this,void 0,void 0,function*(){this._getDEMWorkerSource(B,U.source).removeTile(U)})),this.actor.registerMessageHandler("getClusterExpansionZoom",(B,U)=>x._(this,void 0,void 0,function*(){return this._getWorkerSource(B,U.type,U.source).getClusterExpansionZoom(U)})),this.actor.registerMessageHandler("getClusterChildren",(B,U)=>x._(this,void 0,void 0,function*(){return this._getWorkerSource(B,U.type,U.source).getClusterChildren(U)})),this.actor.registerMessageHandler("getClusterLeaves",(B,U)=>x._(this,void 0,void 0,function*(){return this._getWorkerSource(B,U.type,U.source).getClusterLeaves(U)})),this.actor.registerMessageHandler("loadData",(B,U)=>this._getWorkerSource(B,U.type,U.source).loadData(U)),this.actor.registerMessageHandler("loadTile",(B,U)=>this._getWorkerSource(B,U.type,U.source).loadTile(U)),this.actor.registerMessageHandler("reloadTile",(B,U)=>this._getWorkerSource(B,U.type,U.source).reloadTile(U)),this.actor.registerMessageHandler("abortTile",(B,U)=>this._getWorkerSource(B,U.type,U.source).abortTile(U)),this.actor.registerMessageHandler("removeTile",(B,U)=>this._getWorkerSource(B,U.type,U.source).removeTile(U)),this.actor.registerMessageHandler("removeSource",(B,U)=>x._(this,void 0,void 0,function*(){if(!this.workerSources[B]||!this.workerSources[B][U.type]||!this.workerSources[B][U.type][U.source])return;const G=this.workerSources[B][U.type][U.source];delete this.workerSources[B][U.type][U.source],G.removeSource!==void 0&&G.removeSource(U)})),this.actor.registerMessageHandler("setReferrer",(B,U)=>x._(this,void 0,void 0,function*(){this.referrer=U})),this.actor.registerMessageHandler("syncRTLPluginState",(B,U)=>this._syncRTLPluginState(B,U)),this.actor.registerMessageHandler("importScript",(B,U)=>x._(this,void 0,void 0,function*(){this.self.importScripts(U)})),this.actor.registerMessageHandler("setImages",(B,U)=>this._setImages(B,U)),this.actor.registerMessageHandler("updateLayers",(B,U)=>x._(this,void 0,void 0,function*(){this._getLayerIndex(B).update(U.layers,U.removedIds)})),this.actor.registerMessageHandler("setLayers",(B,U)=>x._(this,void 0,void 0,function*(){this._getLayerIndex(B).replace(U)}))}_setImages(D,B){return x._(this,void 0,void 0,function*(){this.availableImages[D]=B;for(const U in this.workerSources[D]){const G=this.workerSources[D][U];for(const oe in G)G[oe].availableImages=B}})}_syncRTLPluginState(D,B){return x._(this,void 0,void 0,function*(){x.bz.setState(B);const U=x.bz.getPluginURL();if(B.pluginStatus==="loaded"&&!x.bz.isParsed()&&U!=null){this.self.importScripts(U);const G=x.bz.isParsed();if(G)return G;throw new Error(`RTL Text Plugin failed to import scripts from ${U}`)}return!1})}_getAvailableImages(D){let B=this.availableImages[D];return B||(B=[]),B}_getLayerIndex(D){let B=this.layerIndexes[D];return B||(B=this.layerIndexes[D]=new a),B}_getWorkerSource(D,B,U){if(this.workerSources[D]||(this.workerSources[D]={}),this.workerSources[D][B]||(this.workerSources[D][B]={}),!this.workerSources[D][B][U]){const G={sendAsync:(oe,ae)=>(oe.targetMapId=D,this.actor.sendAsync(oe,ae))};switch(B){case"vector":this.workerSources[D][B][U]=new j(G,this._getLayerIndex(D),this._getAvailableImages(D));break;case"geojson":this.workerSources[D][B][U]=new es(G,this._getLayerIndex(D),this._getAvailableImages(D));break;default:this.workerSources[D][B][U]=new this.externalWorkerSourceTypes[B](G,this._getLayerIndex(D),this._getAvailableImages(D))}}return this.workerSources[D][B][U]}_getDEMWorkerSource(D,B){return this.demWorkerSources[D]||(this.demWorkerSources[D]={}),this.demWorkerSources[D][B]||(this.demWorkerSources[D][B]=new X),this.demWorkerSources[D][B]}}return x.i(self)&&(self.worker=new Gi(self)),Gi}),y("index",["exports","./shared"],function(x,a){var M="4.0.1";let L,F;const j={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:d=>new Promise((t,n)=>{const o=requestAnimationFrame(t);d.signal.addEventListener("abort",()=>{cancelAnimationFrame(o),n(a.c())})}),getImageData(d,t=0){return this.getImageCanvasContext(d).getImageData(-t,-t,d.width+2*t,d.height+2*t)},getImageCanvasContext(d){const t=window.document.createElement("canvas"),n=t.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return t.width=d.width,t.height=d.height,n.drawImage(d,0,0,d.width,d.height),n},resolveURL:d=>(L||(L=document.createElement("a")),L.href=d,L.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(F==null&&(F=matchMedia("(prefers-reduced-motion: reduce)")),F.matches)}};class X{static testProp(t){if(!X.docStyle)return t[0];for(let n=0;n{window.removeEventListener("click",X.suppressClickInternal,!0)},0)}static getScale(t){const n=t.getBoundingClientRect();return{x:n.width/t.offsetWidth||1,y:n.height/t.offsetHeight||1,boundingClientRect:n}}static getPoint(t,n,o){const u=n.boundingClientRect;return new a.P((o.clientX-u.left)/n.x-t.clientLeft,(o.clientY-u.top)/n.y-t.clientTop)}static mousePos(t,n){const o=X.getScale(t);return X.getPoint(t,o,n)}static touchPos(t,n){const o=[],u=X.getScale(t);for(let m=0;m{t=[],n=0,o=0,u={}},d.addThrottleControl=I=>{const C=o++;return u[C]=I,C},d.removeThrottleControl=I=>{delete u[I],w()},d.getImage=(I,C,P=!0)=>new Promise((z,V)=>{Ie.supported&&(I.headers||(I.headers={}),I.headers.accept="image/webp,*/*"),a.e(I,{type:"image"}),t.push({abortController:C,requestParameters:I,supportImageRefresh:P,state:"queued",onError:H=>{V(H)},onSuccess:H=>{z(H)}}),w()});const m=I=>a._(this,void 0,void 0,function*(){I.state="running";const{requestParameters:C,supportImageRefresh:P,onError:z,onSuccess:V,abortController:H}=I,W=P===!1&&!a.i(self)&&!a.g(C.url)&&(!C.headers||Object.keys(C.headers).reduce((se,fe)=>se&&fe==="accept",!0));n++;const J=W?T(C,H):a.m(C,H);try{const se=yield J;delete I.abortController,I.state="completed",se.data instanceof HTMLImageElement||a.b(se.data)?V(se):se.data&&V({data:yield(Z=se.data,typeof createImageBitmap=="function"?a.d(Z):a.f(Z)),cacheControl:se.cacheControl,expires:se.expires})}catch(se){delete I.abortController,z(se)}finally{n--,w()}var Z}),w=()=>{const I=(()=>{for(const C of Object.keys(u))if(u[C]())return!0;return!1})()?a.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:a.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let C=n;C0;C++){const P=t.shift();P.abortController.signal.aborted?C--:m(P)}},T=(I,C)=>new Promise((P,z)=>{const V=new Image,H=I.url,W=I.credentials;W&&W==="include"?V.crossOrigin="use-credentials":(W&&W==="same-origin"||!a.s(H))&&(V.crossOrigin="anonymous"),C.signal.addEventListener("abort",()=>{V.src="",z(a.c())}),V.fetchPriority="high",V.onload=()=>{V.onerror=V.onload=null,P({data:V})},V.onerror=()=>{V.onerror=V.onload=null,C.signal.aborted||z(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."))},V.src=H})}($||($={})),$.resetRequestQueue(),function(d){d.Glyphs="Glyphs",d.Image="Image",d.Source="Source",d.SpriteImage="SpriteImage",d.SpriteJSON="SpriteJSON",d.Style="Style",d.Tile="Tile",d.Unknown="Unknown"}(ne||(ne={}));class me{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,o){const u=function(m){const w=m.match(Ue);if(!w)throw new Error(`Unable to parse URL "${m}"`);return{protocol:w[1],authority:w[2],path:w[3]||"/",params:w[4]?w[4].split("&"):[]}}(t);return u.path+=`${n}${o}`,function(m){const w=m.params.length?`?${m.params.join("&")}`:"";return`${m.protocol}://${m.authority}${m.path}${w}`}(u)}setTransformRequest(t){this._transformRequestFn=t}}const Ue=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ee(d){var t=new a.A(3);return t[0]=d[0],t[1]=d[1],t[2]=d[2],t}var be,Se=function(d,t,n){return d[0]=t[0]-n[0],d[1]=t[1]-n[1],d[2]=t[2]-n[2],d};be=new a.A(3),a.A!=Float32Array&&(be[0]=0,be[1]=0,be[2]=0);var at=function(d){var t=d[0],n=d[1];return t*t+n*n};function ge(d){const t=[];if(typeof d=="string")t.push({id:"default",url:d});else if(d&&d.length>0){const n=[];for(const{id:o,url:u}of d){const m=`${o}${u}`;n.indexOf(m)===-1&&(n.push(m),t.push({id:o,url:u}))}}return t}(function(){var d=new a.A(2);a.A!=Float32Array&&(d[0]=0,d[1]=0)})();class De{constructor(t,n,o,u){this.context=t,this.format=o,this.texture=t.gl.createTexture(),this.update(n,u)}update(t,n,o){const{width:u,height:m}=t,w=!(this.size&&this.size[0]===u&&this.size[1]===m||o),{context:T}=this,{gl:I}=T;if(this.useMipmap=!!(n&&n.useMipmap),I.bindTexture(I.TEXTURE_2D,this.texture),T.pixelStoreUnpackFlipY.set(!1),T.pixelStoreUnpack.set(1),T.pixelStoreUnpackPremultiplyAlpha.set(this.format===I.RGBA&&(!n||n.premultiply!==!1)),w)this.size=[u,m],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||a.b(t)?I.texImage2D(I.TEXTURE_2D,0,this.format,this.format,I.UNSIGNED_BYTE,t):I.texImage2D(I.TEXTURE_2D,0,this.format,u,m,0,this.format,I.UNSIGNED_BYTE,t.data);else{const{x:C,y:P}=o||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||a.b(t)?I.texSubImage2D(I.TEXTURE_2D,0,C,P,I.RGBA,I.UNSIGNED_BYTE,t):I.texSubImage2D(I.TEXTURE_2D,0,C,P,u,m,I.RGBA,I.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&I.generateMipmap(I.TEXTURE_2D)}bind(t,n,o){const{context:u}=this,{gl:m}=u;m.bindTexture(m.TEXTURE_2D,this.texture),o!==m.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(o=m.LINEAR),t!==this.filter&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,t),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,o||t),this.filter=t),n!==this.wrap&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,n),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function ft(d){const{userImage:t}=d;return!!(t&&t.render&&t.render())&&(d.data.replace(new Uint8Array(t.data.buffer)),!0)}class kt extends a.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new a.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:n,promiseResolve:o}of this.requestors)o(this._getImagesForIds(n));this.requestors=[]}}getImage(t){const n=this.images[t];if(n&&!n.data&&n.spriteData){const o=n.spriteData;n.data=new a.R({width:o.width,height:o.height},o.context.getImageData(o.x,o.y,o.width,o.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let o=!0;const u=n.data||n.spriteData;return this._validateStretch(n.stretchX,u&&u.width)||(this.fire(new a.j(new Error(`Image "${t}" has invalid "stretchX" value`))),o=!1),this._validateStretch(n.stretchY,u&&u.height)||(this.fire(new a.j(new Error(`Image "${t}" has invalid "stretchY" value`))),o=!1),this._validateContent(n.content,n)||(this.fire(new a.j(new Error(`Image "${t}" has invalid "content" value`))),o=!1),o}_validateStretch(t,n){if(!t)return!0;let o=0;for(const u of t){if(u[0]{let u=!0;if(!this.isLoaded())for(const m of t)this.images[m]||(u=!1);this.isLoaded()||u?n(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:n})})}_getImagesForIds(t){const n={};for(const o of t){let u=this.getImage(o);u||(this.fire(new a.k("styleimagemissing",{id:o})),u=this.getImage(o)),u?n[o]={data:u.data.clone(),pixelRatio:u.pixelRatio,sdf:u.sdf,version:u.version,stretchX:u.stretchX,stretchY:u.stretchY,content:u.content,hasRenderCallback:!!(u.userImage&&u.userImage.render)}:a.w(`Image "${o}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return n}getPixelSize(){const{width:t,height:n}=this.atlasImage;return{width:t,height:n}}getPattern(t){const n=this.patterns[t],o=this.getImage(t);if(!o)return null;if(n&&n.position.version===o.version)return n.position;if(n)n.position.version=o.version;else{const u={w:o.data.width+2,h:o.data.height+2,x:0,y:0},m=new a.I(u,o);this.patterns[t]={bin:u,position:m}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const n=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new De(t,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const m in this.patterns)t.push(this.patterns[m].bin);const{w:n,h:o}=a.p(t),u=this.atlasImage;u.resize({width:n||1,height:o||1});for(const m in this.patterns){const{bin:w}=this.patterns[m],T=w.x+1,I=w.y+1,C=this.getImage(m).data,P=C.width,z=C.height;a.R.copy(C,u,{x:0,y:0},{x:T,y:I},{width:P,height:z}),a.R.copy(C,u,{x:0,y:z-1},{x:T,y:I-1},{width:P,height:1}),a.R.copy(C,u,{x:0,y:0},{x:T,y:I+z},{width:P,height:1}),a.R.copy(C,u,{x:P-1,y:0},{x:T-1,y:I},{width:1,height:z}),a.R.copy(C,u,{x:0,y:0},{x:T+P,y:I},{width:1,height:z})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const n of t){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const o=this.getImage(n);o||a.w(`Image with ID: "${n}" was not found`),ft(o)&&this.updateImage(n,o)}}}const $t=1e20;function nt(d,t,n,o,u,m,w,T,I){for(let C=t;C-1);I++,m[I]=T,w[I]=C,w[I+1]=$t}for(let T=0,I=0;T65535)throw new Error("glyphs > 65535 not supported");if(o.ranges[m])return{stack:t,id:n,glyph:u};if(!this.url)throw new Error("glyphsUrl is not set");if(!o.requests[m]){const T=Vt.loadGlyphRange(t,m,this.url,this.requestManager);o.requests[m]=T}const w=yield o.requests[m];for(const T in w)this._doesCharSupportLocalGlyph(+T)||(o.glyphs[+T]=w[+T]);return o.ranges[m]=!0,{stack:t,id:n,glyph:w[n]||null}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(a.u["CJK Unified Ideographs"](t)||a.u["Hangul Syllables"](t)||a.u.Hiragana(t)||a.u.Katakana(t))}_tinySDF(t,n,o){const u=this.localIdeographFontFamily;if(!u||!this._doesCharSupportLocalGlyph(o))return;let m=t.tinySDF;if(!m){let T="400";/bold/i.test(n)?T="900":/medium/i.test(n)?T="500":/light/i.test(n)&&(T="200"),m=t.tinySDF=new Vt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:u,fontWeight:T})}const w=m.draw(String.fromCharCode(o));return{id:o,bitmap:new a.o({width:w.width||60,height:w.height||60},w.data),metrics:{width:w.glyphWidth/2||24,height:w.glyphHeight/2||24,left:w.glyphLeft/2+.5||0,top:w.glyphTop/2-27.5||-8,advance:w.glyphAdvance/2||24,isDoubleResolution:!0}}}}Vt.loadGlyphRange=function(d,t,n,o){return a._(this,void 0,void 0,function*(){const u=256*t,m=u+255,w=o.transformRequest(n.replace("{fontstack}",d).replace("{range}",`${u}-${m}`),ne.Glyphs),T=yield a.l(w,new AbortController);if(!T||!T.data)throw new Error(`Could not load glyph range. range: ${t}, ${u}-${m}`);const I={};for(const C of a.n(T.data))I[C.id]=C;return I})},Vt.TinySDF=class{constructor({fontSize:d=24,buffer:t=3,radius:n=8,cutoff:o=.25,fontFamily:u="sans-serif",fontWeight:m="normal",fontStyle:w="normal"}={}){this.buffer=t,this.cutoff=o,this.radius=n;const T=this.size=d+4*t,I=this._createCanvas(T),C=this.ctx=I.getContext("2d",{willReadFrequently:!0});C.font=`${w} ${m} ${d}px ${u}`,C.textBaseline="alphabetic",C.textAlign="left",C.fillStyle="black",this.gridOuter=new Float64Array(T*T),this.gridInner=new Float64Array(T*T),this.f=new Float64Array(T),this.z=new Float64Array(T+1),this.v=new Uint16Array(T)}_createCanvas(d){const t=document.createElement("canvas");return t.width=t.height=d,t}draw(d){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:o,actualBoundingBoxLeft:u,actualBoundingBoxRight:m}=this.ctx.measureText(d),w=Math.ceil(n),T=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(m-u))),I=Math.min(this.size-this.buffer,w+Math.ceil(o)),C=T+2*this.buffer,P=I+2*this.buffer,z=Math.max(C*P,0),V=new Uint8ClampedArray(z),H={data:V,width:C,height:P,glyphWidth:T,glyphHeight:I,glyphTop:w,glyphLeft:0,glyphAdvance:t};if(T===0||I===0)return H;const{ctx:W,buffer:J,gridInner:Z,gridOuter:se}=this;W.clearRect(J,J,T,I),W.fillText(d,J,J+w);const fe=W.getImageData(J,J,T,I);se.fill($t,0,z),Z.fill(0,0,z);for(let ee=0;ee0?Ae*Ae:0,Z[_e]=Ae<0?Ae*Ae:0}}nt(se,0,0,C,P,C,this.f,this.v,this.z),nt(Z,J,J,T,I,C,this.f,this.v,this.z);for(let ee=0;ee1&&(I=t[++T]);const P=Math.abs(C-I.left),z=Math.abs(C-I.right),V=Math.min(P,z);let H;const W=m/o*(u+1);if(I.isDash){const J=u-Math.abs(W);H=Math.sqrt(V*V+J*J)}else H=u-Math.sqrt(V*V+W*W);this.data[w+C]=Math.max(0,Math.min(255,H+128))}}}addRegularDash(t){for(let T=t.length-1;T>=0;--T){const I=t[T],C=t[T+1];I.zeroLength?t.splice(T,1):C&&C.isDash===I.isDash&&(C.left=I.left,t.splice(T,1))}const n=t[0],o=t[t.length-1];n.isDash===o.isDash&&(n.left=o.left-this.width,o.right=n.right+this.width);const u=this.width*this.nextRow;let m=0,w=t[m];for(let T=0;T1&&(w=t[++m]);const I=Math.abs(T-w.left),C=Math.abs(T-w.right),P=Math.min(I,C);this.data[u+T]=Math.max(0,Math.min(255,(w.isDash?P:-P)+128))}}addDash(t,n){const o=n?7:0,u=2*o+1;if(this.nextRow+u>this.height)return a.w("LineAtlas out of space"),null;let m=0;for(let T=0;T{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[yi]}numActive(){return Object.keys(this.active).length}}const ki=Math.floor(j.hardwareConcurrency/2);let vi,xi;function He(){return vi||(vi=new hi),vi}hi.workerCount=a.B(globalThis)?Math.max(Math.min(ki,3),1):1;class Tt{constructor(t,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=n;const o=this.workerPool.acquire(n);for(let u=0;u{n.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,n){for(const o of this.actors)o.registerMessageHandler(t,n)}}function Nt(){return xi||(xi=new Tt(He(),a.G),xi.registerMessageHandler("getResource",(d,t,n)=>a.m(t,n))),xi}function Ni(d,t){const n=a.F();return a.H(n,n,[1,1,0]),a.J(n,n,[.5*d.width,.5*d.height,1]),a.K(n,n,d.calculatePosMatrix(t.toUnwrapped()))}function Ur(d,t,n,o,u,m){const w=function(z,V,H){if(z)for(const W of z){const J=V[W];if(J&&J.source===H&&J.type==="fill-extrusion")return!0}else for(const W in V){const J=V[W];if(J.source===H&&J.type==="fill-extrusion")return!0}return!1}(u&&u.layers,t,d.id),T=m.maxPitchScaleFactor(),I=d.tilesIn(o,T,w);I.sort($e);const C=[];for(const z of I)C.push({wrappedTileID:z.tileID.wrapped().key,queryResults:z.tile.queryRenderedFeatures(t,n,d._state,z.queryGeometry,z.cameraQueryGeometry,z.scale,u,m,T,Ni(d.transform,z.tileID))});const P=function(z){const V={},H={};for(const W of z){const J=W.queryResults,Z=W.wrappedTileID,se=H[Z]=H[Z]||{};for(const fe in J){const ee=J[fe],ce=se[fe]=se[fe]||{},ve=V[fe]=V[fe]||[];for(const _e of ee)ce[_e.featureIndex]||(ce[_e.featureIndex]=!0,ve.push(_e))}}return V}(C);for(const z in P)P[z].forEach(V=>{const H=V.feature,W=d.getFeatureState(H.layer["source-layer"],H.id);H.source=H.layer.source,H.layer["source-layer"]&&(H.sourceLayer=H.layer["source-layer"]),H.state=W});return P}function $e(d,t){const n=d.tileID,o=t.tileID;return n.overscaledZ-o.overscaledZ||n.canonical.y-o.canonical.y||n.wrap-o.wrap||n.canonical.x-o.canonical.x}function Ne(d,t,n){return a._(this,void 0,void 0,function*(){let o=d;if(d.url?o=(yield a.h(t.transformRequest(d.url,ne.Source),n)).data:yield j.frameAsync(n),!o)return null;const u=a.L(a.e(o,d),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in o&&o.vector_layers&&(u.vectorLayerIds=o.vector_layers.map(m=>m.id)),u})}class Qt{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof a.M?new a.M(t.lng,t.lat):a.M.convert(t),this}setSouthWest(t){return this._sw=t instanceof a.M?new a.M(t.lng,t.lat):a.M.convert(t),this}extend(t){const n=this._sw,o=this._ne;let u,m;if(t instanceof a.M)u=t,m=t;else{if(!(t instanceof Qt))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Qt.convert(t)):this.extend(a.M.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(a.M.convert(t)):this;if(u=t._sw,m=t._ne,!u||!m)return this}return n||o?(n.lng=Math.min(u.lng,n.lng),n.lat=Math.min(u.lat,n.lat),o.lng=Math.max(m.lng,o.lng),o.lat=Math.max(m.lat,o.lat)):(this._sw=new a.M(u.lng,u.lat),this._ne=new a.M(m.lng,m.lat)),this}getCenter(){return new a.M((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 a.M(this.getWest(),this.getNorth())}getSouthEast(){return new a.M(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(t){const{lng:n,lat:o}=a.M.convert(t);let u=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=o&&o<=this._ne.lat&&u}static convert(t){return t instanceof Qt?t:t&&new Qt(t)}static fromLngLat(t,n=0){const o=360*n/40075017,u=o/Math.cos(Math.PI/180*t.lat);return new Qt(new a.M(t.lng-u,t.lat-o),new a.M(t.lng+u,t.lat+o))}}class Di{constructor(t,n,o){this.bounds=Qt.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=o||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const n=Math.pow(2,t.z),o=Math.floor(a.N(this.bounds.getWest())*n),u=Math.floor(a.O(this.bounds.getNorth())*n),m=Math.ceil(a.N(this.bounds.getEast())*n),w=Math.ceil(a.O(this.bounds.getSouth())*n);return t.x>=o&&t.x=u&&t.y{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return a.e({},this._options)}loadTile(t){return a._(this,void 0,void 0,function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),o={request:this.map._requestManager.transformRequest(n,ne.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};o.request.collectResourceTiming=this._collectResourceTiming;let u="reloadTile";if(t.actor&&t.state!=="expired"){if(t.state==="loading")return new Promise((m,w)=>{t.reloadPromise={resolve:m,reject:w}})}else t.actor=this.dispatcher.getActor(),u="loadTile";t.abortController=new AbortController;try{const m=yield t.actor.sendAsync({type:u,data:o},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,m)}catch(m){if(delete t.abortController,t.aborted)return;if(m&&m.status!==404)throw m;this._afterTileLoadWorkerResponse(t,null)}})}_afterTileLoadWorkerResponse(t,n){if(n&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&t.setExpiryData(n),t.loadVectorData(n,this.map.painter),t.reloadPromise){const o=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(o.resolve).catch(o.reject)}}abortTile(t){return a._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"abortTile",data:{uid:t.uid,type:this.type,source:this.id}}))})}unloadTile(t){return a._(this,void 0,void 0,function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"removeTile",data:{uid:t.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class ur extends a.E{constructor(t,n,o,u){super(),this.id=t,this.dispatcher=o,this.setEventedParent(u),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a.e({type:"raster"},n),a.e(this,a.L(n,["url","scheme","tileSize"]))}load(){return a._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new a.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield Ne(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,t&&(a.e(this,t),t.bounds&&(this.tileBounds=new Di(t.bounds,this.minzoom,this.maxzoom)),this.fire(new a.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new a.j(t))}})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}serialize(){return a.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return a._(this,void 0,void 0,function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const o=yield $.getImage(this.map._requestManager.transformRequest(n,ne.Tile),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(o&&o.data){this.map._refreshExpiredTiles&&o.cacheControl&&o.expires&&t.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});const u=this.map.painter.context,m=u.gl,w=o.data;t.texture=this.map.painter.getTileTexture(w.width),t.texture?t.texture.update(w,{useMipmap:!0}):(t.texture=new De(u,w,m.RGBA,{useMipmap:!0}),t.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST),u.extTextureFilterAnisotropic&&m.texParameterf(m.TEXTURE_2D,u.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,u.extTextureFilterAnisotropicMax)),t.state="loaded"}}catch(o){if(delete t.abortController,t.aborted)t.state="unloaded";else if(o)throw t.state="errored",o}})}abortTile(t){return a._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)})}unloadTile(t){return a._(this,void 0,void 0,function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)})}hasTransition(){return!1}}class On extends ur{constructor(t,n,o,u){super(t,n,o,u),this.type="raster-dem",this.maxzoom=22,this._options=a.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(t){return a._(this,void 0,void 0,function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),o=this.map._requestManager.transformRequest(n,ne.Tile);t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const u=yield $.getImage(o,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(u&&u.data){const m=u.data;this.map._refreshExpiredTiles&&u.cacheControl&&u.expires&&t.setExpiryData({cacheControl:u.cacheControl,expires:u.expires});const w=a.b(m)&&a.S()?m:yield this.readImageNow(m),T={type:this.type,uid:t.uid,source:this.id,rawImageData:w,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||t.state==="expired"){t.actor=this.dispatcher.getActor();const I=yield t.actor.sendAsync({type:"loadDEMTile",data:T});t.dem=I,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(u){if(delete t.abortController,t.aborted)t.state="unloaded";else if(u)throw t.state="errored",u}})}readImageNow(t){return a._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&a.U()){const n=t.width+2,o=t.height+2;try{return new a.R({width:n,height:o},yield a.V(t,-1,-1,n,o))}catch{}}return j.getImageData(t,1)})}_getNeighboringTiles(t){const n=t.canonical,o=Math.pow(2,n.z),u=(n.x-1+o)%o,m=n.x===0?t.wrap-1:t.wrap,w=(n.x+1+o)%o,T=n.x+1===o?t.wrap+1:t.wrap,I={};return I[new a.Q(t.overscaledZ,m,n.z,u,n.y).key]={backfilled:!1},I[new a.Q(t.overscaledZ,T,n.z,w,n.y).key]={backfilled:!1},n.y>0&&(I[new a.Q(t.overscaledZ,m,n.z,u,n.y-1).key]={backfilled:!1},I[new a.Q(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},I[new a.Q(t.overscaledZ,T,n.z,w,n.y-1).key]={backfilled:!1}),n.y+10&&a.e(m,{resourceTiming:u}),this.fire(new a.k("data",Object.assign(Object.assign({},m),{sourceDataType:"metadata"}))),this.fire(new a.k("data",Object.assign(Object.assign({},m),{sourceDataType:"content"})))}catch(o){if(this._pendingLoads--,this._removed)return void this.fire(new a.k("dataabort",{dataType:"source"}));this.fire(new a.j(o))}})}loaded(){return this._pendingLoads===0}loadTile(t){return a._(this,void 0,void 0,function*(){const n=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const o={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.abortController=new AbortController;const u=yield this.actor.sendAsync({type:n,data:o},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(u,this.map.painter,n==="reloadTile")})}abortTile(t){return a._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return a._(this,void 0,void 0,function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"removeTile",data:{uid:t.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"removeSource",data:{type:this.type,source:this.id}})}serialize(){return a.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var or=a.X([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class yn extends a.E{constructor(t,n,o,u){super(),this.id=t,this.dispatcher=o,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(u),this.options=n}load(t){return a._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new a.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const n=yield $.getImage(this.map._requestManager.transformRequest(this.url,ne.Image),this._request);this._request=null,this._loaded=!0,n&&n.data&&(this.image=n.data,t&&(this.coordinates=t),this._finishLoading())}catch(n){this._request=null,this.fire(new a.j(n))}})}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new a.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const n=t.map(a.Y.fromLngLat);this.tileID=function(u){let m=1/0,w=1/0,T=-1/0,I=-1/0;for(const V of u)m=Math.min(m,V.x),w=Math.min(w,V.y),T=Math.max(T,V.x),I=Math.max(I,V.y);const C=Math.max(T-m,I-w),P=Math.max(0,Math.floor(-Math.log(C)/Math.LN2)),z=Math.pow(2,P);return new a.a0(P,Math.floor((m+T)/2*z),Math.floor((w+I)/2*z))}(n),this.minzoom=this.maxzoom=this.tileID.z;const o=n.map(u=>this.tileID.getTilePoint(u)._round());return this._boundsArray=new a.Z,this._boundsArray.emplaceBack(o[0].x,o[0].y,0,0),this._boundsArray.emplaceBack(o[1].x,o[1].y,a.W,0),this._boundsArray.emplaceBack(o[3].x,o[3].y,0,a.W),this._boundsArray.emplaceBack(o[2].x,o[2].y,a.W,a.W),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new a.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,or.members)),this.boundsSegments||(this.boundsSegments=a.$.simpleSegment(0,0,4,2)),this.texture||(this.texture=new De(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let o=!1;for(const u in this.tiles){const m=this.tiles[u];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,o=!0)}o&&this.fire(new a.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return a._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Ss extends yn{constructor(t,n,o,u){super(t,n,o,u),this.roundZoom=!0,this.type="video",this.options=n}load(){return a._(this,void 0,void 0,function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,ne.Source).url);try{const n=yield a.a2(this.urls);if(this._loaded=!0,!n)return;this.video=n,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(n){this.fire(new a.j(n))}})}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 a.j(new a.a1(`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(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,or.members)),this.boundsSegments||(this.boundsSegments=a.$.simpleSegment(0,0,4,2)),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 De(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let o=!1;for(const u in this.tiles){const m=this.tiles[u];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,o=!0)}o&&this.fire(new a.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Ts extends yn{constructor(t,n,o,u){super(t,n,o,u),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(m=>!Array.isArray(m)||m.length!==2||m.some(w=>typeof w!="number"))||this.fire(new a.j(new a.a1(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.j(new a.a1(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new a.j(new a.a1(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new a.j(new a.a1(`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 a.j(new a.a1(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){return a._(this,void 0,void 0,function*(){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 a.j(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(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){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()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,o=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,or.members)),this.boundsSegments||(this.boundsSegments=a.$.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new De(n,this.canvas,o.RGBA,{premultiply:!0});let u=!1;for(const m in this.tiles){const w=this.tiles[m];w.state!=="loaded"&&(w.state="loaded",w.texture=this.texture,u=!0)}u&&this.fire(new a.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const Is={},Qn=d=>{switch(d){case"geojson":return Ut;case"image":return yn;case"raster":return ur;case"raster-dem":return On;case"vector":return we;case"video":return Ss;case"canvas":return Ts}return Is[d]};class ko extends a.E{constructor(){super(...arguments),this.pluginStatus="unavailable",this.pluginURL=null,this.dispatcher=Nt(),this.queue=[]}_sendPluginStateToWorker(){return a._(this,void 0,void 0,function*(){yield this.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}),this.fire(new a.k("pluginStateChange",{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}))})}getRTLTextPluginStatus(){return this.pluginStatus}clearRTLTextPlugin(){this.pluginStatus="unavailable",this.pluginURL=null}setRTLTextPlugin(t,n=!1){return a._(this,void 0,void 0,function*(){if(this.pluginStatus==="deferred"||this.pluginStatus==="loading"||this.pluginStatus==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");this.pluginURL=j.resolveURL(t),this.pluginStatus="deferred",yield this._sendPluginStateToWorker(),n||(yield this._downloadRTLTextPlugin())})}_downloadRTLTextPlugin(){return a._(this,void 0,void 0,function*(){if(this.pluginStatus!=="deferred"||!this.pluginURL)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");try{this.pluginStatus="loading",yield this._sendPluginStateToWorker(),yield a.l({url:this.pluginURL},new AbortController),this.pluginStatus="loaded"}catch{this.pluginStatus="error"}yield this._sendPluginStateToWorker()})}lazyLoadRTLTextPlugin(){return a._(this,void 0,void 0,function*(){this.pluginStatus==="deferred"&&(yield this._downloadRTLTextPlugin())})}}let $n=null;function We(){return $n||($n=new ko),$n}class vn{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=a.a3(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const n=t+this.timeAdded;nm.getLayer(C)).filter(Boolean);if(I.length!==0){T.layers=I,T.stateDependentLayerIds&&(T.stateDependentLayers=T.stateDependentLayerIds.map(C=>I.filter(P=>P.id===C)[0]));for(const C of I)w[C.id]=T}}return w}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const u in this.buckets){const m=this.buckets[u];if(m instanceof a.a5){if(this.hasSymbolBuckets=!0,!o)break;m.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const m=this.buckets[u];if(m instanceof a.a5&&m.hasRTLText){this.hasRTLText=!0,We().lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const u in this.buckets){const m=this.buckets[u];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(u).queryRadius(m))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new a.a4}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const o in this.buckets){const u=this.buckets[o];u.uploadPending()&&u.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new De(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new De(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,o,u,m,w,T,I,C,P){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:u,cameraQueryGeometry:m,scale:w,tileSize:this.tileSize,pixelPosMatrix:P,transform:I,params:T,queryPadding:this.queryPadding*C},t,n,o):{}}querySourceFeatures(t,n){const o=this.latestFeatureIndex;if(!o||!o.rawTileData)return;const u=o.loadVTLayers(),m=n&&n.sourceLayer?n.sourceLayer:"",w=u._geojsonTileLayer||u[m];if(!w)return;const T=a.a6(n&&n.filter),{z:I,x:C,y:P}=this.tileID.canonical,z={z:I,x:C,y:P};for(let V=0;Vo)u=!1;else if(n)if(this.expirationTime{this.remove(t,m)},o)),this.data[u].push(m),this.order.push(u),this.order.length>this.max){const w=this._getAndRemoveByKey(this.order[0]);w&&this.onRemove(w)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const o=t.wrapped().key,u=n===void 0?0:this.data[o].indexOf(n),m=this.data[o][u];return this.data[o].splice(u,1),m.timeout&&clearTimeout(m.timeout),this.data[o].length===0&&delete this.data[o],this.onRemove(m.value),this.order.splice(this.order.indexOf(o),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const o in this.data)for(const u of this.data[o])t(u.value)||n.push(u);for(const o of n)this.remove(o.value.tileID,o)}}class Ws{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,o){const u=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][u]=this.stateChanges[t][u]||{},a.e(this.stateChanges[t][u],o),this.deletedStates[t]===null){this.deletedStates[t]={};for(const m in this.state[t])m!==u&&(this.deletedStates[t][m]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][u]===null){this.deletedStates[t][u]={};for(const m in this.state[t][u])o[m]||(this.deletedStates[t][u][m]=null)}else for(const m in o)this.deletedStates[t]&&this.deletedStates[t][u]&&this.deletedStates[t][u][m]===null&&delete this.deletedStates[t][u][m]}removeFeatureState(t,n,o){if(this.deletedStates[t]===null)return;const u=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},o&&n!==void 0)this.deletedStates[t][u]!==null&&(this.deletedStates[t][u]=this.deletedStates[t][u]||{},this.deletedStates[t][u][o]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][u])for(o in this.deletedStates[t][u]={},this.stateChanges[t][u])this.deletedStates[t][u][o]=null;else this.deletedStates[t][u]=null;else this.deletedStates[t]=null}getState(t,n){const o=String(n),u=a.e({},(this.state[t]||{})[o],(this.stateChanges[t]||{})[o]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const m=this.deletedStates[t][n];if(m===null)return{};for(const w in m)delete u[w]}return u}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const o={};for(const u in this.stateChanges){this.state[u]=this.state[u]||{};const m={};for(const w in this.stateChanges[u])this.state[u][w]||(this.state[u][w]={}),a.e(this.state[u][w],this.stateChanges[u][w]),m[w]=this.state[u][w];o[u]=m}for(const u in this.deletedStates){this.state[u]=this.state[u]||{};const m={};if(this.deletedStates[u]===null)for(const w in this.state[u])m[w]={},this.state[u][w]={};else for(const w in this.deletedStates[u]){if(this.deletedStates[u][w]===null)this.state[u][w]={};else for(const T of Object.keys(this.deletedStates[u][w]))delete this.state[u][w][T];m[w]=this.state[u][w]}o[u]=o[u]||{},a.e(o[u],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(o).length!==0)for(const u in t)t[u].setFeatureState(o,n)}}class hr extends a.E{constructor(t,n,o){super(),this.id=t,this.dispatcher=o,this.on("data",u=>{u.dataType==="source"&&u.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&u.dataType==="source"&&u.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((u,m,w,T)=>{const I=new(Qn(m.type))(u,m,w,T);if(I.id!==u)throw new Error(`Expected Source id to be ${u} instead of ${I.id}`);return I})(t,n,o,this),this._tiles={},this._cache=new jr(0,u=>this._unloadTile(u)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ws,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const n=this._tiles[t];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,n,o){return a._(this,void 0,void 0,function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,n,o)}catch(u){t.state="errored",u.status!==404?this._source.fire(new a.j(u,{tile:t})):this.update(this.transform,this.terrain)}})}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new a.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const o=this._tiles[n];o.upload(t),o.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(Ye).map(t=>t.key)}getRenderableIds(t){const n=[];for(const o in this._tiles)this._isIdRenderable(o,t)&&n.push(this._tiles[o]);return t?n.sort((o,u)=>{const m=o.tileID,w=u.tileID,T=new a.P(m.canonical.x,m.canonical.y)._rotate(this.transform.angle),I=new a.P(w.canonical.x,w.canonical.y)._rotate(this.transform.angle);return m.overscaledZ-w.overscaledZ||I.y-T.y||I.x-T.x}).map(o=>o.tileID.key):n.map(o=>o.tileID).sort(Ye).map(o=>o.key)}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,n){return a._(this,void 0,void 0,function*(){const o=this._tiles[t];o&&(o.state!=="loading"&&(o.state=n),yield this._loadTile(o,t,n))})}_tileLoaded(t,n,o){t.timeAdded=j.now(),o==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new a.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let u=0;u1||(Math.abs(w)>1&&(Math.abs(w+I)===1?w+=I:Math.abs(w-I)===1&&(w-=I)),m.dem&&u.dem&&(u.dem.backfillBorder(m.dem,w,T),u.neighboringTiles&&u.neighboringTiles[C]&&(u.neighboringTiles[C].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,o,u){for(const m in this._tiles){let w=this._tiles[m];if(u[m]||!w.hasData()||w.tileID.overscaledZ<=n||w.tileID.overscaledZ>o)continue;let T=w.tileID;for(;w&&w.tileID.overscaledZ>n+1;){const C=w.tileID.scaledTo(w.tileID.overscaledZ-1);w=this._tiles[C.key],w&&w.hasData()&&(T=C)}let I=T;for(;I.overscaledZ>n;)if(I=I.scaledTo(I.overscaledZ-1),t[I.key]){u[T.key]=T;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const o=this._loadedParentTiles[t.key];return o&&o.tileID.overscaledZ>=n?o:null}for(let o=t.overscaledZ-1;o>=n;o--){const u=t.scaledTo(o),m=this._getLoadedTile(u);if(m)return m}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,o=Math.ceil(t.height/this._source.tileSize)+1,u=Math.floor(n*o*(this._maxTileCacheZoomLevels===null?a.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),m=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,u):u;this._cache.setMaxSize(m)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const o={};for(const u in this._tiles){const m=this._tiles[u];m.tileID=m.tileID.unwrapTo(m.tileID.wrap+n),o[m.tileID.key]=m}this._tiles=o;for(const u in this._timers)clearTimeout(this._timers[u]),delete this._timers[u];for(const u in this._tiles)this._setTileReloadTimer(u,this._tiles[u])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let o;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?o=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(P=>new a.Q(P.canonical.z,P.wrap,P.canonical.z,P.canonical.x,P.canonical.y)):(o=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(o=o.filter(P=>this._source.hasTile(P)))):o=[];const u=t.coveringZoomLevel(this._source),m=Math.max(u-hr.maxOverzooming,this._source.minzoom),w=Math.max(u+hr.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const P={};for(const z of o)if(z.canonical.z>this._source.minzoom){const V=z.scaledTo(z.canonical.z-1);P[V.key]=V;const H=z.scaledTo(Math.max(this._source.minzoom,Math.min(z.canonical.z,5)));P[H.key]=H}o=o.concat(Object.values(P))}const T=o.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,T&&this.fire(new a.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const I=this._updateRetainedTiles(o,u);if(Lt(this._source.type)){const P={},z={},V=Object.keys(I),H=j.now();for(const W of V){const J=I[W],Z=this._tiles[W];if(!Z||Z.fadeEndTime!==0&&Z.fadeEndTime<=H)continue;const se=this.findLoadedParent(J,m);se&&(this._addTile(se.tileID),P[se.tileID.key]=se.tileID),z[W]=J}this._retainLoadedChildren(z,u,w,I);for(const W in P)I[W]||(this._coveredTiles[W]=!0,I[W]=P[W]);if(n){const W={},J={};for(const Z of o)this._tiles[Z.key].hasData()?W[Z.key]=Z:J[Z.key]=Z;for(const Z in J){const se=J[Z].children(this._source.maxzoom);this._tiles[se[0].key]&&this._tiles[se[1].key]&&this._tiles[se[2].key]&&this._tiles[se[3].key]&&(W[se[0].key]=I[se[0].key]=se[0],W[se[1].key]=I[se[1].key]=se[1],W[se[2].key]=I[se[2].key]=se[2],W[se[3].key]=I[se[3].key]=se[3],delete J[Z])}for(const Z in J){const se=this.findLoadedParent(J[Z],this._source.minzoom);if(se){W[se.tileID.key]=I[se.tileID.key]=se.tileID;for(const fe in W)W[fe].isChildOf(se.tileID)&&delete W[fe]}}for(const Z in this._tiles)W[Z]||(this._coveredTiles[Z]=!0)}}for(const P in I)this._tiles[P].clearFadeHold();const C=a.ab(this._tiles,I);for(const P of C){const z=this._tiles[P];z.hasSymbolBuckets&&!z.holdingForFade()?z.setHoldDuration(this.map._fadeDuration):z.hasSymbolBuckets&&!z.symbolFadeFinished()||this._removeTile(P)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const o={},u={},m=Math.max(n-hr.maxOverzooming,this._source.minzoom),w=Math.max(n+hr.maxUnderzooming,this._source.minzoom),T={};for(const I of t){const C=this._addTile(I);o[I.key]=I,C.hasData()||nthis._source.maxzoom){const z=I.children(this._source.maxzoom)[0],V=this.getTile(z);if(V&&V.hasData()){o[z.key]=z;continue}}else{const z=I.children(this._source.maxzoom);if(o[z[0].key]&&o[z[1].key]&&o[z[2].key]&&o[z[3].key])continue}let P=C.wasRequested();for(let z=I.overscaledZ-1;z>=m;--z){const V=I.scaledTo(z);if(u[V.key])break;if(u[V.key]=!0,C=this.getTile(V),!C&&P&&(C=this._addTile(V)),C){const H=C.hasData();if((P||H)&&(o[V.key]=V),P=C.wasRequested(),H)break}}}return o}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let o,u=this._tiles[t].tileID;for(;u.overscaledZ>0;){if(u.key in this._loadedParentTiles){o=this._loadedParentTiles[u.key];break}n.push(u.key);const m=u.scaledTo(u.overscaledZ-1);if(o=this._getLoadedTile(m),o)break;u=m}for(const m of n)this._loadedParentTiles[m]=o}}_addTile(t){let n=this._tiles[t.key];if(n)return 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 o=n;return n||(n=new vn(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,t.key,n.state)),n.uses++,this._tiles[t.key]=n,o||this._source.fire(new a.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const o=n.getExpiryTimeout();o&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},o))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,o){const u=[],m=this.transform;if(!m)return u;const w=o?m.getCameraQueryGeometry(t):t,T=t.map(W=>m.pointCoordinate(W,this.terrain)),I=w.map(W=>m.pointCoordinate(W,this.terrain)),C=this.getIds();let P=1/0,z=1/0,V=-1/0,H=-1/0;for(const W of I)P=Math.min(P,W.x),z=Math.min(z,W.y),V=Math.max(V,W.x),H=Math.max(H,W.y);for(let W=0;W=0&&ee[1].y+fe>=0){const ce=T.map(_e=>Z.getTilePoint(_e)),ve=I.map(_e=>Z.getTilePoint(_e));u.push({tile:J,tileID:Z,queryGeometry:ce,cameraQueryGeometry:ve,scale:se})}}return u}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map(o=>this._tiles[o].tileID);for(const o of n)o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(Lt(this._source.type)){const t=j.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,o){this._state.updateState(t=t||"_geojsonTileLayer",n,o)}removeFeatureState(t,n,o){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,o)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,o){const u=this._tiles[t];u&&u.setDependencies(n,o)}reloadTilesForDependencies(t,n){for(const o in this._tiles)this._tiles[o].hasDependency(t,n)&&this._reloadTile(o,"reloading");this._cache.filter(o=>!o.hasDependency(t,n))}}function Ye(d,t){const n=Math.abs(2*d.wrap)-+(d.wrap<0),o=Math.abs(2*t.wrap)-+(t.wrap<0);return d.overscaledZ-t.overscaledZ||o-n||t.canonical.y-d.canonical.y||t.canonical.x-d.canonical.x}function Lt(d){return d==="raster"||d==="image"||d==="video"}hr.maxOverzooming=10,hr.maxUnderzooming=3;class At{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let o=1;o0?(u-w)/T:0;return this.points[m].mult(1-I).add(this.points[n].mult(I))}}function Ui(d,t){let n=!0;return d==="always"||d!=="never"&&t!=="never"||(n=!1),n}class xn{constructor(t,n,o){const u=this.boxCells=[],m=this.circleCells=[];this.xCellCount=Math.ceil(t/o),this.yCellCount=Math.ceil(n/o);for(let w=0;wthis.width||u<0||n>this.height)return[];const I=[];if(t<=0&&n<=0&&this.width<=o&&this.height<=u){if(m)return[{key:null,x1:t,y1:n,x2:o,y2:u}];for(let C=0;C0}hitTestCircle(t,n,o,u,m){const w=t-o,T=t+o,I=n-o,C=n+o;if(T<0||w>this.width||C<0||I>this.height)return!1;const P=[];return this._forEachCell(w,I,T,C,this._queryCellCircle,P,{hitTest:!0,overlapMode:u,circle:{x:t,y:n,radius:o},seenUids:{box:{},circle:{}}},m),P.length>0}_queryCell(t,n,o,u,m,w,T,I){const{seenUids:C,hitTest:P,overlapMode:z}=T,V=this.boxCells[m];if(V!==null){const W=this.bboxes;for(const J of V)if(!C.box[J]){C.box[J]=!0;const Z=4*J,se=this.boxKeys[J];if(t<=W[Z+2]&&n<=W[Z+3]&&o>=W[Z+0]&&u>=W[Z+1]&&(!I||I(se))&&(!P||!Ui(z,se.overlapMode))&&(w.push({key:se,x1:W[Z],y1:W[Z+1],x2:W[Z+2],y2:W[Z+3]}),P))return!0}}const H=this.circleCells[m];if(H!==null){const W=this.circles;for(const J of H)if(!C.circle[J]){C.circle[J]=!0;const Z=3*J,se=this.circleKeys[J];if(this._circleAndRectCollide(W[Z],W[Z+1],W[Z+2],t,n,o,u)&&(!I||I(se))&&(!P||!Ui(z,se.overlapMode))){const fe=W[Z],ee=W[Z+1],ce=W[Z+2];if(w.push({key:se,x1:fe-ce,y1:ee-ce,x2:fe+ce,y2:ee+ce}),P)return!0}}}return!1}_queryCellCircle(t,n,o,u,m,w,T,I){const{circle:C,seenUids:P,overlapMode:z}=T,V=this.boxCells[m];if(V!==null){const W=this.bboxes;for(const J of V)if(!P.box[J]){P.box[J]=!0;const Z=4*J,se=this.boxKeys[J];if(this._circleAndRectCollide(C.x,C.y,C.radius,W[Z+0],W[Z+1],W[Z+2],W[Z+3])&&(!I||I(se))&&!Ui(z,se.overlapMode))return w.push(!0),!0}}const H=this.circleCells[m];if(H!==null){const W=this.circles;for(const J of H)if(!P.circle[J]){P.circle[J]=!0;const Z=3*J,se=this.circleKeys[J];if(this._circlesCollide(W[Z],W[Z+1],W[Z+2],C.x,C.y,C.radius)&&(!I||I(se))&&!Ui(z,se.overlapMode))return w.push(!0),!0}}}_forEachCell(t,n,o,u,m,w,T,I){const C=this._convertToXCellCoord(t),P=this._convertToYCellCoord(n),z=this._convertToXCellCoord(o),V=this._convertToYCellCoord(u);for(let H=C;H<=z;H++)for(let W=P;W<=V;W++)if(m.call(this,t,n,o,u,this.xCellCount*W+H,w,T,I))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,o,u,m,w){const T=u-t,I=m-n,C=o+w;return C*C>T*T+I*I}_circleAndRectCollide(t,n,o,u,m,w,T){const I=(w-u)/2,C=Math.abs(t-(u+I));if(C>I+o)return!1;const P=(T-m)/2,z=Math.abs(n-(m+P));if(z>P+o)return!1;if(C<=I||z<=P)return!0;const V=C-I,H=z-P;return V*V+H*H<=o*o}}function Ct(d,t,n,o,u){const m=a.F();return t?(a.J(m,m,[1/u,1/u,1]),n||a.ad(m,m,o.angle)):a.K(m,o.labelPlaneMatrix,d),m}function es(d,t,n,o,u){if(t){const m=a.ae(d);return a.J(m,m,[u,u,1]),n||a.ad(m,m,-o.angle),m}return o.glCoordMatrix}function Gi(d,t,n){let o;n?(o=[d.x,d.y,n(d.x,d.y),1],a.af(o,o,t)):(o=[d.x,d.y,0,1],mt(o,o,t));const u=o[3];return{point:new a.P(o[0]/u,o[1]/u),signedDistanceFromCamera:u}}function Y(d,t){return .5+d/t*.5}function D(d,t){const n=d[0]/d[3],o=d[1]/d[3];return n>=-t[0]&&n<=t[0]&&o>=-t[1]&&o<=t[1]}function B(d,t,n,o,u,m,w,T,I,C){const P=o?d.textSizeData:d.iconSizeData,z=a.ag(P,n.transform.zoom),V=[256/n.width*2+1,256/n.height*2+1],H=o?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;H.clear();const W=d.lineVertexArray,J=o?d.text.placedSymbolArray:d.icon.placedSymbolArray,Z=n.transform.width/n.transform.height;let se=!1;for(let fe=0;feMath.abs(n.x-t.x)*o?{useVertical:!0}:(d===a.ah.vertical?t.yn.x)?{needsFlipping:!0}:null}function oe(d,t,n,o,u,m,w,T,I,C,P,z,V,H,W,J){const Z=t/24,se=d.lineOffsetX*Z,fe=d.lineOffsetY*Z;let ee;if(d.numGlyphs>1){const ce=d.glyphStartIndex+d.numGlyphs,ve=d.lineStartIndex,_e=d.lineStartIndex+d.lineLength,Ae=U(Z,T,se,fe,n,P,z,d,I,m,V,W,J);if(!Ae)return{notEnoughRoom:!0};const Re=Gi(Ae.first.point,w,J).point,Le=Gi(Ae.last.point,w,J).point;if(o&&!n){const Ze=G(d.writingMode,Re,Le,H);if(Ze)return Ze}ee=[Ae.first];for(let Ze=d.glyphStartIndex+1;Ze0?Re.point:ae(z,Ae,ve,1,u,J),Ze=G(d.writingMode,ve,Le,H);if(Ze)return Ze}const ce=ze(Z*T.getoffsetX(d.glyphStartIndex),se,fe,n,P,z,d.segment,d.lineStartIndex,d.lineStartIndex+d.lineLength,I,m,V,W,J);if(!ce)return{notEnoughRoom:!0};ee=[ce]}for(const ce of ee)a.aj(C,ce.point,ce.angle);return{}}function ae(d,t,n,o,u,m){const w=Gi(d.add(d.sub(t)._unit()),u,m).point,T=n.sub(w);return n.add(T._mult(o/T.mag()))}function ue(d,t){const{projectionCache:n,lineVertexArray:o,labelPlaneMatrix:u,tileAnchorPoint:m,distanceFromAnchor:w,getElevation:T,previousVertex:I,direction:C,absOffsetX:P}=t;if(n.projections[d])return n.projections[d];const z=new a.P(o.getx(d),o.gety(d)),V=Gi(z,u,T);if(V.signedDistanceFromCamera>0)return n.projections[d]=V.point,V.point;const H=d-C;return ae(w===0?m:new a.P(o.getx(H),o.gety(H)),z,I,P-w+1,u,T)}function re(d,t,n){return d._unit()._perp()._mult(t*n)}function pe(d,t,n,o,u,m,w,T){const{projectionCache:I,direction:C}=T;if(I.offsets[d])return I.offsets[d];const P=n.add(t);if(d+C=u)return I.offsets[d]=P,P;const z=ue(d+C,T),V=re(z.sub(n),w,C),H=n.add(V),W=z.add(V);return I.offsets[d]=a.ak(m,P,H,W)||P,I.offsets[d]}function ze(d,t,n,o,u,m,w,T,I,C,P,z,V,H){const W=o?d-t:d+t;let J=W>0?1:-1,Z=0;o&&(J*=-1,Z=Math.PI),J<0&&(Z+=Math.PI);let se,fe,ee=J>0?T+w:T+w+1,ce=u,ve=u,_e=0,Ae=0;const Re=Math.abs(W),Le=[];let Ze;for(;_e+Ae<=Re;){if(ee+=J,ee=I)return null;_e+=Ae,ve=ce,fe=se;const Je={projectionCache:z,lineVertexArray:C,labelPlaneMatrix:P,tileAnchorPoint:m,distanceFromAnchor:_e,getElevation:H,previousVertex:ve,direction:J,absOffsetX:Re};if(ce=ue(ee,Je),n===0)Le.push(ve),Ze=ce.sub(ve);else{let yt;const lt=ce.sub(ve);yt=lt.mag()===0?re(ue(ee+J,Je).sub(ce),n,J):re(lt,n,J),fe||(fe=ve.add(yt)),se=pe(ee,yt,ce,T,I,fe,n,Je),Le.push(fe),Ze=se.sub(fe)}Ae=Ze.mag()}const st=Ze._mult((Re-_e)/Ae)._add(fe||ve),vt=Z+Math.atan2(ce.y-ve.y,ce.x-ve.x);return Le.push(st),{point:st,angle:V?vt:0,path:Le}}const Ce=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Me(d,t){for(let n=0;n=1;Pt--)lt.push(Je.path[Pt]);for(let Pt=1;PtGi(Ft,I,W));lt=Pt.some(Ft=>Ft.signedDistanceFromCamera<=0)?[]:Pt.map(Ft=>Ft.point)}let Bt=[];if(lt.length>0){const Pt=lt[0].clone(),Ft=lt[0].clone();for(let Fi=1;Fi=Ze.x&&Ft.x<=st.x&&Pt.y>=Ze.y&&Ft.y<=st.y?[lt]:Ft.xst.x||Ft.yst.y?[]:a.al([lt],Ze.x,Ze.y,st.x,st.y)}for(const Pt of Bt){vt.reset(Pt,.25*Le);let Ft=0;Ft=vt.length<=.5*Le?1:Math.ceil(vt.paddedLength/fi)+1;for(let Fi=0;Fi=this.screenRightBoundary||u<_t||n>this.screenBottomBoundary}isInsideGrid(t,n,o,u){return o>=0&&t=0&&no.collisionGroupID===n}}return this.collisionGroups[t]}}function Hi(d,t,n,o,u){const{horizontalAlign:m,verticalAlign:w}=a.at(d);return new a.P(-(m-.5)*t+o[0]*u,-(w-.5)*n+o[1]*u)}function xr(d,t,n,o,u,m){const{x1:w,x2:T,y1:I,y2:C,anchorPointX:P,anchorPointY:z}=d,V=new a.P(t,n);return o&&V._rotate(u?m:-m),{x1:w+V.x,y1:I+V.y,x2:T+V.x,y2:C+V.y,anchorPointX:P,anchorPointY:z}}class Pr{constructor(t,n,o,u,m){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new Mt(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new Ci(u),this.collisionCircleArrays={},this.prevPlacement=m,m&&(m.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,o,u){const m=o.getBucket(n),w=o.latestFeatureIndex;if(!m||!w||n.id!==m.layerIds[0])return;const T=o.collisionBoxArray,I=m.layers[0].layout,C=Math.pow(2,this.transform.zoom-o.tileID.overscaledZ),P=o.tileSize/a.W,z=this.transform.calculatePosMatrix(o.tileID.toUnwrapped()),V=I.get("text-pitch-alignment")==="map",H=I.get("text-rotation-alignment")==="map",W=bt(o,1,this.transform.zoom),J=Ct(z,V,H,this.transform,W);let Z=null;if(V){const fe=es(z,V,H,this.transform,W);Z=a.K([],this.transform.labelPlaneMatrix,fe)}this.retainedQueryData[m.bucketInstanceId]=new Et(m.bucketInstanceId,w,m.sourceLayerIndex,m.index,o.tileID);const se={bucket:m,layout:I,posMatrix:z,textLabelPlaneMatrix:J,labelToScreenMatrix:Z,scale:C,textPixelRatio:P,holdingForFade:o.holdingForFade(),collisionBoxArray:T,partiallyEvaluatedTextSize:a.ag(m.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(m.sourceID)};if(u)for(const fe of m.sortKeyRanges){const{sortKey:ee,symbolInstanceStart:ce,symbolInstanceEnd:ve}=fe;t.push({sortKey:ee,symbolInstanceStart:ce,symbolInstanceEnd:ve,parameters:se})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:m.symbolInstances.length,parameters:se})}attemptAnchorPlacement(t,n,o,u,m,w,T,I,C,P,z,V,H,W,J,Z){const se=a.ap[t.textAnchor],fe=[t.textOffset0,t.textOffset1],ee=Hi(se,o,u,fe,m),ce=this.collisionIndex.placeCollisionBox(xr(n,ee.x,ee.y,w,T,this.transform.angle),z,I,C,P.predicate,Z);if((!J||this.collisionIndex.placeCollisionBox(xr(J,ee.x,ee.y,w,T,this.transform.angle),z,I,C,P.predicate,Z).box.length!==0)&&ce.box.length>0){let ve;if(this.prevPlacement&&this.prevPlacement.variableOffsets[V.crossTileID]&&this.prevPlacement.placements[V.crossTileID]&&this.prevPlacement.placements[V.crossTileID].text&&(ve=this.prevPlacement.variableOffsets[V.crossTileID].anchor),V.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[V.crossTileID]={textOffset:fe,width:o,height:u,anchor:se,textBoxScale:m,prevAnchor:ve},this.markUsedJustification(H,se,V,W),H.allowVerticalPlacement&&(this.markUsedOrientation(H,W,V),this.placedOrientations[V.crossTileID]=W),{shift:ee,placedGlyphBoxes:ce}}}placeLayerBucketPart(t,n,o){const{bucket:u,layout:m,posMatrix:w,textLabelPlaneMatrix:T,labelToScreenMatrix:I,textPixelRatio:C,holdingForFade:P,collisionBoxArray:z,partiallyEvaluatedTextSize:V,collisionGroup:H}=t.parameters,W=m.get("text-optional"),J=m.get("icon-optional"),Z=a.aq(m,"text-overlap","text-allow-overlap"),se=Z==="always",fe=a.aq(m,"icon-overlap","icon-allow-overlap"),ee=fe==="always",ce=m.get("text-rotation-alignment")==="map",ve=m.get("text-pitch-alignment")==="map",_e=m.get("icon-text-fit")!=="none",Ae=m.get("symbol-z-order")==="viewport-y",Re=se&&(ee||!u.hasIconData()||J),Le=ee&&(se||!u.hasTextData()||W);!u.collisionArrays&&z&&u.deserializeCollisionBoxes(z);const Ze=this.retainedQueryData[u.bucketInstanceId].tileID,st=this.terrain?(Je,yt)=>this.terrain.getElevation(Ze,Je,yt):null,vt=(Je,yt)=>{var lt,fi;if(n[Je.crossTileID])return;if(P)return void(this.placements[Je.crossTileID]=new bi(!1,!1,!1));let Bt=!1,Pt=!1,Ft=!0,Fi=null,ni={box:null,offscreen:null},Tr={box:null,offscreen:null},rr=null,Ei=null,pr=null,fr=0,tn=0,Zn=0;yt.textFeatureIndex?fr=yt.textFeatureIndex:Je.useRuntimeCollisionCircles&&(fr=Je.featureIndex),yt.verticalTextFeatureIndex&&(tn=yt.verticalTextFeatureIndex);const Fs=yt.textBox;if(Fs){const Wi=mi=>{let Xi=a.ah.horizontal;if(u.allowVerticalPlacement&&!mi&&this.prevPlacement){const nr=this.prevPlacement.placedOrientations[Je.crossTileID];nr&&(this.placedOrientations[Je.crossTileID]=nr,Xi=nr,this.markUsedOrientation(u,Xi,Je))}return Xi},Oi=(mi,Xi)=>{if(u.allowVerticalPlacement&&Je.numVerticalGlyphVertices>0&&yt.verticalTextBox){for(const nr of u.writingModes)if(nr===a.ah.vertical?(ni=Xi(),Tr=ni):ni=mi(),ni&&ni.box&&ni.box.length)break}else ni=mi()},Pi=Je.textAnchorOffsetStartIndex,Ir=Je.textAnchorOffsetEndIndex;if(Ir===Pi){const mi=(Xi,nr)=>{const Ki=this.collisionIndex.placeCollisionBox(Xi,Z,C,w,H.predicate,st);return Ki&&Ki.box&&Ki.box.length&&(this.markUsedOrientation(u,nr,Je),this.placedOrientations[Je.crossTileID]=nr),Ki};Oi(()=>mi(Fs,a.ah.horizontal),()=>{const Xi=yt.verticalTextBox;return u.allowVerticalPlacement&&Je.numVerticalGlyphVertices>0&&Xi?mi(Xi,a.ah.vertical):{box:null,offscreen:null}}),Wi(ni&&ni.box&&ni.box.length)}else{let mi=a.ap[(fi=(lt=this.prevPlacement)===null||lt===void 0?void 0:lt.variableOffsets[Je.crossTileID])===null||fi===void 0?void 0:fi.anchor];const Xi=(Ki,Rc,zi)=>{const ml=Ki.x2-Ki.x1,Bc=Ki.y2-Ki.y1,ds=Je.textBoxScale,ps=_e&&fe==="never"?Rc:null;let Ln={box:[],offscreen:!1},ca=Z==="never"?1:2,gl="never";mi&&ca++;for(let Fc=0;FcXi(Fs,yt.iconBox,a.ah.horizontal),()=>{const Ki=yt.verticalTextBox;return u.allowVerticalPlacement&&!(ni&&ni.box&&ni.box.length)&&Je.numVerticalGlyphVertices>0&&Ki?Xi(Ki,yt.verticalIconBox,a.ah.vertical):{box:null,offscreen:null}}),ni&&(Bt=ni.box,Ft=ni.offscreen);const nr=Wi(ni&&ni.box);if(!Bt&&this.prevPlacement){const Ki=this.prevPlacement.variableOffsets[Je.crossTileID];Ki&&(this.variableOffsets[Je.crossTileID]=Ki,this.markUsedJustification(u,Ki.anchor,Je,nr))}}}if(rr=ni,Bt=rr&&rr.box&&rr.box.length>0,Ft=rr&&rr.offscreen,Je.useRuntimeCollisionCircles){const Wi=u.text.placedSymbolArray.get(Je.centerJustifiedTextSymbolIndex),Oi=a.ai(u.textSizeData,V,Wi),Pi=m.get("text-padding");Ei=this.collisionIndex.placeCollisionCircles(Z,Wi,u.lineVertexArray,u.glyphOffsetArray,Oi,w,T,I,o,ve,H.predicate,Je.collisionCircleDiameter,Pi,st),Ei.circles.length&&Ei.collisionDetected&&!o&&a.w("Collisions detected, but collision boxes are not shown"),Bt=se||Ei.circles.length>0&&!Ei.collisionDetected,Ft=Ft&&Ei.offscreen}if(yt.iconFeatureIndex&&(Zn=yt.iconFeatureIndex),yt.iconBox){const Wi=Oi=>{const Pi=_e&&Fi?xr(Oi,Fi.x,Fi.y,ce,ve,this.transform.angle):Oi;return this.collisionIndex.placeCollisionBox(Pi,fe,C,w,H.predicate,st)};Tr&&Tr.box&&Tr.box.length&&yt.verticalIconBox?(pr=Wi(yt.verticalIconBox),Pt=pr.box.length>0):(pr=Wi(yt.iconBox),Pt=pr.box.length>0),Ft=Ft&&pr.offscreen}const Os=W||Je.numHorizontalGlyphVertices===0&&Je.numVerticalGlyphVertices===0,Gn=J||Je.numIconVertices===0;if(Os||Gn?Gn?Os||(Pt=Pt&&Bt):Bt=Pt&&Bt:Pt=Bt=Pt&&Bt,Bt&&rr&&rr.box&&this.collisionIndex.insertCollisionBox(rr.box,Z,m.get("text-ignore-placement"),u.bucketInstanceId,Tr&&Tr.box&&tn?tn:fr,H.ID),Pt&&pr&&this.collisionIndex.insertCollisionBox(pr.box,fe,m.get("icon-ignore-placement"),u.bucketInstanceId,Zn,H.ID),Ei&&(Bt&&this.collisionIndex.insertCollisionCircles(Ei.circles,Z,m.get("text-ignore-placement"),u.bucketInstanceId,fr,H.ID),o)){const Wi=u.bucketInstanceId;let Oi=this.collisionCircleArrays[Wi];Oi===void 0&&(Oi=this.collisionCircleArrays[Wi]=new ji);for(let Pi=0;Pi=0;--yt){const lt=Je[yt];vt(u.symbolInstances.get(lt),u.collisionArrays[lt])}}else for(let Je=t.symbolInstanceStart;Je=0&&(t.text.placedSymbolArray.get(T).crossTileID=m>=0&&T!==m?0:o.crossTileID)}markUsedOrientation(t,n,o){const u=n===a.ah.horizontal||n===a.ah.horizontalOnly?n:0,m=n===a.ah.vertical?n:0,w=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex];for(const T of w)t.text.placedSymbolArray.get(T).placedOrientation=u;o.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).placedOrientation=m)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let o=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const u=n?n.symbolFadeChange(t):1,m=n?n.opacities:{},w=n?n.variableOffsets:{},T=n?n.placedOrientations:{};for(const I in this.placements){const C=this.placements[I],P=m[I];P?(this.opacities[I]=new ri(P,u,C.text,C.icon),o=o||C.text!==P.text.placed||C.icon!==P.icon.placed):(this.opacities[I]=new ri(null,u,C.text,C.icon,C.skipFade),o=o||C.text||C.icon)}for(const I in m){const C=m[I];if(!this.opacities[I]){const P=new ri(C,u,!1,!1);P.isHidden()||(this.opacities[I]=P,o=o||C.text.placed||C.icon.placed)}}for(const I in w)this.variableOffsets[I]||!this.opacities[I]||this.opacities[I].isHidden()||(this.variableOffsets[I]=w[I]);for(const I in T)this.placedOrientations[I]||!this.opacities[I]||this.opacities[I].isHidden()||(this.placedOrientations[I]=T[I]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");o?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const o={};for(const u of n){const m=u.getBucket(t);m&&u.latestFeatureIndex&&t.id===m.layerIds[0]&&this.updateBucketOpacities(m,o,u.collisionBoxArray)}}updateBucketOpacities(t,n,o){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const u=t.layers[0],m=u.layout,w=new ri(null,0,!1,!1,!0),T=m.get("text-allow-overlap"),I=m.get("icon-allow-overlap"),C=u._unevaluatedLayout.hasValue("text-variable-anchor")||u._unevaluatedLayout.hasValue("text-variable-anchor-offset"),P=m.get("text-rotation-alignment")==="map",z=m.get("text-pitch-alignment")==="map",V=m.get("icon-text-fit")!=="none",H=new ri(null,0,T&&(I||!t.hasIconData()||m.get("icon-optional")),I&&(T||!t.hasTextData()||m.get("text-optional")),!0);!t.collisionArrays&&o&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(o);const W=(J,Z,se)=>{for(let fe=0;fe0,_e=this.placedOrientations[Z.crossTileID],Ae=_e===a.ah.vertical,Re=_e===a.ah.horizontal||_e===a.ah.horizontalOnly;if(se>0||fe>0){const Le=zr(ce.text);W(t.text,se,Ae?Xs:Le),W(t.text,fe,Re?Xs:Le);const Ze=ce.text.isHidden();[Z.rightJustifiedTextSymbolIndex,Z.centerJustifiedTextSymbolIndex,Z.leftJustifiedTextSymbolIndex].forEach(Je=>{Je>=0&&(t.text.placedSymbolArray.get(Je).hidden=Ze||Ae?1:0)}),Z.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(Z.verticalPlacedTextSymbolIndex).hidden=Ze||Re?1:0);const st=this.variableOffsets[Z.crossTileID];st&&this.markUsedJustification(t,st.anchor,Z,_e);const vt=this.placedOrientations[Z.crossTileID];vt&&(this.markUsedJustification(t,"left",Z,vt),this.markUsedOrientation(t,vt,Z))}if(ve){const Le=zr(ce.icon),Ze=!(V&&Z.verticalPlacedIconSymbolIndex&&Ae);Z.placedIconSymbolIndex>=0&&(W(t.icon,Z.numIconVertices,Ze?Le:Xs),t.icon.placedSymbolArray.get(Z.placedIconSymbolIndex).hidden=ce.icon.isHidden()),Z.verticalPlacedIconSymbolIndex>=0&&(W(t.icon,Z.numVerticalIconVertices,Ze?Xs:Le),t.icon.placedSymbolArray.get(Z.verticalPlacedIconSymbolIndex).hidden=ce.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const Le=t.collisionArrays[J];if(Le){let Ze=new a.P(0,0);if(Le.textBox||Le.verticalTextBox){let vt=!0;if(C){const Je=this.variableOffsets[ee];Je?(Ze=Hi(Je.anchor,Je.width,Je.height,Je.textOffset,Je.textBoxScale),P&&Ze._rotate(z?this.transform.angle:-this.transform.angle)):vt=!1}Le.textBox&&ir(t.textCollisionBox.collisionVertexArray,ce.text.placed,!vt||Ae,Ze.x,Ze.y),Le.verticalTextBox&&ir(t.textCollisionBox.collisionVertexArray,ce.text.placed,!vt||Re,Ze.x,Ze.y)}const st=!!(!Re&&Le.verticalIconBox);Le.iconBox&&ir(t.iconCollisionBox.collisionVertexArray,ce.icon.placed,st,V?Ze.x:0,V?Ze.y:0),Le.verticalIconBox&&ir(t.iconCollisionBox.collisionVertexArray,ce.icon.placed,!st,V?Ze.x:0,V?Ze.y:0)}}}if(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.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const J=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=J.invProjMatrix,t.placementViewportMatrix=J.viewportMatrix,t.collisionCircleArray=J.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}}function ir(d,t,n,o,u){d.emplaceBack(t?1:0,n?1:0,o||0,u||0),d.emplaceBack(t?1:0,n?1:0,o||0,u||0),d.emplaceBack(t?1:0,n?1:0,o||0,u||0),d.emplaceBack(t?1:0,n?1:0,o||0,u||0)}const bn=Math.pow(2,25),$l=Math.pow(2,24),_u=Math.pow(2,17),ti=Math.pow(2,16),La=Math.pow(2,9),Da=Math.pow(2,8),qr=Math.pow(2,1);function zr(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;const t=d.placed?1:0,n=Math.floor(127*d.opacity);return n*bn+t*$l+n*_u+t*ti+n*La+t*Da+n*qr+t}const Xs=0;class Qr{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,o,u,m){const w=this._bucketParts;for(;this._currentTileIndexT.sortKey-I.sortKey));this._currentPartIndex!this._forceFullPlacement&&j.now()-u>2;for(;this._currentPlacementIndex>=0;){const w=n[t[this._currentPlacementIndex]],T=this.placement.collisionIndex.transform.zoom;if(w.type==="symbol"&&(!w.minzoom||w.minzoom<=T)&&(!w.maxzoom||w.maxzoom>T)){if(this._inProgressLayer||(this._inProgressLayer=new Qr(w)),this._inProgressLayer.continuePlacement(o[w.source],this.placement,this._showCollisionBoxes,w,m))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const ks=512/a.W/2;class Co{constructor(t,n,o){this.tileID=t,this.bucketInstanceId=o,this._symbolsByKey={};const u=new Map;for(let m=0;m({x:Math.floor(I.anchorX*ks),y:Math.floor(I.anchorY*ks)})),crossTileIDs:w.map(I=>I.crossTileID)};if(T.positions.length>128){const I=new a.au(T.positions.length,16,Uint16Array);for(const{x:C,y:P}of T.positions)I.add(C,P);I.finish(),delete T.positions,T.index=I}this._symbolsByKey[m]=T}}getScaledCoordinates(t,n){const{x:o,y:u,z:m}=this.tileID.canonical,{x:w,y:T,z:I}=n.canonical,C=ks/Math.pow(2,I-m),P=(T*a.W+t.anchorY)*C,z=u*a.W*ks;return{x:Math.floor((w*a.W+t.anchorX)*C-o*a.W*ks),y:Math.floor(P-z)}}findMatches(t,n,o){const u=this.tileID.canonical.zt)}}class qi{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ks{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(n!==0)for(const o in this.indexes){const u=this.indexes[o],m={};for(const w in u){const T=u[w];T.tileID=T.tileID.unwrapTo(T.tileID.wrap+n),m[T.tileID.key]=T}this.indexes[o]=m}this.lng=t}addBucket(t,n,o){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let m=0;mt.overscaledZ)for(const T in w){const I=w[T];I.tileID.isChildOf(t)&&I.findMatches(n.symbolInstances,t,u)}else{const T=w[t.scaledTo(Number(m)).key];T&&T.findMatches(n.symbolInstances,t,u)}}for(let m=0;m{n[o]=!0});for(const o in this.layerIndexes)n[o]||delete this.layerIndexes[o]}}const Ii=(d,t)=>a.t(d,t&&t.filter(n=>n.identifier!=="source.canvas")),Mo=a.av();class Zr extends a.E{constructor(t,n={}){super(),this._rtlTextPluginStateChange=()=>{for(const o in this.sourceCaches){const u=this.sourceCaches[o].getSource().type;u!=="vector"&&u!=="geojson"||this.sourceCaches[o].reload()}},this.map=t,this.dispatcher=new Tt(He(),t._getMapId()),this.dispatcher.registerMessageHandler("getGlyphs",(o,u)=>this.getGlyphs(o,u)),this.dispatcher.registerMessageHandler("getImages",(o,u)=>this.getImages(o,u)),this.imageManager=new kt,this.imageManager.setEventedParent(this),this.glyphManager=new Vt(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new zt(256,512),this.crossTileSymbolIndex=new Vn,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new a.aw,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",a.ax()),We().on("pluginStateChange",this._rtlTextPluginStateChange),this.on("data",o=>{if(o.dataType!=="source"||o.sourceDataType!=="metadata")return;const u=this.sourceCaches[o.sourceId];if(!u)return;const m=u.getSource();if(m&&m.vectorLayerIds)for(const w in this._layers){const T=this._layers[w];T.source===m.id&&this._validateLayer(T)}})}loadURL(t,n={},o){this.fire(new a.k("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const u=this.map._requestManager.transformRequest(t,ne.Style);this._loadStyleRequest=new AbortController,a.h(u,this._loadStyleRequest).then(m=>{this._loadStyleRequest=null,this._load(m.data,n,o)}).catch(m=>{this._loadStyleRequest=null,m&&this.fire(new a.j(m))})}loadJSON(t,n={},o){this.fire(new a.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,j.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,n.validate=n.validate!==!1,this._load(t,n,o)}).catch(()=>{})}loadEmpty(){this.fire(new a.k("dataloading",{dataType:"style"})),this._load(Mo,{validate:!1})}_load(t,n,o){var u;const m=n.transformStyle?n.transformStyle(o,t):t;if(!n.validate||!Ii(this,a.x(m))){this._loaded=!0,this.stylesheet=m;for(const w in m.sources)this.addSource(w,m.sources[w],{validate:!1});m.sprite?this._loadSprite(m.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(m.glyphs),this._createLayers(),this.light=new ei(this.stylesheet.light),this.map.setTerrain((u=this.stylesheet.terrain)!==null&&u!==void 0?u:null),this.fire(new a.k("data",{dataType:"style"})),this.fire(new a.k("style.load"))}}_createLayers(){const t=a.ay(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of t){const o=a.az(n);o.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=o}}_loadSprite(t,n=!1,o=void 0){let u;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(m,w,T,I){return a._(this,void 0,void 0,function*(){const C=ge(m),P=T>1?"@2x":"",z={},V={};for(const{id:H,url:W}of C){const J=w.transformRequest(w.normalizeSpriteURL(W,P,".json"),ne.SpriteJSON);z[H]=a.h(J,I);const Z=w.transformRequest(w.normalizeSpriteURL(W,P,".png"),ne.SpriteImage);V[H]=$.getImage(Z,I)}return yield Promise.all([...Object.values(z),...Object.values(V)]),function(H,W){return a._(this,void 0,void 0,function*(){const J={};for(const Z in H){J[Z]={};const se=j.getImageCanvasContext((yield W[Z]).data),fe=(yield H[Z]).data;for(const ee in fe){const{width:ce,height:ve,x:_e,y:Ae,sdf:Re,pixelRatio:Le,stretchX:Ze,stretchY:st,content:vt}=fe[ee];J[Z][ee]={data:null,pixelRatio:Le,sdf:Re,stretchX:Ze,stretchY:st,content:vt,spriteData:{width:ce,height:ve,x:_e,y:Ae,context:se}}}}return J})}(z,V)})}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(m=>{if(this._spriteRequest=null,m)for(const w in m){this._spritesImagesIds[w]=[];const T=this._spritesImagesIds[w]?this._spritesImagesIds[w].filter(I=>!(I in m)):[];for(const I of T)this.imageManager.removeImage(I),this._changedImages[I]=!0;for(const I in m[w]){const C=w==="default"?I:`${w}:${I}`;this._spritesImagesIds[w].push(C),C in this.imageManager.images?this.imageManager.updateImage(C,m[w][I],!1):this.imageManager.addImage(C,m[w][I]),n&&(this._changedImages[C]=!0)}}}).catch(m=>{this._spriteRequest=null,u=m,this.fire(new a.j(u))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.k("data",{dataType:"style"})),o&&o(u)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.k("data",{dataType:"style"}))}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const o=t.sourceLayer;if(!o)return;const u=n.getSource();(u.type==="geojson"||u.vectorLayerIds&&u.vectorLayerIds.indexOf(o)===-1)&&this.fire(new a.j(new Error(`Source layer "${o}" does not exist on source "${u.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const n=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n);const o=[];for(const u of t)n[u]&&o.push(n[u]);return o}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const n=Object.keys(this._layers);for(const o of n){const u=this._layers[o];u.type!=="custom"&&(t[o]=u.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const n=this._changed;if(this._changed){const u=Object.keys(this._updatedLayers),m=Object.keys(this._removedLayers);(u.length||m.length)&&this._updateWorkerLayers(u,m);for(const w in this._updatedSources){const T=this._updatedSources[w];if(T==="reload")this._reloadSource(w);else{if(T!=="clear")throw new Error(`Invalid action ${T}`);this._clearSource(w)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const w in this._updatedPaintProps)this._layers[w].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const o={};for(const u in this.sourceCaches){const m=this.sourceCaches[u];o[u]=m.used,m.used=!1}for(const u of this._order){const m=this._layers[u];m.recalculate(t,this._availableImages),!m.isHidden(t.zoom)&&m.source&&(this.sourceCaches[m.source].used=!0)}for(const u in o){const m=this.sourceCaches[u];o[u]!==m.used&&m.fire(new a.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:u}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new a.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){this._checkLoaded();const o=this.serialize();if(t=n.transformStyle?n.transformStyle(o,t):t,Ii(this,a.x(t)))return!1;(t=a.aA(t)).layers=a.ay(t.layers);const u=a.aB(o,t),m=this._getOperationsToPerform(u);if(m.unimplemented.length>0)throw new Error(`Unimplemented: ${m.unimplemented.join(", ")}.`);if(m.operations.length===0)return!1;for(const w of m.operations)w();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){const n=[],o=[];for(const u of t)switch(u.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":n.push(()=>this.addLayer.apply(this,u.args));break;case"removeLayer":n.push(()=>this.removeLayer.apply(this,u.args));break;case"setPaintProperty":n.push(()=>this.setPaintProperty.apply(this,u.args));break;case"setLayoutProperty":n.push(()=>this.setLayoutProperty.apply(this,u.args));break;case"setFilter":n.push(()=>this.setFilter.apply(this,u.args));break;case"addSource":n.push(()=>this.addSource.apply(this,u.args));break;case"removeSource":n.push(()=>this.removeSource.apply(this,u.args));break;case"setLayerZoomRange":n.push(()=>this.setLayerZoomRange.apply(this,u.args));break;case"setLight":n.push(()=>this.setLight.apply(this,u.args));break;case"setGeoJSONSourceData":n.push(()=>this.setGeoJSONSourceData.apply(this,u.args));break;case"setGlyphs":n.push(()=>this.setGlyphs.apply(this,u.args));break;case"setSprite":n.push(()=>this.setSprite.apply(this,u.args));break;case"setTerrain":n.push(()=>this.map.setTerrain.apply(this,u.args));break;case"setTransition":n.push(()=>{});break;default:o.push(u.command)}return{operations:n,unimplemented:o}}addImage(t,n){if(this.getImage(t))return this.fire(new a.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new a.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,o={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);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(a.x.source,`sources.${t}`,n,null,o))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const u=this.sourceCaches[t]=new hr(t,n,this.dispatcher);u.style=this,u.setEventedParent(this,()=>({isSourceLoaded:u.loaded(),source:u.serialize(),sourceId:t})),u.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const o in this._layers)if(this._layers[o].source===t)return this.fire(new a.j(new Error(`Source "${t}" cannot be removed while layer "${o}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new a.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const o=this.sourceCaches[t].getSource();if(o.type!=="geojson")throw new Error(`geojsonSource.type is ${o.type}, which is !== 'geojson`);o.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,o={}){this._checkLoaded();const u=t.id;if(this.getLayer(u))return void this.fire(new a.j(new Error(`Layer "${u}" already exists on this map.`)));let m;if(t.type==="custom"){if(Ii(this,a.aC(t)))return;m=a.az(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(u,t.source),t=a.aA(t),t=a.e(t,{source:u})),this._validate(a.x.layer,`layers.${u}`,t,{arrayIndex:-1},o))return;m=a.az(t),this._validateLayer(m),m.setEventedParent(this,{layer:{id:u}})}const w=n?this._order.indexOf(n):this._order.length;if(n&&w===-1)this.fire(new a.j(new Error(`Cannot add layer "${u}" before non-existing layer "${n}".`)));else{if(this._order.splice(w,0,u),this._layerOrderChanged=!0,this._layers[u]=m,this._removedLayers[u]&&m.source&&m.type!=="custom"){const T=this._removedLayers[u];delete this._removedLayers[u],T.type!==m.type?this._updatedSources[m.source]="clear":(this._updatedSources[m.source]="reload",this.sourceCaches[m.source].pause())}this._updateLayer(m),m.onAdd&&m.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new a.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const o=this._order.indexOf(t);this._order.splice(o,1);const u=n?this._order.indexOf(n):this._order.length;n&&u===-1?this.fire(new a.j(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(u,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new a.j(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const o=this._order.indexOf(t);this._order.splice(o,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,o){this._checkLoaded();const u=this.getLayer(t);u?u.minzoom===n&&u.maxzoom===o||(n!=null&&(u.minzoom=n),o!=null&&(u.maxzoom=o),this._updateLayer(u)):this.fire(new a.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,o={}){this._checkLoaded();const u=this.getLayer(t);if(u){if(!a.aD(u.filter,n))return n==null?(u.filter=void 0,void this._updateLayer(u)):void(this._validate(a.x.filter,`layers.${u.id}.filter`,n,null,o)||(u.filter=a.aA(n),this._updateLayer(u)))}else this.fire(new a.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return a.aA(this.getLayer(t).filter)}setLayoutProperty(t,n,o,u={}){this._checkLoaded();const m=this.getLayer(t);m?a.aD(m.getLayoutProperty(n),o)||(m.setLayoutProperty(n,o,u),this._updateLayer(m)):this.fire(new a.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const o=this.getLayer(t);if(o)return o.getLayoutProperty(n);this.fire(new a.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,o,u={}){this._checkLoaded();const m=this.getLayer(t);m?a.aD(m.getPaintProperty(n),o)||(m.setPaintProperty(n,o,u)&&this._updateLayer(m),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new a.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const o=t.source,u=t.sourceLayer,m=this.sourceCaches[o];if(m===void 0)return void this.fire(new a.j(new Error(`The source '${o}' does not exist in the map's style.`)));const w=m.getSource().type;w==="geojson"&&u?this.fire(new a.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):w!=="vector"||u?(t.id===void 0&&this.fire(new a.j(new Error("The feature id parameter must be provided."))),m.setFeatureState(u,t.id,n)):this.fire(new a.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const o=t.source,u=this.sourceCaches[o];if(u===void 0)return void this.fire(new a.j(new Error(`The source '${o}' does not exist in the map's style.`)));const m=u.getSource().type,w=m==="vector"?t.sourceLayer:void 0;m!=="vector"||w?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new a.j(new Error("A feature id is required to remove its specific state property."))):u.removeFeatureState(w,t.id,n):this.fire(new a.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,o=t.sourceLayer,u=this.sourceCaches[n];if(u!==void 0)return u.getSource().type!=="vector"||o?(t.id===void 0&&this.fire(new a.j(new Error("The feature id parameter must be provided."))),u.getFeatureState(o,t.id)):void this.fire(new a.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new a.j(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return a.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=a.aE(this.sourceCaches,m=>m.serialize()),n=this._serializeByIds(this._order),o=this.map.getTerrain()||void 0,u=this.stylesheet;return a.aF({version:u.version,name:u.name,metadata:u.metadata,light:u.light,center:u.center,zoom:u.zoom,bearing:u.bearing,pitch:u.pitch,sprite:u.sprite,glyphs:u.glyphs,transition:u.transition,sources:t,layers:n,terrain:o},m=>m!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const n=w=>this._layers[w].type==="fill-extrusion",o={},u=[];for(let w=this._order.length-1;w>=0;w--){const T=this._order[w];if(n(T)){o[T]=w;for(const I of t){const C=I[T];if(C)for(const P of C)u.push(P)}}}u.sort((w,T)=>T.intersectionZ-w.intersectionZ);const m=[];for(let w=this._order.length-1;w>=0;w--){const T=this._order[w];if(n(T))for(let I=u.length-1;I>=0;I--){const C=u[I].feature;if(o[C.layer.id]{const Re=se.featureSortOrder;if(Re){const Le=Re.indexOf(_e.featureIndex);return Re.indexOf(Ae.featureIndex)-Le}return Ae.featureIndex-_e.featureIndex});for(const _e of ve)ce.push(_e)}}for(const se in W)W[se].forEach(fe=>{const ee=fe.feature,ce=C[T[se].source].getFeatureState(ee.layer["source-layer"],ee.id);ee.source=ee.layer.source,ee.layer["source-layer"]&&(ee.sourceLayer=ee.layer["source-layer"]),ee.state=ce});return W}(this._layers,w,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(m)}querySourceFeatures(t,n){n&&n.filter&&this._validate(a.x.filter,"querySourceFeatures.filter",n.filter,null,n);const o=this.sourceCaches[t];return o?function(u,m){const w=u.getRenderableIds().map(C=>u.getTileByID(C)),T=[],I={};for(let C=0;CV.getTileByID(H)).sort((H,W)=>W.tileID.overscaledZ-H.tileID.overscaledZ||(H.tileID.isLessThan(W.tileID)?-1:1))}const z=this.crossTileSymbolIndex.addLayer(P,I[P.source],t.center.lng);w=w||z}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((m=m||this._layerOrderChanged||o===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(j.now(),t.zoom))&&(this.pauseablePlacement=new $r(t,this.map.terrain,this._order,m,n,o,u,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,I),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(j.now()),T=!0),w&&this.pauseablePlacement.placement.setStale()),T||w)for(const C of this._order){const P=this._layers[C];P.type==="symbol"&&this.placement.updateLayerOpacities(P,I[P.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(j.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n){return a._(this,void 0,void 0,function*(){const o=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();const u=this.sourceCaches[n.source];return u&&u.setDependencies(n.tileID.key,n.type,n.icons),o})}getGlyphs(t,n){return a._(this,void 0,void 0,function*(){const o=yield this.glyphManager.getGlyphs(n.stacks),u=this.sourceCaches[n.source];return u&&u.setDependencies(n.tileID.key,n.type,[""]),o})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(a.x.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n,o={},u){this._checkLoaded();const m=[{id:t,url:n}],w=[...ge(this.stylesheet.sprite),...m];this._validate(a.x.sprite,"sprite",w,null,o)||(this.stylesheet.sprite=w,this._loadSprite(m,!0,u))}removeSprite(t){this._checkLoaded();const n=ge(this.stylesheet.sprite);if(n.find(o=>o.id===t)){if(this._spritesImagesIds[t])for(const o of this._spritesImagesIds[t])this.imageManager.removeImage(o),this._changedImages[o]=!0;n.splice(n.findIndex(o=>o.id===t),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.k("data",{dataType:"style"}))}else this.fire(new a.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return ge(this.stylesheet.sprite)}setSprite(t,n={},o){this._checkLoaded(),t&&this._validate(a.x.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,o):(this._unloadSprite(),o&&o(null)))}}var Ao=a.X([{name:"a_pos",type:"Int16",components:2}]),wn="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const Ys={prelude:ii(`#ifdef GL_ES -precision mediump float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -`,`#ifdef GL_ES -precision highp float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -vec2 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(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 -);}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 float tile_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 (tile_units_to_pixels*pos+offset)/pattern_size;} -#ifdef TERRAIN3D -uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; -#endif -const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { -#ifdef TERRAIN3D -highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); -#else -return 1.0; -#endif -}float calculate_visibility(vec4 pos) { -#ifdef TERRAIN3D -vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; -#else -return 1.0; -#endif -}float ele(vec2 pos) { -#ifdef TERRAIN3D -vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; -#else -return 0.0; -#endif -}float get_elevation(vec2 pos) { -#ifdef TERRAIN3D -vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; -#else -return 0.0; -#endif -}`),background:ii(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:ii(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:ii(`varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main(void) { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:ii("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:ii(`uniform highp float u_intensity;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma mapbox: initialize highp float weight -float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#pragma mapbox: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma mapbox: initialize highp float weight -#pragma mapbox: initialize mediump float radius -vec2 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;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:ii(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(0.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:ii("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:ii("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying 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);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying 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;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-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(0.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:ii("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:ii(`#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_FragColor=color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:ii(`varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:ii(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:ii(`#ifdef GL_ES -precision highp float; -#endif -uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:ii(`varying vec4 v_color;void main() {gl_FragColor=v_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform 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;attribute vec2 a_pos;attribute vec4 a_normal_ed; -#ifdef TERRAIN3D -attribute vec2 a_centroid; -#endif -varying vec4 v_color; -#pragma mapbox: define highp float base -#pragma mapbox: define highp float height -#pragma mapbox: define highp vec4 color -void main() { -#pragma mapbox: initialize highp float base -#pragma mapbox: initialize highp float height -#pragma mapbox: initialize highp vec4 color -vec3 normal=a_normal_ed.xyz; -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:ii(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; -#ifdef TERRAIN3D -attribute vec2 a_centroid; -#endif -varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 -? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:ii(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);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((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying 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:ii(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; -#define PI 3.141592653589793 -void main() {vec4 pixel=texture2D(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);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:ii(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -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);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float 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;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.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*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float 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; -#endif -v_width2=vec2(outset,inset);}`),lineGradient:ii(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -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);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float 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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);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*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float 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; -#endif -v_width2=vec2(outset,inset);}`),linePattern:ii(`#ifdef GL_ES -precision highp float; -#endif -uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.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);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -float 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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;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*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float 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; -#endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:ii(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -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);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float 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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;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*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float 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; -#endif -v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:ii(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(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);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:ii(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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 highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:ii(`#define SDF_PX 8.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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_pitch_with_map;uniform highp float u_pitch;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;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:ii(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {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=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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_pitch_with_map;uniform highp float u_pitch;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 vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:ii("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",wn),terrainDepth:ii("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",wn),terrainCoords:ii("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",wn)};function ii(d,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,o=t.match(/attribute ([\w]+) ([\w]+)/g),u=d.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),w=m?m.concat(u):u,T={};return{fragmentSource:d=d.replace(n,(I,C,P,z,V)=>(T[V]=!0,C==="define"?` -#ifndef HAS_UNIFORM_u_${V} -varying ${P} ${z} ${V}; -#else -uniform ${P} ${z} u_${V}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${V} - ${P} ${z} ${V} = u_${V}; -#endif -`)),vertexSource:t=t.replace(n,(I,C,P,z,V)=>{const H=z==="float"?"vec2":"vec4",W=V.match(/color/)?"color":H;return T[V]?C==="define"?` -#ifndef HAS_UNIFORM_u_${V} -uniform lowp float u_${V}_t; -attribute ${P} ${H} a_${V}; -varying ${P} ${z} ${V}; -#else -uniform ${P} ${z} u_${V}; -#endif -`:W==="vec4"?` -#ifndef HAS_UNIFORM_u_${V} - ${V} = a_${V}; -#else - ${P} ${z} ${V} = u_${V}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${V} - ${V} = unpack_mix_${W}(a_${V}, u_${V}_t); -#else - ${P} ${z} ${V} = u_${V}; -#endif -`:C==="define"?` -#ifndef HAS_UNIFORM_u_${V} -uniform lowp float u_${V}_t; -attribute ${P} ${H} a_${V}; -#else -uniform ${P} ${z} u_${V}; -#endif -`:W==="vec4"?` -#ifndef HAS_UNIFORM_u_${V} - ${P} ${z} ${V} = a_${V}; -#else - ${P} ${z} ${V} = u_${V}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${V} - ${P} ${z} ${V} = unpack_mix_${W}(a_${V}, u_${V}_t); -#else - ${P} ${z} ${V} = u_${V}; -#endif -`}),staticAttributes:o,staticUniforms:w}}class Eo{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,o,u,m,w,T,I,C){this.context=t;let P=this.boundPaintVertexBuffers.length!==u.length;for(let z=0;!P&&z({u_depth:new a.aG(_e,Ae.u_depth),u_terrain:new a.aG(_e,Ae.u_terrain),u_terrain_dim:new a.aH(_e,Ae.u_terrain_dim),u_terrain_matrix:new a.aI(_e,Ae.u_terrain_matrix),u_terrain_unpack:new a.aJ(_e,Ae.u_terrain_unpack),u_terrain_exaggeration:new a.aH(_e,Ae.u_terrain_exaggeration)}))(t,ve),this.binderUniforms=o?o.getUniforms(t,ve):[]}draw(t,n,o,u,m,w,T,I,C,P,z,V,H,W,J,Z,se,fe){const ee=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(o),t.setStencilMode(u),t.setColorMode(m),t.setCullFace(w),I){t.activeTexture.set(ee.TEXTURE2),ee.bindTexture(ee.TEXTURE_2D,I.depthTexture),t.activeTexture.set(ee.TEXTURE3),ee.bindTexture(ee.TEXTURE_2D,I.texture);for(const ve in this.terrainUniforms)this.terrainUniforms[ve].set(I[ve])}for(const ve in this.fixedUniforms)this.fixedUniforms[ve].set(T[ve]);J&&J.setUniforms(t,this.binderUniforms,H,{zoom:W});let ce=0;switch(n){case ee.LINES:ce=2;break;case ee.TRIANGLES:ce=3;break;case ee.LINE_STRIP:ce=1}for(const ve of V.get()){const _e=ve.vaos||(ve.vaos={});(_e[C]||(_e[C]=new Eo)).bind(t,this,P,J?J.getPaintVertexBuffers():[],z,ve.vertexOffset,Z,se,fe),ee.drawElements(n,ve.primitiveLength*ce,ee.UNSIGNED_SHORT,ve.primitiveOffset*ce*2)}}}function Po(d,t,n){const o=1/bt(n,1,t.transform.tileZoom),u=Math.pow(2,n.tileID.overscaledZ),m=n.tileSize*Math.pow(2,t.transform.tileZoom)/u,w=m*(n.tileID.canonical.x+n.tileID.wrap*u),T=m*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[o,d.fromScale,d.toScale],u_fade:d.t,u_pixel_coord_upper:[w>>16,T>>16],u_pixel_coord_lower:[65535&w,65535&T]}}const Js=(d,t,n,o)=>{const u=t.style.light,m=u.properties.get("position"),w=[m.x,m.y,m.z],T=function(){var C=new a.A(9);return a.A!=Float32Array&&(C[1]=0,C[2]=0,C[3]=0,C[5]=0,C[6]=0,C[7]=0),C[0]=1,C[4]=1,C[8]=1,C}();u.properties.get("anchor")==="viewport"&&function(C,P){var z=Math.sin(P),V=Math.cos(P);C[0]=V,C[1]=z,C[2]=0,C[3]=-z,C[4]=V,C[5]=0,C[6]=0,C[7]=0,C[8]=1}(T,-t.transform.angle),function(C,P,z){var V=P[0],H=P[1],W=P[2];C[0]=V*z[0]+H*z[3]+W*z[6],C[1]=V*z[1]+H*z[4]+W*z[7],C[2]=V*z[2]+H*z[5]+W*z[8]}(w,w,T);const I=u.properties.get("color");return{u_matrix:d,u_lightpos:w,u_lightintensity:u.properties.get("intensity"),u_lightcolor:[I.r,I.g,I.b],u_vertical_gradient:+n,u_opacity:o}},yu=(d,t,n,o,u,m,w)=>a.e(Js(d,t,n,o),Po(m,t,w),{u_height_factor:-Math.pow(2,u.overscaledZ)/w.tileSize/8}),ec=d=>({u_matrix:d}),zo=(d,t,n,o)=>a.e(ec(d),Po(n,t,o)),vu=(d,t)=>({u_matrix:d,u_world:t}),tc=(d,t,n,o,u)=>a.e(zo(d,t,n,o),{u_world:u}),xu=(d,t,n,o)=>{const u=d.transform;let m,w;if(o.paint.get("circle-pitch-alignment")==="map"){const T=bt(n,1,u.zoom);m=!0,w=[T,T]}else m=!1,w=u.pixelsToGLUnits;return{u_camera_to_center_distance:u.cameraToCenterDistance,u_scale_with_map:+(o.paint.get("circle-pitch-scale")==="map"),u_matrix:d.translatePosMatrix(t.posMatrix,n,o.paint.get("circle-translate"),o.paint.get("circle-translate-anchor")),u_pitch_with_map:+m,u_device_pixel_ratio:d.pixelRatio,u_extrude_scale:w}},ic=(d,t,n)=>{const o=bt(n,1,t.zoom),u=Math.pow(2,t.zoom-n.tileID.overscaledZ),m=n.tileID.overscaleFactor();return{u_matrix:d,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:o,u_extrude_scale:[t.pixelsToGLUnits[0]/(o*u),t.pixelsToGLUnits[1]/(o*u)],u_overscale_factor:m}},rc=(d,t,n=1)=>({u_matrix:d,u_color:t,u_overlay:0,u_overlay_scale:n}),Lo=d=>({u_matrix:d}),nc=(d,t,n,o)=>({u_matrix:d,u_extrude_scale:bt(t,1,n),u_intensity:o});function sc(d,t){const n=Math.pow(2,t.canonical.z),o=t.canonical.y;return[new a.Y(0,o/n).toLngLat().lat,new a.Y(0,(o+1)/n).toLngLat().lat]}const Do=(d,t,n,o)=>{const u=d.transform;return{u_matrix:Qs(d,t,n,o),u_ratio:1/bt(t,1,u.zoom),u_device_pixel_ratio:d.pixelRatio,u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]]}},oc=(d,t,n,o,u)=>a.e(Do(d,t,n,u),{u_image:0,u_image_height:o}),ts=(d,t,n,o,u)=>{const m=d.transform,w=Gr(t,m);return{u_matrix:Qs(d,t,n,u),u_texsize:t.imageAtlasTexture.size,u_ratio:1/bt(t,1,m.zoom),u_device_pixel_ratio:d.pixelRatio,u_image:0,u_scale:[w,o.fromScale,o.toScale],u_fade:o.t,u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]]}},Ro=(d,t,n,o,u,m)=>{const w=d.lineAtlas,T=Gr(t,d.transform),I=n.layout.get("line-cap")==="round",C=w.getDash(o.from,I),P=w.getDash(o.to,I),z=C.width*u.fromScale,V=P.width*u.toScale;return a.e(Do(d,t,n,m),{u_patternscale_a:[T/z,-C.height/2],u_patternscale_b:[T/V,-P.height/2],u_sdfgamma:w.width/(256*Math.min(z,V)*d.pixelRatio)/2,u_image:0,u_tex_y_a:C.y,u_tex_y_b:P.y,u_mix:u.t})};function Gr(d,t){return 1/bt(d,1,t.tileZoom)}function Qs(d,t,n,o){return d.translatePosMatrix(o?o.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const Bo=(d,t,n,o,u)=>{return{u_matrix:d,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:o.mix,u_opacity:o.opacity*u.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:u.paint.get("raster-brightness-min"),u_brightness_high:u.paint.get("raster-brightness-max"),u_saturation_factor:(w=u.paint.get("raster-saturation"),w>0?1-1/(1.001-w):-w),u_contrast_factor:(m=u.paint.get("raster-contrast"),m>0?1/(1-m):1+m),u_spin_weights:$s(u.paint.get("raster-hue-rotate"))};var m,w};function $s(d){d*=Math.PI/180;const t=Math.sin(d),n=Math.cos(d);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const eo=(d,t,n,o,u,m,w,T,I,C)=>{const P=u.transform;return{u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:P.cameraToCenterDistance,u_pitch:P.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:P.width/P.height,u_fade_change:u.options.fadeDuration?u.symbolFadeChange:1,u_matrix:m,u_label_plane_matrix:w,u_coord_matrix:T,u_is_text:+I,u_pitch_with_map:+o,u_texsize:C,u_texture:0}},to=(d,t,n,o,u,m,w,T,I,C,P)=>{const z=u.transform;return a.e(eo(d,t,n,o,u,m,w,T,I,C),{u_gamma_scale:o?Math.cos(z._pitch)*z.cameraToCenterDistance:1,u_device_pixel_ratio:u.pixelRatio,u_is_halo:+P})},io=(d,t,n,o,u,m,w,T,I,C)=>a.e(to(d,t,n,o,u,m,w,T,!0,I,!0),{u_texsize_icon:C,u_texture_icon:1}),bu=(d,t,n)=>({u_matrix:d,u_opacity:t,u_color:n}),wu=(d,t,n,o,u,m)=>a.e(function(w,T,I,C){const P=I.imageManager.getPattern(w.from.toString()),z=I.imageManager.getPattern(w.to.toString()),{width:V,height:H}=I.imageManager.getPixelSize(),W=Math.pow(2,C.tileID.overscaledZ),J=C.tileSize*Math.pow(2,I.transform.tileZoom)/W,Z=J*(C.tileID.canonical.x+C.tileID.wrap*W),se=J*C.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:P.tl,u_pattern_br_a:P.br,u_pattern_tl_b:z.tl,u_pattern_br_b:z.br,u_texsize:[V,H],u_mix:T.t,u_pattern_size_a:P.displaySize,u_pattern_size_b:z.displaySize,u_scale_a:T.fromScale,u_scale_b:T.toScale,u_tile_units_to_pixels:1/bt(C,1,I.transform.tileZoom),u_pixel_coord_upper:[Z>>16,se>>16],u_pixel_coord_lower:[65535&Z,65535&se]}}(o,m,n,u),{u_matrix:d,u_opacity:t}),ac={fillExtrusion:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_lightpos:new a.aK(d,t.u_lightpos),u_lightintensity:new a.aH(d,t.u_lightintensity),u_lightcolor:new a.aK(d,t.u_lightcolor),u_vertical_gradient:new a.aH(d,t.u_vertical_gradient),u_opacity:new a.aH(d,t.u_opacity)}),fillExtrusionPattern:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_lightpos:new a.aK(d,t.u_lightpos),u_lightintensity:new a.aH(d,t.u_lightintensity),u_lightcolor:new a.aK(d,t.u_lightcolor),u_vertical_gradient:new a.aH(d,t.u_vertical_gradient),u_height_factor:new a.aH(d,t.u_height_factor),u_image:new a.aG(d,t.u_image),u_texsize:new a.aL(d,t.u_texsize),u_pixel_coord_upper:new a.aL(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new a.aL(d,t.u_pixel_coord_lower),u_scale:new a.aK(d,t.u_scale),u_fade:new a.aH(d,t.u_fade),u_opacity:new a.aH(d,t.u_opacity)}),fill:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix)}),fillPattern:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_image:new a.aG(d,t.u_image),u_texsize:new a.aL(d,t.u_texsize),u_pixel_coord_upper:new a.aL(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new a.aL(d,t.u_pixel_coord_lower),u_scale:new a.aK(d,t.u_scale),u_fade:new a.aH(d,t.u_fade)}),fillOutline:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_world:new a.aL(d,t.u_world)}),fillOutlinePattern:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_world:new a.aL(d,t.u_world),u_image:new a.aG(d,t.u_image),u_texsize:new a.aL(d,t.u_texsize),u_pixel_coord_upper:new a.aL(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new a.aL(d,t.u_pixel_coord_lower),u_scale:new a.aK(d,t.u_scale),u_fade:new a.aH(d,t.u_fade)}),circle:(d,t)=>({u_camera_to_center_distance:new a.aH(d,t.u_camera_to_center_distance),u_scale_with_map:new a.aG(d,t.u_scale_with_map),u_pitch_with_map:new a.aG(d,t.u_pitch_with_map),u_extrude_scale:new a.aL(d,t.u_extrude_scale),u_device_pixel_ratio:new a.aH(d,t.u_device_pixel_ratio),u_matrix:new a.aI(d,t.u_matrix)}),collisionBox:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_camera_to_center_distance:new a.aH(d,t.u_camera_to_center_distance),u_pixels_to_tile_units:new a.aH(d,t.u_pixels_to_tile_units),u_extrude_scale:new a.aL(d,t.u_extrude_scale),u_overscale_factor:new a.aH(d,t.u_overscale_factor)}),collisionCircle:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_inv_matrix:new a.aI(d,t.u_inv_matrix),u_camera_to_center_distance:new a.aH(d,t.u_camera_to_center_distance),u_viewport_size:new a.aL(d,t.u_viewport_size)}),debug:(d,t)=>({u_color:new a.aM(d,t.u_color),u_matrix:new a.aI(d,t.u_matrix),u_overlay:new a.aG(d,t.u_overlay),u_overlay_scale:new a.aH(d,t.u_overlay_scale)}),clippingMask:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix)}),heatmap:(d,t)=>({u_extrude_scale:new a.aH(d,t.u_extrude_scale),u_intensity:new a.aH(d,t.u_intensity),u_matrix:new a.aI(d,t.u_matrix)}),heatmapTexture:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_world:new a.aL(d,t.u_world),u_image:new a.aG(d,t.u_image),u_color_ramp:new a.aG(d,t.u_color_ramp),u_opacity:new a.aH(d,t.u_opacity)}),hillshade:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_image:new a.aG(d,t.u_image),u_latrange:new a.aL(d,t.u_latrange),u_light:new a.aL(d,t.u_light),u_shadow:new a.aM(d,t.u_shadow),u_highlight:new a.aM(d,t.u_highlight),u_accent:new a.aM(d,t.u_accent)}),hillshadePrepare:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_image:new a.aG(d,t.u_image),u_dimension:new a.aL(d,t.u_dimension),u_zoom:new a.aH(d,t.u_zoom),u_unpack:new a.aJ(d,t.u_unpack)}),line:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_ratio:new a.aH(d,t.u_ratio),u_device_pixel_ratio:new a.aH(d,t.u_device_pixel_ratio),u_units_to_pixels:new a.aL(d,t.u_units_to_pixels)}),lineGradient:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_ratio:new a.aH(d,t.u_ratio),u_device_pixel_ratio:new a.aH(d,t.u_device_pixel_ratio),u_units_to_pixels:new a.aL(d,t.u_units_to_pixels),u_image:new a.aG(d,t.u_image),u_image_height:new a.aH(d,t.u_image_height)}),linePattern:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_texsize:new a.aL(d,t.u_texsize),u_ratio:new a.aH(d,t.u_ratio),u_device_pixel_ratio:new a.aH(d,t.u_device_pixel_ratio),u_image:new a.aG(d,t.u_image),u_units_to_pixels:new a.aL(d,t.u_units_to_pixels),u_scale:new a.aK(d,t.u_scale),u_fade:new a.aH(d,t.u_fade)}),lineSDF:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_ratio:new a.aH(d,t.u_ratio),u_device_pixel_ratio:new a.aH(d,t.u_device_pixel_ratio),u_units_to_pixels:new a.aL(d,t.u_units_to_pixels),u_patternscale_a:new a.aL(d,t.u_patternscale_a),u_patternscale_b:new a.aL(d,t.u_patternscale_b),u_sdfgamma:new a.aH(d,t.u_sdfgamma),u_image:new a.aG(d,t.u_image),u_tex_y_a:new a.aH(d,t.u_tex_y_a),u_tex_y_b:new a.aH(d,t.u_tex_y_b),u_mix:new a.aH(d,t.u_mix)}),raster:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_tl_parent:new a.aL(d,t.u_tl_parent),u_scale_parent:new a.aH(d,t.u_scale_parent),u_buffer_scale:new a.aH(d,t.u_buffer_scale),u_fade_t:new a.aH(d,t.u_fade_t),u_opacity:new a.aH(d,t.u_opacity),u_image0:new a.aG(d,t.u_image0),u_image1:new a.aG(d,t.u_image1),u_brightness_low:new a.aH(d,t.u_brightness_low),u_brightness_high:new a.aH(d,t.u_brightness_high),u_saturation_factor:new a.aH(d,t.u_saturation_factor),u_contrast_factor:new a.aH(d,t.u_contrast_factor),u_spin_weights:new a.aK(d,t.u_spin_weights)}),symbolIcon:(d,t)=>({u_is_size_zoom_constant:new a.aG(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aG(d,t.u_is_size_feature_constant),u_size_t:new a.aH(d,t.u_size_t),u_size:new a.aH(d,t.u_size),u_camera_to_center_distance:new a.aH(d,t.u_camera_to_center_distance),u_pitch:new a.aH(d,t.u_pitch),u_rotate_symbol:new a.aG(d,t.u_rotate_symbol),u_aspect_ratio:new a.aH(d,t.u_aspect_ratio),u_fade_change:new a.aH(d,t.u_fade_change),u_matrix:new a.aI(d,t.u_matrix),u_label_plane_matrix:new a.aI(d,t.u_label_plane_matrix),u_coord_matrix:new a.aI(d,t.u_coord_matrix),u_is_text:new a.aG(d,t.u_is_text),u_pitch_with_map:new a.aG(d,t.u_pitch_with_map),u_texsize:new a.aL(d,t.u_texsize),u_texture:new a.aG(d,t.u_texture)}),symbolSDF:(d,t)=>({u_is_size_zoom_constant:new a.aG(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aG(d,t.u_is_size_feature_constant),u_size_t:new a.aH(d,t.u_size_t),u_size:new a.aH(d,t.u_size),u_camera_to_center_distance:new a.aH(d,t.u_camera_to_center_distance),u_pitch:new a.aH(d,t.u_pitch),u_rotate_symbol:new a.aG(d,t.u_rotate_symbol),u_aspect_ratio:new a.aH(d,t.u_aspect_ratio),u_fade_change:new a.aH(d,t.u_fade_change),u_matrix:new a.aI(d,t.u_matrix),u_label_plane_matrix:new a.aI(d,t.u_label_plane_matrix),u_coord_matrix:new a.aI(d,t.u_coord_matrix),u_is_text:new a.aG(d,t.u_is_text),u_pitch_with_map:new a.aG(d,t.u_pitch_with_map),u_texsize:new a.aL(d,t.u_texsize),u_texture:new a.aG(d,t.u_texture),u_gamma_scale:new a.aH(d,t.u_gamma_scale),u_device_pixel_ratio:new a.aH(d,t.u_device_pixel_ratio),u_is_halo:new a.aG(d,t.u_is_halo)}),symbolTextAndIcon:(d,t)=>({u_is_size_zoom_constant:new a.aG(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aG(d,t.u_is_size_feature_constant),u_size_t:new a.aH(d,t.u_size_t),u_size:new a.aH(d,t.u_size),u_camera_to_center_distance:new a.aH(d,t.u_camera_to_center_distance),u_pitch:new a.aH(d,t.u_pitch),u_rotate_symbol:new a.aG(d,t.u_rotate_symbol),u_aspect_ratio:new a.aH(d,t.u_aspect_ratio),u_fade_change:new a.aH(d,t.u_fade_change),u_matrix:new a.aI(d,t.u_matrix),u_label_plane_matrix:new a.aI(d,t.u_label_plane_matrix),u_coord_matrix:new a.aI(d,t.u_coord_matrix),u_is_text:new a.aG(d,t.u_is_text),u_pitch_with_map:new a.aG(d,t.u_pitch_with_map),u_texsize:new a.aL(d,t.u_texsize),u_texsize_icon:new a.aL(d,t.u_texsize_icon),u_texture:new a.aG(d,t.u_texture),u_texture_icon:new a.aG(d,t.u_texture_icon),u_gamma_scale:new a.aH(d,t.u_gamma_scale),u_device_pixel_ratio:new a.aH(d,t.u_device_pixel_ratio),u_is_halo:new a.aG(d,t.u_is_halo)}),background:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_opacity:new a.aH(d,t.u_opacity),u_color:new a.aM(d,t.u_color)}),backgroundPattern:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_opacity:new a.aH(d,t.u_opacity),u_image:new a.aG(d,t.u_image),u_pattern_tl_a:new a.aL(d,t.u_pattern_tl_a),u_pattern_br_a:new a.aL(d,t.u_pattern_br_a),u_pattern_tl_b:new a.aL(d,t.u_pattern_tl_b),u_pattern_br_b:new a.aL(d,t.u_pattern_br_b),u_texsize:new a.aL(d,t.u_texsize),u_mix:new a.aH(d,t.u_mix),u_pattern_size_a:new a.aL(d,t.u_pattern_size_a),u_pattern_size_b:new a.aL(d,t.u_pattern_size_b),u_scale_a:new a.aH(d,t.u_scale_a),u_scale_b:new a.aH(d,t.u_scale_b),u_pixel_coord_upper:new a.aL(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new a.aL(d,t.u_pixel_coord_lower),u_tile_units_to_pixels:new a.aH(d,t.u_tile_units_to_pixels)}),terrain:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_texture:new a.aG(d,t.u_texture),u_ele_delta:new a.aH(d,t.u_ele_delta)}),terrainDepth:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_ele_delta:new a.aH(d,t.u_ele_delta)}),terrainCoords:(d,t)=>({u_matrix:new a.aI(d,t.u_matrix),u_texture:new a.aG(d,t.u_texture),u_terrain_coords_id:new a.aH(d,t.u_terrain_coords_id),u_ele_delta:new a.aH(d,t.u_ele_delta)})};class Su{constructor(t,n,o){this.context=t;const u=t.gl;this.buffer=u.createBuffer(),this.dynamicDraw=!!o,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),u.bufferData(u.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?u.DYNAMIC_DRAW:u.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const is={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Fo{constructor(t,n,o,u){this.length=n.length,this.attributes=o,this.itemSize=n.bytesPerElement,this.dynamicDraw=u,this.context=t;const m=t.gl;this.buffer=m.createBuffer(),t.bindVertexBuffer.set(this.buffer),m.bufferData(m.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?m.DYNAMIC_DRAW:m.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let o=0;o0){const Ze=a.F(),st=Ae;a.aP(Ze,_e.placementInvProjMatrix,d.transform.glCoordMatrix),a.aP(Ze,Ze,_e.placementViewportMatrix),P.push({circleArray:Le,circleOffset:V,transform:st,invTransform:Ze,coord:ce}),z+=Le.length/4,V=z}Re&&C.draw(T,I.LINES,qt.disabled,di.disabled,d.colorModeForRenderPass(),ci.disabled,ic(Ae,d.transform,ve),d.style.map.terrain&&d.style.map.terrain.getTerrainData(ce),n.id,Re.layoutVertexBuffer,Re.indexBuffer,Re.segments,null,d.transform.zoom,null,null,Re.collisionVertexBuffer)}if(!w||!P.length)return;const H=d.useProgram("collisionCircle"),W=new a.aQ;W.resize(4*z),W._trim();let J=0;for(const ee of P)for(let ce=0;ce=0&&(W[Z.associatedIconIndex]={shiftedAnchor:vt,angle:Je})}else Me(Z.numGlyphs,V)}if(C){H.clear();const J=d.icon.placedSymbolArray;for(let Z=0;Zd.style.map.terrain.getElevation(Re,nr,Ki):null,Xi=n.layout.get("text-rotation-alignment")==="map";B(Ze,Re.posMatrix,d,u,fr,tn,Z,C,Xi,mi)}const Os=d.translatePosMatrix(Re.posMatrix,Le,m,w),Gn=se||u&&_e||Fs?Ga:fr,Wi=d.translatePosMatrix(tn,Le,m,w,!0),Oi=Je&&n.paint.get(u?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Pi;Pi=Je?Ze.iconsInText?io(yt.kind,Bt,fe,Z,d,Os,Gn,Wi,Ft,rr):to(yt.kind,Bt,fe,Z,d,Os,Gn,Wi,u,Ft,!0):eo(yt.kind,Bt,fe,Z,d,Os,Gn,Wi,u,Ft);const Ir={program:fi,buffers:st,uniformValues:Pi,atlasTexture:Fi,atlasTextureIcon:Ei,atlasInterpolation:ni,atlasInterpolationIcon:Tr,isSDF:Je,hasHalo:Oi};if(ee&&Ze.canOverlap){ce=!0;const mi=st.segments.get();for(const Xi of mi)Ae.push({segments:new a.$([Xi]),sortKey:Xi.sortKey,state:Ir,terrainData:Pt})}else Ae.push({segments:st.segments,sortKey:0,state:Ir,terrainData:Pt})}ce&&Ae.sort((Re,Le)=>Re.sortKey-Le.sortKey);for(const Re of Ae){const Le=Re.state;if(V.activeTexture.set(H.TEXTURE0),Le.atlasTexture.bind(Le.atlasInterpolation,H.CLAMP_TO_EDGE),Le.atlasTextureIcon&&(V.activeTexture.set(H.TEXTURE1),Le.atlasTextureIcon&&Le.atlasTextureIcon.bind(Le.atlasInterpolationIcon,H.CLAMP_TO_EDGE)),Le.isSDF){const Ze=Le.uniformValues;Le.hasHalo&&(Ze.u_is_halo=1,gc(Le.buffers,Re.segments,n,d,Le.program,ve,P,z,Ze,Re.terrainData)),Ze.u_is_halo=0}gc(Le.buffers,Re.segments,n,d,Le.program,ve,P,z,Le.uniformValues,Re.terrainData)}}function gc(d,t,n,o,u,m,w,T,I,C){const P=o.context;u.draw(P,P.gl.TRIANGLES,m,w,T,ci.disabled,I,C,n.id,d.layoutVertexBuffer,d.indexBuffer,t,n.paint,o.transform.zoom,d.programConfigurations.get(n.id),d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer)}function Xo(d,t,n,o,u){if(!n||!o||!o.imageAtlas)return;const m=o.imageAtlas.patternPositions;let w=m[n.to.toString()],T=m[n.from.toString()];if(!w&&T&&(w=T),!T&&w&&(T=w),!w||!T){const I=u.getPaintProperty(t);w=m[I],T=m[I]}w&&T&&d.setConstantPatternPositions(w,T)}function _c(d,t,n,o,u,m,w){const T=d.context.gl,I="fill-pattern",C=n.paint.get(I),P=C&&C.constantOr(1),z=n.getCrossfadeParameters();let V,H,W,J,Z;w?(H=P&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",V=T.LINES):(H=P?"fillPattern":"fill",V=T.TRIANGLES);const se=C.constantOr(null);for(const fe of o){const ee=t.getTile(fe);if(P&&!ee.patternsLoaded())continue;const ce=ee.getBucket(n);if(!ce)continue;const ve=ce.programConfigurations.get(n.id),_e=d.useProgram(H,ve),Ae=d.style.map.terrain&&d.style.map.terrain.getTerrainData(fe);P&&(d.context.activeTexture.set(T.TEXTURE0),ee.imageAtlasTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),ve.updatePaintBuffers(z)),Xo(ve,I,se,ee,n);const Re=Ae?fe:null,Le=d.translatePosMatrix(Re?Re.posMatrix:fe.posMatrix,ee,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(w){J=ce.indexBuffer2,Z=ce.segments2;const Ze=[T.drawingBufferWidth,T.drawingBufferHeight];W=H==="fillOutlinePattern"&&P?tc(Le,d,z,ee,Ze):vu(Le,Ze)}else J=ce.indexBuffer,Z=ce.segments,W=P?zo(Le,d,z,ee):ec(Le);_e.draw(d.context,V,u,d.stencilModeForClipping(fe),m,ci.disabled,W,Ae,n.id,ce.layoutVertexBuffer,J,Z,n.paint,d.transform.zoom,ve)}}function Ko(d,t,n,o,u,m,w){const T=d.context,I=T.gl,C="fill-extrusion-pattern",P=n.paint.get(C),z=P.constantOr(1),V=n.getCrossfadeParameters(),H=n.paint.get("fill-extrusion-opacity"),W=P.constantOr(null);for(const J of o){const Z=t.getTile(J),se=Z.getBucket(n);if(!se)continue;const fe=d.style.map.terrain&&d.style.map.terrain.getTerrainData(J),ee=se.programConfigurations.get(n.id),ce=d.useProgram(z?"fillExtrusionPattern":"fillExtrusion",ee);z&&(d.context.activeTexture.set(I.TEXTURE0),Z.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),ee.updatePaintBuffers(V)),Xo(ee,C,W,Z,n);const ve=d.translatePosMatrix(J.posMatrix,Z,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),_e=n.paint.get("fill-extrusion-vertical-gradient"),Ae=z?yu(ve,d,_e,H,J,V,Z):Js(ve,d,_e,H);ce.draw(T,T.gl.TRIANGLES,u,m,w,ci.backCCW,Ae,fe,n.id,se.layoutVertexBuffer,se.indexBuffer,se.segments,n.paint,d.transform.zoom,ee,d.style.map.terrain&&se.centroidVertexBuffer)}}function Yo(d,t,n,o,u,m,w){const T=d.context,I=T.gl,C=n.fbo;if(!C)return;const P=d.useProgram("hillshade"),z=d.style.map.terrain&&d.style.map.terrain.getTerrainData(t);T.activeTexture.set(I.TEXTURE0),I.bindTexture(I.TEXTURE_2D,C.colorAttachment.get()),P.draw(T,I.TRIANGLES,u,m,w,ci.disabled,((V,H,W,J)=>{const Z=W.paint.get("hillshade-shadow-color"),se=W.paint.get("hillshade-highlight-color"),fe=W.paint.get("hillshade-accent-color");let ee=W.paint.get("hillshade-illumination-direction")*(Math.PI/180);W.paint.get("hillshade-illumination-anchor")==="viewport"&&(ee-=V.transform.angle);const ce=!V.options.moving;return{u_matrix:J?J.posMatrix:V.transform.calculatePosMatrix(H.tileID.toUnwrapped(),ce),u_image:0,u_latrange:sc(0,H.tileID),u_light:[W.paint.get("hillshade-exaggeration"),ee],u_shadow:Z,u_highlight:se,u_accent:fe}})(d,n,o,z?t:null),z,o.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments)}function Ha(d,t,n,o,u,m){const w=d.context,T=w.gl,I=t.dem;if(I&&I.data){const C=I.dim,P=I.stride,z=I.getPixels();if(w.activeTexture.set(T.TEXTURE1),w.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||d.getTileTexture(P),t.demTexture){const H=t.demTexture;H.update(z,{premultiply:!1}),H.bind(T.NEAREST,T.CLAMP_TO_EDGE)}else t.demTexture=new De(w,z,T.RGBA,{premultiply:!1}),t.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE);w.activeTexture.set(T.TEXTURE0);let V=t.fbo;if(!V){const H=new De(w,{width:C,height:C,data:null},T.RGBA);H.bind(T.LINEAR,T.CLAMP_TO_EDGE),V=t.fbo=w.createFramebuffer(C,C,!0,!1),V.colorAttachment.set(H.texture)}w.bindFramebuffer.set(V.framebuffer),w.viewport.set([0,0,C,C]),d.useProgram("hillshadePrepare").draw(w,T.TRIANGLES,o,u,m,ci.disabled,((H,W)=>{const J=W.stride,Z=a.F();return a.aN(Z,0,a.W,-a.W,0,0,1),a.H(Z,Z,[0,-a.W,0]),{u_matrix:Z,u_image:1,u_dimension:[J,J],u_zoom:H.overscaledZ,u_unpack:W.getUnpackVector()}})(t.tileID,I),null,n.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function yc(d,t,n,o,u,m){const w=o.paint.get("raster-fade-duration");if(!m&&w>0){const T=j.now(),I=(T-d.timeAdded)/w,C=t?(T-t.timeAdded)/w:-1,P=n.getSource(),z=u.coveringZoomLevel({tileSize:P.tileSize,roundZoom:P.roundZoom}),V=!t||Math.abs(t.tileID.overscaledZ-z)>Math.abs(d.tileID.overscaledZ-z),H=V&&d.refreshedUponExpiration?1:a.ac(V?I:1-C,0,1);return d.refreshedUponExpiration&&I>=1&&(d.refreshedUponExpiration=!1),t?{opacity:1,mix:1-H}:{opacity:H,mix:0}}return{opacity:1,mix:0}}const vc=new a.aO(1,0,0,1),Jo=new a.aO(0,1,0,1),Wa=new a.aO(0,0,1,1),zu=new a.aO(1,0,1,1),xc=new a.aO(0,1,1,1);function Mi(d,t,n,o){wr(d,0,t+n/2,d.transform.width,n,o)}function Un(d,t,n,o){wr(d,t-n/2,0,n,d.transform.height,o)}function wr(d,t,n,o,u,m){const w=d.context,T=w.gl;T.enable(T.SCISSOR_TEST),T.scissor(t*d.pixelRatio,n*d.pixelRatio,o*d.pixelRatio,u*d.pixelRatio),w.clear({color:m}),T.disable(T.SCISSOR_TEST)}function Xa(d,t,n){const o=d.context,u=o.gl,m=n.posMatrix,w=d.useProgram("debug"),T=qt.disabled,I=di.disabled,C=d.colorModeForRenderPass(),P="$debug",z=d.style.map.terrain&&d.style.map.terrain.getTerrainData(n);o.activeTexture.set(u.TEXTURE0);const V=t.getTileByID(n.key).latestRawTileData,H=Math.floor((V&&V.byteLength||0)/1024),W=t.getTile(n).tileSize,J=512/Math.min(W,512)*(n.overscaledZ/d.transform.zoom)*.5;let Z=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(Z+=` => ${n.overscaledZ}`),function(se,fe){se.initDebugOverlayCanvas();const ee=se.debugOverlayCanvas,ce=se.context.gl,ve=se.debugOverlayCanvas.getContext("2d");ve.clearRect(0,0,ee.width,ee.height),ve.shadowColor="white",ve.shadowBlur=2,ve.lineWidth=1.5,ve.strokeStyle="white",ve.textBaseline="top",ve.font="bold 36px Open Sans, sans-serif",ve.fillText(fe,5,5),ve.strokeText(fe,5,5),se.debugOverlayTexture.update(ee),se.debugOverlayTexture.bind(ce.LINEAR,ce.CLAMP_TO_EDGE)}(d,`${Z} ${H}kB`),w.draw(o,u.TRIANGLES,T,I,Ri.alphaBlended,ci.disabled,rc(m,a.aO.transparent,J),null,P,d.debugBuffer,d.quadTriangleIndexBuffer,d.debugSegments),w.draw(o,u.LINE_STRIP,T,I,C,ci.disabled,rc(m,a.aO.red),z,P,d.debugBuffer,d.tileBorderIndexBuffer,d.debugSegments)}function Qo(d,t,n){const o=d.context,u=o.gl,m=d.colorModeForRenderPass(),w=new qt(u.LEQUAL,qt.ReadWrite,d.depthRangeFor3D),T=d.useProgram("terrain"),I=t.getTerrainMesh();o.bindFramebuffer.set(null),o.viewport.set([0,0,d.width,d.height]);for(const C of n){const P=d.renderToTexture.getTexture(C),z=t.getTerrainData(C.tileID);o.activeTexture.set(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,P.texture);const V={u_matrix:d.transform.calculatePosMatrix(C.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(d.transform.zoom)};T.draw(o,u.TRIANGLES,w,di.disabled,m,ci.backCCW,V,z,"terrain",I.vertexBuffer,I.indexBuffer,I.segments)}}class bc{constructor(t,n){this.context=new Pu(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:a.F(),renderTime:0},this.setup(),this.numSublayers=hr.maxUnderzooming+hr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Vn}resize(t,n,o){if(this.width=Math.floor(t*o),this.height=Math.floor(n*o),this.pixelRatio=o,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const u of this.style._order)this.style._layers[u].resize()}setup(){const t=this.context,n=new a.aV;n.emplaceBack(0,0),n.emplaceBack(a.W,0),n.emplaceBack(0,a.W),n.emplaceBack(a.W,a.W),this.tileExtentBuffer=t.createVertexBuffer(n,Ao.members),this.tileExtentSegments=a.$.simpleSegment(0,0,4,2);const o=new a.aV;o.emplaceBack(0,0),o.emplaceBack(a.W,0),o.emplaceBack(0,a.W),o.emplaceBack(a.W,a.W),this.debugBuffer=t.createVertexBuffer(o,Ao.members),this.debugSegments=a.$.simpleSegment(0,0,4,5);const u=new a.Z;u.emplaceBack(0,0,0,0),u.emplaceBack(a.W,0,a.W,0),u.emplaceBack(0,a.W,0,a.W),u.emplaceBack(a.W,a.W,a.W,a.W),this.rasterBoundsBuffer=t.createVertexBuffer(u,or.members),this.rasterBoundsSegments=a.$.simpleSegment(0,0,4,2);const m=new a.aV;m.emplaceBack(0,0),m.emplaceBack(1,0),m.emplaceBack(0,1),m.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(m,Ao.members),this.viewportSegments=a.$.simpleSegment(0,0,4,2);const w=new a.aW;w.emplaceBack(0),w.emplaceBack(1),w.emplaceBack(3),w.emplaceBack(2),w.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(w);const T=new a.aX;T.emplaceBack(0,1,2),T.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(T);const I=this.context.gl;this.stencilClearMode=new di({func:I.ALWAYS,mask:0},0,255,I.ZERO,I.ZERO,I.ZERO)}clearStencil(){const t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const o=a.F();a.aN(o,0,this.width,this.height,0,0,1),a.J(o,o,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,n.TRIANGLES,qt.disabled,this.stencilClearMode,Ri.disabled,ci.disabled,Lo(o),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source;const o=this.context,u=o.gl;this.nextStencilID+n.length>256&&this.clearStencil(),o.setColorMode(Ri.disabled),o.setDepthMode(qt.disabled);const m=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const w of n){const T=this._tileClippingMaskIDs[w.key]=this.nextStencilID++,I=this.style.map.terrain&&this.style.map.terrain.getTerrainData(w);m.draw(o,u.TRIANGLES,qt.disabled,new di({func:u.ALWAYS,mask:0},T,255,u.KEEP,u.KEEP,u.REPLACE),Ri.disabled,ci.disabled,Lo(w.posMatrix),I,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new di({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new di({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,o=t.sort((w,T)=>T.overscaledZ-w.overscaledZ),u=o[o.length-1].overscaledZ,m=o[0].overscaledZ-u+1;if(m>1){this.currentStencilSource=void 0,this.nextStencilID+m>256&&this.clearStencil();const w={};for(let T=0;T=0;this.currentLayer--){const I=this.style._layers[o[this.currentLayer]],C=u[I.source],P=m[I.source];this._renderTileClippingMasks(I,P),this.renderLayer(this,C,I,P)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerZ.source&&!Z.isHidden(P)?[C.sourceCaches[Z.source]]:[]),H=V.filter(Z=>Z.getSource().type==="vector"),W=V.filter(Z=>Z.getSource().type!=="vector"),J=Z=>{(!z||z.getSource().maxzoomJ(Z)),z||W.forEach(Z=>J(Z)),z}(this.style,this.transform.zoom);I&&function(C,P,z){for(let V=0;VH.style.map.terrain.getElevation(_e,yt,lt):null)}}}(I,m,T,w,T.layout.get("text-rotation-alignment"),T.layout.get("text-pitch-alignment"),C),T.paint.get("icon-opacity").constantOr(1)!==0&&Wo(m,w,T,I,!1,T.paint.get("icon-translate"),T.paint.get("icon-translate-anchor"),T.layout.get("icon-rotation-alignment"),T.layout.get("icon-pitch-alignment"),T.layout.get("icon-keep-upright"),P,z),T.paint.get("text-opacity").constantOr(1)!==0&&Wo(m,w,T,I,!0,T.paint.get("text-translate"),T.paint.get("text-translate-anchor"),T.layout.get("text-rotation-alignment"),T.layout.get("text-pitch-alignment"),T.layout.get("text-keep-upright"),P,z),w.map.showCollisionBoxes&&(Zo(m,w,T,I,T.paint.get("text-translate"),T.paint.get("text-translate-anchor"),!0),Zo(m,w,T,I,T.paint.get("icon-translate"),T.paint.get("icon-translate-anchor"),!1))})(t,n,o,u,this.style.placement.variableOffsets);break;case"circle":(function(m,w,T,I){if(m.renderPass!=="translucent")return;const C=T.paint.get("circle-opacity"),P=T.paint.get("circle-stroke-width"),z=T.paint.get("circle-stroke-opacity"),V=!T.layout.get("circle-sort-key").isConstant();if(C.constantOr(1)===0&&(P.constantOr(1)===0||z.constantOr(1)===0))return;const H=m.context,W=H.gl,J=m.depthModeForSublayer(0,qt.ReadOnly),Z=di.disabled,se=m.colorModeForRenderPass(),fe=[];for(let ee=0;eeee.sortKey-ce.sortKey);for(const ee of fe){const{programConfiguration:ce,program:ve,layoutVertexBuffer:_e,indexBuffer:Ae,uniformValues:Re,terrainData:Le}=ee.state;ve.draw(H,W.TRIANGLES,J,Z,se,ci.disabled,Re,Le,T.id,_e,Ae,ee.segments,T.paint,m.transform.zoom,ce)}})(t,n,o,u);break;case"heatmap":(function(m,w,T,I){if(T.paint.get("heatmap-opacity")!==0)if(m.renderPass==="offscreen"){const C=m.context,P=C.gl,z=di.disabled,V=new Ri([P.ONE,P.ONE],a.aO.transparent,[!0,!0,!0,!0]);(function(H,W,J){const Z=H.gl;H.activeTexture.set(Z.TEXTURE1),H.viewport.set([0,0,W.width/4,W.height/4]);let se=J.heatmapFbo;if(se)Z.bindTexture(Z.TEXTURE_2D,se.colorAttachment.get()),H.bindFramebuffer.set(se.framebuffer);else{const fe=Z.createTexture();Z.bindTexture(Z.TEXTURE_2D,fe),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_WRAP_S,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_WRAP_T,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_MIN_FILTER,Z.LINEAR),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_MAG_FILTER,Z.LINEAR),se=J.heatmapFbo=H.createFramebuffer(W.width/4,W.height/4,!1,!1),function(ee,ce,ve,_e){var Ae,Re;const Le=ee.gl,Ze=(Ae=ee.HALF_FLOAT)!==null&&Ae!==void 0?Ae:Le.UNSIGNED_BYTE,st=(Re=ee.RGBA16F)!==null&&Re!==void 0?Re:Le.RGBA;Le.texImage2D(Le.TEXTURE_2D,0,st,ce.width/4,ce.height/4,0,Le.RGBA,Ze,null),_e.colorAttachment.set(ve)}(H,W,fe,se)}})(C,m,T),C.clear({color:a.aO.transparent});for(let H=0;H{const ee=a.F();a.aN(ee,0,J.width,J.height,0,0,1);const ce=J.context.gl;return{u_matrix:ee,u_world:[ce.drawingBufferWidth,ce.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:Z.paint.get("heatmap-opacity")}})(C,P),null,P.id,C.viewportBuffer,C.quadTriangleIndexBuffer,C.viewportSegments,P.paint,C.transform.zoom)}(m,T))})(t,n,o,u);break;case"line":(function(m,w,T,I){if(m.renderPass!=="translucent")return;const C=T.paint.get("line-opacity"),P=T.paint.get("line-width");if(C.constantOr(1)===0||P.constantOr(1)===0)return;const z=m.depthModeForSublayer(0,qt.ReadOnly),V=m.colorModeForRenderPass(),H=T.paint.get("line-dasharray"),W=T.paint.get("line-pattern"),J=W.constantOr(1),Z=T.paint.get("line-gradient"),se=T.getCrossfadeParameters(),fe=J?"linePattern":H?"lineSDF":Z?"lineGradient":"line",ee=m.context,ce=ee.gl;let ve=!0;for(const _e of I){const Ae=w.getTile(_e);if(J&&!Ae.patternsLoaded())continue;const Re=Ae.getBucket(T);if(!Re)continue;const Le=Re.programConfigurations.get(T.id),Ze=m.context.program.get(),st=m.useProgram(fe,Le),vt=ve||st.program!==Ze,Je=m.style.map.terrain&&m.style.map.terrain.getTerrainData(_e),yt=W.constantOr(null);if(yt&&Ae.imageAtlas){const Bt=Ae.imageAtlas,Pt=Bt.patternPositions[yt.to.toString()],Ft=Bt.patternPositions[yt.from.toString()];Pt&&Ft&&Le.setConstantPatternPositions(Pt,Ft)}const lt=Je?_e:null,fi=J?ts(m,Ae,T,se,lt):H?Ro(m,Ae,T,H,se,lt):Z?oc(m,Ae,T,Re.lineClipsArray.length,lt):Do(m,Ae,T,lt);if(J)ee.activeTexture.set(ce.TEXTURE0),Ae.imageAtlasTexture.bind(ce.LINEAR,ce.CLAMP_TO_EDGE),Le.updatePaintBuffers(se);else if(H&&(vt||m.lineAtlas.dirty))ee.activeTexture.set(ce.TEXTURE0),m.lineAtlas.bind(ee);else if(Z){const Bt=Re.gradients[T.id];let Pt=Bt.texture;if(T.gradientVersion!==Bt.version){let Ft=256;if(T.stepInterpolant){const Fi=w.getSource().maxzoom,ni=_e.canonical.z===Fi?Math.ceil(1<0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),o=this.imageManager.getPattern(t.to.toString());return!n||!o}useProgram(t,n){this.cache=this.cache||{};const o=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[o]||(this.cache[o]=new Nn(this.context,Ys[t],n,ac[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[o]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new De(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}class jn{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,o){const u=Math.pow(2,o),m=[[-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(T=>{const I=1/(T=a.af([],T,t))[3]/n*u;return a.a_(T,T,[I,I,1/T[3],I])}),w=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(T=>{const I=function(V,H){var W=H[0],J=H[1],Z=H[2],se=W*W+J*J+Z*Z;return se>0&&(se=1/Math.sqrt(se)),V[0]=H[0]*se,V[1]=H[1]*se,V[2]=H[2]*se,V}([],function(V,H,W){var J=H[0],Z=H[1],se=H[2],fe=W[0],ee=W[1],ce=W[2];return V[0]=Z*ce-se*ee,V[1]=se*fe-J*ce,V[2]=J*ee-Z*fe,V}([],Se([],m[T[0]],m[T[1]]),Se([],m[T[2]],m[T[1]]))),C=-((P=I)[0]*(z=m[T[1]])[0]+P[1]*z[1]+P[2]*z[2]);var P,z;return I.concat(C)});return new jn(m,w)}}class qn{constructor(t,n){this.min=t,this.max=n,this.center=function(o,u,m){return o[0]=.5*u[0],o[1]=.5*u[1],o[2]=.5*u[2],o}([],function(o,u,m){return o[0]=u[0]+m[0],o[1]=u[1]+m[1],o[2]=u[2]+m[2],o}([],this.min,this.max))}quadrant(t){const n=[t%2==0,t<2],o=Ee(this.min),u=Ee(this.max);for(let m=0;m=0&&w++;if(w===0)return 0;w!==n.length&&(o=!1)}if(o)return 2;for(let u=0;u<3;u++){let m=Number.MAX_VALUE,w=-Number.MAX_VALUE;for(let T=0;Tthis.max[u]-this.min[u])return 0}return 1}}class zs{constructor(t=0,n=0,o=0,u=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(o)||o<0||isNaN(u)||u<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=o,this.right=u}interpolate(t,n,o){return n.top!=null&&t.top!=null&&(this.top=a.z.number(t.top,n.top,o)),n.bottom!=null&&t.bottom!=null&&(this.bottom=a.z.number(t.bottom,n.bottom,o)),n.left!=null&&t.left!=null&&(this.left=a.z.number(t.left,n.left,o)),n.right!=null&&t.right!=null&&(this.right=a.z.number(t.right,n.right,o)),this}getCenter(t,n){const o=a.ac((this.left+t-this.right)/2,0,t),u=a.ac((this.top+n-this.bottom)/2,0,n);return new a.P(o,u)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new zs(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class $o{constructor(t,n,o,u,m){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=m===void 0||!!m,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=o??0,this._maxPitch=u??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new a.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new zs,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){const t=new $o(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const n=-a.b0(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var o=new a.A(4);return a.A!=Float32Array&&(o[1]=0,o[2]=0),o[0]=1,o[3]=1,o}(),function(o,u,m){var w=u[0],T=u[1],I=u[2],C=u[3],P=Math.sin(m),z=Math.cos(m);o[0]=w*z+I*P,o[1]=T*z+C*P,o[2]=w*-P+I*z,o[3]=T*-P+C*z}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=a.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,o){this._unmodified=!1,this._edgeInsets.interpolate(t,n,o),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){const n=[new a.b1(0,t)];if(this._renderWorldCopies){const o=this.pointCoordinate(new a.P(0,0)),u=this.pointCoordinate(new a.P(this.width,0)),m=this.pointCoordinate(new a.P(this.width,this.height)),w=this.pointCoordinate(new a.P(0,this.height)),T=Math.floor(Math.min(o.x,u.x,m.x,w.x)),I=Math.floor(Math.max(o.x,u.x,m.x,w.x)),C=1;for(let P=T-C;P<=I+C;P++)P!==0&&n.push(new a.b1(P,t))}return n}coveringTiles(t){var n,o;let u=this.coveringZoomLevel(t);const m=u;if(t.minzoom!==void 0&&ut.maxzoom&&(u=t.maxzoom);const w=this.pointCoordinate(this.getCameraPoint()),T=a.Y.fromLngLat(this.center),I=Math.pow(2,u),C=[I*w.x,I*w.y,0],P=[I*T.x,I*T.y,0],z=jn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,u);let V=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(V=u);const H=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,W=ee=>({aabb:new qn([ee*I,0,0],[(ee+1)*I,I,0]),zoom:0,x:0,y:0,wrap:ee,fullyVisible:!1}),J=[],Z=[],se=u,fe=t.reparseOverscaled?m:u;if(this._renderWorldCopies)for(let ee=1;ee<=3;ee++)J.push(W(-ee)),J.push(W(ee));for(J.push(W(0));J.length>0;){const ee=J.pop(),ce=ee.x,ve=ee.y;let _e=ee.fullyVisible;if(!_e){const st=ee.aabb.intersects(z);if(st===0)continue;_e=st===2}const Ae=t.terrain?C:P,Re=ee.aabb.distanceX(Ae),Le=ee.aabb.distanceY(Ae),Ze=Math.max(Math.abs(Re),Math.abs(Le));if(ee.zoom===se||Ze>H+(1<=V){const st=se-ee.zoom,vt=C[0]-.5-(ce<>1),yt=ee.zoom+1;let lt=ee.aabb.quadrant(st);if(t.terrain){const fi=new a.Q(yt,ee.wrap,yt,vt,Je),Bt=t.terrain.getMinMaxElevation(fi),Pt=(n=Bt.minElevation)!==null&&n!==void 0?n:this.elevation,Ft=(o=Bt.maxElevation)!==null&&o!==void 0?o:this.elevation;lt=new qn([lt.min[0],lt.min[1],Pt],[lt.max[0],lt.max[1],Ft])}J.push({aabb:lt,zoom:yt,x:vt,y:Je,wrap:ee.wrap,fullyVisible:_e})}}return Z.sort((ee,ce)=>ee.distanceSq-ce.distanceSq).map(ee=>ee.tileID)}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const n=a.ac(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new a.P(a.N(t.lng)*this.worldSize,a.O(n)*this.worldSize)}unproject(t){return new a.Y(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){const n=this.pointLocation(this.centerPoint,t),o=t.getElevationForLngLatZoom(n,this.tileZoom);if(!(this.elevation-o))return;const u=this.getCameraPosition(),m=a.Y.fromLngLat(u.lngLat,u.altitude),w=a.Y.fromLngLat(n,o),T=m.x-w.x,I=m.y-w.y,C=m.z-w.z,P=Math.sqrt(T*T+I*I+C*C),z=this.scaleZoom(this.cameraToCenterDistance/P/this.tileSize);this._elevation=o,this._center=n,this.zoom=z}setLocationAtPoint(t,n){const o=this.pointCoordinate(n),u=this.pointCoordinate(this.centerPoint),m=this.locationCoordinate(t),w=new a.Y(m.x-(o.x-u.x),m.y-(o.y-u.y));this.center=this.coordinateLocation(w),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,n){return n?this.coordinatePoint(this.locationCoordinate(t),n.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,n){return this.coordinateLocation(this.pointCoordinate(t,n))}locationCoordinate(t){return a.Y.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,n){if(n){const V=n.pointCoordinate(t);if(V!=null)return V}const o=[t.x,t.y,0,1],u=[t.x,t.y,1,1];a.af(o,o,this.pixelMatrixInverse),a.af(u,u,this.pixelMatrixInverse);const m=o[3],w=u[3],T=o[1]/m,I=u[1]/w,C=o[2]/m,P=u[2]/w,z=C===P?0:(0-C)/(P-C);return new a.Y(a.z.number(o[0]/m,u[0]/w,z)/this.worldSize,a.z.number(T,I,z)/this.worldSize)}coordinatePoint(t,n=0,o=this.pixelMatrix){const u=[t.x*this.worldSize,t.y*this.worldSize,n,1];return a.af(u,u,o),new a.P(u[0]/u[3],u[1]/u[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return new Qt().extend(this.pointLocation(new a.P(0,t))).extend(this.pointLocation(new a.P(this.width,t))).extend(this.pointLocation(new a.P(this.width,this.height))).extend(this.pointLocation(new a.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Qt([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t,n=!1){const o=t.key,u=n?this._alignedPosMatrixCache:this._posMatrixCache;if(u[o])return u[o];const m=t.canonical,w=this.worldSize/this.zoomScale(m.z),T=m.x+Math.pow(2,m.z)*t.wrap,I=a.an(new Float64Array(16));return a.H(I,I,[T*w,m.y*w,0]),a.J(I,I,[w/a.W,w/a.W,1]),a.K(I,n?this.alignedProjMatrix:this.projMatrix,I),u[o]=new Float32Array(I),u[o]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,n,o,u,m=-90,w=90,T=-180,I=180;const C=this.size,P=this._unmodified;if(this.latRange){const H=this.latRange;m=a.O(H[1])*this.worldSize,w=a.O(H[0])*this.worldSize,t=w-mw&&(u=w-W)}if(this.lngRange){const H=(T+I)/2,W=a.b0(z.x,H-this.worldSize/2,H+this.worldSize/2),J=C.x/2;W-JI&&(o=I-J)}o===void 0&&u===void 0||(this.center=this.unproject(new a.P(o!==void 0?o:z.x,u!==void 0?u:z.y)).wrap()),this._unmodified=P,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.point.x,o=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=a.b2(1,this.center.lat)*this.worldSize;let u=a.an(new Float64Array(16));a.J(u,u,[this.width/2,-this.height/2,1]),a.H(u,u,[1,-1,0]),this.labelPlaneMatrix=u,u=a.an(new Float64Array(16)),a.J(u,u,[1,-1,1]),a.H(u,u,[-1,-1,0]),a.J(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u;const m=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),w=Math.min(this.elevation,this.minElevationForCurrentTile),T=m-w*this._pixelPerMeter/Math.cos(this._pitch),I=w<0?T:m,C=Math.PI/2+this._pitch,P=this._fov*(.5+t.y/this.height),z=Math.sin(P)*I/Math.sin(a.ac(Math.PI-C-P,.01,Math.PI-.01)),V=this.getHorizon(),H=2*Math.atan(V/this.cameraToCenterDistance)*(.5+t.y/(2*V)),W=Math.sin(H)*I/Math.sin(a.ac(Math.PI-C-H,.01,Math.PI-.01)),J=Math.min(z,W),Z=1.01*(Math.cos(Math.PI/2-this._pitch)*J+I),se=this.height/50;u=new Float64Array(16),a.b3(u,this._fov,this.width/this.height,se,Z),u[8]=2*-t.x/this.width,u[9]=2*t.y/this.height,a.J(u,u,[1,-1,1]),a.H(u,u,[0,0,-this.cameraToCenterDistance]),a.b4(u,u,this._pitch),a.ad(u,u,this.angle),a.H(u,u,[-n,-o,0]),this.mercatorMatrix=a.J([],u,[this.worldSize,this.worldSize,this.worldSize]),a.J(u,u,[1,1,this._pixelPerMeter]),this.pixelMatrix=a.K(new Float64Array(16),this.labelPlaneMatrix,u),a.H(u,u,[0,0,-this.elevation]),this.projMatrix=u,this.invProjMatrix=a.ar([],u),this.pixelMatrix3D=a.K(new Float64Array(16),this.labelPlaneMatrix,u);const fe=this.width%2/2,ee=this.height%2/2,ce=Math.cos(this.angle),ve=Math.sin(this.angle),_e=n-Math.round(n)+ce*fe+ve*ee,Ae=o-Math.round(o)+ce*ee+ve*fe,Re=new Float64Array(u);if(a.H(Re,Re,[_e>.5?_e-1:_e,Ae>.5?Ae-1:Ae,0]),this.alignedProjMatrix=Re,u=a.ar(new Float64Array(16),this.pixelMatrix),!u)throw new Error("failed to invert matrix");this.pixelMatrixInverse=u,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new a.P(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return a.af(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.P(0,t))}getCameraQueryGeometry(t){const n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let o=n.x,u=n.y,m=n.x,w=n.y;for(const T of t)o=Math.min(o,T.x),u=Math.min(u,T.y),m=Math.max(m,T.x),w=Math.max(w,T.y);return[new a.P(o,u),new a.P(m,u),new a.P(m,w),new a.P(o,w),new a.P(o,u)]}}lngLatToCameraDepth(t,n){const o=this.locationCoordinate(t),u=[o.x*this.worldSize,o.y*this.worldSize,n,1];return a.af(u,u,this.projMatrix),u[2]/u[3]}}function Ka(d,t){let n,o=!1,u=null,m=null;const w=()=>{u=null,o&&(d.apply(m,n),u=setTimeout(w,t),o=!1)};return(...T)=>(o=!0,m=this,n=T,u||w(),u)}class Ya{constructor(t){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let o;return n.split("&").map(u=>u.split("=")).forEach(u=>{u[0]===this._hashName&&(o=u)}),(o&&o[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(n.length>=3&&!n.some(o=>isNaN(o))){const o=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:o,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,n)}catch{}},this._updateHash=Ka(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(t){const n=this._map.getCenter(),o=Math.round(100*this._map.getZoom())/100,u=Math.ceil((o*Math.LN2+Math.log(512/360/.5))/Math.LN10),m=Math.pow(10,u),w=Math.round(n.lng*m)/m,T=Math.round(n.lat*m)/m,I=this._map.getBearing(),C=this._map.getPitch();let P="";if(P+=t?`/${w}/${T}/${o}`:`${o}/${T}/${w}`,(I||C)&&(P+="/"+Math.round(10*I)/10),C&&(P+=`/${Math.round(C)}`),this._hashName){const z=this._hashName;let V=!1;const H=window.location.hash.slice(1).split("&").map(W=>{const J=W.split("=")[0];return J===z?(V=!0,`${J}=${P}`):W}).filter(W=>W);return V||H.push(`${z}=${P}`),`#${H.join("&")}`}return`#${P}`}}const no={linearity:.3,easing:a.b5(0,0,.3,1)},wc=a.e({deceleration:2500,maxSpeed:1400},no),ss=a.e({deceleration:20,maxSpeed:1400},no),Sc=a.e({deceleration:1e3,maxSpeed:360},no),Tc=a.e({deceleration:1e3,maxSpeed:90},no);class Ic{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:j.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=j.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new a.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:m}of this._inertiaBuffer)n.zoom+=m.zoomDelta||0,n.bearing+=m.bearingDelta||0,n.pitch+=m.pitchDelta||0,m.panDelta&&n.pan._add(m.panDelta),m.around&&(n.around=m.around),m.pinchAround&&(n.pinchAround=m.pinchAround);const o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,u={};if(n.pan.mag()){const m=oo(n.pan.mag(),o,a.e({},wc,t||{}));u.offset=n.pan.mult(m.amount/n.pan.mag()),u.center=this._map.transform.center,so(u,m)}if(n.zoom){const m=oo(n.zoom,o,ss);u.zoom=this._map.transform.zoom+m.amount,so(u,m)}if(n.bearing){const m=oo(n.bearing,o,Sc);u.bearing=this._map.transform.bearing+a.ac(m.amount,-179,179),so(u,m)}if(n.pitch){const m=oo(n.pitch,o,Tc);u.pitch=this._map.transform.pitch+m.amount,so(u,m)}if(u.zoom||u.bearing){const m=n.pinchAround===void 0?n.around:n.pinchAround;u.around=m?this._map.unproject(m):this._map.getCenter()}return this.clear(),a.e(u,{noMoveStart:!0})}}function so(d,t){(!d.duration||d.durationn.unproject(I)),T=m.reduce((I,C,P,z)=>I.add(C.div(z.length)),new a.P(0,0));super(t,{points:m,point:T,lngLats:w,lngLat:n.unproject(T),originalEvent:o}),this._defaultPrevented=!1}}class os extends a.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,o){super(t,{originalEvent:o}),this._defaultPrevented=!1}}class kc{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new os(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new Lr(t.type,this._map,t))}mouseup(t){this._map.fire(new Lr(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Lr(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Lr(t.type,this._map,t))}mouseover(t){this._map.fire(new Lr(t.type,this._map,t))}mouseout(t){this._map.fire(new Lr(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Ls(t.type,this._map,t))}touchmove(t){this._map.fire(new Ls(t.type,this._map,t))}touchend(t){this._map.fire(new Ls(t.type,this._map,t))}touchcancel(t){this._map.fire(new Ls(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class hn{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Lr(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Lr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Lr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Dr{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(a.P.convert(t),this._map.terrain)}}class Ja{constructor(t,n){this._map=t,this._tr=new Dr(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(X.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const o=n;if(this._lastPos.equals(o)||!this._box&&o.dist(this._startPos)m.fitScreenCoordinates(o,u,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(X.remove(this._box),this._box=null),X.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new a.k(t,{originalEvent:n}))}}function en(d,t){if(d.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${d.length}, points ${t.length}`);const n={};for(let o=0;othis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),o.length===this.numTouches&&(this.centroid=function(u){const m=new a.P(0,0);for(const w of u)m._add(w);return m.div(u.length)}(n),this.touches=en(o,n)))}touchmove(t,n,o){if(this.aborted||!this.centroid)return;const u=en(o,n);for(const m in this.touches){const w=u[m];(!w||w.dist(this.touches[m])>30)&&(this.aborted=!0)}}touchend(t,n,o){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),o.length===0){const u=!this.aborted&&this.centroid;if(this.reset(),u)return u}}}class Qa{constructor(t){this.singleTap=new ao(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,o){this.singleTap.touchstart(t,n,o)}touchmove(t,n,o){this.singleTap.touchmove(t,n,o)}touchend(t,n,o){const u=this.singleTap.touchend(t,n,o);if(u){const m=t.timeStamp-this.lastTime<500,w=!this.lastTap||this.lastTap.dist(u)<30;if(m&&w||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=u,this.count===this.numTaps)return this.reset(),u}}}class Lu{constructor(t){this._tr=new Dr(t),this._zoomIn=new Qa({numTouches:1,numTaps:2}),this._zoomOut=new Qa({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,o){this._zoomIn.touchstart(t,n,o),this._zoomOut.touchstart(t,n,o)}touchmove(t,n,o){this._zoomIn.touchmove(t,n,o),this._zoomOut.touchmove(t,n,o)}touchend(t,n,o){const u=this._zoomIn.touchend(t,n,o),m=this._zoomOut.touchend(t,n,o),w=this._tr;return u?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:w.zoom+1,around:w.unproject(u)},{originalEvent:t})}):m?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:w.zoom-1,around:w.unproject(m)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class lo{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;const o=this._lastPoint;if(!o)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const u=n.length?n[0]:n;return!this._moved&&u.dist(o){d.mousedown=d.dragStart,d.mousemoveWindow=d.dragMove,d.mouseup=d.dragEnd,d.contextmenu=function(t){t.preventDefault()}},$a=({enable:d,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{const o=new as({checkCorrectEvent:u=>X.mouseButton(u)===0&&u.ctrlKey||X.mouseButton(u)===2});return new lo({clickTolerance:t,move:(u,m)=>({bearingDelta:(m.x-u.x)*n}),moveStateManager:o,enable:d,assignEvents:rt})},Ds=({enable:d,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{const o=new as({checkCorrectEvent:u=>X.mouseButton(u)===0&&u.ctrlKey||X.mouseButton(u)===2});return new lo({clickTolerance:t,move:(u,m)=>({pitchDelta:(m.y-u.y)*n}),moveStateManager:o,enable:d,assignEvents:rt})};class co{constructor(t,n){this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new a.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(t,n,o){return this._calculateTransform(t,n,o)}touchmove(t,n,o){if(this._active&&!(o.length0&&(this._active=!0);const u=en(o,n),m=new a.P(0,0),w=new a.P(0,0);let T=0;for(const C in u){const P=u[C],z=this._touches[C];z&&(m._add(P),w._add(P.sub(z)),T++,u[C]=P)}if(this._touches=u,TMath.abs(d.x)}class el extends ea{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,o){super.touchstart(t,n,o),this._currentTouchCount=o.length}_start(t){this._lastPoints=t,ra(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,o){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const u=t[0].sub(this._lastPoints[0]),m=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(u,m,o.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(u.y+m.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,o){if(this._valid!==void 0)return this._valid;const u=t.mag()>=2,m=n.mag()>=2;if(!u&&!m)return;if(!u||!m)return this._firstMove===void 0&&(this._firstMove=o),o-this._firstMove<100&&void 0;const w=t.y>0==n.y>0;return ra(t)&&ra(n)&&w}}const Du={panStep:100,bearingStep:15,pitchStep:10};class Ec{constructor(t){this._tr=new Dr(t);const n=Du;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,o=0,u=0,m=0,w=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?o=-1:(t.preventDefault(),m=-1);break;case 39:t.shiftKey?o=1:(t.preventDefault(),m=1);break;case 38:t.shiftKey?u=1:(t.preventDefault(),w=-1);break;case 40:t.shiftKey?u=-1:(t.preventDefault(),w=1);break;default:return}return this._rotationDisabled&&(o=0,u=0),{cameraAnimation:T=>{const I=this._tr;T.easeTo({duration:300,easeId:"keyboardHandler",easing:ls,zoom:n?Math.round(I.zoom)+n*(t.shiftKey?2:1):I.zoom,bearing:I.bearing+o*this._bearingStep,pitch:I.pitch+u*this._pitchStep,offset:[-m*this._panStep,-w*this._panStep],center:I.center},{originalEvent:t})}}}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 ls(d){return d*(2-d)}const pi=4.000244140625;class uo{constructor(t,n){this._onTimeout=o=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(o)},this._map=t,this._tr=new Dr(t),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!t[this._map.cooperativeGestures._bypassKey])return;let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const o=j.now(),u=o-(this._lastWheelEventTime||0);this._lastWheelEventTime=o,n!==0&&n%pi==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":u>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(u*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()}_start(t){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 n=X.mousePos(this._map.getCanvas(),t),o=this._tr;this._around=n.y>o.transform.height/2-o.transform.getHorizon()?a.M.convert(this._aroundCenter?o.center:o.unproject(n)):a.M.convert(o.center),this._aroundPoint=o.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(this._delta!==0){const T=this._type==="wheel"&&Math.abs(this._delta)>pi?this._wheelZoomRate:this._defaultZoomRate;let I=2/(1+Math.exp(-Math.abs(this._delta*T)));this._delta<0&&I!==0&&(I=1/I);const C=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(C*I))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,o=this._startZoom,u=this._easing;let m,w=!1;if(this._type==="wheel"&&o&&u){const T=Math.min((j.now()-this._lastWheelEventTime)/200,1),I=u(T);m=a.z.number(o,n,I),T<1?this._frameId||(this._frameId=!0):w=!0}else m=n,w=!0;return this._active=!0,w&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!w,zoomDelta:m-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=a.b6;if(this._prevEase){const o=this._prevEase,u=(j.now()-o.start)/o.duration,m=o.easing(u+.01)-o.easing(u),w=.27/Math.sqrt(m*m+1e-4)*.01,T=Math.sqrt(.0729-w*w);n=a.b5(w,T,.25,1)}return this._prevEase={start:j.now(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class na{constructor(t,n){this._clickZoom=t,this._tapZoom=n}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 Pc{constructor(t){this._tr=new Dr(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:o=>{o.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class zc{constructor(){this._tap=new Qa({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,o){if(!this._swipePoint)if(this._tapTime){const u=n[0],m=t.timeStamp-this._tapTime<500,w=this._tapPoint.dist(u)<30;m&&w?o.length>0&&(this._swipePoint=u,this._swipeTouch=o[0].identifier):this.reset()}else this._tap.touchstart(t,n,o)}touchmove(t,n,o){if(this._tapTime){if(this._swipePoint){if(o[0].identifier!==this._swipeTouch)return;const u=n[0],m=u.y-this._swipePoint.y;return this._swipePoint=u,t.preventDefault(),this._active=!0,{zoomDelta:m/128}}}else this._tap.touchmove(t,n,o)}touchend(t,n,o){if(this._tapTime)this._swipePoint&&o.length===0&&this.reset();else{const u=this._tap.touchend(t,n,o);u&&(this._tapTime=t.timeStamp,this._tapPoint=u)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class tl{constructor(t,n,o){this._el=t,this._mousePan=n,this._touchPan=o}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Lc{constructor(t,n,o){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=o}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 dn{constructor(t,n,o,u){this._el=t,this._touchZoom=n,this._touchRotate=o,this._tapDragZoom=u,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-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()}}class ho{constructor(t,n){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=t,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=X.create("div","maplibregl-cooperative-gesture-screen",t);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const o=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),u=document.createElement("div");u.className="maplibregl-desktop-message",u.textContent=n,this._container.appendChild(u);const m=document.createElement("div");m.className="maplibregl-mobile-message",m.textContent=o,this._container.appendChild(m),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(X.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(t){this._onCooperativeGesture(t.touches.length===1)}wheel(t){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!t[this._bypassKey])}_onCooperativeGesture(t){this._enabled&&t&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const ht=d=>d.zoom||d.drag||d.pitch||d.rotate;class xt extends a.k{}function Rs(d){return d.panDelta&&d.panDelta.mag()||d.zoomDelta||d.bearingDelta||d.pitchDelta}class il{constructor(t,n){this.handleWindowEvent=u=>{this.handleEvent(u,`${u.type}Window`)},this.handleEvent=(u,m)=>{if(u.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const w=u.type==="renderFrame"?void 0:u,T={needsRenderFrame:!1},I={},C={},P=u.touches,z=P?this._getMapTouches(P):void 0,V=z?X.touchPos(this._map.getCanvas(),z):X.mousePos(this._map.getCanvas(),u);for(const{handlerName:J,handler:Z,allowed:se}of this._handlers){if(!Z.isEnabled())continue;let fe;this._blockedByActive(C,se,J)?Z.reset():Z[m||u.type]&&(fe=Z[m||u.type](u,V,z),this.mergeHandlerResult(T,I,fe,J,w),fe&&fe.needsRenderFrame&&this._triggerRenderFrame()),(fe||Z.isActive())&&(C[J]=Z)}const H={};for(const J in this._previousActiveHandlers)C[J]||(H[J]=w);this._previousActiveHandlers=C,(Object.keys(H).length||Rs(T))&&(this._changes.push([T,I,H]),this._triggerRenderFrame()),(Object.keys(C).length||Rs(T))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:W}=T;W&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],W(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ic(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const o=this._el;this._listeners=[[o,"touchstart",{passive:!0}],[o,"touchmove",{passive:!1}],[o,"touchend",void 0],[o,"touchcancel",void 0],[o,"mousedown",void 0],[o,"mousemove",void 0],[o,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[o,"mouseover",void 0],[o,"mouseout",void 0],[o,"dblclick",void 0],[o,"click",void 0],[o,"keydown",{capture:!1}],[o,"keyup",void 0],[o,"wheel",{passive:!1}],[o,"contextmenu",void 0],[window,"blur",void 0]];for(const[u,m,w]of this._listeners)X.addEventListener(u,m,u===document?this.handleWindowEvent:this.handleEvent,w)}destroy(){for(const[t,n,o]of this._listeners)X.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,o)}_addDefaultHandlers(t){const n=this._map,o=n.getCanvasContainer();this._add("mapEvent",new kc(n,t));const u=n.boxZoom=new Ja(n,t);this._add("boxZoom",u),t.interactive&&t.boxZoom&&u.enable();const m=n.cooperativeGestures=new ho(n,t.cooperativeGestures);this._add("cooperativeGestures",m),t.cooperativeGestures&&m.enable();const w=new Lu(n),T=new Pc(n);n.doubleClickZoom=new na(T,w),this._add("tapZoom",w),this._add("clickZoom",T),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();const I=new zc;this._add("tapDragZoom",I);const C=n.touchPitch=new el(n);this._add("touchPitch",C),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);const P=$a(t),z=Ds(t);n.dragRotate=new Lc(t,P,z),this._add("mouseRotate",P,["mousePitch"]),this._add("mousePitch",z,["mouseRotate"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();const V=(({enable:fe,clickTolerance:ee})=>{const ce=new as({checkCorrectEvent:ve=>X.mouseButton(ve)===0&&!ve.ctrlKey});return new lo({clickTolerance:ee,move:(ve,_e)=>({around:_e,panDelta:_e.sub(ve)}),activateOnStart:!0,moveStateManager:ce,enable:fe,assignEvents:rt})})(t),H=new co(t,n);n.dragPan=new tl(o,V,H),this._add("mousePan",V),this._add("touchPan",H,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);const W=new ia,J=new Mc;n.touchZoomRotate=new dn(o,J,W,I),this._add("touchRotate",W,["touchPan","touchZoom"]),this._add("touchZoom",J,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate);const Z=n.scrollZoom=new uo(n,()=>this._triggerRenderFrame());this._add("scrollZoom",Z,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);const se=n.keyboard=new Ec(n);this._add("keyboard",se),t.interactive&&t.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new hn(n))}_add(t,n,o){this._handlers.push({handlerName:t,handler:n,allowed:o}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ht(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,o){for(const u in t)if(u!==o&&(!n||n.indexOf(u)<0))return!0;return!1}_getMapTouches(t){const n=[];for(const o of t)this._el.contains(o.target)&&n.push(o);return n}mergeHandlerResult(t,n,o,u,m){if(!o)return;a.e(t,o);const w={handlerName:u,originalEvent:o.originalEvent||m};o.zoomDelta!==void 0&&(n.zoom=w),o.panDelta!==void 0&&(n.drag=w),o.pitchDelta!==void 0&&(n.pitch=w),o.bearingDelta!==void 0&&(n.rotate=w)}_applyChanges(){const t={},n={},o={};for(const[u,m,w]of this._changes)u.panDelta&&(t.panDelta=(t.panDelta||new a.P(0,0))._add(u.panDelta)),u.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+u.zoomDelta),u.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+u.bearingDelta),u.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+u.pitchDelta),u.around!==void 0&&(t.around=u.around),u.pinchAround!==void 0&&(t.pinchAround=u.pinchAround),u.noInertia&&(t.noInertia=u.noInertia),a.e(n,m),a.e(o,w);this._updateMapTransform(t,n,o),this._changes=[]}_updateMapTransform(t,n,o){const u=this._map,m=u._getTransformForUpdate(),w=u.terrain;if(!(Rs(t)||w&&this._terrainMovement))return this._fireEvents(n,o,!0);let{panDelta:T,zoomDelta:I,bearingDelta:C,pitchDelta:P,around:z,pinchAround:V}=t;V!==void 0&&(z=V),u._stop(!0),z=z||u.transform.centerPoint;const H=m.pointLocation(T?z.sub(T):z);C&&(m.bearing+=C),P&&(m.pitch+=P),I&&(m.zoom+=I),w?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?m.center=m.pointLocation(m.centerPoint.sub(T)):m.setLocationAtPoint(H,z):(this._terrainMovement=!0,this._map._elevationFreeze=!0,m.setLocationAtPoint(H,z),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,m.recalculateZoom(u.terrain)})):m.setLocationAtPoint(H,z),u._applyUpdatedTransform(m),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,o,!0)}_fireEvents(t,n,o){const u=ht(this._eventsInProgress),m=ht(t),w={};for(const P in t){const{originalEvent:z}=t[P];this._eventsInProgress[P]||(w[`${P}start`]=z),this._eventsInProgress[P]=t[P]}!u&&m&&this._fireEvent("movestart",m.originalEvent);for(const P in w)this._fireEvent(P,w[P]);m&&this._fireEvent("move",m.originalEvent);for(const P in t){const{originalEvent:z}=t[P];this._fireEvent(P,z)}const T={};let I;for(const P in this._eventsInProgress){const{handlerName:z,originalEvent:V}=this._eventsInProgress[P];this._handlersById[z].isActive()||(delete this._eventsInProgress[P],I=n[z]||V,T[`${P}end`]=I)}for(const P in T)this._fireEvent(P,T[P]);const C=ht(this._eventsInProgress);if(o&&(u||m)&&!C){this._updatingCamera=!0;const P=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),z=V=>V!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new xt("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class rl extends a.E{constructor(t,n){super(),this._renderFrameCallback=()=>{const o=Math.min((j.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(o)),o<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new a.M(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,o){return t=a.P.convert(t).mult(-1),this.panTo(this.transform.center,a.e({offset:t},n),o)}panTo(t,n,o){return this.easeTo(a.e({center:t},n),o)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,o){return this.easeTo(a.e({zoom:t},n),o)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,o){return this.easeTo(a.e({bearing:t},n),o)}resetNorth(t,n){return this.rotateTo(0,a.e({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(a.e({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(o.zoom=a.z.number(u,I,_e)),this._rotating&&(o.bearing=a.z.number(m,C,_e)),this._pitching&&(o.pitch=a.z.number(w,P,_e)),this._padding&&(o.interpolatePadding(T,z,_e),H=o.centerPoint.add(V)),this.terrain&&!t.freezeElevation&&this._updateElevation(_e),ee)o.setLocationAtPoint(ee,ce);else{const Ae=o.zoomScale(o.zoom-u),Re=I>u?Math.min(2,fe):Math.max(.5,fe),Le=Math.pow(Re,1-_e),Ze=o.unproject(Z.add(se.mult(_e*Le)).mult(Ae));o.setLocationAtPoint(o.renderWorldCopies?Ze.wrap():Ze,H)}this._applyUpdatedTransform(o),this._fireMoveEvents(n)},_e=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,_e)},t),this}_prepareEase(t,n,o={}){this._moving=!0,n||o.moving||this.fire(new a.k("movestart",t)),this._zooming&&!o.zooming&&this.fire(new a.k("zoomstart",t)),this._rotating&&!o.rotating&&this.fire(new a.k("rotatestart",t)),this._pitching&&!o.pitching&&this.fire(new a.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&n!==this._elevationTarget){const o=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(o-(n-(o*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=a.z.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;const n=t.clone(),{center:o,zoom:u,pitch:m,bearing:w,elevation:T}=this.transformCameraUpdate(n);o&&(n.center=o),u!==void 0&&(n.zoom=u),m!==void 0&&(n.pitch=m),w!==void 0&&(n.bearing=w),T!==void 0&&(n.elevation=T),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new a.k("move",t)),this._zooming&&this.fire(new a.k("zoom",t)),this._rotating&&this.fire(new a.k("rotate",t)),this._pitching&&this.fire(new a.k("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const o=this._zooming,u=this._rotating,m=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,o&&this.fire(new a.k("zoomend",t)),u&&this.fire(new a.k("rotateend",t)),m&&this.fire(new a.k("pitchend",t)),this.fire(new a.k("moveend",t))}flyTo(t,n){if(!t.essential&&j.prefersReducedMotion){const lt=a.L(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(lt,n)}this.stop(),t=a.e({offset:[0,0],speed:1.2,curve:1.42,easing:a.b6},t);const o=this._getTransformForUpdate(),u=this.getZoom(),m=this.getBearing(),w=this.getPitch(),T=this.getPadding(),I="zoom"in t?a.ac(+t.zoom,o.minZoom,o.maxZoom):u,C="bearing"in t?this._normalizeBearing(t.bearing,m):m,P="pitch"in t?+t.pitch:w,z="padding"in t?t.padding:o.padding,V=o.zoomScale(I-u),H=a.P.convert(t.offset);let W=o.centerPoint.add(H);const J=o.pointLocation(W),Z=a.M.convert(t.center||J);this._normalizeCenter(Z);const se=o.project(J),fe=o.project(Z).sub(se);let ee=t.curve;const ce=Math.max(o.width,o.height),ve=ce/V,_e=fe.mag();if("minZoom"in t){const lt=a.ac(Math.min(t.minZoom,u,I),o.minZoom,o.maxZoom),fi=ce/o.zoomScale(lt-u);ee=Math.sqrt(fi/_e*2)}const Ae=ee*ee;function Re(lt){const fi=(ve*ve-ce*ce+(lt?-1:1)*Ae*Ae*_e*_e)/(2*(lt?ve:ce)*Ae*_e);return Math.log(Math.sqrt(fi*fi+1)-fi)}function Le(lt){return(Math.exp(lt)-Math.exp(-lt))/2}function Ze(lt){return(Math.exp(lt)+Math.exp(-lt))/2}const st=Re(!1);let vt=function(lt){return Ze(st)/Ze(st+ee*lt)},Je=function(lt){return ce*((Ze(st)*(Le(fi=st+ee*lt)/Ze(fi))-Le(st))/Ae)/_e;var fi},yt=(Re(!0)-st)/ee;if(Math.abs(_e)<1e-6||!isFinite(yt)){if(Math.abs(ce-ve)<1e-6)return this.easeTo(t,n);const lt=vet.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=m!==C,this._pitching=P!==w,this._padding=!o.isPaddingEqual(z),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(Z),this._ease(lt=>{const fi=lt*yt,Bt=1/vt(fi);o.zoom=lt===1?I:u+o.scaleZoom(Bt),this._rotating&&(o.bearing=a.z.number(m,C,lt)),this._pitching&&(o.pitch=a.z.number(w,P,lt)),this._padding&&(o.interpolatePadding(T,z,lt),W=o.centerPoint.add(H)),this.terrain&&!t.freezeElevation&&this._updateElevation(lt);const Pt=lt===1?Z:o.unproject(se.add(fe.mult(Je(fi))).mult(Bt));o.setLocationAtPoint(o.renderWorldCopies?Pt.wrap():Pt,W),this._applyUpdatedTransform(o),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const o=this._onEaseEnd;delete this._onEaseEnd,o.call(this,n)}if(!t){const o=this.handlers;o&&o.stop(!1)}return this}_ease(t,n,o){o.animate===!1||o.duration===0?(t(1),n()):(this._easeStart=j.now(),this._easeOptions=o,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=a.b0(t,-180,180);const o=Math.abs(t-n);return Math.abs(t-360-n)180?-360:o<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(a.M.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}const Sr={compact:!0,customAttribution:'MapLibre'};class nl{constructor(t=Sr){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=X.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=X.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=X.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){X.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){const o=this._map._getUIString(`AttributionControl.${n}`);t.title=o,t.setAttribute("aria-label",o)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(u=>typeof u!="string"?"":u)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const u=this._map.style.stylesheet;this.styleOwner=u.owner,this.styleId=u.id}const n=this._map.style.sourceCaches;for(const u in n){const m=n[u];if(m.used||m.usedForTerrain){const w=m.getSource();w.attribution&&t.indexOf(w.attribution)<0&&t.push(w.attribution)}}t=t.filter(u=>String(u).trim()),t.sort((u,m)=>u.length-m.length),t=t.filter((u,m)=>{for(let w=m+1;w=0)return!1;return!0});const o=t.join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class pn{constructor(t={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const o=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&o.classList.add("maplibregl-compact"):o.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=X.create("div","maplibregl-ctrl");const n=X.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){X.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ru{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,o=n?this._queue.concat(n):this._queue;for(const u of o)if(u.id===t)return void(u.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const o of n)if(!o.cancelled&&(o.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var po=a.X([{name:"a_pos3d",type:"Int16",components:3}]);class Ai extends a.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];const o={};for(const u of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))o[u.key]=!0,this._renderableTilesKeys.push(u.key),this._tiles[u.key]||(u.posMatrix=new Float64Array(16),a.aN(u.posMatrix,0,a.W,0,a.W,0,1),this._tiles[u.key]=new vn(u,this.tileSize));for(const u in this._tiles)o[u]||delete this._tiles[u]}freeRtt(t){for(const n in this._tiles){const o=this._tiles[n];(!t||o.tileID.equals(t)||o.tileID.isChildOf(t)||t.isChildOf(o.tileID))&&(o.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const n={};for(const o of this._renderableTilesKeys){const u=this._tiles[o].tileID;if(u.canonical.equals(t.canonical)){const m=t.clone();m.posMatrix=new Float64Array(16),a.aN(m.posMatrix,0,a.W,0,a.W,0,1),n[o]=m}else if(u.canonical.isChildOf(t.canonical)){const m=t.clone();m.posMatrix=new Float64Array(16);const w=u.canonical.z-t.canonical.z,T=u.canonical.x-(u.canonical.x>>w<>w<>w;a.aN(m.posMatrix,0,C,0,C,0,1),a.H(m.posMatrix,m.posMatrix,[-T*C,-I*C,0]),n[o]=m}else if(t.canonical.isChildOf(u.canonical)){const m=t.clone();m.posMatrix=new Float64Array(16);const w=t.canonical.z-u.canonical.z,T=t.canonical.x-(t.canonical.x>>w<>w<>w;a.aN(m.posMatrix,0,a.W,0,a.W,0,1),a.H(m.posMatrix,m.posMatrix,[T*C,I*C,0]),a.J(m.posMatrix,m.posMatrix,[1/2**w,1/2**w,0]),n[o]=m}}return n}getSourceTile(t,n){const o=this.sourceCache._source;let u=t.overscaledZ-this.deltaZoom;if(u>o.maxzoom&&(u=o.maxzoom),u=o.minzoom&&(!m||!m.dem);)m=this.sourceCache.getTileByID(t.scaledTo(u--).key);return m}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=t)}}class Bi{constructor(t,n,o){this.painter=t,this.sourceCache=new Ai(n),this.options=o,this.exaggeration=typeof o.exaggeration=="number"?o.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,o,u=a.W){var m;if(!(n>=0&&n=0&&ot.canonical.z&&(t.canonical.z>=u?m=t.canonical.z-u:a.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const w=t.canonical.x-(t.canonical.x>>m<>m<>8<<4|m>>8,n[w+3]=0;const o=new a.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),u=new De(t,o,t.gl.RGBA,{premultiply:!1});return u.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=u,u}pointCoordinate(t){const n=new Uint8Array(4),o=this.painter.context,u=o.gl;o.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),u.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,u.RGBA,u.UNSIGNED_BYTE,n),o.bindFramebuffer.set(null);const m=n[0]+(n[2]>>4<<8),w=n[1]+((15&n[2])<<8),T=this.coordsIndex[255-n[3]],I=T&&this.sourceCache.getTileByID(T);if(!I)return null;const C=this._coordsTextureSize,P=(1<t.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse)===!1}}const Sn={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class sa{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new Dc(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(o=>!t._layers[o].isHidden(n)),this._coordsDescendingInv={};for(const o in t.sourceCaches){this._coordsDescendingInv[o]={};const u=t.sourceCaches[o].getVisibleCoordinates();for(const m of u){const w=this.terrain.sourceCache.getTerrainCoords(m);for(const T in w)this._coordsDescendingInv[o][T]||(this._coordsDescendingInv[o][T]=[]),this._coordsDescendingInv[o][T].push(w[T])}}this._coordsDescendingInvStr={};for(const o of t._order){const u=t._layers[o],m=u.source;if(Sn[u.type]&&!this._coordsDescendingInvStr[m]){this._coordsDescendingInvStr[m]={};for(const w in this._coordsDescendingInv[m])this._coordsDescendingInvStr[m][w]=this._coordsDescendingInv[m][w].map(T=>T.key).sort().join()}}for(const o of this._renderableTiles)for(const u in this._coordsDescendingInvStr){const m=this._coordsDescendingInvStr[u][o.tileID.key];m&&m!==o.rttCoords[u]&&(o.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const n=t.type,o=this.painter,u=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Sn[n]&&(this._prevType&&Sn[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!u))return!0;if(Sn[this._prevType]||Sn[n]&&u){this._prevType=n;const m=this._stacks.length-1,w=this._stacks[m]||[];for(const T of this._renderableTiles){if(this.pool.isFull()&&(Qo(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(T),T.rtt[m]){const C=this.pool.getObjectForId(T.rtt[m].id);if(C.stamp===T.rtt[m].stamp){this.pool.useObject(C);continue}}const I=this.pool.getOrCreateFreeObject();this.pool.useObject(I),this.pool.stampObject(I),T.rtt[m]={id:I.id,stamp:I.stamp},o.context.bindFramebuffer.set(I.fbo.framebuffer),o.context.clear({color:a.aO.transparent,stencil:0}),o.currentStencilSource=void 0;for(let C=0;C{d.touchstart=d.dragStart,d.touchmoveWindow=d.dragMove,d.touchend=d.dragEnd},ll={showCompass:!0,showZoom:!0,visualizePitch:!1};class cl{constructor(t,n,o=!1){this.mousedown=w=>{this.startMouse(a.e({},w,{ctrlKey:!0,preventDefault:()=>w.preventDefault()}),X.mousePos(this.element,w)),X.addEventListener(window,"mousemove",this.mousemove),X.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=w=>{this.moveMouse(w,X.mousePos(this.element,w))},this.mouseup=w=>{this.mouseRotate.dragEnd(w),this.mousePitch&&this.mousePitch.dragEnd(w),this.offTemp()},this.touchstart=w=>{w.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=X.touchPos(this.element,w.targetTouches)[0],this.startTouch(w,this._startPos),X.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.addEventListener(window,"touchend",this.touchend))},this.touchmove=w=>{w.targetTouches.length!==1?this.reset():(this._lastPos=X.touchPos(this.element,w.targetTouches)[0],this.moveTouch(w,this._lastPos))},this.touchend=w=>{w.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const u=t.dragRotate._mouseRotate.getClickTolerance(),m=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=$a({clickTolerance:u,enable:!0}),this.touchRotate=(({enable:w,clickTolerance:T,bearingDegreesPerPixelMoved:I=.8})=>{const C=new Pn;return new lo({clickTolerance:T,move:(P,z)=>({bearingDelta:(z.x-P.x)*I}),moveStateManager:C,enable:w,assignEvents:Bs})})({clickTolerance:u,enable:!0}),this.map=t,o&&(this.mousePitch=Ds({clickTolerance:m,enable:!0}),this.touchPitch=(({enable:w,clickTolerance:T,pitchDegreesPerPixelMoved:I=-.5})=>{const C=new Pn;return new lo({clickTolerance:T,move:(P,z)=>({pitchDelta:(z.y-P.y)*I}),moveStateManager:C,enable:w,assignEvents:Bs})})({clickTolerance:m,enable:!0})),X.addEventListener(n,"mousedown",this.mousedown),X.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),X.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),X.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),X.disableDrag()}moveMouse(t,n){const o=this.map,{bearingDelta:u}=this.mouseRotate.dragMove(t,n)||{};if(u&&o.setBearing(o.getBearing()+u),this.mousePitch){const{pitchDelta:m}=this.mousePitch.dragMove(t,n)||{};m&&o.setPitch(o.getPitch()+m)}}moveTouch(t,n){const o=this.map,{bearingDelta:u}=this.touchRotate.dragMove(t,n)||{};if(u&&o.setBearing(o.getBearing()+u),this.touchPitch){const{pitchDelta:m}=this.touchPitch.dragMove(t,n)||{};m&&o.setPitch(o.getPitch()+m)}}off(){const t=this.element;X.removeEventListener(t,"mousedown",this.mousedown),X.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),X.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.removeEventListener(window,"touchend",this.touchend),X.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){X.enableDrag(),X.removeEventListener(window,"mousemove",this.mousemove),X.removeEventListener(window,"mouseup",this.mouseup),X.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.removeEventListener(window,"touchend",this.touchend)}}let zn;function oa(d,t,n){if(d=new a.M(d.lng,d.lat),t){const o=new a.M(d.lng-360,d.lat),u=new a.M(d.lng+360,d.lat),m=n.locationPoint(d).distSqr(t);n.locationPoint(o).distSqr(t)180;){const o=n.locationPoint(d);if(o.x>=0&&o.y>=0&&o.x<=n.width&&o.y<=n.height)break;d.lng>n.center.lng?d.lng-=360:d.lng+=360}return d}const fo={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%)"};function aa(d,t,n){const o=d.classList;for(const u in fo)o.remove(`maplibregl-${n}-anchor-${u}`);o.add(`maplibregl-${n}-anchor-${t}`)}class mo extends a.E{constructor(t){if(super(),this._onKeyPress=n=>{const o=n.code,u=n.charCode||n.keyCode;o!=="Space"&&o!=="Enter"&&u!==32&&u!==13||this.togglePopup()},this._onMapClick=n=>{const o=n.originalEvent.target,u=this._element;this._popup&&(o===u||u.contains(o))&&this.togglePopup()},this._update=n=>{if(!this._map)return;const o=this._map.loaded()&&!this._map.isMoving();((n==null?void 0:n.type)==="terrain"||(n==null?void 0:n.type)==="render"&&!o)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=oa(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let u="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?u=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(u=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let m="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?m="rotateX(0deg)":this._pitchAlignment==="map"&&(m=`rotateX(${this._map.getPitch()}deg)`),n&&n.type!=="moveend"||(this._pos=this._pos.round()),X.setTransform(this._element,`${fo[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${m} ${u}`),j.frameAsync(new AbortController).then(()=>{this._updateOpacity(n&&n.type==="moveend")}).catch(()=>{})},this._onMove=n=>{if(!this._isDragging){const o=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=o}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new a.k("dragstart"))),this.fire(new a.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new a.k("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},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"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(t==null?void 0:t.opacity,t==null?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=a.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=X.create("div"),this._element.setAttribute("aria-label","Map marker");const n=X.createNS("http://www.w3.org/2000/svg","svg"),o=41,u=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${o}px`),n.setAttributeNS(null,"width",`${u}px`),n.setAttributeNS(null,"viewBox",`0 0 ${u} ${o}`);const m=X.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"stroke","none"),m.setAttributeNS(null,"stroke-width","1"),m.setAttributeNS(null,"fill","none"),m.setAttributeNS(null,"fill-rule","evenodd");const w=X.createNS("http://www.w3.org/2000/svg","g");w.setAttributeNS(null,"fill-rule","nonzero");const T=X.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"transform","translate(3.0, 29.0)"),T.setAttributeNS(null,"fill","#000000");const I=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const se of I){const fe=X.createNS("http://www.w3.org/2000/svg","ellipse");fe.setAttributeNS(null,"opacity","0.04"),fe.setAttributeNS(null,"cx","10.5"),fe.setAttributeNS(null,"cy","5.80029008"),fe.setAttributeNS(null,"rx",se.rx),fe.setAttributeNS(null,"ry",se.ry),T.appendChild(fe)}const C=X.createNS("http://www.w3.org/2000/svg","g");C.setAttributeNS(null,"fill",this._color);const P=X.createNS("http://www.w3.org/2000/svg","path");P.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),C.appendChild(P);const z=X.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"opacity","0.25"),z.setAttributeNS(null,"fill","#000000");const V=X.createNS("http://www.w3.org/2000/svg","path");V.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),z.appendChild(V);const H=X.createNS("http://www.w3.org/2000/svg","g");H.setAttributeNS(null,"transform","translate(6.0, 7.0)"),H.setAttributeNS(null,"fill","#FFFFFF");const W=X.createNS("http://www.w3.org/2000/svg","g");W.setAttributeNS(null,"transform","translate(8.0, 8.0)");const J=X.createNS("http://www.w3.org/2000/svg","circle");J.setAttributeNS(null,"fill","#000000"),J.setAttributeNS(null,"opacity","0.25"),J.setAttributeNS(null,"cx","5.5"),J.setAttributeNS(null,"cy","5.5"),J.setAttributeNS(null,"r","5.4999962");const Z=X.createNS("http://www.w3.org/2000/svg","circle");Z.setAttributeNS(null,"fill","#FFFFFF"),Z.setAttributeNS(null,"cx","5.5"),Z.setAttributeNS(null,"cy","5.5"),Z.setAttributeNS(null,"r","5.4999962"),W.appendChild(J),W.appendChild(Z),w.appendChild(T),w.appendChild(C),w.appendChild(z),w.appendChild(H),w.appendChild(W),n.appendChild(w),n.setAttributeNS(null,"height",o*this._scale+"px"),n.setAttributeNS(null,"width",u*this._scale+"px"),this._element.appendChild(n),this._offset=a.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",n=>{n.preventDefault()}),this._element.addEventListener("mousedown",n=>{n.preventDefault()}),aa(this._element,this._anchor,"marker"),t&&t.className)for(const n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),X.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=a.M.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const u=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[u,-1*(38.1-13.5+u)],"bottom-right":[-u,-1*(38.1-13.5+u)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}_updateOpacity(t=!1){var n;if(!(!((n=this._map)===null||n===void 0)&&n.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const o=this._map,u=o.terrain.depthAtPoint(this._pos),m=o.terrain.getElevationForLngLatZoom(this._lngLat,o.transform.tileZoom);if(o.transform.lngLatToCameraDepth(this._lngLat,m)-u<.006)return void(this._element.style.opacity=this._opacity);const w=-this._offset.y/o.transform._pixelPerMeter,T=Math.sin(o.getPitch()*Math.PI/180)*w,I=o.terrain.depthAtPoint(new a.P(this._pos.x,this._pos.y-this._offset.y)),C=o.transform.lngLatToCameraDepth(this._lngLat,m+T);this._element.style.opacity=C-I>.006?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=a.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,n){return t===void 0&&n===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),t!==void 0&&(this._opacity=t),n!==void 0&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}const ul={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let cs=0,us=!1;const hl={maxWidth:100,unit:"metric"};function go(d,t,n){const o=n&&n.maxWidth||100,u=d._container.clientHeight/2,m=d.unproject([0,u]),w=d.unproject([o,u]),T=m.distanceTo(w);if(n&&n.unit==="imperial"){const I=3.2808*T;I>5280?hs(t,o,I/5280,d._getUIString("ScaleControl.Miles")):hs(t,o,I,d._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?hs(t,o,T/1852,d._getUIString("ScaleControl.NauticalMiles")):T>=1e3?hs(t,o,T/1e3,d._getUIString("ScaleControl.Kilometers")):hs(t,o,T,d._getUIString("ScaleControl.Meters"))}function hs(d,t,n,o){const u=function(m){const w=Math.pow(10,`${Math.floor(m)}`.length-1);let T=m/w;return T=T>=10?10:T>=5?5:T>=3?3:T>=2?2:T>=1?1:function(I){const C=Math.pow(10,Math.ceil(-Math.log(I)/Math.LN10));return Math.round(I*C)/C}(T),w*T}(n);d.style.width=t*(u/n)+"px",d.innerHTML=`${u} ${o}`}const dl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},pl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function la(d){if(d){if(typeof d=="number"){const t=Math.round(Math.abs(d)/Math.SQRT2);return{center:new a.P(0,0),top:new a.P(0,d),"top-left":new a.P(t,t),"top-right":new a.P(-t,t),bottom:new a.P(0,-d),"bottom-left":new a.P(t,-t),"bottom-right":new a.P(-t,-t),left:new a.P(d,0),right:new a.P(-d,0)}}if(d instanceof a.P||Array.isArray(d)){const t=a.P.convert(d);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:a.P.convert(d.center||[0,0]),top:a.P.convert(d.top||[0,0]),"top-left":a.P.convert(d["top-left"]||[0,0]),"top-right":a.P.convert(d["top-right"]||[0,0]),bottom:a.P.convert(d.bottom||[0,0]),"bottom-left":a.P.convert(d["bottom-left"]||[0,0]),"bottom-right":a.P.convert(d["bottom-right"]||[0,0]),left:a.P.convert(d.left||[0,0]),right:a.P.convert(d.right||[0,0])}}return la(new a.P(0,0))}const fl=M;x.AJAXError=a.bd,x.Evented=a.E,x.LngLat=a.M,x.MercatorCoordinate=a.Y,x.Point=a.P,x.addProtocol=a.be,x.config=a.a,x.removeProtocol=a.bf,x.AttributionControl=nl,x.BoxZoomHandler=Ja,x.CanvasSource=Ts,x.CooperativeGesturesHandler=ho,x.DoubleClickZoomHandler=na,x.DragPanHandler=tl,x.DragRotateHandler=Lc,x.EdgeInsets=zs,x.FullscreenControl=class extends a.E{constructor(d={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,d&&d.container&&(d.container instanceof HTMLElement?this._container=d.container:a.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){X.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const d=this._fullscreenButton=X.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);X.create("span","maplibregl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.title=d}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new a.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new a.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},x.GeoJSONSource=Ut,x.GeolocateControl=class extends a.E{constructor(d){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new a.k("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("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new a.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const n=new a.M(t.coords.longitude,t.coords.latitude),o=t.coords.accuracy,u=this._map.getBearing(),m=a.e({bearing:u},this.options.fitBoundsOptions),w=Qt.fromLngLat(n,o);this._map.fitBounds(w,m,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const n=new a.M(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()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&us)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new a.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",n=>n.preventDefault()),this._geolocateButton=X.create("button","maplibregl-ctrl-geolocate",this._container),X.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){a.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=X.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new mo({element:this._dotElement}),this._circleElement=X.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new mo({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new a.k("trackuserlocationend")))})}},this.options=a.e({},ul,d)}onAdd(d){return this._map=d,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t=!1){return a._(this,void 0,void 0,function*(){if(zn!==void 0&&!t)return zn;if(window.navigator.permissions===void 0)return zn=!!window.navigator.geolocation,zn;try{zn=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{zn=!!window.navigator.geolocation}return zn})}().then(t=>this._setupUI(t)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),X.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,cs=0,us=!1}_isOutOfMapMaxBounds(d){const t=this._map.getMaxBounds(),n=d.coords;return t&&(n.longitudet.getEast()||n.latitudet.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const d=this._map.getBounds(),t=d.getSouthEast(),n=d.getNorthEast(),o=t.distanceTo(n),u=Math.ceil(this._accuracy/(o/this._map._container.clientHeight)*2);this._circleElement.style.width=`${u}px`,this._circleElement.style.height=`${u}px`}trigger(){if(!this._setup)return a.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 a.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":cs--,us=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new a.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.k("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),cs++,cs>1?(d={maximumAge:6e5,timeout:0},us=!0):(d=this.options.positionOptions,us=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,d)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},x.Hash=Ya,x.ImageSource=yn,x.KeyboardHandler=Ec,x.LngLatBounds=Qt,x.LogoControl=pn,x.Map=class extends rl{constructor(d){if(a.bb.mark(a.bc.create),(d=a.e({},al,d)).minZoom!=null&&d.maxZoom!=null&&d.minZoom>d.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(d.minPitch!=null&&d.maxPitch!=null&&d.minPitch>d.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(d.minPitch!=null&&d.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(d.maxPitch!=null&&d.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new $o(d.minZoom,d.maxZoom,d.minPitch,d.maxPitch,d.renderWorldCopies),{bearingSnap:d.bearingSnap}),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new a.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new a.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=d.interactive,this._maxTileCacheSize=d.maxTileCacheSize,this._maxTileCacheZoomLevels=d.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=d.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=d.preserveDrawingBuffer,this._antialias=d.antialias,this._trackResize=d.trackResize,this._bearingSnap=d.bearingSnap,this._refreshExpiredTiles=d.refreshExpiredTiles,this._fadeDuration=d.fadeDuration,this._crossSourceCollisions=d.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=d.collectResourceTiming,this._renderTaskQueue=new Ru,this._controls=[],this._mapId=a.a3(),this._locale=a.e({},sl,d.locale),this._clickTolerance=d.clickTolerance,this._overridePixelRatio=d.pixelRatio,this._maxCanvasSize=d.maxCanvasSize,this.transformCameraUpdate=d.transformCameraUpdate,this._imageQueueHandle=$.addThrottleControl(()=>this.isMoving()),this._requestManager=new me(d.transformRequest),typeof d.container=="string"){if(this._container=document.getElementById(d.container),!this._container)throw new Error(`Container '${d.container}' not found.`)}else{if(!(d.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=d.container}if(d.maxBounds&&this.setMaxBounds(d.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let t=!1;const n=Ka(o=>{this._trackResize&&!this._removed&&this.resize(o)._update()},50);this._resizeObserver=new ResizeObserver(o=>{t?n(o):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new il(this,d),this._hash=d.hash&&new Ya(typeof d.hash=="string"&&d.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),d.bounds&&(this.resize(),this.fitBounds(d.bounds,a.e({},d.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=d.localIdeographFontFamily,this._validateStyle=d.validateStyle,d.style&&this.setStyle(d.style,{localIdeographFontFamily:d.localIdeographFontFamily}),d.attributionControl&&this.addControl(new nl(typeof d.attributionControl=="boolean"?void 0:d.attributionControl)),d.maplibreLogo&&this.addControl(new pn,d.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update(t.dataType==="style"),this.fire(new a.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new a.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new a.k("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(d,t){if(t===void 0&&(t=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new a.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=d.onAdd(this);this._controls.push(d);const o=this._controlPositions[t];return t.indexOf("bottom")!==-1?o.insertBefore(n,o.firstChild):o.appendChild(n),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new a.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(d);return t>-1&&this._controls.splice(t,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}calculateCameraOptionsFromTo(d,t,n,o){return o==null&&this.terrain&&(o=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(d,t,n,o)}resize(d){var t;const n=this._containerDimensions(),o=n[0],u=n[1],m=this._getClampedPixelRatio(o,u);if(this._resizeCanvas(o,u,m),this.painter.resize(o,u,m),this.painter.overLimit()){const T=this.painter.context.gl;this._maxCanvasSize=[T.drawingBufferWidth,T.drawingBufferHeight];const I=this._getClampedPixelRatio(o,u);this._resizeCanvas(o,u,I),this.painter.resize(o,u,I)}this.transform.resize(o,u),(t=this._requestedCameraState)===null||t===void 0||t.resize(o,u);const w=!this._moving;return w&&(this.stop(),this.fire(new a.k("movestart",d)).fire(new a.k("move",d))),this.fire(new a.k("resize",d)),w&&this.fire(new a.k("moveend",d)),this}_getClampedPixelRatio(d,t){const{0:n,1:o}=this._maxCanvasSize,u=this.getPixelRatio(),m=d*u,w=t*u;return Math.min(m>n?n/m:1,w>o?o/w:1)*u}getPixelRatio(){var d;return(d=this._overridePixelRatio)!==null&&d!==void 0?d:devicePixelRatio}setPixelRatio(d){this._overridePixelRatio=d,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(d){return this.transform.setMaxBounds(Qt.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom)return this.transform.minZoom=d,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=d,this._update(),this.getZoom()>d&&this.setZoom(d),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.minPitch=d,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(d>=this.transform.minPitch)return this.transform.maxPitch=d,this._update(),this.getPitch()>d&&this.setPitch(d),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.renderWorldCopies=d,this._update()}project(d){return this.transform.locationPoint(a.M.convert(d),this.style&&this.terrain)}unproject(d){return this.transform.pointLocation(a.P.convert(d),this.terrain)}isMoving(){var d;return this._moving||((d=this.handlers)===null||d===void 0?void 0:d.isMoving())}isZooming(){var d;return this._zooming||((d=this.handlers)===null||d===void 0?void 0:d.isZooming())}isRotating(){var d;return this._rotating||((d=this.handlers)===null||d===void 0?void 0:d.isRotating())}_createDelegatedListener(d,t,n){if(d==="mouseenter"||d==="mouseover"){let o=!1;return{layer:t,listener:n,delegates:{mousemove:m=>{const w=this.getLayer(t)?this.queryRenderedFeatures(m.point,{layers:[t]}):[];w.length?o||(o=!0,n.call(this,new Lr(d,this,m.originalEvent,{features:w}))):o=!1},mouseout:()=>{o=!1}}}}if(d==="mouseleave"||d==="mouseout"){let o=!1;return{layer:t,listener:n,delegates:{mousemove:w=>{(this.getLayer(t)?this.queryRenderedFeatures(w.point,{layers:[t]}):[]).length?o=!0:o&&(o=!1,n.call(this,new Lr(d,this,w.originalEvent)))},mouseout:w=>{o&&(o=!1,n.call(this,new Lr(d,this,w.originalEvent)))}}}}{const o=u=>{const m=this.getLayer(t)?this.queryRenderedFeatures(u.point,{layers:[t]}):[];m.length&&(u.features=m,n.call(this,u),delete u.features)};return{layer:t,listener:n,delegates:{[d]:o}}}}on(d,t,n){if(n===void 0)return super.on(d,t);const o=this._createDelegatedListener(d,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(o);for(const u in o.delegates)this.on(u,o.delegates[u]);return this}once(d,t,n){if(n===void 0)return super.once(d,t);const o=this._createDelegatedListener(d,t,n);for(const u in o.delegates)this.once(u,o.delegates[u]);return this}off(d,t,n){return n===void 0?super.off(d,t):(this._delegatedListeners&&this._delegatedListeners[d]&&(o=>{const u=this._delegatedListeners[d];for(let m=0;mthis._updateStyle(d,t));const n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!d)),d?(this.style=new Zr(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof d=="string"?this.style.loadURL(d,t,n):this.style.loadJSON(d,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Zr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(d,t){if(typeof d=="string"){const n=this._requestManager.transformRequest(d,ne.Style);a.h(n,new AbortController).then(o=>{this._updateDiff(o.data,t)}).catch(o=>{o&&this.fire(new a.j(o))})}else typeof d=="object"&&this._updateDiff(d,t)}_updateDiff(d,t){try{this.style.setState(d,t)&&this._update(!0)}catch(n){a.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(d,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():a.w("There is no style added to the map.")}addSource(d,t){return this._lazyInitEmptyStyle(),this.style.addSource(d,t),this._update(!0)}isSourceLoaded(d){const t=this.style&&this.style.sourceCaches[d];if(t!==void 0)return t.loaded();this.fire(new a.j(new Error(`There is no source with ID '${d}'`)))}setTerrain(d){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),d){const t=this.style.sourceCaches[d.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${d.source}`);this.terrain===null&&t.reload();for(const n in this.style._layers){const o=this.style._layers[n];o.type==="hillshade"&&o.source===d.source&&a.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Bi(this.painter,t,d),this.painter.renderToTexture=new sa(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==d.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new a.k("terrain",{terrain:d})),this}getTerrain(){var d,t;return(t=(d=this.terrain)===null||d===void 0?void 0:d.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const d=this.style&&this.style.sourceCaches;for(const t in d){const n=d[t]._tiles;for(const o in n){const u=n[o];if(u.state!=="loaded"&&u.state!=="errored")return!1}}return!0}removeSource(d){return this.style.removeSource(d),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,t,n={}){const{pixelRatio:o=1,sdf:u=!1,stretchX:m,stretchY:w,content:T}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||a.b(t))){if(t.width===void 0||t.height===void 0)return this.fire(new a.j(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`")));{const{width:I,height:C,data:P}=t,z=t;return this.style.addImage(d,{data:new a.R({width:I,height:C},new Uint8Array(P)),pixelRatio:o,stretchX:m,stretchY:w,content:T,sdf:u,version:0,userImage:z}),z.onAdd&&z.onAdd(this,d),this}}{const{width:I,height:C,data:P}=j.getImageData(t);this.style.addImage(d,{data:new a.R({width:I,height:C},P),pixelRatio:o,stretchX:m,stretchY:w,content:T,sdf:u,version:0})}}updateImage(d,t){const n=this.style.getImage(d);if(!n)return this.fire(new a.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const o=t instanceof HTMLImageElement||a.b(t)?j.getImageData(t):t,{width:u,height:m,data:w}=o;if(u===void 0||m===void 0)return this.fire(new a.j(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(u!==n.data.width||m!==n.data.height)return this.fire(new a.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const T=!(t instanceof HTMLImageElement||a.b(t));return n.data.replace(w,T),this.style.updateImage(d,n),this}getImage(d){return this.style.getImage(d)}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new a.j(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d){return $.getImage(this._requestManager.transformRequest(d,ne.Image),new AbortController)}listImages(){return this.style.listImages()}addLayer(d,t){return this._lazyInitEmptyStyle(),this.style.addLayer(d,t),this._update(!0)}moveLayer(d,t){return this.style.moveLayer(d,t),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(d,t,n){return this.style.setLayerZoomRange(d,t,n),this._update(!0)}setFilter(d,t,n={}){return this.style.setFilter(d,t,n),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,t,n,o={}){return this.style.setPaintProperty(d,t,n,o),this._update(!0)}getPaintProperty(d,t){return this.style.getPaintProperty(d,t)}setLayoutProperty(d,t,n,o={}){return this.style.setLayoutProperty(d,t,n,o),this._update(!0)}getLayoutProperty(d,t){return this.style.getLayoutProperty(d,t)}setGlyphs(d,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(d,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(d,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(d,t,n,o=>{o||this._update(!0)}),this}removeSprite(d){return this._lazyInitEmptyStyle(),this.style.removeSprite(d),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(d,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(d,t,n=>{n||this._update(!0)}),this}setLight(d,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(d,t){return this.style.setFeatureState(d,t),this._update()}removeFeatureState(d,t){return this.style.removeFeatureState(d,t),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let d=0,t=0;return this._container&&(d=this._container.clientWidth||400,t=this._container.clientHeight||300),[d,t]}_setupContainer(){const d=this._container;d.classList.add("maplibregl-map");const t=this._canvasContainer=X.create("div","maplibregl-canvas-container",d);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=X.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const n=this._containerDimensions(),o=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],o);const u=this._controlContainer=X.create("div","maplibregl-control-container",d),m=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(w=>{m[w]=X.create("div",`maplibregl-ctrl-${w} `,u)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,t,n){this._canvas.width=Math.floor(n*d),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const d={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",o=>{t={requestedAttributes:d},o&&(t.statusMessage=o.statusMessage,t.type=o.type)},{once:!0});const n=this._canvas.getContext("webgl2",d)||this._canvas.getContext("webgl",d);if(!n){const o="Failed to initialize WebGL";throw t?(t.message=o,new Error(JSON.stringify(t))):new Error(o)}this.painter=new bc(n,this.transform),Ie.testSupport(n)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_render(d){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(d),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const u=this.transform.zoom,m=j.now();this.style.zoomHistory.update(u,m);const w=new a.a8(u,{now:m,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),T=w.crossFadingFactor();T===1&&T===this._crossFadingFactor||(n=!0,this._crossFadingFactor=T),this.style.update(w)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new a.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,a.bb.mark(a.bc.load),this.fire(new a.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const o=this._sourcesDirty||this._styleDirty||this._placementDirty;return o||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new a.k("idle")),!this._loaded||this._fullyLoaded||o||(this._fullyLoaded=!0,a.bb.mark(a.bc.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var d;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),$.removeThrottleControl(this._imageQueueHandle),(d=this._resizeObserver)===null||d===void 0||d.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),X.remove(this._canvasContainer),X.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),a.bb.clearMetrics(),this._removed=!0,this.fire(new a.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,j.frameAsync(this._frameRequest).then(d=>{a.bb.frame(d),this._frameRequest=null,this._render(d)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get version(){return ol}getCameraTargetElevation(){return this.transform.elevation}},x.MapMouseEvent=Lr,x.MapTouchEvent=Ls,x.MapWheelEvent=os,x.Marker=mo,x.NavigationControl=class{constructor(d){this._updateZoomButtons=()=>{const t=this._map.getZoom(),n=t===this._map.getMaxZoom(),o=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=o,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",o.toString())},this._rotateCompassArrow=()=>{const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,n)=>{const o=this._map._getUIString(`NavigationControl.${n}`);t.title=o,t.setAttribute("aria-label",o)},this.options=a.e({},ll,d),this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),X.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),X.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=X.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new cl(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){X.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(d,t){const n=X.create("button",d,this._container);return n.type="button",n.addEventListener("click",t),n}},x.Popup=class extends a.E{constructor(d){super(),this.remove=()=>(this._content&&X.remove(this._content),this._container&&(X.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map),this.fire(new a.k("close")),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=X.create("div","maplibregl-popup",this._map.getContainer()),this._tip=X.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const w of this.options.className.split(" "))this._container.classList.add(w);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=oa(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;const n=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);let o=this.options.anchor;const u=la(this.options.offset);if(!o){const w=this._container.offsetWidth,T=this._container.offsetHeight;let I;I=n.y+u.bottom.ythis._map.transform.height-T?["bottom"]:[],n.xthis._map.transform.width-w/2&&I.push("right"),o=I.length===0?"bottom":I.join("-")}const m=n.add(u[o]).round();X.setTransform(this._container,`${fo[o]} translate(${m.x}px,${m.y}px)`),aa(this._container,o,"popup")},this._onClose=()=>{this.remove()},this.options=a.e(Object.create(dl),d)}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new a.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(d){return this._lngLat=a.M.convert(d),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(document.createTextNode(d))}setHTML(d){const t=document.createDocumentFragment(),n=document.createElement("body");let o;for(n.innerHTML=d;o=n.firstChild,o;)t.appendChild(o);return this.setDOMContent(t)}getMaxWidth(){var d;return(d=this._container)===null||d===void 0?void 0:d.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=X.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(d),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(d){this._container&&this._container.classList.add(d)}removeClassName(d){this._container&&this._container.classList.remove(d)}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){if(this._container)return this._container.classList.toggle(d)}_createCloseButton(){this.options.closeButton&&(this._closeButton=X.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(pl);d&&d.focus()}},x.RasterDEMTileSource=On,x.RasterTileSource=ur,x.ScaleControl=class{constructor(d){this._onMove=()=>{go(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,go(this._map,this._container,this.options)},this.options=a.e({},hl,d)}getDefaultPosition(){return"bottom-left"}onAdd(d){return this._map=d,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-scale",d.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){X.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},x.ScrollZoomHandler=uo,x.Style=Zr,x.TerrainControl=class{constructor(d){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=d}onAdd(d){return this._map=d,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=X.create("button","maplibregl-ctrl-terrain",this._container),X.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){X.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},x.TwoFingersTouchPitchHandler=el,x.TwoFingersTouchRotateHandler=ia,x.TwoFingersTouchZoomHandler=Mc,x.TwoFingersTouchZoomRotateHandler=dn,x.VectorTileSource=we,x.VideoSource=Ss,x.addSourceType=(d,t)=>a._(void 0,void 0,void 0,function*(){if(Qn(d))throw new Error(`A source type called "${d}" already exists.`);((n,o)=>{Is[n]=o})(d,t)}),x.clearPrewarmedResources=function(){const d=vi;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(yi),vi=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()"))},x.getMaxParallelImageRequests=function(){return a.a.MAX_PARALLEL_IMAGE_REQUESTS},x.getRTLTextPluginStatus=function(){return We().getRTLTextPluginStatus()},x.getVersion=function(){return fl},x.getWorkerCount=function(){return hi.workerCount},x.getWorkerUrl=function(){return a.a.WORKER_URL},x.importScriptInWorkers=function(d){return Nt().broadcast("importScript",d)},x.prewarm=function(){He().acquire(yi)},x.setMaxParallelImageRequests=function(d){a.a.MAX_PARALLEL_IMAGE_REQUESTS=d},x.setRTLTextPlugin=function(d,t){return We().setRTLTextPlugin(d,t)},x.setWorkerCount=function(d){hi.workerCount=d},x.setWorkerUrl=function(d){a.a.WORKER_URL=d}});var b=h;return b})})(Ff);var P_=Ff.exports;const kn=Rf(P_);function Mp(f){let l;return h=>{if(h)for(let p in h){let y=l==null?void 0:l[p],b=h[p];y!==b&&f(p,b,y)}else if(l)for(let p in l)f(p,void 0,l[p]);l=h}}function z_(f,...l){let h=[f];for(let p of l)if(p)Array.isArray(p)&&p[0]===f?h.push(...p.slice(1)):h.push(p);else continue;if(h.length!==1)return h.length===2?h[1]:h}function L_(f){return f===!0?["has","point_count"]:f===!1?["!",["has","point_count"]]:void 0}function Ap(f,l){return["case",["boolean",["feature-state","hover"],!1],l,f]}var uu=D_;function D_(f){var l,h,p;if(f){if(Array.isArray(f)){for(l=[],h=f.length,p=0;p{p=null}),vr())},i(y){h||(Be(p),h=!0)},o(y){Ge(p),h=!1},d(y){y&&Fe(l),p&&p.d(y)}}}function B_(f,l,h){let p,y,b,x,a,M,L,F,j,X,Ie,de,{$$slots:Te={},$$scope:ye}=l,{id:xe=Kl("layer")}=l,{source:Q=void 0}=l,{sourceLayer:$=void 0}=l,{beforeId:ne=void 0}=l,{beforeLayerType:me=void 0}=l,{type:Ue}=l,{paint:Ee=void 0}=l,{layout:be=void 0}=l,{filter:Se=void 0}=l,{applyToClusters:at=void 0}=l,{minzoom:ge=void 0}=l,{maxzoom:De=void 0}=l,{manageHoverState:ft=!1}=l,{hovered:kt=null}=l,{interactive:$t=!0}=l,{hoverCursor:nt=void 0}=l,{eventsIfTopMost:ut=!1}=l;const Vt=Xl(),{map:Jt,source:Ti,self:ei,minzoom:zt,maxzoom:yi,eventTopMost:hi,layerInfo:ki}=M_();Dt(f,Jt,$e=>h(31,j=$e)),Dt(f,Ti,$e=>h(32,X=$e)),Dt(f,ei,$e=>h(0,F=$e)),Dt(f,zt,$e=>h(34,de=$e)),Dt(f,yi,$e=>h(33,Ie=$e)),Yn(()=>{F&&j&&(ki.delete(F),j==null||j.removeLayer(F))});let vi;function xi($e){var we,ur;if(!$t||!F||!j||ut&&hi($e)!==F)return;let Ne=$e.features??[],Qt=(ur=(we=Ne[0])==null?void 0:we.properties)==null?void 0:ur.cluster_id,Di={event:$e,map:j,clusterId:Qt,layer:F,source:a,features:Ne};Vt($e.type,Di)}function He($e){var we,ur;if(!$t||!F||!j||ut&&hi($e)!==F)return;nt&&(j.getCanvas().style.cursor=nt);let Ne=$e.features??[];h(6,kt=Ne[0]??null);let Qt=(ur=(we=Ne[0])==null?void 0:we.properties)==null?void 0:ur.cluster_id;Vt("mouseenter",{event:$e,map:j,clusterId:Qt,layer:F,source:a,features:Ne})}function Tt($e){var we,ur,On;if(!$t||!j)return;if(ut&&hi($e)!==F){h(6,kt=null),ft&&vi!==void 0&&(j==null||j.setFeatureState({source:a,sourceLayer:$,id:vi},{hover:!1}),vi=void 0);return}j.getCanvas().style.cursor=nt;let Ne=$e.features??[],Qt=(ur=(we=Ne[0])==null?void 0:we.properties)==null?void 0:ur.cluster_id,Di=(On=Ne[0])==null?void 0:On.id;Di!==vi&&(ft&&(vi!==void 0&&(j==null||j.setFeatureState({source:a,id:vi,sourceLayer:$},{hover:!1})),j==null||j.setFeatureState({source:a,id:Di,sourceLayer:$},{hover:!0})),vi=Di,h(6,kt=Ne[0]??null)),Vt("mousemove",{event:$e,map:j,clusterId:Qt,layer:F,source:a,features:Ne})}function Nt($e){if(!(!$t||!F||!j)){if(nt&&(j.getCanvas().style.cursor=""),h(6,kt=null),ft&&vi!==void 0){const Ne={source:a,id:vi,sourceLayer:$};j==null||j.setFeatureState(Ne,{hover:!1}),vi=void 0}Vt("mouseleave",{map:j,layer:F,source:a})}}let Ni=!0;function Ur($e){j&&(j.off("click",$e,xi),j.off("dblclick",$e,xi),j.off("contextmenu",$e,xi),j.off("mouseenter",$e,He),j.off("mousemove",$e,Tt),j.off("mouseleave",$e,Nt))}return Yn(()=>{j&&F&&Ur(F)}),f.$$set=$e=>{"id"in $e&&h(7,xe=$e.id),"source"in $e&&h(8,Q=$e.source),"sourceLayer"in $e&&h(9,$=$e.sourceLayer),"beforeId"in $e&&h(10,ne=$e.beforeId),"beforeLayerType"in $e&&h(11,me=$e.beforeLayerType),"type"in $e&&h(12,Ue=$e.type),"paint"in $e&&h(13,Ee=$e.paint),"layout"in $e&&h(14,be=$e.layout),"filter"in $e&&h(15,Se=$e.filter),"applyToClusters"in $e&&h(16,at=$e.applyToClusters),"minzoom"in $e&&h(17,ge=$e.minzoom),"maxzoom"in $e&&h(18,De=$e.maxzoom),"manageHoverState"in $e&&h(19,ft=$e.manageHoverState),"hovered"in $e&&h(6,kt=$e.hovered),"interactive"in $e&&h(20,$t=$e.interactive),"hoverCursor"in $e&&h(21,nt=$e.hoverCursor),"eventsIfTopMost"in $e&&h(22,ut=$e.eventsIfTopMost),"$$scope"in $e&&h(35,ye=$e.$$scope)},f.$$.update=()=>{if(f.$$.dirty[0]&65536&&h(30,p=L_(at)),f.$$.dirty[0]&1073774592&&h(24,y=z_("all",p,Se)),f.$$.dirty[0]&131072|f.$$.dirty[1]&8&&h(26,b=ge??de),f.$$.dirty[0]&262144|f.$$.dirty[1]&4&&h(25,x=De??Ie),f.$$.dirty[0]&256|f.$$.dirty[1]&2&&h(29,a=Q||X),f.$$.dirty[0]&654343809|f.$$.dirty[1]&1&&j&&F!==xe&&a){F&&(Ur(F),ki.delete(F));let $e=ne;if(!ne&&me){let Ne=j.getStyle().layers,Qt=typeof me=="function"?me:we=>we.type===me,Di=Ne==null?void 0:Ne.find(Qt);Di&&($e=Di.id)}Li(ei,F=xe,F),j.addLayer(uu({id:F,type:Ue,source:a,"source-layer":$,filter:y,paint:Ee,layout:be,minzoom:b,maxzoom:x}),$e),h(23,Ni=!0),j.on("click",F,xi),j.on("dblclick",F,xi),j.on("contextmenu",F,xi),j.on("mouseenter",F,He),j.on("mousemove",F,Tt),j.on("mouseleave",F,Nt)}f.$$.dirty[0]&1048577&&F&&ki.set(F,{interactive:$t}),f.$$.dirty[0]&1|f.$$.dirty[1]&1&&h(28,M=F?Mp(($e,Ne)=>j==null?void 0:j.setPaintProperty(F,$e,Ne)):void 0),f.$$.dirty[0]&1|f.$$.dirty[1]&1&&h(27,L=F?Mp(($e,Ne)=>j==null?void 0:j.setLayoutProperty(F,$e,Ne)):void 0),f.$$.dirty[0]&268443648&&(M==null||M(Ee)),f.$$.dirty[0]&134234112&&(L==null||L(be)),f.$$.dirty[0]&100663297|f.$$.dirty[1]&1&&F&&(j==null||j.setLayerZoomRange(F,b,x)),f.$$.dirty[0]&25165825|f.$$.dirty[1]&1&&F&&(Ni?h(23,Ni=!1):j==null||j.setFilter(F,y))},[F,Jt,Ti,ei,zt,yi,kt,xe,Q,$,ne,me,Ue,Ee,be,Se,at,ge,De,ft,$t,nt,ut,Ni,y,x,b,L,M,a,p,j,X,Ie,de,ye,Te]}class Vh extends li{constructor(l){super(),ai(this,l,B_,R_,Yt,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}}function F_(f){let l;const h=f[16].default,p=an(h,f,f[24],null);return{c(){p&&p.c()},m(y,b){p&&p.m(y,b),l=!0},p(y,b){p&&p.p&&(!l||b&16777216)&&cn(p,h,y,y[24],l?ln(h,y[24],b,null):un(y[24]),null)},i(y){l||(Be(p,y),l=!0)},o(y){Ge(p,y),l=!1},d(y){p&&p.d(y)}}}function O_(f){let l,h,p;function y(x){f[17](x)}let b={id:f[1],type:"circle",source:f[2],sourceLayer:f[3],beforeId:f[4],beforeLayerType:f[5],paint:f[6],layout:f[7],filter:f[8],applyToClusters:f[9],minzoom:f[10],maxzoom:f[11],hoverCursor:f[12],manageHoverState:f[13],eventsIfTopMost:f[14],interactive:f[15],$$slots:{default:[F_]},$$scope:{ctx:f}};return f[0]!==void 0&&(b.hovered=f[0]),l=new Vh({props:b}),Yr.push(()=>Ma(l,"hovered",y)),l.$on("click",f[18]),l.$on("dblclick",f[19]),l.$on("contextmenu",f[20]),l.$on("mouseenter",f[21]),l.$on("mousemove",f[22]),l.$on("mouseleave",f[23]),{c(){It(l.$$.fragment)},m(x,a){wt(l,x,a),p=!0},p(x,[a]){const M={};a&2&&(M.id=x[1]),a&4&&(M.source=x[2]),a&8&&(M.sourceLayer=x[3]),a&16&&(M.beforeId=x[4]),a&32&&(M.beforeLayerType=x[5]),a&64&&(M.paint=x[6]),a&128&&(M.layout=x[7]),a&256&&(M.filter=x[8]),a&512&&(M.applyToClusters=x[9]),a&1024&&(M.minzoom=x[10]),a&2048&&(M.maxzoom=x[11]),a&4096&&(M.hoverCursor=x[12]),a&8192&&(M.manageHoverState=x[13]),a&16384&&(M.eventsIfTopMost=x[14]),a&32768&&(M.interactive=x[15]),a&16777216&&(M.$$scope={dirty:a,ctx:x}),!h&&a&1&&(h=!0,M.hovered=x[0],Ca(()=>h=!1)),l.$set(M)},i(x){p||(Be(l.$$.fragment,x),p=!0)},o(x){Ge(l.$$.fragment,x),p=!1},d(x){St(l,x)}}}function V_(f,l,h){let{$$slots:p={},$$scope:y}=l,{id:b=Kl("circle")}=l,{source:x=void 0}=l,{sourceLayer:a=void 0}=l,{beforeId:M=void 0}=l,{beforeLayerType:L=void 0}=l,{paint:F}=l,{layout:j=void 0}=l,{filter:X=void 0}=l,{applyToClusters:Ie=void 0}=l,{minzoom:de=void 0}=l,{maxzoom:Te=void 0}=l,{hoverCursor:ye=void 0}=l,{manageHoverState:xe=!1}=l,{hovered:Q=null}=l,{eventsIfTopMost:$=!1}=l,{interactive:ne=!0}=l;function me(De){Q=De,h(0,Q)}function Ue(De){lr.call(this,f,De)}function Ee(De){lr.call(this,f,De)}function be(De){lr.call(this,f,De)}function Se(De){lr.call(this,f,De)}function at(De){lr.call(this,f,De)}function ge(De){lr.call(this,f,De)}return f.$$set=De=>{"id"in De&&h(1,b=De.id),"source"in De&&h(2,x=De.source),"sourceLayer"in De&&h(3,a=De.sourceLayer),"beforeId"in De&&h(4,M=De.beforeId),"beforeLayerType"in De&&h(5,L=De.beforeLayerType),"paint"in De&&h(6,F=De.paint),"layout"in De&&h(7,j=De.layout),"filter"in De&&h(8,X=De.filter),"applyToClusters"in De&&h(9,Ie=De.applyToClusters),"minzoom"in De&&h(10,de=De.minzoom),"maxzoom"in De&&h(11,Te=De.maxzoom),"hoverCursor"in De&&h(12,ye=De.hoverCursor),"manageHoverState"in De&&h(13,xe=De.manageHoverState),"hovered"in De&&h(0,Q=De.hovered),"eventsIfTopMost"in De&&h(14,$=De.eventsIfTopMost),"interactive"in De&&h(15,ne=De.interactive),"$$scope"in De&&h(24,y=De.$$scope)},[Q,b,x,a,M,L,F,j,X,Ie,de,Te,ye,xe,$,ne,p,me,Ue,Ee,be,Se,at,ge,y]}class N_ extends li{constructor(l){super(),ai(this,l,V_,O_,Yt,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}function U_(f){let l;const h=f[15].default,p=an(h,f,f[23],null);return{c(){p&&p.c()},m(y,b){p&&p.m(y,b),l=!0},p(y,b){p&&p.p&&(!l||b&8388608)&&cn(p,h,y,y[23],l?ln(h,y[23],b,null):un(y[23]),null)},i(y){l||(Be(p,y),l=!0)},o(y){Ge(p,y),l=!1},d(y){p&&p.d(y)}}}function j_(f){let l,h,p;function y(x){f[16](x)}let b={id:f[1],type:"fill",source:f[2],sourceLayer:f[3],beforeId:f[4],beforeLayerType:f[5],paint:f[6],layout:f[7],filter:f[8],minzoom:f[9],maxzoom:f[10],hoverCursor:f[11],manageHoverState:f[12],eventsIfTopMost:f[13],interactive:f[14],$$slots:{default:[U_]},$$scope:{ctx:f}};return f[0]!==void 0&&(b.hovered=f[0]),l=new Vh({props:b}),Yr.push(()=>Ma(l,"hovered",y)),l.$on("click",f[17]),l.$on("dblclick",f[18]),l.$on("contextmenu",f[19]),l.$on("mouseenter",f[20]),l.$on("mousemove",f[21]),l.$on("mouseleave",f[22]),{c(){It(l.$$.fragment)},m(x,a){wt(l,x,a),p=!0},p(x,[a]){const M={};a&2&&(M.id=x[1]),a&4&&(M.source=x[2]),a&8&&(M.sourceLayer=x[3]),a&16&&(M.beforeId=x[4]),a&32&&(M.beforeLayerType=x[5]),a&64&&(M.paint=x[6]),a&128&&(M.layout=x[7]),a&256&&(M.filter=x[8]),a&512&&(M.minzoom=x[9]),a&1024&&(M.maxzoom=x[10]),a&2048&&(M.hoverCursor=x[11]),a&4096&&(M.manageHoverState=x[12]),a&8192&&(M.eventsIfTopMost=x[13]),a&16384&&(M.interactive=x[14]),a&8388608&&(M.$$scope={dirty:a,ctx:x}),!h&&a&1&&(h=!0,M.hovered=x[0],Ca(()=>h=!1)),l.$set(M)},i(x){p||(Be(l.$$.fragment,x),p=!0)},o(x){Ge(l.$$.fragment,x),p=!1},d(x){St(l,x)}}}function q_(f,l,h){let{$$slots:p={},$$scope:y}=l,{id:b=Kl("fill")}=l,{source:x=void 0}=l,{sourceLayer:a=void 0}=l,{beforeId:M=void 0}=l,{beforeLayerType:L=void 0}=l,{paint:F}=l,{layout:j=void 0}=l,{filter:X=void 0}=l,{minzoom:Ie=void 0}=l,{maxzoom:de=void 0}=l,{hoverCursor:Te=void 0}=l,{manageHoverState:ye=!1}=l,{hovered:xe=null}=l,{eventsIfTopMost:Q=!1}=l,{interactive:$=!0}=l;function ne(ge){xe=ge,h(0,xe)}function me(ge){lr.call(this,f,ge)}function Ue(ge){lr.call(this,f,ge)}function Ee(ge){lr.call(this,f,ge)}function be(ge){lr.call(this,f,ge)}function Se(ge){lr.call(this,f,ge)}function at(ge){lr.call(this,f,ge)}return f.$$set=ge=>{"id"in ge&&h(1,b=ge.id),"source"in ge&&h(2,x=ge.source),"sourceLayer"in ge&&h(3,a=ge.sourceLayer),"beforeId"in ge&&h(4,M=ge.beforeId),"beforeLayerType"in ge&&h(5,L=ge.beforeLayerType),"paint"in ge&&h(6,F=ge.paint),"layout"in ge&&h(7,j=ge.layout),"filter"in ge&&h(8,X=ge.filter),"minzoom"in ge&&h(9,Ie=ge.minzoom),"maxzoom"in ge&&h(10,de=ge.maxzoom),"hoverCursor"in ge&&h(11,Te=ge.hoverCursor),"manageHoverState"in ge&&h(12,ye=ge.manageHoverState),"hovered"in ge&&h(0,xe=ge.hovered),"eventsIfTopMost"in ge&&h(13,Q=ge.eventsIfTopMost),"interactive"in ge&&h(14,$=ge.interactive),"$$scope"in ge&&h(23,y=ge.$$scope)},[xe,b,x,a,M,L,F,j,X,Ie,de,Te,ye,Q,$,p,ne,me,Ue,Ee,be,Se,at,y]}class Vf extends li{constructor(l){super(),ai(this,l,q_,j_,Yt,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function Z_(f,l,h){let p;const{map:y}=Ea();Dt(f,y,M=>h(4,p=M));let{position:b="top-left"}=l,{container:x=void 0}=l,a=null;return Yn(()=>{p!=null&&p.loaded()&&a&&p.removeControl(a)}),f.$$set=M=>{"position"in M&&h(1,b=M.position),"container"in M&&h(2,x=M.container)},f.$$.update=()=>{if(f.$$.dirty&30&&p&&!a){let M;typeof x=="string"?M=document.querySelector(x)??void 0:M=x,h(3,a=new kn.FullscreenControl({container:M})),p.addControl(a,b)}},[y,b,x,a,p]}class G_ extends li{constructor(l){super(),ai(this,l,Z_,null,Yt,{position:1,container:2})}}function H_(f,l,h,p,y){let b=!1;f.getSource(l)&&(b=!0,f.removeSource(l));const x=()=>{p(l)&&(f.addSource(l,h),y())};if(b){const a=()=>{l&&(f.getSource(l)?setTimeout(a,1):x())};a()}else x()}function W_(f,l,h){h_().then(()=>{let p=n_(f);if(!p)return;p.getSource(l)===h&&p.removeSource(l)})}function zp(f){let l=f[0],h,p,y=Lp(f);return{c(){y.c(),h=ws()},m(b,x){y.m(b,x),Oe(b,h,x),p=!0},p(b,x){x&1&&Yt(l,l=b[0])?(yr(),Ge(y,1,1,Wt),vr(),y=Lp(b),y.c(),Be(y,1),y.m(h.parentNode,h)):y.p(b,x)},i(b){p||(Be(y),p=!0)},o(b){Ge(y),p=!1},d(b){b&&Fe(h),y.d(b)}}}function Lp(f){let l;const h=f[15].default,p=an(h,f,f[14],null);return{c(){p&&p.c()},m(y,b){p&&p.m(y,b),l=!0},p(y,b){p&&p.p&&(!l||b&16384)&&cn(p,h,y,y[14],l?ln(h,y[14],b,null):un(y[14]),null)},i(y){l||(Be(p,y),l=!0)},o(y){Ge(p,y),l=!1},d(y){p&&p.d(y)}}}function X_(f){let l,h,p=f[0]&&zp(f);return{c(){p&&p.c(),l=ws()},m(y,b){p&&p.m(y,b),Oe(y,l,b),h=!0},p(y,[b]){y[0]?p?(p.p(y,b),b&1&&Be(p,1)):(p=zp(y),p.c(),Be(p,1),p.m(l.parentNode,l)):p&&(yr(),Ge(p,1,1,()=>{p=null}),vr())},i(y){h||(Be(p),h=!0)},o(y){Ge(p),h=!1},d(y){y&&Fe(l),p&&p.d(y)}}}function K_(f,l,h){let p,y,b,{$$slots:x={},$$scope:a}=l,{id:M=Kl("geojson")}=l,{data:L}=l,{generateId:F=!1}=l,{promoteId:j=void 0}=l,{filter:X=void 0}=l,{lineMetrics:Ie=void 0}=l,{cluster:de=void 0}=l;const{map:Te,cluster:ye,self:xe}=C_();Dt(f,Te,ne=>h(13,y=ne)),Dt(f,ye,ne=>h(16,b=ne)),Dt(f,xe,ne=>h(0,p=ne));let Q,$=!0;return Yn(()=>{p&&Q&&y&&(W_(Te,p,Q),Li(xe,p=null,p),h(11,Q=void 0))}),f.$$set=ne=>{"id"in ne&&h(4,M=ne.id),"data"in ne&&h(5,L=ne.data),"generateId"in ne&&h(6,F=ne.generateId),"promoteId"in ne&&h(7,j=ne.promoteId),"filter"in ne&&h(8,X=ne.filter),"lineMetrics"in ne&&h(9,Ie=ne.lineMetrics),"cluster"in ne&&h(10,de=ne.cluster),"$$scope"in ne&&h(14,a=ne.$$scope)},f.$$.update=()=>{f.$$.dirty&1024&&Li(ye,b=de,b),f.$$.dirty&12273&&y&&p!==M&&(Li(xe,p=M,p),H_(y,p,uu({type:"geojson",data:L,filter:X,lineMetrics:Ie,generateId:F,promoteId:j,cluster:!!de,clusterMinPoints:de==null?void 0:de.minPoints,clusterMaxZoom:de==null?void 0:de.maxZoom,clusterRadius:de==null?void 0:de.radius,clusterProperties:de==null?void 0:de.properties}),ne=>y&&ne===p,()=>{p&&(h(11,Q=y==null?void 0:y.getSource(p)),h(12,$=!0))})),f.$$.dirty&8208&&(y==null||y.on("style.load",()=>{h(11,Q=y==null?void 0:y.getSource(M))})),f.$$.dirty&6176&&Q&&($?h(12,$=!1):Q.setData(L)),f.$$.dirty&3072&&(Q==null||Q.setClusterOptions(uu({cluster:!!de,clusterMaxZoom:de==null?void 0:de.maxZoom,clusterRadius:de==null?void 0:de.radius})))},[p,Te,ye,xe,M,L,F,j,X,Ie,de,Q,$,y,a,x]}class Io extends li{constructor(l){super(),ai(this,l,K_,X_,Yt,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10})}}function Y_(f,l,h){let p;const{map:y}=Ea();Dt(f,y,X=>h(8,p=X));let{position:b="top-left"}=l,{positionOptions:x=void 0}=l,{fitBoundsOptions:a=void 0}=l,{trackUserLocation:M=!1}=l,{showAccuracyCircle:L=!0}=l,{showUserLocation:F=!0}=l,j=null;return Yn(()=>{p!=null&&p.loaded()&&j&&p.removeControl(j)}),f.$$set=X=>{"position"in X&&h(1,b=X.position),"positionOptions"in X&&h(2,x=X.positionOptions),"fitBoundsOptions"in X&&h(3,a=X.fitBoundsOptions),"trackUserLocation"in X&&h(4,M=X.trackUserLocation),"showAccuracyCircle"in X&&h(5,L=X.showAccuracyCircle),"showUserLocation"in X&&h(6,F=X.showUserLocation)},f.$$.update=()=>{f.$$.dirty&510&&p&&!j&&(h(7,j=new kn.GeolocateControl({positionOptions:x,fitBoundsOptions:a,trackUserLocation:M,showAccuracyCircle:L,showUserLocation:F})),p.addControl(j,b))},[y,b,x,a,M,L,F,j,p]}class J_ extends li{constructor(l){super(),ai(this,l,Y_,null,Yt,{position:1,positionOptions:2,fitBoundsOptions:3,trackUserLocation:4,showAccuracyCircle:5,showUserLocation:6})}}function Q_(f){let l;const h=f[15].default,p=an(h,f,f[23],null);return{c(){p&&p.c()},m(y,b){p&&p.m(y,b),l=!0},p(y,b){p&&p.p&&(!l||b&8388608)&&cn(p,h,y,y[23],l?ln(h,y[23],b,null):un(y[23]),null)},i(y){l||(Be(p,y),l=!0)},o(y){Ge(p,y),l=!1},d(y){p&&p.d(y)}}}function $_(f){let l,h,p;function y(x){f[16](x)}let b={id:f[1],type:"line",source:f[2],sourceLayer:f[3],beforeId:f[4],beforeLayerType:f[5],paint:f[6],layout:f[7],filter:f[8],minzoom:f[9],maxzoom:f[10],hoverCursor:f[11],manageHoverState:f[12],eventsIfTopMost:f[13],interactive:f[14],$$slots:{default:[Q_]},$$scope:{ctx:f}};return f[0]!==void 0&&(b.hovered=f[0]),l=new Vh({props:b}),Yr.push(()=>Ma(l,"hovered",y)),l.$on("click",f[17]),l.$on("dblclick",f[18]),l.$on("contextmenu",f[19]),l.$on("mouseenter",f[20]),l.$on("mousemove",f[21]),l.$on("mouseleave",f[22]),{c(){It(l.$$.fragment)},m(x,a){wt(l,x,a),p=!0},p(x,[a]){const M={};a&2&&(M.id=x[1]),a&4&&(M.source=x[2]),a&8&&(M.sourceLayer=x[3]),a&16&&(M.beforeId=x[4]),a&32&&(M.beforeLayerType=x[5]),a&64&&(M.paint=x[6]),a&128&&(M.layout=x[7]),a&256&&(M.filter=x[8]),a&512&&(M.minzoom=x[9]),a&1024&&(M.maxzoom=x[10]),a&2048&&(M.hoverCursor=x[11]),a&4096&&(M.manageHoverState=x[12]),a&8192&&(M.eventsIfTopMost=x[13]),a&16384&&(M.interactive=x[14]),a&8388608&&(M.$$scope={dirty:a,ctx:x}),!h&&a&1&&(h=!0,M.hovered=x[0],Ca(()=>h=!1)),l.$set(M)},i(x){p||(Be(l.$$.fragment,x),p=!0)},o(x){Ge(l.$$.fragment,x),p=!1},d(x){St(l,x)}}}function ey(f,l,h){let{$$slots:p={},$$scope:y}=l,{id:b=Kl("line")}=l,{source:x=void 0}=l,{sourceLayer:a=void 0}=l,{beforeId:M=void 0}=l,{beforeLayerType:L=void 0}=l,{paint:F}=l,{layout:j=void 0}=l,{filter:X=void 0}=l,{minzoom:Ie=void 0}=l,{maxzoom:de=void 0}=l,{hoverCursor:Te=void 0}=l,{manageHoverState:ye=!1}=l,{hovered:xe=null}=l,{eventsIfTopMost:Q=!1}=l,{interactive:$=!0}=l;function ne(ge){xe=ge,h(0,xe)}function me(ge){lr.call(this,f,ge)}function Ue(ge){lr.call(this,f,ge)}function Ee(ge){lr.call(this,f,ge)}function be(ge){lr.call(this,f,ge)}function Se(ge){lr.call(this,f,ge)}function at(ge){lr.call(this,f,ge)}return f.$$set=ge=>{"id"in ge&&h(1,b=ge.id),"source"in ge&&h(2,x=ge.source),"sourceLayer"in ge&&h(3,a=ge.sourceLayer),"beforeId"in ge&&h(4,M=ge.beforeId),"beforeLayerType"in ge&&h(5,L=ge.beforeLayerType),"paint"in ge&&h(6,F=ge.paint),"layout"in ge&&h(7,j=ge.layout),"filter"in ge&&h(8,X=ge.filter),"minzoom"in ge&&h(9,Ie=ge.minzoom),"maxzoom"in ge&&h(10,de=ge.maxzoom),"hoverCursor"in ge&&h(11,Te=ge.hoverCursor),"manageHoverState"in ge&&h(12,ye=ge.manageHoverState),"hovered"in ge&&h(0,xe=ge.hovered),"eventsIfTopMost"in ge&&h(13,Q=ge.eventsIfTopMost),"interactive"in ge&&h(14,$=ge.interactive),"$$scope"in ge&&h(23,y=ge.$$scope)},[xe,b,x,a,M,L,F,j,X,Ie,de,Te,ye,Q,$,p,ne,me,Ue,Ee,be,Se,at,y]}class Pa extends li{constructor(l){super(),ai(this,l,ey,$_,Yt,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function ty(f){let l=f.getCenter(),h=Math.round(f.getZoom()*100)/100,p=Math.ceil((h*Math.LN2+Math.log(512/360/.5))/Math.LN10),y=Math.pow(10,p),b=Math.round(l.lat*y)/y,x=Math.round(l.lng*y)/y,a=`${h}/${b}/${x}`,M=f.getBearing(),L=f.getPitch();return(M||L)&&(a+=`/${Math.round(M*10)/10}`),L&&(a+=`/${Math.round(L)}`),`#${a}`}function iy(f){return f.replace("#","").split("/").map(parseFloat)}var su=Nh;function Nh(f,l){return f===l||f!==f&&l!==l?!0:typeof f!=typeof l||{}.toString.call(f)!={}.toString.call(l)||f!==Object(f)||!f?!1:Array.isArray(f)?Dp(f,l):{}.toString.call(f)=="[object Set]"?Dp(Array.from(f),Array.from(l)):{}.toString.call(f)=="[object Object]"?ny(f,l):ry(f,l)}function ry(f,l){return f.toString()===l.toString()}function Dp(f,l){var h=f.length;if(h!=l.length)return!1;for(var p=0;ph(6,p=F));let{position:b="top-left"}=l,{showCompass:x=!0}=l,{showZoom:a=!0}=l,{visualizePitch:M=!1}=l,L=null;return Yn(()=>{p!=null&&p.loaded()&&L&&p.removeControl(L)}),f.$$set=F=>{"position"in F&&h(1,b=F.position),"showCompass"in F&&h(2,x=F.showCompass),"showZoom"in F&&h(3,a=F.showZoom),"visualizePitch"in F&&h(4,M=F.visualizePitch)},f.$$.update=()=>{f.$$.dirty&126&&p&&!L&&(h(5,L=new kn.NavigationControl({showCompass:x,showZoom:a,visualizePitch:M})),p.addControl(L,b))},[y,b,x,a,M,L,p]}class oy extends li{constructor(l){super(),ai(this,l,sy,null,Yt,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function ay(f,l,h){let p;const{map:y}=Ea();Dt(f,y,L=>h(5,p=L));let{position:b="bottom-left"}=l,{maxWidth:x=void 0}=l,{unit:a="metric"}=l,M=null;return Yn(()=>{p!=null&&p.loaded()&&M&&p.removeControl(M)}),f.$$set=L=>{"position"in L&&h(1,b=L.position),"maxWidth"in L&&h(2,x=L.maxWidth),"unit"in L&&h(3,a=L.unit)},f.$$.update=()=>{f.$$.dirty&62&&p&&!M&&(h(4,M=new kn.ScaleControl({maxWidth:x,unit:a})),p.addControl(M,b))},[y,b,x,a,M,p]}class ly extends li{constructor(l){super(),ai(this,l,ay,null,Yt,{position:1,maxWidth:2,unit:3})}}const cy=f=>({map:f[0]&8,loadedImages:f[0]&16,allImagesLoaded:f[0]&32}),Rp=f=>({map:f[3],loadedImages:f[4],allImagesLoaded:f[5]});function Bp(f){let l,h,p=f[2]&&Fp(f);const y=f[36].default,b=an(y,f,f[35],Rp);return{c(){p&&p.c(),l=pt(),b&&b.c()},m(x,a){p&&p.m(x,a),Oe(x,l,a),b&&b.m(x,a),h=!0},p(x,a){x[2]?p?(p.p(x,a),a[0]&4&&Be(p,1)):(p=Fp(x),p.c(),Be(p,1),p.m(l.parentNode,l)):p&&(yr(),Ge(p,1,1,()=>{p=null}),vr()),b&&b.p&&(!h||a[0]&56|a[1]&16)&&cn(b,y,x,x[35],h?ln(y,x[35],a,cy):un(x[35]),Rp)},i(x){h||(Be(p),Be(b,x),h=!0)},o(x){Ge(p),Ge(b,x),h=!1},d(x){x&&Fe(l),p&&p.d(x),b&&b.d(x)}}}function Fp(f){let l,h,p,y,b,x,a,M;return l=new oy({props:{position:f[6]}}),p=new J_({props:{position:f[6],fitBoundsOptions:{maxZoom:12}}}),b=new G_({props:{position:f[6]}}),a=new ly({props:{position:f[6]}}),{c(){It(l.$$.fragment),h=pt(),It(p.$$.fragment),y=pt(),It(b.$$.fragment),x=pt(),It(a.$$.fragment)},m(L,F){wt(l,L,F),Oe(L,h,F),wt(p,L,F),Oe(L,y,F),wt(b,L,F),Oe(L,x,F),wt(a,L,F),M=!0},p(L,F){const j={};F[0]&64&&(j.position=L[6]),l.$set(j);const X={};F[0]&64&&(X.position=L[6]),p.$set(X);const Ie={};F[0]&64&&(Ie.position=L[6]),b.$set(Ie);const de={};F[0]&64&&(de.position=L[6]),a.$set(de)},i(L){M||(Be(l.$$.fragment,L),Be(p.$$.fragment,L),Be(b.$$.fragment,L),Be(a.$$.fragment,L),M=!0)},o(L){Ge(l.$$.fragment,L),Ge(p.$$.fragment,L),Ge(b.$$.fragment,L),Ge(a.$$.fragment,L),M=!1},d(L){L&&(Fe(h),Fe(y),Fe(x)),St(l,L),St(p,L),St(b,L),St(a,L)}}}function uy(f){let l,h,p,y,b,x=f[3]&&f[0]&&Bp(f);return{c(){l=Ve("div"),x&&x.c(),Ht(l,"class",h=Tp(f[1])+" svelte-p00lfq"),kp(l,"expand-map",!f[1])},m(a,M){Oe(a,l,M),x&&x.m(l,null),p=!0,y||(b=Mh(f[9].call(null,l)),y=!0)},p(a,M){a[3]&&a[0]?x?(x.p(a,M),M[0]&9&&Be(x,1)):(x=Bp(a),x.c(),Be(x,1),x.m(l,null)):x&&(yr(),Ge(x,1,1,()=>{x=null}),vr()),(!p||M[0]&2&&h!==(h=Tp(a[1])+" svelte-p00lfq"))&&Ht(l,"class",h),(!p||M[0]&2)&&kp(l,"expand-map",!a[1])},i(a){p||(Be(x),p=!0)},o(a){Ge(x),p=!1},d(a){a&&Fe(l),x&&x.d(),y=!1,b()}}}function hy(f,l,h){let p,y,b,x,{$$slots:a={},$$scope:M}=l,{map:L=null}=l,{class:F=void 0}=l,{style:j}=l,{diffStyleUpdates:X=!1}=l,{center:Ie=void 0}=l,{zoom:de=void 0}=l,{pitch:Te=0}=l,{bearing:ye=0}=l,{bounds:xe=void 0}=l,{hash:Q=!1}=l,{loaded:$=!1}=l,{minZoom:ne=0}=l,{maxZoom:me=22}=l,{zoomOnDoubleClick:Ue=!0}=l,{locale:Ee=void 0}=l,{interactive:be=!0}=l,{attributionControl:Se=!0}=l,{cooperativeGestures:at=!1}=l,{preserveDrawingBuffer:ge=!1}=l,{maxBounds:De=void 0}=l,{images:ft=[]}=l,{standardControls:kt=!1}=l,{filterLayers:$t=void 0}=l,{transformRequest:nt=void 0}=l;const ut=Xl(),{map:Vt,loadedImages:Jt}=k_();Dt(f,Vt,He=>h(3,b=He)),Dt(f,Jt,He=>h(4,x=He));let Ti=new Set;async function ei(He,Tt=!1){if(b&&!(!b.loaded()&&!Tt))if("url"in He){Ti.add(He.id);try{let Nt=await b.loadImage(He.url);b==null||b.addImage(He.id,Nt.data,He.options),x.add(He.id),Jt.set(x)}catch(Nt){ut("error",Nt)}finally{Ti.delete(He.id)}}else b.addImage(He.id,He.data,He.options),x.add(He.id),Jt.set(x)}let zt,yi,hi,ki;function vi(He){if(Q){let Tt=iy(window.location.hash);Tt.length>=3&&(h(11,de=Tt[0]),h(10,Ie=[Tt[2],Tt[1]])),Tt.length==5&&(h(15,ye=Tt[3]),h(14,Te=Tt[4]))}return Li(Vt,b=new kn.Map(uu({container:He,style:j,locale:Ee,center:Ie,zoom:de,pitch:Te,bearing:ye,minZoom:ne,maxZoom:me,interactive:be,preserveDrawingBuffer:ge,maxBounds:De,bounds:xe,attributionControl:Se,transformRequest:nt,cooperativeGestures:at})),b),b.on("load",Tt=>{h(0,$=!0),ut("load",b)}),b.on("error",Tt=>ut("error",{...Tt,map:b})),b.on("movestart",Tt=>ut("movestart",{...Tt,map:b})),b.on("moveend",Tt=>{if(h(10,Ie=Tt.target.getCenter()),h(11,de=Tt.target.getZoom()),h(12,xe=Tt.target.getBounds()),ut("moveend",{...Tt,map:b}),Q){let Nt=window.location.href.replace(/(#.+)?$/,ty(b));window.history.replaceState(window.history.state,"",Nt)}}),b.on("zoomstart",Tt=>ut("zoomstart",{...Tt,map:b})),b.on("zoom",Tt=>{h(11,de=Tt.target.getZoom()),ut("zoom",{...Tt,map:b})}),b.on("zoomend",Tt=>{h(11,de=Tt.target.getZoom()),ut("zoomend",{...Tt,map:b})}),b.on("style.load",()=>{if(b){const Tt=b.getStyle();if(h(32,zt=Tt.layers.map(Nt=>Nt.id)),h(33,yi=Object.keys(Tt.sources)),ki)for(const[Nt,Ni]of Object.entries(ki))b.addSource(Nt,Ni);if(hi)for(const Nt of hi)b.addLayer(Nt);for(const Nt of ft)ei(Nt,!0)}}),b.on("styledata",Tt=>{if(b&&$t){const Nt=b.getStyle().layers;if(Nt)for(let Ni of Nt)$t(Ni)||b.setLayoutProperty(Ni.id,"visibility","none")}ut("styledata",{...Tt,map:b})}),{destroy(){h(0,$=!1),b==null||b.remove(),Li(Vt,b=null,b)}}}let xi=j;return f.$$set=He=>{"map"in He&&h(13,L=He.map),"class"in He&&h(1,F=He.class),"style"in He&&h(16,j=He.style),"diffStyleUpdates"in He&&h(17,X=He.diffStyleUpdates),"center"in He&&h(10,Ie=He.center),"zoom"in He&&h(11,de=He.zoom),"pitch"in He&&h(14,Te=He.pitch),"bearing"in He&&h(15,ye=He.bearing),"bounds"in He&&h(12,xe=He.bounds),"hash"in He&&h(18,Q=He.hash),"loaded"in He&&h(0,$=He.loaded),"minZoom"in He&&h(19,ne=He.minZoom),"maxZoom"in He&&h(20,me=He.maxZoom),"zoomOnDoubleClick"in He&&h(21,Ue=He.zoomOnDoubleClick),"locale"in He&&h(22,Ee=He.locale),"interactive"in He&&h(23,be=He.interactive),"attributionControl"in He&&h(24,Se=He.attributionControl),"cooperativeGestures"in He&&h(25,at=He.cooperativeGestures),"preserveDrawingBuffer"in He&&h(26,ge=He.preserveDrawingBuffer),"maxBounds"in He&&h(27,De=He.maxBounds),"images"in He&&h(28,ft=He.images),"standardControls"in He&&h(2,kt=He.standardControls),"filterLayers"in He&&h(29,$t=He.filterLayers),"transformRequest"in He&&h(30,nt=He.transformRequest),"$$scope"in He&&h(35,M=He.$$scope)},f.$$.update=()=>{if(f.$$.dirty[0]&4&&h(6,p=typeof kt=="boolean"?void 0:kt),f.$$.dirty[0]&8&&h(13,L=b),f.$$.dirty[0]&196616|f.$$.dirty[1]&14&&b&&!su(j,xi)){const He=b.getStyle();if(zt&&(hi=He.layers.filter(Tt=>!zt.includes(Tt.id))),yi){const Tt=Object.keys(He.sources).filter(Nt=>!yi.includes(Nt));ki={};for(const Nt of Tt)ki[Nt]=He.sources[Nt]}h(34,xi=j),b.setStyle(j,{diff:X}),Li(Jt,x=new Set,x),h(31,Ti=new Set)}if(f.$$.dirty[0]&268435481|f.$$.dirty[1]&1&&$&&b!=null&&b.loaded())for(let He of ft)!x.has(He.id)&&!Ti.has(He.id)&&!b.hasImage(He.id)&&ei(He);f.$$.dirty[0]&268435472&&h(5,y=ft.every(He=>x.has(He.id))),f.$$.dirty[0]&1032&&Ie&&!su(Ie,b==null?void 0:b.getCenter())&&(b==null||b.panTo(Ie)),f.$$.dirty[0]&2056&&de&&!su(de,b==null?void 0:b.getZoom())&&(b==null||b.zoomTo(de)),f.$$.dirty[0]&4104&&xe&&!su(xe,b==null?void 0:b.getBounds())&&(b==null||b.fitBounds(xe)),f.$$.dirty[0]&2097160&&(Ue?b==null||b.doubleClickZoom.enable():b==null||b.doubleClickZoom.disable())},[$,F,kt,b,x,y,p,Vt,Jt,vi,Ie,de,xe,L,Te,ye,j,X,Q,ne,me,Ue,Ee,be,Se,at,ge,De,ft,$t,nt,Ti,zt,yi,xi,M,a]}class dy extends li{constructor(l){super(),ai(this,l,hy,uy,Yt,{map:13,class:1,style:16,diffStyleUpdates:17,center:10,zoom:11,pitch:14,bearing:15,bounds:12,hash:18,loaded:0,minZoom:19,maxZoom:20,zoomOnDoubleClick:21,locale:22,interactive:23,attributionControl:24,cooperativeGestures:25,preserveDrawingBuffer:26,maxBounds:27,images:28,standardControls:2,filterLayers:29,transformRequest:30},null,[-1,-1])}}function py(f){let l,h,p,y,b,x,a;const M=f[18].default,L=an(M,f,f[17],null);return{c(){l=Ve("div"),L&&L.c(),Ht(l,"tabindex",h=f[1]?0:void 0),Ht(l,"role",p=f[1]?"button":void 0),Er(l,"z-index",f[2])},m(F,j){Oe(F,l,j),L&&L.m(l,null),b=!0,x||(a=[Mh(f[6].call(null,l)),Mh(y=fy.call(null,l,f[0])),Kt(l,"click",f[19]),Kt(l,"dblclick",f[20]),Kt(l,"contextmenu",f[21]),Kt(l,"mouseenter",f[22]),Kt(l,"mouseleave",f[23]),Kt(l,"mousemove",f[24]),Kt(l,"keydown",f[7])],x=!0)},p(F,[j]){L&&L.p&&(!b||j&131072)&&cn(L,M,F,F[17],b?ln(M,F[17],j,null):un(F[17]),null),(!b||j&2&&h!==(h=F[1]?0:void 0))&&Ht(l,"tabindex",h),(!b||j&2&&p!==(p=F[1]?"button":void 0))&&Ht(l,"role",p),y&&pu(y.update)&&j&1&&y.update.call(null,F[0]),j&4&&Er(l,"z-index",F[2])},i(F){b||(Be(L,F),b=!0)},o(F){Ge(L,F),b=!1},d(F){F&&Fe(l),L&&L.d(F),x=!1,Jr(a)}}}function fy(f,l){const h=f.className;function p(y){y?f.className=`${h} ${y}`:f.className=h}return p(l),{update:p}}function my(f,l,h){let p,y,b,{$$slots:x={},$$scope:a}=l,{lngLat:M}=l,{class:L=void 0}=l,{interactive:F=!0}=l,{asButton:j=!1}=l,{draggable:X=!1}=l,{feature:Ie=null}=l,{offset:de=void 0}=l,{zIndex:Te=void 0}=l,{rotation:ye=0}=l,{opacity:xe=1}=l;const Q=Xl(),{map:$,layerEvent:ne,self:me}=A_();Dt(f,$,nt=>h(26,b=nt)),Dt(f,ne,nt=>h(25,p=nt)),Dt(f,me,nt=>h(16,y=nt));function Ue(nt){Li(me,y=new kn.Marker({element:nt,rotation:ye,draggable:X,offset:de,opacity:xe.toString()}).setLngLat(M).addTo(b),y);const ut=()=>Se("dragstart"),Vt=()=>{Ee(),Se("drag")},Jt=()=>{Ee(),Se("dragend")};return X&&(y.on("dragstart",ut),y.on("drag",Vt),y.on("dragend",Jt)),{destroy(){X&&(y==null||y.off("dragstart",ut),y==null||y.off("drag",Vt),y==null||y.off("dragend",Jt)),y==null||y.remove()}}}function Ee(){let nt=y==null?void 0:y.getLngLat();nt&&(Array.isArray(M)?h(9,M=[nt.lng,nt.lat]):M&&"lon"in M?h(9,M={lon:nt.lng,lat:nt.lat}):h(9,M=nt))}function be(nt){nt.key===" "&&(nt.preventDefault(),nt.stopPropagation(),Se("click"))}function Se(nt){if(!F)return;let ut=y==null?void 0:y.getLngLat();if(!ut)return;const Vt=[ut.lng,ut.lat];let Jt={map:b,marker:y,lngLat:Vt,features:[{type:"Feature",properties:(Ie==null?void 0:Ie.properties)??{},geometry:{type:"Point",coordinates:Vt}}]};Li(ne,p={...Jt,layerType:"marker",type:nt},p),Q(nt,Jt)}const at=()=>Se("click"),ge=()=>Se("dblclick"),De=()=>Se("contextmenu"),ft=nt=>{Se("mouseenter")},kt=()=>{Se("mouseleave")},$t=()=>Se("mousemove");return f.$$set=nt=>{"lngLat"in nt&&h(9,M=nt.lngLat),"class"in nt&&h(0,L=nt.class),"interactive"in nt&&h(10,F=nt.interactive),"asButton"in nt&&h(1,j=nt.asButton),"draggable"in nt&&h(11,X=nt.draggable),"feature"in nt&&h(12,Ie=nt.feature),"offset"in nt&&h(13,de=nt.offset),"zIndex"in nt&&h(2,Te=nt.zIndex),"rotation"in nt&&h(14,ye=nt.rotation),"opacity"in nt&&h(15,xe=nt.opacity),"$$scope"in nt&&h(17,a=nt.$$scope)},f.$$.update=()=>{f.$$.dirty&66048&&(y==null||y.setLngLat(M)),f.$$.dirty&73728&&(y==null||y.setOffset(de??[0,0])),f.$$.dirty&81920&&(y==null||y.setRotation(ye)),f.$$.dirty&98304&&(y==null||y.setOpacity(xe.toString()))},[L,j,Te,$,ne,me,Ue,be,Se,M,F,X,Ie,de,ye,xe,y,a,x,at,ge,De,ft,kt,$t]}class Op extends li{constructor(l){super(),ai(this,l,my,py,Yt,{lngLat:9,class:0,interactive:10,asButton:1,draggable:11,feature:12,offset:13,zIndex:2,rotation:14,opacity:15})}}const gy=f=>({features:f[0]&16,data:f[0]&16,map:f[0]&4,close:f[0]&1}),Vp=f=>{var l;return{features:f[4],data:(l=f[4])==null?void 0:l[0],map:f[2],close:f[31]}};function Np(f){let l,h,p=(f[4]||f[3]instanceof kn.Marker)&&Up(f);return{c(){l=Ve("div"),p&&p.c()},m(y,b){Oe(y,l,b),p&&p.m(l,null),f[32](l),h=!0},p(y,b){y[4]||y[3]instanceof kn.Marker?p?(p.p(y,b),b[0]&24&&Be(p,1)):(p=Up(y),p.c(),Be(p,1),p.m(l,null)):p&&(yr(),Ge(p,1,1,()=>{p=null}),vr())},i(y){h||(Be(p),h=!0)},o(y){Ge(p),h=!1},d(y){y&&Fe(l),p&&p.d(),f[32](null)}}}function Up(f){let l;const h=f[30].default,p=an(h,f,f[29],Vp);return{c(){p&&p.c()},m(y,b){p&&p.m(y,b),l=!0},p(y,b){p&&p.p&&(!l||b[0]&536870933)&&cn(p,h,y,y[29],l?ln(h,y[29],b,gy):un(y[29]),Vp)},i(y){l||(Be(p,y),l=!0)},o(y){Ge(p,y),l=!1},d(y){p&&p.d(y)}}}function _y(f){let l,h,p=f[9].default&&Np(f);return{c(){p&&p.c(),l=ws()},m(y,b){p&&p.m(y,b),Oe(y,l,b),h=!0},p(y,b){y[9].default?p?(p.p(y,b),b[0]&512&&Be(p,1)):(p=Np(y),p.c(),Be(p,1),p.m(l.parentNode,l)):p&&(yr(),Ge(p,1,1,()=>{p=null}),vr())},i(y){h||(Be(p),h=!0)},o(y){Ge(p),h=!1},d(y){y&&Fe(l),p&&p.d(y)}}}function yy(f,l,h){let p,y,b,x,a,M,{$$slots:L={},$$scope:F}=l;const j=s_(L);let{closeButton:X=void 0}=l,{closeOnClickOutside:Ie=!0}=l,{closeOnClickInside:de=!1}=l,{closeOnMove:Te=!1}=l,{openOn:ye="click"}=l,{openIfTopMost:xe=!0}=l,{focusAfterOpen:Q=!0}=l,{anchor:$=void 0}=l,{offset:ne=void 0}=l,{popupClass:me=void 0}=l,{maxWidth:Ue=void 0}=l,{lngLat:Ee=void 0}=l,{html:be=void 0}=l,{open:Se=!1}=l;const at=Xl(),{map:ge,popupTarget:De,layerEvent:ft,layer:kt,eventTopMost:$t}=Ea();Dt(f,ge,Ne=>h(2,b=Ne)),Dt(f,De,Ne=>h(3,a=Ne)),Dt(f,ft,Ne=>h(28,x=Ne)),Dt(f,kt,Ne=>h(35,M=Ne));const nt=["click","dblclick","contextmenu"];let ut,Vt=!1,Jt;function Ti(){if(!ut)return;let Ne=ut.getElement();!Ne||Ne===Jt||(Jt=Ne,ye==="hover"&&(Jt.style.pointerEvents="none"),Jt.addEventListener("mouseenter",()=>{h(24,Vt=!0)},{passive:!0}),Jt.addEventListener("mouseleave",()=>{h(24,Vt=!1)},{passive:!0}),Jt.addEventListener("click",()=>{de&&h(0,Se=!1)},{passive:!0}))}Wl(()=>{if(b)return b.on("click",Nt),b.on("contextmenu",Nt),typeof a=="string"&&(b.on("click",a,hi),b.on("dblclick",a,hi),b.on("contextmenu",a,hi),b.on("mousemove",a,Tt),b.on("mouseleave",a,He),b.on("touchstart",a,vi),b.on("touchend",a,xi)),()=>{b!=null&&b.loaded()&&(ut==null||ut.remove(),b.off("click",Nt),b.off("contextmenu",Nt),a instanceof kn.Marker?a.getPopup()===ut&&a.setPopup(void 0):typeof a=="string"&&(b.off("click",a,hi),b.off("dblclick",a,hi),b.off("contextmenu",a,hi),b.off("mousemove",a,Tt),b.off("mouseleave",a,He),b.off("touchstart",a,vi),b.off("touchend",a,xi)))}});function ei(Ne){return xe?!("marker"in Ne)&&!E_(Ne)&&$t(Ne)!==M:!1}let zt=null,yi="normal";function hi(Ne){Ne.type===ye&&(ei(Ne)||("layerType"in Ne?Ne.layerType==="deckgl"?(h(10,Ee=Ne.coordinate),h(4,zt=Ne.object?[Ne.object]:null)):(h(10,Ee=Ne.lngLat),h(4,zt=Ne.features??[])):(h(10,Ee=Ne.lngLat),h(4,zt=Ne.features??[])),setTimeout(()=>h(0,Se=!0))))}let ki=null;function vi(Ne){ki=Ne.point}function xi(Ne){if(!ki||ye!=="hover")return;let Qt=ki.dist(Ne.point);ki=null,Qt<3&&(h(10,Ee=Ne.lngLat),h(4,zt=Ne.features??[]),ut.isOpen()?h(25,yi="justOpened"):(h(25,yi="opening"),h(0,Se=!0)))}function He(Ne){ye!=="hover"||ki||yi!=="normal"||(h(0,Se=!1),h(4,zt=null))}function Tt(Ne){if(!(ye!=="hover"||ki||yi!=="normal")){if(ei(Ne)){h(0,Se=!1),h(4,zt=null);return}h(0,Se=!0),h(4,zt=Ne.features??[]),h(10,Ee=Ne.lngLat)}}function Nt(Ne){if(yi==="justOpened"){h(25,yi="normal");return}if(!Ie)return;let Qt=[Jt,a instanceof kn.Marker?a==null?void 0:a.getElement():null];Se&&ut.isOpen()&&!Qt.some(Di=>Di==null?void 0:Di.contains(Ne.originalEvent.target))&&(Ne.type==="contextmenu"&&ye==="contextmenu"||Ne.type!=="contextmenu")&&h(0,Se=!1)}Yn(()=>{b&&(ut!=null&&ut.isOpen())&&ut.remove()});let Ni;const Ur=()=>h(0,Se=!1);function $e(Ne){Yr[Ne?"unshift":"push"](()=>{Ni=Ne,h(1,Ni)})}return f.$$set=Ne=>{"closeButton"in Ne&&h(11,X=Ne.closeButton),"closeOnClickOutside"in Ne&&h(12,Ie=Ne.closeOnClickOutside),"closeOnClickInside"in Ne&&h(13,de=Ne.closeOnClickInside),"closeOnMove"in Ne&&h(14,Te=Ne.closeOnMove),"openOn"in Ne&&h(15,ye=Ne.openOn),"openIfTopMost"in Ne&&h(16,xe=Ne.openIfTopMost),"focusAfterOpen"in Ne&&h(17,Q=Ne.focusAfterOpen),"anchor"in Ne&&h(18,$=Ne.anchor),"offset"in Ne&&h(19,ne=Ne.offset),"popupClass"in Ne&&h(20,me=Ne.popupClass),"maxWidth"in Ne&&h(21,Ue=Ne.maxWidth),"lngLat"in Ne&&h(10,Ee=Ne.lngLat),"html"in Ne&&h(22,be=Ne.html),"open"in Ne&&h(0,Se=Ne.open),"$$scope"in Ne&&h(29,F=Ne.$$scope)},f.$$.update=()=>{if(f.$$.dirty[0]&14336&&h(27,p=X??(!Ie&&!de)),f.$$.dirty[0]&146685952&&(ut||(h(23,ut=new kn.Popup({closeButton:p,closeOnClick:!1,closeOnMove:Te,focusAfterOpen:Q,maxWidth:Ue,className:me,anchor:$,offset:ne})),Jt=ut.getElement(),ut.on("open",()=>{h(0,Se=!0),Ti(),at("open",ut)}),ut.on("close",()=>{h(0,Se=!1),at("close",ut)}),ut.on("hover",()=>{at("hover",ut)}))),f.$$.dirty[0]&8421384&&ut&&a instanceof kn.Marker&&(ye==="click"?a.setPopup(ut):a.getPopup()===ut&&a.setPopup(void 0)),f.$$.dirty[0]&268468224&&nt.includes(ye)&&(x==null?void 0:x.type)===ye&&(hi(x),Li(ft,x=null,x)),f.$$.dirty[0]&268468224&&h(26,y=ye==="hover"&&((x==null?void 0:x.type)==="mousemove"||(x==null?void 0:x.type)==="mouseenter")),f.$$.dirty[0]&352354304&&ye==="hover"&&ft&&(y&&x&&(x.layerType==="deckgl"?(h(10,Ee=x.coordinate),h(4,zt=x.object?[x.object]:null)):(h(10,Ee=x.lngLat),h(4,zt=x.features??[]))),h(0,Se=(y||Vt)??!1)),f.$$.dirty[0]&12582914&&(Ni?ut.setDOMContent(Ni):be&&ut.setHTML(be)),f.$$.dirty[0]&8389632&&Ee&&ut.setLngLat(Ee),f.$$.dirty[0]&41943045&&b){let Ne=ut.isOpen();Se&&!Ne?(ut.addTo(b),yi==="opening"&&h(25,yi="justOpened")):!Se&&Ne&&ut.remove()}},[Se,Ni,b,a,zt,ge,De,ft,kt,j,Ee,X,Ie,de,Te,ye,xe,Q,$,ne,me,Ue,be,ut,Vt,yi,y,p,x,F,L,Ur,$e]}class vy extends li{constructor(l){super(),ai(this,l,yy,_y,Yt,{closeButton:11,closeOnClickOutside:12,closeOnClickInside:13,closeOnMove:14,openOn:15,openIfTopMost:16,focusAfterOpen:17,anchor:18,offset:19,popupClass:20,maxWidth:21,lngLat:10,html:22,open:0},null,[-1,-1])}}var Yl=Uint8Array,Nf=Uint16Array,xy=Int32Array,by=new Yl([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]),wy=new Yl([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]),Uf=function(f,l){for(var h=new Nf(31),p=0;p<31;++p)h[p]=l+=1<>1|(oi&21845)<<1,ys=(ys&52428)>>2|(ys&13107)<<2,ys=(ys&61680)>>4|(ys&3855)<<4,Iy[oi]=((ys&65280)>>8|(ys&255)<<8)>>1;var ys,oi,fu=new Yl(288);for(oi=0;oi<144;++oi)fu[oi]=8;var oi;for(oi=144;oi<256;++oi)fu[oi]=9;var oi;for(oi=256;oi<280;++oi)fu[oi]=7;var oi;for(oi=280;oi<288;++oi)fu[oi]=8;var oi,ky=new Yl(32);for(oi=0;oi<32;++oi)ky[oi]=5;var oi,Cy=new Yl(0),My=typeof TextDecoder<"u"&&new TextDecoder,Ay=0;try{My.decode(Cy,{stream:!0}),Ay=1}catch{}const Kn={Footway:"black",Indoors:"grey",BridgeOrTunnel:"black",WithTraffic:"#4C3926",Crossing:"green",Severance:"red"},qf=["#CDE594","#80C6A3","#1F9EB7","#186290","#080C54"],Zf=[1,4,7,10,13,15];const Ey=f=>({}),jp=f=>({}),Py=f=>({}),qp=f=>({});function zy(f){let l,h,p,y;const b=f[1].left,x=an(b,f,f[0],qp),a=f[1].main,M=an(a,f,f[0],jp);return{c(){l=Ve("div"),x&&x.c(),h=pt(),p=Ve("div"),M&&M.c(),Ht(l,"class","left svelte-k43lgc"),Ht(p,"class","main svelte-k43lgc")},m(L,F){Oe(L,l,F),x&&x.m(l,null),Oe(L,h,F),Oe(L,p,F),M&&M.m(p,null),y=!0},p(L,[F]){x&&x.p&&(!y||F&1)&&cn(x,b,L,L[0],y?ln(b,L[0],F,Py):un(L[0]),qp),M&&M.p&&(!y||F&1)&&cn(M,a,L,L[0],y?ln(a,L[0],F,Ey):un(L[0]),jp)},i(L){y||(Be(x,L),Be(M,L),y=!0)},o(L){Ge(x,L),Ge(M,L),y=!1},d(L){L&&(Fe(l),Fe(h),Fe(p)),x&&x.d(L),M&&M.d(L)}}}function Ly(f,l,h){let{$$slots:p={},$$scope:y}=l;return f.$$set=b=>{"$$scope"in b&&h(0,y=b.$$scope)},[y,p]}class Dy extends li{constructor(l){super(),ai(this,l,Ly,zy,Yt,{})}}function Zp(f,l,h){const p=f.slice();return p[1]=l[h][0],p[2]=l[h][1],p}function Gp(f){let l,h,p,y=f[1]+"",b,x;return{c(){l=Ve("li"),h=Ve("span"),p=pt(),b=ui(y),x=pt(),Ht(h,"class","svelte-kzgqtg"),Er(h,"background",f[2])},m(a,M){Oe(a,l,M),qe(l,h),qe(l,p),qe(l,b),qe(l,x)},p(a,M){M&1&&Er(h,"background",a[2]),M&1&&y!==(y=a[1]+"")&&An(b,y)},d(a){a&&Fe(l)}}}function Ry(f){let l,h=sn(f[0]),p=[];for(let y=0;y{"rows"in y&&h(0,p=y.rows)},[p]}class Fy extends li{constructor(l){super(),ai(this,l,By,Ry,Yt,{rows:0})}}function Hp(f){let l,h;return{c(){l=Ve("div"),h=ui(f[0]),Ht(l,"class","svelte-1uuov7f")},m(p,y){Oe(p,l,y),qe(l,h)},p(p,y){y&1&&An(h,p[0])},d(p){p&&Fe(l)}}}function Oy(f){let l,h=f[0]&&Hp(f);return{c(){h&&h.c(),l=ws()},m(p,y){h&&h.m(p,y),Oe(p,l,y)},p(p,[y]){p[0]?h?h.p(p,y):(h=Hp(p),h.c(),h.m(l.parentNode,l)):h&&(h.d(1),h=null)},i:Wt,o:Wt,d(p){p&&Fe(l),h&&h.d(p)}}}function Vy(f,l,h){let{msg:p=null}=l;return f.$$set=y=>{"msg"in y&&h(0,p=y.msg)},[p]}class Ny extends li{constructor(l){super(),ai(this,l,Vy,Oy,Yt,{msg:0})}}const Uy=f=>({dialog:f&1}),Wp=f=>({dialog:f[0]});function jy(f){let l,h,p,y,b;const x=f[4].default,a=an(x,f,f[3],Wp);return{c(){l=Ve("dialog"),h=Ve("article"),a&&a.c(),l.open=!0},m(M,L){Oe(M,l,L),qe(l,h),a&&a.m(h,null),f[6](l),p=!0,y||(b=[Kt(window,"click",f[1]),Kt(window,"keydown",f[2]),Kt(l,"close",f[5])],y=!0)},p(M,[L]){a&&a.p&&(!p||L&9)&&cn(a,x,M,M[3],p?ln(x,M[3],L,Uy):un(M[3]),Wp)},i(M){p||(Be(a,M),p=!0)},o(M){Ge(a,M),p=!1},d(M){M&&Fe(l),a&&a.d(M),f[6](null),y=!1,Jr(b)}}}function qy(f,l,h){let{$$slots:p={},$$scope:y}=l,b;function x(F){b.open&&F.target==b&&b.close()}function a(F){(F.key=="Escape"||F.key=="Enter")&&(F.stopPropagation(),b.close())}function M(F){lr.call(this,f,F)}function L(F){Yr[F?"unshift":"push"](()=>{b=F,h(0,b)})}return f.$$set=F=>{"$$scope"in F&&h(3,y=F.$$scope)},[b,x,a,y,p,M,L]}class Zy extends li{constructor(l){super(),ai(this,l,qy,jy,Yt,{})}}var Nr=63710088e-1,Uh={centimeters:Nr*100,centimetres:Nr*100,degrees:Nr/111325,feet:Nr*3.28084,inches:Nr*39.37,kilometers:Nr/1e3,kilometres:Nr/1e3,meters:Nr,metres:Nr,miles:Nr/1609.344,millimeters:Nr*1e3,millimetres:Nr*1e3,nauticalmiles:Nr/1852,radians:1,yards:Nr*1.0936},Gy={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Nr,yards:1.0936133},zh={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function En(f,l,h){h===void 0&&(h={});var p={type:"Feature"};return(h.id===0||h.id)&&(p.id=h.id),h.bbox&&(p.bbox=h.bbox),p.properties=l||{},p.geometry=f,p}function Hy(f,l,h){switch(f){case"Point":return nn(l).geometry;case"LineString":return Cn(l).geometry;case"Polygon":return jh(l).geometry;case"MultiPoint":return Hf(l).geometry;case"MultiLineString":return Gf(l).geometry;case"MultiPolygon":return Wf(l).geometry;default:throw new Error(f+" is invalid")}}function nn(f,l,h){if(h===void 0&&(h={}),!f)throw new Error("coordinates is required");if(!Array.isArray(f))throw new Error("coordinates must be an Array");if(f.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hu(f[0])||!hu(f[1]))throw new Error("coordinates must contain numbers");var p={type:"Point",coordinates:f};return En(p,l,h)}function Wy(f,l,h){return h===void 0&&(h={}),To(f.map(function(p){return nn(p,l)}),h)}function jh(f,l,h){h===void 0&&(h={});for(var p=0,y=f;p=0))throw new Error("precision must be a positive number");var h=Math.pow(10,l||0);return Math.round(f*h)/h}function qh(f,l){l===void 0&&(l="kilometers");var h=Uh[l];if(!h)throw new Error(l+" units is invalid");return f*h}function mu(f,l){l===void 0&&(l="kilometers");var h=Uh[l];if(!h)throw new Error(l+" units is invalid");return f/h}function Qy(f,l){return Zl(mu(f,l))}function $y(f){var l=f%360;return l<0&&(l+=360),l}function Zl(f){var l=f%(2*Math.PI);return l*180/Math.PI}function Mn(f){var l=f%360;return l*Math.PI/180}function e0(f,l,h){if(l===void 0&&(l="kilometers"),h===void 0&&(h="kilometers"),!(f>=0))throw new Error("length must be a positive number");return qh(mu(f,l),h)}function t0(f,l,h){if(l===void 0&&(l="meters"),h===void 0&&(h="kilometers"),!(f>=0))throw new Error("area must be a positive number");var p=zh[l];if(!p)throw new Error("invalid original units");var y=zh[h];if(!y)throw new Error("invalid final units");return f/p*y}function hu(f){return!isNaN(f)&&f!==null&&!Array.isArray(f)}function Zh(f){return!!f&&f.constructor===Object}function i0(f){if(!f)throw new Error("bbox is required");if(!Array.isArray(f))throw new Error("bbox must be an Array");if(f.length!==4&&f.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");f.forEach(function(l){if(!hu(l))throw new Error("bbox must only contain numbers")})}function r0(f){if(!f)throw new Error("id is required");if(["string","number"].indexOf(typeof f)===-1)throw new Error("id must be a number or a string")}const n0=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:zh,bearingToAzimuth:$y,convertArea:t0,convertLength:e0,degreesToRadians:Mn,earthRadius:Nr,factors:Uh,feature:En,featureCollection:To,geometry:Hy,geometryCollection:Yy,isNumber:hu,isObject:Zh,lengthToDegrees:Qy,lengthToRadians:mu,lineString:Cn,lineStrings:Ky,multiLineString:Gf,multiPoint:Hf,multiPolygon:Wf,point:nn,points:Wy,polygon:jh,polygons:Xy,radiansToDegrees:Zl,radiansToLength:qh,round:Jy,unitsFactors:Gy,validateBBox:i0,validateId:r0},Symbol.toStringTag,{value:"Module"}));function Gl(f){if(!f)throw new Error("coord is required");if(!Array.isArray(f)){if(f.type==="Feature"&&f.geometry!==null&&f.geometry.type==="Point")return f.geometry.coordinates;if(f.type==="Point")return f.coordinates}if(Array.isArray(f)&&f.length>=2&&!Array.isArray(f[0])&&!Array.isArray(f[1]))return f;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Aa(f){if(Array.isArray(f))return f;if(f.type==="Feature"){if(f.geometry!==null)return f.geometry.coordinates}else if(f.coordinates)return f.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Xf(f,l,h){if(h===void 0&&(h={}),h.final===!0)return s0(f,l);var p=Gl(f),y=Gl(l),b=Mn(p[0]),x=Mn(y[0]),a=Mn(p[1]),M=Mn(y[1]),L=Math.sin(x-b)*Math.cos(M),F=Math.cos(a)*Math.sin(M)-Math.sin(a)*Math.cos(M)*Math.cos(x-b);return Zl(Math.atan2(L,F))}function s0(f,l){var h=Xf(l,f);return h=(h+180)%360,h}function Dl(f,l,h){h===void 0&&(h={});var p=Gl(f),y=Gl(l),b=Mn(y[1]-p[1]),x=Mn(y[0]-p[0]),a=Mn(p[1]),M=Mn(y[1]),L=Math.pow(Math.sin(b/2),2)+Math.pow(Math.sin(x/2),2)*Math.cos(a)*Math.cos(M);return qh(2*Math.atan2(Math.sqrt(L),Math.sqrt(1-L)),h.units)}function Xp(f,l,h,p){p===void 0&&(p={});var y=Gl(f),b=Mn(y[0]),x=Mn(y[1]),a=Mn(h),M=mu(l,p.units),L=Math.asin(Math.sin(x)*Math.cos(M)+Math.cos(x)*Math.sin(M)*Math.cos(a)),F=b+Math.atan2(Math.sin(a)*Math.sin(M)*Math.cos(x),Math.cos(M)-Math.sin(x)*Math.sin(L)),j=Zl(F),X=Zl(L);return nn([j,X],p.properties)}function Jl(f,l,h){if(f!==null)for(var p,y,b,x,a,M,L,F=0,j=0,X,Ie=f.type,de=Ie==="FeatureCollection",Te=Ie==="Feature",ye=de?f.features.length:1,xe=0;xeM||de>L||Te>F){a=j,M=p,L=de,F=Te,b=0;return}var ye=Cn([a,j],h.properties);if(l(ye,p,y,Te,b)===!1)return!1;b++,a=j})===!1)return!1}}})}function d0(f,l,h){var p=h,y=!1;return Yf(f,function(b,x,a,M,L){y===!1&&h===void 0?p=b:p=l(p,b,x,a,M,L),y=!0}),p}function Jf(f,l){if(!f)throw new Error("geojson is required");za(f,function(h,p,y){if(h.geometry!==null){var b=h.geometry.type,x=h.geometry.coordinates;switch(b){case"LineString":if(l(h,p,y,0,0)===!1)return!1;break;case"Polygon":for(var a=0;ay?h:y,L=p>b?p:b;return[x,a,M,L]}var Hh={exports:{}},Qf={exports:{}};(function(f,l){(function(h,p){f.exports=p()})(Df,function(){function h(Q,$,ne,me,Ue){(function Ee(be,Se,at,ge,De){for(;ge>at;){if(ge-at>600){var ft=ge-at+1,kt=Se-at+1,$t=Math.log(ft),nt=.5*Math.exp(2*$t/3),ut=.5*Math.sqrt($t*nt*(ft-nt)/ft)*(kt-ft/2<0?-1:1),Vt=Math.max(at,Math.floor(Se-kt*nt/ft+ut)),Jt=Math.min(ge,Math.floor(Se+(ft-kt)*nt/ft+ut));Ee(be,Se,Vt,Jt,De)}var Ti=be[Se],ei=at,zt=ge;for(p(be,at,Se),De(be[ge],Ti)>0&&p(be,at,ge);ei0;)zt--}De(be[at],Ti)===0?p(be,at,zt):p(be,++zt,ge),zt<=Se&&(at=zt+1),Se<=zt&&(ge=zt-1)}})(Q,$,ne||0,me||Q.length-1,Ue||y)}function p(Q,$,ne){var me=Q[$];Q[$]=Q[ne],Q[ne]=me}function y(Q,$){return Q<$?-1:Q>$?1:0}var b=function(Q){Q===void 0&&(Q=9),this._maxEntries=Math.max(4,Q),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function x(Q,$,ne){if(!ne)return $.indexOf(Q);for(var me=0;me<$.length;me++)if(ne(Q,$[me]))return me;return-1}function a(Q,$){M(Q,0,Q.children.length,$,Q)}function M(Q,$,ne,me,Ue){Ue||(Ue=ye(null)),Ue.minX=1/0,Ue.minY=1/0,Ue.maxX=-1/0,Ue.maxY=-1/0;for(var Ee=$;Ee=Q.minX&&$.maxY>=Q.minY}function ye(Q){return{children:Q,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function xe(Q,$,ne,me,Ue){for(var Ee=[$,ne];Ee.length;)if(!((ne=Ee.pop())-($=Ee.pop())<=me)){var be=$+Math.ceil((ne-$)/me/2)*me;h(Q,be,$,ne,Ue),Ee.push($,be,be,ne)}}return b.prototype.all=function(){return this._all(this.data,[])},b.prototype.search=function(Q){var $=this.data,ne=[];if(!Te(Q,$))return ne;for(var me=this.toBBox,Ue=[];$;){for(var Ee=0;Ee<$.children.length;Ee++){var be=$.children[Ee],Se=$.leaf?me(be):be;Te(Q,Se)&&($.leaf?ne.push(be):de(Q,Se)?this._all(be,ne):Ue.push(be))}$=Ue.pop()}return ne},b.prototype.collides=function(Q){var $=this.data;if(!Te(Q,$))return!1;for(var ne=[];$;){for(var me=0;me<$.children.length;me++){var Ue=$.children[me],Ee=$.leaf?this.toBBox(Ue):Ue;if(Te(Q,Ee)){if($.leaf||de(Q,Ee))return!0;ne.push(Ue)}}$=ne.pop()}return!1},b.prototype.load=function(Q){if(!Q||!Q.length)return this;if(Q.length=0&&Ue[$].children.length>this._maxEntries;)this._split(Ue,$),$--;this._adjustParentBBoxes(me,Ue,$)},b.prototype._split=function(Q,$){var ne=Q[$],me=ne.children.length,Ue=this._minEntries;this._chooseSplitAxis(ne,Ue,me);var Ee=this._chooseSplitIndex(ne,Ue,me),be=ye(ne.children.splice(Ee,ne.children.length-Ee));be.height=ne.height,be.leaf=ne.leaf,a(ne,this.toBBox),a(be,this.toBBox),$?Q[$-1].children.push(be):this._splitRoot(ne,be)},b.prototype._splitRoot=function(Q,$){this.data=ye([Q,$]),this.data.height=Q.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},b.prototype._chooseSplitIndex=function(Q,$,ne){for(var me,Ue,Ee,be,Se,at,ge,De=1/0,ft=1/0,kt=$;kt<=ne-$;kt++){var $t=M(Q,0,kt,this.toBBox),nt=M(Q,kt,ne,this.toBBox),ut=(Ue=$t,Ee=nt,be=void 0,Se=void 0,at=void 0,ge=void 0,be=Math.max(Ue.minX,Ee.minX),Se=Math.max(Ue.minY,Ee.minY),at=Math.min(Ue.maxX,Ee.maxX),ge=Math.min(Ue.maxY,Ee.maxY),Math.max(0,at-be)*Math.max(0,ge-Se)),Vt=X($t)+X(nt);ut=$;De--){var ft=Q.children[De];L(be,Q.leaf?Ue(ft):ft),Se+=Ie(be)}return Se},b.prototype._adjustParentBBoxes=function(Q,$,ne){for(var me=ne;me>=0;me--)L($[me],Q)},b.prototype._condense=function(Q){for(var $=Q.length-1,ne=void 0;$>=0;$--)Q[$].children.length===0?$>0?(ne=Q[$-1].children).splice(ne.indexOf(Q[$]),1):this.clear():a(Q[$],this.toBBox)},b})})(Qf);var x0=Qf.exports;const b0=Bf(n0),$f=Bf(g0);var Wh={};Object.defineProperty(Wh,"__esModule",{value:!0});var w0=$f;function Lh(f){var l=[1/0,1/0,-1/0,-1/0];return w0.coordEach(f,function(h){l[0]>h[0]&&(l[0]=h[0]),l[1]>h[1]&&(l[1]=h[1]),l[2] line1 must only contain 2 coordinates");if(p.length!==2)throw new Error(" line2 must only contain 2 coordinates");var y=h[0][0],b=h[0][1],x=h[1][0],a=h[1][1],M=p[0][0],L=p[0][1],F=p[1][0],j=p[1][1],X=(j-L)*(x-y)-(F-M)*(a-b),Ie=(F-M)*(b-L)-(j-L)*(y-M),de=(x-y)*(b-L)-(a-b)*(y-M);if(X===0)return null;var Te=Ie/X,ye=de/X;if(Te>=0&&Te<=1&&ye>=0&&ye<=1){var xe=y+Te*(x-y),Q=b+Te*(a-b);return nn([xe,Q])}return null}function C0(f,l,h){h===void 0&&(h={});var p=nn([1/0,1/0],{dist:1/0}),y=0;return za(f,function(b){for(var x=Aa(b),a=0;a0&&(ye=Te.features[0],ye.properties.dist=Dl(l,ye,h),ye.properties.location=y+Dl(M,ye,h)),M.properties.dist{if(this.active&&!this.dragFrom)this.recalculateHovering(l);else if(this.active&&this.dragFrom){if(this.hover=="polygon"){let h=this.dragFrom[0]-l.lngLat.lng,p=this.dragFrom[1]-l.lngLat.lat;for(let y of this.points)y[0]-=h,y[1]-=p}else this.points[this.hover]=l.lngLat.toArray();this.dragFrom=l.lngLat.toArray(),this.redraw()}});sr(this,"onClick",l=>{if(this.beforeUpdate(),this.active&&this.cursor){let h=[];if(Qp(this.points).forEach((p,y)=>{h.push([y+1,C0(p,this.cursor).properties.dist])}),h.sort((p,y)=>p[1]-y[1]),h.length>0){let p=h[0][0];this.points.splice(p,0,this.cursor.geometry.coordinates),this.hover=p}else this.points.push(this.cursor.geometry.coordinates),this.hover=this.points.length-1;this.redraw(),this.pointsUpdated()}else this.active&&typeof this.hover=="number"&&(this.points.splice(this.hover,1),this.hover=null,this.redraw(),this.pointsUpdated(),this.recalculateHovering(l))});sr(this,"onDoubleClick",l=>{this.active&&(l.preventDefault(),this.cursor=kh(l.lngLat.toArray()),this.onClick(l),this.finish())});sr(this,"onMouseDown",l=>{this.active&&!this.dragFrom&&this.hover!=null&&(l.preventDefault(),this.cursor=null,this.dragFrom=l.lngLat.toArray(),this.beforeUpdate(),this.redraw())});sr(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});sr(this,"onKeypress",l=>{this.active&&(l.key=="Enter"?(l.stopPropagation(),this.finish()):l.key=="z"&&l.ctrlKey&&this.undo())});sr(this,"onKeyDown",l=>{this.active&&l.key=="Escape"&&(l.stopPropagation(),this.cancel())});this.map=l,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,this.previousStates=[],this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("mousedown",this.onMouseDown),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keypress",this.onKeypress),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("mousedown",this.onMouseDown),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keypress",this.onKeypress),document.removeEventListener("keydown",this.onKeyDown)}finish(){let l=this.polygonFeature();if(l)for(let h of this.eventListenersSuccess)h(l);else for(let h of this.eventListenersFailure)h();this.stop()}cancel(){for(let l of this.eventListenersFailure)l();this.stop()}addEventListenerSuccess(l){this.eventListenersSuccess.push(l)}addEventListenerUpdated(l){this.eventListenersUpdated.push(l)}addEventListenerFailure(l){this.eventListenersFailure.push(l)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}startNew(){this.active=!0,this.map.doubleClickZoom.disable()}editExisting(l){this.active=!0,this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(l.geometry.coordinates[0])),this.points.pop(),this.redraw()}stop(){this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.active=!1,this.hover=null,this.dragFrom=null,this.previousStates=[],this.redraw(),this.map.getCanvas().style.cursor="inherit"}undo(){this.dragFrom!=null||this.previousStates.length==0||(this.points=this.previousStates.pop(),this.hover=null,this.redraw())}redraw(){let l={type:"FeatureCollection",features:[]};this.points.forEach((y,b)=>{let x=kh(y);x.properties.hover=this.hover==b,x.properties.idx=b,l.features.push(x)}),l.features=l.features.concat(Qp(this.points));let h=this.polygonFeature();h&&(h.properties.hover=this.hover=="polygon",l.features.push(h)),nm.set(l);let p="crosshair";this.hover!=null&&(p=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=p,sm.set(this.previousStates.length)}pointsUpdated(){let l=this.polygonFeature();if(l)for(let h of this.eventListenersUpdated)h(l)}recalculateHovering(l){this.cursor=null,this.hover=null;for(let h of this.map.queryRenderedFeatures(l.point,{layers:["edit-polygon-fill","edit-polygon-vertices"]}))if(h.geometry.type=="Polygon"){this.hover="polygon";break}else if(h.geometry.type=="Point"&&Object.hasOwn(h.properties,"idx")){this.hover=h.properties.idx;break}this.hover==null&&(this.cursor=kh(l.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let l=this.points.map(rm),h=[JSON.parse(JSON.stringify(l))];return h[0].push(JSON.parse(JSON.stringify(h[0][0]))),{type:"Feature",geometry:{type:"Polygon",coordinates:h},properties:{}}}beforeUpdate(){this.previousStates.push(JSON.parse(JSON.stringify(this.points))),this.previousStates.length>P0&&this.previousStates.shift()}}function Qp(f){let l=[];for(let h=0;h=3&&l.push({type:"Feature",geometry:{type:"LineString",coordinates:[f[f.length-1],f[0]]},properties:{}}),l}function L0(f){let l,h,p;return{c(){l=ui("Undo ("),h=ui(f[1]),p=ui(")")},m(y,b){Oe(y,l,b),Oe(y,h,b),Oe(y,p,b)},p(y,b){b&2&&An(h,y[1])},d(y){y&&(Fe(l),Fe(h),Fe(p))}}}function D0(f){let l;return{c(){l=ui("Undo")},m(h,p){Oe(h,l,p)},p:Wt,d(h){h&&Fe(l)}}}function R0(f){let l,h,p,y,b,x,a,M,L,F,j;function X(Te,ye){return Te[1]==0?D0:L0}let Ie=X(f),de=Ie(f);return{c(){l=Ve("div"),h=Ve("button"),h.textContent="Finish",p=pt(),y=Ve("button"),y.textContent="Cancel",b=pt(),x=Ve("button"),de.c(),M=pt(),L=Ve("ul"),L.innerHTML=`
  • Click - the map to add a vertex
  • Click - a vertex to delete it
  • Drag - a vertex or the polygon to move it
  • Press Control+Z - to undo your last change
  • Press Enter - or - double click - to finish
  • Press Escape - to cancel
  • `,x.disabled=a=f[1]==0,Er(l,"display","flex"),Er(l,"justify-content","space-between")},m(Te,ye){Oe(Te,l,ye),qe(l,h),qe(l,p),qe(l,y),qe(l,b),qe(l,x),de.m(x,null),Oe(Te,M,ye),Oe(Te,L,ye),F||(j=[Kt(h,"click",f[2]),Kt(y,"click",f[3]),Kt(x,"click",f[4])],F=!0)},p(Te,[ye]){Ie===(Ie=X(Te))&&de?de.p(Te,ye):(de.d(1),de=Ie(Te),de&&(de.c(),de.m(x,null))),ye&2&&a!==(a=Te[1]==0)&&(x.disabled=a)},i:Wt,o:Wt,d(Te){Te&&(Fe(l),Fe(M),Fe(L)),de.d(),F=!1,Jr(j)}}}function B0(f,l,h){let p;Dt(f,sm,M=>h(1,p=M));let{polygonTool:y}=l;const b=()=>y.finish(),x=()=>y.cancel(),a=()=>y.undo();return f.$$set=M=>{"polygonTool"in M&&h(0,y=M.polygonTool)},[y,p,b,x,a]}class F0 extends li{constructor(l){super(),ai(this,l,B0,R0,Yt,{polygonTool:0})}}function O0(f){let l,h,p,y,b,x;return l=new Vf({props:{id:"edit-polygon-fill",filter:M0,paint:{"fill-color":"red","fill-opacity":["case",["boolean",["get","hover"],"false"],1,.5]}}}),p=new Pa({props:{id:"edit-polygon-lines",filter:A0,paint:{"line-color":"black","line-width":8,"line-opacity":.5}}}),b=new N_({props:{id:"edit-polygon-vertices",filter:E0,paint:{"circle-color":"black","circle-opacity":["case",["has","hovered"],1,.5],"circle-radius":10}}}),{c(){It(l.$$.fragment),h=pt(),It(p.$$.fragment),y=pt(),It(b.$$.fragment)},m(a,M){wt(l,a,M),Oe(a,h,M),wt(p,a,M),Oe(a,y,M),wt(b,a,M),x=!0},p:Wt,i(a){x||(Be(l.$$.fragment,a),Be(p.$$.fragment,a),Be(b.$$.fragment,a),x=!0)},o(a){Ge(l.$$.fragment,a),Ge(p.$$.fragment,a),Ge(b.$$.fragment,a),x=!1},d(a){a&&(Fe(h),Fe(y)),St(l,a),St(p,a),St(b,a)}}}function V0(f){let l,h;return l=new Io({props:{data:f[0],$$slots:{default:[O0]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,[y]){const b={};y&1&&(b.data=p[0]),y&2&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function N0(f,l,h){let p;return Dt(f,nm,y=>h(0,p=y)),[p]}class om extends li{constructor(l){super(),ai(this,l,N0,V0,Yt,{})}}function U0(f){let l,h,p,y,b,x,a,M,L;return{c(){l=Ve("div"),h=Ve("button"),h.textContent="Import current view",p=pt(),y=Ve("i"),y.textContent="or...",b=pt(),x=Ve("div"),a=Ve("button"),a.textContent="Draw an area to import on the map",Ht(h,"type","button"),Ht(a,"type","button")},m(F,j){Oe(F,l,j),qe(l,h),Oe(F,p,j),Oe(F,y,j),Oe(F,b,j),Oe(F,x,j),qe(x,a),M||(L=[Kt(h,"click",f[1]),Kt(a,"click",f[2])],M=!0)},p:Wt,i:Wt,o:Wt,d(F){F&&(Fe(l),Fe(p),Fe(y),Fe(b),Fe(x)),M=!1,Jr(L)}}}function j0(f){let l,h;return l=new F0({props:{polygonTool:f[0]}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&1&&(b.polygonTool=p[0]),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function q0(f){let l,h,p,y;const b=[j0,U0],x=[];function a(M,L){return M[0]?0:1}return l=a(f),h=x[l]=b[l](f),{c(){h.c(),p=ws()},m(M,L){x[l].m(M,L),Oe(M,p,L),y=!0},p(M,[L]){let F=l;l=a(M),l===F?x[l].p(M,L):(yr(),Ge(x[F],1,1,()=>{x[F]=null}),vr(),h=x[l],h?h.p(M,L):(h=x[l]=b[l](M),h.c()),Be(h,1),h.m(p.parentNode,p))},i(M){y||(Be(h),y=!0)},o(M){Ge(h),y=!1},d(M){M&&Fe(p),x[l].d(M)}}}function Z0(f){let l='poly:"';for(let[p,y]of f.geometry.coordinates[0])l+=`${y} ${p} `;return l=l.slice(0,-1)+'"',`https://overpass-api.de/api/interpreter?data=${`(nwr(${l}); node(w)->.x; <;); out meta;`}`}function Rl(f){return[f.lng,f.lat]}function G0(f,l,h){let{map:p}=l;const y=Xl();let b=null;async function x(F){try{y("loading","Loading from Overpass");let X=await(await fetch(Z0(F))).text();y("gotXml",X)}catch(j){y("error",j.toString())}}function a(){let F=p.getBounds();return{type:"Feature",properties:{},geometry:{coordinates:[[Rl(F.getSouthWest()),Rl(F.getNorthWest()),Rl(F.getNorthEast()),Rl(F.getSouthEast()),Rl(F.getSouthWest())]],type:"Polygon"}}}async function M(){if(p){if(p.getZoom()<13){y("error","Zoom in more to import");return}await x(a())}}function L(){p&&(h(0,b=new z0(p)),b.startNew(),b.addEventListenerSuccess(async F=>{h(0,b=null),await x(F)}),b.addEventListenerFailure(()=>{h(0,b=null)}))}return f.$$set=F=>{"map"in F&&h(3,p=F.map)},[b,M,L,p]}class H0 extends li{constructor(l){super(),ai(this,l,G0,q0,Yt,{map:3})}}const W0=f=>({props:f&8}),$p=f=>({props:Y0(f[3])});function X0(f){let l;const h=f[1].default,p=an(h,f,f[2],$p);return{c(){p&&p.c()},m(y,b){p&&p.m(y,b),l=!0},p(y,b){p&&p.p&&(!l||b&12)&&cn(p,h,y,y[2],l?ln(h,y[2],b,W0):un(y[2]),$p)},i(y){l||(Be(p,y),l=!0)},o(y){Ge(p,y),l=!1},d(y){p&&p.d(y)}}}function K0(f){let l,h;return l=new vy({props:{openOn:f[0],$$slots:{default:[X0,({features:p})=>({3:p}),({features:p})=>p?8:0]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,[y]){const b={};y&1&&(b.openOn=p[0]),y&12&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function Y0(f){return f?f[0].properties??{}:(console.log("A Popup with null features should be impossible"),{})}function J0(f,l,h){let{$$slots:p={},$$scope:y}=l,{openOn:b="hover"}=l;return f.$$set=x=>{"openOn"in x&&h(0,b=x.openOn),"$$scope"in x&&h(2,y=x.$$scope)},[b,p,y]}class am extends li{constructor(l){super(),ai(this,l,J0,K0,Yt,{openOn:0})}}function ef(f,l,h){const p=f.slice();return p[1]=l[h][0],p[2]=l[h][1],p}function tf(f){let l,h,p=f[1]+"",y,b,x=f[2]+"",a;return{c(){l=Ve("tr"),h=Ve("td"),y=ui(p),b=Ve("td"),a=ui(x)},m(M,L){Oe(M,l,L),qe(l,h),qe(h,y),qe(l,b),qe(b,a)},p(M,L){L&1&&p!==(p=M[1]+"")&&An(y,p),L&1&&x!==(x=M[2]+"")&&An(a,x)},d(M){M&&Fe(l)}}}function Q0(f){let l,h,p=sn(Object.entries(f[0])),y=[];for(let b=0;b{"properties"in y&&h(0,p=y.properties)},[p]}class ev extends li{constructor(l){super(),ai(this,l,$0,Q0,Yt,{properties:0})}}function rf(f,l,h){const p=f.slice();return p[2]=l[h],p}function nf(f,l,h){const p=f.slice();return p[5]=l[h],p}function sf(f){let l,h;return{c(){l=Ve("span"),h=ui(`  - `),Er(l,"background",f[5]),Er(l,"width","100%"),Er(l,"border","1px solid black")},m(p,y){Oe(p,l,y),qe(l,h)},p(p,y){y&1&&Er(l,"background",p[5])},d(p){p&&Fe(l)}}}function of(f){let l,h=f[2]+"",p;return{c(){l=Ve("span"),p=ui(h)},m(y,b){Oe(y,l,b),qe(l,p)},p(y,b){b&2&&h!==(h=y[2]+"")&&An(p,h)},d(y){y&&Fe(l)}}}function tv(f){let l,h,p,y=sn(f[0]),b=[];for(let M=0;M{"colorScale"in b&&h(0,p=b.colorScale),"limits"in b&&h(1,y=b.limits)},[p,y]}class rv extends li{constructor(l){super(),ai(this,l,iv,tv,Yt,{colorScale:0,limits:1})}}function Hs(f,l,h){let p=["match",f];for(let[y,b]of Object.entries(l))p.push(y),p.push(b);return p.push(h),p}function nv(f,l,h){let p=["step",f];for(let y=1;y({}),af=f=>({}),ov=f=>({}),lf=f=>({});function av(f){let l,h,p,y;const b=f[3].sidebar,x=an(b,f,f[2],lf),a=f[3].map,M=an(a,f,f[2],af);return{c(){l=Ve("div"),x&&x.c(),h=pt(),p=Ve("div"),M&&M.c()},m(L,F){Oe(L,l,F),x&&x.m(l,null),f[4](l),Oe(L,h,F),Oe(L,p,F),M&&M.m(p,null),f[5](p),y=!0},p(L,[F]){x&&x.p&&(!y||F&4)&&cn(x,b,L,L[2],y?ln(b,L[2],F,ov):un(L[2]),lf),M&&M.p&&(!y||F&4)&&cn(M,a,L,L[2],y?ln(a,L[2],F,sv):un(L[2]),af)},i(L){y||(Be(x,L),Be(M,L),y=!0)},o(L){Ge(x,L),Ge(M,L),y=!1},d(L){L&&(Fe(l),Fe(h),Fe(p)),x&&x.d(L),f[4](null),M&&M.d(L),f[5](null)}}}function lv(f,l,h){let p,y;Dt(f,Dh,L=>h(0,p=L)),Dt(f,Rh,L=>h(1,y=L));let{$$slots:b={},$$scope:x}=l;function a(L){Yr[L?"unshift":"push"](()=>{p=L,Dh.set(p)})}function M(L){Yr[L?"unshift":"push"](()=>{y=L,Rh.set(y)})}return f.$$set=L=>{"$$scope"in L&&h(2,x=L.$$scope)},[p,y,x,b,a,M]}class gu extends li{constructor(l){super(),ai(this,l,lv,av,Yt,{})}}function cv(f){let l,h,p,y,b,x,a,M,L,F,j,X,Ie;return{c(){l=Ve("div"),h=Ve("h2"),h.textContent="Debug mode",p=pt(),y=Ve("div"),b=Ve("button"),b.textContent="Change study area",x=pt(),a=Ve("button"),a.textContent="Route mode",M=pt(),L=Ve("button"),L.textContent="Score mode",F=pt(),j=Ve("p"),j.textContent="Hover to see a segment's properties, and click to open OSM",Ht(l,"slot","sidebar")},m(de,Te){Oe(de,l,Te),qe(l,h),qe(l,p),qe(l,y),qe(y,b),qe(y,x),qe(y,a),qe(y,M),qe(y,L),qe(l,F),qe(l,j),X||(Ie=[Kt(b,"click",f[5]),Kt(a,"click",f[6]),Kt(L,"click",f[7])],X=!0)},p:Wt,d(de){de&&Fe(l),X=!1,Jr(Ie)}}}function uv(f){let l,h,p=f[8].kind+"",y,b,x,a;return x=new ev({props:{properties:f[8]}}),{c(){l=Ve("h2"),h=ui("Classified as "),y=ui(p),b=pt(),It(x.$$.fragment)},m(M,L){Oe(M,l,L),qe(l,h),qe(l,y),Oe(M,b,L),wt(x,M,L),a=!0},p(M,L){(!a||L&256)&&p!==(p=M[8].kind+"")&&An(y,p);const F={};L&256&&(F.properties=M[8]),x.$set(F)},i(M){a||(Be(x.$$.fragment,M),a=!0)},o(M){Ge(x.$$.fragment,M),a=!1},d(M){M&&(Fe(l),Fe(b)),St(x,M)}}}function hv(f){let l,h;return l=new am({props:{openOn:"hover",$$slots:{default:[uv,({props:p})=>({8:p}),({props:p})=>p?256:0]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&768&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function dv(f){let l,h;return l=new Pa({props:{id:"network",paint:{"line-width":Ap(5,7),"line-color":Hs(["get","kind"],Kn,"yellow"),"line-opacity":f[0]?f[1]/100:Hs(["get","kind"],{Severance:0},f[1]/100)},manageHoverState:!0,hoverCursor:"pointer",$$slots:{default:[hv]},$$scope:{ctx:f}}}),l.$on("click",f[4]),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&3&&(b.paint={"line-width":Ap(5,7),"line-color":Hs(["get","kind"],Kn,"yellow"),"line-opacity":p[0]?p[1]/100:Hs(["get","kind"],{Severance:0},p[1]/100)}),y&512&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function pv(f){let l,h,p;return h=new Io({props:{data:JSON.parse(Jn(f[2]).render()),generateId:!0,$$slots:{default:[dv]},$$scope:{ctx:f}}}),{c(){l=Ve("div"),It(h.$$.fragment),Ht(l,"slot","map")},m(y,b){Oe(y,l,b),wt(h,l,null),p=!0},p(y,b){const x={};b&4&&(x.data=JSON.parse(Jn(y[2]).render())),b&515&&(x.$$scope={dirty:b,ctx:y}),h.$set(x)},i(y){p||(Be(h.$$.fragment,y),p=!0)},o(y){Ge(h.$$.fragment,y),p=!1},d(y){y&&Fe(l),St(h)}}}function fv(f){let l,h;return l=new gu({props:{$$slots:{map:[pv],sidebar:[cv]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,[y]){const b={};y&527&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function mv(f,l,h){let p,y;Dt(f,bs,j=>h(2,p=j)),Dt(f,on,j=>h(3,y=j));let{showSeverances:b}=l,{opacity:x}=l;const a=j=>window.open(Jn(j.detail.features[0].properties).way,"_blank"),M=()=>Li(on,y="title",y),L=()=>Li(on,y="route",y),F=()=>Li(on,y="score",y);return f.$$set=j=>{"showSeverances"in j&&h(0,b=j.showSeverances),"opacity"in j&&h(1,x=j.opacity)},[b,x,p,y,a,M,L,F]}class gv extends li{constructor(l){super(),ai(this,l,mv,fv,Yt,{showSeverances:0,opacity:1})}}function cf(f,l,h){const p=f.slice();return p[2]=l[h],p}function uf(f){let l,h,p=hf(f[2])+"",y,b;return{c(){l=Ve("li"),h=Ve("a"),b=pt(),Ht(h,"href",y=Jn(f[2].properties).way),Ht(h,"target","_blank")},m(x,a){Oe(x,l,a),qe(l,h),h.innerHTML=p,qe(l,b)},p(x,a){a&1&&p!==(p=hf(x[2])+"")&&(h.innerHTML=p),a&1&&y!==(y=Jn(x[2].properties).way)&&Ht(h,"href",y)},d(x){x&&Fe(l)}}}function _v(f){let l,h,p,y=(f[0].route_length/f[0].direct_length).toFixed(1)+"",b,x,a,M,L,F=f[1](f[0])+"",j,X,Ie,de,Te=sn(f[0].features),ye=[];for(let xe=0;xe{"route_gj"in b&&h(0,p=b.route_gj)},[p,y]}class vv extends li{constructor(l){super(),ai(this,l,yv,_v,Yt,{route_gj:0})}}function xv(f){let l,h;return l=new Pa({props:{id:"network",paint:{"line-width":5,"line-color":Hs(["get","kind"],Kn,"yellow"),"line-opacity":f[0]?f[1]/100:Hs(["get","kind"],{Severance:0},f[1]/100)}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&3&&(b.paint={"line-width":5,"line-color":Hs(["get","kind"],Kn,"yellow"),"line-opacity":p[0]?p[1]/100:Hs(["get","kind"],{Severance:0},p[1]/100)}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function bv(f){let l,h;return l=new Io({props:{data:JSON.parse(Jn(f[2]).render()),$$slots:{default:[xv]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,[y]){const b={};y&4&&(b.data=JSON.parse(Jn(p[2]).render())),y&11&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function wv(f,l,h){let p;Dt(f,bs,x=>h(2,p=x));let{showSeverances:y}=l,{opacity:b}=l;return f.$$set=x=>{"showSeverances"in x&&h(0,y=x.showSeverances),"opacity"in x&&h(1,b=x.opacity)},[y,b,p]}class lm extends li{constructor(l){super(),ai(this,l,wv,bv,Yt,{showSeverances:0,opacity:1})}}function df(f){let l,h;return{c(){l=Ve("p"),h=ui(f[5])},m(p,y){Oe(p,l,y),qe(l,h)},p(p,y){y&32&&An(h,p[5])},d(p){p&&Fe(l)}}}function pf(f){let l,h;return l=new vv({props:{route_gj:f[4]}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&16&&(b.route_gj=p[4]),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function Sv(f){let l,h,p,y,b,x,a,M,L,F,j,X,Ie,de,Te,ye,xe=f[5]&&df(f),Q=f[4]&&pf(f);return{c(){l=Ve("div"),h=Ve("h2"),h.textContent="Route mode",p=pt(),y=Ve("div"),b=Ve("button"),b.textContent="Change study area",x=pt(),a=Ve("button"),a.textContent="Score mode",M=pt(),L=Ve("button"),L.textContent="Debug OSM",F=pt(),j=Ve("p"),j.innerHTML=`Move the A and B pins to find a walking route. (Hint: right-click - to set the first pin somewhere.)`,X=pt(),xe&&xe.c(),Ie=pt(),Q&&Q.c(),Ht(l,"slot","sidebar")},m($,ne){Oe($,l,ne),qe(l,h),qe(l,p),qe(l,y),qe(y,b),qe(y,x),qe(y,a),qe(l,M),qe(l,L),qe(l,F),qe(l,j),qe(l,X),xe&&xe.m(l,null),qe(l,Ie),Q&&Q.m(l,null),de=!0,Te||(ye=[Kt(b,"click",f[10]),Kt(a,"click",f[11]),Kt(L,"click",f[12])],Te=!0)},p($,ne){$[5]?xe?xe.p($,ne):(xe=df($),xe.c(),xe.m(l,Ie)):xe&&(xe.d(1),xe=null),$[4]?Q?(Q.p($,ne),ne&16&&Be(Q,1)):(Q=pf($),Q.c(),Be(Q,1),Q.m(l,null)):Q&&(yr(),Ge(Q,1,1,()=>{Q=null}),vr())},i($){de||(Be(Q),de=!0)},o($){Ge(Q),de=!1},d($){$&&Fe(l),xe&&xe.d(),Q&&Q.d(),Te=!1,Jr(ye)}}}function Tv(f){let l;return{c(){l=Ve("span"),l.textContent="A",Ht(l,"class","dot svelte-1cqsh0e")},m(h,p){Oe(h,l,p)},p:Wt,d(h){h&&Fe(l)}}}function Iv(f){let l;return{c(){l=Ve("span"),l.textContent="B",Ht(l,"class","dot svelte-1cqsh0e")},m(h,p){Oe(h,l,p)},p:Wt,d(h){h&&Fe(l)}}}function ff(f){let l,h;return l=new Io({props:{data:f[4],$$slots:{default:[kv]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&16&&(b.data=p[4]),y&65536&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function kv(f){let l,h;return l=new Pa({props:{id:"route",beforeId:"network",paint:{"line-width":20,"line-color":"cyan","line-opacity":.5}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p:Wt,i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function Cv(f){let l,h,p,y,b,x,a,M,L,F;h=new lm({props:{showSeverances:f[0],opacity:f[1]}});function j(ye){f[8](ye)}let X={draggable:!0,$$slots:{default:[Tv]},$$scope:{ctx:f}};f[2]!==void 0&&(X.lngLat=f[2]),y=new Op({props:X}),Yr.push(()=>Ma(y,"lngLat",j));function Ie(ye){f[9](ye)}let de={draggable:!0,$$slots:{default:[Iv]},$$scope:{ctx:f}};f[3]!==void 0&&(de.lngLat=f[3]),a=new Op({props:de}),Yr.push(()=>Ma(a,"lngLat",Ie));let Te=f[4]&&ff(f);return{c(){l=Ve("div"),It(h.$$.fragment),p=pt(),It(y.$$.fragment),x=pt(),It(a.$$.fragment),L=pt(),Te&&Te.c(),Ht(l,"slot","map")},m(ye,xe){Oe(ye,l,xe),wt(h,l,null),qe(l,p),wt(y,l,null),qe(l,x),wt(a,l,null),qe(l,L),Te&&Te.m(l,null),F=!0},p(ye,xe){const Q={};xe&1&&(Q.showSeverances=ye[0]),xe&2&&(Q.opacity=ye[1]),h.$set(Q);const $={};xe&65536&&($.$$scope={dirty:xe,ctx:ye}),!b&&xe&4&&(b=!0,$.lngLat=ye[2],Ca(()=>b=!1)),y.$set($);const ne={};xe&65536&&(ne.$$scope={dirty:xe,ctx:ye}),!M&&xe&8&&(M=!0,ne.lngLat=ye[3],Ca(()=>M=!1)),a.$set(ne),ye[4]?Te?(Te.p(ye,xe),xe&16&&Be(Te,1)):(Te=ff(ye),Te.c(),Be(Te,1),Te.m(l,null)):Te&&(yr(),Ge(Te,1,1,()=>{Te=null}),vr())},i(ye){F||(Be(h.$$.fragment,ye),Be(y.$$.fragment,ye),Be(a.$$.fragment,ye),Be(Te),F=!0)},o(ye){Ge(h.$$.fragment,ye),Ge(y.$$.fragment,ye),Ge(a.$$.fragment,ye),Ge(Te),F=!1},d(ye){ye&&Fe(l),St(h),St(y),St(a),Te&&Te.d()}}}function Mv(f){let l,h;return l=new gu({props:{$$slots:{map:[Cv],sidebar:[Sv]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,[y]){const b={};y&65663&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function ou(f,l,h){return l+f*(h-l)}function Av(f,l,h){let p,y,b;Dt(f,Ql,$=>h(13,p=$)),Dt(f,bs,$=>h(7,y=$)),Dt(f,on,$=>h(6,b=$));let{showSeverances:x}=l,{opacity:a}=l,M=Array.from(y.getBounds()),L={lng:ou(.4,M[0],M[2]),lat:ou(.4,M[1],M[3])},F={lng:ou(.6,M[0],M[2]),lat:ou(.6,M[1],M[3])},j=null,X="";Wl(()=>{p==null||p.on("contextmenu",Ie)}),Yn(()=>{p==null||p.off("contextmenu",Ie)});function Ie($){h(2,L=$.lngLat)}function de($){L=$,h(2,L)}function Te($){F=$,h(3,F)}const ye=()=>Li(on,b="title",b),xe=()=>Li(on,b="score",b),Q=()=>Li(on,b="debug",b);return f.$$set=$=>{"showSeverances"in $&&h(0,x=$.showSeverances),"opacity"in $&&h(1,a=$.opacity)},f.$$.update=()=>{if(f.$$.dirty&140&&L&&F)try{h(4,j=JSON.parse(y.compareRoute({x1:L.lng,y1:L.lat,x2:F.lng,y2:F.lat}))),h(5,X="")}catch($){h(4,j=null),h(5,X=$.toString())}},[x,a,L,F,j,X,b,y,de,Te,ye,xe,Q]}class Ev extends li{constructor(l){super(),ai(this,l,Av,Mv,Yt,{showSeverances:0,opacity:1})}}function Pv(f){let l,h,p,y,b,x,a,M,L,F,j,X,Ie,de,Te,ye;return Ie=new rv({props:{colorScale:qf,limits:Zf}}),{c(){l=Ve("div"),h=Ve("h2"),h.textContent="Score mode",p=pt(),y=Ve("div"),b=Ve("button"),b.textContent="Change study area",x=pt(),a=Ve("button"),a.textContent="Route mode",M=pt(),L=Ve("button"),L.textContent="Debug OSM",F=pt(),j=Ve("p"),j.innerHTML=`The desire lines are coloured based on their detour factor. Click one - to see the route`,X=pt(),It(Ie.$$.fragment),Ht(l,"slot","sidebar")},m(xe,Q){Oe(xe,l,Q),qe(l,h),qe(l,p),qe(l,y),qe(y,b),qe(y,x),qe(y,a),qe(l,M),qe(l,L),qe(l,F),qe(l,j),qe(l,X),wt(Ie,l,null),de=!0,Te||(ye=[Kt(b,"click",f[6]),Kt(a,"click",f[7]),Kt(L,"click",f[8])],Te=!0)},p:Wt,i(xe){de||(Be(Ie.$$.fragment,xe),de=!0)},o(xe){Ge(Ie.$$.fragment,xe),de=!1},d(xe){xe&&Fe(l),St(Ie),Te=!1,Jr(ye)}}}function zv(f){let l,h=f[11].score.toFixed(1)+"",p,y;return{c(){l=Ve("span"),p=ui(h),y=ui("x"),Er(l,"font-size","26px")},m(b,x){Oe(b,l,x),qe(l,p),qe(l,y)},p(b,x){x&2048&&h!==(h=b[11].score.toFixed(1)+"")&&An(p,h)},d(b){b&&Fe(l)}}}function Lv(f){let l,h;return l=new am({props:{openOn:"hover",$$slots:{default:[zv,({props:p})=>({11:p}),({props:p})=>p?2048:0]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&6144&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function Dv(f){let l,h;return l=new Pa({props:{id:"scores",paint:{"line-width":8,"line-color":nv(["get","score"],Zf,qf)},$$slots:{default:[Lv]},$$scope:{ctx:f}}}),l.$on("click",f[5]),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&4096&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function mf(f){let l,h;return l=new Io({props:{data:f[2],$$slots:{default:[Rv]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&4&&(b.data=p[2]),y&4096&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function Rv(f){let l,h;return l=new Pa({props:{id:"route",beforeId:"network",paint:{"line-width":20,"line-color":"cyan","line-opacity":.5}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p:Wt,i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function Bv(f){let l,h,p,y,b,x;h=new lm({props:{showSeverances:f[0],opacity:f[1]}}),y=new Io({props:{data:JSON.parse(Jn(f[3]).makeHeatmap()),$$slots:{default:[Dv]},$$scope:{ctx:f}}});let a=f[2]&&mf(f);return{c(){l=Ve("div"),It(h.$$.fragment),p=pt(),It(y.$$.fragment),b=pt(),a&&a.c(),Ht(l,"slot","map")},m(M,L){Oe(M,l,L),wt(h,l,null),qe(l,p),wt(y,l,null),qe(l,b),a&&a.m(l,null),x=!0},p(M,L){const F={};L&1&&(F.showSeverances=M[0]),L&2&&(F.opacity=M[1]),h.$set(F);const j={};L&8&&(j.data=JSON.parse(Jn(M[3]).makeHeatmap())),L&4096&&(j.$$scope={dirty:L,ctx:M}),y.$set(j),M[2]?a?(a.p(M,L),L&4&&Be(a,1)):(a=mf(M),a.c(),Be(a,1),a.m(l,null)):a&&(yr(),Ge(a,1,1,()=>{a=null}),vr())},i(M){x||(Be(h.$$.fragment,M),Be(y.$$.fragment,M),Be(a),x=!0)},o(M){Ge(h.$$.fragment,M),Ge(y.$$.fragment,M),Ge(a),x=!1},d(M){M&&Fe(l),St(h),St(y),a&&a.d()}}}function Fv(f){let l,h;return l=new gu({props:{$$slots:{map:[Bv],sidebar:[Pv]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,[y]){const b={};y&4127&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function Ov(f,l,h){let p,y,b;Dt(f,Ql,de=>h(9,p=de)),Dt(f,bs,de=>h(3,y=de)),Dt(f,on,de=>h(4,b=de));let{showSeverances:x}=l,{opacity:a}=l,M=null;function L(de){try{let Te=de.detail.features[0].geometry.coordinates;h(2,M=JSON.parse(y.compareRoute({x1:Te[0][0],y1:Te[0][1],x2:Te[1][0],y2:Te[1][1]})))}catch(Te){window.alert(`No route: ${Te}`),h(2,M=null)}}Wl(()=>{p==null||p.on("click",F)}),Yn(()=>{p==null||p.off("click",F)});function F(de){p.queryRenderedFeatures(de.point,{layers:["scores"]}).length>0||h(2,M=null)}const j=()=>Li(on,b="title",b),X=()=>Li(on,b="route",b),Ie=()=>Li(on,b="debug",b);return f.$$set=de=>{"showSeverances"in de&&h(0,x=de.showSeverances),"opacity"in de&&h(1,a=de.opacity)},[x,a,M,y,b,L,j,X,Ie]}class Vv extends li{constructor(l){super(),ai(this,l,Ov,Fv,Yt,{showSeverances:0,opacity:1})}}function gf(f,l,h){const p=f.slice();return p[18]=l[h][0],p[19]=l[h][1],p}function _f(f,l,h){const p=f.slice();return p[22]=l[h][0],p[23]=l[h][1],p}function yf(f){let l,h=f[23]+"",p,y;return{c(){l=Ve("option"),p=ui(h),l.__value=y=f[22],jl(l,l.__value)},m(b,x){Oe(b,l,x),qe(l,p)},p(b,x){x&4&&h!==(h=b[23]+"")&&An(p,h),x&4&&y!==(y=b[22])&&(l.__value=y,jl(l,l.__value))},d(b){b&&Fe(l)}}}function vf(f){let l,h,p=sn(f[19]),y=[];for(let b=0;bf[8].call(x)),Ht(de,"type","file")},m(be,Se){wt(l,be,Se),Oe(be,h,Se),Oe(be,p,Se),qe(p,y),qe(y,b),qe(y,x),qe(x,a);for(let at=0;ath(14,p=me)),Dt(f,bs,me=>h(15,y=me)),Dt(f,Ql,me=>h(4,b=me));let x="",a=null,M=!1,L=[];Wl(async()=>{try{let me=await fetch("/osm/areas.json");if(me.ok)M=!0,console.log("Using local cache, not od2net.org"),h(2,L=await me.json());else{let Ue=await fetch("https://assets.od2net.org/severance_pbfs/areas.json");h(2,L=await Ue.json())}}catch{}});let F;async function j(me){try{X(await F.files[0].arrayBuffer()),h(0,x="")}catch(Ue){window.alert(`Couldn't open this file: ${Ue}`)}h(1,a=null)}function X(me){h(1,a="Building map model from OSM input"),console.time("load"),Li(bs,y=new x_(new Uint8Array(me),p),y),console.timeEnd("load")}function Ie(me){try{X(new TextEncoder().encode(me.detail)),h(0,x="")}catch(Ue){window.alert(`Couldn't import from Overpass: ${Ue}`)}h(1,a=null)}async function de(me){me!=""&&(M?await Te(`/osm/${me}.pbf`):await Te(`https://assets.od2net.org/severance_pbfs/${me}.pbf`))}async function Te(me){try{h(1,a=`Downloading ${me}`);let Ue=await fetch(me);X(await Ue.arrayBuffer())}catch(Ue){window.alert(`Couldn't open from URL ${me}: ${Ue}`)}h(1,a=null)}function ye(){x=l_(this),h(0,x),h(2,L)}const xe=()=>de(x);function Q(me){Yr[me?"unshift":"push"](()=>{F=me,h(3,F)})}const $=me=>h(1,a=me.detail),ne=me=>window.alert(me.detail);return f.$$.update=()=>{f.$$.dirty&1&&de(x)},[x,a,L,F,b,j,Ie,de,ye,xe,Q,$,ne]}class jv extends li{constructor(l){super(),ai(this,l,Uv,Nv,Yt,{})}}function xf(f){let l,h;return l=new Zy({props:{$$slots:{default:[qv,({dialog:p})=>({9:p}),({dialog:p})=>p?512:0]},$$scope:{ctx:f}}}),l.$on("close",f[5]),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&1536&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function qv(f){let l,h,p,y,b,x,a,M,L,F,j,X,Ie,de,Te,ye,xe,Q,$,ne,me,Ue;function Ee(){return f[4](f[9])}return{c(){l=Ve("h1"),l.textContent="Severance Snape",h=pt(),p=Ve("p"),p.innerHTML=`This is an experimental tool to study "severances" for people walking. - In some places, crossing a big road (a "severance") might be easy -- there's - a zebra or signalized crossing right on the "desire line" where someone - might want to cross. But often, a person might have to walk a few blocks - to reach the nearest crossing -- and then they might have to go up or down - stairs to cross on a bridge or a tunnel!`,y=pt(),b=Ve("p"),b.textContent=`This tool quantifies just how bad this crossing is with a "detour - factor" -- the ratio of the length to cross in a straight line and the - length of the actual path, according to OSM data. A score close to 1 - is great, and a score of 4 means the actual path is 4 times the length - of the straight desire line.`,x=pt(),a=Ve("p"),a.innerHTML=`This tool is experimental, so there will be bugs both with OSM - data and what the tool shows!`,M=pt(),L=Ve("p"),L.textContent="To use this tool, you need to:",F=pt(),j=Ve("ol"),j.innerHTML=`
  • Choose your study area to analyze
  • Check the severances that show up -- they're inferred from OSM data - and might not be correct
  • Use the Route mode to explore the detour factor between any two - points you choose
  • Use the Score mode to visualize the detour factor everywhere, - looking for places easy and hard to cross
  • `,X=pt(),Ie=Ve("p"),Ie.innerHTML=`This tool aims to complement an "area porosity" analysis, defined in section 2.3.5 of TfL's Cycling Design Standards. That definition of porosity just counts the number of crossings per - area, and isn't very detailed about how far you have to walk to a - crossing in that area.`,de=pt(),Te=Ve("p"),Te.innerHTML=`This open source - tool is created by - Dustin Carlino - and relies heavily on - OpenStreetMap data.`,ye=pt(),xe=Ve("details"),xe.innerHTML='Changelog

    GitHub has more detail; this is a summary

    • 17 February - use Pico for styling
    • 21 January - fix shortest route calculations
    ',Q=pt(),$=Ve("center"),ne=Ve("button"),ne.textContent="Start!"},m(be,Se){Oe(be,l,Se),Oe(be,h,Se),Oe(be,p,Se),Oe(be,y,Se),Oe(be,b,Se),Oe(be,x,Se),Oe(be,a,Se),Oe(be,M,Se),Oe(be,L,Se),Oe(be,F,Se),Oe(be,j,Se),Oe(be,X,Se),Oe(be,Ie,Se),Oe(be,de,Se),Oe(be,Te,Se),Oe(be,ye,Se),Oe(be,xe,Se),Oe(be,Q,Se),Oe(be,$,Se),qe($,ne),me||(Ue=Kt(ne,"click",Ee),me=!0)},p(be,Se){f=be},d(be){be&&(Fe(l),Fe(h),Fe(p),Fe(y),Fe(b),Fe(x),Fe(a),Fe(M),Fe(L),Fe(F),Fe(j),Fe(X),Fe(Ie),Fe(de),Fe(Te),Fe(ye),Fe(xe),Fe(Q),Fe($)),me=!1,Ue()}}}function Zv(f){let l;return{c(){l=Ve("p"),l.textContent="Waiting for MapLibre and WASM to load..."},m(h,p){Oe(h,l,p)},i:Wt,o:Wt,d(h){h&&Fe(l)}}}function Gv(f){let l,h;return l=new jv({}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function Hv(f){let l,h,p,y,b,x,a,M,L,F,j,X,Ie,de,Te,ye,xe,Q,$,ne,me=f[1]&&xf(f);const Ue=[Gv,Zv],Ee=[];function be(Se,at){return Se[2]&&Se[0]?0:1}return L=be(f),F=Ee[L]=Ue[L](f),{c(){l=Ve("div"),me&&me.c(),h=pt(),p=Ve("h2"),p.textContent="Choose your study area",y=pt(),b=Ve("button"),b.textContent="About this tool",x=pt(),a=Ve("hr"),M=pt(),F.c(),j=pt(),X=Ve("div"),Ie=Ve("label"),de=Ve("input"),Te=ui(` - When a road in OSM doesn't explicitly specify sidewalks, assume they exist - or not? (This tool works best in places where sidewalks are consistently - tagged as - `),ye=Ve("a"),ye.textContent="separate ways",xe=ui(". Disable this in those places.)"),Ht(de,"type","checkbox"),Ht(ye,"href","https://wiki.openstreetmap.org/wiki/Sidewalks#Sidewalk_as_separate_way"),Ht(ye,"target","_blank"),Ht(l,"slot","sidebar")},m(Se,at){Oe(Se,l,at),me&&me.m(l,null),qe(l,h),qe(l,p),qe(l,y),qe(l,b),qe(l,x),qe(l,a),qe(l,M),Ee[L].m(l,null),qe(l,j),qe(l,X),qe(X,Ie),qe(Ie,de),de.checked=f[3],qe(Ie,Te),qe(Ie,ye),qe(Ie,xe),Q=!0,$||(ne=[Kt(b,"click",f[6]),Kt(de,"change",f[7])],$=!0)},p(Se,at){Se[1]?me?(me.p(Se,at),at&2&&Be(me,1)):(me=xf(Se),me.c(),Be(me,1),me.m(l,h)):me&&(yr(),Ge(me,1,1,()=>{me=null}),vr());let ge=L;L=be(Se),L!==ge&&(yr(),Ge(Ee[ge],1,1,()=>{Ee[ge]=null}),vr(),F=Ee[L],F||(F=Ee[L]=Ue[L](Se),F.c()),Be(F,1),F.m(l,j)),at&8&&(de.checked=Se[3])},i(Se){Q||(Be(me),Be(F),Q=!0)},o(Se){Ge(me),Ge(F),Q=!1},d(Se){Se&&Fe(l),me&&me.d(),Ee[L].d(),$=!1,Jr(ne)}}}function Wv(f){let l,h,p;return h=new om({}),{c(){l=Ve("div"),It(h.$$.fragment),Ht(l,"slot","map")},m(y,b){Oe(y,l,b),wt(h,l,null),p=!0},p:Wt,i(y){p||(Be(h.$$.fragment,y),p=!0)},o(y){Ge(h.$$.fragment,y),p=!1},d(y){y&&Fe(l),St(h)}}}function Xv(f){let l,h;return l=new gu({props:{$$slots:{map:[Wv],sidebar:[Hv]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,[y]){const b={};y&1039&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function Kv(f,l,h){let p,y,b,x;Dt(f,bs,X=>h(8,p=X)),Dt(f,Ch,X=>h(1,y=X)),Dt(f,Ql,X=>h(2,b=X)),Dt(f,Bh,X=>h(3,x=X));let{wasmReady:a}=l;Li(bs,p=null,p);const M=X=>Jn(X).close(),L=()=>Li(Ch,y=!1,y),F=()=>Li(Ch,y=!0,y);function j(){x=this.checked,Bh.set(x)}return f.$$set=X=>{"wasmReady"in X&&h(0,a=X.wasmReady)},[a,y,b,x,M,L,F,j]}class Yv extends li{constructor(l){super(),ai(this,l,Kv,Xv,Yt,{wasmReady:0})}}function bf(f){let l,h,p,y,b,x,a,M,L,F,j,X,Ie,de,Te,ye,xe,Q,$;return x=new Fy({props:{rows:[["Footway (ground, outdoors)",Kn.Footway],["Indoors footway",Kn.Indoors],["Footway not on the ground",Kn.BridgeOrTunnel],["Street with vehicle traffic (maybe with a sidewalk, maybe not)",Kn.WithTraffic],["Crossing",Kn.Crossing],["Severance",Kn.Severance]]}}),{c(){l=Ve("hr"),h=pt(),p=Ve("div"),y=Ve("button"),y.textContent="Zoom to fit",b=pt(),It(x.$$.fragment),a=pt(),M=Ve("div"),L=Ve("label"),F=Ve("input"),j=ui(` - Show severances`),X=pt(),Ie=Ve("div"),de=Ve("label"),Te=ui(`Network opacity: - `),ye=Ve("input"),Ht(F,"type","checkbox"),Ht(ye,"type","range"),Ht(ye,"min","0"),Ht(ye,"max","100")},m(ne,me){Oe(ne,l,me),Oe(ne,h,me),Oe(ne,p,me),qe(p,y),Oe(ne,b,me),wt(x,ne,me),Oe(ne,a,me),Oe(ne,M,me),qe(M,L),qe(L,F),F.checked=f[6],qe(L,j),Oe(ne,X,me),Oe(ne,Ie,me),qe(Ie,de),qe(de,Te),qe(de,ye),jl(ye,f[5]),xe=!0,Q||($=[Kt(y,"click",f[8]),Kt(F,"change",f[14]),Kt(ye,"change",f[15]),Kt(ye,"input",f[15])],Q=!0)},p(ne,me){me&64&&(F.checked=ne[6]),me&32&&jl(ye,ne[5])},i(ne){xe||(Be(x.$$.fragment,ne),xe=!0)},o(ne){Ge(x.$$.fragment,ne),xe=!1},d(ne){ne&&(Fe(l),Fe(h),Fe(p),Fe(b),Fe(a),Fe(M),Fe(X),Fe(Ie)),St(x,ne),Q=!1,Jr($)}}}function Jv(f){let l,h,p,y,b,x,a=f[7]!="title"&&bf(f);return{c(){l=Ve("div"),h=Ve("h1"),h.textContent="Severance Snape",p=pt(),y=Ve("div"),b=pt(),a&&a.c(),Ht(l,"slot","left")},m(M,L){Oe(M,l,L),qe(l,h),qe(l,p),qe(l,y),f[13](y),qe(l,b),a&&a.m(l,null),x=!0},p(M,L){M[7]!="title"?a?(a.p(M,L),L&128&&Be(a,1)):(a=bf(M),a.c(),Be(a,1),a.m(l,null)):a&&(yr(),Ge(a,1,1,()=>{a=null}),vr())},i(M){x||(Be(a),x=!0)},o(M){Ge(a),x=!1},d(M){M&&Fe(l),f[13](null),a&&a.d()}}}function wf(f){let l,h;return l=new Yv({props:{wasmReady:f[4]}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&16&&(b.wasmReady=p[4]),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function Sf(f){let l,h,p,y,b,x;l=new Io({props:{data:JSON.parse(f[3].getInvertedBoundary()),$$slots:{default:[Qv]},$$scope:{ctx:f}}});const a=[tx,ex,$v],M=[];function L(F,j){return F[7]=="route"?0:F[7]=="score"?1:F[7]=="debug"?2:-1}return~(p=L(f))&&(y=M[p]=a[p](f)),{c(){It(l.$$.fragment),h=pt(),y&&y.c(),b=ws()},m(F,j){wt(l,F,j),Oe(F,h,j),~p&&M[p].m(F,j),Oe(F,b,j),x=!0},p(F,j){const X={};j&8&&(X.data=JSON.parse(F[3].getInvertedBoundary())),j&131072&&(X.$$scope={dirty:j,ctx:F}),l.$set(X);let Ie=p;p=L(F),p===Ie?~p&&M[p].p(F,j):(y&&(yr(),Ge(M[Ie],1,1,()=>{M[Ie]=null}),vr()),~p?(y=M[p],y?y.p(F,j):(y=M[p]=a[p](F),y.c()),Be(y,1),y.m(b.parentNode,b)):y=null)},i(F){x||(Be(l.$$.fragment,F),Be(y),x=!0)},o(F){Ge(l.$$.fragment,F),Ge(y),x=!1},d(F){F&&(Fe(h),Fe(b)),St(l,F),~p&&M[p].d(F)}}}function Qv(f){let l,h;return l=new Vf({props:{paint:{"fill-color":"black","fill-opacity":.3}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p:Wt,i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function $v(f){let l,h;return l=new gv({props:{showSeverances:f[6],opacity:f[5]}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&64&&(b.showSeverances=p[6]),y&32&&(b.opacity=p[5]),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function ex(f){let l,h;return l=new Vv({props:{showSeverances:f[6],opacity:f[5]}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&64&&(b.showSeverances=p[6]),y&32&&(b.opacity=p[5]),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function tx(f){let l,h;return l=new Ev({props:{showSeverances:f[6],opacity:f[5]}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,y){const b={};y&64&&(b.showSeverances=p[6]),y&32&&(b.opacity=p[5]),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function ix(f){let l,h,p,y,b,x,a;p=new om({});let M=f[7]=="title"&&wf(f),L=f[3]&&Sf(f);return{c(){l=Ve("div"),h=pt(),It(p.$$.fragment),y=pt(),M&&M.c(),b=pt(),L&&L.c(),x=ws()},m(F,j){Oe(F,l,j),f[11](l),Oe(F,h,j),wt(p,F,j),Oe(F,y,j),M&&M.m(F,j),Oe(F,b,j),L&&L.m(F,j),Oe(F,x,j),a=!0},p(F,j){F[7]=="title"?M?(M.p(F,j),j&128&&Be(M,1)):(M=wf(F),M.c(),Be(M,1),M.m(b.parentNode,b)):M&&(yr(),Ge(M,1,1,()=>{M=null}),vr()),F[3]?L?(L.p(F,j),j&8&&Be(L,1)):(L=Sf(F),L.c(),Be(L,1),L.m(x.parentNode,x)):L&&(yr(),Ge(L,1,1,()=>{L=null}),vr())},i(F){a||(Be(p.$$.fragment,F),Be(M),Be(L),a=!0)},o(F){Ge(p.$$.fragment,F),Ge(M),Ge(L),a=!1},d(F){F&&(Fe(l),Fe(h),Fe(y),Fe(b),Fe(x)),f[11](null),St(p,F),M&&M.d(F),L&&L.d(F)}}}function rx(f){let l,h,p,y;function b(a){f[12](a)}let x={style:"https://api.maptiler.com/maps/dataviz/style.json?key=MZEJTanw3WpxRvt7qDfo",standardControls:!0,hash:!0,$$slots:{default:[ix]},$$scope:{ctx:f}};return f[0]!==void 0&&(x.map=f[0]),h=new dy({props:x}),Yr.push(()=>Ma(h,"map",b)),{c(){l=Ve("div"),It(h.$$.fragment),Ht(l,"slot","main"),Er(l,"position","relative"),Er(l,"width","100%"),Er(l,"height","100vh")},m(a,M){Oe(a,l,M),wt(h,l,null),y=!0},p(a,M){const L={};M&131324&&(L.$$scope={dirty:M,ctx:a}),!p&&M&1&&(p=!0,L.map=a[0],Ca(()=>p=!1)),h.$set(L)},i(a){y||(Be(h.$$.fragment,a),y=!0)},o(a){Ge(h.$$.fragment,a),y=!1},d(a){a&&Fe(l),St(h)}}}function nx(f){let l,h;return l=new Dy({props:{$$slots:{main:[rx],left:[Jv]},$$scope:{ctx:f}}}),{c(){It(l.$$.fragment)},m(p,y){wt(l,p,y),h=!0},p(p,[y]){const b={};y&131327&&(b.$$scope={dirty:y,ctx:p}),l.$set(b)},i(p){h||(Be(l.$$.fragment,p),h=!0)},o(p){Ge(l.$$.fragment,p),h=!1},d(p){St(l,p)}}}function sx(f,l,h){let p,y,b,x;Dt(f,Rh,ne=>h(9,p=ne)),Dt(f,Dh,ne=>h(10,y=ne)),Dt(f,bs,ne=>h(3,b=ne)),Dt(f,on,ne=>h(7,x=ne));let a=!1;Wl(async()=>{await Lf(),h(4,a=!0)});let M,L=100,F=!0;function j(){M&&b&&M.fitBounds(Array.from(b.getBounds()),{animate:!1})}function X(ne){b&&(console.log("New map model loaded"),j(),Li(on,x="route",x))}let Ie,de;function Te(ne){Yr[ne?"unshift":"push"](()=>{de=ne,h(2,de),h(9,p)})}function ye(ne){M=ne,h(0,M)}function xe(ne){Yr[ne?"unshift":"push"](()=>{Ie=ne,h(1,Ie),h(10,y)})}function Q(){F=this.checked,h(6,F)}function $(){L=o_(this.value),h(5,L)}return f.$$.update=()=>{f.$$.dirty&1&&M&&Ql.set(M),f.$$.dirty&8&&X(),f.$$.dirty&1026&&Ie&&y&&(h(1,Ie.innerHTML="",Ie),Ie.appendChild(y)),f.$$.dirty&516&&de&&p&&(h(2,de.innerHTML="",de),de.appendChild(p))},[M,Ie,de,b,a,L,F,x,j,p,y,Te,ye,xe,Q,$]}class ox extends li{constructor(l){super(),ai(this,l,sx,nx,Yt,{})}}new ox({target:document.getElementById("app")}); diff --git a/assets/main-543678b7.js b/assets/main-543678b7.js new file mode 100644 index 0000000..22aad63 --- /dev/null +++ b/assets/main-543678b7.js @@ -0,0 +1,643 @@ +var v2=Object.defineProperty;var x2=(t,e,n)=>e in t?v2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ur=(t,e,n)=>(x2(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const p of c.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&i(p)}).observe(document,{childList:!0,subtree:!0});function n(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(s){if(s.ep)return;s.ep=!0;const c=n(s);fetch(s.href,c)}})();function Ve(){}function b2(t,e){for(const n in e)t[n]=e[n];return t}function U1(t){return t()}function j0(){return Object.create(null)}function Er(t){t.forEach(U1)}function Rm(t){return typeof t=="function"}function hn(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let nm;function _o(t,e){return t===e?!0:(nm||(nm=document.createElement("a")),nm.href=e,t===nm.href)}function w2(t){return Object.keys(t).length===0}function G1(t,...e){if(t==null){for(const i of e)i(void 0);return Ve}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function S2(t){let e;return G1(t,n=>e=n)(),e}function en(t,e,n){t.$$.on_destroy.push(G1(e,n))}function Do(t,e,n,i){if(t){const s=q1(t,e,n,i);return t[0](s)}}function q1(t,e,n,i){return t[1]&&i?b2(n.ctx.slice(),t[1](i(e))):n.ctx}function Ro(t,e,n,i){if(t[2]&&i){const s=t[2](i(n));if(e.dirty===void 0)return s;if(typeof s=="object"){const c=[],p=Math.max(e.dirty.length,s.length);for(let u=0;u32){const e=[],n=t.ctx.length/32;for(let i=0;it.removeEventListener(e,n,i)}function I2(t){return function(e){return e.preventDefault(),t.call(this,e)}}function Ut(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function C2(t){return t===""?null:+t}function T2(t){return Array.from(t.childNodes)}function to(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ju(t,e){t.value=e??""}function nr(t,e,n,i){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function Z0(t,e,n){for(let i=0;i{const s=t.$$.callbacks[e];if(s){const c=M2(e,n,{cancelable:i});return s.slice().forEach(p=>{p.call(t,c)}),!c.defaultPrevented}return!0}}function j1(t,e){return Ff().$$.context.set(t,e),e}function P2(t){return Ff().$$.context.get(t)}function er(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(i=>i.call(this,e))}const gh=[],yo=[];let xh=[];const m_=[],Z1=Promise.resolve();let g_=!1;function W1(){g_||(g_=!0,Z1.then(H1))}function A2(){return W1(),Z1}function _m(t){xh.push(t)}function wh(t){m_.push(t)}const i_=new Set;let ph=0;function H1(){if(ph!==0)return;const t=vf;do{try{for(;pht.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),xh=e}const pm=new Set;let Xu;function zi(){Xu={r:0,c:[],p:Xu}}function Oi(){Xu.r||Er(Xu.c),Xu=Xu.p}function Bt(t,e){t&&t.i&&(pm.delete(t),t.i(e))}function Xt(t,e,n,i){if(t&&t.o){if(pm.has(t))return;pm.add(t),Xu.c.push(()=>{pm.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}function mo(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function R2(t,e){Xt(t,1,1,()=>{e.delete(t.key)})}function N2(t,e,n,i,s,c,p,u,x,w,E,L){let A=t.length,V=c.length,O=A;const J={};for(;O--;)J[t[O].key]=O;const Y=[],$=new Map,U=new Map,G=[];for(O=V;O--;){const dt=L(s,c,O),pt=n(dt);let ut=p.get(pt);ut?i&&G.push(()=>ut.p(dt,e)):(ut=w(pt,dt),ut.c()),$.set(pt,Y[O]=ut),pt in J&&U.set(pt,Math.abs(O-J[pt]))}const X=new Set,at=new Set;function vt(dt){Bt(dt,1),dt.m(u,E),p.set(dt.key,dt),E=dt.first,V--}for(;A&&V;){const dt=Y[V-1],pt=t[A-1],ut=dt.key,Rt=pt.key;dt===pt?(E=dt.first,A--,V--):$.has(Rt)?!p.has(ut)||X.has(ut)?vt(dt):at.has(Rt)?A--:U.get(ut)>U.get(Rt)?(at.add(ut),vt(dt)):(X.add(Rt),A--):(x(pt,p),A--)}for(;A--;){const dt=t[A];$.has(dt.key)||x(dt,p)}for(;V;)vt(Y[V-1]);return Er(G),Y}function Sh(t,e,n){const i=t.$$.props[e];i!==void 0&&(t.$$.bound[i]=n,n(t.$$.ctx[i]))}function Re(t){t&&t.c()}function ke(t,e,n){const{fragment:i,after_update:s}=t.$$;i&&i.m(e,n),_m(()=>{const c=t.$$.on_mount.map(U1).filter(Rm);t.$$.on_destroy?t.$$.on_destroy.push(...c):Er(c),t.$$.on_mount=[]}),s.forEach(_m)}function De(t,e){const n=t.$$;n.fragment!==null&&(D2(n.after_update),Er(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function z2(t,e){t.$$.dirty[0]===-1&&(gh.push(t),W1(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const O=V.length?V[0]:A;return w.ctx&&s(w.ctx[L],w.ctx[L]=O)&&(!w.skip_bound&&w.bound[L]&&w.bound[L](O),E&&z2(t,L)),A}):[],w.update(),E=!0,Er(w.before_update),w.fragment=i?i(w.ctx):!1,e.target){if(e.hydrate){const L=T2(e.target);w.fragment&&w.fragment.l(L),L.forEach(Ot)}else w.fragment&&w.fragment.c();e.intro&&Bt(t.$$.fragment),ke(t,e.target,e.anchor),H1()}df(x)}class xn{constructor(){ur(this,"$$");ur(this,"$$set")}$destroy(){De(this,1),this.$destroy=Ve}$on(e,n){if(!Rm(n))return Ve;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const s=i.indexOf(n);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!w2(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const O2="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(O2);let _n;const X1=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&X1.decode();let uf=null;function mf(){return(uf===null||uf.byteLength===0)&&(uf=new Uint8Array(_n.memory.buffer)),uf}function ou(t,e){return t=t>>>0,X1.decode(mf().subarray(t,t+e))}const bl=new Array(128).fill(void 0);bl.push(void 0,null,!0,!1);let gf=bl.length;function xl(t){gf===bl.length&&bl.push(bl.length+1);const e=gf;return gf=bl[e],bl[e]=t,e}function ni(t){return bl[t]}function F2(t){t<132||(bl[t]=gf,gf=t)}function _h(t){const e=ni(t);return F2(t),e}function r_(t){return t==null}let cf=null;function Y1(){return(cf===null||cf.byteLength===0)&&(cf=new Float64Array(_n.memory.buffer)),cf}let hf=null;function Jn(){return(hf===null||hf.byteLength===0)&&(hf=new Int32Array(_n.memory.buffer)),hf}let Yu=0;const fm=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},B2=typeof fm.encodeInto=="function"?function(t,e){return fm.encodeInto(t,e)}:function(t,e){const n=fm.encode(t);return e.set(n),{read:t.length,written:n.length}};function o_(t,e,n){if(n===void 0){const u=fm.encode(t),x=e(u.length,1)>>>0;return mf().subarray(x,x+u.length).set(u),Yu=u.length,x}let i=t.length,s=e(i,1)>>>0;const c=mf();let p=0;for(;p127)break;c[s+p]=u}if(p!==i){p!==0&&(t=t.slice(p)),s=n(s,i,i=p+t.length*3,1)>>>0;const u=mf().subarray(s+p,s+i),x=B2(t,u);p+=x.written}return Yu=p,s}function __(t){const e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){const s=t.description;return s==null?"Symbol":`Symbol(${s})`}if(e=="function"){const s=t.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(t)){const s=t.length;let c="[";s>0&&(c+=__(t[0]));for(let p=1;p1)i=n[1];else return toString.call(t);if(i=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message} +${t.stack}`:i}function V2(t,e){const n=e(t.length*1,1)>>>0;return mf().set(t,n/1),Yu=t.length,n}function U2(t,e){return t=t>>>0,Y1().subarray(t/8,t/8+e)}class G2{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();_n.__wbg_mapmodel_free(e)}constructor(e,n){try{const p=_n.__wbindgen_add_to_stack_pointer(-16),u=V2(e,_n.__wbindgen_malloc),x=Yu;_n.mapmodel_new(p,u,x,n);var i=Jn()[p/4+0],s=Jn()[p/4+1],c=Jn()[p/4+2];if(c)throw _h(s);return this.__wbg_ptr=i>>>0,this}finally{_n.__wbindgen_add_to_stack_pointer(16)}}render(){let e,n;try{const w=_n.__wbindgen_add_to_stack_pointer(-16);_n.mapmodel_render(w,this.__wbg_ptr);var i=Jn()[w/4+0],s=Jn()[w/4+1],c=Jn()[w/4+2],p=Jn()[w/4+3],u=i,x=s;if(p)throw u=0,x=0,_h(c);return e=u,n=x,ou(u,x)}finally{_n.__wbindgen_add_to_stack_pointer(16),_n.__wbindgen_free(e,n,1)}}compareRoute(e){let n,i;try{const E=_n.__wbindgen_add_to_stack_pointer(-16);_n.mapmodel_compareRoute(E,this.__wbg_ptr,xl(e));var s=Jn()[E/4+0],c=Jn()[E/4+1],p=Jn()[E/4+2],u=Jn()[E/4+3],x=s,w=c;if(u)throw x=0,w=0,_h(p);return n=x,i=w,ou(x,w)}finally{_n.__wbindgen_add_to_stack_pointer(16),_n.__wbindgen_free(n,i,1)}}makeHeatmap(){let e,n;try{const w=_n.__wbindgen_add_to_stack_pointer(-16);_n.mapmodel_makeHeatmap(w,this.__wbg_ptr);var i=Jn()[w/4+0],s=Jn()[w/4+1],c=Jn()[w/4+2],p=Jn()[w/4+3],u=i,x=s;if(p)throw u=0,x=0,_h(c);return e=u,n=x,ou(u,x)}finally{_n.__wbindgen_add_to_stack_pointer(16),_n.__wbindgen_free(e,n,1)}}getInvertedBoundary(){let e,n;try{const w=_n.__wbindgen_add_to_stack_pointer(-16);_n.mapmodel_getInvertedBoundary(w,this.__wbg_ptr);var i=Jn()[w/4+0],s=Jn()[w/4+1],c=Jn()[w/4+2],p=Jn()[w/4+3],u=i,x=s;if(p)throw u=0,x=0,_h(c);return e=u,n=x,ou(u,x)}finally{_n.__wbindgen_add_to_stack_pointer(16),_n.__wbindgen_free(e,n,1)}}getBounds(){try{const s=_n.__wbindgen_add_to_stack_pointer(-16);_n.mapmodel_getBounds(s,this.__wbg_ptr);var e=Jn()[s/4+0],n=Jn()[s/4+1],i=U2(e,n).slice();return _n.__wbindgen_free(e,n*8,8),i}finally{_n.__wbindgen_add_to_stack_pointer(16)}}}async function q2(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(i){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{const n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}function j2(){const t={};return t.wbg={},t.wbg.__wbindgen_string_new=function(e,n){const i=ou(e,n);return xl(i)},t.wbg.__wbindgen_error_new=function(e,n){const i=new Error(ou(e,n));return xl(i)},t.wbg.__wbindgen_is_object=function(e){const n=ni(e);return typeof n=="object"&&n!==null},t.wbg.__wbindgen_is_undefined=function(e){return ni(e)===void 0},t.wbg.__wbindgen_in=function(e,n){return ni(e)in ni(n)},t.wbg.__wbindgen_object_drop_ref=function(e){_h(e)},t.wbg.__wbindgen_number_get=function(e,n){const i=ni(n),s=typeof i=="number"?i:void 0;Y1()[e/8+1]=r_(s)?0:s,Jn()[e/4+0]=!r_(s)},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return ni(e)==ni(n)},t.wbg.__wbindgen_boolean_get=function(e){const n=ni(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbindgen_string_get=function(e,n){const i=ni(n),s=typeof i=="string"?i:void 0;var c=r_(s)?0:o_(s,_n.__wbindgen_malloc,_n.__wbindgen_realloc),p=Yu;Jn()[e/4+1]=p,Jn()[e/4+0]=c},t.wbg.__wbindgen_object_clone_ref=function(e){const n=ni(e);return xl(n)},t.wbg.__wbg_getwithrefkey_3b3c46ba20582127=function(e,n){const i=ni(e)[ni(n)];return xl(i)},t.wbg.__wbg_debug_34c9290896ec9856=function(e){console.debug(ni(e))},t.wbg.__wbg_error_e60eff06f24ab7a4=function(e){console.error(ni(e))},t.wbg.__wbg_info_d7d58472d0bab115=function(e){console.info(ni(e))},t.wbg.__wbg_log_a4530b4fe289336f=function(e){console.log(ni(e))},t.wbg.__wbg_warn_f260f49434e45e62=function(e){console.warn(ni(e))},t.wbg.__wbg_instanceof_ArrayBuffer_e7d53d51371448e2=function(e){let n;try{n=ni(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_buffer_a448f833075b71ba=function(e){const n=ni(e).buffer;return xl(n)},t.wbg.__wbg_new_8f67e318f15d7254=function(e){const n=new Uint8Array(ni(e));return xl(n)},t.wbg.__wbg_set_2357bf09366ee480=function(e,n,i){ni(e).set(ni(n),i>>>0)},t.wbg.__wbg_length_1d25fa9e4ac21ce7=function(e){return ni(e).length},t.wbg.__wbg_instanceof_Uint8Array_bced6f43aed8c1aa=function(e){let n;try{n=ni(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return xl(e)},t.wbg.__wbg_stack_658279fe44541cf6=function(e,n){const i=ni(n).stack,s=o_(i,_n.__wbindgen_malloc,_n.__wbindgen_realloc),c=Yu;Jn()[e/4+1]=c,Jn()[e/4+0]=s},t.wbg.__wbg_error_f851667af71bcfc6=function(e,n){let i,s;try{i=e,s=n,console.error(ou(e,n))}finally{_n.__wbindgen_free(i,s,1)}},t.wbg.__wbindgen_debug_string=function(e,n){const i=__(ni(n)),s=o_(i,_n.__wbindgen_malloc,_n.__wbindgen_realloc),c=Yu;Jn()[e/4+1]=c,Jn()[e/4+0]=s},t.wbg.__wbindgen_throw=function(e,n){throw new Error(ou(e,n))},t.wbg.__wbindgen_memory=function(){const e=_n.memory;return xl(e)},t}function Z2(t,e){return _n=t.exports,K1.__wbindgen_wasm_module=e,cf=null,hf=null,uf=null,_n}async function K1(t){if(_n!==void 0)return _n;typeof t>"u"&&(t="/severance_snape/assets/backend_bg.wasm");const e=j2();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:i}=await q2(await t,e);return Z2(n,i)}const fh=[];function s_(t,e){return{subscribe:vr(t,e).subscribe}}function vr(t,e=Ve){let n;const i=new Set;function s(u){if(hn(t,u)&&(t=u,n)){const x=!fh.length;for(const w of i)w[1](),fh.push(w,t);if(x){for(let w=0;w{i.delete(w),i.size===0&&n&&(n(),n=null)}}return{set:s,update:c,subscribe:p}}let W2=Date.now();function Vf(t){return`${t}-${W2++}`}const B_=Symbol.for("svelte-maplibre");function Hh(){return P2(B_)}function H2(t){let e=new WeakMap;return n=>{var p;let i=e.get(n.originalEvent);if(i!==void 0)return i;let c=(p=n.target.queryRenderedFeatures(n.point).find(u=>{var x;return(x=t.get(u.layer.id))==null?void 0:x.interactive}))==null?void 0:p.layer.id;return e.set(n.originalEvent,c),c}}function X2(){let t=new Map;return j1(B_,{map:vr(null),source:s_(null),layer:s_(null),popupTarget:s_(null),cluster:vr(),loadedImages:vr(new Set),minzoom:vr(0),maxzoom:vr(24),layerEvent:vr(null),layerInfo:t,eventTopMost:H2(t)})}function W0(t){return{subscribe:t.subscribe}}function V_({key:t,setPopupTarget:e=!1,setCluster:n=!1,setMouseEvent:i=!1}){let s=Hh(),c=vr(null),p=W0(c),u={...s,[t]:W0(c)};if(e&&(u.popupTarget=p),i){let x=vr(null);u.layerEvent=x,s.layerEvent=x}return n&&(u.cluster=vr()),j1(B_,u),{...s,self:c}}function Y2(){return V_({key:"source",setCluster:!0})}function K2(t=!0){return V_({key:"layer",setPopupTarget:t,setMouseEvent:t})}function J2(){return V_({key:"popupTarget",setPopupTarget:!0,setMouseEvent:!0})}function Q2(t){return"layerType"in t&&t.layerType==="deckgl"}var J1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Q1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function $1(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}),n}var tx={exports:{}};/** + * MapLibre GL JS + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.0.1/LICENSE.txt + */(function(t,e){(function(n,i){t.exports=i()})(J1,function(){var n={},i={};function s(p,u,x){if(i[p]=x,p==="index"){var w="var sharedModule = {}; ("+i.shared+")(sharedModule); ("+i.worker+")(sharedModule);",E={};return i.shared(E),i.index(n,E),typeof window<"u"&&n.setWorkerUrl(window.URL.createObjectURL(new Blob([w],{type:"text/javascript"}))),n}}s("shared",["exports"],function(p){function u(a,r,l,f){return new(l||(l=Promise))(function(m,v){function b(P){try{C(f.next(P))}catch(D){v(D)}}function S(P){try{C(f.throw(P))}catch(D){v(D)}}function C(P){var D;P.done?m(P.value):(D=P.value,D instanceof l?D:new l(function(R){R(D)})).then(b,S)}C((f=f.apply(a,r||[])).next())})}function x(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}typeof SuppressedError=="function"&&SuppressedError;var w=E;function E(a,r){this.x=a,this.y=r}E.prototype={clone:function(){return new E(this.x,this.y)},add:function(a){return this.clone()._add(a)},sub:function(a){return this.clone()._sub(a)},multByPoint:function(a){return this.clone()._multByPoint(a)},divByPoint:function(a){return this.clone()._divByPoint(a)},mult:function(a){return this.clone()._mult(a)},div:function(a){return this.clone()._div(a)},rotate:function(a){return this.clone()._rotate(a)},rotateAround:function(a,r){return this.clone()._rotateAround(a,r)},matMult:function(a){return this.clone()._matMult(a)},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(a){return this.x===a.x&&this.y===a.y},dist:function(a){return Math.sqrt(this.distSqr(a))},distSqr:function(a){var r=a.x-this.x,l=a.y-this.y;return r*r+l*l},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(a){return Math.atan2(this.y-a.y,this.x-a.x)},angleWith:function(a){return this.angleWithSep(a.x,a.y)},angleWithSep:function(a,r){return Math.atan2(this.x*r-this.y*a,this.x*a+this.y*r)},_matMult:function(a){var r=a[2]*this.x+a[3]*this.y;return this.x=a[0]*this.x+a[1]*this.y,this.y=r,this},_add:function(a){return this.x+=a.x,this.y+=a.y,this},_sub:function(a){return this.x-=a.x,this.y-=a.y,this},_mult:function(a){return this.x*=a,this.y*=a,this},_div:function(a){return this.x/=a,this.y/=a,this},_multByPoint:function(a){return this.x*=a.x,this.y*=a.y,this},_divByPoint:function(a){return this.x/=a.x,this.y/=a.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var a=this.y;return this.y=this.x,this.x=-a,this},_rotate:function(a){var r=Math.cos(a),l=Math.sin(a),f=l*this.x+r*this.y;return this.x=r*this.x-l*this.y,this.y=f,this},_rotateAround:function(a,r){var l=Math.cos(a),f=Math.sin(a),m=r.y+f*(this.x-r.x)+l*(this.y-r.y);return this.x=r.x+l*(this.x-r.x)-f*(this.y-r.y),this.y=m,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},E.convert=function(a){return a instanceof E?a:Array.isArray(a)?new E(a[0],a[1]):a};var L=x(w),A=V;function V(a,r,l,f){this.cx=3*a,this.bx=3*(l-a)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(f-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=a,this.p1y=r,this.p2x=l,this.p2y=f}V.prototype={sampleCurveX:function(a){return((this.ax*a+this.bx)*a+this.cx)*a},sampleCurveY:function(a){return((this.ay*a+this.by)*a+this.cy)*a},sampleCurveDerivativeX:function(a){return(3*this.ax*a+2*this.bx)*a+this.cx},solveCurveX:function(a,r){if(r===void 0&&(r=1e-6),a<0)return 0;if(a>1)return 1;for(var l=a,f=0;f<8;f++){var m=this.sampleCurveX(l)-a;if(Math.abs(m)m?b=l:S=l,l=.5*(S-b)+b;return l},solve:function(a,r){return this.sampleCurveY(this.solveCurveX(a,r))}};var O=x(A);let J,Y;function $(){return J==null&&(J=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),J}function U(){if(Y==null&&(Y=!1,$())){const r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let f=0;f<5*5;f++){const m=4*f;r.fillStyle=`rgb(${m},${m+1},${m+2})`,r.fillRect(f%5,Math.floor(f/5),1,1)}const l=r.getImageData(0,0,5,5).data;for(let f=0;f<5*5*4;f++)if(f%4!=3&&l[f]!==f){Y=!0;break}}}return Y||!1}function G(a,r,l,f){const m=new O(a,r,l,f);return function(v){return m.solve(v)}}const X=G(.25,.1,.25,1);function at(a,r,l){return Math.min(l,Math.max(r,a))}function vt(a,r,l){const f=l-r,m=((a-r)%f+f)%f+r;return m===r?l:m}function dt(a,...r){for(const l of r)for(const f in l)a[f]=l[f];return a}let pt=1;function ut(a,r,l){const f={};for(const m in a)f[m]=r.call(l||this,a[m],m,a);return f}function Rt(a,r,l){const f={};for(const m in a)r.call(l||this,a[m],m,a)&&(f[m]=a[m]);return f}function yt(a){return Array.isArray(a)?a.map(yt):typeof a=="object"&&a?ut(a,yt):a}const wt={};function ie(a){wt[a]||(typeof console<"u"&&console.warn(a),wt[a]=!0)}function Tt(a,r,l){return(l.y-a.y)*(r.x-a.x)>(r.y-a.y)*(l.x-a.x)}function ae(a){let r=0;for(let l,f,m=0,v=a.length,b=v-1;m"u")throw new Error("VideoFrame not supported");const v=new VideoFrame(a,{timestamp:0});try{const b=v==null?void 0:v.format;if(!b||!b.startsWith("BGR")&&!b.startsWith("RGB"))throw new Error(`Unrecognized format ${b}`);const S=b.startsWith("BGR"),C=new Uint8ClampedArray(f*m*4);if(yield v.copyTo(C,function(P,D,R,B,j){const W=4*Math.max(-D,0),Q=(Math.max(0,R)-R)*B*4+W,rt=4*B,ct=Math.max(0,D),Et=Math.max(0,R);return{rect:{x:ct,y:Et,width:Math.min(P.width,D+B)-ct,height:Math.min(P.height,R+j)-Et},layout:[{offset:Q,stride:rt}]}}(a,r,l,f,m)),S)for(let P=0;PKt(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,cn=function(a,r){if(/:\/\//.test(a.url)&&!/^https?:|^file:/.test(a.url)){const f=zn(a.url);if(f)return f(a,r);if(Kt(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"getResource",data:a,targetMapId:jn},r)}if(!(/^file:/.test(l=a.url)||/^file:/.test(Ge())&&!/^\w+:/.test(l))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(f,m){return u(this,void 0,void 0,function*(){const v=new Request(f.url,{method:f.method||"GET",body:f.body,credentials:f.credentials,headers:f.headers,cache:f.cache,referrer:Ge(),signal:m.signal});f.type==="json"&&v.headers.set("Accept","application/json");const b=yield fetch(v);if(!b.ok){const P=yield b.blob();throw new ee(b.status,b.statusText,f.url,P)}const S=f.type==="arrayBuffer"||f.type==="image"?b.arrayBuffer():f.type==="json"?b.json():b.text(),C=yield S;if(m.signal.aborted)throw Sn();return{data:C,cacheControl:b.headers.get("Cache-Control"),expires:b.headers.get("Expires")}})}(a,r);if(Kt(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"getResource",data:a,mustQueue:!0,targetMapId:jn},r)}var l;return function(f,m){return new Promise((v,b)=>{const S=new XMLHttpRequest;S.open(f.method||"GET",f.url,!0),f.type!=="arrayBuffer"&&f.type!=="image"||(S.responseType="arraybuffer");for(const C in f.headers)S.setRequestHeader(C,f.headers[C]);f.type==="json"&&(S.responseType="text",S.setRequestHeader("Accept","application/json")),S.withCredentials=f.credentials==="include",S.onerror=()=>{b(new Error(S.statusText))},S.onload=()=>{if(!m.signal.aborted)if((S.status>=200&&S.status<300||S.status===0)&&S.response!==null){let C=S.response;if(f.type==="json")try{C=JSON.parse(S.response)}catch(P){return void b(P)}v({data:C,cacheControl:S.getResponseHeader("Cache-Control"),expires:S.getResponseHeader("Expires")})}else{const C=new Blob([S.response],{type:S.getResponseHeader("Content-Type")});b(new ee(S.status,S.statusText,f.url,C))}},m.signal.addEventListener("abort",()=>{S.abort(),b(Sn())}),S.send(f.body)})}(a,r)};function vi(a){if(!a||a.indexOf("://")<=0||a.indexOf("data:image/")===0||a.indexOf("blob:")===0)return!0;const r=new URL(a),l=window.location;return r.protocol===l.protocol&&r.host===l.host}function Bi(a,r,l){l[a]&&l[a].indexOf(r)!==-1||(l[a]=l[a]||[],l[a].push(r))}function Yt(a,r,l){if(l&&l[a]){const f=l[a].indexOf(r);f!==-1&&l[a].splice(f,1)}}class jt{constructor(r,l={}){dt(this,l),this.type=r}}class be extends jt{constructor(r,l={}){super("error",dt({error:r},l))}}class oi{on(r,l){return this._listeners=this._listeners||{},Bi(r,l,this._listeners),this}off(r,l){return Yt(r,l,this._listeners),Yt(r,l,this._oneTimeListeners),this}once(r,l){return l?(this._oneTimeListeners=this._oneTimeListeners||{},Bi(r,l,this._oneTimeListeners),this):new Promise(f=>this.once(r,f))}fire(r,l){typeof r=="string"&&(r=new jt(r,l||{}));const f=r.type;if(this.listens(f)){r.target=this;const m=this._listeners&&this._listeners[f]?this._listeners[f].slice():[];for(const S of m)S.call(this,r);const v=this._oneTimeListeners&&this._oneTimeListeners[f]?this._oneTimeListeners[f].slice():[];for(const S of v)Yt(f,S,this._oneTimeListeners),S.call(this,r);const b=this._eventedParent;b&&(dt(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),b.fire(r))}else r instanceof be&&console.error(r.error);return this}listens(r){return this._listeners&&this._listeners[r]&&this._listeners[r].length>0||this._oneTimeListeners&&this._oneTimeListeners[r]&&this._oneTimeListeners[r].length>0||this._eventedParent&&this._eventedParent.listens(r)}setEventedParent(r,l){return this._eventedParent=r,this._eventedParentData=l,this}}var Pt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},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:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const an=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ji(a,r){const l={};for(const f in a)f!=="ref"&&(l[f]=a[f]);return an.forEach(f=>{f in r&&(l[f]=r[f])}),l}function nn(a,r){if(Array.isArray(a)){if(!Array.isArray(r)||a.length!==r.length)return!1;for(let l=0;l`:a.itemType.kind==="value"?"array":`array<${r}>`}return a.kind}const gt=[Vi,oe,Ye,He,xi,Ci,jo,H(We),ot,F,q];function K(a,r){if(r.kind==="error")return null;if(a.kind==="array"){if(r.kind==="array"&&(r.N===0&&r.itemType.kind==="value"||!K(a.itemType,r.itemType))&&(typeof a.N!="number"||a.N===r.N))return null}else{if(a.kind===r.kind)return null;if(a.kind==="value"){for(const l of gt)if(!K(l,r))return null}}return`Expected ${et(a)} but found ${et(r)} instead.`}function _t(a,r){return r.some(l=>l.kind===a.kind)}function ht(a,r){return r.some(l=>l==="null"?a===null:l==="array"?Array.isArray(a):l==="object"?a&&!Array.isArray(a)&&typeof a=="object":l===typeof a)}function St(a,r){return a.kind==="array"&&r.kind==="array"?a.itemType.kind===r.itemType.kind&&typeof a.N=="number":a.kind===r.kind}const At=.96422,Nt=.82521,Gt=4/29,Se=6/29,Ce=3*Se*Se,qe=Se*Se*Se,je=Math.PI/180,mn=180/Math.PI;function On(a){return(a%=360)<0&&(a+=360),a}function ti([a,r,l,f]){let m,v;const b=$e((.2225045*(a=Ui(a))+.7168786*(r=Ui(r))+.0606169*(l=Ui(l)))/1);a===r&&r===l?m=v=b:(m=$e((.4360747*a+.3850649*r+.1430804*l)/At),v=$e((.0139322*a+.0971045*r+.7141733*l)/Nt));const S=116*b-16;return[S<0?0:S,500*(m-b),200*(b-v),f]}function Ui(a){return a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function $e(a){return a>qe?Math.pow(a,1/3):a/Ce+Gt}function ci([a,r,l,f]){let m=(a+16)/116,v=isNaN(r)?m:m+r/500,b=isNaN(l)?m:m-l/200;return m=1*Gr(m),v=At*Gr(v),b=Nt*Gr(b),[Zi(3.1338561*v-1.6168667*m-.4906146*b),Zi(-.9787684*v+1.9161415*m+.033454*b),Zi(.0719453*v-.2289914*m+1.4052427*b),f]}function Zi(a){return(a=a<=.00304?12.92*a:1.055*Math.pow(a,1/2.4)-.055)<0?0:a>1?1:a}function Gr(a){return a>Se?a*a*a:Ce*(a-Gt)}function ro(a){return parseInt(a.padEnd(2,a),16)/255}function sr(a,r){return Ls(r?a/100:a,0,1)}function Ls(a,r,l){return Math.min(Math.max(r,a),l)}function Kf(a){return!a.some(Number.isNaN)}const Qm={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Dn{constructor(r,l,f,m=1,v=!0){this.r=r,this.g=l,this.b=f,this.a=m,v||(this.r*=m,this.g*=m,this.b*=m,m||this.overwriteGetter("rgb",[r,l,f,m]))}static parse(r){if(r instanceof Dn)return r;if(typeof r!="string")return;const l=function(f){if((f=f.toLowerCase().trim())==="transparent")return[0,0,0,0];const m=Qm[f];if(m){const[b,S,C]=m;return[b/255,S/255,C/255,1]}if(f.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(f)){const b=f.length<6?1:2;let S=1;return[ro(f.slice(S,S+=b)),ro(f.slice(S,S+=b)),ro(f.slice(S,S+=b)),ro(f.slice(S,S+b)||"ff")]}if(f.startsWith("rgb")){const b=f.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(b){const[S,C,P,D,R,B,j,W,Q,rt,ct,Et]=b,ft=[D||" ",j||" ",rt].join("");if(ft===" "||ft===" /"||ft===",,"||ft===",,,"){const xt=[P,B,Q].join(""),qt=xt==="%%%"?100:xt===""?255:0;if(qt){const Wt=[Ls(+C/qt,0,1),Ls(+R/qt,0,1),Ls(+W/qt,0,1),ct?sr(+ct,Et):1];if(Kf(Wt))return Wt}}return}}const v=f.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(v){const[b,S,C,P,D,R,B,j,W]=v,Q=[C||" ",D||" ",B].join("");if(Q===" "||Q===" /"||Q===",,"||Q===",,,"){const rt=[+S,Ls(+P,0,100),Ls(+R,0,100),j?sr(+j,W):1];if(Kf(rt))return function([ct,Et,ft,xt]){function qt(Wt){const de=(Wt+ct/30)%12,we=Et*Math.min(ft,1-ft);return ft-we*Math.max(-1,Math.min(de-3,9-de,1))}return ct=On(ct),Et/=100,ft/=100,[qt(0),qt(8),qt(4),xt]}(rt)}}}(r);return l?new Dn(...l,!1):void 0}get rgb(){const{r,g:l,b:f,a:m}=this,v=m||1/0;return this.overwriteGetter("rgb",[r/v,l/v,f/v,m])}get hcl(){return this.overwriteGetter("hcl",function(r){const[l,f,m,v]=ti(r),b=Math.sqrt(f*f+m*m);return[Math.round(1e4*b)?On(Math.atan2(m,f)*mn):NaN,b,l,v]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ti(this.rgb))}overwriteGetter(r,l){return Object.defineProperty(this,r,{value:l}),l}toString(){const[r,l,f,m]=this.rgb;return`rgba(${[r,l,f].map(v=>Math.round(255*v)).join(",")},${m})`}}Dn.black=new Dn(0,0,0,1),Dn.white=new Dn(1,1,1,1),Dn.transparent=new Dn(0,0,0,0),Dn.red=new Dn(1,0,0,1);class np{constructor(r,l,f){this.sensitivity=r?l?"variant":"case":l?"accent":"base",this.locale=f,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(r,l){return this.collator.compare(r,l)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ip{constructor(r,l,f,m,v){this.text=r,this.image=l,this.scale=f,this.fontStack=m,this.textColor=v}}class So{constructor(r){this.sections=r}static fromString(r){return new So([new ip(r,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(r=>r.text.length!==0||r.image&&r.image.name.length!==0)}static factory(r){return r instanceof So?r:So.fromString(r)}toString(){return this.sections.length===0?"":this.sections.map(r=>r.text).join("")}}class oo{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof oo)return r;if(typeof r=="number")return new oo([r,r,r,r]);if(Array.isArray(r)&&!(r.length<1||r.length>4)){for(const l of r)if(typeof l!="number")return;switch(r.length){case 1:r=[r[0],r[0],r[0],r[0]];break;case 2:r=[r[0],r[1],r[0],r[1]];break;case 3:r=[r[0],r[1],r[2],r[1]]}return new oo(r)}}toString(){return JSON.stringify(this.values)}}const wu=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Zo{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof Zo)return r;if(Array.isArray(r)&&!(r.length<1)&&r.length%2==0){for(let l=0;l=0&&a<=255&&typeof r=="number"&&r>=0&&r<=255&&typeof l=="number"&&l>=0&&l<=255?f===void 0||typeof f=="number"&&f>=0&&f<=1?null:`Invalid rgba value [${[a,r,l,f].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof f=="number"?[a,r,l,f]:[a,r,l]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function yc(a){if(a===null||typeof a=="string"||typeof a=="boolean"||typeof a=="number"||a instanceof Dn||a instanceof np||a instanceof So||a instanceof oo||a instanceof Zo||a instanceof Wo)return!0;if(Array.isArray(a)){for(const r of a)if(!yc(r))return!1;return!0}if(typeof a=="object"){for(const r in a)if(!yc(a[r]))return!1;return!0}return!1}function Gi(a){if(a===null)return Vi;if(typeof a=="string")return Ye;if(typeof a=="boolean")return He;if(typeof a=="number")return oe;if(a instanceof Dn)return xi;if(a instanceof np)return ea;if(a instanceof So)return Ci;if(a instanceof oo)return ot;if(a instanceof Zo)return q;if(a instanceof Wo)return F;if(Array.isArray(a)){const r=a.length;let l;for(const f of a){const m=Gi(f);if(l){if(l===m)continue;l=We;break}l=m}return H(l||We,r)}return jo}function Su(a){const r=typeof a;return a===null?"":r==="string"||r==="number"||r==="boolean"?String(a):a instanceof Dn||a instanceof So||a instanceof oo||a instanceof Zo||a instanceof Wo?a.toString():JSON.stringify(a)}class Ca{constructor(r,l){this.type=r,this.value=l}static parse(r,l){if(r.length!==2)return l.error(`'literal' expression requires exactly one argument, but found ${r.length-1} instead.`);if(!yc(r[1]))return l.error("invalid value");const f=r[1];let m=Gi(f);const v=l.expectedType;return m.kind!=="array"||m.N!==0||!v||v.kind!=="array"||typeof v.N=="number"&&v.N!==0||(m=v),new Ca(m,f)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class si{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}}const vc={string:Ye,number:oe,boolean:He,object:jo};class Eo{constructor(r,l){this.type=r,this.args=l}static parse(r,l){if(r.length<2)return l.error("Expected at least one argument.");let f,m=1;const v=r[0];if(v==="array"){let S,C;if(r.length>2){const P=r[1];if(typeof P!="string"||!(P in vc)||P==="object")return l.error('The item type argument of "array" must be one of string, number, boolean',1);S=vc[P],m++}else S=We;if(r.length>3){if(r[2]!==null&&(typeof r[2]!="number"||r[2]<0||r[2]!==Math.floor(r[2])))return l.error('The length argument to "array" must be a positive integer literal',2);C=r[2],m++}f=H(S,C)}else{if(!vc[v])throw new Error(`Types doesn't contain name = ${v}`);f=vc[v]}const b=[];for(;mr.outputDefined())}}const xc={"to-boolean":He,"to-color":xi,"to-number":oe,"to-string":Ye};class Ms{constructor(r,l){this.type=r,this.args=l}static parse(r,l){if(r.length<2)return l.error("Expected at least one argument.");const f=r[0];if(!xc[f])throw new Error(`Can't parse ${f} as it is not part of the known types`);if((f==="to-boolean"||f==="to-string")&&r.length!==2)return l.error("Expected one argument.");const m=xc[f],v=[];for(let b=1;b4?`Invalid rbga value ${JSON.stringify(l)}: expected an array containing either three or four numeric values.`:zl(l[0],l[1],l[2],l[3]),!f))return new Dn(l[0]/255,l[1]/255,l[2]/255,l[3])}throw new si(f||`Could not parse color from value '${typeof l=="string"?l:JSON.stringify(l)}'`)}case"padding":{let l;for(const f of this.args){l=f.evaluate(r);const m=oo.parse(l);if(m)return m}throw new si(`Could not parse padding from value '${typeof l=="string"?l:JSON.stringify(l)}'`)}case"variableAnchorOffsetCollection":{let l;for(const f of this.args){l=f.evaluate(r);const m=Zo.parse(l);if(m)return m}throw new si(`Could not parse variableAnchorOffsetCollection from value '${typeof l=="string"?l:JSON.stringify(l)}'`)}case"number":{let l=null;for(const f of this.args){if(l=f.evaluate(r),l===null)return 0;const m=Number(l);if(!isNaN(m))return m}throw new si(`Could not convert ${JSON.stringify(l)} to number.`)}case"formatted":return So.fromString(Su(this.args[0].evaluate(r)));case"resolvedImage":return Wo.fromString(Su(this.args[0].evaluate(r)));default:return Su(this.args[0].evaluate(r))}}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}}const Eu=["Unknown","Point","LineString","Polygon"];class Rn{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Eu[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||{}}parseColor(r){let l=this._parseColorCache[r];return l||(l=this._parseColorCache[r]=Dn.parse(r)),l}}class bc{constructor(r,l,f=[],m,v=new el,b=[]){this.registry=r,this.path=f,this.key=f.map(S=>`[${S}]`).join(""),this.scope=v,this.errors=b,this.expectedType=m,this._isConstant=l}parse(r,l,f,m,v={}){return l?this.concat(l,f,m)._parse(r,v):this._parse(r,v)}_parse(r,l){function f(m,v,b){return b==="assert"?new Eo(v,[m]):b==="coerce"?new Ms(v,[m]):m}if(r!==null&&typeof r!="string"&&typeof r!="boolean"&&typeof r!="number"||(r=["literal",r]),Array.isArray(r)){if(r.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const m=r[0];if(typeof m!="string")return this.error(`Expression name must be a string, but found ${typeof m} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const v=this.registry[m];if(v){let b=v.parse(r,this);if(!b)return null;if(this.expectedType){const S=this.expectedType,C=b.type;if(S.kind!=="string"&&S.kind!=="number"&&S.kind!=="boolean"&&S.kind!=="object"&&S.kind!=="array"||C.kind!=="value")if(S.kind!=="color"&&S.kind!=="formatted"&&S.kind!=="resolvedImage"||C.kind!=="value"&&C.kind!=="string")if(S.kind!=="padding"||C.kind!=="value"&&C.kind!=="number"&&C.kind!=="array")if(S.kind!=="variableAnchorOffsetCollection"||C.kind!=="value"&&C.kind!=="array"){if(this.checkSubtype(S,C))return null}else b=f(b,S,l.typeAnnotation||"coerce");else b=f(b,S,l.typeAnnotation||"coerce");else b=f(b,S,l.typeAnnotation||"coerce");else b=f(b,S,l.typeAnnotation||"assert")}if(!(b instanceof Ca)&&b.type.kind!=="resolvedImage"&&this._isConstant(b)){const S=new Rn;try{b=new Ca(b.type,b.evaluate(S))}catch(C){return this.error(C.message),null}}return b}return this.error(`Unknown expression "${m}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(r===void 0?"'undefined' value invalid. Use null instead.":typeof r=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof r} instead.`)}concat(r,l,f){const m=typeof r=="number"?this.path.concat(r):this.path,v=f?this.scope.concat(f):this.scope;return new bc(this.registry,this._isConstant,m,l||null,v,this.errors)}error(r,...l){const f=`${this.key}${l.map(m=>`[${m}]`).join("")}`;this.errors.push(new Ur(f,r))}checkSubtype(r,l){const f=K(r,l);return f&&this.error(f),f}}class Ol{constructor(r,l,f){this.type=ea,this.locale=f,this.caseSensitive=r,this.diacriticSensitive=l}static parse(r,l){if(r.length!==2)return l.error("Expected one argument.");const f=r[1];if(typeof f!="object"||Array.isArray(f))return l.error("Collator options argument must be an object.");const m=l.parse(f["case-sensitive"]!==void 0&&f["case-sensitive"],1,He);if(!m)return null;const v=l.parse(f["diacritic-sensitive"]!==void 0&&f["diacritic-sensitive"],1,He);if(!v)return null;let b=null;return f.locale&&(b=l.parse(f.locale,1,Ye),!b)?null:new Ol(m,v,b)}evaluate(r){return new np(this.caseSensitive.evaluate(r),this.diacriticSensitive.evaluate(r),this.locale?this.locale.evaluate(r):null)}eachChild(r){r(this.caseSensitive),r(this.diacriticSensitive),this.locale&&r(this.locale)}outputDefined(){return!1}}const Ta=8192;function wc(a,r){a[0]=Math.min(a[0],r[0]),a[1]=Math.min(a[1],r[1]),a[2]=Math.max(a[2],r[0]),a[3]=Math.max(a[3],r[1])}function Iu(a,r){return!(a[0]<=r[0]||a[2]>=r[2]||a[1]<=r[1]||a[3]>=r[3])}function $m(a,r){const l=(180+a[0])/360,f=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a[1]*Math.PI/360)))/360,m=Math.pow(2,r.z);return[Math.round(l*m*Ta),Math.round(f*m*Ta)]}function Jf(a,r,l){const f=a[0]-r[0],m=a[1]-r[1],v=a[0]-l[0],b=a[1]-l[1];return f*b-v*m==0&&f*v<=0&&m*b<=0}function Sc(a,r){let l=!1;for(let b=0,S=r.length;b(f=a)[1]!=(v=C[P+1])[1]>f[1]&&f[0]<(v[0]-m[0])*(f[1]-m[1])/(v[1]-m[1])+m[0]&&(l=!l)}}var f,m,v;return l}function tg(a,r){for(let l=0;l0&&S<0||b<0&&S>0}function eg(a,r,l){for(const P of l)for(let D=0;Dl[2]){const m=.5*f;let v=a[0]-l[0]>m?-f:l[0]-a[0]>m?f:0;v===0&&(v=a[0]-l[2]>m?-f:l[2]-a[0]>m?f:0),a[0]+=v}wc(r,a)}function Ic(a,r,l,f){const m=Math.pow(2,f.z)*Ta,v=[f.x*Ta,f.y*Ta],b=[];for(const S of a)for(const C of S){const P=[C.x+v[0],C.y+v[1]];nd(P,r,l,m),b.push(P)}return b}function id(a,r,l,f){const m=Math.pow(2,f.z)*Ta,v=[f.x*Ta,f.y*Ta],b=[];for(const C of a){const P=[];for(const D of C){const R=[D.x+v[0],D.y+v[1]];wc(r,R),P.push(R)}b.push(P)}if(r[2]-r[0]<=m/2){(S=r)[0]=S[1]=1/0,S[2]=S[3]=-1/0;for(const C of b)for(const P of C)nd(P,r,l,m)}var S;return b}class nl{constructor(r,l){this.type=He,this.geojson=r,this.geometries=l}static parse(r,l){if(r.length!==2)return l.error(`'within' expression requires exactly one argument, but found ${r.length-1} instead.`);if(yc(r[1])){const f=r[1];if(f.type==="FeatureCollection"){const m=[];for(const v of f.features){const{type:b,coordinates:S}=v.geometry;b==="Polygon"&&m.push(S),b==="MultiPolygon"&&m.push(...S)}if(m.length)return new nl(f,{type:"MultiPolygon",coordinates:m})}else if(f.type==="Feature"){const m=f.geometry.type;if(m==="Polygon"||m==="MultiPolygon")return new nl(f,f.geometry)}else if(f.type==="Polygon"||f.type==="MultiPolygon")return new nl(f,f)}return l.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return function(l,f){const m=[1/0,1/0,-1/0,-1/0],v=[1/0,1/0,-1/0,-1/0],b=l.canonicalID();if(f.type==="Polygon"){const S=Ec(f.coordinates,v,b),C=Ic(l.geometry(),m,v,b);if(!Iu(m,v))return!1;for(const P of C)if(!Sc(P,S))return!1}if(f.type==="MultiPolygon"){const S=ed(f.coordinates,v,b),C=Ic(l.geometry(),m,v,b);if(!Iu(m,v))return!1;for(const P of C)if(!tg(P,S))return!1}return!0}(r,this.geometries);if(r.geometryType()==="LineString")return function(l,f){const m=[1/0,1/0,-1/0,-1/0],v=[1/0,1/0,-1/0,-1/0],b=l.canonicalID();if(f.type==="Polygon"){const S=Ec(f.coordinates,v,b),C=id(l.geometry(),m,v,b);if(!Iu(m,v))return!1;for(const P of C)if(!$f(P,S))return!1}if(f.type==="MultiPolygon"){const S=ed(f.coordinates,v,b),C=id(l.geometry(),m,v,b);if(!Iu(m,v))return!1;for(const P of C)if(!td(P,S))return!1}return!0}(r,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class Cc{constructor(r,l){this.type=l.type,this.name=r,this.boundExpression=l}static parse(r,l){if(r.length!==2||typeof r[1]!="string")return l.error("'var' expression requires exactly one string literal argument.");const f=r[1];return l.scope.has(f)?new Cc(f,l.scope.get(f)):l.error(`Unknown variable "${f}". Make sure "${f}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(r){return this.boundExpression.evaluate(r)}eachChild(){}outputDefined(){return!1}}class Io{constructor(r,l,f,m){this.name=r,this.type=l,this._evaluate=f,this.args=m}evaluate(r){return this._evaluate(r,this.args)}eachChild(r){this.args.forEach(r)}outputDefined(){return!1}static parse(r,l){const f=r[0],m=Io.definitions[f];if(!m)return l.error(`Unknown expression "${f}". If you wanted a literal array, use ["literal", [...]].`,0);const v=Array.isArray(m)?m[0]:m.type,b=Array.isArray(m)?[[m[1],m[2]]]:m.overloads,S=b.filter(([P])=>!Array.isArray(P)||P.length===r.length-1);let C=null;for(const[P,D]of S){C=new bc(l.registry,Cu,l.path,null,l.scope);const R=[];let B=!1;for(let j=1;j{return B=R,Array.isArray(B)?`(${B.map(et).join(", ")})`:`(${et(B.type)}...)`;var B}).join(" | "),D=[];for(let R=1;R{l=r?l&&Cu(f):l&&f instanceof Ca}),!!l&&Tc(a)&&Lu(a,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Tc(a){if(a instanceof Io&&(a.name==="get"&&a.args.length===1||a.name==="feature-state"||a.name==="has"&&a.args.length===1||a.name==="properties"||a.name==="geometry-type"||a.name==="id"||/^filter-/.test(a.name))||a instanceof nl)return!1;let r=!0;return a.eachChild(l=>{r&&!Tc(l)&&(r=!1)}),r}function Tu(a){if(a instanceof Io&&a.name==="feature-state")return!1;let r=!0;return a.eachChild(l=>{r&&!Tu(l)&&(r=!1)}),r}function Lu(a,r){if(a instanceof Io&&r.indexOf(a.name)>=0)return!1;let l=!0;return a.eachChild(f=>{l&&!Lu(f,r)&&(l=!1)}),l}function Mu(a,r){const l=a.length-1;let f,m,v=0,b=l,S=0;for(;v<=b;)if(S=Math.floor((v+b)/2),f=a[S],m=a[S+1],f<=r){if(S===l||rr))throw new si("Input is not a number.");b=S-1}return 0}class Pu{constructor(r,l,f){this.type=r,this.input=l,this.labels=[],this.outputs=[];for(const[m,v]of f)this.labels.push(m),this.outputs.push(v)}static parse(r,l){if(r.length-1<4)return l.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return l.error("Expected an even number of arguments.");const f=l.parse(r[1],1,oe);if(!f)return null;const m=[];let v=null;l.expectedType&&l.expectedType.kind!=="value"&&(v=l.expectedType);for(let b=1;b=S)return l.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',P);const R=l.parse(C,D,v);if(!R)return null;v=v||R.type,m.push([S,R])}return new Pu(v,f,m)}evaluate(r){const l=this.labels,f=this.outputs;if(l.length===1)return f[0].evaluate(r);const m=this.input.evaluate(r);if(m<=l[0])return f[0].evaluate(r);const v=l.length;return m>=l[v-1]?f[v-1].evaluate(r):f[Mu(l,m)].evaluate(r)}eachChild(r){r(this.input);for(const l of this.outputs)r(l)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}}function ng(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var ig=rd;function rd(a,r,l,f){this.cx=3*a,this.bx=3*(l-a)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(f-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=a,this.p1y=r,this.p2x=l,this.p2y=f}rd.prototype={sampleCurveX:function(a){return((this.ax*a+this.bx)*a+this.cx)*a},sampleCurveY:function(a){return((this.ay*a+this.by)*a+this.cy)*a},sampleCurveDerivativeX:function(a){return(3*this.ax*a+2*this.bx)*a+this.cx},solveCurveX:function(a,r){if(r===void 0&&(r=1e-6),a<0)return 0;if(a>1)return 1;for(var l=a,f=0;f<8;f++){var m=this.sampleCurveX(l)-a;if(Math.abs(m)m?b=l:S=l,l=.5*(S-b)+b;return l},solve:function(a,r){return this.sampleCurveY(this.solveCurveX(a,r))}};var rg=ng(ig);function il(a,r,l){return a+l*(r-a)}function Lc(a,r,l){return a.map((f,m)=>il(f,r[m],l))}const qr={number:il,color:function(a,r,l,f="rgb"){switch(f){case"rgb":{const[m,v,b,S]=Lc(a.rgb,r.rgb,l);return new Dn(m,v,b,S,!1)}case"hcl":{const[m,v,b,S]=a.hcl,[C,P,D,R]=r.hcl;let B,j;if(isNaN(m)||isNaN(C))isNaN(m)?isNaN(C)?B=NaN:(B=C,b!==1&&b!==0||(j=P)):(B=m,D!==1&&D!==0||(j=v));else{let Et=C-m;C>m&&Et>180?Et-=360:C180&&(Et+=360),B=m+l*Et}const[W,Q,rt,ct]=function([Et,ft,xt,qt]){return Et=isNaN(Et)?0:Et*je,ci([xt,Math.cos(Et)*ft,Math.sin(Et)*ft,qt])}([B,j??il(v,P,l),il(b,D,l),il(S,R,l)]);return new Dn(W,Q,rt,ct,!1)}case"lab":{const[m,v,b,S]=ci(Lc(a.lab,r.lab,l));return new Dn(m,v,b,S,!1)}}},array:Lc,padding:function(a,r,l){return new oo(Lc(a.values,r.values,l))},variableAnchorOffsetCollection:function(a,r,l){const f=a.values,m=r.values;if(f.length!==m.length)throw new si(`Cannot interpolate values of different length. from: ${a.toString()}, to: ${r.toString()}`);const v=[];for(let b=0;btypeof D!="number"||D<0||D>1))return l.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);m={name:"cubic-bezier",controlPoints:P}}}if(r.length-1<4)return l.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return l.error("Expected an even number of arguments.");if(v=l.parse(v,2,oe),!v)return null;const S=[];let C=null;f==="interpolate-hcl"||f==="interpolate-lab"?C=xi:l.expectedType&&l.expectedType.kind!=="value"&&(C=l.expectedType);for(let P=0;P=D)return l.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',B);const W=l.parse(R,j,C);if(!W)return null;C=C||W.type,S.push([D,W])}return St(C,oe)||St(C,xi)||St(C,ot)||St(C,q)||St(C,H(oe))?new Cr(C,f,m,v,S):l.error(`Type ${et(C)} is not interpolatable.`)}evaluate(r){const l=this.labels,f=this.outputs;if(l.length===1)return f[0].evaluate(r);const m=this.input.evaluate(r);if(m<=l[0])return f[0].evaluate(r);const v=l.length;if(m>=l[v-1])return f[v-1].evaluate(r);const b=Mu(l,m),S=Cr.interpolationFactor(this.interpolation,m,l[b],l[b+1]),C=f[b].evaluate(r),P=f[b+1].evaluate(r);switch(this.operator){case"interpolate":return qr[this.type.kind](C,P,S);case"interpolate-hcl":return qr.color(C,P,S,"hcl");case"interpolate-lab":return qr.color(C,P,S,"lab")}}eachChild(r){r(this.input);for(const l of this.outputs)r(l)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}}function Ln(a,r,l,f){const m=f-l,v=a-l;return m===0?0:r===1?v/m:(Math.pow(r,v)-1)/(Math.pow(r,m)-1)}class Mc{constructor(r,l){this.type=r,this.args=l}static parse(r,l){if(r.length<2)return l.error("Expectected at least one argument.");let f=null;const m=l.expectedType;m&&m.kind!=="value"&&(f=m);const v=[];for(const S of r.slice(1)){const C=l.parse(S,1+v.length,f,void 0,{typeAnnotation:"omit"});if(!C)return null;f=f||C.type,v.push(C)}if(!f)throw new Error("No output type");const b=m&&v.some(S=>K(m,S.type));return new Mc(b?We:f,v)}evaluate(r){let l,f=null,m=0;for(const v of this.args)if(m++,f=v.evaluate(r),f&&f instanceof Wo&&!f.available&&(l||(l=f.name),f=null,m===this.args.length&&(f=l)),f!==null)break;return f}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}}class Pc{constructor(r,l){this.type=l.type,this.bindings=[].concat(r),this.result=l}evaluate(r){return this.result.evaluate(r)}eachChild(r){for(const l of this.bindings)r(l[1]);r(this.result)}static parse(r,l){if(r.length<4)return l.error(`Expected at least 3 arguments, but found ${r.length-1} instead.`);const f=[];for(let v=1;v=f.length)throw new si(`Array index out of bounds: ${l} > ${f.length-1}.`);if(l!==Math.floor(l))throw new si(`Array index must be an integer, but found ${l} instead.`);return f[l]}eachChild(r){r(this.index),r(this.input)}outputDefined(){return!1}}class op{constructor(r,l){this.type=He,this.needle=r,this.haystack=l}static parse(r,l){if(r.length!==3)return l.error(`Expected 2 arguments, but found ${r.length-1} instead.`);const f=l.parse(r[1],1,We),m=l.parse(r[2],2,We);return f&&m?_t(f.type,[He,Ye,oe,Vi,We])?new op(f,m):l.error(`Expected first argument to be of type boolean, string, number or null, but found ${et(f.type)} instead`):null}evaluate(r){const l=this.needle.evaluate(r),f=this.haystack.evaluate(r);if(!f)return!1;if(!ht(l,["boolean","string","number","null"]))throw new si(`Expected first argument to be of type boolean, string, number or null, but found ${et(Gi(l))} instead.`);if(!ht(f,["string","array"]))throw new si(`Expected second argument to be of type array or string, but found ${et(Gi(f))} instead.`);return f.indexOf(l)>=0}eachChild(r){r(this.needle),r(this.haystack)}outputDefined(){return!0}}class Ac{constructor(r,l,f){this.type=oe,this.needle=r,this.haystack=l,this.fromIndex=f}static parse(r,l){if(r.length<=2||r.length>=5)return l.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`);const f=l.parse(r[1],1,We),m=l.parse(r[2],2,We);if(!f||!m)return null;if(!_t(f.type,[He,Ye,oe,Vi,We]))return l.error(`Expected first argument to be of type boolean, string, number or null, but found ${et(f.type)} instead`);if(r.length===4){const v=l.parse(r[3],3,oe);return v?new Ac(f,m,v):null}return new Ac(f,m)}evaluate(r){const l=this.needle.evaluate(r),f=this.haystack.evaluate(r);if(!ht(l,["boolean","string","number","null"]))throw new si(`Expected first argument to be of type boolean, string, number or null, but found ${et(Gi(l))} instead.`);if(!ht(f,["string","array"]))throw new si(`Expected second argument to be of type array or string, but found ${et(Gi(f))} instead.`);if(this.fromIndex){const m=this.fromIndex.evaluate(r);return f.indexOf(l,m)}return f.indexOf(l)}eachChild(r){r(this.needle),r(this.haystack),this.fromIndex&&r(this.fromIndex)}outputDefined(){return!1}}class sp{constructor(r,l,f,m,v,b){this.inputType=r,this.type=l,this.input=f,this.cases=m,this.outputs=v,this.otherwise=b}static parse(r,l){if(r.length<5)return l.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if(r.length%2!=1)return l.error("Expected an even number of arguments.");let f,m;l.expectedType&&l.expectedType.kind!=="value"&&(m=l.expectedType);const v={},b=[];for(let P=2;PNumber.MAX_SAFE_INTEGER)return B.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof W=="number"&&Math.floor(W)!==W)return B.error("Numeric branch labels must be integer values.");if(f){if(B.checkSubtype(f,Gi(W)))return null}else f=Gi(W);if(v[String(W)]!==void 0)return B.error("Branch labels must be unique.");v[String(W)]=b.length}const j=l.parse(R,P,m);if(!j)return null;m=m||j.type,b.push(j)}const S=l.parse(r[1],1,We);if(!S)return null;const C=l.parse(r[r.length-1],r.length-1,m);return C?S.type.kind!=="value"&&l.concat(1).checkSubtype(f,S.type)?null:new sp(f,m,S,v,b,C):null}evaluate(r){const l=this.input.evaluate(r);return(Gi(l)===this.inputType&&this.outputs[this.cases[l]]||this.otherwise).evaluate(r)}eachChild(r){r(this.input),this.outputs.forEach(r),r(this.otherwise)}outputDefined(){return this.outputs.every(r=>r.outputDefined())&&this.otherwise.outputDefined()}}class ap{constructor(r,l,f){this.type=r,this.branches=l,this.otherwise=f}static parse(r,l){if(r.length<4)return l.error(`Expected at least 3 arguments, but found only ${r.length-1}.`);if(r.length%2!=0)return l.error("Expected an odd number of arguments.");let f;l.expectedType&&l.expectedType.kind!=="value"&&(f=l.expectedType);const m=[];for(let b=1;bl.outputDefined())&&this.otherwise.outputDefined()}}class kc{constructor(r,l,f,m){this.type=r,this.input=l,this.beginIndex=f,this.endIndex=m}static parse(r,l){if(r.length<=2||r.length>=5)return l.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`);const f=l.parse(r[1],1,We),m=l.parse(r[2],2,oe);if(!f||!m)return null;if(!_t(f.type,[H(We),Ye,We]))return l.error(`Expected first argument to be of type array or string, but found ${et(f.type)} instead`);if(r.length===4){const v=l.parse(r[3],3,oe);return v?new kc(f.type,f,m,v):null}return new kc(f.type,f,m)}evaluate(r){const l=this.input.evaluate(r),f=this.beginIndex.evaluate(r);if(!ht(l,["string","array"]))throw new si(`Expected first argument to be of type array or string, but found ${et(Gi(l))} instead.`);if(this.endIndex){const m=this.endIndex.evaluate(r);return l.slice(f,m)}return l.slice(f)}eachChild(r){r(this.input),r(this.beginIndex),this.endIndex&&r(this.endIndex)}outputDefined(){return!1}}function od(a,r){return a==="=="||a==="!="?r.kind==="boolean"||r.kind==="string"||r.kind==="number"||r.kind==="null"||r.kind==="value":r.kind==="string"||r.kind==="number"||r.kind==="value"}function sd(a,r,l,f){return f.compare(r,l)===0}function Fl(a,r,l){const f=a!=="=="&&a!=="!=";return class ex{constructor(v,b,S){this.type=He,this.lhs=v,this.rhs=b,this.collator=S,this.hasUntypedArgument=v.type.kind==="value"||b.type.kind==="value"}static parse(v,b){if(v.length!==3&&v.length!==4)return b.error("Expected two or three arguments.");const S=v[0];let C=b.parse(v[1],1,We);if(!C)return null;if(!od(S,C.type))return b.concat(1).error(`"${S}" comparisons are not supported for type '${et(C.type)}'.`);let P=b.parse(v[2],2,We);if(!P)return null;if(!od(S,P.type))return b.concat(2).error(`"${S}" comparisons are not supported for type '${et(P.type)}'.`);if(C.type.kind!==P.type.kind&&C.type.kind!=="value"&&P.type.kind!=="value")return b.error(`Cannot compare types '${et(C.type)}' and '${et(P.type)}'.`);f&&(C.type.kind==="value"&&P.type.kind!=="value"?C=new Eo(P.type,[C]):C.type.kind!=="value"&&P.type.kind==="value"&&(P=new Eo(C.type,[P])));let D=null;if(v.length===4){if(C.type.kind!=="string"&&P.type.kind!=="string"&&C.type.kind!=="value"&&P.type.kind!=="value")return b.error("Cannot use collator to compare non-string types.");if(D=b.parse(v[3],3,ea),!D)return null}return new ex(C,P,D)}evaluate(v){const b=this.lhs.evaluate(v),S=this.rhs.evaluate(v);if(f&&this.hasUntypedArgument){const C=Gi(b),P=Gi(S);if(C.kind!==P.kind||C.kind!=="string"&&C.kind!=="number")throw new si(`Expected arguments for "${a}" to be (string, string) or (number, number), but found (${C.kind}, ${P.kind}) instead.`)}if(this.collator&&!f&&this.hasUntypedArgument){const C=Gi(b),P=Gi(S);if(C.kind!=="string"||P.kind!=="string")return r(v,b,S)}return this.collator?l(v,b,S,this.collator.evaluate(v)):r(v,b,S)}eachChild(v){v(this.lhs),v(this.rhs),this.collator&&v(this.collator)}outputDefined(){return!0}}}const og=Fl("==",function(a,r,l){return r===l},sd),sg=Fl("!=",function(a,r,l){return r!==l},function(a,r,l,f){return!sd(0,r,l,f)}),ag=Fl("<",function(a,r,l){return r",function(a,r,l){return r>l},function(a,r,l,f){return f.compare(r,l)>0}),ug=Fl("<=",function(a,r,l){return r<=l},function(a,r,l,f){return f.compare(r,l)<=0}),cg=Fl(">=",function(a,r,l){return r>=l},function(a,r,l,f){return f.compare(r,l)>=0});class lp{constructor(r,l,f,m,v){this.type=Ye,this.number=r,this.locale=l,this.currency=f,this.minFractionDigits=m,this.maxFractionDigits=v}static parse(r,l){if(r.length!==3)return l.error("Expected two arguments.");const f=l.parse(r[1],1,oe);if(!f)return null;const m=r[2];if(typeof m!="object"||Array.isArray(m))return l.error("NumberFormat options argument must be an object.");let v=null;if(m.locale&&(v=l.parse(m.locale,1,Ye),!v))return null;let b=null;if(m.currency&&(b=l.parse(m.currency,1,Ye),!b))return null;let S=null;if(m["min-fraction-digits"]&&(S=l.parse(m["min-fraction-digits"],1,oe),!S))return null;let C=null;return m["max-fraction-digits"]&&(C=l.parse(m["max-fraction-digits"],1,oe),!C)?null:new lp(f,v,b,S,C)}evaluate(r){return new Intl.NumberFormat(this.locale?this.locale.evaluate(r):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(r):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(r):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(r):void 0}).format(this.number.evaluate(r))}eachChild(r){r(this.number),this.locale&&r(this.locale),this.currency&&r(this.currency),this.minFractionDigits&&r(this.minFractionDigits),this.maxFractionDigits&&r(this.maxFractionDigits)}outputDefined(){return!1}}class Dc{constructor(r){this.type=Ci,this.sections=r}static parse(r,l){if(r.length<2)return l.error("Expected at least one argument.");const f=r[1];if(!Array.isArray(f)&&typeof f=="object")return l.error("First argument must be an image or text section.");const m=[];let v=!1;for(let b=1;b<=r.length-1;++b){const S=r[b];if(v&&typeof S=="object"&&!Array.isArray(S)){v=!1;let C=null;if(S["font-scale"]&&(C=l.parse(S["font-scale"],1,oe),!C))return null;let P=null;if(S["text-font"]&&(P=l.parse(S["text-font"],1,H(Ye)),!P))return null;let D=null;if(S["text-color"]&&(D=l.parse(S["text-color"],1,xi),!D))return null;const R=m[m.length-1];R.scale=C,R.font=P,R.textColor=D}else{const C=l.parse(r[b],1,We);if(!C)return null;const P=C.type.kind;if(P!=="string"&&P!=="value"&&P!=="null"&&P!=="resolvedImage")return l.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");v=!0,m.push({content:C,scale:null,font:null,textColor:null})}}return new Dc(m)}evaluate(r){return new So(this.sections.map(l=>{const f=l.content.evaluate(r);return Gi(f)===F?new ip("",f,null,null,null):new ip(Su(f),null,l.scale?l.scale.evaluate(r):null,l.font?l.font.evaluate(r).join(","):null,l.textColor?l.textColor.evaluate(r):null)}))}eachChild(r){for(const l of this.sections)r(l.content),l.scale&&r(l.scale),l.font&&r(l.font),l.textColor&&r(l.textColor)}outputDefined(){return!1}}class up{constructor(r){this.type=F,this.input=r}static parse(r,l){if(r.length!==2)return l.error("Expected two arguments.");const f=l.parse(r[1],1,Ye);return f?new up(f):l.error("No image name provided.")}evaluate(r){const l=this.input.evaluate(r),f=Wo.fromString(l);return f&&r.availableImages&&(f.available=r.availableImages.indexOf(l)>-1),f}eachChild(r){r(this.input)}outputDefined(){return!1}}class cp{constructor(r){this.type=oe,this.input=r}static parse(r,l){if(r.length!==2)return l.error(`Expected 1 argument, but found ${r.length-1} instead.`);const f=l.parse(r[1],1);return f?f.type.kind!=="array"&&f.type.kind!=="string"&&f.type.kind!=="value"?l.error(`Expected argument of type string or array, but found ${et(f.type)} instead.`):new cp(f):null}evaluate(r){const l=this.input.evaluate(r);if(typeof l=="string"||Array.isArray(l))return l.length;throw new si(`Expected value to be of type string or array, but found ${et(Gi(l))} instead.`)}eachChild(r){r(this.input)}outputDefined(){return!1}}const Bl={"==":og,"!=":sg,">":lg,"<":ag,">=":cg,"<=":ug,array:Eo,at:rp,boolean:Eo,case:ap,coalesce:Mc,collator:Ol,format:Dc,image:up,in:op,"index-of":Ac,interpolate:Cr,"interpolate-hcl":Cr,"interpolate-lab":Cr,length:cp,let:Pc,literal:Ca,match:sp,number:Eo,"number-format":lp,object:Eo,slice:kc,step:Pu,string:Eo,"to-boolean":Ms,"to-color":Ms,"to-number":Ms,"to-string":Ms,var:Cc,within:nl};function ad(a,[r,l,f,m]){r=r.evaluate(a),l=l.evaluate(a),f=f.evaluate(a);const v=m?m.evaluate(a):1,b=zl(r,l,f,v);if(b)throw new si(b);return new Dn(r/255,l/255,f/255,v,!1)}function ld(a,r){return a in r}function hp(a,r){const l=r[a];return l===void 0?null:l}function rl(a){return{type:a}}function ud(a){return{result:"success",value:a}}function Vl(a){return{result:"error",value:a}}function Ul(a){return a["property-type"]==="data-driven"||a["property-type"]==="cross-faded-data-driven"}function cd(a){return!!a.expression&&a.expression.parameters.indexOf("zoom")>-1}function pp(a){return!!a.expression&&a.expression.interpolated}function bn(a){return a instanceof Number?"number":a instanceof String?"string":a instanceof Boolean?"boolean":Array.isArray(a)?"array":a===null?"null":typeof a}function Rc(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function hg(a){return a}function hd(a,r){const l=r.type==="color",f=a.stops&&typeof a.stops[0][0]=="object",m=f||!(f||a.property!==void 0),v=a.type||(pp(r)?"exponential":"interval");if(l||r.type==="padding"){const D=l?Dn.parse:oo.parse;(a=qo({},a)).stops&&(a.stops=a.stops.map(R=>[R[0],D(R[1])])),a.default=D(a.default?a.default:r.default)}if(a.colorSpace&&(b=a.colorSpace)!=="rgb"&&b!=="hcl"&&b!=="lab")throw new Error(`Unknown color space: "${a.colorSpace}"`);var b;let S,C,P;if(v==="exponential")S=gn;else if(v==="interval")S=pg;else if(v==="categorical"){S=Ti,C=Object.create(null);for(const D of a.stops)C[D[0]]=D[1];P=typeof a.stops[0][0]}else{if(v!=="identity")throw new Error(`Unknown function type "${v}"`);S=fp}if(f){const D={},R=[];for(let W=0;WW[0]),evaluate:({zoom:W},Q)=>gn({stops:B,base:a.base},r,W).evaluate(W,Q)}}if(m){const D=v==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:D,interpolationFactor:Cr.interpolationFactor.bind(void 0,D),zoomStops:a.stops.map(R=>R[0]),evaluate:({zoom:R})=>S(a,r,R,C,P)}}return{kind:"source",evaluate(D,R){const B=R&&R.properties?R.properties[a.property]:void 0;return B===void 0?Au(a.default,r.default):S(a,r,B,C,P)}}}function Au(a,r,l){return a!==void 0?a:r!==void 0?r:l!==void 0?l:void 0}function Ti(a,r,l,f,m){return Au(typeof l===m?f[l]:void 0,a.default,r.default)}function pg(a,r,l){if(bn(l)!=="number")return Au(a.default,r.default);const f=a.stops.length;if(f===1||l<=a.stops[0][0])return a.stops[0][1];if(l>=a.stops[f-1][0])return a.stops[f-1][1];const m=Mu(a.stops.map(v=>v[0]),l);return a.stops[m][1]}function gn(a,r,l){const f=a.base!==void 0?a.base:1;if(bn(l)!=="number")return Au(a.default,r.default);const m=a.stops.length;if(m===1||l<=a.stops[0][0])return a.stops[0][1];if(l>=a.stops[m-1][0])return a.stops[m-1][1];const v=Mu(a.stops.map(D=>D[0]),l),b=function(D,R,B,j){const W=j-B,Q=D-B;return W===0?0:R===1?Q/W:(Math.pow(R,Q)-1)/(Math.pow(R,W)-1)}(l,f,a.stops[v][0],a.stops[v+1][0]),S=a.stops[v][1],C=a.stops[v+1][1],P=qr[r.type]||hg;return typeof S.evaluate=="function"?{evaluate(...D){const R=S.evaluate.apply(void 0,D),B=C.evaluate.apply(void 0,D);if(R!==void 0&&B!==void 0)return P(R,B,b,a.colorSpace)}}:P(S,C,b,a.colorSpace)}function fp(a,r,l){switch(r.type){case"color":l=Dn.parse(l);break;case"formatted":l=So.fromString(l.toString());break;case"resolvedImage":l=Wo.fromString(l.toString());break;case"padding":l=oo.parse(l);break;default:bn(l)===r.type||r.type==="enum"&&r.values[l]||(l=void 0)}return Au(l,a.default,r.default)}Io.register(Bl,{error:[{kind:"error"},[Ye],(a,[r])=>{throw new si(r.evaluate(a))}],typeof:[Ye,[We],(a,[r])=>et(Gi(r.evaluate(a)))],"to-rgba":[H(oe,4),[xi],(a,[r])=>{const[l,f,m,v]=r.evaluate(a).rgb;return[255*l,255*f,255*m,v]}],rgb:[xi,[oe,oe,oe],ad],rgba:[xi,[oe,oe,oe,oe],ad],has:{type:He,overloads:[[[Ye],(a,[r])=>ld(r.evaluate(a),a.properties())],[[Ye,jo],(a,[r,l])=>ld(r.evaluate(a),l.evaluate(a))]]},get:{type:We,overloads:[[[Ye],(a,[r])=>hp(r.evaluate(a),a.properties())],[[Ye,jo],(a,[r,l])=>hp(r.evaluate(a),l.evaluate(a))]]},"feature-state":[We,[Ye],(a,[r])=>hp(r.evaluate(a),a.featureState||{})],properties:[jo,[],a=>a.properties()],"geometry-type":[Ye,[],a=>a.geometryType()],id:[We,[],a=>a.id()],zoom:[oe,[],a=>a.globals.zoom],"heatmap-density":[oe,[],a=>a.globals.heatmapDensity||0],"line-progress":[oe,[],a=>a.globals.lineProgress||0],accumulated:[We,[],a=>a.globals.accumulated===void 0?null:a.globals.accumulated],"+":[oe,rl(oe),(a,r)=>{let l=0;for(const f of r)l+=f.evaluate(a);return l}],"*":[oe,rl(oe),(a,r)=>{let l=1;for(const f of r)l*=f.evaluate(a);return l}],"-":{type:oe,overloads:[[[oe,oe],(a,[r,l])=>r.evaluate(a)-l.evaluate(a)],[[oe],(a,[r])=>-r.evaluate(a)]]},"/":[oe,[oe,oe],(a,[r,l])=>r.evaluate(a)/l.evaluate(a)],"%":[oe,[oe,oe],(a,[r,l])=>r.evaluate(a)%l.evaluate(a)],ln2:[oe,[],()=>Math.LN2],pi:[oe,[],()=>Math.PI],e:[oe,[],()=>Math.E],"^":[oe,[oe,oe],(a,[r,l])=>Math.pow(r.evaluate(a),l.evaluate(a))],sqrt:[oe,[oe],(a,[r])=>Math.sqrt(r.evaluate(a))],log10:[oe,[oe],(a,[r])=>Math.log(r.evaluate(a))/Math.LN10],ln:[oe,[oe],(a,[r])=>Math.log(r.evaluate(a))],log2:[oe,[oe],(a,[r])=>Math.log(r.evaluate(a))/Math.LN2],sin:[oe,[oe],(a,[r])=>Math.sin(r.evaluate(a))],cos:[oe,[oe],(a,[r])=>Math.cos(r.evaluate(a))],tan:[oe,[oe],(a,[r])=>Math.tan(r.evaluate(a))],asin:[oe,[oe],(a,[r])=>Math.asin(r.evaluate(a))],acos:[oe,[oe],(a,[r])=>Math.acos(r.evaluate(a))],atan:[oe,[oe],(a,[r])=>Math.atan(r.evaluate(a))],min:[oe,rl(oe),(a,r)=>Math.min(...r.map(l=>l.evaluate(a)))],max:[oe,rl(oe),(a,r)=>Math.max(...r.map(l=>l.evaluate(a)))],abs:[oe,[oe],(a,[r])=>Math.abs(r.evaluate(a))],round:[oe,[oe],(a,[r])=>{const l=r.evaluate(a);return l<0?-Math.round(-l):Math.round(l)}],floor:[oe,[oe],(a,[r])=>Math.floor(r.evaluate(a))],ceil:[oe,[oe],(a,[r])=>Math.ceil(r.evaluate(a))],"filter-==":[He,[Ye,We],(a,[r,l])=>a.properties()[r.value]===l.value],"filter-id-==":[He,[We],(a,[r])=>a.id()===r.value],"filter-type-==":[He,[Ye],(a,[r])=>a.geometryType()===r.value],"filter-<":[He,[Ye,We],(a,[r,l])=>{const f=a.properties()[r.value],m=l.value;return typeof f==typeof m&&f{const l=a.id(),f=r.value;return typeof l==typeof f&&l":[He,[Ye,We],(a,[r,l])=>{const f=a.properties()[r.value],m=l.value;return typeof f==typeof m&&f>m}],"filter-id->":[He,[We],(a,[r])=>{const l=a.id(),f=r.value;return typeof l==typeof f&&l>f}],"filter-<=":[He,[Ye,We],(a,[r,l])=>{const f=a.properties()[r.value],m=l.value;return typeof f==typeof m&&f<=m}],"filter-id-<=":[He,[We],(a,[r])=>{const l=a.id(),f=r.value;return typeof l==typeof f&&l<=f}],"filter->=":[He,[Ye,We],(a,[r,l])=>{const f=a.properties()[r.value],m=l.value;return typeof f==typeof m&&f>=m}],"filter-id->=":[He,[We],(a,[r])=>{const l=a.id(),f=r.value;return typeof l==typeof f&&l>=f}],"filter-has":[He,[We],(a,[r])=>r.value in a.properties()],"filter-has-id":[He,[],a=>a.id()!==null&&a.id()!==void 0],"filter-type-in":[He,[H(Ye)],(a,[r])=>r.value.indexOf(a.geometryType())>=0],"filter-id-in":[He,[H(We)],(a,[r])=>r.value.indexOf(a.id())>=0],"filter-in-small":[He,[Ye,H(We)],(a,[r,l])=>l.value.indexOf(a.properties()[r.value])>=0],"filter-in-large":[He,[Ye,H(We)],(a,[r,l])=>function(f,m,v,b){for(;v<=b;){const S=v+b>>1;if(m[S]===f)return!0;m[S]>f?b=S-1:v=S+1}return!1}(a.properties()[r.value],l.value,0,l.value.length-1)],all:{type:He,overloads:[[[He,He],(a,[r,l])=>r.evaluate(a)&&l.evaluate(a)],[rl(He),(a,r)=>{for(const l of r)if(!l.evaluate(a))return!1;return!0}]]},any:{type:He,overloads:[[[He,He],(a,[r,l])=>r.evaluate(a)||l.evaluate(a)],[rl(He),(a,r)=>{for(const l of r)if(l.evaluate(a))return!0;return!1}]]},"!":[He,[He],(a,[r])=>!r.evaluate(a)],"is-supported-script":[He,[Ye],(a,[r])=>{const l=a.globals&&a.globals.isSupportedScript;return!l||l(r.evaluate(a))}],upcase:[Ye,[Ye],(a,[r])=>r.evaluate(a).toUpperCase()],downcase:[Ye,[Ye],(a,[r])=>r.evaluate(a).toLowerCase()],concat:[Ye,rl(We),(a,r)=>r.map(l=>Su(l.evaluate(a))).join("")],"resolved-locale":[Ye,[ea],(a,[r])=>r.evaluate(a).resolvedLocale()]});class Wn{constructor(r,l){var f;this.expression=r,this._warningHistory={},this._evaluator=new Rn,this._defaultValue=l?(f=l).type==="color"&&Rc(f.default)?new Dn(0,0,0,0):f.type==="color"?Dn.parse(f.default)||null:f.type==="padding"?oo.parse(f.default)||null:f.type==="variableAnchorOffsetCollection"?Zo.parse(f.default)||null:f.default===void 0?null:f.default:null,this._enumValues=l&&l.type==="enum"?l.values:null}evaluateWithoutErrorHandling(r,l,f,m,v,b){return this._evaluator.globals=r,this._evaluator.feature=l,this._evaluator.featureState=f,this._evaluator.canonical=m,this._evaluator.availableImages=v||null,this._evaluator.formattedSection=b,this.expression.evaluate(this._evaluator)}evaluate(r,l,f,m,v,b){this._evaluator.globals=r,this._evaluator.feature=l||null,this._evaluator.featureState=f||null,this._evaluator.canonical=m,this._evaluator.availableImages=v||null,this._evaluator.formattedSection=b||null;try{const S=this.expression.evaluate(this._evaluator);if(S==null||typeof S=="number"&&S!=S)return this._defaultValue;if(this._enumValues&&!(S in this._enumValues))throw new si(`Expected value to be one of ${Object.keys(this._enumValues).map(C=>JSON.stringify(C)).join(", ")}, but found ${JSON.stringify(S)} instead.`);return S}catch(S){return this._warningHistory[S.message]||(this._warningHistory[S.message]=!0,typeof console<"u"&&console.warn(S.message)),this._defaultValue}}}function qn(a){return Array.isArray(a)&&a.length>0&&typeof a[0]=="string"&&a[0]in Bl}function ol(a,r){const l=new bc(Bl,Cu,[],r?function(m){const v={color:xi,string:Ye,number:oe,enum:Ye,boolean:He,formatted:Ci,padding:ot,resolvedImage:F,variableAnchorOffsetCollection:q};return m.type==="array"?H(v[m.value]||We,m.length):v[m.type]}(r):void 0),f=l.parse(a,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return f?ud(new Wn(f,r)):Vl(l.errors)}class Nc{constructor(r,l){this.kind=r,this._styleExpression=l,this.isStateDependent=r!=="constant"&&!Tu(l.expression)}evaluateWithoutErrorHandling(r,l,f,m,v,b){return this._styleExpression.evaluateWithoutErrorHandling(r,l,f,m,v,b)}evaluate(r,l,f,m,v,b){return this._styleExpression.evaluate(r,l,f,m,v,b)}}class dp{constructor(r,l,f,m){this.kind=r,this.zoomStops=f,this._styleExpression=l,this.isStateDependent=r!=="camera"&&!Tu(l.expression),this.interpolationType=m}evaluateWithoutErrorHandling(r,l,f,m,v,b){return this._styleExpression.evaluateWithoutErrorHandling(r,l,f,m,v,b)}evaluate(r,l,f,m,v,b){return this._styleExpression.evaluate(r,l,f,m,v,b)}interpolationFactor(r,l,f){return this.interpolationType?Cr.interpolationFactor(this.interpolationType,r,l,f):0}}function pd(a,r){const l=ol(a,r);if(l.result==="error")return l;const f=l.value.expression,m=Tc(f);if(!m&&!Ul(r))return Vl([new Ur("","data expressions not supported")]);const v=Lu(f,["zoom"]);if(!v&&!cd(r))return Vl([new Ur("","zoom expressions not supported")]);const b=Oc(f);return b||v?b instanceof Ur?Vl([b]):b instanceof Cr&&!pp(r)?Vl([new Ur("",'"interpolate" expressions cannot be used with this property')]):ud(b?new dp(m?"camera":"composite",l.value,b.labels,b instanceof Cr?b.interpolation:void 0):new Nc(m?"constant":"source",l.value)):Vl([new Ur("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class zc{constructor(r,l){this._parameters=r,this._specification=l,qo(this,hd(this._parameters,this._specification))}static deserialize(r){return new zc(r._parameters,r._specification)}static serialize(r){return{_parameters:r._parameters,_specification:r._specification}}}function Oc(a){let r=null;if(a instanceof Pc)r=Oc(a.result);else if(a instanceof Mc){for(const l of a.args)if(r=Oc(l),r)break}else(a instanceof Pu||a instanceof Cr)&&a.input instanceof Io&&a.input.name==="zoom"&&(r=a);return r instanceof Ur||a.eachChild(l=>{const f=Oc(l);f instanceof Ur?r=f:!r&&f?r=new Ur("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&f&&r!==f&&(r=new Ur("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}function Fc(a){if(a===!0||a===!1)return!0;if(!Array.isArray(a)||a.length===0)return!1;switch(a[0]){case"has":return a.length>=2&&a[1]!=="$id"&&a[1]!=="$type";case"in":return a.length>=3&&(typeof a[1]!="string"||Array.isArray(a[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return a.length!==3||Array.isArray(a[1])||Array.isArray(a[2]);case"any":case"all":for(const r of a.slice(1))if(!Fc(r)&&typeof r!="boolean")return!1;return!0;default:return!0}}const fd={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Bc(a){if(a==null)return{filter:()=>!0,needGeometry:!1};Fc(a)||(a=Uc(a));const r=ol(a,fd);if(r.result==="error")throw new Error(r.value.map(l=>`${l.key}: ${l.message}`).join(", "));return{filter:(l,f,m)=>r.value.evaluate(l,f,{},m),needGeometry:Vc(a)}}function dd(a,r){return ar?1:0}function Vc(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(let r=1;r"||r==="<="||r===">="?mp(a[1],a[2],r):r==="any"?(l=a.slice(1),["any"].concat(l.map(Uc))):r==="all"?["all"].concat(a.slice(1).map(Uc)):r==="none"?["all"].concat(a.slice(1).map(Uc).map(Gc)):r==="in"?md(a[1],a.slice(2)):r==="!in"?Gc(md(a[1],a.slice(2))):r==="has"?gd(a[1]):r==="!has"?Gc(gd(a[1])):r!=="within"||a;var l}function mp(a,r,l){switch(a){case"$type":return[`filter-type-${l}`,r];case"$id":return[`filter-id-${l}`,r];default:return[`filter-${l}`,a,r]}}function md(a,r){if(r.length===0)return!1;switch(a){case"$type":return["filter-type-in",["literal",r]];case"$id":return["filter-id-in",["literal",r]];default:return r.length>200&&!r.some(l=>typeof l!=typeof r[0])?["filter-in-large",a,["literal",r.sort(dd)]]:["filter-in-small",a,["literal",r]]}}function gd(a){switch(a){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",a]}}function Gc(a){return["!",a]}function gp(a){const r=typeof a;if(r==="number"||r==="boolean"||r==="string"||a==null)return JSON.stringify(a);if(Array.isArray(a)){let m="[";for(const v of a)m+=`${gp(v)},`;return`${m}]`}const l=Object.keys(a).sort();let f="{";for(let m=0;mf.maximum?[new $t(r,l,`${l} is greater than the maximum value ${f.maximum}`)]:[]}function yd(a){const r=a.valueSpec,l=hi(a.value.type);let f,m,v,b={};const S=l!=="categorical"&&a.value.property===void 0,C=!S,P=bn(a.value.stops)==="array"&&bn(a.value.stops[0])==="array"&&bn(a.value.stops[0][0])==="object",D=jr({key:a.key,value:a.value,valueSpec:a.styleSpec.function,validateSpec:a.validateSpec,style:a.style,styleSpec:a.styleSpec,objectElementValidators:{stops:function(j){if(l==="identity")return[new $t(j.key,j.value,'identity function may not have a "stops" property')];let W=[];const Q=j.value;return W=W.concat(_p({key:j.key,value:Q,valueSpec:j.valueSpec,validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec,arrayElementValidator:R})),bn(Q)==="array"&&Q.length===0&&W.push(new $t(j.key,Q,"array must have at least one stop")),W},default:function(j){return j.validateSpec({key:j.key,value:j.value,valueSpec:r,validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec})}}});return l==="identity"&&S&&D.push(new $t(a.key,a.value,'missing required property "property"')),l==="identity"||a.value.stops||D.push(new $t(a.key,a.value,'missing required property "stops"')),l==="exponential"&&a.valueSpec.expression&&!pp(a.valueSpec)&&D.push(new $t(a.key,a.value,"exponential functions not supported")),a.styleSpec.$version>=8&&(C&&!Ul(a.valueSpec)?D.push(new $t(a.key,a.value,"property functions not supported")):S&&!cd(a.valueSpec)&&D.push(new $t(a.key,a.value,"zoom functions not supported"))),l!=="categorical"&&!P||a.value.property!==void 0||D.push(new $t(a.key,a.value,'"property" property is required')),D;function R(j){let W=[];const Q=j.value,rt=j.key;if(bn(Q)!=="array")return[new $t(rt,Q,`array expected, ${bn(Q)} found`)];if(Q.length!==2)return[new $t(rt,Q,`array length 2 expected, length ${Q.length} found`)];if(P){if(bn(Q[0])!=="object")return[new $t(rt,Q,`object expected, ${bn(Q[0])} found`)];if(Q[0].zoom===void 0)return[new $t(rt,Q,"object stop key must have zoom")];if(Q[0].value===void 0)return[new $t(rt,Q,"object stop key must have value")];if(v&&v>hi(Q[0].zoom))return[new $t(rt,Q[0].zoom,"stop zoom values must appear in ascending order")];hi(Q[0].zoom)!==v&&(v=hi(Q[0].zoom),m=void 0,b={}),W=W.concat(jr({key:`${rt}[0]`,value:Q[0],valueSpec:{zoom:{}},validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{zoom:qc,value:B}}))}else W=W.concat(B({key:`${rt}[0]`,value:Q[0],valueSpec:{},validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec},Q));return qn(La(Q[1]))?W.concat([new $t(`${rt}[1]`,Q[1],"expressions are not allowed in function stops.")]):W.concat(j.validateSpec({key:`${rt}[1]`,value:Q[1],valueSpec:r,validateSpec:j.validateSpec,style:j.style,styleSpec:j.styleSpec}))}function B(j,W){const Q=bn(j.value),rt=hi(j.value),ct=j.value!==null?j.value:W;if(f){if(Q!==f)return[new $t(j.key,ct,`${Q} stop domain type must match previous stop domain type ${f}`)]}else f=Q;if(Q!=="number"&&Q!=="string"&&Q!=="boolean")return[new $t(j.key,ct,"stop domain value must be a number, string, or boolean")];if(Q!=="number"&&l!=="categorical"){let Et=`number expected, ${Q} found`;return Ul(r)&&l===void 0&&(Et+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new $t(j.key,ct,Et)]}return l!=="categorical"||Q!=="number"||isFinite(rt)&&Math.floor(rt)===rt?l!=="categorical"&&Q==="number"&&m!==void 0&&rtnew $t(`${a.key}${f.key}`,a.value,f.message));const l=r.value.expression||r.value._styleExpression.expression;if(a.expressionContext==="property"&&a.propertyKey==="text-font"&&!l.outputDefined())return[new $t(a.key,a.value,`Invalid data expression for "${a.propertyKey}". Output values must be contained as literals within the expression.`)];if(a.expressionContext==="property"&&a.propertyType==="layout"&&!Tu(l))return[new $t(a.key,a.value,'"feature-state" data expressions are not supported with layout properties.')];if(a.expressionContext==="filter"&&!Tu(l))return[new $t(a.key,a.value,'"feature-state" data expressions are not supported with filters.')];if(a.expressionContext&&a.expressionContext.indexOf("cluster")===0){if(!Lu(l,["zoom","feature-state"]))return[new $t(a.key,a.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(a.expressionContext==="cluster-initial"&&!Tc(l))return[new $t(a.key,a.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Pa(a){const r=a.key,l=a.value,f=a.valueSpec,m=[];return Array.isArray(f.values)?f.values.indexOf(hi(l))===-1&&m.push(new $t(r,l,`expected one of [${f.values.join(", ")}], ${JSON.stringify(l)} found`)):Object.keys(f.values).indexOf(hi(l))===-1&&m.push(new $t(r,l,`expected one of [${Object.keys(f.values).join(", ")}], ${JSON.stringify(l)} found`)),m}function Gl(a){return Fc(La(a.value))?Ma(qo({},a,{expressionContext:"filter",valueSpec:{value:"boolean"}})):jc(a)}function jc(a){const r=a.value,l=a.key;if(bn(r)!=="array")return[new $t(l,r,`array expected, ${bn(r)} found`)];const f=a.styleSpec;let m,v=[];if(r.length<1)return[new $t(l,r,"filter array must have at least 1 element")];switch(v=v.concat(Pa({key:`${l}[0]`,value:r[0],valueSpec:f.filter_operator,style:a.style,styleSpec:a.styleSpec})),hi(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&hi(r[1])==="$type"&&v.push(new $t(l,r,`"$type" cannot be use with operator "${r[0]}"`));case"==":case"!=":r.length!==3&&v.push(new $t(l,r,`filter array for operator "${r[0]}" must have 3 elements`));case"in":case"!in":r.length>=2&&(m=bn(r[1]),m!=="string"&&v.push(new $t(`${l}[1]`,r[1],`string expected, ${m} found`)));for(let b=2;b{P in l&&r.push(new $t(f,l[P],`"${P}" is prohibited for ref layers`))}),m.layers.forEach(P=>{hi(P.id)===S&&(C=P)}),C?C.ref?r.push(new $t(f,l.ref,"ref cannot reference another ref layer")):b=hi(C.type):r.push(new $t(f,l.ref,`ref layer "${S}" not found`))}else if(b!=="background")if(l.source){const C=m.sources&&m.sources[l.source],P=C&&hi(C.type);C?P==="vector"&&b==="raster"?r.push(new $t(f,l.source,`layer "${l.id}" requires a raster source`)):P!=="raster-dem"&&b==="hillshade"?r.push(new $t(f,l.source,`layer "${l.id}" requires a raster-dem source`)):P==="raster"&&b!=="raster"?r.push(new $t(f,l.source,`layer "${l.id}" requires a vector source`)):P!=="vector"||l["source-layer"]?P==="raster-dem"&&b!=="hillshade"?r.push(new $t(f,l.source,"raster-dem source can only be used with layer type 'hillshade'.")):b!=="line"||!l.paint||!l.paint["line-gradient"]||P==="geojson"&&C.lineMetrics||r.push(new $t(f,l,`layer "${l.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):r.push(new $t(f,l,`layer "${l.id}" must specify a "source-layer"`)):r.push(new $t(f,l.source,`source "${l.source}" not found`))}else r.push(new $t(f,l,'missing required property "source"'));return r=r.concat(jr({key:f,value:l,valueSpec:v.layer,style:a.style,styleSpec:a.styleSpec,validateSpec:a.validateSpec,objectElementValidators:{"*":()=>[],type:()=>a.validateSpec({key:`${f}.type`,value:l.type,valueSpec:v.layer.type,style:a.style,styleSpec:a.styleSpec,validateSpec:a.validateSpec,object:l,objectKey:"type"}),filter:Gl,layout:C=>jr({layer:l,key:C.key,value:C.value,style:C.style,styleSpec:C.styleSpec,validateSpec:C.validateSpec,objectElementValidators:{"*":P=>ku(qo({layerType:b},P))}}),paint:C=>jr({layer:l,key:C.key,value:C.value,style:C.style,styleSpec:C.styleSpec,validateSpec:C.validateSpec,objectElementValidators:{"*":P=>vp(qo({layerType:b},P))}})}})),r}function sl(a){const r=a.value,l=a.key,f=bn(r);return f!=="string"?[new $t(l,r,`string expected, ${f} found`)]:[]}const xd={promoteId:function({key:a,value:r}){if(bn(r)==="string")return sl({key:a,value:r});{const l=[];for(const f in r)l.push(...sl({key:`${a}.${f}`,value:r[f]}));return l}}};function bd(a){const r=a.value,l=a.key,f=a.styleSpec,m=a.style,v=a.validateSpec;if(!r.type)return[new $t(l,r,'"type" is required')];const b=hi(r.type);let S;switch(b){case"vector":case"raster":return S=jr({key:l,value:r,valueSpec:f[`source_${b.replace("-","_")}`],style:a.style,styleSpec:f,objectElementValidators:xd,validateSpec:v}),S;case"raster-dem":return S=function(C){var P;const D=(P=C.sourceName)!==null&&P!==void 0?P:"",R=C.value,B=C.styleSpec,j=B.source_raster_dem,W=C.style;let Q=[];const rt=bn(R);if(R===void 0)return Q;if(rt!=="object")return Q.push(new $t("source_raster_dem",R,`object expected, ${rt} found`)),Q;const ct=hi(R.encoding)==="custom",Et=["redFactor","greenFactor","blueFactor","baseShift"],ft=C.value.encoding?`"${C.value.encoding}"`:"Default";for(const xt in R)!ct&&Et.includes(xt)?Q.push(new $t(xt,R[xt],`In "${D}": "${xt}" is only valid when "encoding" is set to "custom". ${ft} encoding found`)):j[xt]?Q=Q.concat(C.validateSpec({key:xt,value:R[xt],valueSpec:j[xt],validateSpec:C.validateSpec,style:W,styleSpec:B})):Q.push(new $t(xt,R[xt],`unknown property "${xt}"`));return Q}({sourceName:l,value:r,style:a.style,styleSpec:f,validateSpec:v}),S;case"geojson":if(S=jr({key:l,value:r,valueSpec:f.source_geojson,style:m,styleSpec:f,validateSpec:v,objectElementValidators:xd}),r.cluster)for(const C in r.clusterProperties){const[P,D]=r.clusterProperties[C],R=typeof P=="string"?[P,["accumulated"],["get",C]]:P;S.push(...Ma({key:`${l}.${C}.map`,value:D,validateSpec:v,expressionContext:"cluster-map"})),S.push(...Ma({key:`${l}.${C}.reduce`,value:R,validateSpec:v,expressionContext:"cluster-reduce"}))}return S;case"video":return jr({key:l,value:r,valueSpec:f.source_video,style:m,validateSpec:v,styleSpec:f});case"image":return jr({key:l,value:r,valueSpec:f.source_image,style:m,validateSpec:v,styleSpec:f});case"canvas":return[new $t(l,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Pa({key:`${l}.type`,value:r.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:m,validateSpec:v,styleSpec:f})}}function wd(a){const r=a.value,l=a.styleSpec,f=l.light,m=a.style;let v=[];const b=bn(r);if(r===void 0)return v;if(b!=="object")return v=v.concat([new $t("light",r,`object expected, ${b} found`)]),v;for(const S in r){const C=S.match(/^(.*)-transition$/);v=v.concat(C&&f[C[1]]&&f[C[1]].transition?a.validateSpec({key:S,value:r[S],valueSpec:l.transition,validateSpec:a.validateSpec,style:m,styleSpec:l}):f[S]?a.validateSpec({key:S,value:r[S],valueSpec:f[S],validateSpec:a.validateSpec,style:m,styleSpec:l}):[new $t(S,r[S],`unknown property "${S}"`)])}return v}function Du(a){const r=a.value,l=a.styleSpec,f=l.sky,m=a.style,v=bn(r);if(r===void 0)return[];if(v!=="object")return[new $t("sky",r,`object expected, ${v} found`)];let b=[];for(const S in r)b=b.concat(f[S]?al({key:S,value:r[S],valueSpec:f[S],style:m,styleSpec:l}):[new $t(S,r[S],`unknown property "${S}"`)]);return b}function Ru(a){const r=a.value,l=a.styleSpec,f=l.terrain,m=a.style;let v=[];const b=bn(r);if(r===void 0)return v;if(b!=="object")return v=v.concat([new $t("terrain",r,`object expected, ${b} found`)]),v;for(const S in r)v=v.concat(f[S]?a.validateSpec({key:S,value:r[S],valueSpec:f[S],validateSpec:a.validateSpec,style:m,styleSpec:l}):[new $t(S,r[S],`unknown property "${S}"`)]);return v}function so(a){let r=[];const l=a.value,f=a.key;if(Array.isArray(l)){const m=[],v=[];for(const b in l)l[b].id&&m.includes(l[b].id)&&r.push(new $t(f,l,`all the sprites' ids must be unique, but ${l[b].id} is duplicated`)),m.push(l[b].id),l[b].url&&v.includes(l[b].url)&&r.push(new $t(f,l,`all the sprites' URLs must be unique, but ${l[b].url} is duplicated`)),v.push(l[b].url),r=r.concat(jr({key:`${f}[${b}]`,value:l[b],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:a.validateSpec}));return r}return sl({key:f,value:l})}const ql={"*":()=>[],array:_p,boolean:function(a){const r=a.value,l=a.key,f=bn(r);return f!=="boolean"?[new $t(l,r,`boolean expected, ${f} found`)]:[]},number:qc,color:function(a){const r=a.key,l=a.value,f=bn(l);return f!=="string"?[new $t(r,l,`color expected, ${f} found`)]:Dn.parse(String(l))?[]:[new $t(r,l,`color expected, "${l}" found`)]},constants:_d,enum:Pa,filter:Gl,function:yd,layer:vd,object:jr,source:bd,light:wd,sky:Du,terrain:Ru,string:sl,formatted:function(a){return sl(a).length===0?[]:Ma(a)},resolvedImage:function(a){return sl(a).length===0?[]:Ma(a)},padding:function(a){const r=a.key,l=a.value;if(bn(l)==="array"){if(l.length<1||l.length>4)return[new $t(r,l,`padding requires 1 to 4 values; ${l.length} values found`)];const f={type:"number"};let m=[];for(let v=0;v[]}})),a.constants&&(l=l.concat(_d({key:"constants",value:a.constants,style:a,styleSpec:r,validateSpec:al}))),xp(l)}function ao(a){return function(r){return a({...r,validateSpec:al})}}function xp(a){return[].concat(a).sort((r,l)=>r.line-l.line)}function Ho(a){return function(...r){return xp(a.apply(this,r))}}ls.source=Ho(ao(bd)),ls.sprite=Ho(ao(so)),ls.glyphs=Ho(ao(Sd)),ls.light=Ho(ao(wd)),ls.sky=Ho(ao(Du)),ls.terrain=Ho(ao(Ru)),ls.layer=Ho(ao(vd)),ls.filter=Ho(ao(Gl)),ls.paintProperty=Ho(ao(vp)),ls.layoutProperty=Ho(ao(ku));const Nu=ls,bp=Nu.light,dg=Nu.paintProperty,zu=Nu.layoutProperty;function Ed(a,r){let l=!1;if(r&&r.length)for(const f of r)a.fire(new be(new Error(f.message))),l=!0;return l}class ll{constructor(r,l,f){const m=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;const b=new Int32Array(this.arrayBuffer);r=b[0],this.d=(l=b[1])+2*(f=b[2]);for(let C=0;C=R[W+0]&&m>=R[W+1])?(S[j]=!0,b.push(D[j])):S[j]=!1}}}}_forEachCell(r,l,f,m,v,b,S,C){const P=this._convertToCellCoord(r),D=this._convertToCellCoord(l),R=this._convertToCellCoord(f),B=this._convertToCellCoord(m);for(let j=P;j<=R;j++)for(let W=D;W<=B;W++){const Q=this.d*W+j;if((!C||C(this._convertFromCellCoord(j),this._convertFromCellCoord(W),this._convertFromCellCoord(j+1),this._convertFromCellCoord(W+1)))&&v.call(this,r,l,f,m,Q,b,S,C))return}}_convertFromCellCoord(r){return(r-this.padding)/this.scale}_convertToCellCoord(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const r=this.cells,l=3+this.cells.length+1+1;let f=0;for(let b=0;b=0)continue;const b=a[v];m[v]=na[f].shallow.indexOf(v)>=0?b:jl(b,r)}a instanceof Error&&(m.message=a.message)}if(m.$name)throw new Error("$name property is reserved for worker serialization logic.");return f!=="Object"&&(m.$name=f),m}throw new Error("can't serialize object of type "+typeof a)}function Ou(a){if(a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="string"||a instanceof Boolean||a instanceof Number||a instanceof String||a instanceof Date||a instanceof RegExp||a instanceof Blob||a instanceof Error||wp(a)||Ne(a)||ArrayBuffer.isView(a)||a instanceof ImageData)return a;if(Array.isArray(a))return a.map(Ou);if(typeof a=="object"){const r=a.$name||"Object";if(!na[r])throw new Error(`can't deserialize unregistered class ${r}`);const{klass:l}=na[r];if(!l)throw new Error(`can't deserialize unregistered class ${r}`);if(l.deserialize)return l.deserialize(a);const f=Object.create(l.prototype);for(const m of Object.keys(a)){if(m==="$name")continue;const v=a[m];f[m]=na[r].shallow.indexOf(m)>=0?v:Ou(v)}return f}throw new Error("can't deserialize object of type "+typeof a)}class Zc{constructor(){this.first=!0}update(r,l){const f=Math.floor(r);return this.first?(this.first=!1,this.lastIntegerZoom=f,this.lastIntegerZoomTime=0,this.lastZoom=r,this.lastFloorZoom=f,!0):(this.lastFloorZoom>f?(this.lastIntegerZoom=f+1,this.lastIntegerZoomTime=l):this.lastFloorZooma>=128&&a<=255,Arabic:a=>a>=1536&&a<=1791,"Arabic Supplement":a=>a>=1872&&a<=1919,"Arabic Extended-A":a=>a>=2208&&a<=2303,"Hangul Jamo":a=>a>=4352&&a<=4607,"Unified Canadian Aboriginal Syllabics":a=>a>=5120&&a<=5759,Khmer:a=>a>=6016&&a<=6143,"Unified Canadian Aboriginal Syllabics Extended":a=>a>=6320&&a<=6399,"General Punctuation":a=>a>=8192&&a<=8303,"Letterlike Symbols":a=>a>=8448&&a<=8527,"Number Forms":a=>a>=8528&&a<=8591,"Miscellaneous Technical":a=>a>=8960&&a<=9215,"Control Pictures":a=>a>=9216&&a<=9279,"Optical Character Recognition":a=>a>=9280&&a<=9311,"Enclosed Alphanumerics":a=>a>=9312&&a<=9471,"Geometric Shapes":a=>a>=9632&&a<=9727,"Miscellaneous Symbols":a=>a>=9728&&a<=9983,"Miscellaneous Symbols and Arrows":a=>a>=11008&&a<=11263,"CJK Radicals Supplement":a=>a>=11904&&a<=12031,"Kangxi Radicals":a=>a>=12032&&a<=12255,"Ideographic Description Characters":a=>a>=12272&&a<=12287,"CJK Symbols and Punctuation":a=>a>=12288&&a<=12351,Hiragana:a=>a>=12352&&a<=12447,Katakana:a=>a>=12448&&a<=12543,Bopomofo:a=>a>=12544&&a<=12591,"Hangul Compatibility Jamo":a=>a>=12592&&a<=12687,Kanbun:a=>a>=12688&&a<=12703,"Bopomofo Extended":a=>a>=12704&&a<=12735,"CJK Strokes":a=>a>=12736&&a<=12783,"Katakana Phonetic Extensions":a=>a>=12784&&a<=12799,"Enclosed CJK Letters and Months":a=>a>=12800&&a<=13055,"CJK Compatibility":a=>a>=13056&&a<=13311,"CJK Unified Ideographs Extension A":a=>a>=13312&&a<=19903,"Yijing Hexagram Symbols":a=>a>=19904&&a<=19967,"CJK Unified Ideographs":a=>a>=19968&&a<=40959,"Yi Syllables":a=>a>=40960&&a<=42127,"Yi Radicals":a=>a>=42128&&a<=42191,"Hangul Jamo Extended-A":a=>a>=43360&&a<=43391,"Hangul Syllables":a=>a>=44032&&a<=55215,"Hangul Jamo Extended-B":a=>a>=55216&&a<=55295,"Private Use Area":a=>a>=57344&&a<=63743,"CJK Compatibility Ideographs":a=>a>=63744&&a<=64255,"Arabic Presentation Forms-A":a=>a>=64336&&a<=65023,"Vertical Forms":a=>a>=65040&&a<=65055,"CJK Compatibility Forms":a=>a>=65072&&a<=65103,"Small Form Variants":a=>a>=65104&&a<=65135,"Arabic Presentation Forms-B":a=>a>=65136&&a<=65279,"Halfwidth and Fullwidth Forms":a=>a>=65280&&a<=65519};function Wc(a){for(const r of a)if(Hc(r.charCodeAt(0)))return!0;return!1}function Id(a){for(const r of a)if(!Cd(r.charCodeAt(0)))return!1;return!0}function Cd(a){return!(pe.Arabic(a)||pe["Arabic Supplement"](a)||pe["Arabic Extended-A"](a)||pe["Arabic Presentation Forms-A"](a)||pe["Arabic Presentation Forms-B"](a))}function Hc(a){return!(a!==746&&a!==747&&(a<4352||!(pe["Bopomofo Extended"](a)||pe.Bopomofo(a)||pe["CJK Compatibility Forms"](a)&&!(a>=65097&&a<=65103)||pe["CJK Compatibility Ideographs"](a)||pe["CJK Compatibility"](a)||pe["CJK Radicals Supplement"](a)||pe["CJK Strokes"](a)||!(!pe["CJK Symbols and Punctuation"](a)||a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||pe["CJK Unified Ideographs Extension A"](a)||pe["CJK Unified Ideographs"](a)||pe["Enclosed CJK Letters and Months"](a)||pe["Hangul Compatibility Jamo"](a)||pe["Hangul Jamo Extended-A"](a)||pe["Hangul Jamo Extended-B"](a)||pe["Hangul Jamo"](a)||pe["Hangul Syllables"](a)||pe.Hiragana(a)||pe["Ideographic Description Characters"](a)||pe.Kanbun(a)||pe["Kangxi Radicals"](a)||pe["Katakana Phonetic Extensions"](a)||pe.Katakana(a)&&a!==12540||!(!pe["Halfwidth and Fullwidth Forms"](a)||a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||!(!pe["Small Form Variants"](a)||a>=65112&&a<=65118||a>=65123&&a<=65126)||pe["Unified Canadian Aboriginal Syllabics"](a)||pe["Unified Canadian Aboriginal Syllabics Extended"](a)||pe["Vertical Forms"](a)||pe["Yijing Hexagram Symbols"](a)||pe["Yi Syllables"](a)||pe["Yi Radicals"](a))))}function Xc(a){return!(Hc(a)||function(r){return!!(pe["Latin-1 Supplement"](r)&&(r===167||r===169||r===174||r===177||r===188||r===189||r===190||r===215||r===247)||pe["General Punctuation"](r)&&(r===8214||r===8224||r===8225||r===8240||r===8241||r===8251||r===8252||r===8258||r===8263||r===8264||r===8265||r===8273)||pe["Letterlike Symbols"](r)||pe["Number Forms"](r)||pe["Miscellaneous Technical"](r)&&(r>=8960&&r<=8967||r>=8972&&r<=8991||r>=8996&&r<=9e3||r===9003||r>=9085&&r<=9114||r>=9150&&r<=9165||r===9167||r>=9169&&r<=9179||r>=9186&&r<=9215)||pe["Control Pictures"](r)&&r!==9251||pe["Optical Character Recognition"](r)||pe["Enclosed Alphanumerics"](r)||pe["Geometric Shapes"](r)||pe["Miscellaneous Symbols"](r)&&!(r>=9754&&r<=9759)||pe["Miscellaneous Symbols and Arrows"](r)&&(r>=11026&&r<=11055||r>=11088&&r<=11097||r>=11192&&r<=11243)||pe["CJK Symbols and Punctuation"](r)||pe.Katakana(r)||pe["Private Use Area"](r)||pe["CJK Compatibility Forms"](r)||pe["Small Form Variants"](r)||pe["Halfwidth and Fullwidth Forms"](r)||r===8734||r===8756||r===8757||r>=9984&&r<=10087||r>=10102&&r<=10131||r===65532||r===65533)}(a))}function Sp(a){return a>=1424&&a<=2303||pe["Arabic Presentation Forms-A"](a)||pe["Arabic Presentation Forms-B"](a)}function mg(a,r){return!(!r&&Sp(a)||a>=2304&&a<=3583||a>=3840&&a<=4255||pe.Khmer(a))}function Td(a){for(const r of a)if(Sp(r.charCodeAt(0)))return!0;return!1}const ul=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(a){this.pluginStatus=a.pluginStatus,this.pluginURL=a.pluginURL}setMethods(a){this.applyArabicShaping=a.applyArabicShaping,this.processBidirectionalText=a.processBidirectionalText,this.processStyledBidirectionalText=a.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Hn{constructor(r,l){this.zoom=r,l?(this.now=l.now,this.fadeDuration=l.fadeDuration,this.zoomHistory=l.zoomHistory,this.transition=l.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Zc,this.transition={})}isSupportedScript(r){return function(l,f){for(const m of l)if(!mg(m.charCodeAt(0),f))return!1;return!0}(r,ul.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const r=this.zoom,l=r-Math.floor(r),f=this.crossFadingFactor();return r>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:l+(1-l)*f}:{fromScale:.5,toScale:1,t:1-(1-f)*l}}}class Fu{constructor(r,l){this.property=r,this.value=l,this.expression=function(f,m){if(Rc(f))return new zc(f,m);if(qn(f)){const v=pd(f,m);if(v.result==="error")throw new Error(v.value.map(b=>`${b.key}: ${b.message}`).join(", "));return v.value}{let v=f;return m.type==="color"&&typeof f=="string"?v=Dn.parse(f):m.type!=="padding"||typeof f!="number"&&!Array.isArray(f)?m.type==="variableAnchorOffsetCollection"&&Array.isArray(f)&&(v=Zo.parse(f)):v=oo.parse(f),{kind:"constant",evaluate:()=>v}}}(l===void 0?r.specification.default:l,r.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(r,l,f){return this.property.possiblyEvaluate(this,r,l,f)}}class Yc{constructor(r){this.property=r,this.value=new Fu(r,void 0)}transitioned(r,l){return new Md(this.property,this.value,l,dt({},r.transition,this.transition),r.now)}untransitioned(){return new Md(this.property,this.value,null,{},0)}}class Ld{constructor(r){this._properties=r,this._values=Object.create(r.defaultTransitionablePropertyValues)}getValue(r){return yt(this._values[r].value.value)}setValue(r,l){Object.prototype.hasOwnProperty.call(this._values,r)||(this._values[r]=new Yc(this._values[r].property)),this._values[r].value=new Fu(this._values[r].property,l===null?void 0:yt(l))}getTransition(r){return yt(this._values[r].transition)}setTransition(r,l){Object.prototype.hasOwnProperty.call(this._values,r)||(this._values[r]=new Yc(this._values[r].property)),this._values[r].transition=yt(l)||void 0}serialize(){const r={};for(const l of Object.keys(this._values)){const f=this.getValue(l);f!==void 0&&(r[l]=f);const m=this.getTransition(l);m!==void 0&&(r[`${l}-transition`]=m)}return r}transitioned(r,l){const f=new Ep(this._properties);for(const m of Object.keys(this._values))f._values[m]=this._values[m].transitioned(r,l._values[m]);return f}untransitioned(){const r=new Ep(this._properties);for(const l of Object.keys(this._values))r._values[l]=this._values[l].untransitioned();return r}}class Md{constructor(r,l,f,m,v){this.property=r,this.value=l,this.begin=v+m.delay||0,this.end=this.begin+m.duration||0,r.specification.transition&&(m.delay||m.duration)&&(this.prior=f)}possiblyEvaluate(r,l,f){const m=r.now||0,v=this.value.possiblyEvaluate(r,l,f),b=this.prior;if(b){if(m>this.end)return this.prior=null,v;if(this.value.isDataDriven())return this.prior=null,v;if(m=1)return 1;const P=C*C,D=P*C;return 4*(C<.5?D:3*(C-P)+D-.75)}(S))}}return v}}class Ep{constructor(r){this._properties=r,this._values=Object.create(r.defaultTransitioningPropertyValues)}possiblyEvaluate(r,l,f){const m=new Bu(this._properties);for(const v of Object.keys(this._values))m._values[v]=this._values[v].possiblyEvaluate(r,l,f);return m}hasTransition(){for(const r of Object.keys(this._values))if(this._values[r].prior)return!0;return!1}}class Pd{constructor(r){this._properties=r,this._values=Object.create(r.defaultPropertyValues)}hasValue(r){return this._values[r].value!==void 0}getValue(r){return yt(this._values[r].value)}setValue(r,l){this._values[r]=new Fu(this._values[r].property,l===null?void 0:yt(l))}serialize(){const r={};for(const l of Object.keys(this._values)){const f=this.getValue(l);f!==void 0&&(r[l]=f)}return r}possiblyEvaluate(r,l,f){const m=new Bu(this._properties);for(const v of Object.keys(this._values))m._values[v]=this._values[v].possiblyEvaluate(r,l,f);return m}}class us{constructor(r,l,f){this.property=r,this.value=l,this.parameters=f}isConstant(){return this.value.kind==="constant"}constantOr(r){return this.value.kind==="constant"?this.value.value:r}evaluate(r,l,f,m){return this.property.evaluate(this.value,this.parameters,r,l,f,m)}}class Bu{constructor(r){this._properties=r,this._values=Object.create(r.defaultPossiblyEvaluatedValues)}get(r){return this._values[r]}}class Ee{constructor(r){this.specification=r}possiblyEvaluate(r,l){if(r.isDataDriven())throw new Error("Value should not be data driven");return r.expression.evaluate(l)}interpolate(r,l,f){const m=qr[this.specification.type];return m?m(r,l,f):r}}class Oe{constructor(r,l){this.specification=r,this.overrides=l}possiblyEvaluate(r,l,f,m){return new us(this,r.expression.kind==="constant"||r.expression.kind==="camera"?{kind:"constant",value:r.expression.evaluate(l,null,{},f,m)}:r.expression,l)}interpolate(r,l,f){if(r.value.kind!=="constant"||l.value.kind!=="constant")return r;if(r.value.value===void 0||l.value.value===void 0)return new us(this,{kind:"constant",value:void 0},r.parameters);const m=qr[this.specification.type];if(m){const v=m(r.value.value,l.value.value,f);return new us(this,{kind:"constant",value:v},r.parameters)}return r}evaluate(r,l,f,m,v,b){return r.kind==="constant"?r.value:r.evaluate(l,f,m,v,b)}}class Zl extends Oe{possiblyEvaluate(r,l,f,m){if(r.value===void 0)return new us(this,{kind:"constant",value:void 0},l);if(r.expression.kind==="constant"){const v=r.expression.evaluate(l,null,{},f,m),b=r.property.specification.type==="resolvedImage"&&typeof v!="string"?v.name:v,S=this._calculate(b,b,b,l);return new us(this,{kind:"constant",value:S},l)}if(r.expression.kind==="camera"){const v=this._calculate(r.expression.evaluate({zoom:l.zoom-1}),r.expression.evaluate({zoom:l.zoom}),r.expression.evaluate({zoom:l.zoom+1}),l);return new us(this,{kind:"constant",value:v},l)}return new us(this,r.expression,l)}evaluate(r,l,f,m,v,b){if(r.kind==="source"){const S=r.evaluate(l,f,m,v,b);return this._calculate(S,S,S,l)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(l.zoom)-1},f,m),r.evaluate({zoom:Math.floor(l.zoom)},f,m),r.evaluate({zoom:Math.floor(l.zoom)+1},f,m),l):r.value}_calculate(r,l,f,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:r,to:l}:{from:f,to:l}}interpolate(r){return r}}class Ip{constructor(r){this.specification=r}possiblyEvaluate(r,l,f,m){if(r.value!==void 0){if(r.expression.kind==="constant"){const v=r.expression.evaluate(l,null,{},f,m);return this._calculate(v,v,v,l)}return this._calculate(r.expression.evaluate(new Hn(Math.floor(l.zoom-1),l)),r.expression.evaluate(new Hn(Math.floor(l.zoom),l)),r.expression.evaluate(new Hn(Math.floor(l.zoom+1),l)),l)}}_calculate(r,l,f,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:r,to:l}:{from:f,to:l}}interpolate(r){return r}}class Cp{constructor(r){this.specification=r}possiblyEvaluate(r,l,f,m){return!!r.expression.evaluate(l,null,{},f,m)}interpolate(){return!1}}class Zr{constructor(r){this.properties=r,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const l in r){const f=r[l];f.specification.overridable&&this.overridableProperties.push(l);const m=this.defaultPropertyValues[l]=new Fu(f,void 0),v=this.defaultTransitionablePropertyValues[l]=new Yc(f);this.defaultTransitioningPropertyValues[l]=v.untransitioned(),this.defaultPossiblyEvaluatedValues[l]=m.possiblyEvaluate({})}}}_e("DataDrivenProperty",Oe),_e("DataConstantProperty",Ee),_e("CrossFadedDataDrivenProperty",Zl),_e("CrossFadedProperty",Ip),_e("ColorRampProperty",Cp);const Tp="-transition";class cs extends oi{constructor(r,l){if(super(),this.id=r.id,this.type=r.type,this._featureFilter={filter:()=>!0,needGeometry:!1},r.type!=="custom"&&(this.metadata=r.metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),l.layout&&(this._unevaluatedLayout=new Pd(l.layout)),l.paint)){this._transitionablePaint=new Ld(l.paint);for(const f in r.paint)this.setPaintProperty(f,r.paint[f],{validate:!1});for(const f in r.layout)this.setLayoutProperty(f,r.layout[f],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Bu(l.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)}setLayoutProperty(r,l,f={}){l!=null&&this._validate(zu,`layers.${this.id}.layout.${r}`,r,l,f)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,l):this.visibility=l)}getPaintProperty(r){return r.endsWith(Tp)?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)}setPaintProperty(r,l,f={}){if(l!=null&&this._validate(dg,`layers.${this.id}.paint.${r}`,r,l,f))return!1;if(r.endsWith(Tp))return this._transitionablePaint.setTransition(r.slice(0,-11),l||void 0),!1;{const m=this._transitionablePaint._values[r],v=m.property.specification["property-type"]==="cross-faded-data-driven",b=m.value.isDataDriven(),S=m.value;this._transitionablePaint.setValue(r,l),this._handleSpecialPaintPropertyUpdate(r);const C=this._transitionablePaint._values[r].value;return C.isDataDriven()||b||v||this._handleOverridablePaintPropertyUpdate(r,S,C)}}_handleSpecialPaintPropertyUpdate(r){}_handleOverridablePaintPropertyUpdate(r,l,f){return!1}isHidden(r){return!!(this.minzoom&&r=this.maxzoom)||this.visibility==="none"}updateTransitions(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(r,l){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,l)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,l)}serialize(){const r={id:this.id,type:this.type,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()};return this.visibility&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),Rt(r,(l,f)=>!(l===void 0||f==="layout"&&!Object.keys(l).length||f==="paint"&&!Object.keys(l).length))}_validate(r,l,f,m,v={}){return(!v||v.validate!==!1)&&Ed(this,r.call(Nu,{key:l,layerType:this.type,objectKey:f,value:m,styleSpec:Pt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const r in this.paint._values){const l=this.paint.get(r);if(l instanceof us&&Ul(l.property.specification)&&(l.value.kind==="source"||l.value.kind==="composite")&&l.value.isStateDependent)return!0}return!1}}const gg={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Vu{constructor(r,l){this._structArray=r,this._pos1=l*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class pi{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(r,l){return r._trim(),l&&(r.isTransferred=!0,l.push(r.arrayBuffer)),{length:r.length,arrayBuffer:r.arrayBuffer}}static deserialize(r){const l=Object.create(this.prototype);return l.arrayBuffer=r.arrayBuffer,l.length=r.length,l.capacity=r.arrayBuffer.byteLength/l.bytesPerElement,l._refreshViews(),l}_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(r){this.reserve(r),this.length=r}reserve(r){if(r>this.capacity){this.capacity=Math.max(r,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const l=this.uint8;this._refreshViews(),l&&this.uint8.set(l)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Li(a,r=1){let l=0,f=0;return{members:a.map(m=>{const v=gg[m.type].BYTES_PER_ELEMENT,b=l=Ad(l,Math.max(r,v)),S=m.components||1;return f=Math.max(f,v),l+=v*S,{name:m.name,type:m.type,components:S,offset:b}}),size:Ad(l,Math.max(f,r)),alignment:r}}function Ad(a,r){return Math.ceil(a/r)*r}class Ps extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l){const f=this.length;return this.resize(f+1),this.emplace(f,r,l)}emplace(r,l,f){const m=2*r;return this.int16[m+0]=l,this.int16[m+1]=f,r}}Ps.prototype.bytesPerElement=4,_e("StructArrayLayout2i4",Ps);class Kc extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,f){const m=this.length;return this.resize(m+1),this.emplace(m,r,l,f)}emplace(r,l,f,m){const v=3*r;return this.int16[v+0]=l,this.int16[v+1]=f,this.int16[v+2]=m,r}}Kc.prototype.bytesPerElement=6,_e("StructArrayLayout3i6",Kc);class Lp extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,f,m){const v=this.length;return this.resize(v+1),this.emplace(v,r,l,f,m)}emplace(r,l,f,m,v){const b=4*r;return this.int16[b+0]=l,this.int16[b+1]=f,this.int16[b+2]=m,this.int16[b+3]=v,r}}Lp.prototype.bytesPerElement=8,_e("StructArrayLayout4i8",Lp);class Mp extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,f,m,v,b){const S=this.length;return this.resize(S+1),this.emplace(S,r,l,f,m,v,b)}emplace(r,l,f,m,v,b,S){const C=6*r;return this.int16[C+0]=l,this.int16[C+1]=f,this.int16[C+2]=m,this.int16[C+3]=v,this.int16[C+4]=b,this.int16[C+5]=S,r}}Mp.prototype.bytesPerElement=12,_e("StructArrayLayout2i4i12",Mp);class Pp extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,f,m,v,b){const S=this.length;return this.resize(S+1),this.emplace(S,r,l,f,m,v,b)}emplace(r,l,f,m,v,b,S){const C=4*r,P=8*r;return this.int16[C+0]=l,this.int16[C+1]=f,this.uint8[P+4]=m,this.uint8[P+5]=v,this.uint8[P+6]=b,this.uint8[P+7]=S,r}}Pp.prototype.bytesPerElement=8,_e("StructArrayLayout2i4ub8",Pp);class Wl extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l){const f=this.length;return this.resize(f+1),this.emplace(f,r,l)}emplace(r,l,f){const m=2*r;return this.float32[m+0]=l,this.float32[m+1]=f,r}}Wl.prototype.bytesPerElement=8,_e("StructArrayLayout2f8",Wl);class Ap extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,l,f,m,v,b,S,C,P,D){const R=this.length;return this.resize(R+1),this.emplace(R,r,l,f,m,v,b,S,C,P,D)}emplace(r,l,f,m,v,b,S,C,P,D,R){const B=10*r;return this.uint16[B+0]=l,this.uint16[B+1]=f,this.uint16[B+2]=m,this.uint16[B+3]=v,this.uint16[B+4]=b,this.uint16[B+5]=S,this.uint16[B+6]=C,this.uint16[B+7]=P,this.uint16[B+8]=D,this.uint16[B+9]=R,r}}Ap.prototype.bytesPerElement=20,_e("StructArrayLayout10ui20",Ap);class kp extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,l,f,m,v,b,S,C,P,D,R,B){const j=this.length;return this.resize(j+1),this.emplace(j,r,l,f,m,v,b,S,C,P,D,R,B)}emplace(r,l,f,m,v,b,S,C,P,D,R,B,j){const W=12*r;return this.int16[W+0]=l,this.int16[W+1]=f,this.int16[W+2]=m,this.int16[W+3]=v,this.uint16[W+4]=b,this.uint16[W+5]=S,this.uint16[W+6]=C,this.uint16[W+7]=P,this.int16[W+8]=D,this.int16[W+9]=R,this.int16[W+10]=B,this.int16[W+11]=j,r}}kp.prototype.bytesPerElement=24,_e("StructArrayLayout4i4ui4i24",kp);class ia extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l,f){const m=this.length;return this.resize(m+1),this.emplace(m,r,l,f)}emplace(r,l,f,m){const v=3*r;return this.float32[v+0]=l,this.float32[v+1]=f,this.float32[v+2]=m,r}}ia.prototype.bytesPerElement=12,_e("StructArrayLayout3f12",ia);class Jc extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(r){const l=this.length;return this.resize(l+1),this.emplace(l,r)}emplace(r,l){return this.uint32[1*r+0]=l,r}}Jc.prototype.bytesPerElement=4,_e("StructArrayLayout1ul4",Jc);class Uu extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,l,f,m,v,b,S,C,P){const D=this.length;return this.resize(D+1),this.emplace(D,r,l,f,m,v,b,S,C,P)}emplace(r,l,f,m,v,b,S,C,P,D){const R=10*r,B=5*r;return this.int16[R+0]=l,this.int16[R+1]=f,this.int16[R+2]=m,this.int16[R+3]=v,this.int16[R+4]=b,this.int16[R+5]=S,this.uint32[B+3]=C,this.uint16[R+8]=P,this.uint16[R+9]=D,r}}Uu.prototype.bytesPerElement=20,_e("StructArrayLayout6i1ul2ui20",Uu);class Qc extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,f,m,v,b){const S=this.length;return this.resize(S+1),this.emplace(S,r,l,f,m,v,b)}emplace(r,l,f,m,v,b,S){const C=6*r;return this.int16[C+0]=l,this.int16[C+1]=f,this.int16[C+2]=m,this.int16[C+3]=v,this.int16[C+4]=b,this.int16[C+5]=S,r}}Qc.prototype.bytesPerElement=12,_e("StructArrayLayout2i2i2i12",Qc);class Gu extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,f,m,v){const b=this.length;return this.resize(b+1),this.emplace(b,r,l,f,m,v)}emplace(r,l,f,m,v,b){const S=4*r,C=8*r;return this.float32[S+0]=l,this.float32[S+1]=f,this.float32[S+2]=m,this.int16[C+6]=v,this.int16[C+7]=b,r}}Gu.prototype.bytesPerElement=16,_e("StructArrayLayout2f1f2i16",Gu);class Dp extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l,f,m){const v=this.length;return this.resize(v+1),this.emplace(v,r,l,f,m)}emplace(r,l,f,m,v){const b=12*r,S=3*r;return this.uint8[b+0]=l,this.uint8[b+1]=f,this.float32[S+1]=m,this.float32[S+2]=v,r}}Dp.prototype.bytesPerElement=12,_e("StructArrayLayout2ub2f12",Dp);class cl extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,l,f){const m=this.length;return this.resize(m+1),this.emplace(m,r,l,f)}emplace(r,l,f,m){const v=3*r;return this.uint16[v+0]=l,this.uint16[v+1]=f,this.uint16[v+2]=m,r}}cl.prototype.bytesPerElement=6,_e("StructArrayLayout3ui6",cl);class hl extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l,f,m,v,b,S,C,P,D,R,B,j,W,Q,rt,ct){const Et=this.length;return this.resize(Et+1),this.emplace(Et,r,l,f,m,v,b,S,C,P,D,R,B,j,W,Q,rt,ct)}emplace(r,l,f,m,v,b,S,C,P,D,R,B,j,W,Q,rt,ct,Et){const ft=24*r,xt=12*r,qt=48*r;return this.int16[ft+0]=l,this.int16[ft+1]=f,this.uint16[ft+2]=m,this.uint16[ft+3]=v,this.uint32[xt+2]=b,this.uint32[xt+3]=S,this.uint32[xt+4]=C,this.uint16[ft+10]=P,this.uint16[ft+11]=D,this.uint16[ft+12]=R,this.float32[xt+7]=B,this.float32[xt+8]=j,this.uint8[qt+36]=W,this.uint8[qt+37]=Q,this.uint8[qt+38]=rt,this.uint32[xt+10]=ct,this.int16[ft+22]=Et,r}}hl.prototype.bytesPerElement=48,_e("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",hl);class Rp extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l,f,m,v,b,S,C,P,D,R,B,j,W,Q,rt,ct,Et,ft,xt,qt,Wt,de,we,fe,he,se,ve){const le=this.length;return this.resize(le+1),this.emplace(le,r,l,f,m,v,b,S,C,P,D,R,B,j,W,Q,rt,ct,Et,ft,xt,qt,Wt,de,we,fe,he,se,ve)}emplace(r,l,f,m,v,b,S,C,P,D,R,B,j,W,Q,rt,ct,Et,ft,xt,qt,Wt,de,we,fe,he,se,ve,le){const Qt=32*r,Me=16*r;return this.int16[Qt+0]=l,this.int16[Qt+1]=f,this.int16[Qt+2]=m,this.int16[Qt+3]=v,this.int16[Qt+4]=b,this.int16[Qt+5]=S,this.int16[Qt+6]=C,this.int16[Qt+7]=P,this.uint16[Qt+8]=D,this.uint16[Qt+9]=R,this.uint16[Qt+10]=B,this.uint16[Qt+11]=j,this.uint16[Qt+12]=W,this.uint16[Qt+13]=Q,this.uint16[Qt+14]=rt,this.uint16[Qt+15]=ct,this.uint16[Qt+16]=Et,this.uint16[Qt+17]=ft,this.uint16[Qt+18]=xt,this.uint16[Qt+19]=qt,this.uint16[Qt+20]=Wt,this.uint16[Qt+21]=de,this.uint16[Qt+22]=we,this.uint32[Me+12]=fe,this.float32[Me+13]=he,this.float32[Me+14]=se,this.uint16[Qt+30]=ve,this.uint16[Qt+31]=le,r}}Rp.prototype.bytesPerElement=64,_e("StructArrayLayout8i15ui1ul2f2ui64",Rp);class qu extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r){const l=this.length;return this.resize(l+1),this.emplace(l,r)}emplace(r,l){return this.float32[1*r+0]=l,r}}qu.prototype.bytesPerElement=4,_e("StructArrayLayout1f4",qu);class pl extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l,f){const m=this.length;return this.resize(m+1),this.emplace(m,r,l,f)}emplace(r,l,f,m){const v=3*r;return this.uint16[6*r+0]=l,this.float32[v+1]=f,this.float32[v+2]=m,r}}pl.prototype.bytesPerElement=12,_e("StructArrayLayout1ui2f12",pl);class Np extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,l,f){const m=this.length;return this.resize(m+1),this.emplace(m,r,l,f)}emplace(r,l,f,m){const v=4*r;return this.uint32[2*r+0]=l,this.uint16[v+2]=f,this.uint16[v+3]=m,r}}Np.prototype.bytesPerElement=8,_e("StructArrayLayout1ul2ui8",Np);class zp extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,l){const f=this.length;return this.resize(f+1),this.emplace(f,r,l)}emplace(r,l,f){const m=2*r;return this.uint16[m+0]=l,this.uint16[m+1]=f,r}}zp.prototype.bytesPerElement=4,_e("StructArrayLayout2ui4",zp);class $c extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r){const l=this.length;return this.resize(l+1),this.emplace(l,r)}emplace(r,l){return this.uint16[1*r+0]=l,r}}$c.prototype.bytesPerElement=2,_e("StructArrayLayout1ui2",$c);class Op extends pi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l,f,m){const v=this.length;return this.resize(v+1),this.emplace(v,r,l,f,m)}emplace(r,l,f,m,v){const b=4*r;return this.float32[b+0]=l,this.float32[b+1]=f,this.float32[b+2]=m,this.float32[b+3]=v,r}}Op.prototype.bytesPerElement=16,_e("StructArrayLayout4f16",Op);class _ extends Vu{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new L(this.anchorPointX,this.anchorPointY)}}_.prototype.size=20;class o extends Uu{get(r){return new _(this,r)}}_e("CollisionBoxArray",o);class h extends Vu{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(r){this._structArray.uint8[this._pos1+37]=r}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(r){this._structArray.uint8[this._pos1+38]=r}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(r){this._structArray.uint32[this._pos4+10]=r}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}h.prototype.size=48;class d extends hl{get(r){return new h(this,r)}}_e("PlacedSymbolArray",d);class g extends Vu{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(r){this._structArray.uint32[this._pos4+12]=r}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}g.prototype.size=64;class y extends Rp{get(r){return new g(this,r)}}_e("SymbolInstanceArray",y);class I extends qu{getoffsetX(r){return this.float32[1*r+0]}}_e("GlyphOffsetArray",I);class T extends Kc{getx(r){return this.int16[3*r+0]}gety(r){return this.int16[3*r+1]}gettileUnitDistanceFromAnchor(r){return this.int16[3*r+2]}}_e("SymbolLineVertexArray",T);class M extends Vu{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}M.prototype.size=12;class k extends pl{get(r){return new M(this,r)}}_e("TextAnchorOffsetArray",k);class N extends Vu{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]}}N.prototype.size=8;class z extends Np{get(r){return new N(this,r)}}_e("FeatureIndexArray",z);class Z extends Ps{}class nt extends Ps{}class it extends Ps{}class st extends Mp{}class tt extends Pp{}class mt extends Wl{}class Ct extends Ap{}class lt extends kp{}class bt extends ia{}class kt extends Jc{}class Mt extends Qc{}class Zt extends Dp{}class Jt extends cl{}class Ht extends zp{}const te=Li([{name:"a_pos",components:2,type:"Int16"}],4),{members:ye}=te;class ze{constructor(r=[]){this.segments=r}prepareSegment(r,l,f,m){let v=this.segments[this.segments.length-1];return r>ze.MAX_VERTEX_ARRAY_LENGTH&&ie(`Max vertices per segment is ${ze.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${r}`),(!v||v.vertexLength+r>ze.MAX_VERTEX_ARRAY_LENGTH||v.sortKey!==m)&&(v={vertexOffset:l.length,primitiveOffset:f.length,vertexLength:0,primitiveLength:0},m!==void 0&&(v.sortKey=m),this.segments.push(v)),v}get(){return this.segments}destroy(){for(const r of this.segments)for(const l in r.vaos)r.vaos[l].destroy()}static simpleSegment(r,l,f,m){return new ze([{vertexOffset:r,primitiveOffset:l,vertexLength:f,primitiveLength:m,vaos:{},sortKey:0}])}}function ce(a,r){return 256*(a=at(Math.floor(a),0,255))+at(Math.floor(r),0,255)}ze.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,_e("SegmentVector",ze);const Ae=Li([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var xe={exports:{}},Xn={exports:{}};Xn.exports=function(a,r){var l,f,m,v,b,S,C,P;for(f=a.length-(l=3&a.length),m=r,b=3432918353,S=461845907,P=0;P>>16)*b&65535)<<16)&4294967295)<<15|C>>>17))*S+(((C>>>16)*S&65535)<<16)&4294967295)<<13|m>>>19))+((5*(m>>>16)&65535)<<16)&4294967295))+((58964+(v>>>16)&65535)<<16);switch(C=0,l){case 3:C^=(255&a.charCodeAt(P+2))<<16;case 2:C^=(255&a.charCodeAt(P+1))<<8;case 1:m^=C=(65535&(C=(C=(65535&(C^=255&a.charCodeAt(P)))*b+(((C>>>16)*b&65535)<<16)&4294967295)<<15|C>>>17))*S+(((C>>>16)*S&65535)<<16)&4294967295}return m^=a.length,m=2246822507*(65535&(m^=m>>>16))+((2246822507*(m>>>16)&65535)<<16)&4294967295,m=3266489909*(65535&(m^=m>>>13))+((3266489909*(m>>>16)&65535)<<16)&4294967295,(m^=m>>>16)>>>0};var ln=Xn.exports,tn={exports:{}};tn.exports=function(a,r){for(var l,f=a.length,m=r^f,v=0;f>=4;)l=1540483477*(65535&(l=255&a.charCodeAt(v)|(255&a.charCodeAt(++v))<<8|(255&a.charCodeAt(++v))<<16|(255&a.charCodeAt(++v))<<24))+((1540483477*(l>>>16)&65535)<<16),m=1540483477*(65535&m)+((1540483477*(m>>>16)&65535)<<16)^(l=1540483477*(65535&(l^=l>>>24))+((1540483477*(l>>>16)&65535)<<16)),f-=4,++v;switch(f){case 3:m^=(255&a.charCodeAt(v+2))<<16;case 2:m^=(255&a.charCodeAt(v+1))<<8;case 1:m=1540483477*(65535&(m^=255&a.charCodeAt(v)))+((1540483477*(m>>>16)&65535)<<16)}return m=1540483477*(65535&(m^=m>>>13))+((1540483477*(m>>>16)&65535)<<16),(m^=m>>>15)>>>0};var un=ln,Mi=tn.exports;xe.exports=un,xe.exports.murmur3=un,xe.exports.murmur2=Mi;var Fn=x(xe.exports);class Wr{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(r,l,f,m){this.ids.push(ar(r)),this.positions.push(l,f,m)}getPositions(r){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const l=ar(r);let f=0,m=this.ids.length-1;for(;f>1;this.ids[b]>=l?m=b:f=b+1}const v=[];for(;this.ids[f]===l;)v.push({index:this.positions[3*f],start:this.positions[3*f+1],end:this.positions[3*f+2]}),f++;return v}static serialize(r,l){const f=new Float64Array(r.ids),m=new Uint32Array(r.positions);return fi(f,m,0,f.length-1),l&&l.push(f.buffer,m.buffer),{ids:f,positions:m}}static deserialize(r){const l=new Wr;return l.ids=r.ids,l.positions=r.positions,l.indexed=!0,l}}function ar(a){const r=+a;return!isNaN(r)&&r<=Number.MAX_SAFE_INTEGER?r:Fn(String(a))}function fi(a,r,l,f){for(;l>1];let v=l-1,b=f+1;for(;;){do v++;while(a[v]m);if(v>=b)break;Tr(a,v,b),Tr(r,3*v,3*b),Tr(r,3*v+1,3*b+1),Tr(r,3*v+2,3*b+2)}b-l`u_${m}`),this.type=f}setUniform(r,l,f){r.set(f.constantOr(this.value))}getBinding(r,l,f){return this.type==="color"?new Hl(r,l):new Xo(r,l)}}class Pi{constructor(r,l){this.uniformNames=l.map(f=>`u_${f}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(r,l){this.pixelRatioFrom=l.pixelRatio,this.pixelRatioTo=r.pixelRatio,this.patternFrom=l.tlbr,this.patternTo=r.tlbr}setUniform(r,l,f,m){const v=m==="u_pattern_to"?this.patternTo:m==="u_pattern_from"?this.patternFrom:m==="u_pixel_ratio_to"?this.pixelRatioTo:m==="u_pixel_ratio_from"?this.pixelRatioFrom:null;v&&r.set(v)}getBinding(r,l,f){return f.substr(0,9)==="u_pattern"?new Aa(r,l):new Xo(r,l)}}class di{constructor(r,l,f,m){this.expression=r,this.type=f,this.maxValue=0,this.paintVertexAttributes=l.map(v=>({name:`a_${v}`,type:"Float32",components:f==="color"?2:1,offset:0})),this.paintVertexArray=new m}populatePaintArray(r,l,f,m,v){const b=this.paintVertexArray.length,S=this.expression.evaluate(new Hn(0),l,{},m,[],v);this.paintVertexArray.resize(r),this._setPaintValue(b,r,S)}updatePaintArray(r,l,f,m){const v=this.expression.evaluate({zoom:0},f,m);this._setPaintValue(r,l,v)}_setPaintValue(r,l,f){if(this.type==="color"){const m=ka(f);for(let v=r;v`u_${S}_t`),this.type=f,this.useIntegerZoom=m,this.zoom=v,this.maxValue=0,this.paintVertexAttributes=l.map(S=>({name:`a_${S}`,type:"Float32",components:f==="color"?4:2,offset:0})),this.paintVertexArray=new b}populatePaintArray(r,l,f,m,v){const b=this.expression.evaluate(new Hn(this.zoom),l,{},m,[],v),S=this.expression.evaluate(new Hn(this.zoom+1),l,{},m,[],v),C=this.paintVertexArray.length;this.paintVertexArray.resize(r),this._setPaintValue(C,r,b,S)}updatePaintArray(r,l,f,m){const v=this.expression.evaluate({zoom:this.zoom},f,m),b=this.expression.evaluate({zoom:this.zoom+1},f,m);this._setPaintValue(r,l,v,b)}_setPaintValue(r,l,f,m){if(this.type==="color"){const v=ka(f),b=ka(m);for(let S=r;S`#define HAS_UNIFORM_${m}`))}return r}getBinderAttributes(){const r=[];for(const l in this.binders){const f=this.binders[l];if(f instanceof di||f instanceof Hr)for(let m=0;m!0){this.programConfigurations={};for(const m of r)this.programConfigurations[m.id]=new Hi(m,l,f);this.needsUpload=!1,this._featureMap=new Wr,this._bufferOffset=0}populatePaintArrays(r,l,f,m,v,b){for(const S in this.programConfigurations)this.programConfigurations[S].populatePaintArrays(r,l,m,v,b);l.id!==void 0&&this._featureMap.add(l.id,f,this._bufferOffset,r),this._bufferOffset=r,this.needsUpload=!0}updatePaintArrays(r,l,f,m){for(const v of f)this.needsUpload=this.programConfigurations[v.id].updatePaintArrays(r,this._featureMap,l,v,m)||this.needsUpload}get(r){return this.programConfigurations[r]}upload(r){if(this.needsUpload){for(const l in this.programConfigurations)this.programConfigurations[l].upload(r);this.needsUpload=!1}}destroy(){for(const r in this.programConfigurations)this.programConfigurations[r].destroy()}}function Xi(a,r){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"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"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[a]||[a.replace(`${r}-`,"").replace(/-/g,"_")]}function kd(a,r,l){const f={color:{source:Wl,composite:Op},number:{source:qu,composite:Wl}},m=function(v){return{"line-pattern":{source:Ct,composite:Ct},"fill-pattern":{source:Ct,composite:Ct},"fill-extrusion-pattern":{source:Ct,composite:Ct}}[v]}(a);return m&&m[l]||f[r][l]}_e("ConstantBinder",Wi),_e("CrossFadedConstantBinder",Pi),_e("SourceExpressionBinder",di),_e("CrossFadedCompositeBinder",Yn),_e("CompositeExpressionBinder",Hr),_e("ProgramConfiguration",Hi,{omit:["_buffers"]}),_e("ProgramConfigurationSet",lr);const bi=8192,Fp=Math.pow(2,14)-1,Dd=-Fp-1;function fl(a){const r=bi/a.extent,l=a.loadGeometry();for(let f=0;fb.x+1||Cb.y+1)&&ie("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return l}function dl(a,r){return{type:a.type,id:a.id,properties:a.properties,geometry:r?fl(a):[]}}function ra(a,r,l,f,m){a.emplaceBack(2*r+(f+1)/2,2*l+(m+1)/2)}class th{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(l=>l.id),this.index=r.index,this.hasPattern=!1,this.layoutVertexArray=new nt,this.indexArray=new Jt,this.segments=new ze,this.programConfigurations=new lr(r.layers,r.zoom),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(r,l,f){const m=this.layers[0],v=[];let b=null,S=!1;m.type==="circle"&&(b=m.layout.get("circle-sort-key"),S=!b.isConstant());for(const{feature:C,id:P,index:D,sourceLayerIndex:R}of r){const B=this.layers[0]._featureFilter.needGeometry,j=dl(C,B);if(!this.layers[0]._featureFilter.filter(new Hn(this.zoom),j,f))continue;const W=S?b.evaluate(j,{},f):void 0,Q={id:P,properties:C.properties,type:C.type,sourceLayerIndex:R,index:D,geometry:B?j.geometry:fl(C),patterns:{},sortKey:W};v.push(Q)}S&&v.sort((C,P)=>C.sortKey-P.sortKey);for(const C of v){const{geometry:P,index:D,sourceLayerIndex:R}=C,B=r[D].feature;this.addFeature(C,P,D,f),l.featureIndex.insert(B,P,D,R,this.index)}}update(r,l,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,l,this.stateDependentLayers,f)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,ye),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(r,l,f,m){for(const v of l)for(const b of v){const S=b.x,C=b.y;if(S<0||S>=bi||C<0||C>=bi)continue;const P=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,r.sortKey),D=P.vertexLength;ra(this.layoutVertexArray,S,C,-1,-1),ra(this.layoutVertexArray,S,C,1,-1),ra(this.layoutVertexArray,S,C,1,1),ra(this.layoutVertexArray,S,C,-1,1),this.indexArray.emplaceBack(D,D+1,D+2),this.indexArray.emplaceBack(D,D+3,D+2),P.vertexLength+=4,P.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,f,{},m)}}function Bp(a,r){for(let l=0;l1){if(ju(a,r))return!0;for(let f=0;f1?l:l.sub(r)._mult(m)._add(r))}function gy(a,r){let l,f,m,v=!1;for(let b=0;br.y!=m.y>r.y&&r.x<(m.x-f.x)*(r.y-f.y)/(m.y-f.y)+f.x&&(v=!v)}return v}function nh(a,r){let l=!1;for(let f=0,m=a.length-1;fr.y!=b.y>r.y&&r.x<(b.x-v.x)*(r.y-v.y)/(b.y-v.y)+v.x&&(l=!l)}return l}function Mb(a,r,l){const f=l[0],m=l[2];if(a.xm.x&&r.x>m.x||a.ym.y&&r.y>m.y)return!1;const v=Tt(a,r,l[0]);return v!==Tt(a,r,l[1])||v!==Tt(a,r,l[2])||v!==Tt(a,r,l[3])}function Vp(a,r,l){const f=r.paint.get(a).value;return f.kind==="constant"?f.value:l.programConfigurations.get(r.id).getMaxValue(a)}function zd(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1])}function Od(a,r,l,f,m){if(!r[0]&&!r[1])return a;const v=L.convert(r)._mult(m);l==="viewport"&&v._rotate(-f);const b=[];for(let S=0;Sxy(rt,Q))}(P,C),j=R?D*S:D;for(const W of m)for(const Q of W){const rt=R?Q:xy(Q,C);let ct=j;const Et=Fd([],[Q.x,Q.y,0,1],C);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ct*=Et[3]/b.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ct*=b.cameraToCenterDistance/Et[3]),Rd(B,rt,ct))return!0}return!1}}function xy(a,r){const l=Fd([],[a.x,a.y,0,1],r);return new L(l[0]/l[3],l[1]/l[3])}class by extends th{}let wy;_e("HeatmapBucket",by,{omit:["layers"]});var Db={get paint(){return wy=wy||new Zr({"heatmap-radius":new Oe(Pt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Oe(Pt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ee(Pt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Cp(Pt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ee(Pt.paint_heatmap["heatmap-opacity"])})}};function vg(a,{width:r,height:l},f,m){if(m){if(m instanceof Uint8ClampedArray)m=new Uint8Array(m.buffer);else if(m.length!==r*l*f)throw new RangeError(`mismatched image size. expected: ${m.length} but got: ${r*l*f}`)}else m=new Uint8Array(r*l*f);return a.width=r,a.height=l,a.data=m,a}function Sy(a,{width:r,height:l},f){if(r===a.width&&l===a.height)return;const m=vg({},{width:r,height:l},f);xg(a,m,{x:0,y:0},{x:0,y:0},{width:Math.min(a.width,r),height:Math.min(a.height,l)},f),a.width=r,a.height=l,a.data=m.data}function xg(a,r,l,f,m,v){if(m.width===0||m.height===0)return r;if(m.width>a.width||m.height>a.height||l.x>a.width-m.width||l.y>a.height-m.height)throw new RangeError("out of range source coordinates for image copy");if(m.width>r.width||m.height>r.height||f.x>r.width-m.width||f.y>r.height-m.height)throw new RangeError("out of range destination coordinates for image copy");const b=a.data,S=r.data;if(b===S)throw new Error("srcData equals dstData, so image is already copied");for(let C=0;C{r[a.evaluationKey]=C;const P=a.expression.evaluate(r);m.data[b+S+0]=Math.floor(255*P.r/P.a),m.data[b+S+1]=Math.floor(255*P.g/P.a),m.data[b+S+2]=Math.floor(255*P.b/P.a),m.data[b+S+3]=Math.floor(255*P.a)};if(a.clips)for(let b=0,S=0;b80*l){f=v=a[0],m=b=a[1];for(var W=l;Wv&&(v=S),C>b&&(b=C);P=(P=Math.max(v-f,b-m))!==0?32767/P:0}return qp(B,j,l,f,m,P,0),j}function Cy(a,r,l,f,m){var v,b;if(m===Eg(a,r,l,f)>0)for(v=r;v=r;v-=f)b=My(v,a[v],a[v+1],b);return b&&Vd(b,b.next)&&(Zp(b),b=b.next),b}function Zu(a,r){if(!a)return a;r||(r=a);var l,f=a;do if(l=!1,f.steiner||!Vd(f,f.next)&&Ai(f.prev,f,f.next)!==0)f=f.next;else{if(Zp(f),(f=r=f.prev)===f.next)break;l=!0}while(l||f!==r);return r}function qp(a,r,l,f,m,v,b){if(a){!b&&v&&function(D,R,B,j){var W=D;do W.z===0&&(W.z=wg(W.x,W.y,R,B,j)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next;while(W!==D);W.prevZ.nextZ=null,W.prevZ=null,function(Q){var rt,ct,Et,ft,xt,qt,Wt,de,we=1;do{for(ct=Q,Q=null,xt=null,qt=0;ct;){for(qt++,Et=ct,Wt=0,rt=0;rt0||de>0&&Et;)Wt!==0&&(de===0||!Et||ct.z<=Et.z)?(ft=ct,ct=ct.nextZ,Wt--):(ft=Et,Et=Et.nextZ,de--),xt?xt.nextZ=ft:Q=ft,ft.prevZ=xt,xt=ft;ct=Et}xt.nextZ=null,we*=2}while(qt>1)}(W)}(a,f,m,v);for(var S,C,P=a;a.prev!==a.next;)if(S=a.prev,C=a.next,v?Vb(a,f,m,v):Bb(a))r.push(S.i/l|0),r.push(a.i/l|0),r.push(C.i/l|0),Zp(a),a=C.next,P=C.next;else if((a=C)===P){b?b===1?qp(a=Ub(Zu(a),r,l),r,l,f,m,v,2):b===2&&Gb(a,r,l,f,m,v):qp(Zu(a),r,l,f,m,v,1);break}}}function Bb(a){var r=a.prev,l=a,f=a.next;if(Ai(r,l,f)>=0)return!1;for(var m=r.x,v=l.x,b=f.x,S=r.y,C=l.y,P=f.y,D=mv?m>b?m:b:v>b?v:b,j=S>C?S>P?S:P:C>P?C:P,W=f.next;W!==r;){if(W.x>=D&&W.x<=B&&W.y>=R&&W.y<=j&&rh(m,S,v,C,b,P,W.x,W.y)&&Ai(W.prev,W,W.next)>=0)return!1;W=W.next}return!0}function Vb(a,r,l,f){var m=a.prev,v=a,b=a.next;if(Ai(m,v,b)>=0)return!1;for(var S=m.x,C=v.x,P=b.x,D=m.y,R=v.y,B=b.y,j=SC?S>P?S:P:C>P?C:P,rt=D>R?D>B?D:B:R>B?R:B,ct=wg(j,W,r,l,f),Et=wg(Q,rt,r,l,f),ft=a.prevZ,xt=a.nextZ;ft&&ft.z>=ct&&xt&&xt.z<=Et;){if(ft.x>=j&&ft.x<=Q&&ft.y>=W&&ft.y<=rt&&ft!==m&&ft!==b&&rh(S,D,C,R,P,B,ft.x,ft.y)&&Ai(ft.prev,ft,ft.next)>=0||(ft=ft.prevZ,xt.x>=j&&xt.x<=Q&&xt.y>=W&&xt.y<=rt&&xt!==m&&xt!==b&&rh(S,D,C,R,P,B,xt.x,xt.y)&&Ai(xt.prev,xt,xt.next)>=0))return!1;xt=xt.nextZ}for(;ft&&ft.z>=ct;){if(ft.x>=j&&ft.x<=Q&&ft.y>=W&&ft.y<=rt&&ft!==m&&ft!==b&&rh(S,D,C,R,P,B,ft.x,ft.y)&&Ai(ft.prev,ft,ft.next)>=0)return!1;ft=ft.prevZ}for(;xt&&xt.z<=Et;){if(xt.x>=j&&xt.x<=Q&&xt.y>=W&&xt.y<=rt&&xt!==m&&xt!==b&&rh(S,D,C,R,P,B,xt.x,xt.y)&&Ai(xt.prev,xt,xt.next)>=0)return!1;xt=xt.nextZ}return!0}function Ub(a,r,l){var f=a;do{var m=f.prev,v=f.next.next;!Vd(m,v)&&Ty(m,f,f.next,v)&&jp(m,v)&&jp(v,m)&&(r.push(m.i/l|0),r.push(f.i/l|0),r.push(v.i/l|0),Zp(f),Zp(f.next),f=a=v),f=f.next}while(f!==a);return Zu(f)}function Gb(a,r,l,f,m,v){var b=a;do{for(var S=b.next.next;S!==b.prev;){if(b.i!==S.i&&Hb(b,S)){var C=Ly(b,S);return b=Zu(b,b.next),C=Zu(C,C.next),qp(b,r,l,f,m,v,0),void qp(C,r,l,f,m,v,0)}S=S.next}b=b.next}while(b!==a)}function qb(a,r){return a.x-r.x}function jb(a,r){var l=function(m,v){var b,S=v,C=m.x,P=m.y,D=-1/0;do{if(P<=S.y&&P>=S.next.y&&S.next.y!==S.y){var R=S.x+(P-S.y)*(S.next.x-S.x)/(S.next.y-S.y);if(R<=C&&R>D&&(D=R,b=S.x=S.x&&S.x>=W&&C!==S.x&&rh(Pb.x||S.x===b.x&&Zb(b,S)))&&(b=S,rt=B)),S=S.next;while(S!==j);return b}(a,r);if(!l)return r;var f=Ly(l,a);return Zu(f,f.next),Zu(l,l.next)}function Zb(a,r){return Ai(a.prev,a,r.prev)<0&&Ai(r.next,a,a.next)<0}function wg(a,r,l,f,m){return(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-l)*m|0)|a<<8))|a<<4))|a<<2))|a<<1))|(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-f)*m|0)|r<<8))|r<<4))|r<<2))|r<<1))<<1}function Wb(a){var r=a,l=a;do(r.x=(a-b)*(v-S)&&(a-b)*(f-S)>=(l-b)*(r-S)&&(l-b)*(v-S)>=(m-b)*(f-S)}function Hb(a,r){return a.next.i!==r.i&&a.prev.i!==r.i&&!function(l,f){var m=l;do{if(m.i!==l.i&&m.next.i!==l.i&&m.i!==f.i&&m.next.i!==f.i&&Ty(m,m.next,l,f))return!0;m=m.next}while(m!==l);return!1}(a,r)&&(jp(a,r)&&jp(r,a)&&function(l,f){var m=l,v=!1,b=(l.x+f.x)/2,S=(l.y+f.y)/2;do m.y>S!=m.next.y>S&&m.next.y!==m.y&&b<(m.next.x-m.x)*(S-m.y)/(m.next.y-m.y)+m.x&&(v=!v),m=m.next;while(m!==l);return v}(a,r)&&(Ai(a.prev,a,r.prev)||Ai(a,r.prev,r))||Vd(a,r)&&Ai(a.prev,a,a.next)>0&&Ai(r.prev,r,r.next)>0)}function Ai(a,r,l){return(r.y-a.y)*(l.x-r.x)-(r.x-a.x)*(l.y-r.y)}function Vd(a,r){return a.x===r.x&&a.y===r.y}function Ty(a,r,l,f){var m=Gd(Ai(a,r,l)),v=Gd(Ai(a,r,f)),b=Gd(Ai(l,f,a)),S=Gd(Ai(l,f,r));return m!==v&&b!==S||!(m!==0||!Ud(a,l,r))||!(v!==0||!Ud(a,f,r))||!(b!==0||!Ud(l,a,f))||!(S!==0||!Ud(l,r,f))}function Ud(a,r,l){return r.x<=Math.max(a.x,l.x)&&r.x>=Math.min(a.x,l.x)&&r.y<=Math.max(a.y,l.y)&&r.y>=Math.min(a.y,l.y)}function Gd(a){return a>0?1:a<0?-1:0}function jp(a,r){return Ai(a.prev,a,a.next)<0?Ai(a,r,a.next)>=0&&Ai(a,a.prev,r)>=0:Ai(a,r,a.prev)<0||Ai(a,a.next,r)<0}function Ly(a,r){var l=new Sg(a.i,a.x,a.y),f=new Sg(r.i,r.x,r.y),m=a.next,v=r.prev;return a.next=r,r.prev=a,l.next=m,m.prev=l,f.next=l,l.prev=f,v.next=f,f.prev=v,f}function My(a,r,l,f){var m=new Sg(a,r,l);return f?(m.next=f.next,m.prev=f,f.next.prev=m,f.next=m):(m.prev=m,m.next=m),m}function Zp(a){a.next.prev=a.prev,a.prev.next=a.next,a.prevZ&&(a.prevZ.nextZ=a.nextZ),a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function Sg(a,r,l){this.i=a,this.x=r,this.y=l,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Eg(a,r,l,f){for(var m=0,v=r,b=l-f;v0&&l.holes.push(f+=a[m-1].length)}return l};var Py=x(bg.exports);function Xb(a,r,l,f,m){Ay(a,r,l||0,f||a.length-1,m||Yb)}function Ay(a,r,l,f,m){for(;f>l;){if(f-l>600){var v=f-l+1,b=r-l+1,S=Math.log(v),C=.5*Math.exp(2*S/3),P=.5*Math.sqrt(S*C*(v-C)/v)*(b-v/2<0?-1:1);Ay(a,r,Math.max(l,Math.floor(r-b*C/v+P)),Math.min(f,Math.floor(r+(v-b)*C/v+P)),m)}var D=a[r],R=l,B=f;for(Wp(a,l,r),m(a[f],D)>0&&Wp(a,l,f);R0;)B--}m(a[l],D)===0?Wp(a,l,B):Wp(a,++B,f),B<=r&&(l=B+1),r<=B&&(f=B-1)}}function Wp(a,r,l){var f=a[r];a[r]=a[l],a[l]=f}function Yb(a,r){return ar?1:0}function Ig(a,r){const l=a.length;if(l<=1)return[a];const f=[];let m,v;for(let b=0;b1)for(let b=0;bl.id),this.index=r.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new it,this.indexArray=new Jt,this.indexArray2=new Ht,this.programConfigurations=new lr(r.layers,r.zoom),this.segments=new ze,this.segments2=new ze,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(r,l,f){this.hasPattern=Cg("fill",this.layers,l);const m=this.layers[0].layout.get("fill-sort-key"),v=!m.isConstant(),b=[];for(const{feature:S,id:C,index:P,sourceLayerIndex:D}of r){const R=this.layers[0]._featureFilter.needGeometry,B=dl(S,R);if(!this.layers[0]._featureFilter.filter(new Hn(this.zoom),B,f))continue;const j=v?m.evaluate(B,{},f,l.availableImages):void 0,W={id:C,properties:S.properties,type:S.type,sourceLayerIndex:D,index:P,geometry:R?B.geometry:fl(S),patterns:{},sortKey:j};b.push(W)}v&&b.sort((S,C)=>S.sortKey-C.sortKey);for(const S of b){const{geometry:C,index:P,sourceLayerIndex:D}=S;if(this.hasPattern){const R=Tg("fill",this.layers,S,this.zoom,l);this.patternFeatures.push(R)}else this.addFeature(S,C,P,f,{});l.featureIndex.insert(r[P].feature,C,P,D,this.index)}}update(r,l,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,l,this.stateDependentLayers,f)}addFeatures(r,l,f){for(const m of this.patternFeatures)this.addFeature(m,m.geometry,m.index,l,f)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,Fb),this.indexBuffer=r.createIndexBuffer(this.indexArray),this.indexBuffer2=r.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(r),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(r,l,f,m,v){for(const b of Ig(l,500)){let S=0;for(const j of b)S+=j.length;const C=this.segments.prepareSegment(S,this.layoutVertexArray,this.indexArray),P=C.vertexLength,D=[],R=[];for(const j of b){if(j.length===0)continue;j!==b[0]&&R.push(D.length/2);const W=this.segments2.prepareSegment(j.length,this.layoutVertexArray,this.indexArray2),Q=W.vertexLength;this.layoutVertexArray.emplaceBack(j[0].x,j[0].y),this.indexArray2.emplaceBack(Q+j.length-1,Q),D.push(j[0].x),D.push(j[0].y);for(let rt=1;rt>3}if(m--,f===1||f===2)v+=a.readSVarint(),b+=a.readSVarint(),f===1&&(r&&S.push(r),r=[]),r.push(new nw(v,b));else{if(f!==7)throw new Error("unknown command "+f);r&&r.push(r[0].clone())}}return r&&S.push(r),S},oh.prototype.bbox=function(){var a=this._pbf;a.pos=this._geometry;for(var r=a.readVarint()+a.pos,l=1,f=0,m=0,v=0,b=1/0,S=-1/0,C=1/0,P=-1/0;a.pos>3}if(f--,l===1||l===2)(m+=a.readSVarint())S&&(S=m),(v+=a.readSVarint())P&&(P=v);else if(l!==7)throw new Error("unknown command "+l)}return[b,C,S,P]},oh.prototype.toGeoJSON=function(a,r,l){var f,m,v=this.extent*Math.pow(2,l),b=this.extent*a,S=this.extent*r,C=this.loadGeometry(),P=oh.types[this.type];function D(j){for(var W=0;W>3;m=b===1?f.readString():b===2?f.readFloat():b===3?f.readDouble():b===4?f.readVarint64():b===5?f.readVarint():b===6?f.readSVarint():b===7?f.readBoolean():null}return m}(l))}zy.prototype.feature=function(a){if(a<0||a>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[a];var r=this._pbf.readVarint()+this._pbf.pos;return new ow(this._pbf,r,this.extent,this._keys,this._values)};var aw=Ny;function lw(a,r,l){if(a===3){var f=new aw(l,l.readVarint()+l.pos);f.length&&(r[f.name]=f)}}Yl.VectorTile=function(a,r){this.layers=a.readFields(lw,{},r)},Yl.VectorTileFeature=Ry,Yl.VectorTileLayer=Ny;const uw=Yl.VectorTileFeature.types,Mg=Math.pow(2,13);function Hp(a,r,l,f,m,v,b,S){a.emplaceBack(r,l,2*Math.floor(f*Mg)+b,m*Mg*2,v*Mg*2,Math.round(S))}class Pg{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(l=>l.id),this.index=r.index,this.hasPattern=!1,this.layoutVertexArray=new st,this.centroidVertexArray=new Z,this.indexArray=new Jt,this.programConfigurations=new lr(r.layers,r.zoom),this.segments=new ze,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(r,l,f){this.features=[],this.hasPattern=Cg("fill-extrusion",this.layers,l);for(const{feature:m,id:v,index:b,sourceLayerIndex:S}of r){const C=this.layers[0]._featureFilter.needGeometry,P=dl(m,C);if(!this.layers[0]._featureFilter.filter(new Hn(this.zoom),P,f))continue;const D={id:v,sourceLayerIndex:S,index:b,geometry:C?P.geometry:fl(m),properties:m.properties,type:m.type,patterns:{}};this.hasPattern?this.features.push(Tg("fill-extrusion",this.layers,D,this.zoom,l)):this.addFeature(D,D.geometry,b,f,{}),l.featureIndex.insert(m,D.geometry,b,S,this.index,!0)}}addFeatures(r,l,f){for(const m of this.features){const{geometry:v}=m;this.addFeature(m,v,m.index,l,f)}}update(r,l,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,l,this.stateDependentLayers,f)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,ew),this.centroidVertexBuffer=r.createVertexBuffer(this.centroidVertexArray,tw.members,!0),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(r,l,f,m,v){const b={x:0,y:0,vertexCount:0};for(const S of Ig(l,500)){let C=0;for(const W of S)C+=W.length;let P=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const W of S){if(W.length===0||hw(W))continue;let Q=0;for(let rt=0;rt=1){const Et=W[rt-1];if(!cw(ct,Et)){P.vertexLength+4>ze.MAX_VERTEX_ARRAY_LENGTH&&(P=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const ft=ct.sub(Et)._perp()._unit(),xt=Et.dist(ct);Q+xt>32768&&(Q=0),Hp(this.layoutVertexArray,ct.x,ct.y,ft.x,ft.y,0,0,Q),Hp(this.layoutVertexArray,ct.x,ct.y,ft.x,ft.y,0,1,Q),b.x+=2*ct.x,b.y+=2*ct.y,b.vertexCount+=2,Q+=xt,Hp(this.layoutVertexArray,Et.x,Et.y,ft.x,ft.y,0,0,Q),Hp(this.layoutVertexArray,Et.x,Et.y,ft.x,ft.y,0,1,Q),b.x+=2*Et.x,b.y+=2*Et.y,b.vertexCount+=2;const qt=P.vertexLength;this.indexArray.emplaceBack(qt,qt+2,qt+1),this.indexArray.emplaceBack(qt+1,qt+2,qt+3),P.vertexLength+=4,P.primitiveLength+=2}}}}if(P.vertexLength+C>ze.MAX_VERTEX_ARRAY_LENGTH&&(P=this.segments.prepareSegment(C,this.layoutVertexArray,this.indexArray)),uw[r.type]!=="Polygon")continue;const D=[],R=[],B=P.vertexLength;for(const W of S)if(W.length!==0){W!==S[0]&&R.push(D.length/2);for(let Q=0;Qbi)||a.y===r.y&&(a.y<0||a.y>bi)}function hw(a){return a.every(r=>r.x<0)||a.every(r=>r.x>bi)||a.every(r=>r.y<0)||a.every(r=>r.y>bi)}let Oy;_e("FillExtrusionBucket",Pg,{omit:["layers","features"]});var pw={get paint(){return Oy=Oy||new Zr({"fill-extrusion-opacity":new Ee(Pt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Oe(Pt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ee(Pt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ee(Pt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Zl(Pt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Oe(Pt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Oe(Pt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ee(Pt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class fw extends cs{constructor(r){super(r,pw)}createBucket(r){return new Pg(r)}queryRadius(){return zd(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(r,l,f,m,v,b,S,C){const P=Od(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),b.angle,S),D=this.paint.get("fill-extrusion-height").evaluate(l,f),R=this.paint.get("fill-extrusion-base").evaluate(l,f),B=function(W,Q,rt,ct){const Et=[];for(const ft of W){const xt=[ft.x,ft.y,0,1];Fd(xt,xt,Q),Et.push(new L(xt[0]/xt[3],xt[1]/xt[3]))}return Et}(P,C),j=function(W,Q,rt,ct){const Et=[],ft=[],xt=ct[8]*Q,qt=ct[9]*Q,Wt=ct[10]*Q,de=ct[11]*Q,we=ct[8]*rt,fe=ct[9]*rt,he=ct[10]*rt,se=ct[11]*rt;for(const ve of W){const le=[],Qt=[];for(const Me of ve){const Ie=Me.x,rn=Me.y,Kn=ct[0]*Ie+ct[4]*rn+ct[12],ei=ct[1]*Ie+ct[5]*rn+ct[13],Ki=ct[2]*Ie+ct[6]*rn+ct[14],Yo=ct[3]*Ie+ct[7]*rn+ct[15],uo=Ki+Wt,qi=Yo+de,yr=Kn+we,Pr=ei+fe,co=Ki+he,ho=Yo+se,Ji=new L((Kn+xt)/qi,(ei+qt)/qi);Ji.z=uo/qi,le.push(Ji);const Qi=new L(yr/ho,Pr/ho);Qi.z=co/ho,Qt.push(Qi)}Et.push(le),ft.push(Qt)}return[Et,ft]}(m,R,D,C);return function(W,Q,rt){let ct=1/0;eh(rt,Q)&&(ct=Fy(rt,Q[0]));for(let Et=0;Etl.id),this.index=r.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(l=>{this.gradients[l.id]={}}),this.layoutVertexArray=new tt,this.layoutVertexArray2=new mt,this.indexArray=new Jt,this.programConfigurations=new lr(r.layers,r.zoom),this.segments=new ze,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(r,l,f){this.hasPattern=Cg("line",this.layers,l);const m=this.layers[0].layout.get("line-sort-key"),v=!m.isConstant(),b=[];for(const{feature:S,id:C,index:P,sourceLayerIndex:D}of r){const R=this.layers[0]._featureFilter.needGeometry,B=dl(S,R);if(!this.layers[0]._featureFilter.filter(new Hn(this.zoom),B,f))continue;const j=v?m.evaluate(B,{},f):void 0,W={id:C,properties:S.properties,type:S.type,sourceLayerIndex:D,index:P,geometry:R?B.geometry:fl(S),patterns:{},sortKey:j};b.push(W)}v&&b.sort((S,C)=>S.sortKey-C.sortKey);for(const S of b){const{geometry:C,index:P,sourceLayerIndex:D}=S;if(this.hasPattern){const R=Tg("line",this.layers,S,this.zoom,l);this.patternFeatures.push(R)}else this.addFeature(S,C,P,f,{});l.featureIndex.insert(r[P].feature,C,P,D,this.index)}}update(r,l,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,l,this.stateDependentLayers,f)}addFeatures(r,l,f){for(const m of this.patternFeatures)this.addFeature(m,m.geometry,m.index,l,f)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=r.createVertexBuffer(this.layoutVertexArray2,_w)),this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,mw),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(r){if(r.properties&&Object.prototype.hasOwnProperty.call(r.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(r.properties,"mapbox_clip_end"))return{start:+r.properties.mapbox_clip_start,end:+r.properties.mapbox_clip_end}}addFeature(r,l,f,m,v){const b=this.layers[0].layout,S=b.get("line-join").evaluate(r,{}),C=b.get("line-cap"),P=b.get("line-miter-limit"),D=b.get("line-round-limit");this.lineClips=this.lineFeatureClips(r);for(const R of l)this.addLine(R,r,S,C,P,D);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,f,v,m)}addLine(r,l,f,m,v,b){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let ct=0;ct=2&&r[C-1].equals(r[C-2]);)C--;let P=0;for(;P0;if(de&&ct>P){const se=B.dist(j);if(se>2*D){const ve=B.sub(B.sub(j)._mult(D/se)._round());this.updateDistance(j,ve),this.addCurrentVertex(ve,Q,0,0,R),j=ve}}const fe=j&&W;let he=fe?f:S?"butt":m;if(fe&&he==="round"&&(qtv&&(he="bevel"),he==="bevel"&&(qt>2&&(he="flipbevel"),qt100)Et=rt.mult(-1);else{const se=qt*Q.add(rt).mag()/Q.sub(rt).mag();Et._perp()._mult(se*(we?-1:1))}this.addCurrentVertex(B,Et,0,0,R),this.addCurrentVertex(B,Et.mult(-1),0,0,R)}else if(he==="bevel"||he==="fakeround"){const se=-Math.sqrt(qt*qt-1),ve=we?se:0,le=we?0:se;if(j&&this.addCurrentVertex(B,Q,ve,le,R),he==="fakeround"){const Qt=Math.round(180*Wt/Math.PI/20);for(let Me=1;Me2*D){const ve=B.add(W.sub(B)._mult(D/se)._round());this.updateDistance(B,ve),this.addCurrentVertex(ve,rt,0,0,R),B=ve}}}}addCurrentVertex(r,l,f,m,v,b=!1){const S=l.y*m-l.x,C=-l.y-l.x*m;this.addHalfVertex(r,l.x+l.y*f,l.y-l.x*f,b,!1,f,v),this.addHalfVertex(r,S,C,b,!0,-m,v),this.distance>By/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(r,l,f,m,v,b))}addHalfVertex({x:r,y:l},f,m,v,b,S,C){const P=.5*(this.lineClips?this.scaledDistance*(By-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((r<<1)+(v?1:0),(l<<1)+(b?1:0),Math.round(63*f)+128,Math.round(63*m)+128,1+(S===0?0:S<0?-1:1)|(63&P)<<2,P>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const D=C.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,D),C.primitiveLength++),b?this.e2=D:this.e1=D}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(r,l){this.distance+=r.dist(l),this.updateScaledDistance()}}let Vy,Uy;_e("LineBucket",Ag,{omit:["layers","patternFeatures"]});var Gy={get paint(){return Uy=Uy||new Zr({"line-opacity":new Oe(Pt.paint_line["line-opacity"]),"line-color":new Oe(Pt.paint_line["line-color"]),"line-translate":new Ee(Pt.paint_line["line-translate"]),"line-translate-anchor":new Ee(Pt.paint_line["line-translate-anchor"]),"line-width":new Oe(Pt.paint_line["line-width"]),"line-gap-width":new Oe(Pt.paint_line["line-gap-width"]),"line-offset":new Oe(Pt.paint_line["line-offset"]),"line-blur":new Oe(Pt.paint_line["line-blur"]),"line-dasharray":new Ip(Pt.paint_line["line-dasharray"]),"line-pattern":new Zl(Pt.paint_line["line-pattern"]),"line-gradient":new Cp(Pt.paint_line["line-gradient"])})},get layout(){return Vy=Vy||new Zr({"line-cap":new Ee(Pt.layout_line["line-cap"]),"line-join":new Oe(Pt.layout_line["line-join"]),"line-miter-limit":new Ee(Pt.layout_line["line-miter-limit"]),"line-round-limit":new Ee(Pt.layout_line["line-round-limit"]),"line-sort-key":new Oe(Pt.layout_line["line-sort-key"])})}};class xw extends Oe{possiblyEvaluate(r,l){return l=new Hn(Math.floor(l.zoom),{now:l.now,fadeDuration:l.fadeDuration,zoomHistory:l.zoomHistory,transition:l.transition}),super.possiblyEvaluate(r,l)}evaluate(r,l,f,m){return l=dt({},l,{zoom:Math.floor(l.zoom)}),super.evaluate(r,l,f,m)}}let qd;class bw extends cs{constructor(r){super(r,Gy),this.gradientVersion=0,qd||(qd=new xw(Gy.paint.properties["line-width"].specification),qd.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(r){if(r==="line-gradient"){const l=this.gradientExpression();this.stepInterpolant=!!function(f){return f._styleExpression!==void 0}(l)&&l._styleExpression.expression instanceof Pu,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(r,l){super.recalculate(r,l),this.paint._values["line-floorwidth"]=qd.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)}createBucket(r){return new Ag(r)}queryRadius(r){const l=r,f=qy(Vp("line-width",this,l),Vp("line-gap-width",this,l)),m=Vp("line-offset",this,l);return f/2+Math.abs(m)+zd(this.paint.get("line-translate"))}queryIntersectsFeature(r,l,f,m,v,b,S){const C=Od(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),b.angle,S),P=S/2*qy(this.paint.get("line-width").evaluate(l,f),this.paint.get("line-gap-width").evaluate(l,f)),D=this.paint.get("line-offset").evaluate(l,f);return D&&(m=function(R,B){const j=[];for(let W=0;W=3){for(let rt=0;rt0?r+2*a:a}const ww=Li([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Sw=Li([{name:"a_projected_pos",components:3,type:"Float32"}],4);Li([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ew=Li([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Li([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const jy=Li([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Iw=Li([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Cw(a,r,l){return a.sections.forEach(f=>{f.text=function(m,v,b){const S=v.layout.get("text-transform").evaluate(b,{});return S==="uppercase"?m=m.toLocaleUpperCase():S==="lowercase"&&(m=m.toLocaleLowerCase()),ul.applyArabicShaping&&(m=ul.applyArabicShaping(m)),m}(f.text,r,l)}),a}Li([{name:"triangle",components:3,type:"Uint16"}]),Li([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{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"}]),Li([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{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",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Li([{type:"Float32",name:"offsetX"}]),Li([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Li([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Yp={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Yi=24,Zy=Bn,Wy=function(a,r,l,f,m){var v,b,S=8*m-f-1,C=(1<>1,D=-7,R=l?m-1:0,B=l?-1:1,j=a[r+R];for(R+=B,v=j&(1<<-D)-1,j>>=-D,D+=S;D>0;v=256*v+a[r+R],R+=B,D-=8);for(b=v&(1<<-D)-1,v>>=-D,D+=f;D>0;b=256*b+a[r+R],R+=B,D-=8);if(v===0)v=1-P;else{if(v===C)return b?NaN:1/0*(j?-1:1);b+=Math.pow(2,f),v-=P}return(j?-1:1)*b*Math.pow(2,v-f)},Hy=function(a,r,l,f,m,v){var b,S,C,P=8*v-m-1,D=(1<>1,B=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,j=f?0:v-1,W=f?1:-1,Q=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(S=isNaN(r)?1:0,b=D):(b=Math.floor(Math.log(r)/Math.LN2),r*(C=Math.pow(2,-b))<1&&(b--,C*=2),(r+=b+R>=1?B/C:B*Math.pow(2,1-R))*C>=2&&(b++,C/=2),b+R>=D?(S=0,b=D):b+R>=1?(S=(r*C-1)*Math.pow(2,m),b+=R):(S=r*Math.pow(2,R-1)*Math.pow(2,m),b=0));m>=8;a[l+j]=255&S,j+=W,S/=256,m-=8);for(b=b<0;a[l+j]=255&b,j+=W,b/=256,P-=8);a[l+j-W]|=128*Q};function Bn(a){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(a)?a:new Uint8Array(a||0),this.pos=0,this.type=0,this.length=this.buf.length}Bn.Varint=0,Bn.Fixed64=1,Bn.Bytes=2,Bn.Fixed32=5;var kg=4294967296,Xy=1/kg,Yy=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ml(a){return a.type===Bn.Bytes?a.readVarint()+a.pos:a.pos+1}function sh(a,r,l){return l?4294967296*r+(a>>>0):4294967296*(r>>>0)+(a>>>0)}function Ky(a,r,l){var f=r<=16383?1:r<=2097151?2:r<=268435455?3:Math.floor(Math.log(r)/(7*Math.LN2));l.realloc(f);for(var m=l.pos-1;m>=a;m--)l.buf[m+f]=l.buf[m]}function Tw(a,r){for(var l=0;l>>8,a[l+2]=r>>>16,a[l+3]=r>>>24}function Jy(a,r){return(a[r]|a[r+1]<<8|a[r+2]<<16)+(a[r+3]<<24)}Bn.prototype={destroy:function(){this.buf=null},readFields:function(a,r,l){for(l=l||this.length;this.pos>3,v=this.pos;this.type=7&f,a(m,r,this),this.pos===v&&this.skip(f)}return r},readMessage:function(a,r){return this.readFields(a,r,this.readVarint()+this.pos)},readFixed32:function(){var a=jd(this.buf,this.pos);return this.pos+=4,a},readSFixed32:function(){var a=Jy(this.buf,this.pos);return this.pos+=4,a},readFixed64:function(){var a=jd(this.buf,this.pos)+jd(this.buf,this.pos+4)*kg;return this.pos+=8,a},readSFixed64:function(){var a=jd(this.buf,this.pos)+Jy(this.buf,this.pos+4)*kg;return this.pos+=8,a},readFloat:function(){var a=Wy(this.buf,this.pos,!0,23,4);return this.pos+=4,a},readDouble:function(){var a=Wy(this.buf,this.pos,!0,52,8);return this.pos+=8,a},readVarint:function(a){var r,l,f=this.buf;return r=127&(l=f[this.pos++]),l<128?r:(r|=(127&(l=f[this.pos++]))<<7,l<128?r:(r|=(127&(l=f[this.pos++]))<<14,l<128?r:(r|=(127&(l=f[this.pos++]))<<21,l<128?r:function(m,v,b){var S,C,P=b.buf;if(S=(112&(C=P[b.pos++]))>>4,C<128||(S|=(127&(C=P[b.pos++]))<<3,C<128)||(S|=(127&(C=P[b.pos++]))<<10,C<128)||(S|=(127&(C=P[b.pos++]))<<17,C<128)||(S|=(127&(C=P[b.pos++]))<<24,C<128)||(S|=(1&(C=P[b.pos++]))<<31,C<128))return sh(m,S,v);throw new Error("Expected varint not more than 10 bytes")}(r|=(15&(l=f[this.pos]))<<28,a,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var a=this.readVarint();return a%2==1?(a+1)/-2:a/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var a=this.readVarint()+this.pos,r=this.pos;return this.pos=a,a-r>=12&&Yy?function(l,f,m){return Yy.decode(l.subarray(f,m))}(this.buf,r,a):function(l,f,m){for(var v="",b=f;b239?4:D>223?3:D>191?2:1;if(b+B>m)break;B===1?D<128&&(R=D):B===2?(192&(S=l[b+1]))==128&&(R=(31&D)<<6|63&S)<=127&&(R=null):B===3?(C=l[b+2],(192&(S=l[b+1]))==128&&(192&C)==128&&((R=(15&D)<<12|(63&S)<<6|63&C)<=2047||R>=55296&&R<=57343)&&(R=null)):B===4&&(C=l[b+2],P=l[b+3],(192&(S=l[b+1]))==128&&(192&C)==128&&(192&P)==128&&((R=(15&D)<<18|(63&S)<<12|(63&C)<<6|63&P)<=65535||R>=1114112)&&(R=null)),R===null?(R=65533,B=1):R>65535&&(R-=65536,v+=String.fromCharCode(R>>>10&1023|55296),R=56320|1023&R),v+=String.fromCharCode(R),b+=B}return v}(this.buf,r,a)},readBytes:function(){var a=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,a);return this.pos=a,r},readPackedVarint:function(a,r){if(this.type!==Bn.Bytes)return a.push(this.readVarint(r));var l=ml(this);for(a=a||[];this.pos127;);else if(r===Bn.Bytes)this.pos=this.readVarint()+this.pos;else if(r===Bn.Fixed32)this.pos+=4;else{if(r!==Bn.Fixed64)throw new Error("Unimplemented type: "+r);this.pos+=8}},writeTag:function(a,r){this.writeVarint(a<<3|r)},realloc:function(a){for(var r=this.length||16;r268435455||a<0?function(r,l){var f,m;if(r>=0?(f=r%4294967296|0,m=r/4294967296|0):(m=~(-r/4294967296),4294967295^(f=~(-r%4294967296))?f=f+1|0:(f=0,m=m+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");l.realloc(10),function(v,b,S){S.buf[S.pos++]=127&v|128,v>>>=7,S.buf[S.pos++]=127&v|128,v>>>=7,S.buf[S.pos++]=127&v|128,v>>>=7,S.buf[S.pos++]=127&v|128,S.buf[S.pos]=127&(v>>>=7)}(f,0,l),function(v,b){var S=(7&v)<<4;b.buf[b.pos++]|=S|((v>>>=3)?128:0),v&&(b.buf[b.pos++]=127&v|((v>>>=7)?128:0),v&&(b.buf[b.pos++]=127&v|((v>>>=7)?128:0),v&&(b.buf[b.pos++]=127&v|((v>>>=7)?128:0),v&&(b.buf[b.pos++]=127&v|((v>>>=7)?128:0),v&&(b.buf[b.pos++]=127&v)))))}(m,l)}(a,this):(this.realloc(4),this.buf[this.pos++]=127&a|(a>127?128:0),a<=127||(this.buf[this.pos++]=127&(a>>>=7)|(a>127?128:0),a<=127||(this.buf[this.pos++]=127&(a>>>=7)|(a>127?128:0),a<=127||(this.buf[this.pos++]=a>>>7&127))))},writeSVarint:function(a){this.writeVarint(a<0?2*-a-1:2*a)},writeBoolean:function(a){this.writeVarint(!!a)},writeString:function(a){a=String(a),this.realloc(4*a.length),this.pos++;var r=this.pos;this.pos=function(f,m,v){for(var b,S,C=0;C55295&&b<57344){if(!S){b>56319||C+1===m.length?(f[v++]=239,f[v++]=191,f[v++]=189):S=b;continue}if(b<56320){f[v++]=239,f[v++]=191,f[v++]=189,S=b;continue}b=S-55296<<10|b-56320|65536,S=null}else S&&(f[v++]=239,f[v++]=191,f[v++]=189,S=null);b<128?f[v++]=b:(b<2048?f[v++]=b>>6|192:(b<65536?f[v++]=b>>12|224:(f[v++]=b>>18|240,f[v++]=b>>12&63|128),f[v++]=b>>6&63|128),f[v++]=63&b|128)}return v}(this.buf,a,this.pos);var l=this.pos-r;l>=128&&Ky(r,l,this),this.pos=r-1,this.writeVarint(l),this.pos+=l},writeFloat:function(a){this.realloc(4),Hy(this.buf,a,this.pos,!0,23,4),this.pos+=4},writeDouble:function(a){this.realloc(8),Hy(this.buf,a,this.pos,!0,52,8),this.pos+=8},writeBytes:function(a){var r=a.length;this.writeVarint(r),this.realloc(r);for(var l=0;l=128&&Ky(l,f,this),this.pos=l-1,this.writeVarint(f),this.pos+=f},writeMessage:function(a,r,l){this.writeTag(a,Bn.Bytes),this.writeRawMessage(r,l)},writePackedVarint:function(a,r){r.length&&this.writeMessage(a,Tw,r)},writePackedSVarint:function(a,r){r.length&&this.writeMessage(a,Lw,r)},writePackedBoolean:function(a,r){r.length&&this.writeMessage(a,Aw,r)},writePackedFloat:function(a,r){r.length&&this.writeMessage(a,Mw,r)},writePackedDouble:function(a,r){r.length&&this.writeMessage(a,Pw,r)},writePackedFixed32:function(a,r){r.length&&this.writeMessage(a,kw,r)},writePackedSFixed32:function(a,r){r.length&&this.writeMessage(a,Dw,r)},writePackedFixed64:function(a,r){r.length&&this.writeMessage(a,Rw,r)},writePackedSFixed64:function(a,r){r.length&&this.writeMessage(a,Nw,r)},writeBytesField:function(a,r){this.writeTag(a,Bn.Bytes),this.writeBytes(r)},writeFixed32Field:function(a,r){this.writeTag(a,Bn.Fixed32),this.writeFixed32(r)},writeSFixed32Field:function(a,r){this.writeTag(a,Bn.Fixed32),this.writeSFixed32(r)},writeFixed64Field:function(a,r){this.writeTag(a,Bn.Fixed64),this.writeFixed64(r)},writeSFixed64Field:function(a,r){this.writeTag(a,Bn.Fixed64),this.writeSFixed64(r)},writeVarintField:function(a,r){this.writeTag(a,Bn.Varint),this.writeVarint(r)},writeSVarintField:function(a,r){this.writeTag(a,Bn.Varint),this.writeSVarint(r)},writeStringField:function(a,r){this.writeTag(a,Bn.Bytes),this.writeString(r)},writeFloatField:function(a,r){this.writeTag(a,Bn.Fixed32),this.writeFloat(r)},writeDoubleField:function(a,r){this.writeTag(a,Bn.Fixed64),this.writeDouble(r)},writeBooleanField:function(a,r){this.writeVarintField(a,!!r)}};var Dg=x(Zy);const Rg=3;function zw(a,r,l){a===1&&l.readMessage(Ow,r)}function Ow(a,r,l){if(a===3){const{id:f,bitmap:m,width:v,height:b,left:S,top:C,advance:P}=l.readMessage(Fw,{});r.push({id:f,bitmap:new Gp({width:v+2*Rg,height:b+2*Rg},m),metrics:{width:v,height:b,left:S,top:C,advance:P}})}}function Fw(a,r,l){a===1?r.id=l.readVarint():a===2?r.bitmap=l.readBytes():a===3?r.width=l.readVarint():a===4?r.height=l.readVarint():a===5?r.left=l.readSVarint():a===6?r.top=l.readSVarint():a===7&&(r.advance=l.readVarint())}const Qy=Rg;function $y(a){let r=0,l=0;for(const b of a)r+=b.w*b.h,l=Math.max(l,b.w);a.sort((b,S)=>S.h-b.h);const f=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),l),h:1/0}];let m=0,v=0;for(const b of a)for(let S=f.length-1;S>=0;S--){const C=f[S];if(!(b.w>C.w||b.h>C.h)){if(b.x=C.x,b.y=C.y,v=Math.max(v,b.y+b.h),m=Math.max(m,b.x+b.w),b.w===C.w&&b.h===C.h){const P=f.pop();S=0&&f>=r&&Wd[this.text.charCodeAt(f)];f--)l--;this.text=this.text.substring(r,l),this.sectionIndex=this.sectionIndex.slice(r,l)}substring(r,l){const f=new lh;return f.text=this.text.substring(r,l),f.sectionIndex=this.sectionIndex.slice(r,l),f.sections=this.sections,f}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((r,l)=>Math.max(r,this.sections[l].scale),0)}addTextSection(r,l){this.text+=r.text,this.sections.push(Jp.forText(r.scale,r.fontStack||l));const f=this.sections.length-1;for(let m=0;m=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Zd(a,r,l,f,m,v,b,S,C,P,D,R,B,j,W,Q){const rt=lh.fromFeature(a,m);let ct;R===p.ah.vertical&&rt.verticalizePunctuation();const{processBidirectionalText:Et,processStyledBidirectionalText:ft}=ul;if(Et&&rt.sections.length===1){ct=[];const Wt=Et(rt.toString(),zg(rt,P,v,r,f,j,W));for(const de of Wt){const we=new lh;we.text=de,we.sections=rt.sections;for(let fe=0;fe0&&_l>To&&(To=_l)}else{const fs=we[fn.fontStack],Mo=fs&&fs[Ar];if(Mo&&Mo.rect)oa=Mo.rect,As=Mo.metrics;else{const _l=de[fn.fontStack],nf=_l&&_l[Ar];if(!nf)continue;As=nf.metrics}tr=(Qi-fn.scale)*Yi}ks?(Wt.verticalizable=!0,Yr.push({glyph:Ar,imageName:sa,x:Kn,y:ei+tr,vertical:ks,scale:fn.scale,fontStack:fn.fontStack,sectionIndex:Kr,metrics:As,rect:oa}),Kn+=gl*fn.scale+Me):(Yr.push({glyph:Ar,imageName:sa,x:Kn,y:ei+tr,vertical:ks,scale:fn.scale,fontStack:fn.fontStack,sectionIndex:Kr,metrics:As,rect:oa}),Kn+=As.advance*fn.scale+Me)}Yr.length!==0&&(Ki=Math.max(Kn-Me,Ki),Uw(Yr,0,Yr.length-1,uo,To)),Kn=0;const Lo=se*Qi+To;po.lineOffset=Math.max(To,Xr),ei+=Lo,Yo=Math.max(Lo,Yo),++qi}var yr;const Pr=ei-Kp,{horizontalAlign:co,verticalAlign:ho}=Og(ve);(function(Ji,Qi,Xr,po,Yr,To,Lo,$i,fn){const Kr=(Qi-Xr)*Yr;let Ar=0;Ar=To!==Lo?-$i*po-Kp:(-po*fn+.5)*Lo;for(const tr of Ji)for(const As of tr.positionedGlyphs)As.x+=Kr,As.y+=Ar})(Wt.positionedLines,uo,co,ho,Ki,Yo,se,Pr,he.length),Wt.top+=-ho*Pr,Wt.bottom=Wt.top+Pr,Wt.left+=-co*Ki,Wt.right=Wt.left+Ki}(qt,r,l,f,ct,b,S,C,R,P,B,Q),!function(Wt){for(const de of Wt)if(de.positionedGlyphs.length!==0)return!1;return!0}(xt)&&qt}const Wd={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Bw={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function e0(a,r,l,f,m,v){if(r.imageName){const b=f[r.imageName];return b?b.displaySize[0]*r.scale*Yi/v+m:0}{const b=l[r.fontStack],S=b&&b[a];return S?S.metrics.advance*r.scale+m:0}}function n0(a,r,l,f){const m=Math.pow(a-r,2);return f?a=0;let D=0;for(let B=0;Bb.id),this.index=r.index,this.pixelRatio=r.pixelRatio,this.sourceLayerIndex=r.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=yg([]),this.placementViewportMatrix=yg([]);const l=this.layers[0]._unevaluatedLayout._values;this.textSizeData=s0(this.zoom,l["text-size"]),this.iconSizeData=s0(this.zoom,l["icon-size"]);const f=this.layers[0].layout,m=f.get("symbol-sort-key"),v=f.get("symbol-z-order");this.canOverlap=Fg(f,"text-overlap","text-allow-overlap")!=="never"||Fg(f,"icon-overlap","icon-allow-overlap")!=="never"||f.get("text-ignore-placement")||f.get("icon-ignore-placement"),this.sortFeaturesByKey=v!=="viewport-y"&&!m.isConstant(),this.sortFeaturesByY=(v==="viewport-y"||v==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,f.get("symbol-placement")==="point"&&(this.writingModes=f.get("text-writing-mode").map(b=>p.ah[b])),this.stateDependentLayerIds=this.layers.filter(b=>b.isStateDependent()).map(b=>b.id),this.sourceID=r.sourceID}createArrays(){this.text=new Vg(new lr(this.layers,this.zoom,r=>/^text/.test(r))),this.icon=new Vg(new lr(this.layers,this.zoom,r=>/^icon/.test(r))),this.glyphOffsetArray=new I,this.lineVertexArray=new T,this.symbolInstances=new y,this.textAnchorOffsets=new k}calculateGlyphDependencies(r,l,f,m,v){for(let b=0;b0)&&(b.value.kind!=="constant"||b.value.value.length>0),D=C.value.kind!=="constant"||!!C.value.value||Object.keys(C.parameters).length>0,R=v.get("symbol-sort-key");if(this.features=[],!P&&!D)return;const B=l.iconDependencies,j=l.glyphDependencies,W=l.availableImages,Q=new Hn(this.zoom);for(const{feature:rt,id:ct,index:Et,sourceLayerIndex:ft}of r){const xt=m._featureFilter.needGeometry,qt=dl(rt,xt);if(!m._featureFilter.filter(Q,qt,f))continue;let Wt,de;if(xt||(qt.geometry=fl(rt)),P){const fe=m.getValueAndResolveTokens("text-field",qt,f,W),he=So.factory(fe);Zw(he)&&(this.hasRTLText=!0),(!this.hasRTLText||ul.getRTLTextPluginStatus()==="unavailable"||this.hasRTLText&&ul.isParsed())&&(Wt=Cw(he,m,qt))}if(D){const fe=m.getValueAndResolveTokens("icon-image",qt,f,W);de=fe instanceof Wo?fe:Wo.fromString(fe)}if(!Wt&&!de)continue;const we=this.sortFeaturesByKey?R.evaluate(qt,{},f):void 0;if(this.features.push({id:ct,text:Wt,icon:de,index:Et,sourceLayerIndex:ft,geometry:qt.geometry,properties:rt.properties,type:qw[rt.type],sortKey:we}),de&&(B[de.name]=!0),Wt){const fe=b.evaluate(qt,{},f).join(","),he=v.get("text-rotation-alignment")!=="viewport"&&v.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(p.ah.vertical)>=0;for(const se of Wt.sections)if(se.image)B[se.image.name]=!0;else{const ve=Wc(Wt.toString()),le=se.fontStack||fe,Qt=j[le]=j[le]||{};this.calculateGlyphDependencies(se.text,Qt,he,this.allowVerticalPlacement,ve)}}}v.get("symbol-placement")==="line"&&(this.features=function(rt){const ct={},Et={},ft=[];let xt=0;function qt(fe){ft.push(rt[fe]),xt++}function Wt(fe,he,se){const ve=Et[fe];return delete Et[fe],Et[he]=ve,ft[ve].geometry[0].pop(),ft[ve].geometry[0]=ft[ve].geometry[0].concat(se[0]),ve}function de(fe,he,se){const ve=ct[he];return delete ct[he],ct[fe]=ve,ft[ve].geometry[0].shift(),ft[ve].geometry[0]=se[0].concat(ft[ve].geometry[0]),ve}function we(fe,he,se){const ve=se?he[0][he[0].length-1]:he[0][0];return`${fe}:${ve.x}:${ve.y}`}for(let fe=0;fefe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((rt,ct)=>rt.sortKey-ct.sortKey)}update(r,l,f){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(r,l,this.layers,f),this.icon.programConfigurations.updatePaintArrays(r,l,this.layers,f))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(r){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(r),this.iconCollisionBox.upload(r)),this.text.upload(r,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(r,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(r,l){const f=this.lineVertexArray.length;if(r.segment!==void 0){let m=r.dist(l[r.segment+1]),v=r.dist(l[r.segment]);const b={};for(let S=r.segment+1;S=0;S--)b[S]={x:l[S].x,y:l[S].y,tileUnitDistanceFromAnchor:v},S>0&&(v+=l[S-1].dist(l[S]));for(let S=0;S0}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}addIndicesForPlacedSymbol(r,l){const f=r.placedSymbolArray.get(l),m=f.vertexStartIndex+4*f.numGlyphs;for(let v=f.vertexStartIndex;vm[S]-m[C]||v[C]-v[S]),b}addToSortKeyRanges(r,l){const f=this.sortKeyRanges[this.sortKeyRanges.length-1];f&&f.sortKey===l?f.symbolInstanceEnd=r+1:this.sortKeyRanges.push({sortKey:l,symbolInstanceStart:r,symbolInstanceEnd:r+1})}sortFeatures(r){if(this.sortFeaturesByY&&this.sortedAngle!==r&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(r),this.sortedAngle=r,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const l of this.symbolInstanceIndexes){const f=this.symbolInstances.get(l);this.featureSortOrder.push(f.featureIndex),[f.rightJustifiedTextSymbolIndex,f.centerJustifiedTextSymbolIndex,f.leftJustifiedTextSymbolIndex].forEach((m,v,b)=>{m>=0&&b.indexOf(m)===v&&this.addIndicesForPlacedSymbol(this.text,m)}),f.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,f.verticalPlacedTextSymbolIndex),f.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.placedIconSymbolIndex),f.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let a0,l0;_e("SymbolBucket",uh,{omit:["layers","collisionBoxArray","features","compareText"]}),uh.MAX_GLYPHS=65535,uh.addDynamicAttributes=Bg;var Gg={get paint(){return l0=l0||new Zr({"icon-opacity":new Oe(Pt.paint_symbol["icon-opacity"]),"icon-color":new Oe(Pt.paint_symbol["icon-color"]),"icon-halo-color":new Oe(Pt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Oe(Pt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Oe(Pt.paint_symbol["icon-halo-blur"]),"icon-translate":new Ee(Pt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ee(Pt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Oe(Pt.paint_symbol["text-opacity"]),"text-color":new Oe(Pt.paint_symbol["text-color"],{runtimeType:xi,getOverride:a=>a.textColor,hasOverride:a=>!!a.textColor}),"text-halo-color":new Oe(Pt.paint_symbol["text-halo-color"]),"text-halo-width":new Oe(Pt.paint_symbol["text-halo-width"]),"text-halo-blur":new Oe(Pt.paint_symbol["text-halo-blur"]),"text-translate":new Ee(Pt.paint_symbol["text-translate"]),"text-translate-anchor":new Ee(Pt.paint_symbol["text-translate-anchor"])})},get layout(){return a0=a0||new Zr({"symbol-placement":new Ee(Pt.layout_symbol["symbol-placement"]),"symbol-spacing":new Ee(Pt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ee(Pt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Oe(Pt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ee(Pt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ee(Pt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ee(Pt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ee(Pt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ee(Pt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ee(Pt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Oe(Pt.layout_symbol["icon-size"]),"icon-text-fit":new Ee(Pt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ee(Pt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Oe(Pt.layout_symbol["icon-image"]),"icon-rotate":new Oe(Pt.layout_symbol["icon-rotate"]),"icon-padding":new Oe(Pt.layout_symbol["icon-padding"]),"icon-keep-upright":new Ee(Pt.layout_symbol["icon-keep-upright"]),"icon-offset":new Oe(Pt.layout_symbol["icon-offset"]),"icon-anchor":new Oe(Pt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ee(Pt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ee(Pt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ee(Pt.layout_symbol["text-rotation-alignment"]),"text-field":new Oe(Pt.layout_symbol["text-field"]),"text-font":new Oe(Pt.layout_symbol["text-font"]),"text-size":new Oe(Pt.layout_symbol["text-size"]),"text-max-width":new Oe(Pt.layout_symbol["text-max-width"]),"text-line-height":new Ee(Pt.layout_symbol["text-line-height"]),"text-letter-spacing":new Oe(Pt.layout_symbol["text-letter-spacing"]),"text-justify":new Oe(Pt.layout_symbol["text-justify"]),"text-radial-offset":new Oe(Pt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ee(Pt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Oe(Pt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Oe(Pt.layout_symbol["text-anchor"]),"text-max-angle":new Ee(Pt.layout_symbol["text-max-angle"]),"text-writing-mode":new Ee(Pt.layout_symbol["text-writing-mode"]),"text-rotate":new Oe(Pt.layout_symbol["text-rotate"]),"text-padding":new Ee(Pt.layout_symbol["text-padding"]),"text-keep-upright":new Ee(Pt.layout_symbol["text-keep-upright"]),"text-transform":new Oe(Pt.layout_symbol["text-transform"]),"text-offset":new Oe(Pt.layout_symbol["text-offset"]),"text-allow-overlap":new Ee(Pt.layout_symbol["text-allow-overlap"]),"text-overlap":new Ee(Pt.layout_symbol["text-overlap"]),"text-ignore-placement":new Ee(Pt.layout_symbol["text-ignore-placement"]),"text-optional":new Ee(Pt.layout_symbol["text-optional"])})}};class u0{constructor(r){if(r.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=r.property.overrides?r.property.overrides.runtimeType:Vi,this.defaultValue=r}evaluate(r){if(r.formattedSection){const l=this.defaultValue.property.overrides;if(l&&l.hasOverride(r.formattedSection))return l.getOverride(r.formattedSection)}return r.feature&&r.featureState?this.defaultValue.evaluate(r.feature,r.featureState):this.defaultValue.property.specification.default}eachChild(r){this.defaultValue.isConstant()||r(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}_e("FormatSectionOverride",u0,{omit:["defaultValue"]});class Xd extends cs{constructor(r){super(r,Gg)}recalculate(r,l){if(super.recalculate(r,l),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const f=this.layout.get("text-writing-mode");if(f){const m=[];for(const v of f)m.indexOf(v)<0&&m.push(v);this.layout._values["text-writing-mode"]=m}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(r,l,f,m){const v=this.layout.get(r).evaluate(l,{},f,m),b=this._unevaluatedLayout._values[r];return b.isDataDriven()||qn(b.value)||!v?v:function(S,C){return C.replace(/{([^{}]+)}/g,(P,D)=>S&&D in S?String(S[D]):"")}(l.properties,v)}createBucket(r){return new uh(r)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const r of Gg.paint.overridableProperties){if(!Xd.hasPaintOverride(this.layout,r))continue;const l=this.paint.get(r),f=new u0(l),m=new Wn(f,l.property.specification);let v=null;v=l.value.kind==="constant"||l.value.kind==="source"?new Nc("source",m):new dp("composite",m,l.value.zoomStops),this.paint._values[r]=new us(l.property,v,l.parameters)}}_handleOverridablePaintPropertyUpdate(r,l,f){return!(!this.layout||l.isDataDriven()||f.isDataDriven())&&Xd.hasPaintOverride(this.layout,r)}static hasPaintOverride(r,l){const f=r.get("text-field"),m=Gg.paint.properties[l];let v=!1;const b=S=>{for(const C of S)if(m.overrides&&m.overrides.hasOverride(C))return void(v=!0)};if(f.value.kind==="constant"&&f.value.value instanceof So)b(f.value.value.sections);else if(f.value.kind==="source"){const S=P=>{v||(P instanceof Ca&&Gi(P.value)===Ci?b(P.value.sections):P instanceof Dc?b(P.sections):P.eachChild(S))},C=f.value;C._styleExpression&&S(C._styleExpression.expression)}return v}}let c0;var Ww={get paint(){return c0=c0||new Zr({"background-color":new Ee(Pt.paint_background["background-color"]),"background-pattern":new Ip(Pt.paint_background["background-pattern"]),"background-opacity":new Ee(Pt.paint_background["background-opacity"])})}};class Hw extends cs{constructor(r){super(r,Ww)}}let h0;var Xw={get paint(){return h0=h0||new Zr({"raster-opacity":new Ee(Pt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ee(Pt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ee(Pt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ee(Pt.paint_raster["raster-brightness-max"]),"raster-saturation":new Ee(Pt.paint_raster["raster-saturation"]),"raster-contrast":new Ee(Pt.paint_raster["raster-contrast"]),"raster-resampling":new Ee(Pt.paint_raster["raster-resampling"]),"raster-fade-duration":new Ee(Pt.paint_raster["raster-fade-duration"])})}};class Yw extends cs{constructor(r){super(r,Xw)}}class Kw extends cs{constructor(r){super(r,{}),this.onAdd=l=>{this.implementation.onAdd&&this.implementation.onAdd(l,l.painter.context.gl)},this.onRemove=l=>{this.implementation.onRemove&&this.implementation.onRemove(l,l.painter.context.gl)},this.implementation=r}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Jw{constructor(r){this._methodToThrottle=r,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const qg=63710088e-1;class Ql{constructor(r,l){if(isNaN(r)||isNaN(l))throw new Error(`Invalid LngLat object: (${r}, ${l})`);if(this.lng=+r,this.lat=+l,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ql(vt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(r){const l=Math.PI/180,f=this.lat*l,m=r.lat*l,v=Math.sin(f)*Math.sin(m)+Math.cos(f)*Math.cos(m)*Math.cos((r.lng-this.lng)*l);return qg*Math.acos(Math.min(v,1))}static convert(r){if(r instanceof Ql)return r;if(Array.isArray(r)&&(r.length===2||r.length===3))return new Ql(Number(r[0]),Number(r[1]));if(!Array.isArray(r)&&typeof r=="object"&&r!==null)return new Ql(Number("lng"in r?r.lng:r.lon),Number(r.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 [, ]")}}const p0=2*Math.PI*qg;function f0(a){return p0*Math.cos(a*Math.PI/180)}function d0(a){return(180+a)/360}function m0(a){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360}function g0(a,r){return a/f0(r)}function jg(a){return 360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90}class Yd{constructor(r,l,f=0){this.x=+r,this.y=+l,this.z=+f}static fromLngLat(r,l=0){const f=Ql.convert(r);return new Yd(d0(f.lng),m0(f.lat),g0(l,f.lat))}toLngLat(){return new Ql(360*this.x-180,jg(this.y))}toAltitude(){return this.z*f0(jg(this.y))}meterInMercatorCoordinateUnits(){return 1/p0*(r=jg(this.y),1/Math.cos(r*Math.PI/180));var r}}function _0(a,r,l){var f=2*Math.PI*6378137/256/Math.pow(2,l);return[a*f-2*Math.PI*6378137/2,r*f-2*Math.PI*6378137/2]}class Zg{constructor(r,l,f){if(r<0||r>25||f<0||f>=Math.pow(2,r)||l<0||l>=Math.pow(2,r))throw new Error(`x=${l}, y=${f}, z=${r} outside of bounds. 0<=x<${Math.pow(2,r)}, 0<=y<${Math.pow(2,r)} 0<=z<=25 `);this.z=r,this.x=l,this.y=f,this.key=$p(0,r,r,l,f)}equals(r){return this.z===r.z&&this.x===r.x&&this.y===r.y}url(r,l,f){const m=(b=this.y,S=this.z,C=_0(256*(v=this.x),256*(b=Math.pow(2,S)-b-1),S),P=_0(256*(v+1),256*(b+1),S),C[0]+","+C[1]+","+P[0]+","+P[1]);var v,b,S,C,P;const D=function(R,B,j){let W,Q="";for(let rt=R;rt>0;rt--)W=1<1?"@2x":"").replace(/{quadkey}/g,D).replace(/{bbox-epsg-3857}/g,m)}isChildOf(r){const l=this.z-r.z;return l>0&&r.x===this.x>>l&&r.y===this.y>>l}getTilePoint(r){const l=Math.pow(2,this.z);return new L((r.x*l-this.x)*bi,(r.y*l-this.y)*bi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class y0{constructor(r,l){this.wrap=r,this.canonical=l,this.key=$p(r,l.z,l.z,l.x,l.y)}}class ps{constructor(r,l,f,m,v){if(r= z; overscaledZ = ${r}; z = ${f}`);this.overscaledZ=r,this.wrap=l,this.canonical=new Zg(f,+m,+v),this.key=$p(l,r,f,m,v)}clone(){return new ps(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(r){return this.overscaledZ===r.overscaledZ&&this.wrap===r.wrap&&this.canonical.equals(r.canonical)}scaledTo(r){if(r>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);const l=this.canonical.z-r;return r>this.canonical.z?new ps(r,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ps(r,this.wrap,r,this.canonical.x>>l,this.canonical.y>>l)}calculateScaledKey(r,l){if(r>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);const f=this.canonical.z-r;return r>this.canonical.z?$p(this.wrap*+l,r,this.canonical.z,this.canonical.x,this.canonical.y):$p(this.wrap*+l,r,r,this.canonical.x>>f,this.canonical.y>>f)}isChildOf(r){if(r.wrap!==this.wrap)return!1;const l=this.canonical.z-r.canonical.z;return r.overscaledZ===0||r.overscaledZ>l&&r.canonical.y===this.canonical.y>>l}children(r){if(this.overscaledZ>=r)return[new ps(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const l=this.canonical.z+1,f=2*this.canonical.x,m=2*this.canonical.y;return[new ps(l,this.wrap,l,f,m),new ps(l,this.wrap,l,f+1,m),new ps(l,this.wrap,l,f,m+1),new ps(l,this.wrap,l,f+1,m+1)]}isLessThan(r){return this.wrapr.wrap)&&(this.overscaledZr.overscaledZ)&&(this.canonical.xr.canonical.x)&&this.canonical.ythis.max&&(this.max=R),R=this.dim+1||l<-1||l>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(l+1)*this.stride+(r+1)}unpack(r,l,f){return r*this.redFactor+l*this.greenFactor+f*this.blueFactor-this.baseShift}getPixels(){return new hs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(r,l,f){if(this.dim!==r.dim)throw new Error("dem dimension mismatch");let m=l*this.dim,v=l*this.dim+this.dim,b=f*this.dim,S=f*this.dim+this.dim;switch(l){case-1:m=v-1;break;case 1:v=m+1}switch(f){case-1:b=S-1;break;case 1:S=b+1}const C=-l*this.dim,P=-f*this.dim;for(let D=b;D=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${r} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[r]}}class b0{constructor(r,l,f,m,v){this.type="Feature",this._vectorTileFeature=r,r._z=l,r._x=f,r._y=m,this.properties=r.properties,this.id=v}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(r){this._geometry=r}toJSON(){const r={geometry:this.geometry};for(const l in this)l!=="_geometry"&&l!=="_vectorTileFeature"&&(r[l]=this[l]);return r}}class w0{constructor(r,l){this.tileID=r,this.x=r.canonical.x,this.y=r.canonical.y,this.z=r.canonical.z,this.grid=new ll(bi,16,0),this.grid3D=new ll(bi,16,0),this.featureIndexArray=new z,this.promoteId=l}insert(r,l,f,m,v,b){const S=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(f,m,v);const C=b?this.grid3D:this.grid;for(let P=0;P=0&&R[3]>=0&&C.insert(S,R[0],R[1],R[2],R[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Yl.VectorTile(new Dg(this.rawTileData)).layers,this.sourceLayerCoder=new x0(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(r,l,f,m){this.loadVTLayers();const v=r.params||{},b=bi/r.tileSize/r.scale,S=Bc(v.filter),C=r.queryGeometry,P=r.queryPadding*b,D=E0(C),R=this.grid.query(D.minX-P,D.minY-P,D.maxX+P,D.maxY+P),B=E0(r.cameraQueryGeometry),j=this.grid3D.query(B.minX-P,B.minY-P,B.maxX+P,B.maxY+P,(rt,ct,Et,ft)=>function(xt,qt,Wt,de,we){for(const he of xt)if(qt<=he.x&&Wt<=he.y&&de>=he.x&&we>=he.y)return!0;const fe=[new L(qt,Wt),new L(qt,we),new L(de,we),new L(de,Wt)];if(xt.length>2){for(const he of fe)if(nh(xt,he))return!0}for(let he=0;he(ft||(ft=fl(xt)),qt.queryIntersectsFeature(C,xt,Wt,ft,this.z,r.transform,b,r.pixelPosMatrix)))}return W}loadMatchingFeature(r,l,f,m,v,b,S,C,P,D,R){const B=this.bucketLayerIDs[l];if(b&&!function(rt,ct){for(let Et=0;Et=0)return!0;return!1}(b,B))return;const j=this.sourceLayerCoder.decode(f),W=this.vtLayers[j].feature(m);if(v.needGeometry){const rt=dl(W,!0);if(!v.filter(new Hn(this.tileID.overscaledZ),rt,this.tileID.canonical))return}else if(!v.filter(new Hn(this.tileID.overscaledZ),W))return;const Q=this.getId(W,j);for(let rt=0;rt{const S=r instanceof Bu?r.get(b):null;return S&&S.evaluate?S.evaluate(l,f,m):S})}function E0(a){let r=1/0,l=1/0,f=-1/0,m=-1/0;for(const v of a)r=Math.min(r,v.x),l=Math.min(l,v.y),f=Math.max(f,v.x),m=Math.max(m,v.y);return{minX:r,minY:l,maxX:f,maxY:m}}function Qw(a,r){return r-a}function I0(a,r,l,f,m){const v=[];for(let b=0;b=f&&R.x>=f||(D.x>=f?D=new L(f,D.y+(f-D.x)/(R.x-D.x)*(R.y-D.y))._round():R.x>=f&&(R=new L(f,D.y+(f-D.x)/(R.x-D.x)*(R.y-D.y))._round()),D.y>=m&&R.y>=m||(D.y>=m?D=new L(D.x+(m-D.y)/(R.y-D.y)*(R.x-D.x),m)._round():R.y>=m&&(R=new L(D.x+(m-D.y)/(R.y-D.y)*(R.x-D.x),m)._round()),C&&D.equals(C[C.length-1])||(C=[D],v.push(C)),C.push(R)))))}}return v}_e("FeatureIndex",w0,{omit:["rawTileData","sourceLayerCoder"]});class $l extends L{constructor(r,l,f,m){super(r,l),this.angle=f,m!==void 0&&(this.segment=m)}clone(){return new $l(this.x,this.y,this.angle,this.segment)}}function C0(a,r,l,f,m){if(r.segment===void 0||l===0)return!0;let v=r,b=r.segment+1,S=0;for(;S>-l/2;){if(b--,b<0)return!1;S-=a[b].dist(v),v=a[b]}S+=a[b].dist(a[b+1]),b++;const C=[];let P=0;for(;Sf;)P-=C.shift().angleDelta;if(P>m)return!1;b++,S+=D.dist(R)}return!0}function T0(a){let r=0;for(let l=0;lP){const W=(P-C)/j,Q=qr.number(R.x,B.x,W),rt=qr.number(R.y,B.y,W),ct=new $l(Q,rt,B.angleTo(R),D);return ct._round(),!b||C0(a,ct,S,b,r)?ct:void 0}C+=j}}function t2(a,r,l,f,m,v,b,S,C){const P=L0(f,v,b),D=M0(f,m),R=D*b,B=a[0].x===0||a[0].x===C||a[0].y===0||a[0].y===C;return r-R=0&&xt=0&&qt=0&&B+P<=D){const Wt=new $l(xt,qt,Et,W);Wt._round(),f&&!C0(a,Wt,v,f,m)||j.push(Wt)}}R+=ct}return S||j.length||b||(j=P0(a,R/2,l,f,m,v,b,!0,C)),j}_e("Anchor",$l);const ch=Co;function A0(a,r,l,f){const m=[],v=a.image,b=v.pixelRatio,S=v.paddedRect.w-2*ch,C=v.paddedRect.h-2*ch,P=a.right-a.left,D=a.bottom-a.top,R=v.stretchX||[[0,S]],B=v.stretchY||[[0,C]],j=(se,ve)=>se+ve[1]-ve[0],W=R.reduce(j,0),Q=B.reduce(j,0),rt=S-W,ct=C-Q;let Et=0,ft=W,xt=0,qt=Q,Wt=0,de=rt,we=0,fe=ct;if(v.content&&f){const se=v.content;Et=Kd(R,0,se[0]),xt=Kd(B,0,se[1]),ft=Kd(R,se[0],se[2]),qt=Kd(B,se[1],se[3]),Wt=se[0]-Et,we=se[1]-xt,de=se[2]-se[0]-ft,fe=se[3]-se[1]-qt}const he=(se,ve,le,Qt)=>{const Me=Jd(se.stretch-Et,ft,P,a.left),Ie=Qd(se.fixed-Wt,de,se.stretch,W),rn=Jd(ve.stretch-xt,qt,D,a.top),Kn=Qd(ve.fixed-we,fe,ve.stretch,Q),ei=Jd(le.stretch-Et,ft,P,a.left),Ki=Qd(le.fixed-Wt,de,le.stretch,W),Yo=Jd(Qt.stretch-xt,qt,D,a.top),uo=Qd(Qt.fixed-we,fe,Qt.stretch,Q),qi=new L(Me,rn),yr=new L(ei,rn),Pr=new L(ei,Yo),co=new L(Me,Yo),ho=new L(Ie/b,Kn/b),Ji=new L(Ki/b,uo/b),Qi=r*Math.PI/180;if(Qi){const Yr=Math.sin(Qi),To=Math.cos(Qi),Lo=[To,-Yr,Yr,To];qi._matMult(Lo),yr._matMult(Lo),co._matMult(Lo),Pr._matMult(Lo)}const Xr=se.stretch+se.fixed,po=ve.stretch+ve.fixed;return{tl:qi,tr:yr,bl:co,br:Pr,tex:{x:v.paddedRect.x+ch+Xr,y:v.paddedRect.y+ch+po,w:le.stretch+le.fixed-Xr,h:Qt.stretch+Qt.fixed-po},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ho,pixelOffsetBR:Ji,minFontScaleX:de/b/P,minFontScaleY:fe/b/D,isSDF:l}};if(f&&(v.stretchX||v.stretchY)){const se=k0(R,rt,W),ve=k0(B,ct,Q);for(let le=0;le0&&(W=Math.max(10,W),this.circleDiameter=W)}else{let R=b.top*S-C[0],B=b.bottom*S+C[2],j=b.left*S-C[3],W=b.right*S+C[1];const Q=b.collisionPadding;if(Q&&(j-=Q[0]*S,R-=Q[1]*S,W+=Q[2]*S,B+=Q[3]*S),D){const rt=new L(j,R),ct=new L(W,R),Et=new L(j,B),ft=new L(W,B),xt=D*Math.PI/180;rt._rotate(xt),ct._rotate(xt),Et._rotate(xt),ft._rotate(xt),j=Math.min(rt.x,ct.x,Et.x,ft.x),W=Math.max(rt.x,ct.x,Et.x,ft.x),R=Math.min(rt.y,ct.y,Et.y,ft.y),B=Math.max(rt.y,ct.y,Et.y,ft.y)}r.emplaceBack(l.x,l.y,j,R,W,B,f,m,v)}this.boxEndIndex=r.length}}class e2{constructor(r=[],l=n2){if(this.data=r,this.length=this.data.length,this.compare=l,this.length>0)for(let f=(this.length>>1)-1;f>=0;f--)this._down(f)}push(r){this.data.push(r),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const r=this.data[0],l=this.data.pop();return this.length--,this.length>0&&(this.data[0]=l,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:l,compare:f}=this,m=l[r];for(;r>0;){const v=r-1>>1,b=l[v];if(f(m,b)>=0)break;l[r]=b,r=v}l[r]=m}_down(r){const{data:l,compare:f}=this,m=this.length>>1,v=l[r];for(;r=0)break;l[r]=S,r=b}l[r]=v}}function n2(a,r){return ar?1:0}function i2(a,r=1,l=!1){let f=1/0,m=1/0,v=-1/0,b=-1/0;const S=a[0];for(let j=0;jv)&&(v=W.x),(!j||W.y>b)&&(b=W.y)}const C=Math.min(v-f,b-m);let P=C/2;const D=new e2([],r2);if(C===0)return new L(f,m);for(let j=f;jR.d||!R.d)&&(R=j,l&&console.log("found best %d after %d probes",Math.round(1e4*j.d)/1e4,B)),j.max-R.d<=r||(P=j.h/2,D.push(new hh(j.p.x-P,j.p.y-P,P,a)),D.push(new hh(j.p.x+P,j.p.y-P,P,a)),D.push(new hh(j.p.x-P,j.p.y+P,P,a)),D.push(new hh(j.p.x+P,j.p.y+P,P,a)),B+=4)}return l&&(console.log(`num probes: ${B}`),console.log(`best distance: ${R.d}`)),R.p}function r2(a,r){return r.max-a.max}function hh(a,r,l,f){this.p=new L(a,r),this.h=l,this.d=function(m,v){let b=!1,S=1/0;for(let C=0;Cm.y!=W.y>m.y&&m.x<(W.x-j.x)*(m.y-j.y)/(W.y-j.y)+j.x&&(b=!b),S=Math.min(S,my(m,j,W))}}return(b?1:-1)*Math.sqrt(S)}(this.p,f),this.max=this.d+this.h*Math.SQRT2}var Mr;p.ap=void 0,(Mr=p.ap||(p.ap={}))[Mr.center=1]="center",Mr[Mr.left=2]="left",Mr[Mr.right=3]="right",Mr[Mr.top=4]="top",Mr[Mr.bottom=5]="bottom",Mr[Mr["top-left"]=6]="top-left",Mr[Mr["top-right"]=7]="top-right",Mr[Mr["bottom-left"]=8]="bottom-left",Mr[Mr["bottom-right"]=9]="bottom-right";const tu=7,Wg=Number.POSITIVE_INFINITY;function D0(a,r){return r[1]!==Wg?function(l,f,m){let v=0,b=0;switch(f=Math.abs(f),m=Math.abs(m),l){case"top-right":case"top-left":case"top":b=m-tu;break;case"bottom-right":case"bottom-left":case"bottom":b=-m+tu}switch(l){case"top-right":case"bottom-right":case"right":v=-f;break;case"top-left":case"bottom-left":case"left":v=f}return[v,b]}(a,r[0],r[1]):function(l,f){let m=0,v=0;f<0&&(f=0);const b=f/Math.SQRT2;switch(l){case"top-right":case"top-left":v=b-tu;break;case"bottom-right":case"bottom-left":v=-b+tu;break;case"bottom":v=-f+tu;break;case"top":v=f-tu}switch(l){case"top-right":case"bottom-right":m=-b;break;case"top-left":case"bottom-left":m=b;break;case"left":m=f;break;case"right":m=-f}return[m,v]}(a,r[0])}function R0(a,r,l){var f;const m=a.layout,v=(f=m.get("text-variable-anchor-offset"))===null||f===void 0?void 0:f.evaluate(r,{},l);if(v){const S=v.values,C=[];for(let P=0;PB*Yi);D.startsWith("top")?R[1]-=tu:D.startsWith("bottom")&&(R[1]+=tu),C[P+1]=R}return new Zo(C)}const b=m.get("text-variable-anchor");if(b){let S;S=a._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[m.get("text-radial-offset").evaluate(r,{},l)*Yi,Wg]:m.get("text-offset").evaluate(r,{},l).map(P=>P*Yi);const C=[];for(const P of b)C.push(P,D0(P,S));return new Zo(C)}return null}function Hg(a){switch(a){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function o2(a,r,l,f,m,v,b,S,C,P,D){let R=v.textMaxSize.evaluate(r,{});R===void 0&&(R=b);const B=a.layers[0].layout,j=B.get("icon-offset").evaluate(r,{},D),W=z0(l.horizontal),Q=b/24,rt=a.tilePixelRatio*Q,ct=a.tilePixelRatio*R/24,Et=a.tilePixelRatio*S,ft=a.tilePixelRatio*B.get("symbol-spacing"),xt=B.get("text-padding")*a.tilePixelRatio,qt=function(Qt,Me,Ie,rn=1){const Kn=Qt.get("icon-padding").evaluate(Me,{},Ie),ei=Kn&&Kn.values;return[ei[0]*rn,ei[1]*rn,ei[2]*rn,ei[3]*rn]}(B,r,D,a.tilePixelRatio),Wt=B.get("text-max-angle")/180*Math.PI,de=B.get("text-rotation-alignment")!=="viewport"&&B.get("symbol-placement")!=="point",we=B.get("icon-rotation-alignment")==="map"&&B.get("symbol-placement")!=="point",fe=B.get("symbol-placement"),he=ft/2,se=B.get("icon-text-fit");let ve;f&&se!=="none"&&(a.allowVerticalPlacement&&l.vertical&&(ve=o0(f,l.vertical,se,B.get("icon-text-fit-padding"),j,Q)),W&&(f=o0(f,W,se,B.get("icon-text-fit-padding"),j,Q)));const le=(Qt,Me)=>{Me.x<0||Me.x>=bi||Me.y<0||Me.y>=bi||function(Ie,rn,Kn,ei,Ki,Yo,uo,qi,yr,Pr,co,ho,Ji,Qi,Xr,po,Yr,To,Lo,$i,fn,Kr,Ar,tr,As){const oa=Ie.addToLineVertexArray(rn,Kn);let sa,gl,ks,fs,Mo=0,_l=0,nf=0,V0=0,e_=-1,n_=-1;const yl={};let U0=Fn("");if(Ie.allowVerticalPlacement&&ei.vertical){const Jr=qi.layout.get("text-rotate").evaluate(fn,{},tr)+90;ks=new $d(yr,rn,Pr,co,ho,ei.vertical,Ji,Qi,Xr,Jr),uo&&(fs=new $d(yr,rn,Pr,co,ho,uo,Yr,To,Xr,Jr))}if(Ki){const Jr=qi.layout.get("icon-rotate").evaluate(fn,{}),ds=qi.layout.get("icon-text-fit")!=="none",Wu=A0(Ki,Jr,Ar,ds),la=uo?A0(uo,Jr,Ar,ds):void 0;gl=new $d(yr,rn,Pr,co,ho,Ki,Yr,To,!1,Jr),Mo=4*Wu.length;const Hu=Ie.iconSizeData;let Ra=null;Hu.kind==="source"?(Ra=[Da*qi.layout.get("icon-size").evaluate(fn,{})],Ra[0]>Jl&&ie(`${Ie.layerIds[0]}: Value for "icon-size" is >= ${Qp}. Reduce your "icon-size".`)):Hu.kind==="composite"&&(Ra=[Da*Kr.compositeIconSizes[0].evaluate(fn,{},tr),Da*Kr.compositeIconSizes[1].evaluate(fn,{},tr)],(Ra[0]>Jl||Ra[1]>Jl)&&ie(`${Ie.layerIds[0]}: Value for "icon-size" is >= ${Qp}. Reduce your "icon-size".`)),Ie.addSymbols(Ie.icon,Wu,Ra,$i,Lo,fn,p.ah.none,rn,oa.lineStartIndex,oa.lineLength,-1,tr),e_=Ie.icon.placedSymbolArray.length-1,la&&(_l=4*la.length,Ie.addSymbols(Ie.icon,la,Ra,$i,Lo,fn,p.ah.vertical,rn,oa.lineStartIndex,oa.lineLength,-1,tr),n_=Ie.icon.placedSymbolArray.length-1)}const G0=Object.keys(ei.horizontal);for(const Jr of G0){const ds=ei.horizontal[Jr];if(!sa){U0=Fn(ds.text);const la=qi.layout.get("text-rotate").evaluate(fn,{},tr);sa=new $d(yr,rn,Pr,co,ho,ds,Ji,Qi,Xr,la)}const Wu=ds.positionedLines.length===1;if(nf+=N0(Ie,rn,ds,Yo,qi,Xr,fn,po,oa,ei.vertical?p.ah.horizontal:p.ah.horizontalOnly,Wu?G0:[Jr],yl,e_,Kr,tr),Wu)break}ei.vertical&&(V0+=N0(Ie,rn,ei.vertical,Yo,qi,Xr,fn,po,oa,p.ah.vertical,["vertical"],yl,n_,Kr,tr));const l2=sa?sa.boxStartIndex:Ie.collisionBoxArray.length,u2=sa?sa.boxEndIndex:Ie.collisionBoxArray.length,c2=ks?ks.boxStartIndex:Ie.collisionBoxArray.length,h2=ks?ks.boxEndIndex:Ie.collisionBoxArray.length,p2=gl?gl.boxStartIndex:Ie.collisionBoxArray.length,f2=gl?gl.boxEndIndex:Ie.collisionBoxArray.length,d2=fs?fs.boxStartIndex:Ie.collisionBoxArray.length,m2=fs?fs.boxEndIndex:Ie.collisionBoxArray.length;let aa=-1;const em=(Jr,ds)=>Jr&&Jr.circleDiameter?Math.max(Jr.circleDiameter,ds):ds;aa=em(sa,aa),aa=em(ks,aa),aa=em(gl,aa),aa=em(fs,aa);const q0=aa>-1?1:0;q0&&(aa*=As/Yi),Ie.glyphOffsetArray.length>=uh.MAX_GLYPHS&&ie("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),fn.sortKey!==void 0&&Ie.addToSortKeyRanges(Ie.symbolInstances.length,fn.sortKey);const g2=R0(qi,fn,tr),[_2,y2]=function(Jr,ds){const Wu=Jr.length,la=ds==null?void 0:ds.values;if((la==null?void 0:la.length)>0)for(let Hu=0;Hu=0?yl.right:-1,yl.center>=0?yl.center:-1,yl.left>=0?yl.left:-1,yl.vertical||-1,e_,n_,U0,l2,u2,c2,h2,p2,f2,d2,m2,Pr,nf,V0,Mo,_l,q0,0,Ji,aa,_2,y2)}(a,Me,Qt,l,f,m,ve,a.layers[0],a.collisionBoxArray,r.index,r.sourceLayerIndex,a.index,rt,[xt,xt,xt,xt],de,C,Et,qt,we,j,r,v,P,D,b)};if(fe==="line")for(const Qt of I0(r.geometry,0,0,bi,bi)){const Me=t2(Qt,ft,Wt,l.vertical||W,f,24,ct,a.overscaling,bi);for(const Ie of Me)W&&s2(a,W.text,he,Ie)||le(Qt,Ie)}else if(fe==="line-center"){for(const Qt of r.geometry)if(Qt.length>1){const Me=$w(Qt,Wt,l.vertical||W,f,24,ct);Me&&le(Qt,Me)}}else if(r.type==="Polygon")for(const Qt of Ig(r.geometry,0)){const Me=i2(Qt,16);le(Qt[0],new $l(Me.x,Me.y,0))}else if(r.type==="LineString")for(const Qt of r.geometry)le(Qt,new $l(Qt[0].x,Qt[0].y,0));else if(r.type==="Point")for(const Qt of r.geometry)for(const Me of Qt)le([Me],new $l(Me.x,Me.y,0))}function N0(a,r,l,f,m,v,b,S,C,P,D,R,B,j,W){const Q=function(Et,ft,xt,qt,Wt,de,we,fe){const he=qt.layout.get("text-rotate").evaluate(de,{})*Math.PI/180,se=[];for(const ve of ft.positionedLines)for(const le of ve.positionedGlyphs){if(!le.rect)continue;const Qt=le.rect||{};let Me=Qy+1,Ie=!0,rn=1,Kn=0;const ei=(Wt||fe)&&le.vertical,Ki=le.metrics.advance*le.scale/2;if(fe&&ft.verticalizable&&(Kn=ve.lineOffset/2-(le.imageName?-(Yi-le.metrics.width*le.scale)/2:(le.scale-1)*Yi)),le.imageName){const $i=we[le.imageName];Ie=$i.sdf,rn=$i.pixelRatio,Me=Co/rn}const Yo=Wt?[le.x+Ki,le.y]:[0,0];let uo=Wt?[0,0]:[le.x+Ki+xt[0],le.y+xt[1]-Kn],qi=[0,0];ei&&(qi=uo,uo=[0,0]);const yr=le.metrics.isDoubleResolution?2:1,Pr=(le.metrics.left-Me)*le.scale-Ki+uo[0],co=(-le.metrics.top-Me)*le.scale+uo[1],ho=Pr+Qt.w/yr*le.scale/rn,Ji=co+Qt.h/yr*le.scale/rn,Qi=new L(Pr,co),Xr=new L(ho,co),po=new L(Pr,Ji),Yr=new L(ho,Ji);if(ei){const $i=new L(-Ki,Ki-Kp),fn=-Math.PI/2,Kr=Yi/2-Ki,Ar=new L(5-Kp-Kr,-(le.imageName?Kr:0)),tr=new L(...qi);Qi._rotateAround(fn,$i)._add(Ar)._add(tr),Xr._rotateAround(fn,$i)._add(Ar)._add(tr),po._rotateAround(fn,$i)._add(Ar)._add(tr),Yr._rotateAround(fn,$i)._add(Ar)._add(tr)}if(he){const $i=Math.sin(he),fn=Math.cos(he),Kr=[fn,-$i,$i,fn];Qi._matMult(Kr),Xr._matMult(Kr),po._matMult(Kr),Yr._matMult(Kr)}const To=new L(0,0),Lo=new L(0,0);se.push({tl:Qi,tr:Xr,bl:po,br:Yr,tex:Qt,writingMode:ft.writingMode,glyphOffset:Yo,sectionIndex:le.sectionIndex,isSDF:Ie,pixelOffsetTL:To,pixelOffsetBR:Lo,minFontScaleX:0,minFontScaleY:0})}return se}(0,l,S,m,v,b,f,a.allowVerticalPlacement),rt=a.textSizeData;let ct=null;rt.kind==="source"?(ct=[Da*m.layout.get("text-size").evaluate(b,{})],ct[0]>Jl&&ie(`${a.layerIds[0]}: Value for "text-size" is >= ${Qp}. Reduce your "text-size".`)):rt.kind==="composite"&&(ct=[Da*j.compositeTextSizes[0].evaluate(b,{},W),Da*j.compositeTextSizes[1].evaluate(b,{},W)],(ct[0]>Jl||ct[1]>Jl)&&ie(`${a.layerIds[0]}: Value for "text-size" is >= ${Qp}. Reduce your "text-size".`)),a.addSymbols(a.text,Q,ct,S,v,b,P,r,C.lineStartIndex,C.lineLength,B,W);for(const Et of D)R[Et]=a.text.placedSymbolArray.length-1;return 4*Q.length}function z0(a){for(const r in a)return a[r];return null}function s2(a,r,l,f){const m=a.compareText;if(r in m){const v=m[r];for(let b=v.length-1;b>=0;b--)if(f.dist(v[b])>4;if(m!==1)throw new Error(`Got v${m} data when expected v1.`);const v=O0[15&f];if(!v)throw new Error("Unrecognized array type.");const[b]=new Uint16Array(r,2,1),[S]=new Uint32Array(r,4,1);return new Xg(S,b,v,r)}constructor(r,l=64,f=Float64Array,m){if(isNaN(r)||r<0)throw new Error(`Unpexpected numItems value: ${r}.`);this.numItems=+r,this.nodeSize=Math.min(Math.max(+l,2),65535),this.ArrayType=f,this.IndexArrayType=r<65536?Uint16Array:Uint32Array;const v=O0.indexOf(this.ArrayType),b=2*r*this.ArrayType.BYTES_PER_ELEMENT,S=r*this.IndexArrayType.BYTES_PER_ELEMENT,C=(8-S%8)%8;if(v<0)throw new Error(`Unexpected typed array class: ${f}.`);m&&m instanceof ArrayBuffer?(this.data=m,this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+S+C,2*r),this._pos=2*r,this._finished=!0):(this.data=new ArrayBuffer(8+b+S+C),this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+S+C,2*r),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+v]),new Uint16Array(this.data,2,1)[0]=l,new Uint32Array(this.data,4,1)[0]=r)}add(r,l){const f=this._pos>>1;return this.ids[f]=f,this.coords[this._pos++]=r,this.coords[this._pos++]=l,f}finish(){const r=this._pos>>1;if(r!==this.numItems)throw new Error(`Added ${r} items when expected ${this.numItems}.`);return Yg(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(r,l,f,m){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:v,coords:b,nodeSize:S}=this,C=[0,v.length-1,0],P=[];for(;C.length;){const D=C.pop()||0,R=C.pop()||0,B=C.pop()||0;if(R-B<=S){for(let rt=B;rt<=R;rt++){const ct=b[2*rt],Et=b[2*rt+1];ct>=r&&ct<=f&&Et>=l&&Et<=m&&P.push(v[rt])}continue}const j=B+R>>1,W=b[2*j],Q=b[2*j+1];W>=r&&W<=f&&Q>=l&&Q<=m&&P.push(v[j]),(D===0?r<=W:l<=Q)&&(C.push(B),C.push(j-1),C.push(1-D)),(D===0?f>=W:m>=Q)&&(C.push(j+1),C.push(R),C.push(1-D))}return P}within(r,l,f){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:m,coords:v,nodeSize:b}=this,S=[0,m.length-1,0],C=[],P=f*f;for(;S.length;){const D=S.pop()||0,R=S.pop()||0,B=S.pop()||0;if(R-B<=b){for(let rt=B;rt<=R;rt++)B0(v[2*rt],v[2*rt+1],r,l)<=P&&C.push(m[rt]);continue}const j=B+R>>1,W=v[2*j],Q=v[2*j+1];B0(W,Q,r,l)<=P&&C.push(m[j]),(D===0?r-f<=W:l-f<=Q)&&(S.push(B),S.push(j-1),S.push(1-D)),(D===0?r+f>=W:l+f>=Q)&&(S.push(j+1),S.push(R),S.push(1-D))}return C}}function Yg(a,r,l,f,m,v){if(m-f<=l)return;const b=f+m>>1;F0(a,r,b,f,m,v),Yg(a,r,l,f,b-1,1-v),Yg(a,r,l,b+1,m,1-v)}function F0(a,r,l,f,m,v){for(;m>f;){if(m-f>600){const P=m-f+1,D=l-f+1,R=Math.log(P),B=.5*Math.exp(2*R/3),j=.5*Math.sqrt(R*B*(P-B)/P)*(D-P/2<0?-1:1);F0(a,r,l,Math.max(f,Math.floor(l-D*B/P+j)),Math.min(m,Math.floor(l+(P-D)*B/P+j)),v)}const b=r[2*l+v];let S=f,C=m;for(tf(a,r,f,l),r[2*m+v]>b&&tf(a,r,f,m);Sb;)C--}r[2*f+v]===b?tf(a,r,f,C):(C++,tf(a,r,C,m)),C<=l&&(f=C+1),l<=C&&(m=C-1)}}function tf(a,r,l,f){Kg(a,l,f),Kg(r,2*l,2*f),Kg(r,2*l+1,2*f+1)}function Kg(a,r,l){const f=a[r];a[r]=a[l],a[l]=f}function B0(a,r,l,f){const m=a-l,v=r-f;return m*m+v*v}var Jg;p.bc=void 0,(Jg=p.bc||(p.bc={})).create="create",Jg.load="load",Jg.fullLoad="fullLoad";let tm=null,ef=[];const Qg=1e3/60,$g="loadTime",t_="fullLoadTime",a2={mark(a){performance.mark(a)},frame(a){const r=a;tm!=null&&ef.push(r-tm),tm=r},clearMetrics(){tm=null,ef=[],performance.clearMeasures($g),performance.clearMeasures(t_);for(const a in p.bc)performance.clearMarks(p.bc[a])},getPerformanceMetrics(){performance.measure($g,p.bc.create,p.bc.load),performance.measure(t_,p.bc.create,p.bc.fullLoad);const a=performance.getEntriesByName($g)[0].duration,r=performance.getEntriesByName(t_)[0].duration,l=ef.length,f=1/(ef.reduce((v,b)=>v+b,0)/l/1e3),m=ef.filter(v=>v>Qg).reduce((v,b)=>v+(b-Qg)/Qg,0);return{loadTime:a,fullLoadTime:r,fps:f,percentDroppedFrames:m/(l+m)*100,totalFrames:l}}};p.$=ze,p.A=ih,p.B=function(a){if(re==null){const r=a.navigator?a.navigator.userAgent:null;re=!!a.safari||!(!r||!(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))}return re},p.C=class{constructor(a,r){this.target=a,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Jw(()=>this.process()),this.subscription=function(l,f,m,v){return l.addEventListener(f,m,!1),{unsubscribe:()=>{l.removeEventListener(f,m,!1)}}}(this.target,"message",l=>this.receive(l)),this.globalScope=Kt(self)?a:window}registerMessageHandler(a,r){this.messageHandlers[a]=r}sendAsync(a,r){return new Promise((l,f)=>{const m=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[m]={resolve:l,reject:f},r&&r.signal.addEventListener("abort",()=>{delete this.resolveRejects[m];const S={id:m,type:"",origin:location.origin,targetMapId:a.targetMapId,sourceMapId:this.mapId};this.target.postMessage(S)},{once:!0});const v=[],b=Object.assign(Object.assign({},a),{id:m,sourceMapId:this.mapId,origin:location.origin,data:jl(a.data,v)});this.target.postMessage(b,{transfer:v})})}receive(a){const r=a.data,l=r.id;if(!(r.origin!=="file://"&&location.origin!=="file://"&&r.origin!==location.origin||r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type===""){delete this.tasks[l];const f=this.abortControllers[l];return delete this.abortControllers[l],void(f&&f.abort())}if(Kt(self)||r.mustQueue)return this.tasks[l]=r,this.taskQueue.push(l),void this.invoker.trigger();this.processTask(l,r)}}process(){if(this.taskQueue.length===0)return;const a=this.taskQueue.shift(),r=this.tasks[a];delete this.tasks[a],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(a,r)}processTask(a,r){return u(this,void 0,void 0,function*(){if(r.type===""){const m=this.resolveRejects[a];return delete this.resolveRejects[a],m?void(r.error?m.reject(Ou(r.error)):m.resolve(Ou(r.data))):void 0}if(!this.messageHandlers[r.type])return void this.completeTask(a,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const l=Ou(r.data),f=new AbortController;this.abortControllers[a]=f;try{const m=yield this.messageHandlers[r.type](r.sourceMapId,l,f);this.completeTask(a,null,m)}catch(m){this.completeTask(a,m)}})}completeTask(a,r,l){const f=[];delete this.abortControllers[a];const m={id:a,type:"",sourceMapId:this.mapId,origin:location.origin,error:r?jl(r):null,data:jl(l,f)};this.target.postMessage(m,{transfer:f})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},p.D=Ee,p.E=oi,p.F=function(){var a=new ih(16);return ih!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=0,a[12]=0,a[13]=0,a[14]=0),a[0]=1,a[5]=1,a[10]=1,a[15]=1,a},p.G=jn,p.H=function(a,r,l){var f,m,v,b,S,C,P,D,R,B,j,W,Q=l[0],rt=l[1],ct=l[2];return r===a?(a[12]=r[0]*Q+r[4]*rt+r[8]*ct+r[12],a[13]=r[1]*Q+r[5]*rt+r[9]*ct+r[13],a[14]=r[2]*Q+r[6]*rt+r[10]*ct+r[14],a[15]=r[3]*Q+r[7]*rt+r[11]*ct+r[15]):(m=r[1],v=r[2],b=r[3],S=r[4],C=r[5],P=r[6],D=r[7],R=r[8],B=r[9],j=r[10],W=r[11],a[0]=f=r[0],a[1]=m,a[2]=v,a[3]=b,a[4]=S,a[5]=C,a[6]=P,a[7]=D,a[8]=R,a[9]=B,a[10]=j,a[11]=W,a[12]=f*Q+S*rt+R*ct+r[12],a[13]=m*Q+C*rt+B*ct+r[13],a[14]=v*Q+P*rt+j*ct+r[14],a[15]=b*Q+D*rt+W*ct+r[15]),a},p.I=Ng,p.J=function(a,r,l){var f=l[0],m=l[1],v=l[2];return a[0]=r[0]*f,a[1]=r[1]*f,a[2]=r[2]*f,a[3]=r[3]*f,a[4]=r[4]*m,a[5]=r[5]*m,a[6]=r[6]*m,a[7]=r[7]*m,a[8]=r[8]*v,a[9]=r[9]*v,a[10]=r[10]*v,a[11]=r[11]*v,a[12]=r[12],a[13]=r[13],a[14]=r[14],a[15]=r[15],a},p.K=vy,p.L=function(a,r){const l={};for(let f=0;f{const r=window.document.createElement("video");return r.muted=!0,new Promise(l=>{r.onloadstart=()=>{l(r)};for(const f of a){const m=window.document.createElement("source");vi(f)||(r.crossOrigin="Anonymous"),m.src=f,r.appendChild(m)}})},p.a3=function(){return pt++},p.a4=o,p.a5=uh,p.a6=Bc,p.a7=dl,p.a8=Hn,p.a9=b0,p.aA=yt,p.aB=function(a,r){if(!a)return[{command:"setStyle",args:[r]}];let l=[];try{if(!nn(a.version,r.version))return[{command:"setStyle",args:[r]}];nn(a.center,r.center)||l.push({command:"setCenter",args:[r.center]}),nn(a.zoom,r.zoom)||l.push({command:"setZoom",args:[r.zoom]}),nn(a.bearing,r.bearing)||l.push({command:"setBearing",args:[r.bearing]}),nn(a.pitch,r.pitch)||l.push({command:"setPitch",args:[r.pitch]}),nn(a.sprite,r.sprite)||l.push({command:"setSprite",args:[r.sprite]}),nn(a.glyphs,r.glyphs)||l.push({command:"setGlyphs",args:[r.glyphs]}),nn(a.transition,r.transition)||l.push({command:"setTransition",args:[r.transition]}),nn(a.light,r.light)||l.push({command:"setLight",args:[r.light]}),nn(a.terrain,r.terrain)||l.push({command:"setTerrain",args:[r.terrain]}),nn(a.sky,r.sky)||l.push({command:"setSky",args:[r.sky]});const f={},m=[];(function(b,S,C,P){let D;for(D in S=S||{},b=b||{})Object.prototype.hasOwnProperty.call(b,D)&&(Object.prototype.hasOwnProperty.call(S,D)||ss(D,C,P));for(D in S)Object.prototype.hasOwnProperty.call(S,D)&&(Object.prototype.hasOwnProperty.call(b,D)?nn(b[D],S[D])||(b[D].type==="geojson"&&S[D].type==="geojson"&&Ia(b,S,D)?$n(C,{command:"setGeoJSONSourceData",args:[D,S[D].data]}):Ts(D,S,C,P)):_r(D,S,C))})(a.sources,r.sources,m,f);const v=[];a.layers&&a.layers.forEach(b=>{"source"in b&&f[b.source]?l.push({command:"removeLayer",args:[b.id]}):v.push(b)}),l=l.concat(m),function(b,S,C){S=S||[];const P=(b=b||[]).map(tl),D=S.map(tl),R=b.reduce(as,{}),B=S.reduce(as,{}),j=P.slice(),W=Object.create(null);let Q,rt,ct,Et,ft;for(let xt=0,qt=0;xt@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(l,f,m,v)=>{const b=m||v;return r[f]=!b||b.toLowerCase(),""}),r["max-age"]){const l=parseInt(r["max-age"],10);isNaN(l)?delete r["max-age"]:r["max-age"]=l}return r},p.ab=function(a,r){const l=[];for(const f in a)f in r||l.push(f);return l},p.ac=at,p.ad=function(a,r,l){var f=Math.sin(l),m=Math.cos(l),v=r[0],b=r[1],S=r[2],C=r[3],P=r[4],D=r[5],R=r[6],B=r[7];return r!==a&&(a[8]=r[8],a[9]=r[9],a[10]=r[10],a[11]=r[11],a[12]=r[12],a[13]=r[13],a[14]=r[14],a[15]=r[15]),a[0]=v*m+P*f,a[1]=b*m+D*f,a[2]=S*m+R*f,a[3]=C*m+B*f,a[4]=P*m-v*f,a[5]=D*m-b*f,a[6]=R*m-S*f,a[7]=B*m-C*f,a},p.ae=function(a){var r=new ih(16);return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r[4]=a[4],r[5]=a[5],r[6]=a[6],r[7]=a[7],r[8]=a[8],r[9]=a[9],r[10]=a[10],r[11]=a[11],r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15],r},p.af=Fd,p.ag=function(a,r){let l=0,f=0;if(a.kind==="constant")f=a.layoutSize;else if(a.kind!=="source"){const{interpolationType:m,minZoom:v,maxZoom:b}=a,S=m?at(Cr.interpolationFactor(m,r,v,b),0,1):0;a.kind==="camera"?f=qr.number(a.minSize,a.maxSize,S):l=S}return{uSizeT:l,uSize:f}},p.ai=function(a,{uSize:r,uSizeT:l},{lowerSize:f,upperSize:m}){return a.kind==="source"?f/Da:a.kind==="composite"?qr.number(f/Da,m/Da,l):r},p.aj=Bg,p.ak=function(a,r,l,f){const m=r.y-a.y,v=r.x-a.x,b=f.y-l.y,S=f.x-l.x,C=b*v-S*m;if(C===0)return null;const P=(S*(a.y-l.y)-b*(a.x-l.x))/C;return new L(a.x+P*v,a.y+P*m)},p.al=I0,p.am=Bp,p.an=yg,p.ao=Yi,p.aq=Fg,p.ar=function(a,r){var l=r[0],f=r[1],m=r[2],v=r[3],b=r[4],S=r[5],C=r[6],P=r[7],D=r[8],R=r[9],B=r[10],j=r[11],W=r[12],Q=r[13],rt=r[14],ct=r[15],Et=l*S-f*b,ft=l*C-m*b,xt=l*P-v*b,qt=f*C-m*S,Wt=f*P-v*S,de=m*P-v*C,we=D*Q-R*W,fe=D*rt-B*W,he=D*ct-j*W,se=R*rt-B*Q,ve=R*ct-j*Q,le=B*ct-j*rt,Qt=Et*le-ft*ve+xt*se+qt*he-Wt*fe+de*we;return Qt?(a[0]=(S*le-C*ve+P*se)*(Qt=1/Qt),a[1]=(m*ve-f*le-v*se)*Qt,a[2]=(Q*de-rt*Wt+ct*qt)*Qt,a[3]=(B*Wt-R*de-j*qt)*Qt,a[4]=(C*he-b*le-P*fe)*Qt,a[5]=(l*le-m*he+v*fe)*Qt,a[6]=(rt*xt-W*de-ct*ft)*Qt,a[7]=(D*de-B*xt+j*ft)*Qt,a[8]=(b*ve-S*he+P*we)*Qt,a[9]=(f*he-l*ve-v*we)*Qt,a[10]=(W*Wt-Q*xt+ct*Et)*Qt,a[11]=(R*xt-D*Wt-j*Et)*Qt,a[12]=(S*fe-b*se-C*we)*Qt,a[13]=(l*se-f*fe+m*we)*Qt,a[14]=(Q*ft-W*qt-rt*Et)*Qt,a[15]=(D*qt-R*ft+B*Et)*Qt,a):null},p.as=Hg,p.at=Og,p.au=Xg,p.av=function(){const a={},r=Pt.$version;for(const l in Pt.$root){const f=Pt.$root[l];if(f.required){let m=null;m=l==="version"?r:f.type==="array"?[]:{},m!=null&&(a[l]=m)}}return a},p.aw=Zc,p.ax=Ge,p.ay=function(a){a=a.slice();const r=Object.create(null);for(let l=0;lQt*Yi)}let fe=b?"center":l.get("text-justify").evaluate(P,{},a.canonical);const he=l.get("symbol-placement"),se=he==="point"?l.get("text-max-width").evaluate(P,{},a.canonical)*Yi:0,ve=()=>{a.bucket.allowVerticalPlacement&&Wc(xt)&&(W.vertical=Zd(Q,a.glyphMap,a.glyphPositions,a.imagePositions,D,se,v,de,"left",Wt,ct,p.ah.vertical,!0,he,B,R))};if(!b&&we){const le=new Set;if(fe==="auto")for(let Me=0;Meu(void 0,void 0,void 0,function*(){if(a.byteLength===0)return createImageBitmap(new ImageData(1,1));const r=new Blob([new Uint8Array(a)],{type:"image/png"});try{return createImageBitmap(r)}catch(l){throw new Error(`Could not load image because of ${l.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),p.e=dt,p.f=a=>new Promise((r,l)=>{const f=new Image;f.onload=()=>{r(f),URL.revokeObjectURL(f.src),f.onload=null,window.requestAnimationFrame(()=>{f.src=Ue})},f.onerror=()=>l(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 m=new Blob([new Uint8Array(a)],{type:"image/png"});f.src=a.byteLength?URL.createObjectURL(m):Ue}),p.g=zn,p.h=(a,r)=>cn(dt(a,{type:"json"}),r),p.i=Kt,p.j=be,p.k=jt,p.l=(a,r)=>cn(dt(a,{type:"arrayBuffer"}),r),p.m=cn,p.n=function(a){return new Dg(a).readFields(zw,[])},p.o=Gp,p.p=$y,p.q=Zr,p.r=bp,p.s=vi,p.t=Ed,p.u=pe,p.v=Pt,p.w=ie,p.x=Nu,p.y=function([a,r,l]){return r+=90,r*=Math.PI/180,l*=Math.PI/180,{x:a*Math.cos(r)*Math.sin(l),y:a*Math.sin(r)*Math.sin(l),z:a*Math.cos(l)}},p.z=qr}),s("worker",["./shared"],function(p){class u{constructor(F){this.keyCache={},F&&this.replace(F)}replace(F){this._layerConfigs={},this._layers={},this.update(F,[])}update(F,q){for(const et of F){this._layerConfigs[et.id]=et;const gt=this._layers[et.id]=p.az(et);gt._featureFilter=p.a6(gt.filter),this.keyCache[et.id]&&delete this.keyCache[et.id]}for(const et of q)delete this.keyCache[et],delete this._layerConfigs[et],delete this._layers[et];this.familiesBySource={};const H=p.bg(Object.values(this._layerConfigs),this.keyCache);for(const et of H){const gt=et.map(Nt=>this._layers[Nt.id]),K=gt[0];if(K.visibility==="none")continue;const _t=K.source||"";let ht=this.familiesBySource[_t];ht||(ht=this.familiesBySource[_t]={});const St=K.sourceLayer||"_geojsonTileLayer";let At=ht[St];At||(At=ht[St]=[]),At.push(gt)}}}class x{constructor(F){const q={},H=[];for(const _t in F){const ht=F[_t],St=q[_t]={};for(const At in ht){const Nt=ht[+At];if(!Nt||Nt.bitmap.width===0||Nt.bitmap.height===0)continue;const Gt={x:0,y:0,w:Nt.bitmap.width+2,h:Nt.bitmap.height+2};H.push(Gt),St[At]={rect:Gt,metrics:Nt.metrics}}}const{w:et,h:gt}=p.p(H),K=new p.o({width:et||1,height:gt||1});for(const _t in F){const ht=F[_t];for(const St in ht){const At=ht[+St];if(!At||At.bitmap.width===0||At.bitmap.height===0)continue;const Nt=q[_t][St].rect;p.o.copy(At.bitmap,K,{x:0,y:0},{x:Nt.x+1,y:Nt.y+1},At.bitmap)}}this.image=K,this.positions=q}}p.bh("GlyphAtlas",x);class w{constructor(F){this.tileID=new p.Q(F.tileID.overscaledZ,F.tileID.wrap,F.tileID.canonical.z,F.tileID.canonical.x,F.tileID.canonical.y),this.uid=F.uid,this.zoom=F.zoom,this.pixelRatio=F.pixelRatio,this.tileSize=F.tileSize,this.source=F.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=F.showCollisionBoxes,this.collectResourceTiming=!!F.collectResourceTiming,this.returnDependencies=!!F.returnDependencies,this.promoteId=F.promoteId,this.inFlightDependencies=[]}parse(F,q,H,et){return p._(this,void 0,void 0,function*(){this.status="parsing",this.data=F,this.collisionBoxArray=new p.a4;const gt=new p.bi(Object.keys(F.layers).sort()),K=new p.bj(this.tileID,this.promoteId);K.bucketLayerIDs=[];const _t={},ht={featureIndex:K,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:H},St=q.familiesBySource[this.source];for(const $e in St){const ci=F.layers[$e];if(!ci)continue;ci.version===1&&p.w(`Vector tile source "${this.source}" layer "${$e}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Zi=gt.encode($e),Gr=[];for(let ro=0;ro=sr.maxzoom||sr.visibility!=="none"&&(E(ro,this.zoom,H),(_t[sr.id]=sr.createBucket({index:K.bucketLayerIDs.length,layers:ro,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Zi,sourceID:this.source})).populate(Gr,ht,this.tileID.canonical),K.bucketLayerIDs.push(ro.map(Ls=>Ls.id)))}}const At=p.aE(ht.glyphDependencies,$e=>Object.keys($e).map(Number));this.inFlightDependencies.forEach($e=>$e==null?void 0:$e.abort()),this.inFlightDependencies=[];let Nt=Promise.resolve({});if(Object.keys(At).length){const $e=new AbortController;this.inFlightDependencies.push($e),Nt=et.sendAsync({type:"getGlyphs",data:{stacks:At,source:this.source,tileID:this.tileID,type:"glyphs"}},$e)}const Gt=Object.keys(ht.iconDependencies);let Se=Promise.resolve({});if(Gt.length){const $e=new AbortController;this.inFlightDependencies.push($e),Se=et.sendAsync({type:"getImages",data:{icons:Gt,source:this.source,tileID:this.tileID,type:"icons"}},$e)}const Ce=Object.keys(ht.patternDependencies);let qe=Promise.resolve({});if(Ce.length){const $e=new AbortController;this.inFlightDependencies.push($e),qe=et.sendAsync({type:"getImages",data:{icons:Ce,source:this.source,tileID:this.tileID,type:"patterns"}},$e)}const[je,mn,On]=yield Promise.all([Nt,Se,qe]),ti=new x(je),Ui=new p.bk(mn,On);for(const $e in _t){const ci=_t[$e];ci instanceof p.a5?(E(ci.layers,this.zoom,H),p.bl({bucket:ci,glyphMap:je,glyphPositions:ti.positions,imageMap:mn,imagePositions:Ui.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):ci.hasPattern&&(ci instanceof p.bm||ci instanceof p.bn||ci instanceof p.bo)&&(E(ci.layers,this.zoom,H),ci.addFeatures(ht,this.tileID.canonical,Ui.patternPositions))}return this.status="done",{buckets:Object.values(_t).filter($e=>!$e.isEmpty()),featureIndex:K,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ti.image,imageAtlas:Ui,glyphMap:this.returnDependencies?je:null,iconMap:this.returnDependencies?mn:null,glyphPositions:this.returnDependencies?ti.positions:null}})}}function E(ot,F,q){const H=new p.a8(F);for(const et of ot)et.recalculate(H,q)}class L{constructor(F,q,H){this.actor=F,this.layerIndex=q,this.availableImages=H,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(F,q){return p._(this,void 0,void 0,function*(){const H=yield p.l(F.request,q);try{return{vectorTile:new p.bp.VectorTile(new p.bq(H.data)),rawData:H.data,cacheControl:H.cacheControl,expires:H.expires}}catch(et){const gt=new Uint8Array(H.data);let K=`Unable to parse the tile at ${F.request.url}, `;throw K+=gt[0]===31&>[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${et.messge}`,new Error(K)}})}loadTile(F){return p._(this,void 0,void 0,function*(){const q=F.uid,H=!!(F&&F.request&&F.request.collectResourceTiming)&&new p.br(F.request),et=new w(F);this.loading[q]=et;const gt=new AbortController;et.abort=gt;try{const K=yield this.loadVectorTile(F,gt);if(delete this.loading[q],!K)return null;const _t=K.rawData,ht={};K.expires&&(ht.expires=K.expires),K.cacheControl&&(ht.cacheControl=K.cacheControl);const St={};if(H){const Nt=H.finish();Nt&&(St.resourceTiming=JSON.parse(JSON.stringify(Nt)))}et.vectorTile=K.vectorTile;const At=et.parse(K.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[q]=et,this.fetching[q]={rawTileData:_t,cacheControl:ht,resourceTiming:St};try{const Nt=yield At;return p.e({rawTileData:_t.slice(0)},Nt,ht,St)}finally{delete this.fetching[q]}}catch(K){throw delete this.loading[q],et.status="done",this.loaded[q]=et,K}})}reloadTile(F){return p._(this,void 0,void 0,function*(){const q=F.uid;if(!this.loaded||!this.loaded[q])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const H=this.loaded[q];if(H.showCollisionBoxes=F.showCollisionBoxes,H.status==="parsing"){const et=yield H.parse(H.vectorTile,this.layerIndex,this.availableImages,this.actor);let gt;if(this.fetching[q]){const{rawTileData:K,cacheControl:_t,resourceTiming:ht}=this.fetching[q];delete this.fetching[q],gt=p.e({rawTileData:K.slice(0)},et,_t,ht)}else gt=et;return gt}if(H.status==="done"&&H.vectorTile)return H.parse(H.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(F){return p._(this,void 0,void 0,function*(){const q=this.loading,H=F.uid;q&&q[H]&&q[H].abort&&(q[H].abort.abort(),delete q[H])})}removeTile(F){return p._(this,void 0,void 0,function*(){this.loaded&&this.loaded[F.uid]&&delete this.loaded[F.uid]})}}class A{constructor(){this.loaded={}}loadTile(F){return p._(this,void 0,void 0,function*(){const{uid:q,encoding:H,rawImageData:et,redFactor:gt,greenFactor:K,blueFactor:_t,baseShift:ht}=F,St=et.width+2,At=et.height+2,Nt=p.b(et)?new p.R({width:St,height:At},yield p.bs(et,-1,-1,St,At)):et,Gt=new p.bt(q,Nt,H,gt,K,_t,ht);return this.loaded=this.loaded||{},this.loaded[q]=Gt,Gt})}removeTile(F){const q=this.loaded,H=F.uid;q&&q[H]&&delete q[H]}}function V(ot,F){if(ot.length!==0){O(ot[0],F);for(var q=1;q=Math.abs(_t)?q-ht+_t:_t-ht+q,q=ht}q+H>=0!=!!F&&ot.reverse()}var J=p.bu(function ot(F,q){var H,et=F&&F.type;if(et==="FeatureCollection")for(H=0;H>31}function ae(ot,F){for(var q=ot.loadGeometry(),H=ot.type,et=0,gt=0,K=q.length,_t=0;_tot},Ue=Math.fround||(wn=new Float32Array(1),ot=>(wn[0]=+ot,wn[0]));var wn;const Qe=3,Pe=5,pn=6;class Sn{constructor(F){this.options=Object.assign(Object.create(Ne),F),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(F){const{log:q,minZoom:H,maxZoom:et}=this.options;q&&console.time("total time");const gt=`prepare ${F.length} points`;q&&console.time(gt),this.points=F;const K=[];for(let ht=0;ht=H;ht--){const St=+Date.now();_t=this.trees[ht]=this._createTree(this._cluster(_t,ht)),q&&console.log("z%d: %d clusters in %dms",ht,_t.numItems,+Date.now()-St)}return q&&console.timeEnd("total time"),this}getClusters(F,q){let H=((F[0]+180)%360+360)%360-180;const et=Math.max(-90,Math.min(90,F[1]));let gt=F[2]===180?180:((F[2]+180)%360+360)%360-180;const K=Math.max(-90,Math.min(90,F[3]));if(F[2]-F[0]>=360)H=-180,gt=180;else if(H>gt){const Nt=this.getClusters([H,et,180,K],q),Gt=this.getClusters([-180,et,gt,K],q);return Nt.concat(Gt)}const _t=this.trees[this._limitZoom(q)],ht=_t.range(jn(H),ee(K),jn(gt),ee(et)),St=_t.data,At=[];for(const Nt of ht){const Gt=this.stride*Nt;At.push(St[Gt+Pe]>1?Pn(St,Gt,this.clusterProps):this.points[St[Gt+Qe]])}return At}getChildren(F){const q=this._getOriginId(F),H=this._getOriginZoom(F),et="No cluster with the specified id.",gt=this.trees[H];if(!gt)throw new Error(et);const K=gt.data;if(q*this.stride>=K.length)throw new Error(et);const _t=this.options.radius/(this.options.extent*Math.pow(2,H-1)),ht=gt.within(K[q*this.stride],K[q*this.stride+1],_t),St=[];for(const At of ht){const Nt=At*this.stride;K[Nt+4]===F&&St.push(K[Nt+Pe]>1?Pn(K,Nt,this.clusterProps):this.points[K[Nt+Qe]])}if(St.length===0)throw new Error(et);return St}getLeaves(F,q,H){const et=[];return this._appendLeaves(et,F,q=q||10,H=H||0,0),et}getTile(F,q,H){const et=this.trees[this._limitZoom(F)],gt=Math.pow(2,F),{extent:K,radius:_t}=this.options,ht=_t/K,St=(H-ht)/gt,At=(H+1+ht)/gt,Nt={features:[]};return this._addTileFeatures(et.range((q-ht)/gt,St,(q+1+ht)/gt,At),et.data,q,H,gt,Nt),q===0&&this._addTileFeatures(et.range(1-ht/gt,St,1,At),et.data,gt,H,gt,Nt),q===gt-1&&this._addTileFeatures(et.range(0,St,ht/gt,At),et.data,-1,H,gt,Nt),Nt.features.length?Nt:null}getClusterExpansionZoom(F){let q=this._getOriginZoom(F)-1;for(;q<=this.options.maxZoom;){const H=this.getChildren(F);if(q++,H.length!==1)break;F=H[0].properties.cluster_id}return q}_appendLeaves(F,q,H,et,gt){const K=this.getChildren(q);for(const _t of K){const ht=_t.properties;if(ht&&ht.cluster?gt+ht.point_count<=et?gt+=ht.point_count:gt=this._appendLeaves(F,ht.cluster_id,H,et,gt):gt1;let At,Nt,Gt;if(St)At=zn(q,ht,this.clusterProps),Nt=q[ht],Gt=q[ht+1];else{const qe=this.points[q[ht+Qe]];At=qe.properties;const[je,mn]=qe.geometry.coordinates;Nt=jn(je),Gt=ee(mn)}const Se={type:1,geometry:[[Math.round(this.options.extent*(Nt*gt-H)),Math.round(this.options.extent*(Gt*gt-et))]],tags:At};let Ce;Ce=St||this.options.generateId?q[ht+Qe]:this.points[q[ht+Qe]].id,Ce!==void 0&&(Se.id=Ce),K.features.push(Se)}}_limitZoom(F){return Math.max(this.options.minZoom,Math.min(Math.floor(+F),this.options.maxZoom+1))}_cluster(F,q){const{radius:H,extent:et,reduce:gt,minPoints:K}=this.options,_t=H/(et*Math.pow(2,q)),ht=F.data,St=[],At=this.stride;for(let Nt=0;Ntq&&(je+=ht[On+Pe])}if(je>qe&&je>=K){let mn,On=Gt*qe,ti=Se*qe,Ui=-1;const $e=((Nt/At|0)<<5)+(q+1)+this.points.length;for(const ci of Ce){const Zi=ci*At;if(ht[Zi+2]<=q)continue;ht[Zi+2]=q;const Gr=ht[Zi+Pe];On+=ht[Zi]*Gr,ti+=ht[Zi+1]*Gr,ht[Zi+4]=$e,gt&&(mn||(mn=this._map(ht,Nt,!0),Ui=this.clusterProps.length,this.clusterProps.push(mn)),gt(mn,this._map(ht,Zi)))}ht[Nt+4]=$e,St.push(On/je,ti/je,1/0,$e,-1,je),gt&&St.push(Ui)}else{for(let mn=0;mn1)for(const mn of Ce){const On=mn*At;if(!(ht[On+2]<=q)){ht[On+2]=q;for(let ti=0;ti>5}_getOriginZoom(F){return(F-this.points.length)%32}_map(F,q,H){if(F[q+Pe]>1){const K=this.clusterProps[F[q+pn]];return H?Object.assign({},K):K}const et=this.points[F[q+Qe]].properties,gt=this.options.map(et);return H&>===et?Object.assign({},gt):gt}}function Pn(ot,F,q){return{type:"Feature",id:ot[F+Qe],properties:zn(ot,F,q),geometry:{type:"Point",coordinates:[(H=ot[F],360*(H-.5)),Ge(ot[F+1])]}};var H}function zn(ot,F,q){const H=ot[F+Pe],et=H>=1e4?`${Math.round(H/1e3)}k`:H>=1e3?Math.round(H/100)/10+"k":H,gt=ot[F+pn],K=gt===-1?{}:Object.assign({},q[gt]);return Object.assign(K,{cluster:!0,cluster_id:ot[F+Qe],point_count:H,point_count_abbreviated:et})}function jn(ot){return ot/360+.5}function ee(ot){const F=Math.sin(ot*Math.PI/180),q=.5-.25*Math.log((1+F)/(1-F))/Math.PI;return q<0?0:q>1?1:q}function Ge(ot){const F=(180-360*ot)*Math.PI/180;return 360*Math.atan(Math.exp(F))/Math.PI-90}function cn(ot,F,q,H){for(var et,gt=H,K=q-F>>1,_t=q-F,ht=ot[F],St=ot[F+1],At=ot[q],Nt=ot[q+1],Gt=F+3;Gtgt)et=Gt,gt=Se;else if(Se===gt){var Ce=Math.abs(Gt-K);Ce<_t&&(et=Gt,_t=Ce)}}gt>H&&(et-F>3&&cn(ot,F,et,H),ot[et+2]=gt,q-et>3&&cn(ot,et,q,H))}function vi(ot,F,q,H,et,gt){var K=et-q,_t=gt-H;if(K!==0||_t!==0){var ht=((ot-q)*K+(F-H)*_t)/(K*K+_t*_t);ht>1?(q=et,H=gt):ht>0&&(q+=K*ht,H+=_t*ht)}return(K=ot-q)*K+(_t=F-H)*_t}function Bi(ot,F,q,H){var et={id:ot===void 0?null:ot,type:F,geometry:q,tags:H,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(gt){var K=gt.geometry,_t=gt.type;if(_t==="Point"||_t==="MultiPoint"||_t==="LineString")Yt(gt,K);else if(_t==="Polygon"||_t==="MultiLineString")for(var ht=0;ht0&&(K+=H?(et*St-ht*gt)/2:Math.sqrt(Math.pow(ht-et,2)+Math.pow(St-gt,2))),et=ht,gt=St}var At=F.length-3;F[2]=1,cn(F,0,At,q),F[At+2]=1,F.size=Math.abs(K),F.start=0,F.end=F.size}function Pt(ot,F,q,H){for(var et=0;et1?1:q}function nn(ot,F,q,H,et,gt,K,_t){if(H/=F,gt>=(q/=F)&&K=H)return null;for(var ht=[],St=0;St=q&&Ce=H)){var qe=[];if(Gt==="Point"||Gt==="MultiPoint")$n(Nt,qe,q,H,et);else if(Gt==="LineString")_r(Nt,qe,q,H,et,!1,_t.lineMetrics);else if(Gt==="MultiLineString")Ts(Nt,qe,q,H,et,!1);else if(Gt==="Polygon")Ts(Nt,qe,q,H,et,!0);else if(Gt==="MultiPolygon")for(var je=0;je=q&&K<=H&&(F.push(ot[gt]),F.push(ot[gt+1]),F.push(ot[gt+2]))}}function _r(ot,F,q,H,et,gt,K){for(var _t,ht,St=ss(ot),At=et===0?Ir:tl,Nt=ot.start,Gt=0;Gtq&&(ht=At(St,Se,Ce,je,mn,q),K&&(St.start=Nt+_t*ht)):On>H?ti=q&&(ht=At(St,Se,Ce,je,mn,q),Ui=!0),ti>H&&On<=H&&(ht=At(St,Se,Ce,je,mn,H),Ui=!0),!gt&&Ui&&(K&&(St.end=Nt+_t*ht),F.push(St),St=ss(ot)),K&&(Nt+=_t)}var $e=ot.length-3;Se=ot[$e],Ce=ot[$e+1],qe=ot[$e+2],(On=et===0?Se:Ce)>=q&&On<=H&&Ia(St,Se,Ce,qe),$e=St.length-3,gt&&$e>=3&&(St[$e]!==St[0]||St[$e+1]!==St[1])&&Ia(St,St[0],St[1],St[2]),St.length&&F.push(St)}function ss(ot){var F=[];return F.size=ot.size,F.start=ot.start,F.end=ot.end,F}function Ts(ot,F,q,H,et,gt){for(var K=0;KK.maxX&&(K.maxX=At),Nt>K.maxY&&(K.maxY=Nt)}return K}function Vi(ot,F,q,H){var et=F.geometry,gt=F.type,K=[];if(gt==="Point"||gt==="MultiPoint")for(var _t=0;_t0&&F.size<(et?K:H))q.numPoints+=F.length/3;else{for(var _t=[],ht=0;htK)&&(q.numSimplified++,_t.push(F[ht]),_t.push(F[ht+1])),q.numPoints++;et&&function(St,At){for(var Nt=0,Gt=0,Se=St.length,Ce=Se-2;Gt0===At)for(Gt=0,Se=St.length;Gt24)throw new Error("maxZoom should be in the 0-24 range");if(F.promoteId&&F.generateId)throw new Error("promoteId and generateId cannot be used together.");var H=function(et,gt){var K=[];if(et.type==="FeatureCollection")for(var _t=0;_t1&&console.time("creation"),Gt=this.tiles[Nt]=el(ot,F,q,H,ht),this.tileCoords.push({z:F,x:q,y:H}),St)){St>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",F,q,H,Gt.numFeatures,Gt.numPoints,Gt.numSimplified),console.timeEnd("creation"));var Se="z"+F;this.stats[Se]=(this.stats[Se]||0)+1,this.total++}if(Gt.source=ot,et){if(F===ht.maxZoom||F===et)continue;var Ce=1<1&&console.time("clipping");var qe,je,mn,On,ti,Ui,$e=.5*ht.buffer/ht.extent,ci=.5-$e,Zi=.5+$e,Gr=1+$e;qe=je=mn=On=null,ti=nn(ot,At,q-$e,q+Zi,0,Gt.minX,Gt.maxX,ht),Ui=nn(ot,At,q+ci,q+Gr,0,Gt.minX,Gt.maxX,ht),ot=null,ti&&(qe=nn(ti,At,H-$e,H+Zi,1,Gt.minY,Gt.maxY,ht),je=nn(ti,At,H+ci,H+Gr,1,Gt.minY,Gt.maxY,ht),ti=null),Ui&&(mn=nn(Ui,At,H-$e,H+Zi,1,Gt.minY,Gt.maxY,ht),On=nn(Ui,At,H+ci,H+Gr,1,Gt.minY,Gt.maxY,ht),Ui=null),St>1&&console.timeEnd("clipping"),_t.push(qe||[],F+1,2*q,2*H),_t.push(je||[],F+1,2*q,2*H+1),_t.push(mn||[],F+1,2*q+1,2*H),_t.push(On||[],F+1,2*q+1,2*H+1)}}},Ye.prototype.getTile=function(ot,F,q){var H=this.options,et=H.extent,gt=H.debug;if(ot<0||ot>24)return null;var K=1<1&&console.log("drilling down to z%d-%d-%d",ot,F,q);for(var ht,St=ot,At=F,Nt=q;!ht&&St>0;)St--,At=Math.floor(At/2),Nt=Math.floor(Nt/2),ht=this.tiles[He(St,At,Nt)];return ht&&ht.source?(gt>1&&console.log("found parent tile z%d-%d-%d",St,At,Nt),gt>1&&console.time("drilling down"),this.splitTile(ht.source,St,At,Nt,ot,F,q),gt>1&&console.timeEnd("drilling down"),this.tiles[_t]?qo(this.tiles[_t],et):null):null};class ea extends L{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(F,q){return p._(this,void 0,void 0,function*(){const H=F.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const et=this._geoJSONIndex.getTile(H.z,H.x,H.y);if(!et)return null;const gt=new class{constructor(_t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=p.W,this.length=_t.length,this._features=_t}feature(_t){return new class{constructor(ht){this._feature=ht,this.extent=p.W,this.type=ht.type,this.properties=ht.tags,"id"in ht&&!isNaN(ht.id)&&(this.id=parseInt(ht.id,10))}loadGeometry(){if(this._feature.type===1){const ht=[];for(const St of this._feature.geometry)ht.push([new p.P(St[0],St[1])]);return ht}{const ht=[];for(const St of this._feature.geometry){const At=[];for(const Nt of St)At.push(new p.P(Nt[0],Nt[1]));ht.push(At)}return ht}}toGeoJSON(ht,St,At){return Y.call(this,ht,St,At)}}(this._features[_t])}}(et.features);let K=re(gt);return K.byteOffset===0&&K.byteLength===K.buffer.byteLength||(K=new Uint8Array(K)),{vectorTile:gt,rawData:K.buffer}})}loadData(F){var q;return p._(this,void 0,void 0,function*(){(q=this._pendingRequest)===null||q===void 0||q.abort();const H=!!(F&&F.request&&F.request.collectResourceTiming)&&new p.br(F.request);this._pendingRequest=new AbortController;try{let et=yield this.loadGeoJSON(F,this._pendingRequest);if(delete this._pendingRequest,typeof et!="object")throw new Error(`Input data given to '${F.source}' is not a valid GeoJSON object.`);if(J(et,!0),F.filter){const K=p.bx(F.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(K.result==="error")throw new Error(K.value.map(ht=>`${ht.key}: ${ht.message}`).join(", "));et={type:"FeatureCollection",features:et.features.filter(ht=>K.value.evaluate({zoom:0},ht))}}this._geoJSONIndex=F.cluster?new Sn(function({superclusterOptions:K,clusterProperties:_t}){if(!_t||!K)return K;const ht={},St={},At={accumulated:null,zoom:0},Nt={properties:null},Gt=Object.keys(_t);for(const Se of Gt){const[Ce,qe]=_t[Se],je=p.bx(qe),mn=p.bx(typeof Ce=="string"?[Ce,["accumulated"],["get",Se]]:Ce);ht[Se]=je.value,St[Se]=mn.value}return K.map=Se=>{Nt.properties=Se;const Ce={};for(const qe of Gt)Ce[qe]=ht[qe].evaluate(At,Nt);return Ce},K.reduce=(Se,Ce)=>{Nt.properties=Ce;for(const qe of Gt)At.accumulated=Se[qe],Se[qe]=St[qe].evaluate(At,Nt)},K}(F)).load(et.features):function(K,_t){return new Ye(K,_t)}(et,F.geojsonVtOptions),this.loaded={};const gt={};if(H){const K=H.finish();K&&(gt.resourceTiming={},gt.resourceTiming[F.source]=JSON.parse(JSON.stringify(K)))}return gt}catch(et){if(delete this._pendingRequest,p.by(et))return{abandoned:!0};throw et}})}reloadTile(F){const q=this.loaded;return q&&q[F.uid]?super.reloadTile(F):this.loadTile(F)}loadGeoJSON(F,q){return p._(this,void 0,void 0,function*(){const{promoteId:H}=F;if(F.request){const et=yield p.h(F.request,q);return this._dataUpdateable=jo(et.data,H)?We(et.data,H):void 0,et.data}if(typeof F.data=="string")try{const et=JSON.parse(F.data);return this._dataUpdateable=jo(et,H)?We(et,H):void 0,et}catch{throw new Error(`Input data given to '${F.source}' is not a valid GeoJSON object.`)}if(!F.dataDiff)throw new Error(`Input data given to '${F.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${F.source}`);return function(et,gt,K){var _t,ht,St,At;if(gt.removeAll&&et.clear(),gt.remove)for(const Nt of gt.remove)et.delete(Nt);if(gt.add)for(const Nt of gt.add){const Gt=xi(Nt,K);Gt!=null&&et.set(Gt,Nt)}if(gt.update)for(const Nt of gt.update){let Gt=et.get(Nt.id);if(Gt==null)continue;const Se=!Nt.removeAllProperties&&(((_t=Nt.removeProperties)===null||_t===void 0?void 0:_t.length)>0||((ht=Nt.addOrUpdateProperties)===null||ht===void 0?void 0:ht.length)>0);if((Nt.newGeometry||Nt.removeAllProperties||Se)&&(Gt=Object.assign({},Gt),et.set(Nt.id,Gt),Se&&(Gt.properties=Object.assign({},Gt.properties))),Nt.newGeometry&&(Gt.geometry=Nt.newGeometry),Nt.removeAllProperties)Gt.properties={};else if(((St=Nt.removeProperties)===null||St===void 0?void 0:St.length)>0)for(const Ce of Nt.removeProperties)Object.prototype.hasOwnProperty.call(Gt.properties,Ce)&&delete Gt.properties[Ce];if(((At=Nt.addOrUpdateProperties)===null||At===void 0?void 0:At.length)>0)for(const{key:Ce,value:qe}of Nt.addOrUpdateProperties)Gt.properties[Ce]=qe}}(this._dataUpdateable,F.dataDiff,H),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(F){return p._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(F){return this._geoJSONIndex.getClusterExpansionZoom(F.clusterId)}getClusterChildren(F){return this._geoJSONIndex.getChildren(F.clusterId)}getClusterLeaves(F){return this._geoJSONIndex.getLeaves(F.clusterId,F.limit,F.offset)}}class Ci{constructor(F){this.self=F,this.actor=new p.C(F),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(q,H)=>{if(this.externalWorkerSourceTypes[q])throw new Error(`Worker source with name "${q}" already registered.`);this.externalWorkerSourceTypes[q]=H},this.self.addProtocol=p.be,this.self.removeProtocol=p.bf,this.self.registerRTLTextPlugin=q=>{if(p.bz.isParsed())throw new Error("RTL text plugin already registered.");p.bz.setMethods(q)},this.actor.registerMessageHandler("loadDEMTile",(q,H)=>this._getDEMWorkerSource(q,H.source).loadTile(H)),this.actor.registerMessageHandler("removeDEMTile",(q,H)=>p._(this,void 0,void 0,function*(){this._getDEMWorkerSource(q,H.source).removeTile(H)})),this.actor.registerMessageHandler("getClusterExpansionZoom",(q,H)=>p._(this,void 0,void 0,function*(){return this._getWorkerSource(q,H.type,H.source).getClusterExpansionZoom(H)})),this.actor.registerMessageHandler("getClusterChildren",(q,H)=>p._(this,void 0,void 0,function*(){return this._getWorkerSource(q,H.type,H.source).getClusterChildren(H)})),this.actor.registerMessageHandler("getClusterLeaves",(q,H)=>p._(this,void 0,void 0,function*(){return this._getWorkerSource(q,H.type,H.source).getClusterLeaves(H)})),this.actor.registerMessageHandler("loadData",(q,H)=>this._getWorkerSource(q,H.type,H.source).loadData(H)),this.actor.registerMessageHandler("loadTile",(q,H)=>this._getWorkerSource(q,H.type,H.source).loadTile(H)),this.actor.registerMessageHandler("reloadTile",(q,H)=>this._getWorkerSource(q,H.type,H.source).reloadTile(H)),this.actor.registerMessageHandler("abortTile",(q,H)=>this._getWorkerSource(q,H.type,H.source).abortTile(H)),this.actor.registerMessageHandler("removeTile",(q,H)=>this._getWorkerSource(q,H.type,H.source).removeTile(H)),this.actor.registerMessageHandler("removeSource",(q,H)=>p._(this,void 0,void 0,function*(){if(!this.workerSources[q]||!this.workerSources[q][H.type]||!this.workerSources[q][H.type][H.source])return;const et=this.workerSources[q][H.type][H.source];delete this.workerSources[q][H.type][H.source],et.removeSource!==void 0&&et.removeSource(H)})),this.actor.registerMessageHandler("setReferrer",(q,H)=>p._(this,void 0,void 0,function*(){this.referrer=H})),this.actor.registerMessageHandler("syncRTLPluginState",(q,H)=>this._syncRTLPluginState(q,H)),this.actor.registerMessageHandler("importScript",(q,H)=>p._(this,void 0,void 0,function*(){this.self.importScripts(H)})),this.actor.registerMessageHandler("setImages",(q,H)=>this._setImages(q,H)),this.actor.registerMessageHandler("updateLayers",(q,H)=>p._(this,void 0,void 0,function*(){this._getLayerIndex(q).update(H.layers,H.removedIds)})),this.actor.registerMessageHandler("setLayers",(q,H)=>p._(this,void 0,void 0,function*(){this._getLayerIndex(q).replace(H)}))}_setImages(F,q){return p._(this,void 0,void 0,function*(){this.availableImages[F]=q;for(const H in this.workerSources[F]){const et=this.workerSources[F][H];for(const gt in et)et[gt].availableImages=q}})}_syncRTLPluginState(F,q){return p._(this,void 0,void 0,function*(){p.bz.setState(q);const H=p.bz.getPluginURL();if(q.pluginStatus==="loaded"&&!p.bz.isParsed()&&H!=null){this.self.importScripts(H);const et=p.bz.isParsed();if(et)return et;throw new Error(`RTL Text Plugin failed to import scripts from ${H}`)}return!1})}_getAvailableImages(F){let q=this.availableImages[F];return q||(q=[]),q}_getLayerIndex(F){let q=this.layerIndexes[F];return q||(q=this.layerIndexes[F]=new u),q}_getWorkerSource(F,q,H){if(this.workerSources[F]||(this.workerSources[F]={}),this.workerSources[F][q]||(this.workerSources[F][q]={}),!this.workerSources[F][q][H]){const et={sendAsync:(gt,K)=>(gt.targetMapId=F,this.actor.sendAsync(gt,K))};switch(q){case"vector":this.workerSources[F][q][H]=new L(et,this._getLayerIndex(F),this._getAvailableImages(F));break;case"geojson":this.workerSources[F][q][H]=new ea(et,this._getLayerIndex(F),this._getAvailableImages(F));break;default:this.workerSources[F][q][H]=new this.externalWorkerSourceTypes[q](et,this._getLayerIndex(F),this._getAvailableImages(F))}}return this.workerSources[F][q][H]}_getDEMWorkerSource(F,q){return this.demWorkerSources[F]||(this.demWorkerSources[F]={}),this.demWorkerSources[F][q]||(this.demWorkerSources[F][q]=new A),this.demWorkerSources[F][q]}}return p.i(self)&&(self.worker=new Ci(self)),Ci}),s("index",["exports","./shared"],function(p,u){var x="4.0.1";let w,E;const L={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:_=>new Promise((o,h)=>{const d=requestAnimationFrame(o);_.signal.addEventListener("abort",()=>{cancelAnimationFrame(d),h(u.c())})}),getImageData(_,o=0){return this.getImageCanvasContext(_).getImageData(-o,-o,_.width+2*o,_.height+2*o)},getImageCanvasContext(_){const o=window.document.createElement("canvas"),h=o.getContext("2d",{willReadFrequently:!0});if(!h)throw new Error("failed to create canvas 2d context");return o.width=_.width,o.height=_.height,h.drawImage(_,0,0,_.width,_.height),h},resolveURL:_=>(w||(w=document.createElement("a")),w.href=_,w.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(E==null&&(E=matchMedia("(prefers-reduced-motion: reduce)")),E.matches)}};class A{static testProp(o){if(!A.docStyle)return o[0];for(let h=0;h{window.removeEventListener("click",A.suppressClickInternal,!0)},0)}static getScale(o){const h=o.getBoundingClientRect();return{x:h.width/o.offsetWidth||1,y:h.height/o.offsetHeight||1,boundingClientRect:h}}static getPoint(o,h,d){const g=h.boundingClientRect;return new u.P((d.clientX-g.left)/h.x-o.clientLeft,(d.clientY-g.top)/h.y-o.clientTop)}static mousePos(o,h){const d=A.getScale(o);return A.getPoint(o,d,h)}static touchPos(o,h){const d=[],g=A.getScale(o);for(let y=0;y{o=[],h=0,d=0,g={}},_.addThrottleControl=M=>{const k=d++;return g[k]=M,k},_.removeThrottleControl=M=>{delete g[M],I()},_.getImage=(M,k,N=!0)=>new Promise((z,Z)=>{V.supported&&(M.headers||(M.headers={}),M.headers.accept="image/webp,*/*"),u.e(M,{type:"image"}),o.push({abortController:k,requestParameters:M,supportImageRefresh:N,state:"queued",onError:nt=>{Z(nt)},onSuccess:nt=>{z(nt)}}),I()});const y=M=>u._(this,void 0,void 0,function*(){M.state="running";const{requestParameters:k,supportImageRefresh:N,onError:z,onSuccess:Z,abortController:nt}=M,it=N===!1&&!u.i(self)&&!u.g(k.url)&&(!k.headers||Object.keys(k.headers).reduce((mt,Ct)=>mt&&Ct==="accept",!0));h++;const st=it?T(k,nt):u.m(k,nt);try{const mt=yield st;delete M.abortController,M.state="completed",mt.data instanceof HTMLImageElement||u.b(mt.data)?Z(mt):mt.data&&Z({data:yield(tt=mt.data,typeof createImageBitmap=="function"?u.d(tt):u.f(tt)),cacheControl:mt.cacheControl,expires:mt.expires})}catch(mt){delete M.abortController,z(mt)}finally{h--,I()}var tt}),I=()=>{const M=(()=>{for(const k of Object.keys(g))if(g[k]())return!0;return!1})()?u.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:u.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let k=h;k0;k++){const N=o.shift();N.abortController.signal.aborted?k--:y(N)}},T=(M,k)=>new Promise((N,z)=>{const Z=new Image,nt=M.url,it=M.credentials;it&&it==="include"?Z.crossOrigin="use-credentials":(it&&it==="same-origin"||!u.s(nt))&&(Z.crossOrigin="anonymous"),k.signal.addEventListener("abort",()=>{Z.src="",z(u.c())}),Z.fetchPriority="high",Z.onload=()=>{Z.onerror=Z.onload=null,N({data:Z})},Z.onerror=()=>{Z.onerror=Z.onload=null,k.signal.aborted||z(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."))},Z.src=nt})}(G||(G={})),G.resetRequestQueue(),function(_){_.Glyphs="Glyphs",_.Image="Image",_.Source="Source",_.SpriteImage="SpriteImage",_.SpriteJSON="SpriteJSON",_.Style="Style",_.Tile="Tile",_.Unknown="Unknown"}(X||(X={}));class at{constructor(o){this._transformRequestFn=o}transformRequest(o,h){return this._transformRequestFn&&this._transformRequestFn(o,h)||{url:o}}normalizeSpriteURL(o,h,d){const g=function(y){const I=y.match(vt);if(!I)throw new Error(`Unable to parse URL "${y}"`);return{protocol:I[1],authority:I[2],path:I[3]||"/",params:I[4]?I[4].split("&"):[]}}(o);return g.path+=`${h}${d}`,function(y){const I=y.params.length?`?${y.params.join("&")}`:"";return`${y.protocol}://${y.authority}${y.path}${I}`}(g)}setTransformRequest(o){this._transformRequestFn=o}}const vt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function dt(_){var o=new u.A(3);return o[0]=_[0],o[1]=_[1],o[2]=_[2],o}var pt,ut=function(_,o,h){return _[0]=o[0]-h[0],_[1]=o[1]-h[1],_[2]=o[2]-h[2],_};pt=new u.A(3),u.A!=Float32Array&&(pt[0]=0,pt[1]=0,pt[2]=0);var Rt=function(_){var o=_[0],h=_[1];return o*o+h*h};function yt(_){const o=[];if(typeof _=="string")o.push({id:"default",url:_});else if(_&&_.length>0){const h=[];for(const{id:d,url:g}of _){const y=`${d}${g}`;h.indexOf(y)===-1&&(h.push(y),o.push({id:d,url:g}))}}return o}(function(){var _=new u.A(2);u.A!=Float32Array&&(_[0]=0,_[1]=0)})();class wt{constructor(o,h,d,g){this.context=o,this.format=d,this.texture=o.gl.createTexture(),this.update(h,g)}update(o,h,d){const{width:g,height:y}=o,I=!(this.size&&this.size[0]===g&&this.size[1]===y||d),{context:T}=this,{gl:M}=T;if(this.useMipmap=!!(h&&h.useMipmap),M.bindTexture(M.TEXTURE_2D,this.texture),T.pixelStoreUnpackFlipY.set(!1),T.pixelStoreUnpack.set(1),T.pixelStoreUnpackPremultiplyAlpha.set(this.format===M.RGBA&&(!h||h.premultiply!==!1)),I)this.size=[g,y],o instanceof HTMLImageElement||o instanceof HTMLCanvasElement||o instanceof HTMLVideoElement||o instanceof ImageData||u.b(o)?M.texImage2D(M.TEXTURE_2D,0,this.format,this.format,M.UNSIGNED_BYTE,o):M.texImage2D(M.TEXTURE_2D,0,this.format,g,y,0,this.format,M.UNSIGNED_BYTE,o.data);else{const{x:k,y:N}=d||{x:0,y:0};o instanceof HTMLImageElement||o instanceof HTMLCanvasElement||o instanceof HTMLVideoElement||o instanceof ImageData||u.b(o)?M.texSubImage2D(M.TEXTURE_2D,0,k,N,M.RGBA,M.UNSIGNED_BYTE,o):M.texSubImage2D(M.TEXTURE_2D,0,k,N,g,y,M.RGBA,M.UNSIGNED_BYTE,o.data)}this.useMipmap&&this.isSizePowerOfTwo()&&M.generateMipmap(M.TEXTURE_2D)}bind(o,h,d){const{context:g}=this,{gl:y}=g;y.bindTexture(y.TEXTURE_2D,this.texture),d!==y.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(d=y.LINEAR),o!==this.filter&&(y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,o),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,d||o),this.filter=o),h!==this.wrap&&(y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_S,h),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_T,h),this.wrap=h)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:o}=this.context;o.deleteTexture(this.texture),this.texture=null}}function ie(_){const{userImage:o}=_;return!!(o&&o.render&&o.render())&&(_.data.replace(new Uint8Array(o.data.buffer)),!0)}class Tt extends u.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new u.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(o){if(this.loaded!==o&&(this.loaded=o,o)){for(const{ids:h,promiseResolve:d}of this.requestors)d(this._getImagesForIds(h));this.requestors=[]}}getImage(o){const h=this.images[o];if(h&&!h.data&&h.spriteData){const d=h.spriteData;h.data=new u.R({width:d.width,height:d.height},d.context.getImageData(d.x,d.y,d.width,d.height).data),h.spriteData=null}return h}addImage(o,h){if(this.images[o])throw new Error(`Image id ${o} already exist, use updateImage instead`);this._validate(o,h)&&(this.images[o]=h)}_validate(o,h){let d=!0;const g=h.data||h.spriteData;return this._validateStretch(h.stretchX,g&&g.width)||(this.fire(new u.j(new Error(`Image "${o}" has invalid "stretchX" value`))),d=!1),this._validateStretch(h.stretchY,g&&g.height)||(this.fire(new u.j(new Error(`Image "${o}" has invalid "stretchY" value`))),d=!1),this._validateContent(h.content,h)||(this.fire(new u.j(new Error(`Image "${o}" has invalid "content" value`))),d=!1),d}_validateStretch(o,h){if(!o)return!0;let d=0;for(const g of o){if(g[0]{let g=!0;if(!this.isLoaded())for(const y of o)this.images[y]||(g=!1);this.isLoaded()||g?h(this._getImagesForIds(o)):this.requestors.push({ids:o,promiseResolve:h})})}_getImagesForIds(o){const h={};for(const d of o){let g=this.getImage(d);g||(this.fire(new u.k("styleimagemissing",{id:d})),g=this.getImage(d)),g?h[d]={data:g.data.clone(),pixelRatio:g.pixelRatio,sdf:g.sdf,version:g.version,stretchX:g.stretchX,stretchY:g.stretchY,content:g.content,hasRenderCallback:!!(g.userImage&&g.userImage.render)}:u.w(`Image "${d}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return h}getPixelSize(){const{width:o,height:h}=this.atlasImage;return{width:o,height:h}}getPattern(o){const h=this.patterns[o],d=this.getImage(o);if(!d)return null;if(h&&h.position.version===d.version)return h.position;if(h)h.position.version=d.version;else{const g={w:d.data.width+2,h:d.data.height+2,x:0,y:0},y=new u.I(g,d);this.patterns[o]={bin:g,position:y}}return this._updatePatternAtlas(),this.patterns[o].position}bind(o){const h=o.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new wt(o,this.atlasImage,h.RGBA),this.atlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE)}_updatePatternAtlas(){const o=[];for(const y in this.patterns)o.push(this.patterns[y].bin);const{w:h,h:d}=u.p(o),g=this.atlasImage;g.resize({width:h||1,height:d||1});for(const y in this.patterns){const{bin:I}=this.patterns[y],T=I.x+1,M=I.y+1,k=this.getImage(y).data,N=k.width,z=k.height;u.R.copy(k,g,{x:0,y:0},{x:T,y:M},{width:N,height:z}),u.R.copy(k,g,{x:0,y:z-1},{x:T,y:M-1},{width:N,height:1}),u.R.copy(k,g,{x:0,y:0},{x:T,y:M+z},{width:N,height:1}),u.R.copy(k,g,{x:N-1,y:0},{x:T-1,y:M},{width:1,height:z}),u.R.copy(k,g,{x:0,y:0},{x:T+N,y:M},{width:1,height:z})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(o){for(const h of o){if(this.callbackDispatchedThisFrame[h])continue;this.callbackDispatchedThisFrame[h]=!0;const d=this.getImage(h);d||u.w(`Image with ID: "${h}" was not found`),ie(d)&&this.updateImage(h,d)}}}const ae=1e20;function Kt(_,o,h,d,g,y,I,T,M){for(let k=o;k-1);M++,y[M]=T,I[M]=k,I[M+1]=ae}for(let T=0,M=0;T65535)throw new Error("glyphs > 65535 not supported");if(d.ranges[y])return{stack:o,id:h,glyph:g};if(!this.url)throw new Error("glyphsUrl is not set");if(!d.requests[y]){const T=Ne.loadGlyphRange(o,y,this.url,this.requestManager);d.requests[y]=T}const I=yield d.requests[y];for(const T in I)this._doesCharSupportLocalGlyph(+T)||(d.glyphs[+T]=I[+T]);return d.ranges[y]=!0,{stack:o,id:h,glyph:I[h]||null}})}_doesCharSupportLocalGlyph(o){return!!this.localIdeographFontFamily&&(u.u["CJK Unified Ideographs"](o)||u.u["Hangul Syllables"](o)||u.u.Hiragana(o)||u.u.Katakana(o))}_tinySDF(o,h,d){const g=this.localIdeographFontFamily;if(!g||!this._doesCharSupportLocalGlyph(d))return;let y=o.tinySDF;if(!y){let T="400";/bold/i.test(h)?T="900":/medium/i.test(h)?T="500":/light/i.test(h)&&(T="200"),y=o.tinySDF=new Ne.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:g,fontWeight:T})}const I=y.draw(String.fromCharCode(d));return{id:d,bitmap:new u.o({width:I.width||60,height:I.height||60},I.data),metrics:{width:I.glyphWidth/2||24,height:I.glyphHeight/2||24,left:I.glyphLeft/2+.5||0,top:I.glyphTop/2-27.5||-8,advance:I.glyphAdvance/2||24,isDoubleResolution:!0}}}}Ne.loadGlyphRange=function(_,o,h,d){return u._(this,void 0,void 0,function*(){const g=256*o,y=g+255,I=d.transformRequest(h.replace("{fontstack}",_).replace("{range}",`${g}-${y}`),X.Glyphs),T=yield u.l(I,new AbortController);if(!T||!T.data)throw new Error(`Could not load glyph range. range: ${o}, ${g}-${y}`);const M={};for(const k of u.n(T.data))M[k.id]=k;return M})},Ne.TinySDF=class{constructor({fontSize:_=24,buffer:o=3,radius:h=8,cutoff:d=.25,fontFamily:g="sans-serif",fontWeight:y="normal",fontStyle:I="normal"}={}){this.buffer=o,this.cutoff=d,this.radius=h;const T=this.size=_+4*o,M=this._createCanvas(T),k=this.ctx=M.getContext("2d",{willReadFrequently:!0});k.font=`${I} ${y} ${_}px ${g}`,k.textBaseline="alphabetic",k.textAlign="left",k.fillStyle="black",this.gridOuter=new Float64Array(T*T),this.gridInner=new Float64Array(T*T),this.f=new Float64Array(T),this.z=new Float64Array(T+1),this.v=new Uint16Array(T)}_createCanvas(_){const o=document.createElement("canvas");return o.width=o.height=_,o}draw(_){const{width:o,actualBoundingBoxAscent:h,actualBoundingBoxDescent:d,actualBoundingBoxLeft:g,actualBoundingBoxRight:y}=this.ctx.measureText(_),I=Math.ceil(h),T=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(y-g))),M=Math.min(this.size-this.buffer,I+Math.ceil(d)),k=T+2*this.buffer,N=M+2*this.buffer,z=Math.max(k*N,0),Z=new Uint8ClampedArray(z),nt={data:Z,width:k,height:N,glyphWidth:T,glyphHeight:M,glyphTop:I,glyphLeft:0,glyphAdvance:o};if(T===0||M===0)return nt;const{ctx:it,buffer:st,gridInner:tt,gridOuter:mt}=this;it.clearRect(st,st,T,M),it.fillText(_,st,st+I);const Ct=it.getImageData(st,st,T,M);mt.fill(ae,0,z),tt.fill(0,0,z);for(let lt=0;lt0?Zt*Zt:0,tt[Mt]=Zt<0?Zt*Zt:0}}Kt(mt,0,0,k,N,k,this.f,this.v,this.z),Kt(tt,st,st,T,M,k,this.f,this.v,this.z);for(let lt=0;lt1&&(M=o[++T]);const N=Math.abs(k-M.left),z=Math.abs(k-M.right),Z=Math.min(N,z);let nt;const it=y/d*(g+1);if(M.isDash){const st=g-Math.abs(it);nt=Math.sqrt(Z*Z+st*st)}else nt=g-Math.sqrt(Z*Z+it*it);this.data[I+k]=Math.max(0,Math.min(255,nt+128))}}}addRegularDash(o){for(let T=o.length-1;T>=0;--T){const M=o[T],k=o[T+1];M.zeroLength?o.splice(T,1):k&&k.isDash===M.isDash&&(k.left=M.left,o.splice(T,1))}const h=o[0],d=o[o.length-1];h.isDash===d.isDash&&(h.left=d.left-this.width,d.right=h.right+this.width);const g=this.width*this.nextRow;let y=0,I=o[y];for(let T=0;T1&&(I=o[++y]);const M=Math.abs(T-I.left),k=Math.abs(T-I.right),N=Math.min(M,k);this.data[g+T]=Math.max(0,Math.min(255,(I.isDash?N:-N)+128))}}addDash(o,h){const d=h?7:0,g=2*d+1;if(this.nextRow+g>this.height)return u.w("LineAtlas out of space"),null;let y=0;for(let T=0;T{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[pn]}numActive(){return Object.keys(this.active).length}}const Pn=Math.floor(L.hardwareConcurrency/2);let zn,jn;function ee(){return zn||(zn=new Sn),zn}Sn.workerCount=u.B(globalThis)?Math.max(Math.min(Pn,3),1):1;class Ge{constructor(o,h){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=h;const d=this.workerPool.acquire(h);for(let g=0;g{h.remove()}),this.actors=[],o&&this.workerPool.release(this.id)}registerMessageHandler(o,h){for(const d of this.actors)d.registerMessageHandler(o,h)}}function cn(){return jn||(jn=new Ge(ee(),u.G),jn.registerMessageHandler("getResource",(_,o,h)=>u.m(o,h))),jn}function vi(_,o){const h=u.F();return u.H(h,h,[1,1,0]),u.J(h,h,[.5*_.width,.5*_.height,1]),u.K(h,h,_.calculatePosMatrix(o.toUnwrapped()))}function Bi(_,o,h,d,g,y){const I=function(z,Z,nt){if(z)for(const it of z){const st=Z[it];if(st&&st.source===nt&&st.type==="fill-extrusion")return!0}else for(const it in Z){const st=Z[it];if(st.source===nt&&st.type==="fill-extrusion")return!0}return!1}(g&&g.layers,o,_.id),T=y.maxPitchScaleFactor(),M=_.tilesIn(d,T,I);M.sort(Yt);const k=[];for(const z of M)k.push({wrappedTileID:z.tileID.wrapped().key,queryResults:z.tile.queryRenderedFeatures(o,h,_._state,z.queryGeometry,z.cameraQueryGeometry,z.scale,g,y,T,vi(_.transform,z.tileID))});const N=function(z){const Z={},nt={};for(const it of z){const st=it.queryResults,tt=it.wrappedTileID,mt=nt[tt]=nt[tt]||{};for(const Ct in st){const lt=st[Ct],bt=mt[Ct]=mt[Ct]||{},kt=Z[Ct]=Z[Ct]||[];for(const Mt of lt)bt[Mt.featureIndex]||(bt[Mt.featureIndex]=!0,kt.push(Mt))}}return Z}(k);for(const z in N)N[z].forEach(Z=>{const nt=Z.feature,it=_.getFeatureState(nt.layer["source-layer"],nt.id);nt.source=nt.layer.source,nt.layer["source-layer"]&&(nt.sourceLayer=nt.layer["source-layer"]),nt.state=it});return N}function Yt(_,o){const h=_.tileID,d=o.tileID;return h.overscaledZ-d.overscaledZ||h.canonical.y-d.canonical.y||h.wrap-d.wrap||h.canonical.x-d.canonical.x}function jt(_,o,h){return u._(this,void 0,void 0,function*(){let d=_;if(_.url?d=(yield u.h(o.transformRequest(_.url,X.Source),h)).data:yield L.frameAsync(h),!d)return null;const g=u.L(u.e(d,_),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in d&&d.vector_layers&&(g.vectorLayerIds=d.vector_layers.map(y=>y.id)),g})}class be{constructor(o,h){o&&(h?this.setSouthWest(o).setNorthEast(h):Array.isArray(o)&&(o.length===4?this.setSouthWest([o[0],o[1]]).setNorthEast([o[2],o[3]]):this.setSouthWest(o[0]).setNorthEast(o[1])))}setNorthEast(o){return this._ne=o instanceof u.M?new u.M(o.lng,o.lat):u.M.convert(o),this}setSouthWest(o){return this._sw=o instanceof u.M?new u.M(o.lng,o.lat):u.M.convert(o),this}extend(o){const h=this._sw,d=this._ne;let g,y;if(o instanceof u.M)g=o,y=o;else{if(!(o instanceof be))return Array.isArray(o)?o.length===4||o.every(Array.isArray)?this.extend(be.convert(o)):this.extend(u.M.convert(o)):o&&("lng"in o||"lon"in o)&&"lat"in o?this.extend(u.M.convert(o)):this;if(g=o._sw,y=o._ne,!g||!y)return this}return h||d?(h.lng=Math.min(g.lng,h.lng),h.lat=Math.min(g.lat,h.lat),d.lng=Math.max(y.lng,d.lng),d.lat=Math.max(y.lat,d.lat)):(this._sw=new u.M(g.lng,g.lat),this._ne=new u.M(y.lng,y.lat)),this}getCenter(){return new u.M((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 u.M(this.getWest(),this.getNorth())}getSouthEast(){return new u.M(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(o){const{lng:h,lat:d}=u.M.convert(o);let g=this._sw.lng<=h&&h<=this._ne.lng;return this._sw.lng>this._ne.lng&&(g=this._sw.lng>=h&&h>=this._ne.lng),this._sw.lat<=d&&d<=this._ne.lat&&g}static convert(o){return o instanceof be?o:o&&new be(o)}static fromLngLat(o,h=0){const d=360*h/40075017,g=d/Math.cos(Math.PI/180*o.lat);return new be(new u.M(o.lng-g,o.lat-d),new u.M(o.lng+g,o.lat+d))}}class oi{constructor(o,h,d){this.bounds=be.convert(this.validateBounds(o)),this.minzoom=h||0,this.maxzoom=d||24}validateBounds(o){return Array.isArray(o)&&o.length===4?[Math.max(-180,o[0]),Math.max(-90,o[1]),Math.min(180,o[2]),Math.min(90,o[3])]:[-180,-90,180,90]}contains(o){const h=Math.pow(2,o.z),d=Math.floor(u.N(this.bounds.getWest())*h),g=Math.floor(u.O(this.bounds.getNorth())*h),y=Math.ceil(u.N(this.bounds.getEast())*h),I=Math.ceil(u.O(this.bounds.getSouth())*h);return o.x>=d&&o.x=g&&o.y{this._options.tiles=o}),this}setUrl(o){return this.setSourceProperty(()=>{this.url=o,this._options.url=o}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return u.e({},this._options)}loadTile(o){return u._(this,void 0,void 0,function*(){const h=o.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),d={request:this.map._requestManager.transformRequest(h,X.Tile),uid:o.uid,tileID:o.tileID,zoom:o.tileID.overscaledZ,tileSize:this.tileSize*o.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};d.request.collectResourceTiming=this._collectResourceTiming;let g="reloadTile";if(o.actor&&o.state!=="expired"){if(o.state==="loading")return new Promise((y,I)=>{o.reloadPromise={resolve:y,reject:I}})}else o.actor=this.dispatcher.getActor(),g="loadTile";o.abortController=new AbortController;try{const y=yield o.actor.sendAsync({type:g,data:d},o.abortController);if(delete o.abortController,o.aborted)return;this._afterTileLoadWorkerResponse(o,y)}catch(y){if(delete o.abortController,o.aborted)return;if(y&&y.status!==404)throw y;this._afterTileLoadWorkerResponse(o,null)}})}_afterTileLoadWorkerResponse(o,h){if(h&&h.resourceTiming&&(o.resourceTiming=h.resourceTiming),h&&this.map._refreshExpiredTiles&&o.setExpiryData(h),o.loadVectorData(h,this.map.painter),o.reloadPromise){const d=o.reloadPromise;o.reloadPromise=null,this.loadTile(o).then(d.resolve).catch(d.reject)}}abortTile(o){return u._(this,void 0,void 0,function*(){o.abortController&&(o.abortController.abort(),delete o.abortController),o.actor&&(yield o.actor.sendAsync({type:"abortTile",data:{uid:o.uid,type:this.type,source:this.id}}))})}unloadTile(o){return u._(this,void 0,void 0,function*(){o.unloadVectorData(),o.actor&&(yield o.actor.sendAsync({type:"removeTile",data:{uid:o.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class an extends u.E{constructor(o,h,d,g){super(),this.id=o,this.dispatcher=d,this.setEventedParent(g),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=u.e({type:"raster"},h),u.e(this,u.L(h,["url","scheme","tileSize"]))}load(){return u._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new u.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const o=yield jt(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,o&&(u.e(this,o),o.bounds&&(this.tileBounds=new oi(o.bounds,this.minzoom,this.maxzoom)),this.fire(new u.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new u.k("data",{dataType:"source",sourceDataType:"content"})))}catch(o){this._tileJSONRequest=null,this.fire(new u.j(o))}})}loaded(){return this._loaded}onAdd(o){this.map=o,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(o){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),o(),this.load()}setTiles(o){return this.setSourceProperty(()=>{this._options.tiles=o}),this}setUrl(o){return this.setSourceProperty(()=>{this.url=o,this._options.url=o}),this}serialize(){return u.e({},this._options)}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}loadTile(o){return u._(this,void 0,void 0,function*(){const h=o.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);o.abortController=new AbortController;try{const d=yield G.getImage(this.map._requestManager.transformRequest(h,X.Tile),o.abortController,this.map._refreshExpiredTiles);if(delete o.abortController,o.aborted)return void(o.state="unloaded");if(d&&d.data){this.map._refreshExpiredTiles&&d.cacheControl&&d.expires&&o.setExpiryData({cacheControl:d.cacheControl,expires:d.expires});const g=this.map.painter.context,y=g.gl,I=d.data;o.texture=this.map.painter.getTileTexture(I.width),o.texture?o.texture.update(I,{useMipmap:!0}):(o.texture=new wt(g,I,y.RGBA,{useMipmap:!0}),o.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE,y.LINEAR_MIPMAP_NEAREST),g.extTextureFilterAnisotropic&&y.texParameterf(y.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax)),o.state="loaded"}}catch(d){if(delete o.abortController,o.aborted)o.state="unloaded";else if(d)throw o.state="errored",d}})}abortTile(o){return u._(this,void 0,void 0,function*(){o.abortController&&(o.abortController.abort(),delete o.abortController)})}unloadTile(o){return u._(this,void 0,void 0,function*(){o.texture&&this.map.painter.saveTileTexture(o.texture)})}hasTransition(){return!1}}class ji extends an{constructor(o,h,d,g){super(o,h,d,g),this.type="raster-dem",this.maxzoom=22,this._options=u.e({type:"raster-dem"},h),this.encoding=h.encoding||"mapbox",this.redFactor=h.redFactor,this.greenFactor=h.greenFactor,this.blueFactor=h.blueFactor,this.baseShift=h.baseShift}loadTile(o){return u._(this,void 0,void 0,function*(){const h=o.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),d=this.map._requestManager.transformRequest(h,X.Tile);o.neighboringTiles=this._getNeighboringTiles(o.tileID),o.abortController=new AbortController;try{const g=yield G.getImage(d,o.abortController,this.map._refreshExpiredTiles);if(delete o.abortController,o.aborted)return void(o.state="unloaded");if(g&&g.data){const y=g.data;this.map._refreshExpiredTiles&&g.cacheControl&&g.expires&&o.setExpiryData({cacheControl:g.cacheControl,expires:g.expires});const I=u.b(y)&&u.S()?y:yield this.readImageNow(y),T={type:this.type,uid:o.uid,source:this.id,rawImageData:I,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!o.actor||o.state==="expired"){o.actor=this.dispatcher.getActor();const M=yield o.actor.sendAsync({type:"loadDEMTile",data:T});o.dem=M,o.needsHillshadePrepare=!0,o.needsTerrainPrepare=!0,o.state="loaded"}}}catch(g){if(delete o.abortController,o.aborted)o.state="unloaded";else if(g)throw o.state="errored",g}})}readImageNow(o){return u._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&u.U()){const h=o.width+2,d=o.height+2;try{return new u.R({width:h,height:d},yield u.V(o,-1,-1,h,d))}catch{}}return L.getImageData(o,1)})}_getNeighboringTiles(o){const h=o.canonical,d=Math.pow(2,h.z),g=(h.x-1+d)%d,y=h.x===0?o.wrap-1:o.wrap,I=(h.x+1+d)%d,T=h.x+1===d?o.wrap+1:o.wrap,M={};return M[new u.Q(o.overscaledZ,y,h.z,g,h.y).key]={backfilled:!1},M[new u.Q(o.overscaledZ,T,h.z,I,h.y).key]={backfilled:!1},h.y>0&&(M[new u.Q(o.overscaledZ,y,h.z,g,h.y-1).key]={backfilled:!1},M[new u.Q(o.overscaledZ,o.wrap,h.z,h.x,h.y-1).key]={backfilled:!1},M[new u.Q(o.overscaledZ,T,h.z,I,h.y-1).key]={backfilled:!1}),h.y+10&&u.e(y,{resourceTiming:g}),this.fire(new u.k("data",Object.assign(Object.assign({},y),{sourceDataType:"metadata"}))),this.fire(new u.k("data",Object.assign(Object.assign({},y),{sourceDataType:"content"})))}catch(d){if(this._pendingLoads--,this._removed)return void this.fire(new u.k("dataabort",{dataType:"source"}));this.fire(new u.j(d))}})}loaded(){return this._pendingLoads===0}loadTile(o){return u._(this,void 0,void 0,function*(){const h=o.actor?"reloadTile":"loadTile";o.actor=this.actor;const d={type:this.type,uid:o.uid,tileID:o.tileID,zoom:o.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};o.abortController=new AbortController;const g=yield this.actor.sendAsync({type:h,data:d},o.abortController);delete o.abortController,o.unloadVectorData(),o.aborted||o.loadVectorData(g,this.map.painter,h==="reloadTile")})}abortTile(o){return u._(this,void 0,void 0,function*(){o.abortController&&(o.abortController.abort(),delete o.abortController),o.aborted=!0})}unloadTile(o){return u._(this,void 0,void 0,function*(){o.unloadVectorData(),yield this.actor.sendAsync({type:"removeTile",data:{uid:o.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"removeSource",data:{type:this.type,source:this.id}})}serialize(){return u.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var $n=u.X([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class _r extends u.E{constructor(o,h,d,g){super(),this.id=o,this.dispatcher=d,this.coordinates=h.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(g),this.options=h}load(o){return u._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new u.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const h=yield G.getImage(this.map._requestManager.transformRequest(this.url,X.Image),this._request);this._request=null,this._loaded=!0,h&&h.data&&(this.image=h.data,o&&(this.coordinates=o),this._finishLoading())}catch(h){this._request=null,this.fire(new u.j(h))}})}loaded(){return this._loaded}updateImage(o){return o.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=o.url,this.load(o.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new u.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(o){this.map=o,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(o){this.coordinates=o;const h=o.map(u.Y.fromLngLat);this.tileID=function(g){let y=1/0,I=1/0,T=-1/0,M=-1/0;for(const Z of g)y=Math.min(y,Z.x),I=Math.min(I,Z.y),T=Math.max(T,Z.x),M=Math.max(M,Z.y);const k=Math.max(T-y,M-I),N=Math.max(0,Math.floor(-Math.log(k)/Math.LN2)),z=Math.pow(2,N);return new u.a0(N,Math.floor((y+T)/2*z),Math.floor((I+M)/2*z))}(h),this.minzoom=this.maxzoom=this.tileID.z;const d=h.map(g=>this.tileID.getTilePoint(g)._round());return this._boundsArray=new u.Z,this._boundsArray.emplaceBack(d[0].x,d[0].y,0,0),this._boundsArray.emplaceBack(d[1].x,d[1].y,u.W,0),this._boundsArray.emplaceBack(d[3].x,d[3].y,0,u.W),this._boundsArray.emplaceBack(d[2].x,d[2].y,u.W,u.W),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new u.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const o=this.map.painter.context,h=o.gl;this.boundsBuffer||(this.boundsBuffer=o.createVertexBuffer(this._boundsArray,$n.members)),this.boundsSegments||(this.boundsSegments=u.$.simpleSegment(0,0,4,2)),this.texture||(this.texture=new wt(o,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));let d=!1;for(const g in this.tiles){const y=this.tiles[g];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,d=!0)}d&&this.fire(new u.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(o){return u._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(o.tileID.canonical)?(this.tiles[String(o.tileID.wrap)]=o,o.buckets={}):o.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ss extends _r{constructor(o,h,d,g){super(o,h,d,g),this.roundZoom=!0,this.type="video",this.options=h}load(){return u._(this,void 0,void 0,function*(){this._loaded=!1;const o=this.options;this.urls=[];for(const h of o.urls)this.urls.push(this.map._requestManager.transformRequest(h,X.Source).url);try{const h=yield u.a2(this.urls);if(this._loaded=!0,!h)return;this.video=h,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(h){this.fire(new u.j(h))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(o){if(this.video){const h=this.video.seekable;oh.end(0)?this.fire(new u.j(new u.a1(`sources.${this.id}`,null,`Playback for this video can be set only between the ${h.start(0)} and ${h.end(0)}-second mark.`))):this.video.currentTime=o}}getVideo(){return this.video}onAdd(o){this.map||(this.map=o,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const o=this.map.painter.context,h=o.gl;this.boundsBuffer||(this.boundsBuffer=o.createVertexBuffer(this._boundsArray,$n.members)),this.boundsSegments||(this.boundsSegments=u.$.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.texSubImage2D(h.TEXTURE_2D,0,0,0,h.RGBA,h.UNSIGNED_BYTE,this.video)):(this.texture=new wt(o,this.video,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));let d=!1;for(const g in this.tiles){const y=this.tiles[g];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,d=!0)}d&&this.fire(new u.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Ts extends _r{constructor(o,h,d,g){super(o,h,d,g),h.coordinates?Array.isArray(h.coordinates)&&h.coordinates.length===4&&!h.coordinates.some(y=>!Array.isArray(y)||y.length!==2||y.some(I=>typeof I!="number"))||this.fire(new u.j(new u.a1(`sources.${o}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.j(new u.a1(`sources.${o}`,null,'missing required property "coordinates"'))),h.animate&&typeof h.animate!="boolean"&&this.fire(new u.j(new u.a1(`sources.${o}`,null,'optional "animate" property must be a boolean value'))),h.canvas?typeof h.canvas=="string"||h.canvas instanceof HTMLCanvasElement||this.fire(new u.j(new u.a1(`sources.${o}`,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 u.j(new u.a1(`sources.${o}`,null,'missing required property "canvas"'))),this.options=h,this.animate=h.animate===void 0||h.animate}load(){return u._(this,void 0,void 0,function*(){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 u.j(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(o){this.map=o,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let o=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,o=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,o=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const h=this.map.painter.context,d=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,$n.members)),this.boundsSegments||(this.boundsSegments=u.$.simpleSegment(0,0,4,2)),this.texture?(o||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new wt(h,this.canvas,d.RGBA,{premultiply:!0});let g=!1;for(const y in this.tiles){const I=this.tiles[y];I.state!=="loaded"&&(I.state="loaded",I.texture=this.texture,g=!0)}g&&this.fire(new u.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const o of[this.canvas.width,this.canvas.height])if(isNaN(o)||o<=0)return!0;return!1}}const Ia={},Ir=_=>{switch(_){case"geojson":return nn;case"image":return _r;case"raster":return an;case"raster-dem":return ji;case"vector":return Pt;case"video":return ss;case"canvas":return Ts}return Ia[_]};class tl extends u.E{constructor(){super(...arguments),this.pluginStatus="unavailable",this.pluginURL=null,this.dispatcher=cn(),this.queue=[]}_sendPluginStateToWorker(){return u._(this,void 0,void 0,function*(){yield this.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}),this.fire(new u.k("pluginStateChange",{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}))})}getRTLTextPluginStatus(){return this.pluginStatus}clearRTLTextPlugin(){this.pluginStatus="unavailable",this.pluginURL=null}setRTLTextPlugin(o,h=!1){return u._(this,void 0,void 0,function*(){if(this.pluginStatus==="deferred"||this.pluginStatus==="loading"||this.pluginStatus==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");this.pluginURL=L.resolveURL(o),this.pluginStatus="deferred",yield this._sendPluginStateToWorker(),h||(yield this._downloadRTLTextPlugin())})}_downloadRTLTextPlugin(){return u._(this,void 0,void 0,function*(){if(this.pluginStatus!=="deferred"||!this.pluginURL)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");try{this.pluginStatus="loading",yield this._sendPluginStateToWorker(),yield u.l({url:this.pluginURL},new AbortController),this.pluginStatus="loaded"}catch{this.pluginStatus="error"}yield this._sendPluginStateToWorker()})}lazyLoadRTLTextPlugin(){return u._(this,void 0,void 0,function*(){this.pluginStatus==="deferred"&&(yield this._downloadRTLTextPlugin())})}}let as=null;function $t(){return as||(as=new tl),as}class qo{constructor(o,h){this.timeAdded=0,this.fadeEndTime=0,this.tileID=o,this.uid=u.a3(),this.uses=0,this.tileSize=h,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(o){const h=o+this.timeAdded;hy.getLayer(k)).filter(Boolean);if(M.length!==0){T.layers=M,T.stateDependentLayerIds&&(T.stateDependentLayers=T.stateDependentLayerIds.map(k=>M.filter(N=>N.id===k)[0]));for(const k of M)I[k.id]=T}}return I}(o.buckets,h.style),this.hasSymbolBuckets=!1;for(const g in this.buckets){const y=this.buckets[g];if(y instanceof u.a5){if(this.hasSymbolBuckets=!0,!d)break;y.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const g in this.buckets){const y=this.buckets[g];if(y instanceof u.a5&&y.hasRTLText){this.hasRTLText=!0,$t().lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const g in this.buckets){const y=this.buckets[g];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(g).queryRadius(y))}o.imageAtlas&&(this.imageAtlas=o.imageAtlas),o.glyphAtlasImage&&(this.glyphAtlasImage=o.glyphAtlasImage)}else this.collisionBoxArray=new u.a4}unloadVectorData(){for(const o in this.buckets)this.buckets[o].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(o){return this.buckets[o.id]}upload(o){for(const d in this.buckets){const g=this.buckets[d];g.uploadPending()&&g.upload(o)}const h=o.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new wt(o,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new wt(o,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(o){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(o,this.imageAtlasTexture)}queryRenderedFeatures(o,h,d,g,y,I,T,M,k,N){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:g,cameraQueryGeometry:y,scale:I,tileSize:this.tileSize,pixelPosMatrix:N,transform:M,params:T,queryPadding:this.queryPadding*k},o,h,d):{}}querySourceFeatures(o,h){const d=this.latestFeatureIndex;if(!d||!d.rawTileData)return;const g=d.loadVTLayers(),y=h&&h.sourceLayer?h.sourceLayer:"",I=g._geojsonTileLayer||g[y];if(!I)return;const T=u.a6(h&&h.filter),{z:M,x:k,y:N}=this.tileID.canonical,z={z:M,x:k,y:N};for(let Z=0;Zd)g=!1;else if(h)if(this.expirationTime{this.remove(o,y)},d)),this.data[g].push(y),this.order.push(g),this.order.length>this.max){const I=this._getAndRemoveByKey(this.order[0]);I&&this.onRemove(I)}return this}has(o){return o.wrapped().key in this.data}getAndRemove(o){return this.has(o)?this._getAndRemoveByKey(o.wrapped().key):null}_getAndRemoveByKey(o){const h=this.data[o].shift();return h.timeout&&clearTimeout(h.timeout),this.data[o].length===0&&delete this.data[o],this.order.splice(this.order.indexOf(o),1),h.value}getByKey(o){const h=this.data[o];return h?h[0].value:null}get(o){return this.has(o)?this.data[o.wrapped().key][0].value:null}remove(o,h){if(!this.has(o))return this;const d=o.wrapped().key,g=h===void 0?0:this.data[d].indexOf(h),y=this.data[d][g];return this.data[d].splice(g,1),y.timeout&&clearTimeout(y.timeout),this.data[d].length===0&&delete this.data[d],this.onRemove(y.value),this.order.splice(this.order.indexOf(d),1),this}setMaxSize(o){for(this.max=o;this.order.length>this.max;){const h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}return this}filter(o){const h=[];for(const d in this.data)for(const g of this.data[d])o(g.value)||h.push(g);for(const d of h)this.remove(d.value.tileID,d)}}class el{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(o,h,d){const g=String(h);if(this.stateChanges[o]=this.stateChanges[o]||{},this.stateChanges[o][g]=this.stateChanges[o][g]||{},u.e(this.stateChanges[o][g],d),this.deletedStates[o]===null){this.deletedStates[o]={};for(const y in this.state[o])y!==g&&(this.deletedStates[o][y]=null)}else if(this.deletedStates[o]&&this.deletedStates[o][g]===null){this.deletedStates[o][g]={};for(const y in this.state[o][g])d[y]||(this.deletedStates[o][g][y]=null)}else for(const y in d)this.deletedStates[o]&&this.deletedStates[o][g]&&this.deletedStates[o][g][y]===null&&delete this.deletedStates[o][g][y]}removeFeatureState(o,h,d){if(this.deletedStates[o]===null)return;const g=String(h);if(this.deletedStates[o]=this.deletedStates[o]||{},d&&h!==void 0)this.deletedStates[o][g]!==null&&(this.deletedStates[o][g]=this.deletedStates[o][g]||{},this.deletedStates[o][g][d]=null);else if(h!==void 0)if(this.stateChanges[o]&&this.stateChanges[o][g])for(d in this.deletedStates[o][g]={},this.stateChanges[o][g])this.deletedStates[o][g][d]=null;else this.deletedStates[o][g]=null;else this.deletedStates[o]=null}getState(o,h){const d=String(h),g=u.e({},(this.state[o]||{})[d],(this.stateChanges[o]||{})[d]);if(this.deletedStates[o]===null)return{};if(this.deletedStates[o]){const y=this.deletedStates[o][h];if(y===null)return{};for(const I in y)delete g[I]}return g}initializeTileState(o,h){o.setFeatureState(this.state,h)}coalesceChanges(o,h){const d={};for(const g in this.stateChanges){this.state[g]=this.state[g]||{};const y={};for(const I in this.stateChanges[g])this.state[g][I]||(this.state[g][I]={}),u.e(this.state[g][I],this.stateChanges[g][I]),y[I]=this.state[g][I];d[g]=y}for(const g in this.deletedStates){this.state[g]=this.state[g]||{};const y={};if(this.deletedStates[g]===null)for(const I in this.state[g])y[I]={},this.state[g][I]={};else for(const I in this.deletedStates[g]){if(this.deletedStates[g][I]===null)this.state[g][I]={};else for(const T of Object.keys(this.deletedStates[g][I]))delete this.state[g][I][T];y[I]=this.state[g][I]}d[g]=d[g]||{},u.e(d[g],y)}if(this.stateChanges={},this.deletedStates={},Object.keys(d).length!==0)for(const g in o)o[g].setFeatureState(d,h)}}class Vi extends u.E{constructor(o,h,d){super(),this.id=o,this.dispatcher=d,this.on("data",g=>{g.dataType==="source"&&g.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&g.dataType==="source"&&g.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((g,y,I,T)=>{const M=new(Ir(y.type))(g,y,I,T);if(M.id!==g)throw new Error(`Expected Source id to be ${g} instead of ${M.id}`);return M})(o,h,d,this),this._tiles={},this._cache=new Ur(0,g=>this._unloadTile(g)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new el,this._didEmitContent=!1,this._updated=!1}onAdd(o){this.map=o,this._maxTileCacheSize=o?o._maxTileCacheSize:null,this._maxTileCacheZoomLevels=o?o._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(o)}onRemove(o){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(o)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const o in this._tiles){const h=this._tiles[o];if(h.state!=="loaded"&&h.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const o=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,o&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(o,h,d){return u._(this,void 0,void 0,function*(){try{yield this._source.loadTile(o),this._tileLoaded(o,h,d)}catch(g){o.state="errored",g.status!==404?this._source.fire(new u.j(g,{tile:o})):this.update(this.transform,this.terrain)}})}_unloadTile(o){this._source.unloadTile&&this._source.unloadTile(o)}_abortTile(o){this._source.abortTile&&this._source.abortTile(o),this._source.fire(new u.k("dataabort",{tile:o,coord:o.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(o){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const h in this._tiles){const d=this._tiles[h];d.upload(o),d.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(o=>o.tileID).sort(oe).map(o=>o.key)}getRenderableIds(o){const h=[];for(const d in this._tiles)this._isIdRenderable(d,o)&&h.push(this._tiles[d]);return o?h.sort((d,g)=>{const y=d.tileID,I=g.tileID,T=new u.P(y.canonical.x,y.canonical.y)._rotate(this.transform.angle),M=new u.P(I.canonical.x,I.canonical.y)._rotate(this.transform.angle);return y.overscaledZ-I.overscaledZ||M.y-T.y||M.x-T.x}).map(d=>d.tileID.key):h.map(d=>d.tileID).sort(oe).map(d=>d.key)}hasRenderableParent(o){const h=this.findLoadedParent(o,0);return!!h&&this._isIdRenderable(h.tileID.key)}_isIdRenderable(o,h){return this._tiles[o]&&this._tiles[o].hasData()&&!this._coveredTiles[o]&&(h||!this._tiles[o].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const o in this._tiles)this._tiles[o].state!=="errored"&&this._reloadTile(o,"reloading")}}_reloadTile(o,h){return u._(this,void 0,void 0,function*(){const d=this._tiles[o];d&&(d.state!=="loading"&&(d.state=h),yield this._loadTile(d,o,h))})}_tileLoaded(o,h,d){o.timeAdded=L.now(),d==="expired"&&(o.refreshedUponExpiration=!0),this._setTileReloadTimer(h,o),this.getSource().type==="raster-dem"&&o.dem&&this._backfillDEM(o),this._state.initializeTileState(o,this.map?this.map.painter:null),o.aborted||this._source.fire(new u.k("data",{dataType:"source",tile:o,coord:o.tileID}))}_backfillDEM(o){const h=this.getRenderableIds();for(let g=0;g1||(Math.abs(I)>1&&(Math.abs(I+M)===1?I+=M:Math.abs(I-M)===1&&(I-=M)),y.dem&&g.dem&&(g.dem.backfillBorder(y.dem,I,T),g.neighboringTiles&&g.neighboringTiles[k]&&(g.neighboringTiles[k].backfilled=!0)))}}getTile(o){return this.getTileByID(o.key)}getTileByID(o){return this._tiles[o]}_retainLoadedChildren(o,h,d,g){for(const y in this._tiles){let I=this._tiles[y];if(g[y]||!I.hasData()||I.tileID.overscaledZ<=h||I.tileID.overscaledZ>d)continue;let T=I.tileID;for(;I&&I.tileID.overscaledZ>h+1;){const k=I.tileID.scaledTo(I.tileID.overscaledZ-1);I=this._tiles[k.key],I&&I.hasData()&&(T=k)}let M=T;for(;M.overscaledZ>h;)if(M=M.scaledTo(M.overscaledZ-1),o[M.key]){g[T.key]=T;break}}}findLoadedParent(o,h){if(o.key in this._loadedParentTiles){const d=this._loadedParentTiles[o.key];return d&&d.tileID.overscaledZ>=h?d:null}for(let d=o.overscaledZ-1;d>=h;d--){const g=o.scaledTo(d),y=this._getLoadedTile(g);if(y)return y}}_getLoadedTile(o){const h=this._tiles[o.key];return h&&h.hasData()?h:this._cache.getByKey(o.wrapped().key)}updateCacheSize(o){const h=Math.ceil(o.width/this._source.tileSize)+1,d=Math.ceil(o.height/this._source.tileSize)+1,g=Math.floor(h*d*(this._maxTileCacheZoomLevels===null?u.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(y)}handleWrapJump(o){const h=Math.round((o-(this._prevLng===void 0?o:this._prevLng))/360);if(this._prevLng=o,h){const d={};for(const g in this._tiles){const y=this._tiles[g];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+h),d[y.tileID.key]=y}this._tiles=d;for(const g in this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(const g in this._tiles)this._setTileReloadTimer(g,this._tiles[g])}}update(o,h){if(this.transform=o,this.terrain=h,!this._sourceLoaded||this._paused)return;let d;this.updateCacheSize(o),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?d=o.getVisibleUnwrappedCoordinates(this._source.tileID).map(N=>new u.Q(N.canonical.z,N.wrap,N.canonical.z,N.canonical.x,N.canonical.y)):(d=o.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:h}),this._source.hasTile&&(d=d.filter(N=>this._source.hasTile(N)))):d=[];const g=o.coveringZoomLevel(this._source),y=Math.max(g-Vi.maxOverzooming,this._source.minzoom),I=Math.max(g+Vi.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const N={};for(const z of d)if(z.canonical.z>this._source.minzoom){const Z=z.scaledTo(z.canonical.z-1);N[Z.key]=Z;const nt=z.scaledTo(Math.max(this._source.minzoom,Math.min(z.canonical.z,5)));N[nt.key]=nt}d=d.concat(Object.values(N))}const T=d.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,T&&this.fire(new u.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const M=this._updateRetainedTiles(d,g);if(Ye(this._source.type)){const N={},z={},Z=Object.keys(M),nt=L.now();for(const it of Z){const st=M[it],tt=this._tiles[it];if(!tt||tt.fadeEndTime!==0&&tt.fadeEndTime<=nt)continue;const mt=this.findLoadedParent(st,y);mt&&(this._addTile(mt.tileID),N[mt.tileID.key]=mt.tileID),z[it]=st}this._retainLoadedChildren(z,g,I,M);for(const it in N)M[it]||(this._coveredTiles[it]=!0,M[it]=N[it]);if(h){const it={},st={};for(const tt of d)this._tiles[tt.key].hasData()?it[tt.key]=tt:st[tt.key]=tt;for(const tt in st){const mt=st[tt].children(this._source.maxzoom);this._tiles[mt[0].key]&&this._tiles[mt[1].key]&&this._tiles[mt[2].key]&&this._tiles[mt[3].key]&&(it[mt[0].key]=M[mt[0].key]=mt[0],it[mt[1].key]=M[mt[1].key]=mt[1],it[mt[2].key]=M[mt[2].key]=mt[2],it[mt[3].key]=M[mt[3].key]=mt[3],delete st[tt])}for(const tt in st){const mt=this.findLoadedParent(st[tt],this._source.minzoom);if(mt){it[mt.tileID.key]=M[mt.tileID.key]=mt.tileID;for(const Ct in it)it[Ct].isChildOf(mt.tileID)&&delete it[Ct]}}for(const tt in this._tiles)it[tt]||(this._coveredTiles[tt]=!0)}}for(const N in M)this._tiles[N].clearFadeHold();const k=u.ab(this._tiles,M);for(const N of k){const z=this._tiles[N];z.hasSymbolBuckets&&!z.holdingForFade()?z.setHoldDuration(this.map._fadeDuration):z.hasSymbolBuckets&&!z.symbolFadeFinished()||this._removeTile(N)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const o in this._tiles)this._tiles[o].holdingForFade()&&this._removeTile(o)}_updateRetainedTiles(o,h){const d={},g={},y=Math.max(h-Vi.maxOverzooming,this._source.minzoom),I=Math.max(h+Vi.maxUnderzooming,this._source.minzoom),T={};for(const M of o){const k=this._addTile(M);d[M.key]=M,k.hasData()||hthis._source.maxzoom){const z=M.children(this._source.maxzoom)[0],Z=this.getTile(z);if(Z&&Z.hasData()){d[z.key]=z;continue}}else{const z=M.children(this._source.maxzoom);if(d[z[0].key]&&d[z[1].key]&&d[z[2].key]&&d[z[3].key])continue}let N=k.wasRequested();for(let z=M.overscaledZ-1;z>=y;--z){const Z=M.scaledTo(z);if(g[Z.key])break;if(g[Z.key]=!0,k=this.getTile(Z),!k&&N&&(k=this._addTile(Z)),k){const nt=k.hasData();if((N||nt)&&(d[Z.key]=Z),N=k.wasRequested(),nt)break}}}return d}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const o in this._tiles){const h=[];let d,g=this._tiles[o].tileID;for(;g.overscaledZ>0;){if(g.key in this._loadedParentTiles){d=this._loadedParentTiles[g.key];break}h.push(g.key);const y=g.scaledTo(g.overscaledZ-1);if(d=this._getLoadedTile(y),d)break;g=y}for(const y of h)this._loadedParentTiles[y]=d}}_addTile(o){let h=this._tiles[o.key];if(h)return h;h=this._cache.getAndRemove(o),h&&(this._setTileReloadTimer(o.key,h),h.tileID=o,this._state.initializeTileState(h,this.map?this.map.painter:null),this._cacheTimers[o.key]&&(clearTimeout(this._cacheTimers[o.key]),delete this._cacheTimers[o.key],this._setTileReloadTimer(o.key,h)));const d=h;return h||(h=new qo(o,this._source.tileSize*o.overscaleFactor()),this._loadTile(h,o.key,h.state)),h.uses++,this._tiles[o.key]=h,d||this._source.fire(new u.k("dataloading",{tile:h,coord:h.tileID,dataType:"source"})),h}_setTileReloadTimer(o,h){o in this._timers&&(clearTimeout(this._timers[o]),delete this._timers[o]);const d=h.getExpiryTimeout();d&&(this._timers[o]=setTimeout(()=>{this._reloadTile(o,"expired"),delete this._timers[o]},d))}_removeTile(o){const h=this._tiles[o];h&&(h.uses--,delete this._tiles[o],this._timers[o]&&(clearTimeout(this._timers[o]),delete this._timers[o]),h.uses>0||(h.hasData()&&h.state!=="reloading"?this._cache.add(h.tileID,h,h.getExpiryTimeout()):(h.aborted=!0,this._abortTile(h),this._unloadTile(h))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const o in this._tiles)this._removeTile(o);this._cache.reset()}tilesIn(o,h,d){const g=[],y=this.transform;if(!y)return g;const I=d?y.getCameraQueryGeometry(o):o,T=o.map(it=>y.pointCoordinate(it,this.terrain)),M=I.map(it=>y.pointCoordinate(it,this.terrain)),k=this.getIds();let N=1/0,z=1/0,Z=-1/0,nt=-1/0;for(const it of M)N=Math.min(N,it.x),z=Math.min(z,it.y),Z=Math.max(Z,it.x),nt=Math.max(nt,it.y);for(let it=0;it=0&<[1].y+Ct>=0){const bt=T.map(Mt=>tt.getTilePoint(Mt)),kt=M.map(Mt=>tt.getTilePoint(Mt));g.push({tile:st,tileID:tt,queryGeometry:bt,cameraQueryGeometry:kt,scale:mt})}}return g}getVisibleCoordinates(o){const h=this.getRenderableIds(o).map(d=>this._tiles[d].tileID);for(const d of h)d.posMatrix=this.transform.calculatePosMatrix(d.toUnwrapped());return h}hasTransition(){if(this._source.hasTransition())return!0;if(Ye(this._source.type)){const o=L.now();for(const h in this._tiles)if(this._tiles[h].fadeEndTime>=o)return!0}return!1}setFeatureState(o,h,d){this._state.updateState(o=o||"_geojsonTileLayer",h,d)}removeFeatureState(o,h,d){this._state.removeFeatureState(o=o||"_geojsonTileLayer",h,d)}getFeatureState(o,h){return this._state.getState(o=o||"_geojsonTileLayer",h)}setDependencies(o,h,d){const g=this._tiles[o];g&&g.setDependencies(h,d)}reloadTilesForDependencies(o,h){for(const d in this._tiles)this._tiles[d].hasDependency(o,h)&&this._reloadTile(d,"reloading");this._cache.filter(d=>!d.hasDependency(o,h))}}function oe(_,o){const h=Math.abs(2*_.wrap)-+(_.wrap<0),d=Math.abs(2*o.wrap)-+(o.wrap<0);return _.overscaledZ-o.overscaledZ||d-h||o.canonical.y-_.canonical.y||o.canonical.x-_.canonical.x}function Ye(_){return _==="raster"||_==="image"||_==="video"}Vi.maxOverzooming=10,Vi.maxUnderzooming=3;class He{constructor(o,h){this.reset(o,h)}reset(o,h){this.points=o||[],this._distances=[0];for(let d=1;d0?(g-I)/T:0;return this.points[y].mult(1-M).add(this.points[h].mult(M))}}function xi(_,o){let h=!0;return _==="always"||_!=="never"&&o!=="never"||(h=!1),h}class jo{constructor(o,h,d){const g=this.boxCells=[],y=this.circleCells=[];this.xCellCount=Math.ceil(o/d),this.yCellCount=Math.ceil(h/d);for(let I=0;Ithis.width||g<0||h>this.height)return[];const M=[];if(o<=0&&h<=0&&this.width<=d&&this.height<=g){if(y)return[{key:null,x1:o,y1:h,x2:d,y2:g}];for(let k=0;k0}hitTestCircle(o,h,d,g,y){const I=o-d,T=o+d,M=h-d,k=h+d;if(T<0||I>this.width||k<0||M>this.height)return!1;const N=[];return this._forEachCell(I,M,T,k,this._queryCellCircle,N,{hitTest:!0,overlapMode:g,circle:{x:o,y:h,radius:d},seenUids:{box:{},circle:{}}},y),N.length>0}_queryCell(o,h,d,g,y,I,T,M){const{seenUids:k,hitTest:N,overlapMode:z}=T,Z=this.boxCells[y];if(Z!==null){const it=this.bboxes;for(const st of Z)if(!k.box[st]){k.box[st]=!0;const tt=4*st,mt=this.boxKeys[st];if(o<=it[tt+2]&&h<=it[tt+3]&&d>=it[tt+0]&&g>=it[tt+1]&&(!M||M(mt))&&(!N||!xi(z,mt.overlapMode))&&(I.push({key:mt,x1:it[tt],y1:it[tt+1],x2:it[tt+2],y2:it[tt+3]}),N))return!0}}const nt=this.circleCells[y];if(nt!==null){const it=this.circles;for(const st of nt)if(!k.circle[st]){k.circle[st]=!0;const tt=3*st,mt=this.circleKeys[st];if(this._circleAndRectCollide(it[tt],it[tt+1],it[tt+2],o,h,d,g)&&(!M||M(mt))&&(!N||!xi(z,mt.overlapMode))){const Ct=it[tt],lt=it[tt+1],bt=it[tt+2];if(I.push({key:mt,x1:Ct-bt,y1:lt-bt,x2:Ct+bt,y2:lt+bt}),N)return!0}}}return!1}_queryCellCircle(o,h,d,g,y,I,T,M){const{circle:k,seenUids:N,overlapMode:z}=T,Z=this.boxCells[y];if(Z!==null){const it=this.bboxes;for(const st of Z)if(!N.box[st]){N.box[st]=!0;const tt=4*st,mt=this.boxKeys[st];if(this._circleAndRectCollide(k.x,k.y,k.radius,it[tt+0],it[tt+1],it[tt+2],it[tt+3])&&(!M||M(mt))&&!xi(z,mt.overlapMode))return I.push(!0),!0}}const nt=this.circleCells[y];if(nt!==null){const it=this.circles;for(const st of nt)if(!N.circle[st]){N.circle[st]=!0;const tt=3*st,mt=this.circleKeys[st];if(this._circlesCollide(it[tt],it[tt+1],it[tt+2],k.x,k.y,k.radius)&&(!M||M(mt))&&!xi(z,mt.overlapMode))return I.push(!0),!0}}}_forEachCell(o,h,d,g,y,I,T,M){const k=this._convertToXCellCoord(o),N=this._convertToYCellCoord(h),z=this._convertToXCellCoord(d),Z=this._convertToYCellCoord(g);for(let nt=k;nt<=z;nt++)for(let it=N;it<=Z;it++)if(y.call(this,o,h,d,g,this.xCellCount*it+nt,I,T,M))return}_convertToXCellCoord(o){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(o*this.xScale)))}_convertToYCellCoord(o){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(o*this.yScale)))}_circlesCollide(o,h,d,g,y,I){const T=g-o,M=y-h,k=d+I;return k*k>T*T+M*M}_circleAndRectCollide(o,h,d,g,y,I,T){const M=(I-g)/2,k=Math.abs(o-(g+M));if(k>M+d)return!1;const N=(T-y)/2,z=Math.abs(h-(y+N));if(z>N+d)return!1;if(k<=M||z<=N)return!0;const Z=k-M,nt=z-N;return Z*Z+nt*nt<=d*d}}function We(_,o,h,d,g){const y=u.F();return o?(u.J(y,y,[1/g,1/g,1]),h||u.ad(y,y,d.angle)):u.K(y,d.labelPlaneMatrix,_),y}function ea(_,o,h,d,g){if(o){const y=u.ae(_);return u.J(y,y,[g,g,1]),h||u.ad(y,y,-d.angle),y}return d.glCoordMatrix}function Ci(_,o,h){let d;h?(d=[_.x,_.y,h(_.x,_.y),1],u.af(d,d,o)):(d=[_.x,_.y,0,1],Se(d,d,o));const g=d[3];return{point:new u.P(d[0]/g,d[1]/g),signedDistanceFromCamera:g}}function ot(_,o){return .5+_/o*.5}function F(_,o){const h=_[0]/_[3],d=_[1]/_[3];return h>=-o[0]&&h<=o[0]&&d>=-o[1]&&d<=o[1]}function q(_,o,h,d,g,y,I,T,M,k){const N=d?_.textSizeData:_.iconSizeData,z=u.ag(N,h.transform.zoom),Z=[256/h.width*2+1,256/h.height*2+1],nt=d?_.text.dynamicLayoutVertexArray:_.icon.dynamicLayoutVertexArray;nt.clear();const it=_.lineVertexArray,st=d?_.text.placedSymbolArray:_.icon.placedSymbolArray,tt=h.transform.width/h.transform.height;let mt=!1;for(let Ct=0;CtMath.abs(h.x-o.x)*d?{useVertical:!0}:(_===u.ah.vertical?o.yh.x)?{needsFlipping:!0}:null}function gt(_,o,h,d,g,y,I,T,M,k,N,z,Z,nt,it,st){const tt=o/24,mt=_.lineOffsetX*tt,Ct=_.lineOffsetY*tt;let lt;if(_.numGlyphs>1){const bt=_.glyphStartIndex+_.numGlyphs,kt=_.lineStartIndex,Mt=_.lineStartIndex+_.lineLength,Zt=H(tt,T,mt,Ct,h,N,z,_,M,y,Z,it,st);if(!Zt)return{notEnoughRoom:!0};const Jt=Ci(Zt.first.point,I,st).point,Ht=Ci(Zt.last.point,I,st).point;if(d&&!h){const te=et(_.writingMode,Jt,Ht,nt);if(te)return te}lt=[Zt.first];for(let te=_.glyphStartIndex+1;te0?Jt.point:K(z,Zt,kt,1,g,st),te=et(_.writingMode,kt,Ht,nt);if(te)return te}const bt=At(tt*T.getoffsetX(_.glyphStartIndex),mt,Ct,h,N,z,_.segment,_.lineStartIndex,_.lineStartIndex+_.lineLength,M,y,Z,it,st);if(!bt)return{notEnoughRoom:!0};lt=[bt]}for(const bt of lt)u.aj(k,bt.point,bt.angle);return{}}function K(_,o,h,d,g,y){const I=Ci(_.add(_.sub(o)._unit()),g,y).point,T=h.sub(I);return h.add(T._mult(d/T.mag()))}function _t(_,o){const{projectionCache:h,lineVertexArray:d,labelPlaneMatrix:g,tileAnchorPoint:y,distanceFromAnchor:I,getElevation:T,previousVertex:M,direction:k,absOffsetX:N}=o;if(h.projections[_])return h.projections[_];const z=new u.P(d.getx(_),d.gety(_)),Z=Ci(z,g,T);if(Z.signedDistanceFromCamera>0)return h.projections[_]=Z.point,Z.point;const nt=_-k;return K(I===0?y:new u.P(d.getx(nt),d.gety(nt)),z,M,N-I+1,g,T)}function ht(_,o,h){return _._unit()._perp()._mult(o*h)}function St(_,o,h,d,g,y,I,T){const{projectionCache:M,direction:k}=T;if(M.offsets[_])return M.offsets[_];const N=h.add(o);if(_+k=g)return M.offsets[_]=N,N;const z=_t(_+k,T),Z=ht(z.sub(h),I,k),nt=h.add(Z),it=z.add(Z);return M.offsets[_]=u.ak(y,N,nt,it)||N,M.offsets[_]}function At(_,o,h,d,g,y,I,T,M,k,N,z,Z,nt){const it=d?_-o:_+o;let st=it>0?1:-1,tt=0;d&&(st*=-1,tt=Math.PI),st<0&&(tt+=Math.PI);let mt,Ct,lt=st>0?T+I:T+I+1,bt=g,kt=g,Mt=0,Zt=0;const Jt=Math.abs(it),Ht=[];let te;for(;Mt+Zt<=Jt;){if(lt+=st,lt=M)return null;Mt+=Zt,kt=bt,Ct=mt;const ce={projectionCache:z,lineVertexArray:k,labelPlaneMatrix:N,tileAnchorPoint:y,distanceFromAnchor:Mt,getElevation:nt,previousVertex:kt,direction:st,absOffsetX:Jt};if(bt=_t(lt,ce),h===0)Ht.push(kt),te=bt.sub(kt);else{let Ae;const xe=bt.sub(kt);Ae=xe.mag()===0?ht(_t(lt+st,ce).sub(bt),h,st):ht(xe,h,st),Ct||(Ct=kt.add(Ae)),mt=St(lt,Ae,bt,T,M,Ct,h,ce),Ht.push(Ct),te=mt.sub(Ct)}Zt=te.mag()}const ye=te._mult((Jt-Mt)/Zt)._add(Ct||kt),ze=tt+Math.atan2(bt.y-kt.y,bt.x-kt.x);return Ht.push(ye),{point:ye,angle:Z?ze:0,path:Ht}}const Nt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Gt(_,o){for(let h=0;h<_;h++){const d=o.length;o.resize(d+4),o.float32.set(Nt,3*d)}}function Se(_,o,h){const d=o[0],g=o[1];return _[0]=h[0]*d+h[4]*g+h[12],_[1]=h[1]*d+h[5]*g+h[13],_[3]=h[3]*d+h[7]*g+h[15],_}const Ce=100;class qe{constructor(o,h=new jo(o.width+200,o.height+200,25),d=new jo(o.width+200,o.height+200,25)){this.transform=o,this.grid=h,this.ignoredGrid=d,this.pitchfactor=Math.cos(o._pitch)*o.cameraToCenterDistance,this.screenRightBoundary=o.width+Ce,this.screenBottomBoundary=o.height+Ce,this.gridRightBoundary=o.width+200,this.gridBottomBoundary=o.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(o,h,d,g,y,I){const T=this.projectAndGetPerspectiveRatio(g,o.anchorPointX,o.anchorPointY,I),M=d*T.perspectiveRatio,k=o.x1*M+T.point.x,N=o.y1*M+T.point.y,z=o.x2*M+T.point.x,Z=o.y2*M+T.point.y;return!this.isInsideGrid(k,N,z,Z)||h!=="always"&&this.grid.hitTest(k,N,z,Z,h,y)||T.perspectiveRatio=1;tn--)xe.push(ce.path[tn]);for(let tn=1;tnCi(un,M,it));xe=tn.some(un=>un.signedDistanceFromCamera<=0)?[]:tn.map(un=>un.point)}let ln=[];if(xe.length>0){const tn=xe[0].clone(),un=xe[0].clone();for(let Mi=1;Mi=te.x&&un.x<=ye.x&&tn.y>=te.y&&un.y<=ye.y?[xe]:un.xye.x||un.yye.y?[]:u.al([xe],te.x,te.y,ye.x,ye.y)}for(const tn of ln){ze.reset(tn,.25*Ht);let un=0;un=ze.length<=.5*Ht?1:Math.ceil(ze.paddedLength/Xn)+1;for(let Mi=0;Mi=this.screenRightBoundary||gthis.screenBottomBoundary}isInsideGrid(o,h,d,g){return d>=0&&o=0&&hd.collisionGroupID===h}}return this.collisionGroups[o]}}function Zi(_,o,h,d,g){const{horizontalAlign:y,verticalAlign:I}=u.at(_);return new u.P(-(y-.5)*o+d[0]*g,-(I-.5)*h+d[1]*g)}function Gr(_,o,h,d,g,y){const{x1:I,x2:T,y1:M,y2:k,anchorPointX:N,anchorPointY:z}=_,Z=new u.P(o,h);return d&&Z._rotate(g?y:-y),{x1:I+Z.x,y1:M+Z.y,x2:T+Z.x,y2:k+Z.y,anchorPointX:N,anchorPointY:z}}class ro{constructor(o,h,d,g,y){this.transform=o.clone(),this.terrain=h,this.collisionIndex=new qe(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=d,this.retainedQueryData={},this.collisionGroups=new ci(g),this.collisionCircleArrays={},this.prevPlacement=y,y&&(y.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(o,h,d,g){const y=d.getBucket(h),I=d.latestFeatureIndex;if(!y||!I||h.id!==y.layerIds[0])return;const T=d.collisionBoxArray,M=y.layers[0].layout,k=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),N=d.tileSize/u.W,z=this.transform.calculatePosMatrix(d.tileID.toUnwrapped()),Z=M.get("text-pitch-alignment")==="map",nt=M.get("text-rotation-alignment")==="map",it=je(d,1,this.transform.zoom),st=We(z,Z,nt,this.transform,it);let tt=null;if(Z){const Ct=ea(z,Z,nt,this.transform,it);tt=u.K([],this.transform.labelPlaneMatrix,Ct)}this.retainedQueryData[y.bucketInstanceId]=new $e(y.bucketInstanceId,I,y.sourceLayerIndex,y.index,d.tileID);const mt={bucket:y,layout:M,posMatrix:z,textLabelPlaneMatrix:st,labelToScreenMatrix:tt,scale:k,textPixelRatio:N,holdingForFade:d.holdingForFade(),collisionBoxArray:T,partiallyEvaluatedTextSize:u.ag(y.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(y.sourceID)};if(g)for(const Ct of y.sortKeyRanges){const{sortKey:lt,symbolInstanceStart:bt,symbolInstanceEnd:kt}=Ct;o.push({sortKey:lt,symbolInstanceStart:bt,symbolInstanceEnd:kt,parameters:mt})}else o.push({symbolInstanceStart:0,symbolInstanceEnd:y.symbolInstances.length,parameters:mt})}attemptAnchorPlacement(o,h,d,g,y,I,T,M,k,N,z,Z,nt,it,st,tt){const mt=u.ap[o.textAnchor],Ct=[o.textOffset0,o.textOffset1],lt=Zi(mt,d,g,Ct,y),bt=this.collisionIndex.placeCollisionBox(Gr(h,lt.x,lt.y,I,T,this.transform.angle),z,M,k,N.predicate,tt);if((!st||this.collisionIndex.placeCollisionBox(Gr(st,lt.x,lt.y,I,T,this.transform.angle),z,M,k,N.predicate,tt).box.length!==0)&&bt.box.length>0){let kt;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID].text&&(kt=this.prevPlacement.variableOffsets[Z.crossTileID].anchor),Z.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Z.crossTileID]={textOffset:Ct,width:d,height:g,anchor:mt,textBoxScale:y,prevAnchor:kt},this.markUsedJustification(nt,mt,Z,it),nt.allowVerticalPlacement&&(this.markUsedOrientation(nt,it,Z),this.placedOrientations[Z.crossTileID]=it),{shift:lt,placedGlyphBoxes:bt}}}placeLayerBucketPart(o,h,d){const{bucket:g,layout:y,posMatrix:I,textLabelPlaneMatrix:T,labelToScreenMatrix:M,textPixelRatio:k,holdingForFade:N,collisionBoxArray:z,partiallyEvaluatedTextSize:Z,collisionGroup:nt}=o.parameters,it=y.get("text-optional"),st=y.get("icon-optional"),tt=u.aq(y,"text-overlap","text-allow-overlap"),mt=tt==="always",Ct=u.aq(y,"icon-overlap","icon-allow-overlap"),lt=Ct==="always",bt=y.get("text-rotation-alignment")==="map",kt=y.get("text-pitch-alignment")==="map",Mt=y.get("icon-text-fit")!=="none",Zt=y.get("symbol-z-order")==="viewport-y",Jt=mt&&(lt||!g.hasIconData()||st),Ht=lt&&(mt||!g.hasTextData()||it);!g.collisionArrays&&z&&g.deserializeCollisionBoxes(z);const te=this.retainedQueryData[g.bucketInstanceId].tileID,ye=this.terrain?(ce,Ae)=>this.terrain.getElevation(te,ce,Ae):null,ze=(ce,Ae)=>{var xe,Xn;if(h[ce.crossTileID])return;if(N)return void(this.placements[ce.crossTileID]=new ti(!1,!1,!1));let ln=!1,tn=!1,un=!0,Mi=null,Fn={box:null,offscreen:null},Wr={box:null,offscreen:null},ar=null,fi=null,Tr=null,Lr=0,Xo=0,Aa=0;Ae.textFeatureIndex?Lr=Ae.textFeatureIndex:ce.useRuntimeCollisionCircles&&(Lr=ce.featureIndex),Ae.verticalTextFeatureIndex&&(Xo=Ae.verticalTextFeatureIndex);const Hl=Ae.textBox;if(Hl){const Wi=Yn=>{let Hi=u.ah.horizontal;if(g.allowVerticalPlacement&&!Yn&&this.prevPlacement){const lr=this.prevPlacement.placedOrientations[ce.crossTileID];lr&&(this.placedOrientations[ce.crossTileID]=lr,Hi=lr,this.markUsedOrientation(g,Hi,ce))}return Hi},Pi=(Yn,Hi)=>{if(g.allowVerticalPlacement&&ce.numVerticalGlyphVertices>0&&Ae.verticalTextBox){for(const lr of g.writingModes)if(lr===u.ah.vertical?(Fn=Hi(),Wr=Fn):Fn=Yn(),Fn&&Fn.box&&Fn.box.length)break}else Fn=Yn()},di=ce.textAnchorOffsetStartIndex,Hr=ce.textAnchorOffsetEndIndex;if(Hr===di){const Yn=(Hi,lr)=>{const Xi=this.collisionIndex.placeCollisionBox(Hi,tt,k,I,nt.predicate,ye);return Xi&&Xi.box&&Xi.box.length&&(this.markUsedOrientation(g,lr,ce),this.placedOrientations[ce.crossTileID]=lr),Xi};Pi(()=>Yn(Hl,u.ah.horizontal),()=>{const Hi=Ae.verticalTextBox;return g.allowVerticalPlacement&&ce.numVerticalGlyphVertices>0&&Hi?Yn(Hi,u.ah.vertical):{box:null,offscreen:null}}),Wi(Fn&&Fn.box&&Fn.box.length)}else{let Yn=u.ap[(Xn=(xe=this.prevPlacement)===null||xe===void 0?void 0:xe.variableOffsets[ce.crossTileID])===null||Xn===void 0?void 0:Xn.anchor];const Hi=(Xi,kd,bi)=>{const Fp=Xi.x2-Xi.x1,Dd=Xi.y2-Xi.y1,fl=ce.textBoxScale,dl=Mt&&Ct==="never"?kd:null;let ra={box:[],offscreen:!1},th=tt==="never"?1:2,Bp="never";Yn&&th++;for(let Rd=0;RdHi(Hl,Ae.iconBox,u.ah.horizontal),()=>{const Xi=Ae.verticalTextBox;return g.allowVerticalPlacement&&!(Fn&&Fn.box&&Fn.box.length)&&ce.numVerticalGlyphVertices>0&&Xi?Hi(Xi,Ae.verticalIconBox,u.ah.vertical):{box:null,offscreen:null}}),Fn&&(ln=Fn.box,un=Fn.offscreen);const lr=Wi(Fn&&Fn.box);if(!ln&&this.prevPlacement){const Xi=this.prevPlacement.variableOffsets[ce.crossTileID];Xi&&(this.variableOffsets[ce.crossTileID]=Xi,this.markUsedJustification(g,Xi.anchor,ce,lr))}}}if(ar=Fn,ln=ar&&ar.box&&ar.box.length>0,un=ar&&ar.offscreen,ce.useRuntimeCollisionCircles){const Wi=g.text.placedSymbolArray.get(ce.centerJustifiedTextSymbolIndex),Pi=u.ai(g.textSizeData,Z,Wi),di=y.get("text-padding");fi=this.collisionIndex.placeCollisionCircles(tt,Wi,g.lineVertexArray,g.glyphOffsetArray,Pi,I,T,M,d,kt,nt.predicate,ce.collisionCircleDiameter,di,ye),fi.circles.length&&fi.collisionDetected&&!d&&u.w("Collisions detected, but collision boxes are not shown"),ln=mt||fi.circles.length>0&&!fi.collisionDetected,un=un&&fi.offscreen}if(Ae.iconFeatureIndex&&(Aa=Ae.iconFeatureIndex),Ae.iconBox){const Wi=Pi=>{const di=Mt&&Mi?Gr(Pi,Mi.x,Mi.y,bt,kt,this.transform.angle):Pi;return this.collisionIndex.placeCollisionBox(di,Ct,k,I,nt.predicate,ye)};Wr&&Wr.box&&Wr.box.length&&Ae.verticalIconBox?(Tr=Wi(Ae.verticalIconBox),tn=Tr.box.length>0):(Tr=Wi(Ae.iconBox),tn=Tr.box.length>0),un=un&&Tr.offscreen}const Xl=it||ce.numHorizontalGlyphVertices===0&&ce.numVerticalGlyphVertices===0,ka=st||ce.numIconVertices===0;if(Xl||ka?ka?Xl||(tn=tn&&ln):ln=tn&&ln:tn=ln=tn&&ln,ln&&ar&&ar.box&&this.collisionIndex.insertCollisionBox(ar.box,tt,y.get("text-ignore-placement"),g.bucketInstanceId,Wr&&Wr.box&&Xo?Xo:Lr,nt.ID),tn&&Tr&&this.collisionIndex.insertCollisionBox(Tr.box,Ct,y.get("icon-ignore-placement"),g.bucketInstanceId,Aa,nt.ID),fi&&(ln&&this.collisionIndex.insertCollisionCircles(fi.circles,tt,y.get("text-ignore-placement"),g.bucketInstanceId,Lr,nt.ID),d)){const Wi=g.bucketInstanceId;let Pi=this.collisionCircleArrays[Wi];Pi===void 0&&(Pi=this.collisionCircleArrays[Wi]=new Ui);for(let di=0;di=0;--Ae){const xe=ce[Ae];ze(g.symbolInstances.get(xe),g.collisionArrays[xe])}}else for(let ce=o.symbolInstanceStart;ce=0&&(o.text.placedSymbolArray.get(T).crossTileID=y>=0&&T!==y?0:d.crossTileID)}markUsedOrientation(o,h,d){const g=h===u.ah.horizontal||h===u.ah.horizontalOnly?h:0,y=h===u.ah.vertical?h:0,I=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex];for(const T of I)o.text.placedSymbolArray.get(T).placedOrientation=g;d.verticalPlacedTextSymbolIndex&&(o.text.placedSymbolArray.get(d.verticalPlacedTextSymbolIndex).placedOrientation=y)}commit(o){this.commitTime=o,this.zoomAtLastRecencyCheck=this.transform.zoom;const h=this.prevPlacement;let d=!1;this.prevZoomAdjustment=h?h.zoomAdjustment(this.transform.zoom):0;const g=h?h.symbolFadeChange(o):1,y=h?h.opacities:{},I=h?h.variableOffsets:{},T=h?h.placedOrientations:{};for(const M in this.placements){const k=this.placements[M],N=y[M];N?(this.opacities[M]=new On(N,g,k.text,k.icon),d=d||k.text!==N.text.placed||k.icon!==N.icon.placed):(this.opacities[M]=new On(null,g,k.text,k.icon,k.skipFade),d=d||k.text||k.icon)}for(const M in y){const k=y[M];if(!this.opacities[M]){const N=new On(k,g,!1,!1);N.isHidden()||(this.opacities[M]=N,d=d||k.text.placed||k.icon.placed)}}for(const M in I)this.variableOffsets[M]||!this.opacities[M]||this.opacities[M].isHidden()||(this.variableOffsets[M]=I[M]);for(const M in T)this.placedOrientations[M]||!this.opacities[M]||this.opacities[M].isHidden()||(this.placedOrientations[M]=T[M]);if(h&&h.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");d?this.lastPlacementChangeTime=o:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=h?h.lastPlacementChangeTime:o)}updateLayerOpacities(o,h){const d={};for(const g of h){const y=g.getBucket(o);y&&g.latestFeatureIndex&&o.id===y.layerIds[0]&&this.updateBucketOpacities(y,d,g.collisionBoxArray)}}updateBucketOpacities(o,h,d){o.hasTextData()&&(o.text.opacityVertexArray.clear(),o.text.hasVisibleVertices=!1),o.hasIconData()&&(o.icon.opacityVertexArray.clear(),o.icon.hasVisibleVertices=!1),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexArray.clear(),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexArray.clear();const g=o.layers[0],y=g.layout,I=new On(null,0,!1,!1,!0),T=y.get("text-allow-overlap"),M=y.get("icon-allow-overlap"),k=g._unevaluatedLayout.hasValue("text-variable-anchor")||g._unevaluatedLayout.hasValue("text-variable-anchor-offset"),N=y.get("text-rotation-alignment")==="map",z=y.get("text-pitch-alignment")==="map",Z=y.get("icon-text-fit")!=="none",nt=new On(null,0,T&&(M||!o.hasIconData()||y.get("icon-optional")),M&&(T||!o.hasTextData()||y.get("text-optional")),!0);!o.collisionArrays&&d&&(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData())&&o.deserializeCollisionBoxes(d);const it=(st,tt,mt)=>{for(let Ct=0;Ct0,Mt=this.placedOrientations[tt.crossTileID],Zt=Mt===u.ah.vertical,Jt=Mt===u.ah.horizontal||Mt===u.ah.horizontalOnly;if(mt>0||Ct>0){const Ht=oo(bt.text);it(o.text,mt,Zt?wu:Ht),it(o.text,Ct,Jt?wu:Ht);const te=bt.text.isHidden();[tt.rightJustifiedTextSymbolIndex,tt.centerJustifiedTextSymbolIndex,tt.leftJustifiedTextSymbolIndex].forEach(ce=>{ce>=0&&(o.text.placedSymbolArray.get(ce).hidden=te||Zt?1:0)}),tt.verticalPlacedTextSymbolIndex>=0&&(o.text.placedSymbolArray.get(tt.verticalPlacedTextSymbolIndex).hidden=te||Jt?1:0);const ye=this.variableOffsets[tt.crossTileID];ye&&this.markUsedJustification(o,ye.anchor,tt,Mt);const ze=this.placedOrientations[tt.crossTileID];ze&&(this.markUsedJustification(o,"left",tt,ze),this.markUsedOrientation(o,ze,tt))}if(kt){const Ht=oo(bt.icon),te=!(Z&&tt.verticalPlacedIconSymbolIndex&&Zt);tt.placedIconSymbolIndex>=0&&(it(o.icon,tt.numIconVertices,te?Ht:wu),o.icon.placedSymbolArray.get(tt.placedIconSymbolIndex).hidden=bt.icon.isHidden()),tt.verticalPlacedIconSymbolIndex>=0&&(it(o.icon,tt.numVerticalIconVertices,te?wu:Ht),o.icon.placedSymbolArray.get(tt.verticalPlacedIconSymbolIndex).hidden=bt.icon.isHidden())}if(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData()){const Ht=o.collisionArrays[st];if(Ht){let te=new u.P(0,0);if(Ht.textBox||Ht.verticalTextBox){let ze=!0;if(k){const ce=this.variableOffsets[lt];ce?(te=Zi(ce.anchor,ce.width,ce.height,ce.textOffset,ce.textBoxScale),N&&te._rotate(z?this.transform.angle:-this.transform.angle)):ze=!1}Ht.textBox&&sr(o.textCollisionBox.collisionVertexArray,bt.text.placed,!ze||Zt,te.x,te.y),Ht.verticalTextBox&&sr(o.textCollisionBox.collisionVertexArray,bt.text.placed,!ze||Jt,te.x,te.y)}const ye=!!(!Jt&&Ht.verticalIconBox);Ht.iconBox&&sr(o.iconCollisionBox.collisionVertexArray,bt.icon.placed,ye,Z?te.x:0,Z?te.y:0),Ht.verticalIconBox&&sr(o.iconCollisionBox.collisionVertexArray,bt.icon.placed,!ye,Z?te.x:0,Z?te.y:0)}}}if(o.sortFeatures(this.transform.angle),this.retainedQueryData[o.bucketInstanceId]&&(this.retainedQueryData[o.bucketInstanceId].featureSortOrder=o.featureSortOrder),o.hasTextData()&&o.text.opacityVertexBuffer&&o.text.opacityVertexBuffer.updateData(o.text.opacityVertexArray),o.hasIconData()&&o.icon.opacityVertexBuffer&&o.icon.opacityVertexBuffer.updateData(o.icon.opacityVertexArray),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexBuffer&&o.iconCollisionBox.collisionVertexBuffer.updateData(o.iconCollisionBox.collisionVertexArray),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexBuffer&&o.textCollisionBox.collisionVertexBuffer.updateData(o.textCollisionBox.collisionVertexArray),o.text.opacityVertexArray.length!==o.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${o.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${o.text.layoutVertexArray.length}) / 4`);if(o.icon.opacityVertexArray.length!==o.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${o.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${o.icon.layoutVertexArray.length}) / 4`);if(o.bucketInstanceId in this.collisionCircleArrays){const st=this.collisionCircleArrays[o.bucketInstanceId];o.placementInvProjMatrix=st.invProjMatrix,o.placementViewportMatrix=st.viewportMatrix,o.collisionCircleArray=st.circles,delete this.collisionCircleArrays[o.bucketInstanceId]}}symbolFadeChange(o){return this.fadeDuration===0?1:(o-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(o){return Math.max(0,(this.transform.zoom-o)/1.5)}hasTransitions(o){return this.stale||o-this.lastPlacementChangeTimeo}setStale(){this.stale=!0}}function sr(_,o,h,d,g){_.emplaceBack(o?1:0,h?1:0,d||0,g||0),_.emplaceBack(o?1:0,h?1:0,d||0,g||0),_.emplaceBack(o?1:0,h?1:0,d||0,g||0),_.emplaceBack(o?1:0,h?1:0,d||0,g||0)}const Ls=Math.pow(2,25),Kf=Math.pow(2,24),Qm=Math.pow(2,17),Dn=Math.pow(2,16),np=Math.pow(2,9),ip=Math.pow(2,8),So=Math.pow(2,1);function oo(_){if(_.opacity===0&&!_.placed)return 0;if(_.opacity===1&&_.placed)return 4294967295;const o=_.placed?1:0,h=Math.floor(127*_.opacity);return h*Ls+o*Kf+h*Qm+o*Dn+h*np+o*ip+h*So+o}const wu=0;class Zo{constructor(o){this._sortAcrossTiles=o.layout.get("symbol-z-order")!=="viewport-y"&&!o.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(o,h,d,g,y){const I=this._bucketParts;for(;this._currentTileIndexT.sortKey-M.sortKey));this._currentPartIndex!this._forceFullPlacement&&L.now()-g>2;for(;this._currentPlacementIndex>=0;){const I=h[o[this._currentPlacementIndex]],T=this.placement.collisionIndex.transform.zoom;if(I.type==="symbol"&&(!I.minzoom||I.minzoom<=T)&&(!I.maxzoom||I.maxzoom>T)){if(this._inProgressLayer||(this._inProgressLayer=new Zo(I)),this._inProgressLayer.continuePlacement(d[I.source],this.placement,this._showCollisionBoxes,I,y))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(o){return this.placement.commit(o),this.placement}}const zl=512/u.W/2;class yc{constructor(o,h,d){this.tileID=o,this.bucketInstanceId=d,this._symbolsByKey={};const g=new Map;for(let y=0;y({x:Math.floor(M.anchorX*zl),y:Math.floor(M.anchorY*zl)})),crossTileIDs:I.map(M=>M.crossTileID)};if(T.positions.length>128){const M=new u.au(T.positions.length,16,Uint16Array);for(const{x:k,y:N}of T.positions)M.add(k,N);M.finish(),delete T.positions,T.index=M}this._symbolsByKey[y]=T}}getScaledCoordinates(o,h){const{x:d,y:g,z:y}=this.tileID.canonical,{x:I,y:T,z:M}=h.canonical,k=zl/Math.pow(2,M-y),N=(T*u.W+o.anchorY)*k,z=g*u.W*zl;return{x:Math.floor((I*u.W+o.anchorX)*k-d*u.W*zl),y:Math.floor(N-z)}}findMatches(o,h,d){const g=this.tileID.canonical.zo)}}class Gi{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Su{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(o){const h=Math.round((o-this.lng)/360);if(h!==0)for(const d in this.indexes){const g=this.indexes[d],y={};for(const I in g){const T=g[I];T.tileID=T.tileID.unwrapTo(T.tileID.wrap+h),y[T.tileID.key]=T}this.indexes[d]=y}this.lng=o}addBucket(o,h,d){if(this.indexes[o.overscaledZ]&&this.indexes[o.overscaledZ][o.key]){if(this.indexes[o.overscaledZ][o.key].bucketInstanceId===h.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(o.overscaledZ,this.indexes[o.overscaledZ][o.key])}for(let y=0;yo.overscaledZ)for(const T in I){const M=I[T];M.tileID.isChildOf(o)&&M.findMatches(h.symbolInstances,o,g)}else{const T=I[o.scaledTo(Number(y)).key];T&&T.findMatches(h.symbolInstances,o,g)}}for(let y=0;y{h[d]=!0});for(const d in this.layerIndexes)h[d]||delete this.layerIndexes[d]}}const si=(_,o)=>u.t(_,o&&o.filter(h=>h.identifier!=="source.canvas")),vc=u.av();class Eo extends u.E{constructor(o,h={}){super(),this._rtlTextPluginStateChange=()=>{for(const d in this.sourceCaches){const g=this.sourceCaches[d].getSource().type;g!=="vector"&&g!=="geojson"||this.sourceCaches[d].reload()}},this.map=o,this.dispatcher=new Ge(ee(),o._getMapId()),this.dispatcher.registerMessageHandler("getGlyphs",(d,g)=>this.getGlyphs(d,g)),this.dispatcher.registerMessageHandler("getImages",(d,g)=>this.getImages(d,g)),this.imageManager=new Tt,this.imageManager.setEventedParent(this),this.glyphManager=new Ne(o._requestManager,h.localIdeographFontFamily),this.lineAtlas=new Pe(256,512),this.crossTileSymbolIndex=new Ca,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new u.aw,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",u.ax()),$t().on("pluginStateChange",this._rtlTextPluginStateChange),this.on("data",d=>{if(d.dataType!=="source"||d.sourceDataType!=="metadata")return;const g=this.sourceCaches[d.sourceId];if(!g)return;const y=g.getSource();if(y&&y.vectorLayerIds)for(const I in this._layers){const T=this._layers[I];T.source===y.id&&this._validateLayer(T)}})}loadURL(o,h={},d){this.fire(new u.k("dataloading",{dataType:"style"})),h.validate=typeof h.validate!="boolean"||h.validate;const g=this.map._requestManager.transformRequest(o,X.Style);this._loadStyleRequest=new AbortController,u.h(g,this._loadStyleRequest).then(y=>{this._loadStyleRequest=null,this._load(y.data,h,d)}).catch(y=>{this._loadStyleRequest=null,y&&this.fire(new u.j(y))})}loadJSON(o,h={},d){this.fire(new u.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,L.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,h.validate=h.validate!==!1,this._load(o,h,d)}).catch(()=>{})}loadEmpty(){this.fire(new u.k("dataloading",{dataType:"style"})),this._load(vc,{validate:!1})}_load(o,h,d){var g;const y=h.transformStyle?h.transformStyle(d,o):o;if(!h.validate||!si(this,u.x(y))){this._loaded=!0,this.stylesheet=y;for(const I in y.sources)this.addSource(I,y.sources[I],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs),this._createLayers(),this.light=new Qe(this.stylesheet.light),this.map.setTerrain((g=this.stylesheet.terrain)!==null&&g!==void 0?g:null),this.fire(new u.k("data",{dataType:"style"})),this.fire(new u.k("style.load"))}}_createLayers(){const o=u.ay(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",o),this._order=o.map(h=>h.id),this._layers={},this._serializedLayers=null;for(const h of o){const d=u.az(h);d.setEventedParent(this,{layer:{id:h.id}}),this._layers[h.id]=d}}_loadSprite(o,h=!1,d=void 0){let g;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(y,I,T,M){return u._(this,void 0,void 0,function*(){const k=yt(y),N=T>1?"@2x":"",z={},Z={};for(const{id:nt,url:it}of k){const st=I.transformRequest(I.normalizeSpriteURL(it,N,".json"),X.SpriteJSON);z[nt]=u.h(st,M);const tt=I.transformRequest(I.normalizeSpriteURL(it,N,".png"),X.SpriteImage);Z[nt]=G.getImage(tt,M)}return yield Promise.all([...Object.values(z),...Object.values(Z)]),function(nt,it){return u._(this,void 0,void 0,function*(){const st={};for(const tt in nt){st[tt]={};const mt=L.getImageCanvasContext((yield it[tt]).data),Ct=(yield nt[tt]).data;for(const lt in Ct){const{width:bt,height:kt,x:Mt,y:Zt,sdf:Jt,pixelRatio:Ht,stretchX:te,stretchY:ye,content:ze}=Ct[lt];st[tt][lt]={data:null,pixelRatio:Ht,sdf:Jt,stretchX:te,stretchY:ye,content:ze,spriteData:{width:bt,height:kt,x:Mt,y:Zt,context:mt}}}}return st})}(z,Z)})}(o,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(y=>{if(this._spriteRequest=null,y)for(const I in y){this._spritesImagesIds[I]=[];const T=this._spritesImagesIds[I]?this._spritesImagesIds[I].filter(M=>!(M in y)):[];for(const M of T)this.imageManager.removeImage(M),this._changedImages[M]=!0;for(const M in y[I]){const k=I==="default"?M:`${I}:${M}`;this._spritesImagesIds[I].push(k),k in this.imageManager.images?this.imageManager.updateImage(k,y[I][M],!1):this.imageManager.addImage(k,y[I][M]),h&&(this._changedImages[k]=!0)}}}).catch(y=>{this._spriteRequest=null,g=y,this.fire(new u.j(g))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),h&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"})),d&&d(g)})}_unloadSprite(){for(const o of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(o),this._changedImages[o]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}_validateLayer(o){const h=this.sourceCaches[o.source];if(!h)return;const d=o.sourceLayer;if(!d)return;const g=h.getSource();(g.type==="geojson"||g.vectorLayerIds&&g.vectorLayerIds.indexOf(d)===-1)&&this.fire(new u.j(new Error(`Source layer "${d}" does not exist on source "${g.id}" as specified by style layer "${o.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const o in this.sourceCaches)if(!this.sourceCaches[o].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(o){const h=this._serializedAllLayers();if(!o||o.length===0)return Object.values(h);const d=[];for(const g of o)h[g]&&d.push(h[g]);return d}_serializedAllLayers(){let o=this._serializedLayers;if(o)return o;o=this._serializedLayers={};const h=Object.keys(this._layers);for(const d of h){const g=this._layers[d];g.type!=="custom"&&(o[d]=g.serialize())}return o}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const o in this.sourceCaches)if(this.sourceCaches[o].hasTransition())return!0;for(const o in this._layers)if(this._layers[o].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(o){if(!this._loaded)return;const h=this._changed;if(this._changed){const g=Object.keys(this._updatedLayers),y=Object.keys(this._removedLayers);(g.length||y.length)&&this._updateWorkerLayers(g,y);for(const I in this._updatedSources){const T=this._updatedSources[I];if(T==="reload")this._reloadSource(I);else{if(T!=="clear")throw new Error(`Invalid action ${T}`);this._clearSource(I)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const I in this._updatedPaintProps)this._layers[I].updateTransitions(o);this.light.updateTransitions(o),this._resetUpdates()}const d={};for(const g in this.sourceCaches){const y=this.sourceCaches[g];d[g]=y.used,y.used=!1}for(const g of this._order){const y=this._layers[g];y.recalculate(o,this._availableImages),!y.isHidden(o.zoom)&&y.source&&(this.sourceCaches[y.source].used=!0)}for(const g in d){const y=this.sourceCaches[g];d[g]!==y.used&&y.fire(new u.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:g}))}this.light.recalculate(o),this.z=o.zoom,h&&this.fire(new u.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const o=Object.keys(this._changedImages);if(o.length){for(const h in this.sourceCaches)this.sourceCaches[h].reloadTilesForDependencies(["icons","patterns"],o);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const o in this.sourceCaches)this.sourceCaches[o].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(o,h){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(o),removedIds:h})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(o,h={}){this._checkLoaded();const d=this.serialize();if(o=h.transformStyle?h.transformStyle(d,o):o,si(this,u.x(o)))return!1;(o=u.aA(o)).layers=u.ay(o.layers);const g=u.aB(d,o),y=this._getOperationsToPerform(g);if(y.unimplemented.length>0)throw new Error(`Unimplemented: ${y.unimplemented.join(", ")}.`);if(y.operations.length===0)return!1;for(const I of y.operations)I();return this.stylesheet=o,this._serializedLayers=null,!0}_getOperationsToPerform(o){const h=[],d=[];for(const g of o)switch(g.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":h.push(()=>this.addLayer.apply(this,g.args));break;case"removeLayer":h.push(()=>this.removeLayer.apply(this,g.args));break;case"setPaintProperty":h.push(()=>this.setPaintProperty.apply(this,g.args));break;case"setLayoutProperty":h.push(()=>this.setLayoutProperty.apply(this,g.args));break;case"setFilter":h.push(()=>this.setFilter.apply(this,g.args));break;case"addSource":h.push(()=>this.addSource.apply(this,g.args));break;case"removeSource":h.push(()=>this.removeSource.apply(this,g.args));break;case"setLayerZoomRange":h.push(()=>this.setLayerZoomRange.apply(this,g.args));break;case"setLight":h.push(()=>this.setLight.apply(this,g.args));break;case"setGeoJSONSourceData":h.push(()=>this.setGeoJSONSourceData.apply(this,g.args));break;case"setGlyphs":h.push(()=>this.setGlyphs.apply(this,g.args));break;case"setSprite":h.push(()=>this.setSprite.apply(this,g.args));break;case"setTerrain":h.push(()=>this.map.setTerrain.apply(this,g.args));break;case"setTransition":h.push(()=>{});break;default:d.push(g.command)}return{operations:h,unimplemented:d}}addImage(o,h){if(this.getImage(o))return this.fire(new u.j(new Error(`An image named "${o}" already exists.`)));this.imageManager.addImage(o,h),this._afterImageUpdated(o)}updateImage(o,h){this.imageManager.updateImage(o,h)}getImage(o){return this.imageManager.getImage(o)}removeImage(o){if(!this.getImage(o))return this.fire(new u.j(new Error(`An image named "${o}" does not exist.`)));this.imageManager.removeImage(o),this._afterImageUpdated(o)}_afterImageUpdated(o){this._availableImages=this.imageManager.listImages(),this._changedImages[o]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(o,h,d={}){if(this._checkLoaded(),this.sourceCaches[o]!==void 0)throw new Error(`Source "${o}" already exists.`);if(!h.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(h.type)>=0&&this._validate(u.x.source,`sources.${o}`,h,null,d))return;this.map&&this.map._collectResourceTiming&&(h.collectResourceTiming=!0);const g=this.sourceCaches[o]=new Vi(o,h,this.dispatcher);g.style=this,g.setEventedParent(this,()=>({isSourceLoaded:g.loaded(),source:g.serialize(),sourceId:o})),g.onAdd(this.map),this._changed=!0}removeSource(o){if(this._checkLoaded(),this.sourceCaches[o]===void 0)throw new Error("There is no source with this ID");for(const d in this._layers)if(this._layers[d].source===o)return this.fire(new u.j(new Error(`Source "${o}" cannot be removed while layer "${d}" is using it.`)));const h=this.sourceCaches[o];delete this.sourceCaches[o],delete this._updatedSources[o],h.fire(new u.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:o})),h.setEventedParent(null),h.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(o,h){if(this._checkLoaded(),this.sourceCaches[o]===void 0)throw new Error(`There is no source with this ID=${o}`);const d=this.sourceCaches[o].getSource();if(d.type!=="geojson")throw new Error(`geojsonSource.type is ${d.type}, which is !== 'geojson`);d.setData(h),this._changed=!0}getSource(o){return this.sourceCaches[o]&&this.sourceCaches[o].getSource()}addLayer(o,h,d={}){this._checkLoaded();const g=o.id;if(this.getLayer(g))return void this.fire(new u.j(new Error(`Layer "${g}" already exists on this map.`)));let y;if(o.type==="custom"){if(si(this,u.aC(o)))return;y=u.az(o)}else{if("source"in o&&typeof o.source=="object"&&(this.addSource(g,o.source),o=u.aA(o),o=u.e(o,{source:g})),this._validate(u.x.layer,`layers.${g}`,o,{arrayIndex:-1},d))return;y=u.az(o),this._validateLayer(y),y.setEventedParent(this,{layer:{id:g}})}const I=h?this._order.indexOf(h):this._order.length;if(h&&I===-1)this.fire(new u.j(new Error(`Cannot add layer "${g}" before non-existing layer "${h}".`)));else{if(this._order.splice(I,0,g),this._layerOrderChanged=!0,this._layers[g]=y,this._removedLayers[g]&&y.source&&y.type!=="custom"){const T=this._removedLayers[g];delete this._removedLayers[g],T.type!==y.type?this._updatedSources[y.source]="clear":(this._updatedSources[y.source]="reload",this.sourceCaches[y.source].pause())}this._updateLayer(y),y.onAdd&&y.onAdd(this.map)}}moveLayer(o,h){if(this._checkLoaded(),this._changed=!0,!this._layers[o])return void this.fire(new u.j(new Error(`The layer '${o}' does not exist in the map's style and cannot be moved.`)));if(o===h)return;const d=this._order.indexOf(o);this._order.splice(d,1);const g=h?this._order.indexOf(h):this._order.length;h&&g===-1?this.fire(new u.j(new Error(`Cannot move layer "${o}" before non-existing layer "${h}".`))):(this._order.splice(g,0,o),this._layerOrderChanged=!0)}removeLayer(o){this._checkLoaded();const h=this._layers[o];if(!h)return void this.fire(new u.j(new Error(`Cannot remove non-existing layer "${o}".`)));h.setEventedParent(null);const d=this._order.indexOf(o);this._order.splice(d,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[o]=h,delete this._layers[o],this._serializedLayers&&delete this._serializedLayers[o],delete this._updatedLayers[o],delete this._updatedPaintProps[o],h.onRemove&&h.onRemove(this.map)}getLayer(o){return this._layers[o]}getLayersOrder(){return[...this._order]}hasLayer(o){return o in this._layers}setLayerZoomRange(o,h,d){this._checkLoaded();const g=this.getLayer(o);g?g.minzoom===h&&g.maxzoom===d||(h!=null&&(g.minzoom=h),d!=null&&(g.maxzoom=d),this._updateLayer(g)):this.fire(new u.j(new Error(`Cannot set the zoom range of non-existing layer "${o}".`)))}setFilter(o,h,d={}){this._checkLoaded();const g=this.getLayer(o);if(g){if(!u.aD(g.filter,h))return h==null?(g.filter=void 0,void this._updateLayer(g)):void(this._validate(u.x.filter,`layers.${g.id}.filter`,h,null,d)||(g.filter=u.aA(h),this._updateLayer(g)))}else this.fire(new u.j(new Error(`Cannot filter non-existing layer "${o}".`)))}getFilter(o){return u.aA(this.getLayer(o).filter)}setLayoutProperty(o,h,d,g={}){this._checkLoaded();const y=this.getLayer(o);y?u.aD(y.getLayoutProperty(h),d)||(y.setLayoutProperty(h,d,g),this._updateLayer(y)):this.fire(new u.j(new Error(`Cannot style non-existing layer "${o}".`)))}getLayoutProperty(o,h){const d=this.getLayer(o);if(d)return d.getLayoutProperty(h);this.fire(new u.j(new Error(`Cannot get style of non-existing layer "${o}".`)))}setPaintProperty(o,h,d,g={}){this._checkLoaded();const y=this.getLayer(o);y?u.aD(y.getPaintProperty(h),d)||(y.setPaintProperty(h,d,g)&&this._updateLayer(y),this._changed=!0,this._updatedPaintProps[o]=!0):this.fire(new u.j(new Error(`Cannot style non-existing layer "${o}".`)))}getPaintProperty(o,h){return this.getLayer(o).getPaintProperty(h)}setFeatureState(o,h){this._checkLoaded();const d=o.source,g=o.sourceLayer,y=this.sourceCaches[d];if(y===void 0)return void this.fire(new u.j(new Error(`The source '${d}' does not exist in the map's style.`)));const I=y.getSource().type;I==="geojson"&&g?this.fire(new u.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):I!=="vector"||g?(o.id===void 0&&this.fire(new u.j(new Error("The feature id parameter must be provided."))),y.setFeatureState(g,o.id,h)):this.fire(new u.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(o,h){this._checkLoaded();const d=o.source,g=this.sourceCaches[d];if(g===void 0)return void this.fire(new u.j(new Error(`The source '${d}' does not exist in the map's style.`)));const y=g.getSource().type,I=y==="vector"?o.sourceLayer:void 0;y!=="vector"||I?h&&typeof o.id!="string"&&typeof o.id!="number"?this.fire(new u.j(new Error("A feature id is required to remove its specific state property."))):g.removeFeatureState(I,o.id,h):this.fire(new u.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(o){this._checkLoaded();const h=o.source,d=o.sourceLayer,g=this.sourceCaches[h];if(g!==void 0)return g.getSource().type!=="vector"||d?(o.id===void 0&&this.fire(new u.j(new Error("The feature id parameter must be provided."))),g.getFeatureState(d,o.id)):void this.fire(new u.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new u.j(new Error(`The source '${h}' does not exist in the map's style.`)))}getTransition(){return u.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const o=u.aE(this.sourceCaches,y=>y.serialize()),h=this._serializeByIds(this._order),d=this.map.getTerrain()||void 0,g=this.stylesheet;return u.aF({version:g.version,name:g.name,metadata:g.metadata,light:g.light,center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch,sprite:g.sprite,glyphs:g.glyphs,transition:g.transition,sources:o,layers:h,terrain:d},y=>y!==void 0)}_updateLayer(o){this._updatedLayers[o.id]=!0,o.source&&!this._updatedSources[o.source]&&this.sourceCaches[o.source].getSource().type!=="raster"&&(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(o){const h=I=>this._layers[I].type==="fill-extrusion",d={},g=[];for(let I=this._order.length-1;I>=0;I--){const T=this._order[I];if(h(T)){d[T]=I;for(const M of o){const k=M[T];if(k)for(const N of k)g.push(N)}}}g.sort((I,T)=>T.intersectionZ-I.intersectionZ);const y=[];for(let I=this._order.length-1;I>=0;I--){const T=this._order[I];if(h(T))for(let M=g.length-1;M>=0;M--){const k=g[M].feature;if(d[k.layer.id]{const Jt=mt.featureSortOrder;if(Jt){const Ht=Jt.indexOf(Mt.featureIndex);return Jt.indexOf(Zt.featureIndex)-Ht}return Zt.featureIndex-Mt.featureIndex});for(const Mt of kt)bt.push(Mt)}}for(const mt in it)it[mt].forEach(Ct=>{const lt=Ct.feature,bt=k[T[mt].source].getFeatureState(lt.layer["source-layer"],lt.id);lt.source=lt.layer.source,lt.layer["source-layer"]&&(lt.sourceLayer=lt.layer["source-layer"]),lt.state=bt});return it}(this._layers,I,this.sourceCaches,o,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(y)}querySourceFeatures(o,h){h&&h.filter&&this._validate(u.x.filter,"querySourceFeatures.filter",h.filter,null,h);const d=this.sourceCaches[o];return d?function(g,y){const I=g.getRenderableIds().map(k=>g.getTileByID(k)),T=[],M={};for(let k=0;kZ.getTileByID(nt)).sort((nt,it)=>it.tileID.overscaledZ-nt.tileID.overscaledZ||(nt.tileID.isLessThan(it.tileID)?-1:1))}const z=this.crossTileSymbolIndex.addLayer(N,M[N.source],o.center.lng);I=I||z}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((y=y||this._layerOrderChanged||d===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(L.now(),o.zoom))&&(this.pauseablePlacement=new Wo(o,this.map.terrain,this._order,y,h,d,g,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,M),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(L.now()),T=!0),I&&this.pauseablePlacement.placement.setStale()),T||I)for(const k of this._order){const N=this._layers[k];N.type==="symbol"&&this.placement.updateLayerOpacities(N,M[N.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(L.now())}_releaseSymbolFadeTiles(){for(const o in this.sourceCaches)this.sourceCaches[o].releaseSymbolFadeTiles()}getImages(o,h){return u._(this,void 0,void 0,function*(){const d=yield this.imageManager.getImages(h.icons);this._updateTilesForChangedImages();const g=this.sourceCaches[h.source];return g&&g.setDependencies(h.tileID.key,h.type,h.icons),d})}getGlyphs(o,h){return u._(this,void 0,void 0,function*(){const d=yield this.glyphManager.getGlyphs(h.stacks),g=this.sourceCaches[h.source];return g&&g.setDependencies(h.tileID.key,h.type,[""]),d})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(o,h={}){this._checkLoaded(),o&&this._validate(u.x.glyphs,"glyphs",o,null,h)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=o,this.glyphManager.entries={},this.glyphManager.setURL(o))}addSprite(o,h,d={},g){this._checkLoaded();const y=[{id:o,url:h}],I=[...yt(this.stylesheet.sprite),...y];this._validate(u.x.sprite,"sprite",I,null,d)||(this.stylesheet.sprite=I,this._loadSprite(y,!0,g))}removeSprite(o){this._checkLoaded();const h=yt(this.stylesheet.sprite);if(h.find(d=>d.id===o)){if(this._spritesImagesIds[o])for(const d of this._spritesImagesIds[o])this.imageManager.removeImage(d),this._changedImages[d]=!0;h.splice(h.findIndex(d=>d.id===o),1),this.stylesheet.sprite=h.length>0?h:void 0,delete this._spritesImagesIds[o],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}else this.fire(new u.j(new Error(`Sprite "${o}" doesn't exists on this map.`)))}getSprite(){return yt(this.stylesheet.sprite)}setSprite(o,h={},d){this._checkLoaded(),o&&this._validate(u.x.sprite,"sprite",o,null,h)||(this.stylesheet.sprite=o,o?this._loadSprite(o,!0,d):(this._unloadSprite(),d&&d(null)))}}var xc=u.X([{name:"a_pos",type:"Int16",components:2}]),Ms="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const Eu={prelude:Rn(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 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(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}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 float tile_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 (tile_units_to_pixels*pos+offset)/pattern_size;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:Rn(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Rn(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Rn(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Rn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Rn(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 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;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Rn(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Rn("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Rn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying 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);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying 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;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-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(0.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:Rn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Rn(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Rn(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Rn(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Rn(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Rn(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform 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;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Rn(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 +? a_pos +: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Rn(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);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((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying 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:Rn(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; +#define PI 3.141592653589793 +void main() {vec4 pixel=texture2D(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);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Rn(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.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*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float 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; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:Rn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);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*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float 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; +#endif +v_width2=vec2(outset,inset);}`),linePattern:Rn(`#ifdef GL_ES +precision highp float; +#endif +uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.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);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +float 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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;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*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float 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; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Rn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +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);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float 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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;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*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float 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; +#endif +v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Rn(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(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);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Rn(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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 highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Rn(`#define SDF_PX 8.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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_pitch_with_map;uniform highp float u_pitch;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;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Rn(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {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=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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_pitch_with_map;uniform highp float u_pitch;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 vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Rn("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Ms),terrainDepth:Rn("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",Ms),terrainCoords:Rn("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Ms)};function Rn(_,o){const h=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,d=o.match(/attribute ([\w]+) ([\w]+)/g),g=_.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),I=y?y.concat(g):g,T={};return{fragmentSource:_=_.replace(h,(M,k,N,z,Z)=>(T[Z]=!0,k==="define"?` +#ifndef HAS_UNIFORM_u_${Z} +varying ${N} ${z} ${Z}; +#else +uniform ${N} ${z} u_${Z}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${Z} + ${N} ${z} ${Z} = u_${Z}; +#endif +`)),vertexSource:o=o.replace(h,(M,k,N,z,Z)=>{const nt=z==="float"?"vec2":"vec4",it=Z.match(/color/)?"color":nt;return T[Z]?k==="define"?` +#ifndef HAS_UNIFORM_u_${Z} +uniform lowp float u_${Z}_t; +attribute ${N} ${nt} a_${Z}; +varying ${N} ${z} ${Z}; +#else +uniform ${N} ${z} u_${Z}; +#endif +`:it==="vec4"?` +#ifndef HAS_UNIFORM_u_${Z} + ${Z} = a_${Z}; +#else + ${N} ${z} ${Z} = u_${Z}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Z} + ${Z} = unpack_mix_${it}(a_${Z}, u_${Z}_t); +#else + ${N} ${z} ${Z} = u_${Z}; +#endif +`:k==="define"?` +#ifndef HAS_UNIFORM_u_${Z} +uniform lowp float u_${Z}_t; +attribute ${N} ${nt} a_${Z}; +#else +uniform ${N} ${z} u_${Z}; +#endif +`:it==="vec4"?` +#ifndef HAS_UNIFORM_u_${Z} + ${N} ${z} ${Z} = a_${Z}; +#else + ${N} ${z} ${Z} = u_${Z}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Z} + ${N} ${z} ${Z} = unpack_mix_${it}(a_${Z}, u_${Z}_t); +#else + ${N} ${z} ${Z} = u_${Z}; +#endif +`}),staticAttributes:d,staticUniforms:I}}class bc{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(o,h,d,g,y,I,T,M,k){this.context=o;let N=this.boundPaintVertexBuffers.length!==g.length;for(let z=0;!N&&z({u_depth:new u.aG(Mt,Zt.u_depth),u_terrain:new u.aG(Mt,Zt.u_terrain),u_terrain_dim:new u.aH(Mt,Zt.u_terrain_dim),u_terrain_matrix:new u.aI(Mt,Zt.u_terrain_matrix),u_terrain_unpack:new u.aJ(Mt,Zt.u_terrain_unpack),u_terrain_exaggeration:new u.aH(Mt,Zt.u_terrain_exaggeration)}))(o,kt),this.binderUniforms=d?d.getUniforms(o,kt):[]}draw(o,h,d,g,y,I,T,M,k,N,z,Z,nt,it,st,tt,mt,Ct){const lt=o.gl;if(this.failedToCreate)return;if(o.program.set(this.program),o.setDepthMode(d),o.setStencilMode(g),o.setColorMode(y),o.setCullFace(I),M){o.activeTexture.set(lt.TEXTURE2),lt.bindTexture(lt.TEXTURE_2D,M.depthTexture),o.activeTexture.set(lt.TEXTURE3),lt.bindTexture(lt.TEXTURE_2D,M.texture);for(const kt in this.terrainUniforms)this.terrainUniforms[kt].set(M[kt])}for(const kt in this.fixedUniforms)this.fixedUniforms[kt].set(T[kt]);st&&st.setUniforms(o,this.binderUniforms,nt,{zoom:it});let bt=0;switch(h){case lt.LINES:bt=2;break;case lt.TRIANGLES:bt=3;break;case lt.LINE_STRIP:bt=1}for(const kt of Z.get()){const Mt=kt.vaos||(kt.vaos={});(Mt[k]||(Mt[k]=new bc)).bind(o,this,N,st?st.getPaintVertexBuffers():[],z,kt.vertexOffset,tt,mt,Ct),lt.drawElements(h,kt.primitiveLength*bt,lt.UNSIGNED_SHORT,kt.primitiveOffset*bt*2)}}}function wc(_,o,h){const d=1/je(h,1,o.transform.tileZoom),g=Math.pow(2,h.tileID.overscaledZ),y=h.tileSize*Math.pow(2,o.transform.tileZoom)/g,I=y*(h.tileID.canonical.x+h.tileID.wrap*g),T=y*h.tileID.canonical.y;return{u_image:0,u_texsize:h.imageAtlasTexture.size,u_scale:[d,_.fromScale,_.toScale],u_fade:_.t,u_pixel_coord_upper:[I>>16,T>>16],u_pixel_coord_lower:[65535&I,65535&T]}}const Iu=(_,o,h,d)=>{const g=o.style.light,y=g.properties.get("position"),I=[y.x,y.y,y.z],T=function(){var k=new u.A(9);return u.A!=Float32Array&&(k[1]=0,k[2]=0,k[3]=0,k[5]=0,k[6]=0,k[7]=0),k[0]=1,k[4]=1,k[8]=1,k}();g.properties.get("anchor")==="viewport"&&function(k,N){var z=Math.sin(N),Z=Math.cos(N);k[0]=Z,k[1]=z,k[2]=0,k[3]=-z,k[4]=Z,k[5]=0,k[6]=0,k[7]=0,k[8]=1}(T,-o.transform.angle),function(k,N,z){var Z=N[0],nt=N[1],it=N[2];k[0]=Z*z[0]+nt*z[3]+it*z[6],k[1]=Z*z[1]+nt*z[4]+it*z[7],k[2]=Z*z[2]+nt*z[5]+it*z[8]}(I,I,T);const M=g.properties.get("color");return{u_matrix:_,u_lightpos:I,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[M.r,M.g,M.b],u_vertical_gradient:+h,u_opacity:d}},$m=(_,o,h,d,g,y,I)=>u.e(Iu(_,o,h,d),wc(y,o,I),{u_height_factor:-Math.pow(2,g.overscaledZ)/I.tileSize/8}),Jf=_=>({u_matrix:_}),Sc=(_,o,h,d)=>u.e(Jf(_),wc(h,o,d)),tg=(_,o)=>({u_matrix:_,u_world:o}),Qf=(_,o,h,d,g)=>u.e(Sc(_,o,h,d),{u_world:g}),eg=(_,o,h,d)=>{const g=_.transform;let y,I;if(d.paint.get("circle-pitch-alignment")==="map"){const T=je(h,1,g.zoom);y=!0,I=[T,T]}else y=!1,I=g.pixelsToGLUnits;return{u_camera_to_center_distance:g.cameraToCenterDistance,u_scale_with_map:+(d.paint.get("circle-pitch-scale")==="map"),u_matrix:_.translatePosMatrix(o.posMatrix,h,d.paint.get("circle-translate"),d.paint.get("circle-translate-anchor")),u_pitch_with_map:+y,u_device_pixel_ratio:_.pixelRatio,u_extrude_scale:I}},$f=(_,o,h)=>{const d=je(h,1,o.zoom),g=Math.pow(2,o.zoom-h.tileID.overscaledZ),y=h.tileID.overscaleFactor();return{u_matrix:_,u_camera_to_center_distance:o.cameraToCenterDistance,u_pixels_to_tile_units:d,u_extrude_scale:[o.pixelsToGLUnits[0]/(d*g),o.pixelsToGLUnits[1]/(d*g)],u_overscale_factor:y}},td=(_,o,h=1)=>({u_matrix:_,u_color:o,u_overlay:0,u_overlay_scale:h}),Ec=_=>({u_matrix:_}),ed=(_,o,h,d)=>({u_matrix:_,u_extrude_scale:je(o,1,h),u_intensity:d});function nd(_,o){const h=Math.pow(2,o.canonical.z),d=o.canonical.y;return[new u.Y(0,d/h).toLngLat().lat,new u.Y(0,(d+1)/h).toLngLat().lat]}const Ic=(_,o,h,d)=>{const g=_.transform;return{u_matrix:Cu(_,o,h,d),u_ratio:1/je(o,1,g.zoom),u_device_pixel_ratio:_.pixelRatio,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},id=(_,o,h,d,g)=>u.e(Ic(_,o,h,g),{u_image:0,u_image_height:d}),nl=(_,o,h,d,g)=>{const y=_.transform,I=Io(o,y);return{u_matrix:Cu(_,o,h,g),u_texsize:o.imageAtlasTexture.size,u_ratio:1/je(o,1,y.zoom),u_device_pixel_ratio:_.pixelRatio,u_image:0,u_scale:[I,d.fromScale,d.toScale],u_fade:d.t,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]]}},Cc=(_,o,h,d,g,y)=>{const I=_.lineAtlas,T=Io(o,_.transform),M=h.layout.get("line-cap")==="round",k=I.getDash(d.from,M),N=I.getDash(d.to,M),z=k.width*g.fromScale,Z=N.width*g.toScale;return u.e(Ic(_,o,h,y),{u_patternscale_a:[T/z,-k.height/2],u_patternscale_b:[T/Z,-N.height/2],u_sdfgamma:I.width/(256*Math.min(z,Z)*_.pixelRatio)/2,u_image:0,u_tex_y_a:k.y,u_tex_y_b:N.y,u_mix:g.t})};function Io(_,o){return 1/je(_,1,o.tileZoom)}function Cu(_,o,h,d){return _.translatePosMatrix(d?d.posMatrix:o.tileID.posMatrix,o,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const Tc=(_,o,h,d,g)=>{return{u_matrix:_,u_tl_parent:o,u_scale_parent:h,u_buffer_scale:1,u_fade_t:d.mix,u_opacity:d.opacity*g.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:g.paint.get("raster-brightness-min"),u_brightness_high:g.paint.get("raster-brightness-max"),u_saturation_factor:(I=g.paint.get("raster-saturation"),I>0?1-1/(1.001-I):-I),u_contrast_factor:(y=g.paint.get("raster-contrast"),y>0?1/(1-y):1+y),u_spin_weights:Tu(g.paint.get("raster-hue-rotate"))};var y,I};function Tu(_){_*=Math.PI/180;const o=Math.sin(_),h=Math.cos(_);return[(2*h+1)/3,(-Math.sqrt(3)*o-h+1)/3,(Math.sqrt(3)*o-h+1)/3]}const Lu=(_,o,h,d,g,y,I,T,M,k)=>{const N=g.transform;return{u_is_size_zoom_constant:+(_==="constant"||_==="source"),u_is_size_feature_constant:+(_==="constant"||_==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:N.cameraToCenterDistance,u_pitch:N.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:N.width/N.height,u_fade_change:g.options.fadeDuration?g.symbolFadeChange:1,u_matrix:y,u_label_plane_matrix:I,u_coord_matrix:T,u_is_text:+M,u_pitch_with_map:+d,u_texsize:k,u_texture:0}},Mu=(_,o,h,d,g,y,I,T,M,k,N)=>{const z=g.transform;return u.e(Lu(_,o,h,d,g,y,I,T,M,k),{u_gamma_scale:d?Math.cos(z._pitch)*z.cameraToCenterDistance:1,u_device_pixel_ratio:g.pixelRatio,u_is_halo:+N})},Pu=(_,o,h,d,g,y,I,T,M,k)=>u.e(Mu(_,o,h,d,g,y,I,T,!0,M,!0),{u_texsize_icon:k,u_texture_icon:1}),ng=(_,o,h)=>({u_matrix:_,u_opacity:o,u_color:h}),ig=(_,o,h,d,g,y)=>u.e(function(I,T,M,k){const N=M.imageManager.getPattern(I.from.toString()),z=M.imageManager.getPattern(I.to.toString()),{width:Z,height:nt}=M.imageManager.getPixelSize(),it=Math.pow(2,k.tileID.overscaledZ),st=k.tileSize*Math.pow(2,M.transform.tileZoom)/it,tt=st*(k.tileID.canonical.x+k.tileID.wrap*it),mt=st*k.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:N.tl,u_pattern_br_a:N.br,u_pattern_tl_b:z.tl,u_pattern_br_b:z.br,u_texsize:[Z,nt],u_mix:T.t,u_pattern_size_a:N.displaySize,u_pattern_size_b:z.displaySize,u_scale_a:T.fromScale,u_scale_b:T.toScale,u_tile_units_to_pixels:1/je(k,1,M.transform.tileZoom),u_pixel_coord_upper:[tt>>16,mt>>16],u_pixel_coord_lower:[65535&tt,65535&mt]}}(d,y,h,g),{u_matrix:_,u_opacity:o}),rd={fillExtrusion:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_lightpos:new u.aK(_,o.u_lightpos),u_lightintensity:new u.aH(_,o.u_lightintensity),u_lightcolor:new u.aK(_,o.u_lightcolor),u_vertical_gradient:new u.aH(_,o.u_vertical_gradient),u_opacity:new u.aH(_,o.u_opacity)}),fillExtrusionPattern:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_lightpos:new u.aK(_,o.u_lightpos),u_lightintensity:new u.aH(_,o.u_lightintensity),u_lightcolor:new u.aK(_,o.u_lightcolor),u_vertical_gradient:new u.aH(_,o.u_vertical_gradient),u_height_factor:new u.aH(_,o.u_height_factor),u_image:new u.aG(_,o.u_image),u_texsize:new u.aL(_,o.u_texsize),u_pixel_coord_upper:new u.aL(_,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.aL(_,o.u_pixel_coord_lower),u_scale:new u.aK(_,o.u_scale),u_fade:new u.aH(_,o.u_fade),u_opacity:new u.aH(_,o.u_opacity)}),fill:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix)}),fillPattern:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_image:new u.aG(_,o.u_image),u_texsize:new u.aL(_,o.u_texsize),u_pixel_coord_upper:new u.aL(_,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.aL(_,o.u_pixel_coord_lower),u_scale:new u.aK(_,o.u_scale),u_fade:new u.aH(_,o.u_fade)}),fillOutline:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_world:new u.aL(_,o.u_world)}),fillOutlinePattern:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_world:new u.aL(_,o.u_world),u_image:new u.aG(_,o.u_image),u_texsize:new u.aL(_,o.u_texsize),u_pixel_coord_upper:new u.aL(_,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.aL(_,o.u_pixel_coord_lower),u_scale:new u.aK(_,o.u_scale),u_fade:new u.aH(_,o.u_fade)}),circle:(_,o)=>({u_camera_to_center_distance:new u.aH(_,o.u_camera_to_center_distance),u_scale_with_map:new u.aG(_,o.u_scale_with_map),u_pitch_with_map:new u.aG(_,o.u_pitch_with_map),u_extrude_scale:new u.aL(_,o.u_extrude_scale),u_device_pixel_ratio:new u.aH(_,o.u_device_pixel_ratio),u_matrix:new u.aI(_,o.u_matrix)}),collisionBox:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_camera_to_center_distance:new u.aH(_,o.u_camera_to_center_distance),u_pixels_to_tile_units:new u.aH(_,o.u_pixels_to_tile_units),u_extrude_scale:new u.aL(_,o.u_extrude_scale),u_overscale_factor:new u.aH(_,o.u_overscale_factor)}),collisionCircle:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_inv_matrix:new u.aI(_,o.u_inv_matrix),u_camera_to_center_distance:new u.aH(_,o.u_camera_to_center_distance),u_viewport_size:new u.aL(_,o.u_viewport_size)}),debug:(_,o)=>({u_color:new u.aM(_,o.u_color),u_matrix:new u.aI(_,o.u_matrix),u_overlay:new u.aG(_,o.u_overlay),u_overlay_scale:new u.aH(_,o.u_overlay_scale)}),clippingMask:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix)}),heatmap:(_,o)=>({u_extrude_scale:new u.aH(_,o.u_extrude_scale),u_intensity:new u.aH(_,o.u_intensity),u_matrix:new u.aI(_,o.u_matrix)}),heatmapTexture:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_world:new u.aL(_,o.u_world),u_image:new u.aG(_,o.u_image),u_color_ramp:new u.aG(_,o.u_color_ramp),u_opacity:new u.aH(_,o.u_opacity)}),hillshade:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_image:new u.aG(_,o.u_image),u_latrange:new u.aL(_,o.u_latrange),u_light:new u.aL(_,o.u_light),u_shadow:new u.aM(_,o.u_shadow),u_highlight:new u.aM(_,o.u_highlight),u_accent:new u.aM(_,o.u_accent)}),hillshadePrepare:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_image:new u.aG(_,o.u_image),u_dimension:new u.aL(_,o.u_dimension),u_zoom:new u.aH(_,o.u_zoom),u_unpack:new u.aJ(_,o.u_unpack)}),line:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_ratio:new u.aH(_,o.u_ratio),u_device_pixel_ratio:new u.aH(_,o.u_device_pixel_ratio),u_units_to_pixels:new u.aL(_,o.u_units_to_pixels)}),lineGradient:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_ratio:new u.aH(_,o.u_ratio),u_device_pixel_ratio:new u.aH(_,o.u_device_pixel_ratio),u_units_to_pixels:new u.aL(_,o.u_units_to_pixels),u_image:new u.aG(_,o.u_image),u_image_height:new u.aH(_,o.u_image_height)}),linePattern:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_texsize:new u.aL(_,o.u_texsize),u_ratio:new u.aH(_,o.u_ratio),u_device_pixel_ratio:new u.aH(_,o.u_device_pixel_ratio),u_image:new u.aG(_,o.u_image),u_units_to_pixels:new u.aL(_,o.u_units_to_pixels),u_scale:new u.aK(_,o.u_scale),u_fade:new u.aH(_,o.u_fade)}),lineSDF:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_ratio:new u.aH(_,o.u_ratio),u_device_pixel_ratio:new u.aH(_,o.u_device_pixel_ratio),u_units_to_pixels:new u.aL(_,o.u_units_to_pixels),u_patternscale_a:new u.aL(_,o.u_patternscale_a),u_patternscale_b:new u.aL(_,o.u_patternscale_b),u_sdfgamma:new u.aH(_,o.u_sdfgamma),u_image:new u.aG(_,o.u_image),u_tex_y_a:new u.aH(_,o.u_tex_y_a),u_tex_y_b:new u.aH(_,o.u_tex_y_b),u_mix:new u.aH(_,o.u_mix)}),raster:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_tl_parent:new u.aL(_,o.u_tl_parent),u_scale_parent:new u.aH(_,o.u_scale_parent),u_buffer_scale:new u.aH(_,o.u_buffer_scale),u_fade_t:new u.aH(_,o.u_fade_t),u_opacity:new u.aH(_,o.u_opacity),u_image0:new u.aG(_,o.u_image0),u_image1:new u.aG(_,o.u_image1),u_brightness_low:new u.aH(_,o.u_brightness_low),u_brightness_high:new u.aH(_,o.u_brightness_high),u_saturation_factor:new u.aH(_,o.u_saturation_factor),u_contrast_factor:new u.aH(_,o.u_contrast_factor),u_spin_weights:new u.aK(_,o.u_spin_weights)}),symbolIcon:(_,o)=>({u_is_size_zoom_constant:new u.aG(_,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aG(_,o.u_is_size_feature_constant),u_size_t:new u.aH(_,o.u_size_t),u_size:new u.aH(_,o.u_size),u_camera_to_center_distance:new u.aH(_,o.u_camera_to_center_distance),u_pitch:new u.aH(_,o.u_pitch),u_rotate_symbol:new u.aG(_,o.u_rotate_symbol),u_aspect_ratio:new u.aH(_,o.u_aspect_ratio),u_fade_change:new u.aH(_,o.u_fade_change),u_matrix:new u.aI(_,o.u_matrix),u_label_plane_matrix:new u.aI(_,o.u_label_plane_matrix),u_coord_matrix:new u.aI(_,o.u_coord_matrix),u_is_text:new u.aG(_,o.u_is_text),u_pitch_with_map:new u.aG(_,o.u_pitch_with_map),u_texsize:new u.aL(_,o.u_texsize),u_texture:new u.aG(_,o.u_texture)}),symbolSDF:(_,o)=>({u_is_size_zoom_constant:new u.aG(_,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aG(_,o.u_is_size_feature_constant),u_size_t:new u.aH(_,o.u_size_t),u_size:new u.aH(_,o.u_size),u_camera_to_center_distance:new u.aH(_,o.u_camera_to_center_distance),u_pitch:new u.aH(_,o.u_pitch),u_rotate_symbol:new u.aG(_,o.u_rotate_symbol),u_aspect_ratio:new u.aH(_,o.u_aspect_ratio),u_fade_change:new u.aH(_,o.u_fade_change),u_matrix:new u.aI(_,o.u_matrix),u_label_plane_matrix:new u.aI(_,o.u_label_plane_matrix),u_coord_matrix:new u.aI(_,o.u_coord_matrix),u_is_text:new u.aG(_,o.u_is_text),u_pitch_with_map:new u.aG(_,o.u_pitch_with_map),u_texsize:new u.aL(_,o.u_texsize),u_texture:new u.aG(_,o.u_texture),u_gamma_scale:new u.aH(_,o.u_gamma_scale),u_device_pixel_ratio:new u.aH(_,o.u_device_pixel_ratio),u_is_halo:new u.aG(_,o.u_is_halo)}),symbolTextAndIcon:(_,o)=>({u_is_size_zoom_constant:new u.aG(_,o.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aG(_,o.u_is_size_feature_constant),u_size_t:new u.aH(_,o.u_size_t),u_size:new u.aH(_,o.u_size),u_camera_to_center_distance:new u.aH(_,o.u_camera_to_center_distance),u_pitch:new u.aH(_,o.u_pitch),u_rotate_symbol:new u.aG(_,o.u_rotate_symbol),u_aspect_ratio:new u.aH(_,o.u_aspect_ratio),u_fade_change:new u.aH(_,o.u_fade_change),u_matrix:new u.aI(_,o.u_matrix),u_label_plane_matrix:new u.aI(_,o.u_label_plane_matrix),u_coord_matrix:new u.aI(_,o.u_coord_matrix),u_is_text:new u.aG(_,o.u_is_text),u_pitch_with_map:new u.aG(_,o.u_pitch_with_map),u_texsize:new u.aL(_,o.u_texsize),u_texsize_icon:new u.aL(_,o.u_texsize_icon),u_texture:new u.aG(_,o.u_texture),u_texture_icon:new u.aG(_,o.u_texture_icon),u_gamma_scale:new u.aH(_,o.u_gamma_scale),u_device_pixel_ratio:new u.aH(_,o.u_device_pixel_ratio),u_is_halo:new u.aG(_,o.u_is_halo)}),background:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_opacity:new u.aH(_,o.u_opacity),u_color:new u.aM(_,o.u_color)}),backgroundPattern:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_opacity:new u.aH(_,o.u_opacity),u_image:new u.aG(_,o.u_image),u_pattern_tl_a:new u.aL(_,o.u_pattern_tl_a),u_pattern_br_a:new u.aL(_,o.u_pattern_br_a),u_pattern_tl_b:new u.aL(_,o.u_pattern_tl_b),u_pattern_br_b:new u.aL(_,o.u_pattern_br_b),u_texsize:new u.aL(_,o.u_texsize),u_mix:new u.aH(_,o.u_mix),u_pattern_size_a:new u.aL(_,o.u_pattern_size_a),u_pattern_size_b:new u.aL(_,o.u_pattern_size_b),u_scale_a:new u.aH(_,o.u_scale_a),u_scale_b:new u.aH(_,o.u_scale_b),u_pixel_coord_upper:new u.aL(_,o.u_pixel_coord_upper),u_pixel_coord_lower:new u.aL(_,o.u_pixel_coord_lower),u_tile_units_to_pixels:new u.aH(_,o.u_tile_units_to_pixels)}),terrain:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_texture:new u.aG(_,o.u_texture),u_ele_delta:new u.aH(_,o.u_ele_delta)}),terrainDepth:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_ele_delta:new u.aH(_,o.u_ele_delta)}),terrainCoords:(_,o)=>({u_matrix:new u.aI(_,o.u_matrix),u_texture:new u.aG(_,o.u_texture),u_terrain_coords_id:new u.aH(_,o.u_terrain_coords_id),u_ele_delta:new u.aH(_,o.u_ele_delta)})};class rg{constructor(o,h,d){this.context=o;const g=o.gl;this.buffer=g.createBuffer(),this.dynamicDraw=!!d,this.context.unbindVAO(),o.bindElementBuffer.set(this.buffer),g.bufferData(g.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(o){const h=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,o.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const il={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Lc{constructor(o,h,d,g){this.length=h.length,this.attributes=d,this.itemSize=h.bytesPerElement,this.dynamicDraw=g,this.context=o;const y=o.gl;this.buffer=y.createBuffer(),o.bindVertexBuffer.set(this.buffer),y.bufferData(y.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(o){if(o.length!==this.length)throw new Error(`Length of new data is ${o.length}, which doesn't match current length of ${this.length}`);const h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,o.arrayBuffer)}enableAttributes(o,h){for(let d=0;d0){const te=u.F(),ye=Zt;u.aP(te,Mt.placementInvProjMatrix,_.transform.glCoordMatrix),u.aP(te,te,Mt.placementViewportMatrix),N.push({circleArray:Ht,circleOffset:Z,transform:ye,invTransform:te,coord:bt}),z+=Ht.length/4,Z=z}Jt&&k.draw(T,M.LINES,gn.disabled,Wn.disabled,_.colorModeForRenderPass(),qn.disabled,$f(Zt,_.transform,kt),_.style.map.terrain&&_.style.map.terrain.getTerrainData(bt),h.id,Jt.layoutVertexBuffer,Jt.indexBuffer,Jt.segments,null,_.transform.zoom,null,null,Jt.collisionVertexBuffer)}if(!I||!N.length)return;const nt=_.useProgram("collisionCircle"),it=new u.aQ;it.resize(4*z),it._trim();let st=0;for(const lt of N)for(let bt=0;bt=0&&(it[tt.associatedIconIndex]={shiftedAnchor:ze,angle:ce})}else Gt(tt.numGlyphs,Z)}if(k){nt.clear();const st=_.icon.placedSymbolArray;for(let tt=0;tt_.style.map.terrain.getElevation(Jt,lr,Xi):null,Hi=h.layout.get("text-rotation-alignment")==="map";q(te,Jt.posMatrix,_,g,Lr,Xo,tt,k,Hi,Yn)}const Xl=_.translatePosMatrix(Jt.posMatrix,Ht,y,I),ka=mt||g&&Mt||Hl?dp:Lr,Wi=_.translatePosMatrix(Xo,Ht,y,I,!0),Pi=ce&&h.paint.get(g?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let di;di=ce?te.iconsInText?Pu(Ae.kind,ln,Ct,tt,_,Xl,ka,Wi,un,ar):Mu(Ae.kind,ln,Ct,tt,_,Xl,ka,Wi,g,un,!0):Lu(Ae.kind,ln,Ct,tt,_,Xl,ka,Wi,g,un);const Hr={program:Xn,buffers:ye,uniformValues:di,atlasTexture:Mi,atlasTextureIcon:fi,atlasInterpolation:Fn,atlasInterpolationIcon:Wr,isSDF:ce,hasHalo:Pi};if(lt&&te.canOverlap){bt=!0;const Yn=ye.segments.get();for(const Hi of Yn)Zt.push({segments:new u.$([Hi]),sortKey:Hi.sortKey,state:Hr,terrainData:tn})}else Zt.push({segments:ye.segments,sortKey:0,state:Hr,terrainData:tn})}bt&&Zt.sort((Jt,Ht)=>Jt.sortKey-Ht.sortKey);for(const Jt of Zt){const Ht=Jt.state;if(Z.activeTexture.set(nt.TEXTURE0),Ht.atlasTexture.bind(Ht.atlasInterpolation,nt.CLAMP_TO_EDGE),Ht.atlasTextureIcon&&(Z.activeTexture.set(nt.TEXTURE1),Ht.atlasTextureIcon&&Ht.atlasTextureIcon.bind(Ht.atlasInterpolationIcon,nt.CLAMP_TO_EDGE)),Ht.isSDF){const te=Ht.uniformValues;Ht.hasHalo&&(te.u_is_halo=1,fd(Ht.buffers,Jt.segments,h,_,Ht.program,kt,N,z,te,Jt.terrainData)),te.u_is_halo=0}fd(Ht.buffers,Jt.segments,h,_,Ht.program,kt,N,z,Ht.uniformValues,Jt.terrainData)}}function fd(_,o,h,d,g,y,I,T,M,k){const N=d.context;g.draw(N,N.gl.TRIANGLES,y,I,T,qn.disabled,M,k,h.id,_.layoutVertexBuffer,_.indexBuffer,o,h.paint,d.transform.zoom,_.programConfigurations.get(h.id),_.dynamicLayoutVertexBuffer,_.opacityVertexBuffer)}function Bc(_,o,h,d,g){if(!h||!d||!d.imageAtlas)return;const y=d.imageAtlas.patternPositions;let I=y[h.to.toString()],T=y[h.from.toString()];if(!I&&T&&(I=T),!T&&I&&(T=I),!I||!T){const M=g.getPaintProperty(o);I=y[M],T=y[M]}I&&T&&_.setConstantPatternPositions(I,T)}function dd(_,o,h,d,g,y,I){const T=_.context.gl,M="fill-pattern",k=h.paint.get(M),N=k&&k.constantOr(1),z=h.getCrossfadeParameters();let Z,nt,it,st,tt;I?(nt=N&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Z=T.LINES):(nt=N?"fillPattern":"fill",Z=T.TRIANGLES);const mt=k.constantOr(null);for(const Ct of d){const lt=o.getTile(Ct);if(N&&!lt.patternsLoaded())continue;const bt=lt.getBucket(h);if(!bt)continue;const kt=bt.programConfigurations.get(h.id),Mt=_.useProgram(nt,kt),Zt=_.style.map.terrain&&_.style.map.terrain.getTerrainData(Ct);N&&(_.context.activeTexture.set(T.TEXTURE0),lt.imageAtlasTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),kt.updatePaintBuffers(z)),Bc(kt,M,mt,lt,h);const Jt=Zt?Ct:null,Ht=_.translatePosMatrix(Jt?Jt.posMatrix:Ct.posMatrix,lt,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(I){st=bt.indexBuffer2,tt=bt.segments2;const te=[T.drawingBufferWidth,T.drawingBufferHeight];it=nt==="fillOutlinePattern"&&N?Qf(Ht,_,z,lt,te):tg(Ht,te)}else st=bt.indexBuffer,tt=bt.segments,it=N?Sc(Ht,_,z,lt):Jf(Ht);Mt.draw(_.context,Z,g,_.stencilModeForClipping(Ct),y,qn.disabled,it,Zt,h.id,bt.layoutVertexBuffer,st,tt,h.paint,_.transform.zoom,kt)}}function Vc(_,o,h,d,g,y,I){const T=_.context,M=T.gl,k="fill-extrusion-pattern",N=h.paint.get(k),z=N.constantOr(1),Z=h.getCrossfadeParameters(),nt=h.paint.get("fill-extrusion-opacity"),it=N.constantOr(null);for(const st of d){const tt=o.getTile(st),mt=tt.getBucket(h);if(!mt)continue;const Ct=_.style.map.terrain&&_.style.map.terrain.getTerrainData(st),lt=mt.programConfigurations.get(h.id),bt=_.useProgram(z?"fillExtrusionPattern":"fillExtrusion",lt);z&&(_.context.activeTexture.set(M.TEXTURE0),tt.imageAtlasTexture.bind(M.LINEAR,M.CLAMP_TO_EDGE),lt.updatePaintBuffers(Z)),Bc(lt,k,it,tt,h);const kt=_.translatePosMatrix(st.posMatrix,tt,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),Mt=h.paint.get("fill-extrusion-vertical-gradient"),Zt=z?$m(kt,_,Mt,nt,st,Z,tt):Iu(kt,_,Mt,nt);bt.draw(T,T.gl.TRIANGLES,g,y,I,qn.backCCW,Zt,Ct,h.id,mt.layoutVertexBuffer,mt.indexBuffer,mt.segments,h.paint,_.transform.zoom,lt,_.style.map.terrain&&mt.centroidVertexBuffer)}}function Uc(_,o,h,d,g,y,I){const T=_.context,M=T.gl,k=h.fbo;if(!k)return;const N=_.useProgram("hillshade"),z=_.style.map.terrain&&_.style.map.terrain.getTerrainData(o);T.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,k.colorAttachment.get()),N.draw(T,M.TRIANGLES,g,y,I,qn.disabled,((Z,nt,it,st)=>{const tt=it.paint.get("hillshade-shadow-color"),mt=it.paint.get("hillshade-highlight-color"),Ct=it.paint.get("hillshade-accent-color");let lt=it.paint.get("hillshade-illumination-direction")*(Math.PI/180);it.paint.get("hillshade-illumination-anchor")==="viewport"&&(lt-=Z.transform.angle);const bt=!Z.options.moving;return{u_matrix:st?st.posMatrix:Z.transform.calculatePosMatrix(nt.tileID.toUnwrapped(),bt),u_image:0,u_latrange:nd(0,nt.tileID),u_light:[it.paint.get("hillshade-exaggeration"),lt],u_shadow:tt,u_highlight:mt,u_accent:Ct}})(_,h,d,z?o:null),z,d.id,_.rasterBoundsBuffer,_.quadTriangleIndexBuffer,_.rasterBoundsSegments)}function mp(_,o,h,d,g,y){const I=_.context,T=I.gl,M=o.dem;if(M&&M.data){const k=M.dim,N=M.stride,z=M.getPixels();if(I.activeTexture.set(T.TEXTURE1),I.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||_.getTileTexture(N),o.demTexture){const nt=o.demTexture;nt.update(z,{premultiply:!1}),nt.bind(T.NEAREST,T.CLAMP_TO_EDGE)}else o.demTexture=new wt(I,z,T.RGBA,{premultiply:!1}),o.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE);I.activeTexture.set(T.TEXTURE0);let Z=o.fbo;if(!Z){const nt=new wt(I,{width:k,height:k,data:null},T.RGBA);nt.bind(T.LINEAR,T.CLAMP_TO_EDGE),Z=o.fbo=I.createFramebuffer(k,k,!0,!1),Z.colorAttachment.set(nt.texture)}I.bindFramebuffer.set(Z.framebuffer),I.viewport.set([0,0,k,k]),_.useProgram("hillshadePrepare").draw(I,T.TRIANGLES,d,g,y,qn.disabled,((nt,it)=>{const st=it.stride,tt=u.F();return u.aN(tt,0,u.W,-u.W,0,0,1),u.H(tt,tt,[0,-u.W,0]),{u_matrix:tt,u_image:1,u_dimension:[st,st],u_zoom:nt.overscaledZ,u_unpack:it.getUnpackVector()}})(o.tileID,M),null,h.id,_.rasterBoundsBuffer,_.quadTriangleIndexBuffer,_.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function md(_,o,h,d,g,y){const I=d.paint.get("raster-fade-duration");if(!y&&I>0){const T=L.now(),M=(T-_.timeAdded)/I,k=o?(T-o.timeAdded)/I:-1,N=h.getSource(),z=g.coveringZoomLevel({tileSize:N.tileSize,roundZoom:N.roundZoom}),Z=!o||Math.abs(o.tileID.overscaledZ-z)>Math.abs(_.tileID.overscaledZ-z),nt=Z&&_.refreshedUponExpiration?1:u.ac(Z?M:1-k,0,1);return _.refreshedUponExpiration&&M>=1&&(_.refreshedUponExpiration=!1),o?{opacity:1,mix:1-nt}:{opacity:nt,mix:0}}return{opacity:1,mix:0}}const gd=new u.aO(1,0,0,1),Gc=new u.aO(0,1,0,1),gp=new u.aO(0,0,1,1),fg=new u.aO(1,0,1,1),_d=new u.aO(0,1,1,1);function hi(_,o,h,d){jr(_,0,o+h/2,_.transform.width,h,d)}function La(_,o,h,d){jr(_,o-h/2,0,h,_.transform.height,d)}function jr(_,o,h,d,g,y){const I=_.context,T=I.gl;T.enable(T.SCISSOR_TEST),T.scissor(o*_.pixelRatio,h*_.pixelRatio,d*_.pixelRatio,g*_.pixelRatio),I.clear({color:y}),T.disable(T.SCISSOR_TEST)}function _p(_,o,h){const d=_.context,g=d.gl,y=h.posMatrix,I=_.useProgram("debug"),T=gn.disabled,M=Wn.disabled,k=_.colorModeForRenderPass(),N="$debug",z=_.style.map.terrain&&_.style.map.terrain.getTerrainData(h);d.activeTexture.set(g.TEXTURE0);const Z=o.getTileByID(h.key).latestRawTileData,nt=Math.floor((Z&&Z.byteLength||0)/1024),it=o.getTile(h).tileSize,st=512/Math.min(it,512)*(h.overscaledZ/_.transform.zoom)*.5;let tt=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(tt+=` => ${h.overscaledZ}`),function(mt,Ct){mt.initDebugOverlayCanvas();const lt=mt.debugOverlayCanvas,bt=mt.context.gl,kt=mt.debugOverlayCanvas.getContext("2d");kt.clearRect(0,0,lt.width,lt.height),kt.shadowColor="white",kt.shadowBlur=2,kt.lineWidth=1.5,kt.strokeStyle="white",kt.textBaseline="top",kt.font="bold 36px Open Sans, sans-serif",kt.fillText(Ct,5,5),kt.strokeText(Ct,5,5),mt.debugOverlayTexture.update(lt),mt.debugOverlayTexture.bind(bt.LINEAR,bt.CLAMP_TO_EDGE)}(_,`${tt} ${nt}kB`),I.draw(d,g.TRIANGLES,T,M,Ti.alphaBlended,qn.disabled,td(y,u.aO.transparent,st),null,N,_.debugBuffer,_.quadTriangleIndexBuffer,_.debugSegments),I.draw(d,g.LINE_STRIP,T,M,k,qn.disabled,td(y,u.aO.red),z,N,_.debugBuffer,_.tileBorderIndexBuffer,_.debugSegments)}function qc(_,o,h){const d=_.context,g=d.gl,y=_.colorModeForRenderPass(),I=new gn(g.LEQUAL,gn.ReadWrite,_.depthRangeFor3D),T=_.useProgram("terrain"),M=o.getTerrainMesh();d.bindFramebuffer.set(null),d.viewport.set([0,0,_.width,_.height]);for(const k of h){const N=_.renderToTexture.getTexture(k),z=o.getTerrainData(k.tileID);d.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,N.texture);const Z={u_matrix:_.transform.calculatePosMatrix(k.tileID.toUnwrapped()),u_texture:0,u_ele_delta:o.getMeshFrameDelta(_.transform.zoom)};T.draw(d,g.TRIANGLES,I,Wn.disabled,y,qn.backCCW,Z,z,"terrain",M.vertexBuffer,M.indexBuffer,M.segments)}}class yd{constructor(o,h){this.context=new pg(o),this.transform=h,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:u.F(),renderTime:0},this.setup(),this.numSublayers=Vi.maxUnderzooming+Vi.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ca}resize(o,h,d){if(this.width=Math.floor(o*d),this.height=Math.floor(h*d),this.pixelRatio=d,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const g of this.style._order)this.style._layers[g].resize()}setup(){const o=this.context,h=new u.aV;h.emplaceBack(0,0),h.emplaceBack(u.W,0),h.emplaceBack(0,u.W),h.emplaceBack(u.W,u.W),this.tileExtentBuffer=o.createVertexBuffer(h,xc.members),this.tileExtentSegments=u.$.simpleSegment(0,0,4,2);const d=new u.aV;d.emplaceBack(0,0),d.emplaceBack(u.W,0),d.emplaceBack(0,u.W),d.emplaceBack(u.W,u.W),this.debugBuffer=o.createVertexBuffer(d,xc.members),this.debugSegments=u.$.simpleSegment(0,0,4,5);const g=new u.Z;g.emplaceBack(0,0,0,0),g.emplaceBack(u.W,0,u.W,0),g.emplaceBack(0,u.W,0,u.W),g.emplaceBack(u.W,u.W,u.W,u.W),this.rasterBoundsBuffer=o.createVertexBuffer(g,$n.members),this.rasterBoundsSegments=u.$.simpleSegment(0,0,4,2);const y=new u.aV;y.emplaceBack(0,0),y.emplaceBack(1,0),y.emplaceBack(0,1),y.emplaceBack(1,1),this.viewportBuffer=o.createVertexBuffer(y,xc.members),this.viewportSegments=u.$.simpleSegment(0,0,4,2);const I=new u.aW;I.emplaceBack(0),I.emplaceBack(1),I.emplaceBack(3),I.emplaceBack(2),I.emplaceBack(0),this.tileBorderIndexBuffer=o.createIndexBuffer(I);const T=new u.aX;T.emplaceBack(0,1,2),T.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=o.createIndexBuffer(T);const M=this.context.gl;this.stencilClearMode=new Wn({func:M.ALWAYS,mask:0},0,255,M.ZERO,M.ZERO,M.ZERO)}clearStencil(){const o=this.context,h=o.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const d=u.F();u.aN(d,0,this.width,this.height,0,0,1),u.J(d,d,[h.drawingBufferWidth,h.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(o,h.TRIANGLES,gn.disabled,this.stencilClearMode,Ti.disabled,qn.disabled,Ec(d),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(o,h){if(this.currentStencilSource===o.source||!o.isTileClipped()||!h||!h.length)return;this.currentStencilSource=o.source;const d=this.context,g=d.gl;this.nextStencilID+h.length>256&&this.clearStencil(),d.setColorMode(Ti.disabled),d.setDepthMode(gn.disabled);const y=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const I of h){const T=this._tileClippingMaskIDs[I.key]=this.nextStencilID++,M=this.style.map.terrain&&this.style.map.terrain.getTerrainData(I);y.draw(d,g.TRIANGLES,gn.disabled,new Wn({func:g.ALWAYS,mask:0},T,255,g.KEEP,g.KEEP,g.REPLACE),Ti.disabled,qn.disabled,Ec(I.posMatrix),M,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const o=this.nextStencilID++,h=this.context.gl;return new Wn({func:h.NOTEQUAL,mask:255},o,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(o){const h=this.context.gl;return new Wn({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[o.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(o){const h=this.context.gl,d=o.sort((I,T)=>T.overscaledZ-I.overscaledZ),g=d[d.length-1].overscaledZ,y=d[0].overscaledZ-g+1;if(y>1){this.currentStencilSource=void 0,this.nextStencilID+y>256&&this.clearStencil();const I={};for(let T=0;T=0;this.currentLayer--){const M=this.style._layers[d[this.currentLayer]],k=g[M.source],N=y[M.source];this._renderTileClippingMasks(M,N),this.renderLayer(this,k,M,N)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayertt.source&&!tt.isHidden(N)?[k.sourceCaches[tt.source]]:[]),nt=Z.filter(tt=>tt.getSource().type==="vector"),it=Z.filter(tt=>tt.getSource().type!=="vector"),st=tt=>{(!z||z.getSource().maxzoomst(tt)),z||it.forEach(tt=>st(tt)),z}(this.style,this.transform.zoom);M&&function(k,N,z){for(let Z=0;Znt.style.map.terrain.getElevation(Mt,Ae,xe):null)}}}(M,y,T,I,T.layout.get("text-rotation-alignment"),T.layout.get("text-pitch-alignment"),k),T.paint.get("icon-opacity").constantOr(1)!==0&&Fc(y,I,T,M,!1,T.paint.get("icon-translate"),T.paint.get("icon-translate-anchor"),T.layout.get("icon-rotation-alignment"),T.layout.get("icon-pitch-alignment"),T.layout.get("icon-keep-upright"),N,z),T.paint.get("text-opacity").constantOr(1)!==0&&Fc(y,I,T,M,!0,T.paint.get("text-translate"),T.paint.get("text-translate-anchor"),T.layout.get("text-rotation-alignment"),T.layout.get("text-pitch-alignment"),T.layout.get("text-keep-upright"),N,z),I.map.showCollisionBoxes&&(Nc(y,I,T,M,T.paint.get("text-translate"),T.paint.get("text-translate-anchor"),!0),Nc(y,I,T,M,T.paint.get("icon-translate"),T.paint.get("icon-translate-anchor"),!1))})(o,h,d,g,this.style.placement.variableOffsets);break;case"circle":(function(y,I,T,M){if(y.renderPass!=="translucent")return;const k=T.paint.get("circle-opacity"),N=T.paint.get("circle-stroke-width"),z=T.paint.get("circle-stroke-opacity"),Z=!T.layout.get("circle-sort-key").isConstant();if(k.constantOr(1)===0&&(N.constantOr(1)===0||z.constantOr(1)===0))return;const nt=y.context,it=nt.gl,st=y.depthModeForSublayer(0,gn.ReadOnly),tt=Wn.disabled,mt=y.colorModeForRenderPass(),Ct=[];for(let lt=0;ltlt.sortKey-bt.sortKey);for(const lt of Ct){const{programConfiguration:bt,program:kt,layoutVertexBuffer:Mt,indexBuffer:Zt,uniformValues:Jt,terrainData:Ht}=lt.state;kt.draw(nt,it.TRIANGLES,st,tt,mt,qn.disabled,Jt,Ht,T.id,Mt,Zt,lt.segments,T.paint,y.transform.zoom,bt)}})(o,h,d,g);break;case"heatmap":(function(y,I,T,M){if(T.paint.get("heatmap-opacity")!==0)if(y.renderPass==="offscreen"){const k=y.context,N=k.gl,z=Wn.disabled,Z=new Ti([N.ONE,N.ONE],u.aO.transparent,[!0,!0,!0,!0]);(function(nt,it,st){const tt=nt.gl;nt.activeTexture.set(tt.TEXTURE1),nt.viewport.set([0,0,it.width/4,it.height/4]);let mt=st.heatmapFbo;if(mt)tt.bindTexture(tt.TEXTURE_2D,mt.colorAttachment.get()),nt.bindFramebuffer.set(mt.framebuffer);else{const Ct=tt.createTexture();tt.bindTexture(tt.TEXTURE_2D,Ct),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_WRAP_S,tt.CLAMP_TO_EDGE),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_WRAP_T,tt.CLAMP_TO_EDGE),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_MIN_FILTER,tt.LINEAR),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_MAG_FILTER,tt.LINEAR),mt=st.heatmapFbo=nt.createFramebuffer(it.width/4,it.height/4,!1,!1),function(lt,bt,kt,Mt){var Zt,Jt;const Ht=lt.gl,te=(Zt=lt.HALF_FLOAT)!==null&&Zt!==void 0?Zt:Ht.UNSIGNED_BYTE,ye=(Jt=lt.RGBA16F)!==null&&Jt!==void 0?Jt:Ht.RGBA;Ht.texImage2D(Ht.TEXTURE_2D,0,ye,bt.width/4,bt.height/4,0,Ht.RGBA,te,null),Mt.colorAttachment.set(kt)}(nt,it,Ct,mt)}})(k,y,T),k.clear({color:u.aO.transparent});for(let nt=0;nt{const lt=u.F();u.aN(lt,0,st.width,st.height,0,0,1);const bt=st.context.gl;return{u_matrix:lt,u_world:[bt.drawingBufferWidth,bt.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:tt.paint.get("heatmap-opacity")}})(k,N),null,N.id,k.viewportBuffer,k.quadTriangleIndexBuffer,k.viewportSegments,N.paint,k.transform.zoom)}(y,T))})(o,h,d,g);break;case"line":(function(y,I,T,M){if(y.renderPass!=="translucent")return;const k=T.paint.get("line-opacity"),N=T.paint.get("line-width");if(k.constantOr(1)===0||N.constantOr(1)===0)return;const z=y.depthModeForSublayer(0,gn.ReadOnly),Z=y.colorModeForRenderPass(),nt=T.paint.get("line-dasharray"),it=T.paint.get("line-pattern"),st=it.constantOr(1),tt=T.paint.get("line-gradient"),mt=T.getCrossfadeParameters(),Ct=st?"linePattern":nt?"lineSDF":tt?"lineGradient":"line",lt=y.context,bt=lt.gl;let kt=!0;for(const Mt of M){const Zt=I.getTile(Mt);if(st&&!Zt.patternsLoaded())continue;const Jt=Zt.getBucket(T);if(!Jt)continue;const Ht=Jt.programConfigurations.get(T.id),te=y.context.program.get(),ye=y.useProgram(Ct,Ht),ze=kt||ye.program!==te,ce=y.style.map.terrain&&y.style.map.terrain.getTerrainData(Mt),Ae=it.constantOr(null);if(Ae&&Zt.imageAtlas){const ln=Zt.imageAtlas,tn=ln.patternPositions[Ae.to.toString()],un=ln.patternPositions[Ae.from.toString()];tn&&un&&Ht.setConstantPatternPositions(tn,un)}const xe=ce?Mt:null,Xn=st?nl(y,Zt,T,mt,xe):nt?Cc(y,Zt,T,nt,mt,xe):tt?id(y,Zt,T,Jt.lineClipsArray.length,xe):Ic(y,Zt,T,xe);if(st)lt.activeTexture.set(bt.TEXTURE0),Zt.imageAtlasTexture.bind(bt.LINEAR,bt.CLAMP_TO_EDGE),Ht.updatePaintBuffers(mt);else if(nt&&(ze||y.lineAtlas.dirty))lt.activeTexture.set(bt.TEXTURE0),y.lineAtlas.bind(lt);else if(tt){const ln=Jt.gradients[T.id];let tn=ln.texture;if(T.gradientVersion!==ln.version){let un=256;if(T.stepInterpolant){const Mi=I.getSource().maxzoom,Fn=Mt.canonical.z===Mi?Math.ceil(1<0?h.pop():null}isPatternMissing(o){if(!o)return!1;if(!o.from||!o.to)return!0;const h=this.imageManager.getPattern(o.from.toString()),d=this.imageManager.getPattern(o.to.toString());return!h||!d}useProgram(o,h){this.cache=this.cache||{};const d=o+(h?h.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[d]||(this.cache[d]=new Ta(this.context,Eu[o],h,rd[o],this._showOverdrawInspector,this.style.map.terrain)),this.cache[d]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const o=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(o.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new wt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:o,drawingBufferHeight:h}=this.context.gl;return this.width!==o||this.height!==h}}class Ma{constructor(o,h){this.points=o,this.planes=h}static fromInvProjectionMatrix(o,h,d){const g=Math.pow(2,d),y=[[-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(T=>{const M=1/(T=u.af([],T,o))[3]/h*g;return u.a_(T,T,[M,M,1/T[3],M])}),I=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(T=>{const M=function(Z,nt){var it=nt[0],st=nt[1],tt=nt[2],mt=it*it+st*st+tt*tt;return mt>0&&(mt=1/Math.sqrt(mt)),Z[0]=nt[0]*mt,Z[1]=nt[1]*mt,Z[2]=nt[2]*mt,Z}([],function(Z,nt,it){var st=nt[0],tt=nt[1],mt=nt[2],Ct=it[0],lt=it[1],bt=it[2];return Z[0]=tt*bt-mt*lt,Z[1]=mt*Ct-st*bt,Z[2]=st*lt-tt*Ct,Z}([],ut([],y[T[0]],y[T[1]]),ut([],y[T[2]],y[T[1]]))),k=-((N=M)[0]*(z=y[T[1]])[0]+N[1]*z[1]+N[2]*z[2]);var N,z;return M.concat(k)});return new Ma(y,I)}}class Pa{constructor(o,h){this.min=o,this.max=h,this.center=function(d,g,y){return d[0]=.5*g[0],d[1]=.5*g[1],d[2]=.5*g[2],d}([],function(d,g,y){return d[0]=g[0]+y[0],d[1]=g[1]+y[1],d[2]=g[2]+y[2],d}([],this.min,this.max))}quadrant(o){const h=[o%2==0,o<2],d=dt(this.min),g=dt(this.max);for(let y=0;y=0&&I++;if(I===0)return 0;I!==h.length&&(d=!1)}if(d)return 2;for(let g=0;g<3;g++){let y=Number.MAX_VALUE,I=-Number.MAX_VALUE;for(let T=0;Tthis.max[g]-this.min[g])return 0}return 1}}class Gl{constructor(o=0,h=0,d=0,g=0){if(isNaN(o)||o<0||isNaN(h)||h<0||isNaN(d)||d<0||isNaN(g)||g<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=o,this.bottom=h,this.left=d,this.right=g}interpolate(o,h,d){return h.top!=null&&o.top!=null&&(this.top=u.z.number(o.top,h.top,d)),h.bottom!=null&&o.bottom!=null&&(this.bottom=u.z.number(o.bottom,h.bottom,d)),h.left!=null&&o.left!=null&&(this.left=u.z.number(o.left,h.left,d)),h.right!=null&&o.right!=null&&(this.right=u.z.number(o.right,h.right,d)),this}getCenter(o,h){const d=u.ac((this.left+o-this.right)/2,0,o),g=u.ac((this.top+h-this.bottom)/2,0,h);return new u.P(d,g)}equals(o){return this.top===o.top&&this.bottom===o.bottom&&this.left===o.left&&this.right===o.right}clone(){return new Gl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class jc{constructor(o,h,d,g,y){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=y===void 0||!!y,this._minZoom=o||0,this._maxZoom=h||22,this._minPitch=d??0,this._maxPitch=g??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new u.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Gl,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){const o=new jc(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return o.apply(this),o}apply(o){this.tileSize=o.tileSize,this.latRange=o.latRange,this.width=o.width,this.height=o.height,this._center=o._center,this._elevation=o._elevation,this.minElevationForCurrentTile=o.minElevationForCurrentTile,this.zoom=o.zoom,this.angle=o.angle,this._fov=o._fov,this._pitch=o._pitch,this._unmodified=o._unmodified,this._edgeInsets=o._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(o){this._minZoom!==o&&(this._minZoom=o,this.zoom=Math.max(this.zoom,o))}get maxZoom(){return this._maxZoom}set maxZoom(o){this._maxZoom!==o&&(this._maxZoom=o,this.zoom=Math.min(this.zoom,o))}get minPitch(){return this._minPitch}set minPitch(o){this._minPitch!==o&&(this._minPitch=o,this.pitch=Math.max(this.pitch,o))}get maxPitch(){return this._maxPitch}set maxPitch(o){this._maxPitch!==o&&(this._maxPitch=o,this.pitch=Math.min(this.pitch,o))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(o){o===void 0?o=!0:o===null&&(o=!1),this._renderWorldCopies=o}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new u.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(o){const h=-u.b0(o,-180,180)*Math.PI/180;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=function(){var d=new u.A(4);return u.A!=Float32Array&&(d[1]=0,d[2]=0),d[0]=1,d[3]=1,d}(),function(d,g,y){var I=g[0],T=g[1],M=g[2],k=g[3],N=Math.sin(y),z=Math.cos(y);d[0]=I*z+M*N,d[1]=T*z+k*N,d[2]=I*-N+M*z,d[3]=T*-N+k*z}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(o){const h=u.ac(o,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(o){o=Math.max(.01,Math.min(60,o)),this._fov!==o&&(this._unmodified=!1,this._fov=o/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(o){const h=Math.min(Math.max(o,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._zoom=h,this.tileZoom=Math.max(0,Math.floor(h)),this.scale=this.zoomScale(h),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(o){o.lat===this._center.lat&&o.lng===this._center.lng||(this._unmodified=!1,this._center=o,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(o){o!==this._elevation&&(this._elevation=o,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(o){this._edgeInsets.equals(o)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,o,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(o){return this._edgeInsets.equals(o)}interpolatePadding(o,h,d){this._unmodified=!1,this._edgeInsets.interpolate(o,h,d),this._constrain(),this._calcMatrices()}coveringZoomLevel(o){const h=(o.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/o.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(o){const h=[new u.b1(0,o)];if(this._renderWorldCopies){const d=this.pointCoordinate(new u.P(0,0)),g=this.pointCoordinate(new u.P(this.width,0)),y=this.pointCoordinate(new u.P(this.width,this.height)),I=this.pointCoordinate(new u.P(0,this.height)),T=Math.floor(Math.min(d.x,g.x,y.x,I.x)),M=Math.floor(Math.max(d.x,g.x,y.x,I.x)),k=1;for(let N=T-k;N<=M+k;N++)N!==0&&h.push(new u.b1(N,o))}return h}coveringTiles(o){var h,d;let g=this.coveringZoomLevel(o);const y=g;if(o.minzoom!==void 0&&go.maxzoom&&(g=o.maxzoom);const I=this.pointCoordinate(this.getCameraPoint()),T=u.Y.fromLngLat(this.center),M=Math.pow(2,g),k=[M*I.x,M*I.y,0],N=[M*T.x,M*T.y,0],z=Ma.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,g);let Z=o.minzoom||0;!o.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Z=g);const nt=o.terrain?2/Math.min(this.tileSize,o.tileSize)*this.tileSize:3,it=lt=>({aabb:new Pa([lt*M,0,0],[(lt+1)*M,M,0]),zoom:0,x:0,y:0,wrap:lt,fullyVisible:!1}),st=[],tt=[],mt=g,Ct=o.reparseOverscaled?y:g;if(this._renderWorldCopies)for(let lt=1;lt<=3;lt++)st.push(it(-lt)),st.push(it(lt));for(st.push(it(0));st.length>0;){const lt=st.pop(),bt=lt.x,kt=lt.y;let Mt=lt.fullyVisible;if(!Mt){const ye=lt.aabb.intersects(z);if(ye===0)continue;Mt=ye===2}const Zt=o.terrain?k:N,Jt=lt.aabb.distanceX(Zt),Ht=lt.aabb.distanceY(Zt),te=Math.max(Math.abs(Jt),Math.abs(Ht));if(lt.zoom===mt||te>nt+(1<=Z){const ye=mt-lt.zoom,ze=k[0]-.5-(bt<>1),Ae=lt.zoom+1;let xe=lt.aabb.quadrant(ye);if(o.terrain){const Xn=new u.Q(Ae,lt.wrap,Ae,ze,ce),ln=o.terrain.getMinMaxElevation(Xn),tn=(h=ln.minElevation)!==null&&h!==void 0?h:this.elevation,un=(d=ln.maxElevation)!==null&&d!==void 0?d:this.elevation;xe=new Pa([xe.min[0],xe.min[1],tn],[xe.max[0],xe.max[1],un])}st.push({aabb:xe,zoom:Ae,x:ze,y:ce,wrap:lt.wrap,fullyVisible:Mt})}}return tt.sort((lt,bt)=>lt.distanceSq-bt.distanceSq).map(lt=>lt.tileID)}resize(o,h){this.width=o,this.height=h,this.pixelsToGLUnits=[2/o,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(o){return Math.pow(2,o)}scaleZoom(o){return Math.log(o)/Math.LN2}project(o){const h=u.ac(o.lat,-this.maxValidLatitude,this.maxValidLatitude);return new u.P(u.N(o.lng)*this.worldSize,u.O(h)*this.worldSize)}unproject(o){return new u.Y(o.x/this.worldSize,o.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(o){const h=this.pointLocation(this.centerPoint,o),d=o.getElevationForLngLatZoom(h,this.tileZoom);if(!(this.elevation-d))return;const g=this.getCameraPosition(),y=u.Y.fromLngLat(g.lngLat,g.altitude),I=u.Y.fromLngLat(h,d),T=y.x-I.x,M=y.y-I.y,k=y.z-I.z,N=Math.sqrt(T*T+M*M+k*k),z=this.scaleZoom(this.cameraToCenterDistance/N/this.tileSize);this._elevation=d,this._center=h,this.zoom=z}setLocationAtPoint(o,h){const d=this.pointCoordinate(h),g=this.pointCoordinate(this.centerPoint),y=this.locationCoordinate(o),I=new u.Y(y.x-(d.x-g.x),y.y-(d.y-g.y));this.center=this.coordinateLocation(I),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(o,h){return h?this.coordinatePoint(this.locationCoordinate(o),h.getElevationForLngLatZoom(o,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(o))}pointLocation(o,h){return this.coordinateLocation(this.pointCoordinate(o,h))}locationCoordinate(o){return u.Y.fromLngLat(o)}coordinateLocation(o){return o&&o.toLngLat()}pointCoordinate(o,h){if(h){const Z=h.pointCoordinate(o);if(Z!=null)return Z}const d=[o.x,o.y,0,1],g=[o.x,o.y,1,1];u.af(d,d,this.pixelMatrixInverse),u.af(g,g,this.pixelMatrixInverse);const y=d[3],I=g[3],T=d[1]/y,M=g[1]/I,k=d[2]/y,N=g[2]/I,z=k===N?0:(0-k)/(N-k);return new u.Y(u.z.number(d[0]/y,g[0]/I,z)/this.worldSize,u.z.number(T,M,z)/this.worldSize)}coordinatePoint(o,h=0,d=this.pixelMatrix){const g=[o.x*this.worldSize,o.y*this.worldSize,h,1];return u.af(g,g,d),new u.P(g[0]/g[3],g[1]/g[3])}getBounds(){const o=Math.max(0,this.height/2-this.getHorizon());return new be().extend(this.pointLocation(new u.P(0,o))).extend(this.pointLocation(new u.P(this.width,o))).extend(this.pointLocation(new u.P(this.width,this.height))).extend(this.pointLocation(new u.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new be([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(o){o?(this.lngRange=[o.getWest(),o.getEast()],this.latRange=[o.getSouth(),o.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(o,h=!1){const d=o.key,g=h?this._alignedPosMatrixCache:this._posMatrixCache;if(g[d])return g[d];const y=o.canonical,I=this.worldSize/this.zoomScale(y.z),T=y.x+Math.pow(2,y.z)*o.wrap,M=u.an(new Float64Array(16));return u.H(M,M,[T*I,y.y*I,0]),u.J(M,M,[I/u.W,I/u.W,1]),u.K(M,h?this.alignedProjMatrix:this.projMatrix,M),g[d]=new Float32Array(M),g[d]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let o,h,d,g,y=-90,I=90,T=-180,M=180;const k=this.size,N=this._unmodified;if(this.latRange){const nt=this.latRange;y=u.O(nt[1])*this.worldSize,I=u.O(nt[0])*this.worldSize,o=I-yI&&(g=I-it)}if(this.lngRange){const nt=(T+M)/2,it=u.b0(z.x,nt-this.worldSize/2,nt+this.worldSize/2),st=k.x/2;it-stM&&(d=M-st)}d===void 0&&g===void 0||(this.center=this.unproject(new u.P(d!==void 0?d:z.x,g!==void 0?g:z.y)).wrap()),this._unmodified=N,this._constraining=!1}_calcMatrices(){if(!this.height)return;const o=this.centerOffset,h=this.point.x,d=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=u.b2(1,this.center.lat)*this.worldSize;let g=u.an(new Float64Array(16));u.J(g,g,[this.width/2,-this.height/2,1]),u.H(g,g,[1,-1,0]),this.labelPlaneMatrix=g,g=u.an(new Float64Array(16)),u.J(g,g,[1,-1,1]),u.H(g,g,[-1,-1,0]),u.J(g,g,[2/this.width,2/this.height,1]),this.glCoordMatrix=g;const y=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),I=Math.min(this.elevation,this.minElevationForCurrentTile),T=y-I*this._pixelPerMeter/Math.cos(this._pitch),M=I<0?T:y,k=Math.PI/2+this._pitch,N=this._fov*(.5+o.y/this.height),z=Math.sin(N)*M/Math.sin(u.ac(Math.PI-k-N,.01,Math.PI-.01)),Z=this.getHorizon(),nt=2*Math.atan(Z/this.cameraToCenterDistance)*(.5+o.y/(2*Z)),it=Math.sin(nt)*M/Math.sin(u.ac(Math.PI-k-nt,.01,Math.PI-.01)),st=Math.min(z,it),tt=1.01*(Math.cos(Math.PI/2-this._pitch)*st+M),mt=this.height/50;g=new Float64Array(16),u.b3(g,this._fov,this.width/this.height,mt,tt),g[8]=2*-o.x/this.width,g[9]=2*o.y/this.height,u.J(g,g,[1,-1,1]),u.H(g,g,[0,0,-this.cameraToCenterDistance]),u.b4(g,g,this._pitch),u.ad(g,g,this.angle),u.H(g,g,[-h,-d,0]),this.mercatorMatrix=u.J([],g,[this.worldSize,this.worldSize,this.worldSize]),u.J(g,g,[1,1,this._pixelPerMeter]),this.pixelMatrix=u.K(new Float64Array(16),this.labelPlaneMatrix,g),u.H(g,g,[0,0,-this.elevation]),this.projMatrix=g,this.invProjMatrix=u.ar([],g),this.pixelMatrix3D=u.K(new Float64Array(16),this.labelPlaneMatrix,g);const Ct=this.width%2/2,lt=this.height%2/2,bt=Math.cos(this.angle),kt=Math.sin(this.angle),Mt=h-Math.round(h)+bt*Ct+kt*lt,Zt=d-Math.round(d)+bt*lt+kt*Ct,Jt=new Float64Array(g);if(u.H(Jt,Jt,[Mt>.5?Mt-1:Mt,Zt>.5?Zt-1:Zt,0]),this.alignedProjMatrix=Jt,g=u.ar(new Float64Array(16),this.pixelMatrix),!g)throw new Error("failed to invert matrix");this.pixelMatrixInverse=g,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const o=this.pointCoordinate(new u.P(0,0)),h=[o.x*this.worldSize,o.y*this.worldSize,0,1];return u.af(h,h,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const o=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.P(0,o))}getCameraQueryGeometry(o){const h=this.getCameraPoint();if(o.length===1)return[o[0],h];{let d=h.x,g=h.y,y=h.x,I=h.y;for(const T of o)d=Math.min(d,T.x),g=Math.min(g,T.y),y=Math.max(y,T.x),I=Math.max(I,T.y);return[new u.P(d,g),new u.P(y,g),new u.P(y,I),new u.P(d,I),new u.P(d,g)]}}lngLatToCameraDepth(o,h){const d=this.locationCoordinate(o),g=[d.x*this.worldSize,d.y*this.worldSize,h,1];return u.af(g,g,this.projMatrix),g[2]/g[3]}}function yp(_,o){let h,d=!1,g=null,y=null;const I=()=>{g=null,d&&(_.apply(y,h),g=setTimeout(I,o),d=!1)};return(...T)=>(d=!0,y=this,h=T,g||I(),g)}class vp{constructor(o){this._getCurrentHash=()=>{const h=window.location.hash.replace("#","");if(this._hashName){let d;return h.split("&").map(g=>g.split("=")).forEach(g=>{g[0]===this._hashName&&(d=g)}),(d&&d[1]||"").split("/")}return h.split("/")},this._onHashChange=()=>{const h=this._getCurrentHash();if(h.length>=3&&!h.some(d=>isNaN(d))){const d=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(h[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+h[2],+h[1]],zoom:+h[0],bearing:d,pitch:+(h[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const h=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,h)}catch{}},this._updateHash=yp(this._updateHashUnthrottled,300),this._hashName=o&&encodeURIComponent(o)}addTo(o){return this._map=o,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(o){const h=this._map.getCenter(),d=Math.round(100*this._map.getZoom())/100,g=Math.ceil((d*Math.LN2+Math.log(512/360/.5))/Math.LN10),y=Math.pow(10,g),I=Math.round(h.lng*y)/y,T=Math.round(h.lat*y)/y,M=this._map.getBearing(),k=this._map.getPitch();let N="";if(N+=o?`/${I}/${T}/${d}`:`${d}/${T}/${I}`,(M||k)&&(N+="/"+Math.round(10*M)/10),k&&(N+=`/${Math.round(k)}`),this._hashName){const z=this._hashName;let Z=!1;const nt=window.location.hash.slice(1).split("&").map(it=>{const st=it.split("=")[0];return st===z?(Z=!0,`${st}=${N}`):it}).filter(it=>it);return Z||nt.push(`${z}=${N}`),`#${nt.join("&")}`}return`#${N}`}}const ku={linearity:.3,easing:u.b5(0,0,.3,1)},vd=u.e({deceleration:2500,maxSpeed:1400},ku),sl=u.e({deceleration:20,maxSpeed:1400},ku),xd=u.e({deceleration:1e3,maxSpeed:360},ku),bd=u.e({deceleration:1e3,maxSpeed:90},ku);class wd{constructor(o){this._map=o,this.clear()}clear(){this._inertiaBuffer=[]}record(o){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:L.now(),settings:o})}_drainInertiaBuffer(){const o=this._inertiaBuffer,h=L.now();for(;o.length>0&&h-o[0].time>160;)o.shift()}_onMoveEnd(o){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const h={zoom:0,bearing:0,pitch:0,pan:new u.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:y}of this._inertiaBuffer)h.zoom+=y.zoomDelta||0,h.bearing+=y.bearingDelta||0,h.pitch+=y.pitchDelta||0,y.panDelta&&h.pan._add(y.panDelta),y.around&&(h.around=y.around),y.pinchAround&&(h.pinchAround=y.pinchAround);const d=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,g={};if(h.pan.mag()){const y=Ru(h.pan.mag(),d,u.e({},vd,o||{}));g.offset=h.pan.mult(y.amount/h.pan.mag()),g.center=this._map.transform.center,Du(g,y)}if(h.zoom){const y=Ru(h.zoom,d,sl);g.zoom=this._map.transform.zoom+y.amount,Du(g,y)}if(h.bearing){const y=Ru(h.bearing,d,xd);g.bearing=this._map.transform.bearing+u.ac(y.amount,-179,179),Du(g,y)}if(h.pitch){const y=Ru(h.pitch,d,bd);g.pitch=this._map.transform.pitch+y.amount,Du(g,y)}if(g.zoom||g.bearing){const y=h.pinchAround===void 0?h.around:h.pinchAround;g.around=y?this._map.unproject(y):this._map.getCenter()}return this.clear(),u.e(g,{noMoveStart:!0})}}function Du(_,o){(!_.duration||_.durationh.unproject(M)),T=y.reduce((M,k,N,z)=>M.add(k.div(z.length)),new u.P(0,0));super(o,{points:y,point:T,lngLats:I,lngLat:h.unproject(T),originalEvent:d}),this._defaultPrevented=!1}}class al extends u.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,h,d){super(o,{originalEvent:d}),this._defaultPrevented=!1}}class Sd{constructor(o,h){this._map=o,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(o){return this._firePreventable(new al(o.type,this._map,o))}mousedown(o,h){return this._mousedownPos=h,this._firePreventable(new so(o.type,this._map,o))}mouseup(o){this._map.fire(new so(o.type,this._map,o))}click(o,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new so(o.type,this._map,o))}dblclick(o){return this._firePreventable(new so(o.type,this._map,o))}mouseover(o){this._map.fire(new so(o.type,this._map,o))}mouseout(o){this._map.fire(new so(o.type,this._map,o))}touchstart(o){return this._firePreventable(new ql(o.type,this._map,o))}touchmove(o){this._map.fire(new ql(o.type,this._map,o))}touchend(o){this._map.fire(new ql(o.type,this._map,o))}touchcancel(o){this._map.fire(new ql(o.type,this._map,o))}_firePreventable(o){if(this._map.fire(o),o.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ls{constructor(o){this._map=o}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(o){this._map.fire(new so(o.type,this._map,o))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new so("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(o){this._delayContextMenu?this._contextMenuEvent=o:this._ignoreContextMenu||this._map.fire(new so(o.type,this._map,o)),this._map.listens("contextmenu")&&o.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ao{constructor(o){this._map=o}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(o){return this.transform.pointLocation(u.P.convert(o),this._map.terrain)}}class xp{constructor(o,h){this._map=o,this._tr=new ao(o),this._el=o.getCanvasContainer(),this._container=o.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(o,h){this.isEnabled()&&o.shiftKey&&o.button===0&&(A.disableDrag(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(o,h){if(!this._active)return;const d=h;if(this._lastPos.equals(d)||!this._box&&d.dist(this._startPos)y.fitScreenCoordinates(d,g,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",o)}keydown(o){this._active&&o.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",o))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(A.remove(this._box),this._box=null),A.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(o,h){return this._map.fire(new u.k(o,{originalEvent:h}))}}function Ho(_,o){if(_.length!==o.length)throw new Error(`The number of touches and points are not equal - touches ${_.length}, points ${o.length}`);const h={};for(let d=0;d<_.length;d++)h[_[d].identifier]=o[d];return h}class Nu{constructor(o){this.reset(),this.numTouches=o.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(o,h,d){(this.centroid||d.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=o.timeStamp),d.length===this.numTouches&&(this.centroid=function(g){const y=new u.P(0,0);for(const I of g)y._add(I);return y.div(g.length)}(h),this.touches=Ho(d,h)))}touchmove(o,h,d){if(this.aborted||!this.centroid)return;const g=Ho(d,h);for(const y in this.touches){const I=g[y];(!I||I.dist(this.touches[y])>30)&&(this.aborted=!0)}}touchend(o,h,d){if((!this.centroid||o.timeStamp-this.startTime>500)&&(this.aborted=!0),d.length===0){const g=!this.aborted&&this.centroid;if(this.reset(),g)return g}}}class bp{constructor(o){this.singleTap=new Nu(o),this.numTaps=o.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(o,h,d){this.singleTap.touchstart(o,h,d)}touchmove(o,h,d){this.singleTap.touchmove(o,h,d)}touchend(o,h,d){const g=this.singleTap.touchend(o,h,d);if(g){const y=o.timeStamp-this.lastTime<500,I=!this.lastTap||this.lastTap.dist(g)<30;if(y&&I||this.reset(),this.count++,this.lastTime=o.timeStamp,this.lastTap=g,this.count===this.numTaps)return this.reset(),g}}}class dg{constructor(o){this._tr=new ao(o),this._zoomIn=new bp({numTouches:1,numTaps:2}),this._zoomOut=new bp({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(o,h,d){this._zoomIn.touchstart(o,h,d),this._zoomOut.touchstart(o,h,d)}touchmove(o,h,d){this._zoomIn.touchmove(o,h,d),this._zoomOut.touchmove(o,h,d)}touchend(o,h,d){const g=this._zoomIn.touchend(o,h,d),y=this._zoomOut.touchend(o,h,d),I=this._tr;return g?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:I.zoom+1,around:I.unproject(g)},{originalEvent:o})}):y?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:I.zoom-1,around:I.unproject(y)},{originalEvent:o})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class zu{constructor(o){this._enabled=!!o.enable,this._moveStateManager=o.moveStateManager,this._clickTolerance=o.clickTolerance||1,this._moveFunction=o.move,this._activateOnStart=!!o.activateOnStart,o.assignEvents(this),this.reset()}reset(o){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(o)}_move(...o){const h=this._moveFunction(...o);if(h.bearingDelta||h.pitchDelta||h.around||h.panDelta)return this._active=!0,h}dragStart(o,h){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(o)&&(this._moveStateManager.startMove(o),this._lastPoint=h.length?h[0]:h,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(o,h){if(!this.isEnabled())return;const d=this._lastPoint;if(!d)return;if(o.preventDefault(),!this._moveStateManager.isValidMoveEvent(o))return void this.reset(o);const g=h.length?h[0]:h;return!this._moved&&g.dist(d){_.mousedown=_.dragStart,_.mousemoveWindow=_.dragMove,_.mouseup=_.dragEnd,_.contextmenu=function(o){o.preventDefault()}},wp=({enable:_,clickTolerance:o,bearingDegreesPerPixelMoved:h=.8})=>{const d=new ll({checkCorrectEvent:g=>A.mouseButton(g)===0&&g.ctrlKey||A.mouseButton(g)===2});return new zu({clickTolerance:o,move:(g,y)=>({bearingDelta:(y.x-g.x)*h}),moveStateManager:d,enable:_,assignEvents:_e})},jl=({enable:_,clickTolerance:o,pitchDegreesPerPixelMoved:h=-.5})=>{const d=new ll({checkCorrectEvent:g=>A.mouseButton(g)===0&&g.ctrlKey||A.mouseButton(g)===2});return new zu({clickTolerance:o,move:(g,y)=>({pitchDelta:(y.y-g.y)*h}),moveStateManager:d,enable:_,assignEvents:_e})};class Ou{constructor(o,h){this._clickTolerance=o.clickTolerance||1,this._map=h,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new u.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(o,h,d){return this._calculateTransform(o,h,d)}touchmove(o,h,d){if(this._active&&!(d.length0&&(this._active=!0);const g=Ho(d,h),y=new u.P(0,0),I=new u.P(0,0);let T=0;for(const k in g){const N=g[k],z=this._touches[k];z&&(y._add(N),I._add(N.sub(z)),T++,g[k]=N)}if(this._touches=g,TMath.abs(_.x)}class Sp extends Zc{constructor(o){super(),this._currentTouchCount=0,this._map=o}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(o,h,d){super.touchstart(o,h,d),this._currentTouchCount=d.length}_start(o){this._lastPoints=o,Xc(o[0].sub(o[1]))&&(this._valid=!1)}_move(o,h,d){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const g=o[0].sub(this._lastPoints[0]),y=o[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(g,y,d.timeStamp),this._valid?(this._lastPoints=o,this._active=!0,{pitchDelta:(g.y+y.y)/2*-.5}):void 0}gestureBeginsVertically(o,h,d){if(this._valid!==void 0)return this._valid;const g=o.mag()>=2,y=h.mag()>=2;if(!g&&!y)return;if(!g||!y)return this._firstMove===void 0&&(this._firstMove=d),d-this._firstMove<100&&void 0;const I=o.y>0==h.y>0;return Xc(o)&&Xc(h)&&I}}const mg={panStep:100,bearingStep:15,pitchStep:10};class Td{constructor(o){this._tr=new ao(o);const h=mg;this._panStep=h.panStep,this._bearingStep=h.bearingStep,this._pitchStep=h.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(o){if(o.altKey||o.ctrlKey||o.metaKey)return;let h=0,d=0,g=0,y=0,I=0;switch(o.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:o.shiftKey?d=-1:(o.preventDefault(),y=-1);break;case 39:o.shiftKey?d=1:(o.preventDefault(),y=1);break;case 38:o.shiftKey?g=1:(o.preventDefault(),I=-1);break;case 40:o.shiftKey?g=-1:(o.preventDefault(),I=1);break;default:return}return this._rotationDisabled&&(d=0,g=0),{cameraAnimation:T=>{const M=this._tr;T.easeTo({duration:300,easeId:"keyboardHandler",easing:ul,zoom:h?Math.round(M.zoom)+h*(o.shiftKey?2:1):M.zoom,bearing:M.bearing+d*this._bearingStep,pitch:M.pitch+g*this._pitchStep,offset:[-y*this._panStep,-I*this._panStep],center:M.center},{originalEvent:o})}}}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 ul(_){return _*(2-_)}const Hn=4.000244140625;class Fu{constructor(o,h){this._onTimeout=d=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(d)},this._map=o,this._tr=new ao(o),this._triggerRenderFrame=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(o){this._defaultZoomRate=o}setWheelZoomRate(o){this._wheelZoomRate=o}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(o){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!o&&o.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(o){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!o[this._map.cooperativeGestures._bypassKey])return;let h=o.deltaMode===WheelEvent.DOM_DELTA_LINE?40*o.deltaY:o.deltaY;const d=L.now(),g=d-(this._lastWheelEventTime||0);this._lastWheelEventTime=d,h!==0&&h%Hn==0?this._type="wheel":h!==0&&Math.abs(h)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,o)):this._type||(this._type=Math.abs(g*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),o.shiftKey&&h&&(h/=4),this._type&&(this._lastWheelEvent=o,this._delta-=h,this._active||this._start(o)),o.preventDefault()}_start(o){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 h=A.mousePos(this._map.getCanvas(),o),d=this._tr;this._around=h.y>d.transform.height/2-d.transform.getHorizon()?u.M.convert(this._aroundCenter?d.center:d.unproject(h)):u.M.convert(d.center),this._aroundPoint=d.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const o=this._tr.transform;if(this._delta!==0){const T=this._type==="wheel"&&Math.abs(this._delta)>Hn?this._wheelZoomRate:this._defaultZoomRate;let M=2/(1+Math.exp(-Math.abs(this._delta*T)));this._delta<0&&M!==0&&(M=1/M);const k=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):o.scale;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(k*M))),this._type==="wheel"&&(this._startZoom=o.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:o.zoom,d=this._startZoom,g=this._easing;let y,I=!1;if(this._type==="wheel"&&d&&g){const T=Math.min((L.now()-this._lastWheelEventTime)/200,1),M=g(T);y=u.z.number(d,h,M),T<1?this._frameId||(this._frameId=!0):I=!0}else y=h,I=!0;return this._active=!0,I&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!I,zoomDelta:y-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(o){let h=u.b6;if(this._prevEase){const d=this._prevEase,g=(L.now()-d.start)/d.duration,y=d.easing(g+.01)-d.easing(g),I=.27/Math.sqrt(y*y+1e-4)*.01,T=Math.sqrt(.0729-I*I);h=u.b5(I,T,.25,1)}return this._prevEase={start:L.now(),duration:o,easing:h},h}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Yc{constructor(o,h){this._clickZoom=o,this._tapZoom=h}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 Ld{constructor(o){this._tr=new ao(o),this.reset()}reset(){this._active=!1}dblclick(o,h){return o.preventDefault(),{cameraAnimation:d=>{d.easeTo({duration:300,zoom:this._tr.zoom+(o.shiftKey?-1:1),around:this._tr.unproject(h)},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Md{constructor(){this._tap=new bp({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(o,h,d){if(!this._swipePoint)if(this._tapTime){const g=h[0],y=o.timeStamp-this._tapTime<500,I=this._tapPoint.dist(g)<30;y&&I?d.length>0&&(this._swipePoint=g,this._swipeTouch=d[0].identifier):this.reset()}else this._tap.touchstart(o,h,d)}touchmove(o,h,d){if(this._tapTime){if(this._swipePoint){if(d[0].identifier!==this._swipeTouch)return;const g=h[0],y=g.y-this._swipePoint.y;return this._swipePoint=g,o.preventDefault(),this._active=!0,{zoomDelta:y/128}}}else this._tap.touchmove(o,h,d)}touchend(o,h,d){if(this._tapTime)this._swipePoint&&d.length===0&&this.reset();else{const g=this._tap.touchend(o,h,d);g&&(this._tapTime=o.timeStamp,this._tapPoint=g)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ep{constructor(o,h,d){this._el=o,this._mousePan=h,this._touchPan=d}enable(o){this._inertiaOptions=o||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Pd{constructor(o,h,d){this._pitchWithRotate=o.pitchWithRotate,this._mouseRotate=h,this._mousePitch=d}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 us{constructor(o,h,d,g){this._el=o,this._touchZoom=h,this._touchRotate=d,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0}enable(o){this._touchZoom.enable(o),this._rotationDisabled||this._touchRotate.enable(o),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-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()}}class Bu{constructor(o,h){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=o,this._options=h,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const o=this._map.getCanvasContainer();o.classList.add("maplibregl-cooperative-gestures"),this._container=A.create("div","maplibregl-cooperative-gesture-screen",o);let h=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(h=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const d=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),g=document.createElement("div");g.className="maplibregl-desktop-message",g.textContent=h,this._container.appendChild(g);const y=document.createElement("div");y.className="maplibregl-mobile-message",y.textContent=d,this._container.appendChild(y),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(A.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(o){this._onCooperativeGesture(o.touches.length===1)}wheel(o){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!o[this._bypassKey])}_onCooperativeGesture(o){this._enabled&&o&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Ee=_=>_.zoom||_.drag||_.pitch||_.rotate;class Oe extends u.k{}function Zl(_){return _.panDelta&&_.panDelta.mag()||_.zoomDelta||_.bearingDelta||_.pitchDelta}class Ip{constructor(o,h){this.handleWindowEvent=g=>{this.handleEvent(g,`${g.type}Window`)},this.handleEvent=(g,y)=>{if(g.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const I=g.type==="renderFrame"?void 0:g,T={needsRenderFrame:!1},M={},k={},N=g.touches,z=N?this._getMapTouches(N):void 0,Z=z?A.touchPos(this._map.getCanvas(),z):A.mousePos(this._map.getCanvas(),g);for(const{handlerName:st,handler:tt,allowed:mt}of this._handlers){if(!tt.isEnabled())continue;let Ct;this._blockedByActive(k,mt,st)?tt.reset():tt[y||g.type]&&(Ct=tt[y||g.type](g,Z,z),this.mergeHandlerResult(T,M,Ct,st,I),Ct&&Ct.needsRenderFrame&&this._triggerRenderFrame()),(Ct||tt.isActive())&&(k[st]=tt)}const nt={};for(const st in this._previousActiveHandlers)k[st]||(nt[st]=I);this._previousActiveHandlers=k,(Object.keys(nt).length||Zl(T))&&(this._changes.push([T,M,nt]),this._triggerRenderFrame()),(Object.keys(k).length||Zl(T))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:it}=T;it&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],it(this._map))},this._map=o,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new wd(o),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(h);const d=this._el;this._listeners=[[d,"touchstart",{passive:!0}],[d,"touchmove",{passive:!1}],[d,"touchend",void 0],[d,"touchcancel",void 0],[d,"mousedown",void 0],[d,"mousemove",void 0],[d,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[d,"mouseover",void 0],[d,"mouseout",void 0],[d,"dblclick",void 0],[d,"click",void 0],[d,"keydown",{capture:!1}],[d,"keyup",void 0],[d,"wheel",{passive:!1}],[d,"contextmenu",void 0],[window,"blur",void 0]];for(const[g,y,I]of this._listeners)A.addEventListener(g,y,g===document?this.handleWindowEvent:this.handleEvent,I)}destroy(){for(const[o,h,d]of this._listeners)A.removeEventListener(o,h,o===document?this.handleWindowEvent:this.handleEvent,d)}_addDefaultHandlers(o){const h=this._map,d=h.getCanvasContainer();this._add("mapEvent",new Sd(h,o));const g=h.boxZoom=new xp(h,o);this._add("boxZoom",g),o.interactive&&o.boxZoom&&g.enable();const y=h.cooperativeGestures=new Bu(h,o.cooperativeGestures);this._add("cooperativeGestures",y),o.cooperativeGestures&&y.enable();const I=new dg(h),T=new Ld(h);h.doubleClickZoom=new Yc(T,I),this._add("tapZoom",I),this._add("clickZoom",T),o.interactive&&o.doubleClickZoom&&h.doubleClickZoom.enable();const M=new Md;this._add("tapDragZoom",M);const k=h.touchPitch=new Sp(h);this._add("touchPitch",k),o.interactive&&o.touchPitch&&h.touchPitch.enable(o.touchPitch);const N=wp(o),z=jl(o);h.dragRotate=new Pd(o,N,z),this._add("mouseRotate",N,["mousePitch"]),this._add("mousePitch",z,["mouseRotate"]),o.interactive&&o.dragRotate&&h.dragRotate.enable();const Z=(({enable:Ct,clickTolerance:lt})=>{const bt=new ll({checkCorrectEvent:kt=>A.mouseButton(kt)===0&&!kt.ctrlKey});return new zu({clickTolerance:lt,move:(kt,Mt)=>({around:Mt,panDelta:Mt.sub(kt)}),activateOnStart:!0,moveStateManager:bt,enable:Ct,assignEvents:_e})})(o),nt=new Ou(o,h);h.dragPan=new Ep(d,Z,nt),this._add("mousePan",Z),this._add("touchPan",nt,["touchZoom","touchRotate"]),o.interactive&&o.dragPan&&h.dragPan.enable(o.dragPan);const it=new Hc,st=new Id;h.touchZoomRotate=new us(d,st,it,M),this._add("touchRotate",it,["touchPan","touchZoom"]),this._add("touchZoom",st,["touchPan","touchRotate"]),o.interactive&&o.touchZoomRotate&&h.touchZoomRotate.enable(o.touchZoomRotate);const tt=h.scrollZoom=new Fu(h,()=>this._triggerRenderFrame());this._add("scrollZoom",tt,["mousePan"]),o.interactive&&o.scrollZoom&&h.scrollZoom.enable(o.scrollZoom);const mt=h.keyboard=new Td(h);this._add("keyboard",mt),o.interactive&&o.keyboard&&h.keyboard.enable(),this._add("blockableMapEvent",new ls(h))}_add(o,h,d){this._handlers.push({handlerName:o,handler:h,allowed:d}),this._handlersById[o]=h}stop(o){if(!this._updatingCamera){for(const{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},o),this._changes=[]}}isActive(){for(const{handler:o}of this._handlers)if(o.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ee(this._eventsInProgress)||this.isZooming()}_blockedByActive(o,h,d){for(const g in o)if(g!==d&&(!h||h.indexOf(g)<0))return!0;return!1}_getMapTouches(o){const h=[];for(const d of o)this._el.contains(d.target)&&h.push(d);return h}mergeHandlerResult(o,h,d,g,y){if(!d)return;u.e(o,d);const I={handlerName:g,originalEvent:d.originalEvent||y};d.zoomDelta!==void 0&&(h.zoom=I),d.panDelta!==void 0&&(h.drag=I),d.pitchDelta!==void 0&&(h.pitch=I),d.bearingDelta!==void 0&&(h.rotate=I)}_applyChanges(){const o={},h={},d={};for(const[g,y,I]of this._changes)g.panDelta&&(o.panDelta=(o.panDelta||new u.P(0,0))._add(g.panDelta)),g.zoomDelta&&(o.zoomDelta=(o.zoomDelta||0)+g.zoomDelta),g.bearingDelta&&(o.bearingDelta=(o.bearingDelta||0)+g.bearingDelta),g.pitchDelta&&(o.pitchDelta=(o.pitchDelta||0)+g.pitchDelta),g.around!==void 0&&(o.around=g.around),g.pinchAround!==void 0&&(o.pinchAround=g.pinchAround),g.noInertia&&(o.noInertia=g.noInertia),u.e(h,y),u.e(d,I);this._updateMapTransform(o,h,d),this._changes=[]}_updateMapTransform(o,h,d){const g=this._map,y=g._getTransformForUpdate(),I=g.terrain;if(!(Zl(o)||I&&this._terrainMovement))return this._fireEvents(h,d,!0);let{panDelta:T,zoomDelta:M,bearingDelta:k,pitchDelta:N,around:z,pinchAround:Z}=o;Z!==void 0&&(z=Z),g._stop(!0),z=z||g.transform.centerPoint;const nt=y.pointLocation(T?z.sub(T):z);k&&(y.bearing+=k),N&&(y.pitch+=N),M&&(y.zoom+=M),I?this._terrainMovement||!h.drag&&!h.zoom?h.drag&&this._terrainMovement?y.center=y.pointLocation(y.centerPoint.sub(T)):y.setLocationAtPoint(nt,z):(this._terrainMovement=!0,this._map._elevationFreeze=!0,y.setLocationAtPoint(nt,z),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,y.recalculateZoom(g.terrain)})):y.setLocationAtPoint(nt,z),g._applyUpdatedTransform(y),this._map._update(),o.noInertia||this._inertia.record(o),this._fireEvents(h,d,!0)}_fireEvents(o,h,d){const g=Ee(this._eventsInProgress),y=Ee(o),I={};for(const N in o){const{originalEvent:z}=o[N];this._eventsInProgress[N]||(I[`${N}start`]=z),this._eventsInProgress[N]=o[N]}!g&&y&&this._fireEvent("movestart",y.originalEvent);for(const N in I)this._fireEvent(N,I[N]);y&&this._fireEvent("move",y.originalEvent);for(const N in o){const{originalEvent:z}=o[N];this._fireEvent(N,z)}const T={};let M;for(const N in this._eventsInProgress){const{handlerName:z,originalEvent:Z}=this._eventsInProgress[N];this._handlersById[z].isActive()||(delete this._eventsInProgress[N],M=h[z]||Z,T[`${N}end`]=M)}for(const N in T)this._fireEvent(N,T[N]);const k=Ee(this._eventsInProgress);if(d&&(g||y)&&!k){this._updatingCamera=!0;const N=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),z=Z=>Z!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Oe("renderFrame",{timeStamp:o})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Cp extends u.E{constructor(o,h){super(),this._renderFrameCallback=()=>{const d=Math.min((L.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(d)),d<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=o,this._bearingSnap=h.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new u.M(this.transform.center.lng,this.transform.center.lat)}setCenter(o,h){return this.jumpTo({center:o},h)}panBy(o,h,d){return o=u.P.convert(o).mult(-1),this.panTo(this.transform.center,u.e({offset:o},h),d)}panTo(o,h,d){return this.easeTo(u.e({center:o},h),d)}getZoom(){return this.transform.zoom}setZoom(o,h){return this.jumpTo({zoom:o},h),this}zoomTo(o,h,d){return this.easeTo(u.e({zoom:o},h),d)}zoomIn(o,h){return this.zoomTo(this.getZoom()+1,o,h),this}zoomOut(o,h){return this.zoomTo(this.getZoom()-1,o,h),this}getBearing(){return this.transform.bearing}setBearing(o,h){return this.jumpTo({bearing:o},h),this}getPadding(){return this.transform.padding}setPadding(o,h){return this.jumpTo({padding:o},h),this}rotateTo(o,h,d){return this.easeTo(u.e({bearing:o},h),d)}resetNorth(o,h){return this.rotateTo(0,u.e({duration:1e3},o),h),this}resetNorthPitch(o,h){return this.easeTo(u.e({bearing:0,pitch:0,duration:1e3},o),h),this}snapToNorth(o,h){return Math.abs(this.getBearing()){if(this._zooming&&(d.zoom=u.z.number(g,M,Mt)),this._rotating&&(d.bearing=u.z.number(y,k,Mt)),this._pitching&&(d.pitch=u.z.number(I,N,Mt)),this._padding&&(d.interpolatePadding(T,z,Mt),nt=d.centerPoint.add(Z)),this.terrain&&!o.freezeElevation&&this._updateElevation(Mt),lt)d.setLocationAtPoint(lt,bt);else{const Zt=d.zoomScale(d.zoom-g),Jt=M>g?Math.min(2,Ct):Math.max(.5,Ct),Ht=Math.pow(Jt,1-Mt),te=d.unproject(tt.add(mt.mult(Mt*Ht)).mult(Zt));d.setLocationAtPoint(d.renderWorldCopies?te.wrap():te,nt)}this._applyUpdatedTransform(d),this._fireMoveEvents(h)},Mt=>{this.terrain&&this._finalizeElevation(),this._afterEase(h,Mt)},o),this}_prepareEase(o,h,d={}){this._moving=!0,h||d.moving||this.fire(new u.k("movestart",o)),this._zooming&&!d.zooming&&this.fire(new u.k("zoomstart",o)),this._rotating&&!d.rotating&&this.fire(new u.k("rotatestart",o)),this._pitching&&!d.pitching&&this.fire(new u.k("pitchstart",o))}_prepareElevation(o){this._elevationCenter=o,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(o,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(o){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const h=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(o<1&&h!==this._elevationTarget){const d=this._elevationTarget-this._elevationStart;this._elevationStart+=o*(d-(h-(d*o+this._elevationStart))/(1-o)),this._elevationTarget=h}this.transform.elevation=u.z.number(this._elevationStart,this._elevationTarget,o)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(o){if(!this.transformCameraUpdate)return;const h=o.clone(),{center:d,zoom:g,pitch:y,bearing:I,elevation:T}=this.transformCameraUpdate(h);d&&(h.center=d),g!==void 0&&(h.zoom=g),y!==void 0&&(h.pitch=y),I!==void 0&&(h.bearing=I),T!==void 0&&(h.elevation=T),this.transform.apply(h)}_fireMoveEvents(o){this.fire(new u.k("move",o)),this._zooming&&this.fire(new u.k("zoom",o)),this._rotating&&this.fire(new u.k("rotate",o)),this._pitching&&this.fire(new u.k("pitch",o))}_afterEase(o,h){if(this._easeId&&h&&this._easeId===h)return;delete this._easeId;const d=this._zooming,g=this._rotating,y=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,d&&this.fire(new u.k("zoomend",o)),g&&this.fire(new u.k("rotateend",o)),y&&this.fire(new u.k("pitchend",o)),this.fire(new u.k("moveend",o))}flyTo(o,h){if(!o.essential&&L.prefersReducedMotion){const xe=u.L(o,["center","zoom","bearing","pitch","around"]);return this.jumpTo(xe,h)}this.stop(),o=u.e({offset:[0,0],speed:1.2,curve:1.42,easing:u.b6},o);const d=this._getTransformForUpdate(),g=this.getZoom(),y=this.getBearing(),I=this.getPitch(),T=this.getPadding(),M="zoom"in o?u.ac(+o.zoom,d.minZoom,d.maxZoom):g,k="bearing"in o?this._normalizeBearing(o.bearing,y):y,N="pitch"in o?+o.pitch:I,z="padding"in o?o.padding:d.padding,Z=d.zoomScale(M-g),nt=u.P.convert(o.offset);let it=d.centerPoint.add(nt);const st=d.pointLocation(it),tt=u.M.convert(o.center||st);this._normalizeCenter(tt);const mt=d.project(st),Ct=d.project(tt).sub(mt);let lt=o.curve;const bt=Math.max(d.width,d.height),kt=bt/Z,Mt=Ct.mag();if("minZoom"in o){const xe=u.ac(Math.min(o.minZoom,g,M),d.minZoom,d.maxZoom),Xn=bt/d.zoomScale(xe-g);lt=Math.sqrt(Xn/Mt*2)}const Zt=lt*lt;function Jt(xe){const Xn=(kt*kt-bt*bt+(xe?-1:1)*Zt*Zt*Mt*Mt)/(2*(xe?kt:bt)*Zt*Mt);return Math.log(Math.sqrt(Xn*Xn+1)-Xn)}function Ht(xe){return(Math.exp(xe)-Math.exp(-xe))/2}function te(xe){return(Math.exp(xe)+Math.exp(-xe))/2}const ye=Jt(!1);let ze=function(xe){return te(ye)/te(ye+lt*xe)},ce=function(xe){return bt*((te(ye)*(Ht(Xn=ye+lt*xe)/te(Xn))-Ht(ye))/Zt)/Mt;var Xn},Ae=(Jt(!0)-ye)/lt;if(Math.abs(Mt)<1e-6||!isFinite(Ae)){if(Math.abs(bt-kt)<1e-6)return this.easeTo(o,h);const xe=kto.maxDuration&&(o.duration=0),this._zooming=!0,this._rotating=y!==k,this._pitching=N!==I,this._padding=!d.isPaddingEqual(z),this._prepareEase(h,!1),this.terrain&&this._prepareElevation(tt),this._ease(xe=>{const Xn=xe*Ae,ln=1/ze(Xn);d.zoom=xe===1?M:g+d.scaleZoom(ln),this._rotating&&(d.bearing=u.z.number(y,k,xe)),this._pitching&&(d.pitch=u.z.number(I,N,xe)),this._padding&&(d.interpolatePadding(T,z,xe),it=d.centerPoint.add(nt)),this.terrain&&!o.freezeElevation&&this._updateElevation(xe);const tn=xe===1?tt:d.unproject(mt.add(Ct.mult(ce(Xn))).mult(ln));d.setLocationAtPoint(d.renderWorldCopies?tn.wrap():tn,it),this._applyUpdatedTransform(d),this._fireMoveEvents(h)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(h)},o),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(o,h){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const d=this._onEaseEnd;delete this._onEaseEnd,d.call(this,h)}if(!o){const d=this.handlers;d&&d.stop(!1)}return this}_ease(o,h,d){d.animate===!1||d.duration===0?(o(1),h()):(this._easeStart=L.now(),this._easeOptions=d,this._onEaseFrame=o,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(o,h){o=u.b0(o,-180,180);const d=Math.abs(o-h);return Math.abs(o-360-h)180?-360:d<-180?360:0}queryTerrainElevation(o){return this.terrain?this.terrain.getElevationForLngLatZoom(u.M.convert(o),this.transform.tileZoom)-this.transform.elevation:null}}const Zr={compact:!0,customAttribution:'MapLibre'};class Tp{constructor(o=Zr){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=h=>{!h||h.sourceDataType!=="metadata"&&h.sourceDataType!=="visibility"&&h.dataType!=="style"&&h.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=o}getDefaultPosition(){return"bottom-right"}onAdd(o){return this._map=o,this._compact=this.options.compact,this._container=A.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=A.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=A.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){A.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(o,h){const d=this._map._getUIString(`AttributionControl.${h}`);o.title=d,o.setAttribute("aria-label",d)}_updateAttributions(){if(!this._map.style)return;let o=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?o=o.concat(this.options.customAttribution.map(g=>typeof g!="string"?"":g)):typeof this.options.customAttribution=="string"&&o.push(this.options.customAttribution)),this._map.style.stylesheet){const g=this._map.style.stylesheet;this.styleOwner=g.owner,this.styleId=g.id}const h=this._map.style.sourceCaches;for(const g in h){const y=h[g];if(y.used||y.usedForTerrain){const I=y.getSource();I.attribution&&o.indexOf(I.attribution)<0&&o.push(I.attribution)}}o=o.filter(g=>String(g).trim()),o.sort((g,y)=>g.length-y.length),o=o.filter((g,y)=>{for(let I=y+1;I=0)return!1;return!0});const d=o.join(" | ");d!==this._attribHTML&&(this._attribHTML=d,o.length?(this._innerContainer.innerHTML=d,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class cs{constructor(o={}){this._updateCompact=()=>{const h=this._container.children;if(h.length){const d=h[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&d.classList.add("maplibregl-compact"):d.classList.remove("maplibregl-compact")}},this.options=o}getDefaultPosition(){return"bottom-left"}onAdd(o){this._map=o,this._compact=this.options&&this.options.compact,this._container=A.create("div","maplibregl-ctrl");const h=A.create("a","maplibregl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://maplibre.org/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){A.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class gg{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(o){const h=++this._id;return this._queue.push({callback:o,id:h,cancelled:!1}),h}remove(o){const h=this._currentlyRunning,d=h?this._queue.concat(h):this._queue;for(const g of d)if(g.id===o)return void(g.cancelled=!0)}run(o=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const h=this._currentlyRunning=this._queue;this._queue=[];for(const d of h)if(!d.cancelled&&(d.callback(o),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Vu=u.X([{name:"a_pos3d",type:"Int16",components:3}]);class pi extends u.E{constructor(o){super(),this.sourceCache=o,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,o.usedForTerrain=!0,o.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(o,h){this.sourceCache.update(o,h),this._renderableTilesKeys=[];const d={};for(const g of o.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))d[g.key]=!0,this._renderableTilesKeys.push(g.key),this._tiles[g.key]||(g.posMatrix=new Float64Array(16),u.aN(g.posMatrix,0,u.W,0,u.W,0,1),this._tiles[g.key]=new qo(g,this.tileSize));for(const g in this._tiles)d[g]||delete this._tiles[g]}freeRtt(o){for(const h in this._tiles){const d=this._tiles[h];(!o||d.tileID.equals(o)||d.tileID.isChildOf(o)||o.isChildOf(d.tileID))&&(d.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(o=>this.getTileByID(o))}getTileByID(o){return this._tiles[o]}getTerrainCoords(o){const h={};for(const d of this._renderableTilesKeys){const g=this._tiles[d].tileID;if(g.canonical.equals(o.canonical)){const y=o.clone();y.posMatrix=new Float64Array(16),u.aN(y.posMatrix,0,u.W,0,u.W,0,1),h[d]=y}else if(g.canonical.isChildOf(o.canonical)){const y=o.clone();y.posMatrix=new Float64Array(16);const I=g.canonical.z-o.canonical.z,T=g.canonical.x-(g.canonical.x>>I<>I<>I;u.aN(y.posMatrix,0,k,0,k,0,1),u.H(y.posMatrix,y.posMatrix,[-T*k,-M*k,0]),h[d]=y}else if(o.canonical.isChildOf(g.canonical)){const y=o.clone();y.posMatrix=new Float64Array(16);const I=o.canonical.z-g.canonical.z,T=o.canonical.x-(o.canonical.x>>I<>I<>I;u.aN(y.posMatrix,0,u.W,0,u.W,0,1),u.H(y.posMatrix,y.posMatrix,[T*k,M*k,0]),u.J(y.posMatrix,y.posMatrix,[1/2**I,1/2**I,0]),h[d]=y}}return h}getSourceTile(o,h){const d=this.sourceCache._source;let g=o.overscaledZ-this.deltaZoom;if(g>d.maxzoom&&(g=d.maxzoom),g=d.minzoom&&(!y||!y.dem);)y=this.sourceCache.getTileByID(o.scaledTo(g--).key);return y}tilesAfterTime(o=Date.now()){return Object.values(this._tiles).filter(h=>h.timeAdded>=o)}}class Li{constructor(o,h,d){this.painter=o,this.sourceCache=new pi(h),this.options=d,this.exaggeration=typeof d.exaggeration=="number"?d.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(o,h,d,g=u.W){var y;if(!(h>=0&&h=0&&do.canonical.z&&(o.canonical.z>=g?y=o.canonical.z-g:u.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const I=o.canonical.x-(o.canonical.x>>y<>y<>8<<4|y>>8,h[I+3]=0;const d=new u.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),g=new wt(o,d,o.gl.RGBA,{premultiply:!1});return g.bind(o.gl.NEAREST,o.gl.CLAMP_TO_EDGE),this._coordsTexture=g,g}pointCoordinate(o){const h=new Uint8Array(4),d=this.painter.context,g=d.gl;d.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),g.readPixels(o.x,this.painter.height/devicePixelRatio-o.y-1,1,1,g.RGBA,g.UNSIGNED_BYTE,h),d.bindFramebuffer.set(null);const y=h[0]+(h[2]>>4<<8),I=h[1]+((15&h[2])<<8),T=this.coordsIndex[255-h[3]],M=T&&this.sourceCache.getTileByID(T);if(!M)return null;const k=this._coordsTextureSize,N=(1<o.id!==h),this._recentlyUsed.push(o.id)}stampObject(o){o.stamp=++this._stamp}getOrCreateFreeObject(){for(const h of this._recentlyUsed)if(!this._objects[h].inUse)return this._objects[h];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const o=this._createObject(this._objects.length);return this._objects.push(o),o}freeObject(o){o.inUse=!1}freeAllObjects(){for(const o of this._objects)this.freeObject(o)}isFull(){return!(this._objects.length!o.inUse)===!1}}const Ps={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Kc{constructor(o,h){this.painter=o,this.terrain=h,this.pool=new Ad(o.context,30,h.sourceCache.tileSize*h.qualityFactor)}destruct(){this.pool.destruct()}getTexture(o){return this.pool.getObjectForId(o.rtt[this._stacks.length-1].id).texture}prepareForRender(o,h){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=o._order.filter(d=>!o._layers[d].isHidden(h)),this._coordsDescendingInv={};for(const d in o.sourceCaches){this._coordsDescendingInv[d]={};const g=o.sourceCaches[d].getVisibleCoordinates();for(const y of g){const I=this.terrain.sourceCache.getTerrainCoords(y);for(const T in I)this._coordsDescendingInv[d][T]||(this._coordsDescendingInv[d][T]=[]),this._coordsDescendingInv[d][T].push(I[T])}}this._coordsDescendingInvStr={};for(const d of o._order){const g=o._layers[d],y=g.source;if(Ps[g.type]&&!this._coordsDescendingInvStr[y]){this._coordsDescendingInvStr[y]={};for(const I in this._coordsDescendingInv[y])this._coordsDescendingInvStr[y][I]=this._coordsDescendingInv[y][I].map(T=>T.key).sort().join()}}for(const d of this._renderableTiles)for(const g in this._coordsDescendingInvStr){const y=this._coordsDescendingInvStr[g][d.tileID.key];y&&y!==d.rttCoords[g]&&(d.rtt=[])}}renderLayer(o){if(o.isHidden(this.painter.transform.zoom))return!1;const h=o.type,d=this.painter,g=this._renderableLayerIds[this._renderableLayerIds.length-1]===o.id;if(Ps[h]&&(this._prevType&&Ps[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(o.id),!g))return!0;if(Ps[this._prevType]||Ps[h]&&g){this._prevType=h;const y=this._stacks.length-1,I=this._stacks[y]||[];for(const T of this._renderableTiles){if(this.pool.isFull()&&(qc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(T),T.rtt[y]){const k=this.pool.getObjectForId(T.rtt[y].id);if(k.stamp===T.rtt[y].stamp){this.pool.useObject(k);continue}}const M=this.pool.getOrCreateFreeObject();this.pool.useObject(M),this.pool.stampObject(M),T.rtt[y]={id:M.id,stamp:M.stamp},d.context.bindFramebuffer.set(M.fbo.framebuffer),d.context.clear({color:u.aO.transparent,stencil:0}),d.currentStencilSource=void 0;for(let k=0;k{_.touchstart=_.dragStart,_.touchmoveWindow=_.dragMove,_.touchend=_.dragEnd},Ap={showCompass:!0,showZoom:!0,visualizePitch:!1};class kp{constructor(o,h,d=!1){this.mousedown=I=>{this.startMouse(u.e({},I,{ctrlKey:!0,preventDefault:()=>I.preventDefault()}),A.mousePos(this.element,I)),A.addEventListener(window,"mousemove",this.mousemove),A.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=I=>{this.moveMouse(I,A.mousePos(this.element,I))},this.mouseup=I=>{this.mouseRotate.dragEnd(I),this.mousePitch&&this.mousePitch.dragEnd(I),this.offTemp()},this.touchstart=I=>{I.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=A.touchPos(this.element,I.targetTouches)[0],this.startTouch(I,this._startPos),A.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),A.addEventListener(window,"touchend",this.touchend))},this.touchmove=I=>{I.targetTouches.length!==1?this.reset():(this._lastPos=A.touchPos(this.element,I.targetTouches)[0],this.moveTouch(I,this._lastPos))},this.touchend=I=>{I.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const g=o.dragRotate._mouseRotate.getClickTolerance(),y=o.dragRotate._mousePitch.getClickTolerance();this.element=h,this.mouseRotate=wp({clickTolerance:g,enable:!0}),this.touchRotate=(({enable:I,clickTolerance:T,bearingDegreesPerPixelMoved:M=.8})=>{const k=new na;return new zu({clickTolerance:T,move:(N,z)=>({bearingDelta:(z.x-N.x)*M}),moveStateManager:k,enable:I,assignEvents:Wl})})({clickTolerance:g,enable:!0}),this.map=o,d&&(this.mousePitch=jl({clickTolerance:y,enable:!0}),this.touchPitch=(({enable:I,clickTolerance:T,pitchDegreesPerPixelMoved:M=-.5})=>{const k=new na;return new zu({clickTolerance:T,move:(N,z)=>({pitchDelta:(z.y-N.y)*M}),moveStateManager:k,enable:I,assignEvents:Wl})})({clickTolerance:y,enable:!0})),A.addEventListener(h,"mousedown",this.mousedown),A.addEventListener(h,"touchstart",this.touchstart,{passive:!1}),A.addEventListener(h,"touchcancel",this.reset)}startMouse(o,h){this.mouseRotate.dragStart(o,h),this.mousePitch&&this.mousePitch.dragStart(o,h),A.disableDrag()}startTouch(o,h){this.touchRotate.dragStart(o,h),this.touchPitch&&this.touchPitch.dragStart(o,h),A.disableDrag()}moveMouse(o,h){const d=this.map,{bearingDelta:g}=this.mouseRotate.dragMove(o,h)||{};if(g&&d.setBearing(d.getBearing()+g),this.mousePitch){const{pitchDelta:y}=this.mousePitch.dragMove(o,h)||{};y&&d.setPitch(d.getPitch()+y)}}moveTouch(o,h){const d=this.map,{bearingDelta:g}=this.touchRotate.dragMove(o,h)||{};if(g&&d.setBearing(d.getBearing()+g),this.touchPitch){const{pitchDelta:y}=this.touchPitch.dragMove(o,h)||{};y&&d.setPitch(d.getPitch()+y)}}off(){const o=this.element;A.removeEventListener(o,"mousedown",this.mousedown),A.removeEventListener(o,"touchstart",this.touchstart,{passive:!1}),A.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),A.removeEventListener(window,"touchend",this.touchend),A.removeEventListener(o,"touchcancel",this.reset),this.offTemp()}offTemp(){A.enableDrag(),A.removeEventListener(window,"mousemove",this.mousemove),A.removeEventListener(window,"mouseup",this.mouseup),A.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),A.removeEventListener(window,"touchend",this.touchend)}}let ia;function Jc(_,o,h){if(_=new u.M(_.lng,_.lat),o){const d=new u.M(_.lng-360,_.lat),g=new u.M(_.lng+360,_.lat),y=h.locationPoint(_).distSqr(o);h.locationPoint(d).distSqr(o)180;){const d=h.locationPoint(_);if(d.x>=0&&d.y>=0&&d.x<=h.width&&d.y<=h.height)break;_.lng>h.center.lng?_.lng-=360:_.lng+=360}return _}const Uu={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%)"};function Qc(_,o,h){const d=_.classList;for(const g in Uu)d.remove(`maplibregl-${h}-anchor-${g}`);d.add(`maplibregl-${h}-anchor-${o}`)}class Gu extends u.E{constructor(o){if(super(),this._onKeyPress=h=>{const d=h.code,g=h.charCode||h.keyCode;d!=="Space"&&d!=="Enter"&&g!==32&&g!==13||this.togglePopup()},this._onMapClick=h=>{const d=h.originalEvent.target,g=this._element;this._popup&&(d===g||g.contains(d))&&this.togglePopup()},this._update=h=>{if(!this._map)return;const d=this._map.loaded()&&!this._map.isMoving();((h==null?void 0:h.type)==="terrain"||(h==null?void 0:h.type)==="render"&&!d)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=Jc(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let g="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?g=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(g=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let y="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?y="rotateX(0deg)":this._pitchAlignment==="map"&&(y=`rotateX(${this._map.getPitch()}deg)`),h&&h.type!=="moveend"||(this._pos=this._pos.round()),A.setTransform(this._element,`${Uu[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${y} ${g}`),L.frameAsync(new AbortController).then(()=>{this._updateOpacity(h&&h.type==="moveend")}).catch(()=>{})},this._onMove=h=>{if(!this._isDragging){const d=this._clickTolerance||this._map._clickTolerance;this._isDragging=h.point.dist(this._pointerdownPos)>=d}this._isDragging&&(this._pos=h.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new u.k("dragstart"))),this.fire(new u.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new u.k("dragend")),this._state="inactive"},this._addDragHandler=h=>{this._element.contains(h.originalEvent.target)&&(h.preventDefault(),this._positionDelta=h.point.sub(this._pos).add(this._offset),this._pointerdownPos=h.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=o&&o.anchor||"center",this._color=o&&o.color||"#3FB1CE",this._scale=o&&o.scale||1,this._draggable=o&&o.draggable||!1,this._clickTolerance=o&&o.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=o&&o.rotation||0,this._rotationAlignment=o&&o.rotationAlignment||"auto",this._pitchAlignment=o&&o.pitchAlignment&&o.pitchAlignment!=="auto"?o.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(o==null?void 0:o.opacity,o==null?void 0:o.opacityWhenCovered),o&&o.element)this._element=o.element,this._offset=u.P.convert(o&&o.offset||[0,0]);else{this._defaultMarker=!0,this._element=A.create("div"),this._element.setAttribute("aria-label","Map marker");const h=A.createNS("http://www.w3.org/2000/svg","svg"),d=41,g=27;h.setAttributeNS(null,"display","block"),h.setAttributeNS(null,"height",`${d}px`),h.setAttributeNS(null,"width",`${g}px`),h.setAttributeNS(null,"viewBox",`0 0 ${g} ${d}`);const y=A.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"stroke","none"),y.setAttributeNS(null,"stroke-width","1"),y.setAttributeNS(null,"fill","none"),y.setAttributeNS(null,"fill-rule","evenodd");const I=A.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"fill-rule","nonzero");const T=A.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"transform","translate(3.0, 29.0)"),T.setAttributeNS(null,"fill","#000000");const M=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const mt of M){const Ct=A.createNS("http://www.w3.org/2000/svg","ellipse");Ct.setAttributeNS(null,"opacity","0.04"),Ct.setAttributeNS(null,"cx","10.5"),Ct.setAttributeNS(null,"cy","5.80029008"),Ct.setAttributeNS(null,"rx",mt.rx),Ct.setAttributeNS(null,"ry",mt.ry),T.appendChild(Ct)}const k=A.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"fill",this._color);const N=A.createNS("http://www.w3.org/2000/svg","path");N.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),k.appendChild(N);const z=A.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"opacity","0.25"),z.setAttributeNS(null,"fill","#000000");const Z=A.createNS("http://www.w3.org/2000/svg","path");Z.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),z.appendChild(Z);const nt=A.createNS("http://www.w3.org/2000/svg","g");nt.setAttributeNS(null,"transform","translate(6.0, 7.0)"),nt.setAttributeNS(null,"fill","#FFFFFF");const it=A.createNS("http://www.w3.org/2000/svg","g");it.setAttributeNS(null,"transform","translate(8.0, 8.0)");const st=A.createNS("http://www.w3.org/2000/svg","circle");st.setAttributeNS(null,"fill","#000000"),st.setAttributeNS(null,"opacity","0.25"),st.setAttributeNS(null,"cx","5.5"),st.setAttributeNS(null,"cy","5.5"),st.setAttributeNS(null,"r","5.4999962");const tt=A.createNS("http://www.w3.org/2000/svg","circle");tt.setAttributeNS(null,"fill","#FFFFFF"),tt.setAttributeNS(null,"cx","5.5"),tt.setAttributeNS(null,"cy","5.5"),tt.setAttributeNS(null,"r","5.4999962"),it.appendChild(st),it.appendChild(tt),I.appendChild(T),I.appendChild(k),I.appendChild(z),I.appendChild(nt),I.appendChild(it),h.appendChild(I),h.setAttributeNS(null,"height",d*this._scale+"px"),h.setAttributeNS(null,"width",g*this._scale+"px"),this._element.appendChild(h),this._offset=u.P.convert(o&&o.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",h=>{h.preventDefault()}),this._element.addEventListener("mousedown",h=>{h.preventDefault()}),Qc(this._element,this._anchor,"marker"),o&&o.className)for(const h of o.className.split(" "))this._element.classList.add(h);this._popup=null}addTo(o){return this.remove(),this._map=o,o.getCanvasContainer().appendChild(this._element),o.on("move",this._update),o.on("moveend",this._update),o.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),A.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=u.M.convert(o),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(o){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),o){if(!("offset"in o.options)){const g=Math.abs(13.5)/Math.SQRT2;o.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[g,-1*(38.1-13.5+g)],"bottom-right":[-g,-1*(38.1-13.5+g)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=o,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const o=this._popup;return o?(o.isOpen()?o.remove():o.addTo(this._map),this):this}_updateOpacity(o=!1){var h;if(!(!((h=this._map)===null||h===void 0)&&h.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(o)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const d=this._map,g=d.terrain.depthAtPoint(this._pos),y=d.terrain.getElevationForLngLatZoom(this._lngLat,d.transform.tileZoom);if(d.transform.lngLatToCameraDepth(this._lngLat,y)-g<.006)return void(this._element.style.opacity=this._opacity);const I=-this._offset.y/d.transform._pixelPerMeter,T=Math.sin(d.getPitch()*Math.PI/180)*I,M=d.terrain.depthAtPoint(new u.P(this._pos.x,this._pos.y-this._offset.y)),k=d.transform.lngLatToCameraDepth(this._lngLat,y+T);this._element.style.opacity=k-M>.006?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(o){return this._offset=u.P.convert(o),this._update(),this}addClassName(o){this._element.classList.add(o)}removeClassName(o){this._element.classList.remove(o)}toggleClassName(o){return this._element.classList.toggle(o)}setDraggable(o){return this._draggable=!!o,this._map&&(o?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(o){return this._rotation=o||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(o){return this._rotationAlignment=o||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(o){return this._pitchAlignment=o&&o!=="auto"?o:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(o,h){return o===void 0&&h===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),o!==void 0&&(this._opacity=o),h!==void 0&&(this._opacityWhenCovered=h),this._map&&this._updateOpacity(!0),this}}const Dp={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let cl=0,hl=!1;const Rp={maxWidth:100,unit:"metric"};function qu(_,o,h){const d=h&&h.maxWidth||100,g=_._container.clientHeight/2,y=_.unproject([0,g]),I=_.unproject([d,g]),T=y.distanceTo(I);if(h&&h.unit==="imperial"){const M=3.2808*T;M>5280?pl(o,d,M/5280,_._getUIString("ScaleControl.Miles")):pl(o,d,M,_._getUIString("ScaleControl.Feet"))}else h&&h.unit==="nautical"?pl(o,d,T/1852,_._getUIString("ScaleControl.NauticalMiles")):T>=1e3?pl(o,d,T/1e3,_._getUIString("ScaleControl.Kilometers")):pl(o,d,T,_._getUIString("ScaleControl.Meters"))}function pl(_,o,h,d){const g=function(y){const I=Math.pow(10,`${Math.floor(y)}`.length-1);let T=y/I;return T=T>=10?10:T>=5?5:T>=3?3:T>=2?2:T>=1?1:function(M){const k=Math.pow(10,Math.ceil(-Math.log(M)/Math.LN10));return Math.round(M*k)/k}(T),I*T}(h);_.style.width=o*(g/h)+"px",_.innerHTML=`${g} ${d}`}const Np={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},zp=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function $c(_){if(_){if(typeof _=="number"){const o=Math.round(Math.abs(_)/Math.SQRT2);return{center:new u.P(0,0),top:new u.P(0,_),"top-left":new u.P(o,o),"top-right":new u.P(-o,o),bottom:new u.P(0,-_),"bottom-left":new u.P(o,-o),"bottom-right":new u.P(-o,-o),left:new u.P(_,0),right:new u.P(-_,0)}}if(_ instanceof u.P||Array.isArray(_)){const o=u.P.convert(_);return{center:o,top:o,"top-left":o,"top-right":o,bottom:o,"bottom-left":o,"bottom-right":o,left:o,right:o}}return{center:u.P.convert(_.center||[0,0]),top:u.P.convert(_.top||[0,0]),"top-left":u.P.convert(_["top-left"]||[0,0]),"top-right":u.P.convert(_["top-right"]||[0,0]),bottom:u.P.convert(_.bottom||[0,0]),"bottom-left":u.P.convert(_["bottom-left"]||[0,0]),"bottom-right":u.P.convert(_["bottom-right"]||[0,0]),left:u.P.convert(_.left||[0,0]),right:u.P.convert(_.right||[0,0])}}return $c(new u.P(0,0))}const Op=x;p.AJAXError=u.bd,p.Evented=u.E,p.LngLat=u.M,p.MercatorCoordinate=u.Y,p.Point=u.P,p.addProtocol=u.be,p.config=u.a,p.removeProtocol=u.bf,p.AttributionControl=Tp,p.BoxZoomHandler=xp,p.CanvasSource=Ts,p.CooperativeGesturesHandler=Bu,p.DoubleClickZoomHandler=Yc,p.DragPanHandler=Ep,p.DragRotateHandler=Pd,p.EdgeInsets=Gl,p.FullscreenControl=class extends u.E{constructor(_={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,_&&_.container&&(_.container instanceof HTMLElement?this._container=_.container:u.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(_){return this._map=_,this._container||(this._container=this._map.getContainer()),this._controlContainer=A.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){A.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const _=this._fullscreenButton=A.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);A.create("span","maplibregl-ctrl-icon",_).setAttribute("aria-hidden","true"),_.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const _=this._getTitle();this._fullscreenButton.setAttribute("aria-label",_),this._fullscreenButton.title=_}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new u.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new u.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},p.GeoJSONSource=nn,p.GeolocateControl=class extends u.E{constructor(_){super(),this._onSuccess=o=>{if(this._map){if(this._isOutOfMapMaxBounds(o))return this._setErrorState(),this.fire(new u.k("outofmaxbounds",o)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=o,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(o),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(o),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new u.k("geolocate",o)),this._finish()}},this._updateCamera=o=>{const h=new u.M(o.coords.longitude,o.coords.latitude),d=o.coords.accuracy,g=this._map.getBearing(),y=u.e({bearing:g},this.options.fitBoundsOptions),I=be.fromLngLat(h,d);this._map.fitBounds(I,y,{geolocateSource:!0})},this._updateMarker=o=>{if(o){const h=new u.M(o.coords.longitude,o.coords.latitude);this._accuracyCircleMarker.setLngLat(h).addTo(this._map),this._userLocationDotMarker.setLngLat(h).addTo(this._map),this._accuracy=o.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=o=>{if(this._map){if(this.options.trackUserLocation)if(o.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const h=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(o.code===3&&hl)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new u.k("error",o)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=o=>{if(this._map){if(this._container.addEventListener("contextmenu",h=>h.preventDefault()),this._geolocateButton=A.create("button","maplibregl-ctrl-geolocate",this._container),A.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",o===!1){u.w("Geolocation support is not available so the GeolocateControl will be disabled.");const h=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h)}else{const h=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=A.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Gu({element:this._dotElement}),this._circleElement=A.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Gu({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",h=>{h.geolocateSource||this._watchState!=="ACTIVE_LOCK"||h.originalEvent&&h.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new u.k("trackuserlocationend")))})}},this.options=u.e({},Dp,_)}onAdd(_){return this._map=_,this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(o=!1){return u._(this,void 0,void 0,function*(){if(ia!==void 0&&!o)return ia;if(window.navigator.permissions===void 0)return ia=!!window.navigator.geolocation,ia;try{ia=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{ia=!!window.navigator.geolocation}return ia})}().then(o=>this._setupUI(o)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),A.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,cl=0,hl=!1}_isOutOfMapMaxBounds(_){const o=this._map.getMaxBounds(),h=_.coords;return o&&(h.longitudeo.getEast()||h.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const _=this._map.getBounds(),o=_.getSouthEast(),h=_.getNorthEast(),d=o.distanceTo(h),g=Math.ceil(this._accuracy/(d/this._map._container.clientHeight)*2);this._circleElement.style.width=`${g}px`,this._circleElement.style.height=`${g}px`}trigger(){if(!this._setup)return u.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 u.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":cl--,hl=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new u.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new u.k("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let _;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),cl++,cl>1?(_={maximumAge:6e5,timeout:0},hl=!0):(_=this.options.positionOptions,hl=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,_)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},p.Hash=vp,p.ImageSource=_r,p.KeyboardHandler=Td,p.LngLatBounds=be,p.LogoControl=cs,p.Map=class extends Cp{constructor(_){if(u.bb.mark(u.bc.create),(_=u.e({},Pp,_)).minZoom!=null&&_.maxZoom!=null&&_.minZoom>_.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(_.minPitch!=null&&_.maxPitch!=null&&_.minPitch>_.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(_.minPitch!=null&&_.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(_.maxPitch!=null&&_.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new jc(_.minZoom,_.maxZoom,_.minPitch,_.maxPitch,_.renderWorldCopies),{bearingSnap:_.bearingSnap}),this._contextLost=o=>{o.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new u.k("webglcontextlost",{originalEvent:o}))},this._contextRestored=o=>{this._setupPainter(),this.resize(),this._update(),this.fire(new u.k("webglcontextrestored",{originalEvent:o}))},this._onMapScroll=o=>{if(o.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=_.interactive,this._maxTileCacheSize=_.maxTileCacheSize,this._maxTileCacheZoomLevels=_.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=_.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=_.preserveDrawingBuffer,this._antialias=_.antialias,this._trackResize=_.trackResize,this._bearingSnap=_.bearingSnap,this._refreshExpiredTiles=_.refreshExpiredTiles,this._fadeDuration=_.fadeDuration,this._crossSourceCollisions=_.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=_.collectResourceTiming,this._renderTaskQueue=new gg,this._controls=[],this._mapId=u.a3(),this._locale=u.e({},Lp,_.locale),this._clickTolerance=_.clickTolerance,this._overridePixelRatio=_.pixelRatio,this._maxCanvasSize=_.maxCanvasSize,this.transformCameraUpdate=_.transformCameraUpdate,this._imageQueueHandle=G.addThrottleControl(()=>this.isMoving()),this._requestManager=new at(_.transformRequest),typeof _.container=="string"){if(this._container=document.getElementById(_.container),!this._container)throw new Error(`Container '${_.container}' not found.`)}else{if(!(_.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=_.container}if(_.maxBounds&&this.setMaxBounds(_.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let o=!1;const h=yp(d=>{this._trackResize&&!this._removed&&this.resize(d)._update()},50);this._resizeObserver=new ResizeObserver(d=>{o?h(d):o=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Ip(this,_),this._hash=_.hash&&new vp(typeof _.hash=="string"&&_.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:_.center,zoom:_.zoom,bearing:_.bearing,pitch:_.pitch}),_.bounds&&(this.resize(),this.fitBounds(_.bounds,u.e({},_.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=_.localIdeographFontFamily,this._validateStyle=_.validateStyle,_.style&&this.setStyle(_.style,{localIdeographFontFamily:_.localIdeographFontFamily}),_.attributionControl&&this.addControl(new Tp(typeof _.attributionControl=="boolean"?void 0:_.attributionControl)),_.maplibreLogo&&this.addControl(new cs,_.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",o=>{this._update(o.dataType==="style"),this.fire(new u.k(`${o.dataType}data`,o))}),this.on("dataloading",o=>{this.fire(new u.k(`${o.dataType}dataloading`,o))}),this.on("dataabort",o=>{this.fire(new u.k("sourcedataabort",o))})}_getMapId(){return this._mapId}addControl(_,o){if(o===void 0&&(o=_.getDefaultPosition?_.getDefaultPosition():"top-right"),!_||!_.onAdd)return this.fire(new u.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const h=_.onAdd(this);this._controls.push(_);const d=this._controlPositions[o];return o.indexOf("bottom")!==-1?d.insertBefore(h,d.firstChild):d.appendChild(h),this}removeControl(_){if(!_||!_.onRemove)return this.fire(new u.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(_);return o>-1&&this._controls.splice(o,1),_.onRemove(this),this}hasControl(_){return this._controls.indexOf(_)>-1}calculateCameraOptionsFromTo(_,o,h,d){return d==null&&this.terrain&&(d=this.terrain.getElevationForLngLatZoom(h,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(_,o,h,d)}resize(_){var o;const h=this._containerDimensions(),d=h[0],g=h[1],y=this._getClampedPixelRatio(d,g);if(this._resizeCanvas(d,g,y),this.painter.resize(d,g,y),this.painter.overLimit()){const T=this.painter.context.gl;this._maxCanvasSize=[T.drawingBufferWidth,T.drawingBufferHeight];const M=this._getClampedPixelRatio(d,g);this._resizeCanvas(d,g,M),this.painter.resize(d,g,M)}this.transform.resize(d,g),(o=this._requestedCameraState)===null||o===void 0||o.resize(d,g);const I=!this._moving;return I&&(this.stop(),this.fire(new u.k("movestart",_)).fire(new u.k("move",_))),this.fire(new u.k("resize",_)),I&&this.fire(new u.k("moveend",_)),this}_getClampedPixelRatio(_,o){const{0:h,1:d}=this._maxCanvasSize,g=this.getPixelRatio(),y=_*g,I=o*g;return Math.min(y>h?h/y:1,I>d?d/I:1)*g}getPixelRatio(){var _;return(_=this._overridePixelRatio)!==null&&_!==void 0?_:devicePixelRatio}setPixelRatio(_){this._overridePixelRatio=_,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(_){return this.transform.setMaxBounds(be.convert(_)),this._update()}setMinZoom(_){if((_=_??-2)>=-2&&_<=this.transform.maxZoom)return this.transform.minZoom=_,this._update(),this.getZoom()<_&&this.setZoom(_),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(_){if((_=_??22)>=this.transform.minZoom)return this.transform.maxZoom=_,this._update(),this.getZoom()>_&&this.setZoom(_),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(_){if((_=_??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(_>=0&&_<=this.transform.maxPitch)return this.transform.minPitch=_,this._update(),this.getPitch()<_&&this.setPitch(_),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(_){if((_=_??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(_>=this.transform.minPitch)return this.transform.maxPitch=_,this._update(),this.getPitch()>_&&this.setPitch(_),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(_){return this.transform.renderWorldCopies=_,this._update()}project(_){return this.transform.locationPoint(u.M.convert(_),this.style&&this.terrain)}unproject(_){return this.transform.pointLocation(u.P.convert(_),this.terrain)}isMoving(){var _;return this._moving||((_=this.handlers)===null||_===void 0?void 0:_.isMoving())}isZooming(){var _;return this._zooming||((_=this.handlers)===null||_===void 0?void 0:_.isZooming())}isRotating(){var _;return this._rotating||((_=this.handlers)===null||_===void 0?void 0:_.isRotating())}_createDelegatedListener(_,o,h){if(_==="mouseenter"||_==="mouseover"){let d=!1;return{layer:o,listener:h,delegates:{mousemove:y=>{const I=this.getLayer(o)?this.queryRenderedFeatures(y.point,{layers:[o]}):[];I.length?d||(d=!0,h.call(this,new so(_,this,y.originalEvent,{features:I}))):d=!1},mouseout:()=>{d=!1}}}}if(_==="mouseleave"||_==="mouseout"){let d=!1;return{layer:o,listener:h,delegates:{mousemove:I=>{(this.getLayer(o)?this.queryRenderedFeatures(I.point,{layers:[o]}):[]).length?d=!0:d&&(d=!1,h.call(this,new so(_,this,I.originalEvent)))},mouseout:I=>{d&&(d=!1,h.call(this,new so(_,this,I.originalEvent)))}}}}{const d=g=>{const y=this.getLayer(o)?this.queryRenderedFeatures(g.point,{layers:[o]}):[];y.length&&(g.features=y,h.call(this,g),delete g.features)};return{layer:o,listener:h,delegates:{[_]:d}}}}on(_,o,h){if(h===void 0)return super.on(_,o);const d=this._createDelegatedListener(_,o,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[_]=this._delegatedListeners[_]||[],this._delegatedListeners[_].push(d);for(const g in d.delegates)this.on(g,d.delegates[g]);return this}once(_,o,h){if(h===void 0)return super.once(_,o);const d=this._createDelegatedListener(_,o,h);for(const g in d.delegates)this.once(g,d.delegates[g]);return this}off(_,o,h){return h===void 0?super.off(_,o):(this._delegatedListeners&&this._delegatedListeners[_]&&(d=>{const g=this._delegatedListeners[_];for(let y=0;ythis._updateStyle(_,o));const h=this.style&&o.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!_)),_?(this.style=new Eo(this,o||{}),this.style.setEventedParent(this,{style:this.style}),typeof _=="string"?this.style.loadURL(_,o,h):this.style.loadJSON(_,o,h),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Eo(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(_,o){if(typeof _=="string"){const h=this._requestManager.transformRequest(_,X.Style);u.h(h,new AbortController).then(d=>{this._updateDiff(d.data,o)}).catch(d=>{d&&this.fire(new u.j(d))})}else typeof _=="object"&&this._updateDiff(_,o)}_updateDiff(_,o){try{this.style.setState(_,o)&&this._update(!0)}catch(h){u.w(`Unable to perform style diff: ${h.message||h.error||h}. Rebuilding the style from scratch.`),this._updateStyle(_,o)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():u.w("There is no style added to the map.")}addSource(_,o){return this._lazyInitEmptyStyle(),this.style.addSource(_,o),this._update(!0)}isSourceLoaded(_){const o=this.style&&this.style.sourceCaches[_];if(o!==void 0)return o.loaded();this.fire(new u.j(new Error(`There is no source with ID '${_}'`)))}setTerrain(_){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),_){const o=this.style.sourceCaches[_.source];if(!o)throw new Error(`cannot load terrain, because there exists no source with ID: ${_.source}`);this.terrain===null&&o.reload();for(const h in this.style._layers){const d=this.style._layers[h];d.type==="hillshade"&&d.source===_.source&&u.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Li(this.painter,o,_),this.painter.renderToTexture=new Kc(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=h=>{h.dataType==="style"?this.terrain.sourceCache.freeRtt():h.dataType==="source"&&h.tile&&(h.sourceId!==_.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(h.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new u.k("terrain",{terrain:_})),this}getTerrain(){var _,o;return(o=(_=this.terrain)===null||_===void 0?void 0:_.options)!==null&&o!==void 0?o:null}areTilesLoaded(){const _=this.style&&this.style.sourceCaches;for(const o in _){const h=_[o]._tiles;for(const d in h){const g=h[d];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0}removeSource(_){return this.style.removeSource(_),this._update(!0)}getSource(_){return this.style.getSource(_)}addImage(_,o,h={}){const{pixelRatio:d=1,sdf:g=!1,stretchX:y,stretchY:I,content:T}=h;if(this._lazyInitEmptyStyle(),!(o instanceof HTMLImageElement||u.b(o))){if(o.width===void 0||o.height===void 0)return this.fire(new u.j(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`")));{const{width:M,height:k,data:N}=o,z=o;return this.style.addImage(_,{data:new u.R({width:M,height:k},new Uint8Array(N)),pixelRatio:d,stretchX:y,stretchY:I,content:T,sdf:g,version:0,userImage:z}),z.onAdd&&z.onAdd(this,_),this}}{const{width:M,height:k,data:N}=L.getImageData(o);this.style.addImage(_,{data:new u.R({width:M,height:k},N),pixelRatio:d,stretchX:y,stretchY:I,content:T,sdf:g,version:0})}}updateImage(_,o){const h=this.style.getImage(_);if(!h)return this.fire(new u.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const d=o instanceof HTMLImageElement||u.b(o)?L.getImageData(o):o,{width:g,height:y,data:I}=d;if(g===void 0||y===void 0)return this.fire(new u.j(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(g!==h.data.width||y!==h.data.height)return this.fire(new u.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const T=!(o instanceof HTMLImageElement||u.b(o));return h.data.replace(I,T),this.style.updateImage(_,h),this}getImage(_){return this.style.getImage(_)}hasImage(_){return _?!!this.style.getImage(_):(this.fire(new u.j(new Error("Missing required image id"))),!1)}removeImage(_){this.style.removeImage(_)}loadImage(_){return G.getImage(this._requestManager.transformRequest(_,X.Image),new AbortController)}listImages(){return this.style.listImages()}addLayer(_,o){return this._lazyInitEmptyStyle(),this.style.addLayer(_,o),this._update(!0)}moveLayer(_,o){return this.style.moveLayer(_,o),this._update(!0)}removeLayer(_){return this.style.removeLayer(_),this._update(!0)}getLayer(_){return this.style.getLayer(_)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(_,o,h){return this.style.setLayerZoomRange(_,o,h),this._update(!0)}setFilter(_,o,h={}){return this.style.setFilter(_,o,h),this._update(!0)}getFilter(_){return this.style.getFilter(_)}setPaintProperty(_,o,h,d={}){return this.style.setPaintProperty(_,o,h,d),this._update(!0)}getPaintProperty(_,o){return this.style.getPaintProperty(_,o)}setLayoutProperty(_,o,h,d={}){return this.style.setLayoutProperty(_,o,h,d),this._update(!0)}getLayoutProperty(_,o){return this.style.getLayoutProperty(_,o)}setGlyphs(_,o={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(_,o),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(_,o,h={}){return this._lazyInitEmptyStyle(),this.style.addSprite(_,o,h,d=>{d||this._update(!0)}),this}removeSprite(_){return this._lazyInitEmptyStyle(),this.style.removeSprite(_),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(_,o={}){return this._lazyInitEmptyStyle(),this.style.setSprite(_,o,h=>{h||this._update(!0)}),this}setLight(_,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(_,o),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(_,o){return this.style.setFeatureState(_,o),this._update()}removeFeatureState(_,o){return this.style.removeFeatureState(_,o),this._update()}getFeatureState(_){return this.style.getFeatureState(_)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let _=0,o=0;return this._container&&(_=this._container.clientWidth||400,o=this._container.clientHeight||300),[_,o]}_setupContainer(){const _=this._container;_.classList.add("maplibregl-map");const o=this._canvasContainer=A.create("div","maplibregl-canvas-container",_);this._interactive&&o.classList.add("maplibregl-interactive"),this._canvas=A.create("canvas","maplibregl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const h=this._containerDimensions(),d=this._getClampedPixelRatio(h[0],h[1]);this._resizeCanvas(h[0],h[1],d);const g=this._controlContainer=A.create("div","maplibregl-control-container",_),y=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(I=>{y[I]=A.create("div",`maplibregl-ctrl-${I} `,g)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(_,o,h){this._canvas.width=Math.floor(h*_),this._canvas.height=Math.floor(h*o),this._canvas.style.width=`${_}px`,this._canvas.style.height=`${o}px`}_setupPainter(){const _={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let o=null;this._canvas.addEventListener("webglcontextcreationerror",d=>{o={requestedAttributes:_},d&&(o.statusMessage=d.statusMessage,o.type=d.type)},{once:!0});const h=this._canvas.getContext("webgl2",_)||this._canvas.getContext("webgl",_);if(!h){const d="Failed to initialize WebGL";throw o?(o.message=d,new Error(JSON.stringify(o))):new Error(d)}this.painter=new yd(h,this.transform),V.testSupport(h)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(_){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||_,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(_){return this._update(),this._renderTaskQueue.add(_)}_cancelRenderFrame(_){this._renderTaskQueue.remove(_)}_render(_){const o=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(_),this._removed)return;let h=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const g=this.transform.zoom,y=L.now();this.style.zoomHistory.update(g,y);const I=new u.a8(g,{now:y,fadeDuration:o,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),T=I.crossFadingFactor();T===1&&T===this._crossFadingFactor||(h=!0,this._crossFadingFactor=T),this.style.update(I)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,o,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:o,showPadding:this.showPadding}),this.fire(new u.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,u.bb.mark(u.bc.load),this.fire(new u.k("load"))),this.style&&(this.style.hasTransitions()||h)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const d=this._sourcesDirty||this._styleDirty||this._placementDirty;return d||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new u.k("idle")),!this._loaded||this._fullyLoaded||d||(this._fullyLoaded=!0,u.bb.mark(u.bc.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var _;this._hash&&this._hash.remove();for(const h of this._controls)h.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),G.removeThrottleControl(this._imageQueueHandle),(_=this._resizeObserver)===null||_===void 0||_.disconnect();const o=this.painter.context.gl.getExtension("WEBGL_lose_context");o&&o.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),A.remove(this._canvasContainer),A.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),u.bb.clearMetrics(),this._removed=!0,this.fire(new u.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,L.frameAsync(this._frameRequest).then(_=>{u.bb.frame(_),this._frameRequest=null,this._render(_)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(_){this._showTileBoundaries!==_&&(this._showTileBoundaries=_,this._update())}get showPadding(){return!!this._showPadding}set showPadding(_){this._showPadding!==_&&(this._showPadding=_,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(_){this._showCollisionBoxes!==_&&(this._showCollisionBoxes=_,_?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(_){this._showOverdrawInspector!==_&&(this._showOverdrawInspector=_,this._update())}get repaint(){return!!this._repaint}set repaint(_){this._repaint!==_&&(this._repaint=_,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(_){this._vertices=_,this._update()}get version(){return Mp}getCameraTargetElevation(){return this.transform.elevation}},p.MapMouseEvent=so,p.MapTouchEvent=ql,p.MapWheelEvent=al,p.Marker=Gu,p.NavigationControl=class{constructor(_){this._updateZoomButtons=()=>{const o=this._map.getZoom(),h=o===this._map.getMaxZoom(),d=o===this._map.getMinZoom();this._zoomInButton.disabled=h,this._zoomOutButton.disabled=d,this._zoomInButton.setAttribute("aria-disabled",h.toString()),this._zoomOutButton.setAttribute("aria-disabled",d.toString())},this._rotateCompassArrow=()=>{const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=o},this._setButtonTitle=(o,h)=>{const d=this._map._getUIString(`NavigationControl.${h}`);o.title=d,o.setAttribute("aria-label",d)},this.options=u.e({},Ap,_),this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",o=>this._map.zoomIn({},{originalEvent:o})),A.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",o=>this._map.zoomOut({},{originalEvent:o})),A.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",o=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:o}):this._map.resetNorth({},{originalEvent:o})}),this._compassIcon=A.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(_){return this._map=_,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new kp(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){A.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(_,o){const h=A.create("button",_,this._container);return h.type="button",h.addEventListener("click",o),h}},p.Popup=class extends u.E{constructor(_){super(),this.remove=()=>(this._content&&A.remove(this._content),this._container&&(A.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map),this.fire(new u.k("close")),this),this._onMouseUp=o=>{this._update(o.point)},this._onMouseMove=o=>{this._update(o.point)},this._onDrag=o=>{this._update(o.point)},this._update=o=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=A.create("div","maplibregl-popup",this._map.getContainer()),this._tip=A.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const I of this.options.className.split(" "))this._container.classList.add(I);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Jc(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!o)return;const h=this._pos=this._trackPointer&&o?o:this._map.project(this._lngLat);let d=this.options.anchor;const g=$c(this.options.offset);if(!d){const I=this._container.offsetWidth,T=this._container.offsetHeight;let M;M=h.y+g.bottom.ythis._map.transform.height-T?["bottom"]:[],h.xthis._map.transform.width-I/2&&M.push("right"),d=M.length===0?"bottom":M.join("-")}const y=h.add(g[d]).round();A.setTransform(this._container,`${Uu[d]} translate(${y.x}px,${y.y}px)`),Qc(this._container,d,"popup")},this._onClose=()=>{this.remove()},this.options=u.e(Object.create(Np),_)}addTo(_){return this._map&&this.remove(),this._map=_,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new u.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(_){return this._lngLat=u.M.convert(_),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(_){return this.setDOMContent(document.createTextNode(_))}setHTML(_){const o=document.createDocumentFragment(),h=document.createElement("body");let d;for(h.innerHTML=_;d=h.firstChild,d;)o.appendChild(d);return this.setDOMContent(o)}getMaxWidth(){var _;return(_=this._container)===null||_===void 0?void 0:_.style.maxWidth}setMaxWidth(_){return this.options.maxWidth=_,this._update(),this}setDOMContent(_){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=A.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(_),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(_){this._container&&this._container.classList.add(_)}removeClassName(_){this._container&&this._container.classList.remove(_)}setOffset(_){return this.options.offset=_,this._update(),this}toggleClassName(_){if(this._container)return this._container.classList.toggle(_)}_createCloseButton(){this.options.closeButton&&(this._closeButton=A.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const _=this._container.querySelector(zp);_&&_.focus()}},p.RasterDEMTileSource=ji,p.RasterTileSource=an,p.ScaleControl=class{constructor(_){this._onMove=()=>{qu(this._map,this._container,this.options)},this.setUnit=o=>{this.options.unit=o,qu(this._map,this._container,this.options)},this.options=u.e({},Rp,_)}getDefaultPosition(){return"bottom-left"}onAdd(_){return this._map=_,this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-scale",_.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){A.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},p.ScrollZoomHandler=Fu,p.Style=Eo,p.TerrainControl=class{constructor(_){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=_}onAdd(_){return this._map=_,this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=A.create("button","maplibregl-ctrl-terrain",this._container),A.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){A.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},p.TwoFingersTouchPitchHandler=Sp,p.TwoFingersTouchRotateHandler=Hc,p.TwoFingersTouchZoomHandler=Id,p.TwoFingersTouchZoomRotateHandler=us,p.VectorTileSource=Pt,p.VideoSource=ss,p.addSourceType=(_,o)=>u._(void 0,void 0,void 0,function*(){if(Ir(_))throw new Error(`A source type called "${_}" already exists.`);((h,d)=>{Ia[h]=d})(_,o)}),p.clearPrewarmedResources=function(){const _=zn;_&&(_.isPreloaded()&&_.numActive()===1?(_.release(pn),zn=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()"))},p.getMaxParallelImageRequests=function(){return u.a.MAX_PARALLEL_IMAGE_REQUESTS},p.getRTLTextPluginStatus=function(){return $t().getRTLTextPluginStatus()},p.getVersion=function(){return Op},p.getWorkerCount=function(){return Sn.workerCount},p.getWorkerUrl=function(){return u.a.WORKER_URL},p.importScriptInWorkers=function(_){return cn().broadcast("importScript",_)},p.prewarm=function(){ee().acquire(pn)},p.setMaxParallelImageRequests=function(_){u.a.MAX_PARALLEL_IMAGE_REQUESTS=_},p.setRTLTextPlugin=function(_,o){return $t().setRTLTextPlugin(_,o)},p.setWorkerCount=function(_){Sn.workerCount=_},p.setWorkerUrl=function(_){u.a.WORKER_URL=_}});var c=n;return c})})(tx);var $2=tx.exports;const ms=Q1($2);function H0(t){let e;return n=>{if(n)for(let i in n){let s=e==null?void 0:e[i],c=n[i];s!==c&&t(i,c,s)}else if(e)for(let i in e)t(i,void 0,e[i]);e=n}}function tS(t,...e){let n=[t];for(let i of e)if(i)Array.isArray(i)&&i[0]===t?n.push(...i.slice(1)):n.push(i);else continue;if(n.length!==1)return n.length===2?n[1]:n}function eS(t){return t===!0?["has","point_count"]:t===!1?["!",["has","point_count"]]:void 0}function X0(t,e){return["case",["boolean",["feature-state","hover"],!1],e,t]}var ym=nS;function nS(t){var e,n,i;if(t){if(Array.isArray(t)){for(e=[],n=t.length,i=0;i{i=null}),Oi())},i(s){n||(Bt(i),n=!0)},o(s){Xt(i),n=!1},d(s){s&&Ot(e),i&&i.d(s)}}}function rS(t,e,n){let i,s,c,p,u,x,w,E,L,A,V,O,{$$slots:J={},$$scope:Y}=e,{id:$=Vf("layer")}=e,{source:U=void 0}=e,{sourceLayer:G=void 0}=e,{beforeId:X=void 0}=e,{beforeLayerType:at=void 0}=e,{type:vt}=e,{paint:dt=void 0}=e,{layout:pt=void 0}=e,{filter:ut=void 0}=e,{applyToClusters:Rt=void 0}=e,{minzoom:yt=void 0}=e,{maxzoom:wt=void 0}=e,{manageHoverState:ie=!1}=e,{hovered:Tt=null}=e,{interactive:ae=!0}=e,{hoverCursor:Kt=void 0}=e,{eventsIfTopMost:re=!1}=e;const Ne=Wh(),{map:Ue,source:wn,self:Qe,minzoom:Pe,maxzoom:pn,eventTopMost:Sn,layerInfo:Pn}=K2();en(t,Ue,Yt=>n(31,L=Yt)),en(t,wn,Yt=>n(32,A=Yt)),en(t,Qe,Yt=>n(0,E=Yt)),en(t,Pe,Yt=>n(34,O=Yt)),en(t,pn,Yt=>n(33,V=Yt)),fa(()=>{E&&L&&(Pn.delete(E),L==null||L.removeLayer(E))});let zn;function jn(Yt){var Pt,an;if(!ae||!E||!L||re&&Sn(Yt)!==E)return;let jt=Yt.features??[],be=(an=(Pt=jt[0])==null?void 0:Pt.properties)==null?void 0:an.cluster_id,oi={event:Yt,map:L,clusterId:be,layer:E,source:u,features:jt};Ne(Yt.type,oi)}function ee(Yt){var Pt,an;if(!ae||!E||!L||re&&Sn(Yt)!==E)return;Kt&&(L.getCanvas().style.cursor=Kt);let jt=Yt.features??[];n(6,Tt=jt[0]??null);let be=(an=(Pt=jt[0])==null?void 0:Pt.properties)==null?void 0:an.cluster_id;Ne("mouseenter",{event:Yt,map:L,clusterId:be,layer:E,source:u,features:jt})}function Ge(Yt){var Pt,an,ji;if(!ae||!L)return;if(re&&Sn(Yt)!==E){n(6,Tt=null),ie&&zn!==void 0&&(L==null||L.setFeatureState({source:u,sourceLayer:G,id:zn},{hover:!1}),zn=void 0);return}L.getCanvas().style.cursor=Kt;let jt=Yt.features??[],be=(an=(Pt=jt[0])==null?void 0:Pt.properties)==null?void 0:an.cluster_id,oi=(ji=jt[0])==null?void 0:ji.id;oi!==zn&&(ie&&(zn!==void 0&&(L==null||L.setFeatureState({source:u,id:zn,sourceLayer:G},{hover:!1})),L==null||L.setFeatureState({source:u,id:oi,sourceLayer:G},{hover:!0})),zn=oi,n(6,Tt=jt[0]??null)),Ne("mousemove",{event:Yt,map:L,clusterId:be,layer:E,source:u,features:jt})}function cn(Yt){if(!(!ae||!E||!L)){if(Kt&&(L.getCanvas().style.cursor=""),n(6,Tt=null),ie&&zn!==void 0){const jt={source:u,id:zn,sourceLayer:G};L==null||L.setFeatureState(jt,{hover:!1}),zn=void 0}Ne("mouseleave",{map:L,layer:E,source:u})}}let vi=!0;function Bi(Yt){L&&(L.off("click",Yt,jn),L.off("dblclick",Yt,jn),L.off("contextmenu",Yt,jn),L.off("mouseenter",Yt,ee),L.off("mousemove",Yt,Ge),L.off("mouseleave",Yt,cn))}return fa(()=>{L&&E&&Bi(E)}),t.$$set=Yt=>{"id"in Yt&&n(7,$=Yt.id),"source"in Yt&&n(8,U=Yt.source),"sourceLayer"in Yt&&n(9,G=Yt.sourceLayer),"beforeId"in Yt&&n(10,X=Yt.beforeId),"beforeLayerType"in Yt&&n(11,at=Yt.beforeLayerType),"type"in Yt&&n(12,vt=Yt.type),"paint"in Yt&&n(13,dt=Yt.paint),"layout"in Yt&&n(14,pt=Yt.layout),"filter"in Yt&&n(15,ut=Yt.filter),"applyToClusters"in Yt&&n(16,Rt=Yt.applyToClusters),"minzoom"in Yt&&n(17,yt=Yt.minzoom),"maxzoom"in Yt&&n(18,wt=Yt.maxzoom),"manageHoverState"in Yt&&n(19,ie=Yt.manageHoverState),"hovered"in Yt&&n(6,Tt=Yt.hovered),"interactive"in Yt&&n(20,ae=Yt.interactive),"hoverCursor"in Yt&&n(21,Kt=Yt.hoverCursor),"eventsIfTopMost"in Yt&&n(22,re=Yt.eventsIfTopMost),"$$scope"in Yt&&n(35,Y=Yt.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&65536&&n(30,i=eS(Rt)),t.$$.dirty[0]&1073774592&&n(24,s=tS("all",i,ut)),t.$$.dirty[0]&131072|t.$$.dirty[1]&8&&n(26,c=yt??O),t.$$.dirty[0]&262144|t.$$.dirty[1]&4&&n(25,p=wt??V),t.$$.dirty[0]&256|t.$$.dirty[1]&2&&n(29,u=U||A),t.$$.dirty[0]&654343809|t.$$.dirty[1]&1&&L&&E!==$&&u){E&&(Bi(E),Pn.delete(E));let Yt=X;if(!X&&at){let jt=L.getStyle().layers,be=typeof at=="function"?at:Pt=>Pt.type===at,oi=jt==null?void 0:jt.find(be);oi&&(Yt=oi.id)}Ei(Qe,E=$,E),L.addLayer(ym({id:E,type:vt,source:u,"source-layer":G,filter:s,paint:dt,layout:pt,minzoom:c,maxzoom:p}),Yt),n(23,vi=!0),L.on("click",E,jn),L.on("dblclick",E,jn),L.on("contextmenu",E,jn),L.on("mouseenter",E,ee),L.on("mousemove",E,Ge),L.on("mouseleave",E,cn)}t.$$.dirty[0]&1048577&&E&&Pn.set(E,{interactive:ae}),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(28,x=E?H0((Yt,jt)=>L==null?void 0:L.setPaintProperty(E,Yt,jt)):void 0),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(27,w=E?H0((Yt,jt)=>L==null?void 0:L.setLayoutProperty(E,Yt,jt)):void 0),t.$$.dirty[0]&268443648&&(x==null||x(dt)),t.$$.dirty[0]&134234112&&(w==null||w(pt)),t.$$.dirty[0]&100663297|t.$$.dirty[1]&1&&E&&(L==null||L.setLayerZoomRange(E,c,p)),t.$$.dirty[0]&25165825|t.$$.dirty[1]&1&&E&&(vi?n(23,vi=!1):L==null||L.setFilter(E,s))},[E,Ue,wn,Qe,Pe,pn,Tt,$,U,G,X,at,vt,dt,pt,ut,Rt,yt,wt,ie,ae,Kt,re,vi,s,p,c,w,x,u,i,L,A,V,O,Y,J]}class U_ extends xn{constructor(e){super(),vn(this,e,rS,iS,hn,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}}function oS(t){let e;const n=t[16].default,i=Do(n,t,t[24],null);return{c(){i&&i.c()},m(s,c){i&&i.m(s,c),e=!0},p(s,c){i&&i.p&&(!e||c&16777216)&&No(i,n,s,s[24],e?Ro(n,s[24],c,null):zo(s[24]),null)},i(s){e||(Bt(i,s),e=!0)},o(s){Xt(i,s),e=!1},d(s){i&&i.d(s)}}}function sS(t){let e,n,i;function s(p){t[17](p)}let c={id:t[1],type:"circle",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],applyToClusters:t[9],minzoom:t[10],maxzoom:t[11],hoverCursor:t[12],manageHoverState:t[13],eventsIfTopMost:t[14],interactive:t[15],$$slots:{default:[oS]},$$scope:{ctx:t}};return t[0]!==void 0&&(c.hovered=t[0]),e=new U_({props:c}),yo.push(()=>Sh(e,"hovered",s)),e.$on("click",t[18]),e.$on("dblclick",t[19]),e.$on("contextmenu",t[20]),e.$on("mouseenter",t[21]),e.$on("mousemove",t[22]),e.$on("mouseleave",t[23]),{c(){Re(e.$$.fragment)},m(p,u){ke(e,p,u),i=!0},p(p,[u]){const x={};u&2&&(x.id=p[1]),u&4&&(x.source=p[2]),u&8&&(x.sourceLayer=p[3]),u&16&&(x.beforeId=p[4]),u&32&&(x.beforeLayerType=p[5]),u&64&&(x.paint=p[6]),u&128&&(x.layout=p[7]),u&256&&(x.filter=p[8]),u&512&&(x.applyToClusters=p[9]),u&1024&&(x.minzoom=p[10]),u&2048&&(x.maxzoom=p[11]),u&4096&&(x.hoverCursor=p[12]),u&8192&&(x.manageHoverState=p[13]),u&16384&&(x.eventsIfTopMost=p[14]),u&32768&&(x.interactive=p[15]),u&16777216&&(x.$$scope={dirty:u,ctx:p}),!n&&u&1&&(n=!0,x.hovered=p[0],wh(()=>n=!1)),e.$set(x)},i(p){i||(Bt(e.$$.fragment,p),i=!0)},o(p){Xt(e.$$.fragment,p),i=!1},d(p){De(e,p)}}}function aS(t,e,n){let{$$slots:i={},$$scope:s}=e,{id:c=Vf("circle")}=e,{source:p=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:x=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:E}=e,{layout:L=void 0}=e,{filter:A=void 0}=e,{applyToClusters:V=void 0}=e,{minzoom:O=void 0}=e,{maxzoom:J=void 0}=e,{hoverCursor:Y=void 0}=e,{manageHoverState:$=!1}=e,{hovered:U=null}=e,{eventsIfTopMost:G=!1}=e,{interactive:X=!0}=e;function at(wt){U=wt,n(0,U)}function vt(wt){er.call(this,t,wt)}function dt(wt){er.call(this,t,wt)}function pt(wt){er.call(this,t,wt)}function ut(wt){er.call(this,t,wt)}function Rt(wt){er.call(this,t,wt)}function yt(wt){er.call(this,t,wt)}return t.$$set=wt=>{"id"in wt&&n(1,c=wt.id),"source"in wt&&n(2,p=wt.source),"sourceLayer"in wt&&n(3,u=wt.sourceLayer),"beforeId"in wt&&n(4,x=wt.beforeId),"beforeLayerType"in wt&&n(5,w=wt.beforeLayerType),"paint"in wt&&n(6,E=wt.paint),"layout"in wt&&n(7,L=wt.layout),"filter"in wt&&n(8,A=wt.filter),"applyToClusters"in wt&&n(9,V=wt.applyToClusters),"minzoom"in wt&&n(10,O=wt.minzoom),"maxzoom"in wt&&n(11,J=wt.maxzoom),"hoverCursor"in wt&&n(12,Y=wt.hoverCursor),"manageHoverState"in wt&&n(13,$=wt.manageHoverState),"hovered"in wt&&n(0,U=wt.hovered),"eventsIfTopMost"in wt&&n(14,G=wt.eventsIfTopMost),"interactive"in wt&&n(15,X=wt.interactive),"$$scope"in wt&&n(24,s=wt.$$scope)},[U,c,p,u,x,w,E,L,A,V,O,J,Y,$,G,X,i,at,vt,dt,pt,ut,Rt,yt,s]}class lS extends xn{constructor(e){super(),vn(this,e,aS,sS,hn,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}function uS(t){let e;const n=t[15].default,i=Do(n,t,t[23],null);return{c(){i&&i.c()},m(s,c){i&&i.m(s,c),e=!0},p(s,c){i&&i.p&&(!e||c&8388608)&&No(i,n,s,s[23],e?Ro(n,s[23],c,null):zo(s[23]),null)},i(s){e||(Bt(i,s),e=!0)},o(s){Xt(i,s),e=!1},d(s){i&&i.d(s)}}}function cS(t){let e,n,i;function s(p){t[16](p)}let c={id:t[1],type:"fill",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],minzoom:t[9],maxzoom:t[10],hoverCursor:t[11],manageHoverState:t[12],eventsIfTopMost:t[13],interactive:t[14],$$slots:{default:[uS]},$$scope:{ctx:t}};return t[0]!==void 0&&(c.hovered=t[0]),e=new U_({props:c}),yo.push(()=>Sh(e,"hovered",s)),e.$on("click",t[17]),e.$on("dblclick",t[18]),e.$on("contextmenu",t[19]),e.$on("mouseenter",t[20]),e.$on("mousemove",t[21]),e.$on("mouseleave",t[22]),{c(){Re(e.$$.fragment)},m(p,u){ke(e,p,u),i=!0},p(p,[u]){const x={};u&2&&(x.id=p[1]),u&4&&(x.source=p[2]),u&8&&(x.sourceLayer=p[3]),u&16&&(x.beforeId=p[4]),u&32&&(x.beforeLayerType=p[5]),u&64&&(x.paint=p[6]),u&128&&(x.layout=p[7]),u&256&&(x.filter=p[8]),u&512&&(x.minzoom=p[9]),u&1024&&(x.maxzoom=p[10]),u&2048&&(x.hoverCursor=p[11]),u&4096&&(x.manageHoverState=p[12]),u&8192&&(x.eventsIfTopMost=p[13]),u&16384&&(x.interactive=p[14]),u&8388608&&(x.$$scope={dirty:u,ctx:p}),!n&&u&1&&(n=!0,x.hovered=p[0],wh(()=>n=!1)),e.$set(x)},i(p){i||(Bt(e.$$.fragment,p),i=!0)},o(p){Xt(e.$$.fragment,p),i=!1},d(p){De(e,p)}}}function hS(t,e,n){let{$$slots:i={},$$scope:s}=e,{id:c=Vf("fill")}=e,{source:p=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:x=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:E}=e,{layout:L=void 0}=e,{filter:A=void 0}=e,{minzoom:V=void 0}=e,{maxzoom:O=void 0}=e,{hoverCursor:J=void 0}=e,{manageHoverState:Y=!1}=e,{hovered:$=null}=e,{eventsIfTopMost:U=!1}=e,{interactive:G=!0}=e;function X(yt){$=yt,n(0,$)}function at(yt){er.call(this,t,yt)}function vt(yt){er.call(this,t,yt)}function dt(yt){er.call(this,t,yt)}function pt(yt){er.call(this,t,yt)}function ut(yt){er.call(this,t,yt)}function Rt(yt){er.call(this,t,yt)}return t.$$set=yt=>{"id"in yt&&n(1,c=yt.id),"source"in yt&&n(2,p=yt.source),"sourceLayer"in yt&&n(3,u=yt.sourceLayer),"beforeId"in yt&&n(4,x=yt.beforeId),"beforeLayerType"in yt&&n(5,w=yt.beforeLayerType),"paint"in yt&&n(6,E=yt.paint),"layout"in yt&&n(7,L=yt.layout),"filter"in yt&&n(8,A=yt.filter),"minzoom"in yt&&n(9,V=yt.minzoom),"maxzoom"in yt&&n(10,O=yt.maxzoom),"hoverCursor"in yt&&n(11,J=yt.hoverCursor),"manageHoverState"in yt&&n(12,Y=yt.manageHoverState),"hovered"in yt&&n(0,$=yt.hovered),"eventsIfTopMost"in yt&&n(13,U=yt.eventsIfTopMost),"interactive"in yt&&n(14,G=yt.interactive),"$$scope"in yt&&n(23,s=yt.$$scope)},[$,c,p,u,x,w,E,L,A,V,O,J,Y,U,G,i,X,at,vt,dt,pt,ut,Rt,s]}class nx extends xn{constructor(e){super(),vn(this,e,hS,cS,hn,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function pS(t,e,n){let i;const{map:s}=Hh();en(t,s,x=>n(4,i=x));let{position:c="top-left"}=e,{container:p=void 0}=e,u=null;return fa(()=>{i!=null&&i.loaded()&&u&&i.removeControl(u)}),t.$$set=x=>{"position"in x&&n(1,c=x.position),"container"in x&&n(2,p=x.container)},t.$$.update=()=>{if(t.$$.dirty&30&&i&&!u){let x;typeof p=="string"?x=document.querySelector(p)??void 0:x=p,n(3,u=new ms.FullscreenControl({container:x})),i.addControl(u,c)}},[s,c,p,u,i]}class fS extends xn{constructor(e){super(),vn(this,e,pS,null,hn,{position:1,container:2})}}function dS(t,e,n,i,s){let c=!1;t.getSource(e)&&(c=!0,t.removeSource(e));const p=()=>{i(e)&&(t.addSource(e,n),s())};if(c){const u=()=>{e&&(t.getSource(e)?setTimeout(u,1):p())};u()}else p()}function mS(t,e,n){A2().then(()=>{let i=S2(t);if(!i)return;i.getSource(e)===n&&i.removeSource(e)})}function J0(t){let e=t[0],n,i,s=Q0(t);return{c(){s.c(),n=Sa()},m(c,p){s.m(c,p),Vt(c,n,p),i=!0},p(c,p){p&1&&hn(e,e=c[0])?(zi(),Xt(s,1,1,Ve),Oi(),s=Q0(c),s.c(),Bt(s,1),s.m(n.parentNode,n)):s.p(c,p)},i(c){i||(Bt(s),i=!0)},o(c){Xt(s),i=!1},d(c){c&&Ot(n),s.d(c)}}}function Q0(t){let e;const n=t[15].default,i=Do(n,t,t[14],null);return{c(){i&&i.c()},m(s,c){i&&i.m(s,c),e=!0},p(s,c){i&&i.p&&(!e||c&16384)&&No(i,n,s,s[14],e?Ro(n,s[14],c,null):zo(s[14]),null)},i(s){e||(Bt(i,s),e=!0)},o(s){Xt(i,s),e=!1},d(s){i&&i.d(s)}}}function gS(t){let e,n,i=t[0]&&J0(t);return{c(){i&&i.c(),e=Sa()},m(s,c){i&&i.m(s,c),Vt(s,e,c),n=!0},p(s,[c]){s[0]?i?(i.p(s,c),c&1&&Bt(i,1)):(i=J0(s),i.c(),Bt(i,1),i.m(e.parentNode,e)):i&&(zi(),Xt(i,1,1,()=>{i=null}),Oi())},i(s){n||(Bt(i),n=!0)},o(s){Xt(i),n=!1},d(s){s&&Ot(e),i&&i.d(s)}}}function _S(t,e,n){let i,s,c,{$$slots:p={},$$scope:u}=e,{id:x=Vf("geojson")}=e,{data:w}=e,{generateId:E=!1}=e,{promoteId:L=void 0}=e,{filter:A=void 0}=e,{lineMetrics:V=void 0}=e,{cluster:O=void 0}=e;const{map:J,cluster:Y,self:$}=Y2();en(t,J,X=>n(13,s=X)),en(t,Y,X=>n(16,c=X)),en(t,$,X=>n(0,i=X));let U,G=!0;return fa(()=>{i&&U&&s&&(mS(J,i,U),Ei($,i=null,i),n(11,U=void 0))}),t.$$set=X=>{"id"in X&&n(4,x=X.id),"data"in X&&n(5,w=X.data),"generateId"in X&&n(6,E=X.generateId),"promoteId"in X&&n(7,L=X.promoteId),"filter"in X&&n(8,A=X.filter),"lineMetrics"in X&&n(9,V=X.lineMetrics),"cluster"in X&&n(10,O=X.cluster),"$$scope"in X&&n(14,u=X.$$scope)},t.$$.update=()=>{t.$$.dirty&1024&&Ei(Y,c=O,c),t.$$.dirty&12273&&s&&i!==x&&(Ei($,i=x,i),dS(s,i,ym({type:"geojson",data:w,filter:A,lineMetrics:V,generateId:E,promoteId:L,cluster:!!O,clusterMinPoints:O==null?void 0:O.minPoints,clusterMaxZoom:O==null?void 0:O.maxZoom,clusterRadius:O==null?void 0:O.radius,clusterProperties:O==null?void 0:O.properties}),X=>s&&X===i,()=>{i&&(n(11,U=s==null?void 0:s.getSource(i)),n(12,G=!0))})),t.$$.dirty&8208&&(s==null||s.on("style.load",()=>{n(11,U=s==null?void 0:s.getSource(x))})),t.$$.dirty&6176&&U&&(G?n(12,G=!1):U.setData(w)),t.$$.dirty&3072&&(U==null||U.setClusterOptions(ym({cluster:!!O,clusterMaxZoom:O==null?void 0:O.maxZoom,clusterRadius:O==null?void 0:O.radius})))},[i,J,Y,$,x,w,E,L,A,V,O,U,G,s,u,p]}class pc extends xn{constructor(e){super(),vn(this,e,_S,gS,hn,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10})}}function yS(t,e,n){let i;const{map:s}=Hh();en(t,s,A=>n(8,i=A));let{position:c="top-left"}=e,{positionOptions:p=void 0}=e,{fitBoundsOptions:u=void 0}=e,{trackUserLocation:x=!1}=e,{showAccuracyCircle:w=!0}=e,{showUserLocation:E=!0}=e,L=null;return fa(()=>{i!=null&&i.loaded()&&L&&i.removeControl(L)}),t.$$set=A=>{"position"in A&&n(1,c=A.position),"positionOptions"in A&&n(2,p=A.positionOptions),"fitBoundsOptions"in A&&n(3,u=A.fitBoundsOptions),"trackUserLocation"in A&&n(4,x=A.trackUserLocation),"showAccuracyCircle"in A&&n(5,w=A.showAccuracyCircle),"showUserLocation"in A&&n(6,E=A.showUserLocation)},t.$$.update=()=>{t.$$.dirty&510&&i&&!L&&(n(7,L=new ms.GeolocateControl({positionOptions:p,fitBoundsOptions:u,trackUserLocation:x,showAccuracyCircle:w,showUserLocation:E})),i.addControl(L,c))},[s,c,p,u,x,w,E,L,i]}class vS extends xn{constructor(e){super(),vn(this,e,yS,null,hn,{position:1,positionOptions:2,fitBoundsOptions:3,trackUserLocation:4,showAccuracyCircle:5,showUserLocation:6})}}function xS(t){let e;const n=t[15].default,i=Do(n,t,t[23],null);return{c(){i&&i.c()},m(s,c){i&&i.m(s,c),e=!0},p(s,c){i&&i.p&&(!e||c&8388608)&&No(i,n,s,s[23],e?Ro(n,s[23],c,null):zo(s[23]),null)},i(s){e||(Bt(i,s),e=!0)},o(s){Xt(i,s),e=!1},d(s){i&&i.d(s)}}}function bS(t){let e,n,i;function s(p){t[16](p)}let c={id:t[1],type:"line",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],minzoom:t[9],maxzoom:t[10],hoverCursor:t[11],manageHoverState:t[12],eventsIfTopMost:t[13],interactive:t[14],$$slots:{default:[xS]},$$scope:{ctx:t}};return t[0]!==void 0&&(c.hovered=t[0]),e=new U_({props:c}),yo.push(()=>Sh(e,"hovered",s)),e.$on("click",t[17]),e.$on("dblclick",t[18]),e.$on("contextmenu",t[19]),e.$on("mouseenter",t[20]),e.$on("mousemove",t[21]),e.$on("mouseleave",t[22]),{c(){Re(e.$$.fragment)},m(p,u){ke(e,p,u),i=!0},p(p,[u]){const x={};u&2&&(x.id=p[1]),u&4&&(x.source=p[2]),u&8&&(x.sourceLayer=p[3]),u&16&&(x.beforeId=p[4]),u&32&&(x.beforeLayerType=p[5]),u&64&&(x.paint=p[6]),u&128&&(x.layout=p[7]),u&256&&(x.filter=p[8]),u&512&&(x.minzoom=p[9]),u&1024&&(x.maxzoom=p[10]),u&2048&&(x.hoverCursor=p[11]),u&4096&&(x.manageHoverState=p[12]),u&8192&&(x.eventsIfTopMost=p[13]),u&16384&&(x.interactive=p[14]),u&8388608&&(x.$$scope={dirty:u,ctx:p}),!n&&u&1&&(n=!0,x.hovered=p[0],wh(()=>n=!1)),e.$set(x)},i(p){i||(Bt(e.$$.fragment,p),i=!0)},o(p){Xt(e.$$.fragment,p),i=!1},d(p){De(e,p)}}}function wS(t,e,n){let{$$slots:i={},$$scope:s}=e,{id:c=Vf("line")}=e,{source:p=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:x=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:E}=e,{layout:L=void 0}=e,{filter:A=void 0}=e,{minzoom:V=void 0}=e,{maxzoom:O=void 0}=e,{hoverCursor:J=void 0}=e,{manageHoverState:Y=!1}=e,{hovered:$=null}=e,{eventsIfTopMost:U=!1}=e,{interactive:G=!0}=e;function X(yt){$=yt,n(0,$)}function at(yt){er.call(this,t,yt)}function vt(yt){er.call(this,t,yt)}function dt(yt){er.call(this,t,yt)}function pt(yt){er.call(this,t,yt)}function ut(yt){er.call(this,t,yt)}function Rt(yt){er.call(this,t,yt)}return t.$$set=yt=>{"id"in yt&&n(1,c=yt.id),"source"in yt&&n(2,p=yt.source),"sourceLayer"in yt&&n(3,u=yt.sourceLayer),"beforeId"in yt&&n(4,x=yt.beforeId),"beforeLayerType"in yt&&n(5,w=yt.beforeLayerType),"paint"in yt&&n(6,E=yt.paint),"layout"in yt&&n(7,L=yt.layout),"filter"in yt&&n(8,A=yt.filter),"minzoom"in yt&&n(9,V=yt.minzoom),"maxzoom"in yt&&n(10,O=yt.maxzoom),"hoverCursor"in yt&&n(11,J=yt.hoverCursor),"manageHoverState"in yt&&n(12,Y=yt.manageHoverState),"hovered"in yt&&n(0,$=yt.hovered),"eventsIfTopMost"in yt&&n(13,U=yt.eventsIfTopMost),"interactive"in yt&&n(14,G=yt.interactive),"$$scope"in yt&&n(23,s=yt.$$scope)},[$,c,p,u,x,w,E,L,A,V,O,J,Y,U,G,i,X,at,vt,dt,pt,ut,Rt,s]}class Xh extends xn{constructor(e){super(),vn(this,e,wS,bS,hn,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function SS(t){let e=t.getCenter(),n=Math.round(t.getZoom()*100)/100,i=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),s=Math.pow(10,i),c=Math.round(e.lat*s)/s,p=Math.round(e.lng*s)/s,u=`${n}/${c}/${p}`,x=t.getBearing(),w=t.getPitch();return(x||w)&&(u+=`/${Math.round(x*10)/10}`),w&&(u+=`/${Math.round(w)}`),`#${u}`}function ES(t){return t.replace("#","").split("/").map(parseFloat)}var im=G_;function G_(t,e){return t===e||t!==t&&e!==e?!0:typeof t!=typeof e||{}.toString.call(t)!={}.toString.call(e)||t!==Object(t)||!t?!1:Array.isArray(t)?$0(t,e):{}.toString.call(t)=="[object Set]"?$0(Array.from(t),Array.from(e)):{}.toString.call(t)=="[object Object]"?CS(t,e):IS(t,e)}function IS(t,e){return t.toString()===e.toString()}function $0(t,e){var n=t.length;if(n!=e.length)return!1;for(var i=0;in(6,i=E));let{position:c="top-left"}=e,{showCompass:p=!0}=e,{showZoom:u=!0}=e,{visualizePitch:x=!1}=e,w=null;return fa(()=>{i!=null&&i.loaded()&&w&&i.removeControl(w)}),t.$$set=E=>{"position"in E&&n(1,c=E.position),"showCompass"in E&&n(2,p=E.showCompass),"showZoom"in E&&n(3,u=E.showZoom),"visualizePitch"in E&&n(4,x=E.visualizePitch)},t.$$.update=()=>{t.$$.dirty&126&&i&&!w&&(n(5,w=new ms.NavigationControl({showCompass:p,showZoom:u,visualizePitch:x})),i.addControl(w,c))},[s,c,p,u,x,w,i]}class LS extends xn{constructor(e){super(),vn(this,e,TS,null,hn,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function MS(t,e,n){let i;const{map:s}=Hh();en(t,s,w=>n(5,i=w));let{position:c="bottom-left"}=e,{maxWidth:p=void 0}=e,{unit:u="metric"}=e,x=null;return fa(()=>{i!=null&&i.loaded()&&x&&i.removeControl(x)}),t.$$set=w=>{"position"in w&&n(1,c=w.position),"maxWidth"in w&&n(2,p=w.maxWidth),"unit"in w&&n(3,u=w.unit)},t.$$.update=()=>{t.$$.dirty&62&&i&&!x&&(n(4,x=new ms.ScaleControl({maxWidth:p,unit:u})),i.addControl(x,c))},[s,c,p,u,x,i]}class PS extends xn{constructor(e){super(),vn(this,e,MS,null,hn,{position:1,maxWidth:2,unit:3})}}const AS=t=>({map:t[0]&8,loadedImages:t[0]&16,allImagesLoaded:t[0]&32}),tv=t=>({map:t[3],loadedImages:t[4],allImagesLoaded:t[5]});function ev(t){let e,n,i=t[2]&&nv(t);const s=t[36].default,c=Do(s,t,t[35],tv);return{c(){i&&i.c(),e=ge(),c&&c.c()},m(p,u){i&&i.m(p,u),Vt(p,e,u),c&&c.m(p,u),n=!0},p(p,u){p[2]?i?(i.p(p,u),u[0]&4&&Bt(i,1)):(i=nv(p),i.c(),Bt(i,1),i.m(e.parentNode,e)):i&&(zi(),Xt(i,1,1,()=>{i=null}),Oi()),c&&c.p&&(!n||u[0]&56|u[1]&16)&&No(c,s,p,p[35],n?Ro(s,p[35],u,AS):zo(p[35]),tv)},i(p){n||(Bt(i),Bt(c,p),n=!0)},o(p){Xt(i),Xt(c,p),n=!1},d(p){p&&Ot(e),i&&i.d(p),c&&c.d(p)}}}function nv(t){let e,n,i,s,c,p,u,x;return e=new LS({props:{position:t[6]}}),i=new vS({props:{position:t[6],fitBoundsOptions:{maxZoom:12}}}),c=new fS({props:{position:t[6]}}),u=new PS({props:{position:t[6]}}),{c(){Re(e.$$.fragment),n=ge(),Re(i.$$.fragment),s=ge(),Re(c.$$.fragment),p=ge(),Re(u.$$.fragment)},m(w,E){ke(e,w,E),Vt(w,n,E),ke(i,w,E),Vt(w,s,E),ke(c,w,E),Vt(w,p,E),ke(u,w,E),x=!0},p(w,E){const L={};E[0]&64&&(L.position=w[6]),e.$set(L);const A={};E[0]&64&&(A.position=w[6]),i.$set(A);const V={};E[0]&64&&(V.position=w[6]),c.$set(V);const O={};E[0]&64&&(O.position=w[6]),u.$set(O)},i(w){x||(Bt(e.$$.fragment,w),Bt(i.$$.fragment,w),Bt(c.$$.fragment,w),Bt(u.$$.fragment,w),x=!0)},o(w){Xt(e.$$.fragment,w),Xt(i.$$.fragment,w),Xt(c.$$.fragment,w),Xt(u.$$.fragment,w),x=!1},d(w){w&&(Ot(n),Ot(s),Ot(p)),De(e,w),De(i,w),De(c,w),De(u,w)}}}function kS(t){let e,n,i,s,c,p=t[3]&&t[0]&&ev(t);return{c(){e=zt("div"),p&&p.c(),Ut(e,"class",n=gm(t[1])+" svelte-p00lfq"),Ga(e,"expand-map",!t[1])},m(u,x){Vt(u,e,x),p&&p.m(e,null),i=!0,s||(c=d_(t[9].call(null,e)),s=!0)},p(u,x){u[3]&&u[0]?p?(p.p(u,x),x[0]&9&&Bt(p,1)):(p=ev(u),p.c(),Bt(p,1),p.m(e,null)):p&&(zi(),Xt(p,1,1,()=>{p=null}),Oi()),(!i||x[0]&2&&n!==(n=gm(u[1])+" svelte-p00lfq"))&&Ut(e,"class",n),(!i||x[0]&2)&&Ga(e,"expand-map",!u[1])},i(u){i||(Bt(p),i=!0)},o(u){Xt(p),i=!1},d(u){u&&Ot(e),p&&p.d(),s=!1,c()}}}function DS(t,e,n){let i,s,c,p,{$$slots:u={},$$scope:x}=e,{map:w=null}=e,{class:E=void 0}=e,{style:L}=e,{diffStyleUpdates:A=!1}=e,{center:V=void 0}=e,{zoom:O=void 0}=e,{pitch:J=0}=e,{bearing:Y=0}=e,{bounds:$=void 0}=e,{hash:U=!1}=e,{loaded:G=!1}=e,{minZoom:X=0}=e,{maxZoom:at=22}=e,{zoomOnDoubleClick:vt=!0}=e,{locale:dt=void 0}=e,{interactive:pt=!0}=e,{attributionControl:ut=!0}=e,{cooperativeGestures:Rt=!1}=e,{preserveDrawingBuffer:yt=!1}=e,{maxBounds:wt=void 0}=e,{images:ie=[]}=e,{standardControls:Tt=!1}=e,{filterLayers:ae=void 0}=e,{transformRequest:Kt=void 0}=e;const re=Wh(),{map:Ne,loadedImages:Ue}=X2();en(t,Ne,ee=>n(3,c=ee)),en(t,Ue,ee=>n(4,p=ee));let wn=new Set;async function Qe(ee,Ge=!1){if(c&&!(!c.loaded()&&!Ge))if("url"in ee){wn.add(ee.id);try{let cn=await c.loadImage(ee.url);c==null||c.addImage(ee.id,cn.data,ee.options),p.add(ee.id),Ue.set(p)}catch(cn){re("error",cn)}finally{wn.delete(ee.id)}}else c.addImage(ee.id,ee.data,ee.options),p.add(ee.id),Ue.set(p)}let Pe,pn,Sn,Pn;function zn(ee){if(U){let Ge=ES(window.location.hash);Ge.length>=3&&(n(11,O=Ge[0]),n(10,V=[Ge[2],Ge[1]])),Ge.length==5&&(n(15,Y=Ge[3]),n(14,J=Ge[4]))}return Ei(Ne,c=new ms.Map(ym({container:ee,style:L,locale:dt,center:V,zoom:O,pitch:J,bearing:Y,minZoom:X,maxZoom:at,interactive:pt,preserveDrawingBuffer:yt,maxBounds:wt,bounds:$,attributionControl:ut,transformRequest:Kt,cooperativeGestures:Rt})),c),c.on("load",Ge=>{n(0,G=!0),re("load",c)}),c.on("error",Ge=>re("error",{...Ge,map:c})),c.on("movestart",Ge=>re("movestart",{...Ge,map:c})),c.on("moveend",Ge=>{if(n(10,V=Ge.target.getCenter()),n(11,O=Ge.target.getZoom()),n(12,$=Ge.target.getBounds()),re("moveend",{...Ge,map:c}),U){let cn=window.location.href.replace(/(#.+)?$/,SS(c));window.history.replaceState(window.history.state,"",cn)}}),c.on("zoomstart",Ge=>re("zoomstart",{...Ge,map:c})),c.on("zoom",Ge=>{n(11,O=Ge.target.getZoom()),re("zoom",{...Ge,map:c})}),c.on("zoomend",Ge=>{n(11,O=Ge.target.getZoom()),re("zoomend",{...Ge,map:c})}),c.on("style.load",()=>{if(c){const Ge=c.getStyle();if(n(32,Pe=Ge.layers.map(cn=>cn.id)),n(33,pn=Object.keys(Ge.sources)),Pn)for(const[cn,vi]of Object.entries(Pn))c.addSource(cn,vi);if(Sn)for(const cn of Sn)c.addLayer(cn);for(const cn of ie)Qe(cn,!0)}}),c.on("styledata",Ge=>{if(c&&ae){const cn=c.getStyle().layers;if(cn)for(let vi of cn)ae(vi)||c.setLayoutProperty(vi.id,"visibility","none")}re("styledata",{...Ge,map:c})}),{destroy(){n(0,G=!1),c==null||c.remove(),Ei(Ne,c=null,c)}}}let jn=L;return t.$$set=ee=>{"map"in ee&&n(13,w=ee.map),"class"in ee&&n(1,E=ee.class),"style"in ee&&n(16,L=ee.style),"diffStyleUpdates"in ee&&n(17,A=ee.diffStyleUpdates),"center"in ee&&n(10,V=ee.center),"zoom"in ee&&n(11,O=ee.zoom),"pitch"in ee&&n(14,J=ee.pitch),"bearing"in ee&&n(15,Y=ee.bearing),"bounds"in ee&&n(12,$=ee.bounds),"hash"in ee&&n(18,U=ee.hash),"loaded"in ee&&n(0,G=ee.loaded),"minZoom"in ee&&n(19,X=ee.minZoom),"maxZoom"in ee&&n(20,at=ee.maxZoom),"zoomOnDoubleClick"in ee&&n(21,vt=ee.zoomOnDoubleClick),"locale"in ee&&n(22,dt=ee.locale),"interactive"in ee&&n(23,pt=ee.interactive),"attributionControl"in ee&&n(24,ut=ee.attributionControl),"cooperativeGestures"in ee&&n(25,Rt=ee.cooperativeGestures),"preserveDrawingBuffer"in ee&&n(26,yt=ee.preserveDrawingBuffer),"maxBounds"in ee&&n(27,wt=ee.maxBounds),"images"in ee&&n(28,ie=ee.images),"standardControls"in ee&&n(2,Tt=ee.standardControls),"filterLayers"in ee&&n(29,ae=ee.filterLayers),"transformRequest"in ee&&n(30,Kt=ee.transformRequest),"$$scope"in ee&&n(35,x=ee.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&4&&n(6,i=typeof Tt=="boolean"?void 0:Tt),t.$$.dirty[0]&8&&n(13,w=c),t.$$.dirty[0]&196616|t.$$.dirty[1]&14&&c&&!im(L,jn)){const ee=c.getStyle();if(Pe&&(Sn=ee.layers.filter(Ge=>!Pe.includes(Ge.id))),pn){const Ge=Object.keys(ee.sources).filter(cn=>!pn.includes(cn));Pn={};for(const cn of Ge)Pn[cn]=ee.sources[cn]}n(34,jn=L),c.setStyle(L,{diff:A}),Ei(Ue,p=new Set,p),n(31,wn=new Set)}if(t.$$.dirty[0]&268435481|t.$$.dirty[1]&1&&G&&c!=null&&c.loaded())for(let ee of ie)!p.has(ee.id)&&!wn.has(ee.id)&&!c.hasImage(ee.id)&&Qe(ee);t.$$.dirty[0]&268435472&&n(5,s=ie.every(ee=>p.has(ee.id))),t.$$.dirty[0]&1032&&V&&!im(V,c==null?void 0:c.getCenter())&&(c==null||c.panTo(V)),t.$$.dirty[0]&2056&&O&&!im(O,c==null?void 0:c.getZoom())&&(c==null||c.zoomTo(O)),t.$$.dirty[0]&4104&&$&&!im($,c==null?void 0:c.getBounds())&&(c==null||c.fitBounds($)),t.$$.dirty[0]&2097160&&(vt?c==null||c.doubleClickZoom.enable():c==null||c.doubleClickZoom.disable())},[G,E,Tt,c,p,s,i,Ne,Ue,zn,V,O,$,w,J,Y,L,A,U,X,at,vt,dt,pt,ut,Rt,yt,wt,ie,ae,Kt,wn,Pe,pn,jn,x,u]}class RS extends xn{constructor(e){super(),vn(this,e,DS,kS,hn,{map:13,class:1,style:16,diffStyleUpdates:17,center:10,zoom:11,pitch:14,bearing:15,bounds:12,hash:18,loaded:0,minZoom:19,maxZoom:20,zoomOnDoubleClick:21,locale:22,interactive:23,attributionControl:24,cooperativeGestures:25,preserveDrawingBuffer:26,maxBounds:27,images:28,standardControls:2,filterLayers:29,transformRequest:30},null,[-1,-1])}}function NS(t){let e,n,i,s,c,p,u;const x=t[18].default,w=Do(x,t,t[17],null);return{c(){e=zt("div"),w&&w.c(),Ut(e,"tabindex",n=t[1]?0:void 0),Ut(e,"role",i=t[1]?"button":void 0),nr(e,"z-index",t[2])},m(E,L){Vt(E,e,L),w&&w.m(e,null),c=!0,p||(u=[d_(t[6].call(null,e)),d_(s=zS.call(null,e,t[0])),Ke(e,"click",t[19]),Ke(e,"dblclick",t[20]),Ke(e,"contextmenu",t[21]),Ke(e,"mouseenter",t[22]),Ke(e,"mouseleave",t[23]),Ke(e,"mousemove",t[24]),Ke(e,"keydown",t[7])],p=!0)},p(E,[L]){w&&w.p&&(!c||L&131072)&&No(w,x,E,E[17],c?Ro(x,E[17],L,null):zo(E[17]),null),(!c||L&2&&n!==(n=E[1]?0:void 0))&&Ut(e,"tabindex",n),(!c||L&2&&i!==(i=E[1]?"button":void 0))&&Ut(e,"role",i),s&&Rm(s.update)&&L&1&&s.update.call(null,E[0]),L&4&&nr(e,"z-index",E[2])},i(E){c||(Bt(w,E),c=!0)},o(E){Xt(w,E),c=!1},d(E){E&&Ot(e),w&&w.d(E),p=!1,Er(u)}}}function zS(t,e){const n=t.className;function i(s){s?t.className=`${n} ${s}`:t.className=n}return i(e),{update:i}}function OS(t,e,n){let i,s,c,{$$slots:p={},$$scope:u}=e,{lngLat:x}=e,{class:w=void 0}=e,{interactive:E=!0}=e,{asButton:L=!1}=e,{draggable:A=!1}=e,{feature:V=null}=e,{offset:O=void 0}=e,{zIndex:J=void 0}=e,{rotation:Y=0}=e,{opacity:$=1}=e;const U=Wh(),{map:G,layerEvent:X,self:at}=J2();en(t,G,Kt=>n(26,c=Kt)),en(t,X,Kt=>n(25,i=Kt)),en(t,at,Kt=>n(16,s=Kt));function vt(Kt){Ei(at,s=new ms.Marker({element:Kt,rotation:Y,draggable:A,offset:O,opacity:$.toString()}).setLngLat(x).addTo(c),s);const re=()=>ut("dragstart"),Ne=()=>{dt(),ut("drag")},Ue=()=>{dt(),ut("dragend")};return A&&(s.on("dragstart",re),s.on("drag",Ne),s.on("dragend",Ue)),{destroy(){A&&(s==null||s.off("dragstart",re),s==null||s.off("drag",Ne),s==null||s.off("dragend",Ue)),s==null||s.remove()}}}function dt(){let Kt=s==null?void 0:s.getLngLat();Kt&&(Array.isArray(x)?n(9,x=[Kt.lng,Kt.lat]):x&&"lon"in x?n(9,x={lon:Kt.lng,lat:Kt.lat}):n(9,x=Kt))}function pt(Kt){Kt.key===" "&&(Kt.preventDefault(),Kt.stopPropagation(),ut("click"))}function ut(Kt){if(!E)return;let re=s==null?void 0:s.getLngLat();if(!re)return;const Ne=[re.lng,re.lat];let Ue={map:c,marker:s,lngLat:Ne,features:[{type:"Feature",properties:(V==null?void 0:V.properties)??{},geometry:{type:"Point",coordinates:Ne}}]};Ei(X,i={...Ue,layerType:"marker",type:Kt},i),U(Kt,Ue)}const Rt=()=>ut("click"),yt=()=>ut("dblclick"),wt=()=>ut("contextmenu"),ie=Kt=>{ut("mouseenter")},Tt=()=>{ut("mouseleave")},ae=()=>ut("mousemove");return t.$$set=Kt=>{"lngLat"in Kt&&n(9,x=Kt.lngLat),"class"in Kt&&n(0,w=Kt.class),"interactive"in Kt&&n(10,E=Kt.interactive),"asButton"in Kt&&n(1,L=Kt.asButton),"draggable"in Kt&&n(11,A=Kt.draggable),"feature"in Kt&&n(12,V=Kt.feature),"offset"in Kt&&n(13,O=Kt.offset),"zIndex"in Kt&&n(2,J=Kt.zIndex),"rotation"in Kt&&n(14,Y=Kt.rotation),"opacity"in Kt&&n(15,$=Kt.opacity),"$$scope"in Kt&&n(17,u=Kt.$$scope)},t.$$.update=()=>{t.$$.dirty&66048&&(s==null||s.setLngLat(x)),t.$$.dirty&73728&&(s==null||s.setOffset(O??[0,0])),t.$$.dirty&81920&&(s==null||s.setRotation(Y)),t.$$.dirty&98304&&(s==null||s.setOpacity($.toString()))},[w,L,J,G,X,at,vt,pt,ut,x,E,A,V,O,Y,$,s,u,p,Rt,yt,wt,ie,Tt,ae]}class iv extends xn{constructor(e){super(),vn(this,e,OS,NS,hn,{lngLat:9,class:0,interactive:10,asButton:1,draggable:11,feature:12,offset:13,zIndex:2,rotation:14,opacity:15})}}const FS=t=>({features:t[0]&16,data:t[0]&16,map:t[0]&4,close:t[0]&1}),rv=t=>{var e;return{features:t[4],data:(e=t[4])==null?void 0:e[0],map:t[2],close:t[31]}};function ov(t){let e,n,i=(t[4]||t[3]instanceof ms.Marker)&&sv(t);return{c(){e=zt("div"),i&&i.c()},m(s,c){Vt(s,e,c),i&&i.m(e,null),t[32](e),n=!0},p(s,c){s[4]||s[3]instanceof ms.Marker?i?(i.p(s,c),c[0]&24&&Bt(i,1)):(i=sv(s),i.c(),Bt(i,1),i.m(e,null)):i&&(zi(),Xt(i,1,1,()=>{i=null}),Oi())},i(s){n||(Bt(i),n=!0)},o(s){Xt(i),n=!1},d(s){s&&Ot(e),i&&i.d(),t[32](null)}}}function sv(t){let e;const n=t[30].default,i=Do(n,t,t[29],rv);return{c(){i&&i.c()},m(s,c){i&&i.m(s,c),e=!0},p(s,c){i&&i.p&&(!e||c[0]&536870933)&&No(i,n,s,s[29],e?Ro(n,s[29],c,FS):zo(s[29]),rv)},i(s){e||(Bt(i,s),e=!0)},o(s){Xt(i,s),e=!1},d(s){i&&i.d(s)}}}function BS(t){let e,n,i=t[9].default&&ov(t);return{c(){i&&i.c(),e=Sa()},m(s,c){i&&i.m(s,c),Vt(s,e,c),n=!0},p(s,c){s[9].default?i?(i.p(s,c),c[0]&512&&Bt(i,1)):(i=ov(s),i.c(),Bt(i,1),i.m(e.parentNode,e)):i&&(zi(),Xt(i,1,1,()=>{i=null}),Oi())},i(s){n||(Bt(i),n=!0)},o(s){Xt(i),n=!1},d(s){s&&Ot(e),i&&i.d(s)}}}function VS(t,e,n){let i,s,c,p,u,x,{$$slots:w={},$$scope:E}=e;const L=E2(w);let{closeButton:A=void 0}=e,{closeOnClickOutside:V=!0}=e,{closeOnClickInside:O=!1}=e,{closeOnMove:J=!1}=e,{openOn:Y="click"}=e,{openIfTopMost:$=!0}=e,{focusAfterOpen:U=!0}=e,{anchor:G=void 0}=e,{offset:X=void 0}=e,{popupClass:at=void 0}=e,{maxWidth:vt=void 0}=e,{lngLat:dt=void 0}=e,{html:pt=void 0}=e,{open:ut=!1}=e;const Rt=Wh(),{map:yt,popupTarget:wt,layerEvent:ie,layer:Tt,eventTopMost:ae}=Hh();en(t,yt,jt=>n(2,c=jt)),en(t,wt,jt=>n(3,u=jt)),en(t,ie,jt=>n(28,p=jt)),en(t,Tt,jt=>n(35,x=jt));const Kt=["click","dblclick","contextmenu"];let re,Ne=!1,Ue;function wn(){if(!re)return;let jt=re.getElement();!jt||jt===Ue||(Ue=jt,Y==="hover"&&(Ue.style.pointerEvents="none"),Ue.addEventListener("mouseenter",()=>{n(24,Ne=!0)},{passive:!0}),Ue.addEventListener("mouseleave",()=>{n(24,Ne=!1)},{passive:!0}),Ue.addEventListener("click",()=>{O&&n(0,ut=!1)},{passive:!0}))}Bf(()=>{if(c)return c.on("click",cn),c.on("contextmenu",cn),typeof u=="string"&&(c.on("click",u,Sn),c.on("dblclick",u,Sn),c.on("contextmenu",u,Sn),c.on("mousemove",u,Ge),c.on("mouseleave",u,ee),c.on("touchstart",u,zn),c.on("touchend",u,jn)),()=>{c!=null&&c.loaded()&&(re==null||re.remove(),c.off("click",cn),c.off("contextmenu",cn),u instanceof ms.Marker?u.getPopup()===re&&u.setPopup(void 0):typeof u=="string"&&(c.off("click",u,Sn),c.off("dblclick",u,Sn),c.off("contextmenu",u,Sn),c.off("mousemove",u,Ge),c.off("mouseleave",u,ee),c.off("touchstart",u,zn),c.off("touchend",u,jn)))}});function Qe(jt){return $?!("marker"in jt)&&!Q2(jt)&&ae(jt)!==x:!1}let Pe=null,pn="normal";function Sn(jt){jt.type===Y&&(Qe(jt)||("layerType"in jt?jt.layerType==="deckgl"?(n(10,dt=jt.coordinate),n(4,Pe=jt.object?[jt.object]:null)):(n(10,dt=jt.lngLat),n(4,Pe=jt.features??[])):(n(10,dt=jt.lngLat),n(4,Pe=jt.features??[])),setTimeout(()=>n(0,ut=!0))))}let Pn=null;function zn(jt){Pn=jt.point}function jn(jt){if(!Pn||Y!=="hover")return;let be=Pn.dist(jt.point);Pn=null,be<3&&(n(10,dt=jt.lngLat),n(4,Pe=jt.features??[]),re.isOpen()?n(25,pn="justOpened"):(n(25,pn="opening"),n(0,ut=!0)))}function ee(jt){Y!=="hover"||Pn||pn!=="normal"||(n(0,ut=!1),n(4,Pe=null))}function Ge(jt){if(!(Y!=="hover"||Pn||pn!=="normal")){if(Qe(jt)){n(0,ut=!1),n(4,Pe=null);return}n(0,ut=!0),n(4,Pe=jt.features??[]),n(10,dt=jt.lngLat)}}function cn(jt){if(pn==="justOpened"){n(25,pn="normal");return}if(!V)return;let be=[Ue,u instanceof ms.Marker?u==null?void 0:u.getElement():null];ut&&re.isOpen()&&!be.some(oi=>oi==null?void 0:oi.contains(jt.originalEvent.target))&&(jt.type==="contextmenu"&&Y==="contextmenu"||jt.type!=="contextmenu")&&n(0,ut=!1)}fa(()=>{c&&(re!=null&&re.isOpen())&&re.remove()});let vi;const Bi=()=>n(0,ut=!1);function Yt(jt){yo[jt?"unshift":"push"](()=>{vi=jt,n(1,vi)})}return t.$$set=jt=>{"closeButton"in jt&&n(11,A=jt.closeButton),"closeOnClickOutside"in jt&&n(12,V=jt.closeOnClickOutside),"closeOnClickInside"in jt&&n(13,O=jt.closeOnClickInside),"closeOnMove"in jt&&n(14,J=jt.closeOnMove),"openOn"in jt&&n(15,Y=jt.openOn),"openIfTopMost"in jt&&n(16,$=jt.openIfTopMost),"focusAfterOpen"in jt&&n(17,U=jt.focusAfterOpen),"anchor"in jt&&n(18,G=jt.anchor),"offset"in jt&&n(19,X=jt.offset),"popupClass"in jt&&n(20,at=jt.popupClass),"maxWidth"in jt&&n(21,vt=jt.maxWidth),"lngLat"in jt&&n(10,dt=jt.lngLat),"html"in jt&&n(22,pt=jt.html),"open"in jt&&n(0,ut=jt.open),"$$scope"in jt&&n(29,E=jt.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&14336&&n(27,i=A??(!V&&!O)),t.$$.dirty[0]&146685952&&(re||(n(23,re=new ms.Popup({closeButton:i,closeOnClick:!1,closeOnMove:J,focusAfterOpen:U,maxWidth:vt,className:at,anchor:G,offset:X})),Ue=re.getElement(),re.on("open",()=>{n(0,ut=!0),wn(),Rt("open",re)}),re.on("close",()=>{n(0,ut=!1),Rt("close",re)}),re.on("hover",()=>{Rt("hover",re)}))),t.$$.dirty[0]&8421384&&re&&u instanceof ms.Marker&&(Y==="click"?u.setPopup(re):u.getPopup()===re&&u.setPopup(void 0)),t.$$.dirty[0]&268468224&&Kt.includes(Y)&&(p==null?void 0:p.type)===Y&&(Sn(p),Ei(ie,p=null,p)),t.$$.dirty[0]&268468224&&n(26,s=Y==="hover"&&((p==null?void 0:p.type)==="mousemove"||(p==null?void 0:p.type)==="mouseenter")),t.$$.dirty[0]&352354304&&Y==="hover"&&ie&&(s&&p&&(p.layerType==="deckgl"?(n(10,dt=p.coordinate),n(4,Pe=p.object?[p.object]:null)):(n(10,dt=p.lngLat),n(4,Pe=p.features??[]))),n(0,ut=(s||Ne)??!1)),t.$$.dirty[0]&12582914&&(vi?re.setDOMContent(vi):pt&&re.setHTML(pt)),t.$$.dirty[0]&8389632&&dt&&re.setLngLat(dt),t.$$.dirty[0]&41943045&&c){let jt=re.isOpen();ut&&!jt?(re.addTo(c),pn==="opening"&&n(25,pn="justOpened")):!ut&&jt&&re.remove()}},[ut,vi,c,u,Pe,yt,wt,ie,Tt,L,dt,A,V,O,J,Y,$,U,G,X,at,vt,pt,re,Ne,pn,s,i,p,E,w,Bi,Yt]}class US extends xn{constructor(e){super(),vn(this,e,VS,BS,hn,{closeButton:11,closeOnClickOutside:12,closeOnClickInside:13,closeOnMove:14,openOn:15,openIfTopMost:16,focusAfterOpen:17,anchor:18,offset:19,popupClass:20,maxWidth:21,lngLat:10,html:22,open:0},null,[-1,-1])}}var Uf=Uint8Array,ix=Uint16Array,GS=Int32Array,qS=new Uf([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]),jS=new Uf([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]),rx=function(t,e){for(var n=new ix(31),i=0;i<31;++i)n[i]=e+=1<>1|(Gn&21845)<<1,vl=(vl&52428)>>2|(vl&13107)<<2,vl=(vl&61680)>>4|(vl&3855)<<4,HS[Gn]=((vl&65280)>>8|(vl&255)<<8)>>1;var vl,Gn,Nm=new Uf(288);for(Gn=0;Gn<144;++Gn)Nm[Gn]=8;var Gn;for(Gn=144;Gn<256;++Gn)Nm[Gn]=9;var Gn;for(Gn=256;Gn<280;++Gn)Nm[Gn]=7;var Gn;for(Gn=280;Gn<288;++Gn)Nm[Gn]=8;var Gn,XS=new Uf(32);for(Gn=0;Gn<32;++Gn)XS[Gn]=5;var Gn,YS=new Uf(0),KS=typeof TextDecoder<"u"&&new TextDecoder,JS=0;try{KS.decode(YS,{stream:!0}),JS=1}catch{}const Ua={Footway:"black",Indoors:"grey",BridgeOrTunnel:"black",WithTraffic:"#4C3926",Crossing:"green",Severance:"red"},sx=["#CDE594","#80C6A3","#1F9EB7","#186290","#080C54"],ax=[1,4,7,10,13,15];var QS=Object.defineProperty,$S=(t,e,n)=>e in t?QS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,av=(t,e,n)=>($S(t,typeof e!="symbol"?e+"":e,n),n);function xf(){}function lx(t){return t()}function lv(){return Object.create(null)}function zm(t){t.forEach(lx)}function ux(t){return typeof t=="function"}function tE(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function eE(t){return Object.keys(t).length===0}function nE(t,e){t.appendChild(e)}function iE(t,e,n){t.insertBefore(e,n||null)}function cx(t){t.parentNode&&t.parentNode.removeChild(t)}function uv(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function eu(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function rE(t){return Array.from(t.childNodes)}function rm(t,e,n){t.classList.toggle(e,!!n)}let q_;function _f(t){q_=t}const yh=[],cv=[];let bh=[];const hv=[],oE=Promise.resolve();let y_=!1;function sE(){y_||(y_=!0,oE.then(hx))}function v_(t){bh.push(t)}const a_=new Set;let dh=0;function hx(){if(dh!==0)return;const t=q_;do{try{for(;dht.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),bh=e}const uE=new Set;function cE(t,e){t&&t.i&&(uE.delete(t),t.i(e))}function hE(t,e,n){const{fragment:i,after_update:s}=t.$$;i&&i.m(e,n),v_(()=>{const c=t.$$.on_mount.map(lx).filter(ux);t.$$.on_destroy?t.$$.on_destroy.push(...c):zm(c),t.$$.on_mount=[]}),s.forEach(v_)}function pE(t,e){const n=t.$$;n.fragment!==null&&(lE(n.after_update),zm(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function fE(t,e){t.$$.dirty[0]===-1&&(yh.push(t),sE(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const O=V.length?V[0]:A;return w.ctx&&s(w.ctx[L],w.ctx[L]=O)&&(!w.skip_bound&&w.bound[L]&&w.bound[L](O),E&&fE(t,L)),A}):[],w.update(),E=!0,zm(w.before_update),w.fragment=i?i(w.ctx):!1,e.target){if(e.hydrate){const L=rE(e.target);w.fragment&&w.fragment.l(L),L.forEach(cx)}else w.fragment&&w.fragment.c();e.intro&&cE(t.$$.fragment),hE(t,e.target,e.anchor),hx()}_f(x)}class mE{constructor(){av(this,"$$"),av(this,"$$set")}$destroy(){pE(this,1),this.$destroy=xf}$on(e,n){if(!ux(n))return xf;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const s=i.indexOf(n);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!eE(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const gE="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(gE);function _E(t){let e,n,i;return{c(){e=uv("svg"),n=uv("path"),eu(n,"stroke-width","4"),eu(n,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),eu(n,"class","svelte-gzo3ar"),eu(e,"width",i=t[0]==="list"?20:void 0),eu(e,"viewBox","0 0 70 85"),eu(e,"fill","none"),eu(e,"class","svelte-gzo3ar"),rm(e,"in-map",t[0]!=="list"),rm(e,"list-icon",t[0]==="list")},m(s,c){iE(s,e,c),nE(e,n)},p(s,[c]){c&1&&i!==(i=s[0]==="list"?20:void 0)&&eu(e,"width",i),c&1&&rm(e,"in-map",s[0]!=="list"),c&1&&rm(e,"list-icon",s[0]==="list")},i:xf,o:xf,d(s){s&&cx(e)}}}function yE(t,e,n){let{displayIn:i}=e;return t.$$set=s=>{"displayIn"in s&&n(0,i=s.displayIn)},[i]}class vE extends mE{constructor(e){super(),dE(this,e,yE,_E,tE,{displayIn:0})}}const xE=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],bE={decimalLatitude:40.123,decimalLongitude:-74.123},wE=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],SE=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222}];function EE(){const t=[];return xE.forEach(e=>{e.decimalLatitude?t.push(e):t.push({...e,...bE})}),[...t,...wE,...SE]}const IE=EE();IE.map(t=>t.verbatimCoordinates);/** + * splaytree v3.1.2 + * Fast Splay tree for Node and browser + * + * @author Alexander Milevski + * @license MIT + * @preserve + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */function CE(t,e){var n={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},i,s,c,p;return p={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function u(w){return function(E){return x([w,E])}}function x(w){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,s&&(c=w[0]&2?s.return:w[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,w[1])).done)return c;switch(s=0,c&&(w=[w[0]&2,c.value]),w[0]){case 0:case 1:c=w;break;case 4:return n.label++,{value:w[1],done:!1};case 5:n.label++,s=w[1],w=[0];continue;case 7:w=n.ops.pop(),n.trys.pop();continue;default:if(c=n.trys,!(c=c.length>0&&c[c.length-1])&&(w[0]===6||w[0]===2)){n=0;continue}if(w[0]===3&&(!c||w[1]>c[0]&&w[1]e?1:t0){if(e.right===null)break;if(n(t,e.right.key)>0){var u=e.right;if(e.right=u.left,u.left=e,e=u,e.right===null)break}s.right=e,s=e,e=e.right}else break}return s.right=e.left,c.left=e.right,e.left=i.right,e.right=i.left,e}function l_(t,e,n,i){var s=new cu(t,e);if(n===null)return s.left=s.right=null,s;n=ru(t,n,i);var c=i(t,n.key);return c<0?(s.left=n.left,s.right=n,n.left=null):c>=0&&(s.right=n.right,s.left=n,n.right=null),s}function pv(t,e,n){var i=null,s=null;if(e){e=ru(t,e,n);var c=n(e.key,t);c===0?(i=e.left,s=e.right):c<0?(s=e.right,e.right=null,i=e):(i=e.left,e.left=null,s=e)}return{left:i,right:s}}function LE(t,e,n){return e===null?t:(t===null||(e=ru(t.key,e,n),e.left=t),e)}function x_(t,e,n,i,s){if(t){i(""+e+(n?"└── ":"├── ")+s(t)+` +`);var c=e+(n?" ":"│ ");t.left&&x_(t.left,c,!1,i,s),t.right&&x_(t.right,c,!0,i,s)}}var j_=function(){function t(e){e===void 0&&(e=TE),this._root=null,this._size=0,this._comparator=e}return t.prototype.insert=function(e,n){return this._size++,this._root=l_(e,n,this._root,this._comparator)},t.prototype.add=function(e,n){var i=new cu(e,n);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var s=this._comparator,c=ru(e,this._root,s),p=s(e,c.key);return p===0?this._root=c:(p<0?(i.left=c.left,i.right=c,c.left=null):p>0&&(i.right=c.right,i.left=c,c.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},t.prototype._remove=function(e,n,i){var s;if(n===null)return null;n=ru(e,n,i);var c=i(e,n.key);return c===0?(n.left===null?s=n.right:(s=ru(e,n.left,i),s.right=n.right),this._size--,s):n},t.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=ru(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},t.prototype.findStatic=function(e){for(var n=this._root,i=this._comparator;n;){var s=i(e,n.key);if(s===0)return n;s<0?n=n.left:n=n.right}return null},t.prototype.find=function(e){return this._root&&(this._root=ru(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},t.prototype.contains=function(e){for(var n=this._root,i=this._comparator;n;){var s=i(e,n.key);if(s===0)return!0;s<0?n=n.left:n=n.right}return!1},t.prototype.forEach=function(e,n){for(var i=this._root,s=[],c=!1;!c;)i!==null?(s.push(i),i=i.left):s.length!==0?(i=s.pop(),e.call(n,i),i=i.right):c=!0;return this},t.prototype.range=function(e,n,i,s){for(var c=[],p=this._comparator,u=this._root,x;c.length!==0||u;)if(u)c.push(u),u=u.left;else{if(u=c.pop(),x=p(u.key,n),x>0)break;if(p(u.key,e)>=0&&i.call(s,u))return this;u=u.right}return this},t.prototype.keys=function(){var e=[];return this.forEach(function(n){var i=n.key;return e.push(i)}),e},t.prototype.values=function(){var e=[];return this.forEach(function(n){var i=n.data;return e.push(i)}),e},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},t.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},t.prototype.at=function(e){for(var n=this._root,i=!1,s=0,c=[];!i;)if(n)c.push(n),n=n.left;else if(c.length>0){if(n=c.pop(),s===e)return n;s++,n=n.right}else i=!0;return null},t.prototype.next=function(e){var n=this._root,i=null;if(e.right){for(i=e.right;i.left;)i=i.left;return i}for(var s=this._comparator;n;){var c=s(e.key,n.key);if(c===0)break;c<0?(i=n,n=n.left):n=n.right}return i},t.prototype.prev=function(e){var n=this._root,i=null;if(e.left!==null){for(i=e.left;i.right;)i=i.right;return i}for(var s=this._comparator;n;){var c=s(e.key,n.key);if(c===0)break;c<0?n=n.left:(i=n,n=n.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return PE(this._root)},t.prototype.load=function(e,n,i){n===void 0&&(n=[]),i===void 0&&(i=!1);var s=e.length,c=this._comparator;if(i&&S_(e,n,0,s-1,c),this._root===null)this._root=b_(e,n,0,s),this._size=s;else{var p=AE(this.toList(),ME(e,n),c);s=this._size+s,this._root=w_({head:p},0,s)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){e===void 0&&(e=function(i){return String(i.key)});var n=[];return x_(this._root,"",!0,function(i){return n.push(i)},e),n.join("")},t.prototype.update=function(e,n,i){var s=this._comparator,c=pv(e,this._root,s),p=c.left,u=c.right;s(e,n)<0?u=l_(n,i,u,s):p=l_(n,i,p,s),this._root=LE(p,u,s)},t.prototype.split=function(e){return pv(e,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var e,n,i;return CE(this,function(s){switch(s.label){case 0:e=this._root,n=[],i=!1,s.label=1;case 1:return i?[3,6]:e===null?[3,2]:(n.push(e),e=e.left,[3,5]);case 2:return n.length===0?[3,4]:(e=n.pop(),[4,e]);case 3:return s.sent(),e=e.right,[3,5];case 4:i=!0,s.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function b_(t,e,n,i){var s=i-n;if(s>0){var c=n+Math.floor(s/2),p=t[c],u=e[c],x=new cu(p,u);return x.left=b_(t,e,n,c),x.right=b_(t,e,c+1,i),x}return null}function ME(t,e){for(var n=new cu(null,null),i=n,s=0;s0?(e=c=c.next=n.pop(),e=e.right):i=!0;return c.next=null,s.next}function w_(t,e,n){var i=n-e;if(i>0){var s=e+Math.floor(i/2),c=w_(t,e,s),p=t.head;return p.left=c,t.head=t.head.next,p.right=w_(t,s+1,n),p}return null}function AE(t,e,n){for(var i=new cu(null,null),s=i,c=t,p=e;c!==null&&p!==null;)n(c.key,p.key)<0?(s.next=c,c=c.next):(s.next=p,p=p.next),s=s.next;return c!==null?s.next=c:p!==null&&(s.next=p),i.next}function S_(t,e,n,i,s){if(!(n>=i)){for(var c=t[n+i>>1],p=n-1,u=i+1;;){do p++;while(s(t[p],c)<0);do u--;while(s(t[u],c)>0);if(p>=u)break;var x=t[p];t[p]=t[u],t[u]=x,x=e[p],e[p]=e[u],e[u]=x}S_(t,e,n,u,s),S_(t,e,u+1,i,s)}}function Qs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fv(t,e){for(var n=0;nn.x?1:e.yn.y?1:0}}]);function t(e,n){Qs(this,t),e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=n}return Oo(t,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var n=e.point.events,i=0,s=n.length;i=0&&L>=0?wA?-1:0:x<0&&L<0?wA?1:0:Lx?1:0}}}]),t}(),OE=0,xm=function(){Oo(t,null,[{key:"compare",value:function(e,n){var i=e.leftSE.point.x,s=n.leftSE.point.x,c=e.rightSE.point.x,p=n.rightSE.point.x;if(pu&&x>w)return-1;var L=e.comparePoint(n.leftSE.point);if(L<0)return 1;if(L>0)return-1;var A=n.comparePoint(e.rightSE.point);return A!==0?A:-1}if(i>s){if(ux&&u>E)return 1;var V=n.comparePoint(e.leftSE.point);if(V!==0)return V;var O=e.comparePoint(n.rightSE.point);return O<0?1:O>0?-1:1}if(ux)return 1;if(cp){var Y=e.comparePoint(n.rightSE.point);if(Y<0)return 1;if(Y>0)return-1}if(c!==p){var $=w-u,U=c-i,G=E-x,X=p-s;if($>U&&GX)return-1}return c>p?1:cE?1:e.idn.id?1:0}}]);function t(e,n,i,s){Qs(this,t),this.id=++OE,this.leftSE=e,e.segment=this,e.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=e,this.rings=i,this.windings=s}return Oo(t,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:en?e:n}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var n=this.leftSE.point,i=this.rightSE.point,s=this.vector();if(n.x===i.x)return e.x===n.x?0:e.x0&&u.swapEvents(),Ba.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(s.checkForConsuming(),c.checkForConsuming()),n}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,i=this.windings.length;n0){var c=n;n=i,i=c}if(n.prev===i){var p=n;n=i,i=p}for(var u=0,x=i.rings.length;u0)s=n,c=e,p=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var x=new Ba(s,!0),w=new Ba(c,!1);return new t(x,w,[i],[p])}}]),t}(),yv=function(){function t(e,n,i){if(Qs(this,t),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=i,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var s=bf.round(e[0][0],e[0][1]);this.bbox={ll:{x:s.x,y:s.y},ur:{x:s.x,y:s.y}};for(var c=s,p=1,u=e.length;pthis.bbox.ur.x&&(this.bbox.ur.x=x.x),x.y>this.bbox.ur.y&&(this.bbox.ur.y=x.y),c=x)}(s.x!==c.x||s.y!==c.y)&&this.segments.push(xm.fromRing(c,s,this))}return Oo(t,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,i=this.segments.length;nthis.bbox.ur.x&&(this.bbox.ur.x=c.bbox.ur.x),c.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=c.bbox.ur.y),this.interiorRings.push(c)}this.multiPoly=n}return Oo(t,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),n=0,i=this.interiorRings.length;nthis.bbox.ur.x&&(this.bbox.ur.x=c.bbox.ur.x),c.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=c.bbox.ur.y),this.polys.push(c)}this.isSubject=n}return Oo(t,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,i=this.polys.length;n0&&(e=s)}for(var c=e.segment.prevInResult(),p=c?c.prevInResult():null;;){if(!c)return null;if(!p)return c.ringOut;if(p.ringOut!==c.ringOut)return p.ringOut.enclosingRing()!==c.ringOut?c.ringOut:c.ringOut.enclosingRing();c=p.prevInResult(),p=c?c.prevInResult():null}}}]),t}(),xv=function(){function t(e){Qs(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return Oo(t,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var n=0,i=this.interiorRings.length;n1&&arguments[1]!==void 0?arguments[1]:xm.compare;Qs(this,t),this.queue=e,this.tree=new j_(n),this.segments=[]}return Oo(t,[{key:"process",value:function(e){var n=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(n),i;var s=e.isLeft?this.tree.insert(n):this.tree.find(n);if(!s)throw new Error("Unable to find segment #".concat(n.id," ")+"[".concat(n.leftSE.point.x,", ").concat(n.leftSE.point.y,"] -> ")+"[".concat(n.rightSE.point.x,", ").concat(n.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var c=s,p=s,u=void 0,x=void 0;u===void 0;)c=this.tree.prev(c),c===null?u=null:c.key.consumedBy===void 0&&(u=c.key);for(;x===void 0;)p=this.tree.next(p),p===null?x=null:p.key.consumedBy===void 0&&(x=p.key);if(e.isLeft){var w=null;if(u){var E=u.getIntersection(n);if(E!==null&&(n.isAnEndpoint(E)||(w=E),!u.isAnEndpoint(E)))for(var L=this._splitSafely(u,E),A=0,V=L.length;A0?(this.tree.remove(n),i.push(e)):(this.segments.push(n),n.prev=u)}else{if(u&&x){var pt=u.getIntersection(x);if(pt!==null){if(!u.isAnEndpoint(pt))for(var ut=this._splitSafely(u,pt),Rt=0,yt=ut.length;Rtbv)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var X=new UE(O),at=O.size,vt=O.pop();vt;){var dt=vt.key;if(O.size===at){var pt=dt.segment;throw new Error("Unable to pop() ".concat(dt.isLeft?"left":"right"," SweepEvent ")+"[".concat(dt.point.x,", ").concat(dt.point.y,"] from segment #").concat(pt.id," ")+"[".concat(pt.leftSE.point.x,", ").concat(pt.leftSE.point.y,"] -> ")+"[".concat(pt.rightSE.point.x,", ").concat(pt.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(O.size>bv)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(X.segments.length>GE)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var ut=X.process(dt),Rt=0,yt=ut.length;Rt1?e-1:0),i=1;i1?e-1:0),i=1;i1?e-1:0),i=1;i1?e-1:0),i=1;in[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]e.x?1:this.ye.y?1:0};It.prototype.clone=function(){};It.prototype.copy=function(){return new It(this)};It.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};It.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)};It.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)};It.prototype.hashCode=function(){var t=17;return t=37*t+It.hashCode(this.x),t=37*t+It.hashCode(this.y),t};It.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z};It.prototype.interfaces_=function(){return[rs,Fm,os]};It.prototype.getClass=function(){return It};It.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=Ze.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}};fc.DimensionalComparator.get=function(){return wl};fc.serialVersionUID.get=function(){return 6683108902428367e3};fc.NULL_ORDINATE.get=function(){return Ze.NaN};fc.X.get=function(){return 0};fc.Y.get=function(){return 1};fc.Z.get=function(){return 2};Object.defineProperties(It,fc);var wl=function(t){if(this._dimensionsToTest=2,arguments.length!==0&&arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new Qn("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};wl.prototype.compare=function(t,e){var n=t,i=e,s=wl.compare(n.x,i.x);if(s!==0)return s;var c=wl.compare(n.y,i.y);if(c!==0)return c;if(this._dimensionsToTest<=2)return 0;var p=wl.compare(n.z,i.z);return p};wl.prototype.interfaces_=function(){return[Eh]};wl.prototype.getClass=function(){return wl};wl.compare=function(t,e){return te?1:Ze.isNaN(t)?Ze.isNaN(e)?0:-1:Ze.isNaN(e)?1:0};var Ih=function(){};Ih.prototype.create=function(){};Ih.prototype.interfaces_=function(){return[]};Ih.prototype.getClass=function(){return Ih};var Lt=function(){},Gf={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Lt.prototype.interfaces_=function(){return[]};Lt.prototype.getClass=function(){return Lt};Lt.toLocationSymbol=function(t){switch(t){case Lt.EXTERIOR:return"e";case Lt.BOUNDARY:return"b";case Lt.INTERIOR:return"i";case Lt.NONE:return"-"}throw new Qn("Unknown location value: "+t)};Gf.INTERIOR.get=function(){return 0};Gf.BOUNDARY.get=function(){return 1};Gf.EXTERIOR.get=function(){return 2};Gf.NONE.get=function(){return-1};Object.defineProperties(Lt,Gf);var Be=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},Fo=function(){},xx={LOG_10:{configurable:!0}};Fo.prototype.interfaces_=function(){return[]};Fo.prototype.getClass=function(){return Fo};Fo.log10=function(t){var e=Math.log(t);return Ze.isInfinite(e)||Ze.isNaN(e)?e:e/Fo.LOG_10};Fo.min=function(t,e,n,i){var s=t;return en?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],s=arguments[1],c=arguments[2];return ic?c:i}};Fo.wrap=function(t,e){return t<0?e- -t%e:t%e};Fo.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}else if(arguments.length===4){var s=arguments[0],c=arguments[1],p=arguments[2],u=arguments[3],x=s;return c>x&&(x=c),p>x&&(x=p),u>x&&(x=u),x}};Fo.average=function(t,e){return(t+e)/2};xx.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(Fo,xx);var $s=function(t){this.str=t};$s.prototype.append=function(t){this.str+=t};$s.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)};$s.prototype.toString=function(t){return this.str};var Us=function(t){this.value=t};Us.prototype.intValue=function(){return this.value};Us.prototype.compareTo=function(t){return this.valuet?1:0};Us.isNaN=function(t){return Number.isNaN(t)};var wf=function(){};wf.isWhitespace=function(t){return t<=32&&t>=0||t===127};wf.toUpperCase=function(t){return t.toUpperCase()};var Dt=function t(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if(typeof arguments[0]=="string"){var i=arguments[0];t.call(this,t.parse(i))}}else if(arguments.length===2){var s=arguments[0],c=arguments[1];this.init(s,c)}},Is={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Dt.prototype.le=function(t){return(this._hi9?(E=!0,L="9"):L="0"+w,p.append(L),n=n.subtract(Dt.valueOf(w)).multiply(Dt.TEN),E&&n.selfAdd(Dt.TEN);var A=!0,V=Dt.magnitude(n._hi);if(V<0&&Math.abs(V)>=u-x&&(A=!1),!A)break}return e[0]=i,p.toString()};Dt.prototype.sqr=function(){return this.multiply(this)};Dt.prototype.doubleValue=function(){return this._hi+this._lo};Dt.prototype.subtract=function(){if(arguments[0]instanceof Dt){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}};Dt.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}};Dt.prototype.isZero=function(){return this._hi===0&&this._lo===0};Dt.prototype.selfSubtract=function(){if(arguments[0]instanceof Dt){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}};Dt.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};Dt.prototype.min=function(t){return this.le(t)?this:t};Dt.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Dt){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,c=null,p=null,u=null,x=null,w=null,E=null,L=null;return x=this._hi/n,w=Dt.SPLIT*x,s=w-x,L=Dt.SPLIT*n,s=w-s,c=x-s,p=L-n,E=x*n,p=L-p,u=n-p,L=s*p-E+s*u+c*p+c*u,w=(this._hi-E-L+this._lo-x*i)/n,L=x+w,this._hi=L,this._lo=x-L+w,this}};Dt.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};Dt.prototype.divide=function(){if(arguments[0]instanceof Dt){var t=arguments[0],e=null,n=null,i=null,s=null,c=null,p=null,u=null,x=null;c=this._hi/t._hi,p=Dt.SPLIT*c,e=p-c,x=Dt.SPLIT*t._hi,e=p-e,n=c-e,i=x-t._hi,u=c*t._hi,i=x-i,s=t._hi-i,x=e*i-u+e*s+n*i+n*s,p=(this._hi-u-x+this._lo-c*t._lo)/t._hi,x=c+p;var w=x,E=c-x+p;return new Dt(w,E)}else if(typeof arguments[0]=="number"){var L=arguments[0];return Ze.isNaN(L)?Dt.createNaN():Dt.copy(this).selfDivide(L,0)}};Dt.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo};Dt.prototype.pow=function(t){if(t===0)return Dt.valueOf(1);var e=new Dt(this),n=Dt.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n};Dt.prototype.ceil=function(){if(this.isNaN())return Dt.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new Dt(t,e)};Dt.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0};Dt.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()};Dt.prototype.setValue=function(){if(arguments[0]instanceof Dt){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}};Dt.prototype.max=function(t){return this.ge(t)?this:t};Dt.prototype.sqrt=function(){if(this.isZero())return Dt.valueOf(0);if(this.isNegative())return Dt.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=Dt.valueOf(e),i=this.subtract(n.sqr()),s=i._hi*(t*.5);return n.add(s)};Dt.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Dt){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,i=null,s=null,c=null,p=null,u=null;return s=this._hi+e,p=s-this._hi,c=s-p,c=e-p+(this._hi-c),u=c+this._lo,n=s+u,i=u+(s-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var x=arguments[0],w=arguments[1],E=null,L=null,A=null,V=null,O=null,J=null,Y=null,$=null;O=this._hi+x,A=this._lo+w,Y=O-this._hi,$=A-this._lo,J=O-Y,V=A-$,J=x-Y+(this._hi-J),V=w-$+(this._lo-V),Y=J+A,E=O+Y,L=Y+(O-E),Y=V+L;var U=E+Y,G=Y+(E-U);return this._hi=U,this._lo=G,this}};Dt.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Dt){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,c=null,p=null,u=null,x=null,w=null;x=Dt.SPLIT*this._hi,s=x-this._hi,w=Dt.SPLIT*n,s=x-s,c=this._hi-s,p=w-n,x=this._hi*n,p=w-p,u=n-p,w=s*p-x+s*u+c*p+c*u+(this._hi*i+this._lo*n);var E=x+w;s=x-E;var L=w+s;return this._hi=E,this._lo=L,this}};Dt.prototype.selfSqr=function(){return this.selfMultiply(this)};Dt.prototype.floor=function(){if(this.isNaN())return Dt.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new Dt(t,e)};Dt.prototype.negate=function(){return this.isNaN()?this:new Dt(-this._hi,-this._lo)};Dt.prototype.clone=function(){};Dt.prototype.multiply=function(){if(arguments[0]instanceof Dt){var t=arguments[0];return t.isNaN()?Dt.createNaN():Dt.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return Ze.isNaN(e)?Dt.createNaN():Dt.copy(this).selfMultiply(e,0)}};Dt.prototype.isNaN=function(){return Ze.isNaN(this._hi)};Dt.prototype.intValue=function(){return Math.trunc(this._hi)};Dt.prototype.toString=function(){var t=Dt.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()};Dt.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,s=n;if(n.charAt(0)===".")s="0"+n;else if(i<0)s="0."+Dt.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var c=i-n.length,p=Dt.stringOfChar("0",c);s=n+p+".0"}return this.isNegative()?"-"+s:s};Dt.prototype.reciprocal=function(){var t=null,e=null,n=null,i=null,s=null,c=null,p=null,u=null;s=1/this._hi,c=Dt.SPLIT*s,t=c-s,u=Dt.SPLIT*this._hi,t=c-t,e=s-t,n=u-this._hi,p=s*this._hi,n=u-n,i=this._hi-n,u=t*n-p+t*i+e*n+e*i,c=(1-p-u-s*this._lo)/this._hi;var x=s+c,w=s-x+c;return new Dt(x,w)};Dt.prototype.toSciNotation=function(){if(this.isZero())return Dt.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=Dt.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var s="";n.length>1&&(s=n.substring(1));var c=n.charAt(0)+"."+s;return this.isNegative()?"-"+c+i:c+i};Dt.prototype.abs=function(){return this.isNaN()?Dt.NaN:this.isNegative()?this.negate():new Dt(this)};Dt.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0};Dt.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo};Dt.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0};Dt.prototype.trunc=function(){return this.isNaN()?Dt.NaN:this.isPositive()?this.floor():this.ceil()};Dt.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};Dt.prototype.interfaces_=function(){return[os,rs,Fm]};Dt.prototype.getClass=function(){return Dt};Dt.sqr=function(t){return Dt.valueOf(t).selfMultiply(t)};Dt.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return Dt.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new Dt(e)}};Dt.sqrt=function(t){return Dt.valueOf(t).sqrt()};Dt.parse=function(t){for(var e=0,n=t.length;wf.isWhitespace(t.charAt(e));)e++;var i=!1;if(e=n);){var w=t.charAt(e);if(e++,wf.isDigit(w)){var E=w-"0";c.selfMultiply(Dt.TEN),c.selfAdd(E),p++;continue}if(w==="."){u=p;continue}if(w==="e"||w==="E"){var L=t.substring(e);try{x=Us.parseInt(L)}catch(Y){throw Y instanceof Error?new Error("Invalid exponent "+L+" in string "+t):Y}finally{}break}throw new Error("Unexpected character '"+w+"' at position "+e+" in string "+t)}var A=c,V=p-u-x;if(V===0)A=c;else if(V>0){var O=Dt.TEN.pow(V);A=c.divide(O)}else if(V<0){var J=Dt.TEN.pow(-V);A=c.multiply(J)}return i?A.negate():A};Dt.createNaN=function(){return new Dt(Ze.NaN,Ze.NaN)};Dt.copy=function(t){return new Dt(t)};Dt.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n)),s=Math.pow(10,i);return s*10<=e&&(i+=1),i};Dt.stringOfChar=function(t,e){for(var n=new $s,i=0;i0){if(c<=0)return $r.signum(p);i=s+c}else if(s<0){if(c>=0)return $r.signum(p);i=-s-c}else return $r.signum(p);var u=$r.DP_SAFE_EPSILON*i;return p>=u||-p>=u?$r.signum(p):2};$r.signum=function(t){return t>0?1:t<0?-1:0};bx.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties($r,bx);var yn=function(){},qf={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};qf.X.get=function(){return 0};qf.Y.get=function(){return 1};qf.Z.get=function(){return 2};qf.M.get=function(){return 3};yn.prototype.setOrdinate=function(t,e,n){};yn.prototype.size=function(){};yn.prototype.getOrdinate=function(t,e){};yn.prototype.getCoordinate=function(){};yn.prototype.getCoordinateCopy=function(t){};yn.prototype.getDimension=function(){};yn.prototype.getX=function(t){};yn.prototype.clone=function(){};yn.prototype.expandEnvelope=function(t){};yn.prototype.copy=function(){};yn.prototype.getY=function(t){};yn.prototype.toCoordinateArray=function(){};yn.prototype.interfaces_=function(){return[Fm]};yn.prototype.getClass=function(){return yn};Object.defineProperties(yn,qf);var wx=function(){},Yh=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(wx),fr=function(){};fr.arraycopy=function(t,e,n,i,s){for(var c=0,p=e;pt._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,i=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}};Te.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Te){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||ithis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(nthis._maxx&&(this._maxx=n),ithis._maxy&&(this._maxy=i))}};Te.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0};Te.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)};Te.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};Te.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};Te.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};Te.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e};Te.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}};Te.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Te){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof It){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}};Te.prototype.centre=function(){return this.isNull()?null:new It((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};Te.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof It){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Te){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],c=arguments[1],p=arguments[2],u=arguments[3];st._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)};Te.prototype.hashCode=function(){var t=17;return t=37*t+It.hashCode(this._minx),t=37*t+It.hashCode(this._maxx),t=37*t+It.hashCode(this._miny),t=37*t+It.hashCode(this._maxy),t};Te.prototype.interfaces_=function(){return[rs,os]};Te.prototype.getClass=function(){return Te};Te.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],c=arguments[2],p=arguments[3],u=Math.min(c.x,p.x),x=Math.max(c.x,p.x),w=Math.min(i.x,s.x),E=Math.max(i.x,s.x);return!(w>x||Ex)||En?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}};ii.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};ii.prototype.setPrecisionModel=function(t){this._precisionModel=t};ii.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;ns?c=i:c=s;else{var p=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>s?c=p:c=u,c===0&&!t.equals(e)&&(c=Math.max(p,u))}return Je.isTrue(!(c===0&&!t.equals(e)),"Bad distance calculation"),c};ii.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,c=Math.sqrt(i*i+s*s);return Je.isTrue(!(c===0&&!t.equals(e)),"Invalid distance calculation"),c};dc.DONT_INTERSECT.get=function(){return 0};dc.DO_INTERSECT.get=function(){return 1};dc.COLLINEAR.get=function(){return 2};dc.NO_INTERSECTION.get=function(){return 0};dc.POINT_INTERSECTION.get=function(){return 1};dc.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(ii,dc);var xu=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(n){var i=new Te(this._inputLines[0][0],this._inputLines[0][1]),s=new Te(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&s.contains(n)},e.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];if(this._isProper=!1,Te.intersects(i,s,n)&&me.orientationIndex(i,s,n)===0&&me.orientationIndex(s,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(s))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION}else return t.prototype.computeIntersection.apply(this,arguments)},e.prototype.normalizeToMinimum=function(n,i,s,c,p){p.x=this.smallestInAbsValue(n.x,i.x,s.x,c.x),p.y=this.smallestInAbsValue(n.y,i.y,s.y,c.y),n.x-=p.x,n.y-=p.y,i.x-=p.x,i.y-=p.y,s.x-=p.x,s.y-=p.y,c.x-=p.x,c.y-=p.y},e.prototype.safeHCoordinateIntersection=function(n,i,s,c){var p=null;try{p=gs.intersection(n,i,s,c)}catch(u){if(u instanceof Yh)p=e.nearestEndpoint(n,i,s,c);else throw u}finally{}return p},e.prototype.intersection=function(n,i,s,c){var p=this.intersectionWithNormalization(n,i,s,c);return this.isInSegmentEnvelopes(p)||(p=new It(e.nearestEndpoint(n,i,s,c))),this._precisionModel!==null&&this._precisionModel.makePrecise(p),p},e.prototype.smallestInAbsValue=function(n,i,s,c){var p=n,u=Math.abs(p);return Math.abs(i)1e-4&&fr.out.println("Distance = "+p.distance(u))},e.prototype.intersectionWithNormalization=function(n,i,s,c){var p=new It(n),u=new It(i),x=new It(s),w=new It(c),E=new It;this.normalizeToEnvCentre(p,u,x,w,E);var L=this.safeHCoordinateIntersection(p,u,x,w);return L.x+=E.x,L.y+=E.y,L},e.prototype.computeCollinearIntersection=function(n,i,s,c){var p=Te.intersects(n,i,s),u=Te.intersects(n,i,c),x=Te.intersects(s,c,n),w=Te.intersects(s,c,i);return p&&u?(this._intPt[0]=s,this._intPt[1]=c,t.COLLINEAR_INTERSECTION):x&&w?(this._intPt[0]=n,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):p&&x?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!u&&!w?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):p&&w?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!u&&!x?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):u&&x?(this._intPt[0]=c,this._intPt[1]=n,c.equals(n)&&!p&&!w?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):u&&w?(this._intPt[0]=c,this._intPt[1]=i,c.equals(i)&&!p&&!x?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(n,i,s,c,p){var u=n.xi.x?n.x:i.x,E=n.y>i.y?n.y:i.y,L=s.xc.x?s.x:c.x,O=s.y>c.y?s.y:c.y,J=u>L?u:L,Y=wA?x:A,U=E0&&u>0||p<0&&u<0)return t.NO_INTERSECTION;var x=me.orientationIndex(s,c,n),w=me.orientationIndex(s,c,i);if(x>0&&w>0||x<0&&w<0)return t.NO_INTERSECTION;var E=p===0&&u===0&&x===0&&w===0;return E?this.computeCollinearIntersection(n,i,s,c):(p===0||u===0||x===0||w===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(c)?this._intPt[0]=n:i.equals2D(s)||i.equals2D(c)?this._intPt[0]=i:p===0?this._intPt[0]=new It(s):u===0?this._intPt[0]=new It(c):x===0?this._intPt[0]=new It(n):w===0&&(this._intPt[0]=new It(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,s,c)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(n,i,s,c){var p=n,u=me.distancePointLine(n,s,c),x=me.distancePointLine(i,s,c);return x0?n>0?-s:s:n>0?s:-s;if(e===0||n===0)return i>0?t>0?s:-s:t>0?-s:s;if(e>0?i>0?e<=i||(s=-s,c=t,t=n,n=c,c=e,e=i,i=c):e<=-i?(s=-s,n=-n,i=-i):(c=t,t=-n,n=c,c=e,e=-i,i=c):i>0?-e<=i?(s=-s,t=-t,e=-e):(c=-t,t=n,n=c,c=-e,e=i,i=c):e>=i?(t=-t,e=-e,n=-n,i=-i):(s=-s,c=-t,t=-n,n=c,c=-e,e=-i,i=c),t>0)if(n>0){if(!(t<=n))return s}else return s;else{if(n>0)return-s;if(t>=n)s=-s,t=-t,n=-n;else return-s}for(;;){if(p=Math.floor(n/t),n=n-p*t,i=i-p*e,i<0)return-s;if(i>e)return s;if(t>n+n){if(ei+i)return-s;n=t-n,i=e-i,s=-s}if(i===0)return n===0?0:-s;if(n===0||(p=Math.floor(t/n),t=t-p*n,e=e-p*i,e<0))return s;if(e>i)return-s;if(n>t+t){if(ie+e)return s;t=n-t,e=i-e,s=-s}if(e===0)return t===0?0:s;if(t===0)return-s}};var Bs=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};Bs.prototype.countSegment=function(t,e){if(t.xi&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var s=t.x-this._p.x,c=t.y-this._p.y,p=e.x-this._p.x,u=e.y-this._p.y,x=$u.signOfDet2x2(s,c,p,u);if(x===0)return this._isPointOnSegment=!0,null;u0&&this._crossingCount++}};Bs.prototype.isPointInPolygon=function(){return this.getLocation()!==Lt.EXTERIOR};Bs.prototype.getLocation=function(){return this._isPointOnSegment?Lt.BOUNDARY:this._crossingCount%2===1?Lt.INTERIOR:Lt.EXTERIOR};Bs.prototype.isOnSegment=function(){return this._isPointOnSegment};Bs.prototype.interfaces_=function(){return[]};Bs.prototype.getClass=function(){return Bs};Bs.locatePointInRing=function(){if(arguments[0]instanceof It&&Be(arguments[1],yn)){for(var t=arguments[0],e=arguments[1],n=new Bs(t),i=new It,s=new It,c=1;c1||x<0||x>1)&&(s=!0)}}return s?Fo.min(me.distancePointLine(t,n,i),me.distancePointLine(e,n,i),me.distancePointLine(n,t,e),me.distancePointLine(i,t,e)):0};me.isPointInRing=function(t,e){return me.locatePointInRing(t,e)!==Lt.EXTERIOR};me.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new It;t.getCoordinate(0,i);for(var s=i.x,c=i.y,p=1;pn.y&&(n=c,i=s)}var p=i;do p=p-1,p<0&&(p=e);while(t[p].equals2D(n)&&p!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(n)&&u!==i);var x=t[p],w=t[u];if(x.equals2D(n)||w.equals2D(n)||x.equals2D(w))return!1;var E=me.computeOrientation(x,n,w),L=!1;return E===0?L=x.x>w.x:L=E>0,L};me.locatePointInRing=function(t,e){return Bs.locatePointInRing(t,e)};me.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),s=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(s)*Math.sqrt(i)};me.computeOrientation=function(t,e,n){return me.orientationIndex(t,e,n)};me.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new Qn("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i=1)return c.distance(u);var E=((p.y-c.y)*(u.x-p.x)-(p.x-c.x)*(u.y-p.y))/x;return Math.abs(E)*Math.sqrt(x)}};me.isOnLine=function(t,e){for(var n=new xu,i=1;i0};Th.prototype.interfaces_=function(){return[es]};Th.prototype.getClass=function(){return Th};var Lh=function(){};Lh.prototype.isInBoundary=function(t){return t>1};Lh.prototype.interfaces_=function(){return[es]};Lh.prototype.getClass=function(){return Lh};var Mh=function(){};Mh.prototype.isInBoundary=function(t){return t===1};Mh.prototype.interfaces_=function(){return[es]};Mh.prototype.getClass=function(){return Mh};var ki=function(){};ki.prototype.add=function(){};ki.prototype.addAll=function(){};ki.prototype.isEmpty=function(){};ki.prototype.iterator=function(){};ki.prototype.size=function(){};ki.prototype.toArray=function(){};ki.prototype.remove=function(){};function W_(t){this.message=t||""}W_.prototype=new Error;W_.prototype.name="IndexOutOfBoundsException";var Kh=function(){};Kh.prototype.hasNext=function(){};Kh.prototype.next=function(){};Kh.prototype.remove=function(){};var _s=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(ki);function Jh(t){this.message=t||""}Jh.prototype=new Error;Jh.prototype.name="NoSuchElementException";var ue=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof ki&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,ki]},e.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},e.prototype.set=function(n,i){var s=this.array_[n];return this.array_[n]=i,s},e.prototype.iterator=function(){return new $E(this)},e.prototype.get=function(n){if(n<0||n>=this.size())throw new W_;return this.array_[n]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var n=this,i=[],s=0,c=this.array_.length;s=1){var w=this.get(this.size()-1);if(w.equals2D(u))return null}t.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var E=arguments[0],L=arguments[1];return this.add(E,L),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var A=arguments[0],V=arguments[1],O=arguments[2];if(O)for(var J=0;J=0;Y--)i.add(A[Y],V);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof It){var $=arguments[0],U=arguments[1],G=arguments[2];if(!G){var X=this.size();if(X>0){if($>0){var at=this.get($-1);if(at.equals2D(U))return null}if($Rt&&(yt=-1);for(var wt=ut;wt!==Rt;wt+=yt)i.add(dt[wt],pt);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new It(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(ue),sn=function(){},Vm={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Vm.ForwardComparator.get=function(){return Sf};Vm.BidirectionalComparator.get=function(){return Ph};Vm.coordArrayType.get=function(){return new Array(0).fill(null)};sn.prototype.interfaces_=function(){return[]};sn.prototype.getClass=function(){return sn};sn.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))};sn.ptNotInList=function(t,e){for(var n=0;n=t?e:[]};sn.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e};sn.extract=function(t,e,n){e=Fo.clamp(e,0,t.length),n=Fo.clamp(n,-1,t.length);var i=n-e+1;n<0&&(i=0),e>=t.length&&(i=0),ni.length)return 1;if(n.length===0)return 0;var s=sn.compare(n,i),c=sn.isEqualReversed(n,i);return c?0:s};Ph.prototype.OLDcompare=function(t,e){var n=t,i=e;if(n.lengthi.length)return 1;if(n.length===0)return 0;for(var s=sn.increasingDirection(n),c=sn.increasingDirection(i),p=s>0?0:n.length-1,u=c>0?0:n.length-1,x=0;x0)e=e.right;else return e.value}return null};br.prototype.put=function(t,e){if(this.root_===null)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Va,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n=this.root_,i,s;do if(i=n,s=t.compareTo(n.key),s<0)n=n.left;else if(s>0)n=n.right;else{var c=n.value;return n.value=e,c}while(n!==null);var p={key:t,left:null,right:null,value:e,parent:i,color:Va,getValue:function(){return this.value},getKey:function(){return this.key}};return s<0?i.left=p:i.right=p,this.fixAfterInsertion(p),this.size_++,null};br.prototype.fixAfterInsertion=function(t){var e=this;for(t.color=nu;t!=null&&t!==this.root_&&t.parent.color===nu;)if(Vn(t)===u_(Vn(Vn(t)))){var n=Iv(Vn(Vn(t)));Ev(n)===nu?(Na(Vn(t),Va),Na(n,Va),Na(Vn(Vn(t)),nu),t=Vn(Vn(t))):(t===Iv(Vn(t))&&(t=Vn(t),e.rotateLeft(t)),Na(Vn(t),Va),Na(Vn(Vn(t)),nu),e.rotateRight(Vn(Vn(t))))}else{var i=u_(Vn(Vn(t)));Ev(i)===nu?(Na(Vn(t),Va),Na(i,Va),Na(Vn(Vn(t)),nu),t=Vn(Vn(t))):(t===u_(Vn(t))&&(t=Vn(t),e.rotateRight(t)),Na(Vn(t),Va),Na(Vn(Vn(t)),nu),e.rotateLeft(Vn(Vn(t))))}this.root_.color=Va};br.prototype.values=function(){var t=new ue,e=this.getFirstEntry();if(e!==null)for(t.add(e.value);(e=br.successor(e))!==null;)t.add(e.value);return t};br.prototype.entrySet=function(){var t=new H_,e=this.getFirstEntry();if(e!==null)for(t.add(e);(e=br.successor(e))!==null;)t.add(e);return t};br.prototype.rotateLeft=function(t){if(t!=null){var e=t.right;t.right=e.left,e.left!=null&&(e.left.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}};br.prototype.rotateRight=function(t){if(t!=null){var e=t.left;t.left=e.right,e.right!=null&&(e.right.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}};br.prototype.getFirstEntry=function(){var t=this.root_;if(t!=null)for(;t.left!=null;)t=t.left;return t};br.successor=function(t){if(t===null)return null;if(t.right!==null){for(var e=t.right;e.left!==null;)e=e.left;return e}else{for(var n=t.parent,i=t;n!==null&&i===n.right;)i=n,n=n.parent;return n}};br.prototype.size=function(){return this.size_};var Ef=function(){};Ef.prototype.interfaces_=function(){return[]};Ef.prototype.getClass=function(){return Ef};function Ex(){}Ex.prototype=new Um;function Gs(){this.array_=[],arguments[0]instanceof ki&&this.addAll(arguments[0])}Gs.prototype=new Ex;Gs.prototype.contains=function(t){for(var e=this,n=0,i=this.array_.length;n=0;){var p=s.substring(0,c);i.add(p),s=s.substring(c+n),c=s.indexOf(e)}s.length>0&&i.add(s);for(var u=new Array(i.size()).fill(null),x=0;x0)for(var c=s;c0&&i.append(" ");for(var c=0;c0&&i.append(","),i.append($o.toString(t.getOrdinate(s,c)))}return i.append(")"),i.toString()}};_i.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return _i.createClosedRing(t,e,4);var i=e.getOrdinate(0,yn.X)===e.getOrdinate(n-1,yn.X)&&e.getOrdinate(0,yn.Y)===e.getOrdinate(n-1,yn.Y);return i?e:_i.createClosedRing(t,e,n+1)};_i.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),s=e.size();_i.copy(e,0,i,0,s);for(var c=s;c0&&_i.reverse(i._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?En.FALSE:0},e.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return me.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var i=this._points.copy();_i.reverse(i);var s=this.getFactory().createLineString(i);return s},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var s=arguments[0],c=s,p=0,u=0;p= 2)");this._points=i},e.prototype.isCoordinate=function(i){for(var s=this,c=0;c=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(li),ha=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Fe.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?t.prototype.equalsExact.call(this,i,s):!1}else return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,c=new Array(s).fill(null),p=0;p0?e.createPoint(n[0]):e.createPoint():t};Tf.prototype.interfaces_=function(){return[ns.GeometryEditorOperation]};Tf.prototype.getClass=function(){return Tf};var Lf=function(){};Lf.prototype.edit=function(t,e){return t instanceof ma?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof li?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof vo?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t};Lf.prototype.interfaces_=function(){return[ns.GeometryEditorOperation]};Lf.prototype.getClass=function(){return Lf};var mi=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n0){var e=new $s(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n3&&(i=3),i<2?new mi(n):new mi(n,i)}};ga.prototype.interfaces_=function(){return[Ih,os]};ga.prototype.getClass=function(){return ga};ga.instance=function(){return ga.instanceObject};Y_.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};Y_.instanceObject.get=function(){return new ga};Object.defineProperties(ga,Y_);var Cx=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(n){return this.map_.get(n)||null},e.prototype.put=function(n,i){return this.map_.set(n,i),i},e.prototype.values=function(){for(var n=new ue,i=this.map_.values(),s=i.next();!s.done;)n.add(s.value),s=i.next();return n},e.prototype.entrySet=function(){var n=new H_;return this.map_.entries().forEach(function(i){return n.add(i)}),n},e.prototype.size=function(){return this.map_.size()},e}(gc),Cn=function t(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=t.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof js){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var i=arguments[0];this._modelType=i._modelType,this._scale=i._scale}}},K_={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Cn.prototype.equals=function(t){if(!(t instanceof Cn))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale};Cn.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new Us(n).compareTo(new Us(i))};Cn.prototype.getScale=function(){return this._scale};Cn.prototype.isFloating=function(){return this._modelType===Cn.FLOATING||this._modelType===Cn.FLOATING_SINGLE};Cn.prototype.getType=function(){return this._modelType};Cn.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Cn.FLOATING?t="Floating":this._modelType===Cn.FLOATING_SINGLE?t="Floating-Single":this._modelType===Cn.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t};Cn.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(Ze.isNaN(t))return t;if(this._modelType===Cn.FLOATING_SINGLE){var e=t;return e}return this._modelType===Cn.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof It){var n=arguments[0];if(this._modelType===Cn.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}};Cn.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Cn.FLOATING?t=16:this._modelType===Cn.FLOATING_SINGLE?t=6:this._modelType===Cn.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t};Cn.prototype.setScale=function(t){this._scale=Math.abs(t)};Cn.prototype.interfaces_=function(){return[os,rs]};Cn.prototype.getClass=function(){return Cn};Cn.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e};K_.serialVersionUID.get=function(){return 7777263578777804e3};K_.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(Cn,K_);var js=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},J_={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};js.prototype.readResolve=function(){return js.nameToTypeMap.get(this._name)};js.prototype.toString=function(){return this._name};js.prototype.interfaces_=function(){return[os]};js.prototype.getClass=function(){return js};J_.serialVersionUID.get=function(){return-552860263173159e4};J_.nameToTypeMap.get=function(){return new Cx};Object.defineProperties(js,J_);Cn.Type=js;Cn.FIXED=new js("FIXED");Cn.FLOATING=new js("FLOATING");Cn.FLOATING_SINGLE=new js("FLOATING SINGLE");var on=function t(){this._precisionModel=new Cn,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?Be(arguments[0],Ih)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Cn&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Tx={serialVersionUID:{configurable:!0}};on.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new It(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new It(t.getMinX(),t.getMinY()),new It(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new It(t.getMinX(),t.getMinY()),new It(t.getMinX(),t.getMaxY()),new It(t.getMaxX(),t.getMaxY()),new It(t.getMaxX(),t.getMinY()),new It(t.getMinX(),t.getMinY())]),null)};on.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new li(this.getCoordinateSequenceFactory().create(t),this);if(Be(t,yn))return new li(t,this)}else return new li(this.getCoordinateSequenceFactory().create([]),this)};on.prototype.createMultiLineString=function(){if(arguments.length===0)return new hu(null,this);if(arguments.length===1){var t=arguments[0];return new hu(t,this)}};on.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,s=t.iterator();s.hasNext();){var c=s.next(),p=c.getClass();e===null&&(e=p),p!==e&&(n=!0),c.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(on.toGeometryArray(t));var u=t.iterator().next(),x=t.size()>1;if(x){if(u instanceof Fi)return this.createMultiPolygon(on.toPolygonArray(t));if(u instanceof li)return this.createMultiLineString(on.toLineStringArray(t));if(u instanceof vo)return this.createMultiPoint(on.toPointArray(t));Je.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u};on.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)};on.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof It){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(Be(arguments[0],yn)){var e=arguments[0];return new vo(e,this)}}};on.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};on.prototype.createPolygon=function(){if(arguments.length===0)return new Fi(null,null,this);if(arguments.length===1){if(Be(arguments[0],yn)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof ma){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];return new Fi(i,s,this)}};on.prototype.getSRID=function(){return this._SRID};on.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Or(null,this);if(arguments.length===1){var t=arguments[0];return new Or(t,this)}};on.prototype.createGeometry=function(t){var e=new ns(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})};on.prototype.getPrecisionModel=function(){return this._precisionModel};on.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(Be(arguments[0],yn)){var e=arguments[0];return new ma(e,this)}}};on.prototype.createMultiPolygon=function(){if(arguments.length===0)return new ha(null,this);if(arguments.length===1){var t=arguments[0];return new ha(t,this)}};on.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Ah(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Ah(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(Be(arguments[0],yn)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(i.size()).fill(null),c=0;c=this.size())throw new Error;return this.array_[t]};ta.prototype.push=function(t){return this.array_.push(t),t};ta.prototype.pop=function(t){if(this.array_.length===0)throw new Wm;return this.array_.pop()};ta.prototype.peek=function(){if(this.array_.length===0)throw new Wm;return this.array_[this.array_.length-1]};ta.prototype.empty=function(){return this.array_.length===0};ta.prototype.isEmpty=function(){return this.empty()};ta.prototype.search=function(t){return this.array_.indexOf(t)};ta.prototype.size=function(){return this.array_.length};ta.prototype.toArray=function(){for(var t=this,e=[],n=0,i=this.array_.length;n0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&i===me.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)};Zs.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var s=ne.LEFT;return i[e].ye._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=n[i])};Zs.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};Zs.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();i.isForward()&&e.checkForRightmostCoordinate(i)}Je.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===ne.LEFT&&(this._orientedDe=this._minDe.getSym())};Zs.prototype.interfaces_=function(){return[]};Zs.prototype.getClass=function(){return Zs};var Ha=function(t){function e(n,i){t.call(this,e.msgWithCoord(n,i)),this.pt=i?new It(i):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},e}(Za),Hm=function(){this.array_=[]};Hm.prototype.addLast=function(t){this.array_.push(t)};Hm.prototype.removeFirst=function(){return this.array_.shift()};Hm.prototype.isEmpty=function(){return this.array_.length===0};var Fr=function(){this._finder=null,this._dirEdgeList=new ue,this._nodes=new ue,this._rightMostCoord=null,this._env=null,this._finder=new Zs};Fr.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}};Fr.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};Fr.prototype.computeNodeDepth=function(t){for(var e=this,n=null,i=t.getEdges().iterator();i.hasNext();){var s=i.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new Ha("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var c=t.getEdges().iterator();c.hasNext();){var p=c.next();p.setVisited(!0),e.copySymDepths(p)}};Fr.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(ne.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)};Fr.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};Fr.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(ne.RIGHT)>=1&&e.getDepth(ne.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}};Fr.prototype.computeDepths=function(t){var e=this,n=new H_,i=new Hm,s=t.getNode();for(i.addLast(s),n.add(s),t.setVisited(!0);!i.isEmpty();){var c=i.removeFirst();n.add(c),e.computeNodeDepth(c);for(var p=c.getEdges().iterator();p.hasNext();){var u=p.next(),x=u.getSym();if(!x.isVisited()){var w=x.getNode();n.contains(w)||(i.addLast(w),n.add(w))}}}};Fr.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0};Fr.prototype.getEnvelope=function(){if(this._env===null){for(var t=new Te,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),s=0;sthis.location.length){var n=new Array(3).fill(null);n[ne.ON]=this.location[ne.ON],n[ne.LEFT]=Lt.NONE,n[ne.RIGHT]=Lt.NONE,this.location=n}for(var i=0;i1&&t.append(Lt.toLocationSymbol(this.location[ne.LEFT])),t.append(Lt.toLocationSymbol(this.location[ne.ON])),this.location.length>1&&t.append(Lt.toLocationSymbol(this.location[ne.RIGHT])),t.toString()};Un.prototype.setLocations=function(t,e,n){this.location[ne.ON]=t,this.location[ne.LEFT]=e,this.location[ne.RIGHT]=n};Un.prototype.get=function(t){return t1};Un.prototype.isAnyNull=function(){for(var t=this,e=0;et._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2};Ii.prototype.addPoints=function(t,e,n){var i=this,s=t.getCoordinates();if(e){var c=1;n&&(c=0);for(var p=c;p=0;x--)i._pts.add(s[x])}};Ii.prototype.isHole=function(){return this._isHole};Ii.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)};Ii.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!me.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var s=i.next();if(s.containsPoint(t))return!1}return!0};Ii.prototype.addHole=function(t){this._holes.add(t)};Ii.prototype.isShell=function(){return this._shell===null};Ii.prototype.getLabel=function(){return this._label};Ii.prototype.getEdges=function(){return this._edges};Ii.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};Ii.prototype.getShell=function(){return this._shell};Ii.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=e.getLocation(n,ne.RIGHT);if(i===Lt.NONE)return null;if(this._label.getLocation(n)===Lt.NONE)return this._label.setLocation(n,i),null}};Ii.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)};Ii.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),i=0;i=2,"found partial label"),this.computeIM(t)};Bo.prototype.isInResult=function(){return this._isInResult};Bo.prototype.isVisited=function(){return this._isVisited};Bo.prototype.interfaces_=function(){return[]};Bo.prototype.getClass=function(){return Bo};var Xm=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var n=arguments[0],i=arguments[1];this._coord=n,this._edges=i,this._label=new An(0,Lt.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(n){},e.prototype.computeMergedLocation=function(n,i){var s=Lt.NONE;if(s=this._label.getLocation(i),!n.isNull(i)){var c=n.getLocation(i);s!==Lt.BOUNDARY&&(s=c)}return s},e.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new An(n,i):this._label.setLocation(n,i)}else return t.prototype.setLabel.apply(this,arguments)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof e){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof An)for(var s=arguments[0],c=0;c<2;c++){var p=n.computeMergedLocation(s,c),u=n._label.getLocation(c);u===Lt.NONE&&n._label.setLocation(c,p)}},e.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},e.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=Lt.NONE;this._label!==null&&(i=this._label.getLocation(n));var s=null;switch(i){case Lt.BOUNDARY:s=Lt.INTERIOR;break;case Lt.INTERIOR:s=Lt.BOUNDARY;break;default:s=Lt.BOUNDARY;break}this._label.setLocation(n,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Bo),Ws=function(){this.nodeMap=new br,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Ws.prototype.find=function(t){return this.nodeMap.get(t)};Ws.prototype.addNode=function(){if(arguments[0]instanceof It){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof Xm){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}};Ws.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};Ws.prototype.iterator=function(){return this.nodeMap.values().iterator()};Ws.prototype.values=function(){return this.nodeMap.values()};Ws.prototype.getBoundaryNodes=function(t){for(var e=new ue,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===Lt.BOUNDARY&&e.add(i)}return e};Ws.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)};Ws.prototype.interfaces_=function(){return[]};Ws.prototype.getClass=function(){return Ws};var kn=function(){},Wf={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};kn.prototype.interfaces_=function(){return[]};kn.prototype.getClass=function(){return kn};kn.isNorthern=function(t){return t===kn.NE||t===kn.NW};kn.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2};kn.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var i=te?t:e;return i===0&&s===3?3:i};kn.isInHalfPlane=function(t,e){return e===kn.SE?t===kn.SE||t===kn.SW:t===e||t===e+1};kn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new Qn("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?kn.NE:kn.SE:e>=0?kn.NW:kn.SW}else if(arguments[0]instanceof It&&arguments[1]instanceof It){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new Qn("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?kn.NE:kn.SE:i.y>=n.y?kn.NW:kn.SW}};Wf.NE.get=function(){return 0};Wf.NW.get=function(){return 1};Wf.SW.get=function(){return 2};Wf.SE.get=function(){return 3};Object.defineProperties(kn,Wf);var wr=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],s=null;this._edge=e,this.init(n,i),this._label=s}else if(arguments.length===4){var c=arguments[0],p=arguments[1],u=arguments[2],x=arguments[3];this._edge=c,this.init(p,u),this._label=x}};wr.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){p.linkDirectedEdgesForMinimalEdgeRings();var u=p.buildMinimalRings(),x=i.findShell(u);x!==null?(i.placePolygonHoles(x,u),e.add(x)):n.addAll(u)}else s.add(p)}return s};xo.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1};xo.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new ue,i=t.iterator();i.hasNext();){var s=i.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var c=new cI(s,e._geometryFactory);n.add(c),c.setInResult()}}return n};xo.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}};xo.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t};xo.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),s=n.getCoordinateN(0),c=null,p=null,u=e.iterator();u.hasNext();){var x=u.next(),w=x.getLinearRing(),E=w.getEnvelopeInternal();c!==null&&(p=c.getLinearRing().getEnvelopeInternal());var L=!1;E.contains(i)&&me.isPointInRing(s,w.getCoordinates())&&(L=!0),L&&(c===null||p.contains(E))&&(c=x)}return c};xo.prototype.findShell=function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var s=i.next();s.isHole()||(n=s,e++)}return Je.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n};xo.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],n=arguments[1];ri.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),s=new ue,c=this.buildMinimalEdgeRings(i,this._shellList,s);this.sortShellsAndHoles(c,this._shellList,s),this.placeFreeHoles(this._shellList,s)}};xo.prototype.interfaces_=function(){return[]};xo.prototype.getClass=function(){return xo};var Dh=function(){};Dh.prototype.getBounds=function(){};Dh.prototype.interfaces_=function(){return[]};Dh.prototype.getClass=function(){return Dh};var xs=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};xs.prototype.getItem=function(){return this._item};xs.prototype.getBounds=function(){return this._bounds};xs.prototype.interfaces_=function(){return[Dh,os]};xs.prototype.getClass=function(){return xs};var Xa=function(){this._size=null,this._items=null,this._size=0,this._items=new ue,this._items.add(null)};Xa.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t};Xa.prototype.size=function(){return this._size};Xa.prototype.reorder=function(t){for(var e=this,n=null,i=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(i)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,i)};Xa.prototype.clear=function(){this._size=0,this._items.clear()};Xa.prototype.isEmpty=function(){return this._size===0};Xa.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)};Xa.prototype.interfaces_=function(){return[]};Xa.prototype.getClass=function(){return Xa};var Tl=function(){};Tl.prototype.visitItem=function(t){};Tl.prototype.interfaces_=function(){return[]};Tl.prototype.getClass=function(){return Tl};var tc=function(){};tc.prototype.insert=function(t,e){};tc.prototype.remove=function(t,e){};tc.prototype.query=function(){};tc.prototype.interfaces_=function(){return[]};tc.prototype.getClass=function(){return tc};var Ni=function(){if(this._childBoundables=new ue,this._bounds=null,this._level=null,arguments.length!==0&&arguments.length===1){var t=arguments[0];this._level=t}},Mx={serialVersionUID:{configurable:!0}};Ni.prototype.getLevel=function(){return this._level};Ni.prototype.size=function(){return this._childBoundables.size()};Ni.prototype.getChildBoundables=function(){return this._childBoundables};Ni.prototype.addChildBoundable=function(t){Je.isTrue(this._bounds===null),this._childBoundables.add(t)};Ni.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};Ni.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};Ni.prototype.interfaces_=function(){return[Dh,os]};Ni.prototype.getClass=function(){return Ni};Mx.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(Ni,Mx);var bs=function(){};bs.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}};bs.min=function(t){return bs.sort(t),t.get(0)};bs.sort=function(t,e){var n=t.toArray();e?lu.sort(n,e):lu.sort(n);for(var i=t.iterator(),s=0,c=n.length;swi.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new Qn("neither boundable is composite")};wi.prototype.isLeaves=function(){return!(wi.isComposite(this._boundable1)||wi.isComposite(this._boundable2))};wi.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0};wi.prototype.expand=function(t,e,n,i){for(var s=this,c=t.getChildBoundables(),p=c.iterator();p.hasNext();){var u=p.next(),x=new wi(u,e,s._itemDistance);x.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},Ym={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};ir.prototype.getNodeCapacity=function(){return this._nodeCapacity};ir.prototype.lastNode=function(t){return t.get(t.size()-1)};ir.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof Ni?n+=t.size(s):s instanceof xs&&(n+=1)}return n}};ir.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof xs&&s.getItem()===e&&(n=s)}return n!==null?(t.getChildBoundables().remove(n),!0):!1};ir.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new ue:e}else if(arguments.length===1){for(var n=arguments[0],i=new ue,s=n.getChildBoundables().iterator();s.hasNext();){var c=s.next();if(c instanceof Ni){var p=t.itemsTree(c);p!==null&&i.add(p)}else c instanceof xs?i.add(c.getItem()):Je.shouldNeverReachHere()}return i.size()<=0?null:i}};ir.prototype.insert=function(t,e){Je.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new xs(t,e))};ir.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new ue;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],c=arguments[2];if(Je.isTrue(i>-2),s.getLevel()===i)return c.add(s),null;for(var p=s.getChildBoundables().iterator();p.hasNext();){var u=p.next();u instanceof Ni?t.boundablesAtLevel(i,u,c):(Je.isTrue(u instanceof xs),i===-1&&c.add(u))}return null}};ir.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new ue;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,s)}else if(arguments.length===3){if(Be(arguments[2],Tl)&&arguments[0]instanceof Object&&arguments[1]instanceof Ni)for(var c=arguments[0],p=arguments[1],u=arguments[2],x=p.getChildBoundables(),w=0;wn&&(n=c)}}return n+1}};ir.prototype.createParentBoundables=function(t,e){var n=this;Je.isTrue(!t.isEmpty());var i=new ue;i.add(this.createNode(e));var s=new ue(t);bs.sort(s,this.getComparator());for(var c=s.iterator();c.hasNext();){var p=c.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(e)),n.lastNode(i).addChildBoundable(p)}return i};ir.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};ir.prototype.interfaces_=function(){return[os]};ir.prototype.getClass=function(){return ir};ir.compareDoubles=function(t,e){return t>e?1:t0);for(var p=new ue,u=0;u0;){var O=V.poll(),J=O.getDistance();if(J>=L)break;O.isLeaves()?(L=J,A=O):O.expandToQueue(V,L)}return[A.getBoundable(0).getItem(),A.getBoundable(1).getItem()]}}else if(arguments.length===3){var Y=arguments[0],$=arguments[1],U=arguments[2],G=new xs(Y,$),X=new wi(this.getRoot(),G,U);return this.nearestNeighbour(X)[0]}},e.prototype.interfaces_=function(){return[tc,os]},e.prototype.getClass=function(){return e},e.centreX=function(i){return e.avg(i.getMinX(),i.getMaxX())},e.avg=function(i,s){return(i+s)/2},e.centreY=function(i){return e.avg(i.getMinY(),i.getMaxY())},n.STRtreeNode.get=function(){return Cv},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[Eh]},compare:function(i,s){return t.compareDoubles(e.centreX(i.getBounds()),e.centreX(s.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[Eh]},compare:function(i,s){return t.compareDoubles(e.centreY(i.getBounds()),e.centreY(s.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(i,s){return i.intersects(s)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(ir),Cv=function(t){function e(){var n=arguments[0];t.call(this,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var s=i.next();n===null?n=new Te(s.getBounds()):n.expandToInclude(s.getBounds())}return n},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ni),Qr=function(){};Qr.prototype.interfaces_=function(){return[]};Qr.prototype.getClass=function(){return Qr};Qr.relativeSign=function(t,e){return te?1:0};Qr.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=Qr.relativeSign(e.x,n.x),s=Qr.relativeSign(e.y,n.y);switch(t){case 0:return Qr.compareValue(i,s);case 1:return Qr.compareValue(s,i);case 2:return Qr.compareValue(s,-i);case 3:return Qr.compareValue(-i,s);case 4:return Qr.compareValue(-i,-s);case 5:return Qr.compareValue(-s,-i);case 6:return Qr.compareValue(-s,i);case 7:return Qr.compareValue(i,-s)}return Je.shouldNeverReachHere("invalid octant value"),0};Qr.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Ll=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._segString=t,this.coord=new It(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))};Ll.prototype.getCoordinate=function(){return this.coord};Ll.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)};Ll.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:Qr.compare(this._segmentOctant,this.coord,e.coord)};Ll.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t};Ll.prototype.isInterior=function(){return this._isInterior};Ll.prototype.interfaces_=function(){return[rs]};Ll.prototype.getClass=function(){return Ll};var Br=function(){this._nodeMap=new br,this._edge=null;var t=arguments[0];this._edge=t};Br.prototype.getSplitCoordinates=function(){var t=this,e=new jf;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next();t.addEdgeCoordinates(i,s,e),i=s}return e.toCoordinateArray()};Br.prototype.addCollapsedNodes=function(){var t=this,e=new ue;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var i=n.next().intValue();t.add(t._edge.getCoordinate(i),i)}};Br.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};Br.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof It&&arguments[1]instanceof It){var s=arguments[0],c=arguments[1],p=c.x-s.x,u=c.y-s.y;if(p===0&&u===0)throw new Qn("Cannot compute the octant for two identical points "+s);return ec.octant(p,u)}};var _a=function(){};_a.prototype.getCoordinates=function(){};_a.prototype.size=function(){};_a.prototype.getCoordinate=function(t){};_a.prototype.isClosed=function(){};_a.prototype.setData=function(t){};_a.prototype.getData=function(){};_a.prototype.interfaces_=function(){return[]};_a.prototype.getClass=function(){return _a};var Mf=function(){};Mf.prototype.addIntersection=function(t,e){};Mf.prototype.interfaces_=function(){return[_a]};Mf.prototype.getClass=function(){return Mf};var yi=function(){this._nodeList=new Br(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};yi.prototype.getCoordinates=function(){return this._pts};yi.prototype.size=function(){return this._pts.length};yi.prototype.getCoordinate=function(t){return this._pts[t]};yi.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};yi.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))};yi.prototype.setData=function(t){this._data=t};yi.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ec.octant(t,e)};yi.prototype.getData=function(){return this._data};yi.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[3],c=new It(n.getIntersection(s));this.addIntersection(c,i)}};yi.prototype.toString=function(){return ys.toLineString(new mi(this._pts))};yi.prototype.getNodeList=function(){return this._nodeList};yi.prototype.addIntersectionNode=function(t,e){var n=e,i=n+1;if(i=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof It){var i=arguments[0];return me.orientationIndex(this.p0,this.p1,i)}};Le.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])};Le.prototype.isVertical=function(){return this.p0.x===this.p1.x};Le.prototype.equals=function(t){if(!(t instanceof Le))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)};Le.prototype.intersection=function(t){var e=new xu;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null};Le.prototype.project=function(){if(arguments[0]instanceof It){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new It(t);var e=this.projectionFactor(t),n=new It;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof Le){var i=arguments[0],s=this.projectionFactor(i.p0),c=this.projectionFactor(i.p1);if(s>=1&&c>=1||s<=0&&c<=0)return null;var p=this.project(i.p0);s<0&&(p=this.p0),s>1&&(p=this.p1);var u=this.project(i.p1);return c<0&&(u=this.p0),c>1&&(u=this.p1),new Le(p,u)}};Le.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};Le.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};Le.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1};Le.prototype.distancePerpendicular=function(t){return me.distancePointLinePerpendicular(t,this.p0,this.p1)};Le.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};Le.prototype.midPoint=function(){return Le.midPoint(this.p0,this.p1)};Le.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;if(i<=0)return Ze.NaN;var s=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i;return s};Le.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),i=Ze.MAX_VALUE,s=null,c=this.closestPoint(t.p0);i=c.distance(t.p0),n[0]=c,n[1]=t.p0;var p=this.closestPoint(t.p1);s=p.distance(t.p1),s0&&e<1)return this.project(t);var n=this.p0.distance(t),i=this.p1.distance(t);return n1||Ze.isNaN(e))&&(e=1),e};Le.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};Le.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};Le.prototype.distance=function(){if(arguments[0]instanceof Le){var t=arguments[0];return me.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof It){var e=arguments[0];return me.distancePointLine(e,this.p0,this.p1)}};Le.prototype.pointAlong=function(t){var e=new It;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e};Le.prototype.hashCode=function(){var t=Ze.doubleToLongBits(this.p0.x);t^=Ze.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=Ze.doubleToLongBits(this.p1.x);n^=Ze.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return e^i};Le.prototype.interfaces_=function(){return[rs,os]};Le.prototype.getClass=function(){return Le};Le.midPoint=function(t,e){return new It((t.x+e.x)/2,(t.y+e.y)/2)};Ax.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(Le,Ax);var Pf=function(){this.tempEnv1=new Te,this.tempEnv2=new Te,this._overlapSeg1=new Le,this._overlapSeg2=new Le};Pf.prototype.overlap=function(){if(arguments.length!==2&&arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}};Pf.prototype.interfaces_=function(){return[]};Pf.prototype.getClass=function(){return Pf};var bo=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i};bo.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]};bo.prototype.computeSelect=function(t,e,n,i){var s=this._pts[e],c=this._pts[n];if(i.tempEnv1.init(s,c),n-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var p=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var i=kn.quadrant(t[n],t[n+1]),s=e+1;sp.getId()&&(p.computeOverlaps(w,s),i._nOverlaps++),i._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return Tv},Object.defineProperties(e,n),e}(Af),Tv=function(t){function e(){t.call(this),this._si=null;var n=arguments[0];this._si=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],c=arguments[3],p=n.getContext(),u=s.getContext();this._si.processIntersections(p,i,u,c)}else return t.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Pf),In=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(i)}else if(arguments.length===4){var s=arguments[0],c=arguments[1],p=arguments[2],u=arguments[3];this.setQuadrantSegments(s),this.setEndCapStyle(c),this.setJoinStyle(p),this.setMitreLimit(u)}}},$a={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};In.prototype.getEndCapStyle=function(){return this._endCapStyle};In.prototype.isSingleSided=function(){return this._isSingleSided};In.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=In.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=In.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==In.JOIN_ROUND&&(this._quadrantSegments=In.DEFAULT_QUADRANT_SEGMENTS)};In.prototype.getJoinStyle=function(){return this._joinStyle};In.prototype.setJoinStyle=function(t){this._joinStyle=t};In.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t};In.prototype.getSimplifyFactor=function(){return this._simplifyFactor};In.prototype.getQuadrantSegments=function(){return this._quadrantSegments};In.prototype.setEndCapStyle=function(t){this._endCapStyle=t};In.prototype.getMitreLimit=function(){return this._mitreLimit};In.prototype.setMitreLimit=function(t){this._mitreLimit=t};In.prototype.setSingleSided=function(t){this._isSingleSided=t};In.prototype.interfaces_=function(){return[]};In.prototype.getClass=function(){return In};In.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)};$a.CAP_ROUND.get=function(){return 1};$a.CAP_FLAT.get=function(){return 2};$a.CAP_SQUARE.get=function(){return 3};$a.JOIN_ROUND.get=function(){return 1};$a.JOIN_MITRE.get=function(){return 2};$a.JOIN_BEVEL.get=function(){return 3};$a.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};$a.DEFAULT_MITRE_LIMIT.get=function(){return 5};$a.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(In,$a);var ui=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=me.COUNTERCLOCKWISE,this._inputLine=t||null},Hf={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};ui.prototype.isDeletable=function(t,e,n,i){var s=this._inputLine[t],c=this._inputLine[e],p=this._inputLine[n];return!this.isConcave(s,c,p)||!this.isShallow(s,c,p,i)?!1:this.isShallowSampled(s,c,t,n,i)};ui.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(n),s=!1;i=0;s--)n.addPt(t[s])};Vo.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return nMath.PI;)t-=dn.PI_TIMES_2;for(;t<=-Math.PI;)t+=dn.PI_TIMES_2;return t};dn.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=n.x-e.x,s=n.y-e.y;return Math.atan2(s,i)}};dn.isAcute=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,c=n.x-e.x,p=n.y-e.y,u=i*c+s*p;return u>0};dn.isObtuse=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,c=n.x-e.x,p=n.y-e.y,u=i*c+s*p;return u<0};dn.interiorAngle=function(t,e,n){var i=dn.angle(e,t),s=dn.angle(e,n);return Math.abs(s-i)};dn.normalizePositive=function(t){if(t<0){for(;t<0;)t+=dn.PI_TIMES_2;t>=dn.PI_TIMES_2&&(t=0)}else{for(;t>=dn.PI_TIMES_2;)t-=dn.PI_TIMES_2;t<0&&(t=0)}return t};dn.angleBetween=function(t,e,n){var i=dn.angle(e,t),s=dn.angle(e,n);return dn.diff(i,s)};dn.diff=function(t,e){var n=null;return tMath.PI&&(n=2*Math.PI-n),n};dn.toRadians=function(t){return t*Math.PI/180};dn.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?dn.COUNTERCLOCKWISE:n<0?dn.CLOCKWISE:dn.NONE};dn.angleBetweenOriented=function(t,e,n){var i=dn.angle(e,t),s=dn.angle(e,n),c=s-i;return c<=-Math.PI?c+dn.PI_TIMES_2:c>Math.PI?c-dn.PI_TIMES_2:c};_c.PI_TIMES_2.get=function(){return 2*Math.PI};_c.PI_OVER_2.get=function(){return Math.PI/2};_c.PI_OVER_4.get=function(){return Math.PI/4};_c.COUNTERCLOCKWISE.get=function(){return me.COUNTERCLOCKWISE};_c.CLOCKWISE.get=function(){return me.CLOCKWISE};_c.NONE.get=function(){return me.COLLINEAR};Object.defineProperties(dn,_c);var Zn=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Le,this._seg1=new Le,this._offset0=new Le,this._offset1=new Le,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new xu,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===In.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(i)},Xf={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Zn.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=me.computeOrientation(this._s0,this._s1,this._s2),i=n===me.CLOCKWISE&&this._side===ne.LEFT||n===me.COUNTERCLOCKWISE&&this._side===ne.RIGHT;n===0?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)};Zn.prototype.addLineEndCap=function(t,e){var n=new Le(t,e),i=new Le;this.computeOffsetSegment(n,ne.LEFT,this._distance,i);var s=new Le;this.computeOffsetSegment(n,ne.RIGHT,this._distance,s);var c=e.x-t.x,p=e.y-t.y,u=Math.atan2(p,c);switch(this._bufParams.getEndCapStyle()){case In.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,me.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case In.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(s.p1);break;case In.CAP_SQUARE:var x=new It;x.x=Math.abs(this._distance)*Math.cos(u),x.y=Math.abs(this._distance)*Math.sin(u);var w=new It(i.p1.x+x.x,i.p1.y+x.y),E=new It(s.p1.x+x.x,s.p1.y+x.y);this._segList.addPt(w),this._segList.addPt(E);break}};Zn.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t};Zn.prototype.addMitreJoin=function(t,e,n,i){var s=!0,c=null;try{c=gs.intersection(e.p0,e.p1,n.p0,n.p1);var p=i<=0?1:c.distance(t)/Math.abs(i);p>this._bufParams.getMitreLimit()&&(s=!1)}catch(u){if(u instanceof Yh)c=new It(0,0),s=!1;else throw u}finally{}s?this._segList.addPt(c):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())};Zn.prototype.addFilletCorner=function(t,e,n,i,s){var c=e.x-t.x,p=e.y-t.y,u=Math.atan2(p,c),x=n.x-t.x,w=n.y-t.y,E=Math.atan2(w,x);i===me.CLOCKWISE?u<=E&&(u+=2*Math.PI):u>=E&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,E,i,s),this._segList.addPt(n)};Zn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new It((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new It((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}};Zn.prototype.createCircle=function(t){var e=new It(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};Zn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)};Zn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Vo,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Zn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};Zn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===In.JOIN_BEVEL||this._bufParams.getJoinStyle()===In.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,me.CLOCKWISE,this._distance))};Zn.prototype.closeRing=function(){this._segList.closeRing()};Zn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};Zn.prototype.interfaces_=function(){return[]};Zn.prototype.getClass=function(){return Zn};Xf.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};Xf.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};Xf.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};Xf.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(Zn,Xf);var eo=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};eo.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,i=Math.abs(e),s=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],s):this.computeOffsetCurve(t,n,s);var c=s.getCoordinates();return n&&sn.reverse(c),c};eo.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var s=ui.simplify(t,-i),c=s.length-1;n.initSideSegments(s[c],s[c-1],ne.LEFT),n.addFirstSegment();for(var p=c-2;p>=0;p--)n.addNextSegment(s[p],!0)}else{n.addSegments(t,!1);var u=ui.simplify(t,i),x=u.length-1;n.initSideSegments(u[0],u[1],ne.LEFT),n.addFirstSegment();for(var w=2;w<=x;w++)n.addNextSegment(u[w],!0)}n.addLastSegment(),n.closeRing()};eo.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===ne.RIGHT&&(i=-i);var s=ui.simplify(t,i),c=s.length-1;n.initSideSegments(s[c-1],s[0],e);for(var p=1;p<=c;p++){var u=p!==1;n.addNextSegment(s[p],u)}n.closeRing()};eo.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=ui.simplify(t,n),s=i.length-1;e.initSideSegments(i[0],i[1],ne.LEFT);for(var c=2;c<=s;c++)e.addNextSegment(i[c],!0);e.addLastSegment(),e.addLineEndCap(i[s-1],i[s]);var p=ui.simplify(t,-n),u=p.length-1;e.initSideSegments(p[u],p[u-1],ne.LEFT);for(var x=u-2;x>=0;x--)e.addNextSegment(p[x],!0);e.addLastSegment(),e.addLineEndCap(p[1],p[0]),e.closeRing()};eo.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case In.CAP_ROUND:e.createCircle(t);break;case In.CAP_SQUARE:e.createSquare(t);break}};eo.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var s=e<0;this.computeSingleSidedBufferCurve(t,s,i)}else this.computeLineBufferCurve(t,i);var c=i.getCoordinates();return c};eo.prototype.getBufferParameters=function(){return this._bufParams};eo.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()};eo.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return eo.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()};eo.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var s=ui.simplify(t,-i),c=s.length-1;n.initSideSegments(s[c],s[c-1],ne.LEFT),n.addFirstSegment();for(var p=c-2;p>=0;p--)n.addNextSegment(s[p],!0)}else{var u=ui.simplify(t,i),x=u.length-1;n.initSideSegments(u[0],u[1],ne.LEFT),n.addFirstSegment();for(var w=2;w<=x;w++)n.addNextSegment(u[w],!0)}n.addLastSegment()};eo.prototype.getSegGen=function(t){return new Zn(this._precisionModel,this._bufParams,t)};eo.prototype.interfaces_=function(){return[]};eo.prototype.getClass=function(){return eo};eo.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;nc.getMaxY()||t.findStabbedSegments(e,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(Be(arguments[2],_s)&&arguments[0]instanceof It&&arguments[1]instanceof L_)for(var p=arguments[0],u=arguments[1],x=arguments[2],w=u.getEdge().getCoordinates(),E=0;Et._seg.p1.y&&t._seg.reverse();var L=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(Lt._seg.p1.y)&&me.computeOrientation(t._seg.p0,t._seg.p1,p)!==me.RIGHT){var A=u.getDepth(ne.LEFT);t._seg.p0.equals(w[E])||(A=u.getDepth(ne.RIGHT));var V=new fu(t._seg,A);x.add(V)}}else if(Be(arguments[2],_s)&&arguments[0]instanceof It&&Be(arguments[1],_s))for(var O=arguments[0],J=arguments[1],Y=arguments[2],$=J.iterator();$.hasNext();){var U=$.next();U.isForward()&&t.findStabbedSegments(O,U,Y)}}};nc.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=bs.min(e);return n._leftDepth};nc.prototype.interfaces_=function(){return[]};nc.prototype.getClass=function(){return nc};Dx.DepthSegment.get=function(){return fu};Object.defineProperties(nc,Dx);var fu=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new Le(t),this._leftDepth=e};fu.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)};fu.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)};fu.prototype.toString=function(){return this._upwardSeg.toString()};fu.prototype.interfaces_=function(){return[rs]};fu.prototype.getClass=function(){return fu};var Tn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Tn.prototype.area=function(){return Tn.area(this.p0,this.p1,this.p2)};Tn.prototype.signedArea=function(){return Tn.signedArea(this.p0,this.p1,this.p2)};Tn.prototype.interpolateZ=function(t){if(t===null)throw new Qn("Supplied point is null.");return Tn.interpolateZ(t,this.p0,this.p1,this.p2)};Tn.prototype.longestSideLength=function(){return Tn.longestSideLength(this.p0,this.p1,this.p2)};Tn.prototype.isAcute=function(){return Tn.isAcute(this.p0,this.p1,this.p2)};Tn.prototype.circumcentre=function(){return Tn.circumcentre(this.p0,this.p1,this.p2)};Tn.prototype.area3D=function(){return Tn.area3D(this.p0,this.p1,this.p2)};Tn.prototype.centroid=function(){return Tn.centroid(this.p0,this.p1,this.p2)};Tn.prototype.inCentre=function(){return Tn.inCentre(this.p0,this.p1,this.p2)};Tn.prototype.interfaces_=function(){return[]};Tn.prototype.getClass=function(){return Tn};Tn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)};Tn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2};Tn.det=function(t,e,n,i){return t*i-e*n};Tn.interpolateZ=function(t,e,n,i){var s=e.x,c=e.y,p=n.x-s,u=i.x-s,x=n.y-c,w=i.y-c,E=p*w-u*x,L=t.x-s,A=t.y-c,V=(w*L-u*A)/E,O=(-x*L+p*A)/E,J=e.z+V*(n.z-e.z)+O*(i.z-e.z);return J};Tn.longestSideLength=function(t,e,n){var i=t.distance(e),s=e.distance(n),c=n.distance(t),p=i;return s>p&&(p=s),c>p&&(p=c),p};Tn.isAcute=function(t,e,n){return!(!dn.isAcute(t,e,n)||!dn.isAcute(e,n,t)||!dn.isAcute(n,t,e))};Tn.circumcentre=function(t,e,n){var i=n.x,s=n.y,c=t.x-i,p=t.y-s,u=e.x-i,x=e.y-s,w=2*Tn.det(c,p,u,x),E=Tn.det(p,c*c+p*p,x,u*u+x*x),L=Tn.det(c,c*c+p*p,u,u*u+x*x),A=i-E/w,V=s+L/w;return new It(A,V)};Tn.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,s=new gs(t.x+n/2,t.y+i/2,1),c=new gs(t.x-i+n/2,t.y+n+i/2,1);return new gs(s,c)};Tn.angleBisector=function(t,e,n){var i=e.distance(t),s=e.distance(n),c=i/(i+s),p=n.x-t.x,u=n.y-t.y,x=new It(t.x+c*p,t.y+c*u);return x};Tn.area3D=function(t,e,n){var i=e.x-t.x,s=e.y-t.y,c=e.z-t.z,p=n.x-t.x,u=n.y-t.y,x=n.z-t.z,w=s*x-c*u,E=c*p-i*x,L=i*u-s*p,A=w*w+E*E+L*L,V=Math.sqrt(A)/2;return V};Tn.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,s=(t.y+e.y+n.y)/3;return new It(i,s)};Tn.inCentre=function(t,e,n){var i=e.distance(n),s=t.distance(n),c=t.distance(e),p=i+s+c,u=(i*t.x+s*e.x+c*n.x)/p,x=(i*t.y+s*e.y+c*n.y)/p;return new It(u,x)};var is=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new ue;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};is.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Lt.EXTERIOR,Lt.INTERIOR)};is.prototype.addPolygon=function(t){var e=this,n=this._distance,i=ne.LEFT;this._distance<0&&(n=-this._distance,i=ne.RIGHT);var s=t.getExteriorRing(),c=sn.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&c.length<3)return null;this.addPolygonRing(c,n,i,Lt.EXTERIOR,Lt.INTERIOR);for(var p=0;p0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(x,n,ne.opposite(i),Lt.INTERIOR,Lt.EXTERIOR)}};is.prototype.isTriangleErodedCompletely=function(t,e){var n=new Tn(t[0],t[1],t[2]),i=n.inCentre(),s=me.distancePointLine(i,n.p0,n.p1);return s=ma.MINIMUM_VALID_SIZE&&me.isCCW(t)&&(c=s,p=i,n=ne.opposite(n));var u=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(u,c,p)};is.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Fi?this.addPolygon(t):t instanceof li?this.addLineString(t):t instanceof vo?this.addPoint(t):t instanceof Ah?this.addCollection(t):t instanceof hu?this.addCollection(t):t instanceof ha?this.addCollection(t):t instanceof Or&&this.addCollection(t)};is.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),s=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>s};is.prototype.addCollection=function(t){for(var e=this,n=0;n=this._max)throw new Jh;var t=this._parent.getGeometryN(this._index++);return t instanceof Or?(this._subcollectionIterator=new pa(t),this._subcollectionIterator.next()):t};pa.prototype.remove=function(){throw new Error(this.getClass().getName())};pa.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)};pa.prototype.interfaces_=function(){return[Kh]};pa.prototype.getClass=function(){return pa};pa.isAtomic=function(t){return!(t instanceof Or)};var ko=function(){this._geom=null;var t=arguments[0];this._geom=t};ko.prototype.locate=function(t){return ko.locate(t,this._geom)};ko.prototype.interfaces_=function(){return[Nh]};ko.prototype.getClass=function(){return ko};ko.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?me.isPointInRing(t,e.getCoordinates()):!1};ko.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!ko.isPointInRing(t,n))return!1;for(var i=0;i=0;c--){var p=n._edgeList.get(c),u=p.getSym();s===null&&(s=u),i!==null&&u.setNext(i),i=p}s.setNext(i)},e.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var i=arguments[0],s=this.findIndex(i),c=i.getDepth(ne.LEFT),p=i.getDepth(ne.RIGHT),u=this.computeDepths(s+1,this._edgeList.size(),c),x=this.computeDepths(0,s,u);if(x!==p)throw new Ha("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var w=arguments[0],E=arguments[1],L=arguments[2],A=L,V=w;V=0;u--){var x=i._resultAreaEdgeList.get(u),w=x.getSym();switch(s===null&&x.getEdgeRing()===n&&(s=x),p){case i._SCANNING_FOR_INCOMING:if(w.getEdgeRing()!==n)continue;c=w,p=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(x.getEdgeRing()!==n)continue;c.setNextMin(x),p=i._SCANNING_FOR_INCOMING;break}}p===this._LINKING_TO_OUTGOING&&(Je.isTrue(s!==null,"found null for first outgoing dirEdge"),Je.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),c.setNextMin(s))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var s=i.next();s.isInResult()&&n++}return n}else if(arguments.length===1){for(var c=arguments[0],p=0,u=this.iterator();u.hasNext();){var x=u.next();x.getEdgeRing()===c&&p++}return p}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var n=Lt.NONE,i=this.iterator();i.hasNext();){var s=i.next(),c=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=Lt.INTERIOR;break}if(c.isInResult()){n=Lt.EXTERIOR;break}}}if(n===Lt.NONE)return null;for(var p=n,u=this.iterator();u.hasNext();){var x=u.next(),w=x.getSym();x.isLineEdge()?x.getEdge().setCovered(p===Lt.INTERIOR):(x.isInResult()&&(p=Lt.EXTERIOR),w.isInResult()&&(p=Lt.INTERIOR))}},e.prototype.computeLabelling=function(n){var i=this;t.prototype.computeLabelling.call(this,n),this._label=new An(Lt.NONE);for(var s=this.iterator();s.hasNext();)for(var c=s.next(),p=c.getEdge(),u=p.getLabel(),x=0;x<2;x++){var w=u.getLocation(x);(w===Lt.INTERIOR||w===Lt.BOUNDARY)&&i._label.setLocation(x,Lt.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Sr),Rx=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(n){return new Xm(n,new pI)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(kh),Ml=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Ml.prototype.compareTo=function(t){var e=t,n=Ml.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n};Ml.prototype.interfaces_=function(){return[rs]};Ml.prototype.getClass=function(){return Ml};Ml.orientation=function(t){return sn.increasingDirection(t)===1};Ml.compareOriented=function(t,e,n,i){for(var s=e?1:-1,c=i?1:-1,p=e?t.length:-1,u=i?n.length:-1,x=e?0:t.length-1,w=i?0:n.length-1;;){var E=t[x].compareTo(n[w]);if(E!==0)return E;x+=s,w+=c;var L=x===p,A=w===u;if(L&&!A)return-1;if(!L&&A)return 1;if(L&&A)return 0}};var ws=function(){this._edges=new ue,this._ocaMap=new br};ws.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n0&&t.print(","),t.print("(");for(var s=i.getCoordinates(),c=0;c0&&t.print(","),t.print(s[c].x+" "+s[c].y);t.println(")")}t.print(") ")};ws.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())};ws.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n0||!e.coord.equals2D(s);c||i--;var p=new Array(i).fill(null),u=0;p[u++]=new It(t.coord);for(var x=t.segmentIndex+1;x<=e.segmentIndex;x++)p[u++]=n.edge.pts[x];return c&&(p[u]=e.coord),new Em(p,new An(this.edge._label))};ya.prototype.add=function(t,e,n){var i=new Hs(t,e,n),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)};ya.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1};ya.prototype.interfaces_=function(){return[]};ya.prototype.getClass=function(){return ya};var mu=function(){};mu.prototype.getChainStartIndices=function(t){var e=this,n=0,i=new ue;i.add(new Us(n));do{var s=e.findChainEnd(t,n);i.add(new Us(s)),n=s}while(nn?e:n};Ya.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return en&&(s=1),t._depth[e][i]=s}}};pr.prototype.getDelta=function(t){return this._depth[t][ne.RIGHT]-this._depth[t][ne.LEFT]};pr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?Lt.EXTERIOR:Lt.INTERIOR};pr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};pr.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var i=1;i<3;i++){var s=e.getLocation(n,i);(s===Lt.EXTERIOR||s===Lt.INTERIOR)&&(t.isNull(n,i)?t._depth[n][i]=pr.depthAtLocation(s):t._depth[n][i]+=pr.depthAtLocation(s))}else if(arguments.length===3){var c=arguments[0],p=arguments[1],u=arguments[2];u===Lt.INTERIOR&&this._depth[c][p]++}};pr.prototype.interfaces_=function(){return[]};pr.prototype.getClass=function(){return pr};pr.depthAtLocation=function(t){return t===Lt.EXTERIOR?0:t===Lt.INTERIOR?1:pr.NULL_VALUE};Nx.NULL_VALUE.get=function(){return-1};Object.defineProperties(pr,Nx);var Em=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new ya(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new pr,this._depthDelta=0,arguments.length===1){var n=arguments[0];e.call(this,n,null)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.pts=i,this._label=s}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var i=new e(n,An.toLineLabel(this._label));return i},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(n){this._isIsolated=n},e.prototype.setName=function(n){this._name=n},e.prototype.equals=function(n){var i=this;if(!(n instanceof e))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var c=!0,p=!0,u=this.pts.length,x=0;x0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},e.prototype.print=function(n){var i=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s0&&n.print(","),n.print(i.pts[s].x+" "+i.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(n){e.updateIM(this._label,n)},e.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(n){var i=this;n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(i.pts[s]+" ");n.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Ya(this)),this._mce},e.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new Te;for(var i=0;i0&&i.append(","),i.append(n.pts[s].x+" "+n.pts[s].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},e.prototype.isPointwiseEqual=function(n){var i=this;if(this.pts.length!==n.pts.length)return!1;for(var s=0;si||this._maxyc;if(p)return!1;var u=this.intersectsToleranceSquare(t,e);return Je.isTrue(!(p&&u),"Found bad envelope test"),u};no.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new It(this._maxx,this._maxy),this._corner[1]=new It(this._minx,this._maxy),this._corner[2]=new It(this._minx,this._miny),this._corner[3]=new It(this._maxx,this._miny)};no.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))};no.prototype.scale=function(t){return Math.round(t*this._scaleFactor)};no.prototype.getCoordinate=function(){return this._originalPt};no.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)};no.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=no.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Te(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv};no.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))};no.prototype.intersectsToleranceSquare=function(t,e){var n=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&i||t.equals(this._pt)||e.equals(this._pt))};no.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(n,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1};no.prototype.interfaces_=function(){return[]};no.prototype.getClass=function(){return no};Ox.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(no,Ox);var kf=function(){this.tempEnv1=new Te,this.selectedSegment=new Le};kf.prototype.select=function(){if(arguments.length!==1&&arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}};kf.prototype.interfaces_=function(){return[]};kf.prototype.getClass=function(){return kf};var zh=function(){this._index=null;var t=arguments[0];this._index=t},Fx={HotPixelSnapAction:{configurable:!0}};zh.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],s=e.getSafeEnvelope(),c=new Bx(e,n,i);return this._index.query(s,{interfaces_:function(){return[Tl]},visitItem:function(p){var u=p;u.select(s,c)}}),c.isNodeAdded()}};zh.prototype.interfaces_=function(){return[]};zh.prototype.getClass=function(){return zh};Fx.HotPixelSnapAction.get=function(){return Bx};Object.defineProperties(zh,Fx);var Bx=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var n=arguments[0],i=arguments[1],s=arguments[2];this._hotPixel=n,this._parentEdge=i,this._hotPixelVertexIndex=s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],s=n.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,i)}else return t.prototype.select.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(kf),ic=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new ue};ic.prototype.processIntersections=function(t,e,n,i){var s=this;if(t===n&&e===i)return null;var c=t.getCoordinates()[e],p=t.getCoordinates()[e+1],u=n.getCoordinates()[i],x=n.getCoordinates()[i+1];if(this._li.computeIntersection(c,p,u,x),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var w=0;w=0;e--){try{t.bufferReducedPrecision(e)}catch(c){if(c instanceof Ha)t._saveException=c;else throw c}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],i=hr.precisionScaleFactor(this._argGeom,this._distance,n),s=new Cn(i);this.bufferFixedPrecision(s)}};hr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Cn.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()};hr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)};hr.prototype.bufferOriginalPrecision=function(){try{var t=new zr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Za)this._saveException=e;else throw e}finally{}};hr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry};hr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)};hr.prototype.interfaces_=function(){return[]};hr.prototype.getClass=function(){return hr};hr.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new hr(t),i=n.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Fe&&typeof arguments[1]=="number"){var s=arguments[0],c=arguments[1],p=arguments[2],u=new hr(s);u.setQuadrantSegments(p);var x=u.getResultGeometry(c);return x}else if(arguments[2]instanceof In&&arguments[0]instanceof Fe&&typeof arguments[1]=="number"){var w=arguments[0],E=arguments[1],L=arguments[2],A=new hr(w,L),V=A.getResultGeometry(E);return V}}else if(arguments.length===4){var O=arguments[0],J=arguments[1],Y=arguments[2],$=arguments[3],U=new hr(O);U.setQuadrantSegments(Y),U.setEndCapStyle($);var G=U.getResultGeometry(J);return G}};hr.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),s=Fo.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),c=e>0?e:0,p=s+2*c,u=Math.trunc(Math.log(p)/Math.log(10)+1),x=n-u,w=Math.pow(10,x);return w};Qh.CAP_ROUND.get=function(){return In.CAP_ROUND};Qh.CAP_BUTT.get=function(){return In.CAP_FLAT};Qh.CAP_FLAT.get=function(){return In.CAP_FLAT};Qh.CAP_SQUARE.get=function(){return In.CAP_SQUARE};Qh.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(hr,Qh);var Dr=function(){this._pt=[new It,new It],this._distance=Ze.NaN,this._isNull=!0};Dr.prototype.getCoordinates=function(){return this._pt};Dr.prototype.getCoordinate=function(t){return this._pt[t]};Dr.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);ithis._distance&&this.initialize(e,n,i)}};Dr.prototype.interfaces_=function(){return[]};Dr.prototype.getClass=function(){return Dr};var ua=function(){};ua.prototype.interfaces_=function(){return[]};ua.prototype.getClass=function(){return ua};ua.computeDistance=function(){if(arguments[2]instanceof Dr&&arguments[0]instanceof li&&arguments[1]instanceof It)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=t.getCoordinates(),s=new Le,c=0;c0||this._isIn?Lt.INTERIOR:Lt.EXTERIOR)};Ss.prototype.interfaces_=function(){return[]};Ss.prototype.getClass=function(){return Ss};var Rr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(arguments.length===3){var i=arguments[0],s=arguments[1],c=arguments[2];this._component=i,this._segIndex=s,this._pt=c}},Vx={INSIDE_AREA:{configurable:!0}};Rr.prototype.isInsideArea=function(){return this._segIndex===Rr.INSIDE_AREA};Rr.prototype.getCoordinate=function(){return this._pt};Rr.prototype.getGeometryComponent=function(){return this._component};Rr.prototype.getSegmentIndex=function(){return this._segIndex};Rr.prototype.interfaces_=function(){return[]};Rr.prototype.getClass=function(){return Rr};Vx.INSIDE_AREA.get=function(){return-1};Object.defineProperties(Rr,Vx);var El=function(t){this._pts=t||null};El.prototype.filter=function(t){t instanceof vo&&this._pts.add(t)};El.prototype.interfaces_=function(){return[qs]};El.prototype.getClass=function(){return El};El.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof vo?bs.singletonList(t):El.getPoints(t,new ue)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof vo?n.add(e):e instanceof Or&&e.apply(new El(n)),n}};var oc=function(){this._locations=null;var t=arguments[0];this._locations=t};oc.prototype.filter=function(t){(t instanceof vo||t instanceof li||t instanceof Fi)&&this._locations.add(new Rr(t,0,t.getCoordinate()))};oc.prototype.interfaces_=function(){return[qs]};oc.prototype.getClass=function(){return oc};oc.getLocations=function(t){var e=new ue;return t.apply(new oc(e)),e};var dr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ss,this._minDistanceLocation=null,this._minDistance=Ze.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=s}};dr.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=1-n,c=ja.getPolygons(this._geom[n]);if(c.size()>0){var p=oc.getLocations(this._geom[s]);if(this.computeContainmentDistance(p,c,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=i[0],this._minDistanceLocation[n]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&Be(arguments[0],_s)&&Be(arguments[1],_s)){for(var u=arguments[0],x=arguments[1],w=arguments[2],E=0;Ethis._minDistance)return null;for(var s=e.getCoordinates(),c=n.getCoordinate(),p=0;pthis._minDistance)return null;for(var V=E.getCoordinates(),O=L.getCoordinates(),J=0;Jthis._distance&&this.initialize(e,n,i)}};xr.prototype.interfaces_=function(){return[]};xr.prototype.getClass=function(){return xr};var zs=function(){};zs.prototype.interfaces_=function(){return[]};zs.prototype.getClass=function(){return zs};zs.computeDistance=function(){if(arguments[2]instanceof xr&&arguments[0]instanceof li&&arguments[1]instanceof It)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new Le,s=t.getCoordinates(),c=0;c1||t<=0)throw new Qn("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t};ts.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)};ts.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};ts.prototype.computeOrientedDistance=function(t,e,n){var i=new sc(e);if(t.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var s=new kl(e,this._densifyFrac);t.apply(s),n.setMaximum(s.getMaxPointDistance())}};ts.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};ts.prototype.interfaces_=function(){return[]};ts.prototype.getClass=function(){return ts};ts.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new ts(t,e);return n.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],c=arguments[2],p=new ts(i,s);return p.setDensifyFraction(c),p.distance()}};ey.MaxPointDistanceFilter.get=function(){return sc};ey.MaxDensifiedByFractionDistanceFilter.get=function(){return kl};Object.defineProperties(ts,ey);var sc=function(){this._maxPtDist=new xr,this._minPtDist=new xr,this._euclideanDist=new zs,this._geom=null;var t=arguments[0];this._geom=t};sc.prototype.filter=function(t){this._minPtDist.initialize(),zs.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};sc.prototype.getMaxPointDistance=function(){return this._maxPtDist};sc.prototype.interfaces_=function(){return[da]};sc.prototype.getClass=function(){return sc};var kl=function(){this._maxPtDist=new xr,this._minPtDist=new xr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};kl.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),s=t.getCoordinate(e),c=(s.x-i.x)/this._numSubSegs,p=(s.y-i.y)/this._numSubSegs,u=0;un){this._isValid=!1;var s=i.getCoordinates();this._errorLocation=s[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+ys.toLineString(s[0],s[1])+")"}};go.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=go.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),go.VERBOSE&&fr.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};go.prototype.checkNegativeValid=function(){if(!(this._input instanceof Fi||this._input instanceof ha||this._input instanceof Or))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)};go.prototype.getErrorIndicator=function(){return this._errorIndicator};go.prototype.checkMinimumDistance=function(t,e,n){var i=new dr(t,e,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")};mr.prototype.report=function(t){if(!mr.VERBOSE)return null;fr.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))};mr.prototype.getErrorMessage=function(){return this._errorMsg};mr.prototype.interfaces_=function(){return[]};mr.prototype.getClass=function(){return mr};mr.isValidMsg=function(t,e,n){var i=new mr(t,e,n);return i.isValid()?null:i.getErrorMessage()};mr.isValid=function(t,e,n){var i=new mr(t,e,n);return!!i.isValid()};iy.VERBOSE.get=function(){return!1};iy.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties(mr,iy);var Ys=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Ys.prototype.getCoordinates=function(){return this._pts};Ys.prototype.size=function(){return this._pts.length};Ys.prototype.getCoordinate=function(t){return this._pts[t]};Ys.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};Ys.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ec.octant(this.getCoordinate(t),this.getCoordinate(t+1))};Ys.prototype.setData=function(t){this._data=t};Ys.prototype.getData=function(){return this._data};Ys.prototype.toString=function(){return ys.toLineString(new mi(this._pts))};Ys.prototype.interfaces_=function(){return[_a]};Ys.prototype.getClass=function(){return Ys};var rr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new ue,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};rr.prototype.getInteriorIntersection=function(){return this._interiorIntersection};rr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t};rr.prototype.getIntersectionSegments=function(){return this._intSegments};rr.prototype.count=function(){return this._intersectionCount};rr.prototype.getIntersections=function(){return this._intersections};rr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};rr.prototype.setKeepIntersections=function(t){this._keepIntersections=t};rr.prototype.processIntersections=function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===i)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(t,e)||this.isEndSegment(n,i);if(!s)return null}var c=t.getCoordinates()[e],p=t.getCoordinates()[e+1],u=n.getCoordinates()[i],x=n.getCoordinates()[i+1];this._li.computeIntersection(c,p,u,x),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=c,this._intSegments[1]=p,this._intSegments[2]=u,this._intSegments[3]=x,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};rr.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2};rr.prototype.hasIntersection=function(){return this._interiorIntersection!==null};rr.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};rr.prototype.interfaces_=function(){return[du]};rr.prototype.getClass=function(){return rr};rr.createAllIntersectionsFinder=function(t){var e=new rr(t);return e.setFindAllIntersections(!0),e};rr.createAnyIntersectionFinder=function(t){return new rr(t)};rr.createIntersectionCounter=function(t){var e=new rr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Es=function(){this._li=new xu,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Es.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};Es.prototype.getIntersections=function(){return this._segInt.getIntersections()};Es.prototype.isValid=function(){return this.execute(),this._isValid};Es.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};Es.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new rr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new $_;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};Es.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ha(this.getErrorMessage(),this._segInt.getInteriorIntersection())};Es.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+ys.toLineString(t[0],t[1])+" and "+ys.toLineString(t[2],t[3])};Es.prototype.interfaces_=function(){return[]};Es.prototype.getClass=function(){return Es};Es.computeIntersections=function(t){var e=new Es(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var _u=function t(){this._nv=null;var e=arguments[0];this._nv=new Es(t.toSegmentStrings(e))};_u.prototype.checkValid=function(){this._nv.checkValid()};_u.prototype.interfaces_=function(){return[]};_u.prototype.getClass=function(){return _u};_u.toSegmentStrings=function(t){for(var e=new ue,n=t.iterator();n.hasNext();){var i=n.next();e.add(new Ys(i.getCoordinates(),i))}return e};_u.checkValid=function(t){var e=new _u(t);e.checkValid()};var ac=function(t){this._mapOp=t};ac.prototype.map=function(t){for(var e=this,n=new ue,i=0;i0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)};io.prototype.interfaces_=function(){return[]};io.prototype.getClass=function(){return io};var xa=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Le,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof li&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var i=arguments[0],s=arguments[1];this._srcPts=i,this._isClosed=t.isClosed(i),this._snapTolerance=s}};xa.prototype.snapVertices=function(t,e){for(var n=this,i=this._isClosed?t.size()-1:t.size(),s=0;s=0&&t.add(p+1,new It(c),!1)}};xa.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,i=Ze.MAX_VALUE,s=-1,c=0;ce&&(e=i)}return e}else if(arguments.length===2){var s=arguments[0],c=arguments[1];return Math.min(gi.computeOverlaySnapTolerance(s),gi.computeOverlaySnapTolerance(c))}};gi.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),i=n*gi.SNAP_PRECISION_FACTOR;return i};gi.snapToSelf=function(t,e,n){var i=new gi(t);return i.snapToSelf(e,n)};Ux.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(gi,Ux);var Gx=function(t){function e(n,i,s){t.call(this),this._snapTolerance=n||null,this._snapPts=i||null,this._isSelfSnap=s!==void 0?s:!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(n,i){var s=new xa(n,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(i)},e.prototype.transformCoordinates=function(n,i){var s=n.toCoordinateArray(),c=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(c)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(io),kr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};kr.prototype.getCommon=function(){return Ze.longBitsToDouble(this._commonBits)};kr.prototype.add=function(t){var e=Ze.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=kr.signExpBits(this._commonBits),this._isFirst=!1,null;var n=kr.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=kr.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=kr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};kr.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=Ze.longBitsToDouble(t),n=Ze.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+n,s=i.substring(i.length-64),c=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]";return c}};kr.prototype.interfaces_=function(){return[]};kr.prototype.getClass=function(){return kr};kr.getBit=function(t,e){var n=1<>52};kr.zeroLowerBits=function(t,e){var n=(1<=0;i--){if(kr.getBit(t,i)!==kr.getBit(e,i))return n;n++}return 52};var Dl=function(){this._commonCoord=null,this._ccFilter=new uc},ry={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Dl.prototype.addCommonBits=function(t){var e=new Rl(this._commonCoord);t.apply(e),t.geometryChanged()};Dl.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new It(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new Rl(e);return t.apply(n),t.geometryChanged(),t};Dl.prototype.getCommonCoordinate=function(){return this._commonCoord};Dl.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()};Dl.prototype.interfaces_=function(){return[]};Dl.prototype.getClass=function(){return Dl};ry.CommonCoordinateFilter.get=function(){return uc};ry.Translater.get=function(){return Rl};Object.defineProperties(Dl,ry);var uc=function(){this._commonBitsX=new kr,this._commonBitsY=new kr};uc.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)};uc.prototype.getCommonCoordinate=function(){return new It(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};uc.prototype.interfaces_=function(){return[da]};uc.prototype.getClass=function(){return uc};var Rl=function(){this.trans=null;var t=arguments[0];this.trans=t};Rl.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)};Rl.prototype.isDone=function(){return!1};Rl.prototype.isGeometryChanged=function(){return!0};Rl.prototype.interfaces_=function(){return[vs]};Rl.prototype.getClass=function(){return Rl};var or=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};or.prototype.selfSnap=function(t){var e=new gi(t),n=e.snapTo(t,this._snapTolerance);return n};or.prototype.removeCommonBits=function(t){this._cbr=new Dl,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e};or.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t};or.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Xe.overlayOp(e[0],e[1],t);return this.prepareResult(n)};or.prototype.checkValid=function(t){t.isValid()||fr.out.println("Snapped geometry is invalid")};or.prototype.computeSnapTolerance=function(){this._snapTolerance=gi.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};or.prototype.snap=function(t){var e=this.removeCommonBits(t),n=gi.snap(e[0],e[1],this._snapTolerance);return n};or.prototype.interfaces_=function(){return[]};or.prototype.getClass=function(){return or};or.overlayOp=function(t,e,n){var i=new or(t,e);return i.getResultGeometry(n)};or.union=function(t,e){return or.overlayOp(t,e,Xe.UNION)};or.intersection=function(t,e){return or.overlayOp(t,e,Xe.INTERSECTION)};or.symDifference=function(t,e){return or.overlayOp(t,e,Xe.SYMDIFFERENCE)};or.difference=function(t,e){return or.overlayOp(t,e,Xe.DIFFERENCE)};var Vr=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Vr.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=Xe.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(n=!0)}catch(c){if(c instanceof Za)i=c;else throw c}finally{}if(!n)try{e=or.overlayOp(this._geom[0],this._geom[1],t)}catch(c){throw c instanceof Za?i:c}finally{}return e};Vr.prototype.interfaces_=function(){return[]};Vr.prototype.getClass=function(){return Vr};Vr.overlayOp=function(t,e,n){var i=new Vr(t,e);return i.getResultGeometry(n)};Vr.union=function(t,e){return Vr.overlayOp(t,e,Xe.UNION)};Vr.intersection=function(t,e){return Vr.overlayOp(t,e,Xe.INTERSECTION)};Vr.symDifference=function(t,e){return Vr.overlayOp(t,e,Xe.SYMDIFFERENCE)};Vr.difference=function(t,e){return Vr.overlayOp(t,e,Xe.DIFFERENCE)};var Df=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Df.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)};Df.prototype.interfaces_=function(){return[]};Df.prototype.getClass=function(){return Df};var wo=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],c=arguments[2];this._eventType=t.INSERT,this._label=i,this._xValue=s,this._obj=c}},oy={INSERT:{configurable:!0},DELETE:{configurable:!0}};wo.prototype.isDelete=function(){return this._eventType===wo.DELETE};wo.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t};wo.prototype.getObject=function(){return this._obj};wo.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0};wo.prototype.getInsertEvent=function(){return this._insertEvent};wo.prototype.isInsert=function(){return this._eventType===wo.INSERT};wo.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label};wo.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};wo.prototype.interfaces_=function(){return[rs]};wo.prototype.getClass=function(){return wo};oy.INSERT.get=function(){return 1};oy.DELETE.get=function(){return 2};Object.defineProperties(wo,oy);var Im=function(){};Im.prototype.interfaces_=function(){return[]};Im.prototype.getClass=function(){return Im};var gr=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};gr.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(gr.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var s=t.getNumPoints()-1;if(e===0&&i===s||i===0&&e===s)return!0}}return!1};gr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};gr.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t};gr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};gr.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),s=i.getCoordinate();if(t.isIntersection(s))return!0}return!1};gr.prototype.hasProperIntersection=function(){return this._hasProper};gr.prototype.hasIntersection=function(){return this._hasIntersection};gr.prototype.isDone=function(){return this._isDone};gr.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))};gr.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e};gr.prototype.addIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var s=t.getCoordinates()[e],c=t.getCoordinates()[e+1],p=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,c,p,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))};gr.prototype.interfaces_=function(){return[]};gr.prototype.getClass=function(){return gr};gr.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var fI=function(t){function e(){t.call(this),this.events=new ue,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){var n=this;bs.sort(this.events);for(var i=0;ie||this._maxc?1:0};Rf.prototype.interfaces_=function(){return[Eh]};Rf.prototype.getClass=function(){return Rf};var dI=function(t){function e(){t.call(this),this._item=null;var n=arguments[0],i=arguments[1],s=arguments[2];this._min=n,this._max=i,this._item=s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;s.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ba),mI=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var n=arguments[0],i=arguments[1];this._node1=n,this._node2=i,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(n,i){this._min=Math.min(n._min,i._min),this._max=Math.max(n._max,i._max)},e.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;this._node1!==null&&this._node1.query(n,i,s),this._node2!==null&&this._node2.query(n,i,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ba),wa=function(){this._leaves=new ue,this._root=null,this._level=0};wa.prototype.buildTree=function(){var t=this;bs.sort(this._leaves,new ba.NodeComparator);for(var e=this._leaves,n=null,i=new ue;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);n=e,e=i,i=n}};wa.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new dI(t,e,n))};wa.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)};wa.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};wa.prototype.printNode=function(t){fr.out.println(ys.toLineString(new It(t._min,this._level),new It(t._max,this._level)))};wa.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};wa.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),i=new Array(n.size()).fill(null),s=0,c=n.iterator();c.hasNext();){var p=c.next();i[s++]=p.getCoordinate().copy()}return i},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(n,i,s){if(this.isBoundaryNode(n,i))return null;s===Lt.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,s)},e.prototype.addPolygonRing=function(n,i,s){if(n.isEmpty())return null;var c=sn.removeRepeatedPoints(n.getCoordinates());if(c.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=c[0],null;var p=i,u=s;me.isCCW(c)&&(p=s,u=i);var x=new Em(c,new An(this._argIndex,Lt.BOUNDARY,p,u));this._lineEdgeMap.put(n,x),this.insertEdge(x),this.insertPoint(this._argIndex,c[0],Lt.BOUNDARY)},e.prototype.insertPoint=function(n,i,s){var c=this._nodes.addNode(i),p=c.getLabel();p===null?c._label=new An(n,s):p.setLocation(n,s)},e.prototype.createEdgeSetIntersector=function(){return new fI},e.prototype.addSelfIntersectionNodes=function(n){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var c=s.next(),p=c.getLabel().getLocation(n),u=c.eiList.iterator();u.hasNext();){var x=u.next();i.addSelfIntersectionNode(n,x.coord,p)}},e.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof ha&&(this._useBoundaryDeterminationRule=!1),n instanceof Fi)this.addPolygon(n);else if(n instanceof li)this.addLineString(n);else if(n instanceof vo)this.addPoint(n);else if(n instanceof Ah)this.addCollection(n);else if(n instanceof hu)this.addCollection(n);else if(n instanceof ha)this.addCollection(n);else if(n instanceof Or)this.addCollection(n);else throw new Error(n.getClass().getName())}else return t.prototype.add.apply(this,arguments)},e.prototype.addCollection=function(n){for(var i=this,s=0;s50?(this._areaPtLocator===null&&(this._areaPtLocator=new Fh(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(n,i){return n.isInBoundary(i)?Lt.BOUNDARY:Lt.INTERIOR},e}(ri),Vh=function(){if(this._li=new xu,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new of(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=es.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new of(0,e,i),this._arg[1]=new of(1,n,i)}else if(arguments.length===3){var s=arguments[0],c=arguments[1],p=arguments[2];s.getPrecisionModel().compareTo(c.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(c.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new of(0,s,p),this._arg[1]=new of(1,c,p)}};Vh.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()};Vh.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)};Vh.prototype.interfaces_=function(){return[]};Vh.prototype.getClass=function(){return Vh};var uu=function(){};uu.prototype.interfaces_=function(){return[]};uu.prototype.getClass=function(){return uu};uu.map=function(){if(arguments[0]instanceof Fe&&Be(arguments[1],uu.MapOp)){for(var t=arguments[0],e=arguments[1],n=new ue,i=0;i=t.size()?null:t.get(e)};Si.union=function(t){var e=new Si(t);return e.union()};Zx.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(Si,Zx);var Cm=function(){};Cm.prototype.interfaces_=function(){return[]};Cm.prototype.getClass=function(){return Cm};Cm.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Xe.createEmptyResult(Xe.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Vr.overlayOp(t,e,Xe.UNION)};function bu(){return new Tm}function Tm(){this.reset()}Tm.prototype={constructor:Tm,reset:function(){this.s=this.t=0},add:function(t){Lv(om,t,this.t),Lv(this,om.s,this.s),this.s?this.t+=om.t:this.s=om.t},valueOf:function(){return this.s}};var om=new Tm;function Lv(t,e,n){var i=t.s=e+n,s=i-e,c=i-s;t.t=e-c+(n-s)}var ai=1e-6,Nn=Math.PI,qa=Nn/2,Mv=Nn/4,Ka=Nn*2,iu=180/Nn,Rs=Nn/180,Nr=Math.abs,gI=Math.atan,Gh=Math.atan2,Di=Math.cos,Ri=Math.sin,$h=Math.sqrt;function Wx(t){return t>1?0:t<-1?Nn:Math.acos(t)}function cc(t){return t>1?qa:t<-1?-qa:Math.asin(t)}function pf(){}function Lm(t,e){t&&Av.hasOwnProperty(t.type)&&Av[t.type](t,e)}var Pv={Feature:function(t,e){Lm(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,s=n.length;++iNn?t-Ka:t<-Nn?t+Ka:t,e]}k_.invert=k_;function yI(t,e,n){return(t%=Ka)?e||n?Hx(Rv(t),Nv(e,n)):Rv(t):e||n?Nv(e,n):k_}function Dv(t){return function(e,n){return e+=t,[e>Nn?e-Ka:e<-Nn?e+Ka:e,n]}}function Rv(t){var e=Dv(t);return e.invert=Dv(-t),e}function Nv(t,e){var n=Di(t),i=Ri(t),s=Di(e),c=Ri(e);function p(u,x){var w=Di(x),E=Di(u)*w,L=Ri(u)*w,A=Ri(x),V=A*n+E*i;return[Gh(L*s-V*c,E*n-A*i),cc(V*s+L*c)]}return p.invert=function(u,x){var w=Di(x),E=Di(u)*w,L=Ri(u)*w,A=Ri(x),V=A*s-L*c;return[Gh(L*s+A*c,E*n+V*i),cc(V*n-E*i)]},p}function vI(t,e,n,i,s,c){if(n){var p=Di(e),u=Ri(e),x=i*n;s==null?(s=e+i*Ka,c=e-x/2):(s=zv(p,s),c=zv(p,c),(i>0?sc)&&(s+=i*Ka));for(var w,E=s;i>0?E>c:E1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function xI(t,e,n,i,s,c){var p=t[0],u=t[1],x=e[0],w=e[1],E=0,L=1,A=x-p,V=w-u,O;if(O=n-p,!(!A&&O>0)){if(O/=A,A<0){if(O0){if(O>L)return;O>E&&(E=O)}if(O=s-p,!(!A&&O<0)){if(O/=A,A<0){if(O>L)return;O>E&&(E=O)}else if(A>0){if(O0)){if(O/=V,V<0){if(O0){if(O>L)return;O>E&&(E=O)}if(O=c-u,!(!V&&O<0)){if(O/=V,V<0){if(O>L)return;O>E&&(E=O)}else if(V>0){if(O0&&(t[0]=p+E*A,t[1]=u+E*V),L<1&&(e[0]=p+L*A,e[1]=u+L*V),!0}}}}}function dm(t,e){return Nr(t[0]-e[0])=0;--u)s.point((L=E[u])[0],L[1]);else i(A.x,A.p.x,-1,s);A=A.p}A=A.o,E=A.z,V=!V}while(!A.v);s.lineEnd()}}}function Ov(t){if(e=t.length){for(var e,n=0,i=t[0],s;++ne?1:t>=e?0:NaN}function bI(t){return t.length===1&&(t=wI(t)),{left:function(e,n,i,s){for(i==null&&(i=0),s==null&&(s=e.length);i>>1;t(e[c],n)<0?i=c+1:s=c}return i},right:function(e,n,i,s){for(i==null&&(i=0),s==null&&(s=e.length);i>>1;t(e[c],n)>0?s=c:i=c+1}return i}}}function wI(t){return function(e,n){return Kx(t(e),n)}}bI(Kx);function Jx(t){for(var e=t.length,n,i=-1,s=0,c,p;++i=0;)for(p=t[e],n=p.length;--n>=0;)c[--s]=p[n];return c}var ff=1e9,um=-ff;function SI(t,e,n,i){function s(w,E){return t<=w&&w<=n&&e<=E&&E<=i}function c(w,E,L,A){var V=0,O=0;if(w==null||(V=p(w,L))!==(O=p(E,L))||x(w,E)<0^L>0)do A.point(V===0||V===3?t:n,V>1?i:e);while((V=(V+L+4)%4)!==O);else A.point(E[0],E[1])}function p(w,E){return Nr(w[0]-t)0?0:3:Nr(w[0]-n)0?2:1:Nr(w[1]-e)0?1:0:E>0?3:2}function u(w,E){return x(w.x,E.x)}function x(w,E){var L=p(w,1),A=p(E,1);return L!==A?L-A:L===0?E[1]-w[1]:L===1?w[0]-E[0]:L===2?w[1]-E[1]:E[0]-w[0]}return function(w){var E=w,L=Xx(),A,V,O,J,Y,$,U,G,X,at,vt,dt={point:pt,lineStart:wt,lineEnd:ie,polygonStart:Rt,polygonEnd:yt};function pt(ae,Kt){s(ae,Kt)&&E.point(ae,Kt)}function ut(){for(var ae=0,Kt=0,re=V.length;Kti&&(Sn-Pe)*(i-pn)>(Pn-pn)*(t-Pe)&&++ae:Pn<=i&&(Sn-Pe)*(i-pn)<(Pn-pn)*(t-Pe)&&--ae;return ae}function Rt(){E=L,A=[],V=[],vt=!0}function yt(){var ae=ut(),Kt=vt&&ae,re=(A=Jx(A)).length;(Kt||re)&&(w.polygonStart(),Kt&&(w.lineStart(),c(null,null,1,w),w.lineEnd()),re&&Yx(A,u,ae,c,w),w.polygonEnd()),E=w,A=V=O=null}function wt(){dt.point=Tt,V&&V.push(O=[]),at=!0,X=!1,U=G=NaN}function ie(){A&&(Tt(J,Y),$&&X&&L.rejoin(),A.push(L.result())),dt.point=pt,X&&E.lineEnd()}function Tt(ae,Kt){var re=s(ae,Kt);if(V&&O.push([ae,Kt]),at)J=ae,Y=Kt,$=re,at=!1,re&&(E.lineStart(),E.point(ae,Kt));else if(re&&X)E.point(ae,Kt);else{var Ne=[U=Math.max(um,Math.min(ff,U)),G=Math.max(um,Math.min(ff,G))],Ue=[ae=Math.max(um,Math.min(ff,ae)),Kt=Math.max(um,Math.min(ff,Kt))];xI(Ne,Ue,t,e,n,i)?(X||(E.lineStart(),E.point(Ne[0],Ne[1])),E.point(Ue[0],Ue[1]),re||E.lineEnd(),vt=!1):re&&(E.lineStart(),E.point(ae,Kt),vt=!1)}U=ae,G=Kt,X=re}return dt}}var h_=bu();function EI(t,e){var n=e[0],i=e[1],s=[Ri(n),-Di(n),0],c=0,p=0;h_.reset();for(var u=0,x=t.length;u=0?1:-1,pt=dt*vt,ut=pt>Nn,Rt=O*X;if(h_.add(Gh(Rt*dt*Ri(pt),J*at+Rt*Di(pt))),c+=ut?vt+dt*Ka:vt,ut^A>=n^U>=n){var yt=Mm(qh(L),qh($));A_(yt);var wt=Mm(s,yt);A_(wt);var ie=(ut^vt>=0?-1:1)*cc(wt[2]);(i>ie||i===ie&&(yt[0]||yt[1]))&&(p+=ut^vt>=0?1:-1)}}return(c<-ai||cNf&&(Nf=t),eAm&&(Am=e)}bu();function Qx(t,e,n,i){return function(s,c){var p=e(c),u=s.invert(i[0],i[1]),x=Xx(),w=e(x),E=!1,L,A,V,O={point:J,lineStart:$,lineEnd:U,polygonStart:function(){O.point=G,O.lineStart=X,O.lineEnd=at,A=[],L=[]},polygonEnd:function(){O.point=J,O.lineStart=$,O.lineEnd=U,A=Jx(A);var vt=EI(L,u);A.length?(E||(c.polygonStart(),E=!0),Yx(A,TI,vt,n,c)):vt&&(E||(c.polygonStart(),E=!0),c.lineStart(),n(null,null,1,c),c.lineEnd()),E&&(c.polygonEnd(),E=!1),A=L=null},sphere:function(){c.polygonStart(),c.lineStart(),n(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function J(vt,dt){var pt=s(vt,dt);t(vt=pt[0],dt=pt[1])&&c.point(vt,dt)}function Y(vt,dt){var pt=s(vt,dt);p.point(pt[0],pt[1])}function $(){O.point=Y,p.lineStart()}function U(){O.point=J,p.lineEnd()}function G(vt,dt){V.push([vt,dt]);var pt=s(vt,dt);w.point(pt[0],pt[1])}function X(){w.lineStart(),V=[]}function at(){G(V[0][0],V[0][1]),w.lineEnd();var vt=w.clean(),dt=x.result(),pt,ut=dt.length,Rt,yt,wt;if(V.pop(),L.push(V),V=null,!!ut){if(vt&1){if(yt=dt[0],(Rt=yt.length-1)>0){for(E||(c.polygonStart(),E=!0),c.lineStart(),pt=0;pt1&&vt&2&&dt.push(dt.pop().concat(dt.shift())),A.push(dt.filter(CI))}}return O}}function CI(t){return t.length>1}function TI(t,e){return((t=t.x)[0]<0?t[1]-qa-ai:qa-t[1])-((e=e.x)[0]<0?e[1]-qa-ai:qa-e[1])}const Vv=Qx(function(){return!0},LI,PI,[-Nn,-qa]);function LI(t){var e=NaN,n=NaN,i=NaN,s;return{lineStart:function(){t.lineStart(),s=1},point:function(c,p){var u=c>0?Nn:-Nn,x=Nr(c-e);Nr(x-Nn)0?qa:-qa),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(c,n),s=0):i!==u&&x>=Nn&&(Nr(e-i)ai?gI((Ri(e)*(c=Di(i))*Ri(n)-Ri(i)*(s=Di(e))*Ri(t))/(s*c*p)):(e+i)/2}function PI(t,e,n,i){var s;if(t==null)s=n*qa,i.point(-Nn,s),i.point(0,s),i.point(Nn,s),i.point(Nn,0),i.point(Nn,-s),i.point(0,-s),i.point(-Nn,-s),i.point(-Nn,0),i.point(-Nn,s);else if(Nr(t[0]-e[0])>ai){var c=t[0]0,s=Nr(n)>ai;function c(E,L,A,V){vI(V,t,e,A,E,L)}function p(E,L){return Di(E)*Di(L)>n}function u(E){var L,A,V,O,J;return{lineStart:function(){O=V=!1,J=1},point:function(Y,$){var U=[Y,$],G,X=p(Y,$),at=i?X?0:w(Y,$):X?w(Y+(Y<0?Nn:-Nn),$):0;if(!L&&(O=V=X)&&E.lineStart(),X!==V&&(G=x(L,U),(!G||dm(L,G)||dm(U,G))&&(U[0]+=ai,U[1]+=ai,X=p(U[0],U[1]))),X!==V)J=0,X?(E.lineStart(),G=x(U,L),E.point(G[0],G[1])):(G=x(L,U),E.point(G[0],G[1]),E.lineEnd()),L=G;else if(s&&L&&i^X){var vt;!(at&A)&&(vt=x(U,L,!0))&&(J=0,i?(E.lineStart(),E.point(vt[0][0],vt[0][1]),E.point(vt[1][0],vt[1][1]),E.lineEnd()):(E.point(vt[1][0],vt[1][1]),E.lineEnd(),E.lineStart(),E.point(vt[0][0],vt[0][1])))}X&&(!L||!dm(L,U))&&E.point(U[0],U[1]),L=U,V=X,A=at},lineEnd:function(){V&&E.lineEnd(),L=null},clean:function(){return J|(O&&V)<<1}}}function x(E,L,A){var V=qh(E),O=qh(L),J=[1,0,0],Y=Mm(V,O),$=sm(Y,Y),U=Y[0],G=$-U*U;if(!G)return!A&&E;var X=n*$/G,at=-n*U/G,vt=Mm(J,Y),dt=am(J,X),pt=am(Y,at);c_(dt,pt);var ut=vt,Rt=sm(dt,ut),yt=sm(ut,ut),wt=Rt*Rt-yt*(sm(dt,dt)-1);if(!(wt<0)){var ie=$h(wt),Tt=am(ut,(-Rt-ie)/yt);if(c_(Tt,dt),Tt=P_(Tt),!A)return Tt;var ae=E[0],Kt=L[0],re=E[1],Ne=L[1],Ue;Kt0^Tt[1]<(Nr(Tt[0]-ae)Nn^(ae<=Tt[0]&&Tt[0]<=Kt)){var pn=am(ut,(-Rt+ie)/yt);return c_(pn,dt),[Tt,P_(pn)]}}}function w(E,L){var A=i?t:Nn-t,V=0;return E<-A?V|=1:E>A&&(V|=2),L<-A?V|=4:L>A&&(V|=8),V}return Qx(p,u,c,i?[0,-t]:[-Nn,t-Nn])}function $x(t){return function(e){var n=new D_;for(var i in t)n[i]=t[i];return n.stream=e,n}}function D_(){}D_.prototype={constructor:D_,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function tb(t,e,n){var i=e[1][0]-e[0][0],s=e[1][1]-e[0][1],c=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),c!=null&&t.clipExtent(null),_I(n,t.stream(Bv));var p=Bv.result(),u=Math.min(i/(p[1][0]-p[0][0]),s/(p[1][1]-p[0][1])),x=+e[0][0]+(i-u*(p[1][0]+p[0][0]))/2,w=+e[0][1]+(s-u*(p[1][1]+p[0][1]))/2;return c!=null&&t.clipExtent(c),t.scale(u*150).translate([x,w])}function kI(t,e,n){return tb(t,[[0,0],e],n)}var Uv=16,DI=Di(30*Rs);function Gv(t,e){return+e?NI(t,e):RI(t)}function RI(t){return $x({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function NI(t,e){function n(i,s,c,p,u,x,w,E,L,A,V,O,J,Y){var $=w-i,U=E-s,G=$*$+U*U;if(G>4*e&&J--){var X=p+A,at=u+V,vt=x+O,dt=$h(X*X+at*at+vt*vt),pt=cc(vt/=dt),ut=Nr(Nr(vt)-1)e||Nr(($*ie+U*Tt)/G-.5)>.3||p*A+u*V+x*O2?Tt[2]%360*Rs:0,wt()):[w*iu,E*iu,L*iu]},ut.precision=function(Tt){return arguments.length?(vt=Gv(yt,at=Tt*Tt),ie()):$h(at)},ut.fitExtent=function(Tt,ae){return tb(ut,Tt,ae)},ut.fitSize=function(Tt,ae){return kI(ut,Tt,ae)};function wt(){V=Hx(A=yI(w,E,L),e);var Tt=e(u,x);return c=i-Tt[0]*n,p=s+Tt[1]*n,ie()}function ie(){return dt=pt=null,ut}return function(){return e=t.apply(this,arguments),ut.invert=e.invert&&Rt,wt()}}function eb(t){return function(e,n){var i=Di(e),s=Di(n),c=t(i*s);return[c*s*Ri(e),c*Ri(n)]}}function nb(t){return function(e,n){var i=$h(e*e+n*n),s=t(i),c=Ri(s),p=Di(s);return[Gh(e*c,i*p),cc(i&&n*c/i)]}}var BI=eb(function(t){return $h(2/(1+t))});BI.invert=nb(function(t){return 2*cc(t/2)});var ib=eb(function(t){return(t=Wx(t))&&t/Ri(t)});ib.invert=nb(function(t){return t});function VI(){return OI(ib).scale(79.4188).clipAngle(180-.001)}function qv(t,e){return[t,e]}qv.invert=qv;function UI(t,e,n){n=n||{};var i=n.units||"kilometers",s=n.steps||8;if(!t)throw new Error("geojson is required");if(typeof n!="object")throw new Error("options must be an object");if(typeof s!="number")throw new Error("steps must be an number");if(e===void 0)throw new Error("radius is required");if(s<=0)throw new Error("steps must be greater than 0");var c=[];switch(t.type){case"GeometryCollection":return yx(t,function(p){var u=mm(p,e,i,s);u&&c.push(u)}),C_(c);case"FeatureCollection":return Sv(t,function(p){var u=mm(p,e,i,s);u&&Sv(u,function(x){x&&c.push(x)})}),C_(c)}return mm(t,e,i,s)}function mm(t,e,n,i){var s=t.properties||{},c=t.type==="Feature"?t.geometry:t;if(c.type==="GeometryCollection"){var p=[];return yx(t,function(J){var Y=mm(J,e,n,i);Y&&p.push(Y)}),C_(p)}var u=GI(c),x={type:c.type,coordinates:ob(c.coordinates,u)},w=new Q_,E=w.read(x),L=YE(KE(e,n),"meters"),A=hr.bufferOp(E,L,i),V=new Lx;if(A=V.write(A),!rb(A.coordinates)){var O={type:A.type,coordinates:sb(A.coordinates,u)};return Om(O,s)}}function rb(t){return Array.isArray(t[0])?rb(t[0]):isNaN(t[0])}function ob(t,e){return typeof t[0]!="object"?e(t):t.map(function(n){return ob(n,e)})}function sb(t,e){return typeof t[0]!="object"?e.invert(t):t.map(function(n){return sb(n,e)})}function GI(t){var e=QE(t).geometry.coordinates,n=[-e[0],-e[1]];return VI().rotate(n).scale(Po)}function qI(t,e){var n=bm(t),i=bm(e),s=t.properties||{},c=fx.difference(n.coordinates,i.coordinates);return c.length===0?null:c.length===1?mx(c[0],s):gx(c,s)}function jv(t){let e;for(const n of t)e&&n[0]-e[0]>=180?n[0]-=360:e&&n[0]-e[0]<-180&&(n[0]+=360),e=n}function Zv(t,e){const n=qI({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},t);if(!n)return;n.properties={isMask:"y"};const i=UI(t,0);if(i.geometry.type==="Polygon")for(const s of i.geometry.coordinates)jv(s);else for(const s of i.geometry.coordinates)for(const c of s)jv(c);e({type:"FeatureCollection",features:[i,n]})}let Wv={type:"FeatureCollection",features:[]};function jI(t,e,n=!0,i=!0,s={},c={},p={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}}){let u,x=[],w,E;function L(){(p!=null&&p.fill||p!=null&&p.line)&&t.addSource("full-geom",{type:"geojson",data:Wv}),p!=null&&p.fill&&t.addLayer({...p==null?void 0:p.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),p!=null&&p.line&&t.addLayer({...p==null?void 0:p.line,id:"full-geom-line",type:"line",source:"full-geom"})}t.loaded()?L():t.once("load",()=>{L()});const A=O=>{u==null||u({type:"mapClick",coordinates:[O.lngLat.lng,O.lngLat.lat]})};function V(O=!1){if(!e)throw new Error;const J=document.createElement("div");return O&&J.classList.add("marker-interactive"),new vE({props:{displayIn:"maplibre"},target:J}),new e.Marker({element:J,offset:[1,-13]})}return{setEventHandler(O){O?(u=O,t.on("click",A)):(u=void 0,t.off("click",A))},flyTo(O,J){t.flyTo({center:O,zoom:J,...s})},fitBounds(O,J,Y){t.fitBounds([[O[0],O[1]],[O[2],O[3]]],{padding:J,maxZoom:Y,...c})},indicateReverse(O){t.getCanvasContainer().style.cursor=O?"crosshair":""},setReverseMarker(O){!e||!n||(E?O?E.setLngLat(O):(E.remove(),E=void 0):O&&(E=(typeof n=="object"?new e.Marker(n):V()).setLngLat(O).addTo(t),E.getElement().classList.add("marker-reverse")))},setMarkers(O,J){if(!n)return;function Y($){var U;(U=t.getSource("full-geom"))==null||U.setData($)}for(const $ of x)$.remove();if(x.length=0,Y(Wv),!!e){if(J){let $=!1;if(J.geometry.type==="GeometryCollection"){const U=J.geometry.geometries.filter(G=>G.type==="Polygon"||G.type==="MultiPolygon");if(U.length>0){let G=U.pop();for(const X of U)G=JE(G,X);Zv({...J,geometry:G},Y),$=!0}else{const G=J.geometry.geometries.filter(X=>X.type==="LineString"||X.type==="MultiLineString");G.length>0&&(Y({...J,geometry:{type:"GeometryCollection",geometries:G}}),$=!0)}}if(!$){if(J.geometry.type==="Polygon"||J.geometry.type==="MultiPolygon")Zv(J,Y);else if(J.geometry.type==="LineString"||J.geometry.type==="MultiLineString"){Y(J);return}}n&&x.push((typeof n=="object"?new e.Marker(n):V()).setLngLat(J.center).addTo(t))}if(i)for(const $ of O??[]){if($===J)continue;const U=(typeof i=="object"?new e.Marker(i):V(!0)).setLngLat($.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText($.place_type[0]==="reverse"?$.place_name:$.place_name.replace(/,.*/,""))).addTo(t),G=U.getElement();G.addEventListener("click",X=>{X.stopPropagation(),u==null||u({type:"markerClick",id:$.id})}),G.addEventListener("mouseenter",()=>{u==null||u({type:"markerMouseEnter",id:$.id}),U.togglePopup()}),G.addEventListener("mouseleave",()=>{u==null||u({type:"markerMouseLeave",id:$.id}),U.togglePopup()}),x.push(U)}}},setSelectedMarker(O){w&&w.getElement().classList.toggle("marker-selected",!1),w=O>-1?x[O]:void 0,w==null||w.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const O=t.getCenter();return[t.getZoom(),O.lng,O.lat]}}}function ZI(t){let e,n;return{c(){e=Sl("svg"),n=Sl("path"),Ut(n,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),Ut(e,"viewBox","0 0 14 14"),Ut(e,"width","13"),Ut(e,"height","13"),Ut(e,"class","svelte-en2qvf")},m(i,s){Vt(i,e,s),Ft(e,n)},p:Ve,i:Ve,o:Ve,d(i){i&&Ot(e)}}}class ab extends xn{constructor(e){super(),vn(this,e,null,ZI,hn,{})}}function WI(t){let e,n;return{c(){e=Sl("svg"),n=Sl("path"),Ut(n,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),Ut(e,"viewBox","0 0 30 30"),Ut(e,"fill","none"),Ut(e,"xmlns","http://www.w3.org/2000/svg"),Ut(e,"class","svelte-d2loi5")},m(i,s){Vt(i,e,s),Ft(e,n)},p:Ve,i:Ve,o:Ve,d(i){i&&Ot(e)}}}class lb extends xn{constructor(e){super(),vn(this,e,null,WI,hn,{})}}function HI(t){let e,n;return{c(){e=zt("img"),_o(e.src,n=t[3]+"area.svg")||Ut(e,"src",n),Ut(e,"alt",t[6]),Ut(e,"class","svelte-ltkwvy")},m(i,s){Vt(i,e,s)},p(i,s){s&8&&!_o(e.src,n=i[3]+"area.svg")&&Ut(e,"src",n),s&64&&Ut(e,"alt",i[6])},d(i){i&&Ot(e)}}}function XI(t){let e,n;return{c(){e=zt("img"),_o(e.src,n=t[3]+"reverse.svg")||Ut(e,"src",n),Ut(e,"alt",t[6]),Ut(e,"class","svelte-ltkwvy")},m(i,s){Vt(i,e,s)},p(i,s){s&8&&!_o(e.src,n=i[3]+"reverse.svg")&&Ut(e,"src",n),s&64&&Ut(e,"alt",i[6])},d(i){i&&Ot(e)}}}function YI(t){let e,n;return{c(){e=zt("img"),_o(e.src,n=t[3]+"poi.svg")||Ut(e,"src",n),Ut(e,"alt",t[6]),Ut(e,"class","svelte-ltkwvy")},m(i,s){Vt(i,e,s)},p(i,s){s&8&&!_o(e.src,n=i[3]+"poi.svg")&&Ut(e,"src",n),s&64&&Ut(e,"alt",i[6])},d(i){i&&Ot(e)}}}function KI(t){let e,n;return{c(){e=zt("img"),_o(e.src,n=t[3]+"postal_code.svg")||Ut(e,"src",n),Ut(e,"alt",t[6]),Ut(e,"class","svelte-ltkwvy")},m(i,s){Vt(i,e,s)},p(i,s){s&8&&!_o(e.src,n=i[3]+"postal_code.svg")&&Ut(e,"src",n),s&64&&Ut(e,"alt",i[6])},d(i){i&&Ot(e)}}}function JI(t){let e,n;return{c(){e=zt("img"),_o(e.src,n=t[3]+"street.svg")||Ut(e,"src",n),Ut(e,"alt",t[6]),Ut(e,"class","svelte-ltkwvy")},m(i,s){Vt(i,e,s)},p(i,s){s&8&&!_o(e.src,n=i[3]+"street.svg")&&Ut(e,"src",n),s&64&&Ut(e,"alt",i[6])},d(i){i&&Ot(e)}}}function QI(t){let e,n;return{c(){e=zt("img"),_o(e.src,n=t[3]+"road.svg")||Ut(e,"src",n),Ut(e,"alt",t[6]),Ut(e,"class","svelte-ltkwvy")},m(i,s){Vt(i,e,s)},p(i,s){s&8&&!_o(e.src,n=i[3]+"road.svg")&&Ut(e,"src",n),s&64&&Ut(e,"alt",i[6])},d(i){i&&Ot(e)}}}function $I(t){let e,n;return{c(){e=zt("img"),_o(e.src,n=t[3]+"housenumber.svg")||Ut(e,"src",n),Ut(e,"alt",t[6]),Ut(e,"class","svelte-ltkwvy")},m(i,s){Vt(i,e,s)},p(i,s){s&8&&!_o(e.src,n=i[3]+"housenumber.svg")&&Ut(e,"src",n),s&64&&Ut(e,"alt",i[6])},d(i){i&&Ot(e)}}}function tC(t){let e,n,i,s;return{c(){e=zt("img"),_o(e.src,n=t[5])||Ut(e,"src",n),Ut(e,"alt",t[4]),Ut(e,"class","svelte-ltkwvy")},m(c,p){Vt(c,e,p),i||(s=Ke(e,"error",t[14]),i=!0)},p(c,p){p&32&&!_o(e.src,n=c[5])&&Ut(e,"src",n),p&16&&Ut(e,"alt",c[4])},d(c){c&&Ot(e),i=!1,s()}}}function Hv(t){let e,n;return{c(){e=zt("span"),n=Mn(t[6]),Ut(e,"class","secondary svelte-ltkwvy")},m(i,s){Vt(i,e,s),Ft(e,n)},p(i,s){s&64&&to(n,i[6])},d(i){i&&Ot(e)}}}function eC(t){var dt,pt;let e,n,i,s,c,p,u,x,w=(t[7]?t[0].place_name:t[0].place_name.replace(/,.*/,""))+"",E,L,A=t[2]==="always"||t[2]&&!t[0].address&&((dt=t[0].properties)==null?void 0:dt.kind)!=="road"&&((pt=t[0].properties)==null?void 0:pt.kind)!=="road_relation"&&!t[0].id.startsWith("address.")&&!t[0].id.startsWith("postal_code.")&&(!t[0].id.startsWith("poi.")||!t[5])&&!t[7],V,O,J=(t[7]?"":t[0].place_name.replace(/[^,]*,?\s*/,""))+"",Y,$,U;function G(ut,Rt){var yt,wt;return Rt&1&&(n=null),Rt&1&&(i=null),Rt&1&&(s=null),ut[5]?tC:ut[0].address?$I:((yt=ut[0].properties)==null?void 0:yt.kind)==="road"||((wt=ut[0].properties)==null?void 0:wt.kind)==="road_relation"?QI:(n==null&&(n=!!ut[0].id.startsWith("address.")),n?JI:(i==null&&(i=!!ut[0].id.startsWith("postal_code.")),i?KI:(s==null&&(s=!!ut[0].id.startsWith("poi.")),s?YI:ut[7]?XI:HI)))}let X=G(t,-1),at=X(t),vt=A&&Hv(t);return{c(){e=zt("li"),at.c(),c=ge(),p=zt("span"),u=zt("span"),x=zt("span"),E=Mn(w),L=ge(),vt&&vt.c(),V=ge(),O=zt("span"),Y=Mn(J),Ut(x,"class","primary svelte-ltkwvy"),Ut(u,"class","svelte-ltkwvy"),Ut(O,"class","line2 svelte-ltkwvy"),Ut(p,"class","texts svelte-ltkwvy"),Ut(e,"tabindex","0"),Ut(e,"data-selected",t[1]),Ut(e,"class","svelte-ltkwvy"),Ga(e,"selected",t[1])},m(ut,Rt){Vt(ut,e,Rt),at.m(e,null),Ft(e,c),Ft(e,p),Ft(p,u),Ft(u,x),Ft(x,E),Ft(u,L),vt&&vt.m(u,null),Ft(p,V),Ft(p,O),Ft(O,Y),$||(U=[Ke(e,"mouseenter",t[12]),Ke(e,"focus",t[13])],$=!0)},p(ut,[Rt]){var yt,wt;X===(X=G(ut,Rt))&&at?at.p(ut,Rt):(at.d(1),at=X(ut),at&&(at.c(),at.m(e,c))),Rt&1&&w!==(w=(ut[7]?ut[0].place_name:ut[0].place_name.replace(/,.*/,""))+"")&&to(E,w),Rt&37&&(A=ut[2]==="always"||ut[2]&&!ut[0].address&&((yt=ut[0].properties)==null?void 0:yt.kind)!=="road"&&((wt=ut[0].properties)==null?void 0:wt.kind)!=="road_relation"&&!ut[0].id.startsWith("address.")&&!ut[0].id.startsWith("postal_code.")&&(!ut[0].id.startsWith("poi.")||!ut[5])&&!ut[7]),A?vt?vt.p(ut,Rt):(vt=Hv(ut),vt.c(),vt.m(u,null)):vt&&(vt.d(1),vt=null),Rt&1&&J!==(J=(ut[7]?"":ut[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&to(Y,J),Rt&2&&Ut(e,"data-selected",ut[1]),Rt&2&&Ga(e,"selected",ut[1])},i:Ve,o:Ve,d(ut){ut&&Ot(e),at.d(),vt&&vt.d(),$=!1,Er(U)}}}function nC(t,e,n){var G;let i,s,{feature:c}=e,{selected:p=!1}=e,{showPlaceType:u}=e,{missingIconsCache:x}=e,{iconsBaseUrl:w}=e;const E=(G=c.properties)==null?void 0:G.categories;let L,A,V=0,O=c.place_type[0]==="reverse";function J(X){A&&x.add(A),n(10,V++,V)}function Y(X){er.call(this,t,X)}function $(X){er.call(this,t,X)}const U=X=>J(X.currentTarget);return t.$$set=X=>{"feature"in X&&n(0,c=X.feature),"selected"in X&&n(1,p=X.selected),"showPlaceType"in X&&n(2,u=X.showPlaceType),"missingIconsCache"in X&&n(9,x=X.missingIconsCache),"iconsBaseUrl"in X&&n(3,w=X.iconsBaseUrl)},t.$$.update=()=>{var X,at,vt,dt;if(t.$$.dirty&3640)do n(11,i--,i),n(4,L=E==null?void 0:E[i]),n(5,A=L?w+L.replace(/ /g,"_")+".svg":void 0);while(i>-1&&(!A||x.has(A)));t.$$.dirty&1&&n(6,s=c.id.startsWith("poi.")?(at=(X=c.properties)==null?void 0:X.categories)==null?void 0:at.join(", "):((dt=(vt=c.properties)==null?void 0:vt.place_type_name)==null?void 0:dt[0])??c.place_type[0])},n(11,i=(E==null?void 0:E.length)??0),[c,p,u,w,L,A,s,O,J,x,V,i,Y,$,U]}class iC extends xn{constructor(e){super(),vn(this,e,nC,eC,hn,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function rC(t){let e;return{c(){e=zt("div"),e.innerHTML='',Ut(e,"class","svelte-7cmwmc")},m(n,i){Vt(n,e,i)},p:Ve,i:Ve,o:Ve,d(n){n&&Ot(e)}}}class oC extends xn{constructor(e){super(),vn(this,e,null,rC,hn,{})}}function sC(t){let e,n;return{c(){e=Sl("svg"),n=Sl("path"),Ut(n,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),Ut(e,"viewBox","0 0 60.006 21.412"),Ut(e,"width","14"),Ut(e,"height","20"),Ut(e,"class","svelte-en2qvf")},m(i,s){Vt(i,e,s),Ft(e,n)},p:Ve,i:Ve,o:Ve,d(i){i&&Ot(e)}}}class aC extends xn{constructor(e){super(),vn(this,e,null,sC,hn,{})}}function lC(t){let e,n,i;return{c(){e=Sl("svg"),n=Sl("circle"),i=Sl("path"),Ut(n,"cx","4.789"),Ut(n,"cy","4.787"),Ut(n,"r","3.85"),nr(n,"stroke-width","1.875"),nr(n,"fill","none"),Ut(i,"d","M12.063 12.063 7.635 7.635"),nr(i,"stroke-width","1.875"),nr(i,"stroke-linecap","round"),Ut(e,"xmlns","http://www.w3.org/2000/svg"),Ut(e,"width","13"),Ut(e,"height","13"),Ut(e,"viewBox","0 0 13 13"),Ut(e,"class","svelte-1bpbt60")},m(s,c){Vt(s,e,c),Ft(e,n),Ft(e,i)},p:Ve,i:Ve,o:Ve,d(s){s&&Ot(e)}}}class uC extends xn{constructor(e){super(),vn(this,e,null,lC,hn,{})}}function cC(t,e,n){const i=e[1],s=e[0],c=i-s;return t===i&&n?t:((t-s)%c+c)%c+s}function Xv(t){const e=[...t];return e[2]i[0]||s.maxZoom!=null&&s.maxZoomDate.now()){if(!sf.coords)break t;return sf.coords}let c;try{return c=await new Promise((p,u)=>{n.signal.addEventListener("abort",()=>{u(Error("aborted"))}),navigator.geolocation.getCurrentPosition(x=>{p([x.coords.longitude,x.coords.latitude].map(w=>w.toFixed(6)).join(","))},x=>{u(x)},s)}),c}catch{}finally{s.cachedLocationExpiry&&(sf={time:Date.now(),coords:c})}if(n.signal.aborted)return}if(s.type==="server-geolocation")return"ip";if(i&&s.type==="map-center")return i[1].toFixed(6)+","+i[2].toFixed(6)}}const Yv=/(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?/i,Kv=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?/i,Jv=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?/i,Qv=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?/i;function pC(t){if(!["DMS","DM","DD"].includes(t))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){if(t=="DD")return this.decimalCoordinates;const e=this.decimalCoordinates.split(",").map(p=>Number(p.trim()));let n=$v(e[0],t),i=$v(e[1],t);n.endsWith('.0"')&&i.endsWith('.0"')&&(n=n.replace(/\.0"$/,'"'),i=i.replace(/\.0"$/,'"'));const s=e[0]>=0?" N":" S",c=e[1]>=0?" E":" W";return`${n+s}, ${i+c}`}else throw new Error("no decimal coordinates to convert")}function $v(t,e){const n=Math.abs(t),i=Math.floor(n),s=(n-i)*60;if(e=="DM"){let u=fC(s,3).toFixed(3).padStart(6,"0");return`${i}° ${u}'`}let c=Math.floor(s),p=((s-c)*60).toFixed(1).padStart(4,"0");return c=c.toString().padStart(2,"0"),`${i}° ${c}' ${p}"`}function fC(t,e){const n=Math.pow(10,e);return Math.round((t+Number.EPSILON)*n)/n}function ay(t,e){e||(e=5),t=t.replace(/\s+/g," ").trim();let n=null,i=null,s="",c="",p=[],u=!1;if(Yv.test(t))if(p=Yv.exec(t),u=cm(p),u){if(n=p[2],i=p[6],n.includes(",")&&(n=n.replace(",",".")),i.includes(",")&&(i=i.replace(",",".")),Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");if(Number(Math.round(i))==Number(i))throw new Error("integer only coordinate provided");p[1]?(s=p[1],c=p[5]):p[4]&&(s=p[4],c=p[8])}else throw new Error("invalid decimal coordinate format");else if(Kv.test(t))if(p=Kv.exec(t),u=cm(p),u)n=Math.abs(parseInt(p[2])),p[4]&&(n+=p[4]/60),p[6]&&(n+=p[6].replace(",",".")/3600),parseInt(p[2])<0&&(n=-1*n),i=Math.abs(parseInt(p[9])),p[11]&&(i+=p[11]/60),p[13]&&(i+=p[13].replace(",",".")/3600),parseInt(p[9])<0&&(i=-1*i),p[1]?(s=p[1],c=p[8]):p[7]&&(s=p[7],c=p[14]);else throw new Error("invalid DMS coordinates format");else if(Jv.test(t))if(p=Jv.exec(t),u=cm(p),u)n=Math.abs(parseInt(p[2])),p[4]&&(n+=p[4]/60),p[6]&&(n+=p[6]/3600),parseInt(p[2])<0&&(n=-1*n),i=Math.abs(parseInt(p[10])),p[12]&&(i+=p[12]/60),p[14]&&(i+=p[14]/3600),parseInt(p[10])<0&&(i=-1*i),p[1]?(s=p[1],c=p[9]):p[8]&&(s=p[8],c=p[16]);else throw new Error("invalid DMS coordinates format");else if(Qv.test(t))if(p=Qv.exec(t),u=cm(p),u)n=Math.abs(parseInt(p[2])),p[4]&&(n+=p[4]/60),p[6]&&(n+=p[6]/3600),parseInt(p[2])<0&&(n=-1*n),i=Math.abs(parseInt(p[10])),p[12]&&(i+=p[12]/60),p[14]&&(i+=p[14]/3600),parseInt(p[10])<0&&(i=-1*i),p[1]?(s=p[1],c=p[9]):p[8]&&(s=p[8],c=p[16]);else throw new Error("invalid coordinates format");if(u){if(Math.abs(i)>=180)throw new Error("invalid longitude value");if(Math.abs(n)>=90)throw new Error("invalid latitude value");if((s||c)&&(!s||!c))throw new Error("invalid coordinates format");if(s&&s==c)throw new Error("invalid coordinates format");let x=/S|SOUTH/i;x.test(s)&&n>0&&(n=-1*n),x=/W|WEST/i,x.test(c)&&i>0&&(i=-1*i);const w=p[0].trim();let E,L;const A=/[,/;\u0020]/g,V=w.match(A);if(V==null){const Y=Math.floor(t.length/2);E=w.substring(0,Y).trim(),L=w.substring(Y).trim()}else{let Y;V.length%2==1?Y=Math.floor(V.length/2):Y=V.length/2-1;let $=0;if(Y==0)$=w.indexOf(V[0]),E=w.substring(0,$).trim(),L=w.substring($+1).trim();else{let U=0,G=0;for(;U<=Y;)$=w.indexOf(V[U],G),G=$+1,U++;E=w.substring(0,$).trim(),L=w.substring($+1).trim()}}const O=E.split(".");if(O.length==2&&O[1]==0&&O[1].length!=2)throw new Error("invalid coordinates format");const J=L.split(".");if(J.length==2&&J[1]==0&&J[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(E)||/^\d+$/.test(L))throw new Error("degree only coordinate/s provided");return isNaN(n)&&n.includes(",")&&(n=n.replace(",",".")),n=Number(Number(n).toFixed(e)),isNaN(i)&&i.includes(",")&&(i=i.replace(",",".")),i=Number(Number(i).toFixed(e)),Object.freeze({verbatimCoordinates:w,verbatimLatitude:E,verbatimLongitude:L,decimalLatitude:n,decimalLongitude:i,decimalCoordinates:`${n},${i}`,closeEnough:dC,toCoordinateFormat:pC})}else throw new Error("coordinates pattern match failed")}function cm(t){if(!isNaN(t[0]))return!1;const e=[...t];if(e.shift(),e.length%2>0)return!1;const n=/^[-+]?\d+([\.,]\d+)?$/,i=/[eastsouthnorthwest]+/i,s=e.length/2;for(let c=0;c{e.decimalLatitude?t.push(e):t.push({...e,..._C})}),[...t,...yC,...vC]}const bC=xC();ay.formats=bC.map(t=>t.verbatimCoordinates);const wC=ay;function e1(t,e,n){const i=t.slice();return i[81]=e[n],i[83]=n,i}function n1(t){let e,n;return e=new oC({}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function i1(t){let e,n,i,s,c;return n=new aC({}),{c(){e=zt("button"),Re(n.$$.fragment),Ut(e,"type","button"),Ut(e,"title",t[9]),Ut(e,"class","svelte-zh3kmv"),Ga(e,"active",t[0])},m(p,u){Vt(p,e,u),ke(n,e,null),i=!0,s||(c=Ke(e,"click",t[67]),s=!0)},p(p,u){(!i||u[0]&512)&&Ut(e,"title",p[9]),(!i||u[0]&1)&&Ga(e,"active",p[0])},i(p){i||(Bt(n.$$.fragment,p),i=!0)},o(p){Xt(n.$$.fragment,p),i=!1},d(p){p&&Ot(e),De(n),s=!1,c()}}}function SC(t){let e,n=[],i=new Map,s,c,p,u=mo(t[14]);const x=w=>w[81].id+(w[81].address?","+w[81].address:"");for(let w=0;w{dt=null}),Oi()),(!G||ae[0]&2)&&Ga(w,"displayable",Tt[1]!==""),Tt[5]===!0?pt?(pt.p(Tt,ae),ae[0]&32&&Bt(pt,1)):(pt=i1(Tt),pt.c(),Bt(pt,1),pt.m(i,O)):pt&&(zi(),Xt(pt,1,1,()=>{pt=null}),Oi()),Rt&&Rt.p&&(!G||ae[1]&134217728)&&No(Rt,ut,Tt,Tt[58],G?Ro(ut,Tt[58],ae,null):zo(Tt[58]),null);let Kt=Y;Y=ie(Tt),Y===Kt?~Y&&wt[Y].p(Tt,ae):($&&(zi(),Xt(wt[Kt],1,1,()=>{wt[Kt]=null}),Oi()),~Y?($=wt[Y],$?$.p(Tt,ae):($=wt[Y]=yt[Y](Tt),$.c()),Bt($,1),$.m(n,null)):$=null),(!G||ae[0]&4&&U!==(U=gm(Tt[2])+" svelte-zh3kmv"))&&Ut(n,"class",U),(!G||ae[0]&22)&&Ga(n,"can-collapse",Tt[4]&&Tt[1]==="")},i(Tt){G||(Bt(vt),Bt(c.$$.fragment,Tt),Bt(L.$$.fragment,Tt),Bt(dt),Bt(pt),Bt(Rt,Tt),Bt($),G=!0)},o(Tt){Xt(vt),Xt(c.$$.fragment,Tt),Xt(L.$$.fragment,Tt),Xt(dt),Xt(pt),Xt(Rt,Tt),Xt($),G=!1},d(Tt){Tt&&(Ot(e),Ot(n)),De(c),t[61](null),De(L),dt&&dt.d(),pt&&pt.d(),Rt&&Rt.d(Tt),~Y&&wt[Y].d(),X=!1,Er(at)}}}function LC(t,e,n){let i,{$$slots:s={},$$scope:c}=e,{class:p=void 0}=e,{apiKey:u}=e,{bbox:x=void 0}=e,{clearButtonTitle:w="clear"}=e,{clearOnBlur:E=!1}=e,{collapsed:L=!1}=e,{country:A=void 0}=e,{debounceSearch:V=200}=e,{enableReverse:O=!1}=e,{errorMessage:J="Something went wrong…"}=e,{filter:Y=()=>!0}=e,{flyTo:$=!0}=e,{fuzzyMatch:U=!0}=e,{language:G=void 0}=e,{limit:X=void 0}=e,{mapController:at=void 0}=e,{minLength:vt=2}=e,{noResultsMessage:dt="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:pt="Search"}=e,{proximity:ut=[{type:"server-geolocation"}]}=e,{reverseActive:Rt=O==="always"}=e,{reverseButtonTitle:yt="toggle reverse geocoding"}=e,{searchValue:wt=""}=e,{showFullGeometry:ie=!0}=e,{showPlaceType:Tt="ifNeeded"}=e,{showResultsWhileTyping:ae=!0}=e,{selectFirst:Kt=!0}=e,{flyToSelected:re=!1}=e,{markerOnSelected:Ne=!0}=e,{types:Ue=void 0}=e,{excludeTypes:wn=!1}=e,{zoom:Qe=16}=e,{maxZoom:Pe=18}=e,{apiUrl:pn="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Sn={}}=e,{iconsBaseUrl:Pn="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.2/icons/"}=e,{adjustUrlQuery:zn=K=>{}}=e;function jn(){Pt.focus()}function ee(){Pt.blur()}function Ge(K,_t=!0){n(1,wt=K),_t?(n(15,an=-1),tl()):(Vi(),setTimeout(()=>{Pt.focus(),Pt.select()}))}function cn(){n(14,Yt=void 0),n(55,be=void 0),n(15,an=-1)}function vi(){n(54,jt=[]),n(55,be=void 0)}let Bi=!1,Yt,jt,be,oi="",Pt,an=-1,ji,nn=[],$n,_r,ss,Ts;const Ia=new Set,Ir=Wh();fa(()=>{at&&(at.setEventHandler(void 0),at.indicateReverse(!1),at.setSelectedMarker(-1),at.setMarkers(void 0,void 0))});function tl(K){if(_r&&(clearTimeout(_r),_r=void 0),an>-1&&Yt)n(55,be=Yt[an]),n(1,wt=be.place_type[0]==="reverse"?be.place_name:be.place_name.replace(/,.*/,"")),n(18,ji=void 0),n(54,jt=void 0),n(15,an=-1);else if(wt){const _t=K||!as(wt);$t(wt,{exact:!0}).then(()=>{n(54,jt=Yt),n(55,be=void 0),_t&&qo()}).catch(ht=>n(18,ji=ht))}}function as(K){try{return wC(K,6)}catch{return!1}}async function $t(K,{byId:_t=!1,exact:ht=!1}={}){n(18,ji=void 0),$n==null||$n.abort();const St=new AbortController;n(19,$n=St);try{const At=as(K),Nt=new URLSearchParams;if(G!==void 0&&Nt.set("language",Array.isArray(G)?G.join(","):G??""),Ue&&Nt.set("types",Ue.join(",")),wn&&Nt.set("excludeTypes",String(wn)),x&&Nt.set("bbox",x.map(qe=>qe.toFixed(6)).join(",")),A&&Nt.set("country",Array.isArray(A)?A.join(","):A),!_t&&!At){const qe=await hC(at,ut,St);qe&&Nt.set("proximity",qe),(ht||!ae)&&Nt.set("autocomplete","false"),Nt.set("fuzzyMatch",String(U))}X!==void 0&&(!At||(Ue==null?void 0:Ue.length)===1)&&Nt.set("limit",String(X)),Nt.set("key",u),zn(Nt);const Gt=pn+"/"+encodeURIComponent(At?At.decimalLongitude+","+At.decimalLatitude:K)+".json?"+Nt.toString();if(Gt===oi){_t?(n(14,Yt=void 0),n(55,be=nn[0])):n(14,Yt=nn);return}oi=Gt;const Se=await fetch(Gt,{signal:St.signal,...Sn});if(!Se.ok)throw new Error(await Se.text());const Ce=await Se.json();Ir("response",{url:Gt,featureCollection:Ce}),_t?(n(14,Yt=void 0),n(55,be=Ce.features[0]),nn=[be]):(n(14,Yt=Ce.features.filter(Y)),At&&Yt.unshift({type:"Feature",properties:{},id:"reverse_"+At.decimalLongitude+"_"+At.decimalLatitude,text:At.decimalLatitude+", "+At.decimalLongitude,place_name:At.decimalLatitude+", "+At.decimalLongitude,place_type:["reverse"],center:[At.decimalLongitude,At.decimalLatitude],bbox:[At.decimalLongitude,At.decimalLatitude,At.decimalLongitude,At.decimalLatitude],geometry:{type:"Point",coordinates:[At.decimalLongitude,At.decimalLatitude]}}),nn=Yt,At&&Pt.focus())}catch(At){if(At&&typeof At=="object"&&"name"in At&&At.name==="AbortError")return;throw At}finally{St===$n&&n(19,$n=void 0)}}function qo(){var ht;if(!(jt!=null&&jt.length)||!$)return;const K=[180,90,-180,-90],_t=!jt.some(St=>!St.matching_text);for(const St of jt)if(_t||!St.matching_text)for(const At of[0,1,2,3])K[At]=Math[At<2?"min":"max"](K[At],((ht=St.bbox)==null?void 0:ht[At])??St.center[At%2]);at&&jt.length>0&&(be&&K[0]===K[2]&&K[1]===K[3]?at.flyTo(be.center,Qe):at.fitBounds(Xv(K),50,Pe))}function Ur(K){n(0,Rt=O==="always"),n(14,Yt=void 0),n(55,be=void 0),n(15,an=-1),Ge(K[1].toFixed(6)+", "+cC(K[0],[-180,180],!0).toFixed(6),!1)}function el(K){if(!Yt)return;let _t=K.key==="ArrowDown"?1:K.key==="ArrowUp"?-1:0;_t&&(an===(Kt?0:-1)&&_t===-1&&n(15,an=Yt.length),n(15,an+=_t),an>=Yt.length&&n(15,an=-1),an<0&&Kt&&n(15,an=0),K.preventDefault())}function Vi(K=!0){if(n(18,ji=void 0),ae){if(_r&&clearTimeout(_r),wt.length{$t(_t).catch(ht=>n(18,ji=ht))},K?V:0)}else n(14,Yt=void 0),n(18,ji=void 0)}function oe(K){n(55,be=K),n(1,wt=K.place_name),n(15,an=-1)}const Ye=()=>Pt.focus();function He(K){yo[K?"unshift":"push"](()=>{Pt=K,n(17,Pt)})}function xi(){wt=this.value,n(1,wt),n(13,Bi),n(27,E)}const jo=()=>n(13,Bi=!0),We=()=>n(13,Bi=!1),ea=()=>Vi(),Ci=()=>{n(1,wt=""),Pt.focus()},ot=()=>n(0,Rt=!Rt),F=()=>n(18,ji=void 0),q=K=>n(15,an=K),H=K=>oe(K),et=()=>{Kt||n(15,an=-1)},gt=()=>{};return t.$$set=K=>{"class"in K&&n(2,p=K.class),"apiKey"in K&&n(25,u=K.apiKey),"bbox"in K&&n(26,x=K.bbox),"clearButtonTitle"in K&&n(3,w=K.clearButtonTitle),"clearOnBlur"in K&&n(27,E=K.clearOnBlur),"collapsed"in K&&n(4,L=K.collapsed),"country"in K&&n(28,A=K.country),"debounceSearch"in K&&n(29,V=K.debounceSearch),"enableReverse"in K&&n(5,O=K.enableReverse),"errorMessage"in K&&n(6,J=K.errorMessage),"filter"in K&&n(30,Y=K.filter),"flyTo"in K&&n(31,$=K.flyTo),"fuzzyMatch"in K&&n(32,U=K.fuzzyMatch),"language"in K&&n(33,G=K.language),"limit"in K&&n(34,X=K.limit),"mapController"in K&&n(35,at=K.mapController),"minLength"in K&&n(36,vt=K.minLength),"noResultsMessage"in K&&n(7,dt=K.noResultsMessage),"placeholder"in K&&n(8,pt=K.placeholder),"proximity"in K&&n(37,ut=K.proximity),"reverseActive"in K&&n(0,Rt=K.reverseActive),"reverseButtonTitle"in K&&n(9,yt=K.reverseButtonTitle),"searchValue"in K&&n(1,wt=K.searchValue),"showFullGeometry"in K&&n(38,ie=K.showFullGeometry),"showPlaceType"in K&&n(10,Tt=K.showPlaceType),"showResultsWhileTyping"in K&&n(39,ae=K.showResultsWhileTyping),"selectFirst"in K&&n(11,Kt=K.selectFirst),"flyToSelected"in K&&n(40,re=K.flyToSelected),"markerOnSelected"in K&&n(41,Ne=K.markerOnSelected),"types"in K&&n(42,Ue=K.types),"excludeTypes"in K&&n(43,wn=K.excludeTypes),"zoom"in K&&n(44,Qe=K.zoom),"maxZoom"in K&&n(45,Pe=K.maxZoom),"apiUrl"in K&&n(46,pn=K.apiUrl),"fetchParameters"in K&&n(47,Sn=K.fetchParameters),"iconsBaseUrl"in K&&n(12,Pn=K.iconsBaseUrl),"adjustUrlQuery"in K&&n(48,zn=K.adjustUrlQuery),"$$scope"in K&&n(58,c=K.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&134225920&&setTimeout(()=>{n(16,ss=Bi),E&&!Bi&&n(1,wt="")}),t.$$.dirty[0]&16386|t.$$.dirty[1]&32&&wt.lengthn(18,ji=K)),t.$$.dirty[1]&50356241&&(at&&be&&be.id!==Ts&&$&&(!be.bbox||be.bbox[0]===be.bbox[2]&&be.bbox[1]===be.bbox[3]?at.flyTo(be.center,be.id.startsWith("poi.")||be.id.startsWith("address.")?Pe:Qe):at.fitBounds(Xv(be.bbox),50,Pe),n(14,Yt=void 0),n(54,jt=void 0),n(15,an=-1)),n(56,Ts=be==null?void 0:be.id)),t.$$.dirty[0]&18432&&Kt&&Yt!=null&&Yt.length&&n(15,an=0),t.$$.dirty[0]&2050&&(Kt||n(15,an=-1)),t.$$.dirty[0]&16384|t.$$.dirty[1]&8388608&&jt!==Yt&&n(54,jt=void 0),t.$$.dirty[0]&81921|t.$$.dirty[1]&8388624&&at&&at.setEventHandler(K=>{switch(K.type){case"mapClick":Rt&&Ur(K.coordinates);break;case"markerClick":{const _t=Yt==null?void 0:Yt.find(ht=>ht.id===K.id);_t&&oe(_t)}break;case"markerMouseEnter":jt&&n(15,an=ss?(Yt==null?void 0:Yt.findIndex(_t=>_t.id===K.id))??-1:-1);break;case"markerMouseLeave":jt&&n(15,an=-1);break}}),t.$$.dirty[0]&49152&&n(57,i=Yt==null?void 0:Yt[an]),t.$$.dirty[1]&67133969&&at&&i&&$&&re&&at.flyTo(i.center,i.id.startsWith("poi.")||i.id.startsWith("address.")?Pe:Qe),t.$$.dirty[1]&1040&&(Ne||at==null||at.setMarkers(void 0,void 0)),t.$$.dirty[1]&75498512&&at&&Ne&&!jt&&(at.setMarkers(i?[i]:void 0,void 0),at.setSelectedMarker(i?0:-1)),t.$$.dirty[1]&25165840&&at&&at.setMarkers(jt,be),t.$$.dirty[0]&32768|t.$$.dirty[1]&8388624&&jt&&at&&at.setSelectedMarker(an),t.$$.dirty[0]&2|t.$$.dirty[1]&16&&at){const K=as(wt);at.setReverseMarker(K?[K.decimalLongitude,K.decimalLatitude]:void 0)}t.$$.dirty[1]&67108864&&Ir("select",i),t.$$.dirty[1]&16777216&&Ir("pick",be),t.$$.dirty[0]&81920&&Ir("optionsVisibilityChange",ss&&!!Yt),t.$$.dirty[0]&16384&&Ir("featuresListed",Yt),t.$$.dirty[1]&8388608&&Ir("featuresMarked",jt),t.$$.dirty[0]&1&&Ir("reverseToggle",Rt),t.$$.dirty[0]&2&&Ir("queryChange",wt),t.$$.dirty[0]&1|t.$$.dirty[1]&16&&at&&at.indicateReverse(Rt)},[Rt,wt,p,w,L,O,J,dt,pt,yt,Tt,Kt,Pn,Bi,Yt,an,ss,Pt,ji,$n,Ia,tl,el,Vi,oe,u,x,E,A,V,Y,$,U,G,X,at,vt,ut,ie,ae,re,Ne,Ue,wn,Qe,Pe,pn,Sn,zn,jn,ee,Ge,cn,vi,jt,be,Ts,i,c,s,Ye,He,xi,jo,We,ea,Ci,ot,F,q,H,et,gt]}class MC extends xn{constructor(e){super(),vn(this,e,LC,TC,hn,{class:2,apiKey:25,bbox:26,clearButtonTitle:3,clearOnBlur:27,collapsed:4,country:28,debounceSearch:29,enableReverse:5,errorMessage:6,filter:30,flyTo:31,fuzzyMatch:32,language:33,limit:34,mapController:35,minLength:36,noResultsMessage:7,placeholder:8,proximity:37,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:38,showPlaceType:10,showResultsWhileTyping:39,selectFirst:11,flyToSelected:40,markerOnSelected:41,types:42,excludeTypes:43,zoom:44,maxZoom:45,apiUrl:46,fetchParameters:47,iconsBaseUrl:12,adjustUrlQuery:48,focus:49,blur:50,setQuery:51,clearList:52,clearMap:53},null,[-1,-1,-1])}get focus(){return this.$$.ctx[49]}get blur(){return this.$$.ctx[50]}get setQuery(){return this.$$.ctx[51]}get clearList(){return this.$$.ctx[52]}get clearMap(){return this.$$.ctx[53]}}let ub="MZEJTanw3WpxRvt7qDfo",R_=vr(null),N_=vr(null),Jo=vr("title"),Nl=vr(null),tp=vr(null),p_=vr(!0),z_=vr(!0);function o1(t){let e,n,i;return n=new MC({props:{mapController:t[0],apiKey:ub}}),{c(){e=zt("div"),Re(n.$$.fragment),Ut(e,"class","svelte-ixhnie")},m(s,c){Vt(s,e,c),ke(n,e,null),i=!0},p(s,c){const p={};c&1&&(p.mapController=s[0]),n.$set(p)},i(s){i||(Bt(n.$$.fragment,s),i=!0)},o(s){Xt(n.$$.fragment,s),i=!1},d(s){s&&Ot(e),De(n)}}}function PC(t){let e,n,i=t[0]&&o1(t);return{c(){i&&i.c(),e=Sa()},m(s,c){i&&i.m(s,c),Vt(s,e,c),n=!0},p(s,[c]){s[0]?i?(i.p(s,c),c&1&&Bt(i,1)):(i=o1(s),i.c(),Bt(i,1),i.m(e.parentNode,e)):i&&(zi(),Xt(i,1,1,()=>{i=null}),Oi())},i(s){n||(Bt(i),n=!0)},o(s){Xt(i),n=!1},d(s){s&&Ot(e),i&&i.d(s)}}}function AC(t,e,n){let i,s;return en(t,tp,c=>n(1,s=c)),t.$$.update=()=>{t.$$.dirty&2&&n(0,i=s?jI(s,ms):null)},[i,s]}class kC extends xn{constructor(e){super(),vn(this,e,AC,PC,hn,{})}}const DC=t=>({}),s1=t=>({}),RC=t=>({}),a1=t=>({});function NC(t){let e,n,i,s;const c=t[1].left,p=Do(c,t,t[0],a1),u=t[1].main,x=Do(u,t,t[0],s1);return{c(){e=zt("div"),p&&p.c(),n=ge(),i=zt("div"),x&&x.c(),Ut(e,"class","left svelte-k43lgc"),Ut(i,"class","main svelte-k43lgc")},m(w,E){Vt(w,e,E),p&&p.m(e,null),Vt(w,n,E),Vt(w,i,E),x&&x.m(i,null),s=!0},p(w,[E]){p&&p.p&&(!s||E&1)&&No(p,c,w,w[0],s?Ro(c,w[0],E,RC):zo(w[0]),a1),x&&x.p&&(!s||E&1)&&No(x,u,w,w[0],s?Ro(u,w[0],E,DC):zo(w[0]),s1)},i(w){s||(Bt(p,w),Bt(x,w),s=!0)},o(w){Xt(p,w),Xt(x,w),s=!1},d(w){w&&(Ot(e),Ot(n),Ot(i)),p&&p.d(w),x&&x.d(w)}}}function zC(t,e,n){let{$$slots:i={},$$scope:s}=e;return t.$$set=c=>{"$$scope"in c&&n(0,s=c.$$scope)},[s,i]}class OC extends xn{constructor(e){super(),vn(this,e,zC,NC,hn,{})}}function l1(t,e,n){const i=t.slice();return i[1]=e[n][0],i[2]=e[n][1],i}function u1(t){let e,n,i,s=t[1]+"",c,p;return{c(){e=zt("li"),n=zt("span"),i=ge(),c=Mn(s),p=ge(),Ut(n,"class","svelte-kzgqtg"),nr(n,"background",t[2])},m(u,x){Vt(u,e,x),Ft(e,n),Ft(e,i),Ft(e,c),Ft(e,p)},p(u,x){x&1&&nr(n,"background",u[2]),x&1&&s!==(s=u[1]+"")&&to(c,s)},d(u){u&&Ot(e)}}}function FC(t){let e,n=mo(t[0]),i=[];for(let s=0;s{"rows"in s&&n(0,i=s.rows)},[i]}class VC extends xn{constructor(e){super(),vn(this,e,BC,FC,hn,{rows:0})}}function c1(t){let e,n;return{c(){e=zt("div"),n=Mn(t[0]),Ut(e,"class","svelte-1uuov7f")},m(i,s){Vt(i,e,s),Ft(e,n)},p(i,s){s&1&&to(n,i[0])},d(i){i&&Ot(e)}}}function UC(t){let e,n=t[0]&&c1(t);return{c(){n&&n.c(),e=Sa()},m(i,s){n&&n.m(i,s),Vt(i,e,s)},p(i,[s]){i[0]?n?n.p(i,s):(n=c1(i),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:Ve,o:Ve,d(i){i&&Ot(e),n&&n.d(i)}}}function GC(t,e,n){let{msg:i=null}=e;return t.$$set=s=>{"msg"in s&&n(0,i=s.msg)},[i]}class qC extends xn{constructor(e){super(),vn(this,e,GC,UC,hn,{msg:0})}}const jC=t=>({dialog:t&1}),h1=t=>({dialog:t[0]});function ZC(t){let e,n,i,s,c;const p=t[4].default,u=Do(p,t,t[3],h1);return{c(){e=zt("dialog"),n=zt("article"),u&&u.c(),e.open=!0},m(x,w){Vt(x,e,w),Ft(e,n),u&&u.m(n,null),t[6](e),i=!0,s||(c=[Ke(window,"click",t[1]),Ke(window,"keydown",t[2]),Ke(e,"close",t[5])],s=!0)},p(x,[w]){u&&u.p&&(!i||w&9)&&No(u,p,x,x[3],i?Ro(p,x[3],w,jC):zo(x[3]),h1)},i(x){i||(Bt(u,x),i=!0)},o(x){Xt(u,x),i=!1},d(x){x&&Ot(e),u&&u.d(x),t[6](null),s=!1,Er(c)}}}function WC(t,e,n){let{$$slots:i={},$$scope:s}=e,c;function p(E){c.open&&E.target==c&&c.close()}function u(E){(E.key=="Escape"||E.key=="Enter")&&(E.stopPropagation(),c.close())}function x(E){er.call(this,t,E)}function w(E){yo[E?"unshift":"push"](()=>{c=E,n(0,c)})}return t.$$set=E=>{"$$scope"in E&&n(3,s=E.$$scope)},[c,p,u,s,i,x,w]}class HC extends xn{constructor(e){super(),vn(this,e,WC,ZC,hn,{})}}var fo=63710088e-1,ly={centimeters:fo*100,centimetres:fo*100,degrees:fo/111325,feet:fo*3.28084,inches:fo*39.37,kilometers:fo/1e3,kilometres:fo/1e3,meters:fo,metres:fo,miles:fo/1609.344,millimeters:fo*1e3,millimetres:fo*1e3,nauticalmiles:fo/1852,radians:1,yards:fo*1.0936},XC={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/fo,yards:1.0936133},O_={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Js(t,e,n){n===void 0&&(n={});var i={type:"Feature"};return(n.id===0||n.id)&&(i.id=n.id),n.bbox&&(i.bbox=n.bbox),i.properties=e||{},i.geometry=t,i}function YC(t,e,n){switch(t){case"Point":return Ko(e).geometry;case"LineString":return Os(e).geometry;case"Polygon":return uy(e).geometry;case"MultiPoint":return hb(e).geometry;case"MultiLineString":return cb(e).geometry;case"MultiPolygon":return pb(e).geometry;default:throw new Error(t+" is invalid")}}function Ko(t,e,n){if(n===void 0&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!km(t[0])||!km(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return Js(i,e,n)}function KC(t,e,n){return n===void 0&&(n={}),hc(t.map(function(i){return Ko(i,e)}),n)}function uy(t,e,n){n===void 0&&(n={});for(var i=0,s=t;i=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function cy(t,e){e===void 0&&(e="kilometers");var n=ly[e];if(!n)throw new Error(e+" units is invalid");return t*n}function Km(t,e){e===void 0&&(e="kilometers");var n=ly[e];if(!n)throw new Error(e+" units is invalid");return t/n}function eT(t,e){return zf(Km(t,e))}function nT(t){var e=t%360;return e<0&&(e+=360),e}function zf(t){var e=t%(2*Math.PI);return e*180/Math.PI}function Fs(t){var e=t%360;return e*Math.PI/180}function iT(t,e,n){if(e===void 0&&(e="kilometers"),n===void 0&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return cy(Km(t,e),n)}function rT(t,e,n){if(e===void 0&&(e="meters"),n===void 0&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=O_[e];if(!i)throw new Error("invalid original units");var s=O_[n];if(!s)throw new Error("invalid final units");return t/i*s}function km(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function hy(t){return!!t&&t.constructor===Object}function oT(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(e){if(!km(e))throw new Error("bbox must only contain numbers")})}function sT(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const aT=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:O_,bearingToAzimuth:nT,convertArea:rT,convertLength:iT,degreesToRadians:Fs,earthRadius:fo,factors:ly,feature:Js,featureCollection:hc,geometry:YC,geometryCollection:$C,isNumber:km,isObject:hy,lengthToDegrees:eT,lengthToRadians:Km,lineString:Os,lineStrings:QC,multiLineString:cb,multiPoint:hb,multiPolygon:pb,point:Ko,points:KC,polygon:uy,polygons:JC,radiansToDegrees:zf,radiansToLength:cy,round:tT,unitsFactors:XC,validateBBox:oT,validateId:sT},Symbol.toStringTag,{value:"Module"}));function Of(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Zh(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function fb(t,e,n){if(n===void 0&&(n={}),n.final===!0)return lT(t,e);var i=Of(t),s=Of(e),c=Fs(i[0]),p=Fs(s[0]),u=Fs(i[1]),x=Fs(s[1]),w=Math.sin(p-c)*Math.cos(x),E=Math.cos(u)*Math.sin(x)-Math.sin(u)*Math.cos(x)*Math.cos(p-c);return zf(Math.atan2(w,E))}function lT(t,e){var n=fb(e,t);return n=(n+180)%360,n}function af(t,e,n){n===void 0&&(n={});var i=Of(t),s=Of(e),c=Fs(s[1]-i[1]),p=Fs(s[0]-i[0]),u=Fs(i[1]),x=Fs(s[1]),w=Math.pow(Math.sin(c/2),2)+Math.pow(Math.sin(p/2),2)*Math.cos(u)*Math.cos(x);return cy(2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w)),n.units)}function p1(t,e,n,i){i===void 0&&(i={});var s=Of(t),c=Fs(s[0]),p=Fs(s[1]),u=Fs(n),x=Km(e,i.units),w=Math.asin(Math.sin(p)*Math.cos(x)+Math.cos(p)*Math.sin(x)*Math.cos(u)),E=c+Math.atan2(Math.sin(u)*Math.sin(x)*Math.cos(p),Math.cos(x)-Math.sin(p)*Math.sin(w)),L=zf(E),A=zf(w);return Ko([L,A],i.properties)}function Yf(t,e,n){if(t!==null)for(var i,s,c,p,u,x,w,E=0,L=0,A,V=t.type,O=V==="FeatureCollection",J=V==="Feature",Y=O?t.features.length:1,$=0;$x||O>w||J>E){u=L,x=i,w=O,E=J,c=0;return}var Y=Os([u,L],n.properties);if(e(Y,i,s,J,c)===!1)return!1;c++,u=L})===!1)return!1}}})}function mT(t,e,n){var i=n,s=!1;return mb(t,function(c,p,u,x,w){s===!1&&n===void 0?i=c:i=e(i,c,p,u,x,w),s=!0}),i}function gb(t,e){if(!t)throw new Error("geojson is required");ep(t,function(n,i,s){if(n.geometry!==null){var c=n.geometry.type,p=n.geometry.coordinates;switch(c){case"LineString":if(e(n,i,s,0,0)===!1)return!1;break;case"Polygon":for(var u=0;us?n:s,w=i>c?i:c;return[p,u,x,w]}var fy={exports:{}},_b={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(J1,function(){function n(U,G,X,at,vt){(function dt(pt,ut,Rt,yt,wt){for(;yt>Rt;){if(yt-Rt>600){var ie=yt-Rt+1,Tt=ut-Rt+1,ae=Math.log(ie),Kt=.5*Math.exp(2*ae/3),re=.5*Math.sqrt(ae*Kt*(ie-Kt)/ie)*(Tt-ie/2<0?-1:1),Ne=Math.max(Rt,Math.floor(ut-Tt*Kt/ie+re)),Ue=Math.min(yt,Math.floor(ut+(ie-Tt)*Kt/ie+re));dt(pt,ut,Ne,Ue,wt)}var wn=pt[ut],Qe=Rt,Pe=yt;for(i(pt,Rt,ut),wt(pt[yt],wn)>0&&i(pt,Rt,yt);Qe0;)Pe--}wt(pt[Rt],wn)===0?i(pt,Rt,Pe):i(pt,++Pe,yt),Pe<=ut&&(Rt=Pe+1),ut<=Pe&&(yt=Pe-1)}})(U,G,X||0,at||U.length-1,vt||s)}function i(U,G,X){var at=U[G];U[G]=U[X],U[X]=at}function s(U,G){return UG?1:0}var c=function(U){U===void 0&&(U=9),this._maxEntries=Math.max(4,U),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function p(U,G,X){if(!X)return G.indexOf(U);for(var at=0;at=U.minX&&G.maxY>=U.minY}function Y(U){return{children:U,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function $(U,G,X,at,vt){for(var dt=[G,X];dt.length;)if(!((X=dt.pop())-(G=dt.pop())<=at)){var pt=G+Math.ceil((X-G)/at/2)*at;n(U,pt,G,X,vt),dt.push(G,pt,pt,X)}}return c.prototype.all=function(){return this._all(this.data,[])},c.prototype.search=function(U){var G=this.data,X=[];if(!J(U,G))return X;for(var at=this.toBBox,vt=[];G;){for(var dt=0;dt=0&&vt[G].children.length>this._maxEntries;)this._split(vt,G),G--;this._adjustParentBBoxes(at,vt,G)},c.prototype._split=function(U,G){var X=U[G],at=X.children.length,vt=this._minEntries;this._chooseSplitAxis(X,vt,at);var dt=this._chooseSplitIndex(X,vt,at),pt=Y(X.children.splice(dt,X.children.length-dt));pt.height=X.height,pt.leaf=X.leaf,u(X,this.toBBox),u(pt,this.toBBox),G?U[G-1].children.push(pt):this._splitRoot(X,pt)},c.prototype._splitRoot=function(U,G){this.data=Y([U,G]),this.data.height=U.height+1,this.data.leaf=!1,u(this.data,this.toBBox)},c.prototype._chooseSplitIndex=function(U,G,X){for(var at,vt,dt,pt,ut,Rt,yt,wt=1/0,ie=1/0,Tt=G;Tt<=X-G;Tt++){var ae=x(U,0,Tt,this.toBBox),Kt=x(U,Tt,X,this.toBBox),re=(vt=ae,dt=Kt,pt=void 0,ut=void 0,Rt=void 0,yt=void 0,pt=Math.max(vt.minX,dt.minX),ut=Math.max(vt.minY,dt.minY),Rt=Math.min(vt.maxX,dt.maxX),yt=Math.min(vt.maxY,dt.maxY),Math.max(0,Rt-pt)*Math.max(0,yt-ut)),Ne=A(ae)+A(Kt);re=G;wt--){var ie=U.children[wt];w(pt,U.leaf?vt(ie):ie),ut+=V(pt)}return ut},c.prototype._adjustParentBBoxes=function(U,G,X){for(var at=X;at>=0;at--)w(G[at],U)},c.prototype._condense=function(U){for(var G=U.length-1,X=void 0;G>=0;G--)U[G].children.length===0?G>0?(X=U[G-1].children).splice(X.indexOf(U[G]),1):this.clear():u(U[G],this.toBBox)},c})})(_b);var ST=_b.exports;const ET=$1(aT),yb=$1(vT);var dy={};Object.defineProperty(dy,"__esModule",{value:!0});var IT=yb;function F_(t){var e=[1/0,1/0,-1/0,-1/0];return IT.coordEach(t,function(n){e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2] line1 must only contain 2 coordinates");if(i.length!==2)throw new Error(" line2 must only contain 2 coordinates");var s=n[0][0],c=n[0][1],p=n[1][0],u=n[1][1],x=i[0][0],w=i[0][1],E=i[1][0],L=i[1][1],A=(L-w)*(p-s)-(E-x)*(u-c),V=(E-x)*(c-w)-(L-w)*(s-x),O=(p-s)*(c-w)-(u-c)*(s-x);if(A===0)return null;var J=V/A,Y=O/A;if(J>=0&&J<=1&&Y>=0&&Y<=1){var $=s+J*(p-s),U=c+J*(u-c);return Ko([$,U])}return null}function PT(t,e,n){n===void 0&&(n={});var i=Ko([1/0,1/0],{dist:1/0}),s=0;return ep(t,function(c){for(var p=Zh(c),u=0;u0&&(Y=J.features[0],Y.properties.dist=af(e,Y,n),Y.properties.location=s+af(x,Y,n)),x.properties.dist{if(this.active&&!this.dragFrom)this.recalculateHovering(e);else if(this.active&&this.dragFrom){if(this.hover=="polygon"){let n=this.dragFrom[0]-e.lngLat.lng,i=this.dragFrom[1]-e.lngLat.lat;for(let s of this.points)s[0]-=n,s[1]-=i}else this.points[this.hover]=e.lngLat.toArray();this.dragFrom=e.lngLat.toArray(),this.redraw()}});ur(this,"onClick",e=>{if(this.beforeUpdate(),this.active&&this.cursor){let n=[];if(g1(this.points).forEach((i,s)=>{n.push([s+1,PT(i,this.cursor).properties.dist])}),n.sort((i,s)=>i[1]-s[1]),n.length>0){let i=n[0][0];this.points.splice(i,0,this.cursor.geometry.coordinates),this.hover=i}else this.points.push(this.cursor.geometry.coordinates),this.hover=this.points.length-1;this.redraw(),this.pointsUpdated()}else this.active&&typeof this.hover=="number"&&(this.points.splice(this.hover,1),this.hover=null,this.redraw(),this.pointsUpdated(),this.recalculateHovering(e))});ur(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.cursor=f_(e.lngLat.toArray()),this.onClick(e),this.finish())});ur(this,"onMouseDown",e=>{this.active&&!this.dragFrom&&this.hover!=null&&(e.preventDefault(),this.cursor=null,this.dragFrom=e.lngLat.toArray(),this.beforeUpdate(),this.redraw())});ur(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});ur(this,"onKeypress",e=>{this.active&&(e.key=="Enter"?(e.stopPropagation(),this.finish()):e.key=="z"&&e.ctrlKey&&this.undo())});ur(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.stopPropagation(),this.cancel())});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,this.previousStates=[],this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("mousedown",this.onMouseDown),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keypress",this.onKeypress),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("mousedown",this.onMouseDown),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keypress",this.onKeypress),document.removeEventListener("keydown",this.onKeyDown)}finish(){let e=this.polygonFeature();if(e)for(let n of this.eventListenersSuccess)n(e);else for(let n of this.eventListenersFailure)n();this.stop()}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}startNew(){this.active=!0,this.map.doubleClickZoom.disable()}editExisting(e){this.active=!0,this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(e.geometry.coordinates[0])),this.points.pop(),this.redraw()}stop(){this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.active=!1,this.hover=null,this.dragFrom=null,this.previousStates=[],this.redraw(),this.map.getCanvas().style.cursor="inherit"}undo(){this.dragFrom!=null||this.previousStates.length==0||(this.points=this.previousStates.pop(),this.hover=null,this.redraw())}redraw(){let e={type:"FeatureCollection",features:[]};this.points.forEach((s,c)=>{let p=f_(s);p.properties.hover=this.hover==c,p.properties.idx=c,e.features.push(p)}),e.features=e.features.concat(g1(this.points));let n=this.polygonFeature();n&&(n.properties.hover=this.hover=="polygon",e.features.push(n)),Sb.set(e);let i="crosshair";this.hover!=null&&(i=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=i,Eb.set(this.previousStates.length)}pointsUpdated(){let e=this.polygonFeature();if(e)for(let n of this.eventListenersUpdated)n(e)}recalculateHovering(e){this.cursor=null,this.hover=null;for(let n of this.map.queryRenderedFeatures(e.point,{layers:["edit-polygon-fill","edit-polygon-vertices"]}))if(n.geometry.type=="Polygon"){this.hover="polygon";break}else if(n.geometry.type=="Point"&&Object.hasOwn(n.properties,"idx")){this.hover=n.properties.idx;break}this.hover==null&&(this.cursor=f_(e.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let e=this.points.map(wb),n=[JSON.parse(JSON.stringify(e))];return n[0].push(JSON.parse(JSON.stringify(n[0][0]))),{type:"Feature",geometry:{type:"Polygon",coordinates:n},properties:{}}}beforeUpdate(){this.previousStates.push(JSON.parse(JSON.stringify(this.points))),this.previousStates.length>RT&&this.previousStates.shift()}}function g1(t){let e=[];for(let n=0;n=3&&e.push({type:"Feature",geometry:{type:"LineString",coordinates:[t[t.length-1],t[0]]},properties:{}}),e}function zT(t){let e,n,i;return{c(){e=Mn("Undo ("),n=Mn(t[1]),i=Mn(")")},m(s,c){Vt(s,e,c),Vt(s,n,c),Vt(s,i,c)},p(s,c){c&2&&to(n,s[1])},d(s){s&&(Ot(e),Ot(n),Ot(i))}}}function OT(t){let e;return{c(){e=Mn("Undo")},m(n,i){Vt(n,e,i)},p:Ve,d(n){n&&Ot(e)}}}function FT(t){let e,n,i,s,c,p,u,x,w,E,L;function A(J,Y){return J[1]==0?OT:zT}let V=A(t),O=V(t);return{c(){e=zt("div"),n=zt("button"),n.textContent="Finish",i=ge(),s=zt("button"),s.textContent="Cancel",c=ge(),p=zt("button"),O.c(),x=ge(),w=zt("ul"),w.innerHTML=`
  • Click + the map to add a vertex
  • Click + a vertex to delete it
  • Drag + a vertex or the polygon to move it
  • Press Control+Z + to undo your last change
  • Press Enter + or + double click + to finish
  • Press Escape + to cancel
  • `,p.disabled=u=t[1]==0,nr(e,"display","flex"),nr(e,"justify-content","space-between")},m(J,Y){Vt(J,e,Y),Ft(e,n),Ft(e,i),Ft(e,s),Ft(e,c),Ft(e,p),O.m(p,null),Vt(J,x,Y),Vt(J,w,Y),E||(L=[Ke(n,"click",t[2]),Ke(s,"click",t[3]),Ke(p,"click",t[4])],E=!0)},p(J,[Y]){V===(V=A(J))&&O?O.p(J,Y):(O.d(1),O=V(J),O&&(O.c(),O.m(p,null))),Y&2&&u!==(u=J[1]==0)&&(p.disabled=u)},i:Ve,o:Ve,d(J){J&&(Ot(e),Ot(x),Ot(w)),O.d(),E=!1,Er(L)}}}function BT(t,e,n){let i;en(t,Eb,x=>n(1,i=x));let{polygonTool:s}=e;const c=()=>s.finish(),p=()=>s.cancel(),u=()=>s.undo();return t.$$set=x=>{"polygonTool"in x&&n(0,s=x.polygonTool)},[s,i,c,p,u]}class VT extends xn{constructor(e){super(),vn(this,e,BT,FT,hn,{polygonTool:0})}}function UT(t){let e,n,i,s,c,p;return e=new nx({props:{id:"edit-polygon-fill",filter:AT,paint:{"fill-color":"red","fill-opacity":["case",["boolean",["get","hover"],"false"],1,.5]}}}),i=new Xh({props:{id:"edit-polygon-lines",filter:kT,paint:{"line-color":"black","line-width":8,"line-opacity":.5}}}),c=new lS({props:{id:"edit-polygon-vertices",filter:DT,paint:{"circle-color":"black","circle-opacity":["case",["has","hovered"],1,.5],"circle-radius":10}}}),{c(){Re(e.$$.fragment),n=ge(),Re(i.$$.fragment),s=ge(),Re(c.$$.fragment)},m(u,x){ke(e,u,x),Vt(u,n,x),ke(i,u,x),Vt(u,s,x),ke(c,u,x),p=!0},p:Ve,i(u){p||(Bt(e.$$.fragment,u),Bt(i.$$.fragment,u),Bt(c.$$.fragment,u),p=!0)},o(u){Xt(e.$$.fragment,u),Xt(i.$$.fragment,u),Xt(c.$$.fragment,u),p=!1},d(u){u&&(Ot(n),Ot(s)),De(e,u),De(i,u),De(c,u)}}}function GT(t){let e,n;return e=new pc({props:{data:t[0],$$slots:{default:[UT]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,[s]){const c={};s&1&&(c.data=i[0]),s&2&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function qT(t,e,n){let i;return en(t,Sb,s=>n(0,i=s)),[i]}class Ib extends xn{constructor(e){super(),vn(this,e,qT,GT,hn,{})}}function jT(t){let e,n,i,s,c,p,u,x,w;return{c(){e=zt("div"),n=zt("button"),n.textContent="Import current view",i=ge(),s=zt("i"),s.textContent="or...",c=ge(),p=zt("div"),u=zt("button"),u.textContent="Draw an area to import on the map",Ut(n,"type","button"),Ut(u,"type","button")},m(E,L){Vt(E,e,L),Ft(e,n),Vt(E,i,L),Vt(E,s,L),Vt(E,c,L),Vt(E,p,L),Ft(p,u),x||(w=[Ke(n,"click",t[1]),Ke(u,"click",t[2])],x=!0)},p:Ve,i:Ve,o:Ve,d(E){E&&(Ot(e),Ot(i),Ot(s),Ot(c),Ot(p)),x=!1,Er(w)}}}function ZT(t){let e,n;return e=new VT({props:{polygonTool:t[0]}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&1&&(c.polygonTool=i[0]),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function WT(t){let e,n,i,s;const c=[ZT,jT],p=[];function u(x,w){return x[0]?0:1}return e=u(t),n=p[e]=c[e](t),{c(){n.c(),i=Sa()},m(x,w){p[e].m(x,w),Vt(x,i,w),s=!0},p(x,[w]){let E=e;e=u(x),e===E?p[e].p(x,w):(zi(),Xt(p[E],1,1,()=>{p[E]=null}),Oi(),n=p[e],n?n.p(x,w):(n=p[e]=c[e](x),n.c()),Bt(n,1),n.m(i.parentNode,i))},i(x){s||(Bt(n),s=!0)},o(x){Xt(n),s=!1},d(x){x&&Ot(i),p[e].d(x)}}}function HT(t){let e='poly:"';for(let[i,s]of t.geometry.coordinates[0])e+=`${s} ${i} `;return e=e.slice(0,-1)+'"',`https://overpass-api.de/api/interpreter?data=${`(nwr(${e}); node(w)->.x; <;); out meta;`}`}function lf(t){return[t.lng,t.lat]}function XT(t,e,n){let{map:i}=e;const s=Wh();let c=null;async function p(E){try{s("loading","Loading from Overpass");let A=await(await fetch(HT(E))).text();s("gotXml",A)}catch(L){s("error",L.toString())}}function u(){let E=i.getBounds();return{type:"Feature",properties:{},geometry:{coordinates:[[lf(E.getSouthWest()),lf(E.getNorthWest()),lf(E.getNorthEast()),lf(E.getSouthEast()),lf(E.getSouthWest())]],type:"Polygon"}}}async function x(){if(i){if(i.getZoom()<13){s("error","Zoom in more to import");return}await p(u())}}function w(){i&&(n(0,c=new NT(i)),c.startNew(),c.addEventListenerSuccess(async E=>{n(0,c=null),await p(E)}),c.addEventListenerFailure(()=>{n(0,c=null)}))}return t.$$set=E=>{"map"in E&&n(3,i=E.map)},[c,x,w,i]}class YT extends xn{constructor(e){super(),vn(this,e,XT,WT,hn,{map:3})}}const KT=t=>({props:t&8}),_1=t=>({props:$T(t[3])});function JT(t){let e;const n=t[1].default,i=Do(n,t,t[2],_1);return{c(){i&&i.c()},m(s,c){i&&i.m(s,c),e=!0},p(s,c){i&&i.p&&(!e||c&12)&&No(i,n,s,s[2],e?Ro(n,s[2],c,KT):zo(s[2]),_1)},i(s){e||(Bt(i,s),e=!0)},o(s){Xt(i,s),e=!1},d(s){i&&i.d(s)}}}function QT(t){let e,n;return e=new US({props:{openOn:t[0],$$slots:{default:[JT,({features:i})=>({3:i}),({features:i})=>i?8:0]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,[s]){const c={};s&1&&(c.openOn=i[0]),s&12&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function $T(t){return t?t[0].properties??{}:(console.log("A Popup with null features should be impossible"),{})}function tL(t,e,n){let{$$slots:i={},$$scope:s}=e,{openOn:c="hover"}=e;return t.$$set=p=>{"openOn"in p&&n(0,c=p.openOn),"$$scope"in p&&n(2,s=p.$$scope)},[c,i,s]}class Cb extends xn{constructor(e){super(),vn(this,e,tL,QT,hn,{openOn:0})}}function y1(t,e,n){const i=t.slice();return i[1]=e[n][0],i[2]=e[n][1],i}function v1(t){let e,n,i=t[1]+"",s,c,p=t[2]+"",u;return{c(){e=zt("tr"),n=zt("td"),s=Mn(i),c=zt("td"),u=Mn(p)},m(x,w){Vt(x,e,w),Ft(e,n),Ft(n,s),Ft(e,c),Ft(c,u)},p(x,w){w&1&&i!==(i=x[1]+"")&&to(s,i),w&1&&p!==(p=x[2]+"")&&to(u,p)},d(x){x&&Ot(e)}}}function eL(t){let e,n,i=mo(Object.entries(t[0])),s=[];for(let c=0;c{"properties"in s&&n(0,i=s.properties)},[i]}class iL extends xn{constructor(e){super(),vn(this,e,nL,eL,hn,{properties:0})}}function x1(t,e,n){const i=t.slice();return i[2]=e[n],i}function b1(t,e,n){const i=t.slice();return i[5]=e[n],i}function w1(t){let e,n;return{c(){e=zt("span"),n=Mn(`  + `),nr(e,"background",t[5]),nr(e,"width","100%"),nr(e,"border","1px solid black")},m(i,s){Vt(i,e,s),Ft(e,n)},p(i,s){s&1&&nr(e,"background",i[5])},d(i){i&&Ot(e)}}}function S1(t){let e,n=t[2]+"",i;return{c(){e=zt("span"),i=Mn(n)},m(s,c){Vt(s,e,c),Ft(e,i)},p(s,c){c&2&&n!==(n=s[2]+"")&&to(i,n)},d(s){s&&Ot(e)}}}function rL(t){let e,n,i,s=mo(t[0]),c=[];for(let x=0;x{"colorScale"in c&&n(0,i=c.colorScale),"limits"in c&&n(1,s=c.limits)},[i,s]}class sL extends xn{constructor(e){super(),vn(this,e,oL,rL,hn,{colorScale:0,limits:1})}}function au(t,e,n){let i=["match",t];for(let[s,c]of Object.entries(e))i.push(s),i.push(c);return i.push(n),i}function aL(t,e,n){let i=["step",t];for(let s=1;s({}),E1=t=>({}),uL=t=>({}),I1=t=>({});function cL(t){let e,n,i,s;const c=t[3].sidebar,p=Do(c,t,t[2],I1),u=t[3].map,x=Do(u,t,t[2],E1);return{c(){e=zt("div"),p&&p.c(),n=ge(),i=zt("div"),x&&x.c()},m(w,E){Vt(w,e,E),p&&p.m(e,null),t[4](e),Vt(w,n,E),Vt(w,i,E),x&&x.m(i,null),t[5](i),s=!0},p(w,[E]){p&&p.p&&(!s||E&4)&&No(p,c,w,w[2],s?Ro(c,w[2],E,uL):zo(w[2]),I1),x&&x.p&&(!s||E&4)&&No(x,u,w,w[2],s?Ro(u,w[2],E,lL):zo(w[2]),E1)},i(w){s||(Bt(p,w),Bt(x,w),s=!0)},o(w){Xt(p,w),Xt(x,w),s=!1},d(w){w&&(Ot(e),Ot(n),Ot(i)),p&&p.d(w),t[4](null),x&&x.d(w),t[5](null)}}}function hL(t,e,n){let i,s;en(t,R_,w=>n(0,i=w)),en(t,N_,w=>n(1,s=w));let{$$slots:c={},$$scope:p}=e;function u(w){yo[w?"unshift":"push"](()=>{i=w,R_.set(i)})}function x(w){yo[w?"unshift":"push"](()=>{s=w,N_.set(s)})}return t.$$set=w=>{"$$scope"in w&&n(2,p=w.$$scope)},[i,s,p,c,u,x]}class Jm extends xn{constructor(e){super(),vn(this,e,hL,cL,hn,{})}}function pL(t){let e,n,i,s,c,p,u,x,w,E,L,A,V;return{c(){e=zt("div"),n=zt("h2"),n.textContent="Debug mode",i=ge(),s=zt("div"),c=zt("button"),c.textContent="Change study area",p=ge(),u=zt("button"),u.textContent="Route mode",x=ge(),w=zt("button"),w.textContent="Score mode",E=ge(),L=zt("p"),L.textContent="Hover to see a segment's properties, and click to open OSM",Ut(e,"slot","sidebar")},m(O,J){Vt(O,e,J),Ft(e,n),Ft(e,i),Ft(e,s),Ft(s,c),Ft(s,p),Ft(s,u),Ft(s,x),Ft(s,w),Ft(e,E),Ft(e,L),A||(V=[Ke(c,"click",t[5]),Ke(u,"click",t[6]),Ke(w,"click",t[7])],A=!0)},p:Ve,d(O){O&&Ot(e),A=!1,Er(V)}}}function fL(t){let e,n,i=t[8].kind+"",s,c,p,u;return p=new iL({props:{properties:t[8]}}),{c(){e=zt("h2"),n=Mn("Classified as "),s=Mn(i),c=ge(),Re(p.$$.fragment)},m(x,w){Vt(x,e,w),Ft(e,n),Ft(e,s),Vt(x,c,w),ke(p,x,w),u=!0},p(x,w){(!u||w&256)&&i!==(i=x[8].kind+"")&&to(s,i);const E={};w&256&&(E.properties=x[8]),p.$set(E)},i(x){u||(Bt(p.$$.fragment,x),u=!0)},o(x){Xt(p.$$.fragment,x),u=!1},d(x){x&&(Ot(e),Ot(c)),De(p,x)}}}function dL(t){let e,n;return e=new Cb({props:{openOn:"hover",$$slots:{default:[fL,({props:i})=>({8:i}),({props:i})=>i?256:0]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&768&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function mL(t){let e,n;return e=new Xh({props:{id:"network",paint:{"line-width":X0(5,7),"line-color":au(["get","kind"],Ua,"yellow"),"line-opacity":t[0]?t[1]/100:au(["get","kind"],{Severance:0},t[1]/100)},manageHoverState:!0,hoverCursor:"pointer",$$slots:{default:[dL]},$$scope:{ctx:t}}}),e.$on("click",t[4]),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&3&&(c.paint={"line-width":X0(5,7),"line-color":au(["get","kind"],Ua,"yellow"),"line-opacity":i[0]?i[1]/100:au(["get","kind"],{Severance:0},i[1]/100)}),s&512&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function gL(t){let e,n,i;return n=new pc({props:{data:JSON.parse(Ja(t[2]).render()),generateId:!0,$$slots:{default:[mL]},$$scope:{ctx:t}}}),{c(){e=zt("div"),Re(n.$$.fragment),Ut(e,"slot","map")},m(s,c){Vt(s,e,c),ke(n,e,null),i=!0},p(s,c){const p={};c&4&&(p.data=JSON.parse(Ja(s[2]).render())),c&515&&(p.$$scope={dirty:c,ctx:s}),n.$set(p)},i(s){i||(Bt(n.$$.fragment,s),i=!0)},o(s){Xt(n.$$.fragment,s),i=!1},d(s){s&&Ot(e),De(n)}}}function _L(t){let e,n;return e=new Jm({props:{$$slots:{map:[gL],sidebar:[pL]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,[s]){const c={};s&527&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function yL(t,e,n){let i,s;en(t,Nl,L=>n(2,i=L)),en(t,Jo,L=>n(3,s=L));let{showSeverances:c}=e,{opacity:p}=e;const u=L=>window.open(Ja(L.detail.features[0].properties).way,"_blank"),x=()=>Ei(Jo,s="title",s),w=()=>Ei(Jo,s="route",s),E=()=>Ei(Jo,s="score",s);return t.$$set=L=>{"showSeverances"in L&&n(0,c=L.showSeverances),"opacity"in L&&n(1,p=L.opacity)},[c,p,i,s,u,x,w,E]}class vL extends xn{constructor(e){super(),vn(this,e,yL,_L,hn,{showSeverances:0,opacity:1})}}function C1(t,e,n){const i=t.slice();return i[2]=e[n],i}function T1(t){let e,n,i=L1(t[2])+"",s,c;return{c(){e=zt("li"),n=zt("a"),c=ge(),Ut(n,"href",s=Ja(t[2].properties).way),Ut(n,"target","_blank")},m(p,u){Vt(p,e,u),Ft(e,n),n.innerHTML=i,Ft(e,c)},p(p,u){u&1&&i!==(i=L1(p[2])+"")&&(n.innerHTML=i),u&1&&s!==(s=Ja(p[2].properties).way)&&Ut(n,"href",s)},d(p){p&&Ot(e)}}}function xL(t){let e,n,i,s=(t[0].route_length/t[0].direct_length).toFixed(1)+"",c,p,u,x,w,E=t[1](t[0])+"",L,A,V,O,J=mo(t[0].features),Y=[];for(let $=0;${"route_gj"in c&&n(0,i=c.route_gj)},[i,s]}class wL extends xn{constructor(e){super(),vn(this,e,bL,xL,hn,{route_gj:0})}}function SL(t){let e,n;return e=new Xh({props:{id:"network",paint:{"line-width":5,"line-color":au(["get","kind"],Ua,"yellow"),"line-opacity":t[0]?t[1]/100:au(["get","kind"],{Severance:0},t[1]/100)}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&3&&(c.paint={"line-width":5,"line-color":au(["get","kind"],Ua,"yellow"),"line-opacity":i[0]?i[1]/100:au(["get","kind"],{Severance:0},i[1]/100)}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function EL(t){let e,n;return e=new pc({props:{data:JSON.parse(Ja(t[2]).render()),$$slots:{default:[SL]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,[s]){const c={};s&4&&(c.data=JSON.parse(Ja(i[2]).render())),s&11&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function IL(t,e,n){let i;en(t,Nl,p=>n(2,i=p));let{showSeverances:s}=e,{opacity:c}=e;return t.$$set=p=>{"showSeverances"in p&&n(0,s=p.showSeverances),"opacity"in p&&n(1,c=p.opacity)},[s,c,i]}class Tb extends xn{constructor(e){super(),vn(this,e,IL,EL,hn,{showSeverances:0,opacity:1})}}function M1(t){let e,n;return{c(){e=zt("p"),n=Mn(t[5])},m(i,s){Vt(i,e,s),Ft(e,n)},p(i,s){s&32&&to(n,i[5])},d(i){i&&Ot(e)}}}function P1(t){let e,n;return e=new wL({props:{route_gj:t[4]}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&16&&(c.route_gj=i[4]),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function CL(t){let e,n,i,s,c,p,u,x,w,E,L,A,V,O,J,Y,$=t[5]&&M1(t),U=t[4]&&P1(t);return{c(){e=zt("div"),n=zt("h2"),n.textContent="Route mode",i=ge(),s=zt("div"),c=zt("button"),c.textContent="Change study area",p=ge(),u=zt("button"),u.textContent="Score mode",x=ge(),w=zt("button"),w.textContent="Debug OSM",E=ge(),L=zt("p"),L.innerHTML=`Move the A and B pins to find a walking route. (Hint: right-click + to set the first pin somewhere.)`,A=ge(),$&&$.c(),V=ge(),U&&U.c(),Ut(e,"slot","sidebar")},m(G,X){Vt(G,e,X),Ft(e,n),Ft(e,i),Ft(e,s),Ft(s,c),Ft(s,p),Ft(s,u),Ft(e,x),Ft(e,w),Ft(e,E),Ft(e,L),Ft(e,A),$&&$.m(e,null),Ft(e,V),U&&U.m(e,null),O=!0,J||(Y=[Ke(c,"click",t[10]),Ke(u,"click",t[11]),Ke(w,"click",t[12])],J=!0)},p(G,X){G[5]?$?$.p(G,X):($=M1(G),$.c(),$.m(e,V)):$&&($.d(1),$=null),G[4]?U?(U.p(G,X),X&16&&Bt(U,1)):(U=P1(G),U.c(),Bt(U,1),U.m(e,null)):U&&(zi(),Xt(U,1,1,()=>{U=null}),Oi())},i(G){O||(Bt(U),O=!0)},o(G){Xt(U),O=!1},d(G){G&&Ot(e),$&&$.d(),U&&U.d(),J=!1,Er(Y)}}}function TL(t){let e;return{c(){e=zt("span"),e.textContent="A",Ut(e,"class","dot svelte-1cqsh0e")},m(n,i){Vt(n,e,i)},p:Ve,d(n){n&&Ot(e)}}}function LL(t){let e;return{c(){e=zt("span"),e.textContent="B",Ut(e,"class","dot svelte-1cqsh0e")},m(n,i){Vt(n,e,i)},p:Ve,d(n){n&&Ot(e)}}}function A1(t){let e,n;return e=new pc({props:{data:t[4],$$slots:{default:[ML]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&16&&(c.data=i[4]),s&65536&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function ML(t){let e,n;return e=new Xh({props:{id:"route",beforeId:"network",paint:{"line-width":20,"line-color":"cyan","line-opacity":.5}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p:Ve,i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function PL(t){let e,n,i,s,c,p,u,x,w,E;n=new Tb({props:{showSeverances:t[0],opacity:t[1]}});function L(Y){t[8](Y)}let A={draggable:!0,$$slots:{default:[TL]},$$scope:{ctx:t}};t[2]!==void 0&&(A.lngLat=t[2]),s=new iv({props:A}),yo.push(()=>Sh(s,"lngLat",L));function V(Y){t[9](Y)}let O={draggable:!0,$$slots:{default:[LL]},$$scope:{ctx:t}};t[3]!==void 0&&(O.lngLat=t[3]),u=new iv({props:O}),yo.push(()=>Sh(u,"lngLat",V));let J=t[4]&&A1(t);return{c(){e=zt("div"),Re(n.$$.fragment),i=ge(),Re(s.$$.fragment),p=ge(),Re(u.$$.fragment),w=ge(),J&&J.c(),Ut(e,"slot","map")},m(Y,$){Vt(Y,e,$),ke(n,e,null),Ft(e,i),ke(s,e,null),Ft(e,p),ke(u,e,null),Ft(e,w),J&&J.m(e,null),E=!0},p(Y,$){const U={};$&1&&(U.showSeverances=Y[0]),$&2&&(U.opacity=Y[1]),n.$set(U);const G={};$&65536&&(G.$$scope={dirty:$,ctx:Y}),!c&&$&4&&(c=!0,G.lngLat=Y[2],wh(()=>c=!1)),s.$set(G);const X={};$&65536&&(X.$$scope={dirty:$,ctx:Y}),!x&&$&8&&(x=!0,X.lngLat=Y[3],wh(()=>x=!1)),u.$set(X),Y[4]?J?(J.p(Y,$),$&16&&Bt(J,1)):(J=A1(Y),J.c(),Bt(J,1),J.m(e,null)):J&&(zi(),Xt(J,1,1,()=>{J=null}),Oi())},i(Y){E||(Bt(n.$$.fragment,Y),Bt(s.$$.fragment,Y),Bt(u.$$.fragment,Y),Bt(J),E=!0)},o(Y){Xt(n.$$.fragment,Y),Xt(s.$$.fragment,Y),Xt(u.$$.fragment,Y),Xt(J),E=!1},d(Y){Y&&Ot(e),De(n),De(s),De(u),J&&J.d()}}}function AL(t){let e,n;return e=new Jm({props:{$$slots:{map:[PL],sidebar:[CL]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,[s]){const c={};s&65663&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function hm(t,e,n){return e+t*(n-e)}function kL(t,e,n){let i,s,c;en(t,tp,G=>n(13,i=G)),en(t,Nl,G=>n(7,s=G)),en(t,Jo,G=>n(6,c=G));let{showSeverances:p}=e,{opacity:u}=e,x=Array.from(s.getBounds()),w={lng:hm(.4,x[0],x[2]),lat:hm(.4,x[1],x[3])},E={lng:hm(.6,x[0],x[2]),lat:hm(.6,x[1],x[3])},L=null,A="";Bf(()=>{i==null||i.on("contextmenu",V)}),fa(()=>{i==null||i.off("contextmenu",V)});function V(G){n(2,w=G.lngLat)}function O(G){w=G,n(2,w)}function J(G){E=G,n(3,E)}const Y=()=>Ei(Jo,c="title",c),$=()=>Ei(Jo,c="score",c),U=()=>Ei(Jo,c="debug",c);return t.$$set=G=>{"showSeverances"in G&&n(0,p=G.showSeverances),"opacity"in G&&n(1,u=G.opacity)},t.$$.update=()=>{if(t.$$.dirty&140&&w&&E)try{n(4,L=JSON.parse(s.compareRoute({x1:w.lng,y1:w.lat,x2:E.lng,y2:E.lat}))),n(5,A="")}catch(G){n(4,L=null),n(5,A=G.toString())}},[p,u,w,E,L,A,c,s,O,J,Y,$,U]}class DL extends xn{constructor(e){super(),vn(this,e,kL,AL,hn,{showSeverances:0,opacity:1})}}function RL(t){let e,n,i,s,c,p,u,x,w,E,L,A,V,O,J,Y;return V=new sL({props:{colorScale:sx,limits:ax}}),{c(){e=zt("div"),n=zt("h2"),n.textContent="Score mode",i=ge(),s=zt("div"),c=zt("button"),c.textContent="Change study area",p=ge(),u=zt("button"),u.textContent="Route mode",x=ge(),w=zt("button"),w.textContent="Debug OSM",E=ge(),L=zt("p"),L.innerHTML=`The desire lines are coloured based on their detour factor. Click one + to see the route`,A=ge(),Re(V.$$.fragment),Ut(e,"slot","sidebar")},m($,U){Vt($,e,U),Ft(e,n),Ft(e,i),Ft(e,s),Ft(s,c),Ft(s,p),Ft(s,u),Ft(e,x),Ft(e,w),Ft(e,E),Ft(e,L),Ft(e,A),ke(V,e,null),O=!0,J||(Y=[Ke(c,"click",t[6]),Ke(u,"click",t[7]),Ke(w,"click",t[8])],J=!0)},p:Ve,i($){O||(Bt(V.$$.fragment,$),O=!0)},o($){Xt(V.$$.fragment,$),O=!1},d($){$&&Ot(e),De(V),J=!1,Er(Y)}}}function NL(t){let e,n=t[11].score.toFixed(1)+"",i,s;return{c(){e=zt("span"),i=Mn(n),s=Mn("x"),nr(e,"font-size","26px")},m(c,p){Vt(c,e,p),Ft(e,i),Ft(e,s)},p(c,p){p&2048&&n!==(n=c[11].score.toFixed(1)+"")&&to(i,n)},d(c){c&&Ot(e)}}}function zL(t){let e,n;return e=new Cb({props:{openOn:"hover",$$slots:{default:[NL,({props:i})=>({11:i}),({props:i})=>i?2048:0]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&6144&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function OL(t){let e,n;return e=new Xh({props:{id:"scores",paint:{"line-width":8,"line-color":aL(["get","score"],ax,sx)},$$slots:{default:[zL]},$$scope:{ctx:t}}}),e.$on("click",t[5]),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&4096&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function k1(t){let e,n;return e=new pc({props:{data:t[2],$$slots:{default:[FL]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&4&&(c.data=i[2]),s&4096&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function FL(t){let e,n;return e=new Xh({props:{id:"route",beforeId:"network",paint:{"line-width":20,"line-color":"cyan","line-opacity":.5}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p:Ve,i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function BL(t){let e,n,i,s,c,p;n=new Tb({props:{showSeverances:t[0],opacity:t[1]}}),s=new pc({props:{data:JSON.parse(Ja(t[3]).makeHeatmap()),$$slots:{default:[OL]},$$scope:{ctx:t}}});let u=t[2]&&k1(t);return{c(){e=zt("div"),Re(n.$$.fragment),i=ge(),Re(s.$$.fragment),c=ge(),u&&u.c(),Ut(e,"slot","map")},m(x,w){Vt(x,e,w),ke(n,e,null),Ft(e,i),ke(s,e,null),Ft(e,c),u&&u.m(e,null),p=!0},p(x,w){const E={};w&1&&(E.showSeverances=x[0]),w&2&&(E.opacity=x[1]),n.$set(E);const L={};w&8&&(L.data=JSON.parse(Ja(x[3]).makeHeatmap())),w&4096&&(L.$$scope={dirty:w,ctx:x}),s.$set(L),x[2]?u?(u.p(x,w),w&4&&Bt(u,1)):(u=k1(x),u.c(),Bt(u,1),u.m(e,null)):u&&(zi(),Xt(u,1,1,()=>{u=null}),Oi())},i(x){p||(Bt(n.$$.fragment,x),Bt(s.$$.fragment,x),Bt(u),p=!0)},o(x){Xt(n.$$.fragment,x),Xt(s.$$.fragment,x),Xt(u),p=!1},d(x){x&&Ot(e),De(n),De(s),u&&u.d()}}}function VL(t){let e,n;return e=new Jm({props:{$$slots:{map:[BL],sidebar:[RL]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,[s]){const c={};s&4127&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function UL(t,e,n){let i,s,c;en(t,tp,O=>n(9,i=O)),en(t,Nl,O=>n(3,s=O)),en(t,Jo,O=>n(4,c=O));let{showSeverances:p}=e,{opacity:u}=e,x=null;function w(O){try{let J=O.detail.features[0].geometry.coordinates;n(2,x=JSON.parse(s.compareRoute({x1:J[0][0],y1:J[0][1],x2:J[1][0],y2:J[1][1]})))}catch(J){window.alert(`No route: ${J}`),n(2,x=null)}}Bf(()=>{i==null||i.on("click",E)}),fa(()=>{i==null||i.off("click",E)});function E(O){i.queryRenderedFeatures(O.point,{layers:["scores"]}).length>0||n(2,x=null)}const L=()=>Ei(Jo,c="title",c),A=()=>Ei(Jo,c="route",c),V=()=>Ei(Jo,c="debug",c);return t.$$set=O=>{"showSeverances"in O&&n(0,p=O.showSeverances),"opacity"in O&&n(1,u=O.opacity)},[p,u,x,s,c,w,L,A,V]}class GL extends xn{constructor(e){super(),vn(this,e,UL,VL,hn,{showSeverances:0,opacity:1})}}function D1(t,e,n){const i=t.slice();return i[18]=e[n][0],i[19]=e[n][1],i}function R1(t,e,n){const i=t.slice();return i[22]=e[n][0],i[23]=e[n][1],i}function N1(t){let e,n=t[23]+"",i,s;return{c(){e=zt("option"),i=Mn(n),e.__value=s=t[22],Ju(e,e.__value)},m(c,p){Vt(c,e,p),Ft(e,i)},p(c,p){p&4&&n!==(n=c[23]+"")&&to(i,n),p&4&&s!==(s=c[22])&&(e.__value=s,Ju(e,e.__value))},d(c){c&&Ot(e)}}}function z1(t){let e,n,i=mo(t[19]),s=[];for(let c=0;ct[8].call(p)),Ut(O,"type","file")},m(pt,ut){ke(e,pt,ut),Vt(pt,n,ut),Vt(pt,i,ut),Ft(i,s),Ft(s,c),Ft(s,p),Ft(p,u);for(let Rt=0;Rtn(14,i=at)),en(t,Nl,at=>n(15,s=at)),en(t,tp,at=>n(4,c=at));let p="",u=null,x=!1,w=[];Bf(async()=>{try{let at=await fetch("/osm/areas.json");if(at.ok)x=!0,console.log("Using local cache, not od2net.org"),n(2,w=await at.json());else{let vt=await fetch("https://assets.od2net.org/severance_pbfs/areas.json");n(2,w=await vt.json())}}catch{}});let E;async function L(at){try{A(await E.files[0].arrayBuffer()),n(0,p="")}catch(vt){window.alert(`Couldn't open this file: ${vt}`)}n(1,u=null)}function A(at){n(1,u="Building map model from OSM input"),console.time("load"),Ei(Nl,s=new G2(new Uint8Array(at),i),s),console.timeEnd("load")}function V(at){try{A(new TextEncoder().encode(at.detail)),n(0,p="")}catch(vt){window.alert(`Couldn't import from Overpass: ${vt}`)}n(1,u=null)}async function O(at){at!=""&&(x?await J(`/osm/${at}.pbf`):await J(`https://assets.od2net.org/severance_pbfs/${at}.pbf`))}async function J(at){try{n(1,u=`Downloading ${at}`);let vt=await fetch(at);A(await vt.arrayBuffer())}catch(vt){window.alert(`Couldn't open from URL ${at}: ${vt}`)}n(1,u=null)}function Y(){p=L2(this),n(0,p),n(2,w)}const $=()=>O(p);function U(at){yo[at?"unshift":"push"](()=>{E=at,n(3,E)})}const G=at=>n(1,u=at.detail),X=at=>window.alert(at.detail);return t.$$.update=()=>{t.$$.dirty&1&&O(p)},[p,u,w,E,c,L,V,O,Y,$,U,G,X]}class ZL extends xn{constructor(e){super(),vn(this,e,jL,qL,hn,{})}}function O1(t){let e,n;return e=new HC({props:{$$slots:{default:[WL,({dialog:i})=>({9:i}),({dialog:i})=>i?512:0]},$$scope:{ctx:t}}}),e.$on("close",t[5]),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&1536&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function WL(t){let e,n,i,s,c,p,u,x,w,E,L,A,V,O,J,Y,$,U,G,X,at,vt;function dt(){return t[4](t[9])}return{c(){e=zt("h1"),e.textContent="Severance Snape",n=ge(),i=zt("p"),i.innerHTML=`This is an experimental tool to study "severances" for people walking. + In some places, crossing a big road (a "severance") might be easy -- there's + a zebra or signalized crossing right on the "desire line" where someone + might want to cross. But often, a person might have to walk a few blocks + to reach the nearest crossing -- and then they might have to go up or down + stairs to cross on a bridge or a tunnel!`,s=ge(),c=zt("p"),c.textContent=`This tool quantifies just how bad this crossing is with a "detour + factor" -- the ratio of the length to cross in a straight line and the + length of the actual path, according to OSM data. A score close to 1 + is great, and a score of 4 means the actual path is 4 times the length + of the straight desire line.`,p=ge(),u=zt("p"),u.innerHTML=`This tool is experimental, so there will be bugs both with OSM + data and what the tool shows!`,x=ge(),w=zt("p"),w.textContent="To use this tool, you need to:",E=ge(),L=zt("ol"),L.innerHTML=`
  • Choose your study area to analyze
  • Check the severances that show up -- they're inferred from OSM data + and might not be correct
  • Use the Route mode to explore the detour factor between any two + points you choose
  • Use the Score mode to visualize the detour factor everywhere, + looking for places easy and hard to cross
  • `,A=ge(),V=zt("p"),V.innerHTML=`This tool aims to complement an "area porosity" analysis, defined in section 2.3.5 of TfL's Cycling Design Standards. That definition of porosity just counts the number of crossings per + area, and isn't very detailed about how far you have to walk to a + crossing in that area.`,O=ge(),J=zt("p"),J.innerHTML=`This open source + tool is created by + Dustin Carlino + and relies heavily on + OpenStreetMap data.`,Y=ge(),$=zt("details"),$.innerHTML='Changelog

    GitHub has more detail; this is a summary

    • 17 February - use Pico for styling
    • 21 January - fix shortest route calculations
    ',U=ge(),G=zt("center"),X=zt("button"),X.textContent="Start!"},m(pt,ut){Vt(pt,e,ut),Vt(pt,n,ut),Vt(pt,i,ut),Vt(pt,s,ut),Vt(pt,c,ut),Vt(pt,p,ut),Vt(pt,u,ut),Vt(pt,x,ut),Vt(pt,w,ut),Vt(pt,E,ut),Vt(pt,L,ut),Vt(pt,A,ut),Vt(pt,V,ut),Vt(pt,O,ut),Vt(pt,J,ut),Vt(pt,Y,ut),Vt(pt,$,ut),Vt(pt,U,ut),Vt(pt,G,ut),Ft(G,X),at||(vt=Ke(X,"click",dt),at=!0)},p(pt,ut){t=pt},d(pt){pt&&(Ot(e),Ot(n),Ot(i),Ot(s),Ot(c),Ot(p),Ot(u),Ot(x),Ot(w),Ot(E),Ot(L),Ot(A),Ot(V),Ot(O),Ot(J),Ot(Y),Ot($),Ot(U),Ot(G)),at=!1,vt()}}}function HL(t){let e;return{c(){e=zt("p"),e.textContent="Waiting for MapLibre and WASM to load..."},m(n,i){Vt(n,e,i)},i:Ve,o:Ve,d(n){n&&Ot(e)}}}function XL(t){let e,n;return e=new ZL({}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function YL(t){let e,n,i,s,c,p,u,x,w,E,L,A,V,O,J,Y,$,U,G,X,at=t[1]&&O1(t);const vt=[XL,HL],dt=[];function pt(ut,Rt){return ut[2]&&ut[0]?0:1}return w=pt(t),E=dt[w]=vt[w](t),{c(){e=zt("div"),at&&at.c(),n=ge(),i=zt("h2"),i.textContent="Choose your study area",s=ge(),c=zt("button"),c.textContent="About this tool",p=ge(),u=zt("hr"),x=ge(),E.c(),L=ge(),A=zt("div"),V=zt("label"),O=zt("input"),J=Mn(` + When a road in OSM doesn't explicitly specify sidewalks, assume they exist + or not? (This tool works best in places where sidewalks are consistently + tagged as + `),Y=zt("a"),Y.textContent="separate ways",$=Mn(". Disable this in those places.)"),Ut(O,"type","checkbox"),Ut(Y,"href","https://wiki.openstreetmap.org/wiki/Sidewalks#Sidewalk_as_separate_way"),Ut(Y,"target","_blank"),Ut(e,"slot","sidebar")},m(ut,Rt){Vt(ut,e,Rt),at&&at.m(e,null),Ft(e,n),Ft(e,i),Ft(e,s),Ft(e,c),Ft(e,p),Ft(e,u),Ft(e,x),dt[w].m(e,null),Ft(e,L),Ft(e,A),Ft(A,V),Ft(V,O),O.checked=t[3],Ft(V,J),Ft(V,Y),Ft(V,$),U=!0,G||(X=[Ke(c,"click",t[6]),Ke(O,"change",t[7])],G=!0)},p(ut,Rt){ut[1]?at?(at.p(ut,Rt),Rt&2&&Bt(at,1)):(at=O1(ut),at.c(),Bt(at,1),at.m(e,n)):at&&(zi(),Xt(at,1,1,()=>{at=null}),Oi());let yt=w;w=pt(ut),w!==yt&&(zi(),Xt(dt[yt],1,1,()=>{dt[yt]=null}),Oi(),E=dt[w],E||(E=dt[w]=vt[w](ut),E.c()),Bt(E,1),E.m(e,L)),Rt&8&&(O.checked=ut[3])},i(ut){U||(Bt(at),Bt(E),U=!0)},o(ut){Xt(at),Xt(E),U=!1},d(ut){ut&&Ot(e),at&&at.d(),dt[w].d(),G=!1,Er(X)}}}function KL(t){let e,n,i;return n=new Ib({}),{c(){e=zt("div"),Re(n.$$.fragment),Ut(e,"slot","map")},m(s,c){Vt(s,e,c),ke(n,e,null),i=!0},p:Ve,i(s){i||(Bt(n.$$.fragment,s),i=!0)},o(s){Xt(n.$$.fragment,s),i=!1},d(s){s&&Ot(e),De(n)}}}function JL(t){let e,n;return e=new Jm({props:{$$slots:{map:[KL],sidebar:[YL]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,[s]){const c={};s&1039&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function QL(t,e,n){let i,s,c,p;en(t,Nl,A=>n(8,i=A)),en(t,p_,A=>n(1,s=A)),en(t,tp,A=>n(2,c=A)),en(t,z_,A=>n(3,p=A));let{wasmReady:u}=e;Ei(Nl,i=null,i);const x=A=>Ja(A).close(),w=()=>Ei(p_,s=!1,s),E=()=>Ei(p_,s=!0,s);function L(){p=this.checked,z_.set(p)}return t.$$set=A=>{"wasmReady"in A&&n(0,u=A.wasmReady)},[u,s,c,p,x,w,E,L]}class $L extends xn{constructor(e){super(),vn(this,e,QL,JL,hn,{wasmReady:0})}}function F1(t){let e,n,i,s,c,p,u,x,w,E,L,A,V,O,J,Y,$,U,G;return p=new VC({props:{rows:[["Footway (ground, outdoors)",Ua.Footway],["Indoors footway",Ua.Indoors],["Footway not on the ground",Ua.BridgeOrTunnel],["Street with vehicle traffic (maybe with a sidewalk, maybe not)",Ua.WithTraffic],["Crossing",Ua.Crossing],["Severance",Ua.Severance]]}}),{c(){e=zt("hr"),n=ge(),i=zt("div"),s=zt("button"),s.textContent="Zoom to fit",c=ge(),Re(p.$$.fragment),u=ge(),x=zt("div"),w=zt("label"),E=zt("input"),L=Mn(` + Show severances`),A=ge(),V=zt("div"),O=zt("label"),J=Mn(`Network opacity: + `),Y=zt("input"),Ut(E,"type","checkbox"),Ut(Y,"type","range"),Ut(Y,"min","0"),Ut(Y,"max","100")},m(X,at){Vt(X,e,at),Vt(X,n,at),Vt(X,i,at),Ft(i,s),Vt(X,c,at),ke(p,X,at),Vt(X,u,at),Vt(X,x,at),Ft(x,w),Ft(w,E),E.checked=t[6],Ft(w,L),Vt(X,A,at),Vt(X,V,at),Ft(V,O),Ft(O,J),Ft(O,Y),Ju(Y,t[5]),$=!0,U||(G=[Ke(s,"click",t[8]),Ke(E,"change",t[14]),Ke(Y,"change",t[15]),Ke(Y,"input",t[15])],U=!0)},p(X,at){at&64&&(E.checked=X[6]),at&32&&Ju(Y,X[5])},i(X){$||(Bt(p.$$.fragment,X),$=!0)},o(X){Xt(p.$$.fragment,X),$=!1},d(X){X&&(Ot(e),Ot(n),Ot(i),Ot(c),Ot(u),Ot(x),Ot(A),Ot(V)),De(p,X),U=!1,Er(G)}}}function tM(t){let e,n,i,s,c,p,u=t[7]!="title"&&F1(t);return{c(){e=zt("div"),n=zt("h1"),n.textContent="Severance Snape",i=ge(),s=zt("div"),c=ge(),u&&u.c(),Ut(e,"slot","left")},m(x,w){Vt(x,e,w),Ft(e,n),Ft(e,i),Ft(e,s),t[13](s),Ft(e,c),u&&u.m(e,null),p=!0},p(x,w){x[7]!="title"?u?(u.p(x,w),w&128&&Bt(u,1)):(u=F1(x),u.c(),Bt(u,1),u.m(e,null)):u&&(zi(),Xt(u,1,1,()=>{u=null}),Oi())},i(x){p||(Bt(u),p=!0)},o(x){Xt(u),p=!1},d(x){x&&Ot(e),t[13](null),u&&u.d()}}}function B1(t){let e,n;return e=new $L({props:{wasmReady:t[4]}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&16&&(c.wasmReady=i[4]),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function V1(t){let e,n,i,s,c,p;e=new pc({props:{data:JSON.parse(t[3].getInvertedBoundary()),$$slots:{default:[eM]},$$scope:{ctx:t}}});const u=[rM,iM,nM],x=[];function w(E,L){return E[7]=="route"?0:E[7]=="score"?1:E[7]=="debug"?2:-1}return~(i=w(t))&&(s=x[i]=u[i](t)),{c(){Re(e.$$.fragment),n=ge(),s&&s.c(),c=Sa()},m(E,L){ke(e,E,L),Vt(E,n,L),~i&&x[i].m(E,L),Vt(E,c,L),p=!0},p(E,L){const A={};L&8&&(A.data=JSON.parse(E[3].getInvertedBoundary())),L&131072&&(A.$$scope={dirty:L,ctx:E}),e.$set(A);let V=i;i=w(E),i===V?~i&&x[i].p(E,L):(s&&(zi(),Xt(x[V],1,1,()=>{x[V]=null}),Oi()),~i?(s=x[i],s?s.p(E,L):(s=x[i]=u[i](E),s.c()),Bt(s,1),s.m(c.parentNode,c)):s=null)},i(E){p||(Bt(e.$$.fragment,E),Bt(s),p=!0)},o(E){Xt(e.$$.fragment,E),Xt(s),p=!1},d(E){E&&(Ot(n),Ot(c)),De(e,E),~i&&x[i].d(E)}}}function eM(t){let e,n;return e=new nx({props:{paint:{"fill-color":"black","fill-opacity":.3}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p:Ve,i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function nM(t){let e,n;return e=new vL({props:{showSeverances:t[6],opacity:t[5]}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&64&&(c.showSeverances=i[6]),s&32&&(c.opacity=i[5]),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function iM(t){let e,n;return e=new GL({props:{showSeverances:t[6],opacity:t[5]}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&64&&(c.showSeverances=i[6]),s&32&&(c.opacity=i[5]),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function rM(t){let e,n;return e=new DL({props:{showSeverances:t[6],opacity:t[5]}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,s){const c={};s&64&&(c.showSeverances=i[6]),s&32&&(c.opacity=i[5]),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function oM(t){let e,n,i,s,c,p,u,x,w;e=new kC({}),c=new Ib({});let E=t[7]=="title"&&B1(t),L=t[3]&&V1(t);return{c(){Re(e.$$.fragment),n=ge(),i=zt("div"),s=ge(),Re(c.$$.fragment),p=ge(),E&&E.c(),u=ge(),L&&L.c(),x=Sa()},m(A,V){ke(e,A,V),Vt(A,n,V),Vt(A,i,V),t[11](i),Vt(A,s,V),ke(c,A,V),Vt(A,p,V),E&&E.m(A,V),Vt(A,u,V),L&&L.m(A,V),Vt(A,x,V),w=!0},p(A,V){A[7]=="title"?E?(E.p(A,V),V&128&&Bt(E,1)):(E=B1(A),E.c(),Bt(E,1),E.m(u.parentNode,u)):E&&(zi(),Xt(E,1,1,()=>{E=null}),Oi()),A[3]?L?(L.p(A,V),V&8&&Bt(L,1)):(L=V1(A),L.c(),Bt(L,1),L.m(x.parentNode,x)):L&&(zi(),Xt(L,1,1,()=>{L=null}),Oi())},i(A){w||(Bt(e.$$.fragment,A),Bt(c.$$.fragment,A),Bt(E),Bt(L),w=!0)},o(A){Xt(e.$$.fragment,A),Xt(c.$$.fragment,A),Xt(E),Xt(L),w=!1},d(A){A&&(Ot(n),Ot(i),Ot(s),Ot(p),Ot(u),Ot(x)),De(e,A),t[11](null),De(c,A),E&&E.d(A),L&&L.d(A)}}}function sM(t){let e,n,i,s;function c(u){t[12](u)}let p={style:`https://api.maptiler.com/maps/dataviz/style.json?key=${ub}`,standardControls:!0,hash:!0,$$slots:{default:[oM]},$$scope:{ctx:t}};return t[0]!==void 0&&(p.map=t[0]),n=new RS({props:p}),yo.push(()=>Sh(n,"map",c)),{c(){e=zt("div"),Re(n.$$.fragment),Ut(e,"slot","main"),nr(e,"position","relative"),nr(e,"width","100%"),nr(e,"height","100vh")},m(u,x){Vt(u,e,x),ke(n,e,null),s=!0},p(u,x){const w={};x&131324&&(w.$$scope={dirty:x,ctx:u}),!i&&x&1&&(i=!0,w.map=u[0],wh(()=>i=!1)),n.$set(w)},i(u){s||(Bt(n.$$.fragment,u),s=!0)},o(u){Xt(n.$$.fragment,u),s=!1},d(u){u&&Ot(e),De(n)}}}function aM(t){let e,n;return e=new OC({props:{$$slots:{main:[sM],left:[tM]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(i,s){ke(e,i,s),n=!0},p(i,[s]){const c={};s&131327&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Bt(e.$$.fragment,i),n=!0)},o(i){Xt(e.$$.fragment,i),n=!1},d(i){De(e,i)}}}function lM(t,e,n){let i,s,c,p;en(t,N_,X=>n(9,i=X)),en(t,R_,X=>n(10,s=X)),en(t,Nl,X=>n(3,c=X)),en(t,Jo,X=>n(7,p=X));let u=!1;Bf(async()=>{await K1(),n(4,u=!0)});let x,w=100,E=!0;function L(){x&&c&&x.fitBounds(Array.from(c.getBounds()),{animate:!1})}function A(X){c&&(console.log("New map model loaded"),L(),Ei(Jo,p="route",p))}let V,O;function J(X){yo[X?"unshift":"push"](()=>{O=X,n(2,O),n(9,i)})}function Y(X){x=X,n(0,x)}function $(X){yo[X?"unshift":"push"](()=>{V=X,n(1,V),n(10,s)})}function U(){E=this.checked,n(6,E)}function G(){w=C2(this.value),n(5,w)}return t.$$.update=()=>{t.$$.dirty&1&&x&&tp.set(x),t.$$.dirty&8&&A(),t.$$.dirty&1026&&V&&s&&(n(1,V.innerHTML="",V),V.appendChild(s)),t.$$.dirty&516&&O&&i&&(n(2,O.innerHTML="",O),O.appendChild(i))},[x,V,O,c,u,w,E,p,L,i,s,J,Y,$,U,G]}class uM extends xn{constructor(e){super(),vn(this,e,lM,aM,hn,{})}}new uM({target:document.getElementById("app")}); diff --git a/index.html b/index.html index 094b3d9..d0f5c9c 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,8 @@ Severance Snape - - + +