diff --git a/assets/backend_bg.wasm b/assets/backend_bg.wasm index 50a8524..1578e12 100644 Binary files a/assets/backend_bg.wasm and b/assets/backend_bg.wasm differ diff --git a/assets/index-69163731.css b/assets/index-e86cf9e1.css similarity index 95% rename from assets/index-69163731.css rename to assets/index-e86cf9e1.css index c341297..2b6b08f 100644 --- a/assets/index-69163731.css +++ b/assets/index-e86cf9e1.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}}.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;color:#000;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}div.svelte-k43lgc{float:left}.left.svelte-k43lgc{width:25%;height:100vh;overflow:scroll;padding:8px}.main.svelte-k43lgc{width:75%}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}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}.ctrl-btn-center.svelte-1s83zbq{display:grid!important;height:100%;width:100%;place-items:center}.expand-map.svelte-p00lfq{position:absolute;top:0;bottom:0;left:0;right:0}table.svelte-lh2o9l{border:solid}.dot.svelte-1ej0v4r{width:30px;height:30px;border-radius:50%;display:flex;justify-content:center;align-items:center;color:#fff;background-color:#00f;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}}.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;color:#000;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}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}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}.ctrl-btn-center.svelte-1s83zbq{display:grid!important;height:100%;width:100%;place-items:center}.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%}.dot.svelte-1ej0v4r{width:30px;height:30px;border-radius:50%;display:flex;justify-content:center;align-items:center;color:#fff;background-color:#00f;font-weight:700} diff --git a/assets/main-43ab0643.js b/assets/main-43ab0643.js new file mode 100644 index 0000000..f8ffe70 --- /dev/null +++ b/assets/main-43ab0643.js @@ -0,0 +1,646 @@ +var OT=Object.defineProperty;var zT=(e,t,n)=>t in e?OT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var fi=(e,t,n)=>(zT(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const h of l.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function ze(){}function FT(e,t){for(const n in t)e[n]=t[n];return e}function K2(e){return e()}function Eb(){return Object.create(null)}function bi(e){e.forEach(K2)}function Kg(e){return typeof e=="function"}function en(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Hm;function bo(e,t){return e===t?!0:(Hm||(Hm=document.createElement("a")),Hm.href=t,e===Hm.href)}function BT(e){return Object.keys(e).length===0}function J2(e,...t){if(e==null){for(const r of t)r(void 0);return ze}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Q2(e){let t;return J2(e,n=>t=n)(),t}function qe(e,t,n){e.$$.on_destroy.push(J2(t,n))}function Ei(e,t,n,r){if(e){const o=$2(e,t,n,r);return e[0](o)}}function $2(e,t,n,r){return e[1]&&r?FT(n.ctx.slice(),e[1](r(t))):n.ctx}function Ii(e,t,n,r){if(e[2]&&r){const o=e[2](r(n));if(t.dirty===void 0)return o;if(typeof o=="object"){const l=[],h=Math.max(t.dirty.length,o.length);for(let u=0;u32){const t=[],n=e.ctx.length/32;for(let r=0;re.removeEventListener(t,n,r)}function GT(e){return function(t){return t.preventDefault(),e.call(this,t)}}function C_(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function Wt(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function qT(e){return e===""?null:+e}function jT(e){return Array.from(e.childNodes)}function Gi(e,t){t=""+t,e.data!==t&&(e.data=t)}function wc(e,t){e.value=t??""}function ai(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,r?"important":"")}function Ib(e,t,n){for(let r=0;r{const o=e.$$.callbacks[t];if(o){const l=ZT(t,n,{cancelable:r});return o.slice().forEach(h=>{h.call(e,l)}),!l.defaultPrevented}return!0}}function K0(e,t){return Ld().$$.context.set(e,t),t}function J0(e){return Ld().$$.context.get(e)}function On(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(r=>r.call(this,t))}const Xh=[],Li=[];let tf=[];const o0=[],tS=Promise.resolve();let s0=!1;function eS(){s0||(s0=!0,tS.then(rS))}function nS(){return eS(),tS}function vg(e){tf.push(e)}function Lu(e){o0.push(e)}const T_=new Set;let Gh=0;function rS(){if(Gh!==0)return;const e=ld;do{try{for(;Ghe.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),tf=t}const sg=new Set;let yc;function sr(){yc={r:0,c:[],p:yc}}function ar(){yc.r||bi(yc.c),yc=yc.p}function Rt(e,t){e&&e.i&&(sg.delete(e),e.i(t))}function Zt(e,t,n,r){if(e&&e.o){if(sg.has(e))return;sg.add(e),yc.c.push(()=>{sg.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function _o(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function YT(e,t){Zt(e,1,1,()=>{t.delete(e.key)})}function KT(e,t,n,r,o,l,h,u,y,w,S,C){let P=e.length,F=l.length,R=P;const Y={};for(;R--;)Y[e[R].key]=R;const J=[],K=new Map,O=new Map,G=[];for(R=F;R--;){const ft=C(o,l,R),ct=n(ft);let ht=h.get(ct);ht?r&&G.push(()=>ht.p(ft,t)):(ht=w(ct,ft),ht.c()),K.set(ct,J[R]=ht),ct in Y&&O.set(ct,Math.abs(R-Y[ct]))}const q=new Set,ot=new Set;function _t(ft){Rt(ft,1),ft.m(u,S),h.set(ft.key,ft),S=ft.first,F--}for(;P&&F;){const ft=J[F-1],ct=e[P-1],ht=ft.key,Pt=ct.key;ft===ct?(S=ft.first,P--,F--):K.has(Pt)?!h.has(ht)||q.has(ht)?_t(ft):ot.has(Pt)?P--:O.get(ht)>O.get(Pt)?(ot.add(ht),_t(ft)):(q.add(Pt),P--):(y(ct,h),P--)}for(;P--;){const ft=e[P];K.has(ft.key)||y(ft,h)}for(;F;)_t(J[F-1]);return bi(G),J}function Pu(e,t,n){const r=e.$$.props[t];r!==void 0&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function Ae(e){e&&e.c()}function Pe(e,t,n){const{fragment:r,after_update:o}=e.$$;r&&r.m(t,n),vg(()=>{const l=e.$$.on_mount.map(K2).filter(Kg);e.$$.on_destroy?e.$$.on_destroy.push(...l):bi(l),e.$$.on_mount=[]}),o.forEach(vg)}function Me(e,t){const n=e.$$;n.fragment!==null&&(XT(n.after_update),bi(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function JT(e,t){e.$$.dirty[0]===-1&&(Xh.push(e),eS(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const R=F.length?F[0]:P;return w.ctx&&o(w.ctx[C],w.ctx[C]=R)&&(!w.skip_bound&&w.bound[C]&&w.bound[C](R),S&&JT(e,C)),P}):[],w.update(),S=!0,bi(w.before_update),w.fragment=r?r(w.ctx):!1,t.target){if(t.hydrate){const C=jT(t.target);w.fragment&&w.fragment.l(C),C.forEach(Vt)}else w.fragment&&w.fragment.c();t.intro&&Rt(e.$$.fragment),Pe(e,t.target,t.anchor),rS()}td(y)}class fn{constructor(){fi(this,"$$");fi(this,"$$set")}$destroy(){Me(this,1),this.$destroy=ze}$on(t,n){if(!Kg(n))return ze;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const o=r.indexOf(n);o!==-1&&r.splice(o,1)}}$set(t){this.$$set&&!BT(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const QT="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(QT);let xn;const iS=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&iS.decode();let Xp=null;function ed(){return(Xp===null||Xp.byteLength===0)&&(Xp=new Uint8Array(xn.memory.buffer)),Xp}function wu(e,t){return e=e>>>0,iS.decode(ed().subarray(e,e+t))}const Ol=new Array(128).fill(void 0);Ol.push(void 0,null,!0,!1);let nd=Ol.length;function Rl(e){nd===Ol.length&&Ol.push(Ol.length+1);const t=nd;return nd=Ol[t],Ol[t]=e,t}function or(e){return Ol[e]}function $T(e){e<132||(Ol[e]=nd,nd=e)}function Yh(e){const t=or(e);return $T(e),t}function L_(e){return e==null}let Yp=null;function oS(){return(Yp===null||Yp.byteLength===0)&&(Yp=new Float64Array(xn.memory.buffer)),Yp}let Kp=null;function Qn(){return(Kp===null||Kp.byteLength===0)&&(Kp=new Int32Array(xn.memory.buffer)),Kp}let _c=0;const ag=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},tL=typeof ag.encodeInto=="function"?function(e,t){return ag.encodeInto(e,t)}:function(e,t){const n=ag.encode(e);return t.set(n),{read:e.length,written:n.length}};function P_(e,t,n){if(n===void 0){const u=ag.encode(e),y=t(u.length,1)>>>0;return ed().subarray(y,y+u.length).set(u),_c=u.length,y}let r=e.length,o=t(r,1)>>>0;const l=ed();let h=0;for(;h127)break;l[o+h]=u}if(h!==r){h!==0&&(e=e.slice(h)),o=n(o,r,r=h+e.length*3,1)>>>0;const u=ed().subarray(o+h,o+r),y=tL(e,u);h+=y.written}return _c=h,o}function a0(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){const o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){const o=e.length;let l="[";o>0&&(l+=a0(e[0]));for(let h=1;h1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message} +${e.stack}`:r}function eL(e,t){const n=t(e.length*1,1)>>>0;return ed().set(e,n/1),_c=e.length,n}function nL(e,t){return e=e>>>0,oS().subarray(e/8,e/8+t)}class rL{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();xn.__wbg_mapmodel_free(t)}constructor(t,n){try{const h=xn.__wbindgen_add_to_stack_pointer(-16),u=eL(t,xn.__wbindgen_malloc),y=_c;xn.mapmodel_new(h,u,y,n);var r=Qn()[h/4+0],o=Qn()[h/4+1],l=Qn()[h/4+2];if(l)throw Yh(o);return this.__wbg_ptr=r>>>0,this}finally{xn.__wbindgen_add_to_stack_pointer(16)}}render(){let t,n;try{const w=xn.__wbindgen_add_to_stack_pointer(-16);xn.mapmodel_render(w,this.__wbg_ptr);var r=Qn()[w/4+0],o=Qn()[w/4+1],l=Qn()[w/4+2],h=Qn()[w/4+3],u=r,y=o;if(h)throw u=0,y=0,Yh(l);return t=u,n=y,wu(u,y)}finally{xn.__wbindgen_add_to_stack_pointer(16),xn.__wbindgen_free(t,n,1)}}compareRoute(t){let n,r;try{const S=xn.__wbindgen_add_to_stack_pointer(-16);xn.mapmodel_compareRoute(S,this.__wbg_ptr,Rl(t));var o=Qn()[S/4+0],l=Qn()[S/4+1],h=Qn()[S/4+2],u=Qn()[S/4+3],y=o,w=l;if(u)throw y=0,w=0,Yh(h);return n=y,r=w,wu(y,w)}finally{xn.__wbindgen_add_to_stack_pointer(16),xn.__wbindgen_free(n,r,1)}}makeHeatmap(){let t,n;try{const w=xn.__wbindgen_add_to_stack_pointer(-16);xn.mapmodel_makeHeatmap(w,this.__wbg_ptr);var r=Qn()[w/4+0],o=Qn()[w/4+1],l=Qn()[w/4+2],h=Qn()[w/4+3],u=r,y=o;if(h)throw u=0,y=0,Yh(l);return t=u,n=y,wu(u,y)}finally{xn.__wbindgen_add_to_stack_pointer(16),xn.__wbindgen_free(t,n,1)}}getInvertedBoundary(){let t,n;try{const w=xn.__wbindgen_add_to_stack_pointer(-16);xn.mapmodel_getInvertedBoundary(w,this.__wbg_ptr);var r=Qn()[w/4+0],o=Qn()[w/4+1],l=Qn()[w/4+2],h=Qn()[w/4+3],u=r,y=o;if(h)throw u=0,y=0,Yh(l);return t=u,n=y,wu(u,y)}finally{xn.__wbindgen_add_to_stack_pointer(16),xn.__wbindgen_free(t,n,1)}}getBounds(){try{const o=xn.__wbindgen_add_to_stack_pointer(-16);xn.mapmodel_getBounds(o,this.__wbg_ptr);var t=Qn()[o/4+0],n=Qn()[o/4+1],r=nL(t,n).slice();return xn.__wbindgen_free(t,n*8,8),r}finally{xn.__wbindgen_add_to_stack_pointer(16)}}}async function iL(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.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",r);else throw r}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function oL(){const e={};return e.wbg={},e.wbg.__wbindgen_string_new=function(t,n){const r=wu(t,n);return Rl(r)},e.wbg.__wbindgen_is_object=function(t){const n=or(t);return typeof n=="object"&&n!==null},e.wbg.__wbindgen_is_undefined=function(t){return or(t)===void 0},e.wbg.__wbindgen_in=function(t,n){return or(t)in or(n)},e.wbg.__wbindgen_object_drop_ref=function(t){Yh(t)},e.wbg.__wbindgen_number_get=function(t,n){const r=or(n),o=typeof r=="number"?r:void 0;oS()[t/8+1]=L_(o)?0:o,Qn()[t/4+0]=!L_(o)},e.wbg.__wbindgen_error_new=function(t,n){const r=new Error(wu(t,n));return Rl(r)},e.wbg.__wbindgen_jsval_loose_eq=function(t,n){return or(t)==or(n)},e.wbg.__wbindgen_boolean_get=function(t){const n=or(t);return typeof n=="boolean"?n?1:0:2},e.wbg.__wbindgen_string_get=function(t,n){const r=or(n),o=typeof r=="string"?r:void 0;var l=L_(o)?0:P_(o,xn.__wbindgen_malloc,xn.__wbindgen_realloc),h=_c;Qn()[t/4+1]=h,Qn()[t/4+0]=l},e.wbg.__wbg_getwithrefkey_3b3c46ba20582127=function(t,n){const r=or(t)[or(n)];return Rl(r)},e.wbg.__wbindgen_object_clone_ref=function(t){const n=or(t);return Rl(n)},e.wbg.__wbg_debug_34c9290896ec9856=function(t){console.debug(or(t))},e.wbg.__wbg_error_e60eff06f24ab7a4=function(t){console.error(or(t))},e.wbg.__wbg_info_d7d58472d0bab115=function(t){console.info(or(t))},e.wbg.__wbg_log_a4530b4fe289336f=function(t){console.log(or(t))},e.wbg.__wbg_warn_f260f49434e45e62=function(t){console.warn(or(t))},e.wbg.__wbg_instanceof_ArrayBuffer_e7d53d51371448e2=function(t){let n;try{n=or(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_buffer_a448f833075b71ba=function(t){const n=or(t).buffer;return Rl(n)},e.wbg.__wbg_new_8f67e318f15d7254=function(t){const n=new Uint8Array(or(t));return Rl(n)},e.wbg.__wbg_set_2357bf09366ee480=function(t,n,r){or(t).set(or(n),r>>>0)},e.wbg.__wbg_length_1d25fa9e4ac21ce7=function(t){return or(t).length},e.wbg.__wbg_instanceof_Uint8Array_bced6f43aed8c1aa=function(t){let n;try{n=or(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbg_new_abda76e883ba8a5f=function(){const t=new Error;return Rl(t)},e.wbg.__wbg_stack_658279fe44541cf6=function(t,n){const r=or(n).stack,o=P_(r,xn.__wbindgen_malloc,xn.__wbindgen_realloc),l=_c;Qn()[t/4+1]=l,Qn()[t/4+0]=o},e.wbg.__wbg_error_f851667af71bcfc6=function(t,n){let r,o;try{r=t,o=n,console.error(wu(t,n))}finally{xn.__wbindgen_free(r,o,1)}},e.wbg.__wbindgen_debug_string=function(t,n){const r=a0(or(n)),o=P_(r,xn.__wbindgen_malloc,xn.__wbindgen_realloc),l=_c;Qn()[t/4+1]=l,Qn()[t/4+0]=o},e.wbg.__wbindgen_throw=function(t,n){throw new Error(wu(t,n))},e.wbg.__wbindgen_memory=function(){const t=xn.memory;return Rl(t)},e}function sL(e,t){return xn=e.exports,sS.__wbindgen_wasm_module=t,Yp=null,Kp=null,Xp=null,xn}async function sS(e){if(xn!==void 0)return xn;typeof e>"u"&&(e="/severance_snape/assets/backend_bg.wasm");const t=oL();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:n,module:r}=await iL(await e,t);return sL(n,r)}const qh=[];function M_(e,t){return{subscribe:Jr(e,t).subscribe}}function Jr(e,t=ze){let n;const r=new Set;function o(u){if(en(e,u)&&(e=u,n)){const y=!qh.length;for(const w of r)w[1](),qh.push(w,e);if(y){for(let w=0;w{r.delete(w),r.size===0&&n&&(n(),n=null)}}return{set:o,update:l,subscribe:h}}let aL=Date.now();function Jg(e){return`${e}-${aL++}`}const Q0=Symbol.for("svelte-maplibre");function Pf(){return J0(Q0)}function lL(e){let t=new WeakMap;return n=>{var h;let r=t.get(n.originalEvent);if(r!==void 0)return r;let l=(h=n.target.queryRenderedFeatures(n.point).find(u=>{var y;return(y=e.get(u.layer.id))==null?void 0:y.interactive}))==null?void 0:h.layer.id;return t.set(n.originalEvent,l),l}}function uL(){let e=new Map;return K0(Q0,{map:Jr(null),source:M_(null),layer:M_(null),popupTarget:M_(null),cluster:Jr(),loadedImages:Jr(new Set),minzoom:Jr(0),maxzoom:Jr(24),layerEvent:Jr(null),layerInfo:e,eventTopMost:lL(e)})}function Cb(e){return{subscribe:e.subscribe}}function $0({key:e,setPopupTarget:t=!1,setCluster:n=!1,setMouseEvent:r=!1}){let o=Pf(),l=Jr(null),h=Cb(l),u={...o,[e]:Cb(l)};if(t&&(u.popupTarget=h),r){let y=Jr(null);u.layerEvent=y,o.layerEvent=y}return n&&(u.cluster=Jr()),K0(Q0,u),{...o,self:l}}function cL(){return $0({key:"source",setCluster:!0})}function hL(e=!0){return $0({key:"layer",setPopupTarget:e,setMouseEvent:e})}function fL(){return $0({key:"popupTarget",setPopupTarget:!0,setMouseEvent:!0})}var Pd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qg(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var aS={exports:{}};/** + * MapLibre GL JS + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.1.3/LICENSE.txt + */(function(e,t){(function(n,r){e.exports=r()})(Pd,function(){var n={},r={};function o(h,u,y){if(r[h]=y,h==="index"){var w="var sharedModule = {}; ("+r.shared+")(sharedModule); ("+r.worker+")(sharedModule);",S={};return r.shared(S),r.index(n,S),typeof window<"u"&&n.setWorkerUrl(window.URL.createObjectURL(new Blob([w],{type:"text/javascript"}))),n}}o("shared",["exports"],function(h){function u(a,i,c,p){return new(c||(c=Promise))(function(g,b){function x(A){try{L(p.next(A))}catch(D){b(D)}}function E(A){try{L(p.throw(A))}catch(D){b(D)}}function L(A){var D;A.done?g(A.value):(D=A.value,D instanceof c?D:new c(function(N){N(D)})).then(x,E)}L((p=p.apply(a,i||[])).next())})}function y(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}typeof SuppressedError=="function"&&SuppressedError;var w=S;function S(a,i){this.x=a,this.y=i}S.prototype={clone:function(){return new S(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,i){return this.clone()._rotateAround(a,i)},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 i=a.x-this.x,c=a.y-this.y;return i*i+c*c},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,i){return Math.atan2(this.x*i-this.y*a,this.x*a+this.y*i)},_matMult:function(a){var i=a[2]*this.x+a[3]*this.y;return this.x=a[0]*this.x+a[1]*this.y,this.y=i,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 i=Math.cos(a),c=Math.sin(a),p=c*this.x+i*this.y;return this.x=i*this.x-c*this.y,this.y=p,this},_rotateAround:function(a,i){var c=Math.cos(a),p=Math.sin(a),g=i.y+p*(this.x-i.x)+c*(this.y-i.y);return this.x=i.x+c*(this.x-i.x)-p*(this.y-i.y),this.y=g,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},S.convert=function(a){return a instanceof S?a:Array.isArray(a)?new S(a[0],a[1]):a};var C=y(w),P=F;function F(a,i,c,p){this.cx=3*a,this.bx=3*(c-a)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(p-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=a,this.p1y=i,this.p2x=c,this.p2y=p}F.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,i){if(i===void 0&&(i=1e-6),a<0)return 0;if(a>1)return 1;for(var c=a,p=0;p<8;p++){var g=this.sampleCurveX(c)-a;if(Math.abs(g)g?x=c:E=c,c=.5*(E-x)+x;return c},solve:function(a,i){return this.sampleCurveY(this.solveCurveX(a,i))}};var R=y(P);let Y,J;function K(){return Y==null&&(Y=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Y}function O(){if(J==null&&(J=!1,K())){const i=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(i){for(let p=0;p<5*5;p++){const g=4*p;i.fillStyle=`rgb(${g},${g+1},${g+2})`,i.fillRect(p%5,Math.floor(p/5),1,1)}const c=i.getImageData(0,0,5,5).data;for(let p=0;p<5*5*4;p++)if(p%4!=3&&c[p]!==p){J=!0;break}}}return J||!1}function G(a,i,c,p){const g=new R(a,i,c,p);return function(b){return g.solve(b)}}const q=G(.25,.1,.25,1);function ot(a,i,c){return Math.min(c,Math.max(i,a))}function _t(a,i,c){const p=c-i,g=((a-i)%p+p)%p+i;return g===i?c:g}function ft(a,...i){for(const c of i)for(const p in c)a[p]=c[p];return a}let ct=1;function ht(a,i,c){const p={};for(const g in a)p[g]=i.call(c||this,a[g],g,a);return p}function Pt(a,i,c){const p={};for(const g in a)i.call(c||this,a[g],g,a)&&(p[g]=a[g]);return p}function $(a){return Array.isArray(a)?a.map($):typeof a=="object"&&a?ht(a,$):a}const Lt={};function $t(a){Lt[a]||(typeof console<"u"&&console.warn(a),Lt[a]=!0)}function Ct(a,i,c){return(c.y-a.y)*(i.x-a.x)>(i.y-a.y)*(c.x-a.x)}function re(a){let i=0;for(let c,p,g=0,b=a.length,x=b-1;g"u")throw new Error("VideoFrame not supported");const b=new VideoFrame(a,{timestamp:0});try{const x=b==null?void 0:b.format;if(!x||!x.startsWith("BGR")&&!x.startsWith("RGB"))throw new Error(`Unrecognized format ${x}`);const E=x.startsWith("BGR"),L=new Uint8ClampedArray(p*g*4);if(yield b.copyTo(L,function(A,D,N,U,W){const H=4*Math.max(-D,0),et=(Math.max(0,N)-N)*U*4+H,st=4*U,pt=Math.max(0,D),It=Math.max(0,N);return{rect:{x:pt,y:It,width:Math.min(A.width,D+U)-pt,height:Math.min(A.height,N+W)-It},layout:[{offset:et,stride:st}]}}(a,i,c,p,g)),E)for(let A=0;Ape(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,vr=function(a,i){if(/:\/\//.test(a.url)&&!/^https?:|^file:/.test(a.url)){const p=mn(a.url);if(p)return p(a,i);if(pe(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:a,targetMapId:Mn},i)}if(!(/^file:/.test(c=a.url)||/^file:/.test(Lr())&&!/^\w+:/.test(c))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(p,g){return u(this,void 0,void 0,function*(){const b=new Request(p.url,{method:p.method||"GET",body:p.body,credentials:p.credentials,headers:p.headers,cache:p.cache,referrer:Lr(),signal:g.signal});p.type==="json"&&b.headers.set("Accept","application/json");const x=yield fetch(b);if(!x.ok){const A=yield x.blob();throw new _r(x.status,x.statusText,p.url,A)}let E;E=p.type==="arrayBuffer"||p.type==="image"?x.arrayBuffer():p.type==="json"?x.json():x.text();const L=yield E;if(g.signal.aborted)throw En();return{data:L,cacheControl:x.headers.get("Cache-Control"),expires:x.headers.get("Expires")}})}(a,i);if(pe(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:a,mustQueue:!0,targetMapId:Mn},i)}var c;return function(p,g){return new Promise((b,x)=>{const E=new XMLHttpRequest;E.open(p.method||"GET",p.url,!0),p.type!=="arrayBuffer"&&p.type!=="image"||(E.responseType="arraybuffer");for(const L in p.headers)E.setRequestHeader(L,p.headers[L]);p.type==="json"&&(E.responseType="text",E.setRequestHeader("Accept","application/json")),E.withCredentials=p.credentials==="include",E.onerror=()=>{x(new Error(E.statusText))},E.onload=()=>{if(!g.signal.aborted)if((E.status>=200&&E.status<300||E.status===0)&&E.response!==null){let L=E.response;if(p.type==="json")try{L=JSON.parse(E.response)}catch(A){return void x(A)}b({data:L,cacheControl:E.getResponseHeader("Cache-Control"),expires:E.getResponseHeader("Expires")})}else{const L=new Blob([E.response],{type:E.getResponseHeader("Content-Type")});x(new _r(E.status,E.statusText,p.url,L))}},g.signal.addEventListener("abort",()=>{E.abort(),x(En())}),E.send(p.body)})}(a,i)};function cr(a){if(!a||a.indexOf("://")<=0||a.indexOf("data:image/")===0||a.indexOf("blob:")===0)return!0;const i=new URL(a),c=window.location;return i.protocol===c.protocol&&i.host===c.host}function Kt(a,i,c){c[a]&&c[a].indexOf(i)!==-1||(c[a]=c[a]||[],c[a].push(i))}function mt(a,i,c){if(c&&c[a]){const p=c[a].indexOf(i);p!==-1&&c[a].splice(p,1)}}class St{constructor(i,c={}){ft(this,c),this.type=i}}class be extends St{constructor(i,c={}){super("error",ft({error:i},c))}}class An{on(i,c){return this._listeners=this._listeners||{},Kt(i,c,this._listeners),this}off(i,c){return mt(i,c,this._listeners),mt(i,c,this._oneTimeListeners),this}once(i,c){return c?(this._oneTimeListeners=this._oneTimeListeners||{},Kt(i,c,this._oneTimeListeners),this):new Promise(p=>this.once(i,p))}fire(i,c){typeof i=="string"&&(i=new St(i,c||{}));const p=i.type;if(this.listens(p)){i.target=this;const g=this._listeners&&this._listeners[p]?this._listeners[p].slice():[];for(const E of g)E.call(this,i);const b=this._oneTimeListeners&&this._oneTimeListeners[p]?this._oneTimeListeners[p].slice():[];for(const E of b)mt(p,E,this._oneTimeListeners),E.call(this,i);const x=this._eventedParent;x&&(ft(i,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),x.fire(i))}else i instanceof be&&console.error(i.error);return this}listens(i){return this._listeners&&this._listeners[i]&&this._listeners[i].length>0||this._oneTimeListeners&&this._oneTimeListeners[i]&&this._oneTimeListeners[i].length>0||this._eventedParent&&this._eventedParent.listens(i)}setEventedParent(i,c){return this._eventedParent=i,this._eventedParentData=c,this}}var Mt={$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 Ze=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Pr(a,i){const c={};for(const p in a)p!=="ref"&&(c[p]=a[p]);return Ze.forEach(p=>{p in i&&(c[p]=i[p])}),c}function on(a,i){if(Array.isArray(a)){if(!Array.isArray(i)||a.length!==i.length)return!1;for(let c=0;c`:a.itemType.kind==="value"?"array":`array<${i}>`}return a.kind}const vt=[jr,se,Ke,Xe,Mr,Nr,Ho,X(He),at,V,j];function Q(a,i){if(i.kind==="error")return null;if(a.kind==="array"){if(i.kind==="array"&&(i.N===0&&i.itemType.kind==="value"||!Q(a.itemType,i.itemType))&&(typeof a.N!="number"||a.N===i.N))return null}else{if(a.kind===i.kind)return null;if(a.kind==="value"){for(const c of vt)if(!Q(c,i))return null}}return`Expected ${nt(a)} but found ${nt(i)} instead.`}function bt(a,i){return i.some(c=>c.kind===a.kind)}function dt(a,i){return i.some(c=>c==="null"?a===null:c==="array"?Array.isArray(a):c==="object"?a&&!Array.isArray(a)&&typeof a=="object":c===typeof a)}function Et(a,i){return a.kind==="array"&&i.kind==="array"?a.itemType.kind===i.itemType.kind&&typeof a.N=="number":a.kind===i.kind}const Nt=.96422,Ft=.82521,Ht=4/29,we=6/29,Te=3*we*we,Ge=we*we*we,je=Math.PI/180,_n=180/Math.PI;function Un(a){return(a%=360)<0&&(a+=360),a}function er([a,i,c,p]){let g,b;const x=nn((.2225045*(a=Wr(a))+.7168786*(i=Wr(i))+.0606169*(c=Wr(c)))/1);a===i&&i===c?g=b=x:(g=nn((.4360747*a+.3850649*i+.1430804*c)/Nt),b=nn((.0139322*a+.0971045*i+.7141733*c)/Ft));const E=116*x-16;return[E<0?0:E,500*(g-x),200*(x-b),p]}function Wr(a){return a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function nn(a){return a>Ge?Math.pow(a,1/3):a/Te+Ht}function br([a,i,c,p]){let g=(a+16)/116,b=isNaN(i)?g:g+i/500,x=isNaN(c)?g:g-c/200;return g=1*Xi(g),b=Nt*Xi(b),x=Ft*Xi(x),[Qr(3.1338561*b-1.6168667*g-.4906146*x),Qr(-.9787684*b+1.9161415*g+.033454*x),Qr(.0719453*b-.2289914*g+1.4052427*x),p]}function Qr(a){return(a=a<=.00304?12.92*a:1.055*Math.pow(a,1/2.4)-.055)<0?0:a>1?1:a}function Xi(a){return a>we?a*a*a:Te*(a-Ht)}function ao(a){return parseInt(a.padEnd(2,a),16)/255}function hi(a,i){return Rs(i?a/100:a,0,1)}function Rs(a,i,c){return Math.min(Math.max(i,a),c)}function Gd(a){return!a.some(Number.isNaN)}const xy={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 zn{constructor(i,c,p,g=1,b=!0){this.r=i,this.g=c,this.b=p,this.a=g,b||(this.r*=g,this.g*=g,this.b*=g,g||this.overwriteGetter("rgb",[i,c,p,g]))}static parse(i){if(i instanceof zn)return i;if(typeof i!="string")return;const c=function(p){if((p=p.toLowerCase().trim())==="transparent")return[0,0,0,0];const g=xy[p];if(g){const[x,E,L]=g;return[x/255,E/255,L/255,1]}if(p.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(p)){const x=p.length<6?1:2;let E=1;return[ao(p.slice(E,E+=x)),ao(p.slice(E,E+=x)),ao(p.slice(E,E+=x)),ao(p.slice(E,E+x)||"ff")]}if(p.startsWith("rgb")){const x=p.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(x){const[E,L,A,D,N,U,W,H,et,st,pt,It]=x,gt=[D||" ",W||" ",st].join("");if(gt===" "||gt===" /"||gt===",,"||gt===",,,"){const xt=[A,U,et].join(""),Xt=xt==="%%%"?100:xt===""?255:0;if(Xt){const Yt=[Rs(+L/Xt,0,1),Rs(+N/Xt,0,1),Rs(+H/Xt,0,1),pt?hi(+pt,It):1];if(Gd(Yt))return Yt}}return}}const b=p.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(b){const[x,E,L,A,D,N,U,W,H]=b,et=[L||" ",D||" ",U].join("");if(et===" "||et===" /"||et===",,"||et===",,,"){const st=[+E,Rs(+A,0,100),Rs(+N,0,100),W?hi(+W,H):1];if(Gd(st))return function([pt,It,gt,xt]){function Xt(Yt){const ge=(Yt+pt/30)%12,xe=It*Math.min(gt,1-gt);return gt-xe*Math.max(-1,Math.min(ge-3,9-ge,1))}return pt=Un(pt),It/=100,gt/=100,[Xt(0),Xt(8),Xt(4),xt]}(st)}}}(i);return c?new zn(...c,!1):void 0}get rgb(){const{r:i,g:c,b:p,a:g}=this,b=g||1/0;return this.overwriteGetter("rgb",[i/b,c/b,p/b,g])}get hcl(){return this.overwriteGetter("hcl",function(i){const[c,p,g,b]=er(i),x=Math.sqrt(p*p+g*g);return[Math.round(1e4*x)?Un(Math.atan2(g,p)*_n):NaN,x,c,b]}(this.rgb))}get lab(){return this.overwriteGetter("lab",er(this.rgb))}overwriteGetter(i,c){return Object.defineProperty(this,i,{value:c}),c}toString(){const[i,c,p,g]=this.rgb;return`rgba(${[i,c,p].map(b=>Math.round(255*b)).join(",")},${g})`}}zn.black=new zn(0,0,0,1),zn.white=new zn(1,1,1,1),zn.transparent=new zn(0,0,0,0),zn.red=new zn(1,0,0,1);class Vf{constructor(i,c,p){this.sensitivity=i?c?"variant":"case":c?"accent":"base",this.locale=p,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(i,c){return this.collator.compare(i,c)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Uf{constructor(i,c,p,g,b){this.text=i,this.image=c,this.scale=p,this.fontStack=g,this.textColor=b}}class Lo{constructor(i){this.sections=i}static fromString(i){return new Lo([new Uf(i,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(i=>i.text.length!==0||i.image&&i.image.name.length!==0)}static factory(i){return i instanceof Lo?i:Lo.fromString(i)}toString(){return this.sections.length===0?"":this.sections.map(i=>i.text).join("")}}class lo{constructor(i){this.values=i.slice()}static parse(i){if(i instanceof lo)return i;if(typeof i=="number")return new lo([i,i,i,i]);if(Array.isArray(i)&&!(i.length<1||i.length>4)){for(const c of i)if(typeof c!="number")return;switch(i.length){case 1:i=[i[0],i[0],i[0],i[0]];break;case 2:i=[i[0],i[1],i[0],i[1]];break;case 3:i=[i[0],i[1],i[2],i[1]]}return new lo(i)}}toString(){return JSON.stringify(this.values)}}const Wu=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Xo{constructor(i){this.values=i.slice()}static parse(i){if(i instanceof Xo)return i;if(Array.isArray(i)&&!(i.length<1)&&i.length%2==0){for(let c=0;c=0&&a<=255&&typeof i=="number"&&i>=0&&i<=255&&typeof c=="number"&&c>=0&&c<=255?p===void 0||typeof p=="number"&&p>=0&&p<=1?null:`Invalid rgba value [${[a,i,c,p].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof p=="number"?[a,i,c,p]:[a,i,c]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Wc(a){if(a===null||typeof a=="string"||typeof a=="boolean"||typeof a=="number"||a instanceof zn||a instanceof Vf||a instanceof Lo||a instanceof lo||a instanceof Xo||a instanceof Yo)return!0;if(Array.isArray(a)){for(const i of a)if(!Wc(i))return!1;return!0}if(typeof a=="object"){for(const i in a)if(!Wc(a[i]))return!1;return!0}return!1}function Zr(a){if(a===null)return jr;if(typeof a=="string")return Ke;if(typeof a=="boolean")return Xe;if(typeof a=="number")return se;if(a instanceof zn)return Mr;if(a instanceof Vf)return fa;if(a instanceof Lo)return Nr;if(a instanceof lo)return at;if(a instanceof Xo)return j;if(a instanceof Yo)return V;if(Array.isArray(a)){const i=a.length;let c;for(const p of a){const g=Zr(p);if(c){if(c===g)continue;c=He;break}c=g}return X(c||He,i)}return Ho}function Zu(a){const i=typeof a;return a===null?"":i==="string"||i==="number"||i==="boolean"?String(a):a instanceof zn||a instanceof Lo||a instanceof lo||a instanceof Xo||a instanceof Yo?a.toString():JSON.stringify(a)}class Oa{constructor(i,c){this.type=i,this.value=c}static parse(i,c){if(i.length!==2)return c.error(`'literal' expression requires exactly one argument, but found ${i.length-1} instead.`);if(!Wc(i[1]))return c.error("invalid value");const p=i[1];let g=Zr(p);const b=c.expectedType;return g.kind!=="array"||g.N!==0||!b||b.kind!=="array"||typeof b.N=="number"&&b.N!==0||(g=b),new Oa(g,p)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class hr{constructor(i){this.name="ExpressionEvaluationError",this.message=i}toJSON(){return this.message}}const Zc={string:Ke,number:se,boolean:Xe,object:Ho};class Po{constructor(i,c){this.type=i,this.args=c}static parse(i,c){if(i.length<2)return c.error("Expected at least one argument.");let p,g=1;const b=i[0];if(b==="array"){let E,L;if(i.length>2){const A=i[1];if(typeof A!="string"||!(A in Zc)||A==="object")return c.error('The item type argument of "array" must be one of string, number, boolean',1);E=Zc[A],g++}else E=He;if(i.length>3){if(i[2]!==null&&(typeof i[2]!="number"||i[2]<0||i[2]!==Math.floor(i[2])))return c.error('The length argument to "array" must be a positive integer literal',2);L=i[2],g++}p=X(E,L)}else{if(!Zc[b])throw new Error(`Types doesn't contain name = ${b}`);p=Zc[b]}const x=[];for(;gi.outputDefined())}}const Hc={"to-boolean":Xe,"to-color":Mr,"to-number":se,"to-string":Ke};class Ns{constructor(i,c){this.type=i,this.args=c}static parse(i,c){if(i.length<2)return c.error("Expected at least one argument.");const p=i[0];if(!Hc[p])throw new Error(`Can't parse ${p} as it is not part of the known types`);if((p==="to-boolean"||p==="to-string")&&i.length!==2)return c.error("Expected one argument.");const g=Hc[p],b=[];for(let x=1;x4?`Invalid rbga value ${JSON.stringify(c)}: expected an array containing either three or four numeric values.`:Ql(c[0],c[1],c[2],c[3]),!p))return new zn(c[0]/255,c[1]/255,c[2]/255,c[3])}throw new hr(p||`Could not parse color from value '${typeof c=="string"?c:JSON.stringify(c)}'`)}case"padding":{let c;for(const p of this.args){c=p.evaluate(i);const g=lo.parse(c);if(g)return g}throw new hr(`Could not parse padding from value '${typeof c=="string"?c:JSON.stringify(c)}'`)}case"variableAnchorOffsetCollection":{let c;for(const p of this.args){c=p.evaluate(i);const g=Xo.parse(c);if(g)return g}throw new hr(`Could not parse variableAnchorOffsetCollection from value '${typeof c=="string"?c:JSON.stringify(c)}'`)}case"number":{let c=null;for(const p of this.args){if(c=p.evaluate(i),c===null)return 0;const g=Number(c);if(!isNaN(g))return g}throw new hr(`Could not convert ${JSON.stringify(c)} to number.`)}case"formatted":return Lo.fromString(Zu(this.args[0].evaluate(i)));case"resolvedImage":return Yo.fromString(Zu(this.args[0].evaluate(i)));default:return Zu(this.args[0].evaluate(i))}}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}}const Hu=["Unknown","Point","LineString","Polygon"];class Fn{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"?Hu[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(i){let c=this._parseColorCache[i];return c||(c=this._parseColorCache[i]=zn.parse(i)),c}}class Xc{constructor(i,c,p=[],g,b=new yl,x=[]){this.registry=i,this.path=p,this.key=p.map(E=>`[${E}]`).join(""),this.scope=b,this.errors=x,this.expectedType=g,this._isConstant=c}parse(i,c,p,g,b={}){return c?this.concat(c,p,g)._parse(i,b):this._parse(i,b)}_parse(i,c){function p(g,b,x){return x==="assert"?new Po(b,[g]):x==="coerce"?new Ns(b,[g]):g}if(i!==null&&typeof i!="string"&&typeof i!="boolean"&&typeof i!="number"||(i=["literal",i]),Array.isArray(i)){if(i.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const g=i[0];if(typeof g!="string")return this.error(`Expression name must be a string, but found ${typeof g} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const b=this.registry[g];if(b){let x=b.parse(i,this);if(!x)return null;if(this.expectedType){const E=this.expectedType,L=x.type;if(E.kind!=="string"&&E.kind!=="number"&&E.kind!=="boolean"&&E.kind!=="object"&&E.kind!=="array"||L.kind!=="value")if(E.kind!=="color"&&E.kind!=="formatted"&&E.kind!=="resolvedImage"||L.kind!=="value"&&L.kind!=="string")if(E.kind!=="padding"||L.kind!=="value"&&L.kind!=="number"&&L.kind!=="array")if(E.kind!=="variableAnchorOffsetCollection"||L.kind!=="value"&&L.kind!=="array"){if(this.checkSubtype(E,L))return null}else x=p(x,E,c.typeAnnotation||"coerce");else x=p(x,E,c.typeAnnotation||"coerce");else x=p(x,E,c.typeAnnotation||"coerce");else x=p(x,E,c.typeAnnotation||"assert")}if(!(x instanceof Oa)&&x.type.kind!=="resolvedImage"&&this._isConstant(x)){const E=new Fn;try{x=new Oa(x.type,x.evaluate(E))}catch(L){return this.error(L.message),null}}return x}return this.error(`Unknown expression "${g}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(i===void 0?"'undefined' value invalid. Use null instead.":typeof i=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof i} instead.`)}concat(i,c,p){const g=typeof i=="number"?this.path.concat(i):this.path,b=p?this.scope.concat(p):this.scope;return new Xc(this.registry,this._isConstant,g,c||null,b,this.errors)}error(i,...c){const p=`${this.key}${c.map(g=>`[${g}]`).join("")}`;this.errors.push(new Hi(p,i))}checkSubtype(i,c){const p=Q(i,c);return p&&this.error(p),p}}class $l{constructor(i,c,p){this.type=fa,this.locale=p,this.caseSensitive=i,this.diacriticSensitive=c}static parse(i,c){if(i.length!==2)return c.error("Expected one argument.");const p=i[1];if(typeof p!="object"||Array.isArray(p))return c.error("Collator options argument must be an object.");const g=c.parse(p["case-sensitive"]!==void 0&&p["case-sensitive"],1,Xe);if(!g)return null;const b=c.parse(p["diacritic-sensitive"]!==void 0&&p["diacritic-sensitive"],1,Xe);if(!b)return null;let x=null;return p.locale&&(x=c.parse(p.locale,1,Ke),!x)?null:new $l(g,b,x)}evaluate(i){return new Vf(this.caseSensitive.evaluate(i),this.diacriticSensitive.evaluate(i),this.locale?this.locale.evaluate(i):null)}eachChild(i){i(this.caseSensitive),i(this.diacriticSensitive),this.locale&&i(this.locale)}outputDefined(){return!1}}const za=8192;function Yc(a,i){a[0]=Math.min(a[0],i[0]),a[1]=Math.min(a[1],i[1]),a[2]=Math.max(a[2],i[0]),a[3]=Math.max(a[3],i[1])}function Xu(a,i){return!(a[0]<=i[0]||a[2]>=i[2]||a[1]<=i[1]||a[3]>=i[3])}function wy(a,i){const c=(180+a[0])/360,p=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a[1]*Math.PI/360)))/360,g=Math.pow(2,i.z);return[Math.round(c*g*za),Math.round(p*g*za)]}function qd(a,i,c){const p=a[0]-i[0],g=a[1]-i[1],b=a[0]-c[0],x=a[1]-c[1];return p*x-b*g==0&&p*b<=0&&g*x<=0}function Kc(a,i){let c=!1;for(let x=0,E=i.length;x(p=a)[1]!=(b=L[A+1])[1]>p[1]&&p[0]<(b[0]-g[0])*(p[1]-g[1])/(b[1]-g[1])+g[0]&&(c=!c)}}var p,g,b;return c}function Sy(a,i){for(let c=0;c0&&E<0||x<0&&E>0}function Ey(a,i,c){for(const A of c)for(let D=0;Dc[2]){const g=.5*p;let b=a[0]-c[0]>g?-p:c[0]-a[0]>g?p:0;b===0&&(b=a[0]-c[2]>g?-p:c[2]-a[0]>g?p:0),a[0]+=b}Yc(i,a)}function Qc(a,i,c,p){const g=Math.pow(2,p.z)*za,b=[p.x*za,p.y*za],x=[];for(const E of a)for(const L of E){const A=[L.x+b[0],L.y+b[1]];Xd(A,i,c,g),x.push(A)}return x}function Yd(a,i,c,p){const g=Math.pow(2,p.z)*za,b=[p.x*za,p.y*za],x=[];for(const L of a){const A=[];for(const D of L){const N=[D.x+b[0],D.y+b[1]];Yc(i,N),A.push(N)}x.push(A)}if(i[2]-i[0]<=g/2){(E=i)[0]=E[1]=1/0,E[2]=E[3]=-1/0;for(const L of x)for(const A of L)Xd(A,i,c,g)}var E;return x}class _l{constructor(i,c){this.type=Xe,this.geojson=i,this.geometries=c}static parse(i,c){if(i.length!==2)return c.error(`'within' expression requires exactly one argument, but found ${i.length-1} instead.`);if(Wc(i[1])){const p=i[1];if(p.type==="FeatureCollection"){const g=[];for(const b of p.features){const{type:x,coordinates:E}=b.geometry;x==="Polygon"&&g.push(E),x==="MultiPolygon"&&g.push(...E)}if(g.length)return new _l(p,{type:"MultiPolygon",coordinates:g})}else if(p.type==="Feature"){const g=p.geometry.type;if(g==="Polygon"||g==="MultiPolygon")return new _l(p,p.geometry)}else if(p.type==="Polygon"||p.type==="MultiPolygon")return new _l(p,p)}return c.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(i){if(i.geometry()!=null&&i.canonicalID()!=null){if(i.geometryType()==="Point")return function(c,p){const g=[1/0,1/0,-1/0,-1/0],b=[1/0,1/0,-1/0,-1/0],x=c.canonicalID();if(p.type==="Polygon"){const E=Jc(p.coordinates,b,x),L=Qc(c.geometry(),g,b,x);if(!Xu(g,b))return!1;for(const A of L)if(!Kc(A,E))return!1}if(p.type==="MultiPolygon"){const E=Hd(p.coordinates,b,x),L=Qc(c.geometry(),g,b,x);if(!Xu(g,b))return!1;for(const A of L)if(!Sy(A,E))return!1}return!0}(i,this.geometries);if(i.geometryType()==="LineString")return function(c,p){const g=[1/0,1/0,-1/0,-1/0],b=[1/0,1/0,-1/0,-1/0],x=c.canonicalID();if(p.type==="Polygon"){const E=Jc(p.coordinates,b,x),L=Yd(c.geometry(),g,b,x);if(!Xu(g,b))return!1;for(const A of L)if(!Wd(A,E))return!1}if(p.type==="MultiPolygon"){const E=Hd(p.coordinates,b,x),L=Yd(c.geometry(),g,b,x);if(!Xu(g,b))return!1;for(const A of L)if(!Zd(A,E))return!1}return!0}(i,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class $c{constructor(i,c){this.type=c.type,this.name=i,this.boundExpression=c}static parse(i,c){if(i.length!==2||typeof i[1]!="string")return c.error("'var' expression requires exactly one string literal argument.");const p=i[1];return c.scope.has(p)?new $c(p,c.scope.get(p)):c.error(`Unknown variable "${p}". Make sure "${p}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(i){return this.boundExpression.evaluate(i)}eachChild(){}outputDefined(){return!1}}class Mo{constructor(i,c,p,g){this.name=i,this.type=c,this._evaluate=p,this.args=g}evaluate(i){return this._evaluate(i,this.args)}eachChild(i){this.args.forEach(i)}outputDefined(){return!1}static parse(i,c){const p=i[0],g=Mo.definitions[p];if(!g)return c.error(`Unknown expression "${p}". If you wanted a literal array, use ["literal", [...]].`,0);const b=Array.isArray(g)?g[0]:g.type,x=Array.isArray(g)?[[g[1],g[2]]]:g.overloads,E=x.filter(([A])=>!Array.isArray(A)||A.length===i.length-1);let L=null;for(const[A,D]of E){L=new Xc(c.registry,Yu,c.path,null,c.scope);const N=[];let U=!1;for(let W=1;W{return U=N,Array.isArray(U)?`(${U.map(nt).join(", ")})`:`(${nt(U.type)}...)`;var U}).join(" | "),D=[];for(let N=1;N{c=i?c&&Yu(p):c&&p instanceof Oa}),!!c&&th(a)&&Ju(a,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function th(a){if(a instanceof Mo&&(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 _l)return!1;let i=!0;return a.eachChild(c=>{i&&!th(c)&&(i=!1)}),i}function Ku(a){if(a instanceof Mo&&a.name==="feature-state")return!1;let i=!0;return a.eachChild(c=>{i&&!Ku(c)&&(i=!1)}),i}function Ju(a,i){if(a instanceof Mo&&i.indexOf(a.name)>=0)return!1;let c=!0;return a.eachChild(p=>{c&&!Ju(p,i)&&(c=!1)}),c}function Qu(a,i){const c=a.length-1;let p,g,b=0,x=c,E=0;for(;b<=x;)if(E=Math.floor((b+x)/2),p=a[E],g=a[E+1],p<=i){if(E===c||ii))throw new hr("Input is not a number.");x=E-1}return 0}class $u{constructor(i,c,p){this.type=i,this.input=c,this.labels=[],this.outputs=[];for(const[g,b]of p)this.labels.push(g),this.outputs.push(b)}static parse(i,c){if(i.length-1<4)return c.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return c.error("Expected an even number of arguments.");const p=c.parse(i[1],1,se);if(!p)return null;const g=[];let b=null;c.expectedType&&c.expectedType.kind!=="value"&&(b=c.expectedType);for(let x=1;x=E)return c.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',A);const N=c.parse(L,D,b);if(!N)return null;b=b||N.type,g.push([E,N])}return new $u(b,p,g)}evaluate(i){const c=this.labels,p=this.outputs;if(c.length===1)return p[0].evaluate(i);const g=this.input.evaluate(i);if(g<=c[0])return p[0].evaluate(i);const b=c.length;return g>=c[b-1]?p[b-1].evaluate(i):p[Qu(c,g)].evaluate(i)}eachChild(i){i(this.input);for(const c of this.outputs)i(c)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}}function Iy(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Cy=Kd;function Kd(a,i,c,p){this.cx=3*a,this.bx=3*(c-a)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(p-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=a,this.p1y=i,this.p2x=c,this.p2y=p}Kd.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,i){if(i===void 0&&(i=1e-6),a<0)return 0;if(a>1)return 1;for(var c=a,p=0;p<8;p++){var g=this.sampleCurveX(c)-a;if(Math.abs(g)g?x=c:E=c,c=.5*(E-x)+x;return c},solve:function(a,i){return this.sampleCurveY(this.solveCurveX(a,i))}};var Ty=Iy(Cy);function vl(a,i,c){return a+c*(i-a)}function eh(a,i,c){return a.map((p,g)=>vl(p,i[g],c))}const Yi={number:vl,color:function(a,i,c,p="rgb"){switch(p){case"rgb":{const[g,b,x,E]=eh(a.rgb,i.rgb,c);return new zn(g,b,x,E,!1)}case"hcl":{const[g,b,x,E]=a.hcl,[L,A,D,N]=i.hcl;let U,W;if(isNaN(g)||isNaN(L))isNaN(g)?isNaN(L)?U=NaN:(U=L,x!==1&&x!==0||(W=A)):(U=g,D!==1&&D!==0||(W=b));else{let It=L-g;L>g&&It>180?It-=360:L180&&(It+=360),U=g+c*It}const[H,et,st,pt]=function([It,gt,xt,Xt]){return It=isNaN(It)?0:It*je,br([xt,Math.cos(It)*gt,Math.sin(It)*gt,Xt])}([U,W??vl(b,A,c),vl(x,D,c),vl(E,N,c)]);return new zn(H,et,st,pt,!1)}case"lab":{const[g,b,x,E]=br(eh(a.lab,i.lab,c));return new zn(g,b,x,E,!1)}}},array:eh,padding:function(a,i,c){return new lo(eh(a.values,i.values,c))},variableAnchorOffsetCollection:function(a,i,c){const p=a.values,g=i.values;if(p.length!==g.length)throw new hr(`Cannot interpolate values of different length. from: ${a.toString()}, to: ${i.toString()}`);const b=[];for(let x=0;xtypeof D!="number"||D<0||D>1))return c.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);g={name:"cubic-bezier",controlPoints:A}}}if(i.length-1<4)return c.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return c.error("Expected an even number of arguments.");if(b=c.parse(b,2,se),!b)return null;const E=[];let L=null;p==="interpolate-hcl"||p==="interpolate-lab"?L=Mr:c.expectedType&&c.expectedType.kind!=="value"&&(L=c.expectedType);for(let A=0;A=D)return c.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',U);const H=c.parse(N,W,L);if(!H)return null;L=L||H.type,E.push([D,H])}return Et(L,se)||Et(L,Mr)||Et(L,at)||Et(L,j)||Et(L,X(se))?new ki(L,p,g,b,E):c.error(`Type ${nt(L)} is not interpolatable.`)}evaluate(i){const c=this.labels,p=this.outputs;if(c.length===1)return p[0].evaluate(i);const g=this.input.evaluate(i);if(g<=c[0])return p[0].evaluate(i);const b=c.length;if(g>=c[b-1])return p[b-1].evaluate(i);const x=Qu(c,g),E=ki.interpolationFactor(this.interpolation,g,c[x],c[x+1]),L=p[x].evaluate(i),A=p[x+1].evaluate(i);switch(this.operator){case"interpolate":return Yi[this.type.kind](L,A,E);case"interpolate-hcl":return Yi.color(L,A,E,"hcl");case"interpolate-lab":return Yi.color(L,A,E,"lab")}}eachChild(i){i(this.input);for(const c of this.outputs)i(c)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}}function kn(a,i,c,p){const g=p-c,b=a-c;return g===0?0:i===1?b/g:(Math.pow(i,b)-1)/(Math.pow(i,g)-1)}class nh{constructor(i,c){this.type=i,this.args=c}static parse(i,c){if(i.length<2)return c.error("Expectected at least one argument.");let p=null;const g=c.expectedType;g&&g.kind!=="value"&&(p=g);const b=[];for(const E of i.slice(1)){const L=c.parse(E,1+b.length,p,void 0,{typeAnnotation:"omit"});if(!L)return null;p=p||L.type,b.push(L)}if(!p)throw new Error("No output type");const x=g&&b.some(E=>Q(g,E.type));return new nh(x?He:p,b)}evaluate(i){let c,p=null,g=0;for(const b of this.args)if(g++,p=b.evaluate(i),p&&p instanceof Yo&&!p.available&&(c||(c=p.name),p=null,g===this.args.length&&(p=c)),p!==null)break;return p}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}}class rh{constructor(i,c){this.type=c.type,this.bindings=[].concat(i),this.result=c}evaluate(i){return this.result.evaluate(i)}eachChild(i){for(const c of this.bindings)i(c[1]);i(this.result)}static parse(i,c){if(i.length<4)return c.error(`Expected at least 3 arguments, but found ${i.length-1} instead.`);const p=[];for(let b=1;b=p.length)throw new hr(`Array index out of bounds: ${c} > ${p.length-1}.`);if(c!==Math.floor(c))throw new hr(`Array index must be an integer, but found ${c} instead.`);return p[c]}eachChild(i){i(this.index),i(this.input)}outputDefined(){return!1}}class qf{constructor(i,c){this.type=Xe,this.needle=i,this.haystack=c}static parse(i,c){if(i.length!==3)return c.error(`Expected 2 arguments, but found ${i.length-1} instead.`);const p=c.parse(i[1],1,He),g=c.parse(i[2],2,He);return p&&g?bt(p.type,[Xe,Ke,se,jr,He])?new qf(p,g):c.error(`Expected first argument to be of type boolean, string, number or null, but found ${nt(p.type)} instead`):null}evaluate(i){const c=this.needle.evaluate(i),p=this.haystack.evaluate(i);if(!p)return!1;if(!dt(c,["boolean","string","number","null"]))throw new hr(`Expected first argument to be of type boolean, string, number or null, but found ${nt(Zr(c))} instead.`);if(!dt(p,["string","array"]))throw new hr(`Expected second argument to be of type array or string, but found ${nt(Zr(p))} instead.`);return p.indexOf(c)>=0}eachChild(i){i(this.needle),i(this.haystack)}outputDefined(){return!0}}class ih{constructor(i,c,p){this.type=se,this.needle=i,this.haystack=c,this.fromIndex=p}static parse(i,c){if(i.length<=2||i.length>=5)return c.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);const p=c.parse(i[1],1,He),g=c.parse(i[2],2,He);if(!p||!g)return null;if(!bt(p.type,[Xe,Ke,se,jr,He]))return c.error(`Expected first argument to be of type boolean, string, number or null, but found ${nt(p.type)} instead`);if(i.length===4){const b=c.parse(i[3],3,se);return b?new ih(p,g,b):null}return new ih(p,g)}evaluate(i){const c=this.needle.evaluate(i),p=this.haystack.evaluate(i);if(!dt(c,["boolean","string","number","null"]))throw new hr(`Expected first argument to be of type boolean, string, number or null, but found ${nt(Zr(c))} instead.`);if(!dt(p,["string","array"]))throw new hr(`Expected second argument to be of type array or string, but found ${nt(Zr(p))} instead.`);if(this.fromIndex){const g=this.fromIndex.evaluate(i);return p.indexOf(c,g)}return p.indexOf(c)}eachChild(i){i(this.needle),i(this.haystack),this.fromIndex&&i(this.fromIndex)}outputDefined(){return!1}}class jf{constructor(i,c,p,g,b,x){this.inputType=i,this.type=c,this.input=p,this.cases=g,this.outputs=b,this.otherwise=x}static parse(i,c){if(i.length<5)return c.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if(i.length%2!=1)return c.error("Expected an even number of arguments.");let p,g;c.expectedType&&c.expectedType.kind!=="value"&&(g=c.expectedType);const b={},x=[];for(let A=2;ANumber.MAX_SAFE_INTEGER)return U.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof H=="number"&&Math.floor(H)!==H)return U.error("Numeric branch labels must be integer values.");if(p){if(U.checkSubtype(p,Zr(H)))return null}else p=Zr(H);if(b[String(H)]!==void 0)return U.error("Branch labels must be unique.");b[String(H)]=x.length}const W=c.parse(N,A,g);if(!W)return null;g=g||W.type,x.push(W)}const E=c.parse(i[1],1,He);if(!E)return null;const L=c.parse(i[i.length-1],i.length-1,g);return L?E.type.kind!=="value"&&c.concat(1).checkSubtype(p,E.type)?null:new jf(p,g,E,b,x,L):null}evaluate(i){const c=this.input.evaluate(i);return(Zr(c)===this.inputType&&this.outputs[this.cases[c]]||this.otherwise).evaluate(i)}eachChild(i){i(this.input),this.outputs.forEach(i),i(this.otherwise)}outputDefined(){return this.outputs.every(i=>i.outputDefined())&&this.otherwise.outputDefined()}}class Wf{constructor(i,c,p){this.type=i,this.branches=c,this.otherwise=p}static parse(i,c){if(i.length<4)return c.error(`Expected at least 3 arguments, but found only ${i.length-1}.`);if(i.length%2!=0)return c.error("Expected an odd number of arguments.");let p;c.expectedType&&c.expectedType.kind!=="value"&&(p=c.expectedType);const g=[];for(let x=1;xc.outputDefined())&&this.otherwise.outputDefined()}}class oh{constructor(i,c,p,g){this.type=i,this.input=c,this.beginIndex=p,this.endIndex=g}static parse(i,c){if(i.length<=2||i.length>=5)return c.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);const p=c.parse(i[1],1,He),g=c.parse(i[2],2,se);if(!p||!g)return null;if(!bt(p.type,[X(He),Ke,He]))return c.error(`Expected first argument to be of type array or string, but found ${nt(p.type)} instead`);if(i.length===4){const b=c.parse(i[3],3,se);return b?new oh(p.type,p,g,b):null}return new oh(p.type,p,g)}evaluate(i){const c=this.input.evaluate(i),p=this.beginIndex.evaluate(i);if(!dt(c,["string","array"]))throw new hr(`Expected first argument to be of type array or string, but found ${nt(Zr(c))} instead.`);if(this.endIndex){const g=this.endIndex.evaluate(i);return c.slice(p,g)}return c.slice(p)}eachChild(i){i(this.input),i(this.beginIndex),this.endIndex&&i(this.endIndex)}outputDefined(){return!1}}function Jd(a,i){return a==="=="||a==="!="?i.kind==="boolean"||i.kind==="string"||i.kind==="number"||i.kind==="null"||i.kind==="value":i.kind==="string"||i.kind==="number"||i.kind==="value"}function Qd(a,i,c,p){return p.compare(i,c)===0}function tu(a,i,c){const p=a!=="=="&&a!=="!=";return class lS{constructor(b,x,E){this.type=Xe,this.lhs=b,this.rhs=x,this.collator=E,this.hasUntypedArgument=b.type.kind==="value"||x.type.kind==="value"}static parse(b,x){if(b.length!==3&&b.length!==4)return x.error("Expected two or three arguments.");const E=b[0];let L=x.parse(b[1],1,He);if(!L)return null;if(!Jd(E,L.type))return x.concat(1).error(`"${E}" comparisons are not supported for type '${nt(L.type)}'.`);let A=x.parse(b[2],2,He);if(!A)return null;if(!Jd(E,A.type))return x.concat(2).error(`"${E}" comparisons are not supported for type '${nt(A.type)}'.`);if(L.type.kind!==A.type.kind&&L.type.kind!=="value"&&A.type.kind!=="value")return x.error(`Cannot compare types '${nt(L.type)}' and '${nt(A.type)}'.`);p&&(L.type.kind==="value"&&A.type.kind!=="value"?L=new Po(A.type,[L]):L.type.kind!=="value"&&A.type.kind==="value"&&(A=new Po(L.type,[A])));let D=null;if(b.length===4){if(L.type.kind!=="string"&&A.type.kind!=="string"&&L.type.kind!=="value"&&A.type.kind!=="value")return x.error("Cannot use collator to compare non-string types.");if(D=x.parse(b[3],3,fa),!D)return null}return new lS(L,A,D)}evaluate(b){const x=this.lhs.evaluate(b),E=this.rhs.evaluate(b);if(p&&this.hasUntypedArgument){const L=Zr(x),A=Zr(E);if(L.kind!==A.kind||L.kind!=="string"&&L.kind!=="number")throw new hr(`Expected arguments for "${a}" to be (string, string) or (number, number), but found (${L.kind}, ${A.kind}) instead.`)}if(this.collator&&!p&&this.hasUntypedArgument){const L=Zr(x),A=Zr(E);if(L.kind!=="string"||A.kind!=="string")return i(b,x,E)}return this.collator?c(b,x,E,this.collator.evaluate(b)):i(b,x,E)}eachChild(b){b(this.lhs),b(this.rhs),this.collator&&b(this.collator)}outputDefined(){return!0}}}const Ly=tu("==",function(a,i,c){return i===c},Qd),Py=tu("!=",function(a,i,c){return i!==c},function(a,i,c,p){return!Qd(0,i,c,p)}),My=tu("<",function(a,i,c){return i",function(a,i,c){return i>c},function(a,i,c,p){return p.compare(i,c)>0}),ky=tu("<=",function(a,i,c){return i<=c},function(a,i,c,p){return p.compare(i,c)<=0}),Dy=tu(">=",function(a,i,c){return i>=c},function(a,i,c,p){return p.compare(i,c)>=0});class Zf{constructor(i,c,p,g,b){this.type=Ke,this.number=i,this.locale=c,this.currency=p,this.minFractionDigits=g,this.maxFractionDigits=b}static parse(i,c){if(i.length!==3)return c.error("Expected two arguments.");const p=c.parse(i[1],1,se);if(!p)return null;const g=i[2];if(typeof g!="object"||Array.isArray(g))return c.error("NumberFormat options argument must be an object.");let b=null;if(g.locale&&(b=c.parse(g.locale,1,Ke),!b))return null;let x=null;if(g.currency&&(x=c.parse(g.currency,1,Ke),!x))return null;let E=null;if(g["min-fraction-digits"]&&(E=c.parse(g["min-fraction-digits"],1,se),!E))return null;let L=null;return g["max-fraction-digits"]&&(L=c.parse(g["max-fraction-digits"],1,se),!L)?null:new Zf(p,b,x,E,L)}evaluate(i){return new Intl.NumberFormat(this.locale?this.locale.evaluate(i):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(i):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(i):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(i):void 0}).format(this.number.evaluate(i))}eachChild(i){i(this.number),this.locale&&i(this.locale),this.currency&&i(this.currency),this.minFractionDigits&&i(this.minFractionDigits),this.maxFractionDigits&&i(this.maxFractionDigits)}outputDefined(){return!1}}class sh{constructor(i){this.type=Nr,this.sections=i}static parse(i,c){if(i.length<2)return c.error("Expected at least one argument.");const p=i[1];if(!Array.isArray(p)&&typeof p=="object")return c.error("First argument must be an image or text section.");const g=[];let b=!1;for(let x=1;x<=i.length-1;++x){const E=i[x];if(b&&typeof E=="object"&&!Array.isArray(E)){b=!1;let L=null;if(E["font-scale"]&&(L=c.parse(E["font-scale"],1,se),!L))return null;let A=null;if(E["text-font"]&&(A=c.parse(E["text-font"],1,X(Ke)),!A))return null;let D=null;if(E["text-color"]&&(D=c.parse(E["text-color"],1,Mr),!D))return null;const N=g[g.length-1];N.scale=L,N.font=A,N.textColor=D}else{const L=c.parse(i[x],1,He);if(!L)return null;const A=L.type.kind;if(A!=="string"&&A!=="value"&&A!=="null"&&A!=="resolvedImage")return c.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");b=!0,g.push({content:L,scale:null,font:null,textColor:null})}}return new sh(g)}evaluate(i){return new Lo(this.sections.map(c=>{const p=c.content.evaluate(i);return Zr(p)===V?new Uf("",p,null,null,null):new Uf(Zu(p),null,c.scale?c.scale.evaluate(i):null,c.font?c.font.evaluate(i).join(","):null,c.textColor?c.textColor.evaluate(i):null)}))}eachChild(i){for(const c of this.sections)i(c.content),c.scale&&i(c.scale),c.font&&i(c.font),c.textColor&&i(c.textColor)}outputDefined(){return!1}}class Hf{constructor(i){this.type=V,this.input=i}static parse(i,c){if(i.length!==2)return c.error("Expected two arguments.");const p=c.parse(i[1],1,Ke);return p?new Hf(p):c.error("No image name provided.")}evaluate(i){const c=this.input.evaluate(i),p=Yo.fromString(c);return p&&i.availableImages&&(p.available=i.availableImages.indexOf(c)>-1),p}eachChild(i){i(this.input)}outputDefined(){return!1}}class Xf{constructor(i){this.type=se,this.input=i}static parse(i,c){if(i.length!==2)return c.error(`Expected 1 argument, but found ${i.length-1} instead.`);const p=c.parse(i[1],1);return p?p.type.kind!=="array"&&p.type.kind!=="string"&&p.type.kind!=="value"?c.error(`Expected argument of type string or array, but found ${nt(p.type)} instead.`):new Xf(p):null}evaluate(i){const c=this.input.evaluate(i);if(typeof c=="string"||Array.isArray(c))return c.length;throw new hr(`Expected value to be of type string or array, but found ${nt(Zr(c))} instead.`)}eachChild(i){i(this.input)}outputDefined(){return!1}}const eu={"==":Ly,"!=":Py,">":Ay,"<":My,">=":Dy,"<=":ky,array:Po,at:Gf,boolean:Po,case:Wf,coalesce:nh,collator:$l,format:sh,image:Hf,in:qf,"index-of":ih,interpolate:ki,"interpolate-hcl":ki,"interpolate-lab":ki,length:Xf,let:rh,literal:Oa,match:jf,number:Po,"number-format":Zf,object:Po,slice:oh,step:$u,string:Po,"to-boolean":Ns,"to-color":Ns,"to-number":Ns,"to-string":Ns,var:$c,within:_l};function $d(a,[i,c,p,g]){i=i.evaluate(a),c=c.evaluate(a),p=p.evaluate(a);const b=g?g.evaluate(a):1,x=Ql(i,c,p,b);if(x)throw new hr(x);return new zn(i/255,c/255,p/255,b,!1)}function tm(a,i){return a in i}function Yf(a,i){const c=i[a];return c===void 0?null:c}function bl(a){return{type:a}}function em(a){return{result:"success",value:a}}function nu(a){return{result:"error",value:a}}function ru(a){return a["property-type"]==="data-driven"||a["property-type"]==="cross-faded-data-driven"}function nm(a){return!!a.expression&&a.expression.parameters.indexOf("zoom")>-1}function Kf(a){return!!a.expression&&a.expression.interpolated}function Sn(a){return a instanceof Number?"number":a instanceof String?"string":a instanceof Boolean?"boolean":Array.isArray(a)?"array":a===null?"null":typeof a}function ah(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function Ry(a){return a}function rm(a,i){const c=i.type==="color",p=a.stops&&typeof a.stops[0][0]=="object",g=p||!(p||a.property!==void 0),b=a.type||(Kf(i)?"exponential":"interval");if(c||i.type==="padding"){const D=c?zn.parse:lo.parse;(a=Zo({},a)).stops&&(a.stops=a.stops.map(N=>[N[0],D(N[1])])),a.default=D(a.default?a.default:i.default)}if(a.colorSpace&&(x=a.colorSpace)!=="rgb"&&x!=="hcl"&&x!=="lab")throw new Error(`Unknown color space: "${a.colorSpace}"`);var x;let E,L,A;if(b==="exponential")E=vn;else if(b==="interval")E=Ny;else if(b==="categorical"){E=Or,L=Object.create(null);for(const D of a.stops)L[D[0]]=D[1];A=typeof a.stops[0][0]}else{if(b!=="identity")throw new Error(`Unknown function type "${b}"`);E=Jf}if(p){const D={},N=[];for(let H=0;HH[0]),evaluate:({zoom:H},et)=>vn({stops:U,base:a.base},i,H).evaluate(H,et)}}if(g){const D=b==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:D,interpolationFactor:ki.interpolationFactor.bind(void 0,D),zoomStops:a.stops.map(N=>N[0]),evaluate:({zoom:N})=>E(a,i,N,L,A)}}return{kind:"source",evaluate(D,N){const U=N&&N.properties?N.properties[a.property]:void 0;return U===void 0?tc(a.default,i.default):E(a,i,U,L,A)}}}function tc(a,i,c){return a!==void 0?a:i!==void 0?i:c!==void 0?c:void 0}function Or(a,i,c,p,g){return tc(typeof c===g?p[c]:void 0,a.default,i.default)}function Ny(a,i,c){if(Sn(c)!=="number")return tc(a.default,i.default);const p=a.stops.length;if(p===1||c<=a.stops[0][0])return a.stops[0][1];if(c>=a.stops[p-1][0])return a.stops[p-1][1];const g=Qu(a.stops.map(b=>b[0]),c);return a.stops[g][1]}function vn(a,i,c){const p=a.base!==void 0?a.base:1;if(Sn(c)!=="number")return tc(a.default,i.default);const g=a.stops.length;if(g===1||c<=a.stops[0][0])return a.stops[0][1];if(c>=a.stops[g-1][0])return a.stops[g-1][1];const b=Qu(a.stops.map(D=>D[0]),c),x=function(D,N,U,W){const H=W-U,et=D-U;return H===0?0:N===1?et/H:(Math.pow(N,et)-1)/(Math.pow(N,H)-1)}(c,p,a.stops[b][0],a.stops[b+1][0]),E=a.stops[b][1],L=a.stops[b+1][1],A=Yi[i.type]||Ry;return typeof E.evaluate=="function"?{evaluate(...D){const N=E.evaluate.apply(void 0,D),U=L.evaluate.apply(void 0,D);if(N!==void 0&&U!==void 0)return A(N,U,x,a.colorSpace)}}:A(E,L,x,a.colorSpace)}function Jf(a,i,c){switch(i.type){case"color":c=zn.parse(c);break;case"formatted":c=Lo.fromString(c.toString());break;case"resolvedImage":c=Yo.fromString(c.toString());break;case"padding":c=lo.parse(c);break;default:Sn(c)===i.type||i.type==="enum"&&i.values[c]||(c=void 0)}return tc(c,a.default,i.default)}Mo.register(eu,{error:[{kind:"error"},[Ke],(a,[i])=>{throw new hr(i.evaluate(a))}],typeof:[Ke,[He],(a,[i])=>nt(Zr(i.evaluate(a)))],"to-rgba":[X(se,4),[Mr],(a,[i])=>{const[c,p,g,b]=i.evaluate(a).rgb;return[255*c,255*p,255*g,b]}],rgb:[Mr,[se,se,se],$d],rgba:[Mr,[se,se,se,se],$d],has:{type:Xe,overloads:[[[Ke],(a,[i])=>tm(i.evaluate(a),a.properties())],[[Ke,Ho],(a,[i,c])=>tm(i.evaluate(a),c.evaluate(a))]]},get:{type:He,overloads:[[[Ke],(a,[i])=>Yf(i.evaluate(a),a.properties())],[[Ke,Ho],(a,[i,c])=>Yf(i.evaluate(a),c.evaluate(a))]]},"feature-state":[He,[Ke],(a,[i])=>Yf(i.evaluate(a),a.featureState||{})],properties:[Ho,[],a=>a.properties()],"geometry-type":[Ke,[],a=>a.geometryType()],id:[He,[],a=>a.id()],zoom:[se,[],a=>a.globals.zoom],"heatmap-density":[se,[],a=>a.globals.heatmapDensity||0],"line-progress":[se,[],a=>a.globals.lineProgress||0],accumulated:[He,[],a=>a.globals.accumulated===void 0?null:a.globals.accumulated],"+":[se,bl(se),(a,i)=>{let c=0;for(const p of i)c+=p.evaluate(a);return c}],"*":[se,bl(se),(a,i)=>{let c=1;for(const p of i)c*=p.evaluate(a);return c}],"-":{type:se,overloads:[[[se,se],(a,[i,c])=>i.evaluate(a)-c.evaluate(a)],[[se],(a,[i])=>-i.evaluate(a)]]},"/":[se,[se,se],(a,[i,c])=>i.evaluate(a)/c.evaluate(a)],"%":[se,[se,se],(a,[i,c])=>i.evaluate(a)%c.evaluate(a)],ln2:[se,[],()=>Math.LN2],pi:[se,[],()=>Math.PI],e:[se,[],()=>Math.E],"^":[se,[se,se],(a,[i,c])=>Math.pow(i.evaluate(a),c.evaluate(a))],sqrt:[se,[se],(a,[i])=>Math.sqrt(i.evaluate(a))],log10:[se,[se],(a,[i])=>Math.log(i.evaluate(a))/Math.LN10],ln:[se,[se],(a,[i])=>Math.log(i.evaluate(a))],log2:[se,[se],(a,[i])=>Math.log(i.evaluate(a))/Math.LN2],sin:[se,[se],(a,[i])=>Math.sin(i.evaluate(a))],cos:[se,[se],(a,[i])=>Math.cos(i.evaluate(a))],tan:[se,[se],(a,[i])=>Math.tan(i.evaluate(a))],asin:[se,[se],(a,[i])=>Math.asin(i.evaluate(a))],acos:[se,[se],(a,[i])=>Math.acos(i.evaluate(a))],atan:[se,[se],(a,[i])=>Math.atan(i.evaluate(a))],min:[se,bl(se),(a,i)=>Math.min(...i.map(c=>c.evaluate(a)))],max:[se,bl(se),(a,i)=>Math.max(...i.map(c=>c.evaluate(a)))],abs:[se,[se],(a,[i])=>Math.abs(i.evaluate(a))],round:[se,[se],(a,[i])=>{const c=i.evaluate(a);return c<0?-Math.round(-c):Math.round(c)}],floor:[se,[se],(a,[i])=>Math.floor(i.evaluate(a))],ceil:[se,[se],(a,[i])=>Math.ceil(i.evaluate(a))],"filter-==":[Xe,[Ke,He],(a,[i,c])=>a.properties()[i.value]===c.value],"filter-id-==":[Xe,[He],(a,[i])=>a.id()===i.value],"filter-type-==":[Xe,[Ke],(a,[i])=>a.geometryType()===i.value],"filter-<":[Xe,[Ke,He],(a,[i,c])=>{const p=a.properties()[i.value],g=c.value;return typeof p==typeof g&&p{const c=a.id(),p=i.value;return typeof c==typeof p&&c":[Xe,[Ke,He],(a,[i,c])=>{const p=a.properties()[i.value],g=c.value;return typeof p==typeof g&&p>g}],"filter-id->":[Xe,[He],(a,[i])=>{const c=a.id(),p=i.value;return typeof c==typeof p&&c>p}],"filter-<=":[Xe,[Ke,He],(a,[i,c])=>{const p=a.properties()[i.value],g=c.value;return typeof p==typeof g&&p<=g}],"filter-id-<=":[Xe,[He],(a,[i])=>{const c=a.id(),p=i.value;return typeof c==typeof p&&c<=p}],"filter->=":[Xe,[Ke,He],(a,[i,c])=>{const p=a.properties()[i.value],g=c.value;return typeof p==typeof g&&p>=g}],"filter-id->=":[Xe,[He],(a,[i])=>{const c=a.id(),p=i.value;return typeof c==typeof p&&c>=p}],"filter-has":[Xe,[He],(a,[i])=>i.value in a.properties()],"filter-has-id":[Xe,[],a=>a.id()!==null&&a.id()!==void 0],"filter-type-in":[Xe,[X(Ke)],(a,[i])=>i.value.indexOf(a.geometryType())>=0],"filter-id-in":[Xe,[X(He)],(a,[i])=>i.value.indexOf(a.id())>=0],"filter-in-small":[Xe,[Ke,X(He)],(a,[i,c])=>c.value.indexOf(a.properties()[i.value])>=0],"filter-in-large":[Xe,[Ke,X(He)],(a,[i,c])=>function(p,g,b,x){for(;b<=x;){const E=b+x>>1;if(g[E]===p)return!0;g[E]>p?x=E-1:b=E+1}return!1}(a.properties()[i.value],c.value,0,c.value.length-1)],all:{type:Xe,overloads:[[[Xe,Xe],(a,[i,c])=>i.evaluate(a)&&c.evaluate(a)],[bl(Xe),(a,i)=>{for(const c of i)if(!c.evaluate(a))return!1;return!0}]]},any:{type:Xe,overloads:[[[Xe,Xe],(a,[i,c])=>i.evaluate(a)||c.evaluate(a)],[bl(Xe),(a,i)=>{for(const c of i)if(c.evaluate(a))return!0;return!1}]]},"!":[Xe,[Xe],(a,[i])=>!i.evaluate(a)],"is-supported-script":[Xe,[Ke],(a,[i])=>{const c=a.globals&&a.globals.isSupportedScript;return!c||c(i.evaluate(a))}],upcase:[Ke,[Ke],(a,[i])=>i.evaluate(a).toUpperCase()],downcase:[Ke,[Ke],(a,[i])=>i.evaluate(a).toLowerCase()],concat:[Ke,bl(He),(a,i)=>i.map(c=>Zu(c.evaluate(a))).join("")],"resolved-locale":[Ke,[fa],(a,[i])=>i.evaluate(a).resolvedLocale()]});class Kn{constructor(i,c){var p;this.expression=i,this._warningHistory={},this._evaluator=new Fn,this._defaultValue=c?(p=c).type==="color"&&ah(p.default)?new zn(0,0,0,0):p.type==="color"?zn.parse(p.default)||null:p.type==="padding"?lo.parse(p.default)||null:p.type==="variableAnchorOffsetCollection"?Xo.parse(p.default)||null:p.default===void 0?null:p.default:null,this._enumValues=c&&c.type==="enum"?c.values:null}evaluateWithoutErrorHandling(i,c,p,g,b,x){return this._evaluator.globals=i,this._evaluator.feature=c,this._evaluator.featureState=p,this._evaluator.canonical=g,this._evaluator.availableImages=b||null,this._evaluator.formattedSection=x,this.expression.evaluate(this._evaluator)}evaluate(i,c,p,g,b,x){this._evaluator.globals=i,this._evaluator.feature=c||null,this._evaluator.featureState=p||null,this._evaluator.canonical=g,this._evaluator.availableImages=b||null,this._evaluator.formattedSection=x||null;try{const E=this.expression.evaluate(this._evaluator);if(E==null||typeof E=="number"&&E!=E)return this._defaultValue;if(this._enumValues&&!(E in this._enumValues))throw new hr(`Expected value to be one of ${Object.keys(this._enumValues).map(L=>JSON.stringify(L)).join(", ")}, but found ${JSON.stringify(E)} instead.`);return E}catch(E){return this._warningHistory[E.message]||(this._warningHistory[E.message]=!0,typeof console<"u"&&console.warn(E.message)),this._defaultValue}}}function Zn(a){return Array.isArray(a)&&a.length>0&&typeof a[0]=="string"&&a[0]in eu}function xl(a,i){const c=new Xc(eu,Yu,[],i?function(g){const b={color:Mr,string:Ke,number:se,enum:Ke,boolean:Xe,formatted:Nr,padding:at,resolvedImage:V,variableAnchorOffsetCollection:j};return g.type==="array"?X(b[g.value]||He,g.length):b[g.type]}(i):void 0),p=c.parse(a,void 0,void 0,void 0,i&&i.type==="string"?{typeAnnotation:"coerce"}:void 0);return p?em(new Kn(p,i)):nu(c.errors)}class lh{constructor(i,c){this.kind=i,this._styleExpression=c,this.isStateDependent=i!=="constant"&&!Ku(c.expression)}evaluateWithoutErrorHandling(i,c,p,g,b,x){return this._styleExpression.evaluateWithoutErrorHandling(i,c,p,g,b,x)}evaluate(i,c,p,g,b,x){return this._styleExpression.evaluate(i,c,p,g,b,x)}}class Qf{constructor(i,c,p,g){this.kind=i,this.zoomStops=p,this._styleExpression=c,this.isStateDependent=i!=="camera"&&!Ku(c.expression),this.interpolationType=g}evaluateWithoutErrorHandling(i,c,p,g,b,x){return this._styleExpression.evaluateWithoutErrorHandling(i,c,p,g,b,x)}evaluate(i,c,p,g,b,x){return this._styleExpression.evaluate(i,c,p,g,b,x)}interpolationFactor(i,c,p){return this.interpolationType?ki.interpolationFactor(this.interpolationType,i,c,p):0}}function im(a,i){const c=xl(a,i);if(c.result==="error")return c;const p=c.value.expression,g=th(p);if(!g&&!ru(i))return nu([new Hi("","data expressions not supported")]);const b=Ju(p,["zoom"]);if(!b&&!nm(i))return nu([new Hi("","zoom expressions not supported")]);const x=ch(p);return x||b?x instanceof Hi?nu([x]):x instanceof ki&&!Kf(i)?nu([new Hi("",'"interpolate" expressions cannot be used with this property')]):em(x?new Qf(g?"camera":"composite",c.value,x.labels,x instanceof ki?x.interpolation:void 0):new lh(g?"constant":"source",c.value)):nu([new Hi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class uh{constructor(i,c){this._parameters=i,this._specification=c,Zo(this,rm(this._parameters,this._specification))}static deserialize(i){return new uh(i._parameters,i._specification)}static serialize(i){return{_parameters:i._parameters,_specification:i._specification}}}function ch(a){let i=null;if(a instanceof rh)i=ch(a.result);else if(a instanceof nh){for(const c of a.args)if(i=ch(c),i)break}else(a instanceof $u||a instanceof ki)&&a.input instanceof Mo&&a.input.name==="zoom"&&(i=a);return i instanceof Hi||a.eachChild(c=>{const p=ch(c);p instanceof Hi?i=p:!i&&p?i=new Hi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&p&&i!==p&&(i=new Hi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),i}function hh(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 i of a.slice(1))if(!hh(i)&&typeof i!="boolean")return!1;return!0;default:return!0}}const om={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function fh(a){if(a==null)return{filter:()=>!0,needGeometry:!1};hh(a)||(a=dh(a));const i=xl(a,om);if(i.result==="error")throw new Error(i.value.map(c=>`${c.key}: ${c.message}`).join(", "));return{filter:(c,p,g)=>i.value.evaluate(c,p,{},g),needGeometry:ph(a)}}function sm(a,i){return ai?1:0}function ph(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(let i=1;i"||i==="<="||i===">="?$f(a[1],a[2],i):i==="any"?(c=a.slice(1),["any"].concat(c.map(dh))):i==="all"?["all"].concat(a.slice(1).map(dh)):i==="none"?["all"].concat(a.slice(1).map(dh).map(mh)):i==="in"?am(a[1],a.slice(2)):i==="!in"?mh(am(a[1],a.slice(2))):i==="has"?lm(a[1]):i==="!has"?mh(lm(a[1])):i!=="within"||a;var c}function $f(a,i,c){switch(a){case"$type":return[`filter-type-${c}`,i];case"$id":return[`filter-id-${c}`,i];default:return[`filter-${c}`,a,i]}}function am(a,i){if(i.length===0)return!1;switch(a){case"$type":return["filter-type-in",["literal",i]];case"$id":return["filter-id-in",["literal",i]];default:return i.length>200&&!i.some(c=>typeof c!=typeof i[0])?["filter-in-large",a,["literal",i.sort(sm)]]:["filter-in-small",a,["literal",i]]}}function lm(a){switch(a){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",a]}}function mh(a){return["!",a]}function tp(a){const i=typeof a;if(i==="number"||i==="boolean"||i==="string"||a==null)return JSON.stringify(a);if(Array.isArray(a)){let g="[";for(const b of a)g+=`${tp(b)},`;return`${g}]`}const c=Object.keys(a).sort();let p="{";for(let g=0;gp.maximum?[new ee(i,c,`${c} is greater than the maximum value ${p.maximum}`)]:[]}function cm(a){const i=a.valueSpec,c=xr(a.value.type);let p,g,b,x={};const E=c!=="categorical"&&a.value.property===void 0,L=!E,A=Sn(a.value.stops)==="array"&&Sn(a.value.stops[0])==="array"&&Sn(a.value.stops[0][0])==="object",D=Ki({key:a.key,value:a.value,valueSpec:a.styleSpec.function,validateSpec:a.validateSpec,style:a.style,styleSpec:a.styleSpec,objectElementValidators:{stops:function(W){if(c==="identity")return[new ee(W.key,W.value,'identity function may not have a "stops" property')];let H=[];const et=W.value;return H=H.concat(ep({key:W.key,value:et,valueSpec:W.valueSpec,validateSpec:W.validateSpec,style:W.style,styleSpec:W.styleSpec,arrayElementValidator:N})),Sn(et)==="array"&&et.length===0&&H.push(new ee(W.key,et,"array must have at least one stop")),H},default:function(W){return W.validateSpec({key:W.key,value:W.value,valueSpec:i,validateSpec:W.validateSpec,style:W.style,styleSpec:W.styleSpec})}}});return c==="identity"&&E&&D.push(new ee(a.key,a.value,'missing required property "property"')),c==="identity"||a.value.stops||D.push(new ee(a.key,a.value,'missing required property "stops"')),c==="exponential"&&a.valueSpec.expression&&!Kf(a.valueSpec)&&D.push(new ee(a.key,a.value,"exponential functions not supported")),a.styleSpec.$version>=8&&(L&&!ru(a.valueSpec)?D.push(new ee(a.key,a.value,"property functions not supported")):E&&!nm(a.valueSpec)&&D.push(new ee(a.key,a.value,"zoom functions not supported"))),c!=="categorical"&&!A||a.value.property!==void 0||D.push(new ee(a.key,a.value,'"property" property is required')),D;function N(W){let H=[];const et=W.value,st=W.key;if(Sn(et)!=="array")return[new ee(st,et,`array expected, ${Sn(et)} found`)];if(et.length!==2)return[new ee(st,et,`array length 2 expected, length ${et.length} found`)];if(A){if(Sn(et[0])!=="object")return[new ee(st,et,`object expected, ${Sn(et[0])} found`)];if(et[0].zoom===void 0)return[new ee(st,et,"object stop key must have zoom")];if(et[0].value===void 0)return[new ee(st,et,"object stop key must have value")];if(b&&b>xr(et[0].zoom))return[new ee(st,et[0].zoom,"stop zoom values must appear in ascending order")];xr(et[0].zoom)!==b&&(b=xr(et[0].zoom),g=void 0,x={}),H=H.concat(Ki({key:`${st}[0]`,value:et[0],valueSpec:{zoom:{}},validateSpec:W.validateSpec,style:W.style,styleSpec:W.styleSpec,objectElementValidators:{zoom:gh,value:U}}))}else H=H.concat(U({key:`${st}[0]`,value:et[0],valueSpec:{},validateSpec:W.validateSpec,style:W.style,styleSpec:W.styleSpec},et));return Zn(Fa(et[1]))?H.concat([new ee(`${st}[1]`,et[1],"expressions are not allowed in function stops.")]):H.concat(W.validateSpec({key:`${st}[1]`,value:et[1],valueSpec:i,validateSpec:W.validateSpec,style:W.style,styleSpec:W.styleSpec}))}function U(W,H){const et=Sn(W.value),st=xr(W.value),pt=W.value!==null?W.value:H;if(p){if(et!==p)return[new ee(W.key,pt,`${et} stop domain type must match previous stop domain type ${p}`)]}else p=et;if(et!=="number"&&et!=="string"&&et!=="boolean")return[new ee(W.key,pt,"stop domain value must be a number, string, or boolean")];if(et!=="number"&&c!=="categorical"){let It=`number expected, ${et} found`;return ru(i)&&c===void 0&&(It+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ee(W.key,pt,It)]}return c!=="categorical"||et!=="number"||isFinite(st)&&Math.floor(st)===st?c!=="categorical"&&et==="number"&&g!==void 0&&stnew ee(`${a.key}${p.key}`,a.value,p.message));const c=i.value.expression||i.value._styleExpression.expression;if(a.expressionContext==="property"&&a.propertyKey==="text-font"&&!c.outputDefined())return[new ee(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"&&!Ku(c))return[new ee(a.key,a.value,'"feature-state" data expressions are not supported with layout properties.')];if(a.expressionContext==="filter"&&!Ku(c))return[new ee(a.key,a.value,'"feature-state" data expressions are not supported with filters.')];if(a.expressionContext&&a.expressionContext.indexOf("cluster")===0){if(!Ju(c,["zoom","feature-state"]))return[new ee(a.key,a.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(a.expressionContext==="cluster-initial"&&!th(c))return[new ee(a.key,a.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Va(a){const i=a.key,c=a.value,p=a.valueSpec,g=[];return Array.isArray(p.values)?p.values.indexOf(xr(c))===-1&&g.push(new ee(i,c,`expected one of [${p.values.join(", ")}], ${JSON.stringify(c)} found`)):Object.keys(p.values).indexOf(xr(c))===-1&&g.push(new ee(i,c,`expected one of [${Object.keys(p.values).join(", ")}], ${JSON.stringify(c)} found`)),g}function iu(a){return hh(Fa(a.value))?Ba(Zo({},a,{expressionContext:"filter",valueSpec:{value:"boolean"}})):np(a)}function np(a){const i=a.value,c=a.key;if(Sn(i)!=="array")return[new ee(c,i,`array expected, ${Sn(i)} found`)];const p=a.styleSpec;let g,b=[];if(i.length<1)return[new ee(c,i,"filter array must have at least 1 element")];switch(b=b.concat(Va({key:`${c}[0]`,value:i[0],valueSpec:p.filter_operator,style:a.style,styleSpec:a.styleSpec})),xr(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&xr(i[1])==="$type"&&b.push(new ee(c,i,`"$type" cannot be use with operator "${i[0]}"`));case"==":case"!=":i.length!==3&&b.push(new ee(c,i,`filter array for operator "${i[0]}" must have 3 elements`));case"in":case"!in":i.length>=2&&(g=Sn(i[1]),g!=="string"&&b.push(new ee(`${c}[1]`,i[1],`string expected, ${g} found`)));for(let x=2;x{A in c&&i.push(new ee(p,c[A],`"${A}" is prohibited for ref layers`))}),g.layers.forEach(A=>{xr(A.id)===E&&(L=A)}),L?L.ref?i.push(new ee(p,c.ref,"ref cannot reference another ref layer")):x=xr(L.type):i.push(new ee(p,c.ref,`ref layer "${E}" not found`))}else if(x!=="background")if(c.source){const L=g.sources&&g.sources[c.source],A=L&&xr(L.type);L?A==="vector"&&x==="raster"?i.push(new ee(p,c.source,`layer "${c.id}" requires a raster source`)):A!=="raster-dem"&&x==="hillshade"?i.push(new ee(p,c.source,`layer "${c.id}" requires a raster-dem source`)):A==="raster"&&x!=="raster"?i.push(new ee(p,c.source,`layer "${c.id}" requires a vector source`)):A!=="vector"||c["source-layer"]?A==="raster-dem"&&x!=="hillshade"?i.push(new ee(p,c.source,"raster-dem source can only be used with layer type 'hillshade'.")):x!=="line"||!c.paint||!c.paint["line-gradient"]||A==="geojson"&&L.lineMetrics||i.push(new ee(p,c,`layer "${c.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):i.push(new ee(p,c,`layer "${c.id}" must specify a "source-layer"`)):i.push(new ee(p,c.source,`source "${c.source}" not found`))}else i.push(new ee(p,c,'missing required property "source"'));return i=i.concat(Ki({key:p,value:c,valueSpec:b.layer,style:a.style,styleSpec:a.styleSpec,validateSpec:a.validateSpec,objectElementValidators:{"*":()=>[],type:()=>a.validateSpec({key:`${p}.type`,value:c.type,valueSpec:b.layer.type,style:a.style,styleSpec:a.styleSpec,validateSpec:a.validateSpec,object:c,objectKey:"type"}),filter:iu,layout:L=>Ki({layer:c,key:L.key,value:L.value,style:L.style,styleSpec:L.styleSpec,validateSpec:L.validateSpec,objectElementValidators:{"*":A=>ip(Zo({layerType:x},A))}}),paint:L=>Ki({layer:c,key:L.key,value:L.value,style:L.style,styleSpec:L.styleSpec,validateSpec:L.validateSpec,objectElementValidators:{"*":A=>rp(Zo({layerType:x},A))}})}})),i}function wl(a){const i=a.value,c=a.key,p=Sn(i);return p!=="string"?[new ee(c,i,`string expected, ${p} found`)]:[]}const hm={promoteId:function({key:a,value:i}){if(Sn(i)==="string")return wl({key:a,value:i});{const c=[];for(const p in i)c.push(...wl({key:`${a}.${p}`,value:i[p]}));return c}}};function fm(a){const i=a.value,c=a.key,p=a.styleSpec,g=a.style,b=a.validateSpec;if(!i.type)return[new ee(c,i,'"type" is required')];const x=xr(i.type);let E;switch(x){case"vector":case"raster":return E=Ki({key:c,value:i,valueSpec:p[`source_${x.replace("-","_")}`],style:a.style,styleSpec:p,objectElementValidators:hm,validateSpec:b}),E;case"raster-dem":return E=function(L){var A;const D=(A=L.sourceName)!==null&&A!==void 0?A:"",N=L.value,U=L.styleSpec,W=U.source_raster_dem,H=L.style;let et=[];const st=Sn(N);if(N===void 0)return et;if(st!=="object")return et.push(new ee("source_raster_dem",N,`object expected, ${st} found`)),et;const pt=xr(N.encoding)==="custom",It=["redFactor","greenFactor","blueFactor","baseShift"],gt=L.value.encoding?`"${L.value.encoding}"`:"Default";for(const xt in N)!pt&&It.includes(xt)?et.push(new ee(xt,N[xt],`In "${D}": "${xt}" is only valid when "encoding" is set to "custom". ${gt} encoding found`)):W[xt]?et=et.concat(L.validateSpec({key:xt,value:N[xt],valueSpec:W[xt],validateSpec:L.validateSpec,style:H,styleSpec:U})):et.push(new ee(xt,N[xt],`unknown property "${xt}"`));return et}({sourceName:c,value:i,style:a.style,styleSpec:p,validateSpec:b}),E;case"geojson":if(E=Ki({key:c,value:i,valueSpec:p.source_geojson,style:g,styleSpec:p,validateSpec:b,objectElementValidators:hm}),i.cluster)for(const L in i.clusterProperties){const[A,D]=i.clusterProperties[L],N=typeof A=="string"?[A,["accumulated"],["get",L]]:A;E.push(...Ba({key:`${c}.${L}.map`,value:D,validateSpec:b,expressionContext:"cluster-map"})),E.push(...Ba({key:`${c}.${L}.reduce`,value:N,validateSpec:b,expressionContext:"cluster-reduce"}))}return E;case"video":return Ki({key:c,value:i,valueSpec:p.source_video,style:g,validateSpec:b,styleSpec:p});case"image":return Ki({key:c,value:i,valueSpec:p.source_image,style:g,validateSpec:b,styleSpec:p});case"canvas":return[new ee(c,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Va({key:`${c}.type`,value:i.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:g,validateSpec:b,styleSpec:p})}}function pm(a){const i=a.value,c=a.styleSpec,p=c.light,g=a.style;let b=[];const x=Sn(i);if(i===void 0)return b;if(x!=="object")return b=b.concat([new ee("light",i,`object expected, ${x} found`)]),b;for(const E in i){const L=E.match(/^(.*)-transition$/);b=b.concat(L&&p[L[1]]&&p[L[1]].transition?a.validateSpec({key:E,value:i[E],valueSpec:c.transition,validateSpec:a.validateSpec,style:g,styleSpec:c}):p[E]?a.validateSpec({key:E,value:i[E],valueSpec:p[E],validateSpec:a.validateSpec,style:g,styleSpec:c}):[new ee(E,i[E],`unknown property "${E}"`)])}return b}function dm(a){const i=a.value,c=a.styleSpec,p=c.sky,g=a.style,b=Sn(i);if(i===void 0)return[];if(b!=="object")return[new ee("sky",i,`object expected, ${b} found`)];let x=[];for(const E in i)x=x.concat(p[E]?Os({key:E,value:i[E],valueSpec:p[E],style:g,styleSpec:c}):[new ee(E,i[E],`unknown property "${E}"`)]);return x}function nc(a){const i=a.value,c=a.styleSpec,p=c.terrain,g=a.style;let b=[];const x=Sn(i);if(i===void 0)return b;if(x!=="object")return b=b.concat([new ee("terrain",i,`object expected, ${x} found`)]),b;for(const E in i)b=b.concat(p[E]?a.validateSpec({key:E,value:i[E],valueSpec:p[E],validateSpec:a.validateSpec,style:g,styleSpec:c}):[new ee(E,i[E],`unknown property "${E}"`)]);return b}function rc(a){let i=[];const c=a.value,p=a.key;if(Array.isArray(c)){const g=[],b=[];for(const x in c)c[x].id&&g.includes(c[x].id)&&i.push(new ee(p,c,`all the sprites' ids must be unique, but ${c[x].id} is duplicated`)),g.push(c[x].id),c[x].url&&b.includes(c[x].url)&&i.push(new ee(p,c,`all the sprites' URLs must be unique, but ${c[x].url} is duplicated`)),b.push(c[x].url),i=i.concat(Ki({key:`${p}[${x}]`,value:c[x],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:a.validateSpec}));return i}return wl({key:p,value:c})}const uo={"*":()=>[],array:ep,boolean:function(a){const i=a.value,c=a.key,p=Sn(i);return p!=="boolean"?[new ee(c,i,`boolean expected, ${p} found`)]:[]},number:gh,color:function(a){const i=a.key,c=a.value,p=Sn(c);return p!=="string"?[new ee(i,c,`color expected, ${p} found`)]:zn.parse(String(c))?[]:[new ee(i,c,`color expected, "${c}" found`)]},constants:um,enum:Va,filter:iu,function:cm,layer:ec,object:Ki,source:fm,light:pm,sky:dm,terrain:nc,string:wl,formatted:function(a){return wl(a).length===0?[]:Ba(a)},resolvedImage:function(a){return wl(a).length===0?[]:Ba(a)},padding:function(a){const i=a.key,c=a.value;if(Sn(c)==="array"){if(c.length<1||c.length>4)return[new ee(i,c,`padding requires 1 to 4 values; ${c.length} values found`)];const p={type:"number"};let g=[];for(let b=0;b[]}})),a.constants&&(c=c.concat(um({key:"constants",value:a.constants,style:a,styleSpec:i,validateSpec:Os}))),ou(c)}function zs(a){return function(i){return a({...i,validateSpec:Os})}}function ou(a){return[].concat(a).sort((i,c)=>i.line-c.line)}function fs(a){return function(...i){return ou(a.apply(this,i))}}hs.source=fs(zs(fm)),hs.sprite=fs(zs(rc)),hs.glyphs=fs(zs(op)),hs.light=fs(zs(pm)),hs.sky=fs(zs(dm)),hs.terrain=fs(zs(nc)),hs.layer=fs(zs(ec)),hs.filter=fs(zs(iu)),hs.paintProperty=fs(zs(rp)),hs.layoutProperty=fs(zs(ip));const Sl=hs,zy=Sl.light,sp=Sl.paintProperty,Fy=Sl.layoutProperty;function su(a,i){let c=!1;if(i&&i.length)for(const p of i)a.fire(new be(new Error(p.message))),c=!0;return c}class ic{constructor(i,c,p){const g=this.cells=[];if(i instanceof ArrayBuffer){this.arrayBuffer=i;const x=new Int32Array(this.arrayBuffer);i=x[0],this.d=(c=x[1])+2*(p=x[2]);for(let L=0;L=N[H+0]&&g>=N[H+1])?(E[W]=!0,x.push(D[W])):E[W]=!1}}}}_forEachCell(i,c,p,g,b,x,E,L){const A=this._convertToCellCoord(i),D=this._convertToCellCoord(c),N=this._convertToCellCoord(p),U=this._convertToCellCoord(g);for(let W=A;W<=N;W++)for(let H=D;H<=U;H++){const et=this.d*H+W;if((!L||L(this._convertFromCellCoord(W),this._convertFromCellCoord(H),this._convertFromCellCoord(W+1),this._convertFromCellCoord(H+1)))&&b.call(this,i,c,p,g,et,x,E,L))return}}_convertFromCellCoord(i){return(i-this.padding)/this.scale}_convertToCellCoord(i){return Math.max(0,Math.min(this.d-1,Math.floor(i*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const i=this.cells,c=3+this.cells.length+1+1;let p=0;for(let x=0;x=0)continue;const x=a[b];g[b]=Fs[p].shallow.indexOf(b)>=0?x:au(x,i)}a instanceof Error&&(g.message=a.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return p!=="Object"&&(g.$name=p),g}throw new Error("can't serialize object of type "+typeof a)}function lu(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||_h(a)||Ne(a)||ArrayBuffer.isView(a)||a instanceof ImageData)return a;if(Array.isArray(a))return a.map(lu);if(typeof a=="object"){const i=a.$name||"Object";if(!Fs[i])throw new Error(`can't deserialize unregistered class ${i}`);const{klass:c}=Fs[i];if(!c)throw new Error(`can't deserialize unregistered class ${i}`);if(c.deserialize)return c.deserialize(a);const p=Object.create(c.prototype);for(const g of Object.keys(a)){if(g==="$name")continue;const b=a[g];p[g]=Fs[i].shallow.indexOf(g)>=0?b:lu(b)}return p}throw new Error("can't deserialize object of type "+typeof a)}class mm{constructor(){this.first=!0}update(i,c){const p=Math.floor(i);return this.first?(this.first=!1,this.lastIntegerZoom=p,this.lastIntegerZoomTime=0,this.lastZoom=i,this.lastFloorZoom=p,!0):(this.lastFloorZoom>p?(this.lastIntegerZoom=p+1,this.lastIntegerZoomTime=c):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 uu(a){for(const i of a)if(vh(i.charCodeAt(0)))return!0;return!1}function gm(a){for(const i of a)if(!ym(i.charCodeAt(0)))return!1;return!0}function ym(a){return!(de.Arabic(a)||de["Arabic Supplement"](a)||de["Arabic Extended-A"](a)||de["Arabic Presentation Forms-A"](a)||de["Arabic Presentation Forms-B"](a))}function vh(a){return!(a!==746&&a!==747&&(a<4352||!(de["Bopomofo Extended"](a)||de.Bopomofo(a)||de["CJK Compatibility Forms"](a)&&!(a>=65097&&a<=65103)||de["CJK Compatibility Ideographs"](a)||de["CJK Compatibility"](a)||de["CJK Radicals Supplement"](a)||de["CJK Strokes"](a)||!(!de["CJK Symbols and Punctuation"](a)||a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||de["CJK Unified Ideographs Extension A"](a)||de["CJK Unified Ideographs"](a)||de["Enclosed CJK Letters and Months"](a)||de["Hangul Compatibility Jamo"](a)||de["Hangul Jamo Extended-A"](a)||de["Hangul Jamo Extended-B"](a)||de["Hangul Jamo"](a)||de["Hangul Syllables"](a)||de.Hiragana(a)||de["Ideographic Description Characters"](a)||de.Kanbun(a)||de["Kangxi Radicals"](a)||de["Katakana Phonetic Extensions"](a)||de.Katakana(a)&&a!==12540||!(!de["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)||!(!de["Small Form Variants"](a)||a>=65112&&a<=65118||a>=65123&&a<=65126)||de["Unified Canadian Aboriginal Syllabics"](a)||de["Unified Canadian Aboriginal Syllabics Extended"](a)||de["Vertical Forms"](a)||de["Yijing Hexagram Symbols"](a)||de["Yi Syllables"](a)||de["Yi Radicals"](a))))}function ap(a){return!(vh(a)||function(i){return!!(de["Latin-1 Supplement"](i)&&(i===167||i===169||i===174||i===177||i===188||i===189||i===190||i===215||i===247)||de["General Punctuation"](i)&&(i===8214||i===8224||i===8225||i===8240||i===8241||i===8251||i===8252||i===8258||i===8263||i===8264||i===8265||i===8273)||de["Letterlike Symbols"](i)||de["Number Forms"](i)||de["Miscellaneous Technical"](i)&&(i>=8960&&i<=8967||i>=8972&&i<=8991||i>=8996&&i<=9e3||i===9003||i>=9085&&i<=9114||i>=9150&&i<=9165||i===9167||i>=9169&&i<=9179||i>=9186&&i<=9215)||de["Control Pictures"](i)&&i!==9251||de["Optical Character Recognition"](i)||de["Enclosed Alphanumerics"](i)||de["Geometric Shapes"](i)||de["Miscellaneous Symbols"](i)&&!(i>=9754&&i<=9759)||de["Miscellaneous Symbols and Arrows"](i)&&(i>=11026&&i<=11055||i>=11088&&i<=11097||i>=11192&&i<=11243)||de["CJK Symbols and Punctuation"](i)||de.Katakana(i)||de["Private Use Area"](i)||de["CJK Compatibility Forms"](i)||de["Small Form Variants"](i)||de["Halfwidth and Fullwidth Forms"](i)||i===8734||i===8756||i===8757||i>=9984&&i<=10087||i>=10102&&i<=10131||i===65532||i===65533)}(a))}function bh(a){return a>=1424&&a<=2303||de["Arabic Presentation Forms-A"](a)||de["Arabic Presentation Forms-B"](a)}function _m(a,i){return!(!i&&bh(a)||a>=2304&&a<=3583||a>=3840&&a<=4255||de.Khmer(a))}function By(a){for(const i of a)if(bh(i.charCodeAt(0)))return!0;return!1}const Ua=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}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.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 nr{constructor(i,c){this.zoom=i,c?(this.now=c.now,this.fadeDuration=c.fadeDuration,this.zoomHistory=c.zoomHistory,this.transition=c.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new mm,this.transition={})}isSupportedScript(i){return function(c,p){for(const g of c)if(!_m(g.charCodeAt(0),p))return!1;return!0}(i,Ua.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const i=this.zoom,c=i-Math.floor(i),p=this.crossFadingFactor();return i>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:c+(1-c)*p}:{fromScale:.5,toScale:1,t:1-(1-p)*c}}}class oc{constructor(i,c){this.property=i,this.value=c,this.expression=function(p,g){if(ah(p))return new uh(p,g);if(Zn(p)){const b=im(p,g);if(b.result==="error")throw new Error(b.value.map(x=>`${x.key}: ${x.message}`).join(", "));return b.value}{let b=p;return g.type==="color"&&typeof p=="string"?b=zn.parse(p):g.type!=="padding"||typeof p!="number"&&!Array.isArray(p)?g.type==="variableAnchorOffsetCollection"&&Array.isArray(p)&&(b=Xo.parse(p)):b=lo.parse(p),{kind:"constant",evaluate:()=>b}}}(c===void 0?i.specification.default:c,i.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(i,c,p){return this.property.possiblyEvaluate(this,i,c,p)}}class xh{constructor(i){this.property=i,this.value=new oc(i,void 0)}transitioned(i,c){return new vm(this.property,this.value,c,ft({},i.transition,this.transition),i.now)}untransitioned(){return new vm(this.property,this.value,null,{},0)}}class lp{constructor(i){this._properties=i,this._values=Object.create(i.defaultTransitionablePropertyValues)}getValue(i){return $(this._values[i].value.value)}setValue(i,c){Object.prototype.hasOwnProperty.call(this._values,i)||(this._values[i]=new xh(this._values[i].property)),this._values[i].value=new oc(this._values[i].property,c===null?void 0:$(c))}getTransition(i){return $(this._values[i].transition)}setTransition(i,c){Object.prototype.hasOwnProperty.call(this._values,i)||(this._values[i]=new xh(this._values[i].property)),this._values[i].transition=$(c)||void 0}serialize(){const i={};for(const c of Object.keys(this._values)){const p=this.getValue(c);p!==void 0&&(i[c]=p);const g=this.getTransition(c);g!==void 0&&(i[`${c}-transition`]=g)}return i}transitioned(i,c){const p=new bm(this._properties);for(const g of Object.keys(this._values))p._values[g]=this._values[g].transitioned(i,c._values[g]);return p}untransitioned(){const i=new bm(this._properties);for(const c of Object.keys(this._values))i._values[c]=this._values[c].untransitioned();return i}}class vm{constructor(i,c,p,g,b){this.property=i,this.value=c,this.begin=b+g.delay||0,this.end=this.begin+g.duration||0,i.specification.transition&&(g.delay||g.duration)&&(this.prior=p)}possiblyEvaluate(i,c,p){const g=i.now||0,b=this.value.possiblyEvaluate(i,c,p),x=this.prior;if(x){if(g>this.end)return this.prior=null,b;if(this.value.isDataDriven())return this.prior=null,b;if(g=1)return 1;const A=L*L,D=A*L;return 4*(L<.5?D:3*(L-A)+D-.75)}(E))}}return b}}class bm{constructor(i){this._properties=i,this._values=Object.create(i.defaultTransitioningPropertyValues)}possiblyEvaluate(i,c,p){const g=new sc(this._properties);for(const b of Object.keys(this._values))g._values[b]=this._values[b].possiblyEvaluate(i,c,p);return g}hasTransition(){for(const i of Object.keys(this._values))if(this._values[i].prior)return!0;return!1}}class xm{constructor(i){this._properties=i,this._values=Object.create(i.defaultPropertyValues)}hasValue(i){return this._values[i].value!==void 0}getValue(i){return $(this._values[i].value)}setValue(i,c){this._values[i]=new oc(this._values[i].property,c===null?void 0:$(c))}serialize(){const i={};for(const c of Object.keys(this._values)){const p=this.getValue(c);p!==void 0&&(i[c]=p)}return i}possiblyEvaluate(i,c,p){const g=new sc(this._properties);for(const b of Object.keys(this._values))g._values[b]=this._values[b].possiblyEvaluate(i,c,p);return g}}class ps{constructor(i,c,p){this.property=i,this.value=c,this.parameters=p}isConstant(){return this.value.kind==="constant"}constantOr(i){return this.value.kind==="constant"?this.value.value:i}evaluate(i,c,p,g){return this.property.evaluate(this.value,this.parameters,i,c,p,g)}}class sc{constructor(i){this._properties=i,this._values=Object.create(i.defaultPossiblyEvaluatedValues)}get(i){return this._values[i]}}class Ie{constructor(i){this.specification=i}possiblyEvaluate(i,c){if(i.isDataDriven())throw new Error("Value should not be data driven");return i.expression.evaluate(c)}interpolate(i,c,p){const g=Yi[this.specification.type];return g?g(i,c,p):i}}class Re{constructor(i,c){this.specification=i,this.overrides=c}possiblyEvaluate(i,c,p,g){return new ps(this,i.expression.kind==="constant"||i.expression.kind==="camera"?{kind:"constant",value:i.expression.evaluate(c,null,{},p,g)}:i.expression,c)}interpolate(i,c,p){if(i.value.kind!=="constant"||c.value.kind!=="constant")return i;if(i.value.value===void 0||c.value.value===void 0)return new ps(this,{kind:"constant",value:void 0},i.parameters);const g=Yi[this.specification.type];if(g){const b=g(i.value.value,c.value.value,p);return new ps(this,{kind:"constant",value:b},i.parameters)}return i}evaluate(i,c,p,g,b,x){return i.kind==="constant"?i.value:i.evaluate(c,p,g,b,x)}}class wh extends Re{possiblyEvaluate(i,c,p,g){if(i.value===void 0)return new ps(this,{kind:"constant",value:void 0},c);if(i.expression.kind==="constant"){const b=i.expression.evaluate(c,null,{},p,g),x=i.property.specification.type==="resolvedImage"&&typeof b!="string"?b.name:b,E=this._calculate(x,x,x,c);return new ps(this,{kind:"constant",value:E},c)}if(i.expression.kind==="camera"){const b=this._calculate(i.expression.evaluate({zoom:c.zoom-1}),i.expression.evaluate({zoom:c.zoom}),i.expression.evaluate({zoom:c.zoom+1}),c);return new ps(this,{kind:"constant",value:b},c)}return new ps(this,i.expression,c)}evaluate(i,c,p,g,b,x){if(i.kind==="source"){const E=i.evaluate(c,p,g,b,x);return this._calculate(E,E,E,c)}return i.kind==="composite"?this._calculate(i.evaluate({zoom:Math.floor(c.zoom)-1},p,g),i.evaluate({zoom:Math.floor(c.zoom)},p,g),i.evaluate({zoom:Math.floor(c.zoom)+1},p,g),c):i.value}_calculate(i,c,p,g){return g.zoom>g.zoomHistory.lastIntegerZoom?{from:i,to:c}:{from:p,to:c}}interpolate(i){return i}}class ac{constructor(i){this.specification=i}possiblyEvaluate(i,c,p,g){if(i.value!==void 0){if(i.expression.kind==="constant"){const b=i.expression.evaluate(c,null,{},p,g);return this._calculate(b,b,b,c)}return this._calculate(i.expression.evaluate(new nr(Math.floor(c.zoom-1),c)),i.expression.evaluate(new nr(Math.floor(c.zoom),c)),i.expression.evaluate(new nr(Math.floor(c.zoom+1),c)),c)}}_calculate(i,c,p,g){return g.zoom>g.zoomHistory.lastIntegerZoom?{from:i,to:c}:{from:p,to:c}}interpolate(i){return i}}class up{constructor(i){this.specification=i}possiblyEvaluate(i,c,p,g){return!!i.expression.evaluate(c,null,{},p,g)}interpolate(){return!1}}class co{constructor(i){this.properties=i,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const c in i){const p=i[c];p.specification.overridable&&this.overridableProperties.push(c);const g=this.defaultPropertyValues[c]=new oc(p,void 0),b=this.defaultTransitionablePropertyValues[c]=new xh(p);this.defaultTransitioningPropertyValues[c]=b.untransitioned(),this.defaultPossiblyEvaluatedValues[c]=g.possiblyEvaluate({})}}}_e("DataDrivenProperty",Re),_e("DataConstantProperty",Ie),_e("CrossFadedDataDrivenProperty",wh),_e("CrossFadedProperty",ac),_e("ColorRampProperty",up);const cp="-transition";class ds extends An{constructor(i,c){if(super(),this.id=i.id,this.type=i.type,this._featureFilter={filter:()=>!0,needGeometry:!1},i.type!=="custom"&&(this.metadata=i.metadata,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,i.type!=="background"&&(this.source=i.source,this.sourceLayer=i["source-layer"],this.filter=i.filter),c.layout&&(this._unevaluatedLayout=new xm(c.layout)),c.paint)){this._transitionablePaint=new lp(c.paint);for(const p in i.paint)this.setPaintProperty(p,i.paint[p],{validate:!1});for(const p in i.layout)this.setLayoutProperty(p,i.layout[p],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new sc(c.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(i){return i==="visibility"?this.visibility:this._unevaluatedLayout.getValue(i)}setLayoutProperty(i,c,p={}){c!=null&&this._validate(Fy,`layers.${this.id}.layout.${i}`,i,c,p)||(i!=="visibility"?this._unevaluatedLayout.setValue(i,c):this.visibility=c)}getPaintProperty(i){return i.endsWith(cp)?this._transitionablePaint.getTransition(i.slice(0,-11)):this._transitionablePaint.getValue(i)}setPaintProperty(i,c,p={}){if(c!=null&&this._validate(sp,`layers.${this.id}.paint.${i}`,i,c,p))return!1;if(i.endsWith(cp))return this._transitionablePaint.setTransition(i.slice(0,-11),c||void 0),!1;{const g=this._transitionablePaint._values[i],b=g.property.specification["property-type"]==="cross-faded-data-driven",x=g.value.isDataDriven(),E=g.value;this._transitionablePaint.setValue(i,c),this._handleSpecialPaintPropertyUpdate(i);const L=this._transitionablePaint._values[i].value;return L.isDataDriven()||x||b||this._handleOverridablePaintPropertyUpdate(i,E,L)}}_handleSpecialPaintPropertyUpdate(i){}_handleOverridablePaintPropertyUpdate(i,c,p){return!1}isHidden(i){return!!(this.minzoom&&i=this.maxzoom)||this.visibility==="none"}updateTransitions(i){this._transitioningPaint=this._transitionablePaint.transitioned(i,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(i,c){i.getCrossfadeParameters&&(this._crossfadeParameters=i.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(i,void 0,c)),this.paint=this._transitioningPaint.possiblyEvaluate(i,void 0,c)}serialize(){const i={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&&(i.layout=i.layout||{},i.layout.visibility=this.visibility),Pt(i,(c,p)=>!(c===void 0||p==="layout"&&!Object.keys(c).length||p==="paint"&&!Object.keys(c).length))}_validate(i,c,p,g,b={}){return(!b||b.validate!==!1)&&su(this,i.call(Sl,{key:c,layerType:this.type,objectKey:p,value:g,styleSpec:Mt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const i in this.paint._values){const c=this.paint.get(i);if(c instanceof ps&&ru(c.property.specification)&&(c.value.kind==="source"||c.value.kind==="composite")&&c.value.isStateDependent)return!0}return!1}}const wm={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class lc{constructor(i,c){this._structArray=i,this._pos1=c*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class wr{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(i,c){return i._trim(),c&&(i.isTransferred=!0,c.push(i.arrayBuffer)),{length:i.length,arrayBuffer:i.arrayBuffer}}static deserialize(i){const c=Object.create(this.prototype);return c.arrayBuffer=i.arrayBuffer,c.length=i.length,c.capacity=i.arrayBuffer.byteLength/c.bytesPerElement,c._refreshViews(),c}_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(i){this.reserve(i),this.length=i}reserve(i){if(i>this.capacity){this.capacity=Math.max(i,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const c=this.uint8;this._refreshViews(),c&&this.uint8.set(c)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function zr(a,i=1){let c=0,p=0;return{members:a.map(g=>{const b=wm[g.type].BYTES_PER_ELEMENT,x=c=Sm(c,Math.max(i,b)),E=g.components||1;return p=Math.max(p,b),c+=b*E,{name:g.name,type:g.type,components:E,offset:x}}),size:Sm(c,Math.max(p,i)),alignment:i}}function Sm(a,i){return Math.ceil(a/i)*i}class uc extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c){const p=this.length;return this.resize(p+1),this.emplace(p,i,c)}emplace(i,c,p){const g=2*i;return this.int16[g+0]=c,this.int16[g+1]=p,i}}uc.prototype.bytesPerElement=4,_e("StructArrayLayout2i4",uc);class pa extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,p){const g=this.length;return this.resize(g+1),this.emplace(g,i,c,p)}emplace(i,c,p,g){const b=3*i;return this.int16[b+0]=c,this.int16[b+1]=p,this.int16[b+2]=g,i}}pa.prototype.bytesPerElement=6,_e("StructArrayLayout3i6",pa);class hp extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,p,g){const b=this.length;return this.resize(b+1),this.emplace(b,i,c,p,g)}emplace(i,c,p,g,b){const x=4*i;return this.int16[x+0]=c,this.int16[x+1]=p,this.int16[x+2]=g,this.int16[x+3]=b,i}}hp.prototype.bytesPerElement=8,_e("StructArrayLayout4i8",hp);class fp extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,p,g,b,x){const E=this.length;return this.resize(E+1),this.emplace(E,i,c,p,g,b,x)}emplace(i,c,p,g,b,x,E){const L=6*i;return this.int16[L+0]=c,this.int16[L+1]=p,this.int16[L+2]=g,this.int16[L+3]=b,this.int16[L+4]=x,this.int16[L+5]=E,i}}fp.prototype.bytesPerElement=12,_e("StructArrayLayout2i4i12",fp);class pp extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,p,g,b,x){const E=this.length;return this.resize(E+1),this.emplace(E,i,c,p,g,b,x)}emplace(i,c,p,g,b,x,E){const L=4*i,A=8*i;return this.int16[L+0]=c,this.int16[L+1]=p,this.uint8[A+4]=g,this.uint8[A+5]=b,this.uint8[A+6]=x,this.uint8[A+7]=E,i}}pp.prototype.bytesPerElement=8,_e("StructArrayLayout2i4ub8",pp);class cc extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,c){const p=this.length;return this.resize(p+1),this.emplace(p,i,c)}emplace(i,c,p){const g=2*i;return this.float32[g+0]=c,this.float32[g+1]=p,i}}cc.prototype.bytesPerElement=8,_e("StructArrayLayout2f8",cc);class Sh extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,c,p,g,b,x,E,L,A,D){const N=this.length;return this.resize(N+1),this.emplace(N,i,c,p,g,b,x,E,L,A,D)}emplace(i,c,p,g,b,x,E,L,A,D,N){const U=10*i;return this.uint16[U+0]=c,this.uint16[U+1]=p,this.uint16[U+2]=g,this.uint16[U+3]=b,this.uint16[U+4]=x,this.uint16[U+5]=E,this.uint16[U+6]=L,this.uint16[U+7]=A,this.uint16[U+8]=D,this.uint16[U+9]=N,i}}Sh.prototype.bytesPerElement=20,_e("StructArrayLayout10ui20",Sh);class dp extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,c,p,g,b,x,E,L,A,D,N,U){const W=this.length;return this.resize(W+1),this.emplace(W,i,c,p,g,b,x,E,L,A,D,N,U)}emplace(i,c,p,g,b,x,E,L,A,D,N,U,W){const H=12*i;return this.int16[H+0]=c,this.int16[H+1]=p,this.int16[H+2]=g,this.int16[H+3]=b,this.uint16[H+4]=x,this.uint16[H+5]=E,this.uint16[H+6]=L,this.uint16[H+7]=A,this.int16[H+8]=D,this.int16[H+9]=N,this.int16[H+10]=U,this.int16[H+11]=W,i}}dp.prototype.bytesPerElement=24,_e("StructArrayLayout4i4ui4i24",dp);class mp extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,c,p){const g=this.length;return this.resize(g+1),this.emplace(g,i,c,p)}emplace(i,c,p,g){const b=3*i;return this.float32[b+0]=c,this.float32[b+1]=p,this.float32[b+2]=g,i}}mp.prototype.bytesPerElement=12,_e("StructArrayLayout3f12",mp);class da extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(i){const c=this.length;return this.resize(c+1),this.emplace(c,i)}emplace(i,c){return this.uint32[1*i+0]=c,i}}da.prototype.bytesPerElement=4,_e("StructArrayLayout1ul4",da);class Eh extends wr{_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(i,c,p,g,b,x,E,L,A){const D=this.length;return this.resize(D+1),this.emplace(D,i,c,p,g,b,x,E,L,A)}emplace(i,c,p,g,b,x,E,L,A,D){const N=10*i,U=5*i;return this.int16[N+0]=c,this.int16[N+1]=p,this.int16[N+2]=g,this.int16[N+3]=b,this.int16[N+4]=x,this.int16[N+5]=E,this.uint32[U+3]=L,this.uint16[N+8]=A,this.uint16[N+9]=D,i}}Eh.prototype.bytesPerElement=20,_e("StructArrayLayout6i1ul2ui20",Eh);class hc extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,p,g,b,x){const E=this.length;return this.resize(E+1),this.emplace(E,i,c,p,g,b,x)}emplace(i,c,p,g,b,x,E){const L=6*i;return this.int16[L+0]=c,this.int16[L+1]=p,this.int16[L+2]=g,this.int16[L+3]=b,this.int16[L+4]=x,this.int16[L+5]=E,i}}hc.prototype.bytesPerElement=12,_e("StructArrayLayout2i2i2i12",hc);class Ih extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,p,g,b){const x=this.length;return this.resize(x+1),this.emplace(x,i,c,p,g,b)}emplace(i,c,p,g,b,x){const E=4*i,L=8*i;return this.float32[E+0]=c,this.float32[E+1]=p,this.float32[E+2]=g,this.int16[L+6]=b,this.int16[L+7]=x,i}}Ih.prototype.bytesPerElement=16,_e("StructArrayLayout2f1f2i16",Ih);class fc extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,c,p,g){const b=this.length;return this.resize(b+1),this.emplace(b,i,c,p,g)}emplace(i,c,p,g,b){const x=12*i,E=3*i;return this.uint8[x+0]=c,this.uint8[x+1]=p,this.float32[E+1]=g,this.float32[E+2]=b,i}}fc.prototype.bytesPerElement=12,_e("StructArrayLayout2ub2f12",fc);class Ch extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,c,p){const g=this.length;return this.resize(g+1),this.emplace(g,i,c,p)}emplace(i,c,p,g){const b=3*i;return this.uint16[b+0]=c,this.uint16[b+1]=p,this.uint16[b+2]=g,i}}Ch.prototype.bytesPerElement=6,_e("StructArrayLayout3ui6",Ch);class cu extends wr{_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(i,c,p,g,b,x,E,L,A,D,N,U,W,H,et,st,pt){const It=this.length;return this.resize(It+1),this.emplace(It,i,c,p,g,b,x,E,L,A,D,N,U,W,H,et,st,pt)}emplace(i,c,p,g,b,x,E,L,A,D,N,U,W,H,et,st,pt,It){const gt=24*i,xt=12*i,Xt=48*i;return this.int16[gt+0]=c,this.int16[gt+1]=p,this.uint16[gt+2]=g,this.uint16[gt+3]=b,this.uint32[xt+2]=x,this.uint32[xt+3]=E,this.uint32[xt+4]=L,this.uint16[gt+10]=A,this.uint16[gt+11]=D,this.uint16[gt+12]=N,this.float32[xt+7]=U,this.float32[xt+8]=W,this.uint8[Xt+36]=H,this.uint8[Xt+37]=et,this.uint8[Xt+38]=st,this.uint32[xt+10]=pt,this.int16[gt+22]=It,i}}cu.prototype.bytesPerElement=48,_e("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",cu);class El extends wr{_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(i,c,p,g,b,x,E,L,A,D,N,U,W,H,et,st,pt,It,gt,xt,Xt,Yt,ge,xe,me,he,oe,ve){const ue=this.length;return this.resize(ue+1),this.emplace(ue,i,c,p,g,b,x,E,L,A,D,N,U,W,H,et,st,pt,It,gt,xt,Xt,Yt,ge,xe,me,he,oe,ve)}emplace(i,c,p,g,b,x,E,L,A,D,N,U,W,H,et,st,pt,It,gt,xt,Xt,Yt,ge,xe,me,he,oe,ve,ue){const te=32*i,De=16*i;return this.int16[te+0]=c,this.int16[te+1]=p,this.int16[te+2]=g,this.int16[te+3]=b,this.int16[te+4]=x,this.int16[te+5]=E,this.int16[te+6]=L,this.int16[te+7]=A,this.uint16[te+8]=D,this.uint16[te+9]=N,this.uint16[te+10]=U,this.uint16[te+11]=W,this.uint16[te+12]=H,this.uint16[te+13]=et,this.uint16[te+14]=st,this.uint16[te+15]=pt,this.uint16[te+16]=It,this.uint16[te+17]=gt,this.uint16[te+18]=xt,this.uint16[te+19]=Xt,this.uint16[te+20]=Yt,this.uint16[te+21]=ge,this.uint16[te+22]=xe,this.uint32[De+12]=me,this.float32[De+13]=he,this.float32[De+14]=oe,this.uint16[te+30]=ve,this.uint16[te+31]=ue,i}}El.prototype.bytesPerElement=64,_e("StructArrayLayout8i15ui1ul2f2ui64",El);class Th extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i){const c=this.length;return this.resize(c+1),this.emplace(c,i)}emplace(i,c){return this.float32[1*i+0]=c,i}}Th.prototype.bytesPerElement=4,_e("StructArrayLayout1f4",Th);class Lh extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,c,p){const g=this.length;return this.resize(g+1),this.emplace(g,i,c,p)}emplace(i,c,p,g){const b=3*i;return this.uint16[6*i+0]=c,this.float32[b+1]=p,this.float32[b+2]=g,i}}Lh.prototype.bytesPerElement=12,_e("StructArrayLayout1ui2f12",Lh);class Il extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,c,p){const g=this.length;return this.resize(g+1),this.emplace(g,i,c,p)}emplace(i,c,p,g){const b=4*i;return this.uint32[2*i+0]=c,this.uint16[b+2]=p,this.uint16[b+3]=g,i}}Il.prototype.bytesPerElement=8,_e("StructArrayLayout1ul2ui8",Il);class gp extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,c){const p=this.length;return this.resize(p+1),this.emplace(p,i,c)}emplace(i,c,p){const g=2*i;return this.uint16[g+0]=c,this.uint16[g+1]=p,i}}gp.prototype.bytesPerElement=4,_e("StructArrayLayout2ui4",gp);class yp extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i){const c=this.length;return this.resize(c+1),this.emplace(c,i)}emplace(i,c){return this.uint16[1*i+0]=c,i}}yp.prototype.bytesPerElement=2,_e("StructArrayLayout1ui2",yp);class Ph extends wr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,c,p,g){const b=this.length;return this.resize(b+1),this.emplace(b,i,c,p,g)}emplace(i,c,p,g,b){const x=4*i;return this.float32[x+0]=c,this.float32[x+1]=p,this.float32[x+2]=g,this.float32[x+3]=b,i}}Ph.prototype.bytesPerElement=16,_e("StructArrayLayout4f16",Ph);class Em extends lc{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 C(this.anchorPointX,this.anchorPointY)}}Em.prototype.size=20;class _ extends Eh{get(i){return new Em(this,i)}}_e("CollisionBoxArray",_);class s extends lc{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(i){this._structArray.uint8[this._pos1+37]=i}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(i){this._structArray.uint8[this._pos1+38]=i}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(i){this._structArray.uint32[this._pos4+10]=i}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}s.prototype.size=48;class f extends cu{get(i){return new s(this,i)}}_e("PlacedSymbolArray",f);class d extends lc{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(i){this._structArray.uint32[this._pos4+12]=i}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]}}d.prototype.size=64;class m extends El{get(i){return new d(this,i)}}_e("SymbolInstanceArray",m);class v extends Th{getoffsetX(i){return this.float32[1*i+0]}}_e("GlyphOffsetArray",v);class I extends pa{getx(i){return this.int16[3*i+0]}gety(i){return this.int16[3*i+1]}gettileUnitDistanceFromAnchor(i){return this.int16[3*i+2]}}_e("SymbolLineVertexArray",I);class T extends lc{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]}}T.prototype.size=12;class M extends Lh{get(i){return new T(this,i)}}_e("TextAnchorOffsetArray",M);class k extends lc{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]}}k.prototype.size=8;class z extends Il{get(i){return new k(this,i)}}_e("FeatureIndexArray",z);class B extends uc{}class Z extends uc{}class it extends uc{}class rt extends fp{}class lt extends pp{}class tt extends cc{}class yt extends Sh{}class kt extends dp{}class ut extends mp{}class wt extends da{}class Dt extends hc{}class Ot extends fc{}class Bt extends Ch{}class Qt extends gp{}const Jt=zr([{name:"a_pos",components:2,type:"Int16"}],4),{members:ie}=Jt;class ae{constructor(i=[]){this.segments=i}prepareSegment(i,c,p,g){let b=this.segments[this.segments.length-1];return i>ae.MAX_VERTEX_ARRAY_LENGTH&&$t(`Max vertices per segment is ${ae.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${i}`),(!b||b.vertexLength+i>ae.MAX_VERTEX_ARRAY_LENGTH||b.sortKey!==g)&&(b={vertexOffset:c.length,primitiveOffset:p.length,vertexLength:0,primitiveLength:0},g!==void 0&&(b.sortKey=g),this.segments.push(b)),b}get(){return this.segments}destroy(){for(const i of this.segments)for(const c in i.vaos)i.vaos[c].destroy()}static simpleSegment(i,c,p,g){return new ae([{vertexOffset:i,primitiveOffset:c,vertexLength:p,primitiveLength:g,vaos:{},sortKey:0}])}}function Je(a,i){return 256*(a=ot(Math.floor(a),0,255))+ot(Math.floor(i),0,255)}ae.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,_e("SegmentVector",ae);const le=zr([{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 Oe={exports:{}},Qe={exports:{}};Qe.exports=function(a,i){var c,p,g,b,x,E,L,A;for(p=a.length-(c=3&a.length),g=i,x=3432918353,E=461845907,A=0;A>>16)*x&65535)<<16)&4294967295)<<15|L>>>17))*E+(((L>>>16)*E&65535)<<16)&4294967295)<<13|g>>>19))+((5*(g>>>16)&65535)<<16)&4294967295))+((58964+(b>>>16)&65535)<<16);switch(L=0,c){case 3:L^=(255&a.charCodeAt(A+2))<<16;case 2:L^=(255&a.charCodeAt(A+1))<<8;case 1:g^=L=(65535&(L=(L=(65535&(L^=255&a.charCodeAt(A)))*x+(((L>>>16)*x&65535)<<16)&4294967295)<<15|L>>>17))*E+(((L>>>16)*E&65535)<<16)&4294967295}return g^=a.length,g=2246822507*(65535&(g^=g>>>16))+((2246822507*(g>>>16)&65535)<<16)&4294967295,g=3266489909*(65535&(g^=g>>>13))+((3266489909*(g>>>16)&65535)<<16)&4294967295,(g^=g>>>16)>>>0};var bn=Qe.exports,Ue={exports:{}};Ue.exports=function(a,i){for(var c,p=a.length,g=i^p,b=0;p>=4;)c=1540483477*(65535&(c=255&a.charCodeAt(b)|(255&a.charCodeAt(++b))<<8|(255&a.charCodeAt(++b))<<16|(255&a.charCodeAt(++b))<<24))+((1540483477*(c>>>16)&65535)<<16),g=1540483477*(65535&g)+((1540483477*(g>>>16)&65535)<<16)^(c=1540483477*(65535&(c^=c>>>24))+((1540483477*(c>>>16)&65535)<<16)),p-=4,++b;switch(p){case 3:g^=(255&a.charCodeAt(b+2))<<16;case 2:g^=(255&a.charCodeAt(b+1))<<8;case 1:g=1540483477*(65535&(g^=255&a.charCodeAt(b)))+((1540483477*(g>>>16)&65535)<<16)}return g=1540483477*(65535&(g^=g>>>13))+((1540483477*(g>>>16)&65535)<<16),(g^=g>>>15)>>>0};var rn=bn,an=Ue.exports;Oe.exports=rn,Oe.exports.murmur3=rn,Oe.exports.murmur2=an;var Sr=y(Oe.exports);class Bn{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(i,c,p,g){this.ids.push(Ao(i)),this.positions.push(c,p,g)}getPositions(i){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const c=Ao(i);let p=0,g=this.ids.length-1;for(;p>1;this.ids[x]>=c?g=x:p=x+1}const b=[];for(;this.ids[p]===c;)b.push({index:this.positions[3*p],start:this.positions[3*p+1],end:this.positions[3*p+2]}),p++;return b}static serialize(i,c){const p=new Float64Array(i.ids),g=new Uint32Array(i.positions);return $r(p,g,0,p.length-1),c&&c.push(p.buffer,g.buffer),{ids:p,positions:g}}static deserialize(i){const c=new Bn;return c.ids=i.ids,c.positions=i.positions,c.indexed=!0,c}}function Ao(a){const i=+a;return!isNaN(i)&&i<=Number.MAX_SAFE_INTEGER?i:Sr(String(a))}function $r(a,i,c,p){for(;c>1];let b=c-1,x=p+1;for(;;){do b++;while(a[b]g);if(b>=x)break;fr(a,b,x),fr(i,3*b,3*x),fr(i,3*b+1,3*x+1),fr(i,3*b+2,3*x+2)}x-c`u_${g}`),this.type=p}setUniform(i,c,p){i.set(p.constantOr(this.value))}getBinding(i,c,p){return this.type==="color"?new Ga(i,c):new ko(i,c)}}class Hr{constructor(i,c){this.uniformNames=c.map(p=>`u_${p}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(i,c){this.pixelRatioFrom=c.pixelRatio,this.pixelRatioTo=i.pixelRatio,this.patternFrom=c.tlbr,this.patternTo=i.tlbr}setUniform(i,c,p,g){const b=g==="u_pattern_to"?this.patternTo:g==="u_pattern_from"?this.patternFrom:g==="u_pixel_ratio_to"?this.pixelRatioTo:g==="u_pixel_ratio_from"?this.pixelRatioFrom:null;b&&i.set(b)}getBinding(i,c,p){return p.substr(0,9)==="u_pattern"?new Bs(i,c):new ko(i,c)}}class pr{constructor(i,c,p,g){this.expression=i,this.type=p,this.maxValue=0,this.paintVertexAttributes=c.map(b=>({name:`a_${b}`,type:"Float32",components:p==="color"?2:1,offset:0})),this.paintVertexArray=new g}populatePaintArray(i,c,p,g,b){const x=this.paintVertexArray.length,E=this.expression.evaluate(new nr(0),c,{},g,[],b);this.paintVertexArray.resize(i),this._setPaintValue(x,i,E)}updatePaintArray(i,c,p,g){const b=this.expression.evaluate({zoom:0},p,g);this._setPaintValue(i,c,b)}_setPaintValue(i,c,p){if(this.type==="color"){const g=qa(p);for(let b=i;b`u_${E}_t`),this.type=p,this.useIntegerZoom=g,this.zoom=b,this.maxValue=0,this.paintVertexAttributes=c.map(E=>({name:`a_${E}`,type:"Float32",components:p==="color"?4:2,offset:0})),this.paintVertexArray=new x}populatePaintArray(i,c,p,g,b){const x=this.expression.evaluate(new nr(this.zoom),c,{},g,[],b),E=this.expression.evaluate(new nr(this.zoom+1),c,{},g,[],b),L=this.paintVertexArray.length;this.paintVertexArray.resize(i),this._setPaintValue(L,i,x,E)}updatePaintArray(i,c,p,g){const b=this.expression.evaluate({zoom:this.zoom},p,g),x=this.expression.evaluate({zoom:this.zoom+1},p,g);this._setPaintValue(i,c,b,x)}_setPaintValue(i,c,p,g){if(this.type==="color"){const b=qa(p),x=qa(g);for(let E=i;E`#define HAS_UNIFORM_${g}`))}return i}getBinderAttributes(){const i=[];for(const c in this.binders){const p=this.binders[c];if(p instanceof pr||p instanceof rr)for(let g=0;g!0){this.programConfigurations={};for(const g of i)this.programConfigurations[g.id]=new Xr(g,c,p);this.needsUpload=!1,this._featureMap=new Bn,this._bufferOffset=0}populatePaintArrays(i,c,p,g,b,x){for(const E in this.programConfigurations)this.programConfigurations[E].populatePaintArrays(i,c,g,b,x);c.id!==void 0&&this._featureMap.add(c.id,p,this._bufferOffset,i),this._bufferOffset=i,this.needsUpload=!0}updatePaintArrays(i,c,p,g){for(const b of p)this.needsUpload=this.programConfigurations[b.id].updatePaintArrays(i,this._featureMap,c,b,g)||this.needsUpload}get(i){return this.programConfigurations[i]}upload(i){if(this.needsUpload){for(const c in this.programConfigurations)this.programConfigurations[c].upload(i);this.needsUpload=!1}}destroy(){for(const i in this.programConfigurations)this.programConfigurations[i].destroy()}}function Jo(a,i){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(`${i}-`,"").replace(/-/g,"_")]}function Yr(a,i,c){const p={color:{source:cc,composite:Ph},number:{source:Th,composite:cc}},g=function(b){return{"line-pattern":{source:yt,composite:yt},"fill-pattern":{source:yt,composite:yt},"fill-extrusion-pattern":{source:yt,composite:yt}}[b]}(a);return g&&g[c]||p[i][c]}_e("ConstantBinder",Vs),_e("CrossFadedConstantBinder",Hr),_e("SourceExpressionBinder",pr),_e("CrossFadedCompositeBinder",Ko),_e("CompositeExpressionBinder",rr),_e("ProgramConfiguration",Xr,{omit:["_buffers"]}),_e("ProgramConfigurationSet",dr);const Ar=8192,_p=Math.pow(2,14)-1,Im=-_p-1;function Cl(a){const i=Ar/a.extent,c=a.loadGeometry();for(let p=0;px.x+1||Lx.y+1)&&$t("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return c}function Tl(a,i){return{type:a.type,id:a.id,properties:a.properties,geometry:i?Cl(a):[]}}function Mh(a,i,c,p,g){a.emplaceBack(2*i+(p+1)/2,2*c+(g+1)/2)}class ja{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(c=>c.id),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new Z,this.indexArray=new Bt,this.segments=new ae,this.programConfigurations=new dr(i.layers,i.zoom),this.stateDependentLayerIds=this.layers.filter(c=>c.isStateDependent()).map(c=>c.id)}populate(i,c,p){const g=this.layers[0],b=[];let x=null,E=!1;g.type==="circle"&&(x=g.layout.get("circle-sort-key"),E=!x.isConstant());for(const{feature:L,id:A,index:D,sourceLayerIndex:N}of i){const U=this.layers[0]._featureFilter.needGeometry,W=Tl(L,U);if(!this.layers[0]._featureFilter.filter(new nr(this.zoom),W,p))continue;const H=E?x.evaluate(W,{},p):void 0,et={id:A,properties:L.properties,type:L.type,sourceLayerIndex:N,index:D,geometry:U?W.geometry:Cl(L),patterns:{},sortKey:H};b.push(et)}E&&b.sort((L,A)=>L.sortKey-A.sortKey);for(const L of b){const{geometry:A,index:D,sourceLayerIndex:N}=L,U=i[D].feature;this.addFeature(L,A,D,p),c.featureIndex.insert(U,A,D,N,this.index)}}update(i,c,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,c,this.stateDependentLayers,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,ie),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(i,c,p,g){for(const b of c)for(const x of b){const E=x.x,L=x.y;if(E<0||E>=Ar||L<0||L>=Ar)continue;const A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,i.sortKey),D=A.vertexLength;Mh(this.layoutVertexArray,E,L,-1,-1),Mh(this.layoutVertexArray,E,L,1,-1),Mh(this.layoutVertexArray,E,L,1,1),Mh(this.layoutVertexArray,E,L,-1,1),this.indexArray.emplaceBack(D,D+1,D+2),this.indexArray.emplaceBack(D,D+3,D+2),A.vertexLength+=4,A.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,p,{},g)}}function vp(a,i){for(let c=0;c1){if(Ah(a,i))return!0;for(let p=0;p1?c:c.sub(i)._mult(g)._add(i))}function Kv(a,i){let c,p,g,b=!1;for(let x=0;xi.y!=g.y>i.y&&i.x<(g.x-p.x)*(i.y-p.y)/(g.y-p.y)+p.x&&(b=!b)}return b}function kh(a,i){let c=!1;for(let p=0,g=a.length-1;pi.y!=x.y>i.y&&i.x<(x.x-b.x)*(i.y-b.y)/(x.y-b.y)+b.x&&(c=!c)}return c}function ZI(a,i,c){const p=c[0],g=c[2];if(a.xg.x&&i.x>g.x||a.yg.y&&i.y>g.y)return!1;const b=Ct(a,i,c[0]);return b!==Ct(a,i,c[1])||b!==Ct(a,i,c[2])||b!==Ct(a,i,c[3])}function Sp(a,i,c){const p=i.paint.get(a).value;return p.kind==="constant"?p.value:c.programConfigurations.get(i.id).getMaxValue(a)}function Tm(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1])}function Lm(a,i,c,p,g){if(!i[0]&&!i[1])return a;const b=C.convert(i)._mult(g);c==="viewport"&&b._rotate(-p);const x=[];for(let E=0;Et1(st,et))}(A,L),W=N?D*E:D;for(const H of g)for(const et of H){const st=N?et:t1(et,L);let pt=W;const It=Pm([],[et.x,et.y,0,1],L);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?pt*=It[3]/x.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(pt*=x.cameraToCenterDistance/It[3]),Cm(U,st,pt))return!0}return!1}}function t1(a,i){const c=Pm([],[a.x,a.y,0,1],i);return new C(c[0]/c[3],c[1]/c[3])}class e1 extends ja{}let n1;_e("HeatmapBucket",e1,{omit:["layers"]});var KI={get paint(){return n1=n1||new co({"heatmap-radius":new Re(Mt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Re(Mt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ie(Mt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new up(Mt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ie(Mt.paint_heatmap["heatmap-opacity"])})}};function Gy(a,{width:i,height:c},p,g){if(g){if(g instanceof Uint8ClampedArray)g=new Uint8Array(g.buffer);else if(g.length!==i*c*p)throw new RangeError(`mismatched image size. expected: ${g.length} but got: ${i*c*p}`)}else g=new Uint8Array(i*c*p);return a.width=i,a.height=c,a.data=g,a}function r1(a,{width:i,height:c},p){if(i===a.width&&c===a.height)return;const g=Gy({},{width:i,height:c},p);qy(a,g,{x:0,y:0},{x:0,y:0},{width:Math.min(a.width,i),height:Math.min(a.height,c)},p),a.width=i,a.height=c,a.data=g.data}function qy(a,i,c,p,g,b){if(g.width===0||g.height===0)return i;if(g.width>a.width||g.height>a.height||c.x>a.width-g.width||c.y>a.height-g.height)throw new RangeError("out of range source coordinates for image copy");if(g.width>i.width||g.height>i.height||p.x>i.width-g.width||p.y>i.height-g.height)throw new RangeError("out of range destination coordinates for image copy");const x=a.data,E=i.data;if(x===E)throw new Error("srcData equals dstData, so image is already copied");for(let L=0;L{i[a.evaluationKey]=L;const A=a.expression.evaluate(i);g.data[x+E+0]=Math.floor(255*A.r/A.a),g.data[x+E+1]=Math.floor(255*A.g/A.a),g.data[x+E+2]=Math.floor(255*A.b/A.a),g.data[x+E+3]=Math.floor(255*A.a)};if(a.clips)for(let x=0,E=0;x80*c){p=b=a[0],g=x=a[1];for(var H=c;Hb&&(b=E),L>x&&(x=L);A=(A=Math.max(b-p,x-g))!==0?32767/A:0}return Cp(U,W,c,p,g,A,0),W}function s1(a,i,c,p,g){var b,x;if(g===Hy(a,i,c,p)>0)for(b=i;b=i;b-=p)x=u1(b,a[b],a[b+1],x);return x&&Am(x,x.next)&&(Lp(x),x=x.next),x}function dc(a,i){if(!a)return a;i||(i=a);var c,p=a;do if(c=!1,p.steiner||!Am(p,p.next)&&Fr(p.prev,p,p.next)!==0)p=p.next;else{if(Lp(p),(p=i=p.prev)===p.next)break;c=!0}while(c||p!==i);return i}function Cp(a,i,c,p,g,b,x){if(a){!x&&b&&function(D,N,U,W){var H=D;do H.z===0&&(H.z=Wy(H.x,H.y,N,U,W)),H.prevZ=H.prev,H.nextZ=H.next,H=H.next;while(H!==D);H.prevZ.nextZ=null,H.prevZ=null,function(et){var st,pt,It,gt,xt,Xt,Yt,ge,xe=1;do{for(pt=et,et=null,xt=null,Xt=0;pt;){for(Xt++,It=pt,Yt=0,st=0;st0||ge>0&&It;)Yt!==0&&(ge===0||!It||pt.z<=It.z)?(gt=pt,pt=pt.nextZ,Yt--):(gt=It,It=It.nextZ,ge--),xt?xt.nextZ=gt:et=gt,gt.prevZ=xt,xt=gt;pt=It}xt.nextZ=null,xe*=2}while(Xt>1)}(H)}(a,p,g,b);for(var E,L,A=a;a.prev!==a.next;)if(E=a.prev,L=a.next,b?rC(a,p,g,b):nC(a))i.push(E.i/c|0),i.push(a.i/c|0),i.push(L.i/c|0),Lp(a),a=L.next,A=L.next;else if((a=L)===A){x?x===1?Cp(a=iC(dc(a),i,c),i,c,p,g,b,2):x===2&&oC(a,i,c,p,g,b):Cp(dc(a),i,c,p,g,b,1);break}}}function nC(a){var i=a.prev,c=a,p=a.next;if(Fr(i,c,p)>=0)return!1;for(var g=i.x,b=c.x,x=p.x,E=i.y,L=c.y,A=p.y,D=gb?g>x?g:x:b>x?b:x,W=E>L?E>A?E:A:L>A?L:A,H=p.next;H!==i;){if(H.x>=D&&H.x<=U&&H.y>=N&&H.y<=W&&Rh(g,E,b,L,x,A,H.x,H.y)&&Fr(H.prev,H,H.next)>=0)return!1;H=H.next}return!0}function rC(a,i,c,p){var g=a.prev,b=a,x=a.next;if(Fr(g,b,x)>=0)return!1;for(var E=g.x,L=b.x,A=x.x,D=g.y,N=b.y,U=x.y,W=EL?E>A?E:A:L>A?L:A,st=D>N?D>U?D:U:N>U?N:U,pt=Wy(W,H,i,c,p),It=Wy(et,st,i,c,p),gt=a.prevZ,xt=a.nextZ;gt&>.z>=pt&&xt&&xt.z<=It;){if(gt.x>=W&>.x<=et&>.y>=H&>.y<=st&>!==g&>!==x&&Rh(E,D,L,N,A,U,gt.x,gt.y)&&Fr(gt.prev,gt,gt.next)>=0||(gt=gt.prevZ,xt.x>=W&&xt.x<=et&&xt.y>=H&&xt.y<=st&&xt!==g&&xt!==x&&Rh(E,D,L,N,A,U,xt.x,xt.y)&&Fr(xt.prev,xt,xt.next)>=0))return!1;xt=xt.nextZ}for(;gt&>.z>=pt;){if(gt.x>=W&>.x<=et&>.y>=H&>.y<=st&>!==g&>!==x&&Rh(E,D,L,N,A,U,gt.x,gt.y)&&Fr(gt.prev,gt,gt.next)>=0)return!1;gt=gt.prevZ}for(;xt&&xt.z<=It;){if(xt.x>=W&&xt.x<=et&&xt.y>=H&&xt.y<=st&&xt!==g&&xt!==x&&Rh(E,D,L,N,A,U,xt.x,xt.y)&&Fr(xt.prev,xt,xt.next)>=0)return!1;xt=xt.nextZ}return!0}function iC(a,i,c){var p=a;do{var g=p.prev,b=p.next.next;!Am(g,b)&&a1(g,p,p.next,b)&&Tp(g,b)&&Tp(b,g)&&(i.push(g.i/c|0),i.push(p.i/c|0),i.push(b.i/c|0),Lp(p),Lp(p.next),p=a=b),p=p.next}while(p!==a);return dc(p)}function oC(a,i,c,p,g,b){var x=a;do{for(var E=x.next.next;E!==x.prev;){if(x.i!==E.i&&cC(x,E)){var L=l1(x,E);return x=dc(x,x.next),L=dc(L,L.next),Cp(x,i,c,p,g,b,0),void Cp(L,i,c,p,g,b,0)}E=E.next}x=x.next}while(x!==a)}function sC(a,i){return a.x-i.x}function aC(a,i){var c=function(g,b){var x,E=b,L=g.x,A=g.y,D=-1/0;do{if(A<=E.y&&A>=E.next.y&&E.next.y!==E.y){var N=E.x+(A-E.y)*(E.next.x-E.x)/(E.next.y-E.y);if(N<=L&&N>D&&(D=N,x=E.x=E.x&&E.x>=H&&L!==E.x&&Rh(Ax.x||E.x===x.x&&lC(x,E)))&&(x=E,st=U)),E=E.next;while(E!==W);return x}(a,i);if(!c)return i;var p=l1(c,a);return dc(p,p.next),dc(c,c.next)}function lC(a,i){return Fr(a.prev,a,i.prev)<0&&Fr(i.next,a,a.next)<0}function Wy(a,i,c,p,g){return(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-c)*g|0)|a<<8))|a<<4))|a<<2))|a<<1))|(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-p)*g|0)|i<<8))|i<<4))|i<<2))|i<<1))<<1}function uC(a){var i=a,c=a;do(i.x=(a-x)*(b-E)&&(a-x)*(p-E)>=(c-x)*(i-E)&&(c-x)*(b-E)>=(g-x)*(p-E)}function cC(a,i){return a.next.i!==i.i&&a.prev.i!==i.i&&!function(c,p){var g=c;do{if(g.i!==c.i&&g.next.i!==c.i&&g.i!==p.i&&g.next.i!==p.i&&a1(g,g.next,c,p))return!0;g=g.next}while(g!==c);return!1}(a,i)&&(Tp(a,i)&&Tp(i,a)&&function(c,p){var g=c,b=!1,x=(c.x+p.x)/2,E=(c.y+p.y)/2;do g.y>E!=g.next.y>E&&g.next.y!==g.y&&x<(g.next.x-g.x)*(E-g.y)/(g.next.y-g.y)+g.x&&(b=!b),g=g.next;while(g!==c);return b}(a,i)&&(Fr(a.prev,a,i.prev)||Fr(a,i.prev,i))||Am(a,i)&&Fr(a.prev,a,a.next)>0&&Fr(i.prev,i,i.next)>0)}function Fr(a,i,c){return(i.y-a.y)*(c.x-i.x)-(i.x-a.x)*(c.y-i.y)}function Am(a,i){return a.x===i.x&&a.y===i.y}function a1(a,i,c,p){var g=Dm(Fr(a,i,c)),b=Dm(Fr(a,i,p)),x=Dm(Fr(c,p,a)),E=Dm(Fr(c,p,i));return g!==b&&x!==E||!(g!==0||!km(a,c,i))||!(b!==0||!km(a,p,i))||!(x!==0||!km(c,a,p))||!(E!==0||!km(c,i,p))}function km(a,i,c){return i.x<=Math.max(a.x,c.x)&&i.x>=Math.min(a.x,c.x)&&i.y<=Math.max(a.y,c.y)&&i.y>=Math.min(a.y,c.y)}function Dm(a){return a>0?1:a<0?-1:0}function Tp(a,i){return Fr(a.prev,a,a.next)<0?Fr(a,i,a.next)>=0&&Fr(a,a.prev,i)>=0:Fr(a,i,a.prev)<0||Fr(a,a.next,i)<0}function l1(a,i){var c=new Zy(a.i,a.x,a.y),p=new Zy(i.i,i.x,i.y),g=a.next,b=i.prev;return a.next=i,i.prev=a,c.next=g,g.prev=c,p.next=c,c.prev=p,b.next=p,p.prev=b,p}function u1(a,i,c,p){var g=new Zy(a,i,c);return p?(g.next=p.next,g.prev=p,p.next.prev=g,p.next=g):(g.prev=g,g.next=g),g}function Lp(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 Zy(a,i,c){this.i=a,this.x=i,this.y=c,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Hy(a,i,c,p){for(var g=0,b=i,x=c-p;b0&&c.holes.push(p+=a[g-1].length)}return c};var c1=y(jy.exports);function hC(a,i,c,p,g){h1(a,i,c||0,p||a.length-1,g||fC)}function h1(a,i,c,p,g){for(;p>c;){if(p-c>600){var b=p-c+1,x=i-c+1,E=Math.log(b),L=.5*Math.exp(2*E/3),A=.5*Math.sqrt(E*L*(b-L)/b)*(x-b/2<0?-1:1);h1(a,i,Math.max(c,Math.floor(i-x*L/b+A)),Math.min(p,Math.floor(i+(b-x)*L/b+A)),g)}var D=a[i],N=c,U=p;for(Pp(a,c,i),g(a[p],D)>0&&Pp(a,c,p);N0;)U--}g(a[c],D)===0?Pp(a,c,U):Pp(a,++U,p),U<=i&&(c=U+1),i<=U&&(p=U-1)}}function Pp(a,i,c){var p=a[i];a[i]=a[c],a[c]=p}function fC(a,i){return ai?1:0}function Xy(a,i){const c=a.length;if(c<=1)return[a];const p=[];let g,b;for(let x=0;x1)for(let x=0;xc.id),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new it,this.indexArray=new Bt,this.indexArray2=new Qt,this.programConfigurations=new dr(i.layers,i.zoom),this.segments=new ae,this.segments2=new ae,this.stateDependentLayerIds=this.layers.filter(c=>c.isStateDependent()).map(c=>c.id)}populate(i,c,p){this.hasPattern=Yy("fill",this.layers,c);const g=this.layers[0].layout.get("fill-sort-key"),b=!g.isConstant(),x=[];for(const{feature:E,id:L,index:A,sourceLayerIndex:D}of i){const N=this.layers[0]._featureFilter.needGeometry,U=Tl(E,N);if(!this.layers[0]._featureFilter.filter(new nr(this.zoom),U,p))continue;const W=b?g.evaluate(U,{},p,c.availableImages):void 0,H={id:L,properties:E.properties,type:E.type,sourceLayerIndex:D,index:A,geometry:N?U.geometry:Cl(E),patterns:{},sortKey:W};x.push(H)}b&&x.sort((E,L)=>E.sortKey-L.sortKey);for(const E of x){const{geometry:L,index:A,sourceLayerIndex:D}=E;if(this.hasPattern){const N=Ky("fill",this.layers,E,this.zoom,c);this.patternFeatures.push(N)}else this.addFeature(E,L,A,p,{});c.featureIndex.insert(i[A].feature,L,A,D,this.index)}}update(i,c,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,c,this.stateDependentLayers,p)}addFeatures(i,c,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,c,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,eC),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.indexBuffer2=i.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(i),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(i,c,p,g,b){for(const x of Xy(c,500)){let E=0;for(const W of x)E+=W.length;const L=this.segments.prepareSegment(E,this.layoutVertexArray,this.indexArray),A=L.vertexLength,D=[],N=[];for(const W of x){if(W.length===0)continue;W!==x[0]&&N.push(D.length/2);const H=this.segments2.prepareSegment(W.length,this.layoutVertexArray,this.indexArray2),et=H.vertexLength;this.layoutVertexArray.emplaceBack(W[0].x,W[0].y),this.indexArray2.emplaceBack(et+W.length-1,et),D.push(W[0].x),D.push(W[0].y);for(let st=1;st>3}if(g--,p===1||p===2)b+=a.readSVarint(),x+=a.readSVarint(),p===1&&(i&&E.push(i),i=[]),i.push(new vC(b,x));else{if(p!==7)throw new Error("unknown command "+p);i&&i.push(i[0].clone())}}return i&&E.push(i),E},Nh.prototype.bbox=function(){var a=this._pbf;a.pos=this._geometry;for(var i=a.readVarint()+a.pos,c=1,p=0,g=0,b=0,x=1/0,E=-1/0,L=1/0,A=-1/0;a.pos>3}if(p--,c===1||c===2)(g+=a.readSVarint())E&&(E=g),(b+=a.readSVarint())A&&(A=b);else if(c!==7)throw new Error("unknown command "+c)}return[x,L,E,A]},Nh.prototype.toGeoJSON=function(a,i,c){var p,g,b=this.extent*Math.pow(2,c),x=this.extent*a,E=this.extent*i,L=this.loadGeometry(),A=Nh.types[this.type];function D(W){for(var H=0;H>3;g=x===1?p.readString():x===2?p.readFloat():x===3?p.readDouble():x===4?p.readVarint64():x===5?p.readVarint():x===6?p.readSVarint():x===7?p.readBoolean():null}return g}(c))}g1.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 i=this._pbf.readVarint()+this._pbf.pos;return new wC(this._pbf,i,this.extent,this._keys,this._values)};var EC=m1;function IC(a,i,c){if(a===3){var p=new EC(c,c.readVarint()+c.pos);p.length&&(i[p.name]=p)}}hu.VectorTile=function(a,i){this.layers=a.readFields(IC,{},i)},hu.VectorTileFeature=d1,hu.VectorTileLayer=m1;const CC=hu.VectorTileFeature.types,Qy=Math.pow(2,13);function Mp(a,i,c,p,g,b,x,E){a.emplaceBack(i,c,2*Math.floor(p*Qy)+x,g*Qy*2,b*Qy*2,Math.round(E))}class $y{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(c=>c.id),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new rt,this.centroidVertexArray=new B,this.indexArray=new Bt,this.programConfigurations=new dr(i.layers,i.zoom),this.segments=new ae,this.stateDependentLayerIds=this.layers.filter(c=>c.isStateDependent()).map(c=>c.id)}populate(i,c,p){this.features=[],this.hasPattern=Yy("fill-extrusion",this.layers,c);for(const{feature:g,id:b,index:x,sourceLayerIndex:E}of i){const L=this.layers[0]._featureFilter.needGeometry,A=Tl(g,L);if(!this.layers[0]._featureFilter.filter(new nr(this.zoom),A,p))continue;const D={id:b,sourceLayerIndex:E,index:x,geometry:L?A.geometry:Cl(g),properties:g.properties,type:g.type,patterns:{}};this.hasPattern?this.features.push(Ky("fill-extrusion",this.layers,D,this.zoom,c)):this.addFeature(D,D.geometry,x,p,{}),c.featureIndex.insert(g,D.geometry,x,E,this.index,!0)}}addFeatures(i,c,p){for(const g of this.features){const{geometry:b}=g;this.addFeature(g,b,g.index,c,p)}}update(i,c,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,c,this.stateDependentLayers,p)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,_C),this.centroidVertexBuffer=i.createVertexBuffer(this.centroidVertexArray,yC.members,!0),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(i,c,p,g,b){const x={x:0,y:0,vertexCount:0};for(const E of Xy(c,500)){let L=0;for(const H of E)L+=H.length;let A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const H of E){if(H.length===0||LC(H))continue;let et=0;for(let st=0;st=1){const It=H[st-1];if(!TC(pt,It)){A.vertexLength+4>ae.MAX_VERTEX_ARRAY_LENGTH&&(A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const gt=pt.sub(It)._perp()._unit(),xt=It.dist(pt);et+xt>32768&&(et=0),Mp(this.layoutVertexArray,pt.x,pt.y,gt.x,gt.y,0,0,et),Mp(this.layoutVertexArray,pt.x,pt.y,gt.x,gt.y,0,1,et),x.x+=2*pt.x,x.y+=2*pt.y,x.vertexCount+=2,et+=xt,Mp(this.layoutVertexArray,It.x,It.y,gt.x,gt.y,0,0,et),Mp(this.layoutVertexArray,It.x,It.y,gt.x,gt.y,0,1,et),x.x+=2*It.x,x.y+=2*It.y,x.vertexCount+=2;const Xt=A.vertexLength;this.indexArray.emplaceBack(Xt,Xt+2,Xt+1),this.indexArray.emplaceBack(Xt+1,Xt+2,Xt+3),A.vertexLength+=4,A.primitiveLength+=2}}}}if(A.vertexLength+L>ae.MAX_VERTEX_ARRAY_LENGTH&&(A=this.segments.prepareSegment(L,this.layoutVertexArray,this.indexArray)),CC[i.type]!=="Polygon")continue;const D=[],N=[],U=A.vertexLength;for(const H of E)if(H.length!==0){H!==E[0]&&N.push(D.length/2);for(let et=0;etAr)||a.y===i.y&&(a.y<0||a.y>Ar)}function LC(a){return a.every(i=>i.x<0)||a.every(i=>i.x>Ar)||a.every(i=>i.y<0)||a.every(i=>i.y>Ar)}let y1;_e("FillExtrusionBucket",$y,{omit:["layers","features"]});var PC={get paint(){return y1=y1||new co({"fill-extrusion-opacity":new Ie(Mt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Re(Mt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ie(Mt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ie(Mt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new wh(Mt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Re(Mt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Re(Mt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ie(Mt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class MC extends ds{constructor(i){super(i,PC)}createBucket(i){return new $y(i)}queryRadius(){return Tm(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(i,c,p,g,b,x,E,L){const A=Lm(i,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),x.angle,E),D=this.paint.get("fill-extrusion-height").evaluate(c,p),N=this.paint.get("fill-extrusion-base").evaluate(c,p),U=function(H,et,st,pt){const It=[];for(const gt of H){const xt=[gt.x,gt.y,0,1];Pm(xt,xt,et),It.push(new C(xt[0]/xt[3],xt[1]/xt[3]))}return It}(A,L),W=function(H,et,st,pt){const It=[],gt=[],xt=pt[8]*et,Xt=pt[9]*et,Yt=pt[10]*et,ge=pt[11]*et,xe=pt[8]*st,me=pt[9]*st,he=pt[10]*st,oe=pt[11]*st;for(const ve of H){const ue=[],te=[];for(const De of ve){const Se=De.x,ln=De.y,Jn=pt[0]*Se+pt[4]*ln+pt[12],ir=pt[1]*Se+pt[5]*ln+pt[13],ni=pt[2]*Se+pt[6]*ln+pt[14],Qo=pt[3]*Se+pt[7]*ln+pt[15],fo=ni+Yt,Kr=Qo+ge,wi=Jn+xe,Ri=ir+me,po=ni+he,mo=Qo+oe,ri=new C((Jn+xt)/Kr,(ir+Xt)/Kr);ri.z=fo/Kr,ue.push(ri);const ii=new C(wi/mo,Ri/mo);ii.z=po/mo,te.push(ii)}It.push(ue),gt.push(te)}return[It,gt]}(g,N,D,L);return function(H,et,st){let pt=1/0;bp(st,et)&&(pt=_1(st,et[0]));for(let It=0;Itc.id),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(c=>{this.gradients[c.id]={}}),this.layoutVertexArray=new lt,this.layoutVertexArray2=new tt,this.indexArray=new Bt,this.programConfigurations=new dr(i.layers,i.zoom),this.segments=new ae,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(c=>c.isStateDependent()).map(c=>c.id)}populate(i,c,p){this.hasPattern=Yy("line",this.layers,c);const g=this.layers[0].layout.get("line-sort-key"),b=!g.isConstant(),x=[];for(const{feature:E,id:L,index:A,sourceLayerIndex:D}of i){const N=this.layers[0]._featureFilter.needGeometry,U=Tl(E,N);if(!this.layers[0]._featureFilter.filter(new nr(this.zoom),U,p))continue;const W=b?g.evaluate(U,{},p):void 0,H={id:L,properties:E.properties,type:E.type,sourceLayerIndex:D,index:A,geometry:N?U.geometry:Cl(E),patterns:{},sortKey:W};x.push(H)}b&&x.sort((E,L)=>E.sortKey-L.sortKey);for(const E of x){const{geometry:L,index:A,sourceLayerIndex:D}=E;if(this.hasPattern){const N=Ky("line",this.layers,E,this.zoom,c);this.patternFeatures.push(N)}else this.addFeature(E,L,A,p,{});c.featureIndex.insert(i[A].feature,L,A,D,this.index)}}update(i,c,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,c,this.stateDependentLayers,p)}addFeatures(i,c,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,c,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=i.createVertexBuffer(this.layoutVertexArray2,RC)),this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,kC),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(i){if(i.properties&&Object.prototype.hasOwnProperty.call(i.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(i.properties,"mapbox_clip_end"))return{start:+i.properties.mapbox_clip_start,end:+i.properties.mapbox_clip_end}}addFeature(i,c,p,g,b){const x=this.layers[0].layout,E=x.get("line-join").evaluate(i,{}),L=x.get("line-cap"),A=x.get("line-miter-limit"),D=x.get("line-round-limit");this.lineClips=this.lineFeatureClips(i);for(const N of c)this.addLine(N,i,E,L,A,D);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,p,b,g)}addLine(i,c,p,g,b,x){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let pt=0;pt=2&&i[L-1].equals(i[L-2]);)L--;let A=0;for(;A0;if(ge&&pt>A){const oe=U.dist(W);if(oe>2*D){const ve=U.sub(U.sub(W)._mult(D/oe)._round());this.updateDistance(W,ve),this.addCurrentVertex(ve,et,0,0,N),W=ve}}const me=W&&H;let he=me?p:E?"butt":g;if(me&&he==="round"&&(Xtb&&(he="bevel"),he==="bevel"&&(Xt>2&&(he="flipbevel"),Xt100)It=st.mult(-1);else{const oe=Xt*et.add(st).mag()/et.sub(st).mag();It._perp()._mult(oe*(xe?-1:1))}this.addCurrentVertex(U,It,0,0,N),this.addCurrentVertex(U,It.mult(-1),0,0,N)}else if(he==="bevel"||he==="fakeround"){const oe=-Math.sqrt(Xt*Xt-1),ve=xe?oe:0,ue=xe?0:oe;if(W&&this.addCurrentVertex(U,et,ve,ue,N),he==="fakeround"){const te=Math.round(180*Yt/Math.PI/20);for(let De=1;De2*D){const ve=U.add(H.sub(U)._mult(D/oe)._round());this.updateDistance(U,ve),this.addCurrentVertex(ve,st,0,0,N),U=ve}}}}addCurrentVertex(i,c,p,g,b,x=!1){const E=c.y*g-c.x,L=-c.y-c.x*g;this.addHalfVertex(i,c.x+c.y*p,c.y-c.x*p,x,!1,p,b),this.addHalfVertex(i,E,L,x,!0,-g,b),this.distance>v1/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(i,c,p,g,b,x))}addHalfVertex({x:i,y:c},p,g,b,x,E,L){const A=.5*(this.lineClips?this.scaledDistance*(v1-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((i<<1)+(b?1:0),(c<<1)+(x?1:0),Math.round(63*p)+128,Math.round(63*g)+128,1+(E===0?0:E<0?-1:1)|(63&A)<<2,A>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const D=L.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,D),L.primitiveLength++),x?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(i,c){this.distance+=i.dist(c),this.updateScaledDistance()}}let b1,x1;_e("LineBucket",t_,{omit:["layers","patternFeatures"]});var w1={get paint(){return x1=x1||new co({"line-opacity":new Re(Mt.paint_line["line-opacity"]),"line-color":new Re(Mt.paint_line["line-color"]),"line-translate":new Ie(Mt.paint_line["line-translate"]),"line-translate-anchor":new Ie(Mt.paint_line["line-translate-anchor"]),"line-width":new Re(Mt.paint_line["line-width"]),"line-gap-width":new Re(Mt.paint_line["line-gap-width"]),"line-offset":new Re(Mt.paint_line["line-offset"]),"line-blur":new Re(Mt.paint_line["line-blur"]),"line-dasharray":new ac(Mt.paint_line["line-dasharray"]),"line-pattern":new wh(Mt.paint_line["line-pattern"]),"line-gradient":new up(Mt.paint_line["line-gradient"])})},get layout(){return b1=b1||new co({"line-cap":new Ie(Mt.layout_line["line-cap"]),"line-join":new Re(Mt.layout_line["line-join"]),"line-miter-limit":new Ie(Mt.layout_line["line-miter-limit"]),"line-round-limit":new Ie(Mt.layout_line["line-round-limit"]),"line-sort-key":new Re(Mt.layout_line["line-sort-key"])})}};class zC extends Re{possiblyEvaluate(i,c){return c=new nr(Math.floor(c.zoom),{now:c.now,fadeDuration:c.fadeDuration,zoomHistory:c.zoomHistory,transition:c.transition}),super.possiblyEvaluate(i,c)}evaluate(i,c,p,g){return c=ft({},c,{zoom:Math.floor(c.zoom)}),super.evaluate(i,c,p,g)}}let Rm;class FC extends ds{constructor(i){super(i,w1),this.gradientVersion=0,Rm||(Rm=new zC(w1.paint.properties["line-width"].specification),Rm.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(i){if(i==="line-gradient"){const c=this.gradientExpression();this.stepInterpolant=!!function(p){return p._styleExpression!==void 0}(c)&&c._styleExpression.expression instanceof $u,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(i,c){super.recalculate(i,c),this.paint._values["line-floorwidth"]=Rm.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,i)}createBucket(i){return new t_(i)}queryRadius(i){const c=i,p=S1(Sp("line-width",this,c),Sp("line-gap-width",this,c)),g=Sp("line-offset",this,c);return p/2+Math.abs(g)+Tm(this.paint.get("line-translate"))}queryIntersectsFeature(i,c,p,g,b,x,E){const L=Lm(i,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),x.angle,E),A=E/2*S1(this.paint.get("line-width").evaluate(c,p),this.paint.get("line-gap-width").evaluate(c,p)),D=this.paint.get("line-offset").evaluate(c,p);return D&&(g=function(N,U){const W=[];for(let H=0;H=3){for(let st=0;st0?i+2*a:a}const BC=zr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),VC=zr([{name:"a_projected_pos",components:3,type:"Float32"}],4);zr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const UC=zr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);zr([{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 E1=zr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),GC=zr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function qC(a,i,c){return a.sections.forEach(p=>{p.text=function(g,b,x){const E=b.layout.get("text-transform").evaluate(x,{});return E==="uppercase"?g=g.toLocaleUpperCase():E==="lowercase"&&(g=g.toLocaleLowerCase()),Ua.applyArabicShaping&&(g=Ua.applyArabicShaping(g)),g}(p.text,i,c)}),a}zr([{name:"triangle",components:3,type:"Uint16"}]),zr([{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"}]),zr([{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"}]),zr([{type:"Float32",name:"offsetX"}]),zr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),zr([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const kp={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var ei=24,I1=Gn,C1=function(a,i,c,p,g){var b,x,E=8*g-p-1,L=(1<>1,D=-7,N=c?g-1:0,U=c?-1:1,W=a[i+N];for(N+=U,b=W&(1<<-D)-1,W>>=-D,D+=E;D>0;b=256*b+a[i+N],N+=U,D-=8);for(x=b&(1<<-D)-1,b>>=-D,D+=p;D>0;x=256*x+a[i+N],N+=U,D-=8);if(b===0)b=1-A;else{if(b===L)return x?NaN:1/0*(W?-1:1);x+=Math.pow(2,p),b-=A}return(W?-1:1)*x*Math.pow(2,b-p)},T1=function(a,i,c,p,g,b){var x,E,L,A=8*b-g-1,D=(1<>1,U=g===23?Math.pow(2,-24)-Math.pow(2,-77):0,W=p?0:b-1,H=p?1:-1,et=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(E=isNaN(i)?1:0,x=D):(x=Math.floor(Math.log(i)/Math.LN2),i*(L=Math.pow(2,-x))<1&&(x--,L*=2),(i+=x+N>=1?U/L:U*Math.pow(2,1-N))*L>=2&&(x++,L/=2),x+N>=D?(E=0,x=D):x+N>=1?(E=(i*L-1)*Math.pow(2,g),x+=N):(E=i*Math.pow(2,N-1)*Math.pow(2,g),x=0));g>=8;a[c+W]=255&E,W+=H,E/=256,g-=8);for(x=x<0;a[c+W]=255&x,W+=H,x/=256,A-=8);a[c+W-H]|=128*et};function Gn(a){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(a)?a:new Uint8Array(a||0),this.pos=0,this.type=0,this.length=this.buf.length}Gn.Varint=0,Gn.Fixed64=1,Gn.Bytes=2,Gn.Fixed32=5;var e_=4294967296,L1=1/e_,P1=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ll(a){return a.type===Gn.Bytes?a.readVarint()+a.pos:a.pos+1}function Oh(a,i,c){return c?4294967296*i+(a>>>0):4294967296*(i>>>0)+(a>>>0)}function M1(a,i,c){var p=i<=16383?1:i<=2097151?2:i<=268435455?3:Math.floor(Math.log(i)/(7*Math.LN2));c.realloc(p);for(var g=c.pos-1;g>=a;g--)c.buf[g+p]=c.buf[g]}function jC(a,i){for(var c=0;c>>8,a[c+2]=i>>>16,a[c+3]=i>>>24}function A1(a,i){return(a[i]|a[i+1]<<8|a[i+2]<<16)+(a[i+3]<<24)}Gn.prototype={destroy:function(){this.buf=null},readFields:function(a,i,c){for(c=c||this.length;this.pos>3,b=this.pos;this.type=7&p,a(g,i,this),this.pos===b&&this.skip(p)}return i},readMessage:function(a,i){return this.readFields(a,i,this.readVarint()+this.pos)},readFixed32:function(){var a=Nm(this.buf,this.pos);return this.pos+=4,a},readSFixed32:function(){var a=A1(this.buf,this.pos);return this.pos+=4,a},readFixed64:function(){var a=Nm(this.buf,this.pos)+Nm(this.buf,this.pos+4)*e_;return this.pos+=8,a},readSFixed64:function(){var a=Nm(this.buf,this.pos)+A1(this.buf,this.pos+4)*e_;return this.pos+=8,a},readFloat:function(){var a=C1(this.buf,this.pos,!0,23,4);return this.pos+=4,a},readDouble:function(){var a=C1(this.buf,this.pos,!0,52,8);return this.pos+=8,a},readVarint:function(a){var i,c,p=this.buf;return i=127&(c=p[this.pos++]),c<128?i:(i|=(127&(c=p[this.pos++]))<<7,c<128?i:(i|=(127&(c=p[this.pos++]))<<14,c<128?i:(i|=(127&(c=p[this.pos++]))<<21,c<128?i:function(g,b,x){var E,L,A=x.buf;if(E=(112&(L=A[x.pos++]))>>4,L<128||(E|=(127&(L=A[x.pos++]))<<3,L<128)||(E|=(127&(L=A[x.pos++]))<<10,L<128)||(E|=(127&(L=A[x.pos++]))<<17,L<128)||(E|=(127&(L=A[x.pos++]))<<24,L<128)||(E|=(1&(L=A[x.pos++]))<<31,L<128))return Oh(g,E,b);throw new Error("Expected varint not more than 10 bytes")}(i|=(15&(c=p[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,i=this.pos;return this.pos=a,a-i>=12&&P1?function(c,p,g){return P1.decode(c.subarray(p,g))}(this.buf,i,a):function(c,p,g){for(var b="",x=p;x239?4:D>223?3:D>191?2:1;if(x+U>g)break;U===1?D<128&&(N=D):U===2?(192&(E=c[x+1]))==128&&(N=(31&D)<<6|63&E)<=127&&(N=null):U===3?(L=c[x+2],(192&(E=c[x+1]))==128&&(192&L)==128&&((N=(15&D)<<12|(63&E)<<6|63&L)<=2047||N>=55296&&N<=57343)&&(N=null)):U===4&&(L=c[x+2],A=c[x+3],(192&(E=c[x+1]))==128&&(192&L)==128&&(192&A)==128&&((N=(15&D)<<18|(63&E)<<12|(63&L)<<6|63&A)<=65535||N>=1114112)&&(N=null)),N===null?(N=65533,U=1):N>65535&&(N-=65536,b+=String.fromCharCode(N>>>10&1023|55296),N=56320|1023&N),b+=String.fromCharCode(N),x+=U}return b}(this.buf,i,a)},readBytes:function(){var a=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,a);return this.pos=a,i},readPackedVarint:function(a,i){if(this.type!==Gn.Bytes)return a.push(this.readVarint(i));var c=Ll(this);for(a=a||[];this.pos127;);else if(i===Gn.Bytes)this.pos=this.readVarint()+this.pos;else if(i===Gn.Fixed32)this.pos+=4;else{if(i!==Gn.Fixed64)throw new Error("Unimplemented type: "+i);this.pos+=8}},writeTag:function(a,i){this.writeVarint(a<<3|i)},realloc:function(a){for(var i=this.length||16;i268435455||a<0?function(i,c){var p,g;if(i>=0?(p=i%4294967296|0,g=i/4294967296|0):(g=~(-i/4294967296),4294967295^(p=~(-i%4294967296))?p=p+1|0:(p=0,g=g+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");c.realloc(10),function(b,x,E){E.buf[E.pos++]=127&b|128,b>>>=7,E.buf[E.pos++]=127&b|128,b>>>=7,E.buf[E.pos++]=127&b|128,b>>>=7,E.buf[E.pos++]=127&b|128,E.buf[E.pos]=127&(b>>>=7)}(p,0,c),function(b,x){var E=(7&b)<<4;x.buf[x.pos++]|=E|((b>>>=3)?128:0),b&&(x.buf[x.pos++]=127&b|((b>>>=7)?128:0),b&&(x.buf[x.pos++]=127&b|((b>>>=7)?128:0),b&&(x.buf[x.pos++]=127&b|((b>>>=7)?128:0),b&&(x.buf[x.pos++]=127&b|((b>>>=7)?128:0),b&&(x.buf[x.pos++]=127&b)))))}(g,c)}(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 i=this.pos;this.pos=function(p,g,b){for(var x,E,L=0;L55295&&x<57344){if(!E){x>56319||L+1===g.length?(p[b++]=239,p[b++]=191,p[b++]=189):E=x;continue}if(x<56320){p[b++]=239,p[b++]=191,p[b++]=189,E=x;continue}x=E-55296<<10|x-56320|65536,E=null}else E&&(p[b++]=239,p[b++]=191,p[b++]=189,E=null);x<128?p[b++]=x:(x<2048?p[b++]=x>>6|192:(x<65536?p[b++]=x>>12|224:(p[b++]=x>>18|240,p[b++]=x>>12&63|128),p[b++]=x>>6&63|128),p[b++]=63&x|128)}return b}(this.buf,a,this.pos);var c=this.pos-i;c>=128&&M1(i,c,this),this.pos=i-1,this.writeVarint(c),this.pos+=c},writeFloat:function(a){this.realloc(4),T1(this.buf,a,this.pos,!0,23,4),this.pos+=4},writeDouble:function(a){this.realloc(8),T1(this.buf,a,this.pos,!0,52,8),this.pos+=8},writeBytes:function(a){var i=a.length;this.writeVarint(i),this.realloc(i);for(var c=0;c=128&&M1(c,p,this),this.pos=c-1,this.writeVarint(p),this.pos+=p},writeMessage:function(a,i,c){this.writeTag(a,Gn.Bytes),this.writeRawMessage(i,c)},writePackedVarint:function(a,i){i.length&&this.writeMessage(a,jC,i)},writePackedSVarint:function(a,i){i.length&&this.writeMessage(a,WC,i)},writePackedBoolean:function(a,i){i.length&&this.writeMessage(a,XC,i)},writePackedFloat:function(a,i){i.length&&this.writeMessage(a,ZC,i)},writePackedDouble:function(a,i){i.length&&this.writeMessage(a,HC,i)},writePackedFixed32:function(a,i){i.length&&this.writeMessage(a,YC,i)},writePackedSFixed32:function(a,i){i.length&&this.writeMessage(a,KC,i)},writePackedFixed64:function(a,i){i.length&&this.writeMessage(a,JC,i)},writePackedSFixed64:function(a,i){i.length&&this.writeMessage(a,QC,i)},writeBytesField:function(a,i){this.writeTag(a,Gn.Bytes),this.writeBytes(i)},writeFixed32Field:function(a,i){this.writeTag(a,Gn.Fixed32),this.writeFixed32(i)},writeSFixed32Field:function(a,i){this.writeTag(a,Gn.Fixed32),this.writeSFixed32(i)},writeFixed64Field:function(a,i){this.writeTag(a,Gn.Fixed64),this.writeFixed64(i)},writeSFixed64Field:function(a,i){this.writeTag(a,Gn.Fixed64),this.writeSFixed64(i)},writeVarintField:function(a,i){this.writeTag(a,Gn.Varint),this.writeVarint(i)},writeSVarintField:function(a,i){this.writeTag(a,Gn.Varint),this.writeSVarint(i)},writeStringField:function(a,i){this.writeTag(a,Gn.Bytes),this.writeString(i)},writeFloatField:function(a,i){this.writeTag(a,Gn.Fixed32),this.writeFloat(i)},writeDoubleField:function(a,i){this.writeTag(a,Gn.Fixed64),this.writeDouble(i)},writeBooleanField:function(a,i){this.writeVarintField(a,!!i)}};var n_=y(I1);const r_=3;function $C(a,i,c){a===1&&c.readMessage(tT,i)}function tT(a,i,c){if(a===3){const{id:p,bitmap:g,width:b,height:x,left:E,top:L,advance:A}=c.readMessage(eT,{});i.push({id:p,bitmap:new Ip({width:b+2*r_,height:x+2*r_},g),metrics:{width:b,height:x,left:E,top:L,advance:A}})}}function eT(a,i,c){a===1?i.id=c.readVarint():a===2?i.bitmap=c.readBytes():a===3?i.width=c.readVarint():a===4?i.height=c.readVarint():a===5?i.left=c.readSVarint():a===6?i.top=c.readSVarint():a===7&&(i.advance=c.readVarint())}const k1=r_;function D1(a){let i=0,c=0;for(const x of a)i+=x.w*x.h,c=Math.max(c,x.w);a.sort((x,E)=>E.h-x.h);const p=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(i/.95)),c),h:1/0}];let g=0,b=0;for(const x of a)for(let E=p.length-1;E>=0;E--){const L=p[E];if(!(x.w>L.w||x.h>L.h)){if(x.x=L.x,x.y=L.y,b=Math.max(b,x.y+x.h),g=Math.max(g,x.x+x.w),x.w===L.w&&x.h===L.h){const A=p.pop();E=0&&p>=i&&zm[this.text.charCodeAt(p)];p--)c--;this.text=this.text.substring(i,c),this.sectionIndex=this.sectionIndex.slice(i,c)}substring(i,c){const p=new Fh;return p.text=this.text.substring(i,c),p.sectionIndex=this.sectionIndex.slice(i,c),p.sections=this.sections,p}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((i,c)=>Math.max(i,this.sections[c].scale),0)}addTextSection(i,c){this.text+=i.text,this.sections.push(Rp.forText(i.scale,i.fontStack||c));const p=this.sections.length-1;for(let g=0;g=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Om(a,i,c,p,g,b,x,E,L,A,D,N,U,W,H,et){const st=Fh.fromFeature(a,g);let pt;N===h.ah.vertical&&st.verticalizePunctuation();const{processBidirectionalText:It,processStyledBidirectionalText:gt}=Ua;if(It&&st.sections.length===1){pt=[];const Yt=It(st.toString(),o_(st,A,b,i,p,W,H));for(const ge of Yt){const xe=new Fh;xe.text=ge,xe.sections=st.sections;for(let me=0;me0&&Ml>Ro&&(Ro=Ml)}else{const ys=xe[gn.fontStack],Oo=ys&&ys[Ni];if(Oo&&Oo.rect)ma=Oo.rect,Us=Oo.metrics;else{const Ml=ge[gn.fontStack],Bp=Ml&&Ml[Ni];if(!Bp)continue;Us=Bp.metrics}si=(ii-gn.scale)*ei}Gs?(Yt.verticalizable=!0,Qi.push({glyph:Ni,imageName:ga,x:Jn,y:ir+si,vertical:Gs,scale:gn.scale,fontStack:gn.fontStack,sectionIndex:$i,metrics:Us,rect:ma}),Jn+=Pl*gn.scale+De):(Qi.push({glyph:Ni,imageName:ga,x:Jn,y:ir+si,vertical:Gs,scale:gn.scale,fontStack:gn.fontStack,sectionIndex:$i,metrics:Us,rect:ma}),Jn+=Us.advance*gn.scale+De)}Qi.length!==0&&(ni=Math.max(Jn-De,ni),iT(Qi,0,Qi.length-1,fo,Ro)),Jn=0;const No=oe*ii+Ro;go.lineOffset=Math.max(Ro,Ji),ir+=No,Qo=Math.max(No,Qo),++Kr}var wi;const Ri=ir-Dp,{horizontalAlign:po,verticalAlign:mo}=s_(ve);(function(ri,ii,Ji,go,Qi,Ro,No,oi,gn){const $i=(ii-Ji)*Qi;let Ni=0;Ni=Ro!==No?-oi*go-Dp:(-go*gn+.5)*No;for(const si of ri)for(const Us of si.positionedGlyphs)Us.x+=$i,Us.y+=Ni})(Yt.positionedLines,fo,po,mo,ni,Qo,oe,Ri,he.length),Yt.top+=-mo*Ri,Yt.bottom=Yt.top+Ri,Yt.left+=-po*ni,Yt.right=Yt.left+ni}(Xt,i,c,p,pt,x,E,L,N,A,U,et),!function(Yt){for(const ge of Yt)if(ge.positionedGlyphs.length!==0)return!1;return!0}(xt)&&Xt}const zm={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},nT={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 N1(a,i,c,p,g,b){if(i.imageName){const x=p[i.imageName];return x?x.displaySize[0]*i.scale*ei/b+g:0}{const x=c[i.fontStack],E=x&&x[a];return E?E.metrics.advance*i.scale+g:0}}function O1(a,i,c,p){const g=Math.pow(a-i,2);return p?a=0;let D=0;for(let U=0;Ux.id),this.index=i.index,this.pixelRatio=i.pixelRatio,this.sourceLayerIndex=i.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Uy([]),this.placementViewportMatrix=Uy([]);const c=this.layers[0]._unevaluatedLayout._values;this.textSizeData=V1(this.zoom,c["text-size"]),this.iconSizeData=V1(this.zoom,c["icon-size"]);const p=this.layers[0].layout,g=p.get("symbol-sort-key"),b=p.get("symbol-z-order");this.canOverlap=a_(p,"text-overlap","text-allow-overlap")!=="never"||a_(p,"icon-overlap","icon-allow-overlap")!=="never"||p.get("text-ignore-placement")||p.get("icon-ignore-placement"),this.sortFeaturesByKey=b!=="viewport-y"&&!g.isConstant(),this.sortFeaturesByY=(b==="viewport-y"||b==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,p.get("symbol-placement")==="point"&&(this.writingModes=p.get("text-writing-mode").map(x=>h.ah[x])),this.stateDependentLayerIds=this.layers.filter(x=>x.isStateDependent()).map(x=>x.id),this.sourceID=i.sourceID}createArrays(){this.text=new u_(new dr(this.layers,this.zoom,i=>/^text/.test(i))),this.icon=new u_(new dr(this.layers,this.zoom,i=>/^icon/.test(i))),this.glyphOffsetArray=new v,this.lineVertexArray=new I,this.symbolInstances=new m,this.textAnchorOffsets=new M}calculateGlyphDependencies(i,c,p,g,b){for(let x=0;x0)&&(x.value.kind!=="constant"||x.value.value.length>0),D=L.value.kind!=="constant"||!!L.value.value||Object.keys(L.parameters).length>0,N=b.get("symbol-sort-key");if(this.features=[],!A&&!D)return;const U=c.iconDependencies,W=c.glyphDependencies,H=c.availableImages,et=new nr(this.zoom);for(const{feature:st,id:pt,index:It,sourceLayerIndex:gt}of i){const xt=g._featureFilter.needGeometry,Xt=Tl(st,xt);if(!g._featureFilter.filter(et,Xt,p))continue;let Yt,ge;if(xt||(Xt.geometry=Cl(st)),A){const me=g.getValueAndResolveTokens("text-field",Xt,p,H),he=Lo.factory(me),oe=this.hasRTLText=this.hasRTLText||lT(he);(!oe||Ua.getRTLTextPluginStatus()==="unavailable"||oe&&Ua.isParsed())&&(Yt=qC(he,g,Xt))}if(D){const me=g.getValueAndResolveTokens("icon-image",Xt,p,H);ge=me instanceof Yo?me:Yo.fromString(me)}if(!Yt&&!ge)continue;const xe=this.sortFeaturesByKey?N.evaluate(Xt,{},p):void 0;if(this.features.push({id:pt,text:Yt,icon:ge,index:It,sourceLayerIndex:gt,geometry:Xt.geometry,properties:st.properties,type:sT[st.type],sortKey:xe}),ge&&(U[ge.name]=!0),Yt){const me=x.evaluate(Xt,{},p).join(","),he=b.get("text-rotation-alignment")!=="viewport"&&b.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(h.ah.vertical)>=0;for(const oe of Yt.sections)if(oe.image)U[oe.image.name]=!0;else{const ve=uu(Yt.toString()),ue=oe.fontStack||me,te=W[ue]=W[ue]||{};this.calculateGlyphDependencies(oe.text,te,he,this.allowVerticalPlacement,ve)}}}b.get("symbol-placement")==="line"&&(this.features=function(st){const pt={},It={},gt=[];let xt=0;function Xt(me){gt.push(st[me]),xt++}function Yt(me,he,oe){const ve=It[me];return delete It[me],It[he]=ve,gt[ve].geometry[0].pop(),gt[ve].geometry[0]=gt[ve].geometry[0].concat(oe[0]),ve}function ge(me,he,oe){const ve=pt[he];return delete pt[he],pt[me]=ve,gt[ve].geometry[0].shift(),gt[ve].geometry[0]=oe[0].concat(gt[ve].geometry[0]),ve}function xe(me,he,oe){const ve=oe?he[0][he[0].length-1]:he[0][0];return`${me}:${ve.x}:${ve.y}`}for(let me=0;meme.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((st,pt)=>st.sortKey-pt.sortKey)}update(i,c,p){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(i,c,this.layers,p),this.icon.programConfigurations.updatePaintArrays(i,c,this.layers,p))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(i){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(i),this.iconCollisionBox.upload(i)),this.text.upload(i,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(i,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(i,c){const p=this.lineVertexArray.length;if(i.segment!==void 0){let g=i.dist(c[i.segment+1]),b=i.dist(c[i.segment]);const x={};for(let E=i.segment+1;E=0;E--)x[E]={x:c[E].x,y:c[E].y,tileUnitDistanceFromAnchor:b},E>0&&(b+=c[E-1].dist(c[E]));for(let E=0;E0}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(i,c){const p=i.placedSymbolArray.get(c),g=p.vertexStartIndex+4*p.numGlyphs;for(let b=p.vertexStartIndex;bg[E]-g[L]||b[L]-b[E]),x}addToSortKeyRanges(i,c){const p=this.sortKeyRanges[this.sortKeyRanges.length-1];p&&p.sortKey===c?p.symbolInstanceEnd=i+1:this.sortKeyRanges.push({sortKey:c,symbolInstanceStart:i,symbolInstanceEnd:i+1})}sortFeatures(i){if(this.sortFeaturesByY&&this.sortedAngle!==i&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(i),this.sortedAngle=i,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const c of this.symbolInstanceIndexes){const p=this.symbolInstances.get(c);this.featureSortOrder.push(p.featureIndex),[p.rightJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.leftJustifiedTextSymbolIndex].forEach((g,b,x)=>{g>=0&&x.indexOf(g)===b&&this.addIndicesForPlacedSymbol(this.text,g)}),p.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,p.verticalPlacedTextSymbolIndex),p.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,p.placedIconSymbolIndex),p.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,p.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let U1,G1;_e("SymbolBucket",Bh,{omit:["layers","collisionBoxArray","features","compareText"]}),Bh.MAX_GLYPHS=65535,Bh.addDynamicAttributes=l_;var h_={get paint(){return G1=G1||new co({"icon-opacity":new Re(Mt.paint_symbol["icon-opacity"]),"icon-color":new Re(Mt.paint_symbol["icon-color"]),"icon-halo-color":new Re(Mt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Re(Mt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Re(Mt.paint_symbol["icon-halo-blur"]),"icon-translate":new Ie(Mt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ie(Mt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Re(Mt.paint_symbol["text-opacity"]),"text-color":new Re(Mt.paint_symbol["text-color"],{runtimeType:Mr,getOverride:a=>a.textColor,hasOverride:a=>!!a.textColor}),"text-halo-color":new Re(Mt.paint_symbol["text-halo-color"]),"text-halo-width":new Re(Mt.paint_symbol["text-halo-width"]),"text-halo-blur":new Re(Mt.paint_symbol["text-halo-blur"]),"text-translate":new Ie(Mt.paint_symbol["text-translate"]),"text-translate-anchor":new Ie(Mt.paint_symbol["text-translate-anchor"])})},get layout(){return U1=U1||new co({"symbol-placement":new Ie(Mt.layout_symbol["symbol-placement"]),"symbol-spacing":new Ie(Mt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ie(Mt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Re(Mt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ie(Mt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ie(Mt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ie(Mt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ie(Mt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ie(Mt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ie(Mt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Re(Mt.layout_symbol["icon-size"]),"icon-text-fit":new Ie(Mt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ie(Mt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Re(Mt.layout_symbol["icon-image"]),"icon-rotate":new Re(Mt.layout_symbol["icon-rotate"]),"icon-padding":new Re(Mt.layout_symbol["icon-padding"]),"icon-keep-upright":new Ie(Mt.layout_symbol["icon-keep-upright"]),"icon-offset":new Re(Mt.layout_symbol["icon-offset"]),"icon-anchor":new Re(Mt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ie(Mt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ie(Mt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ie(Mt.layout_symbol["text-rotation-alignment"]),"text-field":new Re(Mt.layout_symbol["text-field"]),"text-font":new Re(Mt.layout_symbol["text-font"]),"text-size":new Re(Mt.layout_symbol["text-size"]),"text-max-width":new Re(Mt.layout_symbol["text-max-width"]),"text-line-height":new Ie(Mt.layout_symbol["text-line-height"]),"text-letter-spacing":new Re(Mt.layout_symbol["text-letter-spacing"]),"text-justify":new Re(Mt.layout_symbol["text-justify"]),"text-radial-offset":new Re(Mt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ie(Mt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Re(Mt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Re(Mt.layout_symbol["text-anchor"]),"text-max-angle":new Ie(Mt.layout_symbol["text-max-angle"]),"text-writing-mode":new Ie(Mt.layout_symbol["text-writing-mode"]),"text-rotate":new Re(Mt.layout_symbol["text-rotate"]),"text-padding":new Ie(Mt.layout_symbol["text-padding"]),"text-keep-upright":new Ie(Mt.layout_symbol["text-keep-upright"]),"text-transform":new Re(Mt.layout_symbol["text-transform"]),"text-offset":new Re(Mt.layout_symbol["text-offset"]),"text-allow-overlap":new Ie(Mt.layout_symbol["text-allow-overlap"]),"text-overlap":new Ie(Mt.layout_symbol["text-overlap"]),"text-ignore-placement":new Ie(Mt.layout_symbol["text-ignore-placement"]),"text-optional":new Ie(Mt.layout_symbol["text-optional"])})}};class q1{constructor(i){if(i.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=i.property.overrides?i.property.overrides.runtimeType:jr,this.defaultValue=i}evaluate(i){if(i.formattedSection){const c=this.defaultValue.property.overrides;if(c&&c.hasOverride(i.formattedSection))return c.getOverride(i.formattedSection)}return i.feature&&i.featureState?this.defaultValue.evaluate(i.feature,i.featureState):this.defaultValue.property.specification.default}eachChild(i){this.defaultValue.isConstant()||i(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}_e("FormatSectionOverride",q1,{omit:["defaultValue"]});class Bm extends ds{constructor(i){super(i,h_)}recalculate(i,c){if(super.recalculate(i,c),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 p=this.layout.get("text-writing-mode");if(p){const g=[];for(const b of p)g.indexOf(b)<0&&g.push(b);this.layout._values["text-writing-mode"]=g}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(i,c,p,g){const b=this.layout.get(i).evaluate(c,{},p,g),x=this._unevaluatedLayout._values[i];return x.isDataDriven()||Zn(x.value)||!b?b:function(E,L){return L.replace(/{([^{}]+)}/g,(A,D)=>E&&D in E?String(E[D]):"")}(c.properties,b)}createBucket(i){return new Bh(i)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const i of h_.paint.overridableProperties){if(!Bm.hasPaintOverride(this.layout,i))continue;const c=this.paint.get(i),p=new q1(c),g=new Kn(p,c.property.specification);let b=null;b=c.value.kind==="constant"||c.value.kind==="source"?new lh("source",g):new Qf("composite",g,c.value.zoomStops),this.paint._values[i]=new ps(c.property,b,c.parameters)}}_handleOverridablePaintPropertyUpdate(i,c,p){return!(!this.layout||c.isDataDriven()||p.isDataDriven())&&Bm.hasPaintOverride(this.layout,i)}static hasPaintOverride(i,c){const p=i.get("text-field"),g=h_.paint.properties[c];let b=!1;const x=E=>{for(const L of E)if(g.overrides&&g.overrides.hasOverride(L))return void(b=!0)};if(p.value.kind==="constant"&&p.value.value instanceof Lo)x(p.value.value.sections);else if(p.value.kind==="source"){const E=A=>{b||(A instanceof Oa&&Zr(A.value)===Nr?x(A.value.sections):A instanceof sh?x(A.sections):A.eachChild(E))},L=p.value;L._styleExpression&&E(L._styleExpression.expression)}return b}}let j1;var uT={get paint(){return j1=j1||new co({"background-color":new Ie(Mt.paint_background["background-color"]),"background-pattern":new ac(Mt.paint_background["background-pattern"]),"background-opacity":new Ie(Mt.paint_background["background-opacity"])})}};class cT extends ds{constructor(i){super(i,uT)}}let W1;var hT={get paint(){return W1=W1||new co({"raster-opacity":new Ie(Mt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ie(Mt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ie(Mt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ie(Mt.paint_raster["raster-brightness-max"]),"raster-saturation":new Ie(Mt.paint_raster["raster-saturation"]),"raster-contrast":new Ie(Mt.paint_raster["raster-contrast"]),"raster-resampling":new Ie(Mt.paint_raster["raster-resampling"]),"raster-fade-duration":new Ie(Mt.paint_raster["raster-fade-duration"])})}};class fT extends ds{constructor(i){super(i,hT)}}class pT extends ds{constructor(i){super(i,{}),this.onAdd=c=>{this.implementation.onAdd&&this.implementation.onAdd(c,c.painter.context.gl)},this.onRemove=c=>{this.implementation.onRemove&&this.implementation.onRemove(c,c.painter.context.gl)},this.implementation=i}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 dT{constructor(i){this._methodToThrottle=i,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 f_=63710088e-1;class du{constructor(i,c){if(isNaN(i)||isNaN(c))throw new Error(`Invalid LngLat object: (${i}, ${c})`);if(this.lng=+i,this.lat=+c,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new du(_t(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(i){const c=Math.PI/180,p=this.lat*c,g=i.lat*c,b=Math.sin(p)*Math.sin(g)+Math.cos(p)*Math.cos(g)*Math.cos((i.lng-this.lng)*c);return f_*Math.acos(Math.min(b,1))}static convert(i){if(i instanceof du)return i;if(Array.isArray(i)&&(i.length===2||i.length===3))return new du(Number(i[0]),Number(i[1]));if(!Array.isArray(i)&&typeof i=="object"&&i!==null)return new du(Number("lng"in i?i.lng:i.lon),Number(i.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 Z1=2*Math.PI*f_;function H1(a){return Z1*Math.cos(a*Math.PI/180)}function X1(a){return(180+a)/360}function Y1(a){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360}function K1(a,i){return a/H1(i)}function p_(a){return 360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90}class Vm{constructor(i,c,p=0){this.x=+i,this.y=+c,this.z=+p}static fromLngLat(i,c=0){const p=du.convert(i);return new Vm(X1(p.lng),Y1(p.lat),K1(c,p.lat))}toLngLat(){return new du(360*this.x-180,p_(this.y))}toAltitude(){return this.z*H1(p_(this.y))}meterInMercatorCoordinateUnits(){return 1/Z1*(i=p_(this.y),1/Math.cos(i*Math.PI/180));var i}}function J1(a,i,c){var p=2*Math.PI*6378137/256/Math.pow(2,c);return[a*p-2*Math.PI*6378137/2,i*p-2*Math.PI*6378137/2]}class d_{constructor(i,c,p){if(i<0||i>25||p<0||p>=Math.pow(2,i)||c<0||c>=Math.pow(2,i))throw new Error(`x=${c}, y=${p}, z=${i} outside of bounds. 0<=x<${Math.pow(2,i)}, 0<=y<${Math.pow(2,i)} 0<=z<=25 `);this.z=i,this.x=c,this.y=p,this.key=Op(0,i,i,c,p)}equals(i){return this.z===i.z&&this.x===i.x&&this.y===i.y}url(i,c,p){const g=(x=this.y,E=this.z,L=J1(256*(b=this.x),256*(x=Math.pow(2,E)-x-1),E),A=J1(256*(b+1),256*(x+1),E),L[0]+","+L[1]+","+A[0]+","+A[1]);var b,x,E,L,A;const D=function(N,U,W){let H,et="";for(let st=N;st>0;st--)H=1<1?"@2x":"").replace(/{quadkey}/g,D).replace(/{bbox-epsg-3857}/g,g)}isChildOf(i){const c=this.z-i.z;return c>0&&i.x===this.x>>c&&i.y===this.y>>c}getTilePoint(i){const c=Math.pow(2,this.z);return new C((i.x*c-this.x)*Ar,(i.y*c-this.y)*Ar)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Q1{constructor(i,c){this.wrap=i,this.canonical=c,this.key=Op(i,c.z,c.z,c.x,c.y)}}class gs{constructor(i,c,p,g,b){if(i= z; overscaledZ = ${i}; z = ${p}`);this.overscaledZ=i,this.wrap=c,this.canonical=new d_(p,+g,+b),this.key=Op(c,i,p,g,b)}clone(){return new gs(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(i){return this.overscaledZ===i.overscaledZ&&this.wrap===i.wrap&&this.canonical.equals(i.canonical)}scaledTo(i){if(i>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${i}; overscaledZ = ${this.overscaledZ}`);const c=this.canonical.z-i;return i>this.canonical.z?new gs(i,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new gs(i,this.wrap,i,this.canonical.x>>c,this.canonical.y>>c)}calculateScaledKey(i,c){if(i>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${i}; overscaledZ = ${this.overscaledZ}`);const p=this.canonical.z-i;return i>this.canonical.z?Op(this.wrap*+c,i,this.canonical.z,this.canonical.x,this.canonical.y):Op(this.wrap*+c,i,i,this.canonical.x>>p,this.canonical.y>>p)}isChildOf(i){if(i.wrap!==this.wrap)return!1;const c=this.canonical.z-i.canonical.z;return i.overscaledZ===0||i.overscaledZ>c&&i.canonical.y===this.canonical.y>>c}children(i){if(this.overscaledZ>=i)return[new gs(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const c=this.canonical.z+1,p=2*this.canonical.x,g=2*this.canonical.y;return[new gs(c,this.wrap,c,p,g),new gs(c,this.wrap,c,p+1,g),new gs(c,this.wrap,c,p,g+1),new gs(c,this.wrap,c,p+1,g+1)]}isLessThan(i){return this.wrapi.wrap)&&(this.overscaledZi.overscaledZ)&&(this.canonical.xi.canonical.x)&&this.canonical.ythis.max&&(this.max=N),N=this.dim+1||c<-1||c>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(c+1)*this.stride+(i+1)}unpack(i,c,p){return i*this.redFactor+c*this.greenFactor+p*this.blueFactor-this.baseShift}getPixels(){return new ms({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(i,c,p){if(this.dim!==i.dim)throw new Error("dem dimension mismatch");let g=c*this.dim,b=c*this.dim+this.dim,x=p*this.dim,E=p*this.dim+this.dim;switch(c){case-1:g=b-1;break;case 1:b=g+1}switch(p){case-1:x=E-1;break;case 1:E=x+1}const L=-c*this.dim,A=-p*this.dim;for(let D=x;D=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${i} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[i]}}class eb{constructor(i,c,p,g,b){this.type="Feature",this._vectorTileFeature=i,i._z=c,i._x=p,i._y=g,this.properties=i.properties,this.id=b}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(i){this._geometry=i}toJSON(){const i={geometry:this.geometry};for(const c in this)c!=="_geometry"&&c!=="_vectorTileFeature"&&(i[c]=this[c]);return i}}class nb{constructor(i,c){this.tileID=i,this.x=i.canonical.x,this.y=i.canonical.y,this.z=i.canonical.z,this.grid=new ic(Ar,16,0),this.grid3D=new ic(Ar,16,0),this.featureIndexArray=new z,this.promoteId=c}insert(i,c,p,g,b,x){const E=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(p,g,b);const L=x?this.grid3D:this.grid;for(let A=0;A=0&&N[3]>=0&&L.insert(E,N[0],N[1],N[2],N[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new hu.VectorTile(new n_(this.rawTileData)).layers,this.sourceLayerCoder=new tb(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(i,c,p,g){this.loadVTLayers();const b=i.params||{},x=Ar/i.tileSize/i.scale,E=fh(b.filter),L=i.queryGeometry,A=i.queryPadding*x,D=ib(L),N=this.grid.query(D.minX-A,D.minY-A,D.maxX+A,D.maxY+A),U=ib(i.cameraQueryGeometry),W=this.grid3D.query(U.minX-A,U.minY-A,U.maxX+A,U.maxY+A,(st,pt,It,gt)=>function(xt,Xt,Yt,ge,xe){for(const he of xt)if(Xt<=he.x&&Yt<=he.y&&ge>=he.x&&xe>=he.y)return!0;const me=[new C(Xt,Yt),new C(Xt,xe),new C(ge,xe),new C(ge,Yt)];if(xt.length>2){for(const he of me)if(kh(xt,he))return!0}for(let he=0;he(gt||(gt=Cl(xt)),Xt.queryIntersectsFeature(L,xt,Yt,gt,this.z,i.transform,x,i.pixelPosMatrix)))}return H}loadMatchingFeature(i,c,p,g,b,x,E,L,A,D,N){const U=this.bucketLayerIDs[c];if(x&&!function(st,pt){for(let It=0;It=0)return!0;return!1}(x,U))return;const W=this.sourceLayerCoder.decode(p),H=this.vtLayers[W].feature(g);if(b.needGeometry){const st=Tl(H,!0);if(!b.filter(new nr(this.tileID.overscaledZ),st,this.tileID.canonical))return}else if(!b.filter(new nr(this.tileID.overscaledZ),H))return;const et=this.getId(H,W);for(let st=0;st{const E=i instanceof sc?i.get(x):null;return E&&E.evaluate?E.evaluate(c,p,g):E})}function ib(a){let i=1/0,c=1/0,p=-1/0,g=-1/0;for(const b of a)i=Math.min(i,b.x),c=Math.min(c,b.y),p=Math.max(p,b.x),g=Math.max(g,b.y);return{minX:i,minY:c,maxX:p,maxY:g}}function mT(a,i){return i-a}function ob(a,i,c,p,g){const b=[];for(let x=0;x=p&&N.x>=p||(D.x>=p?D=new C(p,D.y+(p-D.x)/(N.x-D.x)*(N.y-D.y))._round():N.x>=p&&(N=new C(p,D.y+(p-D.x)/(N.x-D.x)*(N.y-D.y))._round()),D.y>=g&&N.y>=g||(D.y>=g?D=new C(D.x+(g-D.y)/(N.y-D.y)*(N.x-D.x),g)._round():N.y>=g&&(N=new C(D.x+(g-D.y)/(N.y-D.y)*(N.x-D.x),g)._round()),L&&D.equals(L[L.length-1])||(L=[D],b.push(L)),L.push(N)))))}}return b}_e("FeatureIndex",nb,{omit:["rawTileData","sourceLayerCoder"]});class mu extends C{constructor(i,c,p,g){super(i,c),this.angle=p,g!==void 0&&(this.segment=g)}clone(){return new mu(this.x,this.y,this.angle,this.segment)}}function sb(a,i,c,p,g){if(i.segment===void 0||c===0)return!0;let b=i,x=i.segment+1,E=0;for(;E>-c/2;){if(x--,x<0)return!1;E-=a[x].dist(b),b=a[x]}E+=a[x].dist(a[x+1]),x++;const L=[];let A=0;for(;Ep;)A-=L.shift().angleDelta;if(A>g)return!1;x++,E+=D.dist(N)}return!0}function ab(a){let i=0;for(let c=0;cA){const H=(A-L)/W,et=Yi.number(N.x,U.x,H),st=Yi.number(N.y,U.y,H),pt=new mu(et,st,U.angleTo(N),D);return pt._round(),!x||sb(a,pt,E,x,i)?pt:void 0}L+=W}}function yT(a,i,c,p,g,b,x,E,L){const A=lb(p,b,x),D=ub(p,g),N=D*x,U=a[0].x===0||a[0].x===L||a[0].y===0||a[0].y===L;return i-N=0&&xt=0&&Xt=0&&U+A<=D){const Yt=new mu(xt,Xt,It,H);Yt._round(),p&&!sb(a,Yt,b,p,g)||W.push(Yt)}}N+=pt}return E||W.length||x||(W=cb(a,N/2,c,p,g,b,x,!0,L)),W}_e("Anchor",mu);const Vh=Do;function hb(a,i,c,p){const g=[],b=a.image,x=b.pixelRatio,E=b.paddedRect.w-2*Vh,L=b.paddedRect.h-2*Vh,A=a.right-a.left,D=a.bottom-a.top,N=b.stretchX||[[0,E]],U=b.stretchY||[[0,L]],W=(oe,ve)=>oe+ve[1]-ve[0],H=N.reduce(W,0),et=U.reduce(W,0),st=E-H,pt=L-et;let It=0,gt=H,xt=0,Xt=et,Yt=0,ge=st,xe=0,me=pt;if(b.content&&p){const oe=b.content;It=Um(N,0,oe[0]),xt=Um(U,0,oe[1]),gt=Um(N,oe[0],oe[2]),Xt=Um(U,oe[1],oe[3]),Yt=oe[0]-It,xe=oe[1]-xt,ge=oe[2]-oe[0]-gt,me=oe[3]-oe[1]-Xt}const he=(oe,ve,ue,te)=>{const De=Gm(oe.stretch-It,gt,A,a.left),Se=qm(oe.fixed-Yt,ge,oe.stretch,H),ln=Gm(ve.stretch-xt,Xt,D,a.top),Jn=qm(ve.fixed-xe,me,ve.stretch,et),ir=Gm(ue.stretch-It,gt,A,a.left),ni=qm(ue.fixed-Yt,ge,ue.stretch,H),Qo=Gm(te.stretch-xt,Xt,D,a.top),fo=qm(te.fixed-xe,me,te.stretch,et),Kr=new C(De,ln),wi=new C(ir,ln),Ri=new C(ir,Qo),po=new C(De,Qo),mo=new C(Se/x,Jn/x),ri=new C(ni/x,fo/x),ii=i*Math.PI/180;if(ii){const Qi=Math.sin(ii),Ro=Math.cos(ii),No=[Ro,-Qi,Qi,Ro];Kr._matMult(No),wi._matMult(No),po._matMult(No),Ri._matMult(No)}const Ji=oe.stretch+oe.fixed,go=ve.stretch+ve.fixed;return{tl:Kr,tr:wi,bl:po,br:Ri,tex:{x:b.paddedRect.x+Vh+Ji,y:b.paddedRect.y+Vh+go,w:ue.stretch+ue.fixed-Ji,h:te.stretch+te.fixed-go},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:mo,pixelOffsetBR:ri,minFontScaleX:ge/x/A,minFontScaleY:me/x/D,isSDF:c}};if(p&&(b.stretchX||b.stretchY)){const oe=fb(N,st,H),ve=fb(U,pt,et);for(let ue=0;ue0&&(H=Math.max(10,H),this.circleDiameter=H)}else{let N=x.top*E-L[0],U=x.bottom*E+L[2],W=x.left*E-L[3],H=x.right*E+L[1];const et=x.collisionPadding;if(et&&(W-=et[0]*E,N-=et[1]*E,H+=et[2]*E,U+=et[3]*E),D){const st=new C(W,N),pt=new C(H,N),It=new C(W,U),gt=new C(H,U),xt=D*Math.PI/180;st._rotate(xt),pt._rotate(xt),It._rotate(xt),gt._rotate(xt),W=Math.min(st.x,pt.x,It.x,gt.x),H=Math.max(st.x,pt.x,It.x,gt.x),N=Math.min(st.y,pt.y,It.y,gt.y),U=Math.max(st.y,pt.y,It.y,gt.y)}i.emplaceBack(c.x,c.y,W,N,H,U,p,g,b)}this.boxEndIndex=i.length}}class _T{constructor(i=[],c=vT){if(this.data=i,this.length=this.data.length,this.compare=c,this.length>0)for(let p=(this.length>>1)-1;p>=0;p--)this._down(p)}push(i){this.data.push(i),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const i=this.data[0],c=this.data.pop();return this.length--,this.length>0&&(this.data[0]=c,this._down(0)),i}peek(){return this.data[0]}_up(i){const{data:c,compare:p}=this,g=c[i];for(;i>0;){const b=i-1>>1,x=c[b];if(p(g,x)>=0)break;c[i]=x,i=b}c[i]=g}_down(i){const{data:c,compare:p}=this,g=this.length>>1,b=c[i];for(;i=0)break;c[i]=E,i=x}c[i]=b}}function vT(a,i){return ai?1:0}function bT(a,i=1,c=!1){let p=1/0,g=1/0,b=-1/0,x=-1/0;const E=a[0];for(let W=0;Wb)&&(b=H.x),(!W||H.y>x)&&(x=H.y)}const L=Math.min(b-p,x-g);let A=L/2;const D=new _T([],xT);if(L===0)return new C(p,g);for(let W=p;WN.d||!N.d)&&(N=W,c&&console.log("found best %d after %d probes",Math.round(1e4*W.d)/1e4,U)),W.max-N.d<=i||(A=W.h/2,D.push(new Uh(W.p.x-A,W.p.y-A,A,a)),D.push(new Uh(W.p.x+A,W.p.y-A,A,a)),D.push(new Uh(W.p.x-A,W.p.y+A,A,a)),D.push(new Uh(W.p.x+A,W.p.y+A,A,a)),U+=4)}return c&&(console.log(`num probes: ${U}`),console.log(`best distance: ${N.d}`)),N.p}function xT(a,i){return i.max-a.max}function Uh(a,i,c,p){this.p=new C(a,i),this.h=c,this.d=function(g,b){let x=!1,E=1/0;for(let L=0;Lg.y!=H.y>g.y&&g.x<(H.x-W.x)*(g.y-W.y)/(H.y-W.y)+W.x&&(x=!x),E=Math.min(E,Yv(g,W,H))}}return(x?1:-1)*Math.sqrt(E)}(this.p,p),this.max=this.d+this.h*Math.SQRT2}var Di;h.ap=void 0,(Di=h.ap||(h.ap={}))[Di.center=1]="center",Di[Di.left=2]="left",Di[Di.right=3]="right",Di[Di.top=4]="top",Di[Di.bottom=5]="bottom",Di[Di["top-left"]=6]="top-left",Di[Di["top-right"]=7]="top-right",Di[Di["bottom-left"]=8]="bottom-left",Di[Di["bottom-right"]=9]="bottom-right";const gu=7,m_=Number.POSITIVE_INFINITY;function pb(a,i){return i[1]!==m_?function(c,p,g){let b=0,x=0;switch(p=Math.abs(p),g=Math.abs(g),c){case"top-right":case"top-left":case"top":x=g-gu;break;case"bottom-right":case"bottom-left":case"bottom":x=-g+gu}switch(c){case"top-right":case"bottom-right":case"right":b=-p;break;case"top-left":case"bottom-left":case"left":b=p}return[b,x]}(a,i[0],i[1]):function(c,p){let g=0,b=0;p<0&&(p=0);const x=p/Math.SQRT2;switch(c){case"top-right":case"top-left":b=x-gu;break;case"bottom-right":case"bottom-left":b=-x+gu;break;case"bottom":b=-p+gu;break;case"top":b=p-gu}switch(c){case"top-right":case"bottom-right":g=-x;break;case"top-left":case"bottom-left":g=x;break;case"left":g=p;break;case"right":g=-p}return[g,b]}(a,i[0])}function db(a,i,c){var p;const g=a.layout,b=(p=g.get("text-variable-anchor-offset"))===null||p===void 0?void 0:p.evaluate(i,{},c);if(b){const E=b.values,L=[];for(let A=0;AU*ei);D.startsWith("top")?N[1]-=gu:D.startsWith("bottom")&&(N[1]+=gu),L[A+1]=N}return new Xo(L)}const x=g.get("text-variable-anchor");if(x){let E;E=a._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[g.get("text-radial-offset").evaluate(i,{},c)*ei,m_]:g.get("text-offset").evaluate(i,{},c).map(A=>A*ei);const L=[];for(const A of x)L.push(A,pb(A,E));return new Xo(L)}return null}function g_(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 wT(a,i,c,p,g,b,x,E,L,A,D){let N=b.textMaxSize.evaluate(i,{});N===void 0&&(N=x);const U=a.layers[0].layout,W=U.get("icon-offset").evaluate(i,{},D),H=gb(c.horizontal),et=x/24,st=a.tilePixelRatio*et,pt=a.tilePixelRatio*N/24,It=a.tilePixelRatio*E,gt=a.tilePixelRatio*U.get("symbol-spacing"),xt=U.get("text-padding")*a.tilePixelRatio,Xt=function(te,De,Se,ln=1){const Jn=te.get("icon-padding").evaluate(De,{},Se),ir=Jn&&Jn.values;return[ir[0]*ln,ir[1]*ln,ir[2]*ln,ir[3]*ln]}(U,i,D,a.tilePixelRatio),Yt=U.get("text-max-angle")/180*Math.PI,ge=U.get("text-rotation-alignment")!=="viewport"&&U.get("symbol-placement")!=="point",xe=U.get("icon-rotation-alignment")==="map"&&U.get("symbol-placement")!=="point",me=U.get("symbol-placement"),he=gt/2,oe=U.get("icon-text-fit");let ve;p&&oe!=="none"&&(a.allowVerticalPlacement&&c.vertical&&(ve=B1(p,c.vertical,oe,U.get("icon-text-fit-padding"),W,et)),H&&(p=B1(p,H,oe,U.get("icon-text-fit-padding"),W,et)));const ue=(te,De)=>{De.x<0||De.x>=Ar||De.y<0||De.y>=Ar||function(Se,ln,Jn,ir,ni,Qo,fo,Kr,wi,Ri,po,mo,ri,ii,Ji,go,Qi,Ro,No,oi,gn,$i,Ni,si,Us){const ma=Se.addToLineVertexArray(ln,Jn);let ga,Pl,Gs,ys,Oo=0,Ml=0,Bp=0,bb=0,E_=-1,I_=-1;const Al={};let xb=Sr("");if(Se.allowVerticalPlacement&&ir.vertical){const to=Kr.layout.get("text-rotate").evaluate(gn,{},si)+90;Gs=new jm(wi,ln,Ri,po,mo,ir.vertical,ri,ii,Ji,to),fo&&(ys=new jm(wi,ln,Ri,po,mo,fo,Qi,Ro,Ji,to))}if(ni){const to=Kr.layout.get("icon-rotate").evaluate(gn,{}),_s=Kr.layout.get("icon-text-fit")!=="none",mc=hb(ni,to,Ni,_s),_a=fo?hb(fo,to,Ni,_s):void 0;Pl=new jm(wi,ln,Ri,po,mo,ni,Qi,Ro,!1,to),Oo=4*mc.length;const gc=Se.iconSizeData;let Za=null;gc.kind==="source"?(Za=[Wa*Kr.layout.get("icon-size").evaluate(gn,{})],Za[0]>pu&&$t(`${Se.layerIds[0]}: Value for "icon-size" is >= ${Np}. Reduce your "icon-size".`)):gc.kind==="composite"&&(Za=[Wa*$i.compositeIconSizes[0].evaluate(gn,{},si),Wa*$i.compositeIconSizes[1].evaluate(gn,{},si)],(Za[0]>pu||Za[1]>pu)&&$t(`${Se.layerIds[0]}: Value for "icon-size" is >= ${Np}. Reduce your "icon-size".`)),Se.addSymbols(Se.icon,mc,Za,oi,No,gn,h.ah.none,ln,ma.lineStartIndex,ma.lineLength,-1,si),E_=Se.icon.placedSymbolArray.length-1,_a&&(Ml=4*_a.length,Se.addSymbols(Se.icon,_a,Za,oi,No,gn,h.ah.vertical,ln,ma.lineStartIndex,ma.lineLength,-1,si),I_=Se.icon.placedSymbolArray.length-1)}const wb=Object.keys(ir.horizontal);for(const to of wb){const _s=ir.horizontal[to];if(!ga){xb=Sr(_s.text);const _a=Kr.layout.get("text-rotate").evaluate(gn,{},si);ga=new jm(wi,ln,Ri,po,mo,_s,ri,ii,Ji,_a)}const mc=_s.positionedLines.length===1;if(Bp+=mb(Se,ln,_s,Qo,Kr,Ji,gn,go,ma,ir.vertical?h.ah.horizontal:h.ah.horizontalOnly,mc?wb:[to],Al,E_,$i,si),mc)break}ir.vertical&&(bb+=mb(Se,ln,ir.vertical,Qo,Kr,Ji,gn,go,ma,h.ah.vertical,["vertical"],Al,I_,$i,si));const IT=ga?ga.boxStartIndex:Se.collisionBoxArray.length,CT=ga?ga.boxEndIndex:Se.collisionBoxArray.length,TT=Gs?Gs.boxStartIndex:Se.collisionBoxArray.length,LT=Gs?Gs.boxEndIndex:Se.collisionBoxArray.length,PT=Pl?Pl.boxStartIndex:Se.collisionBoxArray.length,MT=Pl?Pl.boxEndIndex:Se.collisionBoxArray.length,AT=ys?ys.boxStartIndex:Se.collisionBoxArray.length,kT=ys?ys.boxEndIndex:Se.collisionBoxArray.length;let ya=-1;const Zm=(to,_s)=>to&&to.circleDiameter?Math.max(to.circleDiameter,_s):_s;ya=Zm(ga,ya),ya=Zm(Gs,ya),ya=Zm(Pl,ya),ya=Zm(ys,ya);const Sb=ya>-1?1:0;Sb&&(ya*=Us/ei),Se.glyphOffsetArray.length>=Bh.MAX_GLYPHS&&$t("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),gn.sortKey!==void 0&&Se.addToSortKeyRanges(Se.symbolInstances.length,gn.sortKey);const DT=db(Kr,gn,si),[RT,NT]=function(to,_s){const mc=to.length,_a=_s==null?void 0:_s.values;if((_a==null?void 0:_a.length)>0)for(let gc=0;gc<_a.length;gc+=2){const Za=_a[gc+1];to.emplaceBack(h.ap[_a[gc]],Za[0],Za[1])}return[mc,to.length]}(Se.textAnchorOffsets,DT);Se.symbolInstances.emplaceBack(ln.x,ln.y,Al.right>=0?Al.right:-1,Al.center>=0?Al.center:-1,Al.left>=0?Al.left:-1,Al.vertical||-1,E_,I_,xb,IT,CT,TT,LT,PT,MT,AT,kT,Ri,Bp,bb,Oo,Ml,Sb,0,ri,ya,RT,NT)}(a,De,te,c,p,g,ve,a.layers[0],a.collisionBoxArray,i.index,i.sourceLayerIndex,a.index,st,[xt,xt,xt,xt],ge,L,It,Xt,xe,W,i,b,A,D,x)};if(me==="line")for(const te of ob(i.geometry,0,0,Ar,Ar)){const De=yT(te,gt,Yt,c.vertical||H,p,24,pt,a.overscaling,Ar);for(const Se of De)H&&ST(a,H.text,he,Se)||ue(te,Se)}else if(me==="line-center"){for(const te of i.geometry)if(te.length>1){const De=gT(te,Yt,c.vertical||H,p,24,pt);De&&ue(te,De)}}else if(i.type==="Polygon")for(const te of Xy(i.geometry,0)){const De=bT(te,16);ue(te[0],new mu(De.x,De.y,0))}else if(i.type==="LineString")for(const te of i.geometry)ue(te,new mu(te[0].x,te[0].y,0));else if(i.type==="Point")for(const te of i.geometry)for(const De of te)ue([De],new mu(De.x,De.y,0))}function mb(a,i,c,p,g,b,x,E,L,A,D,N,U,W,H){const et=function(It,gt,xt,Xt,Yt,ge,xe,me){const he=Xt.layout.get("text-rotate").evaluate(ge,{})*Math.PI/180,oe=[];for(const ve of gt.positionedLines)for(const ue of ve.positionedGlyphs){if(!ue.rect)continue;const te=ue.rect||{};let De=k1+1,Se=!0,ln=1,Jn=0;const ir=(Yt||me)&&ue.vertical,ni=ue.metrics.advance*ue.scale/2;if(me&>.verticalizable&&(Jn=ve.lineOffset/2-(ue.imageName?-(ei-ue.metrics.width*ue.scale)/2:(ue.scale-1)*ei)),ue.imageName){const oi=xe[ue.imageName];Se=oi.sdf,ln=oi.pixelRatio,De=Do/ln}const Qo=Yt?[ue.x+ni,ue.y]:[0,0];let fo=Yt?[0,0]:[ue.x+ni+xt[0],ue.y+xt[1]-Jn],Kr=[0,0];ir&&(Kr=fo,fo=[0,0]);const wi=ue.metrics.isDoubleResolution?2:1,Ri=(ue.metrics.left-De)*ue.scale-ni+fo[0],po=(-ue.metrics.top-De)*ue.scale+fo[1],mo=Ri+te.w/wi*ue.scale/ln,ri=po+te.h/wi*ue.scale/ln,ii=new C(Ri,po),Ji=new C(mo,po),go=new C(Ri,ri),Qi=new C(mo,ri);if(ir){const oi=new C(-ni,ni-Dp),gn=-Math.PI/2,$i=ei/2-ni,Ni=new C(5-Dp-$i,-(ue.imageName?$i:0)),si=new C(...Kr);ii._rotateAround(gn,oi)._add(Ni)._add(si),Ji._rotateAround(gn,oi)._add(Ni)._add(si),go._rotateAround(gn,oi)._add(Ni)._add(si),Qi._rotateAround(gn,oi)._add(Ni)._add(si)}if(he){const oi=Math.sin(he),gn=Math.cos(he),$i=[gn,-oi,oi,gn];ii._matMult($i),Ji._matMult($i),go._matMult($i),Qi._matMult($i)}const Ro=new C(0,0),No=new C(0,0);oe.push({tl:ii,tr:Ji,bl:go,br:Qi,tex:te,writingMode:gt.writingMode,glyphOffset:Qo,sectionIndex:ue.sectionIndex,isSDF:Se,pixelOffsetTL:Ro,pixelOffsetBR:No,minFontScaleX:0,minFontScaleY:0})}return oe}(0,c,E,g,b,x,p,a.allowVerticalPlacement),st=a.textSizeData;let pt=null;st.kind==="source"?(pt=[Wa*g.layout.get("text-size").evaluate(x,{})],pt[0]>pu&&$t(`${a.layerIds[0]}: Value for "text-size" is >= ${Np}. Reduce your "text-size".`)):st.kind==="composite"&&(pt=[Wa*W.compositeTextSizes[0].evaluate(x,{},H),Wa*W.compositeTextSizes[1].evaluate(x,{},H)],(pt[0]>pu||pt[1]>pu)&&$t(`${a.layerIds[0]}: Value for "text-size" is >= ${Np}. Reduce your "text-size".`)),a.addSymbols(a.text,et,pt,E,b,x,A,i,L.lineStartIndex,L.lineLength,U,H);for(const It of D)N[It]=a.text.placedSymbolArray.length-1;return 4*et.length}function gb(a){for(const i in a)return a[i];return null}function ST(a,i,c,p){const g=a.compareText;if(i in g){const b=g[i];for(let x=b.length-1;x>=0;x--)if(p.dist(b[x])>4;if(g!==1)throw new Error(`Got v${g} data when expected v1.`);const b=yb[15&p];if(!b)throw new Error("Unrecognized array type.");const[x]=new Uint16Array(i,2,1),[E]=new Uint32Array(i,4,1);return new y_(E,x,b,i)}constructor(i,c=64,p=Float64Array,g){if(isNaN(i)||i<0)throw new Error(`Unpexpected numItems value: ${i}.`);this.numItems=+i,this.nodeSize=Math.min(Math.max(+c,2),65535),this.ArrayType=p,this.IndexArrayType=i<65536?Uint16Array:Uint32Array;const b=yb.indexOf(this.ArrayType),x=2*i*this.ArrayType.BYTES_PER_ELEMENT,E=i*this.IndexArrayType.BYTES_PER_ELEMENT,L=(8-E%8)%8;if(b<0)throw new Error(`Unexpected typed array class: ${p}.`);g&&g instanceof ArrayBuffer?(this.data=g,this.ids=new this.IndexArrayType(this.data,8,i),this.coords=new this.ArrayType(this.data,8+E+L,2*i),this._pos=2*i,this._finished=!0):(this.data=new ArrayBuffer(8+x+E+L),this.ids=new this.IndexArrayType(this.data,8,i),this.coords=new this.ArrayType(this.data,8+E+L,2*i),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+b]),new Uint16Array(this.data,2,1)[0]=c,new Uint32Array(this.data,4,1)[0]=i)}add(i,c){const p=this._pos>>1;return this.ids[p]=p,this.coords[this._pos++]=i,this.coords[this._pos++]=c,p}finish(){const i=this._pos>>1;if(i!==this.numItems)throw new Error(`Added ${i} items when expected ${this.numItems}.`);return __(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(i,c,p,g){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:b,coords:x,nodeSize:E}=this,L=[0,b.length-1,0],A=[];for(;L.length;){const D=L.pop()||0,N=L.pop()||0,U=L.pop()||0;if(N-U<=E){for(let st=U;st<=N;st++){const pt=x[2*st],It=x[2*st+1];pt>=i&&pt<=p&&It>=c&&It<=g&&A.push(b[st])}continue}const W=U+N>>1,H=x[2*W],et=x[2*W+1];H>=i&&H<=p&&et>=c&&et<=g&&A.push(b[W]),(D===0?i<=H:c<=et)&&(L.push(U),L.push(W-1),L.push(1-D)),(D===0?p>=H:g>=et)&&(L.push(W+1),L.push(N),L.push(1-D))}return A}within(i,c,p){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:g,coords:b,nodeSize:x}=this,E=[0,g.length-1,0],L=[],A=p*p;for(;E.length;){const D=E.pop()||0,N=E.pop()||0,U=E.pop()||0;if(N-U<=x){for(let st=U;st<=N;st++)vb(b[2*st],b[2*st+1],i,c)<=A&&L.push(g[st]);continue}const W=U+N>>1,H=b[2*W],et=b[2*W+1];vb(H,et,i,c)<=A&&L.push(g[W]),(D===0?i-p<=H:c-p<=et)&&(E.push(U),E.push(W-1),E.push(1-D)),(D===0?i+p>=H:c+p>=et)&&(E.push(W+1),E.push(N),E.push(1-D))}return L}}function __(a,i,c,p,g,b){if(g-p<=c)return;const x=p+g>>1;_b(a,i,x,p,g,b),__(a,i,c,p,x-1,1-b),__(a,i,c,x+1,g,1-b)}function _b(a,i,c,p,g,b){for(;g>p;){if(g-p>600){const A=g-p+1,D=c-p+1,N=Math.log(A),U=.5*Math.exp(2*N/3),W=.5*Math.sqrt(N*U*(A-U)/A)*(D-A/2<0?-1:1);_b(a,i,c,Math.max(p,Math.floor(c-D*U/A+W)),Math.min(g,Math.floor(c+(A-D)*U/A+W)),b)}const x=i[2*c+b];let E=p,L=g;for(zp(a,i,p,c),i[2*g+b]>x&&zp(a,i,p,g);Ex;)L--}i[2*p+b]===x?zp(a,i,p,L):(L++,zp(a,i,L,g)),L<=c&&(p=L+1),c<=L&&(g=L-1)}}function zp(a,i,c,p){v_(a,c,p),v_(i,2*c,2*p),v_(i,2*c+1,2*p+1)}function v_(a,i,c){const p=a[i];a[i]=a[c],a[c]=p}function vb(a,i,c,p){const g=a-c,b=i-p;return g*g+b*b}var b_;h.bd=void 0,(b_=h.bd||(h.bd={})).create="create",b_.load="load",b_.fullLoad="fullLoad";let Wm=null,Fp=[];const x_=1e3/60,w_="loadTime",S_="fullLoadTime",ET={mark(a){performance.mark(a)},frame(a){const i=a;Wm!=null&&Fp.push(i-Wm),Wm=i},clearMetrics(){Wm=null,Fp=[],performance.clearMeasures(w_),performance.clearMeasures(S_);for(const a in h.bd)performance.clearMarks(h.bd[a])},getPerformanceMetrics(){performance.measure(w_,h.bd.create,h.bd.load),performance.measure(S_,h.bd.create,h.bd.fullLoad);const a=performance.getEntriesByName(w_)[0].duration,i=performance.getEntriesByName(S_)[0].duration,c=Fp.length,p=1/(Fp.reduce((b,x)=>b+x,0)/c/1e3),g=Fp.filter(b=>b>x_).reduce((b,x)=>b+(x-x_)/x_,0);return{loadTime:a,fullLoadTime:i,fps:p,percentDroppedFrames:g/(c+g)*100,totalFrames:c}}};h.$=ae,h.A=Dh,h.B=function(a){if(qt==null){const i=a.navigator?a.navigator.userAgent:null;qt=!!a.safari||!(!i||!(/\b(iPad|iPhone|iPod)\b/.test(i)||i.match("Safari")&&!i.match("Chrome")))}return qt},h.C=class{constructor(a,i){this.target=a,this.mapId=i,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new dT(()=>this.process()),this.subscription=function(c,p,g,b){return c.addEventListener(p,g,!1),{unsubscribe:()=>{c.removeEventListener(p,g,!1)}}}(this.target,"message",c=>this.receive(c)),this.globalScope=pe(self)?a:window}registerMessageHandler(a,i){this.messageHandlers[a]=i}sendAsync(a,i){return new Promise((c,p)=>{const g=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[g]={resolve:c,reject:p},i&&i.signal.addEventListener("abort",()=>{delete this.resolveRejects[g];const E={id:g,type:"",origin:location.origin,targetMapId:a.targetMapId,sourceMapId:this.mapId};this.target.postMessage(E)},{once:!0});const b=[],x=Object.assign(Object.assign({},a),{id:g,sourceMapId:this.mapId,origin:location.origin,data:au(a.data,b)});this.target.postMessage(x,{transfer:b})})}receive(a){const i=a.data,c=i.id;if(!(i.origin!=="file://"&&location.origin!=="file://"&&i.origin!==location.origin||i.targetMapId&&this.mapId!==i.targetMapId)){if(i.type===""){delete this.tasks[c];const p=this.abortControllers[c];return delete this.abortControllers[c],void(p&&p.abort())}if(pe(self)||i.mustQueue)return this.tasks[c]=i,this.taskQueue.push(c),void this.invoker.trigger();this.processTask(c,i)}}process(){if(this.taskQueue.length===0)return;const a=this.taskQueue.shift(),i=this.tasks[a];delete this.tasks[a],this.taskQueue.length>0&&this.invoker.trigger(),i&&this.processTask(a,i)}processTask(a,i){return u(this,void 0,void 0,function*(){if(i.type===""){const g=this.resolveRejects[a];return delete this.resolveRejects[a],g?void(i.error?g.reject(lu(i.error)):g.resolve(lu(i.data))):void 0}if(!this.messageHandlers[i.type])return void this.completeTask(a,new Error(`Could not find a registered handler for ${i.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const c=lu(i.data),p=new AbortController;this.abortControllers[a]=p;try{const g=yield this.messageHandlers[i.type](i.sourceMapId,c,p);this.completeTask(a,null,g)}catch(g){this.completeTask(a,g)}})}completeTask(a,i,c){const p=[];delete this.abortControllers[a];const g={id:a,type:"",sourceMapId:this.mapId,origin:location.origin,error:i?au(i):null,data:au(c,p)};this.target.postMessage(g,{transfer:p})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},h.D=Ie,h.E=An,h.F=function(){var a=new Dh(16);return Dh!=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},h.G=Mn,h.H=function(a,i,c){var p,g,b,x,E,L,A,D,N,U,W,H,et=c[0],st=c[1],pt=c[2];return i===a?(a[12]=i[0]*et+i[4]*st+i[8]*pt+i[12],a[13]=i[1]*et+i[5]*st+i[9]*pt+i[13],a[14]=i[2]*et+i[6]*st+i[10]*pt+i[14],a[15]=i[3]*et+i[7]*st+i[11]*pt+i[15]):(g=i[1],b=i[2],x=i[3],E=i[4],L=i[5],A=i[6],D=i[7],N=i[8],U=i[9],W=i[10],H=i[11],a[0]=p=i[0],a[1]=g,a[2]=b,a[3]=x,a[4]=E,a[5]=L,a[6]=A,a[7]=D,a[8]=N,a[9]=U,a[10]=W,a[11]=H,a[12]=p*et+E*st+N*pt+i[12],a[13]=g*et+L*st+U*pt+i[13],a[14]=b*et+A*st+W*pt+i[14],a[15]=x*et+D*st+H*pt+i[15]),a},h.I=i_,h.J=function(a,i,c){var p=c[0],g=c[1],b=c[2];return a[0]=i[0]*p,a[1]=i[1]*p,a[2]=i[2]*p,a[3]=i[3]*p,a[4]=i[4]*g,a[5]=i[5]*g,a[6]=i[6]*g,a[7]=i[7]*g,a[8]=i[8]*b,a[9]=i[9]*b,a[10]=i[10]*b,a[11]=i[11]*b,a[12]=i[12],a[13]=i[13],a[14]=i[14],a[15]=i[15],a},h.K=$v,h.L=function(a,i){const c={};for(let p=0;p{const i=window.document.createElement("video");return i.muted=!0,new Promise(c=>{i.onloadstart=()=>{c(i)};for(const p of a){const g=window.document.createElement("source");cr(p)||(i.crossOrigin="Anonymous"),g.src=p,i.appendChild(g)}})},h.a3=function(){return ct++},h.a4=_,h.a5=Bh,h.a6=fh,h.a7=Tl,h.a8=nr,h.a9=eb,h.aA=$,h.aB=function(a,i){if(!a)return[{command:"setStyle",args:[i]}];let c=[];try{if(!on(a.version,i.version))return[{command:"setStyle",args:[i]}];on(a.center,i.center)||c.push({command:"setCenter",args:[i.center]}),on(a.zoom,i.zoom)||c.push({command:"setZoom",args:[i.zoom]}),on(a.bearing,i.bearing)||c.push({command:"setBearing",args:[i.bearing]}),on(a.pitch,i.pitch)||c.push({command:"setPitch",args:[i.pitch]}),on(a.sprite,i.sprite)||c.push({command:"setSprite",args:[i.sprite]}),on(a.glyphs,i.glyphs)||c.push({command:"setGlyphs",args:[i.glyphs]}),on(a.transition,i.transition)||c.push({command:"setTransition",args:[i.transition]}),on(a.light,i.light)||c.push({command:"setLight",args:[i.light]}),on(a.terrain,i.terrain)||c.push({command:"setTerrain",args:[i.terrain]}),on(a.sky,i.sky)||c.push({command:"setSky",args:[i.sky]});const p={},g=[];(function(x,E,L,A){let D;for(D in E=E||{},x=x||{})Object.prototype.hasOwnProperty.call(x,D)&&(Object.prototype.hasOwnProperty.call(E,D)||us(D,L,A));for(D in E)Object.prototype.hasOwnProperty.call(E,D)&&(Object.prototype.hasOwnProperty.call(x,D)?on(x[D],E[D])||(x[D].type==="geojson"&&E[D].type==="geojson"&&Na(x,E,D)?Hn(L,{command:"setGeoJSONSourceData",args:[D,E[D].data]}):Ds(D,E,L,A)):To(D,E,L))})(a.sources,i.sources,g,p);const b=[];a.layers&&a.layers.forEach(x=>{"source"in x&&p[x.source]?c.push({command:"removeLayer",args:[x.id]}):b.push(x)}),c=c.concat(g),function(x,E,L){E=E||[];const A=(x=x||[]).map(gl),D=E.map(gl),N=x.reduce(cs,{}),U=E.reduce(cs,{}),W=A.slice(),H=Object.create(null);let et,st,pt,It,gt;for(let xt=0,Xt=0;xt@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(c,p,g,b)=>{const x=g||b;return i[p]=!x||x.toLowerCase(),""}),i["max-age"]){const c=parseInt(i["max-age"],10);isNaN(c)?delete i["max-age"]:i["max-age"]=c}return i},h.ab=function(a,i){const c=[];for(const p in a)p in i||c.push(p);return c},h.ac=ot,h.ad=function(a,i,c){var p=Math.sin(c),g=Math.cos(c),b=i[0],x=i[1],E=i[2],L=i[3],A=i[4],D=i[5],N=i[6],U=i[7];return i!==a&&(a[8]=i[8],a[9]=i[9],a[10]=i[10],a[11]=i[11],a[12]=i[12],a[13]=i[13],a[14]=i[14],a[15]=i[15]),a[0]=b*g+A*p,a[1]=x*g+D*p,a[2]=E*g+N*p,a[3]=L*g+U*p,a[4]=A*g-b*p,a[5]=D*g-x*p,a[6]=N*g-E*p,a[7]=U*g-L*p,a},h.ae=function(a){var i=new Dh(16);return i[0]=a[0],i[1]=a[1],i[2]=a[2],i[3]=a[3],i[4]=a[4],i[5]=a[5],i[6]=a[6],i[7]=a[7],i[8]=a[8],i[9]=a[9],i[10]=a[10],i[11]=a[11],i[12]=a[12],i[13]=a[13],i[14]=a[14],i[15]=a[15],i},h.af=Pm,h.ag=function(a,i){let c=0,p=0;if(a.kind==="constant")p=a.layoutSize;else if(a.kind!=="source"){const{interpolationType:g,minZoom:b,maxZoom:x}=a,E=g?ot(ki.interpolationFactor(g,i,b,x),0,1):0;a.kind==="camera"?p=Yi.number(a.minSize,a.maxSize,E):c=E}return{uSizeT:c,uSize:p}},h.ai=function(a,{uSize:i,uSizeT:c},{lowerSize:p,upperSize:g}){return a.kind==="source"?p/Wa:a.kind==="composite"?Yi.number(p/Wa,g/Wa,c):i},h.aj=l_,h.ak=function(a,i,c,p){const g=i.y-a.y,b=i.x-a.x,x=p.y-c.y,E=p.x-c.x,L=x*b-E*g;if(L===0)return null;const A=(E*(a.y-c.y)-x*(a.x-c.x))/L;return new C(a.x+A*b,a.y+A*g)},h.al=ob,h.am=vp,h.an=Uy,h.ao=ei,h.aq=a_,h.ar=function(a,i){var c=i[0],p=i[1],g=i[2],b=i[3],x=i[4],E=i[5],L=i[6],A=i[7],D=i[8],N=i[9],U=i[10],W=i[11],H=i[12],et=i[13],st=i[14],pt=i[15],It=c*E-p*x,gt=c*L-g*x,xt=c*A-b*x,Xt=p*L-g*E,Yt=p*A-b*E,ge=g*A-b*L,xe=D*et-N*H,me=D*st-U*H,he=D*pt-W*H,oe=N*st-U*et,ve=N*pt-W*et,ue=U*pt-W*st,te=It*ue-gt*ve+xt*oe+Xt*he-Yt*me+ge*xe;return te?(a[0]=(E*ue-L*ve+A*oe)*(te=1/te),a[1]=(g*ve-p*ue-b*oe)*te,a[2]=(et*ge-st*Yt+pt*Xt)*te,a[3]=(U*Yt-N*ge-W*Xt)*te,a[4]=(L*he-x*ue-A*me)*te,a[5]=(c*ue-g*he+b*me)*te,a[6]=(st*xt-H*ge-pt*gt)*te,a[7]=(D*ge-U*xt+W*gt)*te,a[8]=(x*ve-E*he+A*xe)*te,a[9]=(p*he-c*ve-b*xe)*te,a[10]=(H*Yt-et*xt+pt*It)*te,a[11]=(N*xt-D*Yt-W*It)*te,a[12]=(E*me-x*oe-L*xe)*te,a[13]=(c*oe-p*me+g*xe)*te,a[14]=(et*gt-H*Xt-st*It)*te,a[15]=(D*Xt-N*gt+U*It)*te,a):null},h.as=g_,h.at=s_,h.au=y_,h.av=function(){const a={},i=Mt.$version;for(const c in Mt.$root){const p=Mt.$root[c];if(p.required){let g=null;g=c==="version"?i:p.type==="array"?[]:{},g!=null&&(a[c]=g)}}return a},h.aw=mm,h.ax=Lr,h.ay=function(a){a=a.slice();const i=Object.create(null);for(let c=0;cte*ei)}let me=x?"center":c.get("text-justify").evaluate(A,{},a.canonical);const he=c.get("symbol-placement"),oe=he==="point"?c.get("text-max-width").evaluate(A,{},a.canonical)*ei:0,ve=()=>{a.bucket.allowVerticalPlacement&&uu(xt)&&(H.vertical=Om(et,a.glyphMap,a.glyphPositions,a.imagePositions,D,oe,b,ge,"left",Yt,pt,h.ah.vertical,!0,he,U,N))};if(!x&&xe){const ue=new Set;if(me==="auto")for(let De=0;Deu(void 0,void 0,void 0,function*(){if(a.byteLength===0)return createImageBitmap(new ImageData(1,1));const i=new Blob([new Uint8Array(a)],{type:"image/png"});try{return createImageBitmap(i)}catch(c){throw new Error(`Could not load image because of ${c.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),h.e=ft,h.f=a=>new Promise((i,c)=>{const p=new Image;p.onload=()=>{i(p),URL.revokeObjectURL(p.src),p.onload=null,window.requestAnimationFrame(()=>{p.src=Ce})},p.onerror=()=>c(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 g=new Blob([new Uint8Array(a)],{type:"image/png"});p.src=a.byteLength?URL.createObjectURL(g):Ce}),h.g=mn,h.h=(a,i)=>vr(ft(a,{type:"json"}),i),h.i=pe,h.j=be,h.k=St,h.l=(a,i)=>vr(ft(a,{type:"arrayBuffer"}),i),h.m=vr,h.n=function(a){return new n_(a).readFields($C,[])},h.o=Ip,h.p=D1,h.q=co,h.r=zy,h.s=cr,h.t=su,h.u=de,h.v=Mt,h.w=$t,h.x=Sl,h.y=function([a,i,c]){return i+=90,i*=Math.PI/180,c*=Math.PI/180,{x:a*Math.cos(i)*Math.sin(c),y:a*Math.sin(i)*Math.sin(c),z:a*Math.cos(c)}},h.z=Yi}),o("worker",["./shared"],function(h){class u{constructor(V){this.keyCache={},V&&this.replace(V)}replace(V){this._layerConfigs={},this._layers={},this.update(V,[])}update(V,j){for(const nt of V){this._layerConfigs[nt.id]=nt;const vt=this._layers[nt.id]=h.az(nt);vt._featureFilter=h.a6(vt.filter),this.keyCache[nt.id]&&delete this.keyCache[nt.id]}for(const nt of j)delete this.keyCache[nt],delete this._layerConfigs[nt],delete this._layers[nt];this.familiesBySource={};const X=h.bh(Object.values(this._layerConfigs),this.keyCache);for(const nt of X){const vt=nt.map(Ft=>this._layers[Ft.id]),Q=vt[0];if(Q.visibility==="none")continue;const bt=Q.source||"";let dt=this.familiesBySource[bt];dt||(dt=this.familiesBySource[bt]={});const Et=Q.sourceLayer||"_geojsonTileLayer";let Nt=dt[Et];Nt||(Nt=dt[Et]=[]),Nt.push(vt)}}}class y{constructor(V){const j={},X=[];for(const bt in V){const dt=V[bt],Et=j[bt]={};for(const Nt in dt){const Ft=dt[+Nt];if(!Ft||Ft.bitmap.width===0||Ft.bitmap.height===0)continue;const Ht={x:0,y:0,w:Ft.bitmap.width+2,h:Ft.bitmap.height+2};X.push(Ht),Et[Nt]={rect:Ht,metrics:Ft.metrics}}}const{w:nt,h:vt}=h.p(X),Q=new h.o({width:nt||1,height:vt||1});for(const bt in V){const dt=V[bt];for(const Et in dt){const Nt=dt[+Et];if(!Nt||Nt.bitmap.width===0||Nt.bitmap.height===0)continue;const Ft=j[bt][Et].rect;h.o.copy(Nt.bitmap,Q,{x:0,y:0},{x:Ft.x+1,y:Ft.y+1},Nt.bitmap)}}this.image=Q,this.positions=j}}h.bi("GlyphAtlas",y);class w{constructor(V){this.tileID=new h.Q(V.tileID.overscaledZ,V.tileID.wrap,V.tileID.canonical.z,V.tileID.canonical.x,V.tileID.canonical.y),this.uid=V.uid,this.zoom=V.zoom,this.pixelRatio=V.pixelRatio,this.tileSize=V.tileSize,this.source=V.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=V.showCollisionBoxes,this.collectResourceTiming=!!V.collectResourceTiming,this.returnDependencies=!!V.returnDependencies,this.promoteId=V.promoteId,this.inFlightDependencies=[]}parse(V,j,X,nt){return h._(this,void 0,void 0,function*(){this.status="parsing",this.data=V,this.collisionBoxArray=new h.a4;const vt=new h.bj(Object.keys(V.layers).sort()),Q=new h.bk(this.tileID,this.promoteId);Q.bucketLayerIDs=[];const bt={},dt={featureIndex:Q,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:X},Et=j.familiesBySource[this.source];for(const nn in Et){const br=V.layers[nn];if(!br)continue;br.version===1&&h.w(`Vector tile source "${this.source}" layer "${nn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Qr=vt.encode(nn),Xi=[];for(let ao=0;ao=hi.maxzoom||hi.visibility!=="none"&&(S(ao,this.zoom,X),(bt[hi.id]=hi.createBucket({index:Q.bucketLayerIDs.length,layers:ao,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Qr,sourceID:this.source})).populate(Xi,dt,this.tileID.canonical),Q.bucketLayerIDs.push(ao.map(Rs=>Rs.id)))}}const Nt=h.aE(dt.glyphDependencies,nn=>Object.keys(nn).map(Number));this.inFlightDependencies.forEach(nn=>nn==null?void 0:nn.abort()),this.inFlightDependencies=[];let Ft=Promise.resolve({});if(Object.keys(Nt).length){const nn=new AbortController;this.inFlightDependencies.push(nn),Ft=nt.sendAsync({type:"GG",data:{stacks:Nt,source:this.source,tileID:this.tileID,type:"glyphs"}},nn)}const Ht=Object.keys(dt.iconDependencies);let we=Promise.resolve({});if(Ht.length){const nn=new AbortController;this.inFlightDependencies.push(nn),we=nt.sendAsync({type:"GI",data:{icons:Ht,source:this.source,tileID:this.tileID,type:"icons"}},nn)}const Te=Object.keys(dt.patternDependencies);let Ge=Promise.resolve({});if(Te.length){const nn=new AbortController;this.inFlightDependencies.push(nn),Ge=nt.sendAsync({type:"GI",data:{icons:Te,source:this.source,tileID:this.tileID,type:"patterns"}},nn)}const[je,_n,Un]=yield Promise.all([Ft,we,Ge]),er=new y(je),Wr=new h.bl(_n,Un);for(const nn in bt){const br=bt[nn];br instanceof h.a5?(S(br.layers,this.zoom,X),h.bm({bucket:br,glyphMap:je,glyphPositions:er.positions,imageMap:_n,imagePositions:Wr.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):br.hasPattern&&(br instanceof h.bn||br instanceof h.bo||br instanceof h.bp)&&(S(br.layers,this.zoom,X),br.addFeatures(dt,this.tileID.canonical,Wr.patternPositions))}return this.status="done",{buckets:Object.values(bt).filter(nn=>!nn.isEmpty()),featureIndex:Q,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:er.image,imageAtlas:Wr,glyphMap:this.returnDependencies?je:null,iconMap:this.returnDependencies?_n:null,glyphPositions:this.returnDependencies?er.positions:null}})}}function S(at,V,j){const X=new h.a8(V);for(const nt of at)nt.recalculate(X,j)}class C{constructor(V,j,X){this.actor=V,this.layerIndex=j,this.availableImages=X,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(V,j){return h._(this,void 0,void 0,function*(){const X=yield h.l(V.request,j);try{return{vectorTile:new h.bq.VectorTile(new h.br(X.data)),rawData:X.data,cacheControl:X.cacheControl,expires:X.expires}}catch(nt){const vt=new Uint8Array(X.data);let Q=`Unable to parse the tile at ${V.request.url}, `;throw Q+=vt[0]===31&&vt[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${nt.messge}`,new Error(Q)}})}loadTile(V){return h._(this,void 0,void 0,function*(){const j=V.uid,X=!!(V&&V.request&&V.request.collectResourceTiming)&&new h.bs(V.request),nt=new w(V);this.loading[j]=nt;const vt=new AbortController;nt.abort=vt;try{const Q=yield this.loadVectorTile(V,vt);if(delete this.loading[j],!Q)return null;const bt=Q.rawData,dt={};Q.expires&&(dt.expires=Q.expires),Q.cacheControl&&(dt.cacheControl=Q.cacheControl);const Et={};if(X){const Ft=X.finish();Ft&&(Et.resourceTiming=JSON.parse(JSON.stringify(Ft)))}nt.vectorTile=Q.vectorTile;const Nt=nt.parse(Q.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[j]=nt,this.fetching[j]={rawTileData:bt,cacheControl:dt,resourceTiming:Et};try{const Ft=yield Nt;return h.e({rawTileData:bt.slice(0)},Ft,dt,Et)}finally{delete this.fetching[j]}}catch(Q){throw delete this.loading[j],nt.status="done",this.loaded[j]=nt,Q}})}reloadTile(V){return h._(this,void 0,void 0,function*(){const j=V.uid;if(!this.loaded||!this.loaded[j])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const X=this.loaded[j];if(X.showCollisionBoxes=V.showCollisionBoxes,X.status==="parsing"){const nt=yield X.parse(X.vectorTile,this.layerIndex,this.availableImages,this.actor);let vt;if(this.fetching[j]){const{rawTileData:Q,cacheControl:bt,resourceTiming:dt}=this.fetching[j];delete this.fetching[j],vt=h.e({rawTileData:Q.slice(0)},nt,bt,dt)}else vt=nt;return vt}if(X.status==="done"&&X.vectorTile)return X.parse(X.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(V){return h._(this,void 0,void 0,function*(){const j=this.loading,X=V.uid;j&&j[X]&&j[X].abort&&(j[X].abort.abort(),delete j[X])})}removeTile(V){return h._(this,void 0,void 0,function*(){this.loaded&&this.loaded[V.uid]&&delete this.loaded[V.uid]})}}class P{constructor(){this.loaded={}}loadTile(V){return h._(this,void 0,void 0,function*(){const{uid:j,encoding:X,rawImageData:nt,redFactor:vt,greenFactor:Q,blueFactor:bt,baseShift:dt}=V,Et=nt.width+2,Nt=nt.height+2,Ft=h.b(nt)?new h.R({width:Et,height:Nt},yield h.bt(nt,-1,-1,Et,Nt)):nt,Ht=new h.bu(j,Ft,X,vt,Q,bt,dt);return this.loaded=this.loaded||{},this.loaded[j]=Ht,Ht})}removeTile(V){const j=this.loaded,X=V.uid;j&&j[X]&&delete j[X]}}function F(at,V){if(at.length!==0){R(at[0],V);for(var j=1;j=Math.abs(bt)?j-dt+bt:bt-dt+j,j=dt}j+X>=0!=!!V&&at.reverse()}var Y=h.bv(function at(V,j){var X,nt=V&&V.type;if(nt==="FeatureCollection")for(X=0;X>31}function re(at,V){for(var j=at.loadGeometry(),X=at.type,nt=0,vt=0,Q=j.length,bt=0;btat},Ce=Math.fround||(pn=new Float32Array(1),at=>(pn[0]=+at,pn[0]));var pn;const Ve=3,Ee=5,sn=6;class En{constructor(V){this.options=Object.assign(Object.create(Ne),V),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(V){const{log:j,minZoom:X,maxZoom:nt}=this.options;j&&console.time("total time");const vt=`prepare ${V.length} points`;j&&console.time(vt),this.points=V;const Q=[];for(let dt=0;dt=X;dt--){const Et=+Date.now();bt=this.trees[dt]=this._createTree(this._cluster(bt,dt)),j&&console.log("z%d: %d clusters in %dms",dt,bt.numItems,+Date.now()-Et)}return j&&console.timeEnd("total time"),this}getClusters(V,j){let X=((V[0]+180)%360+360)%360-180;const nt=Math.max(-90,Math.min(90,V[1]));let vt=V[2]===180?180:((V[2]+180)%360+360)%360-180;const Q=Math.max(-90,Math.min(90,V[3]));if(V[2]-V[0]>=360)X=-180,vt=180;else if(X>vt){const Ft=this.getClusters([X,nt,180,Q],j),Ht=this.getClusters([-180,nt,vt,Q],j);return Ft.concat(Ht)}const bt=this.trees[this._limitZoom(j)],dt=bt.range(Mn(X),_r(Q),Mn(vt),_r(nt)),Et=bt.data,Nt=[];for(const Ft of dt){const Ht=this.stride*Ft;Nt.push(Et[Ht+Ee]>1?dn(Et,Ht,this.clusterProps):this.points[Et[Ht+Ve]])}return Nt}getChildren(V){const j=this._getOriginId(V),X=this._getOriginZoom(V),nt="No cluster with the specified id.",vt=this.trees[X];if(!vt)throw new Error(nt);const Q=vt.data;if(j*this.stride>=Q.length)throw new Error(nt);const bt=this.options.radius/(this.options.extent*Math.pow(2,X-1)),dt=vt.within(Q[j*this.stride],Q[j*this.stride+1],bt),Et=[];for(const Nt of dt){const Ft=Nt*this.stride;Q[Ft+4]===V&&Et.push(Q[Ft+Ee]>1?dn(Q,Ft,this.clusterProps):this.points[Q[Ft+Ve]])}if(Et.length===0)throw new Error(nt);return Et}getLeaves(V,j,X){const nt=[];return this._appendLeaves(nt,V,j=j||10,X=X||0,0),nt}getTile(V,j,X){const nt=this.trees[this._limitZoom(V)],vt=Math.pow(2,V),{extent:Q,radius:bt}=this.options,dt=bt/Q,Et=(X-dt)/vt,Nt=(X+1+dt)/vt,Ft={features:[]};return this._addTileFeatures(nt.range((j-dt)/vt,Et,(j+1+dt)/vt,Nt),nt.data,j,X,vt,Ft),j===0&&this._addTileFeatures(nt.range(1-dt/vt,Et,1,Nt),nt.data,vt,X,vt,Ft),j===vt-1&&this._addTileFeatures(nt.range(0,Et,dt/vt,Nt),nt.data,-1,X,vt,Ft),Ft.features.length?Ft:null}getClusterExpansionZoom(V){let j=this._getOriginZoom(V)-1;for(;j<=this.options.maxZoom;){const X=this.getChildren(V);if(j++,X.length!==1)break;V=X[0].properties.cluster_id}return j}_appendLeaves(V,j,X,nt,vt){const Q=this.getChildren(j);for(const bt of Q){const dt=bt.properties;if(dt&&dt.cluster?vt+dt.point_count<=nt?vt+=dt.point_count:vt=this._appendLeaves(V,dt.cluster_id,X,nt,vt):vt1;let Nt,Ft,Ht;if(Et)Nt=mn(j,dt,this.clusterProps),Ft=j[dt],Ht=j[dt+1];else{const Ge=this.points[j[dt+Ve]];Nt=Ge.properties;const[je,_n]=Ge.geometry.coordinates;Ft=Mn(je),Ht=_r(_n)}const we={type:1,geometry:[[Math.round(this.options.extent*(Ft*vt-X)),Math.round(this.options.extent*(Ht*vt-nt))]],tags:Nt};let Te;Te=Et||this.options.generateId?j[dt+Ve]:this.points[j[dt+Ve]].id,Te!==void 0&&(we.id=Te),Q.features.push(we)}}_limitZoom(V){return Math.max(this.options.minZoom,Math.min(Math.floor(+V),this.options.maxZoom+1))}_cluster(V,j){const{radius:X,extent:nt,reduce:vt,minPoints:Q}=this.options,bt=X/(nt*Math.pow(2,j)),dt=V.data,Et=[],Nt=this.stride;for(let Ft=0;Ftj&&(je+=dt[Un+Ee])}if(je>Ge&&je>=Q){let _n,Un=Ht*Ge,er=we*Ge,Wr=-1;const nn=((Ft/Nt|0)<<5)+(j+1)+this.points.length;for(const br of Te){const Qr=br*Nt;if(dt[Qr+2]<=j)continue;dt[Qr+2]=j;const Xi=dt[Qr+Ee];Un+=dt[Qr]*Xi,er+=dt[Qr+1]*Xi,dt[Qr+4]=nn,vt&&(_n||(_n=this._map(dt,Ft,!0),Wr=this.clusterProps.length,this.clusterProps.push(_n)),vt(_n,this._map(dt,Qr)))}dt[Ft+4]=nn,Et.push(Un/je,er/je,1/0,nn,-1,je),vt&&Et.push(Wr)}else{for(let _n=0;_n1)for(const _n of Te){const Un=_n*Nt;if(!(dt[Un+2]<=j)){dt[Un+2]=j;for(let er=0;er>5}_getOriginZoom(V){return(V-this.points.length)%32}_map(V,j,X){if(V[j+Ee]>1){const Q=this.clusterProps[V[j+sn]];return X?Object.assign({},Q):Q}const nt=this.points[V[j+Ve]].properties,vt=this.options.map(nt);return X&&vt===nt?Object.assign({},vt):vt}}function dn(at,V,j){return{type:"Feature",id:at[V+Ve],properties:mn(at,V,j),geometry:{type:"Point",coordinates:[(X=at[V],360*(X-.5)),Lr(at[V+1])]}};var X}function mn(at,V,j){const X=at[V+Ee],nt=X>=1e4?`${Math.round(X/1e3)}k`:X>=1e3?Math.round(X/100)/10+"k":X,vt=at[V+sn],Q=vt===-1?{}:Object.assign({},j[vt]);return Object.assign(Q,{cluster:!0,cluster_id:at[V+Ve],point_count:X,point_count_abbreviated:nt})}function Mn(at){return at/360+.5}function _r(at){const V=Math.sin(at*Math.PI/180),j=.5-.25*Math.log((1+V)/(1-V))/Math.PI;return j<0?0:j>1?1:j}function Lr(at){const V=(180-360*at)*Math.PI/180;return 360*Math.atan(Math.exp(V))/Math.PI-90}function vr(at,V,j,X){for(var nt,vt=X,Q=j-V>>1,bt=j-V,dt=at[V],Et=at[V+1],Nt=at[j],Ft=at[j+1],Ht=V+3;Htvt)nt=Ht,vt=we;else if(we===vt){var Te=Math.abs(Ht-Q);TeX&&(nt-V>3&&vr(at,V,nt,X),at[nt+2]=vt,j-nt>3&&vr(at,nt,j,X))}function cr(at,V,j,X,nt,vt){var Q=nt-j,bt=vt-X;if(Q!==0||bt!==0){var dt=((at-j)*Q+(V-X)*bt)/(Q*Q+bt*bt);dt>1?(j=nt,X=vt):dt>0&&(j+=Q*dt,X+=bt*dt)}return(Q=at-j)*Q+(bt=V-X)*bt}function Kt(at,V,j,X){var nt={id:at===void 0?null:at,type:V,geometry:j,tags:X,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(vt){var Q=vt.geometry,bt=vt.type;if(bt==="Point"||bt==="MultiPoint"||bt==="LineString")mt(vt,Q);else if(bt==="Polygon"||bt==="MultiLineString")for(var dt=0;dt0&&(Q+=X?(nt*Et-dt*vt)/2:Math.sqrt(Math.pow(dt-nt,2)+Math.pow(Et-vt,2))),nt=dt,vt=Et}var Nt=V.length-3;V[2]=1,vr(V,0,Nt,j),V[Nt+2]=1,V.size=Math.abs(Q),V.start=0,V.end=V.size}function Mt(at,V,j,X){for(var nt=0;nt1?1:j}function on(at,V,j,X,nt,vt,Q,bt){if(X/=V,vt>=(j/=V)&&Q=X)return null;for(var dt=[],Et=0;Et=j&&Te=X)){var Ge=[];if(Ht==="Point"||Ht==="MultiPoint")Hn(Ft,Ge,j,X,nt);else if(Ht==="LineString")To(Ft,Ge,j,X,nt,!1,bt.lineMetrics);else if(Ht==="MultiLineString")Ds(Ft,Ge,j,X,nt,!1);else if(Ht==="Polygon")Ds(Ft,Ge,j,X,nt,!0);else if(Ht==="MultiPolygon")for(var je=0;je=j&&Q<=X&&(V.push(at[vt]),V.push(at[vt+1]),V.push(at[vt+2]))}}function To(at,V,j,X,nt,vt,Q){for(var bt,dt,Et=us(at),Nt=nt===0?xi:gl,Ft=at.start,Ht=0;Htj&&(dt=Nt(Et,we,Te,je,_n,j),Q&&(Et.start=Ft+bt*dt)):Un>X?er=j&&(dt=Nt(Et,we,Te,je,_n,j),Wr=!0),er>X&&Un<=X&&(dt=Nt(Et,we,Te,je,_n,X),Wr=!0),!vt&&Wr&&(Q&&(Et.end=Ft+bt*dt),V.push(Et),Et=us(at)),Q&&(Ft+=bt)}var nn=at.length-3;we=at[nn],Te=at[nn+1],Ge=at[nn+2],(Un=nt===0?we:Te)>=j&&Un<=X&&Na(Et,we,Te,Ge),nn=Et.length-3,vt&&nn>=3&&(Et[nn]!==Et[0]||Et[nn+1]!==Et[1])&&Na(Et,Et[0],Et[1],Et[2]),Et.length&&V.push(Et)}function us(at){var V=[];return V.size=at.size,V.start=at.start,V.end=at.end,V}function Ds(at,V,j,X,nt,vt){for(var Q=0;QQ.maxX&&(Q.maxX=Nt),Ft>Q.maxY&&(Q.maxY=Ft)}return Q}function jr(at,V,j,X){var nt=V.geometry,vt=V.type,Q=[];if(vt==="Point"||vt==="MultiPoint")for(var bt=0;bt0&&V.size<(nt?Q:X))j.numPoints+=V.length/3;else{for(var bt=[],dt=0;dtQ)&&(j.numSimplified++,bt.push(V[dt]),bt.push(V[dt+1])),j.numPoints++;nt&&function(Et,Nt){for(var Ft=0,Ht=0,we=Et.length,Te=we-2;Ht0===Nt)for(Ht=0,we=Et.length;Ht24)throw new Error("maxZoom should be in the 0-24 range");if(V.promoteId&&V.generateId)throw new Error("promoteId and generateId cannot be used together.");var X=function(nt,vt){var Q=[];if(nt.type==="FeatureCollection")for(var bt=0;bt1&&console.time("creation"),Ht=this.tiles[Ft]=yl(at,V,j,X,dt),this.tileCoords.push({z:V,x:j,y:X}),Et)){Et>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",V,j,X,Ht.numFeatures,Ht.numPoints,Ht.numSimplified),console.timeEnd("creation"));var we="z"+V;this.stats[we]=(this.stats[we]||0)+1,this.total++}if(Ht.source=at,nt){if(V===dt.maxZoom||V===nt)continue;var Te=1<1&&console.time("clipping");var Ge,je,_n,Un,er,Wr,nn=.5*dt.buffer/dt.extent,br=.5-nn,Qr=.5+nn,Xi=1+nn;Ge=je=_n=Un=null,er=on(at,Nt,j-nn,j+Qr,0,Ht.minX,Ht.maxX,dt),Wr=on(at,Nt,j+br,j+Xi,0,Ht.minX,Ht.maxX,dt),at=null,er&&(Ge=on(er,Nt,X-nn,X+Qr,1,Ht.minY,Ht.maxY,dt),je=on(er,Nt,X+br,X+Xi,1,Ht.minY,Ht.maxY,dt),er=null),Wr&&(_n=on(Wr,Nt,X-nn,X+Qr,1,Ht.minY,Ht.maxY,dt),Un=on(Wr,Nt,X+br,X+Xi,1,Ht.minY,Ht.maxY,dt),Wr=null),Et>1&&console.timeEnd("clipping"),bt.push(Ge||[],V+1,2*j,2*X),bt.push(je||[],V+1,2*j,2*X+1),bt.push(_n||[],V+1,2*j+1,2*X),bt.push(Un||[],V+1,2*j+1,2*X+1)}}},Ke.prototype.getTile=function(at,V,j){var X=this.options,nt=X.extent,vt=X.debug;if(at<0||at>24)return null;var Q=1<1&&console.log("drilling down to z%d-%d-%d",at,V,j);for(var dt,Et=at,Nt=V,Ft=j;!dt&&Et>0;)Et--,Nt=Math.floor(Nt/2),Ft=Math.floor(Ft/2),dt=this.tiles[Xe(Et,Nt,Ft)];return dt&&dt.source?(vt>1&&console.log("found parent tile z%d-%d-%d",Et,Nt,Ft),vt>1&&console.time("drilling down"),this.splitTile(dt.source,Et,Nt,Ft,at,V,j),vt>1&&console.timeEnd("drilling down"),this.tiles[bt]?Zo(this.tiles[bt],nt):null):null};class fa extends C{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(V,j){return h._(this,void 0,void 0,function*(){const X=V.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const nt=this._geoJSONIndex.getTile(X.z,X.x,X.y);if(!nt)return null;const vt=new class{constructor(bt){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=h.W,this.length=bt.length,this._features=bt}feature(bt){return new class{constructor(dt){this._feature=dt,this.extent=h.W,this.type=dt.type,this.properties=dt.tags,"id"in dt&&!isNaN(dt.id)&&(this.id=parseInt(dt.id,10))}loadGeometry(){if(this._feature.type===1){const dt=[];for(const Et of this._feature.geometry)dt.push([new h.P(Et[0],Et[1])]);return dt}{const dt=[];for(const Et of this._feature.geometry){const Nt=[];for(const Ft of Et)Nt.push(new h.P(Ft[0],Ft[1]));dt.push(Nt)}return dt}}toGeoJSON(dt,Et,Nt){return J.call(this,dt,Et,Nt)}}(this._features[bt])}}(nt.features);let Q=qt(vt);return Q.byteOffset===0&&Q.byteLength===Q.buffer.byteLength||(Q=new Uint8Array(Q)),{vectorTile:vt,rawData:Q.buffer}})}loadData(V){return h._(this,void 0,void 0,function*(){var j;(j=this._pendingRequest)===null||j===void 0||j.abort();const X=!!(V&&V.request&&V.request.collectResourceTiming)&&new h.bs(V.request);this._pendingRequest=new AbortController;try{let nt=yield this.loadGeoJSON(V,this._pendingRequest);if(delete this._pendingRequest,typeof nt!="object")throw new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`);if(Y(nt,!0),V.filter){const Q=h.by(V.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Q.result==="error")throw new Error(Q.value.map(dt=>`${dt.key}: ${dt.message}`).join(", "));nt={type:"FeatureCollection",features:nt.features.filter(dt=>Q.value.evaluate({zoom:0},dt))}}this._geoJSONIndex=V.cluster?new En(function({superclusterOptions:Q,clusterProperties:bt}){if(!bt||!Q)return Q;const dt={},Et={},Nt={accumulated:null,zoom:0},Ft={properties:null},Ht=Object.keys(bt);for(const we of Ht){const[Te,Ge]=bt[we],je=h.by(Ge),_n=h.by(typeof Te=="string"?[Te,["accumulated"],["get",we]]:Te);dt[we]=je.value,Et[we]=_n.value}return Q.map=we=>{Ft.properties=we;const Te={};for(const Ge of Ht)Te[Ge]=dt[Ge].evaluate(Nt,Ft);return Te},Q.reduce=(we,Te)=>{Ft.properties=Te;for(const Ge of Ht)Nt.accumulated=we[Ge],we[Ge]=Et[Ge].evaluate(Nt,Ft)},Q}(V)).load(nt.features):function(Q,bt){return new Ke(Q,bt)}(nt,V.geojsonVtOptions),this.loaded={};const vt={};if(X){const Q=X.finish();Q&&(vt.resourceTiming={},vt.resourceTiming[V.source]=JSON.parse(JSON.stringify(Q)))}return vt}catch(nt){if(delete this._pendingRequest,h.bz(nt))return{abandoned:!0};throw nt}})}reloadTile(V){const j=this.loaded;return j&&j[V.uid]?super.reloadTile(V):this.loadTile(V)}loadGeoJSON(V,j){return h._(this,void 0,void 0,function*(){const{promoteId:X}=V;if(V.request){const nt=yield h.h(V.request,j);return this._dataUpdateable=Ho(nt.data,X)?He(nt.data,X):void 0,nt.data}if(typeof V.data=="string")try{const nt=JSON.parse(V.data);return this._dataUpdateable=Ho(nt,X)?He(nt,X):void 0,nt}catch{throw new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`)}if(!V.dataDiff)throw new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${V.source}`);return function(nt,vt,Q){var bt,dt,Et,Nt;if(vt.removeAll&&nt.clear(),vt.remove)for(const Ft of vt.remove)nt.delete(Ft);if(vt.add)for(const Ft of vt.add){const Ht=Mr(Ft,Q);Ht!=null&&nt.set(Ht,Ft)}if(vt.update)for(const Ft of vt.update){let Ht=nt.get(Ft.id);if(Ht==null)continue;const we=!Ft.removeAllProperties&&(((bt=Ft.removeProperties)===null||bt===void 0?void 0:bt.length)>0||((dt=Ft.addOrUpdateProperties)===null||dt===void 0?void 0:dt.length)>0);if((Ft.newGeometry||Ft.removeAllProperties||we)&&(Ht=Object.assign({},Ht),nt.set(Ft.id,Ht),we&&(Ht.properties=Object.assign({},Ht.properties))),Ft.newGeometry&&(Ht.geometry=Ft.newGeometry),Ft.removeAllProperties)Ht.properties={};else if(((Et=Ft.removeProperties)===null||Et===void 0?void 0:Et.length)>0)for(const Te of Ft.removeProperties)Object.prototype.hasOwnProperty.call(Ht.properties,Te)&&delete Ht.properties[Te];if(((Nt=Ft.addOrUpdateProperties)===null||Nt===void 0?void 0:Nt.length)>0)for(const{key:Te,value:Ge}of Ft.addOrUpdateProperties)Ht.properties[Te]=Ge}}(this._dataUpdateable,V.dataDiff,X),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(V){return h._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(V){return this._geoJSONIndex.getClusterExpansionZoom(V.clusterId)}getClusterChildren(V){return this._geoJSONIndex.getChildren(V.clusterId)}getClusterLeaves(V){return this._geoJSONIndex.getLeaves(V.clusterId,V.limit,V.offset)}}class Nr{constructor(V){this.self=V,this.actor=new h.C(V),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(j,X)=>{if(this.externalWorkerSourceTypes[j])throw new Error(`Worker source with name "${j}" already registered.`);this.externalWorkerSourceTypes[j]=X},this.self.addProtocol=h.bf,this.self.removeProtocol=h.bg,this.self.registerRTLTextPlugin=j=>{if(h.bA.isParsed())throw new Error("RTL text plugin already registered.");h.bA.setMethods(j)},this.actor.registerMessageHandler("LDT",(j,X)=>this._getDEMWorkerSource(j,X.source).loadTile(X)),this.actor.registerMessageHandler("RDT",(j,X)=>h._(this,void 0,void 0,function*(){this._getDEMWorkerSource(j,X.source).removeTile(X)})),this.actor.registerMessageHandler("GCEZ",(j,X)=>h._(this,void 0,void 0,function*(){return this._getWorkerSource(j,X.type,X.source).getClusterExpansionZoom(X)})),this.actor.registerMessageHandler("GCC",(j,X)=>h._(this,void 0,void 0,function*(){return this._getWorkerSource(j,X.type,X.source).getClusterChildren(X)})),this.actor.registerMessageHandler("GCL",(j,X)=>h._(this,void 0,void 0,function*(){return this._getWorkerSource(j,X.type,X.source).getClusterLeaves(X)})),this.actor.registerMessageHandler("LD",(j,X)=>this._getWorkerSource(j,X.type,X.source).loadData(X)),this.actor.registerMessageHandler("LT",(j,X)=>this._getWorkerSource(j,X.type,X.source).loadTile(X)),this.actor.registerMessageHandler("RT",(j,X)=>this._getWorkerSource(j,X.type,X.source).reloadTile(X)),this.actor.registerMessageHandler("AT",(j,X)=>this._getWorkerSource(j,X.type,X.source).abortTile(X)),this.actor.registerMessageHandler("RMT",(j,X)=>this._getWorkerSource(j,X.type,X.source).removeTile(X)),this.actor.registerMessageHandler("RS",(j,X)=>h._(this,void 0,void 0,function*(){if(!this.workerSources[j]||!this.workerSources[j][X.type]||!this.workerSources[j][X.type][X.source])return;const nt=this.workerSources[j][X.type][X.source];delete this.workerSources[j][X.type][X.source],nt.removeSource!==void 0&&nt.removeSource(X)})),this.actor.registerMessageHandler("RM",j=>h._(this,void 0,void 0,function*(){delete this.layerIndexes[j],delete this.availableImages[j],delete this.workerSources[j],delete this.demWorkerSources[j]})),this.actor.registerMessageHandler("SR",(j,X)=>h._(this,void 0,void 0,function*(){this.referrer=X})),this.actor.registerMessageHandler("SRPS",(j,X)=>this._syncRTLPluginState(j,X)),this.actor.registerMessageHandler("IS",(j,X)=>h._(this,void 0,void 0,function*(){this.self.importScripts(X)})),this.actor.registerMessageHandler("SI",(j,X)=>this._setImages(j,X)),this.actor.registerMessageHandler("UL",(j,X)=>h._(this,void 0,void 0,function*(){this._getLayerIndex(j).update(X.layers,X.removedIds)})),this.actor.registerMessageHandler("SL",(j,X)=>h._(this,void 0,void 0,function*(){this._getLayerIndex(j).replace(X)}))}_setImages(V,j){return h._(this,void 0,void 0,function*(){this.availableImages[V]=j;for(const X in this.workerSources[V]){const nt=this.workerSources[V][X];for(const vt in nt)nt[vt].availableImages=j}})}_syncRTLPluginState(V,j){return h._(this,void 0,void 0,function*(){if(h.bA.isParsed())return h.bA.getState();if(j.pluginStatus!=="loading")return h.bA.setState(j),j;const X=j.pluginURL;if(this.self.importScripts(X),h.bA.isParsed()){const nt={pluginStatus:"loaded",pluginURL:X};return h.bA.setState(nt),nt}throw h.bA.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${X}`)})}_getAvailableImages(V){let j=this.availableImages[V];return j||(j=[]),j}_getLayerIndex(V){let j=this.layerIndexes[V];return j||(j=this.layerIndexes[V]=new u),j}_getWorkerSource(V,j,X){if(this.workerSources[V]||(this.workerSources[V]={}),this.workerSources[V][j]||(this.workerSources[V][j]={}),!this.workerSources[V][j][X]){const nt={sendAsync:(vt,Q)=>(vt.targetMapId=V,this.actor.sendAsync(vt,Q))};switch(j){case"vector":this.workerSources[V][j][X]=new C(nt,this._getLayerIndex(V),this._getAvailableImages(V));break;case"geojson":this.workerSources[V][j][X]=new fa(nt,this._getLayerIndex(V),this._getAvailableImages(V));break;default:this.workerSources[V][j][X]=new this.externalWorkerSourceTypes[j](nt,this._getLayerIndex(V),this._getAvailableImages(V))}}return this.workerSources[V][j][X]}_getDEMWorkerSource(V,j){return this.demWorkerSources[V]||(this.demWorkerSources[V]={}),this.demWorkerSources[V][j]||(this.demWorkerSources[V][j]=new P),this.demWorkerSources[V][j]}}return h.i(self)&&(self.worker=new Nr(self)),Nr}),o("index",["exports","./shared"],function(h,u){var y="4.1.3";let w,S;const C={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:_=>new Promise((s,f)=>{const d=requestAnimationFrame(s);_.signal.addEventListener("abort",()=>{cancelAnimationFrame(d),f(u.c())})}),getImageData(_,s=0){return this.getImageCanvasContext(_).getImageData(-s,-s,_.width+2*s,_.height+2*s)},getImageCanvasContext(_){const s=window.document.createElement("canvas"),f=s.getContext("2d",{willReadFrequently:!0});if(!f)throw new Error("failed to create canvas 2d context");return s.width=_.width,s.height=_.height,f.drawImage(_,0,0,_.width,_.height),f},resolveURL:_=>(w||(w=document.createElement("a")),w.href=_,w.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(S==null&&(S=matchMedia("(prefers-reduced-motion: reduce)")),S.matches)}};class P{static testProp(s){if(!P.docStyle)return s[0];for(let f=0;f{window.removeEventListener("click",P.suppressClickInternal,!0)},0)}static getScale(s){const f=s.getBoundingClientRect();return{x:f.width/s.offsetWidth||1,y:f.height/s.offsetHeight||1,boundingClientRect:f}}static getPoint(s,f,d){const m=f.boundingClientRect;return new u.P((d.clientX-m.left)/f.x-s.clientLeft,(d.clientY-m.top)/f.y-s.clientTop)}static mousePos(s,f){const d=P.getScale(s);return P.getPoint(s,d,f)}static touchPos(s,f){const d=[],m=P.getScale(s);for(let v=0;v{s=[],f=0,d=0,m={}},_.addThrottleControl=M=>{const k=d++;return m[k]=M,k},_.removeThrottleControl=M=>{delete m[M],I()},_.getImage=(M,k,z=!0)=>new Promise((B,Z)=>{F.supported&&(M.headers||(M.headers={}),M.headers.accept="image/webp,*/*"),u.e(M,{type:"image"}),s.push({abortController:k,requestParameters:M,supportImageRefresh:z,state:"queued",onError:it=>{Z(it)},onSuccess:it=>{B(it)}}),I()});const v=M=>u._(this,void 0,void 0,function*(){M.state="running";const{requestParameters:k,supportImageRefresh:z,onError:B,onSuccess:Z,abortController:it}=M,rt=z===!1&&!u.i(self)&&!u.g(k.url)&&(!k.headers||Object.keys(k.headers).reduce((yt,kt)=>yt&&kt==="accept",!0));f++;const lt=rt?T(k,it):u.m(k,it);try{const yt=yield lt;delete M.abortController,M.state="completed",yt.data instanceof HTMLImageElement||u.b(yt.data)?Z(yt):yt.data&&Z({data:yield(tt=yt.data,typeof createImageBitmap=="function"?u.d(tt):u.f(tt)),cacheControl:yt.cacheControl,expires:yt.expires})}catch(yt){delete M.abortController,B(yt)}finally{f--,I()}var tt}),I=()=>{const M=(()=>{for(const k of Object.keys(m))if(m[k]())return!0;return!1})()?u.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:u.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let k=f;k0;k++){const z=s.shift();z.abortController.signal.aborted?k--:v(z)}},T=(M,k)=>new Promise((z,B)=>{const Z=new Image,it=M.url,rt=M.credentials;rt&&rt==="include"?Z.crossOrigin="use-credentials":(rt&&rt==="same-origin"||!u.s(it))&&(Z.crossOrigin="anonymous"),k.signal.addEventListener("abort",()=>{Z.src="",B(u.c())}),Z.fetchPriority="high",Z.onload=()=>{Z.onerror=Z.onload=null,z({data:Z})},Z.onerror=()=>{Z.onerror=Z.onload=null,k.signal.aborted||B(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=it})}(G||(G={})),G.resetRequestQueue();class q{constructor(s){this._transformRequestFn=s}transformRequest(s,f){return this._transformRequestFn&&this._transformRequestFn(s,f)||{url:s}}normalizeSpriteURL(s,f,d){const m=function(v){const I=v.match(ot);if(!I)throw new Error(`Unable to parse URL "${v}"`);return{protocol:I[1],authority:I[2],path:I[3]||"/",params:I[4]?I[4].split("&"):[]}}(s);return m.path+=`${f}${d}`,function(v){const I=v.params.length?`?${v.params.join("&")}`:"";return`${v.protocol}://${v.authority}${v.path}${I}`}(m)}setTransformRequest(s){this._transformRequestFn=s}}const ot=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function _t(_){var s=new u.A(3);return s[0]=_[0],s[1]=_[1],s[2]=_[2],s}var ft,ct=function(_,s,f){return _[0]=s[0]-f[0],_[1]=s[1]-f[1],_[2]=s[2]-f[2],_};ft=new u.A(3),u.A!=Float32Array&&(ft[0]=0,ft[1]=0,ft[2]=0);var ht=function(_){var s=_[0],f=_[1];return s*s+f*f};function Pt(_){const s=[];if(typeof _=="string")s.push({id:"default",url:_});else if(_&&_.length>0){const f=[];for(const{id:d,url:m}of _){const v=`${d}${m}`;f.indexOf(v)===-1&&(f.push(v),s.push({id:d,url:m}))}}return s}(function(){var _=new u.A(2);u.A!=Float32Array&&(_[0]=0,_[1]=0)})();class ${constructor(s,f,d,m){this.context=s,this.format=d,this.texture=s.gl.createTexture(),this.update(f,m)}update(s,f,d){const{width:m,height:v}=s,I=!(this.size&&this.size[0]===m&&this.size[1]===v||d),{context:T}=this,{gl:M}=T;if(this.useMipmap=!!(f&&f.useMipmap),M.bindTexture(M.TEXTURE_2D,this.texture),T.pixelStoreUnpackFlipY.set(!1),T.pixelStoreUnpack.set(1),T.pixelStoreUnpackPremultiplyAlpha.set(this.format===M.RGBA&&(!f||f.premultiply!==!1)),I)this.size=[m,v],s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement||s instanceof ImageData||u.b(s)?M.texImage2D(M.TEXTURE_2D,0,this.format,this.format,M.UNSIGNED_BYTE,s):M.texImage2D(M.TEXTURE_2D,0,this.format,m,v,0,this.format,M.UNSIGNED_BYTE,s.data);else{const{x:k,y:z}=d||{x:0,y:0};s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement||s instanceof ImageData||u.b(s)?M.texSubImage2D(M.TEXTURE_2D,0,k,z,M.RGBA,M.UNSIGNED_BYTE,s):M.texSubImage2D(M.TEXTURE_2D,0,k,z,m,v,M.RGBA,M.UNSIGNED_BYTE,s.data)}this.useMipmap&&this.isSizePowerOfTwo()&&M.generateMipmap(M.TEXTURE_2D)}bind(s,f,d){const{context:m}=this,{gl:v}=m;v.bindTexture(v.TEXTURE_2D,this.texture),d!==v.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(d=v.LINEAR),s!==this.filter&&(v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,s),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,d||s),this.filter=s),f!==this.wrap&&(v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,f),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,f),this.wrap=f)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:s}=this.context;s.deleteTexture(this.texture),this.texture=null}}function Lt(_){const{userImage:s}=_;return!!(s&&s.render&&s.render())&&(_.data.replace(new Uint8Array(s.data.buffer)),!0)}class $t 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(s){if(this.loaded!==s&&(this.loaded=s,s)){for(const{ids:f,promiseResolve:d}of this.requestors)d(this._getImagesForIds(f));this.requestors=[]}}getImage(s){const f=this.images[s];if(f&&!f.data&&f.spriteData){const d=f.spriteData;f.data=new u.R({width:d.width,height:d.height},d.context.getImageData(d.x,d.y,d.width,d.height).data),f.spriteData=null}return f}addImage(s,f){if(this.images[s])throw new Error(`Image id ${s} already exist, use updateImage instead`);this._validate(s,f)&&(this.images[s]=f)}_validate(s,f){let d=!0;const m=f.data||f.spriteData;return this._validateStretch(f.stretchX,m&&m.width)||(this.fire(new u.j(new Error(`Image "${s}" has invalid "stretchX" value`))),d=!1),this._validateStretch(f.stretchY,m&&m.height)||(this.fire(new u.j(new Error(`Image "${s}" has invalid "stretchY" value`))),d=!1),this._validateContent(f.content,f)||(this.fire(new u.j(new Error(`Image "${s}" has invalid "content" value`))),d=!1),d}_validateStretch(s,f){if(!s)return!0;let d=0;for(const m of s){if(m[0]{let m=!0;if(!this.isLoaded())for(const v of s)this.images[v]||(m=!1);this.isLoaded()||m?f(this._getImagesForIds(s)):this.requestors.push({ids:s,promiseResolve:f})})}_getImagesForIds(s){const f={};for(const d of s){let m=this.getImage(d);m||(this.fire(new u.k("styleimagemissing",{id:d})),m=this.getImage(d)),m?f[d]={data:m.data.clone(),pixelRatio:m.pixelRatio,sdf:m.sdf,version:m.version,stretchX:m.stretchX,stretchY:m.stretchY,content:m.content,hasRenderCallback:!!(m.userImage&&m.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 f}getPixelSize(){const{width:s,height:f}=this.atlasImage;return{width:s,height:f}}getPattern(s){const f=this.patterns[s],d=this.getImage(s);if(!d)return null;if(f&&f.position.version===d.version)return f.position;if(f)f.position.version=d.version;else{const m={w:d.data.width+2,h:d.data.height+2,x:0,y:0},v=new u.I(m,d);this.patterns[s]={bin:m,position:v}}return this._updatePatternAtlas(),this.patterns[s].position}bind(s){const f=s.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new $(s,this.atlasImage,f.RGBA),this.atlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE)}_updatePatternAtlas(){const s=[];for(const v in this.patterns)s.push(this.patterns[v].bin);const{w:f,h:d}=u.p(s),m=this.atlasImage;m.resize({width:f||1,height:d||1});for(const v in this.patterns){const{bin:I}=this.patterns[v],T=I.x+1,M=I.y+1,k=this.getImage(v).data,z=k.width,B=k.height;u.R.copy(k,m,{x:0,y:0},{x:T,y:M},{width:z,height:B}),u.R.copy(k,m,{x:0,y:B-1},{x:T,y:M-1},{width:z,height:1}),u.R.copy(k,m,{x:0,y:0},{x:T,y:M+B},{width:z,height:1}),u.R.copy(k,m,{x:z-1,y:0},{x:T-1,y:M},{width:1,height:B}),u.R.copy(k,m,{x:0,y:0},{x:T+z,y:M},{width:1,height:B})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(s){for(const f of s){if(this.callbackDispatchedThisFrame[f])continue;this.callbackDispatchedThisFrame[f]=!0;const d=this.getImage(f);d||u.w(`Image with ID: "${f}" was not found`),Lt(d)&&this.updateImage(f,d)}}}const Ct=1e20;function re(_,s,f,d,m,v,I,T,M){for(let k=s;k-1);M++,v[M]=T,I[M]=k,I[M+1]=Ct}for(let T=0,M=0;T65535)throw new Error("glyphs > 65535 not supported");if(d.ranges[v])return{stack:s,id:f,glyph:m};if(!this.url)throw new Error("glyphsUrl is not set");if(!d.requests[v]){const T=qt.loadGlyphRange(s,v,this.url,this.requestManager);d.requests[v]=T}const I=yield d.requests[v];for(const T in I)this._doesCharSupportLocalGlyph(+T)||(d.glyphs[+T]=I[+T]);return d.ranges[v]=!0,{stack:s,id:f,glyph:I[f]||null}})}_doesCharSupportLocalGlyph(s){return!!this.localIdeographFontFamily&&(u.u["CJK Unified Ideographs"](s)||u.u["Hangul Syllables"](s)||u.u.Hiragana(s)||u.u.Katakana(s))}_tinySDF(s,f,d){const m=this.localIdeographFontFamily;if(!m||!this._doesCharSupportLocalGlyph(d))return;let v=s.tinySDF;if(!v){let T="400";/bold/i.test(f)?T="900":/medium/i.test(f)?T="500":/light/i.test(f)&&(T="200"),v=s.tinySDF=new qt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:m,fontWeight:T})}const I=v.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}}}}qt.loadGlyphRange=function(_,s,f,d){return u._(this,void 0,void 0,function*(){const m=256*s,v=m+255,I=d.transformRequest(f.replace("{fontstack}",_).replace("{range}",`${m}-${v}`),"Glyphs"),T=yield u.l(I,new AbortController);if(!T||!T.data)throw new Error(`Could not load glyph range. range: ${s}, ${m}-${v}`);const M={};for(const k of u.n(T.data))M[k.id]=k;return M})},qt.TinySDF=class{constructor({fontSize:_=24,buffer:s=3,radius:f=8,cutoff:d=.25,fontFamily:m="sans-serif",fontWeight:v="normal",fontStyle:I="normal"}={}){this.buffer=s,this.cutoff=d,this.radius=f;const T=this.size=_+4*s,M=this._createCanvas(T),k=this.ctx=M.getContext("2d",{willReadFrequently:!0});k.font=`${I} ${v} ${_}px ${m}`,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 s=document.createElement("canvas");return s.width=s.height=_,s}draw(_){const{width:s,actualBoundingBoxAscent:f,actualBoundingBoxDescent:d,actualBoundingBoxLeft:m,actualBoundingBoxRight:v}=this.ctx.measureText(_),I=Math.ceil(f),T=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(v-m))),M=Math.min(this.size-this.buffer,I+Math.ceil(d)),k=T+2*this.buffer,z=M+2*this.buffer,B=Math.max(k*z,0),Z=new Uint8ClampedArray(B),it={data:Z,width:k,height:z,glyphWidth:T,glyphHeight:M,glyphTop:I,glyphLeft:0,glyphAdvance:s};if(T===0||M===0)return it;const{ctx:rt,buffer:lt,gridInner:tt,gridOuter:yt}=this;rt.clearRect(lt,lt,T,M),rt.fillText(_,lt,lt+I);const kt=rt.getImageData(lt,lt,T,M);yt.fill(Ct,0,B),tt.fill(0,0,B);for(let ut=0;ut0?Bt*Bt:0,tt[Ot]=Bt<0?Bt*Bt:0}}re(yt,0,0,k,z,k,this.f,this.v,this.z),re(tt,lt,lt,T,M,k,this.f,this.v,this.z);for(let ut=0;ut1&&(M=s[++T]);const z=Math.abs(k-M.left),B=Math.abs(k-M.right),Z=Math.min(z,B);let it;const rt=v/d*(m+1);if(M.isDash){const lt=m-Math.abs(rt);it=Math.sqrt(Z*Z+lt*lt)}else it=m-Math.sqrt(Z*Z+rt*rt);this.data[I+k]=Math.max(0,Math.min(255,it+128))}}}addRegularDash(s){for(let T=s.length-1;T>=0;--T){const M=s[T],k=s[T+1];M.zeroLength?s.splice(T,1):k&&k.isDash===M.isDash&&(k.left=M.left,s.splice(T,1))}const f=s[0],d=s[s.length-1];f.isDash===d.isDash&&(f.left=d.left-this.width,d.right=f.right+this.width);const m=this.width*this.nextRow;let v=0,I=s[v];for(let T=0;T1&&(I=s[++v]);const M=Math.abs(T-I.left),k=Math.abs(T-I.right),z=Math.min(M,k);this.data[m+T]=Math.max(0,Math.min(255,(I.isDash?z:-z)+128))}}addDash(s,f){const d=f?7:0,m=2*d+1;if(this.nextRow+m>this.height)return u.w("LineAtlas out of space"),null;let v=0;for(let T=0;T{f.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ee]}numActive(){return Object.keys(this.active).length}}const En=Math.floor(C.hardwareConcurrency/2);let dn,mn;function Mn(){return dn||(dn=new sn),dn}sn.workerCount=u.B(globalThis)?Math.max(Math.min(En,3),1):1;class _r{constructor(s,f){this.workerPool=s,this.actors=[],this.currentActor=0,this.id=f;const d=this.workerPool.acquire(f);for(let m=0;m{f.remove()}),this.actors=[],s&&this.workerPool.release(this.id)}registerMessageHandler(s,f){for(const d of this.actors)d.registerMessageHandler(s,f)}}function Lr(){return mn||(mn=new _r(Mn(),u.G),mn.registerMessageHandler("GR",(_,s,f)=>u.m(s,f))),mn}function vr(_,s){const f=u.F();return u.H(f,f,[1,1,0]),u.J(f,f,[.5*_.width,.5*_.height,1]),u.K(f,f,_.calculatePosMatrix(s.toUnwrapped()))}function cr(_,s,f,d,m,v){const I=function(B,Z,it){if(B)for(const rt of B){const lt=Z[rt];if(lt&<.source===it&<.type==="fill-extrusion")return!0}else for(const rt in Z){const lt=Z[rt];if(lt.source===it&<.type==="fill-extrusion")return!0}return!1}(m&&m.layers,s,_.id),T=v.maxPitchScaleFactor(),M=_.tilesIn(d,T,I);M.sort(Kt);const k=[];for(const B of M)k.push({wrappedTileID:B.tileID.wrapped().key,queryResults:B.tile.queryRenderedFeatures(s,f,_._state,B.queryGeometry,B.cameraQueryGeometry,B.scale,m,v,T,vr(_.transform,B.tileID))});const z=function(B){const Z={},it={};for(const rt of B){const lt=rt.queryResults,tt=rt.wrappedTileID,yt=it[tt]=it[tt]||{};for(const kt in lt){const ut=lt[kt],wt=yt[kt]=yt[kt]||{},Dt=Z[kt]=Z[kt]||[];for(const Ot of ut)wt[Ot.featureIndex]||(wt[Ot.featureIndex]=!0,Dt.push(Ot))}}return Z}(k);for(const B in z)z[B].forEach(Z=>{const it=Z.feature,rt=_.getFeatureState(it.layer["source-layer"],it.id);it.source=it.layer.source,it.layer["source-layer"]&&(it.sourceLayer=it.layer["source-layer"]),it.state=rt});return z}function Kt(_,s){const f=_.tileID,d=s.tileID;return f.overscaledZ-d.overscaledZ||f.canonical.y-d.canonical.y||f.wrap-d.wrap||f.canonical.x-d.canonical.x}function mt(_,s,f){return u._(this,void 0,void 0,function*(){let d=_;if(_.url?d=(yield u.h(s.transformRequest(_.url,"Source"),f)).data:yield C.frameAsync(f),!d)return null;const m=u.L(u.e(d,_),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in d&&d.vector_layers&&(m.vectorLayerIds=d.vector_layers.map(v=>v.id)),m})}class St{constructor(s,f){s&&(f?this.setSouthWest(s).setNorthEast(f):Array.isArray(s)&&(s.length===4?this.setSouthWest([s[0],s[1]]).setNorthEast([s[2],s[3]]):this.setSouthWest(s[0]).setNorthEast(s[1])))}setNorthEast(s){return this._ne=s instanceof u.M?new u.M(s.lng,s.lat):u.M.convert(s),this}setSouthWest(s){return this._sw=s instanceof u.M?new u.M(s.lng,s.lat):u.M.convert(s),this}extend(s){const f=this._sw,d=this._ne;let m,v;if(s instanceof u.M)m=s,v=s;else{if(!(s instanceof St))return Array.isArray(s)?s.length===4||s.every(Array.isArray)?this.extend(St.convert(s)):this.extend(u.M.convert(s)):s&&("lng"in s||"lon"in s)&&"lat"in s?this.extend(u.M.convert(s)):this;if(m=s._sw,v=s._ne,!m||!v)return this}return f||d?(f.lng=Math.min(m.lng,f.lng),f.lat=Math.min(m.lat,f.lat),d.lng=Math.max(v.lng,d.lng),d.lat=Math.max(v.lat,d.lat)):(this._sw=new u.M(m.lng,m.lat),this._ne=new u.M(v.lng,v.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(s){const{lng:f,lat:d}=u.M.convert(s);let m=this._sw.lng<=f&&f<=this._ne.lng;return this._sw.lng>this._ne.lng&&(m=this._sw.lng>=f&&f>=this._ne.lng),this._sw.lat<=d&&d<=this._ne.lat&&m}static convert(s){return s instanceof St?s:s&&new St(s)}static fromLngLat(s,f=0){const d=360*f/40075017,m=d/Math.cos(Math.PI/180*s.lat);return new St(new u.M(s.lng-m,s.lat-d),new u.M(s.lng+m,s.lat+d))}}class be{constructor(s,f,d){this.bounds=St.convert(this.validateBounds(s)),this.minzoom=f||0,this.maxzoom=d||24}validateBounds(s){return Array.isArray(s)&&s.length===4?[Math.max(-180,s[0]),Math.max(-90,s[1]),Math.min(180,s[2]),Math.min(90,s[3])]:[-180,-90,180,90]}contains(s){const f=Math.pow(2,s.z),d=Math.floor(u.N(this.bounds.getWest())*f),m=Math.floor(u.O(this.bounds.getNorth())*f),v=Math.ceil(u.N(this.bounds.getEast())*f),I=Math.ceil(u.O(this.bounds.getSouth())*f);return s.x>=d&&s.x=m&&s.y{this._options.tiles=s}),this}setUrl(s){return this.setSourceProperty(()=>{this.url=s,this._options.url=s}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return u.e({},this._options)}loadTile(s){return u._(this,void 0,void 0,function*(){const f=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),d={request:this.map._requestManager.transformRequest(f,"Tile"),uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,tileSize:this.tileSize*s.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 m="RT";if(s.actor&&s.state!=="expired"){if(s.state==="loading")return new Promise((v,I)=>{s.reloadPromise={resolve:v,reject:I}})}else s.actor=this.dispatcher.getActor(),m="LT";s.abortController=new AbortController;try{const v=yield s.actor.sendAsync({type:m,data:d},s.abortController);if(delete s.abortController,s.aborted)return;this._afterTileLoadWorkerResponse(s,v)}catch(v){if(delete s.abortController,s.aborted)return;if(v&&v.status!==404)throw v;this._afterTileLoadWorkerResponse(s,null)}})}_afterTileLoadWorkerResponse(s,f){if(f&&f.resourceTiming&&(s.resourceTiming=f.resourceTiming),f&&this.map._refreshExpiredTiles&&s.setExpiryData(f),s.loadVectorData(f,this.map.painter),s.reloadPromise){const d=s.reloadPromise;s.reloadPromise=null,this.loadTile(s).then(d.resolve).catch(d.reject)}}abortTile(s){return u._(this,void 0,void 0,function*(){s.abortController&&(s.abortController.abort(),delete s.abortController),s.actor&&(yield s.actor.sendAsync({type:"AT",data:{uid:s.uid,type:this.type,source:this.id}}))})}unloadTile(s){return u._(this,void 0,void 0,function*(){s.unloadVectorData(),s.actor&&(yield s.actor.sendAsync({type:"RMT",data:{uid:s.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Mt extends u.E{constructor(s,f,d,m){super(),this.id=s,this.dispatcher=d,this.setEventedParent(m),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"},f),u.e(this,u.L(f,["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 s=yield mt(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,s&&(u.e(this,s),s.bounds&&(this.tileBounds=new be(s.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(s){this._tileJSONRequest=null,this.fire(new u.j(s))}})}loaded(){return this._loaded}onAdd(s){this.map=s,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(s){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),s(),this.load()}setTiles(s){return this.setSourceProperty(()=>{this._options.tiles=s}),this}setUrl(s){return this.setSourceProperty(()=>{this.url=s,this._options.url=s}),this}serialize(){return u.e({},this._options)}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}loadTile(s){return u._(this,void 0,void 0,function*(){const f=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);s.abortController=new AbortController;try{const d=yield G.getImage(this.map._requestManager.transformRequest(f,"Tile"),s.abortController,this.map._refreshExpiredTiles);if(delete s.abortController,s.aborted)return void(s.state="unloaded");if(d&&d.data){this.map._refreshExpiredTiles&&d.cacheControl&&d.expires&&s.setExpiryData({cacheControl:d.cacheControl,expires:d.expires});const m=this.map.painter.context,v=m.gl,I=d.data;s.texture=this.map.painter.getTileTexture(I.width),s.texture?s.texture.update(I,{useMipmap:!0}):(s.texture=new $(m,I,v.RGBA,{useMipmap:!0}),s.texture.bind(v.LINEAR,v.CLAMP_TO_EDGE,v.LINEAR_MIPMAP_NEAREST),m.extTextureFilterAnisotropic&&v.texParameterf(v.TEXTURE_2D,m.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,m.extTextureFilterAnisotropicMax)),s.state="loaded"}}catch(d){if(delete s.abortController,s.aborted)s.state="unloaded";else if(d)throw s.state="errored",d}})}abortTile(s){return u._(this,void 0,void 0,function*(){s.abortController&&(s.abortController.abort(),delete s.abortController)})}unloadTile(s){return u._(this,void 0,void 0,function*(){s.texture&&this.map.painter.saveTileTexture(s.texture)})}hasTransition(){return!1}}class Ze extends Mt{constructor(s,f,d,m){super(s,f,d,m),this.type="raster-dem",this.maxzoom=22,this._options=u.e({type:"raster-dem"},f),this.encoding=f.encoding||"mapbox",this.redFactor=f.redFactor,this.greenFactor=f.greenFactor,this.blueFactor=f.blueFactor,this.baseShift=f.baseShift}loadTile(s){return u._(this,void 0,void 0,function*(){const f=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),d=this.map._requestManager.transformRequest(f,"Tile");s.neighboringTiles=this._getNeighboringTiles(s.tileID),s.abortController=new AbortController;try{const m=yield G.getImage(d,s.abortController,this.map._refreshExpiredTiles);if(delete s.abortController,s.aborted)return void(s.state="unloaded");if(m&&m.data){const v=m.data;this.map._refreshExpiredTiles&&m.cacheControl&&m.expires&&s.setExpiryData({cacheControl:m.cacheControl,expires:m.expires});const I=u.b(v)&&u.S()?v:yield this.readImageNow(v),T={type:this.type,uid:s.uid,source:this.id,rawImageData:I,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!s.actor||s.state==="expired"){s.actor=this.dispatcher.getActor();const M=yield s.actor.sendAsync({type:"LDT",data:T});s.dem=M,s.needsHillshadePrepare=!0,s.needsTerrainPrepare=!0,s.state="loaded"}}}catch(m){if(delete s.abortController,s.aborted)s.state="unloaded";else if(m)throw s.state="errored",m}})}readImageNow(s){return u._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&u.U()){const f=s.width+2,d=s.height+2;try{return new u.R({width:f,height:d},yield u.V(s,-1,-1,f,d))}catch{}}return C.getImageData(s,1)})}_getNeighboringTiles(s){const f=s.canonical,d=Math.pow(2,f.z),m=(f.x-1+d)%d,v=f.x===0?s.wrap-1:s.wrap,I=(f.x+1+d)%d,T=f.x+1===d?s.wrap+1:s.wrap,M={};return M[new u.Q(s.overscaledZ,v,f.z,m,f.y).key]={backfilled:!1},M[new u.Q(s.overscaledZ,T,f.z,I,f.y).key]={backfilled:!1},f.y>0&&(M[new u.Q(s.overscaledZ,v,f.z,m,f.y-1).key]={backfilled:!1},M[new u.Q(s.overscaledZ,s.wrap,f.z,f.x,f.y-1).key]={backfilled:!1},M[new u.Q(s.overscaledZ,T,f.z,I,f.y-1).key]={backfilled:!1}),f.y+10&&u.e(v,{resourceTiming:m}),this.fire(new u.k("data",Object.assign(Object.assign({},v),{sourceDataType:"metadata"}))),this.fire(new u.k("data",Object.assign(Object.assign({},v),{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(s){return u._(this,void 0,void 0,function*(){const f=s.actor?"RT":"LT";s.actor=this.actor;const d={type:this.type,uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};s.abortController=new AbortController;const m=yield this.actor.sendAsync({type:f,data:d},s.abortController);delete s.abortController,s.unloadVectorData(),s.aborted||s.loadVectorData(m,this.map.painter,f==="RT")})}abortTile(s){return u._(this,void 0,void 0,function*(){s.abortController&&(s.abortController.abort(),delete s.abortController),s.aborted=!0})}unloadTile(s){return u._(this,void 0,void 0,function*(){s.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:s.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return u.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var on=u.X([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Hn extends u.E{constructor(s,f,d,m){super(),this.id=s,this.dispatcher=d,this.coordinates=f.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(m),this.options=f}load(s){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 f=yield G.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,f&&f.data&&(this.image=f.data,s&&(this.coordinates=s),this._finishLoading())}catch(f){this._request=null,this._loaded=!0,this.fire(new u.j(f))}})}loaded(){return this._loaded}updateImage(s){return s.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=s.url,this.load(s.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(s){this.map=s,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(s){this.coordinates=s;const f=s.map(u.Y.fromLngLat);this.tileID=function(m){let v=1/0,I=1/0,T=-1/0,M=-1/0;for(const Z of m)v=Math.min(v,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-v,M-I),z=Math.max(0,Math.floor(-Math.log(k)/Math.LN2)),B=Math.pow(2,z);return new u.a0(z,Math.floor((v+T)/2*B),Math.floor((I+M)/2*B))}(f),this.minzoom=this.maxzoom=this.tileID.z;const d=f.map(m=>this.tileID.getTilePoint(m)._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 s=this.map.painter.context,f=s.gl;this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,on.members)),this.boundsSegments||(this.boundsSegments=u.$.simpleSegment(0,0,4,2)),this.texture||(this.texture=new $(s,this.image,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let d=!1;for(const m in this.tiles){const v=this.tiles[m];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,d=!0)}d&&this.fire(new u.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(s){return u._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(s.tileID.canonical)?(this.tiles[String(s.tileID.wrap)]=s,s.buckets={}):s.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class To extends Hn{constructor(s,f,d,m){super(s,f,d,m),this.roundZoom=!0,this.type="video",this.options=f}load(){return u._(this,void 0,void 0,function*(){this._loaded=!1;const s=this.options;this.urls=[];for(const f of s.urls)this.urls.push(this.map._requestManager.transformRequest(f,"Source").url);try{const f=yield u.a2(this.urls);if(this._loaded=!0,!f)return;this.video=f,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(f){this.fire(new u.j(f))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(s){if(this.video){const f=this.video.seekable;sf.end(0)?this.fire(new u.j(new u.a1(`sources.${this.id}`,null,`Playback for this video can be set only between the ${f.start(0)} and ${f.end(0)}-second mark.`))):this.video.currentTime=s}}getVideo(){return this.video}onAdd(s){this.map||(this.map=s,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 s=this.map.painter.context,f=s.gl;this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,on.members)),this.boundsSegments||(this.boundsSegments=u.$.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE),f.texSubImage2D(f.TEXTURE_2D,0,0,0,f.RGBA,f.UNSIGNED_BYTE,this.video)):(this.texture=new $(s,this.video,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let d=!1;for(const m in this.tiles){const v=this.tiles[m];v.state!=="loaded"&&(v.state="loaded",v.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 us extends Hn{constructor(s,f,d,m){super(s,f,d,m),f.coordinates?Array.isArray(f.coordinates)&&f.coordinates.length===4&&!f.coordinates.some(v=>!Array.isArray(v)||v.length!==2||v.some(I=>typeof I!="number"))||this.fire(new u.j(new u.a1(`sources.${s}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.j(new u.a1(`sources.${s}`,null,'missing required property "coordinates"'))),f.animate&&typeof f.animate!="boolean"&&this.fire(new u.j(new u.a1(`sources.${s}`,null,'optional "animate" property must be a boolean value'))),f.canvas?typeof f.canvas=="string"||f.canvas instanceof HTMLCanvasElement||this.fire(new u.j(new u.a1(`sources.${s}`,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.${s}`,null,'missing required property "canvas"'))),this.options=f,this.animate=f.animate===void 0||f.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(s){this.map=s,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let s=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,s=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,s=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const f=this.map.painter.context,d=f.gl;this.boundsBuffer||(this.boundsBuffer=f.createVertexBuffer(this._boundsArray,on.members)),this.boundsSegments||(this.boundsSegments=u.$.simpleSegment(0,0,4,2)),this.texture?(s||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new $(f,this.canvas,d.RGBA,{premultiply:!0});let m=!1;for(const v in this.tiles){const I=this.tiles[v];I.state!=="loaded"&&(I.state="loaded",I.texture=this.texture,m=!0)}m&&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 s of[this.canvas.width,this.canvas.height])if(isNaN(s)||s<=0)return!0;return!1}}const Ds={},Na=_=>{switch(_){case"geojson":return Pr;case"image":return Hn;case"raster":return Mt;case"raster-dem":return Ze;case"vector":return An;case"video":return To;case"canvas":return us}return Ds[_]},xi="RTLPluginLoaded";class gl extends u.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Lr()}_syncState(s){return this.status=s,this.dispatcher.broadcast("SRPS",{pluginStatus:s,pluginURL:this.url}).catch(f=>{throw this.status="error",f})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(s){return u._(this,arguments,void 0,function*(f,d=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=C.resolveURL(f),!this.url)throw new Error(`requested url ${f} is invalid`);if(this.status==="unavailable"){if(!d)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return u._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new u.k(xi))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let cs=null;function ee(){return cs||(cs=new gl),cs}class Zo{constructor(s,f){this.timeAdded=0,this.fadeEndTime=0,this.tileID=s,this.uid=u.a3(),this.uses=0,this.tileSize=f,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(s){const f=s+this.timeAdded;fv.getLayer(k)).filter(Boolean);if(M.length!==0){T.layers=M,T.stateDependentLayerIds&&(T.stateDependentLayers=T.stateDependentLayerIds.map(k=>M.filter(z=>z.id===k)[0]));for(const k of M)I[k.id]=T}}return I}(s.buckets,f.style),this.hasSymbolBuckets=!1;for(const m in this.buckets){const v=this.buckets[m];if(v instanceof u.a5){if(this.hasSymbolBuckets=!0,!d)break;v.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const m in this.buckets){const v=this.buckets[m];if(v instanceof u.a5&&v.hasRTLText){this.hasRTLText=!0,ee().lazyLoad();break}}this.queryPadding=0;for(const m in this.buckets){const v=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,f.style.getLayer(m).queryRadius(v))}s.imageAtlas&&(this.imageAtlas=s.imageAtlas),s.glyphAtlasImage&&(this.glyphAtlasImage=s.glyphAtlasImage)}else this.collisionBoxArray=new u.a4}unloadVectorData(){for(const s in this.buckets)this.buckets[s].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(s){return this.buckets[s.id]}upload(s){for(const d in this.buckets){const m=this.buckets[d];m.uploadPending()&&m.upload(s)}const f=s.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new $(s,this.imageAtlas.image,f.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new $(s,this.glyphAtlasImage,f.ALPHA),this.glyphAtlasImage=null)}prepare(s){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(s,this.imageAtlasTexture)}queryRenderedFeatures(s,f,d,m,v,I,T,M,k,z){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:m,cameraQueryGeometry:v,scale:I,tileSize:this.tileSize,pixelPosMatrix:z,transform:M,params:T,queryPadding:this.queryPadding*k},s,f,d):{}}querySourceFeatures(s,f){const d=this.latestFeatureIndex;if(!d||!d.rawTileData)return;const m=d.loadVTLayers(),v=f&&f.sourceLayer?f.sourceLayer:"",I=m._geojsonTileLayer||m[v];if(!I)return;const T=u.a6(f&&f.filter),{z:M,x:k,y:z}=this.tileID.canonical,B={z:M,x:k,y:z};for(let Z=0;Zd)m=!1;else if(f)if(this.expirationTime{this.remove(s,v)},d)),this.data[m].push(v),this.order.push(m),this.order.length>this.max){const I=this._getAndRemoveByKey(this.order[0]);I&&this.onRemove(I)}return this}has(s){return s.wrapped().key in this.data}getAndRemove(s){return this.has(s)?this._getAndRemoveByKey(s.wrapped().key):null}_getAndRemoveByKey(s){const f=this.data[s].shift();return f.timeout&&clearTimeout(f.timeout),this.data[s].length===0&&delete this.data[s],this.order.splice(this.order.indexOf(s),1),f.value}getByKey(s){const f=this.data[s];return f?f[0].value:null}get(s){return this.has(s)?this.data[s.wrapped().key][0].value:null}remove(s,f){if(!this.has(s))return this;const d=s.wrapped().key,m=f===void 0?0:this.data[d].indexOf(f),v=this.data[d][m];return this.data[d].splice(m,1),v.timeout&&clearTimeout(v.timeout),this.data[d].length===0&&delete this.data[d],this.onRemove(v.value),this.order.splice(this.order.indexOf(d),1),this}setMaxSize(s){for(this.max=s;this.order.length>this.max;){const f=this._getAndRemoveByKey(this.order[0]);f&&this.onRemove(f)}return this}filter(s){const f=[];for(const d in this.data)for(const m of this.data[d])s(m.value)||f.push(m);for(const d of f)this.remove(d.value.tileID,d)}}class yl{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(s,f,d){const m=String(f);if(this.stateChanges[s]=this.stateChanges[s]||{},this.stateChanges[s][m]=this.stateChanges[s][m]||{},u.e(this.stateChanges[s][m],d),this.deletedStates[s]===null){this.deletedStates[s]={};for(const v in this.state[s])v!==m&&(this.deletedStates[s][v]=null)}else if(this.deletedStates[s]&&this.deletedStates[s][m]===null){this.deletedStates[s][m]={};for(const v in this.state[s][m])d[v]||(this.deletedStates[s][m][v]=null)}else for(const v in d)this.deletedStates[s]&&this.deletedStates[s][m]&&this.deletedStates[s][m][v]===null&&delete this.deletedStates[s][m][v]}removeFeatureState(s,f,d){if(this.deletedStates[s]===null)return;const m=String(f);if(this.deletedStates[s]=this.deletedStates[s]||{},d&&f!==void 0)this.deletedStates[s][m]!==null&&(this.deletedStates[s][m]=this.deletedStates[s][m]||{},this.deletedStates[s][m][d]=null);else if(f!==void 0)if(this.stateChanges[s]&&this.stateChanges[s][m])for(d in this.deletedStates[s][m]={},this.stateChanges[s][m])this.deletedStates[s][m][d]=null;else this.deletedStates[s][m]=null;else this.deletedStates[s]=null}getState(s,f){const d=String(f),m=u.e({},(this.state[s]||{})[d],(this.stateChanges[s]||{})[d]);if(this.deletedStates[s]===null)return{};if(this.deletedStates[s]){const v=this.deletedStates[s][f];if(v===null)return{};for(const I in v)delete m[I]}return m}initializeTileState(s,f){s.setFeatureState(this.state,f)}coalesceChanges(s,f){const d={};for(const m in this.stateChanges){this.state[m]=this.state[m]||{};const v={};for(const I in this.stateChanges[m])this.state[m][I]||(this.state[m][I]={}),u.e(this.state[m][I],this.stateChanges[m][I]),v[I]=this.state[m][I];d[m]=v}for(const m in this.deletedStates){this.state[m]=this.state[m]||{};const v={};if(this.deletedStates[m]===null)for(const I in this.state[m])v[I]={},this.state[m][I]={};else for(const I in this.deletedStates[m]){if(this.deletedStates[m][I]===null)this.state[m][I]={};else for(const T of Object.keys(this.deletedStates[m][I]))delete this.state[m][I][T];v[I]=this.state[m][I]}d[m]=d[m]||{},u.e(d[m],v)}if(this.stateChanges={},this.deletedStates={},Object.keys(d).length!==0)for(const m in s)s[m].setFeatureState(d,f)}}class jr extends u.E{constructor(s,f,d){super(),this.id=s,this.dispatcher=d,this.on("data",m=>this._dataHandler(m)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((m,v,I,T)=>{const M=new(Na(v.type))(m,v,I,T);if(M.id!==m)throw new Error(`Expected Source id to be ${m} instead of ${M.id}`);return M})(s,f,d,this),this._tiles={},this._cache=new Hi(0,m=>this._unloadTile(m)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new yl,this._didEmitContent=!1,this._updated=!1}onAdd(s){this.map=s,this._maxTileCacheSize=s?s._maxTileCacheSize:null,this._maxTileCacheZoomLevels=s?s._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(s)}onRemove(s){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(s)}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 s in this._tiles){const f=this._tiles[s];if(f.state!=="loaded"&&f.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const s=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,s&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(s,f,d){return u._(this,void 0,void 0,function*(){try{yield this._source.loadTile(s),this._tileLoaded(s,f,d)}catch(m){s.state="errored",m.status!==404?this._source.fire(new u.j(m,{tile:s})):this.update(this.transform,this.terrain)}})}_unloadTile(s){this._source.unloadTile&&this._source.unloadTile(s)}_abortTile(s){this._source.abortTile&&this._source.abortTile(s),this._source.fire(new u.k("dataabort",{tile:s,coord:s.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(s){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const f in this._tiles){const d=this._tiles[f];d.upload(s),d.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(s=>s.tileID).sort(se).map(s=>s.key)}getRenderableIds(s){const f=[];for(const d in this._tiles)this._isIdRenderable(d,s)&&f.push(this._tiles[d]);return s?f.sort((d,m)=>{const v=d.tileID,I=m.tileID,T=new u.P(v.canonical.x,v.canonical.y)._rotate(this.transform.angle),M=new u.P(I.canonical.x,I.canonical.y)._rotate(this.transform.angle);return v.overscaledZ-I.overscaledZ||M.y-T.y||M.x-T.x}).map(d=>d.tileID.key):f.map(d=>d.tileID).sort(se).map(d=>d.key)}hasRenderableParent(s){const f=this.findLoadedParent(s,0);return!!f&&this._isIdRenderable(f.tileID.key)}_isIdRenderable(s,f){return this._tiles[s]&&this._tiles[s].hasData()&&!this._coveredTiles[s]&&(f||!this._tiles[s].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const s in this._tiles)this._tiles[s].state!=="errored"&&this._reloadTile(s,"reloading")}}_reloadTile(s,f){return u._(this,void 0,void 0,function*(){const d=this._tiles[s];d&&(d.state!=="loading"&&(d.state=f),yield this._loadTile(d,s,f))})}_tileLoaded(s,f,d){s.timeAdded=C.now(),d==="expired"&&(s.refreshedUponExpiration=!0),this._setTileReloadTimer(f,s),this.getSource().type==="raster-dem"&&s.dem&&this._backfillDEM(s),this._state.initializeTileState(s,this.map?this.map.painter:null),s.aborted||this._source.fire(new u.k("data",{dataType:"source",tile:s,coord:s.tileID}))}_backfillDEM(s){const f=this.getRenderableIds();for(let m=0;m1||(Math.abs(I)>1&&(Math.abs(I+M)===1?I+=M:Math.abs(I-M)===1&&(I-=M)),v.dem&&m.dem&&(m.dem.backfillBorder(v.dem,I,T),m.neighboringTiles&&m.neighboringTiles[k]&&(m.neighboringTiles[k].backfilled=!0)))}}getTile(s){return this.getTileByID(s.key)}getTileByID(s){return this._tiles[s]}_retainLoadedChildren(s,f,d,m){for(const v in this._tiles){let I=this._tiles[v];if(m[v]||!I.hasData()||I.tileID.overscaledZ<=f||I.tileID.overscaledZ>d)continue;let T=I.tileID;for(;I&&I.tileID.overscaledZ>f+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>f;)if(M=M.scaledTo(M.overscaledZ-1),s[M.key]){m[T.key]=T;break}}}findLoadedParent(s,f){if(s.key in this._loadedParentTiles){const d=this._loadedParentTiles[s.key];return d&&d.tileID.overscaledZ>=f?d:null}for(let d=s.overscaledZ-1;d>=f;d--){const m=s.scaledTo(d),v=this._getLoadedTile(m);if(v)return v}}_getLoadedTile(s){const f=this._tiles[s.key];return f&&f.hasData()?f:this._cache.getByKey(s.wrapped().key)}updateCacheSize(s){const f=Math.ceil(s.width/this._source.tileSize)+1,d=Math.ceil(s.height/this._source.tileSize)+1,m=Math.floor(f*d*(this._maxTileCacheZoomLevels===null?u.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),v=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,m):m;this._cache.setMaxSize(v)}handleWrapJump(s){const f=Math.round((s-(this._prevLng===void 0?s:this._prevLng))/360);if(this._prevLng=s,f){const d={};for(const m in this._tiles){const v=this._tiles[m];v.tileID=v.tileID.unwrapTo(v.tileID.wrap+f),d[v.tileID.key]=v}this._tiles=d;for(const m in this._timers)clearTimeout(this._timers[m]),delete this._timers[m];for(const m in this._tiles)this._setTileReloadTimer(m,this._tiles[m])}}update(s,f){if(!this._sourceLoaded||this._paused)return;let d;this.transform=s,this.terrain=f,this.updateCacheSize(s),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?d=s.getVisibleUnwrappedCoordinates(this._source.tileID).map(z=>new u.Q(z.canonical.z,z.wrap,z.canonical.z,z.canonical.x,z.canonical.y)):(d=s.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:f}),this._source.hasTile&&(d=d.filter(z=>this._source.hasTile(z)))):d=[];const m=s.coveringZoomLevel(this._source),v=Math.max(m-jr.maxOverzooming,this._source.minzoom),I=Math.max(m+jr.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const z={};for(const B of d)if(B.canonical.z>this._source.minzoom){const Z=B.scaledTo(B.canonical.z-1);z[Z.key]=Z;const it=B.scaledTo(Math.max(this._source.minzoom,Math.min(B.canonical.z,5)));z[it.key]=it}d=d.concat(Object.values(z))}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,m);if(Ke(this._source.type)){const z={},B={},Z=Object.keys(M),it=C.now();for(const rt of Z){const lt=M[rt],tt=this._tiles[rt];if(!tt||tt.fadeEndTime!==0&&tt.fadeEndTime<=it)continue;const yt=this.findLoadedParent(lt,v);yt&&(this._addTile(yt.tileID),z[yt.tileID.key]=yt.tileID),B[rt]=lt}this._retainLoadedChildren(B,m,I,M);for(const rt in z)M[rt]||(this._coveredTiles[rt]=!0,M[rt]=z[rt]);if(f){const rt={},lt={};for(const tt of d)this._tiles[tt.key].hasData()?rt[tt.key]=tt:lt[tt.key]=tt;for(const tt in lt){const yt=lt[tt].children(this._source.maxzoom);this._tiles[yt[0].key]&&this._tiles[yt[1].key]&&this._tiles[yt[2].key]&&this._tiles[yt[3].key]&&(rt[yt[0].key]=M[yt[0].key]=yt[0],rt[yt[1].key]=M[yt[1].key]=yt[1],rt[yt[2].key]=M[yt[2].key]=yt[2],rt[yt[3].key]=M[yt[3].key]=yt[3],delete lt[tt])}for(const tt in lt){const yt=this.findLoadedParent(lt[tt],this._source.minzoom);if(yt){rt[yt.tileID.key]=M[yt.tileID.key]=yt.tileID;for(const kt in rt)rt[kt].isChildOf(yt.tileID)&&delete rt[kt]}}for(const tt in this._tiles)rt[tt]||(this._coveredTiles[tt]=!0)}}for(const z in M)this._tiles[z].clearFadeHold();const k=u.ab(this._tiles,M);for(const z of k){const B=this._tiles[z];B.hasSymbolBuckets&&!B.holdingForFade()?B.setHoldDuration(this.map._fadeDuration):B.hasSymbolBuckets&&!B.symbolFadeFinished()||this._removeTile(z)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const s in this._tiles)this._tiles[s].holdingForFade()&&this._removeTile(s)}_updateRetainedTiles(s,f){const d={},m={},v=Math.max(f-jr.maxOverzooming,this._source.minzoom),I=Math.max(f+jr.maxUnderzooming,this._source.minzoom),T={};for(const M of s){const k=this._addTile(M);d[M.key]=M,k.hasData()||fthis._source.maxzoom){const B=M.children(this._source.maxzoom)[0],Z=this.getTile(B);if(Z&&Z.hasData()){d[B.key]=B;continue}}else{const B=M.children(this._source.maxzoom);if(d[B[0].key]&&d[B[1].key]&&d[B[2].key]&&d[B[3].key])continue}let z=k.wasRequested();for(let B=M.overscaledZ-1;B>=v;--B){const Z=M.scaledTo(B);if(m[Z.key])break;if(m[Z.key]=!0,k=this.getTile(Z),!k&&z&&(k=this._addTile(Z)),k){const it=k.hasData();if((z||it)&&(d[Z.key]=Z),z=k.wasRequested(),it)break}}}return d}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const s in this._tiles){const f=[];let d,m=this._tiles[s].tileID;for(;m.overscaledZ>0;){if(m.key in this._loadedParentTiles){d=this._loadedParentTiles[m.key];break}f.push(m.key);const v=m.scaledTo(m.overscaledZ-1);if(d=this._getLoadedTile(v),d)break;m=v}for(const v of f)this._loadedParentTiles[v]=d}}_addTile(s){let f=this._tiles[s.key];if(f)return f;f=this._cache.getAndRemove(s),f&&(this._setTileReloadTimer(s.key,f),f.tileID=s,this._state.initializeTileState(f,this.map?this.map.painter:null),this._cacheTimers[s.key]&&(clearTimeout(this._cacheTimers[s.key]),delete this._cacheTimers[s.key],this._setTileReloadTimer(s.key,f)));const d=f;return f||(f=new Zo(s,this._source.tileSize*s.overscaleFactor()),this._loadTile(f,s.key,f.state)),f.uses++,this._tiles[s.key]=f,d||this._source.fire(new u.k("dataloading",{tile:f,coord:f.tileID,dataType:"source"})),f}_setTileReloadTimer(s,f){s in this._timers&&(clearTimeout(this._timers[s]),delete this._timers[s]);const d=f.getExpiryTimeout();d&&(this._timers[s]=setTimeout(()=>{this._reloadTile(s,"expired"),delete this._timers[s]},d))}_removeTile(s){const f=this._tiles[s];f&&(f.uses--,delete this._tiles[s],this._timers[s]&&(clearTimeout(this._timers[s]),delete this._timers[s]),f.uses>0||(f.hasData()&&f.state!=="reloading"?this._cache.add(f.tileID,f,f.getExpiryTimeout()):(f.aborted=!0,this._abortTile(f),this._unloadTile(f))))}_dataHandler(s){const f=s.sourceDataType;s.dataType==="source"&&f==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&s.dataType==="source"&&f==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const s in this._tiles)this._removeTile(s);this._cache.reset()}tilesIn(s,f,d){const m=[],v=this.transform;if(!v)return m;const I=d?v.getCameraQueryGeometry(s):s,T=s.map(rt=>v.pointCoordinate(rt,this.terrain)),M=I.map(rt=>v.pointCoordinate(rt,this.terrain)),k=this.getIds();let z=1/0,B=1/0,Z=-1/0,it=-1/0;for(const rt of M)z=Math.min(z,rt.x),B=Math.min(B,rt.y),Z=Math.max(Z,rt.x),it=Math.max(it,rt.y);for(let rt=0;rt=0&&ut[1].y+kt>=0){const wt=T.map(Ot=>tt.getTilePoint(Ot)),Dt=M.map(Ot=>tt.getTilePoint(Ot));m.push({tile:lt,tileID:tt,queryGeometry:wt,cameraQueryGeometry:Dt,scale:yt})}}return m}getVisibleCoordinates(s){const f=this.getRenderableIds(s).map(d=>this._tiles[d].tileID);for(const d of f)d.posMatrix=this.transform.calculatePosMatrix(d.toUnwrapped());return f}hasTransition(){if(this._source.hasTransition())return!0;if(Ke(this._source.type)){const s=C.now();for(const f in this._tiles)if(this._tiles[f].fadeEndTime>=s)return!0}return!1}setFeatureState(s,f,d){this._state.updateState(s=s||"_geojsonTileLayer",f,d)}removeFeatureState(s,f,d){this._state.removeFeatureState(s=s||"_geojsonTileLayer",f,d)}getFeatureState(s,f){return this._state.getState(s=s||"_geojsonTileLayer",f)}setDependencies(s,f,d){const m=this._tiles[s];m&&m.setDependencies(f,d)}reloadTilesForDependencies(s,f){for(const d in this._tiles)this._tiles[d].hasDependency(s,f)&&this._reloadTile(d,"reloading");this._cache.filter(d=>!d.hasDependency(s,f))}}function se(_,s){const f=Math.abs(2*_.wrap)-+(_.wrap<0),d=Math.abs(2*s.wrap)-+(s.wrap<0);return _.overscaledZ-s.overscaledZ||d-f||s.canonical.y-_.canonical.y||s.canonical.x-_.canonical.x}function Ke(_){return _==="raster"||_==="image"||_==="video"}jr.maxOverzooming=10,jr.maxUnderzooming=3;class Xe{constructor(s,f){this.reset(s,f)}reset(s,f){this.points=s||[],this._distances=[0];for(let d=1;d0?(m-I)/T:0;return this.points[v].mult(1-M).add(this.points[f].mult(M))}}function Mr(_,s){let f=!0;return _==="always"||_!=="never"&&s!=="never"||(f=!1),f}class Ho{constructor(s,f,d){const m=this.boxCells=[],v=this.circleCells=[];this.xCellCount=Math.ceil(s/d),this.yCellCount=Math.ceil(f/d);for(let I=0;Ithis.width||m<0||f>this.height)return[];const M=[];if(s<=0&&f<=0&&this.width<=d&&this.height<=m){if(v)return[{key:null,x1:s,y1:f,x2:d,y2:m}];for(let k=0;k0}hitTestCircle(s,f,d,m,v){const I=s-d,T=s+d,M=f-d,k=f+d;if(T<0||I>this.width||k<0||M>this.height)return!1;const z=[];return this._forEachCell(I,M,T,k,this._queryCellCircle,z,{hitTest:!0,overlapMode:m,circle:{x:s,y:f,radius:d},seenUids:{box:{},circle:{}}},v),z.length>0}_queryCell(s,f,d,m,v,I,T,M){const{seenUids:k,hitTest:z,overlapMode:B}=T,Z=this.boxCells[v];if(Z!==null){const rt=this.bboxes;for(const lt of Z)if(!k.box[lt]){k.box[lt]=!0;const tt=4*lt,yt=this.boxKeys[lt];if(s<=rt[tt+2]&&f<=rt[tt+3]&&d>=rt[tt+0]&&m>=rt[tt+1]&&(!M||M(yt))&&(!z||!Mr(B,yt.overlapMode))&&(I.push({key:yt,x1:rt[tt],y1:rt[tt+1],x2:rt[tt+2],y2:rt[tt+3]}),z))return!0}}const it=this.circleCells[v];if(it!==null){const rt=this.circles;for(const lt of it)if(!k.circle[lt]){k.circle[lt]=!0;const tt=3*lt,yt=this.circleKeys[lt];if(this._circleAndRectCollide(rt[tt],rt[tt+1],rt[tt+2],s,f,d,m)&&(!M||M(yt))&&(!z||!Mr(B,yt.overlapMode))){const kt=rt[tt],ut=rt[tt+1],wt=rt[tt+2];if(I.push({key:yt,x1:kt-wt,y1:ut-wt,x2:kt+wt,y2:ut+wt}),z)return!0}}}return!1}_queryCellCircle(s,f,d,m,v,I,T,M){const{circle:k,seenUids:z,overlapMode:B}=T,Z=this.boxCells[v];if(Z!==null){const rt=this.bboxes;for(const lt of Z)if(!z.box[lt]){z.box[lt]=!0;const tt=4*lt,yt=this.boxKeys[lt];if(this._circleAndRectCollide(k.x,k.y,k.radius,rt[tt+0],rt[tt+1],rt[tt+2],rt[tt+3])&&(!M||M(yt))&&!Mr(B,yt.overlapMode))return I.push(!0),!0}}const it=this.circleCells[v];if(it!==null){const rt=this.circles;for(const lt of it)if(!z.circle[lt]){z.circle[lt]=!0;const tt=3*lt,yt=this.circleKeys[lt];if(this._circlesCollide(rt[tt],rt[tt+1],rt[tt+2],k.x,k.y,k.radius)&&(!M||M(yt))&&!Mr(B,yt.overlapMode))return I.push(!0),!0}}}_forEachCell(s,f,d,m,v,I,T,M){const k=this._convertToXCellCoord(s),z=this._convertToYCellCoord(f),B=this._convertToXCellCoord(d),Z=this._convertToYCellCoord(m);for(let it=k;it<=B;it++)for(let rt=z;rt<=Z;rt++)if(v.call(this,s,f,d,m,this.xCellCount*rt+it,I,T,M))return}_convertToXCellCoord(s){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(s*this.xScale)))}_convertToYCellCoord(s){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(s*this.yScale)))}_circlesCollide(s,f,d,m,v,I){const T=m-s,M=v-f,k=d+I;return k*k>T*T+M*M}_circleAndRectCollide(s,f,d,m,v,I,T){const M=(I-m)/2,k=Math.abs(s-(m+M));if(k>M+d)return!1;const z=(T-v)/2,B=Math.abs(f-(v+z));if(B>z+d)return!1;if(k<=M||B<=z)return!0;const Z=k-M,it=B-z;return Z*Z+it*it<=d*d}}function He(_,s,f,d,m){const v=u.F();return s?(u.J(v,v,[1/m,1/m,1]),f||u.ad(v,v,d.angle)):u.K(v,d.labelPlaneMatrix,_),v}function fa(_,s,f,d,m){if(s){const v=u.ae(_);return u.J(v,v,[m,m,1]),f||u.ad(v,v,-d.angle),v}return d.glCoordMatrix}function Nr(_,s,f){let d;f?(d=[_.x,_.y,f(_.x,_.y),1],u.af(d,d,s)):(d=[_.x,_.y,0,1],we(d,d,s));const m=d[3];return{point:new u.P(d[0]/m,d[1]/m),signedDistanceFromCamera:m}}function at(_,s){return .5+_/s*.5}function V(_,s){const f=_[0]/_[3],d=_[1]/_[3];return f>=-s[0]&&f<=s[0]&&d>=-s[1]&&d<=s[1]}function j(_,s,f,d,m,v,I,T,M,k){const z=d?_.textSizeData:_.iconSizeData,B=u.ag(z,f.transform.zoom),Z=[256/f.width*2+1,256/f.height*2+1],it=d?_.text.dynamicLayoutVertexArray:_.icon.dynamicLayoutVertexArray;it.clear();const rt=_.lineVertexArray,lt=d?_.text.placedSymbolArray:_.icon.placedSymbolArray,tt=f.transform.width/f.transform.height;let yt=!1;for(let kt=0;ktMath.abs(f.x-s.x)*d?{useVertical:!0}:(_===u.ah.vertical?s.yf.x)?{needsFlipping:!0}:null}function vt(_,s,f,d,m,v,I,T,M,k,z,B,Z,it,rt,lt){const tt=s/24,yt=_.lineOffsetX*tt,kt=_.lineOffsetY*tt;let ut;if(_.numGlyphs>1){const wt=_.glyphStartIndex+_.numGlyphs,Dt=_.lineStartIndex,Ot=_.lineStartIndex+_.lineLength,Bt=X(tt,T,yt,kt,f,z,B,_,M,v,Z,rt,lt);if(!Bt)return{notEnoughRoom:!0};const Qt=Nr(Bt.first.point,I,lt).point,Jt=Nr(Bt.last.point,I,lt).point;if(d&&!f){const ie=nt(_.writingMode,Qt,Jt,it);if(ie)return ie}ut=[Bt.first];for(let ie=_.glyphStartIndex+1;ie0?Qt.point:Q(B,Bt,Dt,1,m,lt),ie=nt(_.writingMode,Dt,Jt,it);if(ie)return ie}const wt=Nt(tt*T.getoffsetX(_.glyphStartIndex),yt,kt,f,z,B,_.segment,_.lineStartIndex,_.lineStartIndex+_.lineLength,M,v,Z,rt,lt);if(!wt)return{notEnoughRoom:!0};ut=[wt]}for(const wt of ut)u.aj(k,wt.point,wt.angle);return{}}function Q(_,s,f,d,m,v){const I=Nr(_.add(_.sub(s)._unit()),m,v).point,T=f.sub(I);return f.add(T._mult(d/T.mag()))}function bt(_,s){const{projectionCache:f,lineVertexArray:d,labelPlaneMatrix:m,tileAnchorPoint:v,distanceFromAnchor:I,getElevation:T,previousVertex:M,direction:k,absOffsetX:z}=s;if(f.projections[_])return f.projections[_];const B=new u.P(d.getx(_),d.gety(_)),Z=Nr(B,m,T);if(Z.signedDistanceFromCamera>0)return f.projections[_]=Z.point,Z.point;const it=_-k;return Q(I===0?v:new u.P(d.getx(it),d.gety(it)),B,M,z-I+1,m,T)}function dt(_,s,f){return _._unit()._perp()._mult(s*f)}function Et(_,s,f,d,m,v,I,T){const{projectionCache:M,direction:k}=T;if(M.offsets[_])return M.offsets[_];const z=f.add(s);if(_+k=m)return M.offsets[_]=z,z;const B=bt(_+k,T),Z=dt(B.sub(f),I,k),it=f.add(Z),rt=B.add(Z);return M.offsets[_]=u.ak(v,z,it,rt)||z,M.offsets[_]}function Nt(_,s,f,d,m,v,I,T,M,k,z,B,Z,it){const rt=d?_-s:_+s;let lt=rt>0?1:-1,tt=0;d&&(lt*=-1,tt=Math.PI),lt<0&&(tt+=Math.PI);let yt,kt,ut=lt>0?T+I:T+I+1,wt=m,Dt=m,Ot=0,Bt=0;const Qt=Math.abs(rt),Jt=[];let ie;for(;Ot+Bt<=Qt;){if(ut+=lt,ut=M)return null;Ot+=Bt,Dt=wt,kt=yt;const le={projectionCache:B,lineVertexArray:k,labelPlaneMatrix:z,tileAnchorPoint:v,distanceFromAnchor:Ot,getElevation:it,previousVertex:Dt,direction:lt,absOffsetX:Qt};if(wt=bt(ut,le),f===0)Jt.push(Dt),ie=wt.sub(Dt);else{let Oe;const Qe=wt.sub(Dt);Oe=Qe.mag()===0?dt(bt(ut+lt,le).sub(wt),f,lt):dt(Qe,f,lt),kt||(kt=Dt.add(Oe)),yt=Et(ut,Oe,wt,T,M,kt,f,le),Jt.push(kt),ie=yt.sub(kt)}Bt=ie.mag()}const ae=ie._mult((Qt-Ot)/Bt)._add(kt||Dt),Je=tt+Math.atan2(wt.y-Dt.y,wt.x-Dt.x);return Jt.push(ae),{point:ae,angle:Z?Je:0,path:Jt}}const Ft=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ht(_,s){for(let f=0;f<_;f++){const d=s.length;s.resize(d+4),s.float32.set(Ft,3*d)}}function we(_,s,f){const d=s[0],m=s[1];return _[0]=f[0]*d+f[4]*m+f[12],_[1]=f[1]*d+f[5]*m+f[13],_[3]=f[3]*d+f[7]*m+f[15],_}const Te=100;class Ge{constructor(s,f=new Ho(s.width+200,s.height+200,25),d=new Ho(s.width+200,s.height+200,25)){this.transform=s,this.grid=f,this.ignoredGrid=d,this.pitchfactor=Math.cos(s._pitch)*s.cameraToCenterDistance,this.screenRightBoundary=s.width+Te,this.screenBottomBoundary=s.height+Te,this.gridRightBoundary=s.width+200,this.gridBottomBoundary=s.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(s,f,d,m,v,I){const T=this.projectAndGetPerspectiveRatio(m,s.anchorPointX,s.anchorPointY,I),M=d*T.perspectiveRatio,k=s.x1*M+T.point.x,z=s.y1*M+T.point.y,B=s.x2*M+T.point.x,Z=s.y2*M+T.point.y;return!this.isInsideGrid(k,z,B,Z)||f!=="always"&&this.grid.hitTest(k,z,B,Z,f,v)||T.perspectiveRatio=1;rn--)Qe.push(le.path[rn]);for(let rn=1;rnNr(an,M,rt));Qe=rn.some(an=>an.signedDistanceFromCamera<=0)?[]:rn.map(an=>an.point)}let Ue=[];if(Qe.length>0){const rn=Qe[0].clone(),an=Qe[0].clone();for(let Sr=1;Sr=ie.x&&an.x<=ae.x&&rn.y>=ie.y&&an.y<=ae.y?[Qe]:an.xae.x||an.yae.y?[]:u.al([Qe],ie.x,ie.y,ae.x,ae.y)}for(const rn of Ue){Je.reset(rn,.25*Jt);let an=0;an=Je.length<=.5*Jt?1:Math.ceil(Je.paddedLength/bn)+1;for(let Sr=0;Sr=this.screenRightBoundary||mthis.screenBottomBoundary}isInsideGrid(s,f,d,m){return d>=0&&s=0&&fd.collisionGroupID===f}}return this.collisionGroups[s]}}function Qr(_,s,f,d,m){const{horizontalAlign:v,verticalAlign:I}=u.at(_);return new u.P(-(v-.5)*s+d[0]*m,-(I-.5)*f+d[1]*m)}function Xi(_,s,f,d,m,v){const{x1:I,x2:T,y1:M,y2:k,anchorPointX:z,anchorPointY:B}=_,Z=new u.P(s,f);return d&&Z._rotate(m?v:-v),{x1:I+Z.x,y1:M+Z.y,x2:T+Z.x,y2:k+Z.y,anchorPointX:z,anchorPointY:B}}class ao{constructor(s,f,d,m,v){this.transform=s.clone(),this.terrain=f,this.collisionIndex=new Ge(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=d,this.retainedQueryData={},this.collisionGroups=new br(m),this.collisionCircleArrays={},this.prevPlacement=v,v&&(v.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(s,f,d,m){const v=d.getBucket(f),I=d.latestFeatureIndex;if(!v||!I||f.id!==v.layerIds[0])return;const T=d.collisionBoxArray,M=v.layers[0].layout,k=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),z=d.tileSize/u.W,B=this.transform.calculatePosMatrix(d.tileID.toUnwrapped()),Z=M.get("text-pitch-alignment")==="map",it=M.get("text-rotation-alignment")==="map",rt=je(d,1,this.transform.zoom),lt=He(B,Z,it,this.transform,rt);let tt=null;if(Z){const kt=fa(B,Z,it,this.transform,rt);tt=u.K([],this.transform.labelPlaneMatrix,kt)}this.retainedQueryData[v.bucketInstanceId]=new nn(v.bucketInstanceId,I,v.sourceLayerIndex,v.index,d.tileID);const yt={bucket:v,layout:M,posMatrix:B,textLabelPlaneMatrix:lt,labelToScreenMatrix:tt,scale:k,textPixelRatio:z,holdingForFade:d.holdingForFade(),collisionBoxArray:T,partiallyEvaluatedTextSize:u.ag(v.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(v.sourceID)};if(m)for(const kt of v.sortKeyRanges){const{sortKey:ut,symbolInstanceStart:wt,symbolInstanceEnd:Dt}=kt;s.push({sortKey:ut,symbolInstanceStart:wt,symbolInstanceEnd:Dt,parameters:yt})}else s.push({symbolInstanceStart:0,symbolInstanceEnd:v.symbolInstances.length,parameters:yt})}attemptAnchorPlacement(s,f,d,m,v,I,T,M,k,z,B,Z,it,rt,lt,tt){const yt=u.ap[s.textAnchor],kt=[s.textOffset0,s.textOffset1],ut=Qr(yt,d,m,kt,v),wt=this.collisionIndex.placeCollisionBox(Xi(f,ut.x,ut.y,I,T,this.transform.angle),B,M,k,z.predicate,tt);if((!lt||this.collisionIndex.placeCollisionBox(Xi(lt,ut.x,ut.y,I,T,this.transform.angle),B,M,k,z.predicate,tt).box.length!==0)&&wt.box.length>0){let Dt;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID].text&&(Dt=this.prevPlacement.variableOffsets[Z.crossTileID].anchor),Z.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Z.crossTileID]={textOffset:kt,width:d,height:m,anchor:yt,textBoxScale:v,prevAnchor:Dt},this.markUsedJustification(it,yt,Z,rt),it.allowVerticalPlacement&&(this.markUsedOrientation(it,rt,Z),this.placedOrientations[Z.crossTileID]=rt),{shift:ut,placedGlyphBoxes:wt}}}placeLayerBucketPart(s,f,d){const{bucket:m,layout:v,posMatrix:I,textLabelPlaneMatrix:T,labelToScreenMatrix:M,textPixelRatio:k,holdingForFade:z,collisionBoxArray:B,partiallyEvaluatedTextSize:Z,collisionGroup:it}=s.parameters,rt=v.get("text-optional"),lt=v.get("icon-optional"),tt=u.aq(v,"text-overlap","text-allow-overlap"),yt=tt==="always",kt=u.aq(v,"icon-overlap","icon-allow-overlap"),ut=kt==="always",wt=v.get("text-rotation-alignment")==="map",Dt=v.get("text-pitch-alignment")==="map",Ot=v.get("icon-text-fit")!=="none",Bt=v.get("symbol-z-order")==="viewport-y",Qt=yt&&(ut||!m.hasIconData()||lt),Jt=ut&&(yt||!m.hasTextData()||rt);!m.collisionArrays&&B&&m.deserializeCollisionBoxes(B);const ie=this.retainedQueryData[m.bucketInstanceId].tileID,ae=this.terrain?(le,Oe)=>this.terrain.getElevation(ie,le,Oe):null,Je=(le,Oe)=>{var Qe,bn;if(f[le.crossTileID])return;if(z)return void(this.placements[le.crossTileID]=new er(!1,!1,!1));let Ue=!1,rn=!1,an=!0,Sr=null,Bn={box:null,offscreen:null},Ao={box:null,offscreen:null},$r=null,fr=null,ti=null,ko=0,Bs=0,Ga=0;Oe.textFeatureIndex?ko=Oe.textFeatureIndex:le.useRuntimeCollisionCircles&&(ko=le.featureIndex),Oe.verticalTextFeatureIndex&&(Bs=Oe.verticalTextFeatureIndex);const pc=Oe.textBox;if(pc){const Hr=Xr=>{let dr=u.ah.horizontal;if(m.allowVerticalPlacement&&!Xr&&this.prevPlacement){const Jo=this.prevPlacement.placedOrientations[le.crossTileID];Jo&&(this.placedOrientations[le.crossTileID]=Jo,dr=Jo,this.markUsedOrientation(m,dr,le))}return dr},pr=(Xr,dr)=>{if(m.allowVerticalPlacement&&le.numVerticalGlyphVertices>0&&Oe.verticalTextBox){for(const Jo of m.writingModes)if(Jo===u.ah.vertical?(Bn=dr(),Ao=Bn):Bn=Xr(),Bn&&Bn.box&&Bn.box.length)break}else Bn=Xr()},rr=le.textAnchorOffsetStartIndex,Ko=le.textAnchorOffsetEndIndex;if(Ko===rr){const Xr=(dr,Jo)=>{const Yr=this.collisionIndex.placeCollisionBox(dr,tt,k,I,it.predicate,ae);return Yr&&Yr.box&&Yr.box.length&&(this.markUsedOrientation(m,Jo,le),this.placedOrientations[le.crossTileID]=Jo),Yr};pr(()=>Xr(pc,u.ah.horizontal),()=>{const dr=Oe.verticalTextBox;return m.allowVerticalPlacement&&le.numVerticalGlyphVertices>0&&dr?Xr(dr,u.ah.vertical):{box:null,offscreen:null}}),Hr(Bn&&Bn.box&&Bn.box.length)}else{let Xr=u.ap[(bn=(Qe=this.prevPlacement)===null||Qe===void 0?void 0:Qe.variableOffsets[le.crossTileID])===null||bn===void 0?void 0:bn.anchor];const dr=(Yr,Ar,_p)=>{const Im=Yr.x2-Yr.x1,Cl=Yr.y2-Yr.y1,Tl=le.textBoxScale,Mh=Ot&&kt==="never"?Ar:null;let ja={box:[],offscreen:!1},vp=tt==="never"?1:2,Cm="never";Xr&&vp++;for(let bp=0;bpdr(pc,Oe.iconBox,u.ah.horizontal),()=>{const Yr=Oe.verticalTextBox;return m.allowVerticalPlacement&&!(Bn&&Bn.box&&Bn.box.length)&&le.numVerticalGlyphVertices>0&&Yr?dr(Yr,Oe.verticalIconBox,u.ah.vertical):{box:null,offscreen:null}}),Bn&&(Ue=Bn.box,an=Bn.offscreen);const Jo=Hr(Bn&&Bn.box);if(!Ue&&this.prevPlacement){const Yr=this.prevPlacement.variableOffsets[le.crossTileID];Yr&&(this.variableOffsets[le.crossTileID]=Yr,this.markUsedJustification(m,Yr.anchor,le,Jo))}}}if($r=Bn,Ue=$r&&$r.box&&$r.box.length>0,an=$r&&$r.offscreen,le.useRuntimeCollisionCircles){const Hr=m.text.placedSymbolArray.get(le.centerJustifiedTextSymbolIndex),pr=u.ai(m.textSizeData,Z,Hr),rr=v.get("text-padding");fr=this.collisionIndex.placeCollisionCircles(tt,Hr,m.lineVertexArray,m.glyphOffsetArray,pr,I,T,M,d,Dt,it.predicate,le.collisionCircleDiameter,rr,ae),fr.circles.length&&fr.collisionDetected&&!d&&u.w("Collisions detected, but collision boxes are not shown"),Ue=yt||fr.circles.length>0&&!fr.collisionDetected,an=an&&fr.offscreen}if(Oe.iconFeatureIndex&&(Ga=Oe.iconFeatureIndex),Oe.iconBox){const Hr=pr=>{const rr=Ot&&Sr?Xi(pr,Sr.x,Sr.y,wt,Dt,this.transform.angle):pr;return this.collisionIndex.placeCollisionBox(rr,kt,k,I,it.predicate,ae)};Ao&&Ao.box&&Ao.box.length&&Oe.verticalIconBox?(ti=Hr(Oe.verticalIconBox),rn=ti.box.length>0):(ti=Hr(Oe.iconBox),rn=ti.box.length>0),an=an&&ti.offscreen}const qa=rt||le.numHorizontalGlyphVertices===0&&le.numVerticalGlyphVertices===0,Vs=lt||le.numIconVertices===0;if(qa||Vs?Vs?qa||(rn=rn&&Ue):Ue=rn&&Ue:rn=Ue=rn&&Ue,Ue&&$r&&$r.box&&this.collisionIndex.insertCollisionBox($r.box,tt,v.get("text-ignore-placement"),m.bucketInstanceId,Ao&&Ao.box&&Bs?Bs:ko,it.ID),rn&&ti&&this.collisionIndex.insertCollisionBox(ti.box,kt,v.get("icon-ignore-placement"),m.bucketInstanceId,Ga,it.ID),fr&&(Ue&&this.collisionIndex.insertCollisionCircles(fr.circles,tt,v.get("text-ignore-placement"),m.bucketInstanceId,ko,it.ID),d)){const Hr=m.bucketInstanceId;let pr=this.collisionCircleArrays[Hr];pr===void 0&&(pr=this.collisionCircleArrays[Hr]=new Wr);for(let rr=0;rr=0;--Oe){const Qe=le[Oe];Je(m.symbolInstances.get(Qe),m.collisionArrays[Qe])}}else for(let le=s.symbolInstanceStart;le=0&&(s.text.placedSymbolArray.get(T).crossTileID=v>=0&&T!==v?0:d.crossTileID)}markUsedOrientation(s,f,d){const m=f===u.ah.horizontal||f===u.ah.horizontalOnly?f:0,v=f===u.ah.vertical?f:0,I=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex];for(const T of I)s.text.placedSymbolArray.get(T).placedOrientation=m;d.verticalPlacedTextSymbolIndex&&(s.text.placedSymbolArray.get(d.verticalPlacedTextSymbolIndex).placedOrientation=v)}commit(s){this.commitTime=s,this.zoomAtLastRecencyCheck=this.transform.zoom;const f=this.prevPlacement;let d=!1;this.prevZoomAdjustment=f?f.zoomAdjustment(this.transform.zoom):0;const m=f?f.symbolFadeChange(s):1,v=f?f.opacities:{},I=f?f.variableOffsets:{},T=f?f.placedOrientations:{};for(const M in this.placements){const k=this.placements[M],z=v[M];z?(this.opacities[M]=new Un(z,m,k.text,k.icon),d=d||k.text!==z.text.placed||k.icon!==z.icon.placed):(this.opacities[M]=new Un(null,m,k.text,k.icon,k.skipFade),d=d||k.text||k.icon)}for(const M in v){const k=v[M];if(!this.opacities[M]){const z=new Un(k,m,!1,!1);z.isHidden()||(this.opacities[M]=z,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(f&&f.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");d?this.lastPlacementChangeTime=s:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=f?f.lastPlacementChangeTime:s)}updateLayerOpacities(s,f){const d={};for(const m of f){const v=m.getBucket(s);v&&m.latestFeatureIndex&&s.id===v.layerIds[0]&&this.updateBucketOpacities(v,d,m.collisionBoxArray)}}updateBucketOpacities(s,f,d){s.hasTextData()&&(s.text.opacityVertexArray.clear(),s.text.hasVisibleVertices=!1),s.hasIconData()&&(s.icon.opacityVertexArray.clear(),s.icon.hasVisibleVertices=!1),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexArray.clear(),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexArray.clear();const m=s.layers[0],v=m.layout,I=new Un(null,0,!1,!1,!0),T=v.get("text-allow-overlap"),M=v.get("icon-allow-overlap"),k=m._unevaluatedLayout.hasValue("text-variable-anchor")||m._unevaluatedLayout.hasValue("text-variable-anchor-offset"),z=v.get("text-rotation-alignment")==="map",B=v.get("text-pitch-alignment")==="map",Z=v.get("icon-text-fit")!=="none",it=new Un(null,0,T&&(M||!s.hasIconData()||v.get("icon-optional")),M&&(T||!s.hasTextData()||v.get("text-optional")),!0);!s.collisionArrays&&d&&(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData())&&s.deserializeCollisionBoxes(d);const rt=(lt,tt,yt)=>{for(let kt=0;kt0,Ot=this.placedOrientations[tt.crossTileID],Bt=Ot===u.ah.vertical,Qt=Ot===u.ah.horizontal||Ot===u.ah.horizontalOnly;if(yt>0||kt>0){const Jt=lo(wt.text);rt(s.text,yt,Bt?Wu:Jt),rt(s.text,kt,Qt?Wu:Jt);const ie=wt.text.isHidden();[tt.rightJustifiedTextSymbolIndex,tt.centerJustifiedTextSymbolIndex,tt.leftJustifiedTextSymbolIndex].forEach(le=>{le>=0&&(s.text.placedSymbolArray.get(le).hidden=ie||Bt?1:0)}),tt.verticalPlacedTextSymbolIndex>=0&&(s.text.placedSymbolArray.get(tt.verticalPlacedTextSymbolIndex).hidden=ie||Qt?1:0);const ae=this.variableOffsets[tt.crossTileID];ae&&this.markUsedJustification(s,ae.anchor,tt,Ot);const Je=this.placedOrientations[tt.crossTileID];Je&&(this.markUsedJustification(s,"left",tt,Je),this.markUsedOrientation(s,Je,tt))}if(Dt){const Jt=lo(wt.icon),ie=!(Z&&tt.verticalPlacedIconSymbolIndex&&Bt);tt.placedIconSymbolIndex>=0&&(rt(s.icon,tt.numIconVertices,ie?Jt:Wu),s.icon.placedSymbolArray.get(tt.placedIconSymbolIndex).hidden=wt.icon.isHidden()),tt.verticalPlacedIconSymbolIndex>=0&&(rt(s.icon,tt.numVerticalIconVertices,ie?Wu:Jt),s.icon.placedSymbolArray.get(tt.verticalPlacedIconSymbolIndex).hidden=wt.icon.isHidden())}if(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData()){const Jt=s.collisionArrays[lt];if(Jt){let ie=new u.P(0,0);if(Jt.textBox||Jt.verticalTextBox){let Je=!0;if(k){const le=this.variableOffsets[ut];le?(ie=Qr(le.anchor,le.width,le.height,le.textOffset,le.textBoxScale),z&&ie._rotate(B?this.transform.angle:-this.transform.angle)):Je=!1}Jt.textBox&&hi(s.textCollisionBox.collisionVertexArray,wt.text.placed,!Je||Bt,ie.x,ie.y),Jt.verticalTextBox&&hi(s.textCollisionBox.collisionVertexArray,wt.text.placed,!Je||Qt,ie.x,ie.y)}const ae=!!(!Qt&&Jt.verticalIconBox);Jt.iconBox&&hi(s.iconCollisionBox.collisionVertexArray,wt.icon.placed,ae,Z?ie.x:0,Z?ie.y:0),Jt.verticalIconBox&&hi(s.iconCollisionBox.collisionVertexArray,wt.icon.placed,!ae,Z?ie.x:0,Z?ie.y:0)}}}if(s.sortFeatures(this.transform.angle),this.retainedQueryData[s.bucketInstanceId]&&(this.retainedQueryData[s.bucketInstanceId].featureSortOrder=s.featureSortOrder),s.hasTextData()&&s.text.opacityVertexBuffer&&s.text.opacityVertexBuffer.updateData(s.text.opacityVertexArray),s.hasIconData()&&s.icon.opacityVertexBuffer&&s.icon.opacityVertexBuffer.updateData(s.icon.opacityVertexArray),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexBuffer&&s.iconCollisionBox.collisionVertexBuffer.updateData(s.iconCollisionBox.collisionVertexArray),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexBuffer&&s.textCollisionBox.collisionVertexBuffer.updateData(s.textCollisionBox.collisionVertexArray),s.text.opacityVertexArray.length!==s.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${s.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${s.text.layoutVertexArray.length}) / 4`);if(s.icon.opacityVertexArray.length!==s.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${s.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${s.icon.layoutVertexArray.length}) / 4`);if(s.bucketInstanceId in this.collisionCircleArrays){const lt=this.collisionCircleArrays[s.bucketInstanceId];s.placementInvProjMatrix=lt.invProjMatrix,s.placementViewportMatrix=lt.viewportMatrix,s.collisionCircleArray=lt.circles,delete this.collisionCircleArrays[s.bucketInstanceId]}}symbolFadeChange(s){return this.fadeDuration===0?1:(s-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(s){return Math.max(0,(this.transform.zoom-s)/1.5)}hasTransitions(s){return this.stale||s-this.lastPlacementChangeTimes}setStale(){this.stale=!0}}function hi(_,s,f,d,m){_.emplaceBack(s?1:0,f?1:0,d||0,m||0),_.emplaceBack(s?1:0,f?1:0,d||0,m||0),_.emplaceBack(s?1:0,f?1:0,d||0,m||0),_.emplaceBack(s?1:0,f?1:0,d||0,m||0)}const Rs=Math.pow(2,25),Gd=Math.pow(2,24),xy=Math.pow(2,17),zn=Math.pow(2,16),Vf=Math.pow(2,9),Uf=Math.pow(2,8),Lo=Math.pow(2,1);function lo(_){if(_.opacity===0&&!_.placed)return 0;if(_.opacity===1&&_.placed)return 4294967295;const s=_.placed?1:0,f=Math.floor(127*_.opacity);return f*Rs+s*Gd+f*xy+s*zn+f*Vf+s*Uf+f*Lo+s}const Wu=0;class Xo{constructor(s){this._sortAcrossTiles=s.layout.get("symbol-z-order")!=="viewport-y"&&!s.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(s,f,d,m,v){const I=this._bucketParts;for(;this._currentTileIndexT.sortKey-M.sortKey));this._currentPartIndex!this._forceFullPlacement&&C.now()-m>2;for(;this._currentPlacementIndex>=0;){const I=f[s[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 Xo(I)),this._inProgressLayer.continuePlacement(d[I.source],this.placement,this._showCollisionBoxes,I,v))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(s){return this.placement.commit(s),this.placement}}const Ql=512/u.W/2;class Wc{constructor(s,f,d){this.tileID=s,this.bucketInstanceId=d,this._symbolsByKey={};const m=new Map;for(let v=0;v({x:Math.floor(M.anchorX*Ql),y:Math.floor(M.anchorY*Ql)})),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:z}of T.positions)M.add(k,z);M.finish(),delete T.positions,T.index=M}this._symbolsByKey[v]=T}}getScaledCoordinates(s,f){const{x:d,y:m,z:v}=this.tileID.canonical,{x:I,y:T,z:M}=f.canonical,k=Ql/Math.pow(2,M-v),z=(T*u.W+s.anchorY)*k,B=m*u.W*Ql;return{x:Math.floor((I*u.W+s.anchorX)*k-d*u.W*Ql),y:Math.floor(z-B)}}findMatches(s,f,d){const m=this.tileID.canonical.zs)}}class Zr{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Zu{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(s){const f=Math.round((s-this.lng)/360);if(f!==0)for(const d in this.indexes){const m=this.indexes[d],v={};for(const I in m){const T=m[I];T.tileID=T.tileID.unwrapTo(T.tileID.wrap+f),v[T.tileID.key]=T}this.indexes[d]=v}this.lng=s}addBucket(s,f,d){if(this.indexes[s.overscaledZ]&&this.indexes[s.overscaledZ][s.key]){if(this.indexes[s.overscaledZ][s.key].bucketInstanceId===f.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(s.overscaledZ,this.indexes[s.overscaledZ][s.key])}for(let v=0;vs.overscaledZ)for(const T in I){const M=I[T];M.tileID.isChildOf(s)&&M.findMatches(f.symbolInstances,s,m)}else{const T=I[s.scaledTo(Number(v)).key];T&&T.findMatches(f.symbolInstances,s,m)}}for(let v=0;v{f[d]=!0});for(const d in this.layerIndexes)f[d]||delete this.layerIndexes[d]}}const hr=(_,s)=>u.t(_,s&&s.filter(f=>f.identifier!=="source.canvas")),Zc=u.av();class Po extends u.E{constructor(s,f={}){super(),this._rtlPluginLoaded=()=>{for(const d in this.sourceCaches){const m=this.sourceCaches[d].getSource().type;m!=="vector"&&m!=="geojson"||this.sourceCaches[d].reload()}},this.map=s,this.dispatcher=new _r(Mn(),s._getMapId()),this.dispatcher.registerMessageHandler("GG",(d,m)=>this.getGlyphs(d,m)),this.dispatcher.registerMessageHandler("GI",(d,m)=>this.getImages(d,m)),this.imageManager=new $t,this.imageManager.setEventedParent(this),this.glyphManager=new qt(s._requestManager,f.localIdeographFontFamily),this.lineAtlas=new Ve(256,512),this.crossTileSymbolIndex=new Oa,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new u.aw,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",u.ax()),ee().on(xi,this._rtlPluginLoaded),this.on("data",d=>{if(d.dataType!=="source"||d.sourceDataType!=="metadata")return;const m=this.sourceCaches[d.sourceId];if(!m)return;const v=m.getSource();if(v&&v.vectorLayerIds)for(const I in this._layers){const T=this._layers[I];T.source===v.id&&this._validateLayer(T)}})}loadURL(s,f={},d){this.fire(new u.k("dataloading",{dataType:"style"})),f.validate=typeof f.validate!="boolean"||f.validate;const m=this.map._requestManager.transformRequest(s,"Style");this._loadStyleRequest=new AbortController,u.h(m,this._loadStyleRequest).then(v=>{this._loadStyleRequest=null,this._load(v.data,f,d)}).catch(v=>{this._loadStyleRequest=null,v&&this.fire(new u.j(v))})}loadJSON(s,f={},d){this.fire(new u.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,C.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,f.validate=f.validate!==!1,this._load(s,f,d)}).catch(()=>{})}loadEmpty(){this.fire(new u.k("dataloading",{dataType:"style"})),this._load(Zc,{validate:!1})}_load(s,f,d){var m;const v=f.transformStyle?f.transformStyle(d,s):s;if(!f.validate||!hr(this,u.x(v))){this._loaded=!0,this.stylesheet=v;for(const I in v.sources)this.addSource(I,v.sources[I],{validate:!1});v.sprite?this._loadSprite(v.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(v.glyphs),this._createLayers(),this.light=new pn(this.stylesheet.light),this.map.setTerrain((m=this.stylesheet.terrain)!==null&&m!==void 0?m:null),this.fire(new u.k("data",{dataType:"style"})),this.fire(new u.k("style.load"))}}_createLayers(){const s=u.ay(this.stylesheet.layers);this.dispatcher.broadcast("SL",s),this._order=s.map(f=>f.id),this._layers={},this._serializedLayers=null;for(const f of s){const d=u.az(f);d.setEventedParent(this,{layer:{id:f.id}}),this._layers[f.id]=d}}_loadSprite(s,f=!1,d=void 0){let m;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(v,I,T,M){return u._(this,void 0,void 0,function*(){const k=Pt(v),z=T>1?"@2x":"",B={},Z={};for(const{id:it,url:rt}of k){const lt=I.transformRequest(I.normalizeSpriteURL(rt,z,".json"),"SpriteJSON");B[it]=u.h(lt,M);const tt=I.transformRequest(I.normalizeSpriteURL(rt,z,".png"),"SpriteImage");Z[it]=G.getImage(tt,M)}return yield Promise.all([...Object.values(B),...Object.values(Z)]),function(it,rt){return u._(this,void 0,void 0,function*(){const lt={};for(const tt in it){lt[tt]={};const yt=C.getImageCanvasContext((yield rt[tt]).data),kt=(yield it[tt]).data;for(const ut in kt){const{width:wt,height:Dt,x:Ot,y:Bt,sdf:Qt,pixelRatio:Jt,stretchX:ie,stretchY:ae,content:Je}=kt[ut];lt[tt][ut]={data:null,pixelRatio:Jt,sdf:Qt,stretchX:ie,stretchY:ae,content:Je,spriteData:{width:wt,height:Dt,x:Ot,y:Bt,context:yt}}}}return lt})}(B,Z)})}(s,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(v=>{if(this._spriteRequest=null,v)for(const I in v){this._spritesImagesIds[I]=[];const T=this._spritesImagesIds[I]?this._spritesImagesIds[I].filter(M=>!(M in v)):[];for(const M of T)this.imageManager.removeImage(M),this._changedImages[M]=!0;for(const M in v[I]){const k=I==="default"?M:`${I}:${M}`;this._spritesImagesIds[I].push(k),k in this.imageManager.images?this.imageManager.updateImage(k,v[I][M],!1):this.imageManager.addImage(k,v[I][M]),f&&(this._changedImages[k]=!0)}}}).catch(v=>{this._spriteRequest=null,m=v,this.fire(new u.j(m))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),f&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new u.k("data",{dataType:"style"})),d&&d(m)})}_unloadSprite(){for(const s of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(s),this._changedImages[s]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}_validateLayer(s){const f=this.sourceCaches[s.source];if(!f)return;const d=s.sourceLayer;if(!d)return;const m=f.getSource();(m.type==="geojson"||m.vectorLayerIds&&m.vectorLayerIds.indexOf(d)===-1)&&this.fire(new u.j(new Error(`Source layer "${d}" does not exist on source "${m.id}" as specified by style layer "${s.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const s in this.sourceCaches)if(!this.sourceCaches[s].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(s){const f=this._serializedAllLayers();if(!s||s.length===0)return Object.values(f);const d=[];for(const m of s)f[m]&&d.push(f[m]);return d}_serializedAllLayers(){let s=this._serializedLayers;if(s)return s;s=this._serializedLayers={};const f=Object.keys(this._layers);for(const d of f){const m=this._layers[d];m.type!=="custom"&&(s[d]=m.serialize())}return s}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const s in this.sourceCaches)if(this.sourceCaches[s].hasTransition())return!0;for(const s in this._layers)if(this._layers[s].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(s){if(!this._loaded)return;const f=this._changed;if(f){const m=Object.keys(this._updatedLayers),v=Object.keys(this._removedLayers);(m.length||v.length)&&this._updateWorkerLayers(m,v);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(s);this.light.updateTransitions(s),this._resetUpdates()}const d={};for(const m in this.sourceCaches){const v=this.sourceCaches[m];d[m]=v.used,v.used=!1}for(const m of this._order){const v=this._layers[m];v.recalculate(s,this._availableImages),!v.isHidden(s.zoom)&&v.source&&(this.sourceCaches[v.source].used=!0)}for(const m in d){const v=this.sourceCaches[m];!!d[m]!=!!v.used&&v.fire(new u.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:m}))}this.light.recalculate(s),this.z=s.zoom,f&&this.fire(new u.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const s=Object.keys(this._changedImages);if(s.length){for(const f in this.sourceCaches)this.sourceCaches[f].reloadTilesForDependencies(["icons","patterns"],s);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(s,f){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(s),removedIds:f})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(s,f={}){var d;this._checkLoaded();const m=this.serialize();if(s=f.transformStyle?f.transformStyle(m,s):s,((d=f.validate)===null||d===void 0||d)&&hr(this,u.x(s)))return!1;(s=u.aA(s)).layers=u.ay(s.layers);const v=u.aB(m,s),I=this._getOperationsToPerform(v);if(I.unimplemented.length>0)throw new Error(`Unimplemented: ${I.unimplemented.join(", ")}.`);if(I.operations.length===0)return!1;for(const T of I.operations)T();return this.stylesheet=s,this._serializedLayers=null,!0}_getOperationsToPerform(s){const f=[],d=[];for(const m of s)switch(m.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":f.push(()=>this.addLayer.apply(this,m.args));break;case"removeLayer":f.push(()=>this.removeLayer.apply(this,m.args));break;case"setPaintProperty":f.push(()=>this.setPaintProperty.apply(this,m.args));break;case"setLayoutProperty":f.push(()=>this.setLayoutProperty.apply(this,m.args));break;case"setFilter":f.push(()=>this.setFilter.apply(this,m.args));break;case"addSource":f.push(()=>this.addSource.apply(this,m.args));break;case"removeSource":f.push(()=>this.removeSource.apply(this,m.args));break;case"setLayerZoomRange":f.push(()=>this.setLayerZoomRange.apply(this,m.args));break;case"setLight":f.push(()=>this.setLight.apply(this,m.args));break;case"setGeoJSONSourceData":f.push(()=>this.setGeoJSONSourceData.apply(this,m.args));break;case"setGlyphs":f.push(()=>this.setGlyphs.apply(this,m.args));break;case"setSprite":f.push(()=>this.setSprite.apply(this,m.args));break;case"setTerrain":f.push(()=>this.map.setTerrain.apply(this,m.args));break;case"setTransition":f.push(()=>{});break;default:d.push(m.command)}return{operations:f,unimplemented:d}}addImage(s,f){if(this.getImage(s))return this.fire(new u.j(new Error(`An image named "${s}" already exists.`)));this.imageManager.addImage(s,f),this._afterImageUpdated(s)}updateImage(s,f){this.imageManager.updateImage(s,f)}getImage(s){return this.imageManager.getImage(s)}removeImage(s){if(!this.getImage(s))return this.fire(new u.j(new Error(`An image named "${s}" does not exist.`)));this.imageManager.removeImage(s),this._afterImageUpdated(s)}_afterImageUpdated(s){this._availableImages=this.imageManager.listImages(),this._changedImages[s]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(s,f,d={}){if(this._checkLoaded(),this.sourceCaches[s]!==void 0)throw new Error(`Source "${s}" already exists.`);if(!f.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(f).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(f.type)>=0&&this._validate(u.x.source,`sources.${s}`,f,null,d))return;this.map&&this.map._collectResourceTiming&&(f.collectResourceTiming=!0);const m=this.sourceCaches[s]=new jr(s,f,this.dispatcher);m.style=this,m.setEventedParent(this,()=>({isSourceLoaded:m.loaded(),source:m.serialize(),sourceId:s})),m.onAdd(this.map),this._changed=!0}removeSource(s){if(this._checkLoaded(),this.sourceCaches[s]===void 0)throw new Error("There is no source with this ID");for(const d in this._layers)if(this._layers[d].source===s)return this.fire(new u.j(new Error(`Source "${s}" cannot be removed while layer "${d}" is using it.`)));const f=this.sourceCaches[s];delete this.sourceCaches[s],delete this._updatedSources[s],f.fire(new u.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:s})),f.setEventedParent(null),f.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(s,f){if(this._checkLoaded(),this.sourceCaches[s]===void 0)throw new Error(`There is no source with this ID=${s}`);const d=this.sourceCaches[s].getSource();if(d.type!=="geojson")throw new Error(`geojsonSource.type is ${d.type}, which is !== 'geojson`);d.setData(f),this._changed=!0}getSource(s){return this.sourceCaches[s]&&this.sourceCaches[s].getSource()}addLayer(s,f,d={}){this._checkLoaded();const m=s.id;if(this.getLayer(m))return void this.fire(new u.j(new Error(`Layer "${m}" already exists on this map.`)));let v;if(s.type==="custom"){if(hr(this,u.aC(s)))return;v=u.az(s)}else{if("source"in s&&typeof s.source=="object"&&(this.addSource(m,s.source),s=u.aA(s),s=u.e(s,{source:m})),this._validate(u.x.layer,`layers.${m}`,s,{arrayIndex:-1},d))return;v=u.az(s),this._validateLayer(v),v.setEventedParent(this,{layer:{id:m}})}const I=f?this._order.indexOf(f):this._order.length;if(f&&I===-1)this.fire(new u.j(new Error(`Cannot add layer "${m}" before non-existing layer "${f}".`)));else{if(this._order.splice(I,0,m),this._layerOrderChanged=!0,this._layers[m]=v,this._removedLayers[m]&&v.source&&v.type!=="custom"){const T=this._removedLayers[m];delete this._removedLayers[m],T.type!==v.type?this._updatedSources[v.source]="clear":(this._updatedSources[v.source]="reload",this.sourceCaches[v.source].pause())}this._updateLayer(v),v.onAdd&&v.onAdd(this.map)}}moveLayer(s,f){if(this._checkLoaded(),this._changed=!0,!this._layers[s])return void this.fire(new u.j(new Error(`The layer '${s}' does not exist in the map's style and cannot be moved.`)));if(s===f)return;const d=this._order.indexOf(s);this._order.splice(d,1);const m=f?this._order.indexOf(f):this._order.length;f&&m===-1?this.fire(new u.j(new Error(`Cannot move layer "${s}" before non-existing layer "${f}".`))):(this._order.splice(m,0,s),this._layerOrderChanged=!0)}removeLayer(s){this._checkLoaded();const f=this._layers[s];if(!f)return void this.fire(new u.j(new Error(`Cannot remove non-existing layer "${s}".`)));f.setEventedParent(null);const d=this._order.indexOf(s);this._order.splice(d,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[s]=f,delete this._layers[s],this._serializedLayers&&delete this._serializedLayers[s],delete this._updatedLayers[s],delete this._updatedPaintProps[s],f.onRemove&&f.onRemove(this.map)}getLayer(s){return this._layers[s]}getLayersOrder(){return[...this._order]}hasLayer(s){return s in this._layers}setLayerZoomRange(s,f,d){this._checkLoaded();const m=this.getLayer(s);m?m.minzoom===f&&m.maxzoom===d||(f!=null&&(m.minzoom=f),d!=null&&(m.maxzoom=d),this._updateLayer(m)):this.fire(new u.j(new Error(`Cannot set the zoom range of non-existing layer "${s}".`)))}setFilter(s,f,d={}){this._checkLoaded();const m=this.getLayer(s);if(m){if(!u.aD(m.filter,f))return f==null?(m.filter=void 0,void this._updateLayer(m)):void(this._validate(u.x.filter,`layers.${m.id}.filter`,f,null,d)||(m.filter=u.aA(f),this._updateLayer(m)))}else this.fire(new u.j(new Error(`Cannot filter non-existing layer "${s}".`)))}getFilter(s){return u.aA(this.getLayer(s).filter)}setLayoutProperty(s,f,d,m={}){this._checkLoaded();const v=this.getLayer(s);v?u.aD(v.getLayoutProperty(f),d)||(v.setLayoutProperty(f,d,m),this._updateLayer(v)):this.fire(new u.j(new Error(`Cannot style non-existing layer "${s}".`)))}getLayoutProperty(s,f){const d=this.getLayer(s);if(d)return d.getLayoutProperty(f);this.fire(new u.j(new Error(`Cannot get style of non-existing layer "${s}".`)))}setPaintProperty(s,f,d,m={}){this._checkLoaded();const v=this.getLayer(s);v?u.aD(v.getPaintProperty(f),d)||(v.setPaintProperty(f,d,m)&&this._updateLayer(v),this._changed=!0,this._updatedPaintProps[s]=!0,this._serializedLayers=null):this.fire(new u.j(new Error(`Cannot style non-existing layer "${s}".`)))}getPaintProperty(s,f){return this.getLayer(s).getPaintProperty(f)}setFeatureState(s,f){this._checkLoaded();const d=s.source,m=s.sourceLayer,v=this.sourceCaches[d];if(v===void 0)return void this.fire(new u.j(new Error(`The source '${d}' does not exist in the map's style.`)));const I=v.getSource().type;I==="geojson"&&m?this.fire(new u.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):I!=="vector"||m?(s.id===void 0&&this.fire(new u.j(new Error("The feature id parameter must be provided."))),v.setFeatureState(m,s.id,f)):this.fire(new u.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(s,f){this._checkLoaded();const d=s.source,m=this.sourceCaches[d];if(m===void 0)return void this.fire(new u.j(new Error(`The source '${d}' does not exist in the map's style.`)));const v=m.getSource().type,I=v==="vector"?s.sourceLayer:void 0;v!=="vector"||I?f&&typeof s.id!="string"&&typeof s.id!="number"?this.fire(new u.j(new Error("A feature id is required to remove its specific state property."))):m.removeFeatureState(I,s.id,f):this.fire(new u.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(s){this._checkLoaded();const f=s.source,d=s.sourceLayer,m=this.sourceCaches[f];if(m!==void 0)return m.getSource().type!=="vector"||d?(s.id===void 0&&this.fire(new u.j(new Error("The feature id parameter must be provided."))),m.getFeatureState(d,s.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 '${f}' 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 s=u.aE(this.sourceCaches,v=>v.serialize()),f=this._serializeByIds(this._order),d=this.map.getTerrain()||void 0,m=this.stylesheet;return u.aF({version:m.version,name:m.name,metadata:m.metadata,light:m.light,center:m.center,zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,sprite:m.sprite,glyphs:m.glyphs,transition:m.transition,sources:s,layers:f,terrain:d},v=>v!==void 0)}_updateLayer(s){this._updatedLayers[s.id]=!0,s.source&&!this._updatedSources[s.source]&&this.sourceCaches[s.source].getSource().type!=="raster"&&(this._updatedSources[s.source]="reload",this.sourceCaches[s.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(s){const f=I=>this._layers[I].type==="fill-extrusion",d={},m=[];for(let I=this._order.length-1;I>=0;I--){const T=this._order[I];if(f(T)){d[T]=I;for(const M of s){const k=M[T];if(k)for(const z of k)m.push(z)}}}m.sort((I,T)=>T.intersectionZ-I.intersectionZ);const v=[];for(let I=this._order.length-1;I>=0;I--){const T=this._order[I];if(f(T))for(let M=m.length-1;M>=0;M--){const k=m[M].feature;if(d[k.layer.id]{const Qt=yt.featureSortOrder;if(Qt){const Jt=Qt.indexOf(Ot.featureIndex);return Qt.indexOf(Bt.featureIndex)-Jt}return Bt.featureIndex-Ot.featureIndex});for(const Ot of Dt)wt.push(Ot)}}for(const yt in rt)rt[yt].forEach(kt=>{const ut=kt.feature,wt=k[T[yt].source].getFeatureState(ut.layer["source-layer"],ut.id);ut.source=ut.layer.source,ut.layer["source-layer"]&&(ut.sourceLayer=ut.layer["source-layer"]),ut.state=wt});return rt}(this._layers,I,this.sourceCaches,s,f,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(v)}querySourceFeatures(s,f){f&&f.filter&&this._validate(u.x.filter,"querySourceFeatures.filter",f.filter,null,f);const d=this.sourceCaches[s];return d?function(m,v){const I=m.getRenderableIds().map(k=>m.getTileByID(k)),T=[],M={};for(let k=0;kZ.getTileByID(it)).sort((it,rt)=>rt.tileID.overscaledZ-it.tileID.overscaledZ||(it.tileID.isLessThan(rt.tileID)?-1:1))}const B=this.crossTileSymbolIndex.addLayer(z,M[z.source],s.center.lng);I=I||B}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((v=v||this._layerOrderChanged||d===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(C.now(),s.zoom))&&(this.pauseablePlacement=new Yo(s,this.map.terrain,this._order,v,f,d,m,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(C.now()),T=!0),I&&this.pauseablePlacement.placement.setStale()),T||I)for(const k of this._order){const z=this._layers[k];z.type==="symbol"&&this.placement.updateLayerOpacities(z,M[z.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(C.now())}_releaseSymbolFadeTiles(){for(const s in this.sourceCaches)this.sourceCaches[s].releaseSymbolFadeTiles()}getImages(s,f){return u._(this,void 0,void 0,function*(){const d=yield this.imageManager.getImages(f.icons);this._updateTilesForChangedImages();const m=this.sourceCaches[f.source];return m&&m.setDependencies(f.tileID.key,f.type,f.icons),d})}getGlyphs(s,f){return u._(this,void 0,void 0,function*(){const d=yield this.glyphManager.getGlyphs(f.stacks),m=this.sourceCaches[f.source];return m&&m.setDependencies(f.tileID.key,f.type,[""]),d})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(s,f={}){this._checkLoaded(),s&&this._validate(u.x.glyphs,"glyphs",s,null,f)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=s,this.glyphManager.entries={},this.glyphManager.setURL(s))}addSprite(s,f,d={},m){this._checkLoaded();const v=[{id:s,url:f}],I=[...Pt(this.stylesheet.sprite),...v];this._validate(u.x.sprite,"sprite",I,null,d)||(this.stylesheet.sprite=I,this._loadSprite(v,!0,m))}removeSprite(s){this._checkLoaded();const f=Pt(this.stylesheet.sprite);if(f.find(d=>d.id===s)){if(this._spritesImagesIds[s])for(const d of this._spritesImagesIds[s])this.imageManager.removeImage(d),this._changedImages[d]=!0;f.splice(f.findIndex(d=>d.id===s),1),this.stylesheet.sprite=f.length>0?f:void 0,delete this._spritesImagesIds[s],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}else this.fire(new u.j(new Error(`Sprite "${s}" doesn't exists on this map.`)))}getSprite(){return Pt(this.stylesheet.sprite)}setSprite(s,f={},d){this._checkLoaded(),s&&this._validate(u.x.sprite,"sprite",s,null,f)||(this.stylesheet.sprite=s,s?this._loadSprite(s,!0,d):(this._unloadSprite(),d&&d(null)))}}var Hc=u.X([{name:"a_pos",type:"Int16",components:2}]),Ns="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 Hu={prelude:Fn(`#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:Fn(`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:Fn(`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:Fn(`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:Fn("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:Fn(`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:Fn(`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:Fn("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:Fn("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:Fn("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:Fn(`#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:Fn(`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:Fn(`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:Fn(`#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:Fn(`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:Fn(`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:Fn(`#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:Fn(`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:Fn(`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:Fn(`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:Fn(`#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:Fn(`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:Fn(`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:Fn(`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:Fn(`#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:Fn(`#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:Fn("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Ns),terrainDepth:Fn("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);}",Ns),terrainCoords:Fn("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);}",Ns)};function Fn(_,s){const f=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,d=s.match(/attribute ([\w]+) ([\w]+)/g),m=_.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),v=s.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),I=v?v.concat(m):m,T={};return{fragmentSource:_=_.replace(f,(M,k,z,B,Z)=>(T[Z]=!0,k==="define"?` +#ifndef HAS_UNIFORM_u_${Z} +varying ${z} ${B} ${Z}; +#else +uniform ${z} ${B} u_${Z}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${Z} + ${z} ${B} ${Z} = u_${Z}; +#endif +`)),vertexSource:s=s.replace(f,(M,k,z,B,Z)=>{const it=B==="float"?"vec2":"vec4",rt=Z.match(/color/)?"color":it;return T[Z]?k==="define"?` +#ifndef HAS_UNIFORM_u_${Z} +uniform lowp float u_${Z}_t; +attribute ${z} ${it} a_${Z}; +varying ${z} ${B} ${Z}; +#else +uniform ${z} ${B} u_${Z}; +#endif +`:rt==="vec4"?` +#ifndef HAS_UNIFORM_u_${Z} + ${Z} = a_${Z}; +#else + ${z} ${B} ${Z} = u_${Z}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Z} + ${Z} = unpack_mix_${rt}(a_${Z}, u_${Z}_t); +#else + ${z} ${B} ${Z} = u_${Z}; +#endif +`:k==="define"?` +#ifndef HAS_UNIFORM_u_${Z} +uniform lowp float u_${Z}_t; +attribute ${z} ${it} a_${Z}; +#else +uniform ${z} ${B} u_${Z}; +#endif +`:rt==="vec4"?` +#ifndef HAS_UNIFORM_u_${Z} + ${z} ${B} ${Z} = a_${Z}; +#else + ${z} ${B} ${Z} = u_${Z}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Z} + ${z} ${B} ${Z} = unpack_mix_${rt}(a_${Z}, u_${Z}_t); +#else + ${z} ${B} ${Z} = u_${Z}; +#endif +`}),staticAttributes:d,staticUniforms:I}}class Xc{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(s,f,d,m,v,I,T,M,k){this.context=s;let z=this.boundPaintVertexBuffers.length!==m.length;for(let B=0;!z&&B({u_depth:new u.aG(Ot,Bt.u_depth),u_terrain:new u.aG(Ot,Bt.u_terrain),u_terrain_dim:new u.aH(Ot,Bt.u_terrain_dim),u_terrain_matrix:new u.aI(Ot,Bt.u_terrain_matrix),u_terrain_unpack:new u.aJ(Ot,Bt.u_terrain_unpack),u_terrain_exaggeration:new u.aH(Ot,Bt.u_terrain_exaggeration)}))(s,Dt),this.binderUniforms=d?d.getUniforms(s,Dt):[]}draw(s,f,d,m,v,I,T,M,k,z,B,Z,it,rt,lt,tt,yt,kt){const ut=s.gl;if(this.failedToCreate)return;if(s.program.set(this.program),s.setDepthMode(d),s.setStencilMode(m),s.setColorMode(v),s.setCullFace(I),M){s.activeTexture.set(ut.TEXTURE2),ut.bindTexture(ut.TEXTURE_2D,M.depthTexture),s.activeTexture.set(ut.TEXTURE3),ut.bindTexture(ut.TEXTURE_2D,M.texture);for(const Dt in this.terrainUniforms)this.terrainUniforms[Dt].set(M[Dt])}for(const Dt in this.fixedUniforms)this.fixedUniforms[Dt].set(T[Dt]);lt&<.setUniforms(s,this.binderUniforms,it,{zoom:rt});let wt=0;switch(f){case ut.LINES:wt=2;break;case ut.TRIANGLES:wt=3;break;case ut.LINE_STRIP:wt=1}for(const Dt of Z.get()){const Ot=Dt.vaos||(Dt.vaos={});(Ot[k]||(Ot[k]=new Xc)).bind(s,this,z,lt?lt.getPaintVertexBuffers():[],B,Dt.vertexOffset,tt,yt,kt),ut.drawElements(f,Dt.primitiveLength*wt,ut.UNSIGNED_SHORT,Dt.primitiveOffset*wt*2)}}}function Yc(_,s,f){const d=1/je(f,1,s.transform.tileZoom),m=Math.pow(2,f.tileID.overscaledZ),v=f.tileSize*Math.pow(2,s.transform.tileZoom)/m,I=v*(f.tileID.canonical.x+f.tileID.wrap*m),T=v*f.tileID.canonical.y;return{u_image:0,u_texsize:f.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 Xu=(_,s,f,d)=>{const m=s.style.light,v=m.properties.get("position"),I=[v.x,v.y,v.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}();m.properties.get("anchor")==="viewport"&&function(k,z){var B=Math.sin(z),Z=Math.cos(z);k[0]=Z,k[1]=B,k[2]=0,k[3]=-B,k[4]=Z,k[5]=0,k[6]=0,k[7]=0,k[8]=1}(T,-s.transform.angle),function(k,z,B){var Z=z[0],it=z[1],rt=z[2];k[0]=Z*B[0]+it*B[3]+rt*B[6],k[1]=Z*B[1]+it*B[4]+rt*B[7],k[2]=Z*B[2]+it*B[5]+rt*B[8]}(I,I,T);const M=m.properties.get("color");return{u_matrix:_,u_lightpos:I,u_lightintensity:m.properties.get("intensity"),u_lightcolor:[M.r,M.g,M.b],u_vertical_gradient:+f,u_opacity:d}},wy=(_,s,f,d,m,v,I)=>u.e(Xu(_,s,f,d),Yc(v,s,I),{u_height_factor:-Math.pow(2,m.overscaledZ)/I.tileSize/8}),qd=_=>({u_matrix:_}),Kc=(_,s,f,d)=>u.e(qd(_),Yc(f,s,d)),Sy=(_,s)=>({u_matrix:_,u_world:s}),jd=(_,s,f,d,m)=>u.e(Kc(_,s,f,d),{u_world:m}),Ey=(_,s,f,d)=>{const m=_.transform;let v,I;if(d.paint.get("circle-pitch-alignment")==="map"){const T=je(f,1,m.zoom);v=!0,I=[T,T]}else v=!1,I=m.pixelsToGLUnits;return{u_camera_to_center_distance:m.cameraToCenterDistance,u_scale_with_map:+(d.paint.get("circle-pitch-scale")==="map"),u_matrix:_.translatePosMatrix(s.posMatrix,f,d.paint.get("circle-translate"),d.paint.get("circle-translate-anchor")),u_pitch_with_map:+v,u_device_pixel_ratio:_.pixelRatio,u_extrude_scale:I}},Wd=(_,s,f)=>{const d=je(f,1,s.zoom),m=Math.pow(2,s.zoom-f.tileID.overscaledZ),v=f.tileID.overscaleFactor();return{u_matrix:_,u_camera_to_center_distance:s.cameraToCenterDistance,u_pixels_to_tile_units:d,u_extrude_scale:[s.pixelsToGLUnits[0]/(d*m),s.pixelsToGLUnits[1]/(d*m)],u_overscale_factor:v}},Zd=(_,s,f=1)=>({u_matrix:_,u_color:s,u_overlay:0,u_overlay_scale:f}),Jc=_=>({u_matrix:_}),Hd=(_,s,f,d)=>({u_matrix:_,u_extrude_scale:je(s,1,f),u_intensity:d});function Xd(_,s){const f=Math.pow(2,s.canonical.z),d=s.canonical.y;return[new u.Y(0,d/f).toLngLat().lat,new u.Y(0,(d+1)/f).toLngLat().lat]}const Qc=(_,s,f,d)=>{const m=_.transform;return{u_matrix:Yu(_,s,f,d),u_ratio:1/je(s,1,m.zoom),u_device_pixel_ratio:_.pixelRatio,u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]]}},Yd=(_,s,f,d,m)=>u.e(Qc(_,s,f,m),{u_image:0,u_image_height:d}),_l=(_,s,f,d,m)=>{const v=_.transform,I=Mo(s,v);return{u_matrix:Yu(_,s,f,m),u_texsize:s.imageAtlasTexture.size,u_ratio:1/je(s,1,v.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/v.pixelsToGLUnits[0],1/v.pixelsToGLUnits[1]]}},$c=(_,s,f,d,m,v)=>{const I=_.lineAtlas,T=Mo(s,_.transform),M=f.layout.get("line-cap")==="round",k=I.getDash(d.from,M),z=I.getDash(d.to,M),B=k.width*m.fromScale,Z=z.width*m.toScale;return u.e(Qc(_,s,f,v),{u_patternscale_a:[T/B,-k.height/2],u_patternscale_b:[T/Z,-z.height/2],u_sdfgamma:I.width/(256*Math.min(B,Z)*_.pixelRatio)/2,u_image:0,u_tex_y_a:k.y,u_tex_y_b:z.y,u_mix:m.t})};function Mo(_,s){return 1/je(_,1,s.tileZoom)}function Yu(_,s,f,d){return _.translatePosMatrix(d?d.posMatrix:s.tileID.posMatrix,s,f.paint.get("line-translate"),f.paint.get("line-translate-anchor"))}const th=(_,s,f,d,m)=>{return{u_matrix:_,u_tl_parent:s,u_scale_parent:f,u_buffer_scale:1,u_fade_t:d.mix,u_opacity:d.opacity*m.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:m.paint.get("raster-brightness-min"),u_brightness_high:m.paint.get("raster-brightness-max"),u_saturation_factor:(I=m.paint.get("raster-saturation"),I>0?1-1/(1.001-I):-I),u_contrast_factor:(v=m.paint.get("raster-contrast"),v>0?1/(1-v):1+v),u_spin_weights:Ku(m.paint.get("raster-hue-rotate"))};var v,I};function Ku(_){_*=Math.PI/180;const s=Math.sin(_),f=Math.cos(_);return[(2*f+1)/3,(-Math.sqrt(3)*s-f+1)/3,(Math.sqrt(3)*s-f+1)/3]}const Ju=(_,s,f,d,m,v,I,T,M,k)=>{const z=m.transform;return{u_is_size_zoom_constant:+(_==="constant"||_==="source"),u_is_size_feature_constant:+(_==="constant"||_==="camera"),u_size_t:s?s.uSizeT:0,u_size:s?s.uSize:0,u_camera_to_center_distance:z.cameraToCenterDistance,u_pitch:z.pitch/360*2*Math.PI,u_rotate_symbol:+f,u_aspect_ratio:z.width/z.height,u_fade_change:m.options.fadeDuration?m.symbolFadeChange:1,u_matrix:v,u_label_plane_matrix:I,u_coord_matrix:T,u_is_text:+M,u_pitch_with_map:+d,u_texsize:k,u_texture:0}},Qu=(_,s,f,d,m,v,I,T,M,k,z)=>{const B=m.transform;return u.e(Ju(_,s,f,d,m,v,I,T,M,k),{u_gamma_scale:d?Math.cos(B._pitch)*B.cameraToCenterDistance:1,u_device_pixel_ratio:m.pixelRatio,u_is_halo:+z})},$u=(_,s,f,d,m,v,I,T,M,k)=>u.e(Qu(_,s,f,d,m,v,I,T,!0,M,!0),{u_texsize_icon:k,u_texture_icon:1}),Iy=(_,s,f)=>({u_matrix:_,u_opacity:s,u_color:f}),Cy=(_,s,f,d,m,v)=>u.e(function(I,T,M,k){const z=M.imageManager.getPattern(I.from.toString()),B=M.imageManager.getPattern(I.to.toString()),{width:Z,height:it}=M.imageManager.getPixelSize(),rt=Math.pow(2,k.tileID.overscaledZ),lt=k.tileSize*Math.pow(2,M.transform.tileZoom)/rt,tt=lt*(k.tileID.canonical.x+k.tileID.wrap*rt),yt=lt*k.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:z.tl,u_pattern_br_a:z.br,u_pattern_tl_b:B.tl,u_pattern_br_b:B.br,u_texsize:[Z,it],u_mix:T.t,u_pattern_size_a:z.displaySize,u_pattern_size_b:B.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,yt>>16],u_pixel_coord_lower:[65535&tt,65535&yt]}}(d,v,f,m),{u_matrix:_,u_opacity:s}),Kd={fillExtrusion:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_lightpos:new u.aK(_,s.u_lightpos),u_lightintensity:new u.aH(_,s.u_lightintensity),u_lightcolor:new u.aK(_,s.u_lightcolor),u_vertical_gradient:new u.aH(_,s.u_vertical_gradient),u_opacity:new u.aH(_,s.u_opacity)}),fillExtrusionPattern:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_lightpos:new u.aK(_,s.u_lightpos),u_lightintensity:new u.aH(_,s.u_lightintensity),u_lightcolor:new u.aK(_,s.u_lightcolor),u_vertical_gradient:new u.aH(_,s.u_vertical_gradient),u_height_factor:new u.aH(_,s.u_height_factor),u_image:new u.aG(_,s.u_image),u_texsize:new u.aL(_,s.u_texsize),u_pixel_coord_upper:new u.aL(_,s.u_pixel_coord_upper),u_pixel_coord_lower:new u.aL(_,s.u_pixel_coord_lower),u_scale:new u.aK(_,s.u_scale),u_fade:new u.aH(_,s.u_fade),u_opacity:new u.aH(_,s.u_opacity)}),fill:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix)}),fillPattern:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_image:new u.aG(_,s.u_image),u_texsize:new u.aL(_,s.u_texsize),u_pixel_coord_upper:new u.aL(_,s.u_pixel_coord_upper),u_pixel_coord_lower:new u.aL(_,s.u_pixel_coord_lower),u_scale:new u.aK(_,s.u_scale),u_fade:new u.aH(_,s.u_fade)}),fillOutline:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_world:new u.aL(_,s.u_world)}),fillOutlinePattern:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_world:new u.aL(_,s.u_world),u_image:new u.aG(_,s.u_image),u_texsize:new u.aL(_,s.u_texsize),u_pixel_coord_upper:new u.aL(_,s.u_pixel_coord_upper),u_pixel_coord_lower:new u.aL(_,s.u_pixel_coord_lower),u_scale:new u.aK(_,s.u_scale),u_fade:new u.aH(_,s.u_fade)}),circle:(_,s)=>({u_camera_to_center_distance:new u.aH(_,s.u_camera_to_center_distance),u_scale_with_map:new u.aG(_,s.u_scale_with_map),u_pitch_with_map:new u.aG(_,s.u_pitch_with_map),u_extrude_scale:new u.aL(_,s.u_extrude_scale),u_device_pixel_ratio:new u.aH(_,s.u_device_pixel_ratio),u_matrix:new u.aI(_,s.u_matrix)}),collisionBox:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_camera_to_center_distance:new u.aH(_,s.u_camera_to_center_distance),u_pixels_to_tile_units:new u.aH(_,s.u_pixels_to_tile_units),u_extrude_scale:new u.aL(_,s.u_extrude_scale),u_overscale_factor:new u.aH(_,s.u_overscale_factor)}),collisionCircle:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_inv_matrix:new u.aI(_,s.u_inv_matrix),u_camera_to_center_distance:new u.aH(_,s.u_camera_to_center_distance),u_viewport_size:new u.aL(_,s.u_viewport_size)}),debug:(_,s)=>({u_color:new u.aM(_,s.u_color),u_matrix:new u.aI(_,s.u_matrix),u_overlay:new u.aG(_,s.u_overlay),u_overlay_scale:new u.aH(_,s.u_overlay_scale)}),clippingMask:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix)}),heatmap:(_,s)=>({u_extrude_scale:new u.aH(_,s.u_extrude_scale),u_intensity:new u.aH(_,s.u_intensity),u_matrix:new u.aI(_,s.u_matrix)}),heatmapTexture:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_world:new u.aL(_,s.u_world),u_image:new u.aG(_,s.u_image),u_color_ramp:new u.aG(_,s.u_color_ramp),u_opacity:new u.aH(_,s.u_opacity)}),hillshade:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_image:new u.aG(_,s.u_image),u_latrange:new u.aL(_,s.u_latrange),u_light:new u.aL(_,s.u_light),u_shadow:new u.aM(_,s.u_shadow),u_highlight:new u.aM(_,s.u_highlight),u_accent:new u.aM(_,s.u_accent)}),hillshadePrepare:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_image:new u.aG(_,s.u_image),u_dimension:new u.aL(_,s.u_dimension),u_zoom:new u.aH(_,s.u_zoom),u_unpack:new u.aJ(_,s.u_unpack)}),line:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_ratio:new u.aH(_,s.u_ratio),u_device_pixel_ratio:new u.aH(_,s.u_device_pixel_ratio),u_units_to_pixels:new u.aL(_,s.u_units_to_pixels)}),lineGradient:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_ratio:new u.aH(_,s.u_ratio),u_device_pixel_ratio:new u.aH(_,s.u_device_pixel_ratio),u_units_to_pixels:new u.aL(_,s.u_units_to_pixels),u_image:new u.aG(_,s.u_image),u_image_height:new u.aH(_,s.u_image_height)}),linePattern:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_texsize:new u.aL(_,s.u_texsize),u_ratio:new u.aH(_,s.u_ratio),u_device_pixel_ratio:new u.aH(_,s.u_device_pixel_ratio),u_image:new u.aG(_,s.u_image),u_units_to_pixels:new u.aL(_,s.u_units_to_pixels),u_scale:new u.aK(_,s.u_scale),u_fade:new u.aH(_,s.u_fade)}),lineSDF:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_ratio:new u.aH(_,s.u_ratio),u_device_pixel_ratio:new u.aH(_,s.u_device_pixel_ratio),u_units_to_pixels:new u.aL(_,s.u_units_to_pixels),u_patternscale_a:new u.aL(_,s.u_patternscale_a),u_patternscale_b:new u.aL(_,s.u_patternscale_b),u_sdfgamma:new u.aH(_,s.u_sdfgamma),u_image:new u.aG(_,s.u_image),u_tex_y_a:new u.aH(_,s.u_tex_y_a),u_tex_y_b:new u.aH(_,s.u_tex_y_b),u_mix:new u.aH(_,s.u_mix)}),raster:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_tl_parent:new u.aL(_,s.u_tl_parent),u_scale_parent:new u.aH(_,s.u_scale_parent),u_buffer_scale:new u.aH(_,s.u_buffer_scale),u_fade_t:new u.aH(_,s.u_fade_t),u_opacity:new u.aH(_,s.u_opacity),u_image0:new u.aG(_,s.u_image0),u_image1:new u.aG(_,s.u_image1),u_brightness_low:new u.aH(_,s.u_brightness_low),u_brightness_high:new u.aH(_,s.u_brightness_high),u_saturation_factor:new u.aH(_,s.u_saturation_factor),u_contrast_factor:new u.aH(_,s.u_contrast_factor),u_spin_weights:new u.aK(_,s.u_spin_weights)}),symbolIcon:(_,s)=>({u_is_size_zoom_constant:new u.aG(_,s.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aG(_,s.u_is_size_feature_constant),u_size_t:new u.aH(_,s.u_size_t),u_size:new u.aH(_,s.u_size),u_camera_to_center_distance:new u.aH(_,s.u_camera_to_center_distance),u_pitch:new u.aH(_,s.u_pitch),u_rotate_symbol:new u.aG(_,s.u_rotate_symbol),u_aspect_ratio:new u.aH(_,s.u_aspect_ratio),u_fade_change:new u.aH(_,s.u_fade_change),u_matrix:new u.aI(_,s.u_matrix),u_label_plane_matrix:new u.aI(_,s.u_label_plane_matrix),u_coord_matrix:new u.aI(_,s.u_coord_matrix),u_is_text:new u.aG(_,s.u_is_text),u_pitch_with_map:new u.aG(_,s.u_pitch_with_map),u_texsize:new u.aL(_,s.u_texsize),u_texture:new u.aG(_,s.u_texture)}),symbolSDF:(_,s)=>({u_is_size_zoom_constant:new u.aG(_,s.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aG(_,s.u_is_size_feature_constant),u_size_t:new u.aH(_,s.u_size_t),u_size:new u.aH(_,s.u_size),u_camera_to_center_distance:new u.aH(_,s.u_camera_to_center_distance),u_pitch:new u.aH(_,s.u_pitch),u_rotate_symbol:new u.aG(_,s.u_rotate_symbol),u_aspect_ratio:new u.aH(_,s.u_aspect_ratio),u_fade_change:new u.aH(_,s.u_fade_change),u_matrix:new u.aI(_,s.u_matrix),u_label_plane_matrix:new u.aI(_,s.u_label_plane_matrix),u_coord_matrix:new u.aI(_,s.u_coord_matrix),u_is_text:new u.aG(_,s.u_is_text),u_pitch_with_map:new u.aG(_,s.u_pitch_with_map),u_texsize:new u.aL(_,s.u_texsize),u_texture:new u.aG(_,s.u_texture),u_gamma_scale:new u.aH(_,s.u_gamma_scale),u_device_pixel_ratio:new u.aH(_,s.u_device_pixel_ratio),u_is_halo:new u.aG(_,s.u_is_halo)}),symbolTextAndIcon:(_,s)=>({u_is_size_zoom_constant:new u.aG(_,s.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aG(_,s.u_is_size_feature_constant),u_size_t:new u.aH(_,s.u_size_t),u_size:new u.aH(_,s.u_size),u_camera_to_center_distance:new u.aH(_,s.u_camera_to_center_distance),u_pitch:new u.aH(_,s.u_pitch),u_rotate_symbol:new u.aG(_,s.u_rotate_symbol),u_aspect_ratio:new u.aH(_,s.u_aspect_ratio),u_fade_change:new u.aH(_,s.u_fade_change),u_matrix:new u.aI(_,s.u_matrix),u_label_plane_matrix:new u.aI(_,s.u_label_plane_matrix),u_coord_matrix:new u.aI(_,s.u_coord_matrix),u_is_text:new u.aG(_,s.u_is_text),u_pitch_with_map:new u.aG(_,s.u_pitch_with_map),u_texsize:new u.aL(_,s.u_texsize),u_texsize_icon:new u.aL(_,s.u_texsize_icon),u_texture:new u.aG(_,s.u_texture),u_texture_icon:new u.aG(_,s.u_texture_icon),u_gamma_scale:new u.aH(_,s.u_gamma_scale),u_device_pixel_ratio:new u.aH(_,s.u_device_pixel_ratio),u_is_halo:new u.aG(_,s.u_is_halo)}),background:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_opacity:new u.aH(_,s.u_opacity),u_color:new u.aM(_,s.u_color)}),backgroundPattern:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_opacity:new u.aH(_,s.u_opacity),u_image:new u.aG(_,s.u_image),u_pattern_tl_a:new u.aL(_,s.u_pattern_tl_a),u_pattern_br_a:new u.aL(_,s.u_pattern_br_a),u_pattern_tl_b:new u.aL(_,s.u_pattern_tl_b),u_pattern_br_b:new u.aL(_,s.u_pattern_br_b),u_texsize:new u.aL(_,s.u_texsize),u_mix:new u.aH(_,s.u_mix),u_pattern_size_a:new u.aL(_,s.u_pattern_size_a),u_pattern_size_b:new u.aL(_,s.u_pattern_size_b),u_scale_a:new u.aH(_,s.u_scale_a),u_scale_b:new u.aH(_,s.u_scale_b),u_pixel_coord_upper:new u.aL(_,s.u_pixel_coord_upper),u_pixel_coord_lower:new u.aL(_,s.u_pixel_coord_lower),u_tile_units_to_pixels:new u.aH(_,s.u_tile_units_to_pixels)}),terrain:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_texture:new u.aG(_,s.u_texture),u_ele_delta:new u.aH(_,s.u_ele_delta)}),terrainDepth:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_ele_delta:new u.aH(_,s.u_ele_delta)}),terrainCoords:(_,s)=>({u_matrix:new u.aI(_,s.u_matrix),u_texture:new u.aG(_,s.u_texture),u_terrain_coords_id:new u.aH(_,s.u_terrain_coords_id),u_ele_delta:new u.aH(_,s.u_ele_delta)})};class Ty{constructor(s,f,d){this.context=s;const m=s.gl;this.buffer=m.createBuffer(),this.dynamicDraw=!!d,this.context.unbindVAO(),s.bindElementBuffer.set(this.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?m.DYNAMIC_DRAW:m.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(s){const f=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),f.bufferSubData(f.ELEMENT_ARRAY_BUFFER,0,s.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const vl={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class eh{constructor(s,f,d,m){this.length=f.length,this.attributes=d,this.itemSize=f.bytesPerElement,this.dynamicDraw=m,this.context=s;const v=s.gl;this.buffer=v.createBuffer(),s.bindVertexBuffer.set(this.buffer),v.bufferData(v.ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?v.DYNAMIC_DRAW:v.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(s){if(s.length!==this.length)throw new Error(`Length of new data is ${s.length}, which doesn't match current length of ${this.length}`);const f=this.context.gl;this.bind(),f.bufferSubData(f.ARRAY_BUFFER,0,s.arrayBuffer)}enableAttributes(s,f){for(let d=0;d0){const ie=u.F(),ae=Bt;u.aP(ie,Ot.placementInvProjMatrix,_.transform.glCoordMatrix),u.aP(ie,ie,Ot.placementViewportMatrix),z.push({circleArray:Jt,circleOffset:Z,transform:ae,invTransform:ie,coord:wt}),B+=Jt.length/4,Z=B}Qt&&k.draw(T,M.LINES,vn.disabled,Kn.disabled,_.colorModeForRenderPass(),Zn.disabled,Wd(Bt,_.transform,Dt),_.style.map.terrain&&_.style.map.terrain.getTerrainData(wt),f.id,Qt.layoutVertexBuffer,Qt.indexBuffer,Qt.segments,null,_.transform.zoom,null,null,Qt.collisionVertexBuffer)}if(!I||!z.length)return;const it=_.useProgram("collisionCircle"),rt=new u.aQ;rt.resize(4*B),rt._trim();let lt=0;for(const ut of z)for(let wt=0;wt=0&&(rt[tt.associatedIconIndex]={shiftedAnchor:Je,angle:le})}else Ht(tt.numGlyphs,Z)}if(k){it.clear();const lt=_.icon.placedSymbolArray;for(let tt=0;tt_.style.map.terrain.getElevation(Qt,Jo,Yr):null,dr=f.layout.get("text-rotation-alignment")==="map";j(ie,Qt.posMatrix,_,m,ko,Bs,tt,k,dr,Xr)}const qa=_.translatePosMatrix(Qt.posMatrix,Jt,v,I),Vs=yt||m&&Ot||pc?Qf:ko,Hr=_.translatePosMatrix(Bs,Jt,v,I,!0),pr=le&&f.paint.get(m?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let rr;rr=le?ie.iconsInText?$u(Oe.kind,Ue,kt,tt,_,qa,Vs,Hr,an,$r):Qu(Oe.kind,Ue,kt,tt,_,qa,Vs,Hr,m,an,!0):Ju(Oe.kind,Ue,kt,tt,_,qa,Vs,Hr,m,an);const Ko={program:bn,buffers:ae,uniformValues:rr,atlasTexture:Sr,atlasTextureIcon:fr,atlasInterpolation:Bn,atlasInterpolationIcon:Ao,isSDF:le,hasHalo:pr};if(ut&&ie.canOverlap){wt=!0;const Xr=ae.segments.get();for(const dr of Xr)Bt.push({segments:new u.$([dr]),sortKey:dr.sortKey,state:Ko,terrainData:rn})}else Bt.push({segments:ae.segments,sortKey:0,state:Ko,terrainData:rn})}wt&&Bt.sort((Qt,Jt)=>Qt.sortKey-Jt.sortKey);for(const Qt of Bt){const Jt=Qt.state;if(Z.activeTexture.set(it.TEXTURE0),Jt.atlasTexture.bind(Jt.atlasInterpolation,it.CLAMP_TO_EDGE),Jt.atlasTextureIcon&&(Z.activeTexture.set(it.TEXTURE1),Jt.atlasTextureIcon&&Jt.atlasTextureIcon.bind(Jt.atlasInterpolationIcon,it.CLAMP_TO_EDGE)),Jt.isSDF){const ie=Jt.uniformValues;Jt.hasHalo&&(ie.u_is_halo=1,om(Jt.buffers,Qt.segments,f,_,Jt.program,Dt,z,B,ie,Qt.terrainData)),ie.u_is_halo=0}om(Jt.buffers,Qt.segments,f,_,Jt.program,Dt,z,B,Jt.uniformValues,Qt.terrainData)}}function om(_,s,f,d,m,v,I,T,M,k){const z=d.context;m.draw(z,z.gl.TRIANGLES,v,I,T,Zn.disabled,M,k,f.id,_.layoutVertexBuffer,_.indexBuffer,s,f.paint,d.transform.zoom,_.programConfigurations.get(f.id),_.dynamicLayoutVertexBuffer,_.opacityVertexBuffer)}function fh(_,s,f,d,m){if(!f||!d||!d.imageAtlas)return;const v=d.imageAtlas.patternPositions;let I=v[f.to.toString()],T=v[f.from.toString()];if(!I&&T&&(I=T),!T&&I&&(T=I),!I||!T){const M=m.getPaintProperty(s);I=v[M],T=v[M]}I&&T&&_.setConstantPatternPositions(I,T)}function sm(_,s,f,d,m,v,I){const T=_.context.gl,M="fill-pattern",k=f.paint.get(M),z=k&&k.constantOr(1),B=f.getCrossfadeParameters();let Z,it,rt,lt,tt;I?(it=z&&!f.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Z=T.LINES):(it=z?"fillPattern":"fill",Z=T.TRIANGLES);const yt=k.constantOr(null);for(const kt of d){const ut=s.getTile(kt);if(z&&!ut.patternsLoaded())continue;const wt=ut.getBucket(f);if(!wt)continue;const Dt=wt.programConfigurations.get(f.id),Ot=_.useProgram(it,Dt),Bt=_.style.map.terrain&&_.style.map.terrain.getTerrainData(kt);z&&(_.context.activeTexture.set(T.TEXTURE0),ut.imageAtlasTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),Dt.updatePaintBuffers(B)),fh(Dt,M,yt,ut,f);const Qt=Bt?kt:null,Jt=_.translatePosMatrix(Qt?Qt.posMatrix:kt.posMatrix,ut,f.paint.get("fill-translate"),f.paint.get("fill-translate-anchor"));if(I){lt=wt.indexBuffer2,tt=wt.segments2;const ie=[T.drawingBufferWidth,T.drawingBufferHeight];rt=it==="fillOutlinePattern"&&z?jd(Jt,_,B,ut,ie):Sy(Jt,ie)}else lt=wt.indexBuffer,tt=wt.segments,rt=z?Kc(Jt,_,B,ut):qd(Jt);Ot.draw(_.context,Z,m,_.stencilModeForClipping(kt),v,Zn.disabled,rt,Bt,f.id,wt.layoutVertexBuffer,lt,tt,f.paint,_.transform.zoom,Dt)}}function ph(_,s,f,d,m,v,I){const T=_.context,M=T.gl,k="fill-extrusion-pattern",z=f.paint.get(k),B=z.constantOr(1),Z=f.getCrossfadeParameters(),it=f.paint.get("fill-extrusion-opacity"),rt=z.constantOr(null);for(const lt of d){const tt=s.getTile(lt),yt=tt.getBucket(f);if(!yt)continue;const kt=_.style.map.terrain&&_.style.map.terrain.getTerrainData(lt),ut=yt.programConfigurations.get(f.id),wt=_.useProgram(B?"fillExtrusionPattern":"fillExtrusion",ut);B&&(_.context.activeTexture.set(M.TEXTURE0),tt.imageAtlasTexture.bind(M.LINEAR,M.CLAMP_TO_EDGE),ut.updatePaintBuffers(Z)),fh(ut,k,rt,tt,f);const Dt=_.translatePosMatrix(lt.posMatrix,tt,f.paint.get("fill-extrusion-translate"),f.paint.get("fill-extrusion-translate-anchor")),Ot=f.paint.get("fill-extrusion-vertical-gradient"),Bt=B?wy(Dt,_,Ot,it,lt,Z,tt):Xu(Dt,_,Ot,it);wt.draw(T,T.gl.TRIANGLES,m,v,I,Zn.backCCW,Bt,kt,f.id,yt.layoutVertexBuffer,yt.indexBuffer,yt.segments,f.paint,_.transform.zoom,ut,_.style.map.terrain&&yt.centroidVertexBuffer)}}function dh(_,s,f,d,m,v,I){const T=_.context,M=T.gl,k=f.fbo;if(!k)return;const z=_.useProgram("hillshade"),B=_.style.map.terrain&&_.style.map.terrain.getTerrainData(s);T.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,k.colorAttachment.get()),z.draw(T,M.TRIANGLES,m,v,I,Zn.disabled,((Z,it,rt,lt)=>{const tt=rt.paint.get("hillshade-shadow-color"),yt=rt.paint.get("hillshade-highlight-color"),kt=rt.paint.get("hillshade-accent-color");let ut=rt.paint.get("hillshade-illumination-direction")*(Math.PI/180);rt.paint.get("hillshade-illumination-anchor")==="viewport"&&(ut-=Z.transform.angle);const wt=!Z.options.moving;return{u_matrix:lt?lt.posMatrix:Z.transform.calculatePosMatrix(it.tileID.toUnwrapped(),wt),u_image:0,u_latrange:Xd(0,it.tileID),u_light:[rt.paint.get("hillshade-exaggeration"),ut],u_shadow:tt,u_highlight:yt,u_accent:kt}})(_,f,d,B?s:null),B,d.id,_.rasterBoundsBuffer,_.quadTriangleIndexBuffer,_.rasterBoundsSegments)}function $f(_,s,f,d,m,v){const I=_.context,T=I.gl,M=s.dem;if(M&&M.data){const k=M.dim,z=M.stride,B=M.getPixels();if(I.activeTexture.set(T.TEXTURE1),I.pixelStoreUnpackPremultiplyAlpha.set(!1),s.demTexture=s.demTexture||_.getTileTexture(z),s.demTexture){const it=s.demTexture;it.update(B,{premultiply:!1}),it.bind(T.NEAREST,T.CLAMP_TO_EDGE)}else s.demTexture=new $(I,B,T.RGBA,{premultiply:!1}),s.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE);I.activeTexture.set(T.TEXTURE0);let Z=s.fbo;if(!Z){const it=new $(I,{width:k,height:k,data:null},T.RGBA);it.bind(T.LINEAR,T.CLAMP_TO_EDGE),Z=s.fbo=I.createFramebuffer(k,k,!0,!1),Z.colorAttachment.set(it.texture)}I.bindFramebuffer.set(Z.framebuffer),I.viewport.set([0,0,k,k]),_.useProgram("hillshadePrepare").draw(I,T.TRIANGLES,d,m,v,Zn.disabled,((it,rt)=>{const lt=rt.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:[lt,lt],u_zoom:it.overscaledZ,u_unpack:rt.getUnpackVector()}})(s.tileID,M),null,f.id,_.rasterBoundsBuffer,_.quadTriangleIndexBuffer,_.rasterBoundsSegments),s.needsHillshadePrepare=!1}}function am(_,s,f,d,m,v){const I=d.paint.get("raster-fade-duration");if(!v&&I>0){const T=C.now(),M=(T-_.timeAdded)/I,k=s?(T-s.timeAdded)/I:-1,z=f.getSource(),B=m.coveringZoomLevel({tileSize:z.tileSize,roundZoom:z.roundZoom}),Z=!s||Math.abs(s.tileID.overscaledZ-B)>Math.abs(_.tileID.overscaledZ-B),it=Z&&_.refreshedUponExpiration?1:u.ac(Z?M:1-k,0,1);return _.refreshedUponExpiration&&M>=1&&(_.refreshedUponExpiration=!1),s?{opacity:1,mix:1-it}:{opacity:it,mix:0}}return{opacity:1,mix:0}}const lm=new u.aO(1,0,0,1),mh=new u.aO(0,1,0,1),tp=new u.aO(0,0,1,1),Oy=new u.aO(1,0,1,1),um=new u.aO(0,1,1,1);function xr(_,s,f,d){Ki(_,0,s+f/2,_.transform.width,f,d)}function Fa(_,s,f,d){Ki(_,s-f/2,0,f,_.transform.height,d)}function Ki(_,s,f,d,m,v){const I=_.context,T=I.gl;T.enable(T.SCISSOR_TEST),T.scissor(s*_.pixelRatio,f*_.pixelRatio,d*_.pixelRatio,m*_.pixelRatio),I.clear({color:v}),T.disable(T.SCISSOR_TEST)}function ep(_,s,f){const d=_.context,m=d.gl,v=f.posMatrix,I=_.useProgram("debug"),T=vn.disabled,M=Kn.disabled,k=_.colorModeForRenderPass(),z="$debug",B=_.style.map.terrain&&_.style.map.terrain.getTerrainData(f);d.activeTexture.set(m.TEXTURE0);const Z=s.getTileByID(f.key).latestRawTileData,it=Math.floor((Z&&Z.byteLength||0)/1024),rt=s.getTile(f).tileSize,lt=512/Math.min(rt,512)*(f.overscaledZ/_.transform.zoom)*.5;let tt=f.canonical.toString();f.overscaledZ!==f.canonical.z&&(tt+=` => ${f.overscaledZ}`),function(yt,kt){yt.initDebugOverlayCanvas();const ut=yt.debugOverlayCanvas,wt=yt.context.gl,Dt=yt.debugOverlayCanvas.getContext("2d");Dt.clearRect(0,0,ut.width,ut.height),Dt.shadowColor="white",Dt.shadowBlur=2,Dt.lineWidth=1.5,Dt.strokeStyle="white",Dt.textBaseline="top",Dt.font="bold 36px Open Sans, sans-serif",Dt.fillText(kt,5,5),Dt.strokeText(kt,5,5),yt.debugOverlayTexture.update(ut),yt.debugOverlayTexture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE)}(_,`${tt} ${it}kB`),I.draw(d,m.TRIANGLES,T,M,Or.alphaBlended,Zn.disabled,Zd(v,u.aO.transparent,lt),null,z,_.debugBuffer,_.quadTriangleIndexBuffer,_.debugSegments),I.draw(d,m.LINE_STRIP,T,M,k,Zn.disabled,Zd(v,u.aO.red),B,z,_.debugBuffer,_.tileBorderIndexBuffer,_.debugSegments)}function gh(_,s,f){const d=_.context,m=d.gl,v=_.colorModeForRenderPass(),I=new vn(m.LEQUAL,vn.ReadWrite,_.depthRangeFor3D),T=_.useProgram("terrain"),M=s.getTerrainMesh();d.bindFramebuffer.set(null),d.viewport.set([0,0,_.width,_.height]);for(const k of f){const z=_.renderToTexture.getTexture(k),B=s.getTerrainData(k.tileID);d.activeTexture.set(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,z.texture);const Z={u_matrix:_.transform.calculatePosMatrix(k.tileID.toUnwrapped()),u_texture:0,u_ele_delta:s.getMeshFrameDelta(_.transform.zoom)};T.draw(d,m.TRIANGLES,I,Kn.disabled,v,Zn.backCCW,Z,B,"terrain",M.vertexBuffer,M.indexBuffer,M.segments)}}class cm{constructor(s,f){this.context=new Ny(s),this.transform=f,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:u.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=jr.maxUnderzooming+jr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Oa}resize(s,f,d){if(this.width=Math.floor(s*d),this.height=Math.floor(f*d),this.pixelRatio=d,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const m of this.style._order)this.style._layers[m].resize()}setup(){const s=this.context,f=new u.aV;f.emplaceBack(0,0),f.emplaceBack(u.W,0),f.emplaceBack(0,u.W),f.emplaceBack(u.W,u.W),this.tileExtentBuffer=s.createVertexBuffer(f,Hc.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=s.createVertexBuffer(d,Hc.members),this.debugSegments=u.$.simpleSegment(0,0,4,5);const m=new u.Z;m.emplaceBack(0,0,0,0),m.emplaceBack(u.W,0,u.W,0),m.emplaceBack(0,u.W,0,u.W),m.emplaceBack(u.W,u.W,u.W,u.W),this.rasterBoundsBuffer=s.createVertexBuffer(m,on.members),this.rasterBoundsSegments=u.$.simpleSegment(0,0,4,2);const v=new u.aV;v.emplaceBack(0,0),v.emplaceBack(1,0),v.emplaceBack(0,1),v.emplaceBack(1,1),this.viewportBuffer=s.createVertexBuffer(v,Hc.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=s.createIndexBuffer(I);const T=new u.aX;T.emplaceBack(0,1,2),T.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=s.createIndexBuffer(T);const M=this.context.gl;this.stencilClearMode=new Kn({func:M.ALWAYS,mask:0},0,255,M.ZERO,M.ZERO,M.ZERO)}clearStencil(){const s=this.context,f=s.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,[f.drawingBufferWidth,f.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(s,f.TRIANGLES,vn.disabled,this.stencilClearMode,Or.disabled,Zn.disabled,Jc(d),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(s,f){if(this.currentStencilSource===s.source||!s.isTileClipped()||!f||!f.length)return;this.currentStencilSource=s.source;const d=this.context,m=d.gl;this.nextStencilID+f.length>256&&this.clearStencil(),d.setColorMode(Or.disabled),d.setDepthMode(vn.disabled);const v=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const I of f){const T=this._tileClippingMaskIDs[I.key]=this.nextStencilID++,M=this.style.map.terrain&&this.style.map.terrain.getTerrainData(I);v.draw(d,m.TRIANGLES,vn.disabled,new Kn({func:m.ALWAYS,mask:0},T,255,m.KEEP,m.KEEP,m.REPLACE),Or.disabled,Zn.disabled,Jc(I.posMatrix),M,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const s=this.nextStencilID++,f=this.context.gl;return new Kn({func:f.NOTEQUAL,mask:255},s,255,f.KEEP,f.KEEP,f.REPLACE)}stencilModeForClipping(s){const f=this.context.gl;return new Kn({func:f.EQUAL,mask:255},this._tileClippingMaskIDs[s.key],0,f.KEEP,f.KEEP,f.REPLACE)}stencilConfigForOverlap(s){const f=this.context.gl,d=s.sort((I,T)=>T.overscaledZ-I.overscaledZ),m=d[d.length-1].overscaledZ,v=d[0].overscaledZ-m+1;if(v>1){this.currentStencilSource=void 0,this.nextStencilID+v>256&&this.clearStencil();const I={};for(let T=0;T=0;this.currentLayer--){const M=this.style._layers[d[this.currentLayer]],k=m[M.source],z=v[M.source];this._renderTileClippingMasks(M,z),this.renderLayer(this,k,M,z)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayertt.source&&!tt.isHidden(z)?[k.sourceCaches[tt.source]]:[]),it=Z.filter(tt=>tt.getSource().type==="vector"),rt=Z.filter(tt=>tt.getSource().type!=="vector"),lt=tt=>{(!B||B.getSource().maxzoomlt(tt)),B||rt.forEach(tt=>lt(tt)),B}(this.style,this.transform.zoom);M&&function(k,z,B){for(let Z=0;Z0),m&&(u.a_(f,d),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(v,I){const T=v.context,M=T.gl,k=Or.unblended,z=new vn(M.LEQUAL,vn.ReadWrite,[0,1]),B=I.getTerrainMesh(),Z=I.sourceCache.getRenderableTiles(),it=v.useProgram("terrainDepth");T.bindFramebuffer.set(I.getFramebuffer("depth").framebuffer),T.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),T.clear({color:u.aO.transparent,depth:1});for(const rt of Z){const lt=I.getTerrainData(rt.tileID),tt={u_matrix:v.transform.calculatePosMatrix(rt.tileID.toUnwrapped()),u_ele_delta:I.getMeshFrameDelta(v.transform.zoom)};it.draw(T,M.TRIANGLES,z,Kn.disabled,k,Zn.backCCW,tt,lt,"terrain",B.vertexBuffer,B.indexBuffer,B.segments)}T.bindFramebuffer.set(null),T.viewport.set([0,0,v.width,v.height])}(this,this.style.map.terrain),function(v,I){const T=v.context,M=T.gl,k=Or.unblended,z=new vn(M.LEQUAL,vn.ReadWrite,[0,1]),B=I.getTerrainMesh(),Z=I.getCoordsTexture(),it=I.sourceCache.getRenderableTiles(),rt=v.useProgram("terrainCoords");T.bindFramebuffer.set(I.getFramebuffer("coords").framebuffer),T.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),T.clear({color:u.aO.transparent,depth:1}),I.coordsIndex=[];for(const lt of it){const tt=I.getTerrainData(lt.tileID);T.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,Z.texture);const yt={u_matrix:v.transform.calculatePosMatrix(lt.tileID.toUnwrapped()),u_terrain_coords_id:(255-I.coordsIndex.length)/255,u_texture:0,u_ele_delta:I.getMeshFrameDelta(v.transform.zoom)};rt.draw(T,M.TRIANGLES,z,Kn.disabled,k,Zn.backCCW,yt,tt,"terrain",B.vertexBuffer,B.indexBuffer,B.segments),I.coordsIndex.push(lt.tileID.key)}T.bindFramebuffer.set(null),T.viewport.set([0,0,v.width,v.height])}(this,this.style.map.terrain))}renderLayer(s,f,d,m){if(!d.isHidden(this.transform.zoom)&&(d.type==="background"||d.type==="custom"||(m||[]).length))switch(this.id=d.id,d.type){case"symbol":(function(v,I,T,M,k){if(v.renderPass!=="translucent")return;const z=Kn.disabled,B=v.colorModeForRenderPass();(T._unevaluatedLayout.hasValue("text-variable-anchor")||T._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(Z,it,rt,lt,tt,yt,kt){const ut=it.transform,wt=tt==="map",Dt=yt==="map";for(const Ot of Z){const Bt=lt.getTile(Ot),Qt=Bt.getBucket(rt);if(!Qt||!Qt.text||!Qt.text.segments.get().length)continue;const Jt=u.ag(Qt.textSizeData,ut.zoom),ie=je(Bt,1,it.transform.zoom),ae=He(Ot.posMatrix,Dt,wt,it.transform,ie),Je=rt.layout.get("icon-text-fit")!=="none"&&Qt.hasIconData();if(Jt){const le=Math.pow(2,ut.zoom-Bt.tileID.overscaledZ);uh(Qt,wt,Dt,kt,ut,ae,Ot.posMatrix,le,Jt,Je,it.style.map.terrain?(Oe,Qe)=>it.style.map.terrain.getElevation(Ot,Oe,Qe):null)}}}(M,v,T,I,T.layout.get("text-rotation-alignment"),T.layout.get("text-pitch-alignment"),k),T.paint.get("icon-opacity").constantOr(1)!==0&&hh(v,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"),z,B),T.paint.get("text-opacity").constantOr(1)!==0&&hh(v,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"),z,B),I.map.showCollisionBoxes&&(lh(v,I,T,M,T.paint.get("text-translate"),T.paint.get("text-translate-anchor"),!0),lh(v,I,T,M,T.paint.get("icon-translate"),T.paint.get("icon-translate-anchor"),!1))})(s,f,d,m,this.style.placement.variableOffsets);break;case"circle":(function(v,I,T,M){if(v.renderPass!=="translucent")return;const k=T.paint.get("circle-opacity"),z=T.paint.get("circle-stroke-width"),B=T.paint.get("circle-stroke-opacity"),Z=!T.layout.get("circle-sort-key").isConstant();if(k.constantOr(1)===0&&(z.constantOr(1)===0||B.constantOr(1)===0))return;const it=v.context,rt=it.gl,lt=v.depthModeForSublayer(0,vn.ReadOnly),tt=Kn.disabled,yt=v.colorModeForRenderPass(),kt=[];for(let ut=0;utut.sortKey-wt.sortKey);for(const ut of kt){const{programConfiguration:wt,program:Dt,layoutVertexBuffer:Ot,indexBuffer:Bt,uniformValues:Qt,terrainData:Jt}=ut.state;Dt.draw(it,rt.TRIANGLES,lt,tt,yt,Zn.disabled,Qt,Jt,T.id,Ot,Bt,ut.segments,T.paint,v.transform.zoom,wt)}})(s,f,d,m);break;case"heatmap":(function(v,I,T,M){if(T.paint.get("heatmap-opacity")!==0)if(v.renderPass==="offscreen"){const k=v.context,z=k.gl,B=Kn.disabled,Z=new Or([z.ONE,z.ONE],u.aO.transparent,[!0,!0,!0,!0]);(function(it,rt,lt){const tt=it.gl;it.activeTexture.set(tt.TEXTURE1),it.viewport.set([0,0,rt.width/4,rt.height/4]);let yt=lt.heatmapFbo;if(yt)tt.bindTexture(tt.TEXTURE_2D,yt.colorAttachment.get()),it.bindFramebuffer.set(yt.framebuffer);else{const kt=tt.createTexture();tt.bindTexture(tt.TEXTURE_2D,kt),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),yt=lt.heatmapFbo=it.createFramebuffer(rt.width/4,rt.height/4,!1,!1),function(ut,wt,Dt,Ot){var Bt,Qt;const Jt=ut.gl,ie=(Bt=ut.HALF_FLOAT)!==null&&Bt!==void 0?Bt:Jt.UNSIGNED_BYTE,ae=(Qt=ut.RGBA16F)!==null&&Qt!==void 0?Qt:Jt.RGBA;Jt.texImage2D(Jt.TEXTURE_2D,0,ae,wt.width/4,wt.height/4,0,Jt.RGBA,ie,null),Ot.colorAttachment.set(Dt)}(it,rt,kt,yt)}})(k,v,T),k.clear({color:u.aO.transparent});for(let it=0;it{const ut=u.F();u.aN(ut,0,lt.width,lt.height,0,0,1);const wt=lt.context.gl;return{u_matrix:ut,u_world:[wt.drawingBufferWidth,wt.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:tt.paint.get("heatmap-opacity")}})(k,z),null,z.id,k.viewportBuffer,k.quadTriangleIndexBuffer,k.viewportSegments,z.paint,k.transform.zoom)}(v,T))})(s,f,d,m);break;case"line":(function(v,I,T,M){if(v.renderPass!=="translucent")return;const k=T.paint.get("line-opacity"),z=T.paint.get("line-width");if(k.constantOr(1)===0||z.constantOr(1)===0)return;const B=v.depthModeForSublayer(0,vn.ReadOnly),Z=v.colorModeForRenderPass(),it=T.paint.get("line-dasharray"),rt=T.paint.get("line-pattern"),lt=rt.constantOr(1),tt=T.paint.get("line-gradient"),yt=T.getCrossfadeParameters(),kt=lt?"linePattern":it?"lineSDF":tt?"lineGradient":"line",ut=v.context,wt=ut.gl;let Dt=!0;for(const Ot of M){const Bt=I.getTile(Ot);if(lt&&!Bt.patternsLoaded())continue;const Qt=Bt.getBucket(T);if(!Qt)continue;const Jt=Qt.programConfigurations.get(T.id),ie=v.context.program.get(),ae=v.useProgram(kt,Jt),Je=Dt||ae.program!==ie,le=v.style.map.terrain&&v.style.map.terrain.getTerrainData(Ot),Oe=rt.constantOr(null);if(Oe&&Bt.imageAtlas){const Ue=Bt.imageAtlas,rn=Ue.patternPositions[Oe.to.toString()],an=Ue.patternPositions[Oe.from.toString()];rn&&an&&Jt.setConstantPatternPositions(rn,an)}const Qe=le?Ot:null,bn=lt?_l(v,Bt,T,yt,Qe):it?$c(v,Bt,T,it,yt,Qe):tt?Yd(v,Bt,T,Qt.lineClipsArray.length,Qe):Qc(v,Bt,T,Qe);if(lt)ut.activeTexture.set(wt.TEXTURE0),Bt.imageAtlasTexture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE),Jt.updatePaintBuffers(yt);else if(it&&(Je||v.lineAtlas.dirty))ut.activeTexture.set(wt.TEXTURE0),v.lineAtlas.bind(ut);else if(tt){const Ue=Qt.gradients[T.id];let rn=Ue.texture;if(T.gradientVersion!==Ue.version){let an=256;if(T.stepInterpolant){const Sr=I.getSource().maxzoom,Bn=Ot.canonical.z===Sr?Math.ceil(1<0?f.pop():null}isPatternMissing(s){if(!s)return!1;if(!s.from||!s.to)return!0;const f=this.imageManager.getPattern(s.from.toString()),d=this.imageManager.getPattern(s.to.toString());return!f||!d}useProgram(s,f){this.cache=this.cache||{};const d=s+(f?f.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[d]||(this.cache[d]=new za(this.context,Hu[s],f,Kd[s],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 s=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(s.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new $(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:s,drawingBufferHeight:f}=this.context.gl;return this.width!==s||this.height!==f}}class Ba{constructor(s,f){this.points=s,this.planes=f}static fromInvProjectionMatrix(s,f,d){const m=Math.pow(2,d),v=[[-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,s))[3]/f*m;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,it){var rt=it[0],lt=it[1],tt=it[2],yt=rt*rt+lt*lt+tt*tt;return yt>0&&(yt=1/Math.sqrt(yt)),Z[0]=it[0]*yt,Z[1]=it[1]*yt,Z[2]=it[2]*yt,Z}([],function(Z,it,rt){var lt=it[0],tt=it[1],yt=it[2],kt=rt[0],ut=rt[1],wt=rt[2];return Z[0]=tt*wt-yt*ut,Z[1]=yt*kt-lt*wt,Z[2]=lt*ut-tt*kt,Z}([],ct([],v[T[0]],v[T[1]]),ct([],v[T[2]],v[T[1]]))),k=-((z=M)[0]*(B=v[T[1]])[0]+z[1]*B[1]+z[2]*B[2]);var z,B;return M.concat(k)});return new Ba(v,I)}}class Va{constructor(s,f){this.min=s,this.max=f,this.center=function(d,m,v){return d[0]=.5*m[0],d[1]=.5*m[1],d[2]=.5*m[2],d}([],function(d,m,v){return d[0]=m[0]+v[0],d[1]=m[1]+v[1],d[2]=m[2]+v[2],d}([],this.min,this.max))}quadrant(s){const f=[s%2==0,s<2],d=_t(this.min),m=_t(this.max);for(let v=0;v=0&&I++;if(I===0)return 0;I!==f.length&&(d=!1)}if(d)return 2;for(let m=0;m<3;m++){let v=Number.MAX_VALUE,I=-Number.MAX_VALUE;for(let T=0;Tthis.max[m]-this.min[m])return 0}return 1}}class iu{constructor(s=0,f=0,d=0,m=0){if(isNaN(s)||s<0||isNaN(f)||f<0||isNaN(d)||d<0||isNaN(m)||m<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=s,this.bottom=f,this.left=d,this.right=m}interpolate(s,f,d){return f.top!=null&&s.top!=null&&(this.top=u.z.number(s.top,f.top,d)),f.bottom!=null&&s.bottom!=null&&(this.bottom=u.z.number(s.bottom,f.bottom,d)),f.left!=null&&s.left!=null&&(this.left=u.z.number(s.left,f.left,d)),f.right!=null&&s.right!=null&&(this.right=u.z.number(s.right,f.right,d)),this}getCenter(s,f){const d=u.ac((this.left+s-this.right)/2,0,s),m=u.ac((this.top+f-this.bottom)/2,0,f);return new u.P(d,m)}equals(s){return this.top===s.top&&this.bottom===s.bottom&&this.left===s.left&&this.right===s.right}clone(){return new iu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const np=85.051129;class yh{constructor(s,f,d,m,v){this.tileSize=512,this._renderWorldCopies=v===void 0||!!v,this._minZoom=s||0,this._maxZoom=f||22,this._minPitch=d??0,this._maxPitch=m??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 iu,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){const s=new yh(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return s.apply(this),s}apply(s){this.tileSize=s.tileSize,this.latRange=s.latRange,this.width=s.width,this.height=s.height,this._center=s._center,this._elevation=s._elevation,this.minElevationForCurrentTile=s.minElevationForCurrentTile,this.zoom=s.zoom,this.angle=s.angle,this._fov=s._fov,this._pitch=s._pitch,this._unmodified=s._unmodified,this._edgeInsets=s._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(s){this._minZoom!==s&&(this._minZoom=s,this.zoom=Math.max(this.zoom,s))}get maxZoom(){return this._maxZoom}set maxZoom(s){this._maxZoom!==s&&(this._maxZoom=s,this.zoom=Math.min(this.zoom,s))}get minPitch(){return this._minPitch}set minPitch(s){this._minPitch!==s&&(this._minPitch=s,this.pitch=Math.max(this.pitch,s))}get maxPitch(){return this._maxPitch}set maxPitch(s){this._maxPitch!==s&&(this._maxPitch=s,this.pitch=Math.min(this.pitch,s))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(s){s===void 0?s=!0:s===null&&(s=!1),this._renderWorldCopies=s}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(s){const f=-u.b1(s,-180,180)*Math.PI/180;this.angle!==f&&(this._unmodified=!1,this.angle=f,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,m,v){var I=m[0],T=m[1],M=m[2],k=m[3],z=Math.sin(v),B=Math.cos(v);d[0]=I*B+M*z,d[1]=T*B+k*z,d[2]=I*-z+M*B,d[3]=T*-z+k*B}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(s){const f=u.ac(s,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==f&&(this._unmodified=!1,this._pitch=f,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(s){s=Math.max(.01,Math.min(60,s)),this._fov!==s&&(this._unmodified=!1,this._fov=s/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(s){const f=Math.min(Math.max(s,this.minZoom),this.maxZoom);this._zoom!==f&&(this._unmodified=!1,this._zoom=f,this.tileZoom=Math.max(0,Math.floor(f)),this.scale=this.zoomScale(f),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(s){s.lat===this._center.lat&&s.lng===this._center.lng||(this._unmodified=!1,this._center=s,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(s){s!==this._elevation&&(this._elevation=s,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(s){this._edgeInsets.equals(s)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,s,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(s){return this._edgeInsets.equals(s)}interpolatePadding(s,f,d){this._unmodified=!1,this._edgeInsets.interpolate(s,f,d),this._constrain(),this._calcMatrices()}coveringZoomLevel(s){const f=(s.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/s.tileSize));return Math.max(0,f)}getVisibleUnwrappedCoordinates(s){const f=[new u.b2(0,s)];if(this._renderWorldCopies){const d=this.pointCoordinate(new u.P(0,0)),m=this.pointCoordinate(new u.P(this.width,0)),v=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,m.x,v.x,I.x)),M=Math.floor(Math.max(d.x,m.x,v.x,I.x)),k=1;for(let z=T-k;z<=M+k;z++)z!==0&&f.push(new u.b2(z,s))}return f}coveringTiles(s){var f,d;let m=this.coveringZoomLevel(s);const v=m;if(s.minzoom!==void 0&&ms.maxzoom&&(m=s.maxzoom);const I=this.pointCoordinate(this.getCameraPoint()),T=u.Y.fromLngLat(this.center),M=Math.pow(2,m),k=[M*I.x,M*I.y,0],z=[M*T.x,M*T.y,0],B=Ba.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,m);let Z=s.minzoom||0;!s.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Z=m);const it=s.terrain?2/Math.min(this.tileSize,s.tileSize)*this.tileSize:3,rt=ut=>({aabb:new Va([ut*M,0,0],[(ut+1)*M,M,0]),zoom:0,x:0,y:0,wrap:ut,fullyVisible:!1}),lt=[],tt=[],yt=m,kt=s.reparseOverscaled?v:m;if(this._renderWorldCopies)for(let ut=1;ut<=3;ut++)lt.push(rt(-ut)),lt.push(rt(ut));for(lt.push(rt(0));lt.length>0;){const ut=lt.pop(),wt=ut.x,Dt=ut.y;let Ot=ut.fullyVisible;if(!Ot){const ae=ut.aabb.intersects(B);if(ae===0)continue;Ot=ae===2}const Bt=s.terrain?k:z,Qt=ut.aabb.distanceX(Bt),Jt=ut.aabb.distanceY(Bt),ie=Math.max(Math.abs(Qt),Math.abs(Jt));if(ut.zoom===yt||ie>it+(1<=Z){const ae=yt-ut.zoom,Je=k[0]-.5-(wt<>1),Oe=ut.zoom+1;let Qe=ut.aabb.quadrant(ae);if(s.terrain){const bn=new u.Q(Oe,ut.wrap,Oe,Je,le),Ue=s.terrain.getMinMaxElevation(bn),rn=(f=Ue.minElevation)!==null&&f!==void 0?f:this.elevation,an=(d=Ue.maxElevation)!==null&&d!==void 0?d:this.elevation;Qe=new Va([Qe.min[0],Qe.min[1],rn],[Qe.max[0],Qe.max[1],an])}lt.push({aabb:Qe,zoom:Oe,x:Je,y:le,wrap:ut.wrap,fullyVisible:Ot})}}return tt.sort((ut,wt)=>ut.distanceSq-wt.distanceSq).map(ut=>ut.tileID)}resize(s,f){this.width=s,this.height=f,this.pixelsToGLUnits=[2/s,-2/f],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(s){return Math.pow(2,s)}scaleZoom(s){return Math.log(s)/Math.LN2}project(s){const f=u.ac(s.lat,-85.051129,np);return new u.P(u.N(s.lng)*this.worldSize,u.O(f)*this.worldSize)}unproject(s){return new u.Y(s.x/this.worldSize,s.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(s){const f=this.elevation,d=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,m=this.pointLocation(this.centerPoint,s),v=s.getElevationForLngLatZoom(m,this.tileZoom);if(!(this.elevation-v))return;const I=d+f-v,T=Math.cos(this._pitch)*this.cameraToCenterDistance/I/u.b3(1,m.lat),M=this.scaleZoom(T/this.tileSize);this._elevation=v,this._center=m,this.zoom=M}setLocationAtPoint(s,f){const d=this.pointCoordinate(f),m=this.pointCoordinate(this.centerPoint),v=this.locationCoordinate(s),I=new u.Y(v.x-(d.x-m.x),v.y-(d.y-m.y));this.center=this.coordinateLocation(I),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(s,f){return f?this.coordinatePoint(this.locationCoordinate(s),f.getElevationForLngLatZoom(s,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(s))}pointLocation(s,f){return this.coordinateLocation(this.pointCoordinate(s,f))}locationCoordinate(s){return u.Y.fromLngLat(s)}coordinateLocation(s){return s&&s.toLngLat()}pointCoordinate(s,f){if(f){const Z=f.pointCoordinate(s);if(Z!=null)return Z}const d=[s.x,s.y,0,1],m=[s.x,s.y,1,1];u.af(d,d,this.pixelMatrixInverse),u.af(m,m,this.pixelMatrixInverse);const v=d[3],I=m[3],T=d[1]/v,M=m[1]/I,k=d[2]/v,z=m[2]/I,B=k===z?0:(0-k)/(z-k);return new u.Y(u.z.number(d[0]/v,m[0]/I,B)/this.worldSize,u.z.number(T,M,B)/this.worldSize)}coordinatePoint(s,f=0,d=this.pixelMatrix){const m=[s.x*this.worldSize,s.y*this.worldSize,f,1];return u.af(m,m,d),new u.P(m[0]/m[3],m[1]/m[3])}getBounds(){const s=Math.max(0,this.height/2-this.getHorizon());return new St().extend(this.pointLocation(new u.P(0,s))).extend(this.pointLocation(new u.P(this.width,s))).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 St([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(s){s?(this.lngRange=[s.getWest(),s.getEast()],this.latRange=[s.getSouth(),s.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,np])}calculatePosMatrix(s,f=!1){const d=s.key,m=f?this._alignedPosMatrixCache:this._posMatrixCache;if(m[d])return m[d];const v=s.canonical,I=this.worldSize/this.zoomScale(v.z),T=v.x+Math.pow(2,v.z)*s.wrap,M=u.an(new Float64Array(16));return u.H(M,M,[T*I,v.y*I,0]),u.J(M,M,[I/u.W,I/u.W,1]),u.K(M,f?this.alignedProjMatrix:this.projMatrix,M),m[d]=new Float32Array(M),m[d]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(s,f){f=u.ac(+f,this.minZoom,this.maxZoom);const d={center:new u.M(s.lng,s.lat),zoom:f};let m=this.lngRange;if(!this._renderWorldCopies&&m===null){const ut=179.9999999999;m=[-ut,ut]}const v=this.tileSize*this.zoomScale(d.zoom);let I=0,T=v,M=0,k=v,z=0,B=0;const{x:Z,y:it}=this.size;if(this.latRange){const ut=this.latRange;I=u.O(ut[1])*v,T=u.O(ut[0])*v,T-IT&&(yt=T-ut)}if(m){const ut=(M+k)/2;let wt=rt;this._renderWorldCopies&&(wt=u.b1(rt,ut-v/2,ut+v/2));const Dt=Z/2;wt-Dtk&&(tt=k-Dt)}if(tt!==void 0||yt!==void 0){const ut=new u.P(tt??rt,yt??lt);d.center=this.unproject.call({worldSize:v},ut).wrap()}return d}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const s=this._unmodified,{center:f,zoom:d}=this.getConstrained(this.center,this.zoom);this.center=f,this.zoom=d,this._unmodified=s,this._constraining=!1}_calcMatrices(){if(!this.height)return;const s=this.centerOffset,f=this.point.x,d=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=u.b3(1,this.center.lat)*this.worldSize;let m=u.an(new Float64Array(16));u.J(m,m,[this.width/2,-this.height/2,1]),u.H(m,m,[1,-1,0]),this.labelPlaneMatrix=m,m=u.an(new Float64Array(16)),u.J(m,m,[1,-1,1]),u.H(m,m,[-1,-1,0]),u.J(m,m,[2/this.width,2/this.height,1]),this.glCoordMatrix=m;const v=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),I=Math.min(this.elevation,this.minElevationForCurrentTile),T=v-I*this._pixelPerMeter/Math.cos(this._pitch),M=I<0?T:v,k=Math.PI/2+this._pitch,z=this._fov*(.5+s.y/this.height),B=Math.sin(z)*M/Math.sin(u.ac(Math.PI-k-z,.01,Math.PI-.01)),Z=this.getHorizon(),it=2*Math.atan(Z/this.cameraToCenterDistance)*(.5+s.y/(2*Z)),rt=Math.sin(it)*M/Math.sin(u.ac(Math.PI-k-it,.01,Math.PI-.01)),lt=Math.min(B,rt),tt=1.01*(Math.cos(Math.PI/2-this._pitch)*lt+M),yt=this.height/50;m=new Float64Array(16),u.b4(m,this._fov,this.width/this.height,yt,tt),m[8]=2*-s.x/this.width,m[9]=2*s.y/this.height,u.J(m,m,[1,-1,1]),u.H(m,m,[0,0,-this.cameraToCenterDistance]),u.b5(m,m,this._pitch),u.ad(m,m,this.angle),u.H(m,m,[-f,-d,0]),this.mercatorMatrix=u.J([],m,[this.worldSize,this.worldSize,this.worldSize]),u.J(m,m,[1,1,this._pixelPerMeter]),this.pixelMatrix=u.K(new Float64Array(16),this.labelPlaneMatrix,m),u.H(m,m,[0,0,-this.elevation]),this.projMatrix=m,this.invProjMatrix=u.ar([],m),this.pixelMatrix3D=u.K(new Float64Array(16),this.labelPlaneMatrix,m);const kt=this.width%2/2,ut=this.height%2/2,wt=Math.cos(this.angle),Dt=Math.sin(this.angle),Ot=f-Math.round(f)+wt*kt+Dt*ut,Bt=d-Math.round(d)+wt*ut+Dt*kt,Qt=new Float64Array(m);if(u.H(Qt,Qt,[Ot>.5?Ot-1:Ot,Bt>.5?Bt-1:Bt,0]),this.alignedProjMatrix=Qt,m=u.ar(new Float64Array(16),this.pixelMatrix),!m)throw new Error("failed to invert matrix");this.pixelMatrixInverse=m,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const s=this.pointCoordinate(new u.P(0,0)),f=[s.x*this.worldSize,s.y*this.worldSize,0,1];return u.af(f,f,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const s=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.P(0,s))}getCameraQueryGeometry(s){const f=this.getCameraPoint();if(s.length===1)return[s[0],f];{let d=f.x,m=f.y,v=f.x,I=f.y;for(const T of s)d=Math.min(d,T.x),m=Math.min(m,T.y),v=Math.max(v,T.x),I=Math.max(I,T.y);return[new u.P(d,m),new u.P(v,m),new u.P(v,I),new u.P(d,I),new u.P(d,m)]}}lngLatToCameraDepth(s,f){const d=this.locationCoordinate(s),m=[d.x*this.worldSize,d.y*this.worldSize,f,1];return u.af(m,m,this.projMatrix),m[2]/m[3]}}function rp(_,s){let f,d=!1,m=null,v=null;const I=()=>{m=null,d&&(_.apply(v,f),m=setTimeout(I,s),d=!1)};return(...T)=>(d=!0,v=this,f=T,m||I(),m)}class ip{constructor(s){this._getCurrentHash=()=>{const f=window.location.hash.replace("#","");if(this._hashName){let d;return f.split("&").map(m=>m.split("=")).forEach(m=>{m[0]===this._hashName&&(d=m)}),(d&&d[1]||"").split("/")}return f.split("/")},this._onHashChange=()=>{const f=this._getCurrentHash();if(f.length>=3&&!f.some(d=>isNaN(d))){const d=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(f[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+f[2],+f[1]],zoom:+f[0],bearing:d,pitch:+(f[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const f=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,f)}catch{}},this._updateHash=rp(this._updateHashUnthrottled,300),this._hashName=s&&encodeURIComponent(s)}addTo(s){return this._map=s,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(s){const f=this._map.getCenter(),d=Math.round(100*this._map.getZoom())/100,m=Math.ceil((d*Math.LN2+Math.log(512/360/.5))/Math.LN10),v=Math.pow(10,m),I=Math.round(f.lng*v)/v,T=Math.round(f.lat*v)/v,M=this._map.getBearing(),k=this._map.getPitch();let z="";if(z+=s?`/${I}/${T}/${d}`:`${d}/${T}/${I}`,(M||k)&&(z+="/"+Math.round(10*M)/10),k&&(z+=`/${Math.round(k)}`),this._hashName){const B=this._hashName;let Z=!1;const it=window.location.hash.slice(1).split("&").map(rt=>{const lt=rt.split("=")[0];return lt===B?(Z=!0,`${lt}=${z}`):rt}).filter(rt=>rt);return Z||it.push(`${B}=${z}`),`#${it.join("&")}`}return`#${z}`}}const ec={linearity:.3,easing:u.b6(0,0,.3,1)},wl=u.e({deceleration:2500,maxSpeed:1400},ec),hm=u.e({deceleration:20,maxSpeed:1400},ec),fm=u.e({deceleration:1e3,maxSpeed:360},ec),pm=u.e({deceleration:1e3,maxSpeed:90},ec);class dm{constructor(s){this._map=s,this.clear()}clear(){this._inertiaBuffer=[]}record(s){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:C.now(),settings:s})}_drainInertiaBuffer(){const s=this._inertiaBuffer,f=C.now();for(;s.length>0&&f-s[0].time>160;)s.shift()}_onMoveEnd(s){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const f={zoom:0,bearing:0,pitch:0,pan:new u.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:v}of this._inertiaBuffer)f.zoom+=v.zoomDelta||0,f.bearing+=v.bearingDelta||0,f.pitch+=v.pitchDelta||0,v.panDelta&&f.pan._add(v.panDelta),v.around&&(f.around=v.around),v.pinchAround&&(f.pinchAround=v.pinchAround);const d=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,m={};if(f.pan.mag()){const v=rc(f.pan.mag(),d,u.e({},wl,s||{}));m.offset=f.pan.mult(v.amount/f.pan.mag()),m.center=this._map.transform.center,nc(m,v)}if(f.zoom){const v=rc(f.zoom,d,hm);m.zoom=this._map.transform.zoom+v.amount,nc(m,v)}if(f.bearing){const v=rc(f.bearing,d,fm);m.bearing=this._map.transform.bearing+u.ac(v.amount,-179,179),nc(m,v)}if(f.pitch){const v=rc(f.pitch,d,pm);m.pitch=this._map.transform.pitch+v.amount,nc(m,v)}if(m.zoom||m.bearing){const v=f.pinchAround===void 0?f.around:f.pinchAround;m.around=v?this._map.unproject(v):this._map.getCenter()}return this.clear(),u.e(m,{noMoveStart:!0})}}function nc(_,s){(!_.duration||_.durationf.unproject(M)),T=v.reduce((M,k,z,B)=>M.add(k.div(B.length)),new u.P(0,0));super(s,{points:v,point:T,lngLats:I,lngLat:f.unproject(T),originalEvent:d}),this._defaultPrevented=!1}}class op extends u.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(s,f,d){super(s,{originalEvent:d}),this._defaultPrevented=!1}}class hs{constructor(s,f){this._map=s,this._clickTolerance=f.clickTolerance}reset(){delete this._mousedownPos}wheel(s){return this._firePreventable(new op(s.type,this._map,s))}mousedown(s,f){return this._mousedownPos=f,this._firePreventable(new uo(s.type,this._map,s))}mouseup(s){this._map.fire(new uo(s.type,this._map,s))}click(s,f){this._mousedownPos&&this._mousedownPos.dist(f)>=this._clickTolerance||this._map.fire(new uo(s.type,this._map,s))}dblclick(s){return this._firePreventable(new uo(s.type,this._map,s))}mouseover(s){this._map.fire(new uo(s.type,this._map,s))}mouseout(s){this._map.fire(new uo(s.type,this._map,s))}touchstart(s){return this._firePreventable(new Os(s.type,this._map,s))}touchmove(s){this._map.fire(new Os(s.type,this._map,s))}touchend(s){this._map.fire(new Os(s.type,this._map,s))}touchcancel(s){this._map.fire(new Os(s.type,this._map,s))}_firePreventable(s){if(this._map.fire(s),s.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class zs{constructor(s){this._map=s}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(s){this._map.fire(new uo(s.type,this._map,s))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new uo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(s){this._delayContextMenu?this._contextMenuEvent=s:this._ignoreContextMenu||this._map.fire(new uo(s.type,this._map,s)),this._map.listens("contextmenu")&&s.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ou{constructor(s){this._map=s}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(s){return this.transform.pointLocation(u.P.convert(s),this._map.terrain)}}class fs{constructor(s,f){this._map=s,this._tr=new ou(s),this._el=s.getCanvasContainer(),this._container=s.getContainer(),this._clickTolerance=f.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(s,f){this.isEnabled()&&s.shiftKey&&s.button===0&&(P.disableDrag(),this._startPos=this._lastPos=f,this._active=!0)}mousemoveWindow(s,f){if(!this._active)return;const d=f;if(this._lastPos.equals(d)||!this._box&&d.dist(this._startPos)v.fitScreenCoordinates(d,m,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",s)}keydown(s){this._active&&s.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",s))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(P.remove(this._box),this._box=null),P.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(s,f){return this._map.fire(new u.k(s,{originalEvent:f}))}}function Sl(_,s){if(_.length!==s.length)throw new Error(`The number of touches and points are not equal - touches ${_.length}, points ${s.length}`);const f={};for(let d=0;d<_.length;d++)f[_[d].identifier]=s[d];return f}class zy{constructor(s){this.reset(),this.numTouches=s.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(s,f,d){(this.centroid||d.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=s.timeStamp),d.length===this.numTouches&&(this.centroid=function(m){const v=new u.P(0,0);for(const I of m)v._add(I);return v.div(m.length)}(f),this.touches=Sl(d,f)))}touchmove(s,f,d){if(this.aborted||!this.centroid)return;const m=Sl(d,f);for(const v in this.touches){const I=m[v];(!I||I.dist(this.touches[v])>30)&&(this.aborted=!0)}}touchend(s,f,d){if((!this.centroid||s.timeStamp-this.startTime>500)&&(this.aborted=!0),d.length===0){const m=!this.aborted&&this.centroid;if(this.reset(),m)return m}}}class sp{constructor(s){this.singleTap=new zy(s),this.numTaps=s.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(s,f,d){this.singleTap.touchstart(s,f,d)}touchmove(s,f,d){this.singleTap.touchmove(s,f,d)}touchend(s,f,d){const m=this.singleTap.touchend(s,f,d);if(m){const v=s.timeStamp-this.lastTime<500,I=!this.lastTap||this.lastTap.dist(m)<30;if(v&&I||this.reset(),this.count++,this.lastTime=s.timeStamp,this.lastTap=m,this.count===this.numTaps)return this.reset(),m}}}class Fy{constructor(s){this._tr=new ou(s),this._zoomIn=new sp({numTouches:1,numTaps:2}),this._zoomOut=new sp({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(s,f,d){this._zoomIn.touchstart(s,f,d),this._zoomOut.touchstart(s,f,d)}touchmove(s,f,d){this._zoomIn.touchmove(s,f,d),this._zoomOut.touchmove(s,f,d)}touchend(s,f,d){const m=this._zoomIn.touchend(s,f,d),v=this._zoomOut.touchend(s,f,d),I=this._tr;return m?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:I.zoom+1,around:I.unproject(m)},{originalEvent:s})}):v?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:I.zoom-1,around:I.unproject(v)},{originalEvent:s})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class su{constructor(s){this._enabled=!!s.enable,this._moveStateManager=s.moveStateManager,this._clickTolerance=s.clickTolerance||1,this._moveFunction=s.move,this._activateOnStart=!!s.activateOnStart,s.assignEvents(this),this.reset()}reset(s){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(s)}_move(...s){const f=this._moveFunction(...s);if(f.bearingDelta||f.pitchDelta||f.around||f.panDelta)return this._active=!0,f}dragStart(s,f){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(s)&&(this._moveStateManager.startMove(s),this._lastPoint=f.length?f[0]:f,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(s,f){if(!this.isEnabled())return;const d=this._lastPoint;if(!d)return;if(s.preventDefault(),!this._moveStateManager.isValidMoveEvent(s))return void this.reset(s);const m=f.length?f[0]:f;return!this._moved&&m.dist(d){_.mousedown=_.dragStart,_.mousemoveWindow=_.dragMove,_.mouseup=_.dragEnd,_.contextmenu=function(s){s.preventDefault()}},au=({enable:_,clickTolerance:s,bearingDegreesPerPixelMoved:f=.8})=>{const d=new Fs({checkCorrectEvent:m=>P.mouseButton(m)===0&&m.ctrlKey||P.mouseButton(m)===2});return new su({clickTolerance:s,move:(m,v)=>({bearingDelta:(v.x-m.x)*f}),moveStateManager:d,enable:_,assignEvents:_h})},lu=({enable:_,clickTolerance:s,pitchDegreesPerPixelMoved:f=-.5})=>{const d=new Fs({checkCorrectEvent:m=>P.mouseButton(m)===0&&m.ctrlKey||P.mouseButton(m)===2});return new su({clickTolerance:s,move:(m,v)=>({pitchDelta:(v.y-m.y)*f}),moveStateManager:d,enable:_,assignEvents:_h})};class mm{constructor(s,f){this._clickTolerance=s.clickTolerance||1,this._map=f,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new u.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(s,f,d){return this._calculateTransform(s,f,d)}touchmove(s,f,d){if(this._active&&!(d.length0&&(this._active=!0);const m=Sl(d,f),v=new u.P(0,0),I=new u.P(0,0);let T=0;for(const k in m){const z=m[k],B=this._touches[k];B&&(v._add(z),I._add(z.sub(B)),T++,m[k]=z)}if(this._touches=m,TMath.abs(_.x)}class _m extends de{constructor(s){super(),this._currentTouchCount=0,this._map=s}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(s,f,d){super.touchstart(s,f,d),this._currentTouchCount=d.length}_start(s){this._lastPoints=s,bh(s[0].sub(s[1]))&&(this._valid=!1)}_move(s,f,d){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const m=s[0].sub(this._lastPoints[0]),v=s[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(m,v,d.timeStamp),this._valid?(this._lastPoints=s,this._active=!0,{pitchDelta:(m.y+v.y)/2*-.5}):void 0}gestureBeginsVertically(s,f,d){if(this._valid!==void 0)return this._valid;const m=s.mag()>=2,v=f.mag()>=2;if(!m&&!v)return;if(!m||!v)return this._firstMove===void 0&&(this._firstMove=d),d-this._firstMove<100&&void 0;const I=s.y>0==f.y>0;return bh(s)&&bh(f)&&I}}const By={panStep:100,bearingStep:15,pitchStep:10};class Ua{constructor(s){this._tr=new ou(s);const f=By;this._panStep=f.panStep,this._bearingStep=f.bearingStep,this._pitchStep=f.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(s){if(s.altKey||s.ctrlKey||s.metaKey)return;let f=0,d=0,m=0,v=0,I=0;switch(s.keyCode){case 61:case 107:case 171:case 187:f=1;break;case 189:case 109:case 173:f=-1;break;case 37:s.shiftKey?d=-1:(s.preventDefault(),v=-1);break;case 39:s.shiftKey?d=1:(s.preventDefault(),v=1);break;case 38:s.shiftKey?m=1:(s.preventDefault(),I=-1);break;case 40:s.shiftKey?m=-1:(s.preventDefault(),I=1);break;default:return}return this._rotationDisabled&&(d=0,m=0),{cameraAnimation:T=>{const M=this._tr;T.easeTo({duration:300,easeId:"keyboardHandler",easing:nr,zoom:f?Math.round(M.zoom)+f*(s.shiftKey?2:1):M.zoom,bearing:M.bearing+d*this._bearingStep,pitch:M.pitch+m*this._pitchStep,offset:[-v*this._panStep,-I*this._panStep],center:M.center},{originalEvent:s})}}}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 nr(_){return _*(2-_)}const oc=4.000244140625;class xh{constructor(s,f){this._onTimeout=d=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(d)},this._map=s,this._tr=new ou(s),this._triggerRenderFrame=f,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(s){this._defaultZoomRate=s}setWheelZoomRate(s){this._wheelZoomRate=s}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(s){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!s&&s.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(s){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!s[this._map.cooperativeGestures._bypassKey])return;let f=s.deltaMode===WheelEvent.DOM_DELTA_LINE?40*s.deltaY:s.deltaY;const d=C.now(),m=d-(this._lastWheelEventTime||0);this._lastWheelEventTime=d,f!==0&&f%oc==0?this._type="wheel":f!==0&&Math.abs(f)<4?this._type="trackpad":m>400?(this._type=null,this._lastValue=f,this._timeout=setTimeout(this._onTimeout,40,s)):this._type||(this._type=Math.abs(m*f)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,f+=this._lastValue)),s.shiftKey&&f&&(f/=4),this._type&&(this._lastWheelEvent=s,this._delta-=f,this._active||this._start(s)),s.preventDefault()}_start(s){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 f=P.mousePos(this._map.getCanvas(),s),d=this._tr;this._around=f.y>d.transform.height/2-d.transform.getHorizon()?u.M.convert(this._aroundCenter?d.center:d.unproject(f)):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 s=this._tr.transform;if(this._delta!==0){const T=this._type==="wheel"&&Math.abs(this._delta)>oc?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"?s.zoomScale(this._targetZoom):s.scale;this._targetZoom=Math.min(s.maxZoom,Math.max(s.minZoom,s.scaleZoom(k*M))),this._type==="wheel"&&(this._startZoom=s.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const f=typeof this._targetZoom=="number"?this._targetZoom:s.zoom,d=this._startZoom,m=this._easing;let v,I=!1;if(this._type==="wheel"&&d&&m){const T=Math.min((C.now()-this._lastWheelEventTime)/200,1),M=m(T);v=u.z.number(d,f,M),T<1?this._frameId||(this._frameId=!0):I=!0}else v=f,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:v-s.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(s){let f=u.b7;if(this._prevEase){const d=this._prevEase,m=(C.now()-d.start)/d.duration,v=d.easing(m+.01)-d.easing(m),I=.27/Math.sqrt(v*v+1e-4)*.01,T=Math.sqrt(.0729-I*I);f=u.b6(I,T,.25,1)}return this._prevEase={start:C.now(),duration:s,easing:f},f}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class lp{constructor(s,f){this._clickZoom=s,this._tapZoom=f}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 vm{constructor(s){this._tr=new ou(s),this.reset()}reset(){this._active=!1}dblclick(s,f){return s.preventDefault(),{cameraAnimation:d=>{d.easeTo({duration:300,zoom:this._tr.zoom+(s.shiftKey?-1:1),around:this._tr.unproject(f)},{originalEvent:s})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class bm{constructor(){this._tap=new sp({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(s,f,d){if(!this._swipePoint)if(this._tapTime){const m=f[0],v=s.timeStamp-this._tapTime<500,I=this._tapPoint.dist(m)<30;v&&I?d.length>0&&(this._swipePoint=m,this._swipeTouch=d[0].identifier):this.reset()}else this._tap.touchstart(s,f,d)}touchmove(s,f,d){if(this._tapTime){if(this._swipePoint){if(d[0].identifier!==this._swipeTouch)return;const m=f[0],v=m.y-this._swipePoint.y;return this._swipePoint=m,s.preventDefault(),this._active=!0,{zoomDelta:v/128}}}else this._tap.touchmove(s,f,d)}touchend(s,f,d){if(this._tapTime)this._swipePoint&&d.length===0&&this.reset();else{const m=this._tap.touchend(s,f,d);m&&(this._tapTime=s.timeStamp,this._tapPoint=m)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class xm{constructor(s,f,d){this._el=s,this._mousePan=f,this._touchPan=d}enable(s){this._inertiaOptions=s||{},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 ps{constructor(s,f,d){this._pitchWithRotate=s.pitchWithRotate,this._mouseRotate=f,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 sc{constructor(s,f,d,m){this._el=s,this._touchZoom=f,this._touchRotate=d,this._tapDragZoom=m,this._rotationDisabled=!1,this._enabled=!0}enable(s){this._touchZoom.enable(s),this._rotationDisabled||this._touchRotate.enable(s),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 Ie{constructor(s,f){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=s,this._options=f,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const s=this._map.getCanvasContainer();s.classList.add("maplibregl-cooperative-gestures"),this._container=P.create("div","maplibregl-cooperative-gesture-screen",s);let f=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(f=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const d=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),m=document.createElement("div");m.className="maplibregl-desktop-message",m.textContent=f,this._container.appendChild(m);const v=document.createElement("div");v.className="maplibregl-mobile-message",v.textContent=d,this._container.appendChild(v),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(P.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(s){this._onCooperativeGesture(s.touches.length===1)}wheel(s){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!s[this._bypassKey])}_onCooperativeGesture(s){this._enabled&&s&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Re=_=>_.zoom||_.drag||_.pitch||_.rotate;class wh extends u.k{}function ac(_){return _.panDelta&&_.panDelta.mag()||_.zoomDelta||_.bearingDelta||_.pitchDelta}class up{constructor(s,f){this.handleWindowEvent=m=>{this.handleEvent(m,`${m.type}Window`)},this.handleEvent=(m,v)=>{if(m.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const I=m.type==="renderFrame"?void 0:m,T={needsRenderFrame:!1},M={},k={},z=m.touches,B=z?this._getMapTouches(z):void 0,Z=B?P.touchPos(this._map.getCanvas(),B):P.mousePos(this._map.getCanvas(),m);for(const{handlerName:lt,handler:tt,allowed:yt}of this._handlers){if(!tt.isEnabled())continue;let kt;this._blockedByActive(k,yt,lt)?tt.reset():tt[v||m.type]&&(kt=tt[v||m.type](m,Z,B),this.mergeHandlerResult(T,M,kt,lt,I),kt&&kt.needsRenderFrame&&this._triggerRenderFrame()),(kt||tt.isActive())&&(k[lt]=tt)}const it={};for(const lt in this._previousActiveHandlers)k[lt]||(it[lt]=I);this._previousActiveHandlers=k,(Object.keys(it).length||ac(T))&&(this._changes.push([T,M,it]),this._triggerRenderFrame()),(Object.keys(k).length||ac(T))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:rt}=T;rt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],rt(this._map))},this._map=s,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new dm(s),this._bearingSnap=f.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(f);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[m,v,I]of this._listeners)P.addEventListener(m,v,m===document?this.handleWindowEvent:this.handleEvent,I)}destroy(){for(const[s,f,d]of this._listeners)P.removeEventListener(s,f,s===document?this.handleWindowEvent:this.handleEvent,d)}_addDefaultHandlers(s){const f=this._map,d=f.getCanvasContainer();this._add("mapEvent",new hs(f,s));const m=f.boxZoom=new fs(f,s);this._add("boxZoom",m),s.interactive&&s.boxZoom&&m.enable();const v=f.cooperativeGestures=new Ie(f,s.cooperativeGestures);this._add("cooperativeGestures",v),s.cooperativeGestures&&v.enable();const I=new Fy(f),T=new vm(f);f.doubleClickZoom=new lp(T,I),this._add("tapZoom",I),this._add("clickZoom",T),s.interactive&&s.doubleClickZoom&&f.doubleClickZoom.enable();const M=new bm;this._add("tapDragZoom",M);const k=f.touchPitch=new _m(f);this._add("touchPitch",k),s.interactive&&s.touchPitch&&f.touchPitch.enable(s.touchPitch);const z=au(s),B=lu(s);f.dragRotate=new ps(s,z,B),this._add("mouseRotate",z,["mousePitch"]),this._add("mousePitch",B,["mouseRotate"]),s.interactive&&s.dragRotate&&f.dragRotate.enable();const Z=(({enable:kt,clickTolerance:ut})=>{const wt=new Fs({checkCorrectEvent:Dt=>P.mouseButton(Dt)===0&&!Dt.ctrlKey});return new su({clickTolerance:ut,move:(Dt,Ot)=>({around:Ot,panDelta:Ot.sub(Dt)}),activateOnStart:!0,moveStateManager:wt,enable:kt,assignEvents:_h})})(s),it=new mm(s,f);f.dragPan=new xm(d,Z,it),this._add("mousePan",Z),this._add("touchPan",it,["touchZoom","touchRotate"]),s.interactive&&s.dragPan&&f.dragPan.enable(s.dragPan);const rt=new ap,lt=new ym;f.touchZoomRotate=new sc(d,lt,rt,M),this._add("touchRotate",rt,["touchPan","touchZoom"]),this._add("touchZoom",lt,["touchPan","touchRotate"]),s.interactive&&s.touchZoomRotate&&f.touchZoomRotate.enable(s.touchZoomRotate);const tt=f.scrollZoom=new xh(f,()=>this._triggerRenderFrame());this._add("scrollZoom",tt,["mousePan"]),s.interactive&&s.scrollZoom&&f.scrollZoom.enable(s.scrollZoom);const yt=f.keyboard=new Ua(f);this._add("keyboard",yt),s.interactive&&s.keyboard&&f.keyboard.enable(),this._add("blockableMapEvent",new zs(f))}_add(s,f,d){this._handlers.push({handlerName:s,handler:f,allowed:d}),this._handlersById[s]=f}stop(s){if(!this._updatingCamera){for(const{handler:f}of this._handlers)f.reset();this._inertia.clear(),this._fireEvents({},{},s),this._changes=[]}}isActive(){for(const{handler:s}of this._handlers)if(s.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Re(this._eventsInProgress)||this.isZooming()}_blockedByActive(s,f,d){for(const m in s)if(m!==d&&(!f||f.indexOf(m)<0))return!0;return!1}_getMapTouches(s){const f=[];for(const d of s)this._el.contains(d.target)&&f.push(d);return f}mergeHandlerResult(s,f,d,m,v){if(!d)return;u.e(s,d);const I={handlerName:m,originalEvent:d.originalEvent||v};d.zoomDelta!==void 0&&(f.zoom=I),d.panDelta!==void 0&&(f.drag=I),d.pitchDelta!==void 0&&(f.pitch=I),d.bearingDelta!==void 0&&(f.rotate=I)}_applyChanges(){const s={},f={},d={};for(const[m,v,I]of this._changes)m.panDelta&&(s.panDelta=(s.panDelta||new u.P(0,0))._add(m.panDelta)),m.zoomDelta&&(s.zoomDelta=(s.zoomDelta||0)+m.zoomDelta),m.bearingDelta&&(s.bearingDelta=(s.bearingDelta||0)+m.bearingDelta),m.pitchDelta&&(s.pitchDelta=(s.pitchDelta||0)+m.pitchDelta),m.around!==void 0&&(s.around=m.around),m.pinchAround!==void 0&&(s.pinchAround=m.pinchAround),m.noInertia&&(s.noInertia=m.noInertia),u.e(f,v),u.e(d,I);this._updateMapTransform(s,f,d),this._changes=[]}_updateMapTransform(s,f,d){const m=this._map,v=m._getTransformForUpdate(),I=m.terrain;if(!(ac(s)||I&&this._terrainMovement))return this._fireEvents(f,d,!0);let{panDelta:T,zoomDelta:M,bearingDelta:k,pitchDelta:z,around:B,pinchAround:Z}=s;Z!==void 0&&(B=Z),m._stop(!0),B=B||m.transform.centerPoint;const it=v.pointLocation(T?B.sub(T):B);k&&(v.bearing+=k),z&&(v.pitch+=z),M&&(v.zoom+=M),I?this._terrainMovement||!f.drag&&!f.zoom?f.drag&&this._terrainMovement?v.center=v.pointLocation(v.centerPoint.sub(T)):v.setLocationAtPoint(it,B):(this._terrainMovement=!0,this._map._elevationFreeze=!0,v.setLocationAtPoint(it,B),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,v.recalculateZoom(m.terrain)})):v.setLocationAtPoint(it,B),m._applyUpdatedTransform(v),this._map._update(),s.noInertia||this._inertia.record(s),this._fireEvents(f,d,!0)}_fireEvents(s,f,d){const m=Re(this._eventsInProgress),v=Re(s),I={};for(const z in s){const{originalEvent:B}=s[z];this._eventsInProgress[z]||(I[`${z}start`]=B),this._eventsInProgress[z]=s[z]}!m&&v&&this._fireEvent("movestart",v.originalEvent);for(const z in I)this._fireEvent(z,I[z]);v&&this._fireEvent("move",v.originalEvent);for(const z in s){const{originalEvent:B}=s[z];this._fireEvent(z,B)}const T={};let M;for(const z in this._eventsInProgress){const{handlerName:B,originalEvent:Z}=this._eventsInProgress[z];this._handlersById[B].isActive()||(delete this._eventsInProgress[z],M=f[B]||Z,T[`${z}end`]=M)}for(const z in T)this._fireEvent(z,T[z]);const k=Re(this._eventsInProgress);if(d&&(m||v)&&!k){this._updatingCamera=!0;const z=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),B=Z=>Z!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new wh("renderFrame",{timeStamp:s})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class co extends u.E{constructor(s,f){super(),this._renderFrameCallback=()=>{const d=Math.min((C.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=s,this._bearingSnap=f.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new u.M(this.transform.center.lng,this.transform.center.lat)}setCenter(s,f){return this.jumpTo({center:s},f)}panBy(s,f,d){return s=u.P.convert(s).mult(-1),this.panTo(this.transform.center,u.e({offset:s},f),d)}panTo(s,f,d){return this.easeTo(u.e({center:s},f),d)}getZoom(){return this.transform.zoom}setZoom(s,f){return this.jumpTo({zoom:s},f),this}zoomTo(s,f,d){return this.easeTo(u.e({zoom:s},f),d)}zoomIn(s,f){return this.zoomTo(this.getZoom()+1,s,f),this}zoomOut(s,f){return this.zoomTo(this.getZoom()-1,s,f),this}getBearing(){return this.transform.bearing}setBearing(s,f){return this.jumpTo({bearing:s},f),this}getPadding(){return this.transform.padding}setPadding(s,f){return this.jumpTo({padding:s},f),this}rotateTo(s,f,d){return this.easeTo(u.e({bearing:s},f),d)}resetNorth(s,f){return this.rotateTo(0,u.e({duration:1e3},s),f),this}resetNorthPitch(s,f){return this.easeTo(u.e({bearing:0,pitch:0,duration:1e3},s),f),this}snapToNorth(s,f){return Math.abs(this.getBearing()){if(this._zooming&&(m.zoom=u.z.number(v,tt,Bt)),this._rotating&&(m.bearing=u.z.number(I,k,Bt)),this._pitching&&(m.pitch=u.z.number(T,z,Bt)),this._padding&&(m.interpolatePadding(M,B,Bt),it=m.centerPoint.add(Z)),this.terrain&&!s.freezeElevation&&this._updateElevation(Bt),wt)m.setLocationAtPoint(wt,Dt);else{const Qt=m.zoomScale(m.zoom-v),Jt=tt>v?Math.min(2,ut):Math.max(.5,ut),ie=Math.pow(Jt,1-Bt),ae=m.unproject(yt.add(kt.mult(Bt*ie)).mult(Qt));m.setLocationAtPoint(m.renderWorldCopies?ae.wrap():ae,it)}this._applyUpdatedTransform(m),this._fireMoveEvents(f)},Bt=>{this.terrain&&this._finalizeElevation(),this._afterEase(f,Bt)},s),this}_prepareEase(s,f,d={}){this._moving=!0,f||d.moving||this.fire(new u.k("movestart",s)),this._zooming&&!d.zooming&&this.fire(new u.k("zoomstart",s)),this._rotating&&!d.rotating&&this.fire(new u.k("rotatestart",s)),this._pitching&&!d.pitching&&this.fire(new u.k("pitchstart",s))}_prepareElevation(s){this._elevationCenter=s,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(s,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(s){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const f=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(s<1&&f!==this._elevationTarget){const d=this._elevationTarget-this._elevationStart;this._elevationStart+=s*(d-(f-(d*s+this._elevationStart))/(1-s)),this._elevationTarget=f}this.transform.elevation=u.z.number(this._elevationStart,this._elevationTarget,s)}_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(s){if(!this.transformCameraUpdate)return;const f=s.clone(),{center:d,zoom:m,pitch:v,bearing:I,elevation:T}=this.transformCameraUpdate(f);d&&(f.center=d),m!==void 0&&(f.zoom=m),v!==void 0&&(f.pitch=v),I!==void 0&&(f.bearing=I),T!==void 0&&(f.elevation=T),this.transform.apply(f)}_fireMoveEvents(s){this.fire(new u.k("move",s)),this._zooming&&this.fire(new u.k("zoom",s)),this._rotating&&this.fire(new u.k("rotate",s)),this._pitching&&this.fire(new u.k("pitch",s))}_afterEase(s,f){if(this._easeId&&f&&this._easeId===f)return;delete this._easeId;const d=this._zooming,m=this._rotating,v=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,d&&this.fire(new u.k("zoomend",s)),m&&this.fire(new u.k("rotateend",s)),v&&this.fire(new u.k("pitchend",s)),this.fire(new u.k("moveend",s))}flyTo(s,f){var d;if(!s.essential&&C.prefersReducedMotion){const bn=u.L(s,["center","zoom","bearing","pitch","around"]);return this.jumpTo(bn,f)}this.stop(),s=u.e({offset:[0,0],speed:1.2,curve:1.42,easing:u.b7},s);const m=this._getTransformForUpdate(),v=this.getZoom(),I=this.getBearing(),T=this.getPitch(),M=this.getPadding(),k="bearing"in s?this._normalizeBearing(s.bearing,I):I,z="pitch"in s?+s.pitch:T,B="padding"in s?s.padding:m.padding,Z=u.P.convert(s.offset);let it=m.centerPoint.add(Z);const rt=m.pointLocation(it),{center:lt,zoom:tt}=m.getConstrained(u.M.convert(s.center||rt),(d=s.zoom)!==null&&d!==void 0?d:v);this._normalizeCenter(lt);const yt=m.zoomScale(tt-v),kt=m.project(rt),ut=m.project(lt).sub(kt);let wt=s.curve;const Dt=Math.max(m.width,m.height),Ot=Dt/yt,Bt=ut.mag();if("minZoom"in s){const bn=u.ac(Math.min(s.minZoom,v,tt),m.minZoom,m.maxZoom),Ue=Dt/m.zoomScale(bn-v);wt=Math.sqrt(Ue/Bt*2)}const Qt=wt*wt;function Jt(bn){const Ue=(Ot*Ot-Dt*Dt+(bn?-1:1)*Qt*Qt*Bt*Bt)/(2*(bn?Ot:Dt)*Qt*Bt);return Math.log(Math.sqrt(Ue*Ue+1)-Ue)}function ie(bn){return(Math.exp(bn)-Math.exp(-bn))/2}function ae(bn){return(Math.exp(bn)+Math.exp(-bn))/2}const Je=Jt(!1);let le=function(bn){return ae(Je)/ae(Je+wt*bn)},Oe=function(bn){return Dt*((ae(Je)*(ie(Ue=Je+wt*bn)/ae(Ue))-ie(Je))/Qt)/Bt;var Ue},Qe=(Jt(!0)-Je)/wt;if(Math.abs(Bt)<1e-6||!isFinite(Qe)){if(Math.abs(Dt-Ot)<1e-6)return this.easeTo(s,f);const bn=Ots.maxDuration&&(s.duration=0),this._zooming=!0,this._rotating=I!==k,this._pitching=z!==T,this._padding=!m.isPaddingEqual(B),this._prepareEase(f,!1),this.terrain&&this._prepareElevation(lt),this._ease(bn=>{const Ue=bn*Qe,rn=1/le(Ue);m.zoom=bn===1?tt:v+m.scaleZoom(rn),this._rotating&&(m.bearing=u.z.number(I,k,bn)),this._pitching&&(m.pitch=u.z.number(T,z,bn)),this._padding&&(m.interpolatePadding(M,B,bn),it=m.centerPoint.add(Z)),this.terrain&&!s.freezeElevation&&this._updateElevation(bn);const an=bn===1?lt:m.unproject(kt.add(ut.mult(Oe(Ue))).mult(rn));m.setLocationAtPoint(m.renderWorldCopies?an.wrap():an,it),this._applyUpdatedTransform(m),this._fireMoveEvents(f)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(f)},s),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(s,f){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,f)}if(!s){const d=this.handlers;d&&d.stop(!1)}return this}_ease(s,f,d){d.animate===!1||d.duration===0?(s(1),f()):(this._easeStart=C.now(),this._easeOptions=d,this._onEaseFrame=s,this._onEaseEnd=f,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(s,f){s=u.b1(s,-180,180);const d=Math.abs(s-f);return Math.abs(s-360-f)180?-360:d<-180?360:0}queryTerrainElevation(s){return this.terrain?this.terrain.getElevationForLngLatZoom(u.M.convert(s),this.transform.tileZoom)-this.transform.elevation:null}}const cp={compact:!0,customAttribution:'MapLibre'};class ds{constructor(s=cp){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=f=>{!f||f.sourceDataType!=="metadata"&&f.sourceDataType!=="visibility"&&f.dataType!=="style"&&f.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=s}getDefaultPosition(){return"bottom-right"}onAdd(s){return this._map=s,this._compact=this.options.compact,this._container=P.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=P.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=P.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(){P.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(s,f){const d=this._map._getUIString(`AttributionControl.${f}`);s.title=d,s.setAttribute("aria-label",d)}_updateAttributions(){if(!this._map.style)return;let s=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?s=s.concat(this.options.customAttribution.map(m=>typeof m!="string"?"":m)):typeof this.options.customAttribution=="string"&&s.push(this.options.customAttribution)),this._map.style.stylesheet){const m=this._map.style.stylesheet;this.styleOwner=m.owner,this.styleId=m.id}const f=this._map.style.sourceCaches;for(const m in f){const v=f[m];if(v.used||v.usedForTerrain){const I=v.getSource();I.attribution&&s.indexOf(I.attribution)<0&&s.push(I.attribution)}}s=s.filter(m=>String(m).trim()),s.sort((m,v)=>m.length-v.length),s=s.filter((m,v)=>{for(let I=v+1;I=0)return!1;return!0});const d=s.join(" | ");d!==this._attribHTML&&(this._attribHTML=d,s.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 wm{constructor(s={}){this._updateCompact=()=>{const f=this._container.children;if(f.length){const d=f[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&d.classList.add("maplibregl-compact"):d.classList.remove("maplibregl-compact")}},this.options=s}getDefaultPosition(){return"bottom-left"}onAdd(s){this._map=s,this._compact=this.options&&this.options.compact,this._container=P.create("div","maplibregl-ctrl");const f=P.create("a","maplibregl-ctrl-logo");return f.target="_blank",f.rel="noopener nofollow",f.href="https://maplibre.org/",f.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),f.setAttribute("rel","noopener nofollow"),this._container.appendChild(f),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){P.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class lc{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(s){const f=++this._id;return this._queue.push({callback:s,id:f,cancelled:!1}),f}remove(s){const f=this._currentlyRunning,d=f?this._queue.concat(f):this._queue;for(const m of d)if(m.id===s)return void(m.cancelled=!0)}run(s=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const f=this._currentlyRunning=this._queue;this._queue=[];for(const d of f)if(!d.cancelled&&(d.callback(s),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var wr=u.X([{name:"a_pos3d",type:"Int16",components:3}]);class zr extends u.E{constructor(s){super(),this.sourceCache=s,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,s.usedForTerrain=!0,s.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(s,f){this.sourceCache.update(s,f),this._renderableTilesKeys=[];const d={};for(const m of s.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:f}))d[m.key]=!0,this._renderableTilesKeys.push(m.key),this._tiles[m.key]||(m.posMatrix=new Float64Array(16),u.aN(m.posMatrix,0,u.W,0,u.W,0,1),this._tiles[m.key]=new Zo(m,this.tileSize));for(const m in this._tiles)d[m]||delete this._tiles[m]}freeRtt(s){for(const f in this._tiles){const d=this._tiles[f];(!s||d.tileID.equals(s)||d.tileID.isChildOf(s)||s.isChildOf(d.tileID))&&(d.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(s=>this.getTileByID(s))}getTileByID(s){return this._tiles[s]}getTerrainCoords(s){const f={};for(const d of this._renderableTilesKeys){const m=this._tiles[d].tileID;if(m.canonical.equals(s.canonical)){const v=s.clone();v.posMatrix=new Float64Array(16),u.aN(v.posMatrix,0,u.W,0,u.W,0,1),f[d]=v}else if(m.canonical.isChildOf(s.canonical)){const v=s.clone();v.posMatrix=new Float64Array(16);const I=m.canonical.z-s.canonical.z,T=m.canonical.x-(m.canonical.x>>I<>I<>I;u.aN(v.posMatrix,0,k,0,k,0,1),u.H(v.posMatrix,v.posMatrix,[-T*k,-M*k,0]),f[d]=v}else if(s.canonical.isChildOf(m.canonical)){const v=s.clone();v.posMatrix=new Float64Array(16);const I=s.canonical.z-m.canonical.z,T=s.canonical.x-(s.canonical.x>>I<>I<>I;u.aN(v.posMatrix,0,u.W,0,u.W,0,1),u.H(v.posMatrix,v.posMatrix,[T*k,M*k,0]),u.J(v.posMatrix,v.posMatrix,[1/2**I,1/2**I,0]),f[d]=v}}return f}getSourceTile(s,f){const d=this.sourceCache._source;let m=s.overscaledZ-this.deltaZoom;if(m>d.maxzoom&&(m=d.maxzoom),m=d.minzoom&&(!v||!v.dem);)v=this.sourceCache.getTileByID(s.scaledTo(m--).key);return v}tilesAfterTime(s=Date.now()){return Object.values(this._tiles).filter(f=>f.timeAdded>=s)}}class Sm{constructor(s,f,d){this.painter=s,this.sourceCache=new zr(f),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(s,f,d,m=u.W){var v;if(!(f>=0&&f=0&&ds.canonical.z&&(s.canonical.z>=m?v=s.canonical.z-m:u.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const I=s.canonical.x-(s.canonical.x>>v<>v<>8<<4|v>>8,f[I+3]=0;const d=new u.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(f.buffer)),m=new $(s,d,s.gl.RGBA,{premultiply:!1});return m.bind(s.gl.NEAREST,s.gl.CLAMP_TO_EDGE),this._coordsTexture=m,m}pointCoordinate(s){this.painter.maybeDrawDepthAndCoords(!0);const f=new Uint8Array(4),d=this.painter.context,m=d.gl,v=Math.round(s.x*this.painter.pixelRatio/devicePixelRatio),I=Math.round(s.y*this.painter.pixelRatio/devicePixelRatio),T=Math.round(this.painter.height/devicePixelRatio);d.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),m.readPixels(v,T-I-1,1,1,m.RGBA,m.UNSIGNED_BYTE,f),d.bindFramebuffer.set(null);const M=f[0]+(f[2]>>4<<8),k=f[1]+((15&f[2])<<8),z=this.coordsIndex[255-f[3]],B=z&&this.sourceCache.getTileByID(z);if(!B)return null;const Z=this._coordsTextureSize,it=(1<s.id!==f),this._recentlyUsed.push(s.id)}stampObject(s){s.stamp=++this._stamp}getOrCreateFreeObject(){for(const f of this._recentlyUsed)if(!this._objects[f].inUse)return this._objects[f];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const s=this._createObject(this._objects.length);return this._objects.push(s),s}freeObject(s){s.inUse=!1}freeAllObjects(){for(const s of this._objects)this.freeObject(s)}isFull(){return!(this._objects.length!s.inUse)===!1}}const pa={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class hp{constructor(s,f){this.painter=s,this.terrain=f,this.pool=new uc(s.context,30,f.sourceCache.tileSize*f.qualityFactor)}destruct(){this.pool.destruct()}getTexture(s){return this.pool.getObjectForId(s.rtt[this._stacks.length-1].id).texture}prepareForRender(s,f){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=s._order.filter(d=>!s._layers[d].isHidden(f)),this._coordsDescendingInv={};for(const d in s.sourceCaches){this._coordsDescendingInv[d]={};const m=s.sourceCaches[d].getVisibleCoordinates();for(const v of m){const I=this.terrain.sourceCache.getTerrainCoords(v);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 s._order){const m=s._layers[d],v=m.source;if(pa[m.type]&&!this._coordsDescendingInvStr[v]){this._coordsDescendingInvStr[v]={};for(const I in this._coordsDescendingInv[v])this._coordsDescendingInvStr[v][I]=this._coordsDescendingInv[v][I].map(T=>T.key).sort().join()}}for(const d of this._renderableTiles)for(const m in this._coordsDescendingInvStr){const v=this._coordsDescendingInvStr[m][d.tileID.key];v&&v!==d.rttCoords[m]&&(d.rtt=[])}}renderLayer(s){if(s.isHidden(this.painter.transform.zoom))return!1;const f=s.type,d=this.painter,m=this._renderableLayerIds[this._renderableLayerIds.length-1]===s.id;if(pa[f]&&(this._prevType&&pa[this._prevType]||this._stacks.push([]),this._prevType=f,this._stacks[this._stacks.length-1].push(s.id),!m))return!0;if(pa[this._prevType]||pa[f]&&m){this._prevType=f;const v=this._stacks.length-1,I=this._stacks[v]||[];for(const T of this._renderableTiles){if(this.pool.isFull()&&(gh(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(T),T.rtt[v]){const k=this.pool.getObjectForId(T.rtt[v].id);if(k.stamp===T.rtt[v].stamp){this.pool.useObject(k);continue}}const M=this.pool.getOrCreateFreeObject();this.pool.useObject(M),this.pool.stampObject(M),T.rtt[v]={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},dp={showCompass:!0,showZoom:!0,visualizePitch:!1};class mp{constructor(s,f,d=!1){this.mousedown=I=>{this.startMouse(u.e({},I,{ctrlKey:!0,preventDefault:()=>I.preventDefault()}),P.mousePos(this.element,I)),P.addEventListener(window,"mousemove",this.mousemove),P.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=I=>{this.moveMouse(I,P.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=P.touchPos(this.element,I.targetTouches)[0],this.startTouch(I,this._startPos),P.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),P.addEventListener(window,"touchend",this.touchend))},this.touchmove=I=>{I.targetTouches.length!==1?this.reset():(this._lastPos=P.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 m=s.dragRotate._mouseRotate.getClickTolerance(),v=s.dragRotate._mousePitch.getClickTolerance();this.element=f,this.mouseRotate=au({clickTolerance:m,enable:!0}),this.touchRotate=(({enable:I,clickTolerance:T,bearingDegreesPerPixelMoved:M=.8})=>{const k=new _e;return new su({clickTolerance:T,move:(z,B)=>({bearingDelta:(B.x-z.x)*M}),moveStateManager:k,enable:I,assignEvents:Sh})})({clickTolerance:m,enable:!0}),this.map=s,d&&(this.mousePitch=lu({clickTolerance:v,enable:!0}),this.touchPitch=(({enable:I,clickTolerance:T,pitchDegreesPerPixelMoved:M=-.5})=>{const k=new _e;return new su({clickTolerance:T,move:(z,B)=>({pitchDelta:(B.y-z.y)*M}),moveStateManager:k,enable:I,assignEvents:Sh})})({clickTolerance:v,enable:!0})),P.addEventListener(f,"mousedown",this.mousedown),P.addEventListener(f,"touchstart",this.touchstart,{passive:!1}),P.addEventListener(f,"touchcancel",this.reset)}startMouse(s,f){this.mouseRotate.dragStart(s,f),this.mousePitch&&this.mousePitch.dragStart(s,f),P.disableDrag()}startTouch(s,f){this.touchRotate.dragStart(s,f),this.touchPitch&&this.touchPitch.dragStart(s,f),P.disableDrag()}moveMouse(s,f){const d=this.map,{bearingDelta:m}=this.mouseRotate.dragMove(s,f)||{};if(m&&d.setBearing(d.getBearing()+m),this.mousePitch){const{pitchDelta:v}=this.mousePitch.dragMove(s,f)||{};v&&d.setPitch(d.getPitch()+v)}}moveTouch(s,f){const d=this.map,{bearingDelta:m}=this.touchRotate.dragMove(s,f)||{};if(m&&d.setBearing(d.getBearing()+m),this.touchPitch){const{pitchDelta:v}=this.touchPitch.dragMove(s,f)||{};v&&d.setPitch(d.getPitch()+v)}}off(){const s=this.element;P.removeEventListener(s,"mousedown",this.mousedown),P.removeEventListener(s,"touchstart",this.touchstart,{passive:!1}),P.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),P.removeEventListener(window,"touchend",this.touchend),P.removeEventListener(s,"touchcancel",this.reset),this.offTemp()}offTemp(){P.enableDrag(),P.removeEventListener(window,"mousemove",this.mousemove),P.removeEventListener(window,"mouseup",this.mouseup),P.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),P.removeEventListener(window,"touchend",this.touchend)}}let da;function Eh(_,s,f){const d=new u.M(_.lng,_.lat);if(_=new u.M(_.lng,_.lat),s){const m=new u.M(_.lng-360,_.lat),v=new u.M(_.lng+360,_.lat),I=f.locationPoint(_).distSqr(s);f.locationPoint(m).distSqr(s)180;){const m=f.locationPoint(_);if(m.x>=0&&m.y>=0&&m.x<=f.width&&m.y<=f.height)break;_.lng>f.center.lng?_.lng-=360:_.lng+=360}return _.lng!==d.lng&&f.locationPoint(_).y>f.height/2-f.getHorizon()?_:d}const hc={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 Ih(_,s,f){const d=_.classList;for(const m in hc)d.remove(`maplibregl-${f}-anchor-${m}`);d.add(`maplibregl-${f}-anchor-${s}`)}class fc extends u.E{constructor(s){if(super(),this._onKeyPress=f=>{const d=f.code,m=f.charCode||f.keyCode;d!=="Space"&&d!=="Enter"&&m!==32&&m!==13||this.togglePopup()},this._onMapClick=f=>{const d=f.originalEvent.target,m=this._element;this._popup&&(d===m||m.contains(d))&&this.togglePopup()},this._update=f=>{var d;if(!this._map)return;const m=this._map.loaded()&&!this._map.isMoving();((f==null?void 0:f.type)==="terrain"||(f==null?void 0:f.type)==="render"&&!m)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Eh(this._lngLat,this._flatPos,this._map.transform):(d=this._lngLat)===null||d===void 0?void 0:d.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let v="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?v=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(v=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let I="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?I="rotateX(0deg)":this._pitchAlignment==="map"&&(I=`rotateX(${this._map.getPitch()}deg)`),f&&f.type!=="moveend"||(this._pos=this._pos.round()),P.setTransform(this._element,`${hc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${I} ${v}`),C.frameAsync(new AbortController).then(()=>{this._updateOpacity(f&&f.type==="moveend")}).catch(()=>{})},this._onMove=f=>{if(!this._isDragging){const d=this._clickTolerance||this._map._clickTolerance;this._isDragging=f.point.dist(this._pointerdownPos)>=d}this._isDragging&&(this._pos=f.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=f=>{this._element.contains(f.originalEvent.target)&&(f.preventDefault(),this._positionDelta=f.point.sub(this._pos).add(this._offset),this._pointerdownPos=f.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=s&&s.anchor||"center",this._color=s&&s.color||"#3FB1CE",this._scale=s&&s.scale||1,this._draggable=s&&s.draggable||!1,this._clickTolerance=s&&s.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=s&&s.rotation||0,this._rotationAlignment=s&&s.rotationAlignment||"auto",this._pitchAlignment=s&&s.pitchAlignment&&s.pitchAlignment!=="auto"?s.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(s==null?void 0:s.opacity,s==null?void 0:s.opacityWhenCovered),s&&s.element)this._element=s.element,this._offset=u.P.convert(s&&s.offset||[0,0]);else{this._defaultMarker=!0,this._element=P.create("div"),this._element.setAttribute("aria-label","Map marker");const f=P.createNS("http://www.w3.org/2000/svg","svg"),d=41,m=27;f.setAttributeNS(null,"display","block"),f.setAttributeNS(null,"height",`${d}px`),f.setAttributeNS(null,"width",`${m}px`),f.setAttributeNS(null,"viewBox",`0 0 ${m} ${d}`);const v=P.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"stroke","none"),v.setAttributeNS(null,"stroke-width","1"),v.setAttributeNS(null,"fill","none"),v.setAttributeNS(null,"fill-rule","evenodd");const I=P.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"fill-rule","nonzero");const T=P.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 yt of M){const kt=P.createNS("http://www.w3.org/2000/svg","ellipse");kt.setAttributeNS(null,"opacity","0.04"),kt.setAttributeNS(null,"cx","10.5"),kt.setAttributeNS(null,"cy","5.80029008"),kt.setAttributeNS(null,"rx",yt.rx),kt.setAttributeNS(null,"ry",yt.ry),T.appendChild(kt)}const k=P.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"fill",this._color);const z=P.createNS("http://www.w3.org/2000/svg","path");z.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(z);const B=P.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"opacity","0.25"),B.setAttributeNS(null,"fill","#000000");const Z=P.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"),B.appendChild(Z);const it=P.createNS("http://www.w3.org/2000/svg","g");it.setAttributeNS(null,"transform","translate(6.0, 7.0)"),it.setAttributeNS(null,"fill","#FFFFFF");const rt=P.createNS("http://www.w3.org/2000/svg","g");rt.setAttributeNS(null,"transform","translate(8.0, 8.0)");const lt=P.createNS("http://www.w3.org/2000/svg","circle");lt.setAttributeNS(null,"fill","#000000"),lt.setAttributeNS(null,"opacity","0.25"),lt.setAttributeNS(null,"cx","5.5"),lt.setAttributeNS(null,"cy","5.5"),lt.setAttributeNS(null,"r","5.4999962");const tt=P.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"),rt.appendChild(lt),rt.appendChild(tt),I.appendChild(T),I.appendChild(k),I.appendChild(B),I.appendChild(it),I.appendChild(rt),f.appendChild(I),f.setAttributeNS(null,"height",d*this._scale+"px"),f.setAttributeNS(null,"width",m*this._scale+"px"),this._element.appendChild(f),this._offset=u.P.convert(s&&s.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",f=>{f.preventDefault()}),this._element.addEventListener("mousedown",f=>{f.preventDefault()}),Ih(this._element,this._anchor,"marker"),s&&s.className)for(const f of s.className.split(" "))this._element.classList.add(f);this._popup=null}addTo(s){return this.remove(),this._map=s,s.getCanvasContainer().appendChild(this._element),s.on("move",this._update),s.on("moveend",this._update),s.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),P.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(s){return this._lngLat=u.M.convert(s),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(s){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),s){if(!("offset"in s.options)){const m=Math.abs(13.5)/Math.SQRT2;s.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[m,-1*(38.1-13.5+m)],"bottom-right":[-m,-1*(38.1-13.5+m)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=s,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 s=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:s?(s.isOpen()?s.remove():(s.setLngLat(this._lngLat),s.addTo(this._map)),this):this}_updateOpacity(s=!1){var f,d;if(!(!((f=this._map)===null||f===void 0)&&f.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(s)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const m=this._map,v=m.terrain.depthAtPoint(this._pos),I=m.terrain.getElevationForLngLatZoom(this._lngLat,m.transform.tileZoom);if(m.transform.lngLatToCameraDepth(this._lngLat,I)-v<.006)return void(this._element.style.opacity=this._opacity);const T=-this._offset.y/m.transform._pixelPerMeter,M=Math.sin(m.getPitch()*Math.PI/180)*T,k=m.terrain.depthAtPoint(new u.P(this._pos.x,this._pos.y-this._offset.y)),z=m.transform.lngLatToCameraDepth(this._lngLat,I+M)-k>.006;!((d=this._popup)===null||d===void 0)&&d.isOpen()&&z&&this._popup.remove(),this._element.style.opacity=z?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(s){return this._offset=u.P.convert(s),this._update(),this}addClassName(s){this._element.classList.add(s)}removeClassName(s){this._element.classList.remove(s)}toggleClassName(s){return this._element.classList.toggle(s)}setDraggable(s){return this._draggable=!!s,this._map&&(s?(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(s){return this._rotation=s||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(s){return this._rotationAlignment=s||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(s){return this._pitchAlignment=s&&s!=="auto"?s:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(s,f){return s===void 0&&f===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),s!==void 0&&(this._opacity=s),f!==void 0&&(this._opacityWhenCovered=f),this._map&&this._updateOpacity(!0),this}}const Ch={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let cu=0,El=!1;const Th={maxWidth:100,unit:"metric"};function Lh(_,s,f){const d=f&&f.maxWidth||100,m=_._container.clientHeight/2,v=_.unproject([0,m]),I=_.unproject([d,m]),T=v.distanceTo(I);if(f&&f.unit==="imperial"){const M=3.2808*T;M>5280?Il(s,d,M/5280,_._getUIString("ScaleControl.Miles")):Il(s,d,M,_._getUIString("ScaleControl.Feet"))}else f&&f.unit==="nautical"?Il(s,d,T/1852,_._getUIString("ScaleControl.NauticalMiles")):T>=1e3?Il(s,d,T/1e3,_._getUIString("ScaleControl.Kilometers")):Il(s,d,T,_._getUIString("ScaleControl.Meters"))}function Il(_,s,f,d){const m=function(v){const I=Math.pow(10,`${Math.floor(v)}`.length-1);let T=v/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}(f);_.style.width=s*(m/f)+"px",_.innerHTML=`${m} ${d}`}const gp={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},yp=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Ph(_){if(_){if(typeof _=="number"){const s=Math.round(Math.abs(_)/Math.SQRT2);return{center:new u.P(0,0),top:new u.P(0,_),"top-left":new u.P(s,s),"top-right":new u.P(-s,s),bottom:new u.P(0,-_),"bottom-left":new u.P(s,-s),"bottom-right":new u.P(-s,-s),left:new u.P(_,0),right:new u.P(-_,0)}}if(_ instanceof u.P||Array.isArray(_)){const s=u.P.convert(_);return{center:s,top:s,"top-left":s,"top-right":s,bottom:s,"bottom-left":s,"bottom-right":s,left:s,right:s}}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 Ph(new u.P(0,0))}const Em=y;h.AJAXError=u.be,h.Evented=u.E,h.LngLat=u.M,h.MercatorCoordinate=u.Y,h.Point=u.P,h.addProtocol=u.bf,h.config=u.a,h.removeProtocol=u.bg,h.AttributionControl=ds,h.BoxZoomHandler=fs,h.CanvasSource=us,h.CooperativeGesturesHandler=Ie,h.DoubleClickZoomHandler=lp,h.DragPanHandler=xm,h.DragRotateHandler=ps,h.EdgeInsets=iu,h.FullscreenControl=class extends u.E{constructor(_={}){super(),this._onFullscreenChange=()=>{var s;let f=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((s=f==null?void 0:f.shadowRoot)===null||s===void 0)&&s.fullscreenElement;)f=f.shadowRoot.fullscreenElement;f===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=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){P.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const _=this._fullscreenButton=P.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);P.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()}},h.GeoJSONSource=Pr,h.GeolocateControl=class extends u.E{constructor(_){super(),this._onSuccess=s=>{if(this._map){if(this._isOutOfMapMaxBounds(s))return this._setErrorState(),this.fire(new u.k("outofmaxbounds",s)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=s,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(s),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(s),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new u.k("geolocate",s)),this._finish()}},this._updateCamera=s=>{const f=new u.M(s.coords.longitude,s.coords.latitude),d=s.coords.accuracy,m=this._map.getBearing(),v=u.e({bearing:m},this.options.fitBoundsOptions),I=St.fromLngLat(f,d);this._map.fitBounds(I,v,{geolocateSource:!0})},this._updateMarker=s=>{if(s){const f=new u.M(s.coords.longitude,s.coords.latitude);this._accuracyCircleMarker.setLngLat(f).addTo(this._map),this._userLocationDotMarker.setLngLat(f).addTo(this._map),this._accuracy=s.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=s=>{if(this._map){if(this.options.trackUserLocation)if(s.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 f=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(s.code===3&&El)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new u.k("error",s)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=s=>{if(this._map){if(this._container.addEventListener("contextmenu",f=>f.preventDefault()),this._geolocateButton=P.create("button","maplibregl-ctrl-geolocate",this._container),P.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",s===!1){u.w("Geolocation support is not available so the GeolocateControl will be disabled.");const f=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}else{const f=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=P.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new fc({element:this._dotElement}),this._circleElement=P.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new fc({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",f=>{f.geolocateSource||this._watchState!=="ACTIVE_LOCK"||f.originalEvent&&f.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({},Ch,_)}onAdd(_){return this._map=_,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(){return u._(this,arguments,void 0,function*(s=!1){if(da!==void 0&&!s)return da;if(window.navigator.permissions===void 0)return da=!!window.navigator.geolocation,da;try{da=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{da=!!window.navigator.geolocation}return da})}().then(s=>this._setupUI(s)),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(),P.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,cu=0,El=!1}_isOutOfMapMaxBounds(_){const s=this._map.getMaxBounds(),f=_.coords;return s&&(f.longitudes.getEast()||f.latitudes.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(),s=_.getSouthEast(),f=_.getNorthEast(),d=s.distanceTo(f),m=Math.ceil(this._accuracy/(d/this._map._container.clientHeight)*2);this._circleElement.style.width=`${m}px`,this._circleElement.style.height=`${m}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":cu--,El=!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"),cu++,cu>1?(_={maximumAge:6e5,timeout:0},El=!0):(_=this.options.positionOptions,El=!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)}},h.Hash=ip,h.ImageSource=Hn,h.KeyboardHandler=Ua,h.LngLatBounds=St,h.LogoControl=wm,h.Map=class extends co{constructor(_){if(u.bc.mark(u.bd.create),(_=u.e({},cc,_)).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 yh(_.minZoom,_.maxZoom,_.minPitch,_.maxPitch,_.renderWorldCopies),{bearingSnap:_.bearingSnap}),this._contextLost=s=>{s.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new u.k("webglcontextlost",{originalEvent:s}))},this._contextRestored=s=>{this._setupPainter(),this.resize(),this._update(),this.fire(new u.k("webglcontextrestored",{originalEvent:s}))},this._onMapScroll=s=>{if(s.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 lc,this._controls=[],this._mapId=u.a3(),this._locale=u.e({},fp,_.locale),this._clickTolerance=_.clickTolerance,this._overridePixelRatio=_.pixelRatio,this._maxCanvasSize=_.maxCanvasSize,this.transformCameraUpdate=_.transformCameraUpdate,this._imageQueueHandle=G.addThrottleControl(()=>this.isMoving()),this._requestManager=new q(_.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 s=!1;const f=rp(d=>{this._trackResize&&!this._removed&&this.resize(d)._update()},50);this._resizeObserver=new ResizeObserver(d=>{s?f(d):s=!0}),this._resizeObserver.observe(this._container)}this.handlers=new up(this,_),this._hash=_.hash&&new ip(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 ds(typeof _.attributionControl=="boolean"?void 0:_.attributionControl)),_.maplibreLogo&&this.addControl(new wm,_.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",s=>{this._update(s.dataType==="style"),this.fire(new u.k(`${s.dataType}data`,s))}),this.on("dataloading",s=>{this.fire(new u.k(`${s.dataType}dataloading`,s))}),this.on("dataabort",s=>{this.fire(new u.k("sourcedataabort",s))})}_getMapId(){return this._mapId}addControl(_,s){if(s===void 0&&(s=_.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 f=_.onAdd(this);this._controls.push(_);const d=this._controlPositions[s];return s.indexOf("bottom")!==-1?d.insertBefore(f,d.firstChild):d.appendChild(f),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 s=this._controls.indexOf(_);return s>-1&&this._controls.splice(s,1),_.onRemove(this),this}hasControl(_){return this._controls.indexOf(_)>-1}calculateCameraOptionsFromTo(_,s,f,d){return d==null&&this.terrain&&(d=this.terrain.getElevationForLngLatZoom(f,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(_,s,f,d)}resize(_){var s;const f=this._containerDimensions(),d=f[0],m=f[1],v=this._getClampedPixelRatio(d,m);if(this._resizeCanvas(d,m,v),this.painter.resize(d,m,v),this.painter.overLimit()){const T=this.painter.context.gl;this._maxCanvasSize=[T.drawingBufferWidth,T.drawingBufferHeight];const M=this._getClampedPixelRatio(d,m);this._resizeCanvas(d,m,M),this.painter.resize(d,m,M)}this.transform.resize(d,m),(s=this._requestedCameraState)===null||s===void 0||s.resize(d,m);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(_,s){const{0:f,1:d}=this._maxCanvasSize,m=this.getPixelRatio(),v=_*m,I=s*m;return Math.min(v>f?f/v:1,I>d?d/I:1)*m}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(St.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(_,s,f){if(_==="mouseenter"||_==="mouseover"){let d=!1;return{layer:s,listener:f,delegates:{mousemove:v=>{const I=this.getLayer(s)?this.queryRenderedFeatures(v.point,{layers:[s]}):[];I.length?d||(d=!0,f.call(this,new uo(_,this,v.originalEvent,{features:I}))):d=!1},mouseout:()=>{d=!1}}}}if(_==="mouseleave"||_==="mouseout"){let d=!1;return{layer:s,listener:f,delegates:{mousemove:I=>{(this.getLayer(s)?this.queryRenderedFeatures(I.point,{layers:[s]}):[]).length?d=!0:d&&(d=!1,f.call(this,new uo(_,this,I.originalEvent)))},mouseout:I=>{d&&(d=!1,f.call(this,new uo(_,this,I.originalEvent)))}}}}{const d=m=>{const v=this.getLayer(s)?this.queryRenderedFeatures(m.point,{layers:[s]}):[];v.length&&(m.features=v,f.call(this,m),delete m.features)};return{layer:s,listener:f,delegates:{[_]:d}}}}on(_,s,f){if(f===void 0)return super.on(_,s);const d=this._createDelegatedListener(_,s,f);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[_]=this._delegatedListeners[_]||[],this._delegatedListeners[_].push(d);for(const m in d.delegates)this.on(m,d.delegates[m]);return this}once(_,s,f){if(f===void 0)return super.once(_,s);const d=this._createDelegatedListener(_,s,f);for(const m in d.delegates)this.once(m,d.delegates[m]);return this}off(_,s,f){return f===void 0?super.off(_,s):(this._delegatedListeners&&this._delegatedListeners[_]&&(d=>{const m=this._delegatedListeners[_];for(let v=0;vthis._updateStyle(_,s));const f=this.style&&s.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!_)),_?(this.style=new Po(this,s||{}),this.style.setEventedParent(this,{style:this.style}),typeof _=="string"?this.style.loadURL(_,s,f):this.style.loadJSON(_,s,f),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Po(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(_,s){if(typeof _=="string"){const f=this._requestManager.transformRequest(_,"Style");u.h(f,new AbortController).then(d=>{this._updateDiff(d.data,s)}).catch(d=>{d&&this.fire(new u.j(d))})}else typeof _=="object"&&this._updateDiff(_,s)}_updateDiff(_,s){try{this.style.setState(_,s)&&this._update(!0)}catch(f){u.w(`Unable to perform style diff: ${f.message||f.error||f}. Rebuilding the style from scratch.`),this._updateStyle(_,s)}}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(_,s){return this._lazyInitEmptyStyle(),this.style.addSource(_,s),this._update(!0)}isSourceLoaded(_){const s=this.style&&this.style.sourceCaches[_];if(s!==void 0)return s.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 s=this.style.sourceCaches[_.source];if(!s)throw new Error(`cannot load terrain, because there exists no source with ID: ${_.source}`);this.terrain===null&&s.reload();for(const f in this.style._layers){const d=this.style._layers[f];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 Sm(this.painter,s,_),this.painter.renderToTexture=new hp(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=f=>{f.dataType==="style"?this.terrain.sourceCache.freeRtt():f.dataType==="source"&&f.tile&&(f.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(f.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 _,s;return(s=(_=this.terrain)===null||_===void 0?void 0:_.options)!==null&&s!==void 0?s:null}areTilesLoaded(){const _=this.style&&this.style.sourceCaches;for(const s in _){const f=_[s]._tiles;for(const d in f){const m=f[d];if(m.state!=="loaded"&&m.state!=="errored")return!1}}return!0}removeSource(_){return this.style.removeSource(_),this._update(!0)}getSource(_){return this.style.getSource(_)}addImage(_,s,f={}){const{pixelRatio:d=1,sdf:m=!1,stretchX:v,stretchY:I,content:T}=f;if(this._lazyInitEmptyStyle(),!(s instanceof HTMLImageElement||u.b(s))){if(s.width===void 0||s.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:z}=s,B=s;return this.style.addImage(_,{data:new u.R({width:M,height:k},new Uint8Array(z)),pixelRatio:d,stretchX:v,stretchY:I,content:T,sdf:m,version:0,userImage:B}),B.onAdd&&B.onAdd(this,_),this}}{const{width:M,height:k,data:z}=C.getImageData(s);this.style.addImage(_,{data:new u.R({width:M,height:k},z),pixelRatio:d,stretchX:v,stretchY:I,content:T,sdf:m,version:0})}}updateImage(_,s){const f=this.style.getImage(_);if(!f)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=s instanceof HTMLImageElement||u.b(s)?C.getImageData(s):s,{width:m,height:v,data:I}=d;if(m===void 0||v===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(m!==f.data.width||v!==f.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=!(s instanceof HTMLImageElement||u.b(s));return f.data.replace(I,T),this.style.updateImage(_,f),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(_,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(_,s){return this._lazyInitEmptyStyle(),this.style.addLayer(_,s),this._update(!0)}moveLayer(_,s){return this.style.moveLayer(_,s),this._update(!0)}removeLayer(_){return this.style.removeLayer(_),this._update(!0)}getLayer(_){return this.style.getLayer(_)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(_,s,f){return this.style.setLayerZoomRange(_,s,f),this._update(!0)}setFilter(_,s,f={}){return this.style.setFilter(_,s,f),this._update(!0)}getFilter(_){return this.style.getFilter(_)}setPaintProperty(_,s,f,d={}){return this.style.setPaintProperty(_,s,f,d),this._update(!0)}getPaintProperty(_,s){return this.style.getPaintProperty(_,s)}setLayoutProperty(_,s,f,d={}){return this.style.setLayoutProperty(_,s,f,d),this._update(!0)}getLayoutProperty(_,s){return this.style.getLayoutProperty(_,s)}setGlyphs(_,s={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(_,s),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(_,s,f={}){return this._lazyInitEmptyStyle(),this.style.addSprite(_,s,f,d=>{d||this._update(!0)}),this}removeSprite(_){return this._lazyInitEmptyStyle(),this.style.removeSprite(_),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(_,s={}){return this._lazyInitEmptyStyle(),this.style.setSprite(_,s,f=>{f||this._update(!0)}),this}setLight(_,s={}){return this._lazyInitEmptyStyle(),this.style.setLight(_,s),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(_,s){return this.style.setFeatureState(_,s),this._update()}removeFeatureState(_,s){return this.style.removeFeatureState(_,s),this._update()}getFeatureState(_){return this.style.getFeatureState(_)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let _=0,s=0;return this._container&&(_=this._container.clientWidth||400,s=this._container.clientHeight||300),[_,s]}_setupContainer(){const _=this._container;_.classList.add("maplibregl-map");const s=this._canvasContainer=P.create("div","maplibregl-canvas-container",_);this._interactive&&s.classList.add("maplibregl-interactive"),this._canvas=P.create("canvas","maplibregl-canvas",s),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 f=this._containerDimensions(),d=this._getClampedPixelRatio(f[0],f[1]);this._resizeCanvas(f[0],f[1],d);const m=this._controlContainer=P.create("div","maplibregl-control-container",_),v=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(I=>{v[I]=P.create("div",`maplibregl-ctrl-${I} `,m)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(_,s,f){this._canvas.width=Math.floor(f*_),this._canvas.height=Math.floor(f*s),this._canvas.style.width=`${_}px`,this._canvas.style.height=`${s}px`}_setupPainter(){const _={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let s=null;this._canvas.addEventListener("webglcontextcreationerror",d=>{s={requestedAttributes:_},d&&(s.statusMessage=d.statusMessage,s.type=d.type)},{once:!0});const f=this._canvas.getContext("webgl2",_)||this._canvas.getContext("webgl",_);if(!f){const d="Failed to initialize WebGL";throw s?(s.message=d,new Error(JSON.stringify(s))):new Error(d)}this.painter=new cm(f,this.transform),F.testSupport(f)}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 s=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(_),this._removed)return;let f=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const m=this.transform.zoom,v=C.now();this.style.zoomHistory.update(m,v);const I=new u.a8(m,{now:v,fadeDuration:s,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),T=I.crossFadingFactor();T===1&&T===this._crossFadingFactor||(f=!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,s,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,showPadding:this.showPadding}),this.fire(new u.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,u.bc.mark(u.bd.load),this.fire(new u.k("load"))),this.style&&(this.style.hasTransitions()||f)&&(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.bc.mark(u.bd.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 f of this._controls)f.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 s=this.painter.context.gl.getExtension("WEBGL_lose_context");s&&s.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),P.remove(this._canvasContainer),P.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),u.bc.clearMetrics(),this._removed=!0,this.fire(new u.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,C.frameAsync(this._frameRequest).then(_=>{u.bc.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 pp}getCameraTargetElevation(){return this.transform.elevation}},h.MapMouseEvent=uo,h.MapTouchEvent=Os,h.MapWheelEvent=op,h.Marker=fc,h.NavigationControl=class{constructor(_){this._updateZoomButtons=()=>{const s=this._map.getZoom(),f=s===this._map.getMaxZoom(),d=s===this._map.getMinZoom();this._zoomInButton.disabled=f,this._zoomOutButton.disabled=d,this._zoomInButton.setAttribute("aria-disabled",f.toString()),this._zoomOutButton.setAttribute("aria-disabled",d.toString())},this._rotateCompassArrow=()=>{const s=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=s},this._setButtonTitle=(s,f)=>{const d=this._map._getUIString(`NavigationControl.${f}`);s.title=d,s.setAttribute("aria-label",d)},this.options=u.e({},dp,_),this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",s=>s.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",s=>this._map.zoomIn({},{originalEvent:s})),P.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",s=>this._map.zoomOut({},{originalEvent:s})),P.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",s=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:s}):this._map.resetNorth({},{originalEvent:s})}),this._compassIcon=P.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 mp(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){P.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(_,s){const f=P.create("button",_,this._container);return f.type="button",f.addEventListener("click",s),f}},h.Popup=class extends u.E{constructor(_){super(),this.remove=()=>(this._content&&P.remove(this._content),this._container&&(P.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=s=>{this._update(s.point)},this._onMouseMove=s=>{this._update(s.point)},this._onDrag=s=>{this._update(s.point)},this._update=s=>{var f;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=P.create("div","maplibregl-popup",this._map.getContainer()),this._tip=P.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const T of this.options.className.split(" "))this._container.classList.add(T);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._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Eh(this._lngLat,this._flatPos,this._map.transform):(f=this._lngLat)===null||f===void 0?void 0:f.wrap(),this._trackPointer&&!s)return;const d=this._flatPos=this._pos=this._trackPointer&&s?s:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&s?s:this._map.transform.locationPoint(this._lngLat));let m=this.options.anchor;const v=Ph(this.options.offset);if(!m){const T=this._container.offsetWidth,M=this._container.offsetHeight;let k;k=d.y+v.bottom.ythis._map.transform.height-M?["bottom"]:[],d.xthis._map.transform.width-T/2&&k.push("right"),m=k.length===0?"bottom":k.join("-")}let I=d.add(v[m]);this.options.subpixelPositioning||(I=I.round()),P.setTransform(this._container,`${hc[m]} translate(${I.x}px,${I.y}px)`),Ih(this._container,m,"popup")},this._onClose=()=>{this.remove()},this.options=u.e(Object.create(gp),_)}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._flatPos=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._flatPos=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 s=document.createDocumentFragment(),f=document.createElement("body");let d;for(f.innerHTML=_;d=f.firstChild,d;)s.appendChild(d);return this.setDOMContent(s)}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=P.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(_)}setSubpixelPositioning(_){this.options.subpixelPositioning=_}_createCloseButton(){this.options.closeButton&&(this._closeButton=P.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(yp);_&&_.focus()}},h.RasterDEMTileSource=Ze,h.RasterTileSource=Mt,h.ScaleControl=class{constructor(_){this._onMove=()=>{Lh(this._map,this._container,this.options)},this.setUnit=s=>{this.options.unit=s,Lh(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Th),_)}getDefaultPosition(){return"bottom-left"}onAdd(_){return this._map=_,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-scale",_.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){P.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},h.ScrollZoomHandler=xh,h.Style=Po,h.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=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=P.create("button","maplibregl-ctrl-terrain",this._container),P.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(){P.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},h.TwoFingersTouchPitchHandler=_m,h.TwoFingersTouchRotateHandler=ap,h.TwoFingersTouchZoomHandler=ym,h.TwoFingersTouchZoomRotateHandler=sc,h.VectorTileSource=An,h.VideoSource=To,h.addSourceType=(_,s)=>u._(void 0,void 0,void 0,function*(){if(Na(_))throw new Error(`A source type called "${_}" already exists.`);((f,d)=>{Ds[f]=d})(_,s)}),h.clearPrewarmedResources=function(){const _=dn;_&&(_.isPreloaded()&&_.numActive()===1?(_.release(Ee),dn=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()"))},h.getMaxParallelImageRequests=function(){return u.a.MAX_PARALLEL_IMAGE_REQUESTS},h.getRTLTextPluginStatus=function(){return ee().getRTLTextPluginStatus()},h.getVersion=function(){return Em},h.getWorkerCount=function(){return sn.workerCount},h.getWorkerUrl=function(){return u.a.WORKER_URL},h.importScriptInWorkers=function(_){return Lr().broadcast("IS",_)},h.prewarm=function(){Mn().acquire(Ee)},h.setMaxParallelImageRequests=function(_){u.a.MAX_PARALLEL_IMAGE_REQUESTS=_},h.setRTLTextPlugin=function(_,s){return ee().setRTLTextPlugin(_,s)},h.setWorkerCount=function(_){sn.workerCount=_},h.setWorkerUrl=function(_){u.a.WORKER_URL=_}});var l=n;return l})})(aS);var pL=aS.exports;const bs=tv(pL);function Tb(e){let t;return n=>{if(n)for(let r in n){let o=t==null?void 0:t[r],l=n[r];o!==l&&e(r,l,o)}else if(t)for(let r in t)e(r,void 0,t[r]);t=n}}function dL(e,...t){let n=[e];for(let r of t)if(r)Array.isArray(r)&&r[0]===e?n.push(...r.slice(1)):n.push(r);else continue;if(n.length!==1)return n.length===2?n[1]:n}function mL(e){return e===!0?["has","point_count"]:e===!1?["!",["has","point_count"]]:void 0}function Lb(e,t){return["case",["boolean",["feature-state","hover"],!1],t,e]}var Sc=gL;function gL(e){var t,n,r;if(e){if(Array.isArray(e)){for(t=[],n=e.length,r=0;r{r=null}),ar())},i(o){n||(Rt(r),n=!0)},o(o){Zt(r),n=!1},d(o){o&&Vt(t),r&&r.d(o)}}}function _L(e,t,n){let r,o,l,h,u,y,w,S,C,P,F,R,{$$slots:Y={},$$scope:J}=t,{id:K=Jg("layer")}=t,{source:O=void 0}=t,{sourceLayer:G=void 0}=t,{beforeId:q=void 0}=t,{beforeLayerType:ot=void 0}=t,{type:_t}=t,{paint:ft=void 0}=t,{layout:ct=void 0}=t,{filter:ht=void 0}=t,{applyToClusters:Pt=void 0}=t,{minzoom:$=void 0}=t,{maxzoom:Lt=void 0}=t,{manageHoverState:$t=!1}=t,{hovered:Ct=null}=t,{interactive:re=!0}=t,{hoverCursor:pe=void 0}=t,{eventsIfTopMost:qt=!1}=t;const Ne=Vu(),{map:Ce,source:pn,self:Ve,minzoom:Ee,maxzoom:sn,eventTopMost:En,layerInfo:dn}=hL();qe(e,Ce,mt=>n(31,C=mt)),qe(e,pn,mt=>n(32,P=mt)),qe(e,Ve,mt=>n(0,S=mt)),qe(e,Ee,mt=>n(34,R=mt)),qe(e,sn,mt=>n(33,F=mt)),Ss(()=>{S&&C&&(dn.delete(S),C==null||C.removeLayer(S))});let mn;function Mn(mt){var Mt,Ze;if(!re||!S||!C||qt&&En(mt)!==S)return;let St=mt.features??[],be=(Ze=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:Ze.cluster_id,An={event:mt,map:C,clusterId:be,layer:S,source:u,features:St};Ne(mt.type,An)}function _r(mt){var Mt,Ze;if(!re||!S||!C||qt&&En(mt)!==S)return;pe&&(C.getCanvas().style.cursor=pe);let St=mt.features??[];n(6,Ct=St[0]??null);let be=(Ze=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:Ze.cluster_id;Ne("mouseenter",{event:mt,map:C,clusterId:be,layer:S,source:u,features:St})}function Lr(mt){var Mt,Ze,Pr;if(!re||!C)return;if(qt&&En(mt)!==S){n(6,Ct=null),$t&&mn!==void 0&&(C==null||C.setFeatureState({source:u,sourceLayer:G,id:mn},{hover:!1}),mn=void 0);return}C.getCanvas().style.cursor=pe;let St=mt.features??[],be=(Ze=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:Ze.cluster_id,An=(Pr=St[0])==null?void 0:Pr.id;An!==mn&&($t&&(mn!==void 0&&(C==null||C.setFeatureState({source:u,id:mn,sourceLayer:G},{hover:!1})),C==null||C.setFeatureState({source:u,id:An,sourceLayer:G},{hover:!0})),mn=An,n(6,Ct=St[0]??null)),Ne("mousemove",{event:mt,map:C,clusterId:be,layer:S,source:u,features:St})}function vr(mt){if(!(!re||!S||!C)){if(pe&&(C.getCanvas().style.cursor=""),n(6,Ct=null),$t&&mn!==void 0){const St={source:u,id:mn,sourceLayer:G};C==null||C.setFeatureState(St,{hover:!1}),mn=void 0}Ne("mouseleave",{map:C,layer:S,source:u})}}let cr=!0;function Kt(mt){C&&(C.off("click",mt,Mn),C.off("dblclick",mt,Mn),C.off("contextmenu",mt,Mn),C.off("mouseenter",mt,_r),C.off("mousemove",mt,Lr),C.off("mouseleave",mt,vr))}return Ss(()=>{C&&S&&Kt(S)}),e.$$set=mt=>{"id"in mt&&n(7,K=mt.id),"source"in mt&&n(8,O=mt.source),"sourceLayer"in mt&&n(9,G=mt.sourceLayer),"beforeId"in mt&&n(10,q=mt.beforeId),"beforeLayerType"in mt&&n(11,ot=mt.beforeLayerType),"type"in mt&&n(12,_t=mt.type),"paint"in mt&&n(13,ft=mt.paint),"layout"in mt&&n(14,ct=mt.layout),"filter"in mt&&n(15,ht=mt.filter),"applyToClusters"in mt&&n(16,Pt=mt.applyToClusters),"minzoom"in mt&&n(17,$=mt.minzoom),"maxzoom"in mt&&n(18,Lt=mt.maxzoom),"manageHoverState"in mt&&n(19,$t=mt.manageHoverState),"hovered"in mt&&n(6,Ct=mt.hovered),"interactive"in mt&&n(20,re=mt.interactive),"hoverCursor"in mt&&n(21,pe=mt.hoverCursor),"eventsIfTopMost"in mt&&n(22,qt=mt.eventsIfTopMost),"$$scope"in mt&&n(35,J=mt.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&65536&&n(30,r=mL(Pt)),e.$$.dirty[0]&1073774592&&n(24,o=dL("all",r,ht)),e.$$.dirty[0]&131072|e.$$.dirty[1]&8&&n(26,l=$??R),e.$$.dirty[0]&262144|e.$$.dirty[1]&4&&n(25,h=Lt??F),e.$$.dirty[0]&256|e.$$.dirty[1]&2&&n(29,u=O||P),e.$$.dirty[0]&654343809|e.$$.dirty[1]&1&&C&&S!==K&&u){S&&(Kt(S),dn.delete(S));let mt=q;if(!q&&ot){let St=C.getStyle().layers,be=typeof ot=="function"?ot:Mt=>Mt.type===ot,An=St==null?void 0:St.find(be);An&&(mt=An.id)}$n(Ve,S=K,S),C.addLayer(Sc({id:S,type:_t,source:u,"source-layer":G,filter:o,paint:ft,layout:ct,minzoom:l,maxzoom:h}),mt),n(23,cr=!0),C.on("click",S,Mn),C.on("dblclick",S,Mn),C.on("contextmenu",S,Mn),C.on("mouseenter",S,_r),C.on("mousemove",S,Lr),C.on("mouseleave",S,vr)}e.$$.dirty[0]&1048577&&S&&dn.set(S,{interactive:re}),e.$$.dirty[0]&1|e.$$.dirty[1]&1&&n(28,y=S?Tb((mt,St)=>C==null?void 0:C.setPaintProperty(S,mt,St)):void 0),e.$$.dirty[0]&1|e.$$.dirty[1]&1&&n(27,w=S?Tb((mt,St)=>C==null?void 0:C.setLayoutProperty(S,mt,St)):void 0),e.$$.dirty[0]&268443648&&(y==null||y(ft)),e.$$.dirty[0]&134234112&&(w==null||w(ct)),e.$$.dirty[0]&100663297|e.$$.dirty[1]&1&&S&&(C==null||C.setLayerZoomRange(S,l,h)),e.$$.dirty[0]&25165825|e.$$.dirty[1]&1&&S&&(cr?n(23,cr=!1):C==null||C.setFilter(S,o))},[S,Ce,pn,Ve,Ee,sn,Ct,K,O,G,q,ot,_t,ft,ct,ht,Pt,$,Lt,$t,re,pe,qt,cr,o,h,l,w,y,u,r,C,P,F,R,J,Y]}let uS=class extends fn{constructor(t){super(),hn(this,t,_L,yL,en,{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 vL(e){let t;const n=e[15].default,r=Ei(n,e,e[23],null);return{c(){r&&r.c()},m(o,l){r&&r.m(o,l),t=!0},p(o,l){r&&r.p&&(!t||l&8388608)&&Ci(r,n,o,o[23],t?Ii(n,o[23],l,null):Ti(o[23]),null)},i(o){t||(Rt(r,o),t=!0)},o(o){Zt(r,o),t=!1},d(o){r&&r.d(o)}}}function bL(e){let t,n,r;function o(h){e[16](h)}let l={id:e[1],type:"fill",source:e[2],sourceLayer:e[3],beforeId:e[4],beforeLayerType:e[5],paint:e[6],layout:e[7],filter:e[8],minzoom:e[9],maxzoom:e[10],hoverCursor:e[11],manageHoverState:e[12],eventsIfTopMost:e[13],interactive:e[14],$$slots:{default:[vL]},$$scope:{ctx:e}};return e[0]!==void 0&&(l.hovered=e[0]),t=new uS({props:l}),Li.push(()=>Pu(t,"hovered",o)),t.$on("click",e[17]),t.$on("dblclick",e[18]),t.$on("contextmenu",e[19]),t.$on("mouseenter",e[20]),t.$on("mousemove",e[21]),t.$on("mouseleave",e[22]),{c(){Ae(t.$$.fragment)},m(h,u){Pe(t,h,u),r=!0},p(h,[u]){const y={};u&2&&(y.id=h[1]),u&4&&(y.source=h[2]),u&8&&(y.sourceLayer=h[3]),u&16&&(y.beforeId=h[4]),u&32&&(y.beforeLayerType=h[5]),u&64&&(y.paint=h[6]),u&128&&(y.layout=h[7]),u&256&&(y.filter=h[8]),u&512&&(y.minzoom=h[9]),u&1024&&(y.maxzoom=h[10]),u&2048&&(y.hoverCursor=h[11]),u&4096&&(y.manageHoverState=h[12]),u&8192&&(y.eventsIfTopMost=h[13]),u&16384&&(y.interactive=h[14]),u&8388608&&(y.$$scope={dirty:u,ctx:h}),!n&&u&1&&(n=!0,y.hovered=h[0],Lu(()=>n=!1)),t.$set(y)},i(h){r||(Rt(t.$$.fragment,h),r=!0)},o(h){Zt(t.$$.fragment,h),r=!1},d(h){Me(t,h)}}}function xL(e,t,n){let{$$slots:r={},$$scope:o}=t,{id:l=Jg("fill")}=t,{source:h=void 0}=t,{sourceLayer:u=void 0}=t,{beforeId:y=void 0}=t,{beforeLayerType:w=void 0}=t,{paint:S}=t,{layout:C=void 0}=t,{filter:P=void 0}=t,{minzoom:F=void 0}=t,{maxzoom:R=void 0}=t,{hoverCursor:Y=void 0}=t,{manageHoverState:J=!1}=t,{hovered:K=null}=t,{eventsIfTopMost:O=!1}=t,{interactive:G=!0}=t;function q($){K=$,n(0,K)}function ot($){On.call(this,e,$)}function _t($){On.call(this,e,$)}function ft($){On.call(this,e,$)}function ct($){On.call(this,e,$)}function ht($){On.call(this,e,$)}function Pt($){On.call(this,e,$)}return e.$$set=$=>{"id"in $&&n(1,l=$.id),"source"in $&&n(2,h=$.source),"sourceLayer"in $&&n(3,u=$.sourceLayer),"beforeId"in $&&n(4,y=$.beforeId),"beforeLayerType"in $&&n(5,w=$.beforeLayerType),"paint"in $&&n(6,S=$.paint),"layout"in $&&n(7,C=$.layout),"filter"in $&&n(8,P=$.filter),"minzoom"in $&&n(9,F=$.minzoom),"maxzoom"in $&&n(10,R=$.maxzoom),"hoverCursor"in $&&n(11,Y=$.hoverCursor),"manageHoverState"in $&&n(12,J=$.manageHoverState),"hovered"in $&&n(0,K=$.hovered),"eventsIfTopMost"in $&&n(13,O=$.eventsIfTopMost),"interactive"in $&&n(14,G=$.interactive),"$$scope"in $&&n(23,o=$.$$scope)},[K,l,h,u,y,w,S,C,P,F,R,Y,J,O,G,r,q,ot,_t,ft,ct,ht,Pt,o]}let wL=class extends fn{constructor(t){super(),hn(this,t,xL,bL,en,{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 SL(e,t,n){let r;const{map:o}=Pf();qe(e,o,y=>n(4,r=y));let{position:l="top-left"}=t,{container:h=void 0}=t,u=null;return Ss(()=>{r!=null&&r.loaded()&&u&&r.removeControl(u)}),e.$$set=y=>{"position"in y&&n(1,l=y.position),"container"in y&&n(2,h=y.container)},e.$$.update=()=>{if(e.$$.dirty&30&&r&&!u){let y;typeof h=="string"?y=document.querySelector(h)??void 0:y=h,n(3,u=new bs.FullscreenControl({container:y})),r.addControl(u,l)}},[o,l,h,u,r]}class EL extends fn{constructor(t){super(),hn(this,t,SL,null,en,{position:1,container:2})}}function IL(e,t,n,r,o){let l=!1;e.getSource(t)&&(l=!0,e.removeSource(t));const h=()=>{r(t)&&(e.addSource(t,n),o())};if(l){const u=()=>{t&&(e.getSource(t)?setTimeout(u,1):h())};u()}else h()}function CL(e,t,n){nS().then(()=>{let r=Q2(e);if(!r)return;r.getSource(t)===n&&r.removeSource(t)})}function Ab(e){let t=e[0],n,r,o=kb(e);return{c(){o.c(),n=Co()},m(l,h){o.m(l,h),Ut(l,n,h),r=!0},p(l,h){h&1&&en(t,t=l[0])?(sr(),Zt(o,1,1,ze),ar(),o=kb(l),o.c(),Rt(o,1),o.m(n.parentNode,n)):o.p(l,h)},i(l){r||(Rt(o),r=!0)},o(l){Zt(o),r=!1},d(l){l&&Vt(n),o.d(l)}}}function kb(e){let t;const n=e[15].default,r=Ei(n,e,e[14],null);return{c(){r&&r.c()},m(o,l){r&&r.m(o,l),t=!0},p(o,l){r&&r.p&&(!t||l&16384)&&Ci(r,n,o,o[14],t?Ii(n,o[14],l,null):Ti(o[14]),null)},i(o){t||(Rt(r,o),t=!0)},o(o){Zt(r,o),t=!1},d(o){r&&r.d(o)}}}function TL(e){let t,n,r=e[0]&&Ab(e);return{c(){r&&r.c(),t=Co()},m(o,l){r&&r.m(o,l),Ut(o,t,l),n=!0},p(o,[l]){o[0]?r?(r.p(o,l),l&1&&Rt(r,1)):(r=Ab(o),r.c(),Rt(r,1),r.m(t.parentNode,t)):r&&(sr(),Zt(r,1,1,()=>{r=null}),ar())},i(o){n||(Rt(r),n=!0)},o(o){Zt(r),n=!1},d(o){o&&Vt(t),r&&r.d(o)}}}function LL(e,t,n){let r,o,l,{$$slots:h={},$$scope:u}=t,{id:y=Jg("geojson")}=t,{data:w}=t,{generateId:S=!1}=t,{promoteId:C=void 0}=t,{filter:P=void 0}=t,{lineMetrics:F=void 0}=t,{cluster:R=void 0}=t;const{map:Y,cluster:J,self:K}=cL();qe(e,Y,q=>n(13,o=q)),qe(e,J,q=>n(16,l=q)),qe(e,K,q=>n(0,r=q));let O,G=!0;return Ss(()=>{r&&O&&o&&(CL(Y,r,O),$n(K,r=null,r),n(11,O=void 0))}),e.$$set=q=>{"id"in q&&n(4,y=q.id),"data"in q&&n(5,w=q.data),"generateId"in q&&n(6,S=q.generateId),"promoteId"in q&&n(7,C=q.promoteId),"filter"in q&&n(8,P=q.filter),"lineMetrics"in q&&n(9,F=q.lineMetrics),"cluster"in q&&n(10,R=q.cluster),"$$scope"in q&&n(14,u=q.$$scope)},e.$$.update=()=>{e.$$.dirty&1024&&$n(J,l=R,l),e.$$.dirty&12273&&o&&r!==y&&($n(K,r=y,r),IL(o,r,Sc({type:"geojson",data:w,filter:P,lineMetrics:F,generateId:S,promoteId:C,cluster:!!R,clusterMinPoints:R==null?void 0:R.minPoints,clusterMaxZoom:R==null?void 0:R.maxZoom,clusterRadius:R==null?void 0:R.radius,clusterProperties:R==null?void 0:R.properties}),q=>o&&q===r,()=>{r&&(n(11,O=o==null?void 0:o.getSource(r)),n(12,G=!0))})),e.$$.dirty&8208&&(o==null||o.on("style.load",()=>{n(11,O=o==null?void 0:o.getSource(y))})),e.$$.dirty&6176&&O&&(G?n(12,G=!1):O.setData(w)),e.$$.dirty&3072&&(O==null||O.setClusterOptions(Sc({cluster:!!R,clusterMaxZoom:R==null?void 0:R.maxZoom,clusterRadius:R==null?void 0:R.radius})))},[r,Y,J,K,y,w,S,C,P,F,R,O,G,o,u,h]}let Mf=class extends fn{constructor(t){super(),hn(this,t,LL,TL,en,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10})}};function PL(e,t,n){let r;const{map:o}=Pf();qe(e,o,P=>n(8,r=P));let{position:l="top-left"}=t,{positionOptions:h=void 0}=t,{fitBoundsOptions:u=void 0}=t,{trackUserLocation:y=!1}=t,{showAccuracyCircle:w=!0}=t,{showUserLocation:S=!0}=t,C=null;return Ss(()=>{r!=null&&r.loaded()&&C&&r.removeControl(C)}),e.$$set=P=>{"position"in P&&n(1,l=P.position),"positionOptions"in P&&n(2,h=P.positionOptions),"fitBoundsOptions"in P&&n(3,u=P.fitBoundsOptions),"trackUserLocation"in P&&n(4,y=P.trackUserLocation),"showAccuracyCircle"in P&&n(5,w=P.showAccuracyCircle),"showUserLocation"in P&&n(6,S=P.showUserLocation)},e.$$.update=()=>{e.$$.dirty&510&&r&&!C&&(n(7,C=new bs.GeolocateControl({positionOptions:h,fitBoundsOptions:u,trackUserLocation:y,showAccuracyCircle:w,showUserLocation:S})),r.addControl(C,l))},[o,l,h,u,y,w,S,C,r]}class ML extends fn{constructor(t){super(),hn(this,t,PL,null,en,{position:1,positionOptions:2,fitBoundsOptions:3,trackUserLocation:4,showAccuracyCircle:5,showUserLocation:6})}}function AL(e){let t;const n=e[15].default,r=Ei(n,e,e[23],null);return{c(){r&&r.c()},m(o,l){r&&r.m(o,l),t=!0},p(o,l){r&&r.p&&(!t||l&8388608)&&Ci(r,n,o,o[23],t?Ii(n,o[23],l,null):Ti(o[23]),null)},i(o){t||(Rt(r,o),t=!0)},o(o){Zt(r,o),t=!1},d(o){r&&r.d(o)}}}function kL(e){let t,n,r;function o(h){e[16](h)}let l={id:e[1],type:"line",source:e[2],sourceLayer:e[3],beforeId:e[4],beforeLayerType:e[5],paint:e[6],layout:e[7],filter:e[8],minzoom:e[9],maxzoom:e[10],hoverCursor:e[11],manageHoverState:e[12],eventsIfTopMost:e[13],interactive:e[14],$$slots:{default:[AL]},$$scope:{ctx:e}};return e[0]!==void 0&&(l.hovered=e[0]),t=new uS({props:l}),Li.push(()=>Pu(t,"hovered",o)),t.$on("click",e[17]),t.$on("dblclick",e[18]),t.$on("contextmenu",e[19]),t.$on("mouseenter",e[20]),t.$on("mousemove",e[21]),t.$on("mouseleave",e[22]),{c(){Ae(t.$$.fragment)},m(h,u){Pe(t,h,u),r=!0},p(h,[u]){const y={};u&2&&(y.id=h[1]),u&4&&(y.source=h[2]),u&8&&(y.sourceLayer=h[3]),u&16&&(y.beforeId=h[4]),u&32&&(y.beforeLayerType=h[5]),u&64&&(y.paint=h[6]),u&128&&(y.layout=h[7]),u&256&&(y.filter=h[8]),u&512&&(y.minzoom=h[9]),u&1024&&(y.maxzoom=h[10]),u&2048&&(y.hoverCursor=h[11]),u&4096&&(y.manageHoverState=h[12]),u&8192&&(y.eventsIfTopMost=h[13]),u&16384&&(y.interactive=h[14]),u&8388608&&(y.$$scope={dirty:u,ctx:h}),!n&&u&1&&(n=!0,y.hovered=h[0],Lu(()=>n=!1)),t.$set(y)},i(h){r||(Rt(t.$$.fragment,h),r=!0)},o(h){Zt(t.$$.fragment,h),r=!1},d(h){Me(t,h)}}}function DL(e,t,n){let{$$slots:r={},$$scope:o}=t,{id:l=Jg("line")}=t,{source:h=void 0}=t,{sourceLayer:u=void 0}=t,{beforeId:y=void 0}=t,{beforeLayerType:w=void 0}=t,{paint:S}=t,{layout:C=void 0}=t,{filter:P=void 0}=t,{minzoom:F=void 0}=t,{maxzoom:R=void 0}=t,{hoverCursor:Y=void 0}=t,{manageHoverState:J=!1}=t,{hovered:K=null}=t,{eventsIfTopMost:O=!1}=t,{interactive:G=!0}=t;function q($){K=$,n(0,K)}function ot($){On.call(this,e,$)}function _t($){On.call(this,e,$)}function ft($){On.call(this,e,$)}function ct($){On.call(this,e,$)}function ht($){On.call(this,e,$)}function Pt($){On.call(this,e,$)}return e.$$set=$=>{"id"in $&&n(1,l=$.id),"source"in $&&n(2,h=$.source),"sourceLayer"in $&&n(3,u=$.sourceLayer),"beforeId"in $&&n(4,y=$.beforeId),"beforeLayerType"in $&&n(5,w=$.beforeLayerType),"paint"in $&&n(6,S=$.paint),"layout"in $&&n(7,C=$.layout),"filter"in $&&n(8,P=$.filter),"minzoom"in $&&n(9,F=$.minzoom),"maxzoom"in $&&n(10,R=$.maxzoom),"hoverCursor"in $&&n(11,Y=$.hoverCursor),"manageHoverState"in $&&n(12,J=$.manageHoverState),"hovered"in $&&n(0,K=$.hovered),"eventsIfTopMost"in $&&n(13,O=$.eventsIfTopMost),"interactive"in $&&n(14,G=$.interactive),"$$scope"in $&&n(23,o=$.$$scope)},[K,l,h,u,y,w,S,C,P,F,R,Y,J,O,G,r,q,ot,_t,ft,ct,ht,Pt,o]}let Md=class extends fn{constructor(t){super(),hn(this,t,DL,kL,en,{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 RL(e,t,n){let r;const o=Vu();let{layer:l=void 0}=t;const{map:h}=Pf();qe(e,h,S=>n(2,r=S));function u(S){o(S.type,{...S,map:h})}const y=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","contextmenu","mouseover","mouseout"],w=["click","dblclick","contextmenu","mousemove","movestart","moveend","zoomstart","zoom","zoomend"];return Ss(()=>{if(r)if(l)for(const S of y)r.off(S,l,u);else for(const S of w)r.off(S,u)}),e.$$set=S=>{"layer"in S&&n(1,l=S.layer)},e.$$.update=()=>{if(e.$$.dirty&6&&r)if(l)for(const S of y)r.on(S,l,u);else for(const S of w)r.on(S,u)},[h,l,r]}class cS extends fn{constructor(t){super(),hn(this,t,RL,null,en,{layer:1})}}function NL(e){let t=e.getCenter(),n=Math.round(e.getZoom()*100)/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,r),l=Math.round(t.lat*o)/o,h=Math.round(t.lng*o)/o,u=`${n}/${l}/${h}`,y=e.getBearing(),w=e.getPitch();return(y||w)&&(u+=`/${Math.round(y*10)/10}`),w&&(u+=`/${Math.round(w)}`),`#${u}`}function OL(e){return e.replace("#","").split("/").map(parseFloat)}var Xm=ev;function ev(e,t){return e===t||e!==e&&t!==t?!0:typeof e!=typeof t||{}.toString.call(e)!={}.toString.call(t)||e!==Object(e)||!e?!1:Array.isArray(e)?Db(e,t):{}.toString.call(e)=="[object Set]"?Db(Array.from(e),Array.from(t)):{}.toString.call(e)=="[object Object]"?FL(e,t):zL(e,t)}function zL(e,t){return e.toString()===t.toString()}function Db(e,t){var n=e.length;if(n!=t.length)return!1;for(var r=0;rn(6,r=S));let{position:l="top-left"}=t,{showCompass:h=!0}=t,{showZoom:u=!0}=t,{visualizePitch:y=!1}=t,w=null;return Ss(()=>{r!=null&&r.loaded()&&w&&r.removeControl(w)}),e.$$set=S=>{"position"in S&&n(1,l=S.position),"showCompass"in S&&n(2,h=S.showCompass),"showZoom"in S&&n(3,u=S.showZoom),"visualizePitch"in S&&n(4,y=S.visualizePitch)},e.$$.update=()=>{e.$$.dirty&126&&r&&!w&&(n(5,w=new bs.NavigationControl({showCompass:h,showZoom:u,visualizePitch:y})),r.addControl(w,l))},[o,l,h,u,y,w,r]}class VL extends fn{constructor(t){super(),hn(this,t,BL,null,en,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function UL(e,t,n){let r;const{map:o}=Pf();qe(e,o,w=>n(5,r=w));let{position:l="bottom-left"}=t,{maxWidth:h=void 0}=t,{unit:u="metric"}=t,y=null;return Ss(()=>{r!=null&&r.loaded()&&y&&r.removeControl(y)}),e.$$set=w=>{"position"in w&&n(1,l=w.position),"maxWidth"in w&&n(2,h=w.maxWidth),"unit"in w&&n(3,u=w.unit)},e.$$.update=()=>{e.$$.dirty&62&&r&&!y&&(n(4,y=new bs.ScaleControl({maxWidth:h,unit:u})),r.addControl(y,l))},[o,l,h,u,y,r]}class GL extends fn{constructor(t){super(),hn(this,t,UL,null,en,{position:1,maxWidth:2,unit:3})}}const{window:qL}=UT,jL=e=>({map:e[0]&16,loadedImages:e[0]&32,allImagesLoaded:e[0]&64}),Rb=e=>({map:e[4],loadedImages:e[5],allImagesLoaded:e[6]});function Nb(e){let t,n,r=e[3]&&Ob(e);const o=e[39].default,l=Ei(o,e,e[38],Rb);return{c(){r&&r.c(),t=fe(),l&&l.c()},m(h,u){r&&r.m(h,u),Ut(h,t,u),l&&l.m(h,u),n=!0},p(h,u){h[3]?r?(r.p(h,u),u[0]&8&&Rt(r,1)):(r=Ob(h),r.c(),Rt(r,1),r.m(t.parentNode,t)):r&&(sr(),Zt(r,1,1,()=>{r=null}),ar()),l&&l.p&&(!n||u[0]&112|u[1]&128)&&Ci(l,o,h,h[38],n?Ii(o,h[38],u,jL):Ti(h[38]),Rb)},i(h){n||(Rt(r),Rt(l,h),n=!0)},o(h){Zt(r),Zt(l,h),n=!1},d(h){h&&Vt(t),r&&r.d(h),l&&l.d(h)}}}function Ob(e){let t,n,r,o,l,h,u,y;return t=new VL({props:{position:e[7]}}),r=new ML({props:{position:e[7],fitBoundsOptions:{maxZoom:12}}}),l=new EL({props:{position:e[7]}}),u=new GL({props:{position:e[7]}}),{c(){Ae(t.$$.fragment),n=fe(),Ae(r.$$.fragment),o=fe(),Ae(l.$$.fragment),h=fe(),Ae(u.$$.fragment)},m(w,S){Pe(t,w,S),Ut(w,n,S),Pe(r,w,S),Ut(w,o,S),Pe(l,w,S),Ut(w,h,S),Pe(u,w,S),y=!0},p(w,S){const C={};S[0]&128&&(C.position=w[7]),t.$set(C);const P={};S[0]&128&&(P.position=w[7]),r.$set(P);const F={};S[0]&128&&(F.position=w[7]),l.$set(F);const R={};S[0]&128&&(R.position=w[7]),u.$set(R)},i(w){y||(Rt(t.$$.fragment,w),Rt(r.$$.fragment,w),Rt(l.$$.fragment,w),Rt(u.$$.fragment,w),y=!0)},o(w){Zt(t.$$.fragment,w),Zt(r.$$.fragment,w),Zt(l.$$.fragment,w),Zt(u.$$.fragment,w),y=!1},d(w){w&&(Vt(n),Vt(o),Vt(h)),Me(t,w),Me(r,w),Me(l,w),Me(u,w)}}}function WL(e){let t,n,r,o,l,h=e[4]&&e[0]&&Nb(e);return{c(){t=jt("div"),h&&h.c(),Wt(t,"class",n=_g(e[2])+" svelte-p00lfq"),Wt(t,"data-testid","map-container"),el(t,"expand-map",!e[2])},m(u,y){Ut(u,t,y),h&&h.m(t,null),e[40](t),r=!0,o||(l=[$e(qL,"hashchange",e[11]),i0(e[10].call(null,t))],o=!0)},p(u,y){u[4]&&u[0]?h?(h.p(u,y),y[0]&17&&Rt(h,1)):(h=Nb(u),h.c(),Rt(h,1),h.m(t,null)):h&&(sr(),Zt(h,1,1,()=>{h=null}),ar()),(!r||y[0]&4&&n!==(n=_g(u[2])+" svelte-p00lfq"))&&Wt(t,"class",n),(!r||y[0]&4)&&el(t,"expand-map",!u[2])},i(u){r||(Rt(h),r=!0)},o(u){Zt(h),r=!1},d(u){u&&Vt(t),h&&h.d(),e[40](null),o=!1,bi(l)}}}function ZL(e,t,n){let r,o,l,h,{$$slots:u={},$$scope:y}=t,{map:w=null}=t,{mapContainer:S=void 0}=t,{class:C=void 0}=t,{style:P}=t,{diffStyleUpdates:F=!1}=t,{center:R=void 0}=t,{zoom:Y=void 0}=t,{pitch:J=0}=t,{bearing:K=0}=t,{bounds:O=void 0}=t,{hash:G=!1}=t,{loaded:q=!1}=t,{minZoom:ot=0}=t,{maxZoom:_t=22}=t,{antialias:ft=void 0}=t,{zoomOnDoubleClick:ct=!0}=t,{locale:ht=void 0}=t,{interactive:Pt=!0}=t,{attributionControl:$=!0}=t,{cooperativeGestures:Lt=!1}=t,{preserveDrawingBuffer:$t=!1}=t,{maxBounds:Ct=void 0}=t,{images:re=[]}=t,{standardControls:pe=!1}=t,{filterLayers:qt=void 0}=t,{transformRequest:Ne=void 0}=t;const Ce=Vu(),{map:pn,loadedImages:Ve}=uL();qe(e,pn,Kt=>n(4,l=Kt)),qe(e,Ve,Kt=>n(5,h=Kt));let Ee=new Set;async function sn(Kt,mt=!1){if(l&&!(!l.loaded()&&!mt))if("url"in Kt){Ee.add(Kt.id);try{let St=await l.loadImage(Kt.url);l==null||l.addImage(Kt.id,St.data,Kt.options),h.add(Kt.id),Ve.set(h)}catch(St){Ce("error",St)}finally{Ee.delete(Kt.id)}}else l.addImage(Kt.id,Kt.data,Kt.options),h.add(Kt.id),Ve.set(h)}let En,dn,mn,Mn;function _r(Kt){return vr(),$n(pn,l=new bs.Map(Sc({container:Kt,style:P,locale:ht,center:R,zoom:Y,pitch:J,bearing:K,minZoom:ot,maxZoom:_t,antialias:ft,interactive:Pt,preserveDrawingBuffer:$t,maxBounds:Ct,bounds:O,attributionControl:$,transformRequest:Ne,cooperativeGestures:Lt})),l),l.on("load",mt=>{mt.target.getContainer().setAttribute("data-testid","map"),mt.target.getCanvas().setAttribute("data-testid","map-canvas"),n(0,q=!0),Ce("load",l)}),l.on("error",mt=>Ce("error",{...mt,map:l})),l.on("movestart",mt=>Ce("movestart",{...mt,map:l})),l.on("moveend",mt=>{if(n(12,R=mt.target.getCenter()),n(13,Y=mt.target.getZoom()),n(14,O=mt.target.getBounds()),Ce("moveend",{...mt,map:l}),G){let St=window.location.href.replace(/(#.+)?$/,NL(l));window.history.replaceState(window.history.state,"",St)}}),l.on("click",mt=>Ce("click",{...mt,map:l})),l.on("dblclick",mt=>Ce("dblclick",{...mt,map:l})),l.on("contextmenu",mt=>Ce("contextmenu",{...mt,map:l})),l.on("zoomstart",mt=>Ce("zoomstart",{...mt,map:l})),l.on("zoom",mt=>{n(13,Y=mt.target.getZoom()),Ce("zoom",{...mt,map:l})}),l.on("zoomend",mt=>{n(13,Y=mt.target.getZoom()),Ce("zoomend",{...mt,map:l})}),l.on("style.load",()=>{if(l){const mt=l.getStyle();if(n(35,En=mt.layers.map(St=>St.id)),n(36,dn=Object.keys(mt.sources)),Mn)for(const[St,be]of Object.entries(Mn))l.addSource(St,be);if(mn)for(const St of mn)l.addLayer(St);for(const St of re)sn(St,!0)}}),l.on("styledata",mt=>{if(l&&qt){const St=l.getStyle().layers;if(St)for(let be of St)qt(be)||l.setLayoutProperty(be.id,"visibility","none")}Ce("styledata",{...mt,map:l})}),{destroy(){n(0,q=!1),l==null||l.remove(),$n(pn,l=null,l)}}}let Lr=P;function vr(){if(G){let Kt=OL(window.location.hash);Kt.length>=3&&(n(13,Y=Kt[0]),n(12,R=[Kt[2],Kt[1]])),Kt.length==5&&(n(17,K=Kt[3]),n(16,J=Kt[4]))}}function cr(Kt){Li[Kt?"unshift":"push"](()=>{S=Kt,n(1,S)})}return e.$$set=Kt=>{"map"in Kt&&n(15,w=Kt.map),"mapContainer"in Kt&&n(1,S=Kt.mapContainer),"class"in Kt&&n(2,C=Kt.class),"style"in Kt&&n(18,P=Kt.style),"diffStyleUpdates"in Kt&&n(19,F=Kt.diffStyleUpdates),"center"in Kt&&n(12,R=Kt.center),"zoom"in Kt&&n(13,Y=Kt.zoom),"pitch"in Kt&&n(16,J=Kt.pitch),"bearing"in Kt&&n(17,K=Kt.bearing),"bounds"in Kt&&n(14,O=Kt.bounds),"hash"in Kt&&n(20,G=Kt.hash),"loaded"in Kt&&n(0,q=Kt.loaded),"minZoom"in Kt&&n(21,ot=Kt.minZoom),"maxZoom"in Kt&&n(22,_t=Kt.maxZoom),"antialias"in Kt&&n(23,ft=Kt.antialias),"zoomOnDoubleClick"in Kt&&n(24,ct=Kt.zoomOnDoubleClick),"locale"in Kt&&n(25,ht=Kt.locale),"interactive"in Kt&&n(26,Pt=Kt.interactive),"attributionControl"in Kt&&n(27,$=Kt.attributionControl),"cooperativeGestures"in Kt&&n(28,Lt=Kt.cooperativeGestures),"preserveDrawingBuffer"in Kt&&n(29,$t=Kt.preserveDrawingBuffer),"maxBounds"in Kt&&n(30,Ct=Kt.maxBounds),"images"in Kt&&n(31,re=Kt.images),"standardControls"in Kt&&n(3,pe=Kt.standardControls),"filterLayers"in Kt&&n(32,qt=Kt.filterLayers),"transformRequest"in Kt&&n(33,Ne=Kt.transformRequest),"$$scope"in Kt&&n(38,y=Kt.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&8&&n(7,r=typeof pe=="boolean"?void 0:pe),e.$$.dirty[0]&16&&n(15,w=l),e.$$.dirty[0]&786448|e.$$.dirty[1]&112&&l&&!Xm(P,Lr)){const Kt=l.getStyle();if(En&&(mn=Kt.layers.filter(mt=>!En.includes(mt.id))),dn){const mt=Object.keys(Kt.sources).filter(St=>!dn.includes(St));Mn={};for(const St of mt)Mn[St]=Kt.sources[St]}n(37,Lr=P),l.setStyle(P,{diff:F}),$n(Ve,h=new Set,h),n(34,Ee=new Set)}if(e.$$.dirty[0]&49|e.$$.dirty[1]&9&&q&&l!=null&&l.loaded())for(let Kt of re)!h.has(Kt.id)&&!Ee.has(Kt.id)&&!l.hasImage(Kt.id)&&sn(Kt);e.$$.dirty[0]&32|e.$$.dirty[1]&1&&n(6,o=re.every(Kt=>h.has(Kt.id))),e.$$.dirty[0]&4112&&R&&!Xm(R,l==null?void 0:l.getCenter())&&(l==null||l.panTo(R)),e.$$.dirty[0]&8208&&Y&&!Xm(Y,l==null?void 0:l.getZoom())&&(l==null||l.zoomTo(Y)),e.$$.dirty[0]&16400&&O&&!Xm(O,l==null?void 0:l.getBounds())&&(l==null||l.fitBounds(O)),e.$$.dirty[0]&16777232&&(ct?l==null||l.doubleClickZoom.enable():l==null||l.doubleClickZoom.disable())},[q,S,C,pe,l,h,o,r,pn,Ve,_r,vr,R,Y,O,w,J,K,P,F,G,ot,_t,ft,ct,ht,Pt,$,Lt,$t,Ct,re,qt,Ne,Ee,En,dn,Lr,y,u,cr]}class HL extends fn{constructor(t){super(),hn(this,t,ZL,WL,en,{map:15,mapContainer:1,class:2,style:18,diffStyleUpdates:19,center:12,zoom:13,pitch:16,bearing:17,bounds:14,hash:20,loaded:0,minZoom:21,maxZoom:22,antialias:23,zoomOnDoubleClick:24,locale:25,interactive:26,attributionControl:27,cooperativeGestures:28,preserveDrawingBuffer:29,maxBounds:30,images:31,standardControls:3,filterLayers:32,transformRequest:33},null,[-1,-1])}}const XL=e=>({marker:e&8}),zb=e=>({marker:e[3]});function YL(e){let t,n,r,o,l,h,u;const y=e[19].default,w=Ei(y,e,e[18],zb);return{c(){t=jt("div"),w&&w.c(),Wt(t,"tabindex",n=e[1]?0:void 0),Wt(t,"role",r=e[1]?"button":void 0),ai(t,"z-index",e[2])},m(S,C){Ut(S,t,C),w&&w.m(t,null),l=!0,h||(u=[i0(e[7].call(null,t)),i0(o=KL.call(null,t,e[0])),$e(t,"click",C_(e[20])),$e(t,"dblclick",C_(e[21])),$e(t,"contextmenu",C_(e[22])),$e(t,"mouseenter",e[23]),$e(t,"mouseleave",e[24]),$e(t,"mousemove",e[25]),$e(t,"keydown",e[8])],h=!0)},p(S,[C]){w&&w.p&&(!l||C&262152)&&Ci(w,y,S,S[18],l?Ii(y,S[18],C,XL):Ti(S[18]),zb),(!l||C&2&&n!==(n=S[1]?0:void 0))&&Wt(t,"tabindex",n),(!l||C&2&&r!==(r=S[1]?"button":void 0))&&Wt(t,"role",r),o&&Kg(o.update)&&C&1&&o.update.call(null,S[0]),C&4&&ai(t,"z-index",S[2])},i(S){l||(Rt(w,S),l=!0)},o(S){Zt(w,S),l=!1},d(S){S&&Vt(t),w&&w.d(S),h=!1,bi(u)}}}function KL(e,t){const n=e.className;function r(o){o?e.className=`${n} ${o}`:e.className=n}return r(t),{update:r}}function JL(e,t,n){let r,o,l,{$$slots:h={},$$scope:u}=t,{marker:y=void 0}=t,{lngLat:w}=t,{class:S=void 0}=t,{interactive:C=!0}=t,{asButton:P=!1}=t,{draggable:F=!1}=t,{feature:R=null}=t,{offset:Y=void 0}=t,{zIndex:J=void 0}=t,{rotation:K=0}=t,{opacity:O=1}=t;const G=Vu(),{map:q,layerEvent:ot,self:_t}=fL();qe(e,q,qt=>n(27,l=qt)),qe(e,ot,qt=>n(26,r=qt)),qe(e,_t,qt=>n(3,o=qt));function ft(qt){$n(_t,o=new bs.Marker({element:qt,rotation:K,draggable:F,offset:Y,opacity:O.toString()}).setLngLat(w).addTo(l),o),n(11,y=o);const Ne=()=>Pt("dragstart"),Ce=()=>{ct(),Pt("drag")},pn=()=>{ct(),Pt("dragend")};return F&&(o.on("dragstart",Ne),o.on("drag",Ce),o.on("dragend",pn)),{destroy(){F&&(o==null||o.off("dragstart",Ne),o==null||o.off("drag",Ce),o==null||o.off("dragend",pn)),n(11,y=void 0),o==null||o.remove()}}}function ct(){let qt=o==null?void 0:o.getLngLat();qt&&(Array.isArray(w)?n(10,w=[qt.lng,qt.lat]):w&&"lon"in w?n(10,w={lon:qt.lng,lat:qt.lat}):n(10,w=qt))}function ht(qt){qt.key===" "&&(qt.preventDefault(),qt.stopPropagation(),Pt("click"))}function Pt(qt){if(!C)return;let Ne=o==null?void 0:o.getLngLat();if(!Ne)return;const Ce=[Ne.lng,Ne.lat];let pn={map:l,marker:o,lngLat:Ce,features:[{type:"Feature",properties:(R==null?void 0:R.properties)??{},geometry:{type:"Point",coordinates:Ce}}]};$n(ot,r={...pn,layerType:"marker",type:qt},r),G(qt,pn)}const $=()=>Pt("click"),Lt=()=>Pt("dblclick"),$t=()=>Pt("contextmenu"),Ct=qt=>{Pt("mouseenter")},re=()=>{Pt("mouseleave")},pe=()=>Pt("mousemove");return e.$$set=qt=>{"marker"in qt&&n(11,y=qt.marker),"lngLat"in qt&&n(10,w=qt.lngLat),"class"in qt&&n(0,S=qt.class),"interactive"in qt&&n(12,C=qt.interactive),"asButton"in qt&&n(1,P=qt.asButton),"draggable"in qt&&n(13,F=qt.draggable),"feature"in qt&&n(14,R=qt.feature),"offset"in qt&&n(15,Y=qt.offset),"zIndex"in qt&&n(2,J=qt.zIndex),"rotation"in qt&&n(16,K=qt.rotation),"opacity"in qt&&n(17,O=qt.opacity),"$$scope"in qt&&n(18,u=qt.$$scope)},e.$$.update=()=>{e.$$.dirty&1032&&(o==null||o.setLngLat(w)),e.$$.dirty&32776&&(o==null||o.setOffset(Y??[0,0])),e.$$.dirty&65544&&(o==null||o.setRotation(K)),e.$$.dirty&131080&&(o==null||o.setOpacity(O.toString()))},[S,P,J,o,q,ot,_t,ft,ht,Pt,w,y,C,F,R,Y,K,O,u,h,$,Lt,$t,Ct,re,pe]}class Fb extends fn{constructor(t){super(),hn(this,t,JL,YL,en,{marker:11,lngLat:10,class:0,interactive:12,asButton:1,draggable:13,feature:14,offset:15,zIndex:2,rotation:16,opacity:17})}}var Ad=Uint8Array,hS=Uint16Array,QL=Int32Array,$L=new Ad([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]),tP=new Ad([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]),fS=function(e,t){for(var n=new hS(31),r=0;r<31;++r)n[r]=t+=1<>1|(Wn&21845)<<1,kl=(kl&52428)>>2|(kl&13107)<<2,kl=(kl&61680)>>4|(kl&3855)<<4,rP[Wn]=((kl&65280)>>8|(kl&255)<<8)>>1;var kl,Wn,$g=new Ad(288);for(Wn=0;Wn<144;++Wn)$g[Wn]=8;var Wn;for(Wn=144;Wn<256;++Wn)$g[Wn]=9;var Wn;for(Wn=256;Wn<280;++Wn)$g[Wn]=7;var Wn;for(Wn=280;Wn<288;++Wn)$g[Wn]=8;var Wn,iP=new Ad(32);for(Wn=0;Wn<32;++Wn)iP[Wn]=5;var Wn,oP=new Ad(0),sP=typeof TextDecoder<"u"&&new TextDecoder,aP=0;try{sP.decode(oP,{stream:!0}),aP=1}catch{}const $a={Footway:"black",Indoors:"grey",BridgeOrTunnel:"black",WithTraffic:"#4C3926",Crossing:"green",Severance:"red"},dS=["#CDE594","#80C6A3","#1F9EB7","#186290","#080C54"],mS=[1,4,7,10,13,15];function Bb(e,t,n){const r=e.slice();return r[1]=t[n][0],r[2]=t[n][1],r}function Vb(e){let t,n,r,o=e[1]+"",l,h;return{c(){t=jt("li"),n=jt("span"),r=fe(),l=Cn(o),h=fe(),Wt(n,"class","svelte-kzgqtg"),ai(n,"background",e[2])},m(u,y){Ut(u,t,y),Gt(t,n),Gt(t,r),Gt(t,l),Gt(t,h)},p(u,y){y&1&&ai(n,"background",u[2]),y&1&&o!==(o=u[1]+"")&&Gi(l,o)},d(u){u&&Vt(t)}}}function lP(e){let t,n=_o(e[0]),r=[];for(let o=0;o{"rows"in o&&n(0,r=o.rows)},[r]}class cP extends fn{constructor(t){super(),hn(this,t,uP,lP,en,{rows:0})}}function Ub(e){let t,n;return{c(){t=jt("div"),n=Cn(e[0]),Wt(t,"class","svelte-1uuov7f")},m(r,o){Ut(r,t,o),Gt(t,n)},p(r,o){o&1&&Gi(n,r[0])},d(r){r&&Vt(t)}}}function hP(e){let t,n=e[0]&&Ub(e);return{c(){n&&n.c(),t=Co()},m(r,o){n&&n.m(r,o),Ut(r,t,o)},p(r,[o]){r[0]?n?n.p(r,o):(n=Ub(r),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},i:ze,o:ze,d(r){r&&Vt(t),n&&n.d(r)}}}function fP(e,t,n){let{loading:r}=t;return e.$$set=o=>{"loading"in o&&n(0,r=o.loading)},[r]}class pP extends fn{constructor(t){super(),hn(this,t,fP,hP,en,{loading:0})}}const dP=e=>({dialog:e&1}),Gb=e=>({dialog:e[0]});function mP(e){let t,n,r,o,l;const h=e[4].default,u=Ei(h,e,e[3],Gb);return{c(){t=jt("dialog"),n=jt("article"),u&&u.c(),t.open=!0},m(y,w){Ut(y,t,w),Gt(t,n),u&&u.m(n,null),e[6](t),r=!0,o||(l=[$e(window,"click",e[1]),$e(window,"keydown",e[2]),$e(t,"close",e[5])],o=!0)},p(y,[w]){u&&u.p&&(!r||w&9)&&Ci(u,h,y,y[3],r?Ii(h,y[3],w,dP):Ti(y[3]),Gb)},i(y){r||(Rt(u,y),r=!0)},o(y){Zt(u,y),r=!1},d(y){y&&Vt(t),u&&u.d(y),e[6](null),o=!1,bi(l)}}}function gP(e,t,n){let{$$slots:r={},$$scope:o}=t,l;function h(S){l.open&&S.target==l&&l.close()}function u(S){(S.key=="Escape"||S.key=="Enter")&&(S.stopPropagation(),l.close())}function y(S){On.call(this,e,S)}function w(S){Li[S?"unshift":"push"](()=>{l=S,n(0,l)})}return e.$$set=S=>{"$$scope"in S&&n(3,o=S.$$scope)},[l,h,u,o,r,y,w]}class yP extends fn{constructor(t){super(),hn(this,t,gP,mP,en,{})}}function qb(e,t,n){const r=e.slice();return r[1]=t[n][0],r[2]=t[n][1],r}function jb(e){let t,n,r=e[1]+"",o,l,h,u=e[2]+"",y,w;return{c(){t=jt("tr"),n=jt("td"),o=Cn(r),l=fe(),h=jt("td"),y=Cn(u),w=fe()},m(S,C){Ut(S,t,C),Gt(t,n),Gt(n,o),Gt(t,l),Gt(t,h),Gt(h,y),Gt(t,w)},p(S,C){C&1&&r!==(r=S[1]+"")&&Gi(o,r),C&1&&u!==(u=S[2]+"")&&Gi(y,u)},d(S){S&&Vt(t)}}}function _P(e){let t,n,r=_o(Object.entries(e[0])),o=[];for(let l=0;l{"properties"in o&&n(0,r=o.properties)},[r]}class bP extends fn{constructor(t){super(),hn(this,t,vP,_P,en,{properties:0})}}function Wb(e,t,n){const r=e.slice();return r[3]=t[n],r}function Zb(e,t,n){const r=e.slice();return r[6]=t[n],r}function Hb(e){let t,n;return{c(){t=jt("span"),n=Cn(`  + `),ai(t,"background",e[6]),ai(t,"width","100%"),ai(t,"border","1px solid black")},m(r,o){Ut(r,t,o),Gt(t,n)},p(r,o){o&1&&ai(t,"background",r[6])},d(r){r&&Vt(t)}}}function xP(e){let t,n=e[3]+"",r;return{c(){t=jt("span"),r=Cn(n)},m(o,l){Ut(o,t,l),Gt(t,r)},p(o,l){l&2&&n!==(n=o[3]+"")&&Gi(r,n)},d(o){o&&Vt(t)}}}function wP(e){let t,n=e[3].toFixed(e[2])+"",r;return{c(){t=jt("span"),r=Cn(n)},m(o,l){Ut(o,t,l),Gt(t,r)},p(o,l){l&6&&n!==(n=o[3].toFixed(o[2])+"")&&Gi(r,n)},d(o){o&&Vt(t)}}}function Xb(e){let t;function n(l,h){return l[2]>0?wP:xP}let r=n(e),o=r(e);return{c(){o.c(),t=Co()},m(l,h){o.m(l,h),Ut(l,t,h)},p(l,h){r===(r=n(l))&&o?o.p(l,h):(o.d(1),o=r(l),o&&(o.c(),o.m(t.parentNode,t)))},d(l){l&&Vt(t),o.d(l)}}}function SP(e){let t,n,r,o=_o(e[0]),l=[];for(let y=0;y{"colorScale"in h&&n(0,r=h.colorScale),"limits"in h&&n(1,o=h.limits),"decimalPlaces"in h&&n(2,l=h.decimalPlaces)},[r,o,l]}class IP extends fn{constructor(t){super(),hn(this,t,EP,SP,en,{colorScale:0,limits:1,decimalPlaces:2})}}function il(e){if(e==null||e==null)throw new Error("Oops, notNull given something null");return e}var Yb=Object.prototype.toString,gS=function(t){var n=Yb.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Yb.call(t.callee)==="[object Function]"),r},A_,Kb;function CP(){if(Kb)return A_;Kb=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=gS,o=Object.prototype.propertyIsEnumerable,l=!o.call({toString:null},"toString"),h=o.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],y=function(P){var F=P.constructor;return F&&F.prototype===P},w={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},S=function(){if(typeof window>"u")return!1;for(var P in window)try{if(!w["$"+P]&&t.call(window,P)&&window[P]!==null&&typeof window[P]=="object")try{y(window[P])}catch{return!0}}catch{return!0}return!1}(),C=function(P){if(typeof window>"u"||!S)return y(P);try{return y(P)}catch{return!1}};e=function(F){var R=F!==null&&typeof F=="object",Y=n.call(F)==="[object Function]",J=r(F),K=R&&n.call(F)==="[object String]",O=[];if(!R&&!Y&&!J)throw new TypeError("Object.keys called on a non-object");var G=h&&Y;if(K&&F.length>0&&!t.call(F,0))for(var q=0;q0)for(var ot=0;ot"u"||!Oi?Dn:Oi(Uint8Array),bc={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Dn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Dn:ArrayBuffer,"%ArrayIteratorPrototype%":jh&&Oi?Oi([][Symbol.iterator]()):Dn,"%AsyncFromSyncIteratorPrototype%":Dn,"%AsyncFunction%":Kh,"%AsyncGenerator%":Kh,"%AsyncGeneratorFunction%":Kh,"%AsyncIteratorPrototype%":Kh,"%Atomics%":typeof Atomics>"u"?Dn:Atomics,"%BigInt%":typeof BigInt>"u"?Dn:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Dn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Dn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Dn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":XP,"%eval%":eval,"%EvalError%":YP,"%Float32Array%":typeof Float32Array>"u"?Dn:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Dn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Dn:FinalizationRegistry,"%Function%":vS,"%GeneratorFunction%":Kh,"%Int8Array%":typeof Int8Array>"u"?Dn:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Dn:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Dn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":jh&&Oi?Oi(Oi([][Symbol.iterator]())):Dn,"%JSON%":typeof JSON=="object"?JSON:Dn,"%Map%":typeof Map>"u"?Dn:Map,"%MapIteratorPrototype%":typeof Map>"u"||!jh||!Oi?Dn:Oi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Dn:Promise,"%Proxy%":typeof Proxy>"u"?Dn:Proxy,"%RangeError%":KP,"%ReferenceError%":JP,"%Reflect%":typeof Reflect>"u"?Dn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Dn:Set,"%SetIteratorPrototype%":typeof Set>"u"||!jh||!Oi?Dn:Oi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Dn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":jh&&Oi?Oi(""[Symbol.iterator]()):Dn,"%Symbol%":jh?Symbol:Dn,"%SyntaxError%":rf,"%ThrowTypeError%":$P,"%TypedArray%":eM,"%TypeError%":ef,"%Uint8Array%":typeof Uint8Array>"u"?Dn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Dn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Dn:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Dn:Uint32Array,"%URIError%":QP,"%WeakMap%":typeof WeakMap>"u"?Dn:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Dn:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Dn:WeakSet};if(Oi)try{null.error}catch(e){var nM=Oi(Oi(e));bc["%Error.prototype%"]=nM}var rM=function e(t){var n;if(t==="%AsyncFunction%")n=D_("async function () {}");else if(t==="%GeneratorFunction%")n=D_("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=D_("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Oi&&(n=Oi(o.prototype))}return bc[t]=n,n},ex={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},kd=iv,bg=_S,iM=kd.call(Function.call,Array.prototype.concat),oM=kd.call(Function.apply,Array.prototype.splice),nx=kd.call(Function.call,String.prototype.replace),xg=kd.call(Function.call,String.prototype.slice),sM=kd.call(Function.call,RegExp.prototype.exec),aM=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,lM=/\\(\\)?/g,uM=function(t){var n=xg(t,0,1),r=xg(t,-1);if(n==="%"&&r!=="%")throw new rf("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new rf("invalid intrinsic syntax, expected opening `%`");var o=[];return nx(t,aM,function(l,h,u,y){o[o.length]=u?nx(y,lM,"$1"):h||l}),o},cM=function(t,n){var r=t,o;if(bg(ex,r)&&(o=ex[r],r="%"+o[0]+"%"),bg(bc,r)){var l=bc[r];if(l===Kh&&(l=rM(r)),typeof l>"u"&&!n)throw new ef("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:r,value:l}}throw new rf("intrinsic "+t+" does not exist!")},fl=function(t,n){if(typeof t!="string"||t.length===0)throw new ef("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new ef('"allowMissing" argument must be a boolean');if(sM(/^%?[^%]*%?$/,t)===null)throw new rf("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=uM(t),o=r.length>0?r[0]:"",l=cM("%"+o+"%",n),h=l.name,u=l.value,y=!1,w=l.alias;w&&(o=w[0],oM(r,iM([0,1],w)));for(var S=1,C=!0;S=r.length){var Y=vc(u,P);C=!!Y,C&&"get"in Y&&!("originalValue"in Y.get)?u=Y.get:u=u[P]}else C=bg(u,P),u=u[P];C&&!y&&(bc[h]=u)}}return u},N_,rx;function ov(){if(rx)return N_;rx=1;var e=fl,t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return N_=t,N_}var hM=fl,ug=hM("%Object.getOwnPropertyDescriptor%",!0);if(ug)try{ug([],"length")}catch{ug=null}var sv=ug,ix=ov(),fM=yS,Wh=Uu,ox=sv,av=function(t,n,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Wh("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new Wh("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Wh("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Wh("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Wh("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Wh("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,y=!!ox&&ox(t,n);if(ix)ix(t,n,{configurable:h===null&&y?y.configurable:!h,enumerable:o===null&&y?y.enumerable:!o,value:r,writable:l===null&&y?y.writable:!l});else if(u||!o&&!l&&!h)t[n]=r;else throw new fM("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},l0=ov(),bS=function(){return!!l0};bS.hasArrayLengthDefineBug=function(){if(!l0)return null;try{return l0([],"length",{value:1}).length!==1}catch{return!0}};var lv=bS,pM=nv,dM=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",mM=Object.prototype.toString,gM=Array.prototype.concat,sx=av,yM=function(e){return typeof e=="function"&&mM.call(e)==="[object Function]"},xS=lv(),_M=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!yM(r)||!r())return}xS?sx(e,t,n,!0):sx(e,t,n)},wS=function(e,t){var n=arguments.length>2?arguments[2]:{},r=pM(t);dM&&(r=gM.call(r,Object.getOwnPropertySymbols(t)));for(var o=0;o4294967295||xM(n)!==n)throw new ux("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],o=!0,l=!0;if("length"in t&&lx){var h=lx(t,"length");h&&!h.configurable&&(o=!1),h&&!h.writable&&(l=!1)}return(o||l||!r)&&(bM?ax(t,"length",n,!0,!0):ax(t,"length",n)),t};(function(e){var t=iv,n=fl,r=wM,o=Uu,l=n("%Function.prototype.apply%"),h=n("%Function.prototype.call%"),u=n("%Reflect.apply%",!0)||t.call(h,l),y=ov(),w=n("%Math.max%");e.exports=function(P){if(typeof P!="function")throw new o("a function is required");var F=u(t,h,arguments);return r(F,1+w(0,P.length-(arguments.length-1)),!0)};var S=function(){return u(t,l,arguments)};y?y(e.exports,"apply",{value:S}):e.exports.apply=S})(SS);var Af=SS.exports,ES=fl,IS=Af,SM=IS(ES("String.prototype.indexOf")),la=function(t,n){var r=ES(t,!!n);return typeof r=="function"&&SM(t,".prototype.")>-1?IS(r):r},EM=nv,CS=ty(),TS=la,cx=Object,IM=TS("Array.prototype.push"),hx=TS("Object.prototype.propertyIsEnumerable"),CM=CS?Object.getOwnPropertySymbols:null,LS=function(t,n){if(t==null)throw new TypeError("target must be an object");var r=cx(t);if(arguments.length===1)return r;for(var o=1;o2&&!!arguments[2];return(!r||UM)&&(VM?fx(t,"name",n,!0,!0):fx(t,"name",n)),t},jM=qM,WM=Uu,ZM=Object,kS=jM(function(){if(this==null||this!==ZM(this))throw new WM("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0),HM=kS,XM=Fc.supportsDescriptors,YM=Object.getOwnPropertyDescriptor,DS=function(){if(XM&&/a/mig.flags==="gim"){var t=YM(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var n="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){n+="d"}}),Object.defineProperty(r,"sticky",{get:function(){n+="y"}}),n==="dy")return t.get}}return HM},KM=Fc.supportsDescriptors,JM=DS,QM=Object.getOwnPropertyDescriptor,$M=Object.defineProperty,tA=TypeError,px=Object.getPrototypeOf,eA=/a/,nA=function(){if(!KM||!px)throw new tA("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=JM(),n=px(eA),r=QM(n,"flags");return(!r||r.get!==t)&&$M(n,"flags",{configurable:!0,enumerable:!1,get:t}),t},rA=Fc,iA=Af,oA=kS,RS=DS,sA=nA,NS=iA(RS());rA(NS,{getPolyfill:RS,implementation:oA,shim:sA});var aA=NS,cg={exports:{}},lA=ty,Bc=function(){return lA()&&!!Symbol.toStringTag},uA=Bc(),cA=la,u0=cA("Object.prototype.toString"),ey=function(t){return uA&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:u0(t)==="[object Arguments]"},OS=function(t){return ey(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&u0(t)!=="[object Array]"&&u0(t.callee)==="[object Function]"},hA=function(){return ey(arguments)}();ey.isLegacyArguments=OS;var zS=hA?ey:OS;const fA={},pA=Object.freeze(Object.defineProperty({__proto__:null,default:fA},Symbol.toStringTag,{value:"Module"})),dA=Qg(pA);var uv=typeof Map=="function"&&Map.prototype,z_=Object.getOwnPropertyDescriptor&&uv?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,wg=uv&&z_&&typeof z_.get=="function"?z_.get:null,dx=uv&&Map.prototype.forEach,cv=typeof Set=="function"&&Set.prototype,F_=Object.getOwnPropertyDescriptor&&cv?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Sg=cv&&F_&&typeof F_.get=="function"?F_.get:null,mx=cv&&Set.prototype.forEach,mA=typeof WeakMap=="function"&&WeakMap.prototype,id=mA?WeakMap.prototype.has:null,gA=typeof WeakSet=="function"&&WeakSet.prototype,od=gA?WeakSet.prototype.has:null,yA=typeof WeakRef=="function"&&WeakRef.prototype,gx=yA?WeakRef.prototype.deref:null,_A=Boolean.prototype.valueOf,vA=Object.prototype.toString,bA=Function.prototype.toString,xA=String.prototype.match,hv=String.prototype.slice,Su=String.prototype.replace,wA=String.prototype.toUpperCase,yx=String.prototype.toLowerCase,FS=RegExp.prototype.test,_x=Array.prototype.concat,tl=Array.prototype.join,SA=Array.prototype.slice,vx=Math.floor,c0=typeof BigInt=="function"?BigInt.prototype.valueOf:null,B_=Object.getOwnPropertySymbols,h0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,of=typeof Symbol=="function"&&typeof Symbol.iterator=="object",xo=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===of||"symbol")?Symbol.toStringTag:null,BS=Object.prototype.propertyIsEnumerable,bx=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function xx(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||FS.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-vx(-e):vx(e);if(r!==e){var o=String(r),l=hv.call(t,o.length+1);return Su.call(o,n,"$&_")+"."+Su.call(Su.call(l,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Su.call(t,n,"$&_")}var f0=dA,wx=f0.custom,Sx=US(wx)?wx:null,EA=function e(t,n,r,o){var l=n||{};if(bu(l,"quoteStyle")&&l.quoteStyle!=="single"&&l.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(bu(l,"maxStringLength")&&(typeof l.maxStringLength=="number"?l.maxStringLength<0&&l.maxStringLength!==1/0:l.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=bu(l,"customInspect")?l.customInspect:!0;if(typeof h!="boolean"&&h!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(bu(l,"indent")&&l.indent!==null&&l.indent!==" "&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(bu(l,"numericSeparator")&&typeof l.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=l.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return qS(t,l);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var y=String(t);return u?xx(t,y):y}if(typeof t=="bigint"){var w=String(t)+"n";return u?xx(t,w):w}var S=typeof l.depth>"u"?5:l.depth;if(typeof r>"u"&&(r=0),r>=S&&S>0&&typeof t=="object")return p0(t)?"[Array]":"[Object]";var C=GA(l,r);if(typeof o>"u")o=[];else if(GS(o,t)>=0)return"[Circular]";function P($t,Ct,re){if(Ct&&(o=SA.call(o),o.push(Ct)),re){var pe={depth:l.depth};return bu(l,"quoteStyle")&&(pe.quoteStyle=l.quoteStyle),e($t,pe,r+1,o)}return e($t,l,r+1,o)}if(typeof t=="function"&&!Ex(t)){var F=DA(t),R=Ym(t,P);return"[Function"+(F?": "+F:" (anonymous)")+"]"+(R.length>0?" { "+tl.call(R,", ")+" }":"")}if(US(t)){var Y=of?Su.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):h0.call(t);return typeof t=="object"&&!of?Vp(Y):Y}if(BA(t)){for(var J="<"+yx.call(String(t.nodeName)),K=t.attributes||[],O=0;O",J}if(p0(t)){if(t.length===0)return"[]";var G=Ym(t,P);return C&&!UA(G)?"["+d0(G,C)+"]":"[ "+tl.call(G,", ")+" ]"}if(TA(t)){var q=Ym(t,P);return!("cause"in Error.prototype)&&"cause"in t&&!BS.call(t,"cause")?"{ ["+String(t)+"] "+tl.call(_x.call("[cause]: "+P(t.cause),q),", ")+" }":q.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+tl.call(q,", ")+" }"}if(typeof t=="object"&&h){if(Sx&&typeof t[Sx]=="function"&&f0)return f0(t,{depth:S-r});if(h!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(RA(t)){var ot=[];return dx&&dx.call(t,function($t,Ct){ot.push(P(Ct,t,!0)+" => "+P($t,t))}),Ix("Map",wg.call(t),ot,C)}if(zA(t)){var _t=[];return mx&&mx.call(t,function($t){_t.push(P($t,t))}),Ix("Set",Sg.call(t),_t,C)}if(NA(t))return V_("WeakMap");if(FA(t))return V_("WeakSet");if(OA(t))return V_("WeakRef");if(PA(t))return Vp(P(Number(t)));if(AA(t))return Vp(P(c0.call(t)));if(MA(t))return Vp(_A.call(t));if(LA(t))return Vp(P(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===Pd)return"{ [object globalThis] }";if(!CA(t)&&!Ex(t)){var ft=Ym(t,P),ct=bx?bx(t)===Object.prototype:t instanceof Object||t.constructor===Object,ht=t instanceof Object?"":"null prototype",Pt=!ct&&xo&&Object(t)===t&&xo in t?hv.call(Gu(t),8,-1):ht?"Object":"",$=ct||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",Lt=$+(Pt||ht?"["+tl.call(_x.call([],Pt||[],ht||[]),": ")+"] ":"");return ft.length===0?Lt+"{}":C?Lt+"{"+d0(ft,C)+"}":Lt+"{ "+tl.call(ft,", ")+" }"}return String(t)};function VS(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function IA(e){return Su.call(String(e),/"/g,""")}function p0(e){return Gu(e)==="[object Array]"&&(!xo||!(typeof e=="object"&&xo in e))}function CA(e){return Gu(e)==="[object Date]"&&(!xo||!(typeof e=="object"&&xo in e))}function Ex(e){return Gu(e)==="[object RegExp]"&&(!xo||!(typeof e=="object"&&xo in e))}function TA(e){return Gu(e)==="[object Error]"&&(!xo||!(typeof e=="object"&&xo in e))}function LA(e){return Gu(e)==="[object String]"&&(!xo||!(typeof e=="object"&&xo in e))}function PA(e){return Gu(e)==="[object Number]"&&(!xo||!(typeof e=="object"&&xo in e))}function MA(e){return Gu(e)==="[object Boolean]"&&(!xo||!(typeof e=="object"&&xo in e))}function US(e){if(of)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!h0)return!1;try{return h0.call(e),!0}catch{}return!1}function AA(e){if(!e||typeof e!="object"||!c0)return!1;try{return c0.call(e),!0}catch{}return!1}var kA=Object.prototype.hasOwnProperty||function(e){return e in this};function bu(e,t){return kA.call(e,t)}function Gu(e){return vA.call(e)}function DA(e){if(e.name)return e.name;var t=xA.call(bA.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function GS(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return qS(hv.call(e,0,t.maxStringLength),t)+r}var o=Su.call(Su.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,VA);return VS(o,"single",t)}function VA(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+wA.call(t.toString(16))}function Vp(e){return"Object("+e+")"}function V_(e){return e+" { ? }"}function Ix(e,t,n,r){var o=r?d0(n,r):tl.call(n,", ");return e+" ("+t+") {"+o+"}"}function UA(e){for(var t=0;t=0)return!1;return!0}function GA(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=tl.call(Array(e.indent+1)," ");else return null;return{base:n,prev:tl.call(Array(t+1),n)}}function d0(e,t){if(e.length===0)return"";var n=` +`+t.prev+t.base;return n+tl.call(e,","+n)+` +`+t.prev}function Ym(e,t){var n=p0(e),r=[];if(n){r.length=e.length;for(var o=0;o=r)return n+1;var o=Dx(t,n);if(o<55296||o>56319)return n+1;var l=Dx(t,n+1);return l<56320||l>57343?n+1:n+2},G_=function(t){var n=0;return{next:function(){var o=n>=t.length,l;return o||(l=t[n],n+=1),{done:o,value:l}}}},Rx=function(t,n){if(fk(t)||Px(t))return G_(t);if(pk(t)){var r=0;return{next:function(){var l=yk(t,r),h=gk(t,r,l);return r=l,{done:l>t.length,value:h}}}}if(n&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()};if(!dk&&!mk)cg.exports=function(t){if(t!=null)return Rx(t,!0)};else{var _k=YS,vk=JS,Nx=va("Map.prototype.forEach",!0),Ox=va("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var zx=va("Map.prototype.iterator",!0),Fx=va("Set.prototype.iterator",!0);var Bx=va("Map.prototype.@@iterator",!0)||va("Map.prototype._es6-shim iterator_",!0),Vx=va("Set.prototype.@@iterator",!0)||va("Set.prototype._es6-shim iterator_",!0),bk=function(t){if(_k(t)){if(zx)return Mx(zx(t));if(Bx)return Bx(t);if(Nx){var n=[];return Nx(t,function(o,l){kx(n,[l,o])}),G_(n)}}if(vk(t)){if(Fx)return Mx(Fx(t));if(Vx)return Vx(t);if(Ox){var r=[];return Ox(t,function(o){kx(r,o)}),G_(r)}}};cg.exports=function(t){return bk(t)||Rx(t)}}}var xk=cg.exports,Ux=function(e){return e!==e},QS=function(t,n){return t===0&&n===0?1/t===1/n:!!(t===n||Ux(t)&&Ux(n))},wk=QS,$S=function(){return typeof Object.is=="function"?Object.is:wk},Sk=$S,Ek=Fc,Ik=function(){var t=Sk();return Ek(Object,{is:t},{is:function(){return Object.is!==t}}),t},Ck=Fc,Tk=Af,Lk=QS,tE=$S,Pk=Ik,eE=Tk(tE(),Object);Ck(eE,{getPolyfill:tE,implementation:Lk,shim:Pk});var Mk=eE,Ak=Af,nE=la,kk=fl,m0=kk("%ArrayBuffer%",!0),hg=nE("ArrayBuffer.prototype.byteLength",!0),Dk=nE("Object.prototype.toString"),Gx=!!m0&&!hg&&new m0(0).slice,qx=!!Gx&&Ak(Gx),rE=hg||qx?function(t){if(!t||typeof t!="object")return!1;try{return hg?hg(t):qx(t,0),!0}catch{return!1}}:m0?function(t){return Dk(t)==="[object ArrayBuffer]"}:function(t){return!1},Rk=Date.prototype.getDay,Nk=function(t){try{return Rk.call(t),!0}catch{return!1}},Ok=Object.prototype.toString,zk="[object Date]",Fk=Bc(),Bk=function(t){return typeof t!="object"||t===null?!1:Fk?Nk(t):Ok.call(t)===zk},g0=la,iE=Bc(),oE,sE,y0,_0;if(iE){oE=g0("Object.prototype.hasOwnProperty"),sE=g0("RegExp.prototype.exec"),y0={};var q_=function(){throw y0};_0={toString:q_,valueOf:q_},typeof Symbol.toPrimitive=="symbol"&&(_0[Symbol.toPrimitive]=q_)}var Vk=g0("Object.prototype.toString"),Uk=Object.getOwnPropertyDescriptor,Gk="[object RegExp]",qk=iE?function(t){if(!t||typeof t!="object")return!1;var n=Uk(t,"lastIndex"),r=n&&oE(n,"value");if(!r)return!1;try{sE(t,_0)}catch(o){return o===y0}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:Vk(t)===Gk},jk=la,jx=jk("SharedArrayBuffer.prototype.byteLength",!0),Wk=jx?function(t){if(!t||typeof t!="object")return!1;try{return jx(t),!0}catch{return!1}}:function(t){return!1},Zk=Number.prototype.toString,Hk=function(t){try{return Zk.call(t),!0}catch{return!1}},Xk=Object.prototype.toString,Yk="[object Number]",Kk=Bc(),Jk=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:Kk?Hk(t):Xk.call(t)===Yk},aE=la,Qk=aE("Boolean.prototype.toString"),$k=aE("Object.prototype.toString"),t3=function(t){try{return Qk(t),!0}catch{return!1}},e3="[object Boolean]",n3=Bc(),r3=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:n3&&Symbol.toStringTag in t?t3(t):$k(t)===e3},v0={exports:{}},i3=Object.prototype.toString,o3=rv();if(o3){var s3=Symbol.prototype.toString,a3=/^Symbol\(.*\)$/,l3=function(t){return typeof t.valueOf()!="symbol"?!1:a3.test(s3.call(t))};v0.exports=function(t){if(typeof t=="symbol")return!0;if(i3.call(t)!=="[object Symbol]")return!1;try{return l3(t)}catch{return!1}}}else v0.exports=function(t){return!1};var u3=v0.exports,b0={exports:{}},Wx=typeof BigInt<"u"&&BigInt,c3=function(){return typeof Wx=="function"&&typeof BigInt=="function"&&typeof Wx(42)=="bigint"&&typeof BigInt(42)=="bigint"},h3=c3();if(h3){var f3=BigInt.prototype.valueOf,p3=function(t){try{return f3.call(t),!0}catch{}return!1};b0.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:p3(t)}}else b0.exports=function(t){return!1};var d3=b0.exports,m3=HS,g3=Jk,y3=r3,_3=u3,v3=d3,b3=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(m3(t))return"String";if(g3(t))return"Number";if(y3(t))return"Boolean";if(_3(t))return"Symbol";if(v3(t))return"BigInt"},Cg=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Zx=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Tg;Cg||(Tg=function(t){return!1});var x0=Cg?Cg.prototype.has:null,j_=Zx?Zx.prototype.has:null;!Tg&&!x0&&(Tg=function(t){return!1});var x3=Tg||function(t){if(!t||typeof t!="object")return!1;try{if(x0.call(t,x0),j_)try{j_.call(t,j_)}catch{return!0}return t instanceof Cg}catch{}return!1},w0={exports:{}},w3=fl,lE=la,S3=w3("%WeakSet%",!0),W_=lE("WeakSet.prototype.has",!0);if(W_){var Z_=lE("WeakMap.prototype.has",!0);w0.exports=function(t){if(!t||typeof t!="object")return!1;try{if(W_(t,W_),Z_)try{Z_(t,Z_)}catch{return!0}return t instanceof S3}catch{}return!1}}else w0.exports=function(t){return!1};var E3=w0.exports,I3=YS,C3=JS,T3=x3,L3=E3,P3=function(t){if(t&&typeof t=="object"){if(I3(t))return"Map";if(C3(t))return"Set";if(T3(t))return"WeakMap";if(L3(t))return"WeakSet"}return!1},uE=Function.prototype.toString,Qh=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,S0,fg;if(typeof Qh=="function"&&typeof Object.defineProperty=="function")try{S0=Object.defineProperty({},"length",{get:function(){throw fg}}),fg={},Qh(function(){throw 42},null,S0)}catch(e){e!==fg&&(Qh=null)}else Qh=null;var M3=/^\s*class\b/,E0=function(t){try{var n=uE.call(t);return M3.test(n)}catch{return!1}},H_=function(t){try{return E0(t)?!1:(uE.call(t),!0)}catch{return!1}},pg=Object.prototype.toString,A3="[object Object]",k3="[object Function]",D3="[object GeneratorFunction]",R3="[object HTMLAllCollection]",N3="[object HTML document.all class]",O3="[object HTMLCollection]",z3=typeof Symbol=="function"&&!!Symbol.toStringTag,F3=!(0 in[,]),I0=function(){return!1};if(typeof document=="object"){var B3=document.all;pg.call(B3)===pg.call(document.all)&&(I0=function(t){if((F3||!t)&&(typeof t>"u"||typeof t=="object"))try{var n=pg.call(t);return(n===R3||n===N3||n===O3||n===A3)&&t("")==null}catch{}return!1})}var V3=Qh?function(t){if(I0(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Qh(t,null,S0)}catch(n){if(n!==fg)return!1}return!E0(t)&&H_(t)}:function(t){if(I0(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(z3)return H_(t);if(E0(t))return!1;var n=pg.call(t);return n!==k3&&n!==D3&&!/^\[object HTML/.test(n)?!1:H_(t)},U3=V3,G3=Object.prototype.toString,cE=Object.prototype.hasOwnProperty,q3=function(t,n,r){for(var o=0,l=t.length;o=3&&(o=r),G3.call(t)==="[object Array]"?q3(t,n,o):typeof t=="string"?j3(t,n,o):W3(t,n,o)},H3=Z3,X3=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],X_=X3,Y3=typeof globalThis>"u"?Pd:globalThis,K3=function(){for(var t=[],n=0;n"u"?Pd:globalThis,C0=J3(),yv=gv("String.prototype.slice"),Y_=Object.getPrototypeOf,$3=gv("Array.prototype.indexOf",!0)||function(t,n){for(var r=0;r-1?n:n!=="Object"?!1:eD(t)}return dg?tD(t):null},rD=la,Yx=rD("ArrayBuffer.prototype.byteLength",!0),iD=rE,oD=function(t){return iD(t)?Yx?Yx(t):t.byteLength:NaN},fE=zM,pl=la,Kx=aA,sD=fl,sf=xk,aD=WS,Jx=Mk,Qx=zS,$x=ZS,tw=rE,ew=Bk,nw=qk,rw=Wk,iw=nv,ow=b3,sw=P3,aw=nD,lw=oD,uw=pl("SharedArrayBuffer.prototype.byteLength",!0),cw=pl("Date.prototype.getTime"),K_=Object.getPrototypeOf,hw=pl("Object.prototype.toString"),Mg=sD("%Set%",!0),T0=pl("Map.prototype.has",!0),Ag=pl("Map.prototype.get",!0),fw=pl("Map.prototype.size",!0),kg=pl("Set.prototype.add",!0),pE=pl("Set.prototype.delete",!0),Dg=pl("Set.prototype.has",!0),mg=pl("Set.prototype.size",!0);function pw(e,t,n,r){for(var o=sf(e),l;(l=o.next())&&!l.done;)if(wa(t,l.value,n,r))return pE(e,l.value),!0;return!1}function dE(e){if(typeof e>"u")return null;if(typeof e!="object")return typeof e=="symbol"?!1:typeof e=="string"||typeof e=="number"?+e==+e:!0}function lD(e,t,n,r,o,l){var h=dE(n);if(h!=null)return h;var u=Ag(t,h),y=fE({},o,{strict:!1});return typeof u>"u"&&!T0(t,h)||!wa(r,u,y,l)?!1:!T0(e,h)&&wa(r,u,y,l)}function uD(e,t,n){var r=dE(n);return r??(Dg(t,r)&&!Dg(e,r))}function dw(e,t,n,r,o,l){for(var h=sf(e),u,y;(u=h.next())&&!u.done;)if(y=u.value,wa(n,y,o,l)&&wa(r,Ag(t,y),o,l))return pE(e,y),!0;return!1}function wa(e,t,n,r){var o=n||{};if(o.strict?Jx(e,t):e===t)return!0;var l=ow(e),h=ow(t);if(l!==h)return!1;if(!e||!t||typeof e!="object"&&typeof t!="object")return o.strict?Jx(e,t):e==t;var u=r.has(e),y=r.has(t),w;if(u&&y){if(r.get(e)===r.get(t))return!0}else w={};return u||r.set(e,w),y||r.set(t,w),fD(e,t,o,r)}function mw(e){return!e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function cD(e,t,n,r){if(mg(e)!==mg(t))return!1;for(var o=sf(e),l=sf(t),h,u,y;(h=o.next())&&!h.done;)if(h.value&&typeof h.value=="object")y||(y=new Mg),kg(y,h.value);else if(!Dg(t,h.value)){if(n.strict||!uD(e,t,h.value))return!1;y||(y=new Mg),kg(y,h.value)}if(y){for(;(u=l.next())&&!u.done;)if(u.value&&typeof u.value=="object"){if(!pw(y,u.value,n.strict,r))return!1}else if(!n.strict&&!Dg(e,u.value)&&!pw(y,u.value,n.strict,r))return!1;return mg(y)===0}return!0}function hD(e,t,n,r){if(fw(e)!==fw(t))return!1;for(var o=sf(e),l=sf(t),h,u,y,w,S,C;(h=o.next())&&!h.done;)if(w=h.value[0],S=h.value[1],w&&typeof w=="object")y||(y=new Mg),kg(y,w);else if(C=Ag(t,w),typeof C>"u"&&!T0(t,w)||!wa(S,C,n,r)){if(n.strict||!lD(e,t,w,S,n,r))return!1;y||(y=new Mg),kg(y,w)}if(y){for(;(u=l.next())&&!u.done;)if(w=u.value[0],C=u.value[1],w&&typeof w=="object"){if(!dw(y,e,w,C,n,r))return!1}else if(!n.strict&&(!e.has(w)||!wa(Ag(e,w),C,n,r))&&!dw(y,e,w,C,fE({},n,{strict:!1}),r))return!1;return mg(y)===0}return!0}function fD(e,t,n,r){var o,l;if(typeof e!=typeof t||e==null||t==null||hw(e)!==hw(t)||Qx(e)!==Qx(t))return!1;var h=$x(e),u=$x(t);if(h!==u)return!1;var y=e instanceof Error,w=t instanceof Error;if(y!==w||(y||w)&&(e.name!==t.name||e.message!==t.message))return!1;var S=nw(e),C=nw(t);if(S!==C||(S||C)&&(e.source!==t.source||Kx(e)!==Kx(t)))return!1;var P=ew(e),F=ew(t);if(P!==F||(P||F)&&cw(e)!==cw(t)||n.strict&&K_&&K_(e)!==K_(t))return!1;var R=aw(e),Y=aw(t);if(R!==Y)return!1;if(R||Y){if(e.length!==t.length)return!1;for(o=0;o=0;o--)if(_t[o]!=ft[o])return!1;for(o=_t.length-1;o>=0;o--)if(l=_t[o],!wa(e[l],t[l],n,r))return!1;var ct=sw(e),ht=sw(t);return ct!==ht?!1:ct==="Set"||ht==="Set"?cD(e,t,n,r):ct==="Map"?hD(e,t,n,r):!0}var pD=function(t,n,r){return wa(t,n,r,aD())};const dD=tv(pD);var mD=Object.defineProperty,Yn=(e,t)=>mD(e,"name",{value:t,configurable:!0}),gD=class{constructor(t){this.direction=!1,this.compareProperties=!0;var n,r,o;this.precision=10**-((n=t==null?void 0:t.precision)!=null?n:17),this.direction=(r=t==null?void 0:t.direction)!=null?r:!1,this.compareProperties=(o=t==null?void 0:t.compareProperties)!=null?o:!0}compare(t,n){if(t.type!==n.type||!Jp(t,n))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,n.coordinates);case"LineString":return this.compareLine(t.coordinates,n.coordinates);case"Polygon":return this.comparePolygon(t,n);case"GeometryCollection":return this.compareGeometryCollection(t,n);case"Feature":return this.compareFeature(t,n);case"FeatureCollection":return this.compareFeatureCollection(t,n);default:if(t.type.startsWith("Multi")){const r=L0(t),o=L0(n);return r.every(l=>o.some(h=>this.compare(l,h)))}}return!1}compareCoord(t,n){return t.length===n.length&&t.every((r,o)=>Math.abs(r-n[o])=0&&(r=[].concat(t.slice(o,t.length),t.slice(1,o+1))),r}comparePath(t,n){return t.every((r,o)=>this.compareCoord(r,n[o]))}comparePolygon(t,n){if(this.compareLine(t.coordinates[0],n.coordinates[0],1,!0)){const r=t.coordinates.slice(1,t.coordinates.length),o=n.coordinates.slice(1,n.coordinates.length);return r.every(l=>o.some(h=>this.compareLine(l,h,1,!0)))}return!1}compareGeometryCollection(t,n){return Jp(t.geometries,n.geometries)&&this.compareBBox(t,n)&&t.geometries.every((r,o)=>this.compare(r,n.geometries[o]))}compareFeature(t,n){return t.id===n.id&&(this.compareProperties?dD(t.properties,n.properties):!0)&&this.compareBBox(t,n)&&this.compare(t.geometry,n.geometry)}compareFeatureCollection(t,n){return Jp(t.features,n.features)&&this.compareBBox(t,n)&&t.features.every((r,o)=>this.compare(r,n.features[o]))}compareBBox(t,n){return!t.bbox&&!n.bbox||(t.bbox&&n.bbox?this.compareCoord(t.bbox,n.bbox):!1)}};Yn(gD,"GeojsonEquality");function Jp(e,t){return e.coordinates?e.coordinates.length===t.coordinates.length:e.length===t.length}Yn(Jp,"sameLength");function L0(e){return e.coordinates.map(t=>({type:e.type.replace("Multi",""),coordinates:t}))}Yn(L0,"explode");var vs=63710088e-1,mE={centimeters:vs*100,centimetres:vs*100,degrees:360/(2*Math.PI),feet:vs*3.28084,inches:vs*39.37,kilometers:vs/1e3,kilometres:vs/1e3,meters:vs,metres:vs,miles:vs/1609.344,millimeters:vs*1e3,millimetres:vs*1e3,nauticalmiles:vs/1852,radians:1,yards:vs*1.0936},gw={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,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function ol(e,t,n={}){const r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}Yn(ol,"feature");function yD(e,t,n={}){switch(e){case"Point":return Nl(t).geometry;case"LineString":return zl(t).geometry;case"Polygon":return _v(t).geometry;case"MultiPoint":return yE(t).geometry;case"MultiLineString":return gE(t).geometry;case"MultiPolygon":return _E(t).geometry;default:throw new Error(e+" is invalid")}}Yn(yD,"geometry");function Nl(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Rg(e[0])||!Rg(e[1]))throw new Error("coordinates must contain numbers");return ol({type:"Point",coordinates:e},t,n)}Yn(Nl,"point");function _D(e,t,n={}){return ny(e.map(r=>Nl(r,t)),n)}Yn(_D,"points");function _v(e,t,n={}){for(const o of e){if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(let l=0;l_v(r,t)),n)}Yn(vD,"polygons");function zl(e,t,n={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return ol({type:"LineString",coordinates:e},t,n)}Yn(zl,"lineString");function bD(e,t,n={}){return ny(e.map(r=>zl(r,t)),n)}Yn(bD,"lineStrings");function ny(e,t={}){const n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}Yn(ny,"featureCollection");function gE(e,t,n={}){return ol({type:"MultiLineString",coordinates:e},t,n)}Yn(gE,"multiLineString");function yE(e,t,n={}){return ol({type:"MultiPoint",coordinates:e},t,n)}Yn(yE,"multiPoint");function _E(e,t,n={}){return ol({type:"MultiPolygon",coordinates:e},t,n)}Yn(_E,"multiPolygon");function xD(e,t,n={}){return ol({type:"GeometryCollection",geometries:e},t,n)}Yn(xD,"geometryCollection");function wD(e,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");const n=Math.pow(10,t||0);return Math.round(e*n)/n}Yn(wD,"round");function vE(e,t="kilometers"){const n=mE[t];if(!n)throw new Error(t+" units is invalid");return e*n}Yn(vE,"radiansToLength");function vv(e,t="kilometers"){const n=mE[t];if(!n)throw new Error(t+" units is invalid");return e/n}Yn(vv,"lengthToRadians");function SD(e,t){return bE(vv(e,t))}Yn(SD,"lengthToDegrees");function ED(e){let t=e%360;return t<0&&(t+=360),t}Yn(ED,"bearingToAzimuth");function bE(e){return e%(2*Math.PI)*180/Math.PI}Yn(bE,"radiansToDegrees");function ID(e){return e%360*Math.PI/180}Yn(ID,"degreesToRadians");function CD(e,t="kilometers",n="kilometers"){if(!(e>=0))throw new Error("length must be a positive number");return vE(vv(e,t),n)}Yn(CD,"convertLength");function TD(e,t="meters",n="kilometers"){if(!(e>=0))throw new Error("area must be a positive number");const r=gw[t];if(!r)throw new Error("invalid original units");const o=gw[n];if(!o)throw new Error("invalid final units");return e/r*o}Yn(TD,"convertArea");function Rg(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}Yn(Rg,"isNumber");function bv(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}Yn(bv,"isObject");function LD(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(t=>{if(!Rg(t))throw new Error("bbox must only contain numbers")})}Yn(LD,"validateBBox");function PD(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}Yn(PD,"validateId");var MD=Object.defineProperty,so=(e,t)=>MD(e,"name",{value:t,configurable:!0});function Df(e,t,n){if(e!==null)for(var r,o,l,h,u,y,w,S=0,C=0,P,F=e.type,R=F==="FeatureCollection",Y=F==="Feature",J=R?e.features.length:1,K=0;Ky||R>w||Y>S){u=C,y=r,w=R,S=Y,l=0;return}var J=zl([u,C],n.properties);if(t(J,r,o,Y,l)===!1)return!1;l++,u=C})===!1)return!1}}})}so(SE,"segmentEach");function zD(e,t,n){var r=n,o=!1;return SE(e,function(l,h,u,y,w){o===!1&&n===void 0?r=l:r=t(r,l,h,u,y,w),o=!0}),r}so(zD,"segmentReduce");function EE(e,t){if(!e)throw new Error("geojson is required");ry(e,function(n,r,o){if(n.geometry!==null){var l=n.geometry.type,h=n.geometry.coordinates;switch(l){case"LineString":if(t(n,r,o,0,0)===!1)return!1;break;case"Polygon":for(var u=0;uUD(e,"name",{value:t,configurable:!0});function wv(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;const n=[1/0,1/0,-1/0,-1/0];return Df(e,r=>{n[0]>r[0]&&(n[0]=r[0]),n[1]>r[1]&&(n[1]=r[1]),n[2]t in e?WD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yw=(e,t,n)=>(ZD(e,typeof t!="symbol"?t+"":t,n),n);function cd(){}function IE(e){return e()}function _w(){return Object.create(null)}function iy(e){e.forEach(IE)}function CE(e){return typeof e=="function"}function HD(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function XD(e){return Object.keys(e).length===0}function YD(e,t){e.appendChild(t)}function KD(e,t,n){e.insertBefore(t,n||null)}function TE(e){e.parentNode&&e.parentNode.removeChild(e)}function vw(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function yu(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function JD(e){return Array.from(e.childNodes)}function Qm(e,t,n){e.classList.toggle(t,!!n)}let Sv;function sd(e){Sv=e}const Jh=[],bw=[];let nf=[];const xw=[],QD=Promise.resolve();let P0=!1;function $D(){P0||(P0=!0,QD.then(LE))}function M0(e){nf.push(e)}const J_=new Set;let Zh=0;function LE(){if(Zh!==0)return;const e=Sv;do{try{for(;Zhe.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),nf=t}const n4=new Set;function r4(e,t){e&&e.i&&(n4.delete(e),e.i(t))}function i4(e,t,n){const{fragment:r,after_update:o}=e.$$;r&&r.m(t,n),M0(()=>{const l=e.$$.on_mount.map(IE).filter(CE);e.$$.on_destroy?e.$$.on_destroy.push(...l):iy(l),e.$$.on_mount=[]}),o.forEach(M0)}function o4(e,t){const n=e.$$;n.fragment!==null&&(e4(n.after_update),iy(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function s4(e,t){e.$$.dirty[0]===-1&&(Jh.push(e),$D(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const R=F.length?F[0]:P;return w.ctx&&o(w.ctx[C],w.ctx[C]=R)&&(!w.skip_bound&&w.bound[C]&&w.bound[C](R),S&&s4(e,C)),P}):[],w.update(),S=!0,iy(w.before_update),w.fragment=r?r(w.ctx):!1,t.target){if(t.hydrate){const C=JD(t.target);w.fragment&&w.fragment.l(C),C.forEach(TE)}else w.fragment&&w.fragment.c();t.intro&&r4(e.$$.fragment),i4(e,t.target,t.anchor),LE()}sd(y)}class l4{constructor(){yw(this,"$$"),yw(this,"$$set")}$destroy(){o4(this,1),this.$destroy=cd}$on(t,n){if(!CE(n))return cd;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const o=r.indexOf(n);o!==-1&&r.splice(o,1)}}$set(t){this.$$set&&!XD(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const u4="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(u4);function c4(e){let t,n,r;return{c(){t=vw("svg"),n=vw("path"),yu(n,"stroke-width","4"),yu(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"),yu(n,"class","svelte-gzo3ar"),yu(t,"width",r=e[0]==="list"?20:void 0),yu(t,"viewBox","0 0 70 85"),yu(t,"fill","none"),yu(t,"class","svelte-gzo3ar"),Qm(t,"in-map",e[0]!=="list"),Qm(t,"list-icon",e[0]==="list")},m(o,l){KD(o,t,l),YD(t,n)},p(o,[l]){l&1&&r!==(r=o[0]==="list"?20:void 0)&&yu(t,"width",r),l&1&&Qm(t,"in-map",o[0]!=="list"),l&1&&Qm(t,"list-icon",o[0]==="list")},i:cd,o:cd,d(o){o&&TE(t)}}}function h4(e,t,n){let{displayIn:r}=t;return e.$$set=o=>{"displayIn"in o&&n(0,r=o.displayIn)},[r]}class f4 extends l4{constructor(t){super(),a4(this,t,h4,c4,HD,{displayIn:0})}}const p4=[{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"}],d4={decimalLatitude:40.123,decimalLongitude:-74.123},m4=[{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}],g4=[{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 y4(){const e=[];return p4.forEach(t=>{t.decimalLatitude?e.push(t):e.push({...t,...d4})}),[...e,...m4,...g4]}const _4=y4();_4.map(e=>e.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 v4(e,t){var n={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},r,o,l,h;return h={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function u(w){return function(S){return y([w,S])}}function y(w){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,o&&(l=w[0]&2?o.return:w[0]?o.throw||((l=o.return)&&l.call(o),0):o.next)&&!(l=l.call(o,w[1])).done)return l;switch(o=0,l&&(w=[w[0]&2,l.value]),w[0]){case 0:case 1:l=w;break;case 4:return n.label++,{value:w[1],done:!1};case 5:n.label++,o=w[1],w=[0];continue;case 7:w=n.ops.pop(),n.trys.pop();continue;default:if(l=n.trys,!(l=l.length>0&&l[l.length-1])&&(w[0]===6||w[0]===2)){n=0;continue}if(w[0]===3&&(!l||w[1]>l[0]&&w[1]t?1:e0){if(t.right===null)break;if(n(e,t.right.key)>0){var u=t.right;if(t.right=u.left,u.left=t,t=u,t.right===null)break}o.right=t,o=t,t=t.right}else break}return o.right=t.left,l.left=t.right,t.left=r.right,t.right=r.left,t}function Q_(e,t,n,r){var o=new Mu(e,t);if(n===null)return o.left=o.right=null,o;n=xu(e,n,r);var l=r(e,n.key);return l<0?(o.left=n.left,o.right=n,n.left=null):l>=0&&(o.right=n.right,o.left=n,n.right=null),o}function ww(e,t,n){var r=null,o=null;if(t){t=xu(e,t,n);var l=n(t.key,e);l===0?(r=t.left,o=t.right):l<0?(o=t.right,t.right=null,r=t):(r=t.left,t.left=null,o=t)}return{left:r,right:o}}function x4(e,t,n){return t===null?e:(e===null||(t=xu(e.key,t,n),t.left=e),t)}function A0(e,t,n,r,o){if(e){r(""+t+(n?"└── ":"├── ")+o(e)+` +`);var l=t+(n?" ":"│ ");e.left&&A0(e.left,l,!1,r,o),e.right&&A0(e.right,l,!0,r,o)}}var Ev=function(){function e(t){t===void 0&&(t=b4),this._root=null,this._size=0,this._comparator=t}return e.prototype.insert=function(t,n){return this._size++,this._root=Q_(t,n,this._root,this._comparator)},e.prototype.add=function(t,n){var r=new Mu(t,n);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var o=this._comparator,l=xu(t,this._root,o),h=o(t,l.key);return h===0?this._root=l:(h<0?(r.left=l.left,r.right=l,l.left=null):h>0&&(r.right=l.right,r.left=l,l.right=null),this._size++,this._root=r),this._root},e.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},e.prototype._remove=function(t,n,r){var o;if(n===null)return null;n=xu(t,n,r);var l=r(t,n.key);return l===0?(n.left===null?o=n.right:(o=xu(t,n.left,r),o.right=n.right),this._size--,o):n},e.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=xu(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},e.prototype.findStatic=function(t){for(var n=this._root,r=this._comparator;n;){var o=r(t,n.key);if(o===0)return n;o<0?n=n.left:n=n.right}return null},e.prototype.find=function(t){return this._root&&(this._root=xu(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},e.prototype.contains=function(t){for(var n=this._root,r=this._comparator;n;){var o=r(t,n.key);if(o===0)return!0;o<0?n=n.left:n=n.right}return!1},e.prototype.forEach=function(t,n){for(var r=this._root,o=[],l=!1;!l;)r!==null?(o.push(r),r=r.left):o.length!==0?(r=o.pop(),t.call(n,r),r=r.right):l=!0;return this},e.prototype.range=function(t,n,r,o){for(var l=[],h=this._comparator,u=this._root,y;l.length!==0||u;)if(u)l.push(u),u=u.left;else{if(u=l.pop(),y=h(u.key,n),y>0)break;if(h(u.key,t)>=0&&r.call(o,u))return this;u=u.right}return this},e.prototype.keys=function(){var t=[];return this.forEach(function(n){var r=n.key;return t.push(r)}),t},e.prototype.values=function(){var t=[];return this.forEach(function(n){var r=n.data;return t.push(r)}),t},e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},e.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},e.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},e.prototype.at=function(t){for(var n=this._root,r=!1,o=0,l=[];!r;)if(n)l.push(n),n=n.left;else if(l.length>0){if(n=l.pop(),o===t)return n;o++,n=n.right}else r=!0;return null},e.prototype.next=function(t){var n=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var o=this._comparator;n;){var l=o(t.key,n.key);if(l===0)break;l<0?(r=n,n=n.left):n=n.right}return r},e.prototype.prev=function(t){var n=this._root,r=null;if(t.left!==null){for(r=t.left;r.right;)r=r.right;return r}for(var o=this._comparator;n;){var l=o(t.key,n.key);if(l===0)break;l<0?n=n.left:(r=n,n=n.right)}return r},e.prototype.clear=function(){return this._root=null,this._size=0,this},e.prototype.toList=function(){return S4(this._root)},e.prototype.load=function(t,n,r){n===void 0&&(n=[]),r===void 0&&(r=!1);var o=t.length,l=this._comparator;if(r&&R0(t,n,0,o-1,l),this._root===null)this._root=k0(t,n,0,o),this._size=o;else{var h=E4(this.toList(),w4(t,n),l);o=this._size+o,this._root=D0({head:h},0,o)}return this},e.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),e.prototype.toString=function(t){t===void 0&&(t=function(r){return String(r.key)});var n=[];return A0(this._root,"",!0,function(r){return n.push(r)},t),n.join("")},e.prototype.update=function(t,n,r){var o=this._comparator,l=ww(t,this._root,o),h=l.left,u=l.right;o(t,n)<0?u=Q_(n,r,u,o):h=Q_(n,r,h,o),this._root=x4(h,u,o)},e.prototype.split=function(t){return ww(t,this._root,this._comparator)},e.prototype[Symbol.iterator]=function(){var t,n,r;return v4(this,function(o){switch(o.label){case 0:t=this._root,n=[],r=!1,o.label=1;case 1:return r?[3,6]:t===null?[3,2]:(n.push(t),t=t.left,[3,5]);case 2:return n.length===0?[3,4]:(t=n.pop(),[4,t]);case 3:return o.sent(),t=t.right,[3,5];case 4:r=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},e}();function k0(e,t,n,r){var o=r-n;if(o>0){var l=n+Math.floor(o/2),h=e[l],u=t[l],y=new Mu(h,u);return y.left=k0(e,t,n,l),y.right=k0(e,t,l+1,r),y}return null}function w4(e,t){for(var n=new Mu(null,null),r=n,o=0;o0?(t=l=l.next=n.pop(),t=t.right):r=!0;return l.next=null,o.next}function D0(e,t,n){var r=n-t;if(r>0){var o=t+Math.floor(r/2),l=D0(e,t,o),h=e.head;return h.left=l,e.head=e.head.next,h.right=D0(e,o+1,n),h}return null}function E4(e,t,n){for(var r=new Mu(null,null),o=r,l=e,h=t;l!==null&&h!==null;)n(l.key,h.key)<0?(o.next=l,l=l.next):(o.next=h,h=h.next),o=o.next;return l!==null?o.next=l:h!==null&&(o.next=h),r.next}function R0(e,t,n,r,o){if(!(n>=r)){for(var l=e[n+r>>1],h=n-1,u=r+1;;){do h++;while(o(e[h],l)<0);do u--;while(o(e[u],l)>0);if(h>=u)break;var y=e[h];e[h]=e[u],e[u]=y,y=t[h],t[h]=t[u],t[u]=y}R0(e,t,n,u,o),R0(e,t,u+1,r,o)}}function ua(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sw(e,t){for(var n=0;nn.x?1:t.yn.y?1:0}}]);function e(t,n){ua(this,e),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=n}return Vo(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var n=t.point.events,r=0,o=n.length;r=0&&C>=0?wP?-1:0:y<0&&C<0?wP?1:0:Cy?1:0}}}]),e}(),M4=0,Og=function(){Vo(e,null,[{key:"compare",value:function(t,n){var r=t.leftSE.point.x,o=n.leftSE.point.x,l=t.rightSE.point.x,h=n.rightSE.point.x;if(hu&&y>w)return-1;var C=t.comparePoint(n.leftSE.point);if(C<0)return 1;if(C>0)return-1;var P=n.comparePoint(t.rightSE.point);return P!==0?P:-1}if(r>o){if(uy&&u>S)return 1;var F=n.comparePoint(t.leftSE.point);if(F!==0)return F;var R=t.comparePoint(n.rightSE.point);return R<0?1:R>0?-1:1}if(uy)return 1;if(lh){var J=t.comparePoint(n.rightSE.point);if(J<0)return 1;if(J>0)return-1}if(l!==h){var K=w-u,O=l-r,G=S-y,q=h-o;if(K>O&&Gq)return-1}return l>h?1:lS?1:t.idn.id?1:0}}]);function e(t,n,r,o){ua(this,e),this.id=++M4,this.leftSE=t,t.segment=this,t.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=t,this.rings=r,this.windings=o}return Vo(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:tn?t: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(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var n=this.leftSE.point,r=this.rightSE.point,o=this.vector();if(n.x===r.x)return t.x===n.x?0:t.x0&&u.swapEvents(),Ja.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(o.checkForConsuming(),l.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,r=this.windings.length;n0){var l=n;n=r,r=l}if(n.prev===r){var h=n;n=r,r=h}for(var u=0,y=r.rings.length;u0)o=n,l=t,h=-1;else throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));var y=new Ja(o,!0),w=new Ja(l,!1);return new e(y,w,[r],[h])}}]),e}(),Lw=function(){function e(t,n,r){if(ua(this,e),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=hd.round(t[0][0],t[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var l=o,h=1,u=t.length;hthis.bbox.ur.x&&(this.bbox.ur.x=y.x),y.y>this.bbox.ur.y&&(this.bbox.ur.y=y.y),l=y)}(o.x!==l.x||o.y!==l.y)&&this.segments.push(Og.fromRing(l,o,this))}return Vo(e,[{key:"getSweepEvents",value:function(){for(var t=[],n=0,r=this.segments.length;nthis.bbox.ur.x&&(this.bbox.ur.x=l.bbox.ur.x),l.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=l.bbox.ur.y),this.interiorRings.push(l)}this.multiPoly=n}return Vo(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),n=0,r=this.interiorRings.length;nthis.bbox.ur.x&&(this.bbox.ur.x=l.bbox.ur.x),l.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=l.bbox.ur.y),this.polys.push(l)}this.isSubject=n}return Vo(e,[{key:"getSweepEvents",value:function(){for(var t=[],n=0,r=this.polys.length;n0&&(t=o)}for(var l=t.segment.prevInResult(),h=l?l.prevInResult():null;;){if(!l)return null;if(!h)return l.ringOut;if(h.ringOut!==l.ringOut)return h.ringOut.enclosingRing()!==l.ringOut?l.ringOut:l.ringOut.enclosingRing();l=h.prevInResult(),h=l?l.prevInResult():null}}}]),e}(),Mw=function(){function e(t){ua(this,e),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return Vo(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(var n=0,r=this.interiorRings.length;n1&&arguments[1]!==void 0?arguments[1]:Og.compare;ua(this,e),this.queue=t,this.tree=new Ev(n),this.segments=[]}return Vo(e,[{key:"process",value:function(t){var n=t.segment,r=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(n),r;var o=t.isLeft?this.tree.insert(n):this.tree.find(n);if(!o)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 l=o,h=o,u=void 0,y=void 0;u===void 0;)l=this.tree.prev(l),l===null?u=null:l.key.consumedBy===void 0&&(u=l.key);for(;y===void 0;)h=this.tree.next(h),h===null?y=null:h.key.consumedBy===void 0&&(y=h.key);if(t.isLeft){var w=null;if(u){var S=u.getIntersection(n);if(S!==null&&(n.isAnEndpoint(S)||(w=S),!u.isAnEndpoint(S)))for(var C=this._splitSafely(u,S),P=0,F=C.length;P0?(this.tree.remove(n),r.push(t)):(this.segments.push(n),n.prev=u)}else{if(u&&y){var ct=u.getIntersection(y);if(ct!==null){if(!u.isAnEndpoint(ct))for(var ht=this._splitSafely(u,ct),Pt=0,$=ht.length;Pt<$;Pt++)r.push(ht[Pt]);if(!y.isAnEndpoint(ct))for(var Lt=this._splitSafely(y,ct),$t=0,Ct=Lt.length;$tAw)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var q=new R4(R),ot=R.size,_t=R.pop();_t;){var ft=_t.key;if(R.size===ot){var ct=ft.segment;throw new Error("Unable to pop() ".concat(ft.isLeft?"left":"right"," SweepEvent ")+"[".concat(ft.point.x,", ").concat(ft.point.y,"] from segment #").concat(ct.id," ")+"[".concat(ct.leftSE.point.x,", ").concat(ct.leftSE.point.y,"] -> ")+"[".concat(ct.rightSE.point.x,", ").concat(ct.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(R.size>Aw)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(q.segments.length>N4)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var ht=q.process(ft),Pt=0,$=ht.length;Pt<$;Pt++){var Lt=ht[Pt];Lt.consumedBy===void 0&&R.insert(Lt)}ot=R.size,_t=R.pop()}hd.reset();var $t=k4.factory(q.segments),Ct=new D4($t);return Ct.getGeom()}}]),e}(),xa=new O4,z4=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;rn[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]t.x?1:this.yt.y?1:0};Tt.prototype.clone=function(){};Tt.prototype.copy=function(){return new Tt(this)};Tt.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};Tt.prototype.distance3D=function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return Math.sqrt(t*t+n*n+r*r)};Tt.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)};Tt.prototype.hashCode=function(){var e=17;return e=37*e+Tt.hashCode(this.x),e=37*e+Tt.hashCode(this.y),e};Tt.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z};Tt.prototype.interfaces_=function(){return[as,sy,ls]};Tt.prototype.getClass=function(){return Tt};Tt.hashCode=function(){if(arguments.length===1){var e=arguments[0],t=We.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}};Vc.DimensionalComparator.get=function(){return Fl};Vc.serialVersionUID.get=function(){return 6683108902428367e3};Vc.NULL_ORDINATE.get=function(){return We.NaN};Vc.X.get=function(){return 0};Vc.Y.get=function(){return 1};Vc.Z.get=function(){return 2};Object.defineProperties(Tt,Vc);var Fl=function(e){if(this._dimensionsToTest=2,arguments.length!==0&&arguments.length===1){var t=arguments[0];if(t!==2&&t!==3)throw new tr("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}};Fl.prototype.compare=function(e,t){var n=e,r=t,o=Fl.compare(n.x,r.x);if(o!==0)return o;var l=Fl.compare(n.y,r.y);if(l!==0)return l;if(this._dimensionsToTest<=2)return 0;var h=Fl.compare(n.z,r.z);return h};Fl.prototype.interfaces_=function(){return[af]};Fl.prototype.getClass=function(){return Fl};Fl.compare=function(e,t){return et?1:We.isNaN(e)?We.isNaN(t)?0:-1:We.isNaN(t)?1:0};var lf=function(){};lf.prototype.create=function(){};lf.prototype.interfaces_=function(){return[]};lf.prototype.getClass=function(){return lf};var At=function(){},Dd={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};At.prototype.interfaces_=function(){return[]};At.prototype.getClass=function(){return At};At.toLocationSymbol=function(e){switch(e){case At.EXTERIOR:return"e";case At.BOUNDARY:return"b";case At.INTERIOR:return"i";case At.NONE:return"-"}throw new tr("Unknown location value: "+e)};Dd.INTERIOR.get=function(){return 0};Dd.BOUNDARY.get=function(){return 1};Dd.EXTERIOR.get=function(){return 2};Dd.NONE.get=function(){return-1};Object.defineProperties(At,Dd);var Be=function(e,t){return e.interfaces_&&e.interfaces_().indexOf(t)>-1},Uo=function(){},zE={LOG_10:{configurable:!0}};Uo.prototype.interfaces_=function(){return[]};Uo.prototype.getClass=function(){return Uo};Uo.log10=function(e){var t=Math.log(e);return We.isInfinite(t)||We.isNaN(t)?t:t/Uo.LOG_10};Uo.min=function(e,t,n,r){var o=e;return tn?n:e}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],o=arguments[1],l=arguments[2];return rl?l:r}};Uo.wrap=function(e,t){return e<0?t- -e%t:e%t};Uo.max=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2],r=e;return t>r&&(r=t),n>r&&(r=n),r}else if(arguments.length===4){var o=arguments[0],l=arguments[1],h=arguments[2],u=arguments[3],y=o;return l>y&&(y=l),h>y&&(y=h),u>y&&(y=u),y}};Uo.average=function(e,t){return(e+t)/2};zE.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(Uo,zE);var ca=function(e){this.str=e};ca.prototype.append=function(e){this.str+=e};ca.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)};ca.prototype.toString=function(e){return this.str};var Js=function(e){this.value=e};Js.prototype.intValue=function(){return this.value};Js.prototype.compareTo=function(e){return this.valuee?1:0};Js.isNaN=function(e){return Number.isNaN(e)};var fd=function(){};fd.isWhitespace=function(e){return e<=32&&e>=0||e===127};fd.toUpperCase=function(e){return e.toUpperCase()};var zt=function e(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}else if(typeof arguments[0]=="string"){var r=arguments[0];e.call(this,e.parse(r))}}else if(arguments.length===2){var o=arguments[0],l=arguments[1];this.init(o,l)}},As={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}};zt.prototype.le=function(e){return(this._hi9?(S=!0,C="9"):C="0"+w,h.append(C),n=n.subtract(zt.valueOf(w)).multiply(zt.TEN),S&&n.selfAdd(zt.TEN);var P=!0,F=zt.magnitude(n._hi);if(F<0&&Math.abs(F)>=u-y&&(P=!1),!P)break}return t[0]=r,h.toString()};zt.prototype.sqr=function(){return this.multiply(this)};zt.prototype.doubleValue=function(){return this._hi+this._lo};zt.prototype.subtract=function(){if(arguments[0]instanceof zt){var e=arguments[0];return this.add(e.negate())}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}};zt.prototype.equals=function(){if(arguments.length===1){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}};zt.prototype.isZero=function(){return this._hi===0&&this._lo===0};zt.prototype.selfSubtract=function(){if(arguments[0]instanceof zt){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}};zt.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};zt.prototype.min=function(e){return this.le(e)?this:e};zt.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof zt){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfDivide(t,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],o=null,l=null,h=null,u=null,y=null,w=null,S=null,C=null;return y=this._hi/n,w=zt.SPLIT*y,o=w-y,C=zt.SPLIT*n,o=w-o,l=y-o,h=C-n,S=y*n,h=C-h,u=n-h,C=o*h-S+o*u+l*h+l*u,w=(this._hi-S-C+this._lo-y*r)/n,C=y+w,this._hi=C,this._lo=y-C+w,this}};zt.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};zt.prototype.divide=function(){if(arguments[0]instanceof zt){var e=arguments[0],t=null,n=null,r=null,o=null,l=null,h=null,u=null,y=null;l=this._hi/e._hi,h=zt.SPLIT*l,t=h-l,y=zt.SPLIT*e._hi,t=h-t,n=l-t,r=y-e._hi,u=l*e._hi,r=y-r,o=e._hi-r,y=t*r-u+t*o+n*r+n*o,h=(this._hi-u-y+this._lo-l*e._lo)/e._hi,y=l+h;var w=y,S=l-y+h;return new zt(w,S)}else if(typeof arguments[0]=="number"){var C=arguments[0];return We.isNaN(C)?zt.createNaN():zt.copy(this).selfDivide(C,0)}};zt.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo};zt.prototype.pow=function(e){if(e===0)return zt.valueOf(1);var t=new zt(this),n=zt.valueOf(1),r=Math.abs(e);if(r>1)for(;r>0;)r%2===1&&n.selfMultiply(t),r/=2,r>0&&(t=t.sqr());else n=t;return e<0?n.reciprocal():n};zt.prototype.ceil=function(){if(this.isNaN())return zt.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new zt(e,t)};zt.prototype.compareTo=function(e){var t=e;return this._hit._hi?1:this._lot._lo?1:0};zt.prototype.rint=function(){if(this.isNaN())return this;var e=this.add(.5);return e.floor()};zt.prototype.setValue=function(){if(arguments[0]instanceof zt){var e=arguments[0];return this.init(e),this}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}};zt.prototype.max=function(e){return this.ge(e)?this:e};zt.prototype.sqrt=function(){if(this.isZero())return zt.valueOf(0);if(this.isNegative())return zt.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,n=zt.valueOf(t),r=this.subtract(n.sqr()),o=r._hi*(e*.5);return n.add(o)};zt.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof zt){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0],n=null,r=null,o=null,l=null,h=null,u=null;return o=this._hi+t,h=o-this._hi,l=o-h,l=t-h+(this._hi-l),u=l+this._lo,n=o+u,r=u+(o-n),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(arguments.length===2){var y=arguments[0],w=arguments[1],S=null,C=null,P=null,F=null,R=null,Y=null,J=null,K=null;R=this._hi+y,P=this._lo+w,J=R-this._hi,K=P-this._lo,Y=R-J,F=P-K,Y=y-J+(this._hi-Y),F=w-K+(this._lo-F),J=Y+P,S=R+J,C=J+(R-S),J=F+C;var O=S+J,G=J+(S-O);return this._hi=O,this._lo=G,this}};zt.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof zt){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfMultiply(t,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],o=null,l=null,h=null,u=null,y=null,w=null;y=zt.SPLIT*this._hi,o=y-this._hi,w=zt.SPLIT*n,o=y-o,l=this._hi-o,h=w-n,y=this._hi*n,h=w-h,u=n-h,w=o*h-y+o*u+l*h+l*u+(this._hi*r+this._lo*n);var S=y+w;o=y-S;var C=w+o;return this._hi=S,this._lo=C,this}};zt.prototype.selfSqr=function(){return this.selfMultiply(this)};zt.prototype.floor=function(){if(this.isNaN())return zt.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new zt(e,t)};zt.prototype.negate=function(){return this.isNaN()?this:new zt(-this._hi,-this._lo)};zt.prototype.clone=function(){};zt.prototype.multiply=function(){if(arguments[0]instanceof zt){var e=arguments[0];return e.isNaN()?zt.createNaN():zt.copy(this).selfMultiply(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return We.isNaN(t)?zt.createNaN():zt.copy(this).selfMultiply(t,0)}};zt.prototype.isNaN=function(){return We.isNaN(this._hi)};zt.prototype.intValue=function(){return Math.trunc(this._hi)};zt.prototype.toString=function(){var e=zt.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()};zt.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!0,t),r=t[0]+1,o=n;if(n.charAt(0)===".")o="0"+n;else if(r<0)o="0."+zt.stringOfChar("0",-r)+n;else if(n.indexOf(".")===-1){var l=r-n.length,h=zt.stringOfChar("0",l);o=n+h+".0"}return this.isNegative()?"-"+o:o};zt.prototype.reciprocal=function(){var e=null,t=null,n=null,r=null,o=null,l=null,h=null,u=null;o=1/this._hi,l=zt.SPLIT*o,e=l-o,u=zt.SPLIT*this._hi,e=l-e,t=o-e,n=u-this._hi,h=o*this._hi,n=u-n,r=this._hi-n,u=e*n-h+e*r+t*n+t*r,l=(1-h-u-o*this._lo)/this._hi;var y=o+l,w=o-y+l;return new zt(y,w)};zt.prototype.toSciNotation=function(){if(this.isZero())return zt.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!1,t),r=zt.SCI_NOT_EXPONENT_CHAR+t[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var o="";n.length>1&&(o=n.substring(1));var l=n.charAt(0)+"."+o;return this.isNegative()?"-"+l+r:l+r};zt.prototype.abs=function(){return this.isNaN()?zt.NaN:this.isNegative()?this.negate():new zt(this)};zt.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0};zt.prototype.lt=function(e){return(this._hie._hi||this._hi===e._hi)&&this._lo>e._lo};zt.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0};zt.prototype.trunc=function(){return this.isNaN()?zt.NaN:this.isPositive()?this.floor():this.ceil()};zt.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};zt.prototype.interfaces_=function(){return[ls,as,sy]};zt.prototype.getClass=function(){return zt};zt.sqr=function(e){return zt.valueOf(e).selfMultiply(e)};zt.valueOf=function(){if(typeof arguments[0]=="string"){var e=arguments[0];return zt.parse(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return new zt(t)}};zt.sqrt=function(e){return zt.valueOf(e).sqrt()};zt.parse=function(e){for(var t=0,n=e.length;fd.isWhitespace(e.charAt(t));)t++;var r=!1;if(t=n);){var w=e.charAt(t);if(t++,fd.isDigit(w)){var S=w-"0";l.selfMultiply(zt.TEN),l.selfAdd(S),h++;continue}if(w==="."){u=h;continue}if(w==="e"||w==="E"){var C=e.substring(t);try{y=Js.parseInt(C)}catch(J){throw J instanceof Error?new Error("Invalid exponent "+C+" in string "+e):J}finally{}break}throw new Error("Unexpected character '"+w+"' at position "+t+" in string "+e)}var P=l,F=h-u-y;if(F===0)P=l;else if(F>0){var R=zt.TEN.pow(F);P=l.divide(R)}else if(F<0){var Y=zt.TEN.pow(-F);P=l.multiply(Y)}return r?P.negate():P};zt.createNaN=function(){return new zt(We.NaN,We.NaN)};zt.copy=function(e){return new zt(e)};zt.magnitude=function(e){var t=Math.abs(e),n=Math.log(t)/Math.log(10),r=Math.trunc(Math.floor(n)),o=Math.pow(10,r);return o*10<=t&&(r+=1),r};zt.stringOfChar=function(e,t){for(var n=new ca,r=0;r0){if(l<=0)return no.signum(h);r=o+l}else if(o<0){if(l>=0)return no.signum(h);r=-o-l}else return no.signum(h);var u=no.DP_SAFE_EPSILON*r;return h>=u||-h>=u?no.signum(h):2};no.signum=function(e){return e>0?1:e<0?-1:0};FE.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties(no,FE);var wn=function(){},Rd={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Rd.X.get=function(){return 0};Rd.Y.get=function(){return 1};Rd.Z.get=function(){return 2};Rd.M.get=function(){return 3};wn.prototype.setOrdinate=function(e,t,n){};wn.prototype.size=function(){};wn.prototype.getOrdinate=function(e,t){};wn.prototype.getCoordinate=function(){};wn.prototype.getCoordinateCopy=function(e){};wn.prototype.getDimension=function(){};wn.prototype.getX=function(e){};wn.prototype.clone=function(){};wn.prototype.expandEnvelope=function(e){};wn.prototype.copy=function(){};wn.prototype.getY=function(e){};wn.prototype.toCoordinateArray=function(){};wn.prototype.interfaces_=function(){return[sy]};wn.prototype.getClass=function(){return wn};Object.defineProperties(wn,Rd);var BE=function(){},Rf=function(e){function t(){e.call(this,"Projective point not representable on the Cartesian plane.")}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(BE),gi=function(){};gi.arraycopy=function(e,t,n,r,o){for(var l=0,h=t;he._minx?this._minx:e._minx,n=this._miny>e._miny?this._miny:e._miny,r=this._maxx=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}};Le.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Le){var e=arguments[0];return this.isNull()||e.isNull()?!1:!(e._minx>this._maxx||e._maxxthis._maxy||e._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=t._maxx),t._minythis._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}};Le.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return et._minx?1:this._minyt._miny?1:this._maxxt._maxx?1:this._maxyt._maxy?1:0};Le.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)};Le.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};Le.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};Le.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};Le.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t};Le.prototype.expandBy=function(){if(arguments.length===1){var e=arguments[0];this.expandBy(e,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}};Le.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Le){var e=arguments[0];return this.covers(e)}else if(arguments[0]instanceof Tt){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.covers(n,r)}};Le.prototype.centre=function(){return this.isNull()?null:new Tt((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};Le.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof Tt){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof Le){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(arguments.length===4){var o=arguments[0],l=arguments[1],h=arguments[2],u=arguments[3];oe._maxx&&(t=this._minx-e._maxx);var n=0;return this._maxye._maxy&&(n=this._miny-e._maxy),t===0?n:n===0?t:Math.sqrt(t*t+n*n)};Le.prototype.hashCode=function(){var e=17;return e=37*e+Tt.hashCode(this._minx),e=37*e+Tt.hashCode(this._maxx),e=37*e+Tt.hashCode(this._miny),e=37*e+Tt.hashCode(this._maxy),e};Le.prototype.interfaces_=function(){return[as,ls]};Le.prototype.getClass=function(){return Le};Le.intersects=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2];return n.x>=(e.xt.x?e.x:t.x)&&n.y>=(e.yt.y?e.y:t.y)}else if(arguments.length===4){var r=arguments[0],o=arguments[1],l=arguments[2],h=arguments[3],u=Math.min(l.x,h.x),y=Math.max(l.x,h.x),w=Math.min(r.x,o.x),S=Math.max(r.x,o.x);return!(w>y||Sy)||Sn?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}};lr.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};lr.prototype.setPrecisionModel=function(e){this._precisionModel=e};lr.prototype.isInteriorIntersection=function(){var e=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var t=arguments[0],n=0;no?l=r:l=o;else{var h=Math.abs(e.x-t.x),u=Math.abs(e.y-t.y);r>o?l=h:l=u,l===0&&!e.equals(t)&&(l=Math.max(h,u))}return tn.isTrue(!(l===0&&!e.equals(t)),"Bad distance calculation"),l};lr.nonRobustComputeEdgeDistance=function(e,t,n){var r=e.x-t.x,o=e.y-t.y,l=Math.sqrt(r*r+o*o);return tn.isTrue(!(l===0&&!e.equals(t)),"Invalid distance calculation"),l};Uc.DONT_INTERSECT.get=function(){return 0};Uc.DO_INTERSECT.get=function(){return 1};Uc.COLLINEAR.get=function(){return 2};Uc.NO_INTERSECTION.get=function(){return 0};Uc.POINT_INTERSECTION.get=function(){return 1};Uc.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(lr,Uc);var qu=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var r=new Le(this._inputLines[0][0],this._inputLines[0][1]),o=new Le(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(n)&&o.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],r=arguments[1],o=arguments[2];if(this._isProper=!1,Le.intersects(r,o,n)&&ye.orientationIndex(r,o,n)===0&&ye.orientationIndex(o,r,n)===0)return this._isProper=!0,(n.equals(r)||n.equals(o))&&(this._isProper=!1),this._result=e.POINT_INTERSECTION,null;this._result=e.NO_INTERSECTION}else return e.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,r,o,l,h){h.x=this.smallestInAbsValue(n.x,r.x,o.x,l.x),h.y=this.smallestInAbsValue(n.y,r.y,o.y,l.y),n.x-=h.x,n.y-=h.y,r.x-=h.x,r.y-=h.y,o.x-=h.x,o.y-=h.y,l.x-=h.x,l.y-=h.y},t.prototype.safeHCoordinateIntersection=function(n,r,o,l){var h=null;try{h=xs.intersection(n,r,o,l)}catch(u){if(u instanceof Rf)h=t.nearestEndpoint(n,r,o,l);else throw u}finally{}return h},t.prototype.intersection=function(n,r,o,l){var h=this.intersectionWithNormalization(n,r,o,l);return this.isInSegmentEnvelopes(h)||(h=new Tt(t.nearestEndpoint(n,r,o,l))),this._precisionModel!==null&&this._precisionModel.makePrecise(h),h},t.prototype.smallestInAbsValue=function(n,r,o,l){var h=n,u=Math.abs(h);return Math.abs(r)1e-4&&gi.out.println("Distance = "+h.distance(u))},t.prototype.intersectionWithNormalization=function(n,r,o,l){var h=new Tt(n),u=new Tt(r),y=new Tt(o),w=new Tt(l),S=new Tt;this.normalizeToEnvCentre(h,u,y,w,S);var C=this.safeHCoordinateIntersection(h,u,y,w);return C.x+=S.x,C.y+=S.y,C},t.prototype.computeCollinearIntersection=function(n,r,o,l){var h=Le.intersects(n,r,o),u=Le.intersects(n,r,l),y=Le.intersects(o,l,n),w=Le.intersects(o,l,r);return h&&u?(this._intPt[0]=o,this._intPt[1]=l,e.COLLINEAR_INTERSECTION):y&&w?(this._intPt[0]=n,this._intPt[1]=r,e.COLLINEAR_INTERSECTION):h&&y?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!u&&!w?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):h&&w?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!u&&!y?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):u&&y?(this._intPt[0]=l,this._intPt[1]=n,l.equals(n)&&!h&&!w?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):u&&w?(this._intPt[0]=l,this._intPt[1]=r,l.equals(r)&&!h&&!y?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):e.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,r,o,l,h){var u=n.xr.x?n.x:r.x,S=n.y>r.y?n.y:r.y,C=o.xl.x?o.x:l.x,R=o.y>l.y?o.y:l.y,Y=u>C?u:C,J=wP?y:P,O=S0&&u>0||h<0&&u<0)return e.NO_INTERSECTION;var y=ye.orientationIndex(o,l,n),w=ye.orientationIndex(o,l,r);if(y>0&&w>0||y<0&&w<0)return e.NO_INTERSECTION;var S=h===0&&u===0&&y===0&&w===0;return S?this.computeCollinearIntersection(n,r,o,l):(h===0||u===0||y===0||w===0?(this._isProper=!1,n.equals2D(o)||n.equals2D(l)?this._intPt[0]=n:r.equals2D(o)||r.equals2D(l)?this._intPt[0]=r:h===0?this._intPt[0]=new Tt(o):u===0?this._intPt[0]=new Tt(l):y===0?this._intPt[0]=new Tt(n):w===0&&(this._intPt[0]=new Tt(r))):(this._isProper=!0,this._intPt[0]=this.intersection(n,r,o,l)),e.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,r,o,l){var h=n,u=ye.distancePointLine(n,o,l),y=ye.distancePointLine(r,o,l);return y0?n>0?-o:o:n>0?o:-o;if(t===0||n===0)return r>0?e>0?o:-o:e>0?-o:o;if(t>0?r>0?t<=r||(o=-o,l=e,e=n,n=l,l=t,t=r,r=l):t<=-r?(o=-o,n=-n,r=-r):(l=e,e=-n,n=l,l=t,t=-r,r=l):r>0?-t<=r?(o=-o,e=-e,t=-t):(l=-e,e=n,n=l,l=-t,t=r,r=l):t>=r?(e=-e,t=-t,n=-n,r=-r):(o=-o,l=-e,e=-n,n=l,l=-t,t=-r,r=l),e>0)if(n>0){if(!(e<=n))return o}else return o;else{if(n>0)return-o;if(e>=n)o=-o,e=-e,n=-n;else return-o}for(;;){if(h=Math.floor(n/e),n=n-h*e,r=r-h*t,r<0)return-o;if(r>t)return o;if(e>n+n){if(tr+r)return-o;n=e-n,r=t-r,o=-o}if(r===0)return n===0?0:-o;if(n===0||(h=Math.floor(e/n),e=e-h*n,t=t-h*r,t<0))return o;if(t>r)return-o;if(n>e+e){if(rt+t)return o;e=n-e,t=r-t,o=-o}if(t===0)return e===0?0:o;if(e===0)return-o}};var Ys=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};Ys.prototype.countSegment=function(e,t){if(e.xr&&(n=t.x,r=e.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var o=e.x-this._p.x,l=e.y-this._p.y,h=t.x-this._p.x,u=t.y-this._p.y,y=Ic.signOfDet2x2(o,l,h,u);if(y===0)return this._isPointOnSegment=!0,null;u0&&this._crossingCount++}};Ys.prototype.isPointInPolygon=function(){return this.getLocation()!==At.EXTERIOR};Ys.prototype.getLocation=function(){return this._isPointOnSegment?At.BOUNDARY:this._crossingCount%2===1?At.INTERIOR:At.EXTERIOR};Ys.prototype.isOnSegment=function(){return this._isPointOnSegment};Ys.prototype.interfaces_=function(){return[]};Ys.prototype.getClass=function(){return Ys};Ys.locatePointInRing=function(){if(arguments[0]instanceof Tt&&Be(arguments[1],wn)){for(var e=arguments[0],t=arguments[1],n=new Ys(e),r=new Tt,o=new Tt,l=1;l1||y<0||y>1)&&(o=!0)}}return o?Uo.min(ye.distancePointLine(e,n,r),ye.distancePointLine(t,n,r),ye.distancePointLine(n,e,t),ye.distancePointLine(r,e,t)):0};ye.isPointInRing=function(e,t){return ye.locatePointInRing(e,t)!==At.EXTERIOR};ye.computeLength=function(e){var t=e.size();if(t<=1)return 0;var n=0,r=new Tt;e.getCoordinate(0,r);for(var o=r.x,l=r.y,h=1;hn.y&&(n=l,r=o)}var h=r;do h=h-1,h<0&&(h=t);while(e[h].equals2D(n)&&h!==r);var u=r;do u=(u+1)%t;while(e[u].equals2D(n)&&u!==r);var y=e[h],w=e[u];if(y.equals2D(n)||w.equals2D(n)||y.equals2D(w))return!1;var S=ye.computeOrientation(y,n,w),C=!1;return S===0?C=y.x>w.x:C=S>0,C};ye.locatePointInRing=function(e,t){return Ys.locatePointInRing(e,t)};ye.distancePointLinePerpendicular=function(e,t,n){var r=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),o=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/r;return Math.abs(o)*Math.sqrt(r)};ye.computeOrientation=function(e,t,n){return ye.orientationIndex(e,t,n)};ye.distancePointLine=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(t.length===0)throw new tr("Line array must contain at least one vertex");for(var n=e.distance(t[0]),r=0;r=1)return l.distance(u);var S=((h.y-l.y)*(u.x-h.x)-(h.x-l.x)*(u.y-h.y))/y;return Math.abs(S)*Math.sqrt(y)}};ye.isOnLine=function(e,t){for(var n=new qu,r=1;r0};cf.prototype.interfaces_=function(){return[is]};cf.prototype.getClass=function(){return cf};var hf=function(){};hf.prototype.isInBoundary=function(e){return e>1};hf.prototype.interfaces_=function(){return[is]};hf.prototype.getClass=function(){return hf};var ff=function(){};ff.prototype.isInBoundary=function(e){return e===1};ff.prototype.interfaces_=function(){return[is]};ff.prototype.getClass=function(){return ff};var Br=function(){};Br.prototype.add=function(){};Br.prototype.addAll=function(){};Br.prototype.isEmpty=function(){};Br.prototype.iterator=function(){};Br.prototype.size=function(){};Br.prototype.toArray=function(){};Br.prototype.remove=function(){};function Cv(e){this.message=e||""}Cv.prototype=new Error;Cv.prototype.name="IndexOutOfBoundsException";var Nf=function(){};Nf.prototype.hasNext=function(){};Nf.prototype.next=function(){};Nf.prototype.remove=function(){};var ws=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(Br);function Of(e){this.message=e||""}Of.prototype=new Error;Of.prototype.name="NoSuchElementException";var ce=function(e){function t(){e.call(this),this.array_=[],arguments[0]instanceof Br&&this.addAll(arguments[0])}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[e,Br]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var r=this,o=n.iterator();o.hasNext();)r.add(o.next());return!0},t.prototype.set=function(n,r){var o=this.array_[n];return this.array_[n]=r,o},t.prototype.iterator=function(){return new Z4(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new Cv;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,r=[],o=0,l=this.array_.length;o=1){var w=this.get(this.size()-1);if(w.equals2D(u))return null}e.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var S=arguments[0],C=arguments[1];return this.add(S,C),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var P=arguments[0],F=arguments[1],R=arguments[2];if(R)for(var Y=0;Y=0;J--)r.add(P[J],F);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof Tt){var K=arguments[0],O=arguments[1],G=arguments[2];if(!G){var q=this.size();if(q>0){if(K>0){var ot=this.get(K-1);if(ot.equals2D(O))return null}if(KPt&&($=-1);for(var Lt=ht;Lt!==Pt;Lt+=$)r.add(ft[Lt],ct);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new Tt(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,n),t}(ce),cn=function(){},ly={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};ly.ForwardComparator.get=function(){return pd};ly.BidirectionalComparator.get=function(){return pf};ly.coordArrayType.get=function(){return new Array(0).fill(null)};cn.prototype.interfaces_=function(){return[]};cn.prototype.getClass=function(){return cn};cn.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))};cn.ptNotInList=function(e,t){for(var n=0;n=e?t:[]};cn.indexOf=function(e,t){for(var n=0;n0)&&(t=e[n]);return t};cn.extract=function(e,t,n){t=Uo.clamp(t,0,e.length),n=Uo.clamp(n,-1,e.length);var r=n-t+1;n<0&&(r=0),t>=e.length&&(r=0),nr.length)return 1;if(n.length===0)return 0;var o=cn.compare(n,r),l=cn.isEqualReversed(n,r);return l?0:o};pf.prototype.OLDcompare=function(e,t){var n=e,r=t;if(n.lengthr.length)return 1;if(n.length===0)return 0;for(var o=cn.increasingDirection(n),l=cn.increasingDirection(r),h=o>0?0:n.length-1,u=l>0?0:n.length-1,y=0;y0)t=t.right;else return t.value}return null};Pi.prototype.put=function(e,t){if(this.root_===null)return this.root_={key:e,value:t,left:null,right:null,parent:null,color:Qa,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n=this.root_,r,o;do if(r=n,o=e.compareTo(n.key),o<0)n=n.left;else if(o>0)n=n.right;else{var l=n.value;return n.value=t,l}while(n!==null);var h={key:e,left:null,right:null,value:t,parent:r,color:Qa,getValue:function(){return this.value},getKey:function(){return this.key}};return o<0?r.left=h:r.right=h,this.fixAfterInsertion(h),this.size_++,null};Pi.prototype.fixAfterInsertion=function(e){var t=this;for(e.color=_u;e!=null&&e!==this.root_&&e.parent.color===_u;)if(qn(e)===$_(qn(qn(e)))){var n=Nw(qn(qn(e)));Rw(n)===_u?(Ha(qn(e),Qa),Ha(n,Qa),Ha(qn(qn(e)),_u),e=qn(qn(e))):(e===Nw(qn(e))&&(e=qn(e),t.rotateLeft(e)),Ha(qn(e),Qa),Ha(qn(qn(e)),_u),t.rotateRight(qn(qn(e))))}else{var r=$_(qn(qn(e)));Rw(r)===_u?(Ha(qn(e),Qa),Ha(r,Qa),Ha(qn(qn(e)),_u),e=qn(qn(e))):(e===$_(qn(e))&&(e=qn(e),t.rotateRight(e)),Ha(qn(e),Qa),Ha(qn(qn(e)),_u),t.rotateLeft(qn(qn(e))))}this.root_.color=Qa};Pi.prototype.values=function(){var e=new ce,t=this.getFirstEntry();if(t!==null)for(e.add(t.value);(t=Pi.successor(t))!==null;)e.add(t.value);return e};Pi.prototype.entrySet=function(){var e=new Tv,t=this.getFirstEntry();if(t!==null)for(e.add(t);(t=Pi.successor(t))!==null;)e.add(t);return e};Pi.prototype.rotateLeft=function(e){if(e!=null){var t=e.right;e.right=t.left,t.left!=null&&(t.left.parent=e),t.parent=e.parent,e.parent===null?this.root_=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}};Pi.prototype.rotateRight=function(e){if(e!=null){var t=e.left;e.left=t.right,t.right!=null&&(t.right.parent=e),t.parent=e.parent,e.parent===null?this.root_=t:e.parent.right===e?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}};Pi.prototype.getFirstEntry=function(){var e=this.root_;if(e!=null)for(;e.left!=null;)e=e.left;return e};Pi.successor=function(e){if(e===null)return null;if(e.right!==null){for(var t=e.right;t.left!==null;)t=t.left;return t}else{for(var n=e.parent,r=e;n!==null&&r===n.right;)r=n,n=n.parent;return n}};Pi.prototype.size=function(){return this.size_};var dd=function(){};dd.prototype.interfaces_=function(){return[]};dd.prototype.getClass=function(){return dd};function UE(){}UE.prototype=new uy;function Qs(){this.array_=[],arguments[0]instanceof Br&&this.addAll(arguments[0])}Qs.prototype=new UE;Qs.prototype.contains=function(e){for(var t=this,n=0,r=this.array_.length;n=0;){var h=o.substring(0,l);r.add(h),o=o.substring(l+n),l=o.indexOf(t)}o.length>0&&r.add(o);for(var u=new Array(r.size()).fill(null),y=0;y0)for(var l=o;l0&&r.append(" ");for(var l=0;l0&&r.append(","),r.append(ns.toString(e.getOrdinate(o,l)))}return r.append(")"),r.toString()}};Cr.ensureValidRing=function(e,t){var n=t.size();if(n===0)return t;if(n<=3)return Cr.createClosedRing(e,t,4);var r=t.getOrdinate(0,wn.X)===t.getOrdinate(n-1,wn.X)&&t.getOrdinate(0,wn.Y)===t.getOrdinate(n-1,wn.Y);return r?t:Cr.createClosedRing(e,t,n+1)};Cr.createClosedRing=function(e,t,n){var r=e.create(n,t.getDimension()),o=t.size();Cr.copy(t,0,r,0,o);for(var l=o;l0&&Cr.reverse(r._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?In.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return ye.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var r=this._points.copy();Cr.reverse(r);var o=this.getFactory().createLineString(r);return o},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){for(var o=arguments[0],l=o,h=0,u=0;h= 2)");this._points=r},t.prototype.isCoordinate=function(r){for(var o=this,l=0;l=1&&this.getCoordinateSequence().size()= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,n),t}(gr),Sa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return Fe.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],o=arguments[1];return this.isEquivalentClass(r)?e.prototype.equalsExact.call(this,r,o):!1}else return e.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var r=this,o=this._geometries.length,l=new Array(o).fill(null),h=0;h0?t.createPoint(n[0]):t.createPoint():e};yd.prototype.interfaces_=function(){return[os.GeometryEditorOperation]};yd.prototype.getClass=function(){return yd};var _d=function(){};_d.prototype.edit=function(e,t){return e instanceof Ca?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof gr?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof wo?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e};_d.prototype.interfaces_=function(){return[os.GeometryEditorOperation]};_d.prototype.getClass=function(){return _d};var Er=function(){var e=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 t=arguments[0];this._coordinates=new Array(t).fill(null);for(var n=0;n0){var t=new ca(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var n=1;n3&&(r=3),r<2?new Er(n):new Er(n,r)}};Ta.prototype.interfaces_=function(){return[lf,ls]};Ta.prototype.getClass=function(){return Ta};Ta.instance=function(){return Ta.instanceObject};Pv.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};Pv.instanceObject.get=function(){return new Ta};Object.defineProperties(Ta,Pv);var qE=function(e){function t(){e.call(this),this.map_=new Map}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,r){return this.map_.set(n,r),r},t.prototype.values=function(){for(var n=new ce,r=this.map_.values(),o=r.next();!o.done;)n.add(o.value),o=r.next();return n},t.prototype.entrySet=function(){var n=new Tv;return this.map_.entries().forEach(function(r){return n.add(r)}),n},t.prototype.size=function(){return this.map_.size()},t}(qc),Ln=function e(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=e.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof ta){var t=arguments[0];this._modelType=t,t===e.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var n=arguments[0];this._modelType=e.FIXED,this.setScale(n)}else if(arguments[0]instanceof e){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},Mv={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Ln.prototype.equals=function(e){if(!(e instanceof Ln))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale};Ln.prototype.compareTo=function(e){var t=e,n=this.getMaximumSignificantDigits(),r=t.getMaximumSignificantDigits();return new Js(n).compareTo(new Js(r))};Ln.prototype.getScale=function(){return this._scale};Ln.prototype.isFloating=function(){return this._modelType===Ln.FLOATING||this._modelType===Ln.FLOATING_SINGLE};Ln.prototype.getType=function(){return this._modelType};Ln.prototype.toString=function(){var e="UNKNOWN";return this._modelType===Ln.FLOATING?e="Floating":this._modelType===Ln.FLOATING_SINGLE?e="Floating-Single":this._modelType===Ln.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e};Ln.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var e=arguments[0];if(We.isNaN(e))return e;if(this._modelType===Ln.FLOATING_SINGLE){var t=e;return t}return this._modelType===Ln.FIXED?Math.round(e*this._scale)/this._scale:e}else if(arguments[0]instanceof Tt){var n=arguments[0];if(this._modelType===Ln.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}};Ln.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===Ln.FLOATING?e=16:this._modelType===Ln.FLOATING_SINGLE?e=6:this._modelType===Ln.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e};Ln.prototype.setScale=function(e){this._scale=Math.abs(e)};Ln.prototype.interfaces_=function(){return[ls,as]};Ln.prototype.getClass=function(){return Ln};Ln.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t};Mv.serialVersionUID.get=function(){return 7777263578777804e3};Mv.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(Ln,Mv);var ta=function e(t){this._name=t||null,e.nameToTypeMap.put(t,this)},Av={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ta.prototype.readResolve=function(){return ta.nameToTypeMap.get(this._name)};ta.prototype.toString=function(){return this._name};ta.prototype.interfaces_=function(){return[ls]};ta.prototype.getClass=function(){return ta};Av.serialVersionUID.get=function(){return-552860263173159e4};Av.nameToTypeMap.get=function(){return new qE};Object.defineProperties(ta,Av);Ln.Type=ta;Ln.FIXED=new ta("FIXED");Ln.FLOATING=new ta("FLOATING");Ln.FLOATING_SINGLE=new ta("FLOATING SINGLE");var un=function e(){this._precisionModel=new Ln,this._SRID=0,this._coordinateSequenceFactory=e.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?Be(arguments[0],lf)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Ln&&(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]))},jE={serialVersionUID:{configurable:!0}};un.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new Tt(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new Tt(e.getMinX(),e.getMinY()),new Tt(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new Tt(e.getMinX(),e.getMinY()),new Tt(e.getMinX(),e.getMaxY()),new Tt(e.getMaxX(),e.getMaxY()),new Tt(e.getMaxX(),e.getMinY()),new Tt(e.getMinX(),e.getMinY())]),null)};un.prototype.createLineString=function(e){if(e){if(e instanceof Array)return new gr(this.getCoordinateSequenceFactory().create(e),this);if(Be(e,wn))return new gr(e,this)}else return new gr(this.getCoordinateSequenceFactory().create([]),this)};un.prototype.createMultiLineString=function(){if(arguments.length===0)return new Au(null,this);if(arguments.length===1){var e=arguments[0];return new Au(e,this)}};un.prototype.buildGeometry=function(e){for(var t=null,n=!1,r=!1,o=e.iterator();o.hasNext();){var l=o.next(),h=l.getClass();t===null&&(t=h),h!==t&&(n=!0),l.isGeometryCollectionOrDerived()&&(r=!0)}if(t===null)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(un.toGeometryArray(e));var u=e.iterator().next(),y=e.size()>1;if(y){if(u instanceof qr)return this.createMultiPolygon(un.toPolygonArray(e));if(u instanceof gr)return this.createMultiLineString(un.toLineStringArray(e));if(u instanceof wo)return this.createMultiPoint(un.toPointArray(e));tn.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u};un.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)};un.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Tt){var e=arguments[0];return this.createPoint(e!==null?this.getCoordinateSequenceFactory().create([e]):null)}else if(Be(arguments[0],wn)){var t=arguments[0];return new wo(t,this)}}};un.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};un.prototype.createPolygon=function(){if(arguments.length===0)return new qr(null,null,this);if(arguments.length===1){if(Be(arguments[0],wn)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Ca){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var r=arguments[0],o=arguments[1];return new qr(r,o,this)}};un.prototype.getSRID=function(){return this._SRID};un.prototype.createGeometryCollection=function(){if(arguments.length===0)return new qi(null,this);if(arguments.length===1){var e=arguments[0];return new qi(e,this)}};un.prototype.createGeometry=function(e){var t=new os(this);return t.edit(e,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})};un.prototype.getPrecisionModel=function(){return this._precisionModel};un.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(e!==null?this.getCoordinateSequenceFactory().create(e):null)}else if(Be(arguments[0],wn)){var t=arguments[0];return new Ca(t,this)}}};un.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Sa(null,this);if(arguments.length===1){var e=arguments[0];return new Sa(e,this)}};un.prototype.createMultiPoint=function(){var e=this;if(arguments.length===0)return new df(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new df(t,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],wn)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var o=new Array(r.size()).fill(null),l=0;l=this.size())throw new Error;return this.array_[e]};ha.prototype.push=function(e){return this.array_.push(e),e};ha.prototype.pop=function(e){if(this.array_.length===0)throw new dy;return this.array_.pop()};ha.prototype.peek=function(){if(this.array_.length===0)throw new dy;return this.array_[this.array_.length-1]};ha.prototype.empty=function(){return this.array_.length===0};ha.prototype.isEmpty=function(){return this.empty()};ha.prototype.search=function(e){return this.array_.indexOf(e)};ha.prototype.size=function(){return this.array_.length};ha.prototype.toArray=function(){for(var e=this,t=[],n=0,r=this.array_.length;n0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===ye.CLOCKWISE)&&(o=!0),o&&(this._minIndex=this._minIndex-1)};ea.prototype.getRightmostSideOfSegment=function(e,t){var n=e.getEdge(),r=n.getCoordinates();if(t<0||t+1>=r.length||r[t].y===r[t+1].y)return-1;var o=ne.LEFT;return r[t].yt._minCoord.x)&&(t._minDe=e,t._minIndex=r,t._minCoord=n[r])};ea.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode(),t=e.getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};ea.prototype.findEdge=function(e){for(var t=this,n=e.iterator();n.hasNext();){var r=n.next();r.isForward()&&t.checkForRightmostCoordinate(r)}tn.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 o=this.getRightmostSide(this._minDe,this._minIndex);o===ne.LEFT&&(this._orientedDe=this._minDe.getSym())};ea.prototype.interfaces_=function(){return[]};ea.prototype.getClass=function(){return ea};var ll=function(e){function t(n,r){e.call(this,t.msgWithCoord(n,r)),this.pt=r?new Tt(r):null,this.name="TopologyException"}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,r){return r?n:n+" [ "+r+" ]"},t}(sl),my=function(){this.array_=[]};my.prototype.addLast=function(e){this.array_.push(e)};my.prototype.removeFirst=function(){return this.array_.shift()};my.prototype.isEmpty=function(){return this.array_.length===0};var ji=function(){this._finder=null,this._dirEdgeList=new ce,this._nodes=new ce,this._rightMostCoord=null,this._env=null,this._finder=new ea};ji.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.setVisited(!1)}};ji.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};ji.prototype.computeNodeDepth=function(e){for(var t=this,n=null,r=e.getEdges().iterator();r.hasNext();){var o=r.next();if(o.isVisited()||o.getSym().isVisited()){n=o;break}}if(n===null)throw new ll("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(n);for(var l=e.getEdges().iterator();l.hasNext();){var h=l.next();h.setVisited(!0),t.copySymDepths(h)}};ji.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(ne.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)};ji.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};ji.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(ne.RIGHT)>=1&&t.getDepth(ne.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}};ji.prototype.computeDepths=function(e){var t=this,n=new Tv,r=new my,o=e.getNode();for(r.addLast(o),n.add(o),e.setVisited(!0);!r.isEmpty();){var l=r.removeFirst();n.add(l),t.computeNodeDepth(l);for(var h=l.getEdges().iterator();h.hasNext();){var u=h.next(),y=u.getSym();if(!y.isVisited()){var w=y.getNode();n.contains(w)||(r.addLast(w),n.add(w))}}}};ji.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.xt._rightMostCoord.x?1:0};ji.prototype.getEnvelope=function(){if(this._env===null){for(var e=new Le,t=this._dirEdgeList.iterator();t.hasNext();)for(var n=t.next(),r=n.getEdge().getCoordinates(),o=0;othis.location.length){var n=new Array(3).fill(null);n[ne.ON]=this.location[ne.ON],n[ne.LEFT]=At.NONE,n[ne.RIGHT]=At.NONE,this.location=n}for(var r=0;r1&&e.append(At.toLocationSymbol(this.location[ne.LEFT])),e.append(At.toLocationSymbol(this.location[ne.ON])),this.location.length>1&&e.append(At.toLocationSymbol(this.location[ne.RIGHT])),e.toString()};jn.prototype.setLocations=function(e,t,n){this.location[ne.ON]=e,this.location[ne.LEFT]=t,this.location[ne.RIGHT]=n};jn.prototype.get=function(e){return e1};jn.prototype.isAnyNull=function(){for(var e=this,t=0;te._maxNodeDegree&&(e._maxNodeDegree=r),t=e.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2};Rr.prototype.addPoints=function(e,t,n){var r=this,o=e.getCoordinates();if(t){var l=1;n&&(l=0);for(var h=l;h=0;y--)r._pts.add(o[y])}};Rr.prototype.isHole=function(){return this._isHole};Rr.prototype.setInResult=function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)};Rr.prototype.containsPoint=function(e){var t=this.getLinearRing(),n=t.getEnvelopeInternal();if(!n.contains(e)||!ye.isPointInRing(e,t.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();){var o=r.next();if(o.containsPoint(e))return!1}return!0};Rr.prototype.addHole=function(e){this._holes.add(e)};Rr.prototype.isShell=function(){return this._shell===null};Rr.prototype.getLabel=function(){return this._label};Rr.prototype.getEdges=function(){return this._edges};Rr.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};Rr.prototype.getShell=function(){return this._shell};Rr.prototype.mergeLabel=function(){if(arguments.length===1){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],r=t.getLocation(n,ne.RIGHT);if(r===At.NONE)return null;if(this._label.getLocation(n)===At.NONE)return this._label.setLocation(n,r),null}};Rr.prototype.setShell=function(e){this._shell=e,e!==null&&e.addHole(this)};Rr.prototype.toPolygon=function(e){for(var t=this,n=new Array(this._holes.size()).fill(null),r=0;r=2,"found partial label"),this.computeIM(e)};Go.prototype.isInResult=function(){return this._isInResult};Go.prototype.isVisited=function(){return this._isVisited};Go.prototype.interfaces_=function(){return[]};Go.prototype.getClass=function(){return Go};var gy=function(e){function t(){e.call(this),this._coord=null,this._edges=null;var n=arguments[0],r=arguments[1];this._coord=n,this._edges=r,this._label=new Rn(0,At.NONE)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var r=n.next();if(r.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,r){var o=At.NONE;if(o=this._label.getLocation(r),!n.isNull(r)){var l=n.getLocation(r);o!==At.BOUNDARY&&(o=l)}return o},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];this._label===null?this._label=new Rn(n,r):this._label.setLocation(n,r)}else return e.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var r=arguments[0];this.mergeLabel(r._label)}else if(arguments[0]instanceof Rn)for(var o=arguments[0],l=0;l<2;l++){var h=n.computeMergedLocation(o,l),u=n._label.getLocation(l);u===At.NONE&&n._label.setLocation(l,h)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var r=At.NONE;this._label!==null&&(r=this._label.getLocation(n));var o=null;switch(r){case At.BOUNDARY:o=At.INTERIOR;break;case At.INTERIOR:o=At.BOUNDARY;break;default:o=At.BOUNDARY;break}this._label.setLocation(n,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Go),na=function(){this.nodeMap=new Pi,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};na.prototype.find=function(e){return this.nodeMap.get(e)};na.prototype.addNode=function(){if(arguments[0]instanceof Tt){var e=arguments[0],t=this.nodeMap.get(e);return t===null&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}else if(arguments[0]instanceof gy){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return r===null?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}};na.prototype.print=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}};na.prototype.iterator=function(){return this.nodeMap.values().iterator()};na.prototype.values=function(){return this.nodeMap.values()};na.prototype.getBoundaryNodes=function(e){for(var t=new ce,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(e)===At.BOUNDARY&&t.add(r)}return t};na.prototype.add=function(e){var t=e.getCoordinate(),n=this.addNode(t);n.add(e)};na.prototype.interfaces_=function(){return[]};na.prototype.getClass=function(){return na};var Nn=function(){},zd={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Nn.prototype.interfaces_=function(){return[]};Nn.prototype.getClass=function(){return Nn};Nn.isNorthern=function(e){return e===Nn.NE||e===Nn.NW};Nn.isOpposite=function(e,t){if(e===t)return!1;var n=(e-t+4)%4;return n===2};Nn.commonHalfPlane=function(e,t){if(e===t)return e;var n=(e-t+4)%4;if(n===2)return-1;var r=et?e:t;return r===0&&o===3?3:r};Nn.isInHalfPlane=function(e,t){return t===Nn.SE?e===Nn.SE||e===Nn.SW:e===t||e===t+1};Nn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new tr("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?Nn.NE:Nn.SE:t>=0?Nn.NW:Nn.SW}else if(arguments[0]instanceof Tt&&arguments[1]instanceof Tt){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new tr("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Nn.NE:Nn.SE:r.y>=n.y?Nn.NW:Nn.SW}};zd.NE.get=function(){return 0};zd.NW.get=function(){return 1};zd.SW.get=function(){return 2};zd.SE.get=function(){return 3};Object.defineProperties(Nn,zd);var Mi=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 e=arguments[0];this._edge=e}else if(arguments.length===3){var t=arguments[0],n=arguments[1],r=arguments[2],o=null;this._edge=t,this.init(n,r),this._label=o}else if(arguments.length===4){var l=arguments[0],h=arguments[1],u=arguments[2],y=arguments[3];this._edge=l,this.init(h,u),this._label=y}};Mi.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant2){h.linkDirectedEdgesForMinimalEdgeRings();var u=h.buildMinimalRings(),y=r.findShell(u);y!==null?(r.placePolygonHoles(y,u),t.add(y)):n.addAll(u)}else o.add(h)}return o};So.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();){var n=t.next();if(n.containsPoint(e))return!0}return!1};So.prototype.buildMaximalEdgeRings=function(e){for(var t=this,n=new ce,r=e.iterator();r.hasNext();){var o=r.next();if(o.isInResult()&&o.getLabel().isArea()&&o.getEdgeRing()===null){var l=new rR(o,t._geometryFactory);n.add(l),l.setInResult()}}return n};So.prototype.placePolygonHoles=function(e,t){for(var n=t.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(e)}};So.prototype.getPolygons=function(){var e=this.computePolygons(this._shellList);return e};So.prototype.findEdgeRingContaining=function(e,t){for(var n=e.getLinearRing(),r=n.getEnvelopeInternal(),o=n.getCoordinateN(0),l=null,h=null,u=t.iterator();u.hasNext();){var y=u.next(),w=y.getLinearRing(),S=w.getEnvelopeInternal();l!==null&&(h=l.getLinearRing().getEnvelopeInternal());var C=!1;S.contains(r)&&ye.isPointInRing(o,w.getCoordinates())&&(C=!0),C&&(l===null||h.contains(S))&&(l=y)}return l};So.prototype.findShell=function(e){for(var t=0,n=null,r=e.iterator();r.hasNext();){var o=r.next();o.isHole()||(n=o,t++)}return tn.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),n};So.prototype.add=function(){if(arguments.length===1){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(arguments.length===2){var t=arguments[0],n=arguments[1];ur.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(t),o=new ce,l=this.buildMinimalEdgeRings(r,this._shellList,o);this.sortShellsAndHoles(l,this._shellList,o),this.placeFreeHoles(this._shellList,o)}};So.prototype.interfaces_=function(){return[]};So.prototype.getClass=function(){return So};var gf=function(){};gf.prototype.getBounds=function(){};gf.prototype.interfaces_=function(){return[]};gf.prototype.getClass=function(){return gf};var Cs=function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t};Cs.prototype.getItem=function(){return this._item};Cs.prototype.getBounds=function(){return this._bounds};Cs.prototype.interfaces_=function(){return[gf,ls]};Cs.prototype.getClass=function(){return Cs};var ul=function(){this._size=null,this._items=null,this._size=0,this._items=new ce,this._items.add(null)};ul.prototype.poll=function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e};ul.prototype.size=function(){return this._size};ul.prototype.reorder=function(e){for(var t=this,n=null,r=this._items.get(e);e*2<=this._size&&(n=e*2,n!==t._size&&t._items.get(n+1).compareTo(t._items.get(n))<0&&n++,t._items.get(n).compareTo(r)<0);e=n)t._items.set(e,t._items.get(n));this._items.set(e,r)};ul.prototype.clear=function(){this._size=0,this._items.clear()};ul.prototype.isEmpty=function(){return this._size===0};ul.prototype.add=function(e){var t=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)t._items.set(n,t._items.get(Math.trunc(n/2)));this._items.set(n,e)};ul.prototype.interfaces_=function(){return[]};ul.prototype.getClass=function(){return ul};var ql=function(){};ql.prototype.visitItem=function(e){};ql.prototype.interfaces_=function(){return[]};ql.prototype.getClass=function(){return ql};var Cc=function(){};Cc.prototype.insert=function(e,t){};Cc.prototype.remove=function(e,t){};Cc.prototype.query=function(){};Cc.prototype.interfaces_=function(){return[]};Cc.prototype.getClass=function(){return Cc};var Gr=function(){if(this._childBoundables=new ce,this._bounds=null,this._level=null,arguments.length!==0&&arguments.length===1){var e=arguments[0];this._level=e}},ZE={serialVersionUID:{configurable:!0}};Gr.prototype.getLevel=function(){return this._level};Gr.prototype.size=function(){return this._childBoundables.size()};Gr.prototype.getChildBoundables=function(){return this._childBoundables};Gr.prototype.addChildBoundable=function(e){tn.isTrue(this._bounds===null),this._childBoundables.add(e)};Gr.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};Gr.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};Gr.prototype.interfaces_=function(){return[gf,ls]};Gr.prototype.getClass=function(){return Gr};ZE.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(Gr,ZE);var Ts=function(){};Ts.reverseOrder=function(){return{compare:function(e,t){return t.compareTo(e)}}};Ts.min=function(e){return Ts.sort(e),e.get(0)};Ts.sort=function(e,t){var n=e.toArray();t?Cu.sort(n,t):Cu.sort(n);for(var r=e.iterator(),o=0,l=n.length;okr.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(n)return this.expand(this._boundable1,this._boundable2,e,t),null;if(r)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new tr("neither boundable is composite")};kr.prototype.isLeaves=function(){return!(kr.isComposite(this._boundable1)||kr.isComposite(this._boundable2))};kr.prototype.compareTo=function(e){var t=e;return this._distancet._distance?1:0};kr.prototype.expand=function(e,t,n,r){for(var o=this,l=e.getChildBoundables(),h=l.iterator();h.hasNext();){var u=h.next(),y=new kr(u,t,o._itemDistance);y.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},yy={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};li.prototype.getNodeCapacity=function(){return this._nodeCapacity};li.prototype.lastNode=function(e){return e.get(e.size()-1)};li.prototype.size=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=arguments[0],n=0,r=t.getChildBoundables().iterator();r.hasNext();){var o=r.next();o instanceof Gr?n+=e.size(o):o instanceof Cs&&(n+=1)}return n}};li.prototype.removeItem=function(e,t){for(var n=null,r=e.getChildBoundables().iterator();r.hasNext();){var o=r.next();o instanceof Cs&&o.getItem()===t&&(n=o)}return n!==null?(e.getChildBoundables().remove(n),!0):!1};li.prototype.itemsTree=function(){var e=this;if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new ce:t}else if(arguments.length===1){for(var n=arguments[0],r=new ce,o=n.getChildBoundables().iterator();o.hasNext();){var l=o.next();if(l instanceof Gr){var h=e.itemsTree(l);h!==null&&r.add(h)}else l instanceof Cs?r.add(l.getItem()):tn.shouldNeverReachHere()}return r.size()<=0?null:r}};li.prototype.insert=function(e,t){tn.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Cs(e,t))};li.prototype.boundablesAtLevel=function(){var e=this;if(arguments.length===1){var t=arguments[0],n=new ce;return this.boundablesAtLevel(t,this._root,n),n}else if(arguments.length===3){var r=arguments[0],o=arguments[1],l=arguments[2];if(tn.isTrue(r>-2),o.getLevel()===r)return l.add(o),null;for(var h=o.getChildBoundables().iterator();h.hasNext();){var u=h.next();u instanceof Gr?e.boundablesAtLevel(r,u,l):(tn.isTrue(u instanceof Cs),r===-1&&l.add(u))}return null}};li.prototype.query=function(){var e=this;if(arguments.length===1){var t=arguments[0];this.build();var n=new ce;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,n),n}else if(arguments.length===2){var r=arguments[0],o=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,o)}else if(arguments.length===3){if(Be(arguments[2],ql)&&arguments[0]instanceof Object&&arguments[1]instanceof Gr)for(var l=arguments[0],h=arguments[1],u=arguments[2],y=h.getChildBoundables(),w=0;wn&&(n=l)}}return n+1}};li.prototype.createParentBoundables=function(e,t){var n=this;tn.isTrue(!e.isEmpty());var r=new ce;r.add(this.createNode(t));var o=new ce(e);Ts.sort(o,this.getComparator());for(var l=o.iterator();l.hasNext();){var h=l.next();n.lastNode(r).getChildBoundables().size()===n.getNodeCapacity()&&r.add(n.createNode(t)),n.lastNode(r).addChildBoundable(h)}return r};li.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};li.prototype.interfaces_=function(){return[ls]};li.prototype.getClass=function(){return li};li.compareDoubles=function(e,t){return e>t?1:e0);for(var h=new ce,u=0;u0;){var R=F.poll(),Y=R.getDistance();if(Y>=C)break;R.isLeaves()?(C=Y,P=R):R.expandToQueue(F,C)}return[P.getBoundable(0).getItem(),P.getBoundable(1).getItem()]}}else if(arguments.length===3){var J=arguments[0],K=arguments[1],O=arguments[2],G=new Cs(J,K),q=new kr(this.getRoot(),G,O);return this.nearestNeighbour(q)[0]}},t.prototype.interfaces_=function(){return[Cc,ls]},t.prototype.getClass=function(){return t},t.centreX=function(r){return t.avg(r.getMinX(),r.getMaxX())},t.avg=function(r,o){return(r+o)/2},t.centreY=function(r){return t.avg(r.getMinY(),r.getMaxY())},n.STRtreeNode.get=function(){return Ow},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[af]},compare:function(r,o){return e.compareDoubles(t.centreX(r.getBounds()),t.centreX(o.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[af]},compare:function(r,o){return e.compareDoubles(t.centreY(r.getBounds()),t.centreY(o.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[e.IntersectsOp]},intersects:function(r,o){return r.intersects(o)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,n),t}(li),Ow=function(e){function t(){var n=arguments[0];e.call(this,n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,r=this.getChildBoundables().iterator();r.hasNext();){var o=r.next();n===null?n=new Le(o.getBounds()):n.expandToInclude(o.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Gr),eo=function(){};eo.prototype.interfaces_=function(){return[]};eo.prototype.getClass=function(){return eo};eo.relativeSign=function(e,t){return et?1:0};eo.compare=function(e,t,n){if(t.equals2D(n))return 0;var r=eo.relativeSign(t.x,n.x),o=eo.relativeSign(t.y,n.y);switch(e){case 0:return eo.compareValue(r,o);case 1:return eo.compareValue(o,r);case 2:return eo.compareValue(o,-r);case 3:return eo.compareValue(-r,o);case 4:return eo.compareValue(-r,-o);case 5:return eo.compareValue(-o,-r);case 6:return eo.compareValue(-o,r);case 7:return eo.compareValue(r,-o)}return tn.shouldNeverReachHere("invalid octant value"),0};eo.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0};var jl=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3];this._segString=e,this.coord=new Tt(t),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!t.equals2D(e.getCoordinate(n))};jl.prototype.getCoordinate=function(){return this.coord};jl.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)};jl.prototype.compareTo=function(e){var t=e;return this.segmentIndext.segmentIndex?1:this.coord.equals2D(t.coord)?0:eo.compare(this._segmentOctant,this.coord,t.coord)};jl.prototype.isEndPoint=function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e};jl.prototype.isInterior=function(){return this._isInterior};jl.prototype.interfaces_=function(){return[as]};jl.prototype.getClass=function(){return jl};var Wi=function(){this._nodeMap=new Pi,this._edge=null;var e=arguments[0];this._edge=e};Wi.prototype.getSplitCoordinates=function(){var e=this,t=new Nd;this.addEndpoints();for(var n=this.iterator(),r=n.next();n.hasNext();){var o=n.next();e.addEdgeCoordinates(r,o,t),r=o}return t.toCoordinateArray()};Wi.prototype.addCollapsedNodes=function(){var e=this,t=new ce;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var n=t.iterator();n.hasNext();){var r=n.next().intValue();e.add(e._edge.getCoordinate(r),r)}};Wi.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}};Wi.prototype.findCollapsesFromExistingVertices=function(e){for(var t=this,n=0;n=0?t>=0?n>=r?0:1:n>=r?7:6:t>=0?n>=r?3:2:n>=r?4:5}else if(arguments[0]instanceof Tt&&arguments[1]instanceof Tt){var o=arguments[0],l=arguments[1],h=l.x-o.x,u=l.y-o.y;if(h===0&&u===0)throw new tr("Cannot compute the octant for two identical points "+o);return Tc.octant(h,u)}};var La=function(){};La.prototype.getCoordinates=function(){};La.prototype.size=function(){};La.prototype.getCoordinate=function(e){};La.prototype.isClosed=function(){};La.prototype.setData=function(e){};La.prototype.getData=function(){};La.prototype.interfaces_=function(){return[]};La.prototype.getClass=function(){return La};var vd=function(){};vd.prototype.addIntersection=function(e,t){};vd.prototype.interfaces_=function(){return[La]};vd.prototype.getClass=function(){return vd};var Tr=function(){this._nodeList=new Wi(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};Tr.prototype.getCoordinates=function(){return this._pts};Tr.prototype.size=function(){return this._pts.length};Tr.prototype.getCoordinate=function(e){return this._pts[e]};Tr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};Tr.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))};Tr.prototype.setData=function(e){this._data=e};Tr.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:Tc.octant(e,t)};Tr.prototype.getData=function(){return this._data};Tr.prototype.addIntersection=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(arguments.length===4){var n=arguments[0],r=arguments[1],o=arguments[3],l=new Tt(n.getIntersection(o));this.addIntersection(l,r)}};Tr.prototype.toString=function(){return Es.toLineString(new Er(this._pts))};Tr.prototype.getNodeList=function(){return this._nodeList};Tr.prototype.addIntersectionNode=function(e,t){var n=t,r=n+1;if(r=0&&n>=0||t<=0&&n<=0?Math.max(t,n):0}else if(arguments[0]instanceof Tt){var r=arguments[0];return ye.orientationIndex(this.p0,this.p1,r)}};ke.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])};ke.prototype.isVertical=function(){return this.p0.x===this.p1.x};ke.prototype.equals=function(e){if(!(e instanceof ke))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)};ke.prototype.intersection=function(e){var t=new qu;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null};ke.prototype.project=function(){if(arguments[0]instanceof Tt){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new Tt(e);var t=this.projectionFactor(e),n=new Tt;return n.x=this.p0.x+t*(this.p1.x-this.p0.x),n.y=this.p0.y+t*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof ke){var r=arguments[0],o=this.projectionFactor(r.p0),l=this.projectionFactor(r.p1);if(o>=1&&l>=1||o<=0&&l<=0)return null;var h=this.project(r.p0);o<0&&(h=this.p0),o>1&&(h=this.p1);var u=this.project(r.p1);return l<0&&(u=this.p0),l>1&&(u=this.p1),new ke(h,u)}};ke.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};ke.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};ke.prototype.getCoordinate=function(e){return e===0?this.p0:this.p1};ke.prototype.distancePerpendicular=function(e){return ye.distancePointLinePerpendicular(e,this.p0,this.p1)};ke.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};ke.prototype.midPoint=function(){return ke.midPoint(this.p0,this.p1)};ke.prototype.projectionFactor=function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=t*t+n*n;if(r<=0)return We.NaN;var o=((e.x-this.p0.x)*t+(e.y-this.p0.y)*n)/r;return o};ke.prototype.closestPoints=function(e){var t=this.intersection(e);if(t!==null)return[t,t];var n=new Array(2).fill(null),r=We.MAX_VALUE,o=null,l=this.closestPoint(e.p0);r=l.distance(e.p0),n[0]=l,n[1]=e.p0;var h=this.closestPoint(e.p1);o=h.distance(e.p1),o0&&t<1)return this.project(e);var n=this.p0.distance(e),r=this.p1.distance(e);return n1||We.isNaN(t))&&(t=1),t};ke.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};ke.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};ke.prototype.distance=function(){if(arguments[0]instanceof ke){var e=arguments[0];return ye.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}else if(arguments[0]instanceof Tt){var t=arguments[0];return ye.distancePointLine(t,this.p0,this.p1)}};ke.prototype.pointAlong=function(e){var t=new Tt;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t};ke.prototype.hashCode=function(){var e=We.doubleToLongBits(this.p0.x);e^=We.doubleToLongBits(this.p0.y)*31;var t=Math.trunc(e)^Math.trunc(e>>32),n=We.doubleToLongBits(this.p1.x);n^=We.doubleToLongBits(this.p1.y)*31;var r=Math.trunc(n)^Math.trunc(n>>32);return t^r};ke.prototype.interfaces_=function(){return[as,ls]};ke.prototype.getClass=function(){return ke};ke.midPoint=function(e,t){return new Tt((e.x+t.x)/2,(e.y+t.y)/2)};XE.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(ke,XE);var bd=function(){this.tempEnv1=new Le,this.tempEnv2=new Le,this._overlapSeg1=new ke,this._overlapSeg2=new ke};bd.prototype.overlap=function(){if(arguments.length!==2&&arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3];e.getLineSegment(t,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}};bd.prototype.interfaces_=function(){return[]};bd.prototype.getClass=function(){return bd};var Eo=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3];this._pts=e,this._start=t,this._end=n,this._context=r};Eo.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]};Eo.prototype.computeSelect=function(e,t,n,r){var o=this._pts[t],l=this._pts[n];if(r.tempEnv1.init(o,l),n-t===1)return r.select(this,t),null;if(!e.intersects(r.tempEnv1))return null;var h=Math.trunc((t+n)/2);t=e.length-1)return e.length-1;for(var r=Nn.quadrant(e[n],e[n+1]),o=t+1;oh.getId()&&(h.computeOverlaps(w,o),r._nOverlaps++),r._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.SegmentOverlapAction.get=function(){return zw},Object.defineProperties(t,n),t}(xd),zw=function(e){function t(){e.call(this),this._si=null;var n=arguments[0];this._si=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],r=arguments[1],o=arguments[2],l=arguments[3],h=n.getContext(),u=o.getContext();this._si.processIntersections(h,r,u,l)}else return e.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(bd),Tn=function e(){if(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=e.CAP_ROUND,this._joinStyle=e.JOIN_ROUND,this._mitreLimit=e.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=e.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(arguments.length===4){var o=arguments[0],l=arguments[1],h=arguments[2],u=arguments[3];this.setQuadrantSegments(o),this.setEndCapStyle(l),this.setJoinStyle(h),this.setMitreLimit(u)}}},ml={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}};Tn.prototype.getEndCapStyle=function(){return this._endCapStyle};Tn.prototype.isSingleSided=function(){return this._isSingleSided};Tn.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=Tn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Tn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==Tn.JOIN_ROUND&&(this._quadrantSegments=Tn.DEFAULT_QUADRANT_SEGMENTS)};Tn.prototype.getJoinStyle=function(){return this._joinStyle};Tn.prototype.setJoinStyle=function(e){this._joinStyle=e};Tn.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e};Tn.prototype.getSimplifyFactor=function(){return this._simplifyFactor};Tn.prototype.getQuadrantSegments=function(){return this._quadrantSegments};Tn.prototype.setEndCapStyle=function(e){this._endCapStyle=e};Tn.prototype.getMitreLimit=function(){return this._mitreLimit};Tn.prototype.setMitreLimit=function(e){this._mitreLimit=e};Tn.prototype.setSingleSided=function(e){this._isSingleSided=e};Tn.prototype.interfaces_=function(){return[]};Tn.prototype.getClass=function(){return Tn};Tn.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)};ml.CAP_ROUND.get=function(){return 1};ml.CAP_FLAT.get=function(){return 2};ml.CAP_SQUARE.get=function(){return 3};ml.JOIN_ROUND.get=function(){return 1};ml.JOIN_MITRE.get=function(){return 2};ml.JOIN_BEVEL.get=function(){return 3};ml.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};ml.DEFAULT_MITRE_LIMIT.get=function(){return 5};ml.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(Tn,ml);var yr=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=ye.COUNTERCLOCKWISE,this._inputLine=e||null},Fd={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};yr.prototype.isDeletable=function(e,t,n,r){var o=this._inputLine[e],l=this._inputLine[t],h=this._inputLine[n];return!this.isConcave(o,l,h)||!this.isShallow(o,l,h,r)?!1:this.isShallowSampled(o,l,e,n,r)};yr.prototype.deleteShallowConcavities=function(){for(var e=this,t=1,n=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(n),o=!1;r=0;o--)n.addPt(e[o])};qo.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1),n=e.distance(t);return nMath.PI;)e-=yn.PI_TIMES_2;for(;e<=-Math.PI;)e+=yn.PI_TIMES_2;return e};yn.angle=function(){if(arguments.length===1){var e=arguments[0];return Math.atan2(e.y,e.x)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],r=n.x-t.x,o=n.y-t.y;return Math.atan2(o,r)}};yn.isAcute=function(e,t,n){var r=e.x-t.x,o=e.y-t.y,l=n.x-t.x,h=n.y-t.y,u=r*l+o*h;return u>0};yn.isObtuse=function(e,t,n){var r=e.x-t.x,o=e.y-t.y,l=n.x-t.x,h=n.y-t.y,u=r*l+o*h;return u<0};yn.interiorAngle=function(e,t,n){var r=yn.angle(t,e),o=yn.angle(t,n);return Math.abs(o-r)};yn.normalizePositive=function(e){if(e<0){for(;e<0;)e+=yn.PI_TIMES_2;e>=yn.PI_TIMES_2&&(e=0)}else{for(;e>=yn.PI_TIMES_2;)e-=yn.PI_TIMES_2;e<0&&(e=0)}return e};yn.angleBetween=function(e,t,n){var r=yn.angle(t,e),o=yn.angle(t,n);return yn.diff(r,o)};yn.diff=function(e,t){var n=null;return eMath.PI&&(n=2*Math.PI-n),n};yn.toRadians=function(e){return e*Math.PI/180};yn.getTurn=function(e,t){var n=Math.sin(t-e);return n>0?yn.COUNTERCLOCKWISE:n<0?yn.CLOCKWISE:yn.NONE};yn.angleBetweenOriented=function(e,t,n){var r=yn.angle(t,e),o=yn.angle(t,n),l=o-r;return l<=-Math.PI?l+yn.PI_TIMES_2:l>Math.PI?l-yn.PI_TIMES_2:l};jc.PI_TIMES_2.get=function(){return 2*Math.PI};jc.PI_OVER_2.get=function(){return Math.PI/2};jc.PI_OVER_4.get=function(){return Math.PI/4};jc.COUNTERCLOCKWISE.get=function(){return ye.COUNTERCLOCKWISE};jc.CLOCKWISE.get=function(){return ye.CLOCKWISE};jc.NONE.get=function(){return ye.COLLINEAR};Object.defineProperties(yn,jc);var Xn=function e(){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 ke,this._seg1=new ke,this._offset0=new ke,this._offset1=new ke,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=n,this._li=new qu,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Tn.JOIN_ROUND&&(this._closingSegLengthFactor=e.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Bd={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}};Xn.prototype.addNextSegment=function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,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=ye.computeOrientation(this._s0,this._s1,this._s2),r=n===ye.CLOCKWISE&&this._side===ne.LEFT||n===ye.COUNTERCLOCKWISE&&this._side===ne.RIGHT;n===0?this.addCollinear(t):r?this.addOutsideTurn(n,t):this.addInsideTurn(n,t)};Xn.prototype.addLineEndCap=function(e,t){var n=new ke(e,t),r=new ke;this.computeOffsetSegment(n,ne.LEFT,this._distance,r);var o=new ke;this.computeOffsetSegment(n,ne.RIGHT,this._distance,o);var l=t.x-e.x,h=t.y-e.y,u=Math.atan2(h,l);switch(this._bufParams.getEndCapStyle()){case Tn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(t,u+Math.PI/2,u-Math.PI/2,ye.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case Tn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(o.p1);break;case Tn.CAP_SQUARE:var y=new Tt;y.x=Math.abs(this._distance)*Math.cos(u),y.y=Math.abs(this._distance)*Math.sin(u);var w=new Tt(r.p1.x+y.x,r.p1.y+y.y),S=new Tt(o.p1.x+y.x,o.p1.y+y.y);this._segList.addPt(w),this._segList.addPt(S);break}};Xn.prototype.getCoordinates=function(){var e=this._segList.getCoordinates();return e};Xn.prototype.addMitreJoin=function(e,t,n,r){var o=!0,l=null;try{l=xs.intersection(t.p0,t.p1,n.p0,n.p1);var h=r<=0?1:l.distance(e)/Math.abs(r);h>this._bufParams.getMitreLimit()&&(o=!1)}catch(u){if(u instanceof Rf)l=new Tt(0,0),o=!1;else throw u}finally{}o?this._segList.addPt(l):this.addLimitedMitreJoin(t,n,r,this._bufParams.getMitreLimit())};Xn.prototype.addFilletCorner=function(e,t,n,r,o){var l=t.x-e.x,h=t.y-e.y,u=Math.atan2(h,l),y=n.x-e.x,w=n.y-e.y,S=Math.atan2(w,y);r===ye.CLOCKWISE?u<=S&&(u+=2*Math.PI):u>=S&&(u-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,u,S,r,o),this._segList.addPt(n)};Xn.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new Tt((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 r=new Tt((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(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}};Xn.prototype.createCircle=function(e){var t=new Tt(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};Xn.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)};Xn.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new qo,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*Xn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};Xn.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var t=this._li.getIntersectionNum();t>=2&&(this._bufParams.getJoinStyle()===Tn.JOIN_BEVEL||this._bufParams.getJoinStyle()===Tn.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,ye.CLOCKWISE,this._distance))};Xn.prototype.closeRing=function(){this._segList.closeRing()};Xn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};Xn.prototype.interfaces_=function(){return[]};Xn.prototype.getClass=function(){return Xn};Bd.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};Bd.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};Bd.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};Bd.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(Xn,Bd);var ro=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t};ro.prototype.getOffsetCurve=function(e,t){if(this._distance=t,t===0)return null;var n=t<0,r=Math.abs(t),o=this.getSegGen(r);e.length<=1?this.computePointCurve(e[0],o):this.computeOffsetCurve(e,n,o);var l=o.getCoordinates();return n&&cn.reverse(l),l};ro.prototype.computeSingleSidedBufferCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);if(t){n.addSegments(e,!0);var o=yr.simplify(e,-r),l=o.length-1;n.initSideSegments(o[l],o[l-1],ne.LEFT),n.addFirstSegment();for(var h=l-2;h>=0;h--)n.addNextSegment(o[h],!0)}else{n.addSegments(e,!1);var u=yr.simplify(e,r),y=u.length-1;n.initSideSegments(u[0],u[1],ne.LEFT),n.addFirstSegment();for(var w=2;w<=y;w++)n.addNextSegment(u[w],!0)}n.addLastSegment(),n.closeRing()};ro.prototype.computeRingBufferCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);t===ne.RIGHT&&(r=-r);var o=yr.simplify(e,r),l=o.length-1;n.initSideSegments(o[l-1],o[0],t);for(var h=1;h<=l;h++){var u=h!==1;n.addNextSegment(o[h],u)}n.closeRing()};ro.prototype.computeLineBufferCurve=function(e,t){var n=this.simplifyTolerance(this._distance),r=yr.simplify(e,n),o=r.length-1;t.initSideSegments(r[0],r[1],ne.LEFT);for(var l=2;l<=o;l++)t.addNextSegment(r[l],!0);t.addLastSegment(),t.addLineEndCap(r[o-1],r[o]);var h=yr.simplify(e,-n),u=h.length-1;t.initSideSegments(h[u],h[u-1],ne.LEFT);for(var y=u-2;y>=0;y--)t.addNextSegment(h[y],!0);t.addLastSegment(),t.addLineEndCap(h[1],h[0]),t.closeRing()};ro.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case Tn.CAP_ROUND:t.createCircle(e);break;case Tn.CAP_SQUARE:t.createSquare(e);break}};ro.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided()||t===0)return null;var n=Math.abs(t),r=this.getSegGen(n);if(e.length<=1)this.computePointCurve(e[0],r);else if(this._bufParams.isSingleSided()){var o=t<0;this.computeSingleSidedBufferCurve(e,o,r)}else this.computeLineBufferCurve(e,r);var l=r.getCoordinates();return l};ro.prototype.getBufferParameters=function(){return this._bufParams};ro.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()};ro.prototype.getRingCurve=function(e,t,n){if(this._distance=n,e.length<=2)return this.getLineCurve(e,n);if(n===0)return ro.copyCoordinates(e);var r=this.getSegGen(n);return this.computeRingBufferCurve(e,t,r),r.getCoordinates()};ro.prototype.computeOffsetCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);if(t){var o=yr.simplify(e,-r),l=o.length-1;n.initSideSegments(o[l],o[l-1],ne.LEFT),n.addFirstSegment();for(var h=l-2;h>=0;h--)n.addNextSegment(o[h],!0)}else{var u=yr.simplify(e,r),y=u.length-1;n.initSideSegments(u[0],u[1],ne.LEFT),n.addFirstSegment();for(var w=2;w<=y;w++)n.addNextSegment(u[w],!0)}n.addLastSegment()};ro.prototype.getSegGen=function(e){return new Xn(this._precisionModel,this._bufParams,e)};ro.prototype.interfaces_=function(){return[]};ro.prototype.getClass=function(){return ro};ro.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),n=0;nl.getMaxY()||e.findStabbedSegments(t,o.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(Be(arguments[2],ws)&&arguments[0]instanceof Tt&&arguments[1]instanceof B0)for(var h=arguments[0],u=arguments[1],y=arguments[2],w=u.getEdge().getCoordinates(),S=0;Se._seg.p1.y&&e._seg.reverse();var C=Math.max(e._seg.p0.x,e._seg.p1.x);if(!(Ce._seg.p1.y)&&ye.computeOrientation(e._seg.p0,e._seg.p1,h)!==ye.RIGHT){var P=u.getDepth(ne.LEFT);e._seg.p0.equals(w[S])||(P=u.getDepth(ne.RIGHT));var F=new Du(e._seg,P);y.add(F)}}else if(Be(arguments[2],ws)&&arguments[0]instanceof Tt&&Be(arguments[1],ws))for(var R=arguments[0],Y=arguments[1],J=arguments[2],K=Y.iterator();K.hasNext();){var O=K.next();O.isForward()&&e.findStabbedSegments(R,O,J)}}};Lc.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(t.size()===0)return 0;var n=Ts.min(t);return n._leftDepth};Lc.prototype.interfaces_=function(){return[]};Lc.prototype.getClass=function(){return Lc};KE.DepthSegment.get=function(){return Du};Object.defineProperties(Lc,KE);var Du=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new ke(e),this._leftDepth=t};Du.prototype.compareTo=function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(t._upwardSeg);return n!==0||(n=-1*t._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(t._upwardSeg)};Du.prototype.compareX=function(e,t){var n=e.p0.compareTo(t.p0);return n!==0?n:e.p1.compareTo(t.p1)};Du.prototype.toString=function(){return this._upwardSeg.toString()};Du.prototype.interfaces_=function(){return[as]};Du.prototype.getClass=function(){return Du};var Pn=function(e,t,n){this.p0=e||null,this.p1=t||null,this.p2=n||null};Pn.prototype.area=function(){return Pn.area(this.p0,this.p1,this.p2)};Pn.prototype.signedArea=function(){return Pn.signedArea(this.p0,this.p1,this.p2)};Pn.prototype.interpolateZ=function(e){if(e===null)throw new tr("Supplied point is null.");return Pn.interpolateZ(e,this.p0,this.p1,this.p2)};Pn.prototype.longestSideLength=function(){return Pn.longestSideLength(this.p0,this.p1,this.p2)};Pn.prototype.isAcute=function(){return Pn.isAcute(this.p0,this.p1,this.p2)};Pn.prototype.circumcentre=function(){return Pn.circumcentre(this.p0,this.p1,this.p2)};Pn.prototype.area3D=function(){return Pn.area3D(this.p0,this.p1,this.p2)};Pn.prototype.centroid=function(){return Pn.centroid(this.p0,this.p1,this.p2)};Pn.prototype.inCentre=function(){return Pn.inCentre(this.p0,this.p1,this.p2)};Pn.prototype.interfaces_=function(){return[]};Pn.prototype.getClass=function(){return Pn};Pn.area=function(e,t,n){return Math.abs(((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2)};Pn.signedArea=function(e,t,n){return((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2};Pn.det=function(e,t,n,r){return e*r-t*n};Pn.interpolateZ=function(e,t,n,r){var o=t.x,l=t.y,h=n.x-o,u=r.x-o,y=n.y-l,w=r.y-l,S=h*w-u*y,C=e.x-o,P=e.y-l,F=(w*C-u*P)/S,R=(-y*C+h*P)/S,Y=t.z+F*(n.z-t.z)+R*(r.z-t.z);return Y};Pn.longestSideLength=function(e,t,n){var r=e.distance(t),o=t.distance(n),l=n.distance(e),h=r;return o>h&&(h=o),l>h&&(h=l),h};Pn.isAcute=function(e,t,n){return!(!yn.isAcute(e,t,n)||!yn.isAcute(t,n,e)||!yn.isAcute(n,e,t))};Pn.circumcentre=function(e,t,n){var r=n.x,o=n.y,l=e.x-r,h=e.y-o,u=t.x-r,y=t.y-o,w=2*Pn.det(l,h,u,y),S=Pn.det(h,l*l+h*h,y,u*u+y*y),C=Pn.det(l,l*l+h*h,u,u*u+y*y),P=r-S/w,F=o+C/w;return new Tt(P,F)};Pn.perpendicularBisector=function(e,t){var n=t.x-e.x,r=t.y-e.y,o=new xs(e.x+n/2,e.y+r/2,1),l=new xs(e.x-r+n/2,e.y+n+r/2,1);return new xs(o,l)};Pn.angleBisector=function(e,t,n){var r=t.distance(e),o=t.distance(n),l=r/(r+o),h=n.x-e.x,u=n.y-e.y,y=new Tt(e.x+l*h,e.y+l*u);return y};Pn.area3D=function(e,t,n){var r=t.x-e.x,o=t.y-e.y,l=t.z-e.z,h=n.x-e.x,u=n.y-e.y,y=n.z-e.z,w=o*y-l*u,S=l*h-r*y,C=r*u-o*h,P=w*w+S*S+C*C,F=Math.sqrt(P)/2;return F};Pn.centroid=function(e,t,n){var r=(e.x+t.x+n.x)/3,o=(e.y+t.y+n.y)/3;return new Tt(r,o)};Pn.inCentre=function(e,t,n){var r=t.distance(n),o=e.distance(n),l=e.distance(t),h=r+o+l,u=(r*e.x+o*t.x+l*n.x)/h,y=(r*e.y+o*t.y+l*n.y)/h;return new Tt(u,y)};var ss=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new ce;var e=arguments[0],t=arguments[1],n=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=n};ss.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,At.EXTERIOR,At.INTERIOR)};ss.prototype.addPolygon=function(e){var t=this,n=this._distance,r=ne.LEFT;this._distance<0&&(n=-this._distance,r=ne.RIGHT);var o=e.getExteriorRing(),l=cn.removeRepeatedPoints(o.getCoordinates());if(this._distance<0&&this.isErodedCompletely(o,this._distance)||this._distance<=0&&l.length<3)return null;this.addPolygonRing(l,n,r,At.EXTERIOR,At.INTERIOR);for(var h=0;h0&&t.isErodedCompletely(u,-t._distance)||t.addPolygonRing(y,n,ne.opposite(r),At.INTERIOR,At.EXTERIOR)}};ss.prototype.isTriangleErodedCompletely=function(e,t){var n=new Pn(e[0],e[1],e[2]),r=n.inCentre(),o=ye.distancePointLine(r,n.p0,n.p1);return o=Ca.MINIMUM_VALID_SIZE&&ye.isCCW(e)&&(l=o,h=r,n=ne.opposite(n));var u=this._curveBuilder.getRingCurve(e,n,t);this.addCurve(u,l,h)};ss.prototype.add=function(e){if(e.isEmpty())return null;e instanceof qr?this.addPolygon(e):e instanceof gr?this.addLineString(e):e instanceof wo?this.addPoint(e):e instanceof df?this.addCollection(e):e instanceof Au?this.addCollection(e):e instanceof Sa?this.addCollection(e):e instanceof qi&&this.addCollection(e)};ss.prototype.isErodedCompletely=function(e,t){var n=e.getCoordinates();if(n.length<4)return t<0;if(n.length===4)return this.isTriangleErodedCompletely(n,t);var r=e.getEnvelopeInternal(),o=Math.min(r.getHeight(),r.getWidth());return t<0&&2*Math.abs(t)>o};ss.prototype.addCollection=function(e){for(var t=this,n=0;n=this._max)throw new Of;var e=this._parent.getGeometryN(this._index++);return e instanceof qi?(this._subcollectionIterator=new Ea(e),this._subcollectionIterator.next()):e};Ea.prototype.remove=function(){throw new Error(this.getClass().getName())};Ea.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)};Ea.prototype.interfaces_=function(){return[Nf]};Ea.prototype.getClass=function(){return Ea};Ea.isAtomic=function(e){return!(e instanceof qi)};var Bo=function(){this._geom=null;var e=arguments[0];this._geom=e};Bo.prototype.locate=function(e){return Bo.locate(e,this._geom)};Bo.prototype.interfaces_=function(){return[_f]};Bo.prototype.getClass=function(){return Bo};Bo.isPointInRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?ye.isPointInRing(e,t.getCoordinates()):!1};Bo.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var n=t.getExteriorRing();if(!Bo.isPointInRing(e,n))return!1;for(var r=0;r=0;l--){var h=n._edgeList.get(l),u=h.getSym();o===null&&(o=u),r!==null&&u.setNext(r),r=h}o.setNext(r)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var r=arguments[0],o=this.findIndex(r),l=r.getDepth(ne.LEFT),h=r.getDepth(ne.RIGHT),u=this.computeDepths(o+1,this._edgeList.size(),l),y=this.computeDepths(0,o,u);if(y!==h)throw new ll("depth mismatch at "+r.getCoordinate())}else if(arguments.length===3){for(var w=arguments[0],S=arguments[1],C=arguments[2],P=C,F=w;F=0;u--){var y=r._resultAreaEdgeList.get(u),w=y.getSym();switch(o===null&&y.getEdgeRing()===n&&(o=y),h){case r._SCANNING_FOR_INCOMING:if(w.getEdgeRing()!==n)continue;l=w,h=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(y.getEdgeRing()!==n)continue;l.setNextMin(y),h=r._SCANNING_FOR_INCOMING;break}}h===this._LINKING_TO_OUTGOING&&(tn.isTrue(o!==null,"found null for first outgoing dirEdge"),tn.isTrue(o.getEdgeRing()===n,"unable to link last incoming dirEdge"),l.setNextMin(o))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,r=this.iterator();r.hasNext();){var o=r.next();o.isInResult()&&n++}return n}else if(arguments.length===1){for(var l=arguments[0],h=0,u=this.iterator();u.hasNext();){var y=u.next();y.getEdgeRing()===l&&h++}return h}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=At.NONE,r=this.iterator();r.hasNext();){var o=r.next(),l=o.getSym();if(!o.isLineEdge()){if(o.isInResult()){n=At.INTERIOR;break}if(l.isInResult()){n=At.EXTERIOR;break}}}if(n===At.NONE)return null;for(var h=n,u=this.iterator();u.hasNext();){var y=u.next(),w=y.getSym();y.isLineEdge()?y.getEdge().setCovered(h===At.INTERIOR):(y.isInResult()&&(h=At.EXTERIOR),w.isInResult()&&(h=At.INTERIOR))}},t.prototype.computeLabelling=function(n){var r=this;e.prototype.computeLabelling.call(this,n),this._label=new Rn(At.NONE);for(var o=this.iterator();o.hasNext();)for(var l=o.next(),h=l.getEdge(),u=h.getLabel(),y=0;y<2;y++){var w=u.getLocation(y);(w===At.INTERIOR||w===At.BOUNDARY)&&r._label.setLocation(y,At.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ai),JE=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new gy(n,new oR)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(mf),Wl=function e(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=e.orientation(t)};Wl.prototype.compareTo=function(e){var t=e,n=Wl.compareOriented(this._pts,this._orientation,t._pts,t._orientation);return n};Wl.prototype.interfaces_=function(){return[as]};Wl.prototype.getClass=function(){return Wl};Wl.orientation=function(e){return cn.increasingDirection(e)===1};Wl.compareOriented=function(e,t,n,r){for(var o=t?1:-1,l=r?1:-1,h=t?e.length:-1,u=r?n.length:-1,y=t?0:e.length-1,w=r?0:n.length-1;;){var S=e[y].compareTo(n[w]);if(S!==0)return S;y+=o,w+=l;var C=y===h,P=w===u;if(C&&!P)return-1;if(!C&&P)return 1;if(C&&P)return 0}};var Ls=function(){this._edges=new ce,this._ocaMap=new Pi};Ls.prototype.print=function(e){var t=this;e.print("MULTILINESTRING ( ");for(var n=0;n0&&e.print(","),e.print("(");for(var o=r.getCoordinates(),l=0;l0&&e.print(","),e.print(o[l].x+" "+o[l].y);e.println(")")}e.print(") ")};Ls.prototype.addAll=function(e){for(var t=this,n=e.iterator();n.hasNext();)t.add(n.next())};Ls.prototype.findEdgeIndex=function(e){for(var t=this,n=0;n0||!t.coord.equals2D(o);l||r--;var h=new Array(r).fill(null),u=0;h[u++]=new Tt(e.coord);for(var y=e.segmentIndex+1;y<=t.segmentIndex;y++)h[u++]=n.edge.pts[y];return l&&(h[u]=t.coord),new Vg(h,new Rn(this.edge._label))};Pa.prototype.add=function(e,t,n){var r=new ra(e,t,n),o=this._nodeMap.get(r);return o!==null?o:(this._nodeMap.put(r,r),r)};Pa.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();if(n.coord.equals(e))return!0}return!1};Pa.prototype.interfaces_=function(){return[]};Pa.prototype.getClass=function(){return Pa};var Nu=function(){};Nu.prototype.getChainStartIndices=function(e){var t=this,n=0,r=new ce;r.add(new Js(n));do{var o=t.findChainEnd(e,n);r.add(new Js(o)),n=o}while(nn?t:n};cl.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return tn&&(o=1),e._depth[t][r]=o}}};mi.prototype.getDelta=function(e){return this._depth[e][ne.RIGHT]-this._depth[e][ne.LEFT]};mi.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?At.EXTERIOR:At.INTERIOR};mi.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};mi.prototype.add=function(){var e=this;if(arguments.length===1)for(var t=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var o=t.getLocation(n,r);(o===At.EXTERIOR||o===At.INTERIOR)&&(e.isNull(n,r)?e._depth[n][r]=mi.depthAtLocation(o):e._depth[n][r]+=mi.depthAtLocation(o))}else if(arguments.length===3){var l=arguments[0],h=arguments[1],u=arguments[2];u===At.INTERIOR&&this._depth[l][h]++}};mi.prototype.interfaces_=function(){return[]};mi.prototype.getClass=function(){return mi};mi.depthAtLocation=function(e){return e===At.EXTERIOR?0:e===At.INTERIOR?1:mi.NULL_VALUE};QE.NULL_VALUE.get=function(){return-1};Object.defineProperties(mi,QE);var Vg=function(e){function t(){if(e.call(this),this.pts=null,this._env=null,this.eiList=new Pa(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new mi,this._depthDelta=0,arguments.length===1){var n=arguments[0];t.call(this,n,null)}else if(arguments.length===2){var r=arguments[0],o=arguments[1];this.pts=r,this._label=o}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var r=new t(n,Rn.toLineLabel(this._label));return r},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var r=this;if(!(n instanceof t))return!1;var o=n;if(this.pts.length!==o.pts.length)return!1;for(var l=!0,h=!0,u=this.pts.length,y=0;y0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var r=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var o=0;o0&&n.print(","),n.print(r.pts[o].x+" "+r.pts[o].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var r=this;n.print("edge "+this._name+": ");for(var o=this.pts.length-1;o>=0;o--)n.print(r.pts[o]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new cl(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new Le;for(var r=0;r0&&r.append(","),r.append(n.pts[o].x+" "+n.pts[o].y);return r.append(") "+this._label+" "+this._depthDelta),r.toString()},t.prototype.isPointwiseEqual=function(n){var r=this;if(this.pts.length!==n.pts.length)return!1;for(var o=0;or||this._maxyl;if(h)return!1;var u=this.intersectsToleranceSquare(e,t);return tn.isTrue(!(h&&u),"Found bad envelope test"),u};io.prototype.initCorners=function(e){var t=.5;this._minx=e.x-t,this._maxx=e.x+t,this._miny=e.y-t,this._maxy=e.y+t,this._corner[0]=new Tt(this._maxx,this._maxy),this._corner[1]=new Tt(this._minx,this._maxy),this._corner[2]=new Tt(this._minx,this._miny),this._corner[3]=new Tt(this._maxx,this._miny)};io.prototype.intersects=function(e,t){return this._scaleFactor===1?this.intersectsScaled(e,t):(this.copyScaled(e,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))};io.prototype.scale=function(e){return Math.round(e*this._scaleFactor)};io.prototype.getCoordinate=function(){return this._originalPt};io.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)};io.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var e=io.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Le(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv};io.prototype.intersectsPixelClosure=function(e,t){return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.hasIntersection()))};io.prototype.intersectsToleranceSquare=function(e,t){var n=!1,r=!1;return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.isProper())||n&&r||e.equals(this._pt)||t.equals(this._pt))};io.prototype.addSnappedNode=function(e,t){var n=e.getCoordinate(t),r=e.getCoordinate(t+1);return this.intersects(n,r)?(e.addIntersection(this.getCoordinate(),t),!0):!1};io.prototype.interfaces_=function(){return[]};io.prototype.getClass=function(){return io};tI.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(io,tI);var wd=function(){this.tempEnv1=new Le,this.selectedSegment=new ke};wd.prototype.select=function(){if(arguments.length!==1&&arguments.length===2){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}};wd.prototype.interfaces_=function(){return[]};wd.prototype.getClass=function(){return wd};var vf=function(){this._index=null;var e=arguments[0];this._index=e},eI={HotPixelSnapAction:{configurable:!0}};vf.prototype.snap=function(){if(arguments.length===1){var e=arguments[0];return this.snap(e,null,-1)}else if(arguments.length===3){var t=arguments[0],n=arguments[1],r=arguments[2],o=t.getSafeEnvelope(),l=new nI(t,n,r);return this._index.query(o,{interfaces_:function(){return[ql]},visitItem:function(h){var u=h;u.select(o,l)}}),l.isNodeAdded()}};vf.prototype.interfaces_=function(){return[]};vf.prototype.getClass=function(){return vf};eI.HotPixelSnapAction.get=function(){return nI};Object.defineProperties(vf,eI);var nI=function(e){function t(){e.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var n=arguments[0],r=arguments[1],o=arguments[2];this._hotPixel=n,this._parentEdge=r,this._hotPixelVertexIndex=o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1],o=n.getContext();if(this._parentEdge!==null&&o===this._parentEdge&&r===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(o,r)}else return e.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(wd),Pc=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new ce};Pc.prototype.processIntersections=function(e,t,n,r){var o=this;if(e===n&&t===r)return null;var l=e.getCoordinates()[t],h=e.getCoordinates()[t+1],u=n.getCoordinates()[r],y=n.getCoordinates()[r+1];if(this._li.computeIntersection(l,h,u,y),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var w=0;w=0;t--){try{e.bufferReducedPrecision(t)}catch(l){if(l instanceof ll)e._saveException=l;else throw l}finally{}if(e._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],r=di.precisionScaleFactor(this._argGeom,this._distance,n),o=new Ln(r);this.bufferFixedPrecision(o)}};di.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===Ln.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()};di.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)};di.prototype.bufferOriginalPrecision=function(){try{var e=new Ui(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(t instanceof sl)this._saveException=t;else throw t}finally{}};di.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry};di.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)};di.prototype.interfaces_=function(){return[]};di.prototype.getClass=function(){return di};di.bufferOp=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new di(e),r=n.getResultGeometry(t);return r}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Fe&&typeof arguments[1]=="number"){var o=arguments[0],l=arguments[1],h=arguments[2],u=new di(o);u.setQuadrantSegments(h);var y=u.getResultGeometry(l);return y}else if(arguments[2]instanceof Tn&&arguments[0]instanceof Fe&&typeof arguments[1]=="number"){var w=arguments[0],S=arguments[1],C=arguments[2],P=new di(w,C),F=P.getResultGeometry(S);return F}}else if(arguments.length===4){var R=arguments[0],Y=arguments[1],J=arguments[2],K=arguments[3],O=new di(R);O.setQuadrantSegments(J),O.setEndCapStyle(K);var G=O.getResultGeometry(Y);return G}};di.precisionScaleFactor=function(e,t,n){var r=e.getEnvelopeInternal(),o=Uo.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY())),l=t>0?t:0,h=o+2*l,u=Math.trunc(Math.log(h)/Math.log(10)+1),y=n-u,w=Math.pow(10,y);return w};zf.CAP_ROUND.get=function(){return Tn.CAP_ROUND};zf.CAP_BUTT.get=function(){return Tn.CAP_FLAT};zf.CAP_FLAT.get=function(){return Tn.CAP_FLAT};zf.CAP_SQUARE.get=function(){return Tn.CAP_SQUARE};zf.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(di,zf);var Fi=function(){this._pt=[new Tt,new Tt],this._distance=We.NaN,this._isNull=!0};Fi.prototype.getCoordinates=function(){return this._pt};Fi.prototype.getCoordinate=function(e){return this._pt[e]};Fi.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var r=t.distance(n);rthis._distance&&this.initialize(t,n,r)}};Fi.prototype.interfaces_=function(){return[]};Fi.prototype.getClass=function(){return Fi};var ba=function(){};ba.prototype.interfaces_=function(){return[]};ba.prototype.getClass=function(){return ba};ba.computeDistance=function(){if(arguments[2]instanceof Fi&&arguments[0]instanceof gr&&arguments[1]instanceof Tt)for(var e=arguments[0],t=arguments[1],n=arguments[2],r=e.getCoordinates(),o=new ke,l=0;l0||this._isIn?At.INTERIOR:At.EXTERIOR)};Ps.prototype.interfaces_=function(){return[]};Ps.prototype.getClass=function(){return Ps};var Bi=function e(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],n=arguments[1];e.call(this,t,e.INSIDE_AREA,n)}else if(arguments.length===3){var r=arguments[0],o=arguments[1],l=arguments[2];this._component=r,this._segIndex=o,this._pt=l}},rI={INSIDE_AREA:{configurable:!0}};Bi.prototype.isInsideArea=function(){return this._segIndex===Bi.INSIDE_AREA};Bi.prototype.getCoordinate=function(){return this._pt};Bi.prototype.getGeometryComponent=function(){return this._component};Bi.prototype.getSegmentIndex=function(){return this._segIndex};Bi.prototype.interfaces_=function(){return[]};Bi.prototype.getClass=function(){return Bi};rI.INSIDE_AREA.get=function(){return-1};Object.defineProperties(Bi,rI);var Vl=function(e){this._pts=e||null};Vl.prototype.filter=function(e){e instanceof wo&&this._pts.add(e)};Vl.prototype.interfaces_=function(){return[$s]};Vl.prototype.getClass=function(){return Vl};Vl.getPoints=function(){if(arguments.length===1){var e=arguments[0];return e instanceof wo?Ts.singletonList(e):Vl.getPoints(e,new ce)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t instanceof wo?n.add(t):t instanceof qi&&t.apply(new Vl(n)),n}};var Ac=function(){this._locations=null;var e=arguments[0];this._locations=e};Ac.prototype.filter=function(e){(e instanceof wo||e instanceof gr||e instanceof qr)&&this._locations.add(new Bi(e,0,e.getCoordinate()))};Ac.prototype.interfaces_=function(){return[$s]};Ac.prototype.getClass=function(){return Ac};Ac.getLocations=function(e){var t=new ce;return e.apply(new Ac(t)),t};var yi=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ps,this._minDistanceLocation=null,this._minDistance=We.MAX_VALUE,arguments.length===2){var e=arguments[0],t=arguments[1];this._geom=[e,t],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],r=arguments[1],o=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=o}};yi.prototype.computeContainmentDistance=function(){var e=this;if(arguments.length===0){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1],o=1-n,l=rl.getPolygons(this._geom[n]);if(l.size()>0){var h=Ac.getLocations(this._geom[o]);if(this.computeContainmentDistance(h,l,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[o]=r[0],this._minDistanceLocation[n]=r[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&Be(arguments[0],ws)&&Be(arguments[1],ws)){for(var u=arguments[0],y=arguments[1],w=arguments[2],S=0;Sthis._minDistance)return null;for(var o=t.getCoordinates(),l=n.getCoordinate(),h=0;hthis._minDistance)return null;for(var F=S.getCoordinates(),R=C.getCoordinates(),Y=0;Ythis._distance&&this.initialize(t,n,r)}};Si.prototype.interfaces_=function(){return[]};Si.prototype.getClass=function(){return Si};var Zs=function(){};Zs.prototype.interfaces_=function(){return[]};Zs.prototype.getClass=function(){return Zs};Zs.computeDistance=function(){if(arguments[2]instanceof Si&&arguments[0]instanceof gr&&arguments[1]instanceof Tt)for(var e=arguments[0],t=arguments[1],n=arguments[2],r=new ke,o=e.getCoordinates(),l=0;l1||e<=0)throw new tr("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e};rs.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)};rs.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};rs.prototype.computeOrientedDistance=function(e,t,n){var r=new kc(t);if(e.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var o=new Xl(t,this._densifyFrac);e.apply(o),n.setMaximum(o.getMaxPointDistance())}};rs.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};rs.prototype.interfaces_=function(){return[]};rs.prototype.getClass=function(){return rs};rs.distance=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new rs(e,t);return n.distance()}else if(arguments.length===3){var r=arguments[0],o=arguments[1],l=arguments[2],h=new rs(r,o);return h.setDensifyFraction(l),h.distance()}};Nv.MaxPointDistanceFilter.get=function(){return kc};Nv.MaxDensifiedByFractionDistanceFilter.get=function(){return Xl};Object.defineProperties(rs,Nv);var kc=function(){this._maxPtDist=new Si,this._minPtDist=new Si,this._euclideanDist=new Zs,this._geom=null;var e=arguments[0];this._geom=e};kc.prototype.filter=function(e){this._minPtDist.initialize(),Zs.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};kc.prototype.getMaxPointDistance=function(){return this._maxPtDist};kc.prototype.interfaces_=function(){return[Ia]};kc.prototype.getClass=function(){return kc};var Xl=function(){this._maxPtDist=new Si,this._minPtDist=new Si,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))};Xl.prototype.filter=function(e,t){var n=this;if(t===0)return null;for(var r=e.getCoordinate(t-1),o=e.getCoordinate(t),l=(o.x-r.x)/this._numSubSegs,h=(o.y-r.y)/this._numSubSegs,u=0;un){this._isValid=!1;var o=r.getCoordinates();this._errorLocation=o[1],this._errorIndicator=e.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Es.toLineString(o[0],o[1])+")"}};vo.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=vo.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-t,this._maxValidDistance=e+t,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),vo.VERBOSE&&gi.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};vo.prototype.checkNegativeValid=function(){if(!(this._input instanceof qr||this._input instanceof Sa||this._input instanceof qi))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)};vo.prototype.getErrorIndicator=function(){return this._errorIndicator};vo.prototype.checkMinimumDistance=function(e,t,n){var r=new yi(e,t,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound0&&e>t&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e=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")};_i.prototype.report=function(e){if(!_i.VERBOSE)return null;gi.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))};_i.prototype.getErrorMessage=function(){return this._errorMsg};_i.prototype.interfaces_=function(){return[]};_i.prototype.getClass=function(){return _i};_i.isValidMsg=function(e,t,n){var r=new _i(e,t,n);return r.isValid()?null:r.getErrorMessage()};_i.isValid=function(e,t,n){var r=new _i(e,t,n);return!!r.isValid()};zv.VERBOSE.get=function(){return!1};zv.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties(_i,zv);var oa=function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};oa.prototype.getCoordinates=function(){return this._pts};oa.prototype.size=function(){return this._pts.length};oa.prototype.getCoordinate=function(e){return this._pts[e]};oa.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};oa.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:Tc.octant(this.getCoordinate(e),this.getCoordinate(e+1))};oa.prototype.setData=function(e){this._data=e};oa.prototype.getData=function(){return this._data};oa.prototype.toString=function(){return Es.toLineString(new Er(this._pts))};oa.prototype.interfaces_=function(){return[La]};oa.prototype.getClass=function(){return oa};var ui=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new ce,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null};ui.prototype.getInteriorIntersection=function(){return this._interiorIntersection};ui.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e};ui.prototype.getIntersectionSegments=function(){return this._intSegments};ui.prototype.count=function(){return this._intersectionCount};ui.prototype.getIntersections=function(){return this._intersections};ui.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e};ui.prototype.setKeepIntersections=function(e){this._keepIntersections=e};ui.prototype.processIntersections=function(e,t,n,r){if(!this._findAllIntersections&&this.hasIntersection()||e===n&&t===r)return null;if(this._isCheckEndSegmentsOnly){var o=this.isEndSegment(e,t)||this.isEndSegment(n,r);if(!o)return null}var l=e.getCoordinates()[t],h=e.getCoordinates()[t+1],u=n.getCoordinates()[r],y=n.getCoordinates()[r+1];this._li.computeIntersection(l,h,u,y),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=l,this._intSegments[1]=h,this._intSegments[2]=u,this._intSegments[3]=y,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};ui.prototype.isEndSegment=function(e,t){return t===0||t>=e.size()-2};ui.prototype.hasIntersection=function(){return this._interiorIntersection!==null};ui.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};ui.prototype.interfaces_=function(){return[Ru]};ui.prototype.getClass=function(){return ui};ui.createAllIntersectionsFinder=function(e){var t=new ui(e);return t.setFindAllIntersections(!0),t};ui.createAnyIntersectionFinder=function(e){return new ui(e)};ui.createIntersectionCounter=function(e){var t=new ui(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var Ms=function(){this._li=new qu,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};Ms.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};Ms.prototype.getIntersections=function(){return this._segInt.getIntersections()};Ms.prototype.isValid=function(){return this.execute(),this._isValid};Ms.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e};Ms.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new ui(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new Dv;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};Ms.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new ll(this.getErrorMessage(),this._segInt.getInteriorIntersection())};Ms.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Es.toLineString(e[0],e[1])+" and "+Es.toLineString(e[2],e[3])};Ms.prototype.interfaces_=function(){return[]};Ms.prototype.getClass=function(){return Ms};Ms.computeIntersections=function(e){var t=new Ms(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var zu=function e(){this._nv=null;var t=arguments[0];this._nv=new Ms(e.toSegmentStrings(t))};zu.prototype.checkValid=function(){this._nv.checkValid()};zu.prototype.interfaces_=function(){return[]};zu.prototype.getClass=function(){return zu};zu.toSegmentStrings=function(e){for(var t=new ce,n=e.iterator();n.hasNext();){var r=n.next();t.add(new oa(r.getCoordinates(),r))}return t};zu.checkValid=function(e){var t=new zu(e);t.checkValid()};var Dc=function(e){this._mapOp=e};Dc.prototype.map=function(e){for(var t=this,n=new ce,r=0;r0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)};oo.prototype.interfaces_=function(){return[]};oo.prototype.getClass=function(){return oo};var Aa=function e(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new ke,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof gr&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];e.call(this,t.getCoordinates(),n)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],o=arguments[1];this._srcPts=r,this._isClosed=e.isClosed(r),this._snapTolerance=o}};Aa.prototype.snapVertices=function(e,t){for(var n=this,r=this._isClosed?e.size()-1:e.size(),o=0;o=0&&e.add(h+1,new Tt(l),!1)}};Aa.prototype.findSegmentIndexToSnap=function(e,t){for(var n=this,r=We.MAX_VALUE,o=-1,l=0;lt&&(t=r)}return t}else if(arguments.length===2){var o=arguments[0],l=arguments[1];return Math.min(Ir.computeOverlaySnapTolerance(o),Ir.computeOverlaySnapTolerance(l))}};Ir.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal(),n=Math.min(t.getHeight(),t.getWidth()),r=n*Ir.SNAP_PRECISION_FACTOR;return r};Ir.snapToSelf=function(e,t,n){var r=new Ir(e);return r.snapToSelf(t,n)};iI.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(Ir,iI);var oI=function(e){function t(n,r,o){e.call(this),this._snapTolerance=n||null,this._snapPts=r||null,this._isSelfSnap=o!==void 0?o:!1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,r){var o=new Aa(n,this._snapTolerance);return o.setAllowSnappingToSourceVertices(this._isSelfSnap),o.snapTo(r)},t.prototype.transformCoordinates=function(n,r){var o=n.toCoordinateArray(),l=this.snapLine(o,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(l)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(oo),zi=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};zi.prototype.getCommon=function(){return We.longBitsToDouble(this._commonBits)};zi.prototype.add=function(e){var t=We.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=zi.signExpBits(this._commonBits),this._isFirst=!1,null;var n=zi.signExpBits(t);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=zi.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=zi.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};zi.prototype.toString=function(){if(arguments.length===1){var e=arguments[0],t=We.longBitsToDouble(e),n=We.toBinaryString(e),r="0000000000000000000000000000000000000000000000000000000000000000"+n,o=r.substring(r.length-64),l=o.substring(0,1)+" "+o.substring(1,12)+"(exp) "+o.substring(12)+" [ "+t+" ]";return l}};zi.prototype.interfaces_=function(){return[]};zi.prototype.getClass=function(){return zi};zi.getBit=function(e,t){var n=1<>52};zi.zeroLowerBits=function(e,t){var n=(1<=0;r--){if(zi.getBit(e,r)!==zi.getBit(t,r))return n;n++}return 52};var Yl=function(){this._commonCoord=null,this._ccFilter=new Nc},Fv={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Yl.prototype.addCommonBits=function(e){var t=new Kl(this._commonCoord);e.apply(t),e.geometryChanged()};Yl.prototype.removeCommonBits=function(e){if(this._commonCoord.x===0&&this._commonCoord.y===0)return e;var t=new Tt(this._commonCoord);t.x=-t.x,t.y=-t.y;var n=new Kl(t);return e.apply(n),e.geometryChanged(),e};Yl.prototype.getCommonCoordinate=function(){return this._commonCoord};Yl.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()};Yl.prototype.interfaces_=function(){return[]};Yl.prototype.getClass=function(){return Yl};Fv.CommonCoordinateFilter.get=function(){return Nc};Fv.Translater.get=function(){return Kl};Object.defineProperties(Yl,Fv);var Nc=function(){this._commonBitsX=new zi,this._commonBitsY=new zi};Nc.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)};Nc.prototype.getCommonCoordinate=function(){return new Tt(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};Nc.prototype.interfaces_=function(){return[Ia]};Nc.prototype.getClass=function(){return Nc};var Kl=function(){this.trans=null;var e=arguments[0];this.trans=e};Kl.prototype.filter=function(e,t){var n=e.getOrdinate(t,0)+this.trans.x,r=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,n),e.setOrdinate(t,1,r)};Kl.prototype.isDone=function(){return!1};Kl.prototype.isGeometryChanged=function(){return!0};Kl.prototype.interfaces_=function(){return[Is]};Kl.prototype.getClass=function(){return Kl};var ci=function(e,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=t,this.computeSnapTolerance()};ci.prototype.selfSnap=function(e){var t=new Ir(e),n=t.snapTo(e,this._snapTolerance);return n};ci.prototype.removeCommonBits=function(e){this._cbr=new Yl,this._cbr.add(e[0]),this._cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(e[0].copy()),t[1]=this._cbr.removeCommonBits(e[1].copy()),t};ci.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e};ci.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),n=Ye.overlayOp(t[0],t[1],e);return this.prepareResult(n)};ci.prototype.checkValid=function(e){e.isValid()||gi.out.println("Snapped geometry is invalid")};ci.prototype.computeSnapTolerance=function(){this._snapTolerance=Ir.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};ci.prototype.snap=function(e){var t=this.removeCommonBits(e),n=Ir.snap(t[0],t[1],this._snapTolerance);return n};ci.prototype.interfaces_=function(){return[]};ci.prototype.getClass=function(){return ci};ci.overlayOp=function(e,t,n){var r=new ci(e,t);return r.getResultGeometry(n)};ci.union=function(e,t){return ci.overlayOp(e,t,Ye.UNION)};ci.intersection=function(e,t){return ci.overlayOp(e,t,Ye.INTERSECTION)};ci.symDifference=function(e,t){return ci.overlayOp(e,t,Ye.SYMDIFFERENCE)};ci.difference=function(e,t){return ci.overlayOp(e,t,Ye.DIFFERENCE)};var Zi=function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t};Zi.prototype.getResultGeometry=function(e){var t=null,n=!1,r=null;try{t=Ye.overlayOp(this._geom[0],this._geom[1],e);var o=!0;o&&(n=!0)}catch(l){if(l instanceof sl)r=l;else throw l}finally{}if(!n)try{t=ci.overlayOp(this._geom[0],this._geom[1],e)}catch(l){throw l instanceof sl?r:l}finally{}return t};Zi.prototype.interfaces_=function(){return[]};Zi.prototype.getClass=function(){return Zi};Zi.overlayOp=function(e,t,n){var r=new Zi(e,t);return r.getResultGeometry(n)};Zi.union=function(e,t){return Zi.overlayOp(e,t,Ye.UNION)};Zi.intersection=function(e,t){return Zi.overlayOp(e,t,Ye.INTERSECTION)};Zi.symDifference=function(e,t){return Zi.overlayOp(e,t,Ye.SYMDIFFERENCE)};Zi.difference=function(e,t){return Zi.overlayOp(e,t,Ye.DIFFERENCE)};var Sd=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t};Sd.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)};Sd.prototype.interfaces_=function(){return[]};Sd.prototype.getClass=function(){return Sd};var Io=function e(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],n=arguments[1];this._eventType=e.DELETE,this._xValue=t,this._insertEvent=n}else if(arguments.length===3){var r=arguments[0],o=arguments[1],l=arguments[2];this._eventType=e.INSERT,this._label=r,this._xValue=o,this._obj=l}},Bv={INSERT:{configurable:!0},DELETE:{configurable:!0}};Io.prototype.isDelete=function(){return this._eventType===Io.DELETE};Io.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e};Io.prototype.getObject=function(){return this._obj};Io.prototype.compareTo=function(e){var t=e;return this._xValuet._xValue?1:this._eventTypet._eventType?1:0};Io.prototype.getInsertEvent=function(){return this._insertEvent};Io.prototype.isInsert=function(){return this._eventType===Io.INSERT};Io.prototype.isSameLabel=function(e){return this._label===null?!1:this._label===e._label};Io.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};Io.prototype.interfaces_=function(){return[as]};Io.prototype.getClass=function(){return Io};Bv.INSERT.get=function(){return 1};Bv.DELETE.get=function(){return 2};Object.defineProperties(Io,Bv);var Ug=function(){};Ug.prototype.interfaces_=function(){return[]};Ug.prototype.getClass=function(){return Ug};var vi=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 e=arguments[0],t=arguments[1],n=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=n};vi.prototype.isTrivialIntersection=function(e,t,n,r){if(e===n&&this._li.getIntersectionNum()===1){if(vi.isAdjacentSegments(t,r))return!0;if(e.isClosed()){var o=e.getNumPoints()-1;if(t===0&&r===o||r===0&&t===o)return!0}}return!1};vi.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};vi.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e};vi.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};vi.prototype.isBoundaryPointInternal=function(e,t){for(var n=t.iterator();n.hasNext();){var r=n.next(),o=r.getCoordinate();if(e.isIntersection(o))return!0}return!1};vi.prototype.hasProperIntersection=function(){return this._hasProper};vi.prototype.hasIntersection=function(){return this._hasIntersection};vi.prototype.isDone=function(){return this._isDone};vi.prototype.isBoundaryPoint=function(e,t){return t===null?!1:!!(this.isBoundaryPointInternal(e,t[0])||this.isBoundaryPointInternal(e,t[1]))};vi.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t};vi.prototype.addIntersections=function(e,t,n,r){if(e===n&&t===r)return null;this.numTests++;var o=e.getCoordinates()[t],l=e.getCoordinates()[t+1],h=n.getCoordinates()[r],u=n.getCoordinates()[r+1];this._li.computeIntersection(o,l,h,u),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,n,r)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(e.addIntersections(this._li,t,0),n.addIntersections(this._li,r,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))))};vi.prototype.interfaces_=function(){return[]};vi.prototype.getClass=function(){return vi};vi.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var sR=function(e){function t(){e.call(this),this.events=new ce,this.nOverlaps=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;Ts.sort(this.events);for(var r=0;rt||this._maxl?1:0};Ed.prototype.interfaces_=function(){return[af]};Ed.prototype.getClass=function(){return Ed};var aR=function(e){function t(){e.call(this),this._item=null;var n=arguments[0],r=arguments[1],o=arguments[2];this._min=n,this._max=r,this._item=o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.query=function(n,r,o){if(!this.intersects(n,r))return null;o.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ka),lR=function(e){function t(){e.call(this),this._node1=null,this._node2=null;var n=arguments[0],r=arguments[1];this._node1=n,this._node2=r,this.buildExtent(this._node1,this._node2)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,r){this._min=Math.min(n._min,r._min),this._max=Math.max(n._max,r._max)},t.prototype.query=function(n,r,o){if(!this.intersects(n,r))return null;this._node1!==null&&this._node1.query(n,r,o),this._node2!==null&&this._node2.query(n,r,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ka),Da=function(){this._leaves=new ce,this._root=null,this._level=0};Da.prototype.buildTree=function(){var e=this;Ts.sort(this._leaves,new ka.NodeComparator);for(var t=this._leaves,n=null,r=new ce;;){if(e.buildLevel(t,r),r.size()===1)return r.get(0);n=t,t=r,r=n}};Da.prototype.insert=function(e,t,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new aR(e,t,n))};Da.prototype.query=function(e,t,n){this.init(),this._root.query(e,t,n)};Da.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};Da.prototype.printNode=function(e){gi.out.println(Es.toLineString(new Tt(e._min,this._level),new Tt(e._max,this._level)))};Da.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};Da.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,r[0]),this.insertBoundaryPoint(this._argIndex,r[r.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),r=new Array(n.size()).fill(null),o=0,l=n.iterator();l.hasNext();){var h=l.next();r[o++]=h.getCoordinate().copy()}return r},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,r,o){if(this.isBoundaryNode(n,r))return null;o===At.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,r):this.insertPoint(n,r,o)},t.prototype.addPolygonRing=function(n,r,o){if(n.isEmpty())return null;var l=cn.removeRepeatedPoints(n.getCoordinates());if(l.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=l[0],null;var h=r,u=o;ye.isCCW(l)&&(h=o,u=r);var y=new Vg(l,new Rn(this._argIndex,At.BOUNDARY,h,u));this._lineEdgeMap.put(n,y),this.insertEdge(y),this.insertPoint(this._argIndex,l[0],At.BOUNDARY)},t.prototype.insertPoint=function(n,r,o){var l=this._nodes.addNode(r),h=l.getLabel();h===null?l._label=new Rn(n,o):h.setLocation(n,o)},t.prototype.createEdgeSetIntersector=function(){return new sR},t.prototype.addSelfIntersectionNodes=function(n){for(var r=this,o=this._edges.iterator();o.hasNext();)for(var l=o.next(),h=l.getLabel().getLocation(n),u=l.eiList.iterator();u.hasNext();){var y=u.next();r.addSelfIntersectionNode(n,y.coord,h)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof Sa&&(this._useBoundaryDeterminationRule=!1),n instanceof qr)this.addPolygon(n);else if(n instanceof gr)this.addLineString(n);else if(n instanceof wo)this.addPoint(n);else if(n instanceof df)this.addCollection(n);else if(n instanceof Au)this.addCollection(n);else if(n instanceof Sa)this.addCollection(n);else if(n instanceof qi)this.addCollection(n);else throw new Error(n.getClass().getName())}else return e.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var r=this,o=0;o50?(this._areaPtLocator===null&&(this._areaPtLocator=new xf(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return e.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,r){return n.isInBoundary(r)?At.BOUNDARY:At.INTERIOR},t}(ur),Sf=function(){if(this._li=new qu,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new jp(0,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],r=is.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new jp(0,t,r),this._arg[1]=new jp(1,n,r)}else if(arguments.length===3){var o=arguments[0],l=arguments[1],h=arguments[2];o.getPrecisionModel().compareTo(l.getPrecisionModel())>=0?this.setComputationPrecision(o.getPrecisionModel()):this.setComputationPrecision(l.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new jp(0,o,h),this._arg[1]=new jp(1,l,h)}};Sf.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()};Sf.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)};Sf.prototype.interfaces_=function(){return[]};Sf.prototype.getClass=function(){return Sf};var Tu=function(){};Tu.prototype.interfaces_=function(){return[]};Tu.prototype.getClass=function(){return Tu};Tu.map=function(){if(arguments[0]instanceof Fe&&Be(arguments[1],Tu.MapOp)){for(var e=arguments[0],t=arguments[1],n=new ce,r=0;r=e.size()?null:e.get(t)};Dr.union=function(e){var t=new Dr(e);return t.union()};lI.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(Dr,lI);var Gg=function(){};Gg.prototype.interfaces_=function(){return[]};Gg.prototype.getClass=function(){return Gg};Gg.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return Ye.createEmptyResult(Ye.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),Zi.overlayOp(e,t,Ye.UNION)};function ju(){return new qg}function qg(){this.reset()}qg.prototype={constructor:qg,reset:function(){this.s=this.t=0},add:function(e){Fw($m,e,this.t),Fw(this,$m.s,this.s),this.s?this.t+=$m.t:this.s=$m.t},valueOf:function(){return this.s}};var $m=new qg;function Fw(e,t,n){var r=e.s=t+n,o=r-t,l=r-o;e.t=t-l+(n-o)}var mr=1e-6,Vn=Math.PI,nl=Vn/2,Bw=Vn/4,hl=Vn*2,vu=180/Vn,js=Vn/180,Vi=Math.abs,uR=Math.atan,If=Math.atan2,Vr=Math.cos,Ur=Math.sin,Ff=Math.sqrt;function uI(e){return e>1?0:e<-1?Vn:Math.acos(e)}function Oc(e){return e>1?nl:e<-1?-nl:Math.asin(e)}function Qp(){}function jg(e,t){e&&Uw.hasOwnProperty(e.type)&&Uw[e.type](e,t)}var Vw={Feature:function(e,t){jg(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++rVn?e-hl:e<-Vn?e+hl:e,t]}q0.invert=q0;function hR(e,t,n){return(e%=hl)?t||n?cI(jw(e),Ww(t,n)):jw(e):t||n?Ww(t,n):q0}function qw(e){return function(t,n){return t+=e,[t>Vn?t-hl:t<-Vn?t+hl:t,n]}}function jw(e){var t=qw(e);return t.invert=qw(-e),t}function Ww(e,t){var n=Vr(e),r=Ur(e),o=Vr(t),l=Ur(t);function h(u,y){var w=Vr(y),S=Vr(u)*w,C=Ur(u)*w,P=Ur(y),F=P*n+S*r;return[If(C*o-F*l,S*n-P*r),Oc(F*o+C*l)]}return h.invert=function(u,y){var w=Vr(y),S=Vr(u)*w,C=Ur(u)*w,P=Ur(y),F=P*o-C*l;return[If(C*o+P*l,S*n+F*r),Oc(F*n-S*r)]},h}function fR(e,t,n,r,o,l){if(n){var h=Vr(t),u=Ur(t),y=r*n;o==null?(o=t+r*hl,l=t-y/2):(o=Zw(h,o),l=Zw(h,l),(r>0?ol)&&(o+=r*hl));for(var w,S=o;r>0?S>l:S1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function pR(e,t,n,r,o,l){var h=e[0],u=e[1],y=t[0],w=t[1],S=0,C=1,P=y-h,F=w-u,R;if(R=n-h,!(!P&&R>0)){if(R/=P,P<0){if(R0){if(R>C)return;R>S&&(S=R)}if(R=o-h,!(!P&&R<0)){if(R/=P,P<0){if(R>C)return;R>S&&(S=R)}else if(P>0){if(R0)){if(R/=F,F<0){if(R0){if(R>C)return;R>S&&(S=R)}if(R=l-u,!(!F&&R<0)){if(R/=F,F<0){if(R>C)return;R>S&&(S=R)}else if(F>0){if(R0&&(e[0]=h+S*P,e[1]=u+S*F),C<1&&(t[0]=h+C*P,t[1]=u+C*F),!0}}}}}function gg(e,t){return Vi(e[0]-t[0])=0;--u)o.point((C=S[u])[0],C[1]);else r(P.x,P.p.x,-1,o);P=P.p}P=P.o,S=P.z,F=!F}while(!P.v);o.lineEnd()}}}function Hw(e){if(t=e.length){for(var t,n=0,r=e[0],o;++nt?1:e>=t?0:NaN}function dR(e){return e.length===1&&(e=mR(e)),{left:function(t,n,r,o){for(r==null&&(r=0),o==null&&(o=t.length);r>>1;e(t[l],n)<0?r=l+1:o=l}return r},right:function(t,n,r,o){for(r==null&&(r=0),o==null&&(o=t.length);r>>1;e(t[l],n)>0?o=l:r=l+1}return r}}}function mR(e){return function(t,n){return pI(e(t),n)}}dR(pI);function dI(e){for(var t=e.length,n,r=-1,o=0,l,h;++r=0;)for(h=e[t],n=h.length;--n>=0;)l[--o]=h[n];return l}var $p=1e9,rg=-$p;function gR(e,t,n,r){function o(w,S){return e<=w&&w<=n&&t<=S&&S<=r}function l(w,S,C,P){var F=0,R=0;if(w==null||(F=h(w,C))!==(R=h(S,C))||y(w,S)<0^C>0)do P.point(F===0||F===3?e:n,F>1?r:t);while((F=(F+C+4)%4)!==R);else P.point(S[0],S[1])}function h(w,S){return Vi(w[0]-e)0?0:3:Vi(w[0]-n)0?2:1:Vi(w[1]-t)0?1:0:S>0?3:2}function u(w,S){return y(w.x,S.x)}function y(w,S){var C=h(w,1),P=h(S,1);return C!==P?C-P:C===0?S[1]-w[1]:C===1?w[0]-S[0]:C===2?w[1]-S[1]:S[0]-w[0]}return function(w){var S=w,C=hI(),P,F,R,Y,J,K,O,G,q,ot,_t,ft={point:ct,lineStart:Lt,lineEnd:$t,polygonStart:Pt,polygonEnd:$};function ct(re,pe){o(re,pe)&&S.point(re,pe)}function ht(){for(var re=0,pe=0,qt=F.length;per&&(En-Ee)*(r-sn)>(dn-sn)*(e-Ee)&&++re:dn<=r&&(En-Ee)*(r-sn)<(dn-sn)*(e-Ee)&&--re;return re}function Pt(){S=C,P=[],F=[],_t=!0}function $(){var re=ht(),pe=_t&&re,qt=(P=dI(P)).length;(pe||qt)&&(w.polygonStart(),pe&&(w.lineStart(),l(null,null,1,w),w.lineEnd()),qt&&fI(P,u,re,l,w),w.polygonEnd()),S=w,P=F=R=null}function Lt(){ft.point=Ct,F&&F.push(R=[]),ot=!0,q=!1,O=G=NaN}function $t(){P&&(Ct(Y,J),K&&q&&C.rejoin(),P.push(C.result())),ft.point=ct,q&&S.lineEnd()}function Ct(re,pe){var qt=o(re,pe);if(F&&R.push([re,pe]),ot)Y=re,J=pe,K=qt,ot=!1,qt&&(S.lineStart(),S.point(re,pe));else if(qt&&q)S.point(re,pe);else{var Ne=[O=Math.max(rg,Math.min($p,O)),G=Math.max(rg,Math.min($p,G))],Ce=[re=Math.max(rg,Math.min($p,re)),pe=Math.max(rg,Math.min($p,pe))];pR(Ne,Ce,e,t,n,r)?(q||(S.lineStart(),S.point(Ne[0],Ne[1])),S.point(Ce[0],Ce[1]),qt||S.lineEnd(),_t=!1):qt&&(S.lineStart(),S.point(re,pe),_t=!1)}O=re,G=pe,q=qt}return ft}}var e0=ju();function yR(e,t){var n=t[0],r=t[1],o=[Ur(n),-Vr(n),0],l=0,h=0;e0.reset();for(var u=0,y=e.length;u=0?1:-1,ct=ft*_t,ht=ct>Vn,Pt=R*q;if(e0.add(If(Pt*ft*Ur(ct),Y*ot+Pt*Vr(ct))),l+=ht?_t+ft*hl:_t,ht^P>=n^O>=n){var $=Wg(Cf(C),Cf(K));G0($);var Lt=Wg(o,$);G0(Lt);var $t=(ht^_t>=0?-1:1)*Oc(Lt[2]);(r>$t||r===$t&&($[0]||$[1]))&&(h+=ht^_t>=0?1:-1)}}return(l<-mr||lId&&(Id=e),tHg&&(Hg=t)}ju();function mI(e,t,n,r){return function(o,l){var h=t(l),u=o.invert(r[0],r[1]),y=hI(),w=t(y),S=!1,C,P,F,R={point:Y,lineStart:K,lineEnd:O,polygonStart:function(){R.point=G,R.lineStart=q,R.lineEnd=ot,P=[],C=[]},polygonEnd:function(){R.point=Y,R.lineStart=K,R.lineEnd=O,P=dI(P);var _t=yR(C,u);P.length?(S||(l.polygonStart(),S=!0),fI(P,bR,_t,n,l)):_t&&(S||(l.polygonStart(),S=!0),l.lineStart(),n(null,null,1,l),l.lineEnd()),S&&(l.polygonEnd(),S=!1),P=C=null},sphere:function(){l.polygonStart(),l.lineStart(),n(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function Y(_t,ft){var ct=o(_t,ft);e(_t=ct[0],ft=ct[1])&&l.point(_t,ft)}function J(_t,ft){var ct=o(_t,ft);h.point(ct[0],ct[1])}function K(){R.point=J,h.lineStart()}function O(){R.point=Y,h.lineEnd()}function G(_t,ft){F.push([_t,ft]);var ct=o(_t,ft);w.point(ct[0],ct[1])}function q(){w.lineStart(),F=[]}function ot(){G(F[0][0],F[0][1]),w.lineEnd();var _t=w.clean(),ft=y.result(),ct,ht=ft.length,Pt,$,Lt;if(F.pop(),C.push(F),F=null,!!ht){if(_t&1){if($=ft[0],(Pt=$.length-1)>0){for(S||(l.polygonStart(),S=!0),l.lineStart(),ct=0;ct1&&_t&2&&ft.push(ft.pop().concat(ft.shift())),P.push(ft.filter(vR))}}return R}}function vR(e){return e.length>1}function bR(e,t){return((e=e.x)[0]<0?e[1]-nl-mr:nl-e[1])-((t=t.x)[0]<0?t[1]-nl-mr:nl-t[1])}const Kw=mI(function(){return!0},xR,SR,[-Vn,-nl]);function xR(e){var t=NaN,n=NaN,r=NaN,o;return{lineStart:function(){e.lineStart(),o=1},point:function(l,h){var u=l>0?Vn:-Vn,y=Vi(l-t);Vi(y-Vn)0?nl:-nl),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(u,n),e.point(l,n),o=0):r!==u&&y>=Vn&&(Vi(t-r)mr?uR((Ur(t)*(l=Vr(r))*Ur(n)-Ur(r)*(o=Vr(t))*Ur(e))/(o*l*h)):(t+r)/2}function SR(e,t,n,r){var o;if(e==null)o=n*nl,r.point(-Vn,o),r.point(0,o),r.point(Vn,o),r.point(Vn,0),r.point(Vn,-o),r.point(0,-o),r.point(-Vn,-o),r.point(-Vn,0),r.point(-Vn,o);else if(Vi(e[0]-t[0])>mr){var l=e[0]0,o=Vi(n)>mr;function l(S,C,P,F){fR(F,e,t,P,S,C)}function h(S,C){return Vr(S)*Vr(C)>n}function u(S){var C,P,F,R,Y;return{lineStart:function(){R=F=!1,Y=1},point:function(J,K){var O=[J,K],G,q=h(J,K),ot=r?q?0:w(J,K):q?w(J+(J<0?Vn:-Vn),K):0;if(!C&&(R=F=q)&&S.lineStart(),q!==F&&(G=y(C,O),(!G||gg(C,G)||gg(O,G))&&(O[0]+=mr,O[1]+=mr,q=h(O[0],O[1]))),q!==F)Y=0,q?(S.lineStart(),G=y(O,C),S.point(G[0],G[1])):(G=y(C,O),S.point(G[0],G[1]),S.lineEnd()),C=G;else if(o&&C&&r^q){var _t;!(ot&P)&&(_t=y(O,C,!0))&&(Y=0,r?(S.lineStart(),S.point(_t[0][0],_t[0][1]),S.point(_t[1][0],_t[1][1]),S.lineEnd()):(S.point(_t[1][0],_t[1][1]),S.lineEnd(),S.lineStart(),S.point(_t[0][0],_t[0][1])))}q&&(!C||!gg(C,O))&&S.point(O[0],O[1]),C=O,F=q,P=ot},lineEnd:function(){F&&S.lineEnd(),C=null},clean:function(){return Y|(R&&F)<<1}}}function y(S,C,P){var F=Cf(S),R=Cf(C),Y=[1,0,0],J=Wg(F,R),K=tg(J,J),O=J[0],G=K-O*O;if(!G)return!P&&S;var q=n*K/G,ot=-n*O/G,_t=Wg(Y,J),ft=eg(Y,q),ct=eg(J,ot);t0(ft,ct);var ht=_t,Pt=tg(ft,ht),$=tg(ht,ht),Lt=Pt*Pt-$*(tg(ft,ft)-1);if(!(Lt<0)){var $t=Ff(Lt),Ct=eg(ht,(-Pt-$t)/$);if(t0(Ct,ft),Ct=U0(Ct),!P)return Ct;var re=S[0],pe=C[0],qt=S[1],Ne=C[1],Ce;pe0^Ct[1]<(Vi(Ct[0]-re)Vn^(re<=Ct[0]&&Ct[0]<=pe)){var sn=eg(ht,(-Pt+$t)/$);return t0(sn,ft),[Ct,U0(sn)]}}}function w(S,C){var P=r?e:Vn-e,F=0;return S<-P?F|=1:S>P&&(F|=2),C<-P?F|=4:C>P&&(F|=8),F}return mI(h,u,l,r?[0,-e]:[-Vn,e-Vn])}function gI(e){return function(t){var n=new j0;for(var r in e)n[r]=e[r];return n.stream=t,n}}function j0(){}j0.prototype={constructor:j0,point:function(e,t){this.stream.point(e,t)},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 yI(e,t,n){var r=t[1][0]-t[0][0],o=t[1][1]-t[0][1],l=e.clipExtent&&e.clipExtent();e.scale(150).translate([0,0]),l!=null&&e.clipExtent(null),cR(n,e.stream(Yw));var h=Yw.result(),u=Math.min(r/(h[1][0]-h[0][0]),o/(h[1][1]-h[0][1])),y=+t[0][0]+(r-u*(h[1][0]+h[0][0]))/2,w=+t[0][1]+(o-u*(h[1][1]+h[0][1]))/2;return l!=null&&e.clipExtent(l),e.scale(u*150).translate([y,w])}function IR(e,t,n){return yI(e,[[0,0],t],n)}var Jw=16,CR=Vr(30*js);function Qw(e,t){return+t?LR(e,t):TR(e)}function TR(e){return gI({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function LR(e,t){function n(r,o,l,h,u,y,w,S,C,P,F,R,Y,J){var K=w-r,O=S-o,G=K*K+O*O;if(G>4*t&&Y--){var q=h+P,ot=u+F,_t=y+R,ft=Ff(q*q+ot*ot+_t*_t),ct=Oc(_t/=ft),ht=Vi(Vi(_t)-1)t||Vi((K*$t+O*Ct)/G-.5)>.3||h*P+u*F+y*R2?Ct[2]%360*js:0,Lt()):[w*vu,S*vu,C*vu]},ht.precision=function(Ct){return arguments.length?(_t=Qw($,ot=Ct*Ct),$t()):Ff(ot)},ht.fitExtent=function(Ct,re){return yI(ht,Ct,re)},ht.fitSize=function(Ct,re){return IR(ht,Ct,re)};function Lt(){F=cI(P=hR(w,S,C),t);var Ct=t(u,y);return l=r-Ct[0]*n,h=o+Ct[1]*n,$t()}function $t(){return ft=ct=null,ht}return function(){return t=e.apply(this,arguments),ht.invert=t.invert&&Pt,Lt()}}function _I(e){return function(t,n){var r=Vr(t),o=Vr(n),l=e(r*o);return[l*o*Ur(t),l*Ur(n)]}}function vI(e){return function(t,n){var r=Ff(t*t+n*n),o=e(r),l=Ur(o),h=Vr(o);return[If(t*l,r*h),Oc(r&&n*l/r)]}}var kR=_I(function(e){return Ff(2/(1+e))});kR.invert=vI(function(e){return 2*Oc(e/2)});var bI=_I(function(e){return(e=uI(e))&&e/Ur(e)});bI.invert=vI(function(e){return e});function DR(){return MR(bI).scale(79.4188).clipAngle(180-.001)}function $w(e,t){return[e,t]}$w.invert=$w;function RR(e,t,n){n=n||{};var r=n.units||"kilometers",o=n.steps||8;if(!e)throw new Error("geojson is required");if(typeof n!="object")throw new Error("options must be an object");if(typeof o!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(o<=0)throw new Error("steps must be greater than 0");var l=[];switch(e.type){case"GeometryCollection":return NE(e,function(h){var u=yg(h,t,r,o);u&&l.push(u)}),z0(l);case"FeatureCollection":return Dw(e,function(h){var u=yg(h,t,r,o);u&&Dw(u,function(y){y&&l.push(y)})}),z0(l)}return yg(e,t,r,o)}function yg(e,t,n,r){var o=e.properties||{},l=e.type==="Feature"?e.geometry:e;if(l.type==="GeometryCollection"){var h=[];return NE(e,function(Y){var J=yg(Y,t,n,r);J&&h.push(J)}),z0(h)}var u=NR(l),y={type:l.type,coordinates:wI(l.coordinates,u)},w=new kv,S=w.read(y),C=G4(q4(t,n),"meters"),P=di.bufferOp(S,C,r),F=new WE;if(P=F.write(P),!xI(P.coordinates)){var R={type:P.type,coordinates:SI(P.coordinates,u)};return oy(R,o)}}function xI(e){return Array.isArray(e[0])?xI(e[0]):isNaN(e[0])}function wI(e,t){return typeof e[0]!="object"?t(e):e.map(function(n){return wI(n,t)})}function SI(e,t){return typeof e[0]!="object"?t.invert(e):e.map(function(n){return SI(n,t)})}function NR(e){var t=W4(e).geometry.coordinates,n=[-t[0],-t[1]];return DR().rotate(n).scale(zo)}function OR(e,t){var n=zg(e),r=zg(t),o=e.properties||{},l=ME.difference(n.coordinates,r.coordinates);return l.length===0?null:l.length===1?kE(l[0],o):DE(l,o)}function t2(e){let t;for(const n of e)t&&n[0]-t[0]>=180?n[0]-=360:t&&n[0]-t[0]<-180&&(n[0]+=360),t=n}function e2(e,t){const n=OR({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},e);if(!n)return;n.properties={isMask:"y"};const r=RR(e,0);if(r.geometry.type==="Polygon")for(const o of r.geometry.coordinates)t2(o);else for(const o of r.geometry.coordinates)for(const l of o)t2(l);t({type:"FeatureCollection",features:[r,n]})}let n2={type:"FeatureCollection",features:[]};function zR(e,t,n=!0,r=!0,o={},l={},h={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,y=[],w,S;function C(){(h!=null&&h.fill||h!=null&&h.line)&&e.addSource("full-geom",{type:"geojson",data:n2}),h!=null&&h.fill&&e.addLayer({...h==null?void 0:h.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),h!=null&&h.line&&e.addLayer({...h==null?void 0:h.line,id:"full-geom-line",type:"line",source:"full-geom"})}e.loaded()?C():e.once("load",()=>{C()});const P=R=>{u==null||u({type:"mapClick",coordinates:[R.lngLat.lng,R.lngLat.lat]})};function F(R=!1){if(!t)throw new Error;const Y=document.createElement("div");return R&&Y.classList.add("marker-interactive"),new f4({props:{displayIn:"maplibre"},target:Y}),new t.Marker({element:Y,offset:[1,-13]})}return{setEventHandler(R){R?(u=R,e.on("click",P)):(u=void 0,e.off("click",P))},flyTo(R,Y){e.flyTo({center:R,zoom:Y,...o})},fitBounds(R,Y,J){e.fitBounds([[R[0],R[1]],[R[2],R[3]]],{padding:Y,maxZoom:J,...l})},indicateReverse(R){e.getCanvasContainer().style.cursor=R?"crosshair":""},setReverseMarker(R){!t||!n||(S?R?S.setLngLat(R):(S.remove(),S=void 0):R&&(S=(typeof n=="object"?new t.Marker(n):F()).setLngLat(R).addTo(e),S.getElement().classList.add("marker-reverse")))},setMarkers(R,Y){if(!n)return;function J(K){var O;(O=e.getSource("full-geom"))==null||O.setData(K)}for(const K of y)K.remove();if(y.length=0,J(n2),!!t){if(Y){let K=!1;if(Y.geometry.type==="GeometryCollection"){const O=Y.geometry.geometries.filter(G=>G.type==="Polygon"||G.type==="MultiPolygon");if(O.length>0){let G=O.pop();for(const q of O)G=j4(G,q);e2({...Y,geometry:G},J),K=!0}else{const G=Y.geometry.geometries.filter(q=>q.type==="LineString"||q.type==="MultiLineString");G.length>0&&(J({...Y,geometry:{type:"GeometryCollection",geometries:G}}),K=!0)}}if(!K){if(Y.geometry.type==="Polygon"||Y.geometry.type==="MultiPolygon")e2(Y,J);else if(Y.geometry.type==="LineString"||Y.geometry.type==="MultiLineString"){J(Y);return}}n&&y.push((typeof n=="object"?new t.Marker(n):F()).setLngLat(Y.center).addTo(e))}if(r)for(const K of R??[]){if(K===Y)continue;const O=(typeof r=="object"?new t.Marker(r):F(!0)).setLngLat(K.center).setPopup(new t.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(K.place_type[0]==="reverse"?K.place_name:K.place_name.replace(/,.*/,""))).addTo(e),G=O.getElement();G.addEventListener("click",q=>{q.stopPropagation(),u==null||u({type:"markerClick",id:K.id})}),G.addEventListener("mouseenter",()=>{u==null||u({type:"markerMouseEnter",id:K.id}),O.togglePopup()}),G.addEventListener("mouseleave",()=>{u==null||u({type:"markerMouseLeave",id:K.id}),O.togglePopup()}),y.push(O)}}},setSelectedMarker(R){w&&w.getElement().classList.toggle("marker-selected",!1),w=R>-1?y[R]:void 0,w==null||w.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const R=e.getCenter();return[e.getZoom(),R.lng,R.lat]}}}function FR(e){let t,n;return{c(){t=Bl("svg"),n=Bl("path"),Wt(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"),Wt(t,"viewBox","0 0 14 14"),Wt(t,"width","13"),Wt(t,"height","13"),Wt(t,"class","svelte-en2qvf")},m(r,o){Ut(r,t,o),Gt(t,n)},p:ze,i:ze,o:ze,d(r){r&&Vt(t)}}}class EI extends fn{constructor(t){super(),hn(this,t,null,FR,en,{})}}function BR(e){let t,n;return{c(){t=Bl("svg"),n=Bl("path"),Wt(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"),Wt(t,"viewBox","0 0 30 30"),Wt(t,"fill","none"),Wt(t,"xmlns","http://www.w3.org/2000/svg"),Wt(t,"class","svelte-d2loi5")},m(r,o){Ut(r,t,o),Gt(t,n)},p:ze,i:ze,o:ze,d(r){r&&Vt(t)}}}class II extends fn{constructor(t){super(),hn(this,t,null,BR,en,{})}}function VR(e){let t,n;return{c(){t=jt("img"),bo(t.src,n=e[3]+"area.svg")||Wt(t,"src",n),Wt(t,"alt",e[6]),Wt(t,"class","svelte-ltkwvy")},m(r,o){Ut(r,t,o)},p(r,o){o&8&&!bo(t.src,n=r[3]+"area.svg")&&Wt(t,"src",n),o&64&&Wt(t,"alt",r[6])},d(r){r&&Vt(t)}}}function UR(e){let t,n;return{c(){t=jt("img"),bo(t.src,n=e[3]+"reverse.svg")||Wt(t,"src",n),Wt(t,"alt",e[6]),Wt(t,"class","svelte-ltkwvy")},m(r,o){Ut(r,t,o)},p(r,o){o&8&&!bo(t.src,n=r[3]+"reverse.svg")&&Wt(t,"src",n),o&64&&Wt(t,"alt",r[6])},d(r){r&&Vt(t)}}}function GR(e){let t,n;return{c(){t=jt("img"),bo(t.src,n=e[3]+"poi.svg")||Wt(t,"src",n),Wt(t,"alt",e[6]),Wt(t,"class","svelte-ltkwvy")},m(r,o){Ut(r,t,o)},p(r,o){o&8&&!bo(t.src,n=r[3]+"poi.svg")&&Wt(t,"src",n),o&64&&Wt(t,"alt",r[6])},d(r){r&&Vt(t)}}}function qR(e){let t,n;return{c(){t=jt("img"),bo(t.src,n=e[3]+"postal_code.svg")||Wt(t,"src",n),Wt(t,"alt",e[6]),Wt(t,"class","svelte-ltkwvy")},m(r,o){Ut(r,t,o)},p(r,o){o&8&&!bo(t.src,n=r[3]+"postal_code.svg")&&Wt(t,"src",n),o&64&&Wt(t,"alt",r[6])},d(r){r&&Vt(t)}}}function jR(e){let t,n;return{c(){t=jt("img"),bo(t.src,n=e[3]+"street.svg")||Wt(t,"src",n),Wt(t,"alt",e[6]),Wt(t,"class","svelte-ltkwvy")},m(r,o){Ut(r,t,o)},p(r,o){o&8&&!bo(t.src,n=r[3]+"street.svg")&&Wt(t,"src",n),o&64&&Wt(t,"alt",r[6])},d(r){r&&Vt(t)}}}function WR(e){let t,n;return{c(){t=jt("img"),bo(t.src,n=e[3]+"road.svg")||Wt(t,"src",n),Wt(t,"alt",e[6]),Wt(t,"class","svelte-ltkwvy")},m(r,o){Ut(r,t,o)},p(r,o){o&8&&!bo(t.src,n=r[3]+"road.svg")&&Wt(t,"src",n),o&64&&Wt(t,"alt",r[6])},d(r){r&&Vt(t)}}}function ZR(e){let t,n;return{c(){t=jt("img"),bo(t.src,n=e[3]+"housenumber.svg")||Wt(t,"src",n),Wt(t,"alt",e[6]),Wt(t,"class","svelte-ltkwvy")},m(r,o){Ut(r,t,o)},p(r,o){o&8&&!bo(t.src,n=r[3]+"housenumber.svg")&&Wt(t,"src",n),o&64&&Wt(t,"alt",r[6])},d(r){r&&Vt(t)}}}function HR(e){let t,n,r,o;return{c(){t=jt("img"),bo(t.src,n=e[5])||Wt(t,"src",n),Wt(t,"alt",e[4]),Wt(t,"class","svelte-ltkwvy")},m(l,h){Ut(l,t,h),r||(o=$e(t,"error",e[14]),r=!0)},p(l,h){h&32&&!bo(t.src,n=l[5])&&Wt(t,"src",n),h&16&&Wt(t,"alt",l[4])},d(l){l&&Vt(t),r=!1,o()}}}function r2(e){let t,n;return{c(){t=jt("span"),n=Cn(e[6]),Wt(t,"class","secondary svelte-ltkwvy")},m(r,o){Ut(r,t,o),Gt(t,n)},p(r,o){o&64&&Gi(n,r[6])},d(r){r&&Vt(t)}}}function XR(e){var ft,ct;let t,n,r,o,l,h,u,y,w=(e[7]?e[0].place_name:e[0].place_name.replace(/,.*/,""))+"",S,C,P=e[2]==="always"||e[2]&&!e[0].address&&((ft=e[0].properties)==null?void 0:ft.kind)!=="road"&&((ct=e[0].properties)==null?void 0:ct.kind)!=="road_relation"&&!e[0].id.startsWith("address.")&&!e[0].id.startsWith("postal_code.")&&(!e[0].id.startsWith("poi.")||!e[5])&&!e[7],F,R,Y=(e[7]?"":e[0].place_name.replace(/[^,]*,?\s*/,""))+"",J,K,O;function G(ht,Pt){var $,Lt;return Pt&1&&(n=null),Pt&1&&(r=null),Pt&1&&(o=null),ht[5]?HR:ht[0].address?ZR:(($=ht[0].properties)==null?void 0:$.kind)==="road"||((Lt=ht[0].properties)==null?void 0:Lt.kind)==="road_relation"?WR:(n==null&&(n=!!ht[0].id.startsWith("address.")),n?jR:(r==null&&(r=!!ht[0].id.startsWith("postal_code.")),r?qR:(o==null&&(o=!!ht[0].id.startsWith("poi.")),o?GR:ht[7]?UR:VR)))}let q=G(e,-1),ot=q(e),_t=P&&r2(e);return{c(){t=jt("li"),ot.c(),l=fe(),h=jt("span"),u=jt("span"),y=jt("span"),S=Cn(w),C=fe(),_t&&_t.c(),F=fe(),R=jt("span"),J=Cn(Y),Wt(y,"class","primary svelte-ltkwvy"),Wt(u,"class","svelte-ltkwvy"),Wt(R,"class","line2 svelte-ltkwvy"),Wt(h,"class","texts svelte-ltkwvy"),Wt(t,"tabindex","0"),Wt(t,"data-selected",e[1]),Wt(t,"class","svelte-ltkwvy"),el(t,"selected",e[1])},m(ht,Pt){Ut(ht,t,Pt),ot.m(t,null),Gt(t,l),Gt(t,h),Gt(h,u),Gt(u,y),Gt(y,S),Gt(u,C),_t&&_t.m(u,null),Gt(h,F),Gt(h,R),Gt(R,J),K||(O=[$e(t,"mouseenter",e[12]),$e(t,"focus",e[13])],K=!0)},p(ht,[Pt]){var $,Lt;q===(q=G(ht,Pt))&&ot?ot.p(ht,Pt):(ot.d(1),ot=q(ht),ot&&(ot.c(),ot.m(t,l))),Pt&1&&w!==(w=(ht[7]?ht[0].place_name:ht[0].place_name.replace(/,.*/,""))+"")&&Gi(S,w),Pt&37&&(P=ht[2]==="always"||ht[2]&&!ht[0].address&&(($=ht[0].properties)==null?void 0:$.kind)!=="road"&&((Lt=ht[0].properties)==null?void 0:Lt.kind)!=="road_relation"&&!ht[0].id.startsWith("address.")&&!ht[0].id.startsWith("postal_code.")&&(!ht[0].id.startsWith("poi.")||!ht[5])&&!ht[7]),P?_t?_t.p(ht,Pt):(_t=r2(ht),_t.c(),_t.m(u,null)):_t&&(_t.d(1),_t=null),Pt&1&&Y!==(Y=(ht[7]?"":ht[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Gi(J,Y),Pt&2&&Wt(t,"data-selected",ht[1]),Pt&2&&el(t,"selected",ht[1])},i:ze,o:ze,d(ht){ht&&Vt(t),ot.d(),_t&&_t.d(),K=!1,bi(O)}}}function YR(e,t,n){var G;let r,o,{feature:l}=t,{selected:h=!1}=t,{showPlaceType:u}=t,{missingIconsCache:y}=t,{iconsBaseUrl:w}=t;const S=(G=l.properties)==null?void 0:G.categories;let C,P,F=0,R=l.place_type[0]==="reverse";function Y(q){P&&y.add(P),n(10,F++,F)}function J(q){On.call(this,e,q)}function K(q){On.call(this,e,q)}const O=q=>Y(q.currentTarget);return e.$$set=q=>{"feature"in q&&n(0,l=q.feature),"selected"in q&&n(1,h=q.selected),"showPlaceType"in q&&n(2,u=q.showPlaceType),"missingIconsCache"in q&&n(9,y=q.missingIconsCache),"iconsBaseUrl"in q&&n(3,w=q.iconsBaseUrl)},e.$$.update=()=>{var q,ot,_t,ft;if(e.$$.dirty&3640)do n(11,r--,r),n(4,C=S==null?void 0:S[r]),n(5,P=C?w+C.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!P||y.has(P)));e.$$.dirty&1&&n(6,o=l.id.startsWith("poi.")?(ot=(q=l.properties)==null?void 0:q.categories)==null?void 0:ot.join(", "):((ft=(_t=l.properties)==null?void 0:_t.place_type_name)==null?void 0:ft[0])??l.place_type[0])},n(11,r=(S==null?void 0:S.length)??0),[l,h,u,w,C,P,o,R,Y,y,F,r,J,K,O]}class KR extends fn{constructor(t){super(),hn(this,t,YR,XR,en,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function JR(e){let t;return{c(){t=jt("div"),t.innerHTML='',Wt(t,"class","svelte-7cmwmc")},m(n,r){Ut(n,t,r)},p:ze,i:ze,o:ze,d(n){n&&Vt(t)}}}class QR extends fn{constructor(t){super(),hn(this,t,null,JR,en,{})}}function $R(e){let t,n;return{c(){t=Bl("svg"),n=Bl("path"),Wt(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"),Wt(t,"viewBox","0 0 60.006 21.412"),Wt(t,"width","14"),Wt(t,"height","20"),Wt(t,"class","svelte-en2qvf")},m(r,o){Ut(r,t,o),Gt(t,n)},p:ze,i:ze,o:ze,d(r){r&&Vt(t)}}}class tN extends fn{constructor(t){super(),hn(this,t,null,$R,en,{})}}function eN(e){let t,n,r;return{c(){t=Bl("svg"),n=Bl("circle"),r=Bl("path"),Wt(n,"cx","4.789"),Wt(n,"cy","4.787"),Wt(n,"r","3.85"),ai(n,"stroke-width","1.875"),ai(n,"fill","none"),Wt(r,"d","M12.063 12.063 7.635 7.635"),ai(r,"stroke-width","1.875"),ai(r,"stroke-linecap","round"),Wt(t,"xmlns","http://www.w3.org/2000/svg"),Wt(t,"width","13"),Wt(t,"height","13"),Wt(t,"viewBox","0 0 13 13"),Wt(t,"class","svelte-1bpbt60")},m(o,l){Ut(o,t,l),Gt(t,n),Gt(t,r)},p:ze,i:ze,o:ze,d(o){o&&Vt(t)}}}class nN extends fn{constructor(t){super(),hn(this,t,null,eN,en,{})}}function rN(e,t,n){const r=t[1],o=t[0],l=r-o;return e===r&&n?e:((e-o)%l+l)%l+o}function i2(e){const t=[...e];return t[2]r[0]||o.maxZoom!=null&&o.maxZoomDate.now()){if(!Wp.coords)break t;return Wp.coords}let l;try{return l=await new Promise((h,u)=>{n.signal.addEventListener("abort",()=>{u(Error("aborted"))}),navigator.geolocation.getCurrentPosition(y=>{h([y.coords.longitude,y.coords.latitude].map(w=>w.toFixed(6)).join(","))},y=>{u(y)},o)}),l}catch{}finally{o.cachedLocationExpiry&&(Wp={time:Date.now(),coords:l})}if(n.signal.aborted)return}if(o.type==="server-geolocation")return"ip";if(r&&o.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}const o2=/(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,s2=/(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,a2=/(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,l2=/(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 oN(e){if(!["DMS","DM","DD"].includes(e))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){if(e=="DD")return this.decimalCoordinates;const t=this.decimalCoordinates.split(",").map(h=>Number(h.trim()));let n=u2(t[0],e),r=u2(t[1],e);n.endsWith('.0"')&&r.endsWith('.0"')&&(n=n.replace(/\.0"$/,'"'),r=r.replace(/\.0"$/,'"'));const o=t[0]>=0?" N":" S",l=t[1]>=0?" E":" W";return`${n+o}, ${r+l}`}else throw new Error("no decimal coordinates to convert")}function u2(e,t){const n=Math.abs(e),r=Math.floor(n),o=(n-r)*60;if(t=="DM"){let u=sN(o,3).toFixed(3).padStart(6,"0");return`${r}° ${u}'`}let l=Math.floor(o),h=((o-l)*60).toFixed(1).padStart(4,"0");return l=l.toString().padStart(2,"0"),`${r}° ${l}' ${h}"`}function sN(e,t){const n=Math.pow(10,t);return Math.round((e+Number.EPSILON)*n)/n}function Uv(e,t){t||(t=5),e=e.replace(/\s+/g," ").trim();let n=null,r=null,o="",l="",h=[],u=!1;if(o2.test(e))if(h=o2.exec(e),u=ig(h),u){if(n=h[2],r=h[6],n.includes(",")&&(n=n.replace(",",".")),r.includes(",")&&(r=r.replace(",",".")),Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");if(Number(Math.round(r))==Number(r))throw new Error("integer only coordinate provided");h[1]?(o=h[1],l=h[5]):h[4]&&(o=h[4],l=h[8])}else throw new Error("invalid decimal coordinate format");else if(s2.test(e))if(h=s2.exec(e),u=ig(h),u)n=Math.abs(parseInt(h[2])),h[4]&&(n+=h[4]/60),h[6]&&(n+=h[6].replace(",",".")/3600),parseInt(h[2])<0&&(n=-1*n),r=Math.abs(parseInt(h[9])),h[11]&&(r+=h[11]/60),h[13]&&(r+=h[13].replace(",",".")/3600),parseInt(h[9])<0&&(r=-1*r),h[1]?(o=h[1],l=h[8]):h[7]&&(o=h[7],l=h[14]);else throw new Error("invalid DMS coordinates format");else if(a2.test(e))if(h=a2.exec(e),u=ig(h),u)n=Math.abs(parseInt(h[2])),h[4]&&(n+=h[4]/60),h[6]&&(n+=h[6]/3600),parseInt(h[2])<0&&(n=-1*n),r=Math.abs(parseInt(h[10])),h[12]&&(r+=h[12]/60),h[14]&&(r+=h[14]/3600),parseInt(h[10])<0&&(r=-1*r),h[1]?(o=h[1],l=h[9]):h[8]&&(o=h[8],l=h[16]);else throw new Error("invalid DMS coordinates format");else if(l2.test(e))if(h=l2.exec(e),u=ig(h),u)n=Math.abs(parseInt(h[2])),h[4]&&(n+=h[4]/60),h[6]&&(n+=h[6]/3600),parseInt(h[2])<0&&(n=-1*n),r=Math.abs(parseInt(h[10])),h[12]&&(r+=h[12]/60),h[14]&&(r+=h[14]/3600),parseInt(h[10])<0&&(r=-1*r),h[1]?(o=h[1],l=h[9]):h[8]&&(o=h[8],l=h[16]);else throw new Error("invalid coordinates format");if(u){if(Math.abs(r)>=180)throw new Error("invalid longitude value");if(Math.abs(n)>=90)throw new Error("invalid latitude value");if((o||l)&&(!o||!l))throw new Error("invalid coordinates format");if(o&&o==l)throw new Error("invalid coordinates format");let y=/S|SOUTH/i;y.test(o)&&n>0&&(n=-1*n),y=/W|WEST/i,y.test(l)&&r>0&&(r=-1*r);const w=h[0].trim();let S,C;const P=/[,/;\u0020]/g,F=w.match(P);if(F==null){const J=Math.floor(e.length/2);S=w.substring(0,J).trim(),C=w.substring(J).trim()}else{let J;F.length%2==1?J=Math.floor(F.length/2):J=F.length/2-1;let K=0;if(J==0)K=w.indexOf(F[0]),S=w.substring(0,K).trim(),C=w.substring(K+1).trim();else{let O=0,G=0;for(;O<=J;)K=w.indexOf(F[O],G),G=K+1,O++;S=w.substring(0,K).trim(),C=w.substring(K+1).trim()}}const R=S.split(".");if(R.length==2&&R[1]==0&&R[1].length!=2)throw new Error("invalid coordinates format");const Y=C.split(".");if(Y.length==2&&Y[1]==0&&Y[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(S)||/^\d+$/.test(C))throw new Error("degree only coordinate/s provided");return isNaN(n)&&n.includes(",")&&(n=n.replace(",",".")),n=Number(Number(n).toFixed(t)),isNaN(r)&&r.includes(",")&&(r=r.replace(",",".")),r=Number(Number(r).toFixed(t)),Object.freeze({verbatimCoordinates:w,verbatimLatitude:S,verbatimLongitude:C,decimalLatitude:n,decimalLongitude:r,decimalCoordinates:`${n},${r}`,closeEnough:aN,toCoordinateFormat:oN})}else throw new Error("coordinates pattern match failed")}function ig(e){if(!isNaN(e[0]))return!1;const t=[...e];if(t.shift(),t.length%2>0)return!1;const n=/^[-+]?\d+([\.,]\d+)?$/,r=/[eastsouthnorthwest]+/i,o=t.length/2;for(let l=0;l{t.decimalLatitude?e.push(t):e.push({...t,...cN})}),[...e,...hN,...fN]}const dN=pN();Uv.formats=dN.map(e=>e.verbatimCoordinates);const mN=Uv;function h2(e,t,n){const r=e.slice();return r[81]=t[n],r[83]=n,r}function f2(e){let t,n;return t=new QR({}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function p2(e){let t,n,r,o,l;return n=new tN({}),{c(){t=jt("button"),Ae(n.$$.fragment),Wt(t,"type","button"),Wt(t,"title",e[9]),Wt(t,"class","svelte-zh3kmv"),el(t,"active",e[0])},m(h,u){Ut(h,t,u),Pe(n,t,null),r=!0,o||(l=$e(t,"click",e[67]),o=!0)},p(h,u){(!r||u[0]&512)&&Wt(t,"title",h[9]),(!r||u[0]&1)&&el(t,"active",h[0])},i(h){r||(Rt(n.$$.fragment,h),r=!0)},o(h){Zt(n.$$.fragment,h),r=!1},d(h){h&&Vt(t),Me(n),o=!1,l()}}}function gN(e){let t,n=[],r=new Map,o,l,h,u=_o(e[14]);const y=w=>w[81].id+(w[81].address?","+w[81].address:"");for(let w=0;w{ft=null}),ar()),(!G||re[0]&2)&&el(w,"displayable",Ct[1]!==""),Ct[5]===!0?ct?(ct.p(Ct,re),re[0]&32&&Rt(ct,1)):(ct=p2(Ct),ct.c(),Rt(ct,1),ct.m(r,R)):ct&&(sr(),Zt(ct,1,1,()=>{ct=null}),ar()),Pt&&Pt.p&&(!G||re[1]&134217728)&&Ci(Pt,ht,Ct,Ct[58],G?Ii(ht,Ct[58],re,null):Ti(Ct[58]),null);let pe=J;J=$t(Ct),J===pe?~J&&Lt[J].p(Ct,re):(K&&(sr(),Zt(Lt[pe],1,1,()=>{Lt[pe]=null}),ar()),~J?(K=Lt[J],K?K.p(Ct,re):(K=Lt[J]=$[J](Ct),K.c()),Rt(K,1),K.m(n,null)):K=null),(!G||re[0]&4&&O!==(O=_g(Ct[2])+" svelte-zh3kmv"))&&Wt(n,"class",O),(!G||re[0]&22)&&el(n,"can-collapse",Ct[4]&&Ct[1]==="")},i(Ct){G||(Rt(_t),Rt(l.$$.fragment,Ct),Rt(C.$$.fragment,Ct),Rt(ft),Rt(ct),Rt(Pt,Ct),Rt(K),G=!0)},o(Ct){Zt(_t),Zt(l.$$.fragment,Ct),Zt(C.$$.fragment,Ct),Zt(ft),Zt(ct),Zt(Pt,Ct),Zt(K),G=!1},d(Ct){Ct&&(Vt(t),Vt(n)),Me(l),e[61](null),Me(C),ft&&ft.d(),ct&&ct.d(),Pt&&Pt.d(Ct),~J&&Lt[J].d(),q=!1,bi(ot)}}}function xN(e,t,n){let r,{$$slots:o={},$$scope:l}=t,{class:h=void 0}=t,{apiKey:u}=t,{bbox:y=void 0}=t,{clearButtonTitle:w="clear"}=t,{clearOnBlur:S=!1}=t,{collapsed:C=!1}=t,{country:P=void 0}=t,{debounceSearch:F=200}=t,{enableReverse:R=!1}=t,{errorMessage:Y="Something went wrong…"}=t,{filter:J=()=>!0}=t,{flyTo:K=!0}=t,{fuzzyMatch:O=!0}=t,{language:G=void 0}=t,{limit:q=void 0}=t,{mapController:ot=void 0}=t,{minLength:_t=2}=t,{noResultsMessage:ft="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!"}=t,{placeholder:ct="Search"}=t,{proximity:ht=[{type:"server-geolocation"}]}=t,{reverseActive:Pt=R==="always"}=t,{reverseButtonTitle:$="toggle reverse geocoding"}=t,{searchValue:Lt=""}=t,{showFullGeometry:$t=!0}=t,{showPlaceType:Ct="ifNeeded"}=t,{showResultsWhileTyping:re=!0}=t,{selectFirst:pe=!0}=t,{flyToSelected:qt=!1}=t,{markerOnSelected:Ne=!0}=t,{types:Ce=void 0}=t,{excludeTypes:pn=!1}=t,{zoom:Ve=16}=t,{maxZoom:Ee=18}=t,{apiUrl:sn="https://api.maptiler.com/geocoding"}=t,{fetchParameters:En={}}=t,{iconsBaseUrl:dn="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.2/icons/"}=t,{adjustUrlQuery:mn=Q=>{}}=t;function Mn(){Mt.focus()}function _r(){Mt.blur()}function Lr(Q,bt=!0){n(1,Lt=Q),bt?(n(15,Ze=-1),gl()):(jr(),setTimeout(()=>{Mt.focus(),Mt.select()}))}function vr(){n(14,mt=void 0),n(55,be=void 0),n(15,Ze=-1)}function cr(){n(54,St=[]),n(55,be=void 0)}let Kt=!1,mt,St,be,An="",Mt,Ze=-1,Pr,on=[],Hn,To,us,Ds;const Na=new Set,xi=Vu();Ss(()=>{ot&&(ot.setEventHandler(void 0),ot.indicateReverse(!1),ot.setSelectedMarker(-1),ot.setMarkers(void 0,void 0))});function gl(Q){if(To&&(clearTimeout(To),To=void 0),Ze>-1&&mt)n(55,be=mt[Ze]),n(1,Lt=be.place_type[0]==="reverse"?be.place_name:be.place_name.replace(/,.*/,"")),n(18,Pr=void 0),n(54,St=void 0),n(15,Ze=-1);else if(Lt){const bt=Q||!cs(Lt);ee(Lt,{exact:!0}).then(()=>{n(54,St=mt),n(55,be=void 0),bt&&Zo()}).catch(dt=>n(18,Pr=dt))}}function cs(Q){try{return mN(Q,6)}catch{return!1}}async function ee(Q,{byId:bt=!1,exact:dt=!1}={}){n(18,Pr=void 0),Hn==null||Hn.abort();const Et=new AbortController;n(19,Hn=Et);try{const Nt=cs(Q),Ft=new URLSearchParams;if(G!==void 0&&Ft.set("language",Array.isArray(G)?G.join(","):G??""),Ce&&Ft.set("types",Ce.join(",")),pn&&Ft.set("excludeTypes",String(pn)),y&&Ft.set("bbox",y.map(Ge=>Ge.toFixed(6)).join(",")),P&&Ft.set("country",Array.isArray(P)?P.join(","):P),!bt&&!Nt){const Ge=await iN(ot,ht,Et);Ge&&Ft.set("proximity",Ge),(dt||!re)&&Ft.set("autocomplete","false"),Ft.set("fuzzyMatch",String(O))}q!==void 0&&(!Nt||(Ce==null?void 0:Ce.length)===1)&&Ft.set("limit",String(q)),Ft.set("key",u),mn(Ft);const Ht=sn+"/"+encodeURIComponent(Nt?Nt.decimalLongitude+","+Nt.decimalLatitude:Q)+".json?"+Ft.toString();if(Ht===An){bt?(n(14,mt=void 0),n(55,be=on[0])):n(14,mt=on);return}An=Ht;const we=await fetch(Ht,{signal:Et.signal,...En});if(!we.ok)throw new Error(await we.text());const Te=await we.json();xi("response",{url:Ht,featureCollection:Te}),bt?(n(14,mt=void 0),n(55,be=Te.features[0]),on=[be]):(n(14,mt=Te.features.filter(J)),Nt&&mt.unshift({type:"Feature",properties:{},id:"reverse_"+Nt.decimalLongitude+"_"+Nt.decimalLatitude,text:Nt.decimalLatitude+", "+Nt.decimalLongitude,place_name:Nt.decimalLatitude+", "+Nt.decimalLongitude,place_type:["reverse"],center:[Nt.decimalLongitude,Nt.decimalLatitude],bbox:[Nt.decimalLongitude,Nt.decimalLatitude,Nt.decimalLongitude,Nt.decimalLatitude],geometry:{type:"Point",coordinates:[Nt.decimalLongitude,Nt.decimalLatitude]}}),on=mt,Nt&&Mt.focus())}catch(Nt){if(Nt&&typeof Nt=="object"&&"name"in Nt&&Nt.name==="AbortError")return;throw Nt}finally{Et===Hn&&n(19,Hn=void 0)}}function Zo(){var dt;if(!(St!=null&&St.length)||!K)return;const Q=[180,90,-180,-90],bt=!St.some(Et=>!Et.matching_text);for(const Et of St)if(bt||!Et.matching_text)for(const Nt of[0,1,2,3])Q[Nt]=Math[Nt<2?"min":"max"](Q[Nt],((dt=Et.bbox)==null?void 0:dt[Nt])??Et.center[Nt%2]);ot&&St.length>0&&(be&&Q[0]===Q[2]&&Q[1]===Q[3]?ot.flyTo(be.center,Ve):ot.fitBounds(i2(Q),50,Ee))}function Hi(Q){n(0,Pt=R==="always"),n(14,mt=void 0),n(55,be=void 0),n(15,Ze=-1),Lr(Q[1].toFixed(6)+", "+rN(Q[0],[-180,180],!0).toFixed(6),!1)}function yl(Q){if(!mt)return;let bt=Q.key==="ArrowDown"?1:Q.key==="ArrowUp"?-1:0;bt&&(Ze===(pe?0:-1)&&bt===-1&&n(15,Ze=mt.length),n(15,Ze+=bt),Ze>=mt.length&&n(15,Ze=-1),Ze<0&&pe&&n(15,Ze=0),Q.preventDefault())}function jr(Q=!0){if(n(18,Pr=void 0),re){if(To&&clearTimeout(To),Lt.length<_t)return;const bt=Lt;To=window.setTimeout(()=>{ee(bt).catch(dt=>n(18,Pr=dt))},Q?F:0)}else n(14,mt=void 0),n(18,Pr=void 0)}function se(Q){n(55,be=Q),n(1,Lt=Q.place_name),n(15,Ze=-1)}const Ke=()=>Mt.focus();function Xe(Q){Li[Q?"unshift":"push"](()=>{Mt=Q,n(17,Mt)})}function Mr(){Lt=this.value,n(1,Lt),n(13,Kt),n(27,S)}const Ho=()=>n(13,Kt=!0),He=()=>n(13,Kt=!1),fa=()=>jr(),Nr=()=>{n(1,Lt=""),Mt.focus()},at=()=>n(0,Pt=!Pt),V=()=>n(18,Pr=void 0),j=Q=>n(15,Ze=Q),X=Q=>se(Q),nt=()=>{pe||n(15,Ze=-1)},vt=()=>{};return e.$$set=Q=>{"class"in Q&&n(2,h=Q.class),"apiKey"in Q&&n(25,u=Q.apiKey),"bbox"in Q&&n(26,y=Q.bbox),"clearButtonTitle"in Q&&n(3,w=Q.clearButtonTitle),"clearOnBlur"in Q&&n(27,S=Q.clearOnBlur),"collapsed"in Q&&n(4,C=Q.collapsed),"country"in Q&&n(28,P=Q.country),"debounceSearch"in Q&&n(29,F=Q.debounceSearch),"enableReverse"in Q&&n(5,R=Q.enableReverse),"errorMessage"in Q&&n(6,Y=Q.errorMessage),"filter"in Q&&n(30,J=Q.filter),"flyTo"in Q&&n(31,K=Q.flyTo),"fuzzyMatch"in Q&&n(32,O=Q.fuzzyMatch),"language"in Q&&n(33,G=Q.language),"limit"in Q&&n(34,q=Q.limit),"mapController"in Q&&n(35,ot=Q.mapController),"minLength"in Q&&n(36,_t=Q.minLength),"noResultsMessage"in Q&&n(7,ft=Q.noResultsMessage),"placeholder"in Q&&n(8,ct=Q.placeholder),"proximity"in Q&&n(37,ht=Q.proximity),"reverseActive"in Q&&n(0,Pt=Q.reverseActive),"reverseButtonTitle"in Q&&n(9,$=Q.reverseButtonTitle),"searchValue"in Q&&n(1,Lt=Q.searchValue),"showFullGeometry"in Q&&n(38,$t=Q.showFullGeometry),"showPlaceType"in Q&&n(10,Ct=Q.showPlaceType),"showResultsWhileTyping"in Q&&n(39,re=Q.showResultsWhileTyping),"selectFirst"in Q&&n(11,pe=Q.selectFirst),"flyToSelected"in Q&&n(40,qt=Q.flyToSelected),"markerOnSelected"in Q&&n(41,Ne=Q.markerOnSelected),"types"in Q&&n(42,Ce=Q.types),"excludeTypes"in Q&&n(43,pn=Q.excludeTypes),"zoom"in Q&&n(44,Ve=Q.zoom),"maxZoom"in Q&&n(45,Ee=Q.maxZoom),"apiUrl"in Q&&n(46,sn=Q.apiUrl),"fetchParameters"in Q&&n(47,En=Q.fetchParameters),"iconsBaseUrl"in Q&&n(12,dn=Q.iconsBaseUrl),"adjustUrlQuery"in Q&&n(48,mn=Q.adjustUrlQuery),"$$scope"in Q&&n(58,l=Q.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&134225920&&setTimeout(()=>{n(16,us=Kt),S&&!Kt&&n(1,Lt="")}),e.$$.dirty[0]&16386|e.$$.dirty[1]&32&&Lt.length<_t&&(n(55,be=void 0),n(14,mt=void 0),n(18,Pr=void 0),n(54,St=mt)),e.$$.dirty[1]&16777344&&$t&&be&&!be.address&&be.geometry.type==="Point"&&be.place_type[0]!=="reverse"&&ee(be.id,{byId:!0}).catch(Q=>n(18,Pr=Q)),e.$$.dirty[1]&50356241&&(ot&&be&&be.id!==Ds&&K&&(!be.bbox||be.bbox[0]===be.bbox[2]&&be.bbox[1]===be.bbox[3]?ot.flyTo(be.center,be.id.startsWith("poi.")||be.id.startsWith("address.")?Ee:Ve):ot.fitBounds(i2(be.bbox),50,Ee),n(14,mt=void 0),n(54,St=void 0),n(15,Ze=-1)),n(56,Ds=be==null?void 0:be.id)),e.$$.dirty[0]&18432&&pe&&mt!=null&&mt.length&&n(15,Ze=0),e.$$.dirty[0]&2050&&(pe||n(15,Ze=-1)),e.$$.dirty[0]&16384|e.$$.dirty[1]&8388608&&St!==mt&&n(54,St=void 0),e.$$.dirty[0]&81921|e.$$.dirty[1]&8388624&&ot&&ot.setEventHandler(Q=>{switch(Q.type){case"mapClick":Pt&&Hi(Q.coordinates);break;case"markerClick":{const bt=mt==null?void 0:mt.find(dt=>dt.id===Q.id);bt&&se(bt)}break;case"markerMouseEnter":St&&n(15,Ze=us?(mt==null?void 0:mt.findIndex(bt=>bt.id===Q.id))??-1:-1);break;case"markerMouseLeave":St&&n(15,Ze=-1);break}}),e.$$.dirty[0]&49152&&n(57,r=mt==null?void 0:mt[Ze]),e.$$.dirty[1]&67133969&&ot&&r&&K&&qt&&ot.flyTo(r.center,r.id.startsWith("poi.")||r.id.startsWith("address.")?Ee:Ve),e.$$.dirty[1]&1040&&(Ne||ot==null||ot.setMarkers(void 0,void 0)),e.$$.dirty[1]&75498512&&ot&&Ne&&!St&&(ot.setMarkers(r?[r]:void 0,void 0),ot.setSelectedMarker(r?0:-1)),e.$$.dirty[1]&25165840&&ot&&ot.setMarkers(St,be),e.$$.dirty[0]&32768|e.$$.dirty[1]&8388624&&St&&ot&&ot.setSelectedMarker(Ze),e.$$.dirty[0]&2|e.$$.dirty[1]&16&&ot){const Q=cs(Lt);ot.setReverseMarker(Q?[Q.decimalLongitude,Q.decimalLatitude]:void 0)}e.$$.dirty[1]&67108864&&xi("select",r),e.$$.dirty[1]&16777216&&xi("pick",be),e.$$.dirty[0]&81920&&xi("optionsVisibilityChange",us&&!!mt),e.$$.dirty[0]&16384&&xi("featuresListed",mt),e.$$.dirty[1]&8388608&&xi("featuresMarked",St),e.$$.dirty[0]&1&&xi("reverseToggle",Pt),e.$$.dirty[0]&2&&xi("queryChange",Lt),e.$$.dirty[0]&1|e.$$.dirty[1]&16&&ot&&ot.indicateReverse(Pt)},[Pt,Lt,h,w,C,R,Y,ft,ct,$,Ct,pe,dn,Kt,mt,Ze,us,Mt,Pr,Hn,Na,gl,yl,jr,se,u,y,S,P,F,J,K,O,G,q,ot,_t,ht,$t,re,qt,Ne,Ce,pn,Ve,Ee,sn,En,mn,Mn,_r,Lr,vr,cr,St,be,Ds,r,l,o,Ke,Xe,Mr,Ho,He,fa,Nr,at,V,j,X,nt,vt]}class wN extends fn{constructor(t){super(),hn(this,t,xN,bN,en,{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]}}function m2(e){let t,n,r;return n=new wN({props:{mapController:e[1],apiKey:e[0]}}),{c(){t=jt("div"),Ae(n.$$.fragment),Wt(t,"class","svelte-ixhnie")},m(o,l){Ut(o,t,l),Pe(n,t,null),r=!0},p(o,l){const h={};l&2&&(h.mapController=o[1]),l&1&&(h.apiKey=o[0]),n.$set(h)},i(o){r||(Rt(n.$$.fragment,o),r=!0)},o(o){Zt(n.$$.fragment,o),r=!1},d(o){o&&Vt(t),Me(n)}}}function SN(e){let t,n,r=e[1]&&m2(e);return{c(){r&&r.c(),t=Co()},m(o,l){r&&r.m(o,l),Ut(o,t,l),n=!0},p(o,[l]){o[1]?r?(r.p(o,l),l&2&&Rt(r,1)):(r=m2(o),r.c(),Rt(r,1),r.m(t.parentNode,t)):r&&(sr(),Zt(r,1,1,()=>{r=null}),ar())},i(o){n||(Rt(r),n=!0)},o(o){Zt(r),n=!1},d(o){o&&Vt(t),r&&r.d(o)}}}function EN(e,t,n){let r,{apiKey:o}=t,{map:l}=t;return e.$$set=h=>{"apiKey"in h&&n(0,o=h.apiKey),"map"in h&&n(2,l=h.map)},e.$$.update=()=>{e.$$.dirty&4&&n(1,r=l?zR(l,bs):null)},[o,r,l]}class IN extends fn{constructor(t){super(),hn(this,t,EN,SN,en,{apiKey:0,map:2})}}const CN=Symbol.for("svelte-maplibre");function TN(){return J0(CN)}function LN(e){return"layerType"in e&&e.layerType==="deckgl"}const PN=e=>({features:e[0]&16,data:e[0]&16,map:e[0]&4,close:e[0]&1}),g2=e=>{var t;return{features:e[4],data:(t=e[4])==null?void 0:t[0],map:e[2],close:e[31]}};function y2(e){let t,n,r=(e[4]||e[3]instanceof bs.Marker)&&_2(e);return{c(){t=jt("div"),r&&r.c()},m(o,l){Ut(o,t,l),r&&r.m(t,null),e[32](t),n=!0},p(o,l){o[4]||o[3]instanceof bs.Marker?r?(r.p(o,l),l[0]&24&&Rt(r,1)):(r=_2(o),r.c(),Rt(r,1),r.m(t,null)):r&&(sr(),Zt(r,1,1,()=>{r=null}),ar())},i(o){n||(Rt(r),n=!0)},o(o){Zt(r),n=!1},d(o){o&&Vt(t),r&&r.d(),e[32](null)}}}function _2(e){let t;const n=e[30].default,r=Ei(n,e,e[29],g2);return{c(){r&&r.c()},m(o,l){r&&r.m(o,l),t=!0},p(o,l){r&&r.p&&(!t||l[0]&536870933)&&Ci(r,n,o,o[29],t?Ii(n,o[29],l,PN):Ti(o[29]),g2)},i(o){t||(Rt(r,o),t=!0)},o(o){Zt(r,o),t=!1},d(o){r&&r.d(o)}}}function MN(e){let t,n,r=e[9].default&&y2(e);return{c(){r&&r.c(),t=Co()},m(o,l){r&&r.m(o,l),Ut(o,t,l),n=!0},p(o,l){o[9].default?r?(r.p(o,l),l[0]&512&&Rt(r,1)):(r=y2(o),r.c(),Rt(r,1),r.m(t.parentNode,t)):r&&(sr(),Zt(r,1,1,()=>{r=null}),ar())},i(o){n||(Rt(r),n=!0)},o(o){Zt(r),n=!1},d(o){o&&Vt(t),r&&r.d(o)}}}function AN(e,t,n){let r,o,l,h,u,y,{$$slots:w={},$$scope:S}=t;const C=VT(w);let{closeButton:P=void 0}=t,{closeOnClickOutside:F=!0}=t,{closeOnClickInside:R=!1}=t,{closeOnMove:Y=!1}=t,{openOn:J="click"}=t,{openIfTopMost:K=!0}=t,{focusAfterOpen:O=!0}=t,{anchor:G=void 0}=t,{offset:q=void 0}=t,{popupClass:ot=void 0}=t,{maxWidth:_t=void 0}=t,{lngLat:ft=void 0}=t,{html:ct=void 0}=t,{open:ht=!1}=t;const Pt=Vu(),{map:$,popupTarget:Lt,layerEvent:$t,layer:Ct,eventTopMost:re}=TN();qe(e,$,St=>n(2,l=St)),qe(e,Lt,St=>n(3,u=St)),qe(e,$t,St=>n(28,h=St)),qe(e,Ct,St=>n(35,y=St));const pe=["click","dblclick","contextmenu"];let qt,Ne=!1,Ce;function pn(){if(!qt)return;let St=qt.getElement();!St||St===Ce||(Ce=St,J==="hover"&&(Ce.style.pointerEvents="none"),Ce.addEventListener("mouseenter",()=>{n(24,Ne=!0)},{passive:!0}),Ce.addEventListener("mouseleave",()=>{n(24,Ne=!1)},{passive:!0}),Ce.addEventListener("click",()=>{R&&n(0,ht=!1)},{passive:!0}))}Y0(()=>{if(l)return l.on("click",vr),l.on("contextmenu",vr),typeof u=="string"&&(l.on("click",u,En),l.on("dblclick",u,En),l.on("contextmenu",u,En),l.on("mousemove",u,Lr),l.on("mouseleave",u,_r),l.on("touchstart",u,mn),l.on("touchend",u,Mn)),()=>{l!=null&&l.loaded()&&(qt==null||qt.remove(),l.off("click",vr),l.off("contextmenu",vr),u instanceof bs.Marker?u.getPopup()===qt&&u.setPopup(void 0):typeof u=="string"&&(l.off("click",u,En),l.off("dblclick",u,En),l.off("contextmenu",u,En),l.off("mousemove",u,Lr),l.off("mouseleave",u,_r),l.off("touchstart",u,mn),l.off("touchend",u,Mn)))}});function Ve(St){return K?!("marker"in St)&&!LN(St)&&re(St)!==y:!1}let Ee=null,sn="normal";function En(St){St.type===J&&(Ve(St)||("layerType"in St?St.layerType==="deckgl"?(n(10,ft=St.coordinate),n(4,Ee=St.object?[St.object]:null)):(n(10,ft=St.lngLat),n(4,Ee=St.features??[])):(n(10,ft=St.lngLat),n(4,Ee=St.features??[])),setTimeout(()=>n(0,ht=!0))))}let dn=null;function mn(St){dn=St.point}function Mn(St){if(!dn||J!=="hover")return;let be=dn.dist(St.point);dn=null,be<3&&(n(10,ft=St.lngLat),n(4,Ee=St.features??[]),qt.isOpen()?n(25,sn="justOpened"):(n(25,sn="opening"),n(0,ht=!0)))}function _r(St){J!=="hover"||dn||sn!=="normal"||(n(0,ht=!1),n(4,Ee=null))}function Lr(St){if(!(J!=="hover"||dn||sn!=="normal")){if(Ve(St)){n(0,ht=!1),n(4,Ee=null);return}n(0,ht=!0),n(4,Ee=St.features??[]),n(10,ft=St.lngLat)}}function vr(St){if(sn==="justOpened"){n(25,sn="normal");return}if(!F)return;let be=[Ce,u instanceof bs.Marker?u==null?void 0:u.getElement():null];ht&&qt.isOpen()&&!be.some(An=>An==null?void 0:An.contains(St.originalEvent.target))&&(St.type==="contextmenu"&&J==="contextmenu"||St.type!=="contextmenu")&&n(0,ht=!1)}Ss(()=>{l&&(qt!=null&&qt.isOpen())&&qt.remove()});let cr;const Kt=()=>n(0,ht=!1);function mt(St){Li[St?"unshift":"push"](()=>{cr=St,n(1,cr)})}return e.$$set=St=>{"closeButton"in St&&n(11,P=St.closeButton),"closeOnClickOutside"in St&&n(12,F=St.closeOnClickOutside),"closeOnClickInside"in St&&n(13,R=St.closeOnClickInside),"closeOnMove"in St&&n(14,Y=St.closeOnMove),"openOn"in St&&n(15,J=St.openOn),"openIfTopMost"in St&&n(16,K=St.openIfTopMost),"focusAfterOpen"in St&&n(17,O=St.focusAfterOpen),"anchor"in St&&n(18,G=St.anchor),"offset"in St&&n(19,q=St.offset),"popupClass"in St&&n(20,ot=St.popupClass),"maxWidth"in St&&n(21,_t=St.maxWidth),"lngLat"in St&&n(10,ft=St.lngLat),"html"in St&&n(22,ct=St.html),"open"in St&&n(0,ht=St.open),"$$scope"in St&&n(29,S=St.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&14336&&n(27,r=P??(!F&&!R)),e.$$.dirty[0]&146685952&&(qt||(n(23,qt=new bs.Popup({closeButton:r,closeOnClick:!1,closeOnMove:Y,focusAfterOpen:O,maxWidth:_t,className:ot,anchor:G,offset:q})),Ce=qt.getElement(),qt.on("open",()=>{n(0,ht=!0),pn(),Pt("open",qt)}),qt.on("close",()=>{n(0,ht=!1),Pt("close",qt)}),qt.on("hover",()=>{Pt("hover",qt)}))),e.$$.dirty[0]&8421384&&qt&&u instanceof bs.Marker&&(J==="click"?u.setPopup(qt):u.getPopup()===qt&&u.setPopup(void 0)),e.$$.dirty[0]&268468224&&pe.includes(J)&&(h==null?void 0:h.type)===J&&(En(h),$n($t,h=null,h)),e.$$.dirty[0]&268468224&&n(26,o=J==="hover"&&((h==null?void 0:h.type)==="mousemove"||(h==null?void 0:h.type)==="mouseenter")),e.$$.dirty[0]&352354304&&J==="hover"&&$t&&(o&&h&&(h.layerType==="deckgl"?(n(10,ft=h.coordinate),n(4,Ee=h.object?[h.object]:null)):(n(10,ft=h.lngLat),n(4,Ee=h.features??[]))),n(0,ht=(o||Ne)??!1)),e.$$.dirty[0]&12582914&&(cr?qt.setDOMContent(cr):ct&&qt.setHTML(ct)),e.$$.dirty[0]&8389632&&ft&&qt.setLngLat(ft),e.$$.dirty[0]&41943045&&l){let St=qt.isOpen();ht&&!St?(qt.addTo(l),sn==="opening"&&n(25,sn="justOpened")):!ht&&St&&qt.remove()}},[ht,cr,l,u,Ee,$,Lt,$t,Ct,C,ft,P,F,R,Y,J,K,O,G,q,ot,_t,ct,qt,Ne,sn,o,r,h,S,w,Kt,mt]}class kN extends fn{constructor(t){super(),hn(this,t,AN,MN,en,{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])}}const DN=e=>({props:e&8}),v2=e=>({props:ON(e[3])});function RN(e){let t;const n=e[1].default,r=Ei(n,e,e[2],v2);return{c(){r&&r.c()},m(o,l){r&&r.m(o,l),t=!0},p(o,l){r&&r.p&&(!t||l&12)&&Ci(r,n,o,o[2],t?Ii(n,o[2],l,DN):Ti(o[2]),v2)},i(o){t||(Rt(r,o),t=!0)},o(o){Zt(r,o),t=!1},d(o){r&&r.d(o)}}}function NN(e){let t,n;return t=new kN({props:{openOn:e[0],$$slots:{default:[RN,({features:r})=>({3:r}),({features:r})=>r?8:0]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,[o]){const l={};o&1&&(l.openOn=r[0]),o&12&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function ON(e){return e?e[0].properties??{}:(console.log("A Popup with null features should be impossible"),{})}function zN(e,t,n){let{$$slots:r={},$$scope:o}=t,{openOn:l="hover"}=t;return e.$$set=h=>{"openOn"in h&&n(0,l=h.openOn),"$$scope"in h&&n(2,o=h.$$scope)},[l,r,o]}class CI extends fn{constructor(t){super(),hn(this,t,zN,NN,en,{openOn:0})}}function Iu(e,t,n){let r=["match",e];for(let[o,l]of Object.entries(t))r.push(o),r.push(l);return r.push(n),r}function FN(e,t,n){let r=["step",e];for(let o=1;o=0))throw new Error("precision must be a positive number");var n=Math.pow(10,t||0);return Math.round(e*n)/n}function jv(e,t){t===void 0&&(t="kilometers");var n=Gv[t];if(!n)throw new Error(t+" units is invalid");return e*n}function _y(e,t){t===void 0&&(t="kilometers");var n=Gv[t];if(!n)throw new Error(t+" units is invalid");return e/n}function ZN(e,t){return Cd(_y(e,t))}function HN(e){var t=e%360;return t<0&&(t+=360),t}function Cd(e){var t=e%(2*Math.PI);return t*180/Math.PI}function Xs(e){var t=e%360;return t*Math.PI/180}function XN(e,t,n){if(t===void 0&&(t="kilometers"),n===void 0&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return jv(_y(e,t),n)}function YN(e,t,n){if(t===void 0&&(t="meters"),n===void 0&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var r=W0[t];if(!r)throw new Error("invalid original units");var o=W0[n];if(!o)throw new Error("invalid final units");return e/r*o}function Xg(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function Wv(e){return!!e&&e.constructor===Object}function KN(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(t){if(!Xg(t))throw new Error("bbox must only contain numbers")})}function JN(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}const QN=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:W0,bearingToAzimuth:HN,convertArea:YN,convertLength:XN,degreesToRadians:Xs,earthRadius:yo,factors:Gv,feature:aa,featureCollection:zc,geometry:VN,geometryCollection:jN,isNumber:Xg,isObject:Wv,lengthToDegrees:ZN,lengthToRadians:_y,lineString:Hs,lineStrings:qN,multiLineString:TI,multiPoint:LI,multiPolygon:PI,point:$o,points:UN,polygon:qv,polygons:GN,radiansToDegrees:Cd,radiansToLength:jv,round:WN,unitsFactors:BN,validateBBox:KN,validateId:JN},Symbol.toStringTag,{value:"Module"}));function Td(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return e.geometry.coordinates;if(e.type==="Point")return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Lf(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function MI(e,t,n){if(n===void 0&&(n={}),n.final===!0)return $N(e,t);var r=Td(e),o=Td(t),l=Xs(r[0]),h=Xs(o[0]),u=Xs(r[1]),y=Xs(o[1]),w=Math.sin(h-l)*Math.cos(y),S=Math.cos(u)*Math.sin(y)-Math.sin(u)*Math.cos(y)*Math.cos(h-l);return Cd(Math.atan2(w,S))}function $N(e,t){var n=MI(t,e);return n=(n+180)%360,n}function Zp(e,t,n){n===void 0&&(n={});var r=Td(e),o=Td(t),l=Xs(o[1]-r[1]),h=Xs(o[0]-r[0]),u=Xs(r[1]),y=Xs(o[1]),w=Math.pow(Math.sin(l/2),2)+Math.pow(Math.sin(h/2),2)*Math.cos(u)*Math.cos(y);return jv(2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w)),n.units)}function b2(e,t,n,r){r===void 0&&(r={});var o=Td(e),l=Xs(o[0]),h=Xs(o[1]),u=Xs(n),y=_y(t,r.units),w=Math.asin(Math.sin(h)*Math.cos(y)+Math.cos(h)*Math.sin(y)*Math.cos(u)),S=l+Math.atan2(Math.sin(u)*Math.sin(y)*Math.cos(h),Math.cos(y)-Math.sin(h)*Math.sin(w)),C=Cd(S),P=Cd(w);return $o([C,P],r.properties)}function Vd(e,t,n){if(e!==null)for(var r,o,l,h,u,y,w,S=0,C=0,P,F=e.type,R=F==="FeatureCollection",Y=F==="Feature",J=R?e.features.length:1,K=0;Ky||R>w||Y>S){u=C,y=r,w=R,S=Y,l=0;return}var J=Hs([u,C],n.properties);if(t(J,r,o,Y,l)===!1)return!1;l++,u=C})===!1)return!1}}})}function sO(e,t,n){var r=n,o=!1;return kI(e,function(l,h,u,y,w){o===!1&&n===void 0?r=l:r=t(r,l,h,u,y,w),o=!0}),r}function DI(e,t){if(!e)throw new Error("geojson is required");Bf(e,function(n,r,o){if(n.geometry!==null){var l=n.geometry.type,h=n.geometry.coordinates;switch(l){case"LineString":if(t(n,r,o,0,0)===!1)return!1;break;case"Polygon":for(var u=0;uo?n:o,w=r>l?r:l;return[h,u,y,w]}var Hv={exports:{}},RI={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Pd,function(){function n(O,G,q,ot,_t){(function ft(ct,ht,Pt,$,Lt){for(;$>Pt;){if($-Pt>600){var $t=$-Pt+1,Ct=ht-Pt+1,re=Math.log($t),pe=.5*Math.exp(2*re/3),qt=.5*Math.sqrt(re*pe*($t-pe)/$t)*(Ct-$t/2<0?-1:1),Ne=Math.max(Pt,Math.floor(ht-Ct*pe/$t+qt)),Ce=Math.min($,Math.floor(ht+($t-Ct)*pe/$t+qt));ft(ct,ht,Ne,Ce,Lt)}var pn=ct[ht],Ve=Pt,Ee=$;for(r(ct,Pt,ht),Lt(ct[$],pn)>0&&r(ct,Pt,$);Ve0;)Ee--}Lt(ct[Pt],pn)===0?r(ct,Pt,Ee):r(ct,++Ee,$),Ee<=ht&&(Pt=Ee+1),ht<=Ee&&($=Ee-1)}})(O,G,q||0,ot||O.length-1,_t||o)}function r(O,G,q){var ot=O[G];O[G]=O[q],O[q]=ot}function o(O,G){return OG?1:0}var l=function(O){O===void 0&&(O=9),this._maxEntries=Math.max(4,O),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function h(O,G,q){if(!q)return G.indexOf(O);for(var ot=0;ot=O.minX&&G.maxY>=O.minY}function J(O){return{children:O,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function K(O,G,q,ot,_t){for(var ft=[G,q];ft.length;)if(!((q=ft.pop())-(G=ft.pop())<=ot)){var ct=G+Math.ceil((q-G)/ot/2)*ot;n(O,ct,G,q,_t),ft.push(G,ct,ct,q)}}return l.prototype.all=function(){return this._all(this.data,[])},l.prototype.search=function(O){var G=this.data,q=[];if(!Y(O,G))return q;for(var ot=this.toBBox,_t=[];G;){for(var ft=0;ft=0&&_t[G].children.length>this._maxEntries;)this._split(_t,G),G--;this._adjustParentBBoxes(ot,_t,G)},l.prototype._split=function(O,G){var q=O[G],ot=q.children.length,_t=this._minEntries;this._chooseSplitAxis(q,_t,ot);var ft=this._chooseSplitIndex(q,_t,ot),ct=J(q.children.splice(ft,q.children.length-ft));ct.height=q.height,ct.leaf=q.leaf,u(q,this.toBBox),u(ct,this.toBBox),G?O[G-1].children.push(ct):this._splitRoot(q,ct)},l.prototype._splitRoot=function(O,G){this.data=J([O,G]),this.data.height=O.height+1,this.data.leaf=!1,u(this.data,this.toBBox)},l.prototype._chooseSplitIndex=function(O,G,q){for(var ot,_t,ft,ct,ht,Pt,$,Lt=1/0,$t=1/0,Ct=G;Ct<=q-G;Ct++){var re=y(O,0,Ct,this.toBBox),pe=y(O,Ct,q,this.toBBox),qt=(_t=re,ft=pe,ct=void 0,ht=void 0,Pt=void 0,$=void 0,ct=Math.max(_t.minX,ft.minX),ht=Math.max(_t.minY,ft.minY),Pt=Math.min(_t.maxX,ft.maxX),$=Math.min(_t.maxY,ft.maxY),Math.max(0,Pt-ct)*Math.max(0,$-ht)),Ne=P(re)+P(pe);qt=G;Lt--){var $t=O.children[Lt];w(ct,O.leaf?_t($t):$t),ht+=F(ct)}return ht},l.prototype._adjustParentBBoxes=function(O,G,q){for(var ot=q;ot>=0;ot--)w(G[ot],O)},l.prototype._condense=function(O){for(var G=O.length-1,q=void 0;G>=0;G--)O[G].children.length===0?G>0?(q=O[G-1].children).splice(q.indexOf(O[G]),1):this.clear():u(O[G],this.toBBox)},l})})(RI);var dO=RI.exports;const mO=Qg(QN),gO=Qg(cO),yO=Qg(jD);var Xa=dO,NI=mO,OI=gO,Hh=yO.default,_O=OI.featureEach;OI.coordEach;NI.polygon;var w2=NI.featureCollection;function zI(e){var t=new Xa(e);return t.insert=function(n){if(n.type!=="Feature")throw new Error("invalid feature");return n.bbox=n.bbox?n.bbox:Hh(n),Xa.prototype.insert.call(this,n)},t.load=function(n){var r=[];return Array.isArray(n)?n.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Hh(o),r.push(o)}):_O(n,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Hh(o),r.push(o)}),Xa.prototype.load.call(this,r)},t.remove=function(n,r){if(n.type!=="Feature")throw new Error("invalid feature");return n.bbox=n.bbox?n.bbox:Hh(n),Xa.prototype.remove.call(this,n,r)},t.clear=function(){return Xa.prototype.clear.call(this)},t.search=function(n){var r=Xa.prototype.search.call(this,this.toBBox(n));return w2(r)},t.collides=function(n){return Xa.prototype.collides.call(this,this.toBBox(n))},t.all=function(){var n=Xa.prototype.all.call(this);return w2(n)},t.toJSON=function(){return Xa.prototype.toJSON.call(this)},t.fromJSON=function(n){return Xa.prototype.fromJSON.call(this,n)},t.toBBox=function(n){var r;if(n.bbox)r=n.bbox;else if(Array.isArray(n)&&n.length===4)r=n;else if(Array.isArray(n)&&n.length===6)r=[n[0],n[1],n[3],n[4]];else if(n.type==="Feature")r=Hh(n);else if(n.type==="FeatureCollection")r=Hh(n);else throw new Error("invalid geojson");return{minX:r[0],minY:r[1],maxX:r[2],maxY:r[3]}},t}Hv.exports=zI;Hv.exports.default=zI;var vO=Hv.exports;const bO=tv(vO);function xO(e,t){var n={},r=[];if(e.type==="LineString"&&(e=aa(e)),t.type==="LineString"&&(t=aa(t)),e.type==="Feature"&&t.type==="Feature"&&e.geometry!==null&&t.geometry!==null&&e.geometry.type==="LineString"&&t.geometry.type==="LineString"&&e.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var o=S2(e,t);return o&&r.push(o),zc(r)}var l=bO();return l.load(x2(t)),Yg(x2(e),function(h){Yg(l.search(h),function(u){var y=S2(h,u);if(y){var w=Lf(y).join(",");n[w]||(n[w]=!0,r.push(y))}})}),zc(r)}function S2(e,t){var n=Lf(e),r=Lf(t);if(n.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(r.length!==2)throw new Error(" line2 must only contain 2 coordinates");var o=n[0][0],l=n[0][1],h=n[1][0],u=n[1][1],y=r[0][0],w=r[0][1],S=r[1][0],C=r[1][1],P=(C-w)*(h-o)-(S-y)*(u-l),F=(S-y)*(l-w)-(C-w)*(o-y),R=(h-o)*(l-w)-(u-l)*(o-y);if(P===0)return null;var Y=F/P,J=R/P;if(Y>=0&&Y<=1&&J>=0&&J<=1){var K=o+Y*(h-o),O=l+Y*(u-l);return $o([K,O])}return null}function wO(e,t,n){n===void 0&&(n={});var r=$o([1/0,1/0],{dist:1/0}),o=0;return Bf(e,function(l){for(var h=Lf(l),u=0;u0&&(J=Y.features[0],J.properties.dist=Zp(t,J,n),J.properties.location=o+Zp(y,J,n)),y.properties.dist{if(this.active&&!this.dragFrom)this.recalculateHovering(t);else if(this.active&&this.dragFrom){if(this.hover=="polygon"){let n=this.dragFrom[0]-t.lngLat.lng,r=this.dragFrom[1]-t.lngLat.lat;for(let o of this.points)o[0]-=n,o[1]-=r}else this.points[this.hover]=t.lngLat.toArray();this.dragFrom=t.lngLat.toArray(),this.redraw()}});fi(this,"onClick",t=>{if(this.beforeUpdate(),this.active&&this.cursor){let n=[];if(E2(this.points).forEach((r,o)=>{n.push([o+1,wO(r,this.cursor).properties.dist])}),n.sort((r,o)=>r[1]-o[1]),n.length>0){let r=n[0][0];this.points.splice(r,0,this.cursor.geometry.coordinates),this.hover=r}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(t))});fi(this,"onDoubleClick",t=>{this.active&&(t.preventDefault(),this.cursor=n0(t.lngLat.toArray()),this.onClick(t),this.finish())});fi(this,"onMouseDown",t=>{this.active&&!this.dragFrom&&this.hover!=null&&(t.preventDefault(),this.cursor=null,this.dragFrom=t.lngLat.toArray(),this.beforeUpdate(),this.redraw())});fi(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});fi(this,"onKeypress",t=>{this.active&&(t.key=="Enter"?(t.stopPropagation(),this.finish()):t.key=="z"&&t.ctrlKey&&this.undo())});fi(this,"onKeyDown",t=>{this.active&&t.key=="Escape"&&(t.stopPropagation(),this.cancel())});this.map=t,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 t=this.polygonFeature();if(t)for(let n of this.eventListenersSuccess)n(t);else for(let n of this.eventListenersFailure)n();this.stop()}cancel(){for(let t of this.eventListenersFailure)t();this.stop()}addEventListenerSuccess(t){this.eventListenersSuccess.push(t)}addEventListenerUpdated(t){this.eventListenersUpdated.push(t)}addEventListenerFailure(t){this.eventListenersFailure.push(t)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}startNew(){this.active=!0,this.map.doubleClickZoom.disable()}editExisting(t){this.active=!0,this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(t.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 t={type:"FeatureCollection",features:[]};this.points.forEach((o,l)=>{let h=n0(o);h.properties.hover=this.hover==l,h.properties.idx=l,t.features.push(h)}),t.features=t.features.concat(E2(this.points));let n=this.polygonFeature();n&&(n.properties.hover=this.hover=="polygon",t.features.push(n)),BI.set(t);let r="crosshair";this.hover!=null&&(r=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=r,VI.set(this.previousStates.length)}pointsUpdated(){let t=this.polygonFeature();if(t)for(let n of this.eventListenersUpdated)n(t)}recalculateHovering(t){this.cursor=null,this.hover=null;for(let n of this.map.queryRenderedFeatures(t.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=n0(t.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let t=this.points.map(FI),n=[JSON.parse(JSON.stringify(t))];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>CO&&this.previousStates.shift()}}function E2(e){let t=[];for(let n=0;n=3&&t.push({type:"Feature",geometry:{type:"LineString",coordinates:[e[e.length-1],e[0]]},properties:{}}),t}function LO(e){let t,n,r;return{c(){t=Cn("Undo ("),n=Cn(e[1]),r=Cn(")")},m(o,l){Ut(o,t,l),Ut(o,n,l),Ut(o,r,l)},p(o,l){l&2&&Gi(n,o[1])},d(o){o&&(Vt(t),Vt(n),Vt(r))}}}function PO(e){let t;return{c(){t=Cn("Undo")},m(n,r){Ut(n,t,r)},p:ze,d(n){n&&Vt(t)}}}function MO(e){let t,n,r,o,l,h,u,y,w,S,C;function P(Y,J){return Y[1]==0?PO:LO}let F=P(e),R=F(e);return{c(){t=jt("div"),n=jt("button"),n.textContent="Finish",r=fe(),o=jt("button"),o.textContent="Cancel",l=fe(),h=jt("button"),R.c(),y=fe(),w=jt("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
  • `,h.disabled=u=e[1]==0,ai(t,"display","flex"),ai(t,"justify-content","space-between")},m(Y,J){Ut(Y,t,J),Gt(t,n),Gt(t,r),Gt(t,o),Gt(t,l),Gt(t,h),R.m(h,null),Ut(Y,y,J),Ut(Y,w,J),S||(C=[$e(n,"click",e[2]),$e(o,"click",e[3]),$e(h,"click",e[4])],S=!0)},p(Y,[J]){F===(F=P(Y))&&R?R.p(Y,J):(R.d(1),R=F(Y),R&&(R.c(),R.m(h,null))),J&2&&u!==(u=Y[1]==0)&&(h.disabled=u)},i:ze,o:ze,d(Y){Y&&(Vt(t),Vt(y),Vt(w)),R.d(),S=!1,bi(C)}}}function AO(e,t,n){let r;qe(e,VI,y=>n(1,r=y));let{polygonTool:o}=t;const l=()=>o.finish(),h=()=>o.cancel(),u=()=>o.undo();return e.$$set=y=>{"polygonTool"in y&&n(0,o=y.polygonTool)},[o,r,l,h,u]}class kO extends fn{constructor(t){super(),hn(this,t,AO,MO,en,{polygonTool:0})}}let DO=Date.now();function Ud(e){return`${e}-${DO++}`}const UI=Symbol.for("svelte-maplibre");function RO(){return J0(UI)}function I2(e){return{subscribe:e.subscribe}}function GI({key:e,setPopupTarget:t=!1,setCluster:n=!1,setMouseEvent:r=!1}){let o=RO(),l=Jr(null),h=I2(l),u={...o,[e]:I2(l)};if(t&&(u.popupTarget=h),r){let y=Jr(null);u.layerEvent=y,o.layerEvent=y}return n&&(u.cluster=Jr()),K0(UI,u),{...o,self:l}}function NO(){return GI({key:"source",setCluster:!0})}function OO(e=!0){return GI({key:"layer",setPopupTarget:e,setMouseEvent:e})}function C2(e){let t;return n=>{if(n)for(let r in n){let o=t==null?void 0:t[r],l=n[r];o!==l&&e(r,l,o)}else if(t)for(let r in t)e(r,void 0,t[r]);t=n}}function zO(e,...t){let n=[e];for(let r of t)if(r)Array.isArray(r)&&r[0]===e?n.push(...r.slice(1)):n.push(r);else continue;if(n.length!==1)return n.length===2?n[1]:n}function FO(e){return e===!0?["has","point_count"]:e===!1?["!",["has","point_count"]]:void 0}function T2(e){let t=e[0],n,r,o=L2(e);return{c(){o.c(),n=Co()},m(l,h){o.m(l,h),Ut(l,n,h),r=!0},p(l,h){h[0]&1&&en(t,t=l[0])?(sr(),Zt(o,1,1,ze),ar(),o=L2(l),o.c(),Rt(o,1),o.m(n.parentNode,n)):o.p(l,h)},i(l){r||(Rt(o),r=!0)},o(l){Zt(o),r=!1},d(l){l&&Vt(n),o.d(l)}}}function L2(e){let t;const n=e[36].default,r=Ei(n,e,e[35],null);return{c(){r&&r.c()},m(o,l){r&&r.m(o,l),t=!0},p(o,l){r&&r.p&&(!t||l[1]&16)&&Ci(r,n,o,o[35],t?Ii(n,o[35],l,null):Ti(o[35]),null)},i(o){t||(Rt(r,o),t=!0)},o(o){Zt(r,o),t=!1},d(o){r&&r.d(o)}}}function BO(e){let t,n,r=e[0]&&T2(e);return{c(){r&&r.c(),t=Co()},m(o,l){r&&r.m(o,l),Ut(o,t,l),n=!0},p(o,l){o[0]?r?(r.p(o,l),l[0]&1&&Rt(r,1)):(r=T2(o),r.c(),Rt(r,1),r.m(t.parentNode,t)):r&&(sr(),Zt(r,1,1,()=>{r=null}),ar())},i(o){n||(Rt(r),n=!0)},o(o){Zt(r),n=!1},d(o){o&&Vt(t),r&&r.d(o)}}}function VO(e,t,n){let r,o,l,h,u,y,w,S,C,P,F,R,{$$slots:Y={},$$scope:J}=t,{id:K=Ud("layer")}=t,{source:O=void 0}=t,{sourceLayer:G=void 0}=t,{beforeId:q=void 0}=t,{beforeLayerType:ot=void 0}=t,{type:_t}=t,{paint:ft=void 0}=t,{layout:ct=void 0}=t,{filter:ht=void 0}=t,{applyToClusters:Pt=void 0}=t,{minzoom:$=void 0}=t,{maxzoom:Lt=void 0}=t,{manageHoverState:$t=!1}=t,{hovered:Ct=null}=t,{interactive:re=!0}=t,{hoverCursor:pe=void 0}=t,{eventsIfTopMost:qt=!1}=t;const Ne=Vu(),{map:Ce,source:pn,self:Ve,minzoom:Ee,maxzoom:sn,eventTopMost:En,layerInfo:dn}=OO();qe(e,Ce,mt=>n(31,C=mt)),qe(e,pn,mt=>n(32,P=mt)),qe(e,Ve,mt=>n(0,S=mt)),qe(e,Ee,mt=>n(34,R=mt)),qe(e,sn,mt=>n(33,F=mt)),Ss(()=>{S&&C&&(dn.delete(S),C==null||C.removeLayer(S))});let mn;function Mn(mt){var Mt,Ze;if(!re||!S||!C||qt&&En(mt)!==S)return;let St=mt.features??[],be=(Ze=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:Ze.cluster_id,An={event:mt,map:C,clusterId:be,layer:S,source:u,features:St};Ne(mt.type,An)}function _r(mt){var Mt,Ze;if(!re||!S||!C||qt&&En(mt)!==S)return;pe&&(C.getCanvas().style.cursor=pe);let St=mt.features??[];n(6,Ct=St[0]??null);let be=(Ze=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:Ze.cluster_id;Ne("mouseenter",{event:mt,map:C,clusterId:be,layer:S,source:u,features:St})}function Lr(mt){var Mt,Ze,Pr;if(!re||!C)return;if(qt&&En(mt)!==S){n(6,Ct=null),$t&&mn!==void 0&&(C==null||C.setFeatureState({source:u,sourceLayer:G,id:mn},{hover:!1}),mn=void 0);return}C.getCanvas().style.cursor=pe;let St=mt.features??[],be=(Ze=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:Ze.cluster_id,An=(Pr=St[0])==null?void 0:Pr.id;An!==mn&&($t&&(mn!==void 0&&(C==null||C.setFeatureState({source:u,id:mn,sourceLayer:G},{hover:!1})),C==null||C.setFeatureState({source:u,id:An,sourceLayer:G},{hover:!0})),mn=An,n(6,Ct=St[0]??null)),Ne("mousemove",{event:mt,map:C,clusterId:be,layer:S,source:u,features:St})}function vr(mt){if(!(!re||!S||!C)){if(pe&&(C.getCanvas().style.cursor=""),n(6,Ct=null),$t&&mn!==void 0){const St={source:u,id:mn,sourceLayer:G};C==null||C.setFeatureState(St,{hover:!1}),mn=void 0}Ne("mouseleave",{map:C,layer:S,source:u})}}let cr=!0;function Kt(mt){C&&(C.off("click",mt,Mn),C.off("dblclick",mt,Mn),C.off("contextmenu",mt,Mn),C.off("mouseenter",mt,_r),C.off("mousemove",mt,Lr),C.off("mouseleave",mt,vr))}return Ss(()=>{C&&S&&Kt(S)}),e.$$set=mt=>{"id"in mt&&n(7,K=mt.id),"source"in mt&&n(8,O=mt.source),"sourceLayer"in mt&&n(9,G=mt.sourceLayer),"beforeId"in mt&&n(10,q=mt.beforeId),"beforeLayerType"in mt&&n(11,ot=mt.beforeLayerType),"type"in mt&&n(12,_t=mt.type),"paint"in mt&&n(13,ft=mt.paint),"layout"in mt&&n(14,ct=mt.layout),"filter"in mt&&n(15,ht=mt.filter),"applyToClusters"in mt&&n(16,Pt=mt.applyToClusters),"minzoom"in mt&&n(17,$=mt.minzoom),"maxzoom"in mt&&n(18,Lt=mt.maxzoom),"manageHoverState"in mt&&n(19,$t=mt.manageHoverState),"hovered"in mt&&n(6,Ct=mt.hovered),"interactive"in mt&&n(20,re=mt.interactive),"hoverCursor"in mt&&n(21,pe=mt.hoverCursor),"eventsIfTopMost"in mt&&n(22,qt=mt.eventsIfTopMost),"$$scope"in mt&&n(35,J=mt.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&65536&&n(30,r=FO(Pt)),e.$$.dirty[0]&1073774592&&n(24,o=zO("all",r,ht)),e.$$.dirty[0]&131072|e.$$.dirty[1]&8&&n(26,l=$??R),e.$$.dirty[0]&262144|e.$$.dirty[1]&4&&n(25,h=Lt??F),e.$$.dirty[0]&256|e.$$.dirty[1]&2&&n(29,u=O||P),e.$$.dirty[0]&654343809|e.$$.dirty[1]&1&&C&&S!==K&&u){S&&(Kt(S),dn.delete(S));let mt=q;if(!q&&ot){let St=C.getStyle().layers,be=typeof ot=="function"?ot:Mt=>Mt.type===ot,An=St==null?void 0:St.find(be);An&&(mt=An.id)}$n(Ve,S=K,S),C.addLayer(Sc({id:S,type:_t,source:u,"source-layer":G,filter:o,paint:ft,layout:ct,minzoom:l,maxzoom:h}),mt),n(23,cr=!0),C.on("click",S,Mn),C.on("dblclick",S,Mn),C.on("contextmenu",S,Mn),C.on("mouseenter",S,_r),C.on("mousemove",S,Lr),C.on("mouseleave",S,vr)}e.$$.dirty[0]&1048577&&S&&dn.set(S,{interactive:re}),e.$$.dirty[0]&1|e.$$.dirty[1]&1&&n(28,y=S?C2((mt,St)=>C==null?void 0:C.setPaintProperty(S,mt,St)):void 0),e.$$.dirty[0]&1|e.$$.dirty[1]&1&&n(27,w=S?C2((mt,St)=>C==null?void 0:C.setLayoutProperty(S,mt,St)):void 0),e.$$.dirty[0]&268443648&&(y==null||y(ft)),e.$$.dirty[0]&134234112&&(w==null||w(ct)),e.$$.dirty[0]&100663297|e.$$.dirty[1]&1&&S&&(C==null||C.setLayerZoomRange(S,l,h)),e.$$.dirty[0]&25165825|e.$$.dirty[1]&1&&S&&(cr?n(23,cr=!1):C==null||C.setFilter(S,o))},[S,Ce,pn,Ve,Ee,sn,Ct,K,O,G,q,ot,_t,ft,ct,ht,Pt,$,Lt,$t,re,pe,qt,cr,o,h,l,w,y,u,r,C,P,F,R,J,Y]}class Xv extends fn{constructor(t){super(),hn(this,t,VO,BO,en,{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 UO(e){let t;const n=e[16].default,r=Ei(n,e,e[24],null);return{c(){r&&r.c()},m(o,l){r&&r.m(o,l),t=!0},p(o,l){r&&r.p&&(!t||l&16777216)&&Ci(r,n,o,o[24],t?Ii(n,o[24],l,null):Ti(o[24]),null)},i(o){t||(Rt(r,o),t=!0)},o(o){Zt(r,o),t=!1},d(o){r&&r.d(o)}}}function GO(e){let t,n,r;function o(h){e[17](h)}let l={id:e[1],type:"circle",source:e[2],sourceLayer:e[3],beforeId:e[4],beforeLayerType:e[5],paint:e[6],layout:e[7],filter:e[8],applyToClusters:e[9],minzoom:e[10],maxzoom:e[11],hoverCursor:e[12],manageHoverState:e[13],eventsIfTopMost:e[14],interactive:e[15],$$slots:{default:[UO]},$$scope:{ctx:e}};return e[0]!==void 0&&(l.hovered=e[0]),t=new Xv({props:l}),Li.push(()=>Pu(t,"hovered",o)),t.$on("click",e[18]),t.$on("dblclick",e[19]),t.$on("contextmenu",e[20]),t.$on("mouseenter",e[21]),t.$on("mousemove",e[22]),t.$on("mouseleave",e[23]),{c(){Ae(t.$$.fragment)},m(h,u){Pe(t,h,u),r=!0},p(h,[u]){const y={};u&2&&(y.id=h[1]),u&4&&(y.source=h[2]),u&8&&(y.sourceLayer=h[3]),u&16&&(y.beforeId=h[4]),u&32&&(y.beforeLayerType=h[5]),u&64&&(y.paint=h[6]),u&128&&(y.layout=h[7]),u&256&&(y.filter=h[8]),u&512&&(y.applyToClusters=h[9]),u&1024&&(y.minzoom=h[10]),u&2048&&(y.maxzoom=h[11]),u&4096&&(y.hoverCursor=h[12]),u&8192&&(y.manageHoverState=h[13]),u&16384&&(y.eventsIfTopMost=h[14]),u&32768&&(y.interactive=h[15]),u&16777216&&(y.$$scope={dirty:u,ctx:h}),!n&&u&1&&(n=!0,y.hovered=h[0],Lu(()=>n=!1)),t.$set(y)},i(h){r||(Rt(t.$$.fragment,h),r=!0)},o(h){Zt(t.$$.fragment,h),r=!1},d(h){Me(t,h)}}}function qO(e,t,n){let{$$slots:r={},$$scope:o}=t,{id:l=Ud("circle")}=t,{source:h=void 0}=t,{sourceLayer:u=void 0}=t,{beforeId:y=void 0}=t,{beforeLayerType:w=void 0}=t,{paint:S}=t,{layout:C=void 0}=t,{filter:P=void 0}=t,{applyToClusters:F=void 0}=t,{minzoom:R=void 0}=t,{maxzoom:Y=void 0}=t,{hoverCursor:J=void 0}=t,{manageHoverState:K=!1}=t,{hovered:O=null}=t,{eventsIfTopMost:G=!1}=t,{interactive:q=!0}=t;function ot(Lt){O=Lt,n(0,O)}function _t(Lt){On.call(this,e,Lt)}function ft(Lt){On.call(this,e,Lt)}function ct(Lt){On.call(this,e,Lt)}function ht(Lt){On.call(this,e,Lt)}function Pt(Lt){On.call(this,e,Lt)}function $(Lt){On.call(this,e,Lt)}return e.$$set=Lt=>{"id"in Lt&&n(1,l=Lt.id),"source"in Lt&&n(2,h=Lt.source),"sourceLayer"in Lt&&n(3,u=Lt.sourceLayer),"beforeId"in Lt&&n(4,y=Lt.beforeId),"beforeLayerType"in Lt&&n(5,w=Lt.beforeLayerType),"paint"in Lt&&n(6,S=Lt.paint),"layout"in Lt&&n(7,C=Lt.layout),"filter"in Lt&&n(8,P=Lt.filter),"applyToClusters"in Lt&&n(9,F=Lt.applyToClusters),"minzoom"in Lt&&n(10,R=Lt.minzoom),"maxzoom"in Lt&&n(11,Y=Lt.maxzoom),"hoverCursor"in Lt&&n(12,J=Lt.hoverCursor),"manageHoverState"in Lt&&n(13,K=Lt.manageHoverState),"hovered"in Lt&&n(0,O=Lt.hovered),"eventsIfTopMost"in Lt&&n(14,G=Lt.eventsIfTopMost),"interactive"in Lt&&n(15,q=Lt.interactive),"$$scope"in Lt&&n(24,o=Lt.$$scope)},[O,l,h,u,y,w,S,C,P,F,R,Y,J,K,G,q,r,ot,_t,ft,ct,ht,Pt,$,o]}class jO extends fn{constructor(t){super(),hn(this,t,qO,GO,en,{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 WO(e){let t;const n=e[15].default,r=Ei(n,e,e[23],null);return{c(){r&&r.c()},m(o,l){r&&r.m(o,l),t=!0},p(o,l){r&&r.p&&(!t||l&8388608)&&Ci(r,n,o,o[23],t?Ii(n,o[23],l,null):Ti(o[23]),null)},i(o){t||(Rt(r,o),t=!0)},o(o){Zt(r,o),t=!1},d(o){r&&r.d(o)}}}function ZO(e){let t,n,r;function o(h){e[16](h)}let l={id:e[1],type:"fill",source:e[2],sourceLayer:e[3],beforeId:e[4],beforeLayerType:e[5],paint:e[6],layout:e[7],filter:e[8],minzoom:e[9],maxzoom:e[10],hoverCursor:e[11],manageHoverState:e[12],eventsIfTopMost:e[13],interactive:e[14],$$slots:{default:[WO]},$$scope:{ctx:e}};return e[0]!==void 0&&(l.hovered=e[0]),t=new Xv({props:l}),Li.push(()=>Pu(t,"hovered",o)),t.$on("click",e[17]),t.$on("dblclick",e[18]),t.$on("contextmenu",e[19]),t.$on("mouseenter",e[20]),t.$on("mousemove",e[21]),t.$on("mouseleave",e[22]),{c(){Ae(t.$$.fragment)},m(h,u){Pe(t,h,u),r=!0},p(h,[u]){const y={};u&2&&(y.id=h[1]),u&4&&(y.source=h[2]),u&8&&(y.sourceLayer=h[3]),u&16&&(y.beforeId=h[4]),u&32&&(y.beforeLayerType=h[5]),u&64&&(y.paint=h[6]),u&128&&(y.layout=h[7]),u&256&&(y.filter=h[8]),u&512&&(y.minzoom=h[9]),u&1024&&(y.maxzoom=h[10]),u&2048&&(y.hoverCursor=h[11]),u&4096&&(y.manageHoverState=h[12]),u&8192&&(y.eventsIfTopMost=h[13]),u&16384&&(y.interactive=h[14]),u&8388608&&(y.$$scope={dirty:u,ctx:h}),!n&&u&1&&(n=!0,y.hovered=h[0],Lu(()=>n=!1)),t.$set(y)},i(h){r||(Rt(t.$$.fragment,h),r=!0)},o(h){Zt(t.$$.fragment,h),r=!1},d(h){Me(t,h)}}}function HO(e,t,n){let{$$slots:r={},$$scope:o}=t,{id:l=Ud("fill")}=t,{source:h=void 0}=t,{sourceLayer:u=void 0}=t,{beforeId:y=void 0}=t,{beforeLayerType:w=void 0}=t,{paint:S}=t,{layout:C=void 0}=t,{filter:P=void 0}=t,{minzoom:F=void 0}=t,{maxzoom:R=void 0}=t,{hoverCursor:Y=void 0}=t,{manageHoverState:J=!1}=t,{hovered:K=null}=t,{eventsIfTopMost:O=!1}=t,{interactive:G=!0}=t;function q($){K=$,n(0,K)}function ot($){On.call(this,e,$)}function _t($){On.call(this,e,$)}function ft($){On.call(this,e,$)}function ct($){On.call(this,e,$)}function ht($){On.call(this,e,$)}function Pt($){On.call(this,e,$)}return e.$$set=$=>{"id"in $&&n(1,l=$.id),"source"in $&&n(2,h=$.source),"sourceLayer"in $&&n(3,u=$.sourceLayer),"beforeId"in $&&n(4,y=$.beforeId),"beforeLayerType"in $&&n(5,w=$.beforeLayerType),"paint"in $&&n(6,S=$.paint),"layout"in $&&n(7,C=$.layout),"filter"in $&&n(8,P=$.filter),"minzoom"in $&&n(9,F=$.minzoom),"maxzoom"in $&&n(10,R=$.maxzoom),"hoverCursor"in $&&n(11,Y=$.hoverCursor),"manageHoverState"in $&&n(12,J=$.manageHoverState),"hovered"in $&&n(0,K=$.hovered),"eventsIfTopMost"in $&&n(13,O=$.eventsIfTopMost),"interactive"in $&&n(14,G=$.interactive),"$$scope"in $&&n(23,o=$.$$scope)},[K,l,h,u,y,w,S,C,P,F,R,Y,J,O,G,r,q,ot,_t,ft,ct,ht,Pt,o]}class XO extends fn{constructor(t){super(),hn(this,t,HO,ZO,en,{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 YO(e,t,n,r,o){let l=!1;e.getSource(t)&&(l=!0,e.removeSource(t));const h=()=>{r(t)&&(e.addSource(t,n),o())};if(l){const u=()=>{t&&(e.getSource(t)?setTimeout(u,1):h())};u()}else h()}function KO(e,t,n){nS().then(()=>{let r=Q2(e);if(!r)return;r.getSource(t)===n&&r.removeSource(t)})}function P2(e){let t=e[0],n,r,o=M2(e);return{c(){o.c(),n=Co()},m(l,h){o.m(l,h),Ut(l,n,h),r=!0},p(l,h){h&1&&en(t,t=l[0])?(sr(),Zt(o,1,1,ze),ar(),o=M2(l),o.c(),Rt(o,1),o.m(n.parentNode,n)):o.p(l,h)},i(l){r||(Rt(o),r=!0)},o(l){Zt(o),r=!1},d(l){l&&Vt(n),o.d(l)}}}function M2(e){let t;const n=e[15].default,r=Ei(n,e,e[14],null);return{c(){r&&r.c()},m(o,l){r&&r.m(o,l),t=!0},p(o,l){r&&r.p&&(!t||l&16384)&&Ci(r,n,o,o[14],t?Ii(n,o[14],l,null):Ti(o[14]),null)},i(o){t||(Rt(r,o),t=!0)},o(o){Zt(r,o),t=!1},d(o){r&&r.d(o)}}}function JO(e){let t,n,r=e[0]&&P2(e);return{c(){r&&r.c(),t=Co()},m(o,l){r&&r.m(o,l),Ut(o,t,l),n=!0},p(o,[l]){o[0]?r?(r.p(o,l),l&1&&Rt(r,1)):(r=P2(o),r.c(),Rt(r,1),r.m(t.parentNode,t)):r&&(sr(),Zt(r,1,1,()=>{r=null}),ar())},i(o){n||(Rt(r),n=!0)},o(o){Zt(r),n=!1},d(o){o&&Vt(t),r&&r.d(o)}}}function QO(e,t,n){let r,o,l,{$$slots:h={},$$scope:u}=t,{id:y=Ud("geojson")}=t,{data:w}=t,{generateId:S=!1}=t,{promoteId:C=void 0}=t,{filter:P=void 0}=t,{lineMetrics:F=void 0}=t,{cluster:R=void 0}=t;const{map:Y,cluster:J,self:K}=NO();qe(e,Y,q=>n(13,o=q)),qe(e,J,q=>n(16,l=q)),qe(e,K,q=>n(0,r=q));let O,G=!0;return Ss(()=>{r&&O&&o&&(KO(Y,r,O),$n(K,r=null,r),n(11,O=void 0))}),e.$$set=q=>{"id"in q&&n(4,y=q.id),"data"in q&&n(5,w=q.data),"generateId"in q&&n(6,S=q.generateId),"promoteId"in q&&n(7,C=q.promoteId),"filter"in q&&n(8,P=q.filter),"lineMetrics"in q&&n(9,F=q.lineMetrics),"cluster"in q&&n(10,R=q.cluster),"$$scope"in q&&n(14,u=q.$$scope)},e.$$.update=()=>{e.$$.dirty&1024&&$n(J,l=R,l),e.$$.dirty&12273&&o&&r!==y&&($n(K,r=y,r),YO(o,r,Sc({type:"geojson",data:w,filter:P,lineMetrics:F,generateId:S,promoteId:C,cluster:!!R,clusterMinPoints:R==null?void 0:R.minPoints,clusterMaxZoom:R==null?void 0:R.maxZoom,clusterRadius:R==null?void 0:R.radius,clusterProperties:R==null?void 0:R.properties}),q=>o&&q===r,()=>{r&&(n(11,O=o==null?void 0:o.getSource(r)),n(12,G=!0))})),e.$$.dirty&8208&&(o==null||o.on("style.load",()=>{n(11,O=o==null?void 0:o.getSource(y))})),e.$$.dirty&6176&&O&&(G?n(12,G=!1):O.setData(w)),e.$$.dirty&3072&&(O==null||O.setClusterOptions(Sc({cluster:!!R,clusterMaxZoom:R==null?void 0:R.maxZoom,clusterRadius:R==null?void 0:R.radius})))},[r,Y,J,K,y,w,S,C,P,F,R,O,G,o,u,h]}class $O extends fn{constructor(t){super(),hn(this,t,QO,JO,en,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10})}}function t5(e){let t;const n=e[15].default,r=Ei(n,e,e[23],null);return{c(){r&&r.c()},m(o,l){r&&r.m(o,l),t=!0},p(o,l){r&&r.p&&(!t||l&8388608)&&Ci(r,n,o,o[23],t?Ii(n,o[23],l,null):Ti(o[23]),null)},i(o){t||(Rt(r,o),t=!0)},o(o){Zt(r,o),t=!1},d(o){r&&r.d(o)}}}function e5(e){let t,n,r;function o(h){e[16](h)}let l={id:e[1],type:"line",source:e[2],sourceLayer:e[3],beforeId:e[4],beforeLayerType:e[5],paint:e[6],layout:e[7],filter:e[8],minzoom:e[9],maxzoom:e[10],hoverCursor:e[11],manageHoverState:e[12],eventsIfTopMost:e[13],interactive:e[14],$$slots:{default:[t5]},$$scope:{ctx:e}};return e[0]!==void 0&&(l.hovered=e[0]),t=new Xv({props:l}),Li.push(()=>Pu(t,"hovered",o)),t.$on("click",e[17]),t.$on("dblclick",e[18]),t.$on("contextmenu",e[19]),t.$on("mouseenter",e[20]),t.$on("mousemove",e[21]),t.$on("mouseleave",e[22]),{c(){Ae(t.$$.fragment)},m(h,u){Pe(t,h,u),r=!0},p(h,[u]){const y={};u&2&&(y.id=h[1]),u&4&&(y.source=h[2]),u&8&&(y.sourceLayer=h[3]),u&16&&(y.beforeId=h[4]),u&32&&(y.beforeLayerType=h[5]),u&64&&(y.paint=h[6]),u&128&&(y.layout=h[7]),u&256&&(y.filter=h[8]),u&512&&(y.minzoom=h[9]),u&1024&&(y.maxzoom=h[10]),u&2048&&(y.hoverCursor=h[11]),u&4096&&(y.manageHoverState=h[12]),u&8192&&(y.eventsIfTopMost=h[13]),u&16384&&(y.interactive=h[14]),u&8388608&&(y.$$scope={dirty:u,ctx:h}),!n&&u&1&&(n=!0,y.hovered=h[0],Lu(()=>n=!1)),t.$set(y)},i(h){r||(Rt(t.$$.fragment,h),r=!0)},o(h){Zt(t.$$.fragment,h),r=!1},d(h){Me(t,h)}}}function n5(e,t,n){let{$$slots:r={},$$scope:o}=t,{id:l=Ud("line")}=t,{source:h=void 0}=t,{sourceLayer:u=void 0}=t,{beforeId:y=void 0}=t,{beforeLayerType:w=void 0}=t,{paint:S}=t,{layout:C=void 0}=t,{filter:P=void 0}=t,{minzoom:F=void 0}=t,{maxzoom:R=void 0}=t,{hoverCursor:Y=void 0}=t,{manageHoverState:J=!1}=t,{hovered:K=null}=t,{eventsIfTopMost:O=!1}=t,{interactive:G=!0}=t;function q($){K=$,n(0,K)}function ot($){On.call(this,e,$)}function _t($){On.call(this,e,$)}function ft($){On.call(this,e,$)}function ct($){On.call(this,e,$)}function ht($){On.call(this,e,$)}function Pt($){On.call(this,e,$)}return e.$$set=$=>{"id"in $&&n(1,l=$.id),"source"in $&&n(2,h=$.source),"sourceLayer"in $&&n(3,u=$.sourceLayer),"beforeId"in $&&n(4,y=$.beforeId),"beforeLayerType"in $&&n(5,w=$.beforeLayerType),"paint"in $&&n(6,S=$.paint),"layout"in $&&n(7,C=$.layout),"filter"in $&&n(8,P=$.filter),"minzoom"in $&&n(9,F=$.minzoom),"maxzoom"in $&&n(10,R=$.maxzoom),"hoverCursor"in $&&n(11,Y=$.hoverCursor),"manageHoverState"in $&&n(12,J=$.manageHoverState),"hovered"in $&&n(0,K=$.hovered),"eventsIfTopMost"in $&&n(13,O=$.eventsIfTopMost),"interactive"in $&&n(14,G=$.interactive),"$$scope"in $&&n(23,o=$.$$scope)},[K,l,h,u,y,w,S,C,P,F,R,Y,J,O,G,r,q,ot,_t,ft,ct,ht,Pt,o]}class r5 extends fn{constructor(t){super(),hn(this,t,n5,e5,en,{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 i5(e){let t,n,r,o,l,h;return t=new XO({props:{id:"edit-polygon-fill",filter:SO,paint:{"fill-color":"red","fill-opacity":["case",["boolean",["get","hover"],"false"],1,.5]}}}),r=new r5({props:{id:"edit-polygon-lines",filter:EO,paint:{"line-color":"black","line-width":8,"line-opacity":.5}}}),l=new jO({props:{id:"edit-polygon-vertices",filter:IO,paint:{"circle-color":"black","circle-opacity":["case",["has","hovered"],1,.5],"circle-radius":10}}}),{c(){Ae(t.$$.fragment),n=fe(),Ae(r.$$.fragment),o=fe(),Ae(l.$$.fragment)},m(u,y){Pe(t,u,y),Ut(u,n,y),Pe(r,u,y),Ut(u,o,y),Pe(l,u,y),h=!0},p:ze,i(u){h||(Rt(t.$$.fragment,u),Rt(r.$$.fragment,u),Rt(l.$$.fragment,u),h=!0)},o(u){Zt(t.$$.fragment,u),Zt(r.$$.fragment,u),Zt(l.$$.fragment,u),h=!1},d(u){u&&(Vt(n),Vt(o)),Me(t,u),Me(r,u),Me(l,u)}}}function o5(e){let t,n;return t=new $O({props:{data:e[0],$$slots:{default:[i5]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,[o]){const l={};o&1&&(l.data=r[0]),o&2&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function s5(e,t,n){let r;return qe(e,BI,o=>n(0,r=o)),[r]}class qI extends fn{constructor(t){super(),hn(this,t,s5,o5,en,{})}}const a5=e=>({}),A2=e=>({}),l5=e=>({}),k2=e=>({});function u5(e){let t,n,r,o;const l=e[1].left,h=Ei(l,e,e[0],k2),u=e[1].main,y=Ei(u,e,e[0],A2);return{c(){t=jt("div"),h&&h.c(),n=fe(),r=jt("div"),y&&y.c(),Wt(t,"class","left svelte-k43lgc"),Wt(r,"class","main svelte-k43lgc")},m(w,S){Ut(w,t,S),h&&h.m(t,null),Ut(w,n,S),Ut(w,r,S),y&&y.m(r,null),o=!0},p(w,[S]){h&&h.p&&(!o||S&1)&&Ci(h,l,w,w[0],o?Ii(l,w[0],S,l5):Ti(w[0]),k2),y&&y.p&&(!o||S&1)&&Ci(y,u,w,w[0],o?Ii(u,w[0],S,a5):Ti(w[0]),A2)},i(w){o||(Rt(h,w),Rt(y,w),o=!0)},o(w){Zt(h,w),Zt(y,w),o=!1},d(w){w&&(Vt(t),Vt(n),Vt(r)),h&&h.d(w),y&&y.d(w)}}}function c5(e,t,n){let{$$slots:r={},$$scope:o}=t;return e.$$set=l=>{"$$scope"in l&&n(0,o=l.$$scope)},[o,r]}class h5 extends fn{constructor(t){super(),hn(this,t,c5,u5,en,{})}}const f5=e=>({}),D2=e=>({}),p5=e=>({}),R2=e=>({});function d5(e){let t,n,r,o;const l=e[3].sidebar,h=Ei(l,e,e[2],R2),u=e[3].map,y=Ei(u,e,e[2],D2);return{c(){t=jt("div"),h&&h.c(),n=fe(),r=jt("div"),y&&y.c()},m(w,S){Ut(w,t,S),h&&h.m(t,null),e[4](t),Ut(w,n,S),Ut(w,r,S),y&&y.m(r,null),e[5](r),o=!0},p(w,[S]){h&&h.p&&(!o||S&4)&&Ci(h,l,w,w[2],o?Ii(l,w[2],S,p5):Ti(w[2]),R2),y&&y.p&&(!o||S&4)&&Ci(y,u,w,w[2],o?Ii(u,w[2],S,f5):Ti(w[2]),D2)},i(w){o||(Rt(h,w),Rt(y,w),o=!0)},o(w){Zt(h,w),Zt(y,w),o=!1},d(w){w&&(Vt(t),Vt(n),Vt(r)),h&&h.d(w),e[4](null),y&&y.d(w),e[5](null)}}}function m5(e,t,n){let r,o;qe(e,Z0,w=>n(0,r=w)),qe(e,H0,w=>n(1,o=w));let{$$slots:l={},$$scope:h}=t;function u(w){Li[w?"unshift":"push"](()=>{r=w,Z0.set(r)})}function y(w){Li[w?"unshift":"push"](()=>{o=w,H0.set(o)})}return e.$$set=w=>{"$$scope"in w&&n(2,h=w.$$scope)},[r,o,h,l,u,y]}class vy extends fn{constructor(t){super(),hn(this,t,m5,d5,en,{})}}let Z0=Jr(null),H0=Jr(null),jI="MZEJTanw3WpxRvt7qDfo",ts=Jr("title"),Jl=Jr(null),by=Jr(null),r0=Jr(!0),X0=Jr(!0);function g5(e){let t,n,r,o,l,h,u,y,w,S,C,P,F;return{c(){t=jt("div"),n=jt("h2"),n.textContent="Debug mode",r=fe(),o=jt("div"),l=jt("button"),l.textContent="Change study area",h=fe(),u=jt("button"),u.textContent="Route mode",y=fe(),w=jt("button"),w.textContent="Score mode",S=fe(),C=jt("p"),C.textContent="Hover to see a segment's properties, and click to open OSM",Wt(t,"slot","sidebar")},m(R,Y){Ut(R,t,Y),Gt(t,n),Gt(t,r),Gt(t,o),Gt(o,l),Gt(o,h),Gt(o,u),Gt(o,y),Gt(o,w),Gt(t,S),Gt(t,C),P||(F=[$e(l,"click",e[5]),$e(u,"click",e[6]),$e(w,"click",e[7])],P=!0)},p:ze,d(R){R&&Vt(t),P=!1,bi(F)}}}function y5(e){let t,n,r=e[8].kind+"",o,l,h,u;return h=new bP({props:{properties:e[8]}}),{c(){t=jt("h2"),n=Cn("Classified as "),o=Cn(r),l=fe(),Ae(h.$$.fragment)},m(y,w){Ut(y,t,w),Gt(t,n),Gt(t,o),Ut(y,l,w),Pe(h,y,w),u=!0},p(y,w){(!u||w&256)&&r!==(r=y[8].kind+"")&&Gi(o,r);const S={};w&256&&(S.properties=y[8]),h.$set(S)},i(y){u||(Rt(h.$$.fragment,y),u=!0)},o(y){Zt(h.$$.fragment,y),u=!1},d(y){y&&(Vt(t),Vt(l)),Me(h,y)}}}function _5(e){let t,n;return t=new CI({props:{openOn:"hover",$$slots:{default:[y5,({props:r})=>({8:r}),({props:r})=>r?256:0]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&768&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function v5(e){let t,n;return t=new Md({props:{id:"network",paint:{"line-width":Lb(5,7),"line-color":Iu(["get","kind"],$a,"yellow"),"line-opacity":e[0]?e[1]/100:Iu(["get","kind"],{Severance:0},e[1]/100)},manageHoverState:!0,hoverCursor:"pointer",$$slots:{default:[_5]},$$scope:{ctx:e}}}),t.$on("click",e[4]),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&3&&(l.paint={"line-width":Lb(5,7),"line-color":Iu(["get","kind"],$a,"yellow"),"line-opacity":r[0]?r[1]/100:Iu(["get","kind"],{Severance:0},r[1]/100)}),o&512&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function b5(e){let t,n,r;return n=new Mf({props:{data:JSON.parse(il(e[2]).render()),generateId:!0,$$slots:{default:[v5]},$$scope:{ctx:e}}}),{c(){t=jt("div"),Ae(n.$$.fragment),Wt(t,"slot","map")},m(o,l){Ut(o,t,l),Pe(n,t,null),r=!0},p(o,l){const h={};l&4&&(h.data=JSON.parse(il(o[2]).render())),l&515&&(h.$$scope={dirty:l,ctx:o}),n.$set(h)},i(o){r||(Rt(n.$$.fragment,o),r=!0)},o(o){Zt(n.$$.fragment,o),r=!1},d(o){o&&Vt(t),Me(n)}}}function x5(e){let t,n;return t=new vy({props:{$$slots:{map:[b5],sidebar:[g5]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,[o]){const l={};o&527&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function w5(e,t,n){let r,o;qe(e,Jl,C=>n(2,r=C)),qe(e,ts,C=>n(3,o=C));let{showSeverances:l}=t,{opacity:h}=t;const u=C=>window.open(il(C.detail.features[0].properties).way,"_blank"),y=()=>$n(ts,o="title",o),w=()=>$n(ts,o="route",o),S=()=>$n(ts,o="score",o);return e.$$set=C=>{"showSeverances"in C&&n(0,l=C.showSeverances),"opacity"in C&&n(1,h=C.opacity)},[l,h,r,o,u,y,w,S]}class S5 extends fn{constructor(t){super(),hn(this,t,w5,x5,en,{showSeverances:0,opacity:1})}}function N2(e,t,n){const r=e.slice();return r[2]=t[n],r}function O2(e){let t,n,r=z2(e[2])+"",o,l;return{c(){t=jt("li"),n=jt("a"),l=fe(),Wt(n,"href",o=il(e[2].properties).way),Wt(n,"target","_blank")},m(h,u){Ut(h,t,u),Gt(t,n),n.innerHTML=r,Gt(t,l)},p(h,u){u&1&&r!==(r=z2(h[2])+"")&&(n.innerHTML=r),u&1&&o!==(o=il(h[2].properties).way)&&Wt(n,"href",o)},d(h){h&&Vt(t)}}}function E5(e){let t,n,r,o=(e[0].route_length/e[0].direct_length).toFixed(1)+"",l,h,u,y,w,S=e[1](e[0])+"",C,P,F,R,Y=_o(e[0].features),J=[];for(let K=0;K{"route_gj"in l&&n(0,r=l.route_gj)},[r,o]}class C5 extends fn{constructor(t){super(),hn(this,t,I5,E5,en,{route_gj:0})}}function T5(e){let t,n;return t=new Md({props:{id:"network",paint:{"line-width":5,"line-color":Iu(["get","kind"],$a,"yellow"),"line-opacity":e[0]?e[1]/100:Iu(["get","kind"],{Severance:0},e[1]/100)}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&3&&(l.paint={"line-width":5,"line-color":Iu(["get","kind"],$a,"yellow"),"line-opacity":r[0]?r[1]/100:Iu(["get","kind"],{Severance:0},r[1]/100)}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function L5(e){let t,n;return t=new Mf({props:{data:JSON.parse(il(e[2]).render()),$$slots:{default:[T5]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,[o]){const l={};o&4&&(l.data=JSON.parse(il(r[2]).render())),o&11&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function P5(e,t,n){let r;qe(e,Jl,h=>n(2,r=h));let{showSeverances:o}=t,{opacity:l}=t;return e.$$set=h=>{"showSeverances"in h&&n(0,o=h.showSeverances),"opacity"in h&&n(1,l=h.opacity)},[o,l,r]}class WI extends fn{constructor(t){super(),hn(this,t,P5,L5,en,{showSeverances:0,opacity:1})}}function F2(e){let t,n;return{c(){t=jt("p"),n=Cn(e[5])},m(r,o){Ut(r,t,o),Gt(t,n)},p(r,o){o&32&&Gi(n,r[5])},d(r){r&&Vt(t)}}}function B2(e){let t,n;return t=new C5({props:{route_gj:e[4]}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&16&&(l.route_gj=r[4]),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function M5(e){let t,n,r,o,l,h,u,y,w,S,C,P,F,R,Y,J,K=e[5]&&F2(e),O=e[4]&&B2(e);return{c(){t=jt("div"),n=jt("h2"),n.textContent="Route mode",r=fe(),o=jt("div"),l=jt("button"),l.textContent="Change study area",h=fe(),u=jt("button"),u.textContent="Score mode",y=fe(),w=jt("button"),w.textContent="Debug OSM",S=fe(),C=jt("p"),C.innerHTML=`Move the A and B pins to find a walking route. (Hint: right-click + to set the first pin somewhere.)`,P=fe(),K&&K.c(),F=fe(),O&&O.c(),Wt(t,"slot","sidebar")},m(G,q){Ut(G,t,q),Gt(t,n),Gt(t,r),Gt(t,o),Gt(o,l),Gt(o,h),Gt(o,u),Gt(t,y),Gt(t,w),Gt(t,S),Gt(t,C),Gt(t,P),K&&K.m(t,null),Gt(t,F),O&&O.m(t,null),R=!0,Y||(J=[$e(l,"click",e[11]),$e(u,"click",e[12]),$e(w,"click",e[13])],Y=!0)},p(G,q){G[5]?K?K.p(G,q):(K=F2(G),K.c(),K.m(t,F)):K&&(K.d(1),K=null),G[4]?O?(O.p(G,q),q&16&&Rt(O,1)):(O=B2(G),O.c(),Rt(O,1),O.m(t,null)):O&&(sr(),Zt(O,1,1,()=>{O=null}),ar())},i(G){R||(Rt(O),R=!0)},o(G){Zt(O),R=!1},d(G){G&&Vt(t),K&&K.d(),O&&O.d(),Y=!1,bi(J)}}}function A5(e){let t;return{c(){t=jt("span"),t.textContent="A",Wt(t,"class","dot svelte-1ej0v4r")},m(n,r){Ut(n,t,r)},p:ze,d(n){n&&Vt(t)}}}function k5(e){let t;return{c(){t=jt("span"),t.textContent="B",Wt(t,"class","dot svelte-1ej0v4r")},m(n,r){Ut(n,t,r)},p:ze,d(n){n&&Vt(t)}}}function V2(e){let t,n;return t=new Mf({props:{data:e[4],$$slots:{default:[D5]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&16&&(l.data=r[4]),o&32768&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function D5(e){let t,n;return t=new Md({props:{id:"route",beforeId:"network",paint:{"line-width":20,"line-color":"cyan","line-opacity":.5}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p:ze,i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function R5(e){let t,n,r,o,l,h,u,y,w,S,C,P;n=new cS({}),n.$on("contextmenu",e[7]),o=new WI({props:{showSeverances:e[0],opacity:e[1]}});function F(O){e[9](O)}let R={draggable:!0,$$slots:{default:[A5]},$$scope:{ctx:e}};e[2]!==void 0&&(R.lngLat=e[2]),h=new Fb({props:R}),Li.push(()=>Pu(h,"lngLat",F));function Y(O){e[10](O)}let J={draggable:!0,$$slots:{default:[k5]},$$scope:{ctx:e}};e[3]!==void 0&&(J.lngLat=e[3]),w=new Fb({props:J}),Li.push(()=>Pu(w,"lngLat",Y));let K=e[4]&&V2(e);return{c(){t=jt("div"),Ae(n.$$.fragment),r=fe(),Ae(o.$$.fragment),l=fe(),Ae(h.$$.fragment),y=fe(),Ae(w.$$.fragment),C=fe(),K&&K.c(),Wt(t,"slot","map")},m(O,G){Ut(O,t,G),Pe(n,t,null),Gt(t,r),Pe(o,t,null),Gt(t,l),Pe(h,t,null),Gt(t,y),Pe(w,t,null),Gt(t,C),K&&K.m(t,null),P=!0},p(O,G){const q={};G&1&&(q.showSeverances=O[0]),G&2&&(q.opacity=O[1]),o.$set(q);const ot={};G&32768&&(ot.$$scope={dirty:G,ctx:O}),!u&&G&4&&(u=!0,ot.lngLat=O[2],Lu(()=>u=!1)),h.$set(ot);const _t={};G&32768&&(_t.$$scope={dirty:G,ctx:O}),!S&&G&8&&(S=!0,_t.lngLat=O[3],Lu(()=>S=!1)),w.$set(_t),O[4]?K?(K.p(O,G),G&16&&Rt(K,1)):(K=V2(O),K.c(),Rt(K,1),K.m(t,null)):K&&(sr(),Zt(K,1,1,()=>{K=null}),ar())},i(O){P||(Rt(n.$$.fragment,O),Rt(o.$$.fragment,O),Rt(h.$$.fragment,O),Rt(w.$$.fragment,O),Rt(K),P=!0)},o(O){Zt(n.$$.fragment,O),Zt(o.$$.fragment,O),Zt(h.$$.fragment,O),Zt(w.$$.fragment,O),Zt(K),P=!1},d(O){O&&Vt(t),Me(n),Me(o),Me(h),Me(w),K&&K.d()}}}function N5(e){let t,n;return t=new vy({props:{$$slots:{map:[R5],sidebar:[M5]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,[o]){const l={};o&32895&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function og(e,t,n){return t+e*(n-t)}function O5(e,t,n){let r,o;qe(e,Jl,O=>n(8,r=O)),qe(e,ts,O=>n(6,o=O));let{showSeverances:l}=t,{opacity:h}=t,u=Array.from(r.getBounds()),y={lng:og(.4,u[0],u[2]),lat:og(.4,u[1],u[3])},w={lng:og(.6,u[0],u[2]),lat:og(.6,u[1],u[3])},S=null,C="";function P(O){n(2,y=O.detail.lngLat)}function F(O){y=O,n(2,y)}function R(O){w=O,n(3,w)}const Y=()=>$n(ts,o="title",o),J=()=>$n(ts,o="score",o),K=()=>$n(ts,o="debug",o);return e.$$set=O=>{"showSeverances"in O&&n(0,l=O.showSeverances),"opacity"in O&&n(1,h=O.opacity)},e.$$.update=()=>{if(e.$$.dirty&268&&y&&w)try{n(4,S=JSON.parse(r.compareRoute({x1:y.lng,y1:y.lat,x2:w.lng,y2:w.lat}))),n(5,C="")}catch(O){n(4,S=null),n(5,C=O.toString())}},[l,h,y,w,S,C,o,P,r,F,R,Y,J,K]}class z5 extends fn{constructor(t){super(),hn(this,t,O5,N5,en,{showSeverances:0,opacity:1})}}function F5(e){let t,n,r,o,l,h,u,y,w,S,C,P,F,R,Y,J;return F=new IP({props:{colorScale:dS,limits:mS}}),{c(){t=jt("div"),n=jt("h2"),n.textContent="Score mode",r=fe(),o=jt("div"),l=jt("button"),l.textContent="Change study area",h=fe(),u=jt("button"),u.textContent="Route mode",y=fe(),w=jt("button"),w.textContent="Debug OSM",S=fe(),C=jt("p"),C.innerHTML=`The desire lines are coloured based on their detour factor. Click one + to see the route`,P=fe(),Ae(F.$$.fragment),Wt(t,"slot","sidebar")},m(K,O){Ut(K,t,O),Gt(t,n),Gt(t,r),Gt(t,o),Gt(o,l),Gt(o,h),Gt(o,u),Gt(t,y),Gt(t,w),Gt(t,S),Gt(t,C),Gt(t,P),Pe(F,t,null),R=!0,Y||(J=[$e(l,"click",e[7]),$e(u,"click",e[8]),$e(w,"click",e[9])],Y=!0)},p:ze,i(K){R||(Rt(F.$$.fragment,K),R=!0)},o(K){Zt(F.$$.fragment,K),R=!1},d(K){K&&Vt(t),Me(F),Y=!1,bi(J)}}}function B5(e){let t,n=e[11].score.toFixed(1)+"",r,o;return{c(){t=jt("span"),r=Cn(n),o=Cn("x"),ai(t,"font-size","26px")},m(l,h){Ut(l,t,h),Gt(t,r),Gt(t,o)},p(l,h){h&2048&&n!==(n=l[11].score.toFixed(1)+"")&&Gi(r,n)},d(l){l&&Vt(t)}}}function V5(e){let t,n;return t=new CI({props:{openOn:"hover",$$slots:{default:[B5,({props:r})=>({11:r}),({props:r})=>r?2048:0]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&6144&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function U5(e){let t,n;return t=new Md({props:{id:"scores",paint:{"line-width":8,"line-color":FN(["get","score"],mS,dS)},$$slots:{default:[V5]},$$scope:{ctx:e}}}),t.$on("click",e[5]),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&4096&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function U2(e){let t,n;return t=new Mf({props:{data:e[2],$$slots:{default:[G5]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&4&&(l.data=r[2]),o&4096&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function G5(e){let t,n;return t=new Md({props:{id:"route",beforeId:"network",paint:{"line-width":20,"line-color":"cyan","line-opacity":.5}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p:ze,i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function q5(e){let t,n,r,o,l,h,u,y;n=new cS({}),n.$on("click",e[6]),o=new WI({props:{showSeverances:e[0],opacity:e[1]}}),h=new Mf({props:{data:JSON.parse(il(e[3]).makeHeatmap()),$$slots:{default:[U5]},$$scope:{ctx:e}}});let w=e[2]&&U2(e);return{c(){t=jt("div"),Ae(n.$$.fragment),r=fe(),Ae(o.$$.fragment),l=fe(),Ae(h.$$.fragment),u=fe(),w&&w.c(),Wt(t,"slot","map")},m(S,C){Ut(S,t,C),Pe(n,t,null),Gt(t,r),Pe(o,t,null),Gt(t,l),Pe(h,t,null),Gt(t,u),w&&w.m(t,null),y=!0},p(S,C){const P={};C&1&&(P.showSeverances=S[0]),C&2&&(P.opacity=S[1]),o.$set(P);const F={};C&8&&(F.data=JSON.parse(il(S[3]).makeHeatmap())),C&4096&&(F.$$scope={dirty:C,ctx:S}),h.$set(F),S[2]?w?(w.p(S,C),C&4&&Rt(w,1)):(w=U2(S),w.c(),Rt(w,1),w.m(t,null)):w&&(sr(),Zt(w,1,1,()=>{w=null}),ar())},i(S){y||(Rt(n.$$.fragment,S),Rt(o.$$.fragment,S),Rt(h.$$.fragment,S),Rt(w),y=!0)},o(S){Zt(n.$$.fragment,S),Zt(o.$$.fragment,S),Zt(h.$$.fragment,S),Zt(w),y=!1},d(S){S&&Vt(t),Me(n),Me(o),Me(h),w&&w.d()}}}function j5(e){let t,n;return t=new vy({props:{$$slots:{map:[q5],sidebar:[F5]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,[o]){const l={};o&4127&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function W5(e,t,n){let r,o,l;qe(e,by,R=>n(10,r=R)),qe(e,Jl,R=>n(3,o=R)),qe(e,ts,R=>n(4,l=R));let{showSeverances:h}=t,{opacity:u}=t,y=null;function w(R){try{let Y=R.detail.features[0].geometry.coordinates;n(2,y=JSON.parse(o.compareRoute({x1:Y[0][0],y1:Y[0][1],x2:Y[1][0],y2:Y[1][1]})))}catch(Y){window.alert(`No route: ${Y}`),n(2,y=null)}}function S(R){r.queryRenderedFeatures(R.detail.point,{layers:["scores"]}).length>0||n(2,y=null)}const C=()=>$n(ts,l="title",l),P=()=>$n(ts,l="route",l),F=()=>$n(ts,l="debug",l);return e.$$set=R=>{"showSeverances"in R&&n(0,h=R.showSeverances),"opacity"in R&&n(1,u=R.opacity)},[h,u,y,o,l,w,S,C,P,F]}class Z5 extends fn{constructor(t){super(),hn(this,t,W5,j5,en,{showSeverances:0,opacity:1})}}function H5(e){let t,n,r,o,l,h,u;return{c(){t=jt("button"),t.textContent="Import current view",n=fe(),r=jt("i"),r.textContent="or...",o=fe(),l=jt("button"),l.textContent="Draw an area to import on the map",Wt(t,"type","button"),Wt(l,"type","button")},m(y,w){Ut(y,t,w),Ut(y,n,w),Ut(y,r,w),Ut(y,o,w),Ut(y,l,w),h||(u=[$e(t,"click",e[1]),$e(l,"click",e[2])],h=!0)},p:ze,i:ze,o:ze,d(y){y&&(Vt(t),Vt(n),Vt(r),Vt(o),Vt(l)),h=!1,bi(u)}}}function X5(e){let t,n;return t=new kO({props:{polygonTool:e[0]}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&1&&(l.polygonTool=r[0]),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function Y5(e){let t,n,r,o;const l=[X5,H5],h=[];function u(y,w){return y[0]?0:1}return t=u(e),n=h[t]=l[t](e),{c(){n.c(),r=Co()},m(y,w){h[t].m(y,w),Ut(y,r,w),o=!0},p(y,[w]){let S=t;t=u(y),t===S?h[t].p(y,w):(sr(),Zt(h[S],1,1,()=>{h[S]=null}),ar(),n=h[t],n?n.p(y,w):(n=h[t]=l[t](y),n.c()),Rt(n,1),n.m(r.parentNode,r))},i(y){o||(Rt(n),o=!0)},o(y){Zt(n),o=!1},d(y){y&&Vt(r),h[t].d(y)}}}function Hp(e){return[e.lng,e.lat]}function K5(e,t,n){let{map:r}=t;const o=Vu();let l=null;async function h(S){try{o("loading","Loading from Overpass");let P=await(await fetch(Q5(S))).text();o("gotXml",P)}catch(C){o("error",C.toString())}}function u(){let S=r.getBounds();return{type:"Feature",properties:{},geometry:{coordinates:[[Hp(S.getSouthWest()),Hp(S.getNorthWest()),Hp(S.getNorthEast()),Hp(S.getSouthEast()),Hp(S.getSouthWest())]],type:"Polygon"}}}async function y(){if(r){if(r.getZoom()<13){o("error","Zoom in more to import");return}await h(u())}}function w(){r&&(n(0,l=new TO(r)),l.startNew(),l.addEventListenerSuccess(async S=>{n(0,l=null),await h(S)}),l.addEventListenerFailure(()=>{n(0,l=null)}))}return e.$$set=S=>{"map"in S&&n(3,r=S.map)},[l,y,w,r]}class J5 extends fn{constructor(t){super(),hn(this,t,K5,Y5,en,{map:3})}}function Q5(e){let t='poly:"';for(let[r,o]of e.geometry.coordinates[0])t+=`${o} ${r} `;return t=t.slice(0,-1)+'"',`https://overpass-api.de/api/interpreter?data=${`(nwr(${t}); node(w)->.x; <;); out meta;`}`}function G2(e,t,n){const r=e.slice();return r[17]=t[n][0],r[18]=t[n][1],r}function q2(e,t,n){const r=e.slice();return r[21]=t[n][0],r[22]=t[n][1],r}function j2(e){let t,n=e[22]+"",r,o;return{c(){t=jt("option"),r=Cn(n),t.__value=o=e[21],wc(t,t.__value)},m(l,h){Ut(l,t,h),Gt(t,r)},p(l,h){h&4&&n!==(n=l[22]+"")&&Gi(r,n),h&4&&o!==(o=l[21])&&(t.__value=o,wc(t,t.__value))},d(l){l&&Vt(t)}}}function W2(e){let t,n,r=_o(e[18]),o=[];for(let l=0;le[7].call(h)),Wt(R,"type","file")},m(ct,ht){Pe(t,ct,ht),Ut(ct,n,ht),Ut(ct,r,ht),Gt(r,o),Gt(o,l),Gt(o,h),Gt(h,u);for(let Pt=0;Ptn(12,r=q)),qe(e,Jl,q=>n(13,o=q)),qe(e,by,q=>n(4,l=q));let h="",u="",y=!1,w=[];Y0(async()=>{try{let q=await fetch("/osm/areas.json");if(q.ok)y=!0,console.log("Using local cache, not od2net.org"),n(2,w=await q.json());else{let ot=await fetch("https://assets.od2net.org/severance_pbfs/areas.json");n(2,w=await ot.json())}}catch{}});let S;async function C(q){try{P(await S.files[0].arrayBuffer()),n(0,h="")}catch(ot){window.alert(`Couldn't open this file: ${ot}`)}n(1,u="")}function P(q){n(1,u="Building map model from OSM input"),console.time("load"),$n(Jl,o=new rL(new Uint8Array(q),r),o),console.timeEnd("load")}function F(q){try{P(new TextEncoder().encode(q.detail)),n(0,h="")}catch(ot){window.alert(`Couldn't import from Overpass: ${ot}`)}n(1,u="")}async function R(q){q!=""&&(y?await Y(`/osm/${q}.pbf`):await Y(`https://assets.od2net.org/severance_pbfs/${q}.pbf`))}async function Y(q){try{n(1,u=`Downloading ${q}`);let ot=await fetch(q);P(await ot.arrayBuffer())}catch(ot){window.alert(`Couldn't open from URL ${q}: ${ot}`)}n(1,u="")}function J(){h=WT(this),n(0,h),n(2,w)}function K(q){Li[q?"unshift":"push"](()=>{S=q,n(3,S)})}const O=q=>n(1,u=q.detail),G=q=>window.alert(q.detail);return e.$$.update=()=>{e.$$.dirty&1&&R(h)},[h,u,w,S,l,C,F,J,K,O,G]}class ez extends fn{constructor(t){super(),hn(this,t,tz,$5,en,{})}}function Z2(e){let t,n;return t=new yP({props:{$$slots:{default:[nz,({dialog:r})=>({9:r}),({dialog:r})=>r?512:0]},$$scope:{ctx:e}}}),t.$on("close",e[5]),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&1536&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function nz(e){let t,n,r,o,l,h,u,y,w,S,C,P,F,R,Y,J,K,O,G,q,ot,_t;function ft(){return e[4](e[9])}return{c(){t=jt("h1"),t.textContent="Severance Snape",n=fe(),r=jt("p"),r.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!`,o=fe(),l=jt("p"),l.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.`,h=fe(),u=jt("p"),u.innerHTML=`This tool is experimental, so there will be bugs both with OSM + data and what the tool shows!`,y=fe(),w=jt("p"),w.textContent="To use this tool, you need to:",S=fe(),C=jt("ol"),C.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
  • `,P=fe(),F=jt("p"),F.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.`,R=fe(),Y=jt("p"),Y.innerHTML=`This open source + tool is created by + Dustin Carlino + and relies heavily on + OpenStreetMap data.`,J=fe(),K=jt("details"),K.innerHTML='Changelog

    GitHub has more detail; this is a summary

    • 17 February - use Pico for styling
    • 21 January - fix shortest route calculations
    ',O=fe(),G=jt("center"),q=jt("button"),q.textContent="Start!"},m(ct,ht){Ut(ct,t,ht),Ut(ct,n,ht),Ut(ct,r,ht),Ut(ct,o,ht),Ut(ct,l,ht),Ut(ct,h,ht),Ut(ct,u,ht),Ut(ct,y,ht),Ut(ct,w,ht),Ut(ct,S,ht),Ut(ct,C,ht),Ut(ct,P,ht),Ut(ct,F,ht),Ut(ct,R,ht),Ut(ct,Y,ht),Ut(ct,J,ht),Ut(ct,K,ht),Ut(ct,O,ht),Ut(ct,G,ht),Gt(G,q),ot||(_t=$e(q,"click",ft),ot=!0)},p(ct,ht){e=ct},d(ct){ct&&(Vt(t),Vt(n),Vt(r),Vt(o),Vt(l),Vt(h),Vt(u),Vt(y),Vt(w),Vt(S),Vt(C),Vt(P),Vt(F),Vt(R),Vt(Y),Vt(J),Vt(K),Vt(O),Vt(G)),ot=!1,_t()}}}function rz(e){let t;return{c(){t=jt("p"),t.textContent="Waiting for MapLibre and WASM to load..."},m(n,r){Ut(n,t,r)},i:ze,o:ze,d(n){n&&Vt(t)}}}function iz(e){let t,n;return t=new ez({}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function oz(e){let t,n,r,o,l,h,u,y,w,S,C,P,F,R,Y,J,K,O,G,q,ot=e[1]&&Z2(e);const _t=[iz,rz],ft=[];function ct(ht,Pt){return ht[2]&&ht[0]?0:1}return w=ct(e),S=ft[w]=_t[w](e),{c(){t=jt("div"),ot&&ot.c(),n=fe(),r=jt("h2"),r.textContent="Choose your study area",o=fe(),l=jt("button"),l.textContent="About this tool",h=fe(),u=jt("hr"),y=fe(),S.c(),C=fe(),P=jt("div"),F=jt("label"),R=jt("input"),Y=Cn(` + 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 + `),J=jt("a"),J.textContent="separate ways",K=Cn(". Disable this in those places.)"),Wt(R,"type","checkbox"),Wt(J,"href","https://wiki.openstreetmap.org/wiki/Sidewalks#Sidewalk_as_separate_way"),Wt(J,"target","_blank"),Wt(t,"slot","sidebar")},m(ht,Pt){Ut(ht,t,Pt),ot&&ot.m(t,null),Gt(t,n),Gt(t,r),Gt(t,o),Gt(t,l),Gt(t,h),Gt(t,u),Gt(t,y),ft[w].m(t,null),Gt(t,C),Gt(t,P),Gt(P,F),Gt(F,R),R.checked=e[3],Gt(F,Y),Gt(F,J),Gt(F,K),O=!0,G||(q=[$e(l,"click",e[6]),$e(R,"change",e[7])],G=!0)},p(ht,Pt){ht[1]?ot?(ot.p(ht,Pt),Pt&2&&Rt(ot,1)):(ot=Z2(ht),ot.c(),Rt(ot,1),ot.m(t,n)):ot&&(sr(),Zt(ot,1,1,()=>{ot=null}),ar());let $=w;w=ct(ht),w!==$&&(sr(),Zt(ft[$],1,1,()=>{ft[$]=null}),ar(),S=ft[w],S||(S=ft[w]=_t[w](ht),S.c()),Rt(S,1),S.m(t,C)),Pt&8&&(R.checked=ht[3])},i(ht){O||(Rt(ot),Rt(S),O=!0)},o(ht){Zt(ot),Zt(S),O=!1},d(ht){ht&&Vt(t),ot&&ot.d(),ft[w].d(),G=!1,bi(q)}}}function sz(e){let t,n,r;return n=new qI({}),{c(){t=jt("div"),Ae(n.$$.fragment),Wt(t,"slot","map")},m(o,l){Ut(o,t,l),Pe(n,t,null),r=!0},p:ze,i(o){r||(Rt(n.$$.fragment,o),r=!0)},o(o){Zt(n.$$.fragment,o),r=!1},d(o){o&&Vt(t),Me(n)}}}function az(e){let t,n;return t=new vy({props:{$$slots:{map:[sz],sidebar:[oz]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,[o]){const l={};o&1039&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function lz(e,t,n){let r,o,l,h;qe(e,Jl,P=>n(8,r=P)),qe(e,r0,P=>n(1,o=P)),qe(e,by,P=>n(2,l=P)),qe(e,X0,P=>n(3,h=P));let{wasmReady:u}=t;$n(Jl,r=null,r);const y=P=>il(P).close(),w=()=>$n(r0,o=!1,o),S=()=>$n(r0,o=!0,o);function C(){h=this.checked,X0.set(h)}return e.$$set=P=>{"wasmReady"in P&&n(0,u=P.wasmReady)},[u,o,l,h,y,w,S,C]}class uz extends fn{constructor(t){super(),hn(this,t,lz,az,en,{wasmReady:0})}}function H2(e){let t,n,r,o,l,h,u,y,w,S,C,P,F,R,Y,J,K,O,G;return h=new cP({props:{rows:[["Footway (ground, outdoors)",$a.Footway],["Indoors footway",$a.Indoors],["Footway not on the ground",$a.BridgeOrTunnel],["Street with vehicle traffic (maybe with a sidewalk, maybe not)",$a.WithTraffic],["Crossing",$a.Crossing],["Severance",$a.Severance]]}}),{c(){t=jt("hr"),n=fe(),r=jt("div"),o=jt("button"),o.textContent="Zoom to fit",l=fe(),Ae(h.$$.fragment),u=fe(),y=jt("div"),w=jt("label"),S=jt("input"),C=Cn(` + Show severances`),P=fe(),F=jt("div"),R=jt("label"),Y=Cn(`Network opacity: + `),J=jt("input"),Wt(S,"type","checkbox"),Wt(J,"type","range"),Wt(J,"min","0"),Wt(J,"max","100")},m(q,ot){Ut(q,t,ot),Ut(q,n,ot),Ut(q,r,ot),Gt(r,o),Ut(q,l,ot),Pe(h,q,ot),Ut(q,u,ot),Ut(q,y,ot),Gt(y,w),Gt(w,S),S.checked=e[6],Gt(w,C),Ut(q,P,ot),Ut(q,F,ot),Gt(F,R),Gt(R,Y),Gt(R,J),wc(J,e[5]),K=!0,O||(G=[$e(o,"click",e[8]),$e(S,"change",e[14]),$e(J,"change",e[15]),$e(J,"input",e[15])],O=!0)},p(q,ot){ot&64&&(S.checked=q[6]),ot&32&&wc(J,q[5])},i(q){K||(Rt(h.$$.fragment,q),K=!0)},o(q){Zt(h.$$.fragment,q),K=!1},d(q){q&&(Vt(t),Vt(n),Vt(r),Vt(l),Vt(u),Vt(y),Vt(P),Vt(F)),Me(h,q),O=!1,bi(G)}}}function cz(e){let t,n,r,o,l,h,u=e[7]!="title"&&H2(e);return{c(){t=jt("div"),n=jt("h1"),n.textContent="Severance Snape",r=fe(),o=jt("div"),l=fe(),u&&u.c(),Wt(t,"slot","left")},m(y,w){Ut(y,t,w),Gt(t,n),Gt(t,r),Gt(t,o),e[13](o),Gt(t,l),u&&u.m(t,null),h=!0},p(y,w){y[7]!="title"?u?(u.p(y,w),w&128&&Rt(u,1)):(u=H2(y),u.c(),Rt(u,1),u.m(t,null)):u&&(sr(),Zt(u,1,1,()=>{u=null}),ar())},i(y){h||(Rt(u),h=!0)},o(y){Zt(u),h=!1},d(y){y&&Vt(t),e[13](null),u&&u.d()}}}function X2(e){let t,n;return t=new uz({props:{wasmReady:e[4]}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&16&&(l.wasmReady=r[4]),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function Y2(e){let t,n,r,o,l,h;t=new Mf({props:{data:JSON.parse(e[3].getInvertedBoundary()),$$slots:{default:[hz]},$$scope:{ctx:e}}});const u=[dz,pz,fz],y=[];function w(S,C){return S[7]=="route"?0:S[7]=="score"?1:S[7]=="debug"?2:-1}return~(r=w(e))&&(o=y[r]=u[r](e)),{c(){Ae(t.$$.fragment),n=fe(),o&&o.c(),l=Co()},m(S,C){Pe(t,S,C),Ut(S,n,C),~r&&y[r].m(S,C),Ut(S,l,C),h=!0},p(S,C){const P={};C&8&&(P.data=JSON.parse(S[3].getInvertedBoundary())),C&131072&&(P.$$scope={dirty:C,ctx:S}),t.$set(P);let F=r;r=w(S),r===F?~r&&y[r].p(S,C):(o&&(sr(),Zt(y[F],1,1,()=>{y[F]=null}),ar()),~r?(o=y[r],o?o.p(S,C):(o=y[r]=u[r](S),o.c()),Rt(o,1),o.m(l.parentNode,l)):o=null)},i(S){h||(Rt(t.$$.fragment,S),Rt(o),h=!0)},o(S){Zt(t.$$.fragment,S),Zt(o),h=!1},d(S){S&&(Vt(n),Vt(l)),Me(t,S),~r&&y[r].d(S)}}}function hz(e){let t,n;return t=new wL({props:{paint:{"fill-color":"black","fill-opacity":.3}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p:ze,i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function fz(e){let t,n;return t=new S5({props:{showSeverances:e[6],opacity:e[5]}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&64&&(l.showSeverances=r[6]),o&32&&(l.opacity=r[5]),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function pz(e){let t,n;return t=new Z5({props:{showSeverances:e[6],opacity:e[5]}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&64&&(l.showSeverances=r[6]),o&32&&(l.opacity=r[5]),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function dz(e){let t,n;return t=new z5({props:{showSeverances:e[6],opacity:e[5]}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,o){const l={};o&64&&(l.showSeverances=r[6]),o&32&&(l.opacity=r[5]),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function mz(e){let t,n,r,o,l,h,u,y,w;t=new IN({props:{map:e[0],apiKey:jI}}),l=new qI({});let S=e[7]=="title"&&X2(e),C=e[3]&&Y2(e);return{c(){Ae(t.$$.fragment),n=fe(),r=jt("div"),o=fe(),Ae(l.$$.fragment),h=fe(),S&&S.c(),u=fe(),C&&C.c(),y=Co()},m(P,F){Pe(t,P,F),Ut(P,n,F),Ut(P,r,F),e[11](r),Ut(P,o,F),Pe(l,P,F),Ut(P,h,F),S&&S.m(P,F),Ut(P,u,F),C&&C.m(P,F),Ut(P,y,F),w=!0},p(P,F){const R={};F&1&&(R.map=P[0]),t.$set(R),P[7]=="title"?S?(S.p(P,F),F&128&&Rt(S,1)):(S=X2(P),S.c(),Rt(S,1),S.m(u.parentNode,u)):S&&(sr(),Zt(S,1,1,()=>{S=null}),ar()),P[3]?C?(C.p(P,F),F&8&&Rt(C,1)):(C=Y2(P),C.c(),Rt(C,1),C.m(y.parentNode,y)):C&&(sr(),Zt(C,1,1,()=>{C=null}),ar())},i(P){w||(Rt(t.$$.fragment,P),Rt(l.$$.fragment,P),Rt(S),Rt(C),w=!0)},o(P){Zt(t.$$.fragment,P),Zt(l.$$.fragment,P),Zt(S),Zt(C),w=!1},d(P){P&&(Vt(n),Vt(r),Vt(o),Vt(h),Vt(u),Vt(y)),Me(t,P),e[11](null),Me(l,P),S&&S.d(P),C&&C.d(P)}}}function gz(e){let t,n,r,o;function l(u){e[12](u)}let h={style:`https://api.maptiler.com/maps/dataviz/style.json?key=${jI}`,standardControls:!0,hash:!0,$$slots:{default:[mz]},$$scope:{ctx:e}};return e[0]!==void 0&&(h.map=e[0]),n=new HL({props:h}),Li.push(()=>Pu(n,"map",l)),{c(){t=jt("div"),Ae(n.$$.fragment),Wt(t,"slot","main"),ai(t,"position","relative"),ai(t,"width","100%"),ai(t,"height","100vh")},m(u,y){Ut(u,t,y),Pe(n,t,null),o=!0},p(u,y){const w={};y&131325&&(w.$$scope={dirty:y,ctx:u}),!r&&y&1&&(r=!0,w.map=u[0],Lu(()=>r=!1)),n.$set(w)},i(u){o||(Rt(n.$$.fragment,u),o=!0)},o(u){Zt(n.$$.fragment,u),o=!1},d(u){u&&Vt(t),Me(n)}}}function yz(e){let t,n;return t=new h5({props:{$$slots:{main:[gz],left:[cz]},$$scope:{ctx:e}}}),{c(){Ae(t.$$.fragment)},m(r,o){Pe(t,r,o),n=!0},p(r,[o]){const l={};o&131327&&(l.$$scope={dirty:o,ctx:r}),t.$set(l)},i(r){n||(Rt(t.$$.fragment,r),n=!0)},o(r){Zt(t.$$.fragment,r),n=!1},d(r){Me(t,r)}}}function _z(e,t,n){let r,o,l,h;qe(e,H0,q=>n(9,r=q)),qe(e,Z0,q=>n(10,o=q)),qe(e,Jl,q=>n(3,l=q)),qe(e,ts,q=>n(7,h=q));let u=!1;Y0(async()=>{await sS(),n(4,u=!0)});let y,w=100,S=!0;function C(){y&&l&&y.fitBounds(Array.from(l.getBounds()),{animate:!1})}function P(q){l&&(console.log("New map model loaded"),C(),$n(ts,h="route",h))}let F,R;function Y(q){Li[q?"unshift":"push"](()=>{R=q,n(2,R),n(9,r)})}function J(q){y=q,n(0,y)}function K(q){Li[q?"unshift":"push"](()=>{F=q,n(1,F),n(10,o)})}function O(){S=this.checked,n(6,S)}function G(){w=qT(this.value),n(5,w)}return e.$$.update=()=>{e.$$.dirty&1&&y&&by.set(y),e.$$.dirty&8&&P(),e.$$.dirty&1026&&F&&o&&(n(1,F.innerHTML="",F),F.appendChild(o)),e.$$.dirty&516&&R&&r&&(n(2,R.innerHTML="",R),R.appendChild(r))},[y,F,R,l,u,w,S,h,C,r,o,Y,J,K,O,G]}class vz extends fn{constructor(t){super(),hn(this,t,_z,yz,en,{})}}new vz({target:document.getElementById("app")}); diff --git a/assets/main-44c9753c.js b/assets/main-44c9753c.js deleted file mode 100644 index a9814f7..0000000 --- a/assets/main-44c9753c.js +++ /dev/null @@ -1,643 +0,0 @@ -var R2=Object.defineProperty;var N2=(t,e,n)=>e in t?R2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var cr=(t,e,n)=>(N2(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 f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).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 Oe(){}function z2(t,e){for(const n in e)t[n]=e[n];return t}function $1(t){return t()}function Y0(){return Object.create(null)}function yr(t){t.forEach($1)}function Dm(t){return typeof t=="function"}function en(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let nm;function go(t,e){return t===e?!0:(nm||(nm=document.createElement("a")),nm.href=e,t===nm.href)}function O2(t){return Object.keys(t).length===0}function tx(t,...e){if(t==null){for(const i of e)i(void 0);return Oe}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function ex(t){let e;return tx(t,n=>e=n)(),e}function qe(t,e,n){t.$$.on_destroy.push(tx(e,n))}function wr(t,e,n,i){if(t){const s=nx(t,e,n,i);return t[0](s)}}function nx(t,e,n,i){return t[1]&&i?z2(n.ctx.slice(),t[1](i(e))):n.ctx}function Sr(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=[],f=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 V2(t){return function(e){return e.preventDefault(),t.call(this,e)}}function r_(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function Zt(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function U2(t){return t===""?null:+t}function G2(t){return Array.from(t.childNodes)}function Br(t,e){e=""+e,t.data!==e&&(t.data=e)}function tc(t,e){t.value=e??""}function or(t,e,n,i){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function K0(t,e,n){for(let i=0;i{const s=t.$$.callbacks[e];if(s){const c=j2(e,n,{cancelable:i});return s.slice().forEach(f=>{f.call(t,c)}),!c.defaultPrevented}return!0}}function G_(t,e){return Bp().$$.context.set(t,e),e}function q_(t){return Bp().$$.context.get(t)}function Nn(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(i=>i.call(this,e))}const wh=[],Cr=[];let Ch=[];const __=[],ix=Promise.resolve();let y_=!1;function rx(){y_||(y_=!0,ix.then(sx))}function ox(){return rx(),ix}function _m(t){Ch.push(t)}function cu(t){__.push(t)}const o_=new Set;let yh=0;function sx(){if(yh!==0)return;const t=xp;do{try{for(;yht.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),Ch=e}const fm=new Set;let Ju;function ri(){Ju={r:0,c:[],p:Ju}}function oi(){Ju.r||yr(Ju.c),Ju=Ju.p}function Rt(t,e){t&&t.i&&(fm.delete(t),t.i(e))}function Wt(t,e,n,i){if(t&&t.o){if(fm.has(t))return;fm.add(t),Ju.c.push(()=>{fm.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}function po(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function H2(t,e){Wt(t,1,1,()=>{e.delete(t.key)})}function X2(t,e,n,i,s,c,f,u,v,w,I,L){let A=t.length,U=c.length,z=A;const K={};for(;z--;)K[t[z].key]=z;const J=[],Q=new Map,O=new Map,G=[];for(z=U;z--;){const dt=L(s,c,z),ht=n(dt);let ct=f.get(ht);ct?i&&G.push(()=>ct.p(dt,e)):(ct=w(ht,dt),ct.c()),Q.set(ht,J[z]=ct),ht in K&&O.set(ht,Math.abs(z-K[ht]))}const j=new Set,lt=new Set;function xt(dt){Rt(dt,1),dt.m(u,I),f.set(dt.key,dt),I=dt.first,U--}for(;A&&U;){const dt=J[U-1],ht=t[A-1],ct=dt.key,Pt=ht.key;dt===ht?(I=dt.first,A--,U--):Q.has(Pt)?!f.has(ct)||j.has(ct)?xt(dt):lt.has(Pt)?A--:O.get(ct)>O.get(Pt)?(lt.add(ct),xt(dt)):(j.add(Pt),A--):(v(ht,f),A--)}for(;A--;){const dt=t[A];Q.has(dt.key)||v(dt,f)}for(;U;)xt(J[U-1]);return yr(G),J}function hu(t,e,n){const i=t.$$.props[e];i!==void 0&&(t.$$.bound[i]=n,n(t.$$.ctx[i]))}function Ae(t){t&&t.c()}function Me(t,e,n){const{fragment:i,after_update:s}=t.$$;i&&i.m(e,n),_m(()=>{const c=t.$$.on_mount.map($1).filter(Dm);t.$$.on_destroy?t.$$.on_destroy.push(...c):yr(c),t.$$.on_mount=[]}),s.forEach(_m)}function Pe(t,e){const n=t.$$;n.fragment!==null&&(W2(n.after_update),yr(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Y2(t,e){t.$$.dirty[0]===-1&&(wh.push(t),rx(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const z=U.length?U[0]:A;return w.ctx&&s(w.ctx[L],w.ctx[L]=z)&&(!w.skip_bound&&w.bound[L]&&w.bound[L](z),I&&Y2(t,L)),A}):[],w.update(),I=!0,yr(w.before_update),w.fragment=i?i(w.ctx):!1,e.target){if(e.hydrate){const L=G2(e.target);w.fragment&&w.fragment.l(L),L.forEach(Vt)}else w.fragment&&w.fragment.c();e.intro&&Rt(t.$$.fragment),Me(t,e.target,e.anchor),sx()}mp(v)}class fn{constructor(){cr(this,"$$");cr(this,"$$set")}$destroy(){Pe(this,1),this.$destroy=Oe}$on(e,n){if(!Dm(n))return Oe;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&&!O2(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const K2="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(K2);let bn;const ax=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&ax.decode();let cp=null;function gp(){return(cp===null||cp.byteLength===0)&&(cp=new Uint8Array(bn.memory.buffer)),cp}function ou(t,e){return t=t>>>0,ax.decode(gp().subarray(t,t+e))}const bl=new Array(128).fill(void 0);bl.push(void 0,null,!0,!1);let _p=bl.length;function xl(t){_p===bl.length&&bl.push(bl.length+1);const e=_p;return _p=bl[e],bl[e]=t,e}function ii(t){return bl[t]}function J2(t){t<132||(bl[t]=_p,_p=t)}function Sh(t){const e=ii(t);return J2(t),e}function s_(t){return t==null}let hp=null;function lx(){return(hp===null||hp.byteLength===0)&&(hp=new Float64Array(bn.memory.buffer)),hp}let fp=null;function Kn(){return(fp===null||fp.byteLength===0)&&(fp=new Int32Array(bn.memory.buffer)),fp}let Qu=0;const pm=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Q2=typeof pm.encodeInto=="function"?function(t,e){return pm.encodeInto(t,e)}:function(t,e){const n=pm.encode(t);return e.set(n),{read:t.length,written:n.length}};function a_(t,e,n){if(n===void 0){const u=pm.encode(t),v=e(u.length,1)>>>0;return gp().subarray(v,v+u.length).set(u),Qu=u.length,v}let i=t.length,s=e(i,1)>>>0;const c=gp();let f=0;for(;f127)break;c[s+f]=u}if(f!==i){f!==0&&(t=t.slice(f)),s=n(s,i,i=f+t.length*3,1)>>>0;const u=gp().subarray(s+f,s+i),v=Q2(t,u);f+=v.written}return Qu=f,s}function v_(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+=v_(t[0]));for(let f=1;f1)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 $2(t,e){const n=e(t.length*1,1)>>>0;return gp().set(t,n/1),Qu=t.length,n}function tS(t,e){return t=t>>>0,lx().subarray(t/8,t/8+e)}class eS{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();bn.__wbg_mapmodel_free(e)}constructor(e,n){try{const f=bn.__wbindgen_add_to_stack_pointer(-16),u=$2(e,bn.__wbindgen_malloc),v=Qu;bn.mapmodel_new(f,u,v,n);var i=Kn()[f/4+0],s=Kn()[f/4+1],c=Kn()[f/4+2];if(c)throw Sh(s);return this.__wbg_ptr=i>>>0,this}finally{bn.__wbindgen_add_to_stack_pointer(16)}}render(){let e,n;try{const w=bn.__wbindgen_add_to_stack_pointer(-16);bn.mapmodel_render(w,this.__wbg_ptr);var i=Kn()[w/4+0],s=Kn()[w/4+1],c=Kn()[w/4+2],f=Kn()[w/4+3],u=i,v=s;if(f)throw u=0,v=0,Sh(c);return e=u,n=v,ou(u,v)}finally{bn.__wbindgen_add_to_stack_pointer(16),bn.__wbindgen_free(e,n,1)}}compareRoute(e){let n,i;try{const I=bn.__wbindgen_add_to_stack_pointer(-16);bn.mapmodel_compareRoute(I,this.__wbg_ptr,xl(e));var s=Kn()[I/4+0],c=Kn()[I/4+1],f=Kn()[I/4+2],u=Kn()[I/4+3],v=s,w=c;if(u)throw v=0,w=0,Sh(f);return n=v,i=w,ou(v,w)}finally{bn.__wbindgen_add_to_stack_pointer(16),bn.__wbindgen_free(n,i,1)}}makeHeatmap(){let e,n;try{const w=bn.__wbindgen_add_to_stack_pointer(-16);bn.mapmodel_makeHeatmap(w,this.__wbg_ptr);var i=Kn()[w/4+0],s=Kn()[w/4+1],c=Kn()[w/4+2],f=Kn()[w/4+3],u=i,v=s;if(f)throw u=0,v=0,Sh(c);return e=u,n=v,ou(u,v)}finally{bn.__wbindgen_add_to_stack_pointer(16),bn.__wbindgen_free(e,n,1)}}getInvertedBoundary(){let e,n;try{const w=bn.__wbindgen_add_to_stack_pointer(-16);bn.mapmodel_getInvertedBoundary(w,this.__wbg_ptr);var i=Kn()[w/4+0],s=Kn()[w/4+1],c=Kn()[w/4+2],f=Kn()[w/4+3],u=i,v=s;if(f)throw u=0,v=0,Sh(c);return e=u,n=v,ou(u,v)}finally{bn.__wbindgen_add_to_stack_pointer(16),bn.__wbindgen_free(e,n,1)}}getBounds(){try{const s=bn.__wbindgen_add_to_stack_pointer(-16);bn.mapmodel_getBounds(s,this.__wbg_ptr);var e=Kn()[s/4+0],n=Kn()[s/4+1],i=tS(e,n).slice();return bn.__wbindgen_free(e,n*8,8),i}finally{bn.__wbindgen_add_to_stack_pointer(16)}}}async function nS(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 iS(){const t={};return t.wbg={},t.wbg.__wbindgen_error_new=function(e,n){const i=new Error(ou(e,n));return xl(i)},t.wbg.__wbindgen_string_new=function(e,n){const i=ou(e,n);return xl(i)},t.wbg.__wbindgen_is_object=function(e){const n=ii(e);return typeof n=="object"&&n!==null},t.wbg.__wbindgen_is_undefined=function(e){return ii(e)===void 0},t.wbg.__wbindgen_in=function(e,n){return ii(e)in ii(n)},t.wbg.__wbindgen_object_drop_ref=function(e){Sh(e)},t.wbg.__wbindgen_number_get=function(e,n){const i=ii(n),s=typeof i=="number"?i:void 0;lx()[e/8+1]=s_(s)?0:s,Kn()[e/4+0]=!s_(s)},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return ii(e)==ii(n)},t.wbg.__wbindgen_boolean_get=function(e){const n=ii(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbindgen_string_get=function(e,n){const i=ii(n),s=typeof i=="string"?i:void 0;var c=s_(s)?0:a_(s,bn.__wbindgen_malloc,bn.__wbindgen_realloc),f=Qu;Kn()[e/4+1]=f,Kn()[e/4+0]=c},t.wbg.__wbindgen_object_clone_ref=function(e){const n=ii(e);return xl(n)},t.wbg.__wbg_getwithrefkey_3b3c46ba20582127=function(e,n){const i=ii(e)[ii(n)];return xl(i)},t.wbg.__wbg_debug_34c9290896ec9856=function(e){console.debug(ii(e))},t.wbg.__wbg_error_e60eff06f24ab7a4=function(e){console.error(ii(e))},t.wbg.__wbg_info_d7d58472d0bab115=function(e){console.info(ii(e))},t.wbg.__wbg_log_a4530b4fe289336f=function(e){console.log(ii(e))},t.wbg.__wbg_warn_f260f49434e45e62=function(e){console.warn(ii(e))},t.wbg.__wbg_instanceof_ArrayBuffer_e7d53d51371448e2=function(e){let n;try{n=ii(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_buffer_a448f833075b71ba=function(e){const n=ii(e).buffer;return xl(n)},t.wbg.__wbg_new_8f67e318f15d7254=function(e){const n=new Uint8Array(ii(e));return xl(n)},t.wbg.__wbg_set_2357bf09366ee480=function(e,n,i){ii(e).set(ii(n),i>>>0)},t.wbg.__wbg_length_1d25fa9e4ac21ce7=function(e){return ii(e).length},t.wbg.__wbg_instanceof_Uint8Array_bced6f43aed8c1aa=function(e){let n;try{n=ii(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=ii(n).stack,s=a_(i,bn.__wbindgen_malloc,bn.__wbindgen_realloc),c=Qu;Kn()[e/4+1]=c,Kn()[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{bn.__wbindgen_free(i,s,1)}},t.wbg.__wbindgen_debug_string=function(e,n){const i=v_(ii(n)),s=a_(i,bn.__wbindgen_malloc,bn.__wbindgen_realloc),c=Qu;Kn()[e/4+1]=c,Kn()[e/4+0]=s},t.wbg.__wbindgen_throw=function(e,n){throw new Error(ou(e,n))},t.wbg.__wbindgen_memory=function(){const e=bn.memory;return xl(e)},t}function rS(t,e){return bn=t.exports,ux.__wbindgen_wasm_module=e,hp=null,fp=null,cp=null,bn}async function ux(t){if(bn!==void 0)return bn;typeof t>"u"&&(t="/severance_snape/assets/backend_bg.wasm");const e=iS();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:i}=await nS(await t,e);return rS(n,i)}const vh=[];function l_(t,e){return{subscribe:Yi(t,e).subscribe}}function Yi(t,e=Oe){let n;const i=new Set;function s(u){if(en(t,u)&&(t=u,n)){const v=!vh.length;for(const w of i)w[1](),vh.push(w,t);if(v){for(let w=0;w{i.delete(w),i.size===0&&n&&(n(),n=null)}}return{set:s,update:c,subscribe:f}}let oS=Date.now();function Rm(t){return`${t}-${oS++}`}const j_=Symbol.for("svelte-maplibre");function Kh(){return q_(j_)}function sS(t){let e=new WeakMap;return n=>{var f;let i=e.get(n.originalEvent);if(i!==void 0)return i;let c=(f=n.target.queryRenderedFeatures(n.point).find(u=>{var v;return(v=t.get(u.layer.id))==null?void 0:v.interactive}))==null?void 0:f.layer.id;return e.set(n.originalEvent,c),c}}function aS(){let t=new Map;return G_(j_,{map:Yi(null),source:l_(null),layer:l_(null),popupTarget:l_(null),cluster:Yi(),loadedImages:Yi(new Set),minzoom:Yi(0),maxzoom:Yi(24),layerEvent:Yi(null),layerInfo:t,eventTopMost:sS(t)})}function J0(t){return{subscribe:t.subscribe}}function Z_({key:t,setPopupTarget:e=!1,setCluster:n=!1,setMouseEvent:i=!1}){let s=Kh(),c=Yi(null),f=J0(c),u={...s,[t]:J0(c)};if(e&&(u.popupTarget=f),i){let v=Yi(null);u.layerEvent=v,s.layerEvent=v}return n&&(u.cluster=Yi()),G_(j_,u),{...s,self:c}}function lS(){return Z_({key:"source",setCluster:!0})}function uS(t=!0){return Z_({key:"layer",setPopupTarget:t,setMouseEvent:t})}function cS(){return Z_({key:"popupTarget",setPopupTarget:!0,setMouseEvent:!0})}var cx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function fx(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 px={exports:{}};/** - * MapLibre GL JS - * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.1.3/LICENSE.txt - */(function(t,e){(function(n,i){t.exports=i()})(cx,function(){var n={},i={};function s(f,u,v){if(i[f]=v,f==="index"){var w="var sharedModule = {}; ("+i.shared+")(sharedModule); ("+i.worker+")(sharedModule);",I={};return i.shared(I),i.index(n,I),typeof window<"u"&&n.setWorkerUrl(window.URL.createObjectURL(new Blob([w],{type:"text/javascript"}))),n}}s("shared",["exports"],function(f){function u(a,r,l,p){return new(l||(l=Promise))(function(g,x){function b(P){try{T(p.next(P))}catch(D){x(D)}}function S(P){try{T(p.throw(P))}catch(D){x(D)}}function T(P){var D;P.done?g(P.value):(D=P.value,D instanceof l?D:new l(function(R){R(D)})).then(b,S)}T((p=p.apply(a,r||[])).next())})}function v(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}typeof SuppressedError=="function"&&SuppressedError;var w=I;function I(a,r){this.x=a,this.y=r}I.prototype={clone:function(){return new I(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),p=l*this.x+r*this.y;return this.x=r*this.x-l*this.y,this.y=p,this},_rotateAround:function(a,r){var l=Math.cos(a),p=Math.sin(a),g=r.y+p*(this.x-r.x)+l*(this.y-r.y);return this.x=r.x+l*(this.x-r.x)-p*(this.y-r.y),this.y=g,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},I.convert=function(a){return a instanceof I?a:Array.isArray(a)?new I(a[0],a[1]):a};var L=v(w),A=U;function U(a,r,l,p){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*(p-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=a,this.p1y=r,this.p2x=l,this.p2y=p}U.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,p=0;p<8;p++){var g=this.sampleCurveX(l)-a;if(Math.abs(g)g?b=l:S=l,l=.5*(S-b)+b;return l},solve:function(a,r){return this.sampleCurveY(this.solveCurveX(a,r))}};var z=v(A);let K,J;function Q(){return K==null&&(K=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),K}function O(){if(J==null&&(J=!1,Q())){const r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let p=0;p<5*5;p++){const g=4*p;r.fillStyle=`rgb(${g},${g+1},${g+2})`,r.fillRect(p%5,Math.floor(p/5),1,1)}const l=r.getImageData(0,0,5,5).data;for(let p=0;p<5*5*4;p++)if(p%4!=3&&l[p]!==p){J=!0;break}}}return J||!1}function G(a,r,l,p){const g=new z(a,r,l,p);return function(x){return g.solve(x)}}const j=G(.25,.1,.25,1);function lt(a,r,l){return Math.min(l,Math.max(r,a))}function xt(a,r,l){const p=l-r,g=((a-r)%p+p)%p+r;return g===r?l:g}function dt(a,...r){for(const l of r)for(const p in l)a[p]=l[p];return a}let ht=1;function ct(a,r,l){const p={};for(const g in a)p[g]=r.call(l||this,a[g],g,a);return p}function Pt(a,r,l){const p={};for(const g in a)r.call(l||this,a[g],g,a)&&(p[g]=a[g]);return p}function $(a){return Array.isArray(a)?a.map($):typeof a=="object"&&a?ct(a,$):a}const Lt={};function ee(a){Lt[a]||(typeof console<"u"&&console.warn(a),Lt[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 re(a){let r=0;for(let l,p,g=0,x=a.length,b=x-1;g"u")throw new Error("VideoFrame not supported");const x=new VideoFrame(a,{timestamp:0});try{const b=x==null?void 0:x.format;if(!b||!b.startsWith("BGR")&&!b.startsWith("RGB"))throw new Error(`Unrecognized format ${b}`);const S=b.startsWith("BGR"),T=new Uint8ClampedArray(p*g*4);if(yield x.copyTo(T,function(P,D,R,V,Z){const H=4*Math.max(-D,0),et=(Math.max(0,R)-R)*V*4+H,ot=4*V,ft=Math.max(0,D),Et=Math.max(0,R);return{rect:{x:ft,y:Et,width:Math.min(P.width,D+V)-ft,height:Math.min(P.height,R+Z)-Et},layout:[{offset:et,stride:ot}]}}(a,r,l,p,g)),S)for(let P=0;P_e(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,_i=function(a,r){if(/:\/\//.test(a.url)&&!/^https?:|^file:/.test(a.url)){const p=mn(a.url);if(p)return p(a,r);if(_e(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:a,targetMapId:Pn},r)}if(!(/^file:/.test(l=a.url)||/^file:/.test(Ci())&&!/^\w+:/.test(l))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(p,g){return u(this,void 0,void 0,function*(){const x=new Request(p.url,{method:p.method||"GET",body:p.body,credentials:p.credentials,headers:p.headers,cache:p.cache,referrer:Ci(),signal:g.signal});p.type==="json"&&x.headers.set("Accept","application/json");const b=yield fetch(x);if(!b.ok){const P=yield b.blob();throw new gi(b.status,b.statusText,p.url,P)}let S;S=p.type==="arrayBuffer"||p.type==="image"?b.arrayBuffer():p.type==="json"?b.json():b.text();const T=yield S;if(g.signal.aborted)throw In();return{data:T,cacheControl:b.headers.get("Cache-Control"),expires:b.headers.get("Expires")}})}(a,r);if(_e(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:a,mustQueue:!0,targetMapId:Pn},r)}var l;return function(p,g){return new Promise((x,b)=>{const S=new XMLHttpRequest;S.open(p.method||"GET",p.url,!0),p.type!=="arrayBuffer"&&p.type!=="image"||(S.responseType="arraybuffer");for(const T in p.headers)S.setRequestHeader(T,p.headers[T]);p.type==="json"&&(S.responseType="text",S.setRequestHeader("Accept","application/json")),S.withCredentials=p.credentials==="include",S.onerror=()=>{b(new Error(S.statusText))},S.onload=()=>{if(!g.signal.aborted)if((S.status>=200&&S.status<300||S.status===0)&&S.response!==null){let T=S.response;if(p.type==="json")try{T=JSON.parse(S.response)}catch(P){return void b(P)}x({data:T,cacheControl:S.getResponseHeader("Cache-Control"),expires:S.getResponseHeader("Expires")})}else{const T=new Blob([S.response],{type:S.getResponseHeader("Content-Type")});b(new gi(S.status,S.statusText,p.url,T))}},g.signal.addEventListener("abort",()=>{S.abort(),b(In())}),S.send(p.body)})}(a,r)};function li(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 Kt(a,r,l){l[a]&&l[a].indexOf(r)!==-1||(l[a]=l[a]||[],l[a].push(r))}function mt(a,r,l){if(l&&l[a]){const p=l[a].indexOf(r);p!==-1&&l[a].splice(p,1)}}class St{constructor(r,l={}){dt(this,l),this.type=r}}class xe extends St{constructor(r,l={}){super("error",dt({error:r},l))}}class An{on(r,l){return this._listeners=this._listeners||{},Kt(r,l,this._listeners),this}off(r,l){return mt(r,l,this._listeners),mt(r,l,this._oneTimeListeners),this}once(r,l){return l?(this._oneTimeListeners=this._oneTimeListeners||{},Kt(r,l,this._oneTimeListeners),this):new Promise(p=>this.once(r,p))}fire(r,l){typeof r=="string"&&(r=new St(r,l||{}));const p=r.type;if(this.listens(p)){r.target=this;const g=this._listeners&&this._listeners[p]?this._listeners[p].slice():[];for(const S of g)S.call(this,r);const x=this._oneTimeListeners&&this._oneTimeListeners[p]?this._oneTimeListeners[p].slice():[];for(const S of x)mt(p,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 xe&&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 Mt={$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 We=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ti(a,r){const l={};for(const p in a)p!=="ref"&&(l[p]=a[p]);return We.forEach(p=>{p in r&&(l[p]=r[p])}),l}function on(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 yt=[Gi,se,Ke,Xe,Li,Di,Go,X(He),st,B,q];function Y(a,r){if(r.kind==="error")return null;if(a.kind==="array"){if(r.kind==="array"&&(r.N===0&&r.itemType.kind==="value"||!Y(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 yt)if(!Y(l,r))return null}}return`Expected ${nt(a)} but found ${nt(r)} instead.`}function vt(a,r){return r.some(l=>l.kind===a.kind)}function pt(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 It(a,r){return a.kind==="array"&&r.kind==="array"?a.itemType.kind===r.itemType.kind&&typeof a.N=="number":a.kind===r.kind}const Nt=.96422,Ft=.82521,Ht=4/29,we=6/29,Te=3*we*we,Ge=we*we*we,je=Math.PI/180,yn=180/Math.PI;function Vn(a){return(a%=360)<0&&(a+=360),a}function $n([a,r,l,p]){let g,x;const b=nn((.2225045*(a=qi(a))+.7168786*(r=qi(r))+.0606169*(l=qi(l)))/1);a===r&&r===l?g=x=b:(g=nn((.4360747*a+.3850649*r+.1430804*l)/Nt),x=nn((.0139322*a+.0971045*r+.7141733*l)/Ft));const S=116*b-16;return[S<0?0:S,500*(g-b),200*(b-x),p]}function qi(a){return a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function nn(a){return a>Ge?Math.pow(a,1/3):a/Te+Ht}function yi([a,r,l,p]){let g=(a+16)/116,x=isNaN(r)?g:g+r/500,b=isNaN(l)?g:g-l/200;return g=1*Zr(g),x=Nt*Zr(x),b=Ft*Zr(b),[Ki(3.1338561*x-1.6168667*g-.4906146*b),Ki(-.9787684*x+1.9161415*g+.033454*b),Ki(.0719453*x-.2289914*g+1.4052427*b),p]}function Ki(a){return(a=a<=.00304?12.92*a:1.055*Math.pow(a,1/2.4)-.055)<0?0:a>1?1:a}function Zr(a){return a>we?a*a*a:Te*(a-Ht)}function io(a){return parseInt(a.padEnd(2,a),16)/255}function ur(a,r){return Ls(r?a/100:a,0,1)}function Ls(a,r,l){return Math.min(Math.max(r,a),l)}function Jp(a){return!a.some(Number.isNaN)}const $m={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 zn{constructor(r,l,p,g=1,x=!0){this.r=r,this.g=l,this.b=p,this.a=g,x||(this.r*=g,this.g*=g,this.b*=g,g||this.overwriteGetter("rgb",[r,l,p,g]))}static parse(r){if(r instanceof zn)return r;if(typeof r!="string")return;const l=function(p){if((p=p.toLowerCase().trim())==="transparent")return[0,0,0,0];const g=$m[p];if(g){const[b,S,T]=g;return[b/255,S/255,T/255,1]}if(p.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(p)){const b=p.length<6?1:2;let S=1;return[io(p.slice(S,S+=b)),io(p.slice(S,S+=b)),io(p.slice(S,S+=b)),io(p.slice(S,S+b)||"ff")]}if(p.startsWith("rgb")){const b=p.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(b){const[S,T,P,D,R,V,Z,H,et,ot,ft,Et]=b,gt=[D||" ",Z||" ",ot].join("");if(gt===" "||gt===" /"||gt===",,"||gt===",,,"){const bt=[P,V,et].join(""),Xt=bt==="%%%"?100:bt===""?255:0;if(Xt){const Yt=[Ls(+T/Xt,0,1),Ls(+R/Xt,0,1),Ls(+H/Xt,0,1),ft?ur(+ft,Et):1];if(Jp(Yt))return Yt}}return}}const x=p.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(x){const[b,S,T,P,D,R,V,Z,H]=x,et=[T||" ",D||" ",V].join("");if(et===" "||et===" /"||et===",,"||et===",,,"){const ot=[+S,Ls(+P,0,100),Ls(+R,0,100),Z?ur(+Z,H):1];if(Jp(ot))return function([ft,Et,gt,bt]){function Xt(Yt){const me=(Yt+ft/30)%12,be=Et*Math.min(gt,1-gt);return gt-be*Math.max(-1,Math.min(me-3,9-me,1))}return ft=Vn(ft),Et/=100,gt/=100,[Xt(0),Xt(8),Xt(4),bt]}(ot)}}}(r);return l?new zn(...l,!1):void 0}get rgb(){const{r,g:l,b:p,a:g}=this,x=g||1/0;return this.overwriteGetter("rgb",[r/x,l/x,p/x,g])}get hcl(){return this.overwriteGetter("hcl",function(r){const[l,p,g,x]=$n(r),b=Math.sqrt(p*p+g*g);return[Math.round(1e4*b)?Vn(Math.atan2(g,p)*yn):NaN,b,l,x]}(this.rgb))}get lab(){return this.overwriteGetter("lab",$n(this.rgb))}overwriteGetter(r,l){return Object.defineProperty(this,r,{value:l}),l}toString(){const[r,l,p,g]=this.rgb;return`rgba(${[r,l,p].map(x=>Math.round(255*x)).join(",")},${g})`}}zn.black=new zn(0,0,0,1),zn.white=new zn(1,1,1,1),zn.transparent=new zn(0,0,0,0),zn.red=new zn(1,0,0,1);class of{constructor(r,l,p){this.sensitivity=r?l?"variant":"case":l?"accent":"base",this.locale=p,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 sf{constructor(r,l,p,g,x){this.text=r,this.image=l,this.scale=p,this.fontStack=g,this.textColor=x}}class So{constructor(r){this.sections=r}static fromString(r){return new So([new sf(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 ro{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof ro)return r;if(typeof r=="number")return new ro([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 ro(r)}}toString(){return JSON.stringify(this.values)}}const Eu=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class qo{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof qo)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?p===void 0||typeof p=="number"&&p>=0&&p<=1?null:`Invalid rgba value [${[a,r,l,p].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof p=="number"?[a,r,l,p]:[a,r,l]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function bc(a){if(a===null||typeof a=="string"||typeof a=="boolean"||typeof a=="number"||a instanceof zn||a instanceof of||a instanceof So||a instanceof ro||a instanceof qo||a instanceof jo)return!0;if(Array.isArray(a)){for(const r of a)if(!bc(r))return!1;return!0}if(typeof a=="object"){for(const r in a)if(!bc(a[r]))return!1;return!0}return!1}function ji(a){if(a===null)return Gi;if(typeof a=="string")return Ke;if(typeof a=="boolean")return Xe;if(typeof a=="number")return se;if(a instanceof zn)return Li;if(a instanceof of)return oa;if(a instanceof So)return Di;if(a instanceof ro)return st;if(a instanceof qo)return q;if(a instanceof jo)return B;if(Array.isArray(a)){const r=a.length;let l;for(const p of a){const g=ji(p);if(l){if(l===g)continue;l=He;break}l=g}return X(l||He,r)}return Go}function Cu(a){const r=typeof a;return a===null?"":r==="string"||r==="number"||r==="boolean"?String(a):a instanceof zn||a instanceof So||a instanceof ro||a instanceof qo||a instanceof jo?a.toString():JSON.stringify(a)}class Ta{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(!bc(r[1]))return l.error("invalid value");const p=r[1];let g=ji(p);const x=l.expectedType;return g.kind!=="array"||g.N!==0||!x||x.kind!=="array"||typeof x.N=="number"&&x.N!==0||(g=x),new Ta(g,p)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ui{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}}const wc={string:Ke,number:se,boolean:Xe,object:Go};class Io{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 p,g=1;const x=r[0];if(x==="array"){let S,T;if(r.length>2){const P=r[1];if(typeof P!="string"||!(P in wc)||P==="object")return l.error('The item type argument of "array" must be one of string, number, boolean',1);S=wc[P],g++}else S=He;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);T=r[2],g++}p=X(S,T)}else{if(!wc[x])throw new Error(`Types doesn't contain name = ${x}`);p=wc[x]}const b=[];for(;gr.outputDefined())}}const Sc={"to-boolean":Xe,"to-color":Li,"to-number":se,"to-string":Ke};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 p=r[0];if(!Sc[p])throw new Error(`Can't parse ${p} as it is not part of the known types`);if((p==="to-boolean"||p==="to-string")&&r.length!==2)return l.error("Expected one argument.");const g=Sc[p],x=[];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]),!p))return new zn(l[0]/255,l[1]/255,l[2]/255,l[3])}throw new ui(p||`Could not parse color from value '${typeof l=="string"?l:JSON.stringify(l)}'`)}case"padding":{let l;for(const p of this.args){l=p.evaluate(r);const g=ro.parse(l);if(g)return g}throw new ui(`Could not parse padding from value '${typeof l=="string"?l:JSON.stringify(l)}'`)}case"variableAnchorOffsetCollection":{let l;for(const p of this.args){l=p.evaluate(r);const g=qo.parse(l);if(g)return g}throw new ui(`Could not parse variableAnchorOffsetCollection from value '${typeof l=="string"?l:JSON.stringify(l)}'`)}case"number":{let l=null;for(const p of this.args){if(l=p.evaluate(r),l===null)return 0;const g=Number(l);if(!isNaN(g))return g}throw new ui(`Could not convert ${JSON.stringify(l)} to number.`)}case"formatted":return So.fromString(Cu(this.args[0].evaluate(r)));case"resolvedImage":return jo.fromString(Cu(this.args[0].evaluate(r)));default:return Cu(this.args[0].evaluate(r))}}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}}const Tu=["Unknown","Point","LineString","Polygon"];class On{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"?Tu[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]=zn.parse(r)),l}}class Ic{constructor(r,l,p=[],g,x=new rl,b=[]){this.registry=r,this.path=p,this.key=p.map(S=>`[${S}]`).join(""),this.scope=x,this.errors=b,this.expectedType=g,this._isConstant=l}parse(r,l,p,g,x={}){return l?this.concat(l,p,g)._parse(r,x):this._parse(r,x)}_parse(r,l){function p(g,x,b){return b==="assert"?new Io(x,[g]):b==="coerce"?new Ms(x,[g]):g}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 g=r[0];if(typeof g!="string")return this.error(`Expression name must be a string, but found ${typeof g} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const x=this.registry[g];if(x){let b=x.parse(r,this);if(!b)return null;if(this.expectedType){const S=this.expectedType,T=b.type;if(S.kind!=="string"&&S.kind!=="number"&&S.kind!=="boolean"&&S.kind!=="object"&&S.kind!=="array"||T.kind!=="value")if(S.kind!=="color"&&S.kind!=="formatted"&&S.kind!=="resolvedImage"||T.kind!=="value"&&T.kind!=="string")if(S.kind!=="padding"||T.kind!=="value"&&T.kind!=="number"&&T.kind!=="array")if(S.kind!=="variableAnchorOffsetCollection"||T.kind!=="value"&&T.kind!=="array"){if(this.checkSubtype(S,T))return null}else b=p(b,S,l.typeAnnotation||"coerce");else b=p(b,S,l.typeAnnotation||"coerce");else b=p(b,S,l.typeAnnotation||"coerce");else b=p(b,S,l.typeAnnotation||"assert")}if(!(b instanceof Ta)&&b.type.kind!=="resolvedImage"&&this._isConstant(b)){const S=new On;try{b=new Ta(b.type,b.evaluate(S))}catch(T){return this.error(T.message),null}}return b}return this.error(`Unknown expression "${g}". 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,p){const g=typeof r=="number"?this.path.concat(r):this.path,x=p?this.scope.concat(p):this.scope;return new Ic(this.registry,this._isConstant,g,l||null,x,this.errors)}error(r,...l){const p=`${this.key}${l.map(g=>`[${g}]`).join("")}`;this.errors.push(new jr(p,r))}checkSubtype(r,l){const p=Y(r,l);return p&&this.error(p),p}}class Ol{constructor(r,l,p){this.type=oa,this.locale=p,this.caseSensitive=r,this.diacriticSensitive=l}static parse(r,l){if(r.length!==2)return l.error("Expected one argument.");const p=r[1];if(typeof p!="object"||Array.isArray(p))return l.error("Collator options argument must be an object.");const g=l.parse(p["case-sensitive"]!==void 0&&p["case-sensitive"],1,Xe);if(!g)return null;const x=l.parse(p["diacritic-sensitive"]!==void 0&&p["diacritic-sensitive"],1,Xe);if(!x)return null;let b=null;return p.locale&&(b=l.parse(p.locale,1,Ke),!b)?null:new Ol(g,x,b)}evaluate(r){return new of(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 La=8192;function Ec(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 Lu(a,r){return!(a[0]<=r[0]||a[2]>=r[2]||a[1]<=r[1]||a[3]>=r[3])}function tg(a,r){const l=(180+a[0])/360,p=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a[1]*Math.PI/360)))/360,g=Math.pow(2,r.z);return[Math.round(l*g*La),Math.round(p*g*La)]}function Qp(a,r,l){const p=a[0]-r[0],g=a[1]-r[1],x=a[0]-l[0],b=a[1]-l[1];return p*b-x*g==0&&p*x<=0&&g*b<=0}function Cc(a,r){let l=!1;for(let b=0,S=r.length;b(p=a)[1]!=(x=T[P+1])[1]>p[1]&&p[0]<(x[0]-g[0])*(p[1]-g[1])/(x[1]-g[1])+g[0]&&(l=!l)}}var p,g,x;return l}function eg(a,r){for(let l=0;l0&&S<0||b<0&&S>0}function ng(a,r,l){for(const P of l)for(let D=0;Dl[2]){const g=.5*p;let x=a[0]-l[0]>g?-p:l[0]-a[0]>g?p:0;x===0&&(x=a[0]-l[2]>g?-p:l[2]-a[0]>g?p:0),a[0]+=x}Ec(r,a)}function Lc(a,r,l,p){const g=Math.pow(2,p.z)*La,x=[p.x*La,p.y*La],b=[];for(const S of a)for(const T of S){const P=[T.x+x[0],T.y+x[1]];id(P,r,l,g),b.push(P)}return b}function rd(a,r,l,p){const g=Math.pow(2,p.z)*La,x=[p.x*La,p.y*La],b=[];for(const T of a){const P=[];for(const D of T){const R=[D.x+x[0],D.y+x[1]];Ec(r,R),P.push(R)}b.push(P)}if(r[2]-r[0]<=g/2){(S=r)[0]=S[1]=1/0,S[2]=S[3]=-1/0;for(const T of b)for(const P of T)id(P,r,l,g)}var S;return b}class ol{constructor(r,l){this.type=Xe,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(bc(r[1])){const p=r[1];if(p.type==="FeatureCollection"){const g=[];for(const x of p.features){const{type:b,coordinates:S}=x.geometry;b==="Polygon"&&g.push(S),b==="MultiPolygon"&&g.push(...S)}if(g.length)return new ol(p,{type:"MultiPolygon",coordinates:g})}else if(p.type==="Feature"){const g=p.geometry.type;if(g==="Polygon"||g==="MultiPolygon")return new ol(p,p.geometry)}else if(p.type==="Polygon"||p.type==="MultiPolygon")return new ol(p,p)}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,p){const g=[1/0,1/0,-1/0,-1/0],x=[1/0,1/0,-1/0,-1/0],b=l.canonicalID();if(p.type==="Polygon"){const S=Tc(p.coordinates,x,b),T=Lc(l.geometry(),g,x,b);if(!Lu(g,x))return!1;for(const P of T)if(!Cc(P,S))return!1}if(p.type==="MultiPolygon"){const S=nd(p.coordinates,x,b),T=Lc(l.geometry(),g,x,b);if(!Lu(g,x))return!1;for(const P of T)if(!eg(P,S))return!1}return!0}(r,this.geometries);if(r.geometryType()==="LineString")return function(l,p){const g=[1/0,1/0,-1/0,-1/0],x=[1/0,1/0,-1/0,-1/0],b=l.canonicalID();if(p.type==="Polygon"){const S=Tc(p.coordinates,x,b),T=rd(l.geometry(),g,x,b);if(!Lu(g,x))return!1;for(const P of T)if(!td(P,S))return!1}if(p.type==="MultiPolygon"){const S=nd(p.coordinates,x,b),T=rd(l.geometry(),g,x,b);if(!Lu(g,x))return!1;for(const P of T)if(!ed(P,S))return!1}return!0}(r,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class Mc{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 p=r[1];return l.scope.has(p)?new Mc(p,l.scope.get(p)):l.error(`Unknown variable "${p}". Make sure "${p}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(r){return this.boundExpression.evaluate(r)}eachChild(){}outputDefined(){return!1}}class Eo{constructor(r,l,p,g){this.name=r,this.type=l,this._evaluate=p,this.args=g}evaluate(r){return this._evaluate(r,this.args)}eachChild(r){this.args.forEach(r)}outputDefined(){return!1}static parse(r,l){const p=r[0],g=Eo.definitions[p];if(!g)return l.error(`Unknown expression "${p}". If you wanted a literal array, use ["literal", [...]].`,0);const x=Array.isArray(g)?g[0]:g.type,b=Array.isArray(g)?[[g[1],g[2]]]:g.overloads,S=b.filter(([P])=>!Array.isArray(P)||P.length===r.length-1);let T=null;for(const[P,D]of S){T=new Ic(l.registry,Mu,l.path,null,l.scope);const R=[];let V=!1;for(let Z=1;Z{return V=R,Array.isArray(V)?`(${V.map(nt).join(", ")})`:`(${nt(V.type)}...)`;var V}).join(" | "),D=[];for(let R=1;R{l=r?l&&Mu(p):l&&p instanceof Ta}),!!l&&Pc(a)&&Au(a,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Pc(a){if(a instanceof Eo&&(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 ol)return!1;let r=!0;return a.eachChild(l=>{r&&!Pc(l)&&(r=!1)}),r}function Pu(a){if(a instanceof Eo&&a.name==="feature-state")return!1;let r=!0;return a.eachChild(l=>{r&&!Pu(l)&&(r=!1)}),r}function Au(a,r){if(a instanceof Eo&&r.indexOf(a.name)>=0)return!1;let l=!0;return a.eachChild(p=>{l&&!Au(p,r)&&(l=!1)}),l}function ku(a,r){const l=a.length-1;let p,g,x=0,b=l,S=0;for(;x<=b;)if(S=Math.floor((x+b)/2),p=a[S],g=a[S+1],p<=r){if(S===l||rr))throw new ui("Input is not a number.");b=S-1}return 0}class Du{constructor(r,l,p){this.type=r,this.input=l,this.labels=[],this.outputs=[];for(const[g,x]of p)this.labels.push(g),this.outputs.push(x)}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 p=l.parse(r[1],1,se);if(!p)return null;const g=[];let x=null;l.expectedType&&l.expectedType.kind!=="value"&&(x=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(T,D,x);if(!R)return null;x=x||R.type,g.push([S,R])}return new Du(x,p,g)}evaluate(r){const l=this.labels,p=this.outputs;if(l.length===1)return p[0].evaluate(r);const g=this.input.evaluate(r);if(g<=l[0])return p[0].evaluate(r);const x=l.length;return g>=l[x-1]?p[x-1].evaluate(r):p[ku(l,g)].evaluate(r)}eachChild(r){r(this.input);for(const l of this.outputs)r(l)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}}function ig(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var rg=od;function od(a,r,l,p){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*(p-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=a,this.p1y=r,this.p2x=l,this.p2y=p}od.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,p=0;p<8;p++){var g=this.sampleCurveX(l)-a;if(Math.abs(g)g?b=l:S=l,l=.5*(S-b)+b;return l},solve:function(a,r){return this.sampleCurveY(this.solveCurveX(a,r))}};var og=ig(rg);function sl(a,r,l){return a+l*(r-a)}function Ac(a,r,l){return a.map((p,g)=>sl(p,r[g],l))}const Wr={number:sl,color:function(a,r,l,p="rgb"){switch(p){case"rgb":{const[g,x,b,S]=Ac(a.rgb,r.rgb,l);return new zn(g,x,b,S,!1)}case"hcl":{const[g,x,b,S]=a.hcl,[T,P,D,R]=r.hcl;let V,Z;if(isNaN(g)||isNaN(T))isNaN(g)?isNaN(T)?V=NaN:(V=T,b!==1&&b!==0||(Z=P)):(V=g,D!==1&&D!==0||(Z=x));else{let Et=T-g;T>g&&Et>180?Et-=360:T180&&(Et+=360),V=g+l*Et}const[H,et,ot,ft]=function([Et,gt,bt,Xt]){return Et=isNaN(Et)?0:Et*je,yi([bt,Math.cos(Et)*gt,Math.sin(Et)*gt,Xt])}([V,Z??sl(x,P,l),sl(b,D,l),sl(S,R,l)]);return new zn(H,et,ot,ft,!1)}case"lab":{const[g,x,b,S]=yi(Ac(a.lab,r.lab,l));return new zn(g,x,b,S,!1)}}},array:Ac,padding:function(a,r,l){return new ro(Ac(a.values,r.values,l))},variableAnchorOffsetCollection:function(a,r,l){const p=a.values,g=r.values;if(p.length!==g.length)throw new ui(`Cannot interpolate values of different length. from: ${a.toString()}, to: ${r.toString()}`);const x=[];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);g={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(x=l.parse(x,2,se),!x)return null;const S=[];let T=null;p==="interpolate-hcl"||p==="interpolate-lab"?T=Li:l.expectedType&&l.expectedType.kind!=="value"&&(T=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.',V);const H=l.parse(R,Z,T);if(!H)return null;T=T||H.type,S.push([D,H])}return It(T,se)||It(T,Li)||It(T,st)||It(T,q)||It(T,X(se))?new Pr(T,p,g,x,S):l.error(`Type ${nt(T)} is not interpolatable.`)}evaluate(r){const l=this.labels,p=this.outputs;if(l.length===1)return p[0].evaluate(r);const g=this.input.evaluate(r);if(g<=l[0])return p[0].evaluate(r);const x=l.length;if(g>=l[x-1])return p[x-1].evaluate(r);const b=ku(l,g),S=Pr.interpolationFactor(this.interpolation,g,l[b],l[b+1]),T=p[b].evaluate(r),P=p[b+1].evaluate(r);switch(this.operator){case"interpolate":return Wr[this.type.kind](T,P,S);case"interpolate-hcl":return Wr.color(T,P,S,"hcl");case"interpolate-lab":return Wr.color(T,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 kn(a,r,l,p){const g=p-l,x=a-l;return g===0?0:r===1?x/g:(Math.pow(r,x)-1)/(Math.pow(r,g)-1)}class kc{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 p=null;const g=l.expectedType;g&&g.kind!=="value"&&(p=g);const x=[];for(const S of r.slice(1)){const T=l.parse(S,1+x.length,p,void 0,{typeAnnotation:"omit"});if(!T)return null;p=p||T.type,x.push(T)}if(!p)throw new Error("No output type");const b=g&&x.some(S=>Y(g,S.type));return new kc(b?He:p,x)}evaluate(r){let l,p=null,g=0;for(const x of this.args)if(g++,p=x.evaluate(r),p&&p instanceof jo&&!p.available&&(l||(l=p.name),p=null,g===this.args.length&&(p=l)),p!==null)break;return p}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}}class Dc{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 p=[];for(let x=1;x=p.length)throw new ui(`Array index out of bounds: ${l} > ${p.length-1}.`);if(l!==Math.floor(l))throw new ui(`Array index must be an integer, but found ${l} instead.`);return p[l]}eachChild(r){r(this.index),r(this.input)}outputDefined(){return!1}}class lf{constructor(r,l){this.type=Xe,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 p=l.parse(r[1],1,He),g=l.parse(r[2],2,He);return p&&g?vt(p.type,[Xe,Ke,se,Gi,He])?new lf(p,g):l.error(`Expected first argument to be of type boolean, string, number or null, but found ${nt(p.type)} instead`):null}evaluate(r){const l=this.needle.evaluate(r),p=this.haystack.evaluate(r);if(!p)return!1;if(!pt(l,["boolean","string","number","null"]))throw new ui(`Expected first argument to be of type boolean, string, number or null, but found ${nt(ji(l))} instead.`);if(!pt(p,["string","array"]))throw new ui(`Expected second argument to be of type array or string, but found ${nt(ji(p))} instead.`);return p.indexOf(l)>=0}eachChild(r){r(this.needle),r(this.haystack)}outputDefined(){return!0}}class Rc{constructor(r,l,p){this.type=se,this.needle=r,this.haystack=l,this.fromIndex=p}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 p=l.parse(r[1],1,He),g=l.parse(r[2],2,He);if(!p||!g)return null;if(!vt(p.type,[Xe,Ke,se,Gi,He]))return l.error(`Expected first argument to be of type boolean, string, number or null, but found ${nt(p.type)} instead`);if(r.length===4){const x=l.parse(r[3],3,se);return x?new Rc(p,g,x):null}return new Rc(p,g)}evaluate(r){const l=this.needle.evaluate(r),p=this.haystack.evaluate(r);if(!pt(l,["boolean","string","number","null"]))throw new ui(`Expected first argument to be of type boolean, string, number or null, but found ${nt(ji(l))} instead.`);if(!pt(p,["string","array"]))throw new ui(`Expected second argument to be of type array or string, but found ${nt(ji(p))} instead.`);if(this.fromIndex){const g=this.fromIndex.evaluate(r);return p.indexOf(l,g)}return p.indexOf(l)}eachChild(r){r(this.needle),r(this.haystack),this.fromIndex&&r(this.fromIndex)}outputDefined(){return!1}}class uf{constructor(r,l,p,g,x,b){this.inputType=r,this.type=l,this.input=p,this.cases=g,this.outputs=x,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 p,g;l.expectedType&&l.expectedType.kind!=="value"&&(g=l.expectedType);const x={},b=[];for(let P=2;PNumber.MAX_SAFE_INTEGER)return V.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof H=="number"&&Math.floor(H)!==H)return V.error("Numeric branch labels must be integer values.");if(p){if(V.checkSubtype(p,ji(H)))return null}else p=ji(H);if(x[String(H)]!==void 0)return V.error("Branch labels must be unique.");x[String(H)]=b.length}const Z=l.parse(R,P,g);if(!Z)return null;g=g||Z.type,b.push(Z)}const S=l.parse(r[1],1,He);if(!S)return null;const T=l.parse(r[r.length-1],r.length-1,g);return T?S.type.kind!=="value"&&l.concat(1).checkSubtype(p,S.type)?null:new uf(p,g,S,x,b,T):null}evaluate(r){const l=this.input.evaluate(r);return(ji(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 cf{constructor(r,l,p){this.type=r,this.branches=l,this.otherwise=p}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 p;l.expectedType&&l.expectedType.kind!=="value"&&(p=l.expectedType);const g=[];for(let b=1;bl.outputDefined())&&this.otherwise.outputDefined()}}class Nc{constructor(r,l,p,g){this.type=r,this.input=l,this.beginIndex=p,this.endIndex=g}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 p=l.parse(r[1],1,He),g=l.parse(r[2],2,se);if(!p||!g)return null;if(!vt(p.type,[X(He),Ke,He]))return l.error(`Expected first argument to be of type array or string, but found ${nt(p.type)} instead`);if(r.length===4){const x=l.parse(r[3],3,se);return x?new Nc(p.type,p,g,x):null}return new Nc(p.type,p,g)}evaluate(r){const l=this.input.evaluate(r),p=this.beginIndex.evaluate(r);if(!pt(l,["string","array"]))throw new ui(`Expected first argument to be of type array or string, but found ${nt(ji(l))} instead.`);if(this.endIndex){const g=this.endIndex.evaluate(r);return l.slice(p,g)}return l.slice(p)}eachChild(r){r(this.input),r(this.beginIndex),this.endIndex&&r(this.endIndex)}outputDefined(){return!1}}function sd(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 ad(a,r,l,p){return p.compare(r,l)===0}function Fl(a,r,l){const p=a!=="=="&&a!=="!=";return class dx{constructor(x,b,S){this.type=Xe,this.lhs=x,this.rhs=b,this.collator=S,this.hasUntypedArgument=x.type.kind==="value"||b.type.kind==="value"}static parse(x,b){if(x.length!==3&&x.length!==4)return b.error("Expected two or three arguments.");const S=x[0];let T=b.parse(x[1],1,He);if(!T)return null;if(!sd(S,T.type))return b.concat(1).error(`"${S}" comparisons are not supported for type '${nt(T.type)}'.`);let P=b.parse(x[2],2,He);if(!P)return null;if(!sd(S,P.type))return b.concat(2).error(`"${S}" comparisons are not supported for type '${nt(P.type)}'.`);if(T.type.kind!==P.type.kind&&T.type.kind!=="value"&&P.type.kind!=="value")return b.error(`Cannot compare types '${nt(T.type)}' and '${nt(P.type)}'.`);p&&(T.type.kind==="value"&&P.type.kind!=="value"?T=new Io(P.type,[T]):T.type.kind!=="value"&&P.type.kind==="value"&&(P=new Io(T.type,[P])));let D=null;if(x.length===4){if(T.type.kind!=="string"&&P.type.kind!=="string"&&T.type.kind!=="value"&&P.type.kind!=="value")return b.error("Cannot use collator to compare non-string types.");if(D=b.parse(x[3],3,oa),!D)return null}return new dx(T,P,D)}evaluate(x){const b=this.lhs.evaluate(x),S=this.rhs.evaluate(x);if(p&&this.hasUntypedArgument){const T=ji(b),P=ji(S);if(T.kind!==P.kind||T.kind!=="string"&&T.kind!=="number")throw new ui(`Expected arguments for "${a}" to be (string, string) or (number, number), but found (${T.kind}, ${P.kind}) instead.`)}if(this.collator&&!p&&this.hasUntypedArgument){const T=ji(b),P=ji(S);if(T.kind!=="string"||P.kind!=="string")return r(x,b,S)}return this.collator?l(x,b,S,this.collator.evaluate(x)):r(x,b,S)}eachChild(x){x(this.lhs),x(this.rhs),this.collator&&x(this.collator)}outputDefined(){return!0}}}const sg=Fl("==",function(a,r,l){return r===l},ad),ag=Fl("!=",function(a,r,l){return r!==l},function(a,r,l,p){return!ad(0,r,l,p)}),lg=Fl("<",function(a,r,l){return r",function(a,r,l){return r>l},function(a,r,l,p){return p.compare(r,l)>0}),cg=Fl("<=",function(a,r,l){return r<=l},function(a,r,l,p){return p.compare(r,l)<=0}),hg=Fl(">=",function(a,r,l){return r>=l},function(a,r,l,p){return p.compare(r,l)>=0});class hf{constructor(r,l,p,g,x){this.type=Ke,this.number=r,this.locale=l,this.currency=p,this.minFractionDigits=g,this.maxFractionDigits=x}static parse(r,l){if(r.length!==3)return l.error("Expected two arguments.");const p=l.parse(r[1],1,se);if(!p)return null;const g=r[2];if(typeof g!="object"||Array.isArray(g))return l.error("NumberFormat options argument must be an object.");let x=null;if(g.locale&&(x=l.parse(g.locale,1,Ke),!x))return null;let b=null;if(g.currency&&(b=l.parse(g.currency,1,Ke),!b))return null;let S=null;if(g["min-fraction-digits"]&&(S=l.parse(g["min-fraction-digits"],1,se),!S))return null;let T=null;return g["max-fraction-digits"]&&(T=l.parse(g["max-fraction-digits"],1,se),!T)?null:new hf(p,x,b,S,T)}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 zc{constructor(r){this.type=Di,this.sections=r}static parse(r,l){if(r.length<2)return l.error("Expected at least one argument.");const p=r[1];if(!Array.isArray(p)&&typeof p=="object")return l.error("First argument must be an image or text section.");const g=[];let x=!1;for(let b=1;b<=r.length-1;++b){const S=r[b];if(x&&typeof S=="object"&&!Array.isArray(S)){x=!1;let T=null;if(S["font-scale"]&&(T=l.parse(S["font-scale"],1,se),!T))return null;let P=null;if(S["text-font"]&&(P=l.parse(S["text-font"],1,X(Ke)),!P))return null;let D=null;if(S["text-color"]&&(D=l.parse(S["text-color"],1,Li),!D))return null;const R=g[g.length-1];R.scale=T,R.font=P,R.textColor=D}else{const T=l.parse(r[b],1,He);if(!T)return null;const P=T.type.kind;if(P!=="string"&&P!=="value"&&P!=="null"&&P!=="resolvedImage")return l.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,g.push({content:T,scale:null,font:null,textColor:null})}}return new zc(g)}evaluate(r){return new So(this.sections.map(l=>{const p=l.content.evaluate(r);return ji(p)===B?new sf("",p,null,null,null):new sf(Cu(p),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 ff{constructor(r){this.type=B,this.input=r}static parse(r,l){if(r.length!==2)return l.error("Expected two arguments.");const p=l.parse(r[1],1,Ke);return p?new ff(p):l.error("No image name provided.")}evaluate(r){const l=this.input.evaluate(r),p=jo.fromString(l);return p&&r.availableImages&&(p.available=r.availableImages.indexOf(l)>-1),p}eachChild(r){r(this.input)}outputDefined(){return!1}}class pf{constructor(r){this.type=se,this.input=r}static parse(r,l){if(r.length!==2)return l.error(`Expected 1 argument, but found ${r.length-1} instead.`);const p=l.parse(r[1],1);return p?p.type.kind!=="array"&&p.type.kind!=="string"&&p.type.kind!=="value"?l.error(`Expected argument of type string or array, but found ${nt(p.type)} instead.`):new pf(p):null}evaluate(r){const l=this.input.evaluate(r);if(typeof l=="string"||Array.isArray(l))return l.length;throw new ui(`Expected value to be of type string or array, but found ${nt(ji(l))} instead.`)}eachChild(r){r(this.input)}outputDefined(){return!1}}const Bl={"==":sg,"!=":ag,">":ug,"<":lg,">=":hg,"<=":cg,array:Io,at:af,boolean:Io,case:cf,coalesce:kc,collator:Ol,format:zc,image:ff,in:lf,"index-of":Rc,interpolate:Pr,"interpolate-hcl":Pr,"interpolate-lab":Pr,length:pf,let:Dc,literal:Ta,match:uf,number:Io,"number-format":hf,object:Io,slice:Nc,step:Du,string:Io,"to-boolean":Ms,"to-color":Ms,"to-number":Ms,"to-string":Ms,var:Mc,within:ol};function ld(a,[r,l,p,g]){r=r.evaluate(a),l=l.evaluate(a),p=p.evaluate(a);const x=g?g.evaluate(a):1,b=zl(r,l,p,x);if(b)throw new ui(b);return new zn(r/255,l/255,p/255,x,!1)}function ud(a,r){return a in r}function df(a,r){const l=r[a];return l===void 0?null:l}function al(a){return{type:a}}function cd(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 hd(a){return!!a.expression&&a.expression.parameters.indexOf("zoom")>-1}function mf(a){return!!a.expression&&a.expression.interpolated}function Sn(a){return a instanceof Number?"number":a instanceof String?"string":a instanceof Boolean?"boolean":Array.isArray(a)?"array":a===null?"null":typeof a}function Oc(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function fg(a){return a}function fd(a,r){const l=r.type==="color",p=a.stops&&typeof a.stops[0][0]=="object",g=p||!(p||a.property!==void 0),x=a.type||(mf(r)?"exponential":"interval");if(l||r.type==="padding"){const D=l?zn.parse:ro.parse;(a=Uo({},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,T,P;if(x==="exponential")S=vn;else if(x==="interval")S=pg;else if(x==="categorical"){S=Ri,T=Object.create(null);for(const D of a.stops)T[D[0]]=D[1];P=typeof a.stops[0][0]}else{if(x!=="identity")throw new Error(`Unknown function type "${x}"`);S=gf}if(p){const D={},R=[];for(let H=0;HH[0]),evaluate:({zoom:H},et)=>vn({stops:V,base:a.base},r,H).evaluate(H,et)}}if(g){const D=x==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:D,interpolationFactor:Pr.interpolationFactor.bind(void 0,D),zoomStops:a.stops.map(R=>R[0]),evaluate:({zoom:R})=>S(a,r,R,T,P)}}return{kind:"source",evaluate(D,R){const V=R&&R.properties?R.properties[a.property]:void 0;return V===void 0?Ru(a.default,r.default):S(a,r,V,T,P)}}}function Ru(a,r,l){return a!==void 0?a:r!==void 0?r:l!==void 0?l:void 0}function Ri(a,r,l,p,g){return Ru(typeof l===g?p[l]:void 0,a.default,r.default)}function pg(a,r,l){if(Sn(l)!=="number")return Ru(a.default,r.default);const p=a.stops.length;if(p===1||l<=a.stops[0][0])return a.stops[0][1];if(l>=a.stops[p-1][0])return a.stops[p-1][1];const g=ku(a.stops.map(x=>x[0]),l);return a.stops[g][1]}function vn(a,r,l){const p=a.base!==void 0?a.base:1;if(Sn(l)!=="number")return Ru(a.default,r.default);const g=a.stops.length;if(g===1||l<=a.stops[0][0])return a.stops[0][1];if(l>=a.stops[g-1][0])return a.stops[g-1][1];const x=ku(a.stops.map(D=>D[0]),l),b=function(D,R,V,Z){const H=Z-V,et=D-V;return H===0?0:R===1?et/H:(Math.pow(R,et)-1)/(Math.pow(R,H)-1)}(l,p,a.stops[x][0],a.stops[x+1][0]),S=a.stops[x][1],T=a.stops[x+1][1],P=Wr[r.type]||fg;return typeof S.evaluate=="function"?{evaluate(...D){const R=S.evaluate.apply(void 0,D),V=T.evaluate.apply(void 0,D);if(R!==void 0&&V!==void 0)return P(R,V,b,a.colorSpace)}}:P(S,T,b,a.colorSpace)}function gf(a,r,l){switch(r.type){case"color":l=zn.parse(l);break;case"formatted":l=So.fromString(l.toString());break;case"resolvedImage":l=jo.fromString(l.toString());break;case"padding":l=ro.parse(l);break;default:Sn(l)===r.type||r.type==="enum"&&r.values[l]||(l=void 0)}return Ru(l,a.default,r.default)}Eo.register(Bl,{error:[{kind:"error"},[Ke],(a,[r])=>{throw new ui(r.evaluate(a))}],typeof:[Ke,[He],(a,[r])=>nt(ji(r.evaluate(a)))],"to-rgba":[X(se,4),[Li],(a,[r])=>{const[l,p,g,x]=r.evaluate(a).rgb;return[255*l,255*p,255*g,x]}],rgb:[Li,[se,se,se],ld],rgba:[Li,[se,se,se,se],ld],has:{type:Xe,overloads:[[[Ke],(a,[r])=>ud(r.evaluate(a),a.properties())],[[Ke,Go],(a,[r,l])=>ud(r.evaluate(a),l.evaluate(a))]]},get:{type:He,overloads:[[[Ke],(a,[r])=>df(r.evaluate(a),a.properties())],[[Ke,Go],(a,[r,l])=>df(r.evaluate(a),l.evaluate(a))]]},"feature-state":[He,[Ke],(a,[r])=>df(r.evaluate(a),a.featureState||{})],properties:[Go,[],a=>a.properties()],"geometry-type":[Ke,[],a=>a.geometryType()],id:[He,[],a=>a.id()],zoom:[se,[],a=>a.globals.zoom],"heatmap-density":[se,[],a=>a.globals.heatmapDensity||0],"line-progress":[se,[],a=>a.globals.lineProgress||0],accumulated:[He,[],a=>a.globals.accumulated===void 0?null:a.globals.accumulated],"+":[se,al(se),(a,r)=>{let l=0;for(const p of r)l+=p.evaluate(a);return l}],"*":[se,al(se),(a,r)=>{let l=1;for(const p of r)l*=p.evaluate(a);return l}],"-":{type:se,overloads:[[[se,se],(a,[r,l])=>r.evaluate(a)-l.evaluate(a)],[[se],(a,[r])=>-r.evaluate(a)]]},"/":[se,[se,se],(a,[r,l])=>r.evaluate(a)/l.evaluate(a)],"%":[se,[se,se],(a,[r,l])=>r.evaluate(a)%l.evaluate(a)],ln2:[se,[],()=>Math.LN2],pi:[se,[],()=>Math.PI],e:[se,[],()=>Math.E],"^":[se,[se,se],(a,[r,l])=>Math.pow(r.evaluate(a),l.evaluate(a))],sqrt:[se,[se],(a,[r])=>Math.sqrt(r.evaluate(a))],log10:[se,[se],(a,[r])=>Math.log(r.evaluate(a))/Math.LN10],ln:[se,[se],(a,[r])=>Math.log(r.evaluate(a))],log2:[se,[se],(a,[r])=>Math.log(r.evaluate(a))/Math.LN2],sin:[se,[se],(a,[r])=>Math.sin(r.evaluate(a))],cos:[se,[se],(a,[r])=>Math.cos(r.evaluate(a))],tan:[se,[se],(a,[r])=>Math.tan(r.evaluate(a))],asin:[se,[se],(a,[r])=>Math.asin(r.evaluate(a))],acos:[se,[se],(a,[r])=>Math.acos(r.evaluate(a))],atan:[se,[se],(a,[r])=>Math.atan(r.evaluate(a))],min:[se,al(se),(a,r)=>Math.min(...r.map(l=>l.evaluate(a)))],max:[se,al(se),(a,r)=>Math.max(...r.map(l=>l.evaluate(a)))],abs:[se,[se],(a,[r])=>Math.abs(r.evaluate(a))],round:[se,[se],(a,[r])=>{const l=r.evaluate(a);return l<0?-Math.round(-l):Math.round(l)}],floor:[se,[se],(a,[r])=>Math.floor(r.evaluate(a))],ceil:[se,[se],(a,[r])=>Math.ceil(r.evaluate(a))],"filter-==":[Xe,[Ke,He],(a,[r,l])=>a.properties()[r.value]===l.value],"filter-id-==":[Xe,[He],(a,[r])=>a.id()===r.value],"filter-type-==":[Xe,[Ke],(a,[r])=>a.geometryType()===r.value],"filter-<":[Xe,[Ke,He],(a,[r,l])=>{const p=a.properties()[r.value],g=l.value;return typeof p==typeof g&&p{const l=a.id(),p=r.value;return typeof l==typeof p&&l":[Xe,[Ke,He],(a,[r,l])=>{const p=a.properties()[r.value],g=l.value;return typeof p==typeof g&&p>g}],"filter-id->":[Xe,[He],(a,[r])=>{const l=a.id(),p=r.value;return typeof l==typeof p&&l>p}],"filter-<=":[Xe,[Ke,He],(a,[r,l])=>{const p=a.properties()[r.value],g=l.value;return typeof p==typeof g&&p<=g}],"filter-id-<=":[Xe,[He],(a,[r])=>{const l=a.id(),p=r.value;return typeof l==typeof p&&l<=p}],"filter->=":[Xe,[Ke,He],(a,[r,l])=>{const p=a.properties()[r.value],g=l.value;return typeof p==typeof g&&p>=g}],"filter-id->=":[Xe,[He],(a,[r])=>{const l=a.id(),p=r.value;return typeof l==typeof p&&l>=p}],"filter-has":[Xe,[He],(a,[r])=>r.value in a.properties()],"filter-has-id":[Xe,[],a=>a.id()!==null&&a.id()!==void 0],"filter-type-in":[Xe,[X(Ke)],(a,[r])=>r.value.indexOf(a.geometryType())>=0],"filter-id-in":[Xe,[X(He)],(a,[r])=>r.value.indexOf(a.id())>=0],"filter-in-small":[Xe,[Ke,X(He)],(a,[r,l])=>l.value.indexOf(a.properties()[r.value])>=0],"filter-in-large":[Xe,[Ke,X(He)],(a,[r,l])=>function(p,g,x,b){for(;x<=b;){const S=x+b>>1;if(g[S]===p)return!0;g[S]>p?b=S-1:x=S+1}return!1}(a.properties()[r.value],l.value,0,l.value.length-1)],all:{type:Xe,overloads:[[[Xe,Xe],(a,[r,l])=>r.evaluate(a)&&l.evaluate(a)],[al(Xe),(a,r)=>{for(const l of r)if(!l.evaluate(a))return!1;return!0}]]},any:{type:Xe,overloads:[[[Xe,Xe],(a,[r,l])=>r.evaluate(a)||l.evaluate(a)],[al(Xe),(a,r)=>{for(const l of r)if(l.evaluate(a))return!0;return!1}]]},"!":[Xe,[Xe],(a,[r])=>!r.evaluate(a)],"is-supported-script":[Xe,[Ke],(a,[r])=>{const l=a.globals&&a.globals.isSupportedScript;return!l||l(r.evaluate(a))}],upcase:[Ke,[Ke],(a,[r])=>r.evaluate(a).toUpperCase()],downcase:[Ke,[Ke],(a,[r])=>r.evaluate(a).toLowerCase()],concat:[Ke,al(He),(a,r)=>r.map(l=>Cu(l.evaluate(a))).join("")],"resolved-locale":[Ke,[oa],(a,[r])=>r.evaluate(a).resolvedLocale()]});class Xn{constructor(r,l){var p;this.expression=r,this._warningHistory={},this._evaluator=new On,this._defaultValue=l?(p=l).type==="color"&&Oc(p.default)?new zn(0,0,0,0):p.type==="color"?zn.parse(p.default)||null:p.type==="padding"?ro.parse(p.default)||null:p.type==="variableAnchorOffsetCollection"?qo.parse(p.default)||null:p.default===void 0?null:p.default:null,this._enumValues=l&&l.type==="enum"?l.values:null}evaluateWithoutErrorHandling(r,l,p,g,x,b){return this._evaluator.globals=r,this._evaluator.feature=l,this._evaluator.featureState=p,this._evaluator.canonical=g,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=b,this.expression.evaluate(this._evaluator)}evaluate(r,l,p,g,x,b){this._evaluator.globals=r,this._evaluator.feature=l||null,this._evaluator.featureState=p||null,this._evaluator.canonical=g,this._evaluator.availableImages=x||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 ui(`Expected value to be one of ${Object.keys(this._enumValues).map(T=>JSON.stringify(T)).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 Zn(a){return Array.isArray(a)&&a.length>0&&typeof a[0]=="string"&&a[0]in Bl}function ll(a,r){const l=new Ic(Bl,Mu,[],r?function(g){const x={color:Li,string:Ke,number:se,enum:Ke,boolean:Xe,formatted:Di,padding:st,resolvedImage:B,variableAnchorOffsetCollection:q};return g.type==="array"?X(x[g.value]||He,g.length):x[g.type]}(r):void 0),p=l.parse(a,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return p?cd(new Xn(p,r)):Vl(l.errors)}class Fc{constructor(r,l){this.kind=r,this._styleExpression=l,this.isStateDependent=r!=="constant"&&!Pu(l.expression)}evaluateWithoutErrorHandling(r,l,p,g,x,b){return this._styleExpression.evaluateWithoutErrorHandling(r,l,p,g,x,b)}evaluate(r,l,p,g,x,b){return this._styleExpression.evaluate(r,l,p,g,x,b)}}class _f{constructor(r,l,p,g){this.kind=r,this.zoomStops=p,this._styleExpression=l,this.isStateDependent=r!=="camera"&&!Pu(l.expression),this.interpolationType=g}evaluateWithoutErrorHandling(r,l,p,g,x,b){return this._styleExpression.evaluateWithoutErrorHandling(r,l,p,g,x,b)}evaluate(r,l,p,g,x,b){return this._styleExpression.evaluate(r,l,p,g,x,b)}interpolationFactor(r,l,p){return this.interpolationType?Pr.interpolationFactor(this.interpolationType,r,l,p):0}}function pd(a,r){const l=ll(a,r);if(l.result==="error")return l;const p=l.value.expression,g=Pc(p);if(!g&&!Ul(r))return Vl([new jr("","data expressions not supported")]);const x=Au(p,["zoom"]);if(!x&&!hd(r))return Vl([new jr("","zoom expressions not supported")]);const b=Vc(p);return b||x?b instanceof jr?Vl([b]):b instanceof Pr&&!mf(r)?Vl([new jr("",'"interpolate" expressions cannot be used with this property')]):cd(b?new _f(g?"camera":"composite",l.value,b.labels,b instanceof Pr?b.interpolation:void 0):new Fc(g?"constant":"source",l.value)):Vl([new jr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Bc{constructor(r,l){this._parameters=r,this._specification=l,Uo(this,fd(this._parameters,this._specification))}static deserialize(r){return new Bc(r._parameters,r._specification)}static serialize(r){return{_parameters:r._parameters,_specification:r._specification}}}function Vc(a){let r=null;if(a instanceof Dc)r=Vc(a.result);else if(a instanceof kc){for(const l of a.args)if(r=Vc(l),r)break}else(a instanceof Du||a instanceof Pr)&&a.input instanceof Eo&&a.input.name==="zoom"&&(r=a);return r instanceof jr||a.eachChild(l=>{const p=Vc(l);p instanceof jr?r=p:!r&&p?r=new jr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&p&&r!==p&&(r=new jr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}function Uc(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(!Uc(r)&&typeof r!="boolean")return!1;return!0;default:return!0}}const dd={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Gc(a){if(a==null)return{filter:()=>!0,needGeometry:!1};Uc(a)||(a=jc(a));const r=ll(a,dd);if(r.result==="error")throw new Error(r.value.map(l=>`${l.key}: ${l.message}`).join(", "));return{filter:(l,p,g)=>r.value.evaluate(l,p,{},g),needGeometry:qc(a)}}function md(a,r){return ar?1:0}function qc(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(let r=1;r"||r==="<="||r===">="?yf(a[1],a[2],r):r==="any"?(l=a.slice(1),["any"].concat(l.map(jc))):r==="all"?["all"].concat(a.slice(1).map(jc)):r==="none"?["all"].concat(a.slice(1).map(jc).map(Zc)):r==="in"?gd(a[1],a.slice(2)):r==="!in"?Zc(gd(a[1],a.slice(2))):r==="has"?_d(a[1]):r==="!has"?Zc(_d(a[1])):r!=="within"||a;var l}function yf(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 gd(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(md)]]:["filter-in-small",a,["literal",r]]}}function _d(a){switch(a){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",a]}}function Zc(a){return["!",a]}function vf(a){const r=typeof a;if(r==="number"||r==="boolean"||r==="string"||a==null)return JSON.stringify(a);if(Array.isArray(a)){let g="[";for(const x of a)g+=`${vf(x)},`;return`${g}]`}const l=Object.keys(a).sort();let p="{";for(let g=0;gp.maximum?[new te(r,l,`${l} is greater than the maximum value ${p.maximum}`)]:[]}function vd(a){const r=a.valueSpec,l=vi(a.value.type);let p,g,x,b={};const S=l!=="categorical"&&a.value.property===void 0,T=!S,P=Sn(a.value.stops)==="array"&&Sn(a.value.stops[0])==="array"&&Sn(a.value.stops[0][0])==="object",D=Hr({key:a.key,value:a.value,valueSpec:a.styleSpec.function,validateSpec:a.validateSpec,style:a.style,styleSpec:a.styleSpec,objectElementValidators:{stops:function(Z){if(l==="identity")return[new te(Z.key,Z.value,'identity function may not have a "stops" property')];let H=[];const et=Z.value;return H=H.concat(xf({key:Z.key,value:et,valueSpec:Z.valueSpec,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec,arrayElementValidator:R})),Sn(et)==="array"&&et.length===0&&H.push(new te(Z.key,et,"array must have at least one stop")),H},default:function(Z){return Z.validateSpec({key:Z.key,value:Z.value,valueSpec:r,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec})}}});return l==="identity"&&S&&D.push(new te(a.key,a.value,'missing required property "property"')),l==="identity"||a.value.stops||D.push(new te(a.key,a.value,'missing required property "stops"')),l==="exponential"&&a.valueSpec.expression&&!mf(a.valueSpec)&&D.push(new te(a.key,a.value,"exponential functions not supported")),a.styleSpec.$version>=8&&(T&&!Ul(a.valueSpec)?D.push(new te(a.key,a.value,"property functions not supported")):S&&!hd(a.valueSpec)&&D.push(new te(a.key,a.value,"zoom functions not supported"))),l!=="categorical"&&!P||a.value.property!==void 0||D.push(new te(a.key,a.value,'"property" property is required')),D;function R(Z){let H=[];const et=Z.value,ot=Z.key;if(Sn(et)!=="array")return[new te(ot,et,`array expected, ${Sn(et)} found`)];if(et.length!==2)return[new te(ot,et,`array length 2 expected, length ${et.length} found`)];if(P){if(Sn(et[0])!=="object")return[new te(ot,et,`object expected, ${Sn(et[0])} found`)];if(et[0].zoom===void 0)return[new te(ot,et,"object stop key must have zoom")];if(et[0].value===void 0)return[new te(ot,et,"object stop key must have value")];if(x&&x>vi(et[0].zoom))return[new te(ot,et[0].zoom,"stop zoom values must appear in ascending order")];vi(et[0].zoom)!==x&&(x=vi(et[0].zoom),g=void 0,b={}),H=H.concat(Hr({key:`${ot}[0]`,value:et[0],valueSpec:{zoom:{}},validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec,objectElementValidators:{zoom:Wc,value:V}}))}else H=H.concat(V({key:`${ot}[0]`,value:et[0],valueSpec:{},validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec},et));return Zn(Ma(et[1]))?H.concat([new te(`${ot}[1]`,et[1],"expressions are not allowed in function stops.")]):H.concat(Z.validateSpec({key:`${ot}[1]`,value:et[1],valueSpec:r,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec}))}function V(Z,H){const et=Sn(Z.value),ot=vi(Z.value),ft=Z.value!==null?Z.value:H;if(p){if(et!==p)return[new te(Z.key,ft,`${et} stop domain type must match previous stop domain type ${p}`)]}else p=et;if(et!=="number"&&et!=="string"&&et!=="boolean")return[new te(Z.key,ft,"stop domain value must be a number, string, or boolean")];if(et!=="number"&&l!=="categorical"){let Et=`number expected, ${et} found`;return Ul(r)&&l===void 0&&(Et+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new te(Z.key,ft,Et)]}return l!=="categorical"||et!=="number"||isFinite(ot)&&Math.floor(ot)===ot?l!=="categorical"&&et==="number"&&g!==void 0&&otnew te(`${a.key}${p.key}`,a.value,p.message));const l=r.value.expression||r.value._styleExpression.expression;if(a.expressionContext==="property"&&a.propertyKey==="text-font"&&!l.outputDefined())return[new te(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"&&!Pu(l))return[new te(a.key,a.value,'"feature-state" data expressions are not supported with layout properties.')];if(a.expressionContext==="filter"&&!Pu(l))return[new te(a.key,a.value,'"feature-state" data expressions are not supported with filters.')];if(a.expressionContext&&a.expressionContext.indexOf("cluster")===0){if(!Au(l,["zoom","feature-state"]))return[new te(a.key,a.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(a.expressionContext==="cluster-initial"&&!Pc(l))return[new te(a.key,a.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Aa(a){const r=a.key,l=a.value,p=a.valueSpec,g=[];return Array.isArray(p.values)?p.values.indexOf(vi(l))===-1&&g.push(new te(r,l,`expected one of [${p.values.join(", ")}], ${JSON.stringify(l)} found`)):Object.keys(p.values).indexOf(vi(l))===-1&&g.push(new te(r,l,`expected one of [${Object.keys(p.values).join(", ")}], ${JSON.stringify(l)} found`)),g}function Gl(a){return Uc(Ma(a.value))?Pa(Uo({},a,{expressionContext:"filter",valueSpec:{value:"boolean"}})):bf(a)}function bf(a){const r=a.value,l=a.key;if(Sn(r)!=="array")return[new te(l,r,`array expected, ${Sn(r)} found`)];const p=a.styleSpec;let g,x=[];if(r.length<1)return[new te(l,r,"filter array must have at least 1 element")];switch(x=x.concat(Aa({key:`${l}[0]`,value:r[0],valueSpec:p.filter_operator,style:a.style,styleSpec:a.styleSpec})),vi(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&vi(r[1])==="$type"&&x.push(new te(l,r,`"$type" cannot be use with operator "${r[0]}"`));case"==":case"!=":r.length!==3&&x.push(new te(l,r,`filter array for operator "${r[0]}" must have 3 elements`));case"in":case"!in":r.length>=2&&(g=Sn(r[1]),g!=="string"&&x.push(new te(`${l}[1]`,r[1],`string expected, ${g} found`)));for(let b=2;b{P in l&&r.push(new te(p,l[P],`"${P}" is prohibited for ref layers`))}),g.layers.forEach(P=>{vi(P.id)===S&&(T=P)}),T?T.ref?r.push(new te(p,l.ref,"ref cannot reference another ref layer")):b=vi(T.type):r.push(new te(p,l.ref,`ref layer "${S}" not found`))}else if(b!=="background")if(l.source){const T=g.sources&&g.sources[l.source],P=T&&vi(T.type);T?P==="vector"&&b==="raster"?r.push(new te(p,l.source,`layer "${l.id}" requires a raster source`)):P!=="raster-dem"&&b==="hillshade"?r.push(new te(p,l.source,`layer "${l.id}" requires a raster-dem source`)):P==="raster"&&b!=="raster"?r.push(new te(p,l.source,`layer "${l.id}" requires a vector source`)):P!=="vector"||l["source-layer"]?P==="raster-dem"&&b!=="hillshade"?r.push(new te(p,l.source,"raster-dem source can only be used with layer type 'hillshade'.")):b!=="line"||!l.paint||!l.paint["line-gradient"]||P==="geojson"&&T.lineMetrics||r.push(new te(p,l,`layer "${l.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):r.push(new te(p,l,`layer "${l.id}" must specify a "source-layer"`)):r.push(new te(p,l.source,`source "${l.source}" not found`))}else r.push(new te(p,l,'missing required property "source"'));return r=r.concat(Hr({key:p,value:l,valueSpec:x.layer,style:a.style,styleSpec:a.styleSpec,validateSpec:a.validateSpec,objectElementValidators:{"*":()=>[],type:()=>a.validateSpec({key:`${p}.type`,value:l.type,valueSpec:x.layer.type,style:a.style,styleSpec:a.styleSpec,validateSpec:a.validateSpec,object:l,objectKey:"type"}),filter:Gl,layout:T=>Hr({layer:l,key:T.key,value:T.value,style:T.style,styleSpec:T.styleSpec,validateSpec:T.validateSpec,objectElementValidators:{"*":P=>Sf(Uo({layerType:b},P))}}),paint:T=>Hr({layer:l,key:T.key,value:T.value,style:T.style,styleSpec:T.styleSpec,validateSpec:T.validateSpec,objectElementValidators:{"*":P=>wf(Uo({layerType:b},P))}})}})),r}function ul(a){const r=a.value,l=a.key,p=Sn(r);return p!=="string"?[new te(l,r,`string expected, ${p} found`)]:[]}const xd={promoteId:function({key:a,value:r}){if(Sn(r)==="string")return ul({key:a,value:r});{const l=[];for(const p in r)l.push(...ul({key:`${a}.${p}`,value:r[p]}));return l}}};function bd(a){const r=a.value,l=a.key,p=a.styleSpec,g=a.style,x=a.validateSpec;if(!r.type)return[new te(l,r,'"type" is required')];const b=vi(r.type);let S;switch(b){case"vector":case"raster":return S=Hr({key:l,value:r,valueSpec:p[`source_${b.replace("-","_")}`],style:a.style,styleSpec:p,objectElementValidators:xd,validateSpec:x}),S;case"raster-dem":return S=function(T){var P;const D=(P=T.sourceName)!==null&&P!==void 0?P:"",R=T.value,V=T.styleSpec,Z=V.source_raster_dem,H=T.style;let et=[];const ot=Sn(R);if(R===void 0)return et;if(ot!=="object")return et.push(new te("source_raster_dem",R,`object expected, ${ot} found`)),et;const ft=vi(R.encoding)==="custom",Et=["redFactor","greenFactor","blueFactor","baseShift"],gt=T.value.encoding?`"${T.value.encoding}"`:"Default";for(const bt in R)!ft&&Et.includes(bt)?et.push(new te(bt,R[bt],`In "${D}": "${bt}" is only valid when "encoding" is set to "custom". ${gt} encoding found`)):Z[bt]?et=et.concat(T.validateSpec({key:bt,value:R[bt],valueSpec:Z[bt],validateSpec:T.validateSpec,style:H,styleSpec:V})):et.push(new te(bt,R[bt],`unknown property "${bt}"`));return et}({sourceName:l,value:r,style:a.style,styleSpec:p,validateSpec:x}),S;case"geojson":if(S=Hr({key:l,value:r,valueSpec:p.source_geojson,style:g,styleSpec:p,validateSpec:x,objectElementValidators:xd}),r.cluster)for(const T in r.clusterProperties){const[P,D]=r.clusterProperties[T],R=typeof P=="string"?[P,["accumulated"],["get",T]]:P;S.push(...Pa({key:`${l}.${T}.map`,value:D,validateSpec:x,expressionContext:"cluster-map"})),S.push(...Pa({key:`${l}.${T}.reduce`,value:R,validateSpec:x,expressionContext:"cluster-reduce"}))}return S;case"video":return Hr({key:l,value:r,valueSpec:p.source_video,style:g,validateSpec:x,styleSpec:p});case"image":return Hr({key:l,value:r,valueSpec:p.source_image,style:g,validateSpec:x,styleSpec:p});case"canvas":return[new te(l,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Aa({key:`${l}.type`,value:r.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:g,validateSpec:x,styleSpec:p})}}function wd(a){const r=a.value,l=a.styleSpec,p=l.light,g=a.style;let x=[];const b=Sn(r);if(r===void 0)return x;if(b!=="object")return x=x.concat([new te("light",r,`object expected, ${b} found`)]),x;for(const S in r){const T=S.match(/^(.*)-transition$/);x=x.concat(T&&p[T[1]]&&p[T[1]].transition?a.validateSpec({key:S,value:r[S],valueSpec:l.transition,validateSpec:a.validateSpec,style:g,styleSpec:l}):p[S]?a.validateSpec({key:S,value:r[S],valueSpec:p[S],validateSpec:a.validateSpec,style:g,styleSpec:l}):[new te(S,r[S],`unknown property "${S}"`)])}return x}function Sd(a){const r=a.value,l=a.styleSpec,p=l.sky,g=a.style,x=Sn(r);if(r===void 0)return[];if(x!=="object")return[new te("sky",r,`object expected, ${x} found`)];let b=[];for(const S in r)b=b.concat(p[S]?Ps({key:S,value:r[S],valueSpec:p[S],style:g,styleSpec:l}):[new te(S,r[S],`unknown property "${S}"`)]);return b}function zu(a){const r=a.value,l=a.styleSpec,p=l.terrain,g=a.style;let x=[];const b=Sn(r);if(r===void 0)return x;if(b!=="object")return x=x.concat([new te("terrain",r,`object expected, ${b} found`)]),x;for(const S in r)x=x.concat(p[S]?a.validateSpec({key:S,value:r[S],valueSpec:p[S],validateSpec:a.validateSpec,style:g,styleSpec:l}):[new te(S,r[S],`unknown property "${S}"`)]);return x}function Ou(a){let r=[];const l=a.value,p=a.key;if(Array.isArray(l)){const g=[],x=[];for(const b in l)l[b].id&&g.includes(l[b].id)&&r.push(new te(p,l,`all the sprites' ids must be unique, but ${l[b].id} is duplicated`)),g.push(l[b].id),l[b].url&&x.includes(l[b].url)&&r.push(new te(p,l,`all the sprites' URLs must be unique, but ${l[b].url} is duplicated`)),x.push(l[b].url),r=r.concat(Hr({key:`${p}[${b}]`,value:l[b],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:a.validateSpec}));return r}return ul({key:p,value:l})}const oo={"*":()=>[],array:xf,boolean:function(a){const r=a.value,l=a.key,p=Sn(r);return p!=="boolean"?[new te(l,r,`boolean expected, ${p} found`)]:[]},number:Wc,color:function(a){const r=a.key,l=a.value,p=Sn(l);return p!=="string"?[new te(r,l,`color expected, ${p} found`)]:zn.parse(String(l))?[]:[new te(r,l,`color expected, "${l}" found`)]},constants:yd,enum:Aa,filter:Gl,function:vd,layer:Nu,object:Hr,source:bd,light:wd,sky:Sd,terrain:zu,string:ul,formatted:function(a){return ul(a).length===0?[]:Pa(a)},resolvedImage:function(a){return ul(a).length===0?[]:Pa(a)},padding:function(a){const r=a.key,l=a.value;if(Sn(l)==="array"){if(l.length<1||l.length>4)return[new te(r,l,`padding requires 1 to 4 values; ${l.length} values found`)];const p={type:"number"};let g=[];for(let x=0;x[]}})),a.constants&&(l=l.concat(yd({key:"constants",value:a.constants,style:a,styleSpec:r,validateSpec:Ps}))),ql(l)}function As(a){return function(r){return a({...r,validateSpec:Ps})}}function ql(a){return[].concat(a).sort((r,l)=>r.line-l.line)}function as(a){return function(...r){return ql(a.apply(this,r))}}ss.source=as(As(bd)),ss.sprite=as(As(Ou)),ss.glyphs=as(As(If)),ss.light=as(As(wd)),ss.sky=as(As(Sd)),ss.terrain=as(As(zu)),ss.layer=as(As(Nu)),ss.filter=as(As(Gl)),ss.paintProperty=as(As(wf)),ss.layoutProperty=as(As(Sf));const cl=ss,mg=cl.light,Ef=cl.paintProperty,gg=cl.layoutProperty;function jl(a,r){let l=!1;if(r&&r.length)for(const p of r)a.fire(new xe(new Error(p.message))),l=!0;return l}class Fu{constructor(r,l,p){const g=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;const b=new Int32Array(this.arrayBuffer);r=b[0],this.d=(l=b[1])+2*(p=b[2]);for(let T=0;T=R[H+0]&&g>=R[H+1])?(S[Z]=!0,b.push(D[Z])):S[Z]=!1}}}}_forEachCell(r,l,p,g,x,b,S,T){const P=this._convertToCellCoord(r),D=this._convertToCellCoord(l),R=this._convertToCellCoord(p),V=this._convertToCellCoord(g);for(let Z=P;Z<=R;Z++)for(let H=D;H<=V;H++){const et=this.d*H+Z;if((!T||T(this._convertFromCellCoord(Z),this._convertFromCellCoord(H),this._convertFromCellCoord(Z+1),this._convertFromCellCoord(H+1)))&&x.call(this,r,l,p,g,et,b,S,T))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 p=0;for(let b=0;b=0)continue;const b=a[x];g[x]=ks[p].shallow.indexOf(x)>=0?b:Zl(b,r)}a instanceof Error&&(g.message=a.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return p!=="Object"&&(g.$name=p),g}throw new Error("can't serialize object of type "+typeof a)}function Wl(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||Xc(a)||Ne(a)||ArrayBuffer.isView(a)||a instanceof ImageData)return a;if(Array.isArray(a))return a.map(Wl);if(typeof a=="object"){const r=a.$name||"Object";if(!ks[r])throw new Error(`can't deserialize unregistered class ${r}`);const{klass:l}=ks[r];if(!l)throw new Error(`can't deserialize unregistered class ${r}`);if(l.deserialize)return l.deserialize(a);const p=Object.create(l.prototype);for(const g of Object.keys(a)){if(g==="$name")continue;const x=a[g];p[g]=ks[r].shallow.indexOf(g)>=0?x:Wl(x)}return p}throw new Error("can't deserialize object of type "+typeof a)}class Id{constructor(){this.first=!0}update(r,l){const p=Math.floor(r);return this.first?(this.first=!1,this.lastIntegerZoom=p,this.lastIntegerZoomTime=0,this.lastZoom=r,this.lastFloorZoom=p,!0):(this.lastFloorZoom>p?(this.lastIntegerZoom=p+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 Hl(a){for(const r of a)if(Yc(r.charCodeAt(0)))return!0;return!1}function Ed(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 Yc(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 Cf(a){return!(Yc(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 Kc(a){return a>=1424&&a<=2303||pe["Arabic Presentation Forms-A"](a)||pe["Arabic Presentation Forms-B"](a)}function Td(a,r){return!(!r&&Kc(a)||a>=2304&&a<=3583||a>=3840&&a<=4255||pe.Khmer(a))}function _g(a){for(const r of a)if(Kc(r.charCodeAt(0)))return!0;return!1}const ka=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}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.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 ti{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 Id,this.transition={})}isSupportedScript(r){return function(l,p){for(const g of l)if(!Td(g.charCodeAt(0),p))return!1;return!0}(r,ka.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),p=this.crossFadingFactor();return r>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:l+(1-l)*p}:{fromScale:.5,toScale:1,t:1-(1-p)*l}}}class Bu{constructor(r,l){this.property=r,this.value=l,this.expression=function(p,g){if(Oc(p))return new Bc(p,g);if(Zn(p)){const x=pd(p,g);if(x.result==="error")throw new Error(x.value.map(b=>`${b.key}: ${b.message}`).join(", "));return x.value}{let x=p;return g.type==="color"&&typeof p=="string"?x=zn.parse(p):g.type!=="padding"||typeof p!="number"&&!Array.isArray(p)?g.type==="variableAnchorOffsetCollection"&&Array.isArray(p)&&(x=qo.parse(p)):x=ro.parse(p),{kind:"constant",evaluate:()=>x}}}(l===void 0?r.specification.default:l,r.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(r,l,p){return this.property.possiblyEvaluate(this,r,l,p)}}class Jc{constructor(r){this.property=r,this.value=new Bu(r,void 0)}transitioned(r,l){return new Ld(this.property,this.value,l,dt({},r.transition,this.transition),r.now)}untransitioned(){return new Ld(this.property,this.value,null,{},0)}}class Tf{constructor(r){this._properties=r,this._values=Object.create(r.defaultTransitionablePropertyValues)}getValue(r){return $(this._values[r].value.value)}setValue(r,l){Object.prototype.hasOwnProperty.call(this._values,r)||(this._values[r]=new Jc(this._values[r].property)),this._values[r].value=new Bu(this._values[r].property,l===null?void 0:$(l))}getTransition(r){return $(this._values[r].transition)}setTransition(r,l){Object.prototype.hasOwnProperty.call(this._values,r)||(this._values[r]=new Jc(this._values[r].property)),this._values[r].transition=$(l)||void 0}serialize(){const r={};for(const l of Object.keys(this._values)){const p=this.getValue(l);p!==void 0&&(r[l]=p);const g=this.getTransition(l);g!==void 0&&(r[`${l}-transition`]=g)}return r}transitioned(r,l){const p=new Md(this._properties);for(const g of Object.keys(this._values))p._values[g]=this._values[g].transitioned(r,l._values[g]);return p}untransitioned(){const r=new Md(this._properties);for(const l of Object.keys(this._values))r._values[l]=this._values[l].untransitioned();return r}}class Ld{constructor(r,l,p,g,x){this.property=r,this.value=l,this.begin=x+g.delay||0,this.end=this.begin+g.duration||0,r.specification.transition&&(g.delay||g.duration)&&(this.prior=p)}possiblyEvaluate(r,l,p){const g=r.now||0,x=this.value.possiblyEvaluate(r,l,p),b=this.prior;if(b){if(g>this.end)return this.prior=null,x;if(this.value.isDataDriven())return this.prior=null,x;if(g=1)return 1;const P=T*T,D=P*T;return 4*(T<.5?D:3*(T-P)+D-.75)}(S))}}return x}}class Md{constructor(r){this._properties=r,this._values=Object.create(r.defaultTransitioningPropertyValues)}possiblyEvaluate(r,l,p){const g=new Vu(this._properties);for(const x of Object.keys(this._values))g._values[x]=this._values[x].possiblyEvaluate(r,l,p);return g}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 $(this._values[r].value)}setValue(r,l){this._values[r]=new Bu(this._values[r].property,l===null?void 0:$(l))}serialize(){const r={};for(const l of Object.keys(this._values)){const p=this.getValue(l);p!==void 0&&(r[l]=p)}return r}possiblyEvaluate(r,l,p){const g=new Vu(this._properties);for(const x of Object.keys(this._values))g._values[x]=this._values[x].possiblyEvaluate(r,l,p);return g}}class ls{constructor(r,l,p){this.property=r,this.value=l,this.parameters=p}isConstant(){return this.value.kind==="constant"}constantOr(r){return this.value.kind==="constant"?this.value.value:r}evaluate(r,l,p,g){return this.property.evaluate(this.value,this.parameters,r,l,p,g)}}class Vu{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,p){const g=Wr[this.specification.type];return g?g(r,l,p):r}}class Re{constructor(r,l){this.specification=r,this.overrides=l}possiblyEvaluate(r,l,p,g){return new ls(this,r.expression.kind==="constant"||r.expression.kind==="camera"?{kind:"constant",value:r.expression.evaluate(l,null,{},p,g)}:r.expression,l)}interpolate(r,l,p){if(r.value.kind!=="constant"||l.value.kind!=="constant")return r;if(r.value.value===void 0||l.value.value===void 0)return new ls(this,{kind:"constant",value:void 0},r.parameters);const g=Wr[this.specification.type];if(g){const x=g(r.value.value,l.value.value,p);return new ls(this,{kind:"constant",value:x},r.parameters)}return r}evaluate(r,l,p,g,x,b){return r.kind==="constant"?r.value:r.evaluate(l,p,g,x,b)}}class Qc extends Re{possiblyEvaluate(r,l,p,g){if(r.value===void 0)return new ls(this,{kind:"constant",value:void 0},l);if(r.expression.kind==="constant"){const x=r.expression.evaluate(l,null,{},p,g),b=r.property.specification.type==="resolvedImage"&&typeof x!="string"?x.name:x,S=this._calculate(b,b,b,l);return new ls(this,{kind:"constant",value:S},l)}if(r.expression.kind==="camera"){const x=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 ls(this,{kind:"constant",value:x},l)}return new ls(this,r.expression,l)}evaluate(r,l,p,g,x,b){if(r.kind==="source"){const S=r.evaluate(l,p,g,x,b);return this._calculate(S,S,S,l)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(l.zoom)-1},p,g),r.evaluate({zoom:Math.floor(l.zoom)},p,g),r.evaluate({zoom:Math.floor(l.zoom)+1},p,g),l):r.value}_calculate(r,l,p,g){return g.zoom>g.zoomHistory.lastIntegerZoom?{from:r,to:l}:{from:p,to:l}}interpolate(r){return r}}class Uu{constructor(r){this.specification=r}possiblyEvaluate(r,l,p,g){if(r.value!==void 0){if(r.expression.kind==="constant"){const x=r.expression.evaluate(l,null,{},p,g);return this._calculate(x,x,x,l)}return this._calculate(r.expression.evaluate(new ti(Math.floor(l.zoom-1),l)),r.expression.evaluate(new ti(Math.floor(l.zoom),l)),r.expression.evaluate(new ti(Math.floor(l.zoom+1),l)),l)}}_calculate(r,l,p,g){return g.zoom>g.zoomHistory.lastIntegerZoom?{from:r,to:l}:{from:p,to:l}}interpolate(r){return r}}class Lf{constructor(r){this.specification=r}possiblyEvaluate(r,l,p,g){return!!r.expression.evaluate(l,null,{},p,g)}interpolate(){return!1}}class so{constructor(r){this.properties=r,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const l in r){const p=r[l];p.specification.overridable&&this.overridableProperties.push(l);const g=this.defaultPropertyValues[l]=new Bu(p,void 0),x=this.defaultTransitionablePropertyValues[l]=new Jc(p);this.defaultTransitioningPropertyValues[l]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[l]=g.possiblyEvaluate({})}}}ye("DataDrivenProperty",Re),ye("DataConstantProperty",Ee),ye("CrossFadedDataDrivenProperty",Qc),ye("CrossFadedProperty",Uu),ye("ColorRampProperty",Lf);const Mf="-transition";class us extends An{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 Tf(l.paint);for(const p in r.paint)this.setPaintProperty(p,r.paint[p],{validate:!1});for(const p in r.layout)this.setLayoutProperty(p,r.layout[p],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Vu(l.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)}setLayoutProperty(r,l,p={}){l!=null&&this._validate(gg,`layers.${this.id}.layout.${r}`,r,l,p)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,l):this.visibility=l)}getPaintProperty(r){return r.endsWith(Mf)?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)}setPaintProperty(r,l,p={}){if(l!=null&&this._validate(Ef,`layers.${this.id}.paint.${r}`,r,l,p))return!1;if(r.endsWith(Mf))return this._transitionablePaint.setTransition(r.slice(0,-11),l||void 0),!1;{const g=this._transitionablePaint._values[r],x=g.property.specification["property-type"]==="cross-faded-data-driven",b=g.value.isDataDriven(),S=g.value;this._transitionablePaint.setValue(r,l),this._handleSpecialPaintPropertyUpdate(r);const T=this._transitionablePaint._values[r].value;return T.isDataDriven()||b||x||this._handleOverridablePaintPropertyUpdate(r,S,T)}}_handleSpecialPaintPropertyUpdate(r){}_handleOverridablePaintPropertyUpdate(r,l,p){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),Pt(r,(l,p)=>!(l===void 0||p==="layout"&&!Object.keys(l).length||p==="paint"&&!Object.keys(l).length))}_validate(r,l,p,g,x={}){return(!x||x.validate!==!1)&&jl(this,r.call(cl,{key:l,layerType:this.type,objectKey:p,value:g,styleSpec:Mt,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 ls&&Ul(l.property.specification)&&(l.value.kind==="source"||l.value.kind==="composite")&&l.value.isStateDependent)return!0}return!1}}const Ad={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Gu{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 xi{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 Ni(a,r=1){let l=0,p=0;return{members:a.map(g=>{const x=Ad[g.type].BYTES_PER_ELEMENT,b=l=kd(l,Math.max(r,x)),S=g.components||1;return p=Math.max(p,x),l+=x*S,{name:g.name,type:g.type,components:S,offset:b}}),size:kd(l,Math.max(p,r)),alignment:r}}function kd(a,r){return Math.ceil(a/r)*r}class qu extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l){const p=this.length;return this.resize(p+1),this.emplace(p,r,l)}emplace(r,l,p){const g=2*r;return this.int16[g+0]=l,this.int16[g+1]=p,r}}qu.prototype.bytesPerElement=4,ye("StructArrayLayout2i4",qu);class sa extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,p){const g=this.length;return this.resize(g+1),this.emplace(g,r,l,p)}emplace(r,l,p,g){const x=3*r;return this.int16[x+0]=l,this.int16[x+1]=p,this.int16[x+2]=g,r}}sa.prototype.bytesPerElement=6,ye("StructArrayLayout3i6",sa);class Pf extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,p,g){const x=this.length;return this.resize(x+1),this.emplace(x,r,l,p,g)}emplace(r,l,p,g,x){const b=4*r;return this.int16[b+0]=l,this.int16[b+1]=p,this.int16[b+2]=g,this.int16[b+3]=x,r}}Pf.prototype.bytesPerElement=8,ye("StructArrayLayout4i8",Pf);class Af extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,p,g,x,b){const S=this.length;return this.resize(S+1),this.emplace(S,r,l,p,g,x,b)}emplace(r,l,p,g,x,b,S){const T=6*r;return this.int16[T+0]=l,this.int16[T+1]=p,this.int16[T+2]=g,this.int16[T+3]=x,this.int16[T+4]=b,this.int16[T+5]=S,r}}Af.prototype.bytesPerElement=12,ye("StructArrayLayout2i4i12",Af);class kf extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,p,g,x,b){const S=this.length;return this.resize(S+1),this.emplace(S,r,l,p,g,x,b)}emplace(r,l,p,g,x,b,S){const T=4*r,P=8*r;return this.int16[T+0]=l,this.int16[T+1]=p,this.uint8[P+4]=g,this.uint8[P+5]=x,this.uint8[P+6]=b,this.uint8[P+7]=S,r}}kf.prototype.bytesPerElement=8,ye("StructArrayLayout2i4ub8",kf);class ju extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l){const p=this.length;return this.resize(p+1),this.emplace(p,r,l)}emplace(r,l,p){const g=2*r;return this.float32[g+0]=l,this.float32[g+1]=p,r}}ju.prototype.bytesPerElement=8,ye("StructArrayLayout2f8",ju);class $c extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,l,p,g,x,b,S,T,P,D){const R=this.length;return this.resize(R+1),this.emplace(R,r,l,p,g,x,b,S,T,P,D)}emplace(r,l,p,g,x,b,S,T,P,D,R){const V=10*r;return this.uint16[V+0]=l,this.uint16[V+1]=p,this.uint16[V+2]=g,this.uint16[V+3]=x,this.uint16[V+4]=b,this.uint16[V+5]=S,this.uint16[V+6]=T,this.uint16[V+7]=P,this.uint16[V+8]=D,this.uint16[V+9]=R,r}}$c.prototype.bytesPerElement=20,ye("StructArrayLayout10ui20",$c);class Df extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,l,p,g,x,b,S,T,P,D,R,V){const Z=this.length;return this.resize(Z+1),this.emplace(Z,r,l,p,g,x,b,S,T,P,D,R,V)}emplace(r,l,p,g,x,b,S,T,P,D,R,V,Z){const H=12*r;return this.int16[H+0]=l,this.int16[H+1]=p,this.int16[H+2]=g,this.int16[H+3]=x,this.uint16[H+4]=b,this.uint16[H+5]=S,this.uint16[H+6]=T,this.uint16[H+7]=P,this.int16[H+8]=D,this.int16[H+9]=R,this.int16[H+10]=V,this.int16[H+11]=Z,r}}Df.prototype.bytesPerElement=24,ye("StructArrayLayout4i4ui4i24",Df);class Rf extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l,p){const g=this.length;return this.resize(g+1),this.emplace(g,r,l,p)}emplace(r,l,p,g){const x=3*r;return this.float32[x+0]=l,this.float32[x+1]=p,this.float32[x+2]=g,r}}Rf.prototype.bytesPerElement=12,ye("StructArrayLayout3f12",Rf);class aa extends xi{_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}}aa.prototype.bytesPerElement=4,ye("StructArrayLayout1ul4",aa);class th extends xi{_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,p,g,x,b,S,T,P){const D=this.length;return this.resize(D+1),this.emplace(D,r,l,p,g,x,b,S,T,P)}emplace(r,l,p,g,x,b,S,T,P,D){const R=10*r,V=5*r;return this.int16[R+0]=l,this.int16[R+1]=p,this.int16[R+2]=g,this.int16[R+3]=x,this.int16[R+4]=b,this.int16[R+5]=S,this.uint32[V+3]=T,this.uint16[R+8]=P,this.uint16[R+9]=D,r}}th.prototype.bytesPerElement=20,ye("StructArrayLayout6i1ul2ui20",th);class Zu extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,p,g,x,b){const S=this.length;return this.resize(S+1),this.emplace(S,r,l,p,g,x,b)}emplace(r,l,p,g,x,b,S){const T=6*r;return this.int16[T+0]=l,this.int16[T+1]=p,this.int16[T+2]=g,this.int16[T+3]=x,this.int16[T+4]=b,this.int16[T+5]=S,r}}Zu.prototype.bytesPerElement=12,ye("StructArrayLayout2i2i2i12",Zu);class eh extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,l,p,g,x){const b=this.length;return this.resize(b+1),this.emplace(b,r,l,p,g,x)}emplace(r,l,p,g,x,b){const S=4*r,T=8*r;return this.float32[S+0]=l,this.float32[S+1]=p,this.float32[S+2]=g,this.int16[T+6]=x,this.int16[T+7]=b,r}}eh.prototype.bytesPerElement=16,ye("StructArrayLayout2f1f2i16",eh);class Wu extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l,p,g){const x=this.length;return this.resize(x+1),this.emplace(x,r,l,p,g)}emplace(r,l,p,g,x){const b=12*r,S=3*r;return this.uint8[b+0]=l,this.uint8[b+1]=p,this.float32[S+1]=g,this.float32[S+2]=x,r}}Wu.prototype.bytesPerElement=12,ye("StructArrayLayout2ub2f12",Wu);class nh extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,l,p){const g=this.length;return this.resize(g+1),this.emplace(g,r,l,p)}emplace(r,l,p,g){const x=3*r;return this.uint16[x+0]=l,this.uint16[x+1]=p,this.uint16[x+2]=g,r}}nh.prototype.bytesPerElement=6,ye("StructArrayLayout3ui6",nh);class Xl extends xi{_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,p,g,x,b,S,T,P,D,R,V,Z,H,et,ot,ft){const Et=this.length;return this.resize(Et+1),this.emplace(Et,r,l,p,g,x,b,S,T,P,D,R,V,Z,H,et,ot,ft)}emplace(r,l,p,g,x,b,S,T,P,D,R,V,Z,H,et,ot,ft,Et){const gt=24*r,bt=12*r,Xt=48*r;return this.int16[gt+0]=l,this.int16[gt+1]=p,this.uint16[gt+2]=g,this.uint16[gt+3]=x,this.uint32[bt+2]=b,this.uint32[bt+3]=S,this.uint32[bt+4]=T,this.uint16[gt+10]=P,this.uint16[gt+11]=D,this.uint16[gt+12]=R,this.float32[bt+7]=V,this.float32[bt+8]=Z,this.uint8[Xt+36]=H,this.uint8[Xt+37]=et,this.uint8[Xt+38]=ot,this.uint32[bt+10]=ft,this.int16[gt+22]=Et,r}}Xl.prototype.bytesPerElement=48,ye("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Xl);class hl extends xi{_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,p,g,x,b,S,T,P,D,R,V,Z,H,et,ot,ft,Et,gt,bt,Xt,Yt,me,be,de,he,oe,ve){const ue=this.length;return this.resize(ue+1),this.emplace(ue,r,l,p,g,x,b,S,T,P,D,R,V,Z,H,et,ot,ft,Et,gt,bt,Xt,Yt,me,be,de,he,oe,ve)}emplace(r,l,p,g,x,b,S,T,P,D,R,V,Z,H,et,ot,ft,Et,gt,bt,Xt,Yt,me,be,de,he,oe,ve,ue){const $t=32*r,De=16*r;return this.int16[$t+0]=l,this.int16[$t+1]=p,this.int16[$t+2]=g,this.int16[$t+3]=x,this.int16[$t+4]=b,this.int16[$t+5]=S,this.int16[$t+6]=T,this.int16[$t+7]=P,this.uint16[$t+8]=D,this.uint16[$t+9]=R,this.uint16[$t+10]=V,this.uint16[$t+11]=Z,this.uint16[$t+12]=H,this.uint16[$t+13]=et,this.uint16[$t+14]=ot,this.uint16[$t+15]=ft,this.uint16[$t+16]=Et,this.uint16[$t+17]=gt,this.uint16[$t+18]=bt,this.uint16[$t+19]=Xt,this.uint16[$t+20]=Yt,this.uint16[$t+21]=me,this.uint16[$t+22]=be,this.uint32[De+12]=de,this.float32[De+13]=he,this.float32[De+14]=oe,this.uint16[$t+30]=ve,this.uint16[$t+31]=ue,r}}hl.prototype.bytesPerElement=64,ye("StructArrayLayout8i15ui1ul2f2ui64",hl);class ih extends xi{_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}}ih.prototype.bytesPerElement=4,ye("StructArrayLayout1f4",ih);class rh extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l,p){const g=this.length;return this.resize(g+1),this.emplace(g,r,l,p)}emplace(r,l,p,g){const x=3*r;return this.uint16[6*r+0]=l,this.float32[x+1]=p,this.float32[x+2]=g,r}}rh.prototype.bytesPerElement=12,ye("StructArrayLayout1ui2f12",rh);class fl extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,l,p){const g=this.length;return this.resize(g+1),this.emplace(g,r,l,p)}emplace(r,l,p,g){const x=4*r;return this.uint32[2*r+0]=l,this.uint16[x+2]=p,this.uint16[x+3]=g,r}}fl.prototype.bytesPerElement=8,ye("StructArrayLayout1ul2ui8",fl);class Nf extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,l){const p=this.length;return this.resize(p+1),this.emplace(p,r,l)}emplace(r,l,p){const g=2*r;return this.uint16[g+0]=l,this.uint16[g+1]=p,r}}Nf.prototype.bytesPerElement=4,ye("StructArrayLayout2ui4",Nf);class zf extends xi{_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}}zf.prototype.bytesPerElement=2,ye("StructArrayLayout1ui2",zf);class oh extends xi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,l,p,g){const x=this.length;return this.resize(x+1),this.emplace(x,r,l,p,g)}emplace(r,l,p,g,x){const b=4*r;return this.float32[b+0]=l,this.float32[b+1]=p,this.float32[b+2]=g,this.float32[b+3]=x,r}}oh.prototype.bytesPerElement=16,ye("StructArrayLayout4f16",oh);class Dd extends Gu{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)}}Dd.prototype.size=20;class _ extends th{get(r){return new Dd(this,r)}}ye("CollisionBoxArray",_);class o extends Gu{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]}}o.prototype.size=48;class h extends Xl{get(r){return new o(this,r)}}ye("PlacedSymbolArray",h);class d extends Gu{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]}}d.prototype.size=64;class m extends hl{get(r){return new d(this,r)}}ye("SymbolInstanceArray",m);class y extends ih{getoffsetX(r){return this.float32[1*r+0]}}ye("GlyphOffsetArray",y);class E extends sa{getx(r){return this.int16[3*r+0]}gety(r){return this.int16[3*r+1]}gettileUnitDistanceFromAnchor(r){return this.int16[3*r+2]}}ye("SymbolLineVertexArray",E);class C extends Gu{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]}}C.prototype.size=12;class M extends rh{get(r){return new C(this,r)}}ye("TextAnchorOffsetArray",M);class k extends Gu{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]}}k.prototype.size=8;class N extends fl{get(r){return new k(this,r)}}ye("FeatureIndexArray",N);class F extends qu{}class W extends qu{}class rt extends qu{}class it extends Af{}class at extends kf{}class tt extends ju{}class _t extends $c{}class kt extends Df{}class ut extends Rf{}class wt extends aa{}class Dt extends Zu{}class zt extends Wu{}class Bt extends nh{}class Qt extends Nf{}const Jt=Ni([{name:"a_pos",components:2,type:"Int16"}],4),{members:ie}=Jt;class ae{constructor(r=[]){this.segments=r}prepareSegment(r,l,p,g){let x=this.segments[this.segments.length-1];return r>ae.MAX_VERTEX_ARRAY_LENGTH&&ee(`Max vertices per segment is ${ae.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${r}`),(!x||x.vertexLength+r>ae.MAX_VERTEX_ARRAY_LENGTH||x.sortKey!==g)&&(x={vertexOffset:l.length,primitiveOffset:p.length,vertexLength:0,primitiveLength:0},g!==void 0&&(x.sortKey=g),this.segments.push(x)),x}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,p,g){return new ae([{vertexOffset:r,primitiveOffset:l,vertexLength:p,primitiveLength:g,vaos:{},sortKey:0}])}}function Je(a,r){return 256*(a=lt(Math.floor(a),0,255))+lt(Math.floor(r),0,255)}ae.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ye("SegmentVector",ae);const le=Ni([{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 ze={exports:{}},Qe={exports:{}};Qe.exports=function(a,r){var l,p,g,x,b,S,T,P;for(p=a.length-(l=3&a.length),g=r,b=3432918353,S=461845907,P=0;P>>16)*b&65535)<<16)&4294967295)<<15|T>>>17))*S+(((T>>>16)*S&65535)<<16)&4294967295)<<13|g>>>19))+((5*(g>>>16)&65535)<<16)&4294967295))+((58964+(x>>>16)&65535)<<16);switch(T=0,l){case 3:T^=(255&a.charCodeAt(P+2))<<16;case 2:T^=(255&a.charCodeAt(P+1))<<8;case 1:g^=T=(65535&(T=(T=(65535&(T^=255&a.charCodeAt(P)))*b+(((T>>>16)*b&65535)<<16)&4294967295)<<15|T>>>17))*S+(((T>>>16)*S&65535)<<16)&4294967295}return g^=a.length,g=2246822507*(65535&(g^=g>>>16))+((2246822507*(g>>>16)&65535)<<16)&4294967295,g=3266489909*(65535&(g^=g>>>13))+((3266489909*(g>>>16)&65535)<<16)&4294967295,(g^=g>>>16)>>>0};var xn=Qe.exports,Ue={exports:{}};Ue.exports=function(a,r){for(var l,p=a.length,g=r^p,x=0;p>=4;)l=1540483477*(65535&(l=255&a.charCodeAt(x)|(255&a.charCodeAt(++x))<<8|(255&a.charCodeAt(++x))<<16|(255&a.charCodeAt(++x))<<24))+((1540483477*(l>>>16)&65535)<<16),g=1540483477*(65535&g)+((1540483477*(g>>>16)&65535)<<16)^(l=1540483477*(65535&(l^=l>>>24))+((1540483477*(l>>>16)&65535)<<16)),p-=4,++x;switch(p){case 3:g^=(255&a.charCodeAt(x+2))<<16;case 2:g^=(255&a.charCodeAt(x+1))<<8;case 1:g=1540483477*(65535&(g^=255&a.charCodeAt(x)))+((1540483477*(g>>>16)&65535)<<16)}return g=1540483477*(65535&(g^=g>>>13))+((1540483477*(g>>>16)&65535)<<16),(g^=g>>>15)>>>0};var rn=xn,an=Ue.exports;ze.exports=rn,ze.exports.murmur3=rn,ze.exports.murmur2=an;var bi=v(ze.exports);class Fn{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(r,l,p,g){this.ids.push(Co(r)),this.positions.push(l,p,g)}getPositions(r){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const l=Co(r);let p=0,g=this.ids.length-1;for(;p>1;this.ids[b]>=l?g=b:p=b+1}const x=[];for(;this.ids[p]===l;)x.push({index:this.positions[3*p],start:this.positions[3*p+1],end:this.positions[3*p+2]}),p++;return x}static serialize(r,l){const p=new Float64Array(r.ids),g=new Uint32Array(r.positions);return Ji(p,g,0,p.length-1),l&&l.push(p.buffer,g.buffer),{ids:p,positions:g}}static deserialize(r){const l=new Fn;return l.ids=r.ids,l.positions=r.positions,l.indexed=!0,l}}function Co(a){const r=+a;return!isNaN(r)&&r<=Number.MAX_SAFE_INTEGER?r:bi(String(a))}function Ji(a,r,l,p){for(;l>1];let x=l-1,b=p+1;for(;;){do x++;while(a[x]g);if(x>=b)break;ci(a,x,b),ci(r,3*x,3*b),ci(r,3*x+1,3*b+1),ci(r,3*x+2,3*b+2)}b-l`u_${g}`),this.type=p}setUniform(r,l,p){r.set(p.constantOr(this.value))}getBinding(r,l,p){return this.type==="color"?new Da(r,l):new To(r,l)}}class Zi{constructor(r,l){this.uniformNames=l.map(p=>`u_${p}`),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,p,g){const x=g==="u_pattern_to"?this.patternTo:g==="u_pattern_from"?this.patternFrom:g==="u_pixel_ratio_to"?this.pixelRatioTo:g==="u_pixel_ratio_from"?this.pixelRatioFrom:null;x&&r.set(x)}getBinding(r,l,p){return p.substr(0,9)==="u_pattern"?new Ds(r,l):new To(r,l)}}class hi{constructor(r,l,p,g){this.expression=r,this.type=p,this.maxValue=0,this.paintVertexAttributes=l.map(x=>({name:`a_${x}`,type:"Float32",components:p==="color"?2:1,offset:0})),this.paintVertexArray=new g}populatePaintArray(r,l,p,g,x){const b=this.paintVertexArray.length,S=this.expression.evaluate(new ti(0),l,{},g,[],x);this.paintVertexArray.resize(r),this._setPaintValue(b,r,S)}updatePaintArray(r,l,p,g){const x=this.expression.evaluate({zoom:0},p,g);this._setPaintValue(r,l,x)}_setPaintValue(r,l,p){if(this.type==="color"){const g=Ra(p);for(let x=r;x`u_${S}_t`),this.type=p,this.useIntegerZoom=g,this.zoom=x,this.maxValue=0,this.paintVertexAttributes=l.map(S=>({name:`a_${S}`,type:"Float32",components:p==="color"?4:2,offset:0})),this.paintVertexArray=new b}populatePaintArray(r,l,p,g,x){const b=this.expression.evaluate(new ti(this.zoom),l,{},g,[],x),S=this.expression.evaluate(new ti(this.zoom+1),l,{},g,[],x),T=this.paintVertexArray.length;this.paintVertexArray.resize(r),this._setPaintValue(T,r,b,S)}updatePaintArray(r,l,p,g){const x=this.expression.evaluate({zoom:this.zoom},p,g),b=this.expression.evaluate({zoom:this.zoom+1},p,g);this._setPaintValue(r,l,x,b)}_setPaintValue(r,l,p,g){if(this.type==="color"){const x=Ra(p),b=Ra(g);for(let S=r;S`#define HAS_UNIFORM_${g}`))}return r}getBinderAttributes(){const r=[];for(const l in this.binders){const p=this.binders[l];if(p instanceof hi||p instanceof ei)for(let g=0;g!0){this.programConfigurations={};for(const g of r)this.programConfigurations[g.id]=new Wi(g,l,p);this.needsUpload=!1,this._featureMap=new Fn,this._bufferOffset=0}populatePaintArrays(r,l,p,g,x,b){for(const S in this.programConfigurations)this.programConfigurations[S].populatePaintArrays(r,l,g,x,b);l.id!==void 0&&this._featureMap.add(l.id,p,this._bufferOffset,r),this._bufferOffset=r,this.needsUpload=!0}updatePaintArrays(r,l,p,g){for(const x of p)this.needsUpload=this.programConfigurations[x.id].updatePaintArrays(r,this._featureMap,l,x,g)||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 Wo(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 Hi(a,r,l){const p={color:{source:ju,composite:oh},number:{source:ih,composite:ju}},g=function(x){return{"line-pattern":{source:_t,composite:_t},"fill-pattern":{source:_t,composite:_t},"fill-extrusion-pattern":{source:_t,composite:_t}}[x]}(a);return g&&g[l]||p[r][l]}ye("ConstantBinder",Rs),ye("CrossFadedConstantBinder",Zi),ye("SourceExpressionBinder",hi),ye("CrossFadedCompositeBinder",Zo),ye("CompositeExpressionBinder",ei),ye("ProgramConfiguration",Wi,{omit:["_buffers"]}),ye("ProgramConfigurationSet",fi);const Mi=8192,Of=Math.pow(2,14)-1,Rd=-Of-1;function pl(a){const r=Mi/a.extent,l=a.loadGeometry();for(let p=0;pb.x+1||Tb.y+1)&&ee("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?pl(a):[]}}function sh(a,r,l,p,g){a.emplaceBack(2*r+(p+1)/2,2*l+(g+1)/2)}class Na{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 W,this.indexArray=new Bt,this.segments=new ae,this.programConfigurations=new fi(r.layers,r.zoom),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(r,l,p){const g=this.layers[0],x=[];let b=null,S=!1;g.type==="circle"&&(b=g.layout.get("circle-sort-key"),S=!b.isConstant());for(const{feature:T,id:P,index:D,sourceLayerIndex:R}of r){const V=this.layers[0]._featureFilter.needGeometry,Z=dl(T,V);if(!this.layers[0]._featureFilter.filter(new ti(this.zoom),Z,p))continue;const H=S?b.evaluate(Z,{},p):void 0,et={id:P,properties:T.properties,type:T.type,sourceLayerIndex:R,index:D,geometry:V?Z.geometry:pl(T),patterns:{},sortKey:H};x.push(et)}S&&x.sort((T,P)=>T.sortKey-P.sortKey);for(const T of x){const{geometry:P,index:D,sourceLayerIndex:R}=T,V=r[D].feature;this.addFeature(T,P,D,p),l.featureIndex.insert(V,P,D,R,this.index)}}update(r,l,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,l,this.stateDependentLayers,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,ie),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,p,g){for(const x of l)for(const b of x){const S=b.x,T=b.y;if(S<0||S>=Mi||T<0||T>=Mi)continue;const P=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,r.sortKey),D=P.vertexLength;sh(this.layoutVertexArray,S,T,-1,-1),sh(this.layoutVertexArray,S,T,1,-1),sh(this.layoutVertexArray,S,T,1,1),sh(this.layoutVertexArray,S,T,-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,p,{},g)}}function Ff(a,r){for(let l=0;l1){if(ah(a,r))return!0;for(let p=0;p1?l:l.sub(r)._mult(g)._add(r))}function by(a,r){let l,p,g,x=!1;for(let b=0;br.y!=g.y>r.y&&r.x<(g.x-p.x)*(r.y-p.y)/(g.y-p.y)+p.x&&(x=!x)}return x}function lh(a,r){let l=!1;for(let p=0,g=a.length-1;pr.y!=b.y>r.y&&r.x<(b.x-x.x)*(r.y-x.y)/(b.y-x.y)+x.x&&(l=!l)}return l}function jb(a,r,l){const p=l[0],g=l[2];if(a.xg.x&&r.x>g.x||a.yg.y&&r.y>g.y)return!1;const x=Tt(a,r,l[0]);return x!==Tt(a,r,l[1])||x!==Tt(a,r,l[2])||x!==Tt(a,r,l[3])}function Gf(a,r,l){const p=r.paint.get(a).value;return p.kind==="constant"?p.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,p,g){if(!r[0]&&!r[1])return a;const x=L.convert(r)._mult(g);l==="viewport"&&x._rotate(-p);const b=[];for(let S=0;SEy(ot,et))}(P,T),Z=R?D*S:D;for(const H of g)for(const et of H){const ot=R?et:Ey(et,T);let ft=Z;const Et=Fd([],[et.x,et.y,0,1],T);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ft*=Et[3]/b.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ft*=b.cameraToCenterDistance/Et[3]),Nd(V,ot,ft))return!0}return!1}}function Ey(a,r){const l=Fd([],[a.x,a.y,0,1],r);return new L(l[0]/l[3],l[1]/l[3])}class Cy extends Na{}let Ty;ye("HeatmapBucket",Cy,{omit:["layers"]});var Xb={get paint(){return Ty=Ty||new so({"heatmap-radius":new Re(Mt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Re(Mt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ee(Mt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Lf(Mt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ee(Mt.paint_heatmap["heatmap-opacity"])})}};function xg(a,{width:r,height:l},p,g){if(g){if(g instanceof Uint8ClampedArray)g=new Uint8Array(g.buffer);else if(g.length!==r*l*p)throw new RangeError(`mismatched image size. expected: ${g.length} but got: ${r*l*p}`)}else g=new Uint8Array(r*l*p);return a.width=r,a.height=l,a.data=g,a}function Ly(a,{width:r,height:l},p){if(r===a.width&&l===a.height)return;const g=xg({},{width:r,height:l},p);bg(a,g,{x:0,y:0},{x:0,y:0},{width:Math.min(a.width,r),height:Math.min(a.height,l)},p),a.width=r,a.height=l,a.data=g.data}function bg(a,r,l,p,g,x){if(g.width===0||g.height===0)return r;if(g.width>a.width||g.height>a.height||l.x>a.width-g.width||l.y>a.height-g.height)throw new RangeError("out of range source coordinates for image copy");if(g.width>r.width||g.height>r.height||p.x>r.width-g.width||p.y>r.height-g.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 T=0;T{r[a.evaluationKey]=T;const P=a.expression.evaluate(r);g.data[b+S+0]=Math.floor(255*P.r/P.a),g.data[b+S+1]=Math.floor(255*P.g/P.a),g.data[b+S+2]=Math.floor(255*P.b/P.a),g.data[b+S+3]=Math.floor(255*P.a)};if(a.clips)for(let b=0,S=0;b80*l){p=x=a[0],g=b=a[1];for(var H=l;Hx&&(x=S),T>b&&(b=T);P=(P=Math.max(x-p,b-g))!==0?32767/P:0}return Zf(V,Z,l,p,g,P,0),Z}function Ay(a,r,l,p,g){var x,b;if(g===Eg(a,r,l,p)>0)for(x=r;x=r;x-=p)b=Ry(x,a[x],a[x+1],b);return b&&Vd(b,b.next)&&(Hf(b),b=b.next),b}function Xu(a,r){if(!a)return a;r||(r=a);var l,p=a;do if(l=!1,p.steiner||!Vd(p,p.next)&&zi(p.prev,p,p.next)!==0)p=p.next;else{if(Hf(p),(p=r=p.prev)===p.next)break;l=!0}while(l||p!==r);return r}function Zf(a,r,l,p,g,x,b){if(a){!b&&x&&function(D,R,V,Z){var H=D;do H.z===0&&(H.z=Sg(H.x,H.y,R,V,Z)),H.prevZ=H.prev,H.nextZ=H.next,H=H.next;while(H!==D);H.prevZ.nextZ=null,H.prevZ=null,function(et){var ot,ft,Et,gt,bt,Xt,Yt,me,be=1;do{for(ft=et,et=null,bt=null,Xt=0;ft;){for(Xt++,Et=ft,Yt=0,ot=0;ot0||me>0&&Et;)Yt!==0&&(me===0||!Et||ft.z<=Et.z)?(gt=ft,ft=ft.nextZ,Yt--):(gt=Et,Et=Et.nextZ,me--),bt?bt.nextZ=gt:et=gt,gt.prevZ=bt,bt=gt;ft=Et}bt.nextZ=null,be*=2}while(Xt>1)}(H)}(a,p,g,x);for(var S,T,P=a;a.prev!==a.next;)if(S=a.prev,T=a.next,x?ew(a,p,g,x):tw(a))r.push(S.i/l|0),r.push(a.i/l|0),r.push(T.i/l|0),Hf(a),a=T.next,P=T.next;else if((a=T)===P){b?b===1?Zf(a=nw(Xu(a),r,l),r,l,p,g,x,2):b===2&&iw(a,r,l,p,g,x):Zf(Xu(a),r,l,p,g,x,1);break}}}function tw(a){var r=a.prev,l=a,p=a.next;if(zi(r,l,p)>=0)return!1;for(var g=r.x,x=l.x,b=p.x,S=r.y,T=l.y,P=p.y,D=gx?g>b?g:b:x>b?x:b,Z=S>T?S>P?S:P:T>P?T:P,H=p.next;H!==r;){if(H.x>=D&&H.x<=V&&H.y>=R&&H.y<=Z&&ch(g,S,x,T,b,P,H.x,H.y)&&zi(H.prev,H,H.next)>=0)return!1;H=H.next}return!0}function ew(a,r,l,p){var g=a.prev,x=a,b=a.next;if(zi(g,x,b)>=0)return!1;for(var S=g.x,T=x.x,P=b.x,D=g.y,R=x.y,V=b.y,Z=ST?S>P?S:P:T>P?T:P,ot=D>R?D>V?D:V:R>V?R:V,ft=Sg(Z,H,r,l,p),Et=Sg(et,ot,r,l,p),gt=a.prevZ,bt=a.nextZ;gt&>.z>=ft&&bt&&bt.z<=Et;){if(gt.x>=Z&>.x<=et&>.y>=H&>.y<=ot&>!==g&>!==b&&ch(S,D,T,R,P,V,gt.x,gt.y)&&zi(gt.prev,gt,gt.next)>=0||(gt=gt.prevZ,bt.x>=Z&&bt.x<=et&&bt.y>=H&&bt.y<=ot&&bt!==g&&bt!==b&&ch(S,D,T,R,P,V,bt.x,bt.y)&&zi(bt.prev,bt,bt.next)>=0))return!1;bt=bt.nextZ}for(;gt&>.z>=ft;){if(gt.x>=Z&>.x<=et&>.y>=H&>.y<=ot&>!==g&>!==b&&ch(S,D,T,R,P,V,gt.x,gt.y)&&zi(gt.prev,gt,gt.next)>=0)return!1;gt=gt.prevZ}for(;bt&&bt.z<=Et;){if(bt.x>=Z&&bt.x<=et&&bt.y>=H&&bt.y<=ot&&bt!==g&&bt!==b&&ch(S,D,T,R,P,V,bt.x,bt.y)&&zi(bt.prev,bt,bt.next)>=0)return!1;bt=bt.nextZ}return!0}function nw(a,r,l){var p=a;do{var g=p.prev,x=p.next.next;!Vd(g,x)&&ky(g,p,p.next,x)&&Wf(g,x)&&Wf(x,g)&&(r.push(g.i/l|0),r.push(p.i/l|0),r.push(x.i/l|0),Hf(p),Hf(p.next),p=a=x),p=p.next}while(p!==a);return Xu(p)}function iw(a,r,l,p,g,x){var b=a;do{for(var S=b.next.next;S!==b.prev;){if(b.i!==S.i&&lw(b,S)){var T=Dy(b,S);return b=Xu(b,b.next),T=Xu(T,T.next),Zf(b,r,l,p,g,x,0),void Zf(T,r,l,p,g,x,0)}S=S.next}b=b.next}while(b!==a)}function rw(a,r){return a.x-r.x}function ow(a,r){var l=function(g,x){var b,S=x,T=g.x,P=g.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<=T&&R>D&&(D=R,b=S.x=S.x&&S.x>=H&&T!==S.x&&ch(Pb.x||S.x===b.x&&sw(b,S)))&&(b=S,ot=V)),S=S.next;while(S!==Z);return b}(a,r);if(!l)return r;var p=Dy(l,a);return Xu(p,p.next),Xu(l,l.next)}function sw(a,r){return zi(a.prev,a,r.prev)<0&&zi(r.next,a,a.next)<0}function Sg(a,r,l,p,g){return(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-l)*g|0)|a<<8))|a<<4))|a<<2))|a<<1))|(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-p)*g|0)|r<<8))|r<<4))|r<<2))|r<<1))<<1}function aw(a){var r=a,l=a;do(r.x=(a-b)*(x-S)&&(a-b)*(p-S)>=(l-b)*(r-S)&&(l-b)*(x-S)>=(g-b)*(p-S)}function lw(a,r){return a.next.i!==r.i&&a.prev.i!==r.i&&!function(l,p){var g=l;do{if(g.i!==l.i&&g.next.i!==l.i&&g.i!==p.i&&g.next.i!==p.i&&ky(g,g.next,l,p))return!0;g=g.next}while(g!==l);return!1}(a,r)&&(Wf(a,r)&&Wf(r,a)&&function(l,p){var g=l,x=!1,b=(l.x+p.x)/2,S=(l.y+p.y)/2;do g.y>S!=g.next.y>S&&g.next.y!==g.y&&b<(g.next.x-g.x)*(S-g.y)/(g.next.y-g.y)+g.x&&(x=!x),g=g.next;while(g!==l);return x}(a,r)&&(zi(a.prev,a,r.prev)||zi(a,r.prev,r))||Vd(a,r)&&zi(a.prev,a,a.next)>0&&zi(r.prev,r,r.next)>0)}function zi(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 ky(a,r,l,p){var g=Gd(zi(a,r,l)),x=Gd(zi(a,r,p)),b=Gd(zi(l,p,a)),S=Gd(zi(l,p,r));return g!==x&&b!==S||!(g!==0||!Ud(a,l,r))||!(x!==0||!Ud(a,p,r))||!(b!==0||!Ud(l,a,p))||!(S!==0||!Ud(l,r,p))}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 Wf(a,r){return zi(a.prev,a,a.next)<0?zi(a,r,a.next)>=0&&zi(a,a.prev,r)>=0:zi(a,r,a.prev)<0||zi(a,a.next,r)<0}function Dy(a,r){var l=new Ig(a.i,a.x,a.y),p=new Ig(r.i,r.x,r.y),g=a.next,x=r.prev;return a.next=r,r.prev=a,l.next=g,g.prev=l,p.next=l,l.prev=p,x.next=p,p.prev=x,p}function Ry(a,r,l,p){var g=new Ig(a,r,l);return p?(g.next=p.next,g.prev=p,p.next.prev=g,p.next=g):(g.prev=g,g.next=g),g}function Hf(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 Ig(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,p){for(var g=0,x=r,b=l-p;x0&&l.holes.push(p+=a[g-1].length)}return l};var Ny=v(wg.exports);function uw(a,r,l,p,g){zy(a,r,l||0,p||a.length-1,g||cw)}function zy(a,r,l,p,g){for(;p>l;){if(p-l>600){var x=p-l+1,b=r-l+1,S=Math.log(x),T=.5*Math.exp(2*S/3),P=.5*Math.sqrt(S*T*(x-T)/x)*(b-x/2<0?-1:1);zy(a,r,Math.max(l,Math.floor(r-b*T/x+P)),Math.min(p,Math.floor(r+(x-b)*T/x+P)),g)}var D=a[r],R=l,V=p;for(Xf(a,l,r),g(a[p],D)>0&&Xf(a,l,p);R0;)V--}g(a[l],D)===0?Xf(a,l,V):Xf(a,++V,p),V<=r&&(l=V+1),r<=V&&(p=V-1)}}function Xf(a,r,l){var p=a[r];a[r]=a[l],a[l]=p}function cw(a,r){return ar?1:0}function Cg(a,r){const l=a.length;if(l<=1)return[a];const p=[];let g,x;for(let b=0;b1)for(let b=0;bl.id),this.index=r.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new rt,this.indexArray=new Bt,this.indexArray2=new Qt,this.programConfigurations=new fi(r.layers,r.zoom),this.segments=new ae,this.segments2=new ae,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(r,l,p){this.hasPattern=Tg("fill",this.layers,l);const g=this.layers[0].layout.get("fill-sort-key"),x=!g.isConstant(),b=[];for(const{feature:S,id:T,index:P,sourceLayerIndex:D}of r){const R=this.layers[0]._featureFilter.needGeometry,V=dl(S,R);if(!this.layers[0]._featureFilter.filter(new ti(this.zoom),V,p))continue;const Z=x?g.evaluate(V,{},p,l.availableImages):void 0,H={id:T,properties:S.properties,type:S.type,sourceLayerIndex:D,index:P,geometry:R?V.geometry:pl(S),patterns:{},sortKey:Z};b.push(H)}x&&b.sort((S,T)=>S.sortKey-T.sortKey);for(const S of b){const{geometry:T,index:P,sourceLayerIndex:D}=S;if(this.hasPattern){const R=Lg("fill",this.layers,S,this.zoom,l);this.patternFeatures.push(R)}else this.addFeature(S,T,P,p,{});l.featureIndex.insert(r[P].feature,T,P,D,this.index)}}update(r,l,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,l,this.stateDependentLayers,p)}addFeatures(r,l,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,l,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,$b),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,p,g,x){for(const b of Cg(l,500)){let S=0;for(const Z of b)S+=Z.length;const T=this.segments.prepareSegment(S,this.layoutVertexArray,this.indexArray),P=T.vertexLength,D=[],R=[];for(const Z of b){if(Z.length===0)continue;Z!==b[0]&&R.push(D.length/2);const H=this.segments2.prepareSegment(Z.length,this.layoutVertexArray,this.indexArray2),et=H.vertexLength;this.layoutVertexArray.emplaceBack(Z[0].x,Z[0].y),this.indexArray2.emplaceBack(et+Z.length-1,et),D.push(Z[0].x),D.push(Z[0].y);for(let ot=1;ot>3}if(g--,p===1||p===2)x+=a.readSVarint(),b+=a.readSVarint(),p===1&&(r&&S.push(r),r=[]),r.push(new _w(x,b));else{if(p!==7)throw new Error("unknown command "+p);r&&r.push(r[0].clone())}}return r&&S.push(r),S},hh.prototype.bbox=function(){var a=this._pbf;a.pos=this._geometry;for(var r=a.readVarint()+a.pos,l=1,p=0,g=0,x=0,b=1/0,S=-1/0,T=1/0,P=-1/0;a.pos>3}if(p--,l===1||l===2)(g+=a.readSVarint())S&&(S=g),(x+=a.readSVarint())P&&(P=x);else if(l!==7)throw new Error("unknown command "+l)}return[b,T,S,P]},hh.prototype.toGeoJSON=function(a,r,l){var p,g,x=this.extent*Math.pow(2,l),b=this.extent*a,S=this.extent*r,T=this.loadGeometry(),P=hh.types[this.type];function D(Z){for(var H=0;H>3;g=b===1?p.readString():b===2?p.readFloat():b===3?p.readDouble():b===4?p.readVarint64():b===5?p.readVarint():b===6?p.readSVarint():b===7?p.readBoolean():null}return g}(l))}Uy.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 xw(this._pbf,r,this.extent,this._keys,this._values)};var ww=Vy;function Sw(a,r,l){if(a===3){var p=new ww(l,l.readVarint()+l.pos);p.length&&(r[p.name]=p)}}Yl.VectorTile=function(a,r){this.layers=a.readFields(Sw,{},r)},Yl.VectorTileFeature=By,Yl.VectorTileLayer=Vy;const Iw=Yl.VectorTileFeature.types,Pg=Math.pow(2,13);function Yf(a,r,l,p,g,x,b,S){a.emplaceBack(r,l,2*Math.floor(p*Pg)+b,g*Pg*2,x*Pg*2,Math.round(S))}class Ag{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 it,this.centroidVertexArray=new F,this.indexArray=new Bt,this.programConfigurations=new fi(r.layers,r.zoom),this.segments=new ae,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(r,l,p){this.features=[],this.hasPattern=Tg("fill-extrusion",this.layers,l);for(const{feature:g,id:x,index:b,sourceLayerIndex:S}of r){const T=this.layers[0]._featureFilter.needGeometry,P=dl(g,T);if(!this.layers[0]._featureFilter.filter(new ti(this.zoom),P,p))continue;const D={id:x,sourceLayerIndex:S,index:b,geometry:T?P.geometry:pl(g),properties:g.properties,type:g.type,patterns:{}};this.hasPattern?this.features.push(Lg("fill-extrusion",this.layers,D,this.zoom,l)):this.addFeature(D,D.geometry,b,p,{}),l.featureIndex.insert(g,D.geometry,b,S,this.index,!0)}}addFeatures(r,l,p){for(const g of this.features){const{geometry:x}=g;this.addFeature(g,x,g.index,l,p)}}update(r,l,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,l,this.stateDependentLayers,p)}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,gw),this.centroidVertexBuffer=r.createVertexBuffer(this.centroidVertexArray,mw.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,p,g,x){const b={x:0,y:0,vertexCount:0};for(const S of Cg(l,500)){let T=0;for(const H of S)T+=H.length;let P=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const H of S){if(H.length===0||Cw(H))continue;let et=0;for(let ot=0;ot=1){const Et=H[ot-1];if(!Ew(ft,Et)){P.vertexLength+4>ae.MAX_VERTEX_ARRAY_LENGTH&&(P=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const gt=ft.sub(Et)._perp()._unit(),bt=Et.dist(ft);et+bt>32768&&(et=0),Yf(this.layoutVertexArray,ft.x,ft.y,gt.x,gt.y,0,0,et),Yf(this.layoutVertexArray,ft.x,ft.y,gt.x,gt.y,0,1,et),b.x+=2*ft.x,b.y+=2*ft.y,b.vertexCount+=2,et+=bt,Yf(this.layoutVertexArray,Et.x,Et.y,gt.x,gt.y,0,0,et),Yf(this.layoutVertexArray,Et.x,Et.y,gt.x,gt.y,0,1,et),b.x+=2*Et.x,b.y+=2*Et.y,b.vertexCount+=2;const Xt=P.vertexLength;this.indexArray.emplaceBack(Xt,Xt+2,Xt+1),this.indexArray.emplaceBack(Xt+1,Xt+2,Xt+3),P.vertexLength+=4,P.primitiveLength+=2}}}}if(P.vertexLength+T>ae.MAX_VERTEX_ARRAY_LENGTH&&(P=this.segments.prepareSegment(T,this.layoutVertexArray,this.indexArray)),Iw[r.type]!=="Polygon")continue;const D=[],R=[],V=P.vertexLength;for(const H of S)if(H.length!==0){H!==S[0]&&R.push(D.length/2);for(let et=0;etMi)||a.y===r.y&&(a.y<0||a.y>Mi)}function Cw(a){return a.every(r=>r.x<0)||a.every(r=>r.x>Mi)||a.every(r=>r.y<0)||a.every(r=>r.y>Mi)}let Gy;ye("FillExtrusionBucket",Ag,{omit:["layers","features"]});var Tw={get paint(){return Gy=Gy||new so({"fill-extrusion-opacity":new Ee(Mt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Re(Mt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ee(Mt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ee(Mt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Qc(Mt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Re(Mt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Re(Mt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ee(Mt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Lw extends us{constructor(r){super(r,Tw)}createBucket(r){return new Ag(r)}queryRadius(){return zd(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(r,l,p,g,x,b,S,T){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,p),R=this.paint.get("fill-extrusion-base").evaluate(l,p),V=function(H,et,ot,ft){const Et=[];for(const gt of H){const bt=[gt.x,gt.y,0,1];Fd(bt,bt,et),Et.push(new L(bt[0]/bt[3],bt[1]/bt[3]))}return Et}(P,T),Z=function(H,et,ot,ft){const Et=[],gt=[],bt=ft[8]*et,Xt=ft[9]*et,Yt=ft[10]*et,me=ft[11]*et,be=ft[8]*ot,de=ft[9]*ot,he=ft[10]*ot,oe=ft[11]*ot;for(const ve of H){const ue=[],$t=[];for(const De of ve){const Se=De.x,ln=De.y,Yn=ft[0]*Se+ft[4]*ln+ft[12],ni=ft[1]*Se+ft[5]*ln+ft[13],tr=ft[2]*Se+ft[6]*ln+ft[14],Ho=ft[3]*Se+ft[7]*ln+ft[15],lo=tr+Yt,Xi=Ho+me,xr=Yn+be,kr=ni+de,uo=tr+he,co=Ho+oe,er=new L((Yn+bt)/Xi,(ni+Xt)/Xi);er.z=lo/Xi,ue.push(er);const nr=new L(xr/co,kr/co);nr.z=uo/co,$t.push(nr)}Et.push(ue),gt.push($t)}return[Et,gt]}(g,R,D,T);return function(H,et,ot){let ft=1/0;Bf(ot,et)&&(ft=qy(ot,et[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 at,this.layoutVertexArray2=new tt,this.indexArray=new Bt,this.programConfigurations=new fi(r.layers,r.zoom),this.segments=new ae,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(r,l,p){this.hasPattern=Tg("line",this.layers,l);const g=this.layers[0].layout.get("line-sort-key"),x=!g.isConstant(),b=[];for(const{feature:S,id:T,index:P,sourceLayerIndex:D}of r){const R=this.layers[0]._featureFilter.needGeometry,V=dl(S,R);if(!this.layers[0]._featureFilter.filter(new ti(this.zoom),V,p))continue;const Z=x?g.evaluate(V,{},p):void 0,H={id:T,properties:S.properties,type:S.type,sourceLayerIndex:D,index:P,geometry:R?V.geometry:pl(S),patterns:{},sortKey:Z};b.push(H)}x&&b.sort((S,T)=>S.sortKey-T.sortKey);for(const S of b){const{geometry:T,index:P,sourceLayerIndex:D}=S;if(this.hasPattern){const R=Lg("line",this.layers,S,this.zoom,l);this.patternFeatures.push(R)}else this.addFeature(S,T,P,p,{});l.featureIndex.insert(r[P].feature,T,P,D,this.index)}}update(r,l,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,l,this.stateDependentLayers,p)}addFeatures(r,l,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,l,p)}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,kw)),this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,Pw),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,p,g,x){const b=this.layers[0].layout,S=b.get("line-join").evaluate(r,{}),T=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,T,P,D);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,p,x,g)}addLine(r,l,p,g,x,b){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let ft=0;ft=2&&r[T-1].equals(r[T-2]);)T--;let P=0;for(;P0;if(me&&ft>P){const oe=V.dist(Z);if(oe>2*D){const ve=V.sub(V.sub(Z)._mult(D/oe)._round());this.updateDistance(Z,ve),this.addCurrentVertex(ve,et,0,0,R),Z=ve}}const de=Z&&H;let he=de?p:S?"butt":g;if(de&&he==="round"&&(Xtx&&(he="bevel"),he==="bevel"&&(Xt>2&&(he="flipbevel"),Xt100)Et=ot.mult(-1);else{const oe=Xt*et.add(ot).mag()/et.sub(ot).mag();Et._perp()._mult(oe*(be?-1:1))}this.addCurrentVertex(V,Et,0,0,R),this.addCurrentVertex(V,Et.mult(-1),0,0,R)}else if(he==="bevel"||he==="fakeround"){const oe=-Math.sqrt(Xt*Xt-1),ve=be?oe:0,ue=be?0:oe;if(Z&&this.addCurrentVertex(V,et,ve,ue,R),he==="fakeround"){const $t=Math.round(180*Yt/Math.PI/20);for(let De=1;De<$t;De++){let Se=De/$t;if(Se!==.5){const Yn=Se-.5;Se+=Se*Yn*(Se-1)*((1.0904+gt*(gt*(3.55645-1.43519*gt)-3.2452))*Yn*Yn+(.848013+gt*(.215638*gt-1.06021)))}const ln=ot.sub(et)._mult(Se)._add(et)._unit()._mult(be?-1:1);this.addHalfVertex(V,ln.x,ln.y,!1,be,0,R)}}H&&this.addCurrentVertex(V,ot,-ve,-ue,R)}else if(he==="butt")this.addCurrentVertex(V,Et,0,0,R);else if(he==="square"){const oe=Z?1:-1;this.addCurrentVertex(V,Et,oe,oe,R)}else he==="round"&&(Z&&(this.addCurrentVertex(V,et,0,0,R),this.addCurrentVertex(V,et,1,1,R,!0)),H&&(this.addCurrentVertex(V,ot,-1,-1,R,!0),this.addCurrentVertex(V,ot,0,0,R)));if(me&&ft2*D){const ve=V.add(H.sub(V)._mult(D/oe)._round());this.updateDistance(V,ve),this.addCurrentVertex(ve,ot,0,0,R),V=ve}}}}addCurrentVertex(r,l,p,g,x,b=!1){const S=l.y*g-l.x,T=-l.y-l.x*g;this.addHalfVertex(r,l.x+l.y*p,l.y-l.x*p,b,!1,p,x),this.addHalfVertex(r,S,T,b,!0,-g,x),this.distance>jy/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(r,l,p,g,x,b))}addHalfVertex({x:r,y:l},p,g,x,b,S,T){const P=.5*(this.lineClips?this.scaledDistance*(jy-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((r<<1)+(x?1:0),(l<<1)+(b?1:0),Math.round(63*p)+128,Math.round(63*g)+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=T.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,D),T.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 Zy,Wy;ye("LineBucket",kg,{omit:["layers","patternFeatures"]});var Hy={get paint(){return Wy=Wy||new so({"line-opacity":new Re(Mt.paint_line["line-opacity"]),"line-color":new Re(Mt.paint_line["line-color"]),"line-translate":new Ee(Mt.paint_line["line-translate"]),"line-translate-anchor":new Ee(Mt.paint_line["line-translate-anchor"]),"line-width":new Re(Mt.paint_line["line-width"]),"line-gap-width":new Re(Mt.paint_line["line-gap-width"]),"line-offset":new Re(Mt.paint_line["line-offset"]),"line-blur":new Re(Mt.paint_line["line-blur"]),"line-dasharray":new Uu(Mt.paint_line["line-dasharray"]),"line-pattern":new Qc(Mt.paint_line["line-pattern"]),"line-gradient":new Lf(Mt.paint_line["line-gradient"])})},get layout(){return Zy=Zy||new so({"line-cap":new Ee(Mt.layout_line["line-cap"]),"line-join":new Re(Mt.layout_line["line-join"]),"line-miter-limit":new Ee(Mt.layout_line["line-miter-limit"]),"line-round-limit":new Ee(Mt.layout_line["line-round-limit"]),"line-sort-key":new Re(Mt.layout_line["line-sort-key"])})}};class Nw extends Re{possiblyEvaluate(r,l){return l=new ti(Math.floor(l.zoom),{now:l.now,fadeDuration:l.fadeDuration,zoomHistory:l.zoomHistory,transition:l.transition}),super.possiblyEvaluate(r,l)}evaluate(r,l,p,g){return l=dt({},l,{zoom:Math.floor(l.zoom)}),super.evaluate(r,l,p,g)}}let qd;class zw extends us{constructor(r){super(r,Hy),this.gradientVersion=0,qd||(qd=new Nw(Hy.paint.properties["line-width"].specification),qd.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(r){if(r==="line-gradient"){const l=this.gradientExpression();this.stepInterpolant=!!function(p){return p._styleExpression!==void 0}(l)&&l._styleExpression.expression instanceof Du,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 kg(r)}queryRadius(r){const l=r,p=Xy(Gf("line-width",this,l),Gf("line-gap-width",this,l)),g=Gf("line-offset",this,l);return p/2+Math.abs(g)+zd(this.paint.get("line-translate"))}queryIntersectsFeature(r,l,p,g,x,b,S){const T=Od(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),b.angle,S),P=S/2*Xy(this.paint.get("line-width").evaluate(l,p),this.paint.get("line-gap-width").evaluate(l,p)),D=this.paint.get("line-offset").evaluate(l,p);return D&&(g=function(R,V){const Z=[];for(let H=0;H=3){for(let ot=0;ot0?r+2*a:a}const Ow=Ni([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Fw=Ni([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ni([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Bw=Ni([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Ni([{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 Yy=Ni([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Vw=Ni([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Uw(a,r,l){return a.sections.forEach(p=>{p.text=function(g,x,b){const S=x.layout.get("text-transform").evaluate(b,{});return S==="uppercase"?g=g.toLocaleUpperCase():S==="lowercase"&&(g=g.toLocaleLowerCase()),ka.applyArabicShaping&&(g=ka.applyArabicShaping(g)),g}(p.text,r,l)}),a}Ni([{name:"triangle",components:3,type:"Uint16"}]),Ni([{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"}]),Ni([{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"}]),Ni([{type:"Float32",name:"offsetX"}]),Ni([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Ni([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Jf={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var $i=24,Ky=Un,Jy=function(a,r,l,p,g){var x,b,S=8*g-p-1,T=(1<>1,D=-7,R=l?g-1:0,V=l?-1:1,Z=a[r+R];for(R+=V,x=Z&(1<<-D)-1,Z>>=-D,D+=S;D>0;x=256*x+a[r+R],R+=V,D-=8);for(b=x&(1<<-D)-1,x>>=-D,D+=p;D>0;b=256*b+a[r+R],R+=V,D-=8);if(x===0)x=1-P;else{if(x===T)return b?NaN:1/0*(Z?-1:1);b+=Math.pow(2,p),x-=P}return(Z?-1:1)*b*Math.pow(2,x-p)},Qy=function(a,r,l,p,g,x){var b,S,T,P=8*x-g-1,D=(1<>1,V=g===23?Math.pow(2,-24)-Math.pow(2,-77):0,Z=p?0:x-1,H=p?1:-1,et=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*(T=Math.pow(2,-b))<1&&(b--,T*=2),(r+=b+R>=1?V/T:V*Math.pow(2,1-R))*T>=2&&(b++,T/=2),b+R>=D?(S=0,b=D):b+R>=1?(S=(r*T-1)*Math.pow(2,g),b+=R):(S=r*Math.pow(2,R-1)*Math.pow(2,g),b=0));g>=8;a[l+Z]=255&S,Z+=H,S/=256,g-=8);for(b=b<0;a[l+Z]=255&b,Z+=H,b/=256,P-=8);a[l+Z-H]|=128*et};function Un(a){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(a)?a:new Uint8Array(a||0),this.pos=0,this.type=0,this.length=this.buf.length}Un.Varint=0,Un.Fixed64=1,Un.Bytes=2,Un.Fixed32=5;var Dg=4294967296,$y=1/Dg,t0=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ml(a){return a.type===Un.Bytes?a.readVarint()+a.pos:a.pos+1}function fh(a,r,l){return l?4294967296*r+(a>>>0):4294967296*(r>>>0)+(a>>>0)}function e0(a,r,l){var p=r<=16383?1:r<=2097151?2:r<=268435455?3:Math.floor(Math.log(r)/(7*Math.LN2));l.realloc(p);for(var g=l.pos-1;g>=a;g--)l.buf[g+p]=l.buf[g]}function Gw(a,r){for(var l=0;l>>8,a[l+2]=r>>>16,a[l+3]=r>>>24}function n0(a,r){return(a[r]|a[r+1]<<8|a[r+2]<<16)+(a[r+3]<<24)}Un.prototype={destroy:function(){this.buf=null},readFields:function(a,r,l){for(l=l||this.length;this.pos>3,x=this.pos;this.type=7&p,a(g,r,this),this.pos===x&&this.skip(p)}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=n0(this.buf,this.pos);return this.pos+=4,a},readFixed64:function(){var a=jd(this.buf,this.pos)+jd(this.buf,this.pos+4)*Dg;return this.pos+=8,a},readSFixed64:function(){var a=jd(this.buf,this.pos)+n0(this.buf,this.pos+4)*Dg;return this.pos+=8,a},readFloat:function(){var a=Jy(this.buf,this.pos,!0,23,4);return this.pos+=4,a},readDouble:function(){var a=Jy(this.buf,this.pos,!0,52,8);return this.pos+=8,a},readVarint:function(a){var r,l,p=this.buf;return r=127&(l=p[this.pos++]),l<128?r:(r|=(127&(l=p[this.pos++]))<<7,l<128?r:(r|=(127&(l=p[this.pos++]))<<14,l<128?r:(r|=(127&(l=p[this.pos++]))<<21,l<128?r:function(g,x,b){var S,T,P=b.buf;if(S=(112&(T=P[b.pos++]))>>4,T<128||(S|=(127&(T=P[b.pos++]))<<3,T<128)||(S|=(127&(T=P[b.pos++]))<<10,T<128)||(S|=(127&(T=P[b.pos++]))<<17,T<128)||(S|=(127&(T=P[b.pos++]))<<24,T<128)||(S|=(1&(T=P[b.pos++]))<<31,T<128))return fh(g,S,x);throw new Error("Expected varint not more than 10 bytes")}(r|=(15&(l=p[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&&t0?function(l,p,g){return t0.decode(l.subarray(p,g))}(this.buf,r,a):function(l,p,g){for(var x="",b=p;b239?4:D>223?3:D>191?2:1;if(b+V>g)break;V===1?D<128&&(R=D):V===2?(192&(S=l[b+1]))==128&&(R=(31&D)<<6|63&S)<=127&&(R=null):V===3?(T=l[b+2],(192&(S=l[b+1]))==128&&(192&T)==128&&((R=(15&D)<<12|(63&S)<<6|63&T)<=2047||R>=55296&&R<=57343)&&(R=null)):V===4&&(T=l[b+2],P=l[b+3],(192&(S=l[b+1]))==128&&(192&T)==128&&(192&P)==128&&((R=(15&D)<<18|(63&S)<<12|(63&T)<<6|63&P)<=65535||R>=1114112)&&(R=null)),R===null?(R=65533,V=1):R>65535&&(R-=65536,x+=String.fromCharCode(R>>>10&1023|55296),R=56320|1023&R),x+=String.fromCharCode(R),b+=V}return x}(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!==Un.Bytes)return a.push(this.readVarint(r));var l=ml(this);for(a=a||[];this.pos127;);else if(r===Un.Bytes)this.pos=this.readVarint()+this.pos;else if(r===Un.Fixed32)this.pos+=4;else{if(r!==Un.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 p,g;if(r>=0?(p=r%4294967296|0,g=r/4294967296|0):(g=~(-r/4294967296),4294967295^(p=~(-r%4294967296))?p=p+1|0:(p=0,g=g+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");l.realloc(10),function(x,b,S){S.buf[S.pos++]=127&x|128,x>>>=7,S.buf[S.pos++]=127&x|128,x>>>=7,S.buf[S.pos++]=127&x|128,x>>>=7,S.buf[S.pos++]=127&x|128,S.buf[S.pos]=127&(x>>>=7)}(p,0,l),function(x,b){var S=(7&x)<<4;b.buf[b.pos++]|=S|((x>>>=3)?128:0),x&&(b.buf[b.pos++]=127&x|((x>>>=7)?128:0),x&&(b.buf[b.pos++]=127&x|((x>>>=7)?128:0),x&&(b.buf[b.pos++]=127&x|((x>>>=7)?128:0),x&&(b.buf[b.pos++]=127&x|((x>>>=7)?128:0),x&&(b.buf[b.pos++]=127&x)))))}(g,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(p,g,x){for(var b,S,T=0;T55295&&b<57344){if(!S){b>56319||T+1===g.length?(p[x++]=239,p[x++]=191,p[x++]=189):S=b;continue}if(b<56320){p[x++]=239,p[x++]=191,p[x++]=189,S=b;continue}b=S-55296<<10|b-56320|65536,S=null}else S&&(p[x++]=239,p[x++]=191,p[x++]=189,S=null);b<128?p[x++]=b:(b<2048?p[x++]=b>>6|192:(b<65536?p[x++]=b>>12|224:(p[x++]=b>>18|240,p[x++]=b>>12&63|128),p[x++]=b>>6&63|128),p[x++]=63&b|128)}return x}(this.buf,a,this.pos);var l=this.pos-r;l>=128&&e0(r,l,this),this.pos=r-1,this.writeVarint(l),this.pos+=l},writeFloat:function(a){this.realloc(4),Qy(this.buf,a,this.pos,!0,23,4),this.pos+=4},writeDouble:function(a){this.realloc(8),Qy(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&&e0(l,p,this),this.pos=l-1,this.writeVarint(p),this.pos+=p},writeMessage:function(a,r,l){this.writeTag(a,Un.Bytes),this.writeRawMessage(r,l)},writePackedVarint:function(a,r){r.length&&this.writeMessage(a,Gw,r)},writePackedSVarint:function(a,r){r.length&&this.writeMessage(a,qw,r)},writePackedBoolean:function(a,r){r.length&&this.writeMessage(a,Ww,r)},writePackedFloat:function(a,r){r.length&&this.writeMessage(a,jw,r)},writePackedDouble:function(a,r){r.length&&this.writeMessage(a,Zw,r)},writePackedFixed32:function(a,r){r.length&&this.writeMessage(a,Hw,r)},writePackedSFixed32:function(a,r){r.length&&this.writeMessage(a,Xw,r)},writePackedFixed64:function(a,r){r.length&&this.writeMessage(a,Yw,r)},writePackedSFixed64:function(a,r){r.length&&this.writeMessage(a,Kw,r)},writeBytesField:function(a,r){this.writeTag(a,Un.Bytes),this.writeBytes(r)},writeFixed32Field:function(a,r){this.writeTag(a,Un.Fixed32),this.writeFixed32(r)},writeSFixed32Field:function(a,r){this.writeTag(a,Un.Fixed32),this.writeSFixed32(r)},writeFixed64Field:function(a,r){this.writeTag(a,Un.Fixed64),this.writeFixed64(r)},writeSFixed64Field:function(a,r){this.writeTag(a,Un.Fixed64),this.writeSFixed64(r)},writeVarintField:function(a,r){this.writeTag(a,Un.Varint),this.writeVarint(r)},writeSVarintField:function(a,r){this.writeTag(a,Un.Varint),this.writeSVarint(r)},writeStringField:function(a,r){this.writeTag(a,Un.Bytes),this.writeString(r)},writeFloatField:function(a,r){this.writeTag(a,Un.Fixed32),this.writeFloat(r)},writeDoubleField:function(a,r){this.writeTag(a,Un.Fixed64),this.writeDouble(r)},writeBooleanField:function(a,r){this.writeVarintField(a,!!r)}};var Rg=v(Ky);const Ng=3;function Jw(a,r,l){a===1&&l.readMessage(Qw,r)}function Qw(a,r,l){if(a===3){const{id:p,bitmap:g,width:x,height:b,left:S,top:T,advance:P}=l.readMessage($w,{});r.push({id:p,bitmap:new jf({width:x+2*Ng,height:b+2*Ng},g),metrics:{width:x,height:b,left:S,top:T,advance:P}})}}function $w(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 i0=Ng;function r0(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 p=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),l),h:1/0}];let g=0,x=0;for(const b of a)for(let S=p.length-1;S>=0;S--){const T=p[S];if(!(b.w>T.w||b.h>T.h)){if(b.x=T.x,b.y=T.y,x=Math.max(x,b.y+b.h),g=Math.max(g,b.x+b.w),b.w===T.w&&b.h===T.h){const P=p.pop();S=0&&p>=r&&Wd[this.text.charCodeAt(p)];p--)l--;this.text=this.text.substring(r,l),this.sectionIndex=this.sectionIndex.slice(r,l)}substring(r,l){const p=new dh;return p.text=this.text.substring(r,l),p.sectionIndex=this.sectionIndex.slice(r,l),p.sections=this.sections,p}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($f.forText(r.scale,r.fontStack||l));const p=this.sections.length-1;for(let g=0;g=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Zd(a,r,l,p,g,x,b,S,T,P,D,R,V,Z,H,et){const ot=dh.fromFeature(a,g);let ft;R===f.ah.vertical&&ot.verticalizePunctuation();const{processBidirectionalText:Et,processStyledBidirectionalText:gt}=ka;if(Et&&ot.sections.length===1){ft=[];const Yt=Et(ot.toString(),Og(ot,P,x,r,p,Z,H));for(const me of Yt){const be=new dh;be.text=me,be.sections=ot.sections;for(let de=0;de0&&_l>Mo&&(Mo=_l)}else{const fs=be[gn.fontStack],Ao=fs&&fs[Dr];if(Ao&&Ao.rect)la=Ao.rect,Ns=Ao.metrics;else{const _l=me[gn.fontStack],rp=_l&&_l[Dr];if(!rp)continue;Ns=rp.metrics}rr=(nr-gn.scale)*$i}zs?(Yt.verticalizable=!0,Yr.push({glyph:Dr,imageName:ua,x:Yn,y:ni+rr,vertical:zs,scale:gn.scale,fontStack:gn.fontStack,sectionIndex:Kr,metrics:Ns,rect:la}),Yn+=gl*gn.scale+De):(Yr.push({glyph:Dr,imageName:ua,x:Yn,y:ni+rr,vertical:zs,scale:gn.scale,fontStack:gn.fontStack,sectionIndex:Kr,metrics:Ns,rect:la}),Yn+=Ns.advance*gn.scale+De)}Yr.length!==0&&(tr=Math.max(Yn-De,tr),n2(Yr,0,Yr.length-1,lo,Mo)),Yn=0;const Po=oe*nr+Mo;ho.lineOffset=Math.max(Mo,Xr),ni+=Po,Ho=Math.max(Po,Ho),++Xi}var xr;const kr=ni-Qf,{horizontalAlign:uo,verticalAlign:co}=Fg(ve);(function(er,nr,Xr,ho,Yr,Mo,Po,ir,gn){const Kr=(nr-Xr)*Yr;let Dr=0;Dr=Mo!==Po?-ir*ho-Qf:(-ho*gn+.5)*Po;for(const rr of er)for(const Ns of rr.positionedGlyphs)Ns.x+=Kr,Ns.y+=Dr})(Yt.positionedLines,lo,uo,co,tr,Ho,oe,kr,he.length),Yt.top+=-co*kr,Yt.bottom=Yt.top+kr,Yt.left+=-uo*tr,Yt.right=Yt.left+tr}(Xt,r,l,p,ft,b,S,T,R,P,V,et),!function(Yt){for(const me of Yt)if(me.positionedGlyphs.length!==0)return!1;return!0}(bt)&&Xt}const Wd={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},t2={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 s0(a,r,l,p,g,x){if(r.imageName){const b=p[r.imageName];return b?b.displaySize[0]*r.scale*$i/x+g:0}{const b=l[r.fontStack],S=b&&b[a];return S?S.metrics.advance*r.scale+g:0}}function a0(a,r,l,p){const g=Math.pow(a-r,2);return p?a=0;let D=0;for(let V=0;Vb.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=vg([]),this.placementViewportMatrix=vg([]);const l=this.layers[0]._unevaluatedLayout._values;this.textSizeData=h0(this.zoom,l["text-size"]),this.iconSizeData=h0(this.zoom,l["icon-size"]);const p=this.layers[0].layout,g=p.get("symbol-sort-key"),x=p.get("symbol-z-order");this.canOverlap=Bg(p,"text-overlap","text-allow-overlap")!=="never"||Bg(p,"icon-overlap","icon-allow-overlap")!=="never"||p.get("text-ignore-placement")||p.get("icon-ignore-placement"),this.sortFeaturesByKey=x!=="viewport-y"&&!g.isConstant(),this.sortFeaturesByY=(x==="viewport-y"||x==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,p.get("symbol-placement")==="point"&&(this.writingModes=p.get("text-writing-mode").map(b=>f.ah[b])),this.stateDependentLayerIds=this.layers.filter(b=>b.isStateDependent()).map(b=>b.id),this.sourceID=r.sourceID}createArrays(){this.text=new Ug(new fi(this.layers,this.zoom,r=>/^text/.test(r))),this.icon=new Ug(new fi(this.layers,this.zoom,r=>/^icon/.test(r))),this.glyphOffsetArray=new y,this.lineVertexArray=new E,this.symbolInstances=new m,this.textAnchorOffsets=new M}calculateGlyphDependencies(r,l,p,g,x){for(let b=0;b0)&&(b.value.kind!=="constant"||b.value.value.length>0),D=T.value.kind!=="constant"||!!T.value.value||Object.keys(T.parameters).length>0,R=x.get("symbol-sort-key");if(this.features=[],!P&&!D)return;const V=l.iconDependencies,Z=l.glyphDependencies,H=l.availableImages,et=new ti(this.zoom);for(const{feature:ot,id:ft,index:Et,sourceLayerIndex:gt}of r){const bt=g._featureFilter.needGeometry,Xt=dl(ot,bt);if(!g._featureFilter.filter(et,Xt,p))continue;let Yt,me;if(bt||(Xt.geometry=pl(ot)),P){const de=g.getValueAndResolveTokens("text-field",Xt,p,H),he=So.factory(de),oe=this.hasRTLText=this.hasRTLText||s2(he);(!oe||ka.getRTLTextPluginStatus()==="unavailable"||oe&&ka.isParsed())&&(Yt=Uw(he,g,Xt))}if(D){const de=g.getValueAndResolveTokens("icon-image",Xt,p,H);me=de instanceof jo?de:jo.fromString(de)}if(!Yt&&!me)continue;const be=this.sortFeaturesByKey?R.evaluate(Xt,{},p):void 0;if(this.features.push({id:ft,text:Yt,icon:me,index:Et,sourceLayerIndex:gt,geometry:Xt.geometry,properties:ot.properties,type:r2[ot.type],sortKey:be}),me&&(V[me.name]=!0),Yt){const de=b.evaluate(Xt,{},p).join(","),he=x.get("text-rotation-alignment")!=="viewport"&&x.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(f.ah.vertical)>=0;for(const oe of Yt.sections)if(oe.image)V[oe.image.name]=!0;else{const ve=Hl(Yt.toString()),ue=oe.fontStack||de,$t=Z[ue]=Z[ue]||{};this.calculateGlyphDependencies(oe.text,$t,he,this.allowVerticalPlacement,ve)}}}x.get("symbol-placement")==="line"&&(this.features=function(ot){const ft={},Et={},gt=[];let bt=0;function Xt(de){gt.push(ot[de]),bt++}function Yt(de,he,oe){const ve=Et[de];return delete Et[de],Et[he]=ve,gt[ve].geometry[0].pop(),gt[ve].geometry[0]=gt[ve].geometry[0].concat(oe[0]),ve}function me(de,he,oe){const ve=ft[he];return delete ft[he],ft[de]=ve,gt[ve].geometry[0].shift(),gt[ve].geometry[0]=oe[0].concat(gt[ve].geometry[0]),ve}function be(de,he,oe){const ve=oe?he[0][he[0].length-1]:he[0][0];return`${de}:${ve.x}:${ve.y}`}for(let de=0;dede.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ot,ft)=>ot.sortKey-ft.sortKey)}update(r,l,p){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(r,l,this.layers,p),this.icon.programConfigurations.updatePaintArrays(r,l,this.layers,p))}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 p=this.lineVertexArray.length;if(r.segment!==void 0){let g=r.dist(l[r.segment+1]),x=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:x},S>0&&(x+=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 p=r.placedSymbolArray.get(l),g=p.vertexStartIndex+4*p.numGlyphs;for(let x=p.vertexStartIndex;xg[S]-g[T]||x[T]-x[S]),b}addToSortKeyRanges(r,l){const p=this.sortKeyRanges[this.sortKeyRanges.length-1];p&&p.sortKey===l?p.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 p=this.symbolInstances.get(l);this.featureSortOrder.push(p.featureIndex),[p.rightJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.leftJustifiedTextSymbolIndex].forEach((g,x,b)=>{g>=0&&b.indexOf(g)===x&&this.addIndicesForPlacedSymbol(this.text,g)}),p.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,p.verticalPlacedTextSymbolIndex),p.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,p.placedIconSymbolIndex),p.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,p.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let f0,p0;ye("SymbolBucket",mh,{omit:["layers","collisionBoxArray","features","compareText"]}),mh.MAX_GLYPHS=65535,mh.addDynamicAttributes=Vg;var qg={get paint(){return p0=p0||new so({"icon-opacity":new Re(Mt.paint_symbol["icon-opacity"]),"icon-color":new Re(Mt.paint_symbol["icon-color"]),"icon-halo-color":new Re(Mt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Re(Mt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Re(Mt.paint_symbol["icon-halo-blur"]),"icon-translate":new Ee(Mt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ee(Mt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Re(Mt.paint_symbol["text-opacity"]),"text-color":new Re(Mt.paint_symbol["text-color"],{runtimeType:Li,getOverride:a=>a.textColor,hasOverride:a=>!!a.textColor}),"text-halo-color":new Re(Mt.paint_symbol["text-halo-color"]),"text-halo-width":new Re(Mt.paint_symbol["text-halo-width"]),"text-halo-blur":new Re(Mt.paint_symbol["text-halo-blur"]),"text-translate":new Ee(Mt.paint_symbol["text-translate"]),"text-translate-anchor":new Ee(Mt.paint_symbol["text-translate-anchor"])})},get layout(){return f0=f0||new so({"symbol-placement":new Ee(Mt.layout_symbol["symbol-placement"]),"symbol-spacing":new Ee(Mt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ee(Mt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Re(Mt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ee(Mt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ee(Mt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ee(Mt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ee(Mt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ee(Mt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ee(Mt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Re(Mt.layout_symbol["icon-size"]),"icon-text-fit":new Ee(Mt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ee(Mt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Re(Mt.layout_symbol["icon-image"]),"icon-rotate":new Re(Mt.layout_symbol["icon-rotate"]),"icon-padding":new Re(Mt.layout_symbol["icon-padding"]),"icon-keep-upright":new Ee(Mt.layout_symbol["icon-keep-upright"]),"icon-offset":new Re(Mt.layout_symbol["icon-offset"]),"icon-anchor":new Re(Mt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ee(Mt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ee(Mt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ee(Mt.layout_symbol["text-rotation-alignment"]),"text-field":new Re(Mt.layout_symbol["text-field"]),"text-font":new Re(Mt.layout_symbol["text-font"]),"text-size":new Re(Mt.layout_symbol["text-size"]),"text-max-width":new Re(Mt.layout_symbol["text-max-width"]),"text-line-height":new Ee(Mt.layout_symbol["text-line-height"]),"text-letter-spacing":new Re(Mt.layout_symbol["text-letter-spacing"]),"text-justify":new Re(Mt.layout_symbol["text-justify"]),"text-radial-offset":new Re(Mt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ee(Mt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Re(Mt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Re(Mt.layout_symbol["text-anchor"]),"text-max-angle":new Ee(Mt.layout_symbol["text-max-angle"]),"text-writing-mode":new Ee(Mt.layout_symbol["text-writing-mode"]),"text-rotate":new Re(Mt.layout_symbol["text-rotate"]),"text-padding":new Ee(Mt.layout_symbol["text-padding"]),"text-keep-upright":new Ee(Mt.layout_symbol["text-keep-upright"]),"text-transform":new Re(Mt.layout_symbol["text-transform"]),"text-offset":new Re(Mt.layout_symbol["text-offset"]),"text-allow-overlap":new Ee(Mt.layout_symbol["text-allow-overlap"]),"text-overlap":new Ee(Mt.layout_symbol["text-overlap"]),"text-ignore-placement":new Ee(Mt.layout_symbol["text-ignore-placement"]),"text-optional":new Ee(Mt.layout_symbol["text-optional"])})}};class d0{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:Gi,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}}ye("FormatSectionOverride",d0,{omit:["defaultValue"]});class Xd extends us{constructor(r){super(r,qg)}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 p=this.layout.get("text-writing-mode");if(p){const g=[];for(const x of p)g.indexOf(x)<0&&g.push(x);this.layout._values["text-writing-mode"]=g}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(r,l,p,g){const x=this.layout.get(r).evaluate(l,{},p,g),b=this._unevaluatedLayout._values[r];return b.isDataDriven()||Zn(b.value)||!x?x:function(S,T){return T.replace(/{([^{}]+)}/g,(P,D)=>S&&D in S?String(S[D]):"")}(l.properties,x)}createBucket(r){return new mh(r)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const r of qg.paint.overridableProperties){if(!Xd.hasPaintOverride(this.layout,r))continue;const l=this.paint.get(r),p=new d0(l),g=new Xn(p,l.property.specification);let x=null;x=l.value.kind==="constant"||l.value.kind==="source"?new Fc("source",g):new _f("composite",g,l.value.zoomStops),this.paint._values[r]=new ls(l.property,x,l.parameters)}}_handleOverridablePaintPropertyUpdate(r,l,p){return!(!this.layout||l.isDataDriven()||p.isDataDriven())&&Xd.hasPaintOverride(this.layout,r)}static hasPaintOverride(r,l){const p=r.get("text-field"),g=qg.paint.properties[l];let x=!1;const b=S=>{for(const T of S)if(g.overrides&&g.overrides.hasOverride(T))return void(x=!0)};if(p.value.kind==="constant"&&p.value.value instanceof So)b(p.value.value.sections);else if(p.value.kind==="source"){const S=P=>{x||(P instanceof Ta&&ji(P.value)===Di?b(P.value.sections):P instanceof zc?b(P.sections):P.eachChild(S))},T=p.value;T._styleExpression&&S(T._styleExpression.expression)}return x}}let m0;var a2={get paint(){return m0=m0||new so({"background-color":new Ee(Mt.paint_background["background-color"]),"background-pattern":new Uu(Mt.paint_background["background-pattern"]),"background-opacity":new Ee(Mt.paint_background["background-opacity"])})}};class l2 extends us{constructor(r){super(r,a2)}}let g0;var u2={get paint(){return g0=g0||new so({"raster-opacity":new Ee(Mt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ee(Mt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ee(Mt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ee(Mt.paint_raster["raster-brightness-max"]),"raster-saturation":new Ee(Mt.paint_raster["raster-saturation"]),"raster-contrast":new Ee(Mt.paint_raster["raster-contrast"]),"raster-resampling":new Ee(Mt.paint_raster["raster-resampling"]),"raster-fade-duration":new Ee(Mt.paint_raster["raster-fade-duration"])})}};class c2 extends us{constructor(r){super(r,u2)}}class h2 extends us{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 f2{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 jg=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(xt(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,p=this.lat*l,g=r.lat*l,x=Math.sin(p)*Math.sin(g)+Math.cos(p)*Math.cos(g)*Math.cos((r.lng-this.lng)*l);return jg*Math.acos(Math.min(x,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 _0=2*Math.PI*jg;function y0(a){return _0*Math.cos(a*Math.PI/180)}function v0(a){return(180+a)/360}function x0(a){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360}function b0(a,r){return a/y0(r)}function Zg(a){return 360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90}class Yd{constructor(r,l,p=0){this.x=+r,this.y=+l,this.z=+p}static fromLngLat(r,l=0){const p=Ql.convert(r);return new Yd(v0(p.lng),x0(p.lat),b0(l,p.lat))}toLngLat(){return new Ql(360*this.x-180,Zg(this.y))}toAltitude(){return this.z*y0(Zg(this.y))}meterInMercatorCoordinateUnits(){return 1/_0*(r=Zg(this.y),1/Math.cos(r*Math.PI/180));var r}}function w0(a,r,l){var p=2*Math.PI*6378137/256/Math.pow(2,l);return[a*p-2*Math.PI*6378137/2,r*p-2*Math.PI*6378137/2]}class Wg{constructor(r,l,p){if(r<0||r>25||p<0||p>=Math.pow(2,r)||l<0||l>=Math.pow(2,r))throw new Error(`x=${l}, y=${p}, 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=p,this.key=ep(0,r,r,l,p)}equals(r){return this.z===r.z&&this.x===r.x&&this.y===r.y}url(r,l,p){const g=(b=this.y,S=this.z,T=w0(256*(x=this.x),256*(b=Math.pow(2,S)-b-1),S),P=w0(256*(x+1),256*(b+1),S),T[0]+","+T[1]+","+P[0]+","+P[1]);var x,b,S,T,P;const D=function(R,V,Z){let H,et="";for(let ot=R;ot>0;ot--)H=1<1?"@2x":"").replace(/{quadkey}/g,D).replace(/{bbox-epsg-3857}/g,g)}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)*Mi,(r.y*l-this.y)*Mi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class S0{constructor(r,l){this.wrap=r,this.canonical=l,this.key=ep(r,l.z,l.z,l.x,l.y)}}class hs{constructor(r,l,p,g,x){if(r= z; overscaledZ = ${r}; z = ${p}`);this.overscaledZ=r,this.wrap=l,this.canonical=new Wg(p,+g,+x),this.key=ep(l,r,p,g,x)}clone(){return new hs(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 hs(r,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new hs(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 p=this.canonical.z-r;return r>this.canonical.z?ep(this.wrap*+l,r,this.canonical.z,this.canonical.x,this.canonical.y):ep(this.wrap*+l,r,r,this.canonical.x>>p,this.canonical.y>>p)}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 hs(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const l=this.canonical.z+1,p=2*this.canonical.x,g=2*this.canonical.y;return[new hs(l,this.wrap,l,p,g),new hs(l,this.wrap,l,p+1,g),new hs(l,this.wrap,l,p,g+1),new hs(l,this.wrap,l,p+1,g+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,p){return r*this.redFactor+l*this.greenFactor+p*this.blueFactor-this.baseShift}getPixels(){return new cs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(r,l,p){if(this.dim!==r.dim)throw new Error("dem dimension mismatch");let g=l*this.dim,x=l*this.dim+this.dim,b=p*this.dim,S=p*this.dim+this.dim;switch(l){case-1:g=x-1;break;case 1:x=g+1}switch(p){case-1:b=S-1;break;case 1:S=b+1}const T=-l*this.dim,P=-p*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 C0{constructor(r,l,p,g,x){this.type="Feature",this._vectorTileFeature=r,r._z=l,r._x=p,r._y=g,this.properties=r.properties,this.id=x}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 T0{constructor(r,l){this.tileID=r,this.x=r.canonical.x,this.y=r.canonical.y,this.z=r.canonical.z,this.grid=new Fu(Mi,16,0),this.grid3D=new Fu(Mi,16,0),this.featureIndexArray=new N,this.promoteId=l}insert(r,l,p,g,x,b){const S=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(p,g,x);const T=b?this.grid3D:this.grid;for(let P=0;P=0&&R[3]>=0&&T.insert(S,R[0],R[1],R[2],R[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Yl.VectorTile(new Rg(this.rawTileData)).layers,this.sourceLayerCoder=new E0(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(r,l,p,g){this.loadVTLayers();const x=r.params||{},b=Mi/r.tileSize/r.scale,S=Gc(x.filter),T=r.queryGeometry,P=r.queryPadding*b,D=M0(T),R=this.grid.query(D.minX-P,D.minY-P,D.maxX+P,D.maxY+P),V=M0(r.cameraQueryGeometry),Z=this.grid3D.query(V.minX-P,V.minY-P,V.maxX+P,V.maxY+P,(ot,ft,Et,gt)=>function(bt,Xt,Yt,me,be){for(const he of bt)if(Xt<=he.x&&Yt<=he.y&&me>=he.x&&be>=he.y)return!0;const de=[new L(Xt,Yt),new L(Xt,be),new L(me,be),new L(me,Yt)];if(bt.length>2){for(const he of de)if(lh(bt,he))return!0}for(let he=0;he(gt||(gt=pl(bt)),Xt.queryIntersectsFeature(T,bt,Yt,gt,this.z,r.transform,b,r.pixelPosMatrix)))}return H}loadMatchingFeature(r,l,p,g,x,b,S,T,P,D,R){const V=this.bucketLayerIDs[l];if(b&&!function(ot,ft){for(let Et=0;Et=0)return!0;return!1}(b,V))return;const Z=this.sourceLayerCoder.decode(p),H=this.vtLayers[Z].feature(g);if(x.needGeometry){const ot=dl(H,!0);if(!x.filter(new ti(this.tileID.overscaledZ),ot,this.tileID.canonical))return}else if(!x.filter(new ti(this.tileID.overscaledZ),H))return;const et=this.getId(H,Z);for(let ot=0;ot{const S=r instanceof Vu?r.get(b):null;return S&&S.evaluate?S.evaluate(l,p,g):S})}function M0(a){let r=1/0,l=1/0,p=-1/0,g=-1/0;for(const x of a)r=Math.min(r,x.x),l=Math.min(l,x.y),p=Math.max(p,x.x),g=Math.max(g,x.y);return{minX:r,minY:l,maxX:p,maxY:g}}function p2(a,r){return r-a}function P0(a,r,l,p,g){const x=[];for(let b=0;b=p&&R.x>=p||(D.x>=p?D=new L(p,D.y+(p-D.x)/(R.x-D.x)*(R.y-D.y))._round():R.x>=p&&(R=new L(p,D.y+(p-D.x)/(R.x-D.x)*(R.y-D.y))._round()),D.y>=g&&R.y>=g||(D.y>=g?D=new L(D.x+(g-D.y)/(R.y-D.y)*(R.x-D.x),g)._round():R.y>=g&&(R=new L(D.x+(g-D.y)/(R.y-D.y)*(R.x-D.x),g)._round()),T&&D.equals(T[T.length-1])||(T=[D],x.push(T)),T.push(R)))))}}return x}ye("FeatureIndex",T0,{omit:["rawTileData","sourceLayerCoder"]});class $l extends L{constructor(r,l,p,g){super(r,l),this.angle=p,g!==void 0&&(this.segment=g)}clone(){return new $l(this.x,this.y,this.angle,this.segment)}}function A0(a,r,l,p,g){if(r.segment===void 0||l===0)return!0;let x=r,b=r.segment+1,S=0;for(;S>-l/2;){if(b--,b<0)return!1;S-=a[b].dist(x),x=a[b]}S+=a[b].dist(a[b+1]),b++;const T=[];let P=0;for(;Sp;)P-=T.shift().angleDelta;if(P>g)return!1;b++,S+=D.dist(R)}return!0}function k0(a){let r=0;for(let l=0;lP){const H=(P-T)/Z,et=Wr.number(R.x,V.x,H),ot=Wr.number(R.y,V.y,H),ft=new $l(et,ot,V.angleTo(R),D);return ft._round(),!b||A0(a,ft,S,b,r)?ft:void 0}T+=Z}}function m2(a,r,l,p,g,x,b,S,T){const P=D0(p,x,b),D=R0(p,g),R=D*b,V=a[0].x===0||a[0].x===T||a[0].y===0||a[0].y===T;return r-R=0&&bt=0&&Xt=0&&V+P<=D){const Yt=new $l(bt,Xt,Et,H);Yt._round(),p&&!A0(a,Yt,x,p,g)||Z.push(Yt)}}R+=ft}return S||Z.length||b||(Z=N0(a,R/2,l,p,g,x,b,!0,T)),Z}ye("Anchor",$l);const gh=Lo;function z0(a,r,l,p){const g=[],x=a.image,b=x.pixelRatio,S=x.paddedRect.w-2*gh,T=x.paddedRect.h-2*gh,P=a.right-a.left,D=a.bottom-a.top,R=x.stretchX||[[0,S]],V=x.stretchY||[[0,T]],Z=(oe,ve)=>oe+ve[1]-ve[0],H=R.reduce(Z,0),et=V.reduce(Z,0),ot=S-H,ft=T-et;let Et=0,gt=H,bt=0,Xt=et,Yt=0,me=ot,be=0,de=ft;if(x.content&&p){const oe=x.content;Et=Kd(R,0,oe[0]),bt=Kd(V,0,oe[1]),gt=Kd(R,oe[0],oe[2]),Xt=Kd(V,oe[1],oe[3]),Yt=oe[0]-Et,be=oe[1]-bt,me=oe[2]-oe[0]-gt,de=oe[3]-oe[1]-Xt}const he=(oe,ve,ue,$t)=>{const De=Jd(oe.stretch-Et,gt,P,a.left),Se=Qd(oe.fixed-Yt,me,oe.stretch,H),ln=Jd(ve.stretch-bt,Xt,D,a.top),Yn=Qd(ve.fixed-be,de,ve.stretch,et),ni=Jd(ue.stretch-Et,gt,P,a.left),tr=Qd(ue.fixed-Yt,me,ue.stretch,H),Ho=Jd($t.stretch-bt,Xt,D,a.top),lo=Qd($t.fixed-be,de,$t.stretch,et),Xi=new L(De,ln),xr=new L(ni,ln),kr=new L(ni,Ho),uo=new L(De,Ho),co=new L(Se/b,Yn/b),er=new L(tr/b,lo/b),nr=r*Math.PI/180;if(nr){const Yr=Math.sin(nr),Mo=Math.cos(nr),Po=[Mo,-Yr,Yr,Mo];Xi._matMult(Po),xr._matMult(Po),uo._matMult(Po),kr._matMult(Po)}const Xr=oe.stretch+oe.fixed,ho=ve.stretch+ve.fixed;return{tl:Xi,tr:xr,bl:uo,br:kr,tex:{x:x.paddedRect.x+gh+Xr,y:x.paddedRect.y+gh+ho,w:ue.stretch+ue.fixed-Xr,h:$t.stretch+$t.fixed-ho},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:co,pixelOffsetBR:er,minFontScaleX:me/b/P,minFontScaleY:de/b/D,isSDF:l}};if(p&&(x.stretchX||x.stretchY)){const oe=O0(R,ot,H),ve=O0(V,ft,et);for(let ue=0;ue0&&(H=Math.max(10,H),this.circleDiameter=H)}else{let R=b.top*S-T[0],V=b.bottom*S+T[2],Z=b.left*S-T[3],H=b.right*S+T[1];const et=b.collisionPadding;if(et&&(Z-=et[0]*S,R-=et[1]*S,H+=et[2]*S,V+=et[3]*S),D){const ot=new L(Z,R),ft=new L(H,R),Et=new L(Z,V),gt=new L(H,V),bt=D*Math.PI/180;ot._rotate(bt),ft._rotate(bt),Et._rotate(bt),gt._rotate(bt),Z=Math.min(ot.x,ft.x,Et.x,gt.x),H=Math.max(ot.x,ft.x,Et.x,gt.x),R=Math.min(ot.y,ft.y,Et.y,gt.y),V=Math.max(ot.y,ft.y,Et.y,gt.y)}r.emplaceBack(l.x,l.y,Z,R,H,V,p,g,x)}this.boxEndIndex=r.length}}class g2{constructor(r=[],l=_2){if(this.data=r,this.length=this.data.length,this.compare=l,this.length>0)for(let p=(this.length>>1)-1;p>=0;p--)this._down(p)}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:p}=this,g=l[r];for(;r>0;){const x=r-1>>1,b=l[x];if(p(g,b)>=0)break;l[r]=b,r=x}l[r]=g}_down(r){const{data:l,compare:p}=this,g=this.length>>1,x=l[r];for(;r=0)break;l[r]=S,r=b}l[r]=x}}function _2(a,r){return ar?1:0}function y2(a,r=1,l=!1){let p=1/0,g=1/0,x=-1/0,b=-1/0;const S=a[0];for(let Z=0;Zx)&&(x=H.x),(!Z||H.y>b)&&(b=H.y)}const T=Math.min(x-p,b-g);let P=T/2;const D=new g2([],v2);if(T===0)return new L(p,g);for(let Z=p;ZR.d||!R.d)&&(R=Z,l&&console.log("found best %d after %d probes",Math.round(1e4*Z.d)/1e4,V)),Z.max-R.d<=r||(P=Z.h/2,D.push(new _h(Z.p.x-P,Z.p.y-P,P,a)),D.push(new _h(Z.p.x+P,Z.p.y-P,P,a)),D.push(new _h(Z.p.x-P,Z.p.y+P,P,a)),D.push(new _h(Z.p.x+P,Z.p.y+P,P,a)),V+=4)}return l&&(console.log(`num probes: ${V}`),console.log(`best distance: ${R.d}`)),R.p}function v2(a,r){return r.max-a.max}function _h(a,r,l,p){this.p=new L(a,r),this.h=l,this.d=function(g,x){let b=!1,S=1/0;for(let T=0;Tg.y!=H.y>g.y&&g.x<(H.x-Z.x)*(g.y-Z.y)/(H.y-Z.y)+Z.x&&(b=!b),S=Math.min(S,xy(g,Z,H))}}return(b?1:-1)*Math.sqrt(S)}(this.p,p),this.max=this.d+this.h*Math.SQRT2}var Ar;f.ap=void 0,(Ar=f.ap||(f.ap={}))[Ar.center=1]="center",Ar[Ar.left=2]="left",Ar[Ar.right=3]="right",Ar[Ar.top=4]="top",Ar[Ar.bottom=5]="bottom",Ar[Ar["top-left"]=6]="top-left",Ar[Ar["top-right"]=7]="top-right",Ar[Ar["bottom-left"]=8]="bottom-left",Ar[Ar["bottom-right"]=9]="bottom-right";const tu=7,Hg=Number.POSITIVE_INFINITY;function F0(a,r){return r[1]!==Hg?function(l,p,g){let x=0,b=0;switch(p=Math.abs(p),g=Math.abs(g),l){case"top-right":case"top-left":case"top":b=g-tu;break;case"bottom-right":case"bottom-left":case"bottom":b=-g+tu}switch(l){case"top-right":case"bottom-right":case"right":x=-p;break;case"top-left":case"bottom-left":case"left":x=p}return[x,b]}(a,r[0],r[1]):function(l,p){let g=0,x=0;p<0&&(p=0);const b=p/Math.SQRT2;switch(l){case"top-right":case"top-left":x=b-tu;break;case"bottom-right":case"bottom-left":x=-b+tu;break;case"bottom":x=-p+tu;break;case"top":x=p-tu}switch(l){case"top-right":case"bottom-right":g=-b;break;case"top-left":case"bottom-left":g=b;break;case"left":g=p;break;case"right":g=-p}return[g,x]}(a,r[0])}function B0(a,r,l){var p;const g=a.layout,x=(p=g.get("text-variable-anchor-offset"))===null||p===void 0?void 0:p.evaluate(r,{},l);if(x){const S=x.values,T=[];for(let P=0;PV*$i);D.startsWith("top")?R[1]-=tu:D.startsWith("bottom")&&(R[1]+=tu),T[P+1]=R}return new qo(T)}const b=g.get("text-variable-anchor");if(b){let S;S=a._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[g.get("text-radial-offset").evaluate(r,{},l)*$i,Hg]:g.get("text-offset").evaluate(r,{},l).map(P=>P*$i);const T=[];for(const P of b)T.push(P,F0(P,S));return new qo(T)}return null}function Xg(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 x2(a,r,l,p,g,x,b,S,T,P,D){let R=x.textMaxSize.evaluate(r,{});R===void 0&&(R=b);const V=a.layers[0].layout,Z=V.get("icon-offset").evaluate(r,{},D),H=U0(l.horizontal),et=b/24,ot=a.tilePixelRatio*et,ft=a.tilePixelRatio*R/24,Et=a.tilePixelRatio*S,gt=a.tilePixelRatio*V.get("symbol-spacing"),bt=V.get("text-padding")*a.tilePixelRatio,Xt=function($t,De,Se,ln=1){const Yn=$t.get("icon-padding").evaluate(De,{},Se),ni=Yn&&Yn.values;return[ni[0]*ln,ni[1]*ln,ni[2]*ln,ni[3]*ln]}(V,r,D,a.tilePixelRatio),Yt=V.get("text-max-angle")/180*Math.PI,me=V.get("text-rotation-alignment")!=="viewport"&&V.get("symbol-placement")!=="point",be=V.get("icon-rotation-alignment")==="map"&&V.get("symbol-placement")!=="point",de=V.get("symbol-placement"),he=gt/2,oe=V.get("icon-text-fit");let ve;p&&oe!=="none"&&(a.allowVerticalPlacement&&l.vertical&&(ve=c0(p,l.vertical,oe,V.get("icon-text-fit-padding"),Z,et)),H&&(p=c0(p,H,oe,V.get("icon-text-fit-padding"),Z,et)));const ue=($t,De)=>{De.x<0||De.x>=Mi||De.y<0||De.y>=Mi||function(Se,ln,Yn,ni,tr,Ho,lo,Xi,xr,kr,uo,co,er,nr,Xr,ho,Yr,Mo,Po,ir,gn,Kr,Dr,rr,Ns){const la=Se.addToLineVertexArray(ln,Yn);let ua,gl,zs,fs,Ao=0,_l=0,rp=0,Z0=0,n_=-1,i_=-1;const yl={};let W0=bi("");if(Se.allowVerticalPlacement&&ni.vertical){const Jr=Xi.layout.get("text-rotate").evaluate(gn,{},rr)+90;zs=new $d(xr,ln,kr,uo,co,ni.vertical,er,nr,Xr,Jr),lo&&(fs=new $d(xr,ln,kr,uo,co,lo,Yr,Mo,Xr,Jr))}if(tr){const Jr=Xi.layout.get("icon-rotate").evaluate(gn,{}),ps=Xi.layout.get("icon-text-fit")!=="none",Yu=z0(tr,Jr,Dr,ps),ha=lo?z0(lo,Jr,Dr,ps):void 0;gl=new $d(xr,ln,kr,uo,co,tr,Yr,Mo,!1,Jr),Ao=4*Yu.length;const Ku=Se.iconSizeData;let Oa=null;Ku.kind==="source"?(Oa=[za*Xi.layout.get("icon-size").evaluate(gn,{})],Oa[0]>Jl&&ee(`${Se.layerIds[0]}: Value for "icon-size" is >= ${tp}. Reduce your "icon-size".`)):Ku.kind==="composite"&&(Oa=[za*Kr.compositeIconSizes[0].evaluate(gn,{},rr),za*Kr.compositeIconSizes[1].evaluate(gn,{},rr)],(Oa[0]>Jl||Oa[1]>Jl)&&ee(`${Se.layerIds[0]}: Value for "icon-size" is >= ${tp}. Reduce your "icon-size".`)),Se.addSymbols(Se.icon,Yu,Oa,ir,Po,gn,f.ah.none,ln,la.lineStartIndex,la.lineLength,-1,rr),n_=Se.icon.placedSymbolArray.length-1,ha&&(_l=4*ha.length,Se.addSymbols(Se.icon,ha,Oa,ir,Po,gn,f.ah.vertical,ln,la.lineStartIndex,la.lineLength,-1,rr),i_=Se.icon.placedSymbolArray.length-1)}const H0=Object.keys(ni.horizontal);for(const Jr of H0){const ps=ni.horizontal[Jr];if(!ua){W0=bi(ps.text);const ha=Xi.layout.get("text-rotate").evaluate(gn,{},rr);ua=new $d(xr,ln,kr,uo,co,ps,er,nr,Xr,ha)}const Yu=ps.positionedLines.length===1;if(rp+=V0(Se,ln,ps,Ho,Xi,Xr,gn,ho,la,ni.vertical?f.ah.horizontal:f.ah.horizontalOnly,Yu?H0:[Jr],yl,n_,Kr,rr),Yu)break}ni.vertical&&(Z0+=V0(Se,ln,ni.vertical,Ho,Xi,Xr,gn,ho,la,f.ah.vertical,["vertical"],yl,i_,Kr,rr));const S2=ua?ua.boxStartIndex:Se.collisionBoxArray.length,I2=ua?ua.boxEndIndex:Se.collisionBoxArray.length,E2=zs?zs.boxStartIndex:Se.collisionBoxArray.length,C2=zs?zs.boxEndIndex:Se.collisionBoxArray.length,T2=gl?gl.boxStartIndex:Se.collisionBoxArray.length,L2=gl?gl.boxEndIndex:Se.collisionBoxArray.length,M2=fs?fs.boxStartIndex:Se.collisionBoxArray.length,P2=fs?fs.boxEndIndex:Se.collisionBoxArray.length;let ca=-1;const em=(Jr,ps)=>Jr&&Jr.circleDiameter?Math.max(Jr.circleDiameter,ps):ps;ca=em(ua,ca),ca=em(zs,ca),ca=em(gl,ca),ca=em(fs,ca);const X0=ca>-1?1:0;X0&&(ca*=Ns/$i),Se.glyphOffsetArray.length>=mh.MAX_GLYPHS&&ee("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),gn.sortKey!==void 0&&Se.addToSortKeyRanges(Se.symbolInstances.length,gn.sortKey);const A2=B0(Xi,gn,rr),[k2,D2]=function(Jr,ps){const Yu=Jr.length,ha=ps==null?void 0:ps.values;if((ha==null?void 0:ha.length)>0)for(let Ku=0;Ku=0?yl.right:-1,yl.center>=0?yl.center:-1,yl.left>=0?yl.left:-1,yl.vertical||-1,n_,i_,W0,S2,I2,E2,C2,T2,L2,M2,P2,kr,rp,Z0,Ao,_l,X0,0,er,ca,k2,D2)}(a,De,$t,l,p,g,ve,a.layers[0],a.collisionBoxArray,r.index,r.sourceLayerIndex,a.index,ot,[bt,bt,bt,bt],me,T,Et,Xt,be,Z,r,x,P,D,b)};if(de==="line")for(const $t of P0(r.geometry,0,0,Mi,Mi)){const De=m2($t,gt,Yt,l.vertical||H,p,24,ft,a.overscaling,Mi);for(const Se of De)H&&b2(a,H.text,he,Se)||ue($t,Se)}else if(de==="line-center"){for(const $t of r.geometry)if($t.length>1){const De=d2($t,Yt,l.vertical||H,p,24,ft);De&&ue($t,De)}}else if(r.type==="Polygon")for(const $t of Cg(r.geometry,0)){const De=y2($t,16);ue($t[0],new $l(De.x,De.y,0))}else if(r.type==="LineString")for(const $t of r.geometry)ue($t,new $l($t[0].x,$t[0].y,0));else if(r.type==="Point")for(const $t of r.geometry)for(const De of $t)ue([De],new $l(De.x,De.y,0))}function V0(a,r,l,p,g,x,b,S,T,P,D,R,V,Z,H){const et=function(Et,gt,bt,Xt,Yt,me,be,de){const he=Xt.layout.get("text-rotate").evaluate(me,{})*Math.PI/180,oe=[];for(const ve of gt.positionedLines)for(const ue of ve.positionedGlyphs){if(!ue.rect)continue;const $t=ue.rect||{};let De=i0+1,Se=!0,ln=1,Yn=0;const ni=(Yt||de)&&ue.vertical,tr=ue.metrics.advance*ue.scale/2;if(de&>.verticalizable&&(Yn=ve.lineOffset/2-(ue.imageName?-($i-ue.metrics.width*ue.scale)/2:(ue.scale-1)*$i)),ue.imageName){const ir=be[ue.imageName];Se=ir.sdf,ln=ir.pixelRatio,De=Lo/ln}const Ho=Yt?[ue.x+tr,ue.y]:[0,0];let lo=Yt?[0,0]:[ue.x+tr+bt[0],ue.y+bt[1]-Yn],Xi=[0,0];ni&&(Xi=lo,lo=[0,0]);const xr=ue.metrics.isDoubleResolution?2:1,kr=(ue.metrics.left-De)*ue.scale-tr+lo[0],uo=(-ue.metrics.top-De)*ue.scale+lo[1],co=kr+$t.w/xr*ue.scale/ln,er=uo+$t.h/xr*ue.scale/ln,nr=new L(kr,uo),Xr=new L(co,uo),ho=new L(kr,er),Yr=new L(co,er);if(ni){const ir=new L(-tr,tr-Qf),gn=-Math.PI/2,Kr=$i/2-tr,Dr=new L(5-Qf-Kr,-(ue.imageName?Kr:0)),rr=new L(...Xi);nr._rotateAround(gn,ir)._add(Dr)._add(rr),Xr._rotateAround(gn,ir)._add(Dr)._add(rr),ho._rotateAround(gn,ir)._add(Dr)._add(rr),Yr._rotateAround(gn,ir)._add(Dr)._add(rr)}if(he){const ir=Math.sin(he),gn=Math.cos(he),Kr=[gn,-ir,ir,gn];nr._matMult(Kr),Xr._matMult(Kr),ho._matMult(Kr),Yr._matMult(Kr)}const Mo=new L(0,0),Po=new L(0,0);oe.push({tl:nr,tr:Xr,bl:ho,br:Yr,tex:$t,writingMode:gt.writingMode,glyphOffset:Ho,sectionIndex:ue.sectionIndex,isSDF:Se,pixelOffsetTL:Mo,pixelOffsetBR:Po,minFontScaleX:0,minFontScaleY:0})}return oe}(0,l,S,g,x,b,p,a.allowVerticalPlacement),ot=a.textSizeData;let ft=null;ot.kind==="source"?(ft=[za*g.layout.get("text-size").evaluate(b,{})],ft[0]>Jl&&ee(`${a.layerIds[0]}: Value for "text-size" is >= ${tp}. Reduce your "text-size".`)):ot.kind==="composite"&&(ft=[za*Z.compositeTextSizes[0].evaluate(b,{},H),za*Z.compositeTextSizes[1].evaluate(b,{},H)],(ft[0]>Jl||ft[1]>Jl)&&ee(`${a.layerIds[0]}: Value for "text-size" is >= ${tp}. Reduce your "text-size".`)),a.addSymbols(a.text,et,ft,S,x,b,P,r,T.lineStartIndex,T.lineLength,V,H);for(const Et of D)R[Et]=a.text.placedSymbolArray.length-1;return 4*et.length}function U0(a){for(const r in a)return a[r];return null}function b2(a,r,l,p){const g=a.compareText;if(r in g){const x=g[r];for(let b=x.length-1;b>=0;b--)if(p.dist(x[b])>4;if(g!==1)throw new Error(`Got v${g} data when expected v1.`);const x=G0[15&p];if(!x)throw new Error("Unrecognized array type.");const[b]=new Uint16Array(r,2,1),[S]=new Uint32Array(r,4,1);return new Yg(S,b,x,r)}constructor(r,l=64,p=Float64Array,g){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=p,this.IndexArrayType=r<65536?Uint16Array:Uint32Array;const x=G0.indexOf(this.ArrayType),b=2*r*this.ArrayType.BYTES_PER_ELEMENT,S=r*this.IndexArrayType.BYTES_PER_ELEMENT,T=(8-S%8)%8;if(x<0)throw new Error(`Unexpected typed array class: ${p}.`);g&&g instanceof ArrayBuffer?(this.data=g,this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+S+T,2*r),this._pos=2*r,this._finished=!0):(this.data=new ArrayBuffer(8+b+S+T),this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+S+T,2*r),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+x]),new Uint16Array(this.data,2,1)[0]=l,new Uint32Array(this.data,4,1)[0]=r)}add(r,l){const p=this._pos>>1;return this.ids[p]=p,this.coords[this._pos++]=r,this.coords[this._pos++]=l,p}finish(){const r=this._pos>>1;if(r!==this.numItems)throw new Error(`Added ${r} items when expected ${this.numItems}.`);return Kg(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(r,l,p,g){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:x,coords:b,nodeSize:S}=this,T=[0,x.length-1,0],P=[];for(;T.length;){const D=T.pop()||0,R=T.pop()||0,V=T.pop()||0;if(R-V<=S){for(let ot=V;ot<=R;ot++){const ft=b[2*ot],Et=b[2*ot+1];ft>=r&&ft<=p&&Et>=l&&Et<=g&&P.push(x[ot])}continue}const Z=V+R>>1,H=b[2*Z],et=b[2*Z+1];H>=r&&H<=p&&et>=l&&et<=g&&P.push(x[Z]),(D===0?r<=H:l<=et)&&(T.push(V),T.push(Z-1),T.push(1-D)),(D===0?p>=H:g>=et)&&(T.push(Z+1),T.push(R),T.push(1-D))}return P}within(r,l,p){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:g,coords:x,nodeSize:b}=this,S=[0,g.length-1,0],T=[],P=p*p;for(;S.length;){const D=S.pop()||0,R=S.pop()||0,V=S.pop()||0;if(R-V<=b){for(let ot=V;ot<=R;ot++)j0(x[2*ot],x[2*ot+1],r,l)<=P&&T.push(g[ot]);continue}const Z=V+R>>1,H=x[2*Z],et=x[2*Z+1];j0(H,et,r,l)<=P&&T.push(g[Z]),(D===0?r-p<=H:l-p<=et)&&(S.push(V),S.push(Z-1),S.push(1-D)),(D===0?r+p>=H:l+p>=et)&&(S.push(Z+1),S.push(R),S.push(1-D))}return T}}function Kg(a,r,l,p,g,x){if(g-p<=l)return;const b=p+g>>1;q0(a,r,b,p,g,x),Kg(a,r,l,p,b-1,1-x),Kg(a,r,l,b+1,g,1-x)}function q0(a,r,l,p,g,x){for(;g>p;){if(g-p>600){const P=g-p+1,D=l-p+1,R=Math.log(P),V=.5*Math.exp(2*R/3),Z=.5*Math.sqrt(R*V*(P-V)/P)*(D-P/2<0?-1:1);q0(a,r,l,Math.max(p,Math.floor(l-D*V/P+Z)),Math.min(g,Math.floor(l+(P-D)*V/P+Z)),x)}const b=r[2*l+x];let S=p,T=g;for(np(a,r,p,l),r[2*g+x]>b&&np(a,r,p,g);Sb;)T--}r[2*p+x]===b?np(a,r,p,T):(T++,np(a,r,T,g)),T<=l&&(p=T+1),l<=T&&(g=T-1)}}function np(a,r,l,p){Jg(a,l,p),Jg(r,2*l,2*p),Jg(r,2*l+1,2*p+1)}function Jg(a,r,l){const p=a[r];a[r]=a[l],a[l]=p}function j0(a,r,l,p){const g=a-l,x=r-p;return g*g+x*x}var Qg;f.bd=void 0,(Qg=f.bd||(f.bd={})).create="create",Qg.load="load",Qg.fullLoad="fullLoad";let tm=null,ip=[];const $g=1e3/60,t_="loadTime",e_="fullLoadTime",w2={mark(a){performance.mark(a)},frame(a){const r=a;tm!=null&&ip.push(r-tm),tm=r},clearMetrics(){tm=null,ip=[],performance.clearMeasures(t_),performance.clearMeasures(e_);for(const a in f.bd)performance.clearMarks(f.bd[a])},getPerformanceMetrics(){performance.measure(t_,f.bd.create,f.bd.load),performance.measure(e_,f.bd.create,f.bd.fullLoad);const a=performance.getEntriesByName(t_)[0].duration,r=performance.getEntriesByName(e_)[0].duration,l=ip.length,p=1/(ip.reduce((x,b)=>x+b,0)/l/1e3),g=ip.filter(x=>x>$g).reduce((x,b)=>x+(b-$g)/$g,0);return{loadTime:a,fullLoadTime:r,fps:p,percentDroppedFrames:g/(l+g)*100,totalFrames:l}}};f.$=ae,f.A=uh,f.B=function(a){if(qt==null){const r=a.navigator?a.navigator.userAgent:null;qt=!!a.safari||!(!r||!(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))}return qt},f.C=class{constructor(a,r){this.target=a,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new f2(()=>this.process()),this.subscription=function(l,p,g,x){return l.addEventListener(p,g,!1),{unsubscribe:()=>{l.removeEventListener(p,g,!1)}}}(this.target,"message",l=>this.receive(l)),this.globalScope=_e(self)?a:window}registerMessageHandler(a,r){this.messageHandlers[a]=r}sendAsync(a,r){return new Promise((l,p)=>{const g=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[g]={resolve:l,reject:p},r&&r.signal.addEventListener("abort",()=>{delete this.resolveRejects[g];const S={id:g,type:"",origin:location.origin,targetMapId:a.targetMapId,sourceMapId:this.mapId};this.target.postMessage(S)},{once:!0});const x=[],b=Object.assign(Object.assign({},a),{id:g,sourceMapId:this.mapId,origin:location.origin,data:Zl(a.data,x)});this.target.postMessage(b,{transfer:x})})}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 p=this.abortControllers[l];return delete this.abortControllers[l],void(p&&p.abort())}if(_e(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 g=this.resolveRejects[a];return delete this.resolveRejects[a],g?void(r.error?g.reject(Wl(r.error)):g.resolve(Wl(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=Wl(r.data),p=new AbortController;this.abortControllers[a]=p;try{const g=yield this.messageHandlers[r.type](r.sourceMapId,l,p);this.completeTask(a,null,g)}catch(g){this.completeTask(a,g)}})}completeTask(a,r,l){const p=[];delete this.abortControllers[a];const g={id:a,type:"",sourceMapId:this.mapId,origin:location.origin,error:r?Zl(r):null,data:Zl(l,p)};this.target.postMessage(g,{transfer:p})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},f.D=Ee,f.E=An,f.F=function(){var a=new uh(16);return uh!=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},f.G=Pn,f.H=function(a,r,l){var p,g,x,b,S,T,P,D,R,V,Z,H,et=l[0],ot=l[1],ft=l[2];return r===a?(a[12]=r[0]*et+r[4]*ot+r[8]*ft+r[12],a[13]=r[1]*et+r[5]*ot+r[9]*ft+r[13],a[14]=r[2]*et+r[6]*ot+r[10]*ft+r[14],a[15]=r[3]*et+r[7]*ot+r[11]*ft+r[15]):(g=r[1],x=r[2],b=r[3],S=r[4],T=r[5],P=r[6],D=r[7],R=r[8],V=r[9],Z=r[10],H=r[11],a[0]=p=r[0],a[1]=g,a[2]=x,a[3]=b,a[4]=S,a[5]=T,a[6]=P,a[7]=D,a[8]=R,a[9]=V,a[10]=Z,a[11]=H,a[12]=p*et+S*ot+R*ft+r[12],a[13]=g*et+T*ot+V*ft+r[13],a[14]=x*et+P*ot+Z*ft+r[14],a[15]=b*et+D*ot+H*ft+r[15]),a},f.I=zg,f.J=function(a,r,l){var p=l[0],g=l[1],x=l[2];return a[0]=r[0]*p,a[1]=r[1]*p,a[2]=r[2]*p,a[3]=r[3]*p,a[4]=r[4]*g,a[5]=r[5]*g,a[6]=r[6]*g,a[7]=r[7]*g,a[8]=r[8]*x,a[9]=r[9]*x,a[10]=r[10]*x,a[11]=r[11]*x,a[12]=r[12],a[13]=r[13],a[14]=r[14],a[15]=r[15],a},f.K=Iy,f.L=function(a,r){const l={};for(let p=0;p{const r=window.document.createElement("video");return r.muted=!0,new Promise(l=>{r.onloadstart=()=>{l(r)};for(const p of a){const g=window.document.createElement("source");li(p)||(r.crossOrigin="Anonymous"),g.src=p,r.appendChild(g)}})},f.a3=function(){return ht++},f.a4=_,f.a5=mh,f.a6=Gc,f.a7=dl,f.a8=ti,f.a9=C0,f.aA=$,f.aB=function(a,r){if(!a)return[{command:"setStyle",args:[r]}];let l=[];try{if(!on(a.version,r.version))return[{command:"setStyle",args:[r]}];on(a.center,r.center)||l.push({command:"setCenter",args:[r.center]}),on(a.zoom,r.zoom)||l.push({command:"setZoom",args:[r.zoom]}),on(a.bearing,r.bearing)||l.push({command:"setBearing",args:[r.bearing]}),on(a.pitch,r.pitch)||l.push({command:"setPitch",args:[r.pitch]}),on(a.sprite,r.sprite)||l.push({command:"setSprite",args:[r.sprite]}),on(a.glyphs,r.glyphs)||l.push({command:"setGlyphs",args:[r.glyphs]}),on(a.transition,r.transition)||l.push({command:"setTransition",args:[r.transition]}),on(a.light,r.light)||l.push({command:"setLight",args:[r.light]}),on(a.terrain,r.terrain)||l.push({command:"setTerrain",args:[r.terrain]}),on(a.sky,r.sky)||l.push({command:"setSky",args:[r.sky]});const p={},g=[];(function(b,S,T,P){let D;for(D in S=S||{},b=b||{})Object.prototype.hasOwnProperty.call(b,D)&&(Object.prototype.hasOwnProperty.call(S,D)||rs(D,T,P));for(D in S)Object.prototype.hasOwnProperty.call(S,D)&&(Object.prototype.hasOwnProperty.call(b,D)?on(b[D],S[D])||(b[D].type==="geojson"&&S[D].type==="geojson"&&Ca(b,S,D)?Wn(T,{command:"setGeoJSONSourceData",args:[D,S[D].data]}):Ts(D,S,T,P)):wo(D,S,T))})(a.sources,r.sources,g,p);const x=[];a.layers&&a.layers.forEach(b=>{"source"in b&&p[b.source]?l.push({command:"removeLayer",args:[b.id]}):x.push(b)}),l=l.concat(g),function(b,S,T){S=S||[];const P=(b=b||[]).map(il),D=S.map(il),R=b.reduce(os,{}),V=S.reduce(os,{}),Z=P.slice(),H=Object.create(null);let et,ot,ft,Et,gt;for(let bt=0,Xt=0;bt@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(l,p,g,x)=>{const b=g||x;return r[p]=!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},f.ab=function(a,r){const l=[];for(const p in a)p in r||l.push(p);return l},f.ac=lt,f.ad=function(a,r,l){var p=Math.sin(l),g=Math.cos(l),x=r[0],b=r[1],S=r[2],T=r[3],P=r[4],D=r[5],R=r[6],V=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]=x*g+P*p,a[1]=b*g+D*p,a[2]=S*g+R*p,a[3]=T*g+V*p,a[4]=P*g-x*p,a[5]=D*g-b*p,a[6]=R*g-S*p,a[7]=V*g-T*p,a},f.ae=function(a){var r=new uh(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},f.af=Fd,f.ag=function(a,r){let l=0,p=0;if(a.kind==="constant")p=a.layoutSize;else if(a.kind!=="source"){const{interpolationType:g,minZoom:x,maxZoom:b}=a,S=g?lt(Pr.interpolationFactor(g,r,x,b),0,1):0;a.kind==="camera"?p=Wr.number(a.minSize,a.maxSize,S):l=S}return{uSizeT:l,uSize:p}},f.ai=function(a,{uSize:r,uSizeT:l},{lowerSize:p,upperSize:g}){return a.kind==="source"?p/za:a.kind==="composite"?Wr.number(p/za,g/za,l):r},f.aj=Vg,f.ak=function(a,r,l,p){const g=r.y-a.y,x=r.x-a.x,b=p.y-l.y,S=p.x-l.x,T=b*x-S*g;if(T===0)return null;const P=(S*(a.y-l.y)-b*(a.x-l.x))/T;return new L(a.x+P*x,a.y+P*g)},f.al=P0,f.am=Ff,f.an=vg,f.ao=$i,f.aq=Bg,f.ar=function(a,r){var l=r[0],p=r[1],g=r[2],x=r[3],b=r[4],S=r[5],T=r[6],P=r[7],D=r[8],R=r[9],V=r[10],Z=r[11],H=r[12],et=r[13],ot=r[14],ft=r[15],Et=l*S-p*b,gt=l*T-g*b,bt=l*P-x*b,Xt=p*T-g*S,Yt=p*P-x*S,me=g*P-x*T,be=D*et-R*H,de=D*ot-V*H,he=D*ft-Z*H,oe=R*ot-V*et,ve=R*ft-Z*et,ue=V*ft-Z*ot,$t=Et*ue-gt*ve+bt*oe+Xt*he-Yt*de+me*be;return $t?(a[0]=(S*ue-T*ve+P*oe)*($t=1/$t),a[1]=(g*ve-p*ue-x*oe)*$t,a[2]=(et*me-ot*Yt+ft*Xt)*$t,a[3]=(V*Yt-R*me-Z*Xt)*$t,a[4]=(T*he-b*ue-P*de)*$t,a[5]=(l*ue-g*he+x*de)*$t,a[6]=(ot*bt-H*me-ft*gt)*$t,a[7]=(D*me-V*bt+Z*gt)*$t,a[8]=(b*ve-S*he+P*be)*$t,a[9]=(p*he-l*ve-x*be)*$t,a[10]=(H*Yt-et*bt+ft*Et)*$t,a[11]=(R*bt-D*Yt-Z*Et)*$t,a[12]=(S*de-b*oe-T*be)*$t,a[13]=(l*oe-p*de+g*be)*$t,a[14]=(et*gt-H*Xt-ot*Et)*$t,a[15]=(D*Xt-R*gt+V*Et)*$t,a):null},f.as=Xg,f.at=Fg,f.au=Yg,f.av=function(){const a={},r=Mt.$version;for(const l in Mt.$root){const p=Mt.$root[l];if(p.required){let g=null;g=l==="version"?r:p.type==="array"?[]:{},g!=null&&(a[l]=g)}}return a},f.aw=Id,f.ax=Ci,f.ay=function(a){a=a.slice();const r=Object.create(null);for(let l=0;l$t*$i)}let de=b?"center":l.get("text-justify").evaluate(P,{},a.canonical);const he=l.get("symbol-placement"),oe=he==="point"?l.get("text-max-width").evaluate(P,{},a.canonical)*$i:0,ve=()=>{a.bucket.allowVerticalPlacement&&Hl(bt)&&(H.vertical=Zd(et,a.glyphMap,a.glyphPositions,a.imagePositions,D,oe,x,me,"left",Yt,ft,f.ah.vertical,!0,he,V,R))};if(!b&&be){const ue=new Set;if(de==="auto")for(let De=0;Deu(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.`)}}),f.e=dt,f.f=a=>new Promise((r,l)=>{const p=new Image;p.onload=()=>{r(p),URL.revokeObjectURL(p.src),p.onload=null,window.requestAnimationFrame(()=>{p.src=Ce})},p.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 g=new Blob([new Uint8Array(a)],{type:"image/png"});p.src=a.byteLength?URL.createObjectURL(g):Ce}),f.g=mn,f.h=(a,r)=>_i(dt(a,{type:"json"}),r),f.i=_e,f.j=xe,f.k=St,f.l=(a,r)=>_i(dt(a,{type:"arrayBuffer"}),r),f.m=_i,f.n=function(a){return new Rg(a).readFields(Jw,[])},f.o=jf,f.p=r0,f.q=so,f.r=mg,f.s=li,f.t=jl,f.u=pe,f.v=Mt,f.w=ee,f.x=cl,f.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)}},f.z=Wr}),s("worker",["./shared"],function(f){class u{constructor(B){this.keyCache={},B&&this.replace(B)}replace(B){this._layerConfigs={},this._layers={},this.update(B,[])}update(B,q){for(const nt of B){this._layerConfigs[nt.id]=nt;const yt=this._layers[nt.id]=f.az(nt);yt._featureFilter=f.a6(yt.filter),this.keyCache[nt.id]&&delete this.keyCache[nt.id]}for(const nt of q)delete this.keyCache[nt],delete this._layerConfigs[nt],delete this._layers[nt];this.familiesBySource={};const X=f.bh(Object.values(this._layerConfigs),this.keyCache);for(const nt of X){const yt=nt.map(Ft=>this._layers[Ft.id]),Y=yt[0];if(Y.visibility==="none")continue;const vt=Y.source||"";let pt=this.familiesBySource[vt];pt||(pt=this.familiesBySource[vt]={});const It=Y.sourceLayer||"_geojsonTileLayer";let Nt=pt[It];Nt||(Nt=pt[It]=[]),Nt.push(yt)}}}class v{constructor(B){const q={},X=[];for(const vt in B){const pt=B[vt],It=q[vt]={};for(const Nt in pt){const Ft=pt[+Nt];if(!Ft||Ft.bitmap.width===0||Ft.bitmap.height===0)continue;const Ht={x:0,y:0,w:Ft.bitmap.width+2,h:Ft.bitmap.height+2};X.push(Ht),It[Nt]={rect:Ht,metrics:Ft.metrics}}}const{w:nt,h:yt}=f.p(X),Y=new f.o({width:nt||1,height:yt||1});for(const vt in B){const pt=B[vt];for(const It in pt){const Nt=pt[+It];if(!Nt||Nt.bitmap.width===0||Nt.bitmap.height===0)continue;const Ft=q[vt][It].rect;f.o.copy(Nt.bitmap,Y,{x:0,y:0},{x:Ft.x+1,y:Ft.y+1},Nt.bitmap)}}this.image=Y,this.positions=q}}f.bi("GlyphAtlas",v);class w{constructor(B){this.tileID=new f.Q(B.tileID.overscaledZ,B.tileID.wrap,B.tileID.canonical.z,B.tileID.canonical.x,B.tileID.canonical.y),this.uid=B.uid,this.zoom=B.zoom,this.pixelRatio=B.pixelRatio,this.tileSize=B.tileSize,this.source=B.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=B.showCollisionBoxes,this.collectResourceTiming=!!B.collectResourceTiming,this.returnDependencies=!!B.returnDependencies,this.promoteId=B.promoteId,this.inFlightDependencies=[]}parse(B,q,X,nt){return f._(this,void 0,void 0,function*(){this.status="parsing",this.data=B,this.collisionBoxArray=new f.a4;const yt=new f.bj(Object.keys(B.layers).sort()),Y=new f.bk(this.tileID,this.promoteId);Y.bucketLayerIDs=[];const vt={},pt={featureIndex:Y,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:X},It=q.familiesBySource[this.source];for(const nn in It){const yi=B.layers[nn];if(!yi)continue;yi.version===1&&f.w(`Vector tile source "${this.source}" layer "${nn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Ki=yt.encode(nn),Zr=[];for(let io=0;io=ur.maxzoom||ur.visibility!=="none"&&(I(io,this.zoom,X),(vt[ur.id]=ur.createBucket({index:Y.bucketLayerIDs.length,layers:io,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Ki,sourceID:this.source})).populate(Zr,pt,this.tileID.canonical),Y.bucketLayerIDs.push(io.map(Ls=>Ls.id)))}}const Nt=f.aE(pt.glyphDependencies,nn=>Object.keys(nn).map(Number));this.inFlightDependencies.forEach(nn=>nn==null?void 0:nn.abort()),this.inFlightDependencies=[];let Ft=Promise.resolve({});if(Object.keys(Nt).length){const nn=new AbortController;this.inFlightDependencies.push(nn),Ft=nt.sendAsync({type:"GG",data:{stacks:Nt,source:this.source,tileID:this.tileID,type:"glyphs"}},nn)}const Ht=Object.keys(pt.iconDependencies);let we=Promise.resolve({});if(Ht.length){const nn=new AbortController;this.inFlightDependencies.push(nn),we=nt.sendAsync({type:"GI",data:{icons:Ht,source:this.source,tileID:this.tileID,type:"icons"}},nn)}const Te=Object.keys(pt.patternDependencies);let Ge=Promise.resolve({});if(Te.length){const nn=new AbortController;this.inFlightDependencies.push(nn),Ge=nt.sendAsync({type:"GI",data:{icons:Te,source:this.source,tileID:this.tileID,type:"patterns"}},nn)}const[je,yn,Vn]=yield Promise.all([Ft,we,Ge]),$n=new v(je),qi=new f.bl(yn,Vn);for(const nn in vt){const yi=vt[nn];yi instanceof f.a5?(I(yi.layers,this.zoom,X),f.bm({bucket:yi,glyphMap:je,glyphPositions:$n.positions,imageMap:yn,imagePositions:qi.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):yi.hasPattern&&(yi instanceof f.bn||yi instanceof f.bo||yi instanceof f.bp)&&(I(yi.layers,this.zoom,X),yi.addFeatures(pt,this.tileID.canonical,qi.patternPositions))}return this.status="done",{buckets:Object.values(vt).filter(nn=>!nn.isEmpty()),featureIndex:Y,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:$n.image,imageAtlas:qi,glyphMap:this.returnDependencies?je:null,iconMap:this.returnDependencies?yn:null,glyphPositions:this.returnDependencies?$n.positions:null}})}}function I(st,B,q){const X=new f.a8(B);for(const nt of st)nt.recalculate(X,q)}class L{constructor(B,q,X){this.actor=B,this.layerIndex=q,this.availableImages=X,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(B,q){return f._(this,void 0,void 0,function*(){const X=yield f.l(B.request,q);try{return{vectorTile:new f.bq.VectorTile(new f.br(X.data)),rawData:X.data,cacheControl:X.cacheControl,expires:X.expires}}catch(nt){const yt=new Uint8Array(X.data);let Y=`Unable to parse the tile at ${B.request.url}, `;throw Y+=yt[0]===31&&yt[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${nt.messge}`,new Error(Y)}})}loadTile(B){return f._(this,void 0,void 0,function*(){const q=B.uid,X=!!(B&&B.request&&B.request.collectResourceTiming)&&new f.bs(B.request),nt=new w(B);this.loading[q]=nt;const yt=new AbortController;nt.abort=yt;try{const Y=yield this.loadVectorTile(B,yt);if(delete this.loading[q],!Y)return null;const vt=Y.rawData,pt={};Y.expires&&(pt.expires=Y.expires),Y.cacheControl&&(pt.cacheControl=Y.cacheControl);const It={};if(X){const Ft=X.finish();Ft&&(It.resourceTiming=JSON.parse(JSON.stringify(Ft)))}nt.vectorTile=Y.vectorTile;const Nt=nt.parse(Y.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[q]=nt,this.fetching[q]={rawTileData:vt,cacheControl:pt,resourceTiming:It};try{const Ft=yield Nt;return f.e({rawTileData:vt.slice(0)},Ft,pt,It)}finally{delete this.fetching[q]}}catch(Y){throw delete this.loading[q],nt.status="done",this.loaded[q]=nt,Y}})}reloadTile(B){return f._(this,void 0,void 0,function*(){const q=B.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 X=this.loaded[q];if(X.showCollisionBoxes=B.showCollisionBoxes,X.status==="parsing"){const nt=yield X.parse(X.vectorTile,this.layerIndex,this.availableImages,this.actor);let yt;if(this.fetching[q]){const{rawTileData:Y,cacheControl:vt,resourceTiming:pt}=this.fetching[q];delete this.fetching[q],yt=f.e({rawTileData:Y.slice(0)},nt,vt,pt)}else yt=nt;return yt}if(X.status==="done"&&X.vectorTile)return X.parse(X.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(B){return f._(this,void 0,void 0,function*(){const q=this.loading,X=B.uid;q&&q[X]&&q[X].abort&&(q[X].abort.abort(),delete q[X])})}removeTile(B){return f._(this,void 0,void 0,function*(){this.loaded&&this.loaded[B.uid]&&delete this.loaded[B.uid]})}}class A{constructor(){this.loaded={}}loadTile(B){return f._(this,void 0,void 0,function*(){const{uid:q,encoding:X,rawImageData:nt,redFactor:yt,greenFactor:Y,blueFactor:vt,baseShift:pt}=B,It=nt.width+2,Nt=nt.height+2,Ft=f.b(nt)?new f.R({width:It,height:Nt},yield f.bt(nt,-1,-1,It,Nt)):nt,Ht=new f.bu(q,Ft,X,yt,Y,vt,pt);return this.loaded=this.loaded||{},this.loaded[q]=Ht,Ht})}removeTile(B){const q=this.loaded,X=B.uid;q&&q[X]&&delete q[X]}}function U(st,B){if(st.length!==0){z(st[0],B);for(var q=1;q=Math.abs(vt)?q-pt+vt:vt-pt+q,q=pt}q+X>=0!=!!B&&st.reverse()}var K=f.bv(function st(B,q){var X,nt=B&&B.type;if(nt==="FeatureCollection")for(X=0;X>31}function re(st,B){for(var q=st.loadGeometry(),X=st.type,nt=0,yt=0,Y=q.length,vt=0;vtst},Ce=Math.fround||(pn=new Float32Array(1),st=>(pn[0]=+st,pn[0]));var pn;const Ve=3,Ie=5,sn=6;class In{constructor(B){this.options=Object.assign(Object.create(Ne),B),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(B){const{log:q,minZoom:X,maxZoom:nt}=this.options;q&&console.time("total time");const yt=`prepare ${B.length} points`;q&&console.time(yt),this.points=B;const Y=[];for(let pt=0;pt=X;pt--){const It=+Date.now();vt=this.trees[pt]=this._createTree(this._cluster(vt,pt)),q&&console.log("z%d: %d clusters in %dms",pt,vt.numItems,+Date.now()-It)}return q&&console.timeEnd("total time"),this}getClusters(B,q){let X=((B[0]+180)%360+360)%360-180;const nt=Math.max(-90,Math.min(90,B[1]));let yt=B[2]===180?180:((B[2]+180)%360+360)%360-180;const Y=Math.max(-90,Math.min(90,B[3]));if(B[2]-B[0]>=360)X=-180,yt=180;else if(X>yt){const Ft=this.getClusters([X,nt,180,Y],q),Ht=this.getClusters([-180,nt,yt,Y],q);return Ft.concat(Ht)}const vt=this.trees[this._limitZoom(q)],pt=vt.range(Pn(X),gi(Y),Pn(yt),gi(nt)),It=vt.data,Nt=[];for(const Ft of pt){const Ht=this.stride*Ft;Nt.push(It[Ht+Ie]>1?dn(It,Ht,this.clusterProps):this.points[It[Ht+Ve]])}return Nt}getChildren(B){const q=this._getOriginId(B),X=this._getOriginZoom(B),nt="No cluster with the specified id.",yt=this.trees[X];if(!yt)throw new Error(nt);const Y=yt.data;if(q*this.stride>=Y.length)throw new Error(nt);const vt=this.options.radius/(this.options.extent*Math.pow(2,X-1)),pt=yt.within(Y[q*this.stride],Y[q*this.stride+1],vt),It=[];for(const Nt of pt){const Ft=Nt*this.stride;Y[Ft+4]===B&&It.push(Y[Ft+Ie]>1?dn(Y,Ft,this.clusterProps):this.points[Y[Ft+Ve]])}if(It.length===0)throw new Error(nt);return It}getLeaves(B,q,X){const nt=[];return this._appendLeaves(nt,B,q=q||10,X=X||0,0),nt}getTile(B,q,X){const nt=this.trees[this._limitZoom(B)],yt=Math.pow(2,B),{extent:Y,radius:vt}=this.options,pt=vt/Y,It=(X-pt)/yt,Nt=(X+1+pt)/yt,Ft={features:[]};return this._addTileFeatures(nt.range((q-pt)/yt,It,(q+1+pt)/yt,Nt),nt.data,q,X,yt,Ft),q===0&&this._addTileFeatures(nt.range(1-pt/yt,It,1,Nt),nt.data,yt,X,yt,Ft),q===yt-1&&this._addTileFeatures(nt.range(0,It,pt/yt,Nt),nt.data,-1,X,yt,Ft),Ft.features.length?Ft:null}getClusterExpansionZoom(B){let q=this._getOriginZoom(B)-1;for(;q<=this.options.maxZoom;){const X=this.getChildren(B);if(q++,X.length!==1)break;B=X[0].properties.cluster_id}return q}_appendLeaves(B,q,X,nt,yt){const Y=this.getChildren(q);for(const vt of Y){const pt=vt.properties;if(pt&&pt.cluster?yt+pt.point_count<=nt?yt+=pt.point_count:yt=this._appendLeaves(B,pt.cluster_id,X,nt,yt):yt1;let Nt,Ft,Ht;if(It)Nt=mn(q,pt,this.clusterProps),Ft=q[pt],Ht=q[pt+1];else{const Ge=this.points[q[pt+Ve]];Nt=Ge.properties;const[je,yn]=Ge.geometry.coordinates;Ft=Pn(je),Ht=gi(yn)}const we={type:1,geometry:[[Math.round(this.options.extent*(Ft*yt-X)),Math.round(this.options.extent*(Ht*yt-nt))]],tags:Nt};let Te;Te=It||this.options.generateId?q[pt+Ve]:this.points[q[pt+Ve]].id,Te!==void 0&&(we.id=Te),Y.features.push(we)}}_limitZoom(B){return Math.max(this.options.minZoom,Math.min(Math.floor(+B),this.options.maxZoom+1))}_cluster(B,q){const{radius:X,extent:nt,reduce:yt,minPoints:Y}=this.options,vt=X/(nt*Math.pow(2,q)),pt=B.data,It=[],Nt=this.stride;for(let Ft=0;Ftq&&(je+=pt[Vn+Ie])}if(je>Ge&&je>=Y){let yn,Vn=Ht*Ge,$n=we*Ge,qi=-1;const nn=((Ft/Nt|0)<<5)+(q+1)+this.points.length;for(const yi of Te){const Ki=yi*Nt;if(pt[Ki+2]<=q)continue;pt[Ki+2]=q;const Zr=pt[Ki+Ie];Vn+=pt[Ki]*Zr,$n+=pt[Ki+1]*Zr,pt[Ki+4]=nn,yt&&(yn||(yn=this._map(pt,Ft,!0),qi=this.clusterProps.length,this.clusterProps.push(yn)),yt(yn,this._map(pt,Ki)))}pt[Ft+4]=nn,It.push(Vn/je,$n/je,1/0,nn,-1,je),yt&&It.push(qi)}else{for(let yn=0;yn1)for(const yn of Te){const Vn=yn*Nt;if(!(pt[Vn+2]<=q)){pt[Vn+2]=q;for(let $n=0;$n>5}_getOriginZoom(B){return(B-this.points.length)%32}_map(B,q,X){if(B[q+Ie]>1){const Y=this.clusterProps[B[q+sn]];return X?Object.assign({},Y):Y}const nt=this.points[B[q+Ve]].properties,yt=this.options.map(nt);return X&&yt===nt?Object.assign({},yt):yt}}function dn(st,B,q){return{type:"Feature",id:st[B+Ve],properties:mn(st,B,q),geometry:{type:"Point",coordinates:[(X=st[B],360*(X-.5)),Ci(st[B+1])]}};var X}function mn(st,B,q){const X=st[B+Ie],nt=X>=1e4?`${Math.round(X/1e3)}k`:X>=1e3?Math.round(X/100)/10+"k":X,yt=st[B+sn],Y=yt===-1?{}:Object.assign({},q[yt]);return Object.assign(Y,{cluster:!0,cluster_id:st[B+Ve],point_count:X,point_count_abbreviated:nt})}function Pn(st){return st/360+.5}function gi(st){const B=Math.sin(st*Math.PI/180),q=.5-.25*Math.log((1+B)/(1-B))/Math.PI;return q<0?0:q>1?1:q}function Ci(st){const B=(180-360*st)*Math.PI/180;return 360*Math.atan(Math.exp(B))/Math.PI-90}function _i(st,B,q,X){for(var nt,yt=X,Y=q-B>>1,vt=q-B,pt=st[B],It=st[B+1],Nt=st[q],Ft=st[q+1],Ht=B+3;Htyt)nt=Ht,yt=we;else if(we===yt){var Te=Math.abs(Ht-Y);TeX&&(nt-B>3&&_i(st,B,nt,X),st[nt+2]=yt,q-nt>3&&_i(st,nt,q,X))}function li(st,B,q,X,nt,yt){var Y=nt-q,vt=yt-X;if(Y!==0||vt!==0){var pt=((st-q)*Y+(B-X)*vt)/(Y*Y+vt*vt);pt>1?(q=nt,X=yt):pt>0&&(q+=Y*pt,X+=vt*pt)}return(Y=st-q)*Y+(vt=B-X)*vt}function Kt(st,B,q,X){var nt={id:st===void 0?null:st,type:B,geometry:q,tags:X,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(yt){var Y=yt.geometry,vt=yt.type;if(vt==="Point"||vt==="MultiPoint"||vt==="LineString")mt(yt,Y);else if(vt==="Polygon"||vt==="MultiLineString")for(var pt=0;pt0&&(Y+=X?(nt*It-pt*yt)/2:Math.sqrt(Math.pow(pt-nt,2)+Math.pow(It-yt,2))),nt=pt,yt=It}var Nt=B.length-3;B[2]=1,_i(B,0,Nt,q),B[Nt+2]=1,B.size=Math.abs(Y),B.start=0,B.end=B.size}function Mt(st,B,q,X){for(var nt=0;nt1?1:q}function on(st,B,q,X,nt,yt,Y,vt){if(X/=B,yt>=(q/=B)&&Y=X)return null;for(var pt=[],It=0;It=q&&Te=X)){var Ge=[];if(Ht==="Point"||Ht==="MultiPoint")Wn(Ft,Ge,q,X,nt);else if(Ht==="LineString")wo(Ft,Ge,q,X,nt,!1,vt.lineMetrics);else if(Ht==="MultiLineString")Ts(Ft,Ge,q,X,nt,!1);else if(Ht==="Polygon")Ts(Ft,Ge,q,X,nt,!0);else if(Ht==="MultiPolygon")for(var je=0;je=q&&Y<=X&&(B.push(st[yt]),B.push(st[yt+1]),B.push(st[yt+2]))}}function wo(st,B,q,X,nt,yt,Y){for(var vt,pt,It=rs(st),Nt=nt===0?vr:il,Ft=st.start,Ht=0;Htq&&(pt=Nt(It,we,Te,je,yn,q),Y&&(It.start=Ft+vt*pt)):Vn>X?$n=q&&(pt=Nt(It,we,Te,je,yn,q),qi=!0),$n>X&&Vn<=X&&(pt=Nt(It,we,Te,je,yn,X),qi=!0),!yt&&qi&&(Y&&(It.end=Ft+vt*pt),B.push(It),It=rs(st)),Y&&(Ft+=vt)}var nn=st.length-3;we=st[nn],Te=st[nn+1],Ge=st[nn+2],(Vn=nt===0?we:Te)>=q&&Vn<=X&&Ca(It,we,Te,Ge),nn=It.length-3,yt&&nn>=3&&(It[nn]!==It[0]||It[nn+1]!==It[1])&&Ca(It,It[0],It[1],It[2]),It.length&&B.push(It)}function rs(st){var B=[];return B.size=st.size,B.start=st.start,B.end=st.end,B}function Ts(st,B,q,X,nt,yt){for(var Y=0;YY.maxX&&(Y.maxX=Nt),Ft>Y.maxY&&(Y.maxY=Ft)}return Y}function Gi(st,B,q,X){var nt=B.geometry,yt=B.type,Y=[];if(yt==="Point"||yt==="MultiPoint")for(var vt=0;vt0&&B.size<(nt?Y:X))q.numPoints+=B.length/3;else{for(var vt=[],pt=0;ptY)&&(q.numSimplified++,vt.push(B[pt]),vt.push(B[pt+1])),q.numPoints++;nt&&function(It,Nt){for(var Ft=0,Ht=0,we=It.length,Te=we-2;Ht0===Nt)for(Ht=0,we=It.length;Ht24)throw new Error("maxZoom should be in the 0-24 range");if(B.promoteId&&B.generateId)throw new Error("promoteId and generateId cannot be used together.");var X=function(nt,yt){var Y=[];if(nt.type==="FeatureCollection")for(var vt=0;vt1&&console.time("creation"),Ht=this.tiles[Ft]=rl(st,B,q,X,pt),this.tileCoords.push({z:B,x:q,y:X}),It)){It>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",B,q,X,Ht.numFeatures,Ht.numPoints,Ht.numSimplified),console.timeEnd("creation"));var we="z"+B;this.stats[we]=(this.stats[we]||0)+1,this.total++}if(Ht.source=st,nt){if(B===pt.maxZoom||B===nt)continue;var Te=1<1&&console.time("clipping");var Ge,je,yn,Vn,$n,qi,nn=.5*pt.buffer/pt.extent,yi=.5-nn,Ki=.5+nn,Zr=1+nn;Ge=je=yn=Vn=null,$n=on(st,Nt,q-nn,q+Ki,0,Ht.minX,Ht.maxX,pt),qi=on(st,Nt,q+yi,q+Zr,0,Ht.minX,Ht.maxX,pt),st=null,$n&&(Ge=on($n,Nt,X-nn,X+Ki,1,Ht.minY,Ht.maxY,pt),je=on($n,Nt,X+yi,X+Zr,1,Ht.minY,Ht.maxY,pt),$n=null),qi&&(yn=on(qi,Nt,X-nn,X+Ki,1,Ht.minY,Ht.maxY,pt),Vn=on(qi,Nt,X+yi,X+Zr,1,Ht.minY,Ht.maxY,pt),qi=null),It>1&&console.timeEnd("clipping"),vt.push(Ge||[],B+1,2*q,2*X),vt.push(je||[],B+1,2*q,2*X+1),vt.push(yn||[],B+1,2*q+1,2*X),vt.push(Vn||[],B+1,2*q+1,2*X+1)}}},Ke.prototype.getTile=function(st,B,q){var X=this.options,nt=X.extent,yt=X.debug;if(st<0||st>24)return null;var Y=1<1&&console.log("drilling down to z%d-%d-%d",st,B,q);for(var pt,It=st,Nt=B,Ft=q;!pt&&It>0;)It--,Nt=Math.floor(Nt/2),Ft=Math.floor(Ft/2),pt=this.tiles[Xe(It,Nt,Ft)];return pt&&pt.source?(yt>1&&console.log("found parent tile z%d-%d-%d",It,Nt,Ft),yt>1&&console.time("drilling down"),this.splitTile(pt.source,It,Nt,Ft,st,B,q),yt>1&&console.timeEnd("drilling down"),this.tiles[vt]?Uo(this.tiles[vt],nt):null):null};class oa extends L{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(B,q){return f._(this,void 0,void 0,function*(){const X=B.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const nt=this._geoJSONIndex.getTile(X.z,X.x,X.y);if(!nt)return null;const yt=new class{constructor(vt){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=f.W,this.length=vt.length,this._features=vt}feature(vt){return new class{constructor(pt){this._feature=pt,this.extent=f.W,this.type=pt.type,this.properties=pt.tags,"id"in pt&&!isNaN(pt.id)&&(this.id=parseInt(pt.id,10))}loadGeometry(){if(this._feature.type===1){const pt=[];for(const It of this._feature.geometry)pt.push([new f.P(It[0],It[1])]);return pt}{const pt=[];for(const It of this._feature.geometry){const Nt=[];for(const Ft of It)Nt.push(new f.P(Ft[0],Ft[1]));pt.push(Nt)}return pt}}toGeoJSON(pt,It,Nt){return J.call(this,pt,It,Nt)}}(this._features[vt])}}(nt.features);let Y=qt(yt);return Y.byteOffset===0&&Y.byteLength===Y.buffer.byteLength||(Y=new Uint8Array(Y)),{vectorTile:yt,rawData:Y.buffer}})}loadData(B){return f._(this,void 0,void 0,function*(){var q;(q=this._pendingRequest)===null||q===void 0||q.abort();const X=!!(B&&B.request&&B.request.collectResourceTiming)&&new f.bs(B.request);this._pendingRequest=new AbortController;try{let nt=yield this.loadGeoJSON(B,this._pendingRequest);if(delete this._pendingRequest,typeof nt!="object")throw new Error(`Input data given to '${B.source}' is not a valid GeoJSON object.`);if(K(nt,!0),B.filter){const Y=f.by(B.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Y.result==="error")throw new Error(Y.value.map(pt=>`${pt.key}: ${pt.message}`).join(", "));nt={type:"FeatureCollection",features:nt.features.filter(pt=>Y.value.evaluate({zoom:0},pt))}}this._geoJSONIndex=B.cluster?new In(function({superclusterOptions:Y,clusterProperties:vt}){if(!vt||!Y)return Y;const pt={},It={},Nt={accumulated:null,zoom:0},Ft={properties:null},Ht=Object.keys(vt);for(const we of Ht){const[Te,Ge]=vt[we],je=f.by(Ge),yn=f.by(typeof Te=="string"?[Te,["accumulated"],["get",we]]:Te);pt[we]=je.value,It[we]=yn.value}return Y.map=we=>{Ft.properties=we;const Te={};for(const Ge of Ht)Te[Ge]=pt[Ge].evaluate(Nt,Ft);return Te},Y.reduce=(we,Te)=>{Ft.properties=Te;for(const Ge of Ht)Nt.accumulated=we[Ge],we[Ge]=It[Ge].evaluate(Nt,Ft)},Y}(B)).load(nt.features):function(Y,vt){return new Ke(Y,vt)}(nt,B.geojsonVtOptions),this.loaded={};const yt={};if(X){const Y=X.finish();Y&&(yt.resourceTiming={},yt.resourceTiming[B.source]=JSON.parse(JSON.stringify(Y)))}return yt}catch(nt){if(delete this._pendingRequest,f.bz(nt))return{abandoned:!0};throw nt}})}reloadTile(B){const q=this.loaded;return q&&q[B.uid]?super.reloadTile(B):this.loadTile(B)}loadGeoJSON(B,q){return f._(this,void 0,void 0,function*(){const{promoteId:X}=B;if(B.request){const nt=yield f.h(B.request,q);return this._dataUpdateable=Go(nt.data,X)?He(nt.data,X):void 0,nt.data}if(typeof B.data=="string")try{const nt=JSON.parse(B.data);return this._dataUpdateable=Go(nt,X)?He(nt,X):void 0,nt}catch{throw new Error(`Input data given to '${B.source}' is not a valid GeoJSON object.`)}if(!B.dataDiff)throw new Error(`Input data given to '${B.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${B.source}`);return function(nt,yt,Y){var vt,pt,It,Nt;if(yt.removeAll&&nt.clear(),yt.remove)for(const Ft of yt.remove)nt.delete(Ft);if(yt.add)for(const Ft of yt.add){const Ht=Li(Ft,Y);Ht!=null&&nt.set(Ht,Ft)}if(yt.update)for(const Ft of yt.update){let Ht=nt.get(Ft.id);if(Ht==null)continue;const we=!Ft.removeAllProperties&&(((vt=Ft.removeProperties)===null||vt===void 0?void 0:vt.length)>0||((pt=Ft.addOrUpdateProperties)===null||pt===void 0?void 0:pt.length)>0);if((Ft.newGeometry||Ft.removeAllProperties||we)&&(Ht=Object.assign({},Ht),nt.set(Ft.id,Ht),we&&(Ht.properties=Object.assign({},Ht.properties))),Ft.newGeometry&&(Ht.geometry=Ft.newGeometry),Ft.removeAllProperties)Ht.properties={};else if(((It=Ft.removeProperties)===null||It===void 0?void 0:It.length)>0)for(const Te of Ft.removeProperties)Object.prototype.hasOwnProperty.call(Ht.properties,Te)&&delete Ht.properties[Te];if(((Nt=Ft.addOrUpdateProperties)===null||Nt===void 0?void 0:Nt.length)>0)for(const{key:Te,value:Ge}of Ft.addOrUpdateProperties)Ht.properties[Te]=Ge}}(this._dataUpdateable,B.dataDiff,X),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(B){return f._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(B){return this._geoJSONIndex.getClusterExpansionZoom(B.clusterId)}getClusterChildren(B){return this._geoJSONIndex.getChildren(B.clusterId)}getClusterLeaves(B){return this._geoJSONIndex.getLeaves(B.clusterId,B.limit,B.offset)}}class Di{constructor(B){this.self=B,this.actor=new f.C(B),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(q,X)=>{if(this.externalWorkerSourceTypes[q])throw new Error(`Worker source with name "${q}" already registered.`);this.externalWorkerSourceTypes[q]=X},this.self.addProtocol=f.bf,this.self.removeProtocol=f.bg,this.self.registerRTLTextPlugin=q=>{if(f.bA.isParsed())throw new Error("RTL text plugin already registered.");f.bA.setMethods(q)},this.actor.registerMessageHandler("LDT",(q,X)=>this._getDEMWorkerSource(q,X.source).loadTile(X)),this.actor.registerMessageHandler("RDT",(q,X)=>f._(this,void 0,void 0,function*(){this._getDEMWorkerSource(q,X.source).removeTile(X)})),this.actor.registerMessageHandler("GCEZ",(q,X)=>f._(this,void 0,void 0,function*(){return this._getWorkerSource(q,X.type,X.source).getClusterExpansionZoom(X)})),this.actor.registerMessageHandler("GCC",(q,X)=>f._(this,void 0,void 0,function*(){return this._getWorkerSource(q,X.type,X.source).getClusterChildren(X)})),this.actor.registerMessageHandler("GCL",(q,X)=>f._(this,void 0,void 0,function*(){return this._getWorkerSource(q,X.type,X.source).getClusterLeaves(X)})),this.actor.registerMessageHandler("LD",(q,X)=>this._getWorkerSource(q,X.type,X.source).loadData(X)),this.actor.registerMessageHandler("LT",(q,X)=>this._getWorkerSource(q,X.type,X.source).loadTile(X)),this.actor.registerMessageHandler("RT",(q,X)=>this._getWorkerSource(q,X.type,X.source).reloadTile(X)),this.actor.registerMessageHandler("AT",(q,X)=>this._getWorkerSource(q,X.type,X.source).abortTile(X)),this.actor.registerMessageHandler("RMT",(q,X)=>this._getWorkerSource(q,X.type,X.source).removeTile(X)),this.actor.registerMessageHandler("RS",(q,X)=>f._(this,void 0,void 0,function*(){if(!this.workerSources[q]||!this.workerSources[q][X.type]||!this.workerSources[q][X.type][X.source])return;const nt=this.workerSources[q][X.type][X.source];delete this.workerSources[q][X.type][X.source],nt.removeSource!==void 0&&nt.removeSource(X)})),this.actor.registerMessageHandler("RM",q=>f._(this,void 0,void 0,function*(){delete this.layerIndexes[q],delete this.availableImages[q],delete this.workerSources[q],delete this.demWorkerSources[q]})),this.actor.registerMessageHandler("SR",(q,X)=>f._(this,void 0,void 0,function*(){this.referrer=X})),this.actor.registerMessageHandler("SRPS",(q,X)=>this._syncRTLPluginState(q,X)),this.actor.registerMessageHandler("IS",(q,X)=>f._(this,void 0,void 0,function*(){this.self.importScripts(X)})),this.actor.registerMessageHandler("SI",(q,X)=>this._setImages(q,X)),this.actor.registerMessageHandler("UL",(q,X)=>f._(this,void 0,void 0,function*(){this._getLayerIndex(q).update(X.layers,X.removedIds)})),this.actor.registerMessageHandler("SL",(q,X)=>f._(this,void 0,void 0,function*(){this._getLayerIndex(q).replace(X)}))}_setImages(B,q){return f._(this,void 0,void 0,function*(){this.availableImages[B]=q;for(const X in this.workerSources[B]){const nt=this.workerSources[B][X];for(const yt in nt)nt[yt].availableImages=q}})}_syncRTLPluginState(B,q){return f._(this,void 0,void 0,function*(){if(f.bA.isParsed())return f.bA.getState();if(q.pluginStatus!=="loading")return f.bA.setState(q),q;const X=q.pluginURL;if(this.self.importScripts(X),f.bA.isParsed()){const nt={pluginStatus:"loaded",pluginURL:X};return f.bA.setState(nt),nt}throw f.bA.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${X}`)})}_getAvailableImages(B){let q=this.availableImages[B];return q||(q=[]),q}_getLayerIndex(B){let q=this.layerIndexes[B];return q||(q=this.layerIndexes[B]=new u),q}_getWorkerSource(B,q,X){if(this.workerSources[B]||(this.workerSources[B]={}),this.workerSources[B][q]||(this.workerSources[B][q]={}),!this.workerSources[B][q][X]){const nt={sendAsync:(yt,Y)=>(yt.targetMapId=B,this.actor.sendAsync(yt,Y))};switch(q){case"vector":this.workerSources[B][q][X]=new L(nt,this._getLayerIndex(B),this._getAvailableImages(B));break;case"geojson":this.workerSources[B][q][X]=new oa(nt,this._getLayerIndex(B),this._getAvailableImages(B));break;default:this.workerSources[B][q][X]=new this.externalWorkerSourceTypes[q](nt,this._getLayerIndex(B),this._getAvailableImages(B))}}return this.workerSources[B][q][X]}_getDEMWorkerSource(B,q){return this.demWorkerSources[B]||(this.demWorkerSources[B]={}),this.demWorkerSources[B][q]||(this.demWorkerSources[B][q]=new A),this.demWorkerSources[B][q]}}return f.i(self)&&(self.worker=new Di(self)),Di}),s("index",["exports","./shared"],function(f,u){var v="4.1.3";let w,I;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&&(I==null&&(I=matchMedia("(prefers-reduced-motion: reduce)")),I.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 m=h.boundingClientRect;return new u.P((d.clientX-m.left)/h.x-o.clientLeft,(d.clientY-m.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=[],m=A.getScale(o);for(let y=0;y{o=[],h=0,d=0,m={}},_.addThrottleControl=M=>{const k=d++;return m[k]=M,k},_.removeThrottleControl=M=>{delete m[M],E()},_.getImage=(M,k,N=!0)=>new Promise((F,W)=>{U.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:rt=>{W(rt)},onSuccess:rt=>{F(rt)}}),E()});const y=M=>u._(this,void 0,void 0,function*(){M.state="running";const{requestParameters:k,supportImageRefresh:N,onError:F,onSuccess:W,abortController:rt}=M,it=N===!1&&!u.i(self)&&!u.g(k.url)&&(!k.headers||Object.keys(k.headers).reduce((_t,kt)=>_t&&kt==="accept",!0));h++;const at=it?C(k,rt):u.m(k,rt);try{const _t=yield at;delete M.abortController,M.state="completed",_t.data instanceof HTMLImageElement||u.b(_t.data)?W(_t):_t.data&&W({data:yield(tt=_t.data,typeof createImageBitmap=="function"?u.d(tt):u.f(tt)),cacheControl:_t.cacheControl,expires:_t.expires})}catch(_t){delete M.abortController,F(_t)}finally{h--,E()}var tt}),E=()=>{const M=(()=>{for(const k of Object.keys(m))if(m[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)}},C=(M,k)=>new Promise((N,F)=>{const W=new Image,rt=M.url,it=M.credentials;it&&it==="include"?W.crossOrigin="use-credentials":(it&&it==="same-origin"||!u.s(rt))&&(W.crossOrigin="anonymous"),k.signal.addEventListener("abort",()=>{W.src="",F(u.c())}),W.fetchPriority="high",W.onload=()=>{W.onerror=W.onload=null,N({data:W})},W.onerror=()=>{W.onerror=W.onload=null,k.signal.aborted||F(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."))},W.src=rt})}(G||(G={})),G.resetRequestQueue();class j{constructor(o){this._transformRequestFn=o}transformRequest(o,h){return this._transformRequestFn&&this._transformRequestFn(o,h)||{url:o}}normalizeSpriteURL(o,h,d){const m=function(y){const E=y.match(lt);if(!E)throw new Error(`Unable to parse URL "${y}"`);return{protocol:E[1],authority:E[2],path:E[3]||"/",params:E[4]?E[4].split("&"):[]}}(o);return m.path+=`${h}${d}`,function(y){const E=y.params.length?`?${y.params.join("&")}`:"";return`${y.protocol}://${y.authority}${y.path}${E}`}(m)}setTransformRequest(o){this._transformRequestFn=o}}const lt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function xt(_){var o=new u.A(3);return o[0]=_[0],o[1]=_[1],o[2]=_[2],o}var dt,ht=function(_,o,h){return _[0]=o[0]-h[0],_[1]=o[1]-h[1],_[2]=o[2]-h[2],_};dt=new u.A(3),u.A!=Float32Array&&(dt[0]=0,dt[1]=0,dt[2]=0);var ct=function(_){var o=_[0],h=_[1];return o*o+h*h};function Pt(_){const o=[];if(typeof _=="string")o.push({id:"default",url:_});else if(_&&_.length>0){const h=[];for(const{id:d,url:m}of _){const y=`${d}${m}`;h.indexOf(y)===-1&&(h.push(y),o.push({id:d,url:m}))}}return o}(function(){var _=new u.A(2);u.A!=Float32Array&&(_[0]=0,_[1]=0)})();class ${constructor(o,h,d,m){this.context=o,this.format=d,this.texture=o.gl.createTexture(),this.update(h,m)}update(o,h,d){const{width:m,height:y}=o,E=!(this.size&&this.size[0]===m&&this.size[1]===y||d),{context:C}=this,{gl:M}=C;if(this.useMipmap=!!(h&&h.useMipmap),M.bindTexture(M.TEXTURE_2D,this.texture),C.pixelStoreUnpackFlipY.set(!1),C.pixelStoreUnpack.set(1),C.pixelStoreUnpackPremultiplyAlpha.set(this.format===M.RGBA&&(!h||h.premultiply!==!1)),E)this.size=[m,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,m,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,m,y,M.RGBA,M.UNSIGNED_BYTE,o.data)}this.useMipmap&&this.isSizePowerOfTwo()&&M.generateMipmap(M.TEXTURE_2D)}bind(o,h,d){const{context:m}=this,{gl:y}=m;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 Lt(_){const{userImage:o}=_;return!!(o&&o.render&&o.render())&&(_.data.replace(new Uint8Array(o.data.buffer)),!0)}class ee 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 m=h.data||h.spriteData;return this._validateStretch(h.stretchX,m&&m.width)||(this.fire(new u.j(new Error(`Image "${o}" has invalid "stretchX" value`))),d=!1),this._validateStretch(h.stretchY,m&&m.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 m of o){if(m[0]{let m=!0;if(!this.isLoaded())for(const y of o)this.images[y]||(m=!1);this.isLoaded()||m?h(this._getImagesForIds(o)):this.requestors.push({ids:o,promiseResolve:h})})}_getImagesForIds(o){const h={};for(const d of o){let m=this.getImage(d);m||(this.fire(new u.k("styleimagemissing",{id:d})),m=this.getImage(d)),m?h[d]={data:m.data.clone(),pixelRatio:m.pixelRatio,sdf:m.sdf,version:m.version,stretchX:m.stretchX,stretchY:m.stretchY,content:m.content,hasRenderCallback:!!(m.userImage&&m.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 m={w:d.data.width+2,h:d.data.height+2,x:0,y:0},y=new u.I(m,d);this.patterns[o]={bin:m,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 $(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),m=this.atlasImage;m.resize({width:h||1,height:d||1});for(const y in this.patterns){const{bin:E}=this.patterns[y],C=E.x+1,M=E.y+1,k=this.getImage(y).data,N=k.width,F=k.height;u.R.copy(k,m,{x:0,y:0},{x:C,y:M},{width:N,height:F}),u.R.copy(k,m,{x:0,y:F-1},{x:C,y:M-1},{width:N,height:1}),u.R.copy(k,m,{x:0,y:0},{x:C,y:M+F},{width:N,height:1}),u.R.copy(k,m,{x:N-1,y:0},{x:C-1,y:M},{width:1,height:F}),u.R.copy(k,m,{x:0,y:0},{x:C+N,y:M},{width:1,height:F})}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`),Lt(d)&&this.updateImage(h,d)}}}const Tt=1e20;function re(_,o,h,d,m,y,E,C,M){for(let k=o;k-1);M++,y[M]=C,E[M]=k,E[M+1]=Tt}for(let C=0,M=0;C65535)throw new Error("glyphs > 65535 not supported");if(d.ranges[y])return{stack:o,id:h,glyph:m};if(!this.url)throw new Error("glyphsUrl is not set");if(!d.requests[y]){const C=qt.loadGlyphRange(o,y,this.url,this.requestManager);d.requests[y]=C}const E=yield d.requests[y];for(const C in E)this._doesCharSupportLocalGlyph(+C)||(d.glyphs[+C]=E[+C]);return d.ranges[y]=!0,{stack:o,id:h,glyph:E[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 m=this.localIdeographFontFamily;if(!m||!this._doesCharSupportLocalGlyph(d))return;let y=o.tinySDF;if(!y){let C="400";/bold/i.test(h)?C="900":/medium/i.test(h)?C="500":/light/i.test(h)&&(C="200"),y=o.tinySDF=new qt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:m,fontWeight:C})}const E=y.draw(String.fromCharCode(d));return{id:d,bitmap:new u.o({width:E.width||60,height:E.height||60},E.data),metrics:{width:E.glyphWidth/2||24,height:E.glyphHeight/2||24,left:E.glyphLeft/2+.5||0,top:E.glyphTop/2-27.5||-8,advance:E.glyphAdvance/2||24,isDoubleResolution:!0}}}}qt.loadGlyphRange=function(_,o,h,d){return u._(this,void 0,void 0,function*(){const m=256*o,y=m+255,E=d.transformRequest(h.replace("{fontstack}",_).replace("{range}",`${m}-${y}`),"Glyphs"),C=yield u.l(E,new AbortController);if(!C||!C.data)throw new Error(`Could not load glyph range. range: ${o}, ${m}-${y}`);const M={};for(const k of u.n(C.data))M[k.id]=k;return M})},qt.TinySDF=class{constructor({fontSize:_=24,buffer:o=3,radius:h=8,cutoff:d=.25,fontFamily:m="sans-serif",fontWeight:y="normal",fontStyle:E="normal"}={}){this.buffer=o,this.cutoff=d,this.radius=h;const C=this.size=_+4*o,M=this._createCanvas(C),k=this.ctx=M.getContext("2d",{willReadFrequently:!0});k.font=`${E} ${y} ${_}px ${m}`,k.textBaseline="alphabetic",k.textAlign="left",k.fillStyle="black",this.gridOuter=new Float64Array(C*C),this.gridInner=new Float64Array(C*C),this.f=new Float64Array(C),this.z=new Float64Array(C+1),this.v=new Uint16Array(C)}_createCanvas(_){const o=document.createElement("canvas");return o.width=o.height=_,o}draw(_){const{width:o,actualBoundingBoxAscent:h,actualBoundingBoxDescent:d,actualBoundingBoxLeft:m,actualBoundingBoxRight:y}=this.ctx.measureText(_),E=Math.ceil(h),C=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(y-m))),M=Math.min(this.size-this.buffer,E+Math.ceil(d)),k=C+2*this.buffer,N=M+2*this.buffer,F=Math.max(k*N,0),W=new Uint8ClampedArray(F),rt={data:W,width:k,height:N,glyphWidth:C,glyphHeight:M,glyphTop:E,glyphLeft:0,glyphAdvance:o};if(C===0||M===0)return rt;const{ctx:it,buffer:at,gridInner:tt,gridOuter:_t}=this;it.clearRect(at,at,C,M),it.fillText(_,at,at+E);const kt=it.getImageData(at,at,C,M);_t.fill(Tt,0,F),tt.fill(0,0,F);for(let ut=0;ut0?Bt*Bt:0,tt[zt]=Bt<0?Bt*Bt:0}}re(_t,0,0,k,N,k,this.f,this.v,this.z),re(tt,at,at,C,M,k,this.f,this.v,this.z);for(let ut=0;ut1&&(M=o[++C]);const N=Math.abs(k-M.left),F=Math.abs(k-M.right),W=Math.min(N,F);let rt;const it=y/d*(m+1);if(M.isDash){const at=m-Math.abs(it);rt=Math.sqrt(W*W+at*at)}else rt=m-Math.sqrt(W*W+it*it);this.data[E+k]=Math.max(0,Math.min(255,rt+128))}}}addRegularDash(o){for(let C=o.length-1;C>=0;--C){const M=o[C],k=o[C+1];M.zeroLength?o.splice(C,1):k&&k.isDash===M.isDash&&(k.left=M.left,o.splice(C,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 m=this.width*this.nextRow;let y=0,E=o[y];for(let C=0;C1&&(E=o[++y]);const M=Math.abs(C-E.left),k=Math.abs(C-E.right),N=Math.min(M,k);this.data[m+C]=Math.max(0,Math.min(255,(E.isDash?N:-N)+128))}}addDash(o,h){const d=h?7:0,m=2*d+1;if(this.nextRow+m>this.height)return u.w("LineAtlas out of space"),null;let y=0;for(let C=0;C{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ie]}numActive(){return Object.keys(this.active).length}}const In=Math.floor(L.hardwareConcurrency/2);let dn,mn;function Pn(){return dn||(dn=new sn),dn}sn.workerCount=u.B(globalThis)?Math.max(Math.min(In,3),1):1;class gi{constructor(o,h){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=h;const d=this.workerPool.acquire(h);for(let m=0;m{h.remove()}),this.actors=[],o&&this.workerPool.release(this.id)}registerMessageHandler(o,h){for(const d of this.actors)d.registerMessageHandler(o,h)}}function Ci(){return mn||(mn=new gi(Pn(),u.G),mn.registerMessageHandler("GR",(_,o,h)=>u.m(o,h))),mn}function _i(_,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 li(_,o,h,d,m,y){const E=function(F,W,rt){if(F)for(const it of F){const at=W[it];if(at&&at.source===rt&&at.type==="fill-extrusion")return!0}else for(const it in W){const at=W[it];if(at.source===rt&&at.type==="fill-extrusion")return!0}return!1}(m&&m.layers,o,_.id),C=y.maxPitchScaleFactor(),M=_.tilesIn(d,C,E);M.sort(Kt);const k=[];for(const F of M)k.push({wrappedTileID:F.tileID.wrapped().key,queryResults:F.tile.queryRenderedFeatures(o,h,_._state,F.queryGeometry,F.cameraQueryGeometry,F.scale,m,y,C,_i(_.transform,F.tileID))});const N=function(F){const W={},rt={};for(const it of F){const at=it.queryResults,tt=it.wrappedTileID,_t=rt[tt]=rt[tt]||{};for(const kt in at){const ut=at[kt],wt=_t[kt]=_t[kt]||{},Dt=W[kt]=W[kt]||[];for(const zt of ut)wt[zt.featureIndex]||(wt[zt.featureIndex]=!0,Dt.push(zt))}}return W}(k);for(const F in N)N[F].forEach(W=>{const rt=W.feature,it=_.getFeatureState(rt.layer["source-layer"],rt.id);rt.source=rt.layer.source,rt.layer["source-layer"]&&(rt.sourceLayer=rt.layer["source-layer"]),rt.state=it});return N}function Kt(_,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 mt(_,o,h){return u._(this,void 0,void 0,function*(){let d=_;if(_.url?d=(yield u.h(o.transformRequest(_.url,"Source"),h)).data:yield L.frameAsync(h),!d)return null;const m=u.L(u.e(d,_),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in d&&d.vector_layers&&(m.vectorLayerIds=d.vector_layers.map(y=>y.id)),m})}class St{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 m,y;if(o instanceof u.M)m=o,y=o;else{if(!(o instanceof St))return Array.isArray(o)?o.length===4||o.every(Array.isArray)?this.extend(St.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(m=o._sw,y=o._ne,!m||!y)return this}return h||d?(h.lng=Math.min(m.lng,h.lng),h.lat=Math.min(m.lat,h.lat),d.lng=Math.max(y.lng,d.lng),d.lat=Math.max(y.lat,d.lat)):(this._sw=new u.M(m.lng,m.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 m=this._sw.lng<=h&&h<=this._ne.lng;return this._sw.lng>this._ne.lng&&(m=this._sw.lng>=h&&h>=this._ne.lng),this._sw.lat<=d&&d<=this._ne.lat&&m}static convert(o){return o instanceof St?o:o&&new St(o)}static fromLngLat(o,h=0){const d=360*h/40075017,m=d/Math.cos(Math.PI/180*o.lat);return new St(new u.M(o.lng-m,o.lat-d),new u.M(o.lng+m,o.lat+d))}}class xe{constructor(o,h,d){this.bounds=St.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),m=Math.floor(u.O(this.bounds.getNorth())*h),y=Math.ceil(u.N(this.bounds.getEast())*h),E=Math.ceil(u.O(this.bounds.getSouth())*h);return o.x>=d&&o.x=m&&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,"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 m="RT";if(o.actor&&o.state!=="expired"){if(o.state==="loading")return new Promise((y,E)=>{o.reloadPromise={resolve:y,reject:E}})}else o.actor=this.dispatcher.getActor(),m="LT";o.abortController=new AbortController;try{const y=yield o.actor.sendAsync({type:m,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:"AT",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:"RMT",data:{uid:o.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Mt extends u.E{constructor(o,h,d,m){super(),this.id=o,this.dispatcher=d,this.setEventedParent(m),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 mt(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,o&&(u.e(this,o),o.bounds&&(this.tileBounds=new xe(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,"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 m=this.map.painter.context,y=m.gl,E=d.data;o.texture=this.map.painter.getTileTexture(E.width),o.texture?o.texture.update(E,{useMipmap:!0}):(o.texture=new $(m,E,y.RGBA,{useMipmap:!0}),o.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE,y.LINEAR_MIPMAP_NEAREST),m.extTextureFilterAnisotropic&&y.texParameterf(y.TEXTURE_2D,m.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,m.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 We extends Mt{constructor(o,h,d,m){super(o,h,d,m),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,"Tile");o.neighboringTiles=this._getNeighboringTiles(o.tileID),o.abortController=new AbortController;try{const m=yield G.getImage(d,o.abortController,this.map._refreshExpiredTiles);if(delete o.abortController,o.aborted)return void(o.state="unloaded");if(m&&m.data){const y=m.data;this.map._refreshExpiredTiles&&m.cacheControl&&m.expires&&o.setExpiryData({cacheControl:m.cacheControl,expires:m.expires});const E=u.b(y)&&u.S()?y:yield this.readImageNow(y),C={type:this.type,uid:o.uid,source:this.id,rawImageData:E,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:"LDT",data:C});o.dem=M,o.needsHillshadePrepare=!0,o.needsTerrainPrepare=!0,o.state="loaded"}}}catch(m){if(delete o.abortController,o.aborted)o.state="unloaded";else if(m)throw o.state="errored",m}})}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),m=(h.x-1+d)%d,y=h.x===0?o.wrap-1:o.wrap,E=(h.x+1+d)%d,C=h.x+1===d?o.wrap+1:o.wrap,M={};return M[new u.Q(o.overscaledZ,y,h.z,m,h.y).key]={backfilled:!1},M[new u.Q(o.overscaledZ,C,h.z,E,h.y).key]={backfilled:!1},h.y>0&&(M[new u.Q(o.overscaledZ,y,h.z,m,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,C,h.z,E,h.y-1).key]={backfilled:!1}),h.y+10&&u.e(y,{resourceTiming:m}),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?"RT":"LT";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 m=yield this.actor.sendAsync({type:h,data:d},o.abortController);delete o.abortController,o.unloadVectorData(),o.aborted||o.loadVectorData(m,this.map.painter,h==="RT")})}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:"RMT",data:{uid:o.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return u.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var on=u.X([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Wn extends u.E{constructor(o,h,d,m){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(m),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,"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._loaded=!0,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(m){let y=1/0,E=1/0,C=-1/0,M=-1/0;for(const W of m)y=Math.min(y,W.x),E=Math.min(E,W.y),C=Math.max(C,W.x),M=Math.max(M,W.y);const k=Math.max(C-y,M-E),N=Math.max(0,Math.floor(-Math.log(k)/Math.LN2)),F=Math.pow(2,N);return new u.a0(N,Math.floor((y+C)/2*F),Math.floor((E+M)/2*F))}(h),this.minzoom=this.maxzoom=this.tileID.z;const d=h.map(m=>this.tileID.getTilePoint(m)._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,on.members)),this.boundsSegments||(this.boundsSegments=u.$.simpleSegment(0,0,4,2)),this.texture||(this.texture=new $(o,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));let d=!1;for(const m in this.tiles){const y=this.tiles[m];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 wo extends Wn{constructor(o,h,d,m){super(o,h,d,m),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,"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,on.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 $(o,this.video,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));let d=!1;for(const m in this.tiles){const y=this.tiles[m];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 rs extends Wn{constructor(o,h,d,m){super(o,h,d,m),h.coordinates?Array.isArray(h.coordinates)&&h.coordinates.length===4&&!h.coordinates.some(y=>!Array.isArray(y)||y.length!==2||y.some(E=>typeof E!="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,on.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 $(h,this.canvas,d.RGBA,{premultiply:!0});let m=!1;for(const y in this.tiles){const E=this.tiles[y];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture,m=!0)}m&&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 Ts={},Ca=_=>{switch(_){case"geojson":return Ti;case"image":return Wn;case"raster":return Mt;case"raster-dem":return We;case"vector":return An;case"video":return wo;case"canvas":return rs}return Ts[_]},vr="RTLPluginLoaded";class il extends u.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Ci()}_syncState(o){return this.status=o,this.dispatcher.broadcast("SRPS",{pluginStatus:o,pluginURL:this.url}).catch(h=>{throw this.status="error",h})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(o){return u._(this,arguments,void 0,function*(h,d=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=L.resolveURL(h),!this.url)throw new Error(`requested url ${h} is invalid`);if(this.status==="unavailable"){if(!d)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return u._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new u.k(vr))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let os=null;function te(){return os||(os=new il),os}class Uo{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){C.layers=M,C.stateDependentLayerIds&&(C.stateDependentLayers=C.stateDependentLayerIds.map(k=>M.filter(N=>N.id===k)[0]));for(const k of M)E[k.id]=C}}return E}(o.buckets,h.style),this.hasSymbolBuckets=!1;for(const m in this.buckets){const y=this.buckets[m];if(y instanceof u.a5){if(this.hasSymbolBuckets=!0,!d)break;y.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const m in this.buckets){const y=this.buckets[m];if(y instanceof u.a5&&y.hasRTLText){this.hasRTLText=!0,te().lazyLoad();break}}this.queryPadding=0;for(const m in this.buckets){const y=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(m).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 m=this.buckets[d];m.uploadPending()&&m.upload(o)}const h=o.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new $(o,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new $(o,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(o){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(o,this.imageAtlasTexture)}queryRenderedFeatures(o,h,d,m,y,E,C,M,k,N){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:m,cameraQueryGeometry:y,scale:E,tileSize:this.tileSize,pixelPosMatrix:N,transform:M,params:C,queryPadding:this.queryPadding*k},o,h,d):{}}querySourceFeatures(o,h){const d=this.latestFeatureIndex;if(!d||!d.rawTileData)return;const m=d.loadVTLayers(),y=h&&h.sourceLayer?h.sourceLayer:"",E=m._geojsonTileLayer||m[y];if(!E)return;const C=u.a6(h&&h.filter),{z:M,x:k,y:N}=this.tileID.canonical,F={z:M,x:k,y:N};for(let W=0;Wd)m=!1;else if(h)if(this.expirationTime{this.remove(o,y)},d)),this.data[m].push(y),this.order.push(m),this.order.length>this.max){const E=this._getAndRemoveByKey(this.order[0]);E&&this.onRemove(E)}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,m=h===void 0?0:this.data[d].indexOf(h),y=this.data[d][m];return this.data[d].splice(m,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 m of this.data[d])o(m.value)||h.push(m);for(const d of h)this.remove(d.value.tileID,d)}}class rl{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(o,h,d){const m=String(h);if(this.stateChanges[o]=this.stateChanges[o]||{},this.stateChanges[o][m]=this.stateChanges[o][m]||{},u.e(this.stateChanges[o][m],d),this.deletedStates[o]===null){this.deletedStates[o]={};for(const y in this.state[o])y!==m&&(this.deletedStates[o][y]=null)}else if(this.deletedStates[o]&&this.deletedStates[o][m]===null){this.deletedStates[o][m]={};for(const y in this.state[o][m])d[y]||(this.deletedStates[o][m][y]=null)}else for(const y in d)this.deletedStates[o]&&this.deletedStates[o][m]&&this.deletedStates[o][m][y]===null&&delete this.deletedStates[o][m][y]}removeFeatureState(o,h,d){if(this.deletedStates[o]===null)return;const m=String(h);if(this.deletedStates[o]=this.deletedStates[o]||{},d&&h!==void 0)this.deletedStates[o][m]!==null&&(this.deletedStates[o][m]=this.deletedStates[o][m]||{},this.deletedStates[o][m][d]=null);else if(h!==void 0)if(this.stateChanges[o]&&this.stateChanges[o][m])for(d in this.deletedStates[o][m]={},this.stateChanges[o][m])this.deletedStates[o][m][d]=null;else this.deletedStates[o][m]=null;else this.deletedStates[o]=null}getState(o,h){const d=String(h),m=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 E in y)delete m[E]}return m}initializeTileState(o,h){o.setFeatureState(this.state,h)}coalesceChanges(o,h){const d={};for(const m in this.stateChanges){this.state[m]=this.state[m]||{};const y={};for(const E in this.stateChanges[m])this.state[m][E]||(this.state[m][E]={}),u.e(this.state[m][E],this.stateChanges[m][E]),y[E]=this.state[m][E];d[m]=y}for(const m in this.deletedStates){this.state[m]=this.state[m]||{};const y={};if(this.deletedStates[m]===null)for(const E in this.state[m])y[E]={},this.state[m][E]={};else for(const E in this.deletedStates[m]){if(this.deletedStates[m][E]===null)this.state[m][E]={};else for(const C of Object.keys(this.deletedStates[m][E]))delete this.state[m][E][C];y[E]=this.state[m][E]}d[m]=d[m]||{},u.e(d[m],y)}if(this.stateChanges={},this.deletedStates={},Object.keys(d).length!==0)for(const m in o)o[m].setFeatureState(d,h)}}class Gi extends u.E{constructor(o,h,d){super(),this.id=o,this.dispatcher=d,this.on("data",m=>this._dataHandler(m)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((m,y,E,C)=>{const M=new(Ca(y.type))(m,y,E,C);if(M.id!==m)throw new Error(`Expected Source id to be ${m} instead of ${M.id}`);return M})(o,h,d,this),this._tiles={},this._cache=new jr(0,m=>this._unloadTile(m)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new rl,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(m){o.state="errored",m.status!==404?this._source.fire(new u.j(m,{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(se).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,m)=>{const y=d.tileID,E=m.tileID,C=new u.P(y.canonical.x,y.canonical.y)._rotate(this.transform.angle),M=new u.P(E.canonical.x,E.canonical.y)._rotate(this.transform.angle);return y.overscaledZ-E.overscaledZ||M.y-C.y||M.x-C.x}).map(d=>d.tileID.key):h.map(d=>d.tileID).sort(se).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 m=0;m1||(Math.abs(E)>1&&(Math.abs(E+M)===1?E+=M:Math.abs(E-M)===1&&(E-=M)),y.dem&&m.dem&&(m.dem.backfillBorder(y.dem,E,C),m.neighboringTiles&&m.neighboringTiles[k]&&(m.neighboringTiles[k].backfilled=!0)))}}getTile(o){return this.getTileByID(o.key)}getTileByID(o){return this._tiles[o]}_retainLoadedChildren(o,h,d,m){for(const y in this._tiles){let E=this._tiles[y];if(m[y]||!E.hasData()||E.tileID.overscaledZ<=h||E.tileID.overscaledZ>d)continue;let C=E.tileID;for(;E&&E.tileID.overscaledZ>h+1;){const k=E.tileID.scaledTo(E.tileID.overscaledZ-1);E=this._tiles[k.key],E&&E.hasData()&&(C=k)}let M=C;for(;M.overscaledZ>h;)if(M=M.scaledTo(M.overscaledZ-1),o[M.key]){m[C.key]=C;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 m=o.scaledTo(d),y=this._getLoadedTile(m);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,m=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,m):m;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 m in this._tiles){const y=this._tiles[m];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+h),d[y.tileID.key]=y}this._tiles=d;for(const m in this._timers)clearTimeout(this._timers[m]),delete this._timers[m];for(const m in this._tiles)this._setTileReloadTimer(m,this._tiles[m])}}update(o,h){if(!this._sourceLoaded||this._paused)return;let d;this.transform=o,this.terrain=h,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 m=o.coveringZoomLevel(this._source),y=Math.max(m-Gi.maxOverzooming,this._source.minzoom),E=Math.max(m+Gi.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const N={};for(const F of d)if(F.canonical.z>this._source.minzoom){const W=F.scaledTo(F.canonical.z-1);N[W.key]=W;const rt=F.scaledTo(Math.max(this._source.minzoom,Math.min(F.canonical.z,5)));N[rt.key]=rt}d=d.concat(Object.values(N))}const C=d.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,C&&this.fire(new u.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const M=this._updateRetainedTiles(d,m);if(Ke(this._source.type)){const N={},F={},W=Object.keys(M),rt=L.now();for(const it of W){const at=M[it],tt=this._tiles[it];if(!tt||tt.fadeEndTime!==0&&tt.fadeEndTime<=rt)continue;const _t=this.findLoadedParent(at,y);_t&&(this._addTile(_t.tileID),N[_t.tileID.key]=_t.tileID),F[it]=at}this._retainLoadedChildren(F,m,E,M);for(const it in N)M[it]||(this._coveredTiles[it]=!0,M[it]=N[it]);if(h){const it={},at={};for(const tt of d)this._tiles[tt.key].hasData()?it[tt.key]=tt:at[tt.key]=tt;for(const tt in at){const _t=at[tt].children(this._source.maxzoom);this._tiles[_t[0].key]&&this._tiles[_t[1].key]&&this._tiles[_t[2].key]&&this._tiles[_t[3].key]&&(it[_t[0].key]=M[_t[0].key]=_t[0],it[_t[1].key]=M[_t[1].key]=_t[1],it[_t[2].key]=M[_t[2].key]=_t[2],it[_t[3].key]=M[_t[3].key]=_t[3],delete at[tt])}for(const tt in at){const _t=this.findLoadedParent(at[tt],this._source.minzoom);if(_t){it[_t.tileID.key]=M[_t.tileID.key]=_t.tileID;for(const kt in it)it[kt].isChildOf(_t.tileID)&&delete it[kt]}}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 F=this._tiles[N];F.hasSymbolBuckets&&!F.holdingForFade()?F.setHoldDuration(this.map._fadeDuration):F.hasSymbolBuckets&&!F.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={},m={},y=Math.max(h-Gi.maxOverzooming,this._source.minzoom),E=Math.max(h+Gi.maxUnderzooming,this._source.minzoom),C={};for(const M of o){const k=this._addTile(M);d[M.key]=M,k.hasData()||hthis._source.maxzoom){const F=M.children(this._source.maxzoom)[0],W=this.getTile(F);if(W&&W.hasData()){d[F.key]=F;continue}}else{const F=M.children(this._source.maxzoom);if(d[F[0].key]&&d[F[1].key]&&d[F[2].key]&&d[F[3].key])continue}let N=k.wasRequested();for(let F=M.overscaledZ-1;F>=y;--F){const W=M.scaledTo(F);if(m[W.key])break;if(m[W.key]=!0,k=this.getTile(W),!k&&N&&(k=this._addTile(W)),k){const rt=k.hasData();if((N||rt)&&(d[W.key]=W),N=k.wasRequested(),rt)break}}}return d}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const o in this._tiles){const h=[];let d,m=this._tiles[o].tileID;for(;m.overscaledZ>0;){if(m.key in this._loadedParentTiles){d=this._loadedParentTiles[m.key];break}h.push(m.key);const y=m.scaledTo(m.overscaledZ-1);if(d=this._getLoadedTile(y),d)break;m=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 Uo(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))))}_dataHandler(o){const h=o.sourceDataType;o.dataType==="source"&&h==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&o.dataType==="source"&&h==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const o in this._tiles)this._removeTile(o);this._cache.reset()}tilesIn(o,h,d){const m=[],y=this.transform;if(!y)return m;const E=d?y.getCameraQueryGeometry(o):o,C=o.map(it=>y.pointCoordinate(it,this.terrain)),M=E.map(it=>y.pointCoordinate(it,this.terrain)),k=this.getIds();let N=1/0,F=1/0,W=-1/0,rt=-1/0;for(const it of M)N=Math.min(N,it.x),F=Math.min(F,it.y),W=Math.max(W,it.x),rt=Math.max(rt,it.y);for(let it=0;it=0&&ut[1].y+kt>=0){const wt=C.map(zt=>tt.getTilePoint(zt)),Dt=M.map(zt=>tt.getTilePoint(zt));m.push({tile:at,tileID:tt,queryGeometry:wt,cameraQueryGeometry:Dt,scale:_t})}}return m}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(Ke(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 m=this._tiles[o];m&&m.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 se(_,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 Ke(_){return _==="raster"||_==="image"||_==="video"}Gi.maxOverzooming=10,Gi.maxUnderzooming=3;class Xe{constructor(o,h){this.reset(o,h)}reset(o,h){this.points=o||[],this._distances=[0];for(let d=1;d0?(m-E)/C:0;return this.points[y].mult(1-M).add(this.points[h].mult(M))}}function Li(_,o){let h=!0;return _==="always"||_!=="never"&&o!=="never"||(h=!1),h}class Go{constructor(o,h,d){const m=this.boxCells=[],y=this.circleCells=[];this.xCellCount=Math.ceil(o/d),this.yCellCount=Math.ceil(h/d);for(let E=0;Ethis.width||m<0||h>this.height)return[];const M=[];if(o<=0&&h<=0&&this.width<=d&&this.height<=m){if(y)return[{key:null,x1:o,y1:h,x2:d,y2:m}];for(let k=0;k0}hitTestCircle(o,h,d,m,y){const E=o-d,C=o+d,M=h-d,k=h+d;if(C<0||E>this.width||k<0||M>this.height)return!1;const N=[];return this._forEachCell(E,M,C,k,this._queryCellCircle,N,{hitTest:!0,overlapMode:m,circle:{x:o,y:h,radius:d},seenUids:{box:{},circle:{}}},y),N.length>0}_queryCell(o,h,d,m,y,E,C,M){const{seenUids:k,hitTest:N,overlapMode:F}=C,W=this.boxCells[y];if(W!==null){const it=this.bboxes;for(const at of W)if(!k.box[at]){k.box[at]=!0;const tt=4*at,_t=this.boxKeys[at];if(o<=it[tt+2]&&h<=it[tt+3]&&d>=it[tt+0]&&m>=it[tt+1]&&(!M||M(_t))&&(!N||!Li(F,_t.overlapMode))&&(E.push({key:_t,x1:it[tt],y1:it[tt+1],x2:it[tt+2],y2:it[tt+3]}),N))return!0}}const rt=this.circleCells[y];if(rt!==null){const it=this.circles;for(const at of rt)if(!k.circle[at]){k.circle[at]=!0;const tt=3*at,_t=this.circleKeys[at];if(this._circleAndRectCollide(it[tt],it[tt+1],it[tt+2],o,h,d,m)&&(!M||M(_t))&&(!N||!Li(F,_t.overlapMode))){const kt=it[tt],ut=it[tt+1],wt=it[tt+2];if(E.push({key:_t,x1:kt-wt,y1:ut-wt,x2:kt+wt,y2:ut+wt}),N)return!0}}}return!1}_queryCellCircle(o,h,d,m,y,E,C,M){const{circle:k,seenUids:N,overlapMode:F}=C,W=this.boxCells[y];if(W!==null){const it=this.bboxes;for(const at of W)if(!N.box[at]){N.box[at]=!0;const tt=4*at,_t=this.boxKeys[at];if(this._circleAndRectCollide(k.x,k.y,k.radius,it[tt+0],it[tt+1],it[tt+2],it[tt+3])&&(!M||M(_t))&&!Li(F,_t.overlapMode))return E.push(!0),!0}}const rt=this.circleCells[y];if(rt!==null){const it=this.circles;for(const at of rt)if(!N.circle[at]){N.circle[at]=!0;const tt=3*at,_t=this.circleKeys[at];if(this._circlesCollide(it[tt],it[tt+1],it[tt+2],k.x,k.y,k.radius)&&(!M||M(_t))&&!Li(F,_t.overlapMode))return E.push(!0),!0}}}_forEachCell(o,h,d,m,y,E,C,M){const k=this._convertToXCellCoord(o),N=this._convertToYCellCoord(h),F=this._convertToXCellCoord(d),W=this._convertToYCellCoord(m);for(let rt=k;rt<=F;rt++)for(let it=N;it<=W;it++)if(y.call(this,o,h,d,m,this.xCellCount*it+rt,E,C,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,m,y,E){const C=m-o,M=y-h,k=d+E;return k*k>C*C+M*M}_circleAndRectCollide(o,h,d,m,y,E,C){const M=(E-m)/2,k=Math.abs(o-(m+M));if(k>M+d)return!1;const N=(C-y)/2,F=Math.abs(h-(y+N));if(F>N+d)return!1;if(k<=M||F<=N)return!0;const W=k-M,rt=F-N;return W*W+rt*rt<=d*d}}function He(_,o,h,d,m){const y=u.F();return o?(u.J(y,y,[1/m,1/m,1]),h||u.ad(y,y,d.angle)):u.K(y,d.labelPlaneMatrix,_),y}function oa(_,o,h,d,m){if(o){const y=u.ae(_);return u.J(y,y,[m,m,1]),h||u.ad(y,y,-d.angle),y}return d.glCoordMatrix}function Di(_,o,h){let d;h?(d=[_.x,_.y,h(_.x,_.y),1],u.af(d,d,o)):(d=[_.x,_.y,0,1],we(d,d,o));const m=d[3];return{point:new u.P(d[0]/m,d[1]/m),signedDistanceFromCamera:m}}function st(_,o){return .5+_/o*.5}function B(_,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,m,y,E,C,M,k){const N=d?_.textSizeData:_.iconSizeData,F=u.ag(N,h.transform.zoom),W=[256/h.width*2+1,256/h.height*2+1],rt=d?_.text.dynamicLayoutVertexArray:_.icon.dynamicLayoutVertexArray;rt.clear();const it=_.lineVertexArray,at=d?_.text.placedSymbolArray:_.icon.placedSymbolArray,tt=h.transform.width/h.transform.height;let _t=!1;for(let kt=0;ktMath.abs(h.x-o.x)*d?{useVertical:!0}:(_===u.ah.vertical?o.yh.x)?{needsFlipping:!0}:null}function yt(_,o,h,d,m,y,E,C,M,k,N,F,W,rt,it,at){const tt=o/24,_t=_.lineOffsetX*tt,kt=_.lineOffsetY*tt;let ut;if(_.numGlyphs>1){const wt=_.glyphStartIndex+_.numGlyphs,Dt=_.lineStartIndex,zt=_.lineStartIndex+_.lineLength,Bt=X(tt,C,_t,kt,h,N,F,_,M,y,W,it,at);if(!Bt)return{notEnoughRoom:!0};const Qt=Di(Bt.first.point,E,at).point,Jt=Di(Bt.last.point,E,at).point;if(d&&!h){const ie=nt(_.writingMode,Qt,Jt,rt);if(ie)return ie}ut=[Bt.first];for(let ie=_.glyphStartIndex+1;ie0?Qt.point:Y(F,Bt,Dt,1,m,at),ie=nt(_.writingMode,Dt,Jt,rt);if(ie)return ie}const wt=Nt(tt*C.getoffsetX(_.glyphStartIndex),_t,kt,h,N,F,_.segment,_.lineStartIndex,_.lineStartIndex+_.lineLength,M,y,W,it,at);if(!wt)return{notEnoughRoom:!0};ut=[wt]}for(const wt of ut)u.aj(k,wt.point,wt.angle);return{}}function Y(_,o,h,d,m,y){const E=Di(_.add(_.sub(o)._unit()),m,y).point,C=h.sub(E);return h.add(C._mult(d/C.mag()))}function vt(_,o){const{projectionCache:h,lineVertexArray:d,labelPlaneMatrix:m,tileAnchorPoint:y,distanceFromAnchor:E,getElevation:C,previousVertex:M,direction:k,absOffsetX:N}=o;if(h.projections[_])return h.projections[_];const F=new u.P(d.getx(_),d.gety(_)),W=Di(F,m,C);if(W.signedDistanceFromCamera>0)return h.projections[_]=W.point,W.point;const rt=_-k;return Y(E===0?y:new u.P(d.getx(rt),d.gety(rt)),F,M,N-E+1,m,C)}function pt(_,o,h){return _._unit()._perp()._mult(o*h)}function It(_,o,h,d,m,y,E,C){const{projectionCache:M,direction:k}=C;if(M.offsets[_])return M.offsets[_];const N=h.add(o);if(_+k=m)return M.offsets[_]=N,N;const F=vt(_+k,C),W=pt(F.sub(h),E,k),rt=h.add(W),it=F.add(W);return M.offsets[_]=u.ak(y,N,rt,it)||N,M.offsets[_]}function Nt(_,o,h,d,m,y,E,C,M,k,N,F,W,rt){const it=d?_-o:_+o;let at=it>0?1:-1,tt=0;d&&(at*=-1,tt=Math.PI),at<0&&(tt+=Math.PI);let _t,kt,ut=at>0?C+E:C+E+1,wt=m,Dt=m,zt=0,Bt=0;const Qt=Math.abs(it),Jt=[];let ie;for(;zt+Bt<=Qt;){if(ut+=at,ut=M)return null;zt+=Bt,Dt=wt,kt=_t;const le={projectionCache:F,lineVertexArray:k,labelPlaneMatrix:N,tileAnchorPoint:y,distanceFromAnchor:zt,getElevation:rt,previousVertex:Dt,direction:at,absOffsetX:Qt};if(wt=vt(ut,le),h===0)Jt.push(Dt),ie=wt.sub(Dt);else{let ze;const Qe=wt.sub(Dt);ze=Qe.mag()===0?pt(vt(ut+at,le).sub(wt),h,at):pt(Qe,h,at),kt||(kt=Dt.add(ze)),_t=It(ut,ze,wt,C,M,kt,h,le),Jt.push(kt),ie=_t.sub(kt)}Bt=ie.mag()}const ae=ie._mult((Qt-zt)/Bt)._add(kt||Dt),Je=tt+Math.atan2(wt.y-Dt.y,wt.x-Dt.x);return Jt.push(ae),{point:ae,angle:W?Je:0,path:Jt}}const Ft=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ht(_,o){for(let h=0;h<_;h++){const d=o.length;o.resize(d+4),o.float32.set(Ft,3*d)}}function we(_,o,h){const d=o[0],m=o[1];return _[0]=h[0]*d+h[4]*m+h[12],_[1]=h[1]*d+h[5]*m+h[13],_[3]=h[3]*d+h[7]*m+h[15],_}const Te=100;class Ge{constructor(o,h=new Go(o.width+200,o.height+200,25),d=new Go(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+Te,this.screenBottomBoundary=o.height+Te,this.gridRightBoundary=o.width+200,this.gridBottomBoundary=o.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(o,h,d,m,y,E){const C=this.projectAndGetPerspectiveRatio(m,o.anchorPointX,o.anchorPointY,E),M=d*C.perspectiveRatio,k=o.x1*M+C.point.x,N=o.y1*M+C.point.y,F=o.x2*M+C.point.x,W=o.y2*M+C.point.y;return!this.isInsideGrid(k,N,F,W)||h!=="always"&&this.grid.hitTest(k,N,F,W,h,y)||C.perspectiveRatio=1;rn--)Qe.push(le.path[rn]);for(let rn=1;rnDi(an,M,it));Qe=rn.some(an=>an.signedDistanceFromCamera<=0)?[]:rn.map(an=>an.point)}let Ue=[];if(Qe.length>0){const rn=Qe[0].clone(),an=Qe[0].clone();for(let bi=1;bi=ie.x&&an.x<=ae.x&&rn.y>=ie.y&&an.y<=ae.y?[Qe]:an.xae.x||an.yae.y?[]:u.al([Qe],ie.x,ie.y,ae.x,ae.y)}for(const rn of Ue){Je.reset(rn,.25*Jt);let an=0;an=Je.length<=.5*Jt?1:Math.ceil(Je.paddedLength/xn)+1;for(let bi=0;bi=this.screenRightBoundary||mthis.screenBottomBoundary}isInsideGrid(o,h,d,m){return d>=0&&o=0&&hd.collisionGroupID===h}}return this.collisionGroups[o]}}function Ki(_,o,h,d,m){const{horizontalAlign:y,verticalAlign:E}=u.at(_);return new u.P(-(y-.5)*o+d[0]*m,-(E-.5)*h+d[1]*m)}function Zr(_,o,h,d,m,y){const{x1:E,x2:C,y1:M,y2:k,anchorPointX:N,anchorPointY:F}=_,W=new u.P(o,h);return d&&W._rotate(m?y:-y),{x1:E+W.x,y1:M+W.y,x2:C+W.x,y2:k+W.y,anchorPointX:N,anchorPointY:F}}class io{constructor(o,h,d,m,y){this.transform=o.clone(),this.terrain=h,this.collisionIndex=new Ge(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=d,this.retainedQueryData={},this.collisionGroups=new yi(m),this.collisionCircleArrays={},this.prevPlacement=y,y&&(y.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(o,h,d,m){const y=d.getBucket(h),E=d.latestFeatureIndex;if(!y||!E||h.id!==y.layerIds[0])return;const C=d.collisionBoxArray,M=y.layers[0].layout,k=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),N=d.tileSize/u.W,F=this.transform.calculatePosMatrix(d.tileID.toUnwrapped()),W=M.get("text-pitch-alignment")==="map",rt=M.get("text-rotation-alignment")==="map",it=je(d,1,this.transform.zoom),at=He(F,W,rt,this.transform,it);let tt=null;if(W){const kt=oa(F,W,rt,this.transform,it);tt=u.K([],this.transform.labelPlaneMatrix,kt)}this.retainedQueryData[y.bucketInstanceId]=new nn(y.bucketInstanceId,E,y.sourceLayerIndex,y.index,d.tileID);const _t={bucket:y,layout:M,posMatrix:F,textLabelPlaneMatrix:at,labelToScreenMatrix:tt,scale:k,textPixelRatio:N,holdingForFade:d.holdingForFade(),collisionBoxArray:C,partiallyEvaluatedTextSize:u.ag(y.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(y.sourceID)};if(m)for(const kt of y.sortKeyRanges){const{sortKey:ut,symbolInstanceStart:wt,symbolInstanceEnd:Dt}=kt;o.push({sortKey:ut,symbolInstanceStart:wt,symbolInstanceEnd:Dt,parameters:_t})}else o.push({symbolInstanceStart:0,symbolInstanceEnd:y.symbolInstances.length,parameters:_t})}attemptAnchorPlacement(o,h,d,m,y,E,C,M,k,N,F,W,rt,it,at,tt){const _t=u.ap[o.textAnchor],kt=[o.textOffset0,o.textOffset1],ut=Ki(_t,d,m,kt,y),wt=this.collisionIndex.placeCollisionBox(Zr(h,ut.x,ut.y,E,C,this.transform.angle),F,M,k,N.predicate,tt);if((!at||this.collisionIndex.placeCollisionBox(Zr(at,ut.x,ut.y,E,C,this.transform.angle),F,M,k,N.predicate,tt).box.length!==0)&&wt.box.length>0){let Dt;if(this.prevPlacement&&this.prevPlacement.variableOffsets[W.crossTileID]&&this.prevPlacement.placements[W.crossTileID]&&this.prevPlacement.placements[W.crossTileID].text&&(Dt=this.prevPlacement.variableOffsets[W.crossTileID].anchor),W.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[W.crossTileID]={textOffset:kt,width:d,height:m,anchor:_t,textBoxScale:y,prevAnchor:Dt},this.markUsedJustification(rt,_t,W,it),rt.allowVerticalPlacement&&(this.markUsedOrientation(rt,it,W),this.placedOrientations[W.crossTileID]=it),{shift:ut,placedGlyphBoxes:wt}}}placeLayerBucketPart(o,h,d){const{bucket:m,layout:y,posMatrix:E,textLabelPlaneMatrix:C,labelToScreenMatrix:M,textPixelRatio:k,holdingForFade:N,collisionBoxArray:F,partiallyEvaluatedTextSize:W,collisionGroup:rt}=o.parameters,it=y.get("text-optional"),at=y.get("icon-optional"),tt=u.aq(y,"text-overlap","text-allow-overlap"),_t=tt==="always",kt=u.aq(y,"icon-overlap","icon-allow-overlap"),ut=kt==="always",wt=y.get("text-rotation-alignment")==="map",Dt=y.get("text-pitch-alignment")==="map",zt=y.get("icon-text-fit")!=="none",Bt=y.get("symbol-z-order")==="viewport-y",Qt=_t&&(ut||!m.hasIconData()||at),Jt=ut&&(_t||!m.hasTextData()||it);!m.collisionArrays&&F&&m.deserializeCollisionBoxes(F);const ie=this.retainedQueryData[m.bucketInstanceId].tileID,ae=this.terrain?(le,ze)=>this.terrain.getElevation(ie,le,ze):null,Je=(le,ze)=>{var Qe,xn;if(h[le.crossTileID])return;if(N)return void(this.placements[le.crossTileID]=new $n(!1,!1,!1));let Ue=!1,rn=!1,an=!0,bi=null,Fn={box:null,offscreen:null},Co={box:null,offscreen:null},Ji=null,ci=null,Qi=null,To=0,Ds=0,Da=0;ze.textFeatureIndex?To=ze.textFeatureIndex:le.useRuntimeCollisionCircles&&(To=le.featureIndex),ze.verticalTextFeatureIndex&&(Ds=ze.verticalTextFeatureIndex);const Hu=ze.textBox;if(Hu){const Zi=Wi=>{let fi=u.ah.horizontal;if(m.allowVerticalPlacement&&!Wi&&this.prevPlacement){const Wo=this.prevPlacement.placedOrientations[le.crossTileID];Wo&&(this.placedOrientations[le.crossTileID]=Wo,fi=Wo,this.markUsedOrientation(m,fi,le))}return fi},hi=(Wi,fi)=>{if(m.allowVerticalPlacement&&le.numVerticalGlyphVertices>0&&ze.verticalTextBox){for(const Wo of m.writingModes)if(Wo===u.ah.vertical?(Fn=fi(),Co=Fn):Fn=Wi(),Fn&&Fn.box&&Fn.box.length)break}else Fn=Wi()},ei=le.textAnchorOffsetStartIndex,Zo=le.textAnchorOffsetEndIndex;if(Zo===ei){const Wi=(fi,Wo)=>{const Hi=this.collisionIndex.placeCollisionBox(fi,tt,k,E,rt.predicate,ae);return Hi&&Hi.box&&Hi.box.length&&(this.markUsedOrientation(m,Wo,le),this.placedOrientations[le.crossTileID]=Wo),Hi};hi(()=>Wi(Hu,u.ah.horizontal),()=>{const fi=ze.verticalTextBox;return m.allowVerticalPlacement&&le.numVerticalGlyphVertices>0&&fi?Wi(fi,u.ah.vertical):{box:null,offscreen:null}}),Zi(Fn&&Fn.box&&Fn.box.length)}else{let Wi=u.ap[(xn=(Qe=this.prevPlacement)===null||Qe===void 0?void 0:Qe.variableOffsets[le.crossTileID])===null||xn===void 0?void 0:xn.anchor];const fi=(Hi,Mi,Of)=>{const Rd=Hi.x2-Hi.x1,pl=Hi.y2-Hi.y1,dl=le.textBoxScale,sh=zt&&kt==="never"?Mi:null;let Na={box:[],offscreen:!1},Ff=tt==="never"?1:2,Nd="never";Wi&&Ff++;for(let Bf=0;Bffi(Hu,ze.iconBox,u.ah.horizontal),()=>{const Hi=ze.verticalTextBox;return m.allowVerticalPlacement&&!(Fn&&Fn.box&&Fn.box.length)&&le.numVerticalGlyphVertices>0&&Hi?fi(Hi,ze.verticalIconBox,u.ah.vertical):{box:null,offscreen:null}}),Fn&&(Ue=Fn.box,an=Fn.offscreen);const Wo=Zi(Fn&&Fn.box);if(!Ue&&this.prevPlacement){const Hi=this.prevPlacement.variableOffsets[le.crossTileID];Hi&&(this.variableOffsets[le.crossTileID]=Hi,this.markUsedJustification(m,Hi.anchor,le,Wo))}}}if(Ji=Fn,Ue=Ji&&Ji.box&&Ji.box.length>0,an=Ji&&Ji.offscreen,le.useRuntimeCollisionCircles){const Zi=m.text.placedSymbolArray.get(le.centerJustifiedTextSymbolIndex),hi=u.ai(m.textSizeData,W,Zi),ei=y.get("text-padding");ci=this.collisionIndex.placeCollisionCircles(tt,Zi,m.lineVertexArray,m.glyphOffsetArray,hi,E,C,M,d,Dt,rt.predicate,le.collisionCircleDiameter,ei,ae),ci.circles.length&&ci.collisionDetected&&!d&&u.w("Collisions detected, but collision boxes are not shown"),Ue=_t||ci.circles.length>0&&!ci.collisionDetected,an=an&&ci.offscreen}if(ze.iconFeatureIndex&&(Da=ze.iconFeatureIndex),ze.iconBox){const Zi=hi=>{const ei=zt&&bi?Zr(hi,bi.x,bi.y,wt,Dt,this.transform.angle):hi;return this.collisionIndex.placeCollisionBox(ei,kt,k,E,rt.predicate,ae)};Co&&Co.box&&Co.box.length&&ze.verticalIconBox?(Qi=Zi(ze.verticalIconBox),rn=Qi.box.length>0):(Qi=Zi(ze.iconBox),rn=Qi.box.length>0),an=an&&Qi.offscreen}const Ra=it||le.numHorizontalGlyphVertices===0&&le.numVerticalGlyphVertices===0,Rs=at||le.numIconVertices===0;if(Ra||Rs?Rs?Ra||(rn=rn&&Ue):Ue=rn&&Ue:rn=Ue=rn&&Ue,Ue&&Ji&&Ji.box&&this.collisionIndex.insertCollisionBox(Ji.box,tt,y.get("text-ignore-placement"),m.bucketInstanceId,Co&&Co.box&&Ds?Ds:To,rt.ID),rn&&Qi&&this.collisionIndex.insertCollisionBox(Qi.box,kt,y.get("icon-ignore-placement"),m.bucketInstanceId,Da,rt.ID),ci&&(Ue&&this.collisionIndex.insertCollisionCircles(ci.circles,tt,y.get("text-ignore-placement"),m.bucketInstanceId,To,rt.ID),d)){const Zi=m.bucketInstanceId;let hi=this.collisionCircleArrays[Zi];hi===void 0&&(hi=this.collisionCircleArrays[Zi]=new qi);for(let ei=0;ei=0;--ze){const Qe=le[ze];Je(m.symbolInstances.get(Qe),m.collisionArrays[Qe])}}else for(let le=o.symbolInstanceStart;le=0&&(o.text.placedSymbolArray.get(C).crossTileID=y>=0&&C!==y?0:d.crossTileID)}markUsedOrientation(o,h,d){const m=h===u.ah.horizontal||h===u.ah.horizontalOnly?h:0,y=h===u.ah.vertical?h:0,E=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex];for(const C of E)o.text.placedSymbolArray.get(C).placedOrientation=m;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 m=h?h.symbolFadeChange(o):1,y=h?h.opacities:{},E=h?h.variableOffsets:{},C=h?h.placedOrientations:{};for(const M in this.placements){const k=this.placements[M],N=y[M];N?(this.opacities[M]=new Vn(N,m,k.text,k.icon),d=d||k.text!==N.text.placed||k.icon!==N.icon.placed):(this.opacities[M]=new Vn(null,m,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 Vn(k,m,!1,!1);N.isHidden()||(this.opacities[M]=N,d=d||k.text.placed||k.icon.placed)}}for(const M in E)this.variableOffsets[M]||!this.opacities[M]||this.opacities[M].isHidden()||(this.variableOffsets[M]=E[M]);for(const M in C)this.placedOrientations[M]||!this.opacities[M]||this.opacities[M].isHidden()||(this.placedOrientations[M]=C[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 m of h){const y=m.getBucket(o);y&&m.latestFeatureIndex&&o.id===y.layerIds[0]&&this.updateBucketOpacities(y,d,m.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 m=o.layers[0],y=m.layout,E=new Vn(null,0,!1,!1,!0),C=y.get("text-allow-overlap"),M=y.get("icon-allow-overlap"),k=m._unevaluatedLayout.hasValue("text-variable-anchor")||m._unevaluatedLayout.hasValue("text-variable-anchor-offset"),N=y.get("text-rotation-alignment")==="map",F=y.get("text-pitch-alignment")==="map",W=y.get("icon-text-fit")!=="none",rt=new Vn(null,0,C&&(M||!o.hasIconData()||y.get("icon-optional")),M&&(C||!o.hasTextData()||y.get("text-optional")),!0);!o.collisionArrays&&d&&(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData())&&o.deserializeCollisionBoxes(d);const it=(at,tt,_t)=>{for(let kt=0;kt0,zt=this.placedOrientations[tt.crossTileID],Bt=zt===u.ah.vertical,Qt=zt===u.ah.horizontal||zt===u.ah.horizontalOnly;if(_t>0||kt>0){const Jt=ro(wt.text);it(o.text,_t,Bt?Eu:Jt),it(o.text,kt,Qt?Eu:Jt);const ie=wt.text.isHidden();[tt.rightJustifiedTextSymbolIndex,tt.centerJustifiedTextSymbolIndex,tt.leftJustifiedTextSymbolIndex].forEach(le=>{le>=0&&(o.text.placedSymbolArray.get(le).hidden=ie||Bt?1:0)}),tt.verticalPlacedTextSymbolIndex>=0&&(o.text.placedSymbolArray.get(tt.verticalPlacedTextSymbolIndex).hidden=ie||Qt?1:0);const ae=this.variableOffsets[tt.crossTileID];ae&&this.markUsedJustification(o,ae.anchor,tt,zt);const Je=this.placedOrientations[tt.crossTileID];Je&&(this.markUsedJustification(o,"left",tt,Je),this.markUsedOrientation(o,Je,tt))}if(Dt){const Jt=ro(wt.icon),ie=!(W&&tt.verticalPlacedIconSymbolIndex&&Bt);tt.placedIconSymbolIndex>=0&&(it(o.icon,tt.numIconVertices,ie?Jt:Eu),o.icon.placedSymbolArray.get(tt.placedIconSymbolIndex).hidden=wt.icon.isHidden()),tt.verticalPlacedIconSymbolIndex>=0&&(it(o.icon,tt.numVerticalIconVertices,ie?Eu:Jt),o.icon.placedSymbolArray.get(tt.verticalPlacedIconSymbolIndex).hidden=wt.icon.isHidden())}if(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData()){const Jt=o.collisionArrays[at];if(Jt){let ie=new u.P(0,0);if(Jt.textBox||Jt.verticalTextBox){let Je=!0;if(k){const le=this.variableOffsets[ut];le?(ie=Ki(le.anchor,le.width,le.height,le.textOffset,le.textBoxScale),N&&ie._rotate(F?this.transform.angle:-this.transform.angle)):Je=!1}Jt.textBox&&ur(o.textCollisionBox.collisionVertexArray,wt.text.placed,!Je||Bt,ie.x,ie.y),Jt.verticalTextBox&&ur(o.textCollisionBox.collisionVertexArray,wt.text.placed,!Je||Qt,ie.x,ie.y)}const ae=!!(!Qt&&Jt.verticalIconBox);Jt.iconBox&&ur(o.iconCollisionBox.collisionVertexArray,wt.icon.placed,ae,W?ie.x:0,W?ie.y:0),Jt.verticalIconBox&&ur(o.iconCollisionBox.collisionVertexArray,wt.icon.placed,!ae,W?ie.x:0,W?ie.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 at=this.collisionCircleArrays[o.bucketInstanceId];o.placementInvProjMatrix=at.invProjMatrix,o.placementViewportMatrix=at.viewportMatrix,o.collisionCircleArray=at.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 ur(_,o,h,d,m){_.emplaceBack(o?1:0,h?1:0,d||0,m||0),_.emplaceBack(o?1:0,h?1:0,d||0,m||0),_.emplaceBack(o?1:0,h?1:0,d||0,m||0),_.emplaceBack(o?1:0,h?1:0,d||0,m||0)}const Ls=Math.pow(2,25),Jp=Math.pow(2,24),$m=Math.pow(2,17),zn=Math.pow(2,16),of=Math.pow(2,9),sf=Math.pow(2,8),So=Math.pow(2,1);function ro(_){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*Jp+h*$m+o*zn+h*of+o*sf+h*So+o}const Eu=0;class qo{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,m,y){const E=this._bucketParts;for(;this._currentTileIndexC.sortKey-M.sortKey));this._currentPartIndex!this._forceFullPlacement&&L.now()-m>2;for(;this._currentPlacementIndex>=0;){const E=h[o[this._currentPlacementIndex]],C=this.placement.collisionIndex.transform.zoom;if(E.type==="symbol"&&(!E.minzoom||E.minzoom<=C)&&(!E.maxzoom||E.maxzoom>C)){if(this._inProgressLayer||(this._inProgressLayer=new qo(E)),this._inProgressLayer.continuePlacement(d[E.source],this.placement,this._showCollisionBoxes,E,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 bc{constructor(o,h,d){this.tileID=o,this.bucketInstanceId=d,this._symbolsByKey={};const m=new Map;for(let y=0;y({x:Math.floor(M.anchorX*zl),y:Math.floor(M.anchorY*zl)})),crossTileIDs:E.map(M=>M.crossTileID)};if(C.positions.length>128){const M=new u.au(C.positions.length,16,Uint16Array);for(const{x:k,y:N}of C.positions)M.add(k,N);M.finish(),delete C.positions,C.index=M}this._symbolsByKey[y]=C}}getScaledCoordinates(o,h){const{x:d,y:m,z:y}=this.tileID.canonical,{x:E,y:C,z:M}=h.canonical,k=zl/Math.pow(2,M-y),N=(C*u.W+o.anchorY)*k,F=m*u.W*zl;return{x:Math.floor((E*u.W+o.anchorX)*k-d*u.W*zl),y:Math.floor(N-F)}}findMatches(o,h,d){const m=this.tileID.canonical.zo)}}class ji{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Cu{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 m=this.indexes[d],y={};for(const E in m){const C=m[E];C.tileID=C.tileID.unwrapTo(C.tileID.wrap+h),y[C.tileID.key]=C}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 C in E){const M=E[C];M.tileID.isChildOf(o)&&M.findMatches(h.symbolInstances,o,m)}else{const C=E[o.scaledTo(Number(y)).key];C&&C.findMatches(h.symbolInstances,o,m)}}for(let y=0;y{h[d]=!0});for(const d in this.layerIndexes)h[d]||delete this.layerIndexes[d]}}const ui=(_,o)=>u.t(_,o&&o.filter(h=>h.identifier!=="source.canvas")),wc=u.av();class Io extends u.E{constructor(o,h={}){super(),this._rtlPluginLoaded=()=>{for(const d in this.sourceCaches){const m=this.sourceCaches[d].getSource().type;m!=="vector"&&m!=="geojson"||this.sourceCaches[d].reload()}},this.map=o,this.dispatcher=new gi(Pn(),o._getMapId()),this.dispatcher.registerMessageHandler("GG",(d,m)=>this.getGlyphs(d,m)),this.dispatcher.registerMessageHandler("GI",(d,m)=>this.getImages(d,m)),this.imageManager=new ee,this.imageManager.setEventedParent(this),this.glyphManager=new qt(o._requestManager,h.localIdeographFontFamily),this.lineAtlas=new Ve(256,512),this.crossTileSymbolIndex=new Ta,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new u.aw,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",u.ax()),te().on(vr,this._rtlPluginLoaded),this.on("data",d=>{if(d.dataType!=="source"||d.sourceDataType!=="metadata")return;const m=this.sourceCaches[d.sourceId];if(!m)return;const y=m.getSource();if(y&&y.vectorLayerIds)for(const E in this._layers){const C=this._layers[E];C.source===y.id&&this._validateLayer(C)}})}loadURL(o,h={},d){this.fire(new u.k("dataloading",{dataType:"style"})),h.validate=typeof h.validate!="boolean"||h.validate;const m=this.map._requestManager.transformRequest(o,"Style");this._loadStyleRequest=new AbortController,u.h(m,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(wc,{validate:!1})}_load(o,h,d){var m;const y=h.transformStyle?h.transformStyle(d,o):o;if(!h.validate||!ui(this,u.x(y))){this._loaded=!0,this.stylesheet=y;for(const E in y.sources)this.addSource(E,y.sources[E],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs),this._createLayers(),this.light=new pn(this.stylesheet.light),this.map.setTerrain((m=this.stylesheet.terrain)!==null&&m!==void 0?m: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("SL",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 m;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(y,E,C,M){return u._(this,void 0,void 0,function*(){const k=Pt(y),N=C>1?"@2x":"",F={},W={};for(const{id:rt,url:it}of k){const at=E.transformRequest(E.normalizeSpriteURL(it,N,".json"),"SpriteJSON");F[rt]=u.h(at,M);const tt=E.transformRequest(E.normalizeSpriteURL(it,N,".png"),"SpriteImage");W[rt]=G.getImage(tt,M)}return yield Promise.all([...Object.values(F),...Object.values(W)]),function(rt,it){return u._(this,void 0,void 0,function*(){const at={};for(const tt in rt){at[tt]={};const _t=L.getImageCanvasContext((yield it[tt]).data),kt=(yield rt[tt]).data;for(const ut in kt){const{width:wt,height:Dt,x:zt,y:Bt,sdf:Qt,pixelRatio:Jt,stretchX:ie,stretchY:ae,content:Je}=kt[ut];at[tt][ut]={data:null,pixelRatio:Jt,sdf:Qt,stretchX:ie,stretchY:ae,content:Je,spriteData:{width:wt,height:Dt,x:zt,y:Bt,context:_t}}}}return at})}(F,W)})}(o,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(y=>{if(this._spriteRequest=null,y)for(const E in y){this._spritesImagesIds[E]=[];const C=this._spritesImagesIds[E]?this._spritesImagesIds[E].filter(M=>!(M in y)):[];for(const M of C)this.imageManager.removeImage(M),this._changedImages[M]=!0;for(const M in y[E]){const k=E==="default"?M:`${E}:${M}`;this._spritesImagesIds[E].push(k),k in this.imageManager.images?this.imageManager.updateImage(k,y[E][M],!1):this.imageManager.addImage(k,y[E][M]),h&&(this._changedImages[k]=!0)}}}).catch(y=>{this._spriteRequest=null,m=y,this.fire(new u.j(m))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),h&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new u.k("data",{dataType:"style"})),d&&d(m)})}_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("SI",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 m=h.getSource();(m.type==="geojson"||m.vectorLayerIds&&m.vectorLayerIds.indexOf(d)===-1)&&this.fire(new u.j(new Error(`Source layer "${d}" does not exist on source "${m.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 m of o)h[m]&&d.push(h[m]);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 m=this._layers[d];m.type!=="custom"&&(o[d]=m.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(h){const m=Object.keys(this._updatedLayers),y=Object.keys(this._removedLayers);(m.length||y.length)&&this._updateWorkerLayers(m,y);for(const E in this._updatedSources){const C=this._updatedSources[E];if(C==="reload")this._reloadSource(E);else{if(C!=="clear")throw new Error(`Invalid action ${C}`);this._clearSource(E)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const E in this._updatedPaintProps)this._layers[E].updateTransitions(o);this.light.updateTransitions(o),this._resetUpdates()}const d={};for(const m in this.sourceCaches){const y=this.sourceCaches[m];d[m]=y.used,y.used=!1}for(const m of this._order){const y=this._layers[m];y.recalculate(o,this._availableImages),!y.isHidden(o.zoom)&&y.source&&(this.sourceCaches[y.source].used=!0)}for(const m in d){const y=this.sourceCaches[m];!!d[m]!=!!y.used&&y.fire(new u.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:m}))}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("UL",{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={}){var d;this._checkLoaded();const m=this.serialize();if(o=h.transformStyle?h.transformStyle(m,o):o,((d=h.validate)===null||d===void 0||d)&&ui(this,u.x(o)))return!1;(o=u.aA(o)).layers=u.ay(o.layers);const y=u.aB(m,o),E=this._getOperationsToPerform(y);if(E.unimplemented.length>0)throw new Error(`Unimplemented: ${E.unimplemented.join(", ")}.`);if(E.operations.length===0)return!1;for(const C of E.operations)C();return this.stylesheet=o,this._serializedLayers=null,!0}_getOperationsToPerform(o){const h=[],d=[];for(const m of o)switch(m.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":h.push(()=>this.addLayer.apply(this,m.args));break;case"removeLayer":h.push(()=>this.removeLayer.apply(this,m.args));break;case"setPaintProperty":h.push(()=>this.setPaintProperty.apply(this,m.args));break;case"setLayoutProperty":h.push(()=>this.setLayoutProperty.apply(this,m.args));break;case"setFilter":h.push(()=>this.setFilter.apply(this,m.args));break;case"addSource":h.push(()=>this.addSource.apply(this,m.args));break;case"removeSource":h.push(()=>this.removeSource.apply(this,m.args));break;case"setLayerZoomRange":h.push(()=>this.setLayerZoomRange.apply(this,m.args));break;case"setLight":h.push(()=>this.setLight.apply(this,m.args));break;case"setGeoJSONSourceData":h.push(()=>this.setGeoJSONSourceData.apply(this,m.args));break;case"setGlyphs":h.push(()=>this.setGlyphs.apply(this,m.args));break;case"setSprite":h.push(()=>this.setSprite.apply(this,m.args));break;case"setTerrain":h.push(()=>this.map.setTerrain.apply(this,m.args));break;case"setTransition":h.push(()=>{});break;default:d.push(m.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("SI",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 m=this.sourceCaches[o]=new Gi(o,h,this.dispatcher);m.style=this,m.setEventedParent(this,()=>({isSourceLoaded:m.loaded(),source:m.serialize(),sourceId:o})),m.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 m=o.id;if(this.getLayer(m))return void this.fire(new u.j(new Error(`Layer "${m}" already exists on this map.`)));let y;if(o.type==="custom"){if(ui(this,u.aC(o)))return;y=u.az(o)}else{if("source"in o&&typeof o.source=="object"&&(this.addSource(m,o.source),o=u.aA(o),o=u.e(o,{source:m})),this._validate(u.x.layer,`layers.${m}`,o,{arrayIndex:-1},d))return;y=u.az(o),this._validateLayer(y),y.setEventedParent(this,{layer:{id:m}})}const E=h?this._order.indexOf(h):this._order.length;if(h&&E===-1)this.fire(new u.j(new Error(`Cannot add layer "${m}" before non-existing layer "${h}".`)));else{if(this._order.splice(E,0,m),this._layerOrderChanged=!0,this._layers[m]=y,this._removedLayers[m]&&y.source&&y.type!=="custom"){const C=this._removedLayers[m];delete this._removedLayers[m],C.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 m=h?this._order.indexOf(h):this._order.length;h&&m===-1?this.fire(new u.j(new Error(`Cannot move layer "${o}" before non-existing layer "${h}".`))):(this._order.splice(m,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 m=this.getLayer(o);m?m.minzoom===h&&m.maxzoom===d||(h!=null&&(m.minzoom=h),d!=null&&(m.maxzoom=d),this._updateLayer(m)):this.fire(new u.j(new Error(`Cannot set the zoom range of non-existing layer "${o}".`)))}setFilter(o,h,d={}){this._checkLoaded();const m=this.getLayer(o);if(m){if(!u.aD(m.filter,h))return h==null?(m.filter=void 0,void this._updateLayer(m)):void(this._validate(u.x.filter,`layers.${m.id}.filter`,h,null,d)||(m.filter=u.aA(h),this._updateLayer(m)))}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,m={}){this._checkLoaded();const y=this.getLayer(o);y?u.aD(y.getLayoutProperty(h),d)||(y.setLayoutProperty(h,d,m),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,m={}){this._checkLoaded();const y=this.getLayer(o);y?u.aD(y.getPaintProperty(h),d)||(y.setPaintProperty(h,d,m)&&this._updateLayer(y),this._changed=!0,this._updatedPaintProps[o]=!0,this._serializedLayers=null):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,m=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 E=y.getSource().type;E==="geojson"&&m?this.fire(new u.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):E!=="vector"||m?(o.id===void 0&&this.fire(new u.j(new Error("The feature id parameter must be provided."))),y.setFeatureState(m,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,m=this.sourceCaches[d];if(m===void 0)return void this.fire(new u.j(new Error(`The source '${d}' does not exist in the map's style.`)));const y=m.getSource().type,E=y==="vector"?o.sourceLayer:void 0;y!=="vector"||E?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."))):m.removeFeatureState(E,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,m=this.sourceCaches[h];if(m!==void 0)return m.getSource().type!=="vector"||d?(o.id===void 0&&this.fire(new u.j(new Error("The feature id parameter must be provided."))),m.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,m=this.stylesheet;return u.aF({version:m.version,name:m.name,metadata:m.metadata,light:m.light,center:m.center,zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,sprite:m.sprite,glyphs:m.glyphs,transition:m.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=E=>this._layers[E].type==="fill-extrusion",d={},m=[];for(let E=this._order.length-1;E>=0;E--){const C=this._order[E];if(h(C)){d[C]=E;for(const M of o){const k=M[C];if(k)for(const N of k)m.push(N)}}}m.sort((E,C)=>C.intersectionZ-E.intersectionZ);const y=[];for(let E=this._order.length-1;E>=0;E--){const C=this._order[E];if(h(C))for(let M=m.length-1;M>=0;M--){const k=m[M].feature;if(d[k.layer.id]{const Qt=_t.featureSortOrder;if(Qt){const Jt=Qt.indexOf(zt.featureIndex);return Qt.indexOf(Bt.featureIndex)-Jt}return Bt.featureIndex-zt.featureIndex});for(const zt of Dt)wt.push(zt)}}for(const _t in it)it[_t].forEach(kt=>{const ut=kt.feature,wt=k[C[_t].source].getFeatureState(ut.layer["source-layer"],ut.id);ut.source=ut.layer.source,ut.layer["source-layer"]&&(ut.sourceLayer=ut.layer["source-layer"]),ut.state=wt});return it}(this._layers,E,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(m,y){const E=m.getRenderableIds().map(k=>m.getTileByID(k)),C=[],M={};for(let k=0;kW.getTileByID(rt)).sort((rt,it)=>it.tileID.overscaledZ-rt.tileID.overscaledZ||(rt.tileID.isLessThan(it.tileID)?-1:1))}const F=this.crossTileSymbolIndex.addLayer(N,M[N.source],o.center.lng);E=E||F}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 jo(o,this.map.terrain,this._order,y,h,d,m,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()),C=!0),E&&this.pauseablePlacement.placement.setStale()),C||E)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 m=this.sourceCaches[h.source];return m&&m.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),m=this.sourceCaches[h.source];return m&&m.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={},m){this._checkLoaded();const y=[{id:o,url:h}],E=[...Pt(this.stylesheet.sprite),...y];this._validate(u.x.sprite,"sprite",E,null,d)||(this.stylesheet.sprite=E,this._loadSprite(y,!0,m))}removeSprite(o){this._checkLoaded();const h=Pt(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("SI",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 Pt(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 Sc=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 Tu={prelude:On(`#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:On(`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:On(`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:On(`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:On("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:On(`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:On(`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:On("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:On("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:On("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:On(`#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:On(`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:On(`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:On(`#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:On(`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:On(`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:On(`#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:On(`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:On(`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:On(`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:On(`#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:On(`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:On(`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:On(`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:On(`#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:On(`#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:On("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Ms),terrainDepth:On("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:On("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 On(_,o){const h=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,d=o.match(/attribute ([\w]+) ([\w]+)/g),m=_.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),E=y?y.concat(m):m,C={};return{fragmentSource:_=_.replace(h,(M,k,N,F,W)=>(C[W]=!0,k==="define"?` -#ifndef HAS_UNIFORM_u_${W} -varying ${N} ${F} ${W}; -#else -uniform ${N} ${F} u_${W}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${W} - ${N} ${F} ${W} = u_${W}; -#endif -`)),vertexSource:o=o.replace(h,(M,k,N,F,W)=>{const rt=F==="float"?"vec2":"vec4",it=W.match(/color/)?"color":rt;return C[W]?k==="define"?` -#ifndef HAS_UNIFORM_u_${W} -uniform lowp float u_${W}_t; -attribute ${N} ${rt} a_${W}; -varying ${N} ${F} ${W}; -#else -uniform ${N} ${F} u_${W}; -#endif -`:it==="vec4"?` -#ifndef HAS_UNIFORM_u_${W} - ${W} = a_${W}; -#else - ${N} ${F} ${W} = u_${W}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${W} - ${W} = unpack_mix_${it}(a_${W}, u_${W}_t); -#else - ${N} ${F} ${W} = u_${W}; -#endif -`:k==="define"?` -#ifndef HAS_UNIFORM_u_${W} -uniform lowp float u_${W}_t; -attribute ${N} ${rt} a_${W}; -#else -uniform ${N} ${F} u_${W}; -#endif -`:it==="vec4"?` -#ifndef HAS_UNIFORM_u_${W} - ${N} ${F} ${W} = a_${W}; -#else - ${N} ${F} ${W} = u_${W}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${W} - ${N} ${F} ${W} = unpack_mix_${it}(a_${W}, u_${W}_t); -#else - ${N} ${F} ${W} = u_${W}; -#endif -`}),staticAttributes:d,staticUniforms:E}}class Ic{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,m,y,E,C,M,k){this.context=o;let N=this.boundPaintVertexBuffers.length!==m.length;for(let F=0;!N&&F({u_depth:new u.aG(zt,Bt.u_depth),u_terrain:new u.aG(zt,Bt.u_terrain),u_terrain_dim:new u.aH(zt,Bt.u_terrain_dim),u_terrain_matrix:new u.aI(zt,Bt.u_terrain_matrix),u_terrain_unpack:new u.aJ(zt,Bt.u_terrain_unpack),u_terrain_exaggeration:new u.aH(zt,Bt.u_terrain_exaggeration)}))(o,Dt),this.binderUniforms=d?d.getUniforms(o,Dt):[]}draw(o,h,d,m,y,E,C,M,k,N,F,W,rt,it,at,tt,_t,kt){const ut=o.gl;if(this.failedToCreate)return;if(o.program.set(this.program),o.setDepthMode(d),o.setStencilMode(m),o.setColorMode(y),o.setCullFace(E),M){o.activeTexture.set(ut.TEXTURE2),ut.bindTexture(ut.TEXTURE_2D,M.depthTexture),o.activeTexture.set(ut.TEXTURE3),ut.bindTexture(ut.TEXTURE_2D,M.texture);for(const Dt in this.terrainUniforms)this.terrainUniforms[Dt].set(M[Dt])}for(const Dt in this.fixedUniforms)this.fixedUniforms[Dt].set(C[Dt]);at&&at.setUniforms(o,this.binderUniforms,rt,{zoom:it});let wt=0;switch(h){case ut.LINES:wt=2;break;case ut.TRIANGLES:wt=3;break;case ut.LINE_STRIP:wt=1}for(const Dt of W.get()){const zt=Dt.vaos||(Dt.vaos={});(zt[k]||(zt[k]=new Ic)).bind(o,this,N,at?at.getPaintVertexBuffers():[],F,Dt.vertexOffset,tt,_t,kt),ut.drawElements(h,Dt.primitiveLength*wt,ut.UNSIGNED_SHORT,Dt.primitiveOffset*wt*2)}}}function Ec(_,o,h){const d=1/je(h,1,o.transform.tileZoom),m=Math.pow(2,h.tileID.overscaledZ),y=h.tileSize*Math.pow(2,o.transform.tileZoom)/m,E=y*(h.tileID.canonical.x+h.tileID.wrap*m),C=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:[E>>16,C>>16],u_pixel_coord_lower:[65535&E,65535&C]}}const Lu=(_,o,h,d)=>{const m=o.style.light,y=m.properties.get("position"),E=[y.x,y.y,y.z],C=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}();m.properties.get("anchor")==="viewport"&&function(k,N){var F=Math.sin(N),W=Math.cos(N);k[0]=W,k[1]=F,k[2]=0,k[3]=-F,k[4]=W,k[5]=0,k[6]=0,k[7]=0,k[8]=1}(C,-o.transform.angle),function(k,N,F){var W=N[0],rt=N[1],it=N[2];k[0]=W*F[0]+rt*F[3]+it*F[6],k[1]=W*F[1]+rt*F[4]+it*F[7],k[2]=W*F[2]+rt*F[5]+it*F[8]}(E,E,C);const M=m.properties.get("color");return{u_matrix:_,u_lightpos:E,u_lightintensity:m.properties.get("intensity"),u_lightcolor:[M.r,M.g,M.b],u_vertical_gradient:+h,u_opacity:d}},tg=(_,o,h,d,m,y,E)=>u.e(Lu(_,o,h,d),Ec(y,o,E),{u_height_factor:-Math.pow(2,m.overscaledZ)/E.tileSize/8}),Qp=_=>({u_matrix:_}),Cc=(_,o,h,d)=>u.e(Qp(_),Ec(h,o,d)),eg=(_,o)=>({u_matrix:_,u_world:o}),$p=(_,o,h,d,m)=>u.e(Cc(_,o,h,d),{u_world:m}),ng=(_,o,h,d)=>{const m=_.transform;let y,E;if(d.paint.get("circle-pitch-alignment")==="map"){const C=je(h,1,m.zoom);y=!0,E=[C,C]}else y=!1,E=m.pixelsToGLUnits;return{u_camera_to_center_distance:m.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:E}},td=(_,o,h)=>{const d=je(h,1,o.zoom),m=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*m),o.pixelsToGLUnits[1]/(d*m)],u_overscale_factor:y}},ed=(_,o,h=1)=>({u_matrix:_,u_color:o,u_overlay:0,u_overlay_scale:h}),Tc=_=>({u_matrix:_}),nd=(_,o,h,d)=>({u_matrix:_,u_extrude_scale:je(o,1,h),u_intensity:d});function id(_,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 Lc=(_,o,h,d)=>{const m=_.transform;return{u_matrix:Mu(_,o,h,d),u_ratio:1/je(o,1,m.zoom),u_device_pixel_ratio:_.pixelRatio,u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]]}},rd=(_,o,h,d,m)=>u.e(Lc(_,o,h,m),{u_image:0,u_image_height:d}),ol=(_,o,h,d,m)=>{const y=_.transform,E=Eo(o,y);return{u_matrix:Mu(_,o,h,m),u_texsize:o.imageAtlasTexture.size,u_ratio:1/je(o,1,y.zoom),u_device_pixel_ratio:_.pixelRatio,u_image:0,u_scale:[E,d.fromScale,d.toScale],u_fade:d.t,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]]}},Mc=(_,o,h,d,m,y)=>{const E=_.lineAtlas,C=Eo(o,_.transform),M=h.layout.get("line-cap")==="round",k=E.getDash(d.from,M),N=E.getDash(d.to,M),F=k.width*m.fromScale,W=N.width*m.toScale;return u.e(Lc(_,o,h,y),{u_patternscale_a:[C/F,-k.height/2],u_patternscale_b:[C/W,-N.height/2],u_sdfgamma:E.width/(256*Math.min(F,W)*_.pixelRatio)/2,u_image:0,u_tex_y_a:k.y,u_tex_y_b:N.y,u_mix:m.t})};function Eo(_,o){return 1/je(_,1,o.tileZoom)}function Mu(_,o,h,d){return _.translatePosMatrix(d?d.posMatrix:o.tileID.posMatrix,o,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const Pc=(_,o,h,d,m)=>{return{u_matrix:_,u_tl_parent:o,u_scale_parent:h,u_buffer_scale:1,u_fade_t:d.mix,u_opacity:d.opacity*m.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:m.paint.get("raster-brightness-min"),u_brightness_high:m.paint.get("raster-brightness-max"),u_saturation_factor:(E=m.paint.get("raster-saturation"),E>0?1-1/(1.001-E):-E),u_contrast_factor:(y=m.paint.get("raster-contrast"),y>0?1/(1-y):1+y),u_spin_weights:Pu(m.paint.get("raster-hue-rotate"))};var y,E};function Pu(_){_*=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 Au=(_,o,h,d,m,y,E,C,M,k)=>{const N=m.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:m.options.fadeDuration?m.symbolFadeChange:1,u_matrix:y,u_label_plane_matrix:E,u_coord_matrix:C,u_is_text:+M,u_pitch_with_map:+d,u_texsize:k,u_texture:0}},ku=(_,o,h,d,m,y,E,C,M,k,N)=>{const F=m.transform;return u.e(Au(_,o,h,d,m,y,E,C,M,k),{u_gamma_scale:d?Math.cos(F._pitch)*F.cameraToCenterDistance:1,u_device_pixel_ratio:m.pixelRatio,u_is_halo:+N})},Du=(_,o,h,d,m,y,E,C,M,k)=>u.e(ku(_,o,h,d,m,y,E,C,!0,M,!0),{u_texsize_icon:k,u_texture_icon:1}),ig=(_,o,h)=>({u_matrix:_,u_opacity:o,u_color:h}),rg=(_,o,h,d,m,y)=>u.e(function(E,C,M,k){const N=M.imageManager.getPattern(E.from.toString()),F=M.imageManager.getPattern(E.to.toString()),{width:W,height:rt}=M.imageManager.getPixelSize(),it=Math.pow(2,k.tileID.overscaledZ),at=k.tileSize*Math.pow(2,M.transform.tileZoom)/it,tt=at*(k.tileID.canonical.x+k.tileID.wrap*it),_t=at*k.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:N.tl,u_pattern_br_a:N.br,u_pattern_tl_b:F.tl,u_pattern_br_b:F.br,u_texsize:[W,rt],u_mix:C.t,u_pattern_size_a:N.displaySize,u_pattern_size_b:F.displaySize,u_scale_a:C.fromScale,u_scale_b:C.toScale,u_tile_units_to_pixels:1/je(k,1,M.transform.tileZoom),u_pixel_coord_upper:[tt>>16,_t>>16],u_pixel_coord_lower:[65535&tt,65535&_t]}}(d,y,h,m),{u_matrix:_,u_opacity:o}),od={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 og{constructor(o,h,d){this.context=o;const m=o.gl;this.buffer=m.createBuffer(),this.dynamicDraw=!!d,this.context.unbindVAO(),o.bindElementBuffer.set(this.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?m.DYNAMIC_DRAW:m.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 sl={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ac{constructor(o,h,d,m){this.length=h.length,this.attributes=d,this.itemSize=h.bytesPerElement,this.dynamicDraw=m,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 ie=u.F(),ae=Bt;u.aP(ie,zt.placementInvProjMatrix,_.transform.glCoordMatrix),u.aP(ie,ie,zt.placementViewportMatrix),N.push({circleArray:Jt,circleOffset:W,transform:ae,invTransform:ie,coord:wt}),F+=Jt.length/4,W=F}Qt&&k.draw(C,M.LINES,vn.disabled,Xn.disabled,_.colorModeForRenderPass(),Zn.disabled,td(Bt,_.transform,Dt),_.style.map.terrain&&_.style.map.terrain.getTerrainData(wt),h.id,Qt.layoutVertexBuffer,Qt.indexBuffer,Qt.segments,null,_.transform.zoom,null,null,Qt.collisionVertexBuffer)}if(!E||!N.length)return;const rt=_.useProgram("collisionCircle"),it=new u.aQ;it.resize(4*F),it._trim();let at=0;for(const ut of N)for(let wt=0;wt=0&&(it[tt.associatedIconIndex]={shiftedAnchor:Je,angle:le})}else Ht(tt.numGlyphs,W)}if(k){rt.clear();const at=_.icon.placedSymbolArray;for(let tt=0;tt_.style.map.terrain.getElevation(Qt,Wo,Hi):null,fi=h.layout.get("text-rotation-alignment")==="map";q(ie,Qt.posMatrix,_,m,To,Ds,tt,k,fi,Wi)}const Ra=_.translatePosMatrix(Qt.posMatrix,Jt,y,E),Rs=_t||m&&zt||Hu?_f:To,Zi=_.translatePosMatrix(Ds,Jt,y,E,!0),hi=le&&h.paint.get(m?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let ei;ei=le?ie.iconsInText?Du(ze.kind,Ue,kt,tt,_,Ra,Rs,Zi,an,Ji):ku(ze.kind,Ue,kt,tt,_,Ra,Rs,Zi,m,an,!0):Au(ze.kind,Ue,kt,tt,_,Ra,Rs,Zi,m,an);const Zo={program:xn,buffers:ae,uniformValues:ei,atlasTexture:bi,atlasTextureIcon:ci,atlasInterpolation:Fn,atlasInterpolationIcon:Co,isSDF:le,hasHalo:hi};if(ut&&ie.canOverlap){wt=!0;const Wi=ae.segments.get();for(const fi of Wi)Bt.push({segments:new u.$([fi]),sortKey:fi.sortKey,state:Zo,terrainData:rn})}else Bt.push({segments:ae.segments,sortKey:0,state:Zo,terrainData:rn})}wt&&Bt.sort((Qt,Jt)=>Qt.sortKey-Jt.sortKey);for(const Qt of Bt){const Jt=Qt.state;if(W.activeTexture.set(rt.TEXTURE0),Jt.atlasTexture.bind(Jt.atlasInterpolation,rt.CLAMP_TO_EDGE),Jt.atlasTextureIcon&&(W.activeTexture.set(rt.TEXTURE1),Jt.atlasTextureIcon&&Jt.atlasTextureIcon.bind(Jt.atlasInterpolationIcon,rt.CLAMP_TO_EDGE)),Jt.isSDF){const ie=Jt.uniformValues;Jt.hasHalo&&(ie.u_is_halo=1,dd(Jt.buffers,Qt.segments,h,_,Jt.program,Dt,N,F,ie,Qt.terrainData)),ie.u_is_halo=0}dd(Jt.buffers,Qt.segments,h,_,Jt.program,Dt,N,F,Jt.uniformValues,Qt.terrainData)}}function dd(_,o,h,d,m,y,E,C,M,k){const N=d.context;m.draw(N,N.gl.TRIANGLES,y,E,C,Zn.disabled,M,k,h.id,_.layoutVertexBuffer,_.indexBuffer,o,h.paint,d.transform.zoom,_.programConfigurations.get(h.id),_.dynamicLayoutVertexBuffer,_.opacityVertexBuffer)}function Gc(_,o,h,d,m){if(!h||!d||!d.imageAtlas)return;const y=d.imageAtlas.patternPositions;let E=y[h.to.toString()],C=y[h.from.toString()];if(!E&&C&&(E=C),!C&&E&&(C=E),!E||!C){const M=m.getPaintProperty(o);E=y[M],C=y[M]}E&&C&&_.setConstantPatternPositions(E,C)}function md(_,o,h,d,m,y,E){const C=_.context.gl,M="fill-pattern",k=h.paint.get(M),N=k&&k.constantOr(1),F=h.getCrossfadeParameters();let W,rt,it,at,tt;E?(rt=N&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",W=C.LINES):(rt=N?"fillPattern":"fill",W=C.TRIANGLES);const _t=k.constantOr(null);for(const kt of d){const ut=o.getTile(kt);if(N&&!ut.patternsLoaded())continue;const wt=ut.getBucket(h);if(!wt)continue;const Dt=wt.programConfigurations.get(h.id),zt=_.useProgram(rt,Dt),Bt=_.style.map.terrain&&_.style.map.terrain.getTerrainData(kt);N&&(_.context.activeTexture.set(C.TEXTURE0),ut.imageAtlasTexture.bind(C.LINEAR,C.CLAMP_TO_EDGE),Dt.updatePaintBuffers(F)),Gc(Dt,M,_t,ut,h);const Qt=Bt?kt:null,Jt=_.translatePosMatrix(Qt?Qt.posMatrix:kt.posMatrix,ut,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(E){at=wt.indexBuffer2,tt=wt.segments2;const ie=[C.drawingBufferWidth,C.drawingBufferHeight];it=rt==="fillOutlinePattern"&&N?$p(Jt,_,F,ut,ie):eg(Jt,ie)}else at=wt.indexBuffer,tt=wt.segments,it=N?Cc(Jt,_,F,ut):Qp(Jt);zt.draw(_.context,W,m,_.stencilModeForClipping(kt),y,Zn.disabled,it,Bt,h.id,wt.layoutVertexBuffer,at,tt,h.paint,_.transform.zoom,Dt)}}function qc(_,o,h,d,m,y,E){const C=_.context,M=C.gl,k="fill-extrusion-pattern",N=h.paint.get(k),F=N.constantOr(1),W=h.getCrossfadeParameters(),rt=h.paint.get("fill-extrusion-opacity"),it=N.constantOr(null);for(const at of d){const tt=o.getTile(at),_t=tt.getBucket(h);if(!_t)continue;const kt=_.style.map.terrain&&_.style.map.terrain.getTerrainData(at),ut=_t.programConfigurations.get(h.id),wt=_.useProgram(F?"fillExtrusionPattern":"fillExtrusion",ut);F&&(_.context.activeTexture.set(M.TEXTURE0),tt.imageAtlasTexture.bind(M.LINEAR,M.CLAMP_TO_EDGE),ut.updatePaintBuffers(W)),Gc(ut,k,it,tt,h);const Dt=_.translatePosMatrix(at.posMatrix,tt,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),zt=h.paint.get("fill-extrusion-vertical-gradient"),Bt=F?tg(Dt,_,zt,rt,at,W,tt):Lu(Dt,_,zt,rt);wt.draw(C,C.gl.TRIANGLES,m,y,E,Zn.backCCW,Bt,kt,h.id,_t.layoutVertexBuffer,_t.indexBuffer,_t.segments,h.paint,_.transform.zoom,ut,_.style.map.terrain&&_t.centroidVertexBuffer)}}function jc(_,o,h,d,m,y,E){const C=_.context,M=C.gl,k=h.fbo;if(!k)return;const N=_.useProgram("hillshade"),F=_.style.map.terrain&&_.style.map.terrain.getTerrainData(o);C.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,k.colorAttachment.get()),N.draw(C,M.TRIANGLES,m,y,E,Zn.disabled,((W,rt,it,at)=>{const tt=it.paint.get("hillshade-shadow-color"),_t=it.paint.get("hillshade-highlight-color"),kt=it.paint.get("hillshade-accent-color");let ut=it.paint.get("hillshade-illumination-direction")*(Math.PI/180);it.paint.get("hillshade-illumination-anchor")==="viewport"&&(ut-=W.transform.angle);const wt=!W.options.moving;return{u_matrix:at?at.posMatrix:W.transform.calculatePosMatrix(rt.tileID.toUnwrapped(),wt),u_image:0,u_latrange:id(0,rt.tileID),u_light:[it.paint.get("hillshade-exaggeration"),ut],u_shadow:tt,u_highlight:_t,u_accent:kt}})(_,h,d,F?o:null),F,d.id,_.rasterBoundsBuffer,_.quadTriangleIndexBuffer,_.rasterBoundsSegments)}function yf(_,o,h,d,m,y){const E=_.context,C=E.gl,M=o.dem;if(M&&M.data){const k=M.dim,N=M.stride,F=M.getPixels();if(E.activeTexture.set(C.TEXTURE1),E.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||_.getTileTexture(N),o.demTexture){const rt=o.demTexture;rt.update(F,{premultiply:!1}),rt.bind(C.NEAREST,C.CLAMP_TO_EDGE)}else o.demTexture=new $(E,F,C.RGBA,{premultiply:!1}),o.demTexture.bind(C.NEAREST,C.CLAMP_TO_EDGE);E.activeTexture.set(C.TEXTURE0);let W=o.fbo;if(!W){const rt=new $(E,{width:k,height:k,data:null},C.RGBA);rt.bind(C.LINEAR,C.CLAMP_TO_EDGE),W=o.fbo=E.createFramebuffer(k,k,!0,!1),W.colorAttachment.set(rt.texture)}E.bindFramebuffer.set(W.framebuffer),E.viewport.set([0,0,k,k]),_.useProgram("hillshadePrepare").draw(E,C.TRIANGLES,d,m,y,Zn.disabled,((rt,it)=>{const at=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:[at,at],u_zoom:rt.overscaledZ,u_unpack:it.getUnpackVector()}})(o.tileID,M),null,h.id,_.rasterBoundsBuffer,_.quadTriangleIndexBuffer,_.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function gd(_,o,h,d,m,y){const E=d.paint.get("raster-fade-duration");if(!y&&E>0){const C=L.now(),M=(C-_.timeAdded)/E,k=o?(C-o.timeAdded)/E:-1,N=h.getSource(),F=m.coveringZoomLevel({tileSize:N.tileSize,roundZoom:N.roundZoom}),W=!o||Math.abs(o.tileID.overscaledZ-F)>Math.abs(_.tileID.overscaledZ-F),rt=W&&_.refreshedUponExpiration?1:u.ac(W?M:1-k,0,1);return _.refreshedUponExpiration&&M>=1&&(_.refreshedUponExpiration=!1),o?{opacity:1,mix:1-rt}:{opacity:rt,mix:0}}return{opacity:1,mix:0}}const _d=new u.aO(1,0,0,1),Zc=new u.aO(0,1,0,1),vf=new u.aO(0,0,1,1),dg=new u.aO(1,0,1,1),yd=new u.aO(0,1,1,1);function vi(_,o,h,d){Hr(_,0,o+h/2,_.transform.width,h,d)}function Ma(_,o,h,d){Hr(_,o-h/2,0,h,_.transform.height,d)}function Hr(_,o,h,d,m,y){const E=_.context,C=E.gl;C.enable(C.SCISSOR_TEST),C.scissor(o*_.pixelRatio,h*_.pixelRatio,d*_.pixelRatio,m*_.pixelRatio),E.clear({color:y}),C.disable(C.SCISSOR_TEST)}function xf(_,o,h){const d=_.context,m=d.gl,y=h.posMatrix,E=_.useProgram("debug"),C=vn.disabled,M=Xn.disabled,k=_.colorModeForRenderPass(),N="$debug",F=_.style.map.terrain&&_.style.map.terrain.getTerrainData(h);d.activeTexture.set(m.TEXTURE0);const W=o.getTileByID(h.key).latestRawTileData,rt=Math.floor((W&&W.byteLength||0)/1024),it=o.getTile(h).tileSize,at=512/Math.min(it,512)*(h.overscaledZ/_.transform.zoom)*.5;let tt=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(tt+=` => ${h.overscaledZ}`),function(_t,kt){_t.initDebugOverlayCanvas();const ut=_t.debugOverlayCanvas,wt=_t.context.gl,Dt=_t.debugOverlayCanvas.getContext("2d");Dt.clearRect(0,0,ut.width,ut.height),Dt.shadowColor="white",Dt.shadowBlur=2,Dt.lineWidth=1.5,Dt.strokeStyle="white",Dt.textBaseline="top",Dt.font="bold 36px Open Sans, sans-serif",Dt.fillText(kt,5,5),Dt.strokeText(kt,5,5),_t.debugOverlayTexture.update(ut),_t.debugOverlayTexture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE)}(_,`${tt} ${rt}kB`),E.draw(d,m.TRIANGLES,C,M,Ri.alphaBlended,Zn.disabled,ed(y,u.aO.transparent,at),null,N,_.debugBuffer,_.quadTriangleIndexBuffer,_.debugSegments),E.draw(d,m.LINE_STRIP,C,M,k,Zn.disabled,ed(y,u.aO.red),F,N,_.debugBuffer,_.tileBorderIndexBuffer,_.debugSegments)}function Wc(_,o,h){const d=_.context,m=d.gl,y=_.colorModeForRenderPass(),E=new vn(m.LEQUAL,vn.ReadWrite,_.depthRangeFor3D),C=_.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),F=o.getTerrainData(k.tileID);d.activeTexture.set(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,N.texture);const W={u_matrix:_.transform.calculatePosMatrix(k.tileID.toUnwrapped()),u_texture:0,u_ele_delta:o.getMeshFrameDelta(_.transform.zoom)};C.draw(d,m.TRIANGLES,E,Xn.disabled,y,Zn.backCCW,W,F,"terrain",M.vertexBuffer,M.indexBuffer,M.segments)}}class vd{constructor(o,h){this.context=new pg(o),this.transform=h,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:u.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Gi.maxUnderzooming+Gi.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ta}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 m of this.style._order)this.style._layers[m].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,Sc.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,Sc.members),this.debugSegments=u.$.simpleSegment(0,0,4,5);const m=new u.Z;m.emplaceBack(0,0,0,0),m.emplaceBack(u.W,0,u.W,0),m.emplaceBack(0,u.W,0,u.W),m.emplaceBack(u.W,u.W,u.W,u.W),this.rasterBoundsBuffer=o.createVertexBuffer(m,on.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,Sc.members),this.viewportSegments=u.$.simpleSegment(0,0,4,2);const E=new u.aW;E.emplaceBack(0),E.emplaceBack(1),E.emplaceBack(3),E.emplaceBack(2),E.emplaceBack(0),this.tileBorderIndexBuffer=o.createIndexBuffer(E);const C=new u.aX;C.emplaceBack(0,1,2),C.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=o.createIndexBuffer(C);const M=this.context.gl;this.stencilClearMode=new Xn({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,vn.disabled,this.stencilClearMode,Ri.disabled,Zn.disabled,Tc(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,m=d.gl;this.nextStencilID+h.length>256&&this.clearStencil(),d.setColorMode(Ri.disabled),d.setDepthMode(vn.disabled);const y=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const E of h){const C=this._tileClippingMaskIDs[E.key]=this.nextStencilID++,M=this.style.map.terrain&&this.style.map.terrain.getTerrainData(E);y.draw(d,m.TRIANGLES,vn.disabled,new Xn({func:m.ALWAYS,mask:0},C,255,m.KEEP,m.KEEP,m.REPLACE),Ri.disabled,Zn.disabled,Tc(E.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 Xn({func:h.NOTEQUAL,mask:255},o,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(o){const h=this.context.gl;return new Xn({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((E,C)=>C.overscaledZ-E.overscaledZ),m=d[d.length-1].overscaledZ,y=d[0].overscaledZ-m+1;if(y>1){this.currentStencilSource=void 0,this.nextStencilID+y>256&&this.clearStencil();const E={};for(let C=0;C=0;this.currentLayer--){const M=this.style._layers[d[this.currentLayer]],k=m[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]]:[]),rt=W.filter(tt=>tt.getSource().type==="vector"),it=W.filter(tt=>tt.getSource().type!=="vector"),at=tt=>{(!F||F.getSource().maxzoomat(tt)),F||it.forEach(tt=>at(tt)),F}(this.style,this.transform.zoom);M&&function(k,N,F){for(let W=0;W0),m&&(u.a_(h,d),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(y,E){const C=y.context,M=C.gl,k=Ri.unblended,N=new vn(M.LEQUAL,vn.ReadWrite,[0,1]),F=E.getTerrainMesh(),W=E.sourceCache.getRenderableTiles(),rt=y.useProgram("terrainDepth");C.bindFramebuffer.set(E.getFramebuffer("depth").framebuffer),C.viewport.set([0,0,y.width/devicePixelRatio,y.height/devicePixelRatio]),C.clear({color:u.aO.transparent,depth:1});for(const it of W){const at=E.getTerrainData(it.tileID),tt={u_matrix:y.transform.calculatePosMatrix(it.tileID.toUnwrapped()),u_ele_delta:E.getMeshFrameDelta(y.transform.zoom)};rt.draw(C,M.TRIANGLES,N,Xn.disabled,k,Zn.backCCW,tt,at,"terrain",F.vertexBuffer,F.indexBuffer,F.segments)}C.bindFramebuffer.set(null),C.viewport.set([0,0,y.width,y.height])}(this,this.style.map.terrain),function(y,E){const C=y.context,M=C.gl,k=Ri.unblended,N=new vn(M.LEQUAL,vn.ReadWrite,[0,1]),F=E.getTerrainMesh(),W=E.getCoordsTexture(),rt=E.sourceCache.getRenderableTiles(),it=y.useProgram("terrainCoords");C.bindFramebuffer.set(E.getFramebuffer("coords").framebuffer),C.viewport.set([0,0,y.width/devicePixelRatio,y.height/devicePixelRatio]),C.clear({color:u.aO.transparent,depth:1}),E.coordsIndex=[];for(const at of rt){const tt=E.getTerrainData(at.tileID);C.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,W.texture);const _t={u_matrix:y.transform.calculatePosMatrix(at.tileID.toUnwrapped()),u_terrain_coords_id:(255-E.coordsIndex.length)/255,u_texture:0,u_ele_delta:E.getMeshFrameDelta(y.transform.zoom)};it.draw(C,M.TRIANGLES,N,Xn.disabled,k,Zn.backCCW,_t,tt,"terrain",F.vertexBuffer,F.indexBuffer,F.segments),E.coordsIndex.push(at.tileID.key)}C.bindFramebuffer.set(null),C.viewport.set([0,0,y.width,y.height])}(this,this.style.map.terrain))}renderLayer(o,h,d,m){if(!d.isHidden(this.transform.zoom)&&(d.type==="background"||d.type==="custom"||(m||[]).length))switch(this.id=d.id,d.type){case"symbol":(function(y,E,C,M,k){if(y.renderPass!=="translucent")return;const N=Xn.disabled,F=y.colorModeForRenderPass();(C._unevaluatedLayout.hasValue("text-variable-anchor")||C._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(W,rt,it,at,tt,_t,kt){const ut=rt.transform,wt=tt==="map",Dt=_t==="map";for(const zt of W){const Bt=at.getTile(zt),Qt=Bt.getBucket(it);if(!Qt||!Qt.text||!Qt.text.segments.get().length)continue;const Jt=u.ag(Qt.textSizeData,ut.zoom),ie=je(Bt,1,rt.transform.zoom),ae=He(zt.posMatrix,Dt,wt,rt.transform,ie),Je=it.layout.get("icon-text-fit")!=="none"&&Qt.hasIconData();if(Jt){const le=Math.pow(2,ut.zoom-Bt.tileID.overscaledZ);Bc(Qt,wt,Dt,kt,ut,ae,zt.posMatrix,le,Jt,Je,rt.style.map.terrain?(ze,Qe)=>rt.style.map.terrain.getElevation(zt,ze,Qe):null)}}}(M,y,C,E,C.layout.get("text-rotation-alignment"),C.layout.get("text-pitch-alignment"),k),C.paint.get("icon-opacity").constantOr(1)!==0&&Uc(y,E,C,M,!1,C.paint.get("icon-translate"),C.paint.get("icon-translate-anchor"),C.layout.get("icon-rotation-alignment"),C.layout.get("icon-pitch-alignment"),C.layout.get("icon-keep-upright"),N,F),C.paint.get("text-opacity").constantOr(1)!==0&&Uc(y,E,C,M,!0,C.paint.get("text-translate"),C.paint.get("text-translate-anchor"),C.layout.get("text-rotation-alignment"),C.layout.get("text-pitch-alignment"),C.layout.get("text-keep-upright"),N,F),E.map.showCollisionBoxes&&(Fc(y,E,C,M,C.paint.get("text-translate"),C.paint.get("text-translate-anchor"),!0),Fc(y,E,C,M,C.paint.get("icon-translate"),C.paint.get("icon-translate-anchor"),!1))})(o,h,d,m,this.style.placement.variableOffsets);break;case"circle":(function(y,E,C,M){if(y.renderPass!=="translucent")return;const k=C.paint.get("circle-opacity"),N=C.paint.get("circle-stroke-width"),F=C.paint.get("circle-stroke-opacity"),W=!C.layout.get("circle-sort-key").isConstant();if(k.constantOr(1)===0&&(N.constantOr(1)===0||F.constantOr(1)===0))return;const rt=y.context,it=rt.gl,at=y.depthModeForSublayer(0,vn.ReadOnly),tt=Xn.disabled,_t=y.colorModeForRenderPass(),kt=[];for(let ut=0;utut.sortKey-wt.sortKey);for(const ut of kt){const{programConfiguration:wt,program:Dt,layoutVertexBuffer:zt,indexBuffer:Bt,uniformValues:Qt,terrainData:Jt}=ut.state;Dt.draw(rt,it.TRIANGLES,at,tt,_t,Zn.disabled,Qt,Jt,C.id,zt,Bt,ut.segments,C.paint,y.transform.zoom,wt)}})(o,h,d,m);break;case"heatmap":(function(y,E,C,M){if(C.paint.get("heatmap-opacity")!==0)if(y.renderPass==="offscreen"){const k=y.context,N=k.gl,F=Xn.disabled,W=new Ri([N.ONE,N.ONE],u.aO.transparent,[!0,!0,!0,!0]);(function(rt,it,at){const tt=rt.gl;rt.activeTexture.set(tt.TEXTURE1),rt.viewport.set([0,0,it.width/4,it.height/4]);let _t=at.heatmapFbo;if(_t)tt.bindTexture(tt.TEXTURE_2D,_t.colorAttachment.get()),rt.bindFramebuffer.set(_t.framebuffer);else{const kt=tt.createTexture();tt.bindTexture(tt.TEXTURE_2D,kt),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),_t=at.heatmapFbo=rt.createFramebuffer(it.width/4,it.height/4,!1,!1),function(ut,wt,Dt,zt){var Bt,Qt;const Jt=ut.gl,ie=(Bt=ut.HALF_FLOAT)!==null&&Bt!==void 0?Bt:Jt.UNSIGNED_BYTE,ae=(Qt=ut.RGBA16F)!==null&&Qt!==void 0?Qt:Jt.RGBA;Jt.texImage2D(Jt.TEXTURE_2D,0,ae,wt.width/4,wt.height/4,0,Jt.RGBA,ie,null),zt.colorAttachment.set(Dt)}(rt,it,kt,_t)}})(k,y,C),k.clear({color:u.aO.transparent});for(let rt=0;rt{const ut=u.F();u.aN(ut,0,at.width,at.height,0,0,1);const wt=at.context.gl;return{u_matrix:ut,u_world:[wt.drawingBufferWidth,wt.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,C))})(o,h,d,m);break;case"line":(function(y,E,C,M){if(y.renderPass!=="translucent")return;const k=C.paint.get("line-opacity"),N=C.paint.get("line-width");if(k.constantOr(1)===0||N.constantOr(1)===0)return;const F=y.depthModeForSublayer(0,vn.ReadOnly),W=y.colorModeForRenderPass(),rt=C.paint.get("line-dasharray"),it=C.paint.get("line-pattern"),at=it.constantOr(1),tt=C.paint.get("line-gradient"),_t=C.getCrossfadeParameters(),kt=at?"linePattern":rt?"lineSDF":tt?"lineGradient":"line",ut=y.context,wt=ut.gl;let Dt=!0;for(const zt of M){const Bt=E.getTile(zt);if(at&&!Bt.patternsLoaded())continue;const Qt=Bt.getBucket(C);if(!Qt)continue;const Jt=Qt.programConfigurations.get(C.id),ie=y.context.program.get(),ae=y.useProgram(kt,Jt),Je=Dt||ae.program!==ie,le=y.style.map.terrain&&y.style.map.terrain.getTerrainData(zt),ze=it.constantOr(null);if(ze&&Bt.imageAtlas){const Ue=Bt.imageAtlas,rn=Ue.patternPositions[ze.to.toString()],an=Ue.patternPositions[ze.from.toString()];rn&&an&&Jt.setConstantPatternPositions(rn,an)}const Qe=le?zt:null,xn=at?ol(y,Bt,C,_t,Qe):rt?Mc(y,Bt,C,rt,_t,Qe):tt?rd(y,Bt,C,Qt.lineClipsArray.length,Qe):Lc(y,Bt,C,Qe);if(at)ut.activeTexture.set(wt.TEXTURE0),Bt.imageAtlasTexture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE),Jt.updatePaintBuffers(_t);else if(rt&&(Je||y.lineAtlas.dirty))ut.activeTexture.set(wt.TEXTURE0),y.lineAtlas.bind(ut);else if(tt){const Ue=Qt.gradients[C.id];let rn=Ue.texture;if(C.gradientVersion!==Ue.version){let an=256;if(C.stepInterpolant){const bi=E.getSource().maxzoom,Fn=zt.canonical.z===bi?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 La(this.context,Tu[o],h,od[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 $(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 Pa{constructor(o,h){this.points=o,this.planes=h}static fromInvProjectionMatrix(o,h,d){const m=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(C=>{const M=1/(C=u.af([],C,o))[3]/h*m;return u.a$(C,C,[M,M,1/C[3],M])}),E=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(C=>{const M=function(W,rt){var it=rt[0],at=rt[1],tt=rt[2],_t=it*it+at*at+tt*tt;return _t>0&&(_t=1/Math.sqrt(_t)),W[0]=rt[0]*_t,W[1]=rt[1]*_t,W[2]=rt[2]*_t,W}([],function(W,rt,it){var at=rt[0],tt=rt[1],_t=rt[2],kt=it[0],ut=it[1],wt=it[2];return W[0]=tt*wt-_t*ut,W[1]=_t*kt-at*wt,W[2]=at*ut-tt*kt,W}([],ht([],y[C[0]],y[C[1]]),ht([],y[C[2]],y[C[1]]))),k=-((N=M)[0]*(F=y[C[1]])[0]+N[1]*F[1]+N[2]*F[2]);var N,F;return M.concat(k)});return new Pa(y,E)}}class Aa{constructor(o,h){this.min=o,this.max=h,this.center=function(d,m,y){return d[0]=.5*m[0],d[1]=.5*m[1],d[2]=.5*m[2],d}([],function(d,m,y){return d[0]=m[0]+y[0],d[1]=m[1]+y[1],d[2]=m[2]+y[2],d}([],this.min,this.max))}quadrant(o){const h=[o%2==0,o<2],d=xt(this.min),m=xt(this.max);for(let y=0;y=0&&E++;if(E===0)return 0;E!==h.length&&(d=!1)}if(d)return 2;for(let m=0;m<3;m++){let y=Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let C=0;Cthis.max[m]-this.min[m])return 0}return 1}}class Gl{constructor(o=0,h=0,d=0,m=0){if(isNaN(o)||o<0||isNaN(h)||h<0||isNaN(d)||d<0||isNaN(m)||m<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=m}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),m=u.ac((this.top+h-this.bottom)/2,0,h);return new u.P(d,m)}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}}}const bf=85.051129;class Hc{constructor(o,h,d,m,y){this.tileSize=512,this._renderWorldCopies=y===void 0||!!y,this._minZoom=o||0,this._maxZoom=h||22,this._minPitch=d??0,this._maxPitch=m??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 Hc(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.b1(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,m,y){var E=m[0],C=m[1],M=m[2],k=m[3],N=Math.sin(y),F=Math.cos(y);d[0]=E*F+M*N,d[1]=C*F+k*N,d[2]=E*-N+M*F,d[3]=C*-N+k*F}(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.b2(0,o)];if(this._renderWorldCopies){const d=this.pointCoordinate(new u.P(0,0)),m=this.pointCoordinate(new u.P(this.width,0)),y=this.pointCoordinate(new u.P(this.width,this.height)),E=this.pointCoordinate(new u.P(0,this.height)),C=Math.floor(Math.min(d.x,m.x,y.x,E.x)),M=Math.floor(Math.max(d.x,m.x,y.x,E.x)),k=1;for(let N=C-k;N<=M+k;N++)N!==0&&h.push(new u.b2(N,o))}return h}coveringTiles(o){var h,d;let m=this.coveringZoomLevel(o);const y=m;if(o.minzoom!==void 0&&mo.maxzoom&&(m=o.maxzoom);const E=this.pointCoordinate(this.getCameraPoint()),C=u.Y.fromLngLat(this.center),M=Math.pow(2,m),k=[M*E.x,M*E.y,0],N=[M*C.x,M*C.y,0],F=Pa.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,m);let W=o.minzoom||0;!o.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(W=m);const rt=o.terrain?2/Math.min(this.tileSize,o.tileSize)*this.tileSize:3,it=ut=>({aabb:new Aa([ut*M,0,0],[(ut+1)*M,M,0]),zoom:0,x:0,y:0,wrap:ut,fullyVisible:!1}),at=[],tt=[],_t=m,kt=o.reparseOverscaled?y:m;if(this._renderWorldCopies)for(let ut=1;ut<=3;ut++)at.push(it(-ut)),at.push(it(ut));for(at.push(it(0));at.length>0;){const ut=at.pop(),wt=ut.x,Dt=ut.y;let zt=ut.fullyVisible;if(!zt){const ae=ut.aabb.intersects(F);if(ae===0)continue;zt=ae===2}const Bt=o.terrain?k:N,Qt=ut.aabb.distanceX(Bt),Jt=ut.aabb.distanceY(Bt),ie=Math.max(Math.abs(Qt),Math.abs(Jt));if(ut.zoom===_t||ie>rt+(1<<_t-ut.zoom)-2&&ut.zoom>=W){const ae=_t-ut.zoom,Je=k[0]-.5-(wt<>1),ze=ut.zoom+1;let Qe=ut.aabb.quadrant(ae);if(o.terrain){const xn=new u.Q(ze,ut.wrap,ze,Je,le),Ue=o.terrain.getMinMaxElevation(xn),rn=(h=Ue.minElevation)!==null&&h!==void 0?h:this.elevation,an=(d=Ue.maxElevation)!==null&&d!==void 0?d:this.elevation;Qe=new Aa([Qe.min[0],Qe.min[1],rn],[Qe.max[0],Qe.max[1],an])}at.push({aabb:Qe,zoom:ze,x:Je,y:le,wrap:ut.wrap,fullyVisible:zt})}}return tt.sort((ut,wt)=>ut.distanceSq-wt.distanceSq).map(ut=>ut.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,-85.051129,bf);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.elevation,d=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,m=this.pointLocation(this.centerPoint,o),y=o.getElevationForLngLatZoom(m,this.tileZoom);if(!(this.elevation-y))return;const E=d+h-y,C=Math.cos(this._pitch)*this.cameraToCenterDistance/E/u.b3(1,m.lat),M=this.scaleZoom(C/this.tileSize);this._elevation=y,this._center=m,this.zoom=M}setLocationAtPoint(o,h){const d=this.pointCoordinate(h),m=this.pointCoordinate(this.centerPoint),y=this.locationCoordinate(o),E=new u.Y(y.x-(d.x-m.x),y.y-(d.y-m.y));this.center=this.coordinateLocation(E),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 W=h.pointCoordinate(o);if(W!=null)return W}const d=[o.x,o.y,0,1],m=[o.x,o.y,1,1];u.af(d,d,this.pixelMatrixInverse),u.af(m,m,this.pixelMatrixInverse);const y=d[3],E=m[3],C=d[1]/y,M=m[1]/E,k=d[2]/y,N=m[2]/E,F=k===N?0:(0-k)/(N-k);return new u.Y(u.z.number(d[0]/y,m[0]/E,F)/this.worldSize,u.z.number(C,M,F)/this.worldSize)}coordinatePoint(o,h=0,d=this.pixelMatrix){const m=[o.x*this.worldSize,o.y*this.worldSize,h,1];return u.af(m,m,d),new u.P(m[0]/m[3],m[1]/m[3])}getBounds(){const o=Math.max(0,this.height/2-this.getHorizon());return new St().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 St([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=[-85.051129,bf])}calculatePosMatrix(o,h=!1){const d=o.key,m=h?this._alignedPosMatrixCache:this._posMatrixCache;if(m[d])return m[d];const y=o.canonical,E=this.worldSize/this.zoomScale(y.z),C=y.x+Math.pow(2,y.z)*o.wrap,M=u.an(new Float64Array(16));return u.H(M,M,[C*E,y.y*E,0]),u.J(M,M,[E/u.W,E/u.W,1]),u.K(M,h?this.alignedProjMatrix:this.projMatrix,M),m[d]=new Float32Array(M),m[d]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(o,h){h=u.ac(+h,this.minZoom,this.maxZoom);const d={center:new u.M(o.lng,o.lat),zoom:h};let m=this.lngRange;if(!this._renderWorldCopies&&m===null){const ut=179.9999999999;m=[-ut,ut]}const y=this.tileSize*this.zoomScale(d.zoom);let E=0,C=y,M=0,k=y,N=0,F=0;const{x:W,y:rt}=this.size;if(this.latRange){const ut=this.latRange;E=u.O(ut[1])*y,C=u.O(ut[0])*y,C-EC&&(_t=C-ut)}if(m){const ut=(M+k)/2;let wt=it;this._renderWorldCopies&&(wt=u.b1(it,ut-y/2,ut+y/2));const Dt=W/2;wt-Dtk&&(tt=k-Dt)}if(tt!==void 0||_t!==void 0){const ut=new u.P(tt??it,_t??at);d.center=this.unproject.call({worldSize:y},ut).wrap()}return d}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const o=this._unmodified,{center:h,zoom:d}=this.getConstrained(this.center,this.zoom);this.center=h,this.zoom=d,this._unmodified=o,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.b3(1,this.center.lat)*this.worldSize;let m=u.an(new Float64Array(16));u.J(m,m,[this.width/2,-this.height/2,1]),u.H(m,m,[1,-1,0]),this.labelPlaneMatrix=m,m=u.an(new Float64Array(16)),u.J(m,m,[1,-1,1]),u.H(m,m,[-1,-1,0]),u.J(m,m,[2/this.width,2/this.height,1]),this.glCoordMatrix=m;const y=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),E=Math.min(this.elevation,this.minElevationForCurrentTile),C=y-E*this._pixelPerMeter/Math.cos(this._pitch),M=E<0?C:y,k=Math.PI/2+this._pitch,N=this._fov*(.5+o.y/this.height),F=Math.sin(N)*M/Math.sin(u.ac(Math.PI-k-N,.01,Math.PI-.01)),W=this.getHorizon(),rt=2*Math.atan(W/this.cameraToCenterDistance)*(.5+o.y/(2*W)),it=Math.sin(rt)*M/Math.sin(u.ac(Math.PI-k-rt,.01,Math.PI-.01)),at=Math.min(F,it),tt=1.01*(Math.cos(Math.PI/2-this._pitch)*at+M),_t=this.height/50;m=new Float64Array(16),u.b4(m,this._fov,this.width/this.height,_t,tt),m[8]=2*-o.x/this.width,m[9]=2*o.y/this.height,u.J(m,m,[1,-1,1]),u.H(m,m,[0,0,-this.cameraToCenterDistance]),u.b5(m,m,this._pitch),u.ad(m,m,this.angle),u.H(m,m,[-h,-d,0]),this.mercatorMatrix=u.J([],m,[this.worldSize,this.worldSize,this.worldSize]),u.J(m,m,[1,1,this._pixelPerMeter]),this.pixelMatrix=u.K(new Float64Array(16),this.labelPlaneMatrix,m),u.H(m,m,[0,0,-this.elevation]),this.projMatrix=m,this.invProjMatrix=u.ar([],m),this.pixelMatrix3D=u.K(new Float64Array(16),this.labelPlaneMatrix,m);const kt=this.width%2/2,ut=this.height%2/2,wt=Math.cos(this.angle),Dt=Math.sin(this.angle),zt=h-Math.round(h)+wt*kt+Dt*ut,Bt=d-Math.round(d)+wt*ut+Dt*kt,Qt=new Float64Array(m);if(u.H(Qt,Qt,[zt>.5?zt-1:zt,Bt>.5?Bt-1:Bt,0]),this.alignedProjMatrix=Qt,m=u.ar(new Float64Array(16),this.pixelMatrix),!m)throw new Error("failed to invert matrix");this.pixelMatrixInverse=m,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,m=h.y,y=h.x,E=h.y;for(const C of o)d=Math.min(d,C.x),m=Math.min(m,C.y),y=Math.max(y,C.x),E=Math.max(E,C.y);return[new u.P(d,m),new u.P(y,m),new u.P(y,E),new u.P(d,E),new u.P(d,m)]}}lngLatToCameraDepth(o,h){const d=this.locationCoordinate(o),m=[d.x*this.worldSize,d.y*this.worldSize,h,1];return u.af(m,m,this.projMatrix),m[2]/m[3]}}function wf(_,o){let h,d=!1,m=null,y=null;const E=()=>{m=null,d&&(_.apply(y,h),m=setTimeout(E,o),d=!1)};return(...C)=>(d=!0,y=this,h=C,m||E(),m)}class Sf{constructor(o){this._getCurrentHash=()=>{const h=window.location.hash.replace("#","");if(this._hashName){let d;return h.split("&").map(m=>m.split("=")).forEach(m=>{m[0]===this._hashName&&(d=m)}),(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=wf(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,m=Math.ceil((d*Math.LN2+Math.log(512/360/.5))/Math.LN10),y=Math.pow(10,m),E=Math.round(h.lng*y)/y,C=Math.round(h.lat*y)/y,M=this._map.getBearing(),k=this._map.getPitch();let N="";if(N+=o?`/${E}/${C}/${d}`:`${d}/${C}/${E}`,(M||k)&&(N+="/"+Math.round(10*M)/10),k&&(N+=`/${Math.round(k)}`),this._hashName){const F=this._hashName;let W=!1;const rt=window.location.hash.slice(1).split("&").map(it=>{const at=it.split("=")[0];return at===F?(W=!0,`${at}=${N}`):it}).filter(it=>it);return W||rt.push(`${F}=${N}`),`#${rt.join("&")}`}return`#${N}`}}const Nu={linearity:.3,easing:u.b6(0,0,.3,1)},ul=u.e({deceleration:2500,maxSpeed:1400},Nu),xd=u.e({deceleration:20,maxSpeed:1400},Nu),bd=u.e({deceleration:1e3,maxSpeed:360},Nu),wd=u.e({deceleration:1e3,maxSpeed:90},Nu);class Sd{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,m={};if(h.pan.mag()){const y=Ou(h.pan.mag(),d,u.e({},ul,o||{}));m.offset=h.pan.mult(y.amount/h.pan.mag()),m.center=this._map.transform.center,zu(m,y)}if(h.zoom){const y=Ou(h.zoom,d,xd);m.zoom=this._map.transform.zoom+y.amount,zu(m,y)}if(h.bearing){const y=Ou(h.bearing,d,bd);m.bearing=this._map.transform.bearing+u.ac(y.amount,-179,179),zu(m,y)}if(h.pitch){const y=Ou(h.pitch,d,wd);m.pitch=this._map.transform.pitch+y.amount,zu(m,y)}if(m.zoom||m.bearing){const y=h.pinchAround===void 0?h.around:h.pinchAround;m.around=y?this._map.unproject(y):this._map.getCenter()}return this.clear(),u.e(m,{noMoveStart:!0})}}function zu(_,o){(!_.duration||_.durationh.unproject(M)),C=y.reduce((M,k,N,F)=>M.add(k.div(F.length)),new u.P(0,0));super(o,{points:y,point:C,lngLats:E,lngLat:h.unproject(C),originalEvent:d}),this._defaultPrevented=!1}}class If extends u.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,h,d){super(o,{originalEvent:d}),this._defaultPrevented=!1}}class ss{constructor(o,h){this._map=o,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(o){return this._firePreventable(new If(o.type,this._map,o))}mousedown(o,h){return this._mousedownPos=h,this._firePreventable(new oo(o.type,this._map,o))}mouseup(o){this._map.fire(new oo(o.type,this._map,o))}click(o,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new oo(o.type,this._map,o))}dblclick(o){return this._firePreventable(new oo(o.type,this._map,o))}mouseover(o){this._map.fire(new oo(o.type,this._map,o))}mouseout(o){this._map.fire(new oo(o.type,this._map,o))}touchstart(o){return this._firePreventable(new Ps(o.type,this._map,o))}touchmove(o){this._map.fire(new Ps(o.type,this._map,o))}touchend(o){this._map.fire(new Ps(o.type,this._map,o))}touchcancel(o){this._map.fire(new Ps(o.type,this._map,o))}_firePreventable(o){if(this._map.fire(o),o.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class As{constructor(o){this._map=o}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(o){this._map.fire(new oo(o.type,this._map,o))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new oo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(o){this._delayContextMenu?this._contextMenuEvent=o:this._ignoreContextMenu||this._map.fire(new oo(o.type,this._map,o)),this._map.listens("contextmenu")&&o.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ql{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 as{constructor(o,h){this._map=o,this._tr=new ql(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,m,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 cl(_,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 mg{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(m){const y=new u.P(0,0);for(const E of m)y._add(E);return y.div(m.length)}(h),this.touches=cl(d,h)))}touchmove(o,h,d){if(this.aborted||!this.centroid)return;const m=cl(d,h);for(const y in this.touches){const E=m[y];(!E||E.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 m=!this.aborted&&this.centroid;if(this.reset(),m)return m}}}class Ef{constructor(o){this.singleTap=new mg(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 m=this.singleTap.touchend(o,h,d);if(m){const y=o.timeStamp-this.lastTime<500,E=!this.lastTap||this.lastTap.dist(m)<30;if(y&&E||this.reset(),this.count++,this.lastTime=o.timeStamp,this.lastTap=m,this.count===this.numTaps)return this.reset(),m}}}class gg{constructor(o){this._tr=new ql(o),this._zoomIn=new Ef({numTouches:1,numTaps:2}),this._zoomOut=new Ef({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 m=this._zoomIn.touchend(o,h,d),y=this._zoomOut.touchend(o,h,d),E=this._tr;return m?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:C=>C.easeTo({duration:300,zoom:E.zoom+1,around:E.unproject(m)},{originalEvent:o})}):y?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:C=>C.easeTo({duration:300,zoom:E.zoom-1,around:E.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 jl{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 m=h.length?h[0]:h;return!this._moved&&m.dist(d){_.mousedown=_.dragStart,_.mousemoveWindow=_.dragMove,_.mouseup=_.dragEnd,_.contextmenu=function(o){o.preventDefault()}},Zl=({enable:_,clickTolerance:o,bearingDegreesPerPixelMoved:h=.8})=>{const d=new ks({checkCorrectEvent:m=>A.mouseButton(m)===0&&m.ctrlKey||A.mouseButton(m)===2});return new jl({clickTolerance:o,move:(m,y)=>({bearingDelta:(y.x-m.x)*h}),moveStateManager:d,enable:_,assignEvents:Xc})},Wl=({enable:_,clickTolerance:o,pitchDegreesPerPixelMoved:h=-.5})=>{const d=new ks({checkCorrectEvent:m=>A.mouseButton(m)===0&&m.ctrlKey||A.mouseButton(m)===2});return new jl({clickTolerance:o,move:(m,y)=>({pitchDelta:(y.y-m.y)*h}),moveStateManager:d,enable:_,assignEvents:Xc})};class Id{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 m=cl(d,h),y=new u.P(0,0),E=new u.P(0,0);let C=0;for(const k in m){const N=m[k],F=this._touches[k];F&&(y._add(N),E._add(N.sub(F)),C++,m[k]=N)}if(this._touches=m,CMath.abs(_.x)}class Td extends pe{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,Kc(o[0].sub(o[1]))&&(this._valid=!1)}_move(o,h,d){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const m=o[0].sub(this._lastPoints[0]),y=o[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(m,y,d.timeStamp),this._valid?(this._lastPoints=o,this._active=!0,{pitchDelta:(m.y+y.y)/2*-.5}):void 0}gestureBeginsVertically(o,h,d){if(this._valid!==void 0)return this._valid;const m=o.mag()>=2,y=h.mag()>=2;if(!m&&!y)return;if(!m||!y)return this._firstMove===void 0&&(this._firstMove=d),d-this._firstMove<100&&void 0;const E=o.y>0==h.y>0;return Kc(o)&&Kc(h)&&E}}const _g={panStep:100,bearingStep:15,pitchStep:10};class ka{constructor(o){this._tr=new ql(o);const h=_g;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,m=0,y=0,E=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?m=1:(o.preventDefault(),E=-1);break;case 40:o.shiftKey?m=-1:(o.preventDefault(),E=1);break;default:return}return this._rotationDisabled&&(d=0,m=0),{cameraAnimation:C=>{const M=this._tr;C.easeTo({duration:300,easeId:"keyboardHandler",easing:ti,zoom:h?Math.round(M.zoom)+h*(o.shiftKey?2:1):M.zoom,bearing:M.bearing+d*this._bearingStep,pitch:M.pitch+m*this._pitchStep,offset:[-y*this._panStep,-E*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 ti(_){return _*(2-_)}const Bu=4.000244140625;class Jc{constructor(o,h){this._onTimeout=d=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(d)},this._map=o,this._tr=new ql(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(),m=d-(this._lastWheelEventTime||0);this._lastWheelEventTime=d,h!==0&&h%Bu==0?this._type="wheel":h!==0&&Math.abs(h)<4?this._type="trackpad":m>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,o)):this._type||(this._type=Math.abs(m*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 C=this._type==="wheel"&&Math.abs(this._delta)>Bu?this._wheelZoomRate:this._defaultZoomRate;let M=2/(1+Math.exp(-Math.abs(this._delta*C)));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,m=this._easing;let y,E=!1;if(this._type==="wheel"&&d&&m){const C=Math.min((L.now()-this._lastWheelEventTime)/200,1),M=m(C);y=u.z.number(d,h,M),C<1?this._frameId||(this._frameId=!0):E=!0}else y=h,E=!0;return this._active=!0,E&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!E,zoomDelta:y-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(o){let h=u.b7;if(this._prevEase){const d=this._prevEase,m=(L.now()-d.start)/d.duration,y=d.easing(m+.01)-d.easing(m),E=.27/Math.sqrt(y*y+1e-4)*.01,C=Math.sqrt(.0729-E*E);h=u.b6(E,C,.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 Tf{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 ql(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 Ef({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 m=h[0],y=o.timeStamp-this._tapTime<500,E=this._tapPoint.dist(m)<30;y&&E?d.length>0&&(this._swipePoint=m,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 m=h[0],y=m.y-this._swipePoint.y;return this._swipePoint=m,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 m=this._tap.touchend(o,h,d);m&&(this._tapTime=o.timeStamp,this._tapPoint=m)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Pd{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 ls{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 Vu{constructor(o,h,d,m){this._el=o,this._touchZoom=h,this._touchRotate=d,this._tapDragZoom=m,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 Ee{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"),m=document.createElement("div");m.className="maplibregl-desktop-message",m.textContent=h,this._container.appendChild(m);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 Re=_=>_.zoom||_.drag||_.pitch||_.rotate;class Qc extends u.k{}function Uu(_){return _.panDelta&&_.panDelta.mag()||_.zoomDelta||_.bearingDelta||_.pitchDelta}class Lf{constructor(o,h){this.handleWindowEvent=m=>{this.handleEvent(m,`${m.type}Window`)},this.handleEvent=(m,y)=>{if(m.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const E=m.type==="renderFrame"?void 0:m,C={needsRenderFrame:!1},M={},k={},N=m.touches,F=N?this._getMapTouches(N):void 0,W=F?A.touchPos(this._map.getCanvas(),F):A.mousePos(this._map.getCanvas(),m);for(const{handlerName:at,handler:tt,allowed:_t}of this._handlers){if(!tt.isEnabled())continue;let kt;this._blockedByActive(k,_t,at)?tt.reset():tt[y||m.type]&&(kt=tt[y||m.type](m,W,F),this.mergeHandlerResult(C,M,kt,at,E),kt&&kt.needsRenderFrame&&this._triggerRenderFrame()),(kt||tt.isActive())&&(k[at]=tt)}const rt={};for(const at in this._previousActiveHandlers)k[at]||(rt[at]=E);this._previousActiveHandlers=k,(Object.keys(rt).length||Uu(C))&&(this._changes.push([C,M,rt]),this._triggerRenderFrame()),(Object.keys(k).length||Uu(C))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:it}=C;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 Sd(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[m,y,E]of this._listeners)A.addEventListener(m,y,m===document?this.handleWindowEvent:this.handleEvent,E)}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 ss(h,o));const m=h.boxZoom=new as(h,o);this._add("boxZoom",m),o.interactive&&o.boxZoom&&m.enable();const y=h.cooperativeGestures=new Ee(h,o.cooperativeGestures);this._add("cooperativeGestures",y),o.cooperativeGestures&&y.enable();const E=new gg(h),C=new Ld(h);h.doubleClickZoom=new Tf(C,E),this._add("tapZoom",E),this._add("clickZoom",C),o.interactive&&o.doubleClickZoom&&h.doubleClickZoom.enable();const M=new Md;this._add("tapDragZoom",M);const k=h.touchPitch=new Td(h);this._add("touchPitch",k),o.interactive&&o.touchPitch&&h.touchPitch.enable(o.touchPitch);const N=Zl(o),F=Wl(o);h.dragRotate=new ls(o,N,F),this._add("mouseRotate",N,["mousePitch"]),this._add("mousePitch",F,["mouseRotate"]),o.interactive&&o.dragRotate&&h.dragRotate.enable();const W=(({enable:kt,clickTolerance:ut})=>{const wt=new ks({checkCorrectEvent:Dt=>A.mouseButton(Dt)===0&&!Dt.ctrlKey});return new jl({clickTolerance:ut,move:(Dt,zt)=>({around:zt,panDelta:zt.sub(Dt)}),activateOnStart:!0,moveStateManager:wt,enable:kt,assignEvents:Xc})})(o),rt=new Id(o,h);h.dragPan=new Pd(d,W,rt),this._add("mousePan",W),this._add("touchPan",rt,["touchZoom","touchRotate"]),o.interactive&&o.dragPan&&h.dragPan.enable(o.dragPan);const it=new Cf,at=new Cd;h.touchZoomRotate=new Vu(d,at,it,M),this._add("touchRotate",it,["touchPan","touchZoom"]),this._add("touchZoom",at,["touchPan","touchRotate"]),o.interactive&&o.touchZoomRotate&&h.touchZoomRotate.enable(o.touchZoomRotate);const tt=h.scrollZoom=new Jc(h,()=>this._triggerRenderFrame());this._add("scrollZoom",tt,["mousePan"]),o.interactive&&o.scrollZoom&&h.scrollZoom.enable(o.scrollZoom);const _t=h.keyboard=new ka(h);this._add("keyboard",_t),o.interactive&&o.keyboard&&h.keyboard.enable(),this._add("blockableMapEvent",new As(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!!Re(this._eventsInProgress)||this.isZooming()}_blockedByActive(o,h,d){for(const m in o)if(m!==d&&(!h||h.indexOf(m)<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,m,y){if(!d)return;u.e(o,d);const E={handlerName:m,originalEvent:d.originalEvent||y};d.zoomDelta!==void 0&&(h.zoom=E),d.panDelta!==void 0&&(h.drag=E),d.pitchDelta!==void 0&&(h.pitch=E),d.bearingDelta!==void 0&&(h.rotate=E)}_applyChanges(){const o={},h={},d={};for(const[m,y,E]of this._changes)m.panDelta&&(o.panDelta=(o.panDelta||new u.P(0,0))._add(m.panDelta)),m.zoomDelta&&(o.zoomDelta=(o.zoomDelta||0)+m.zoomDelta),m.bearingDelta&&(o.bearingDelta=(o.bearingDelta||0)+m.bearingDelta),m.pitchDelta&&(o.pitchDelta=(o.pitchDelta||0)+m.pitchDelta),m.around!==void 0&&(o.around=m.around),m.pinchAround!==void 0&&(o.pinchAround=m.pinchAround),m.noInertia&&(o.noInertia=m.noInertia),u.e(h,y),u.e(d,E);this._updateMapTransform(o,h,d),this._changes=[]}_updateMapTransform(o,h,d){const m=this._map,y=m._getTransformForUpdate(),E=m.terrain;if(!(Uu(o)||E&&this._terrainMovement))return this._fireEvents(h,d,!0);let{panDelta:C,zoomDelta:M,bearingDelta:k,pitchDelta:N,around:F,pinchAround:W}=o;W!==void 0&&(F=W),m._stop(!0),F=F||m.transform.centerPoint;const rt=y.pointLocation(C?F.sub(C):F);k&&(y.bearing+=k),N&&(y.pitch+=N),M&&(y.zoom+=M),E?this._terrainMovement||!h.drag&&!h.zoom?h.drag&&this._terrainMovement?y.center=y.pointLocation(y.centerPoint.sub(C)):y.setLocationAtPoint(rt,F):(this._terrainMovement=!0,this._map._elevationFreeze=!0,y.setLocationAtPoint(rt,F),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,y.recalculateZoom(m.terrain)})):y.setLocationAtPoint(rt,F),m._applyUpdatedTransform(y),this._map._update(),o.noInertia||this._inertia.record(o),this._fireEvents(h,d,!0)}_fireEvents(o,h,d){const m=Re(this._eventsInProgress),y=Re(o),E={};for(const N in o){const{originalEvent:F}=o[N];this._eventsInProgress[N]||(E[`${N}start`]=F),this._eventsInProgress[N]=o[N]}!m&&y&&this._fireEvent("movestart",y.originalEvent);for(const N in E)this._fireEvent(N,E[N]);y&&this._fireEvent("move",y.originalEvent);for(const N in o){const{originalEvent:F}=o[N];this._fireEvent(N,F)}const C={};let M;for(const N in this._eventsInProgress){const{handlerName:F,originalEvent:W}=this._eventsInProgress[N];this._handlersById[F].isActive()||(delete this._eventsInProgress[N],M=h[F]||W,C[`${N}end`]=M)}for(const N in C)this._fireEvent(N,C[N]);const k=Re(this._eventsInProgress);if(d&&(m||y)&&!k){this._updatingCamera=!0;const N=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),F=W=>W!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Qc("renderFrame",{timeStamp:o})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class so 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&&(m.zoom=u.z.number(y,tt,Bt)),this._rotating&&(m.bearing=u.z.number(E,k,Bt)),this._pitching&&(m.pitch=u.z.number(C,N,Bt)),this._padding&&(m.interpolatePadding(M,F,Bt),rt=m.centerPoint.add(W)),this.terrain&&!o.freezeElevation&&this._updateElevation(Bt),wt)m.setLocationAtPoint(wt,Dt);else{const Qt=m.zoomScale(m.zoom-y),Jt=tt>y?Math.min(2,ut):Math.max(.5,ut),ie=Math.pow(Jt,1-Bt),ae=m.unproject(_t.add(kt.mult(Bt*ie)).mult(Qt));m.setLocationAtPoint(m.renderWorldCopies?ae.wrap():ae,rt)}this._applyUpdatedTransform(m),this._fireMoveEvents(h)},Bt=>{this.terrain&&this._finalizeElevation(),this._afterEase(h,Bt)},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:m,pitch:y,bearing:E,elevation:C}=this.transformCameraUpdate(h);d&&(h.center=d),m!==void 0&&(h.zoom=m),y!==void 0&&(h.pitch=y),E!==void 0&&(h.bearing=E),C!==void 0&&(h.elevation=C),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,m=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)),m&&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){var d;if(!o.essential&&L.prefersReducedMotion){const xn=u.L(o,["center","zoom","bearing","pitch","around"]);return this.jumpTo(xn,h)}this.stop(),o=u.e({offset:[0,0],speed:1.2,curve:1.42,easing:u.b7},o);const m=this._getTransformForUpdate(),y=this.getZoom(),E=this.getBearing(),C=this.getPitch(),M=this.getPadding(),k="bearing"in o?this._normalizeBearing(o.bearing,E):E,N="pitch"in o?+o.pitch:C,F="padding"in o?o.padding:m.padding,W=u.P.convert(o.offset);let rt=m.centerPoint.add(W);const it=m.pointLocation(rt),{center:at,zoom:tt}=m.getConstrained(u.M.convert(o.center||it),(d=o.zoom)!==null&&d!==void 0?d:y);this._normalizeCenter(at);const _t=m.zoomScale(tt-y),kt=m.project(it),ut=m.project(at).sub(kt);let wt=o.curve;const Dt=Math.max(m.width,m.height),zt=Dt/_t,Bt=ut.mag();if("minZoom"in o){const xn=u.ac(Math.min(o.minZoom,y,tt),m.minZoom,m.maxZoom),Ue=Dt/m.zoomScale(xn-y);wt=Math.sqrt(Ue/Bt*2)}const Qt=wt*wt;function Jt(xn){const Ue=(zt*zt-Dt*Dt+(xn?-1:1)*Qt*Qt*Bt*Bt)/(2*(xn?zt:Dt)*Qt*Bt);return Math.log(Math.sqrt(Ue*Ue+1)-Ue)}function ie(xn){return(Math.exp(xn)-Math.exp(-xn))/2}function ae(xn){return(Math.exp(xn)+Math.exp(-xn))/2}const Je=Jt(!1);let le=function(xn){return ae(Je)/ae(Je+wt*xn)},ze=function(xn){return Dt*((ae(Je)*(ie(Ue=Je+wt*xn)/ae(Ue))-ie(Je))/Qt)/Bt;var Ue},Qe=(Jt(!0)-Je)/wt;if(Math.abs(Bt)<1e-6||!isFinite(Qe)){if(Math.abs(Dt-zt)<1e-6)return this.easeTo(o,h);const xn=zto.maxDuration&&(o.duration=0),this._zooming=!0,this._rotating=E!==k,this._pitching=N!==C,this._padding=!m.isPaddingEqual(F),this._prepareEase(h,!1),this.terrain&&this._prepareElevation(at),this._ease(xn=>{const Ue=xn*Qe,rn=1/le(Ue);m.zoom=xn===1?tt:y+m.scaleZoom(rn),this._rotating&&(m.bearing=u.z.number(E,k,xn)),this._pitching&&(m.pitch=u.z.number(C,N,xn)),this._padding&&(m.interpolatePadding(M,F,xn),rt=m.centerPoint.add(W)),this.terrain&&!o.freezeElevation&&this._updateElevation(xn);const an=xn===1?at:m.unproject(kt.add(ut.mult(ze(Ue))).mult(rn));m.setLocationAtPoint(m.renderWorldCopies?an.wrap():an,rt),this._applyUpdatedTransform(m),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.b1(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 Mf={compact:!0,customAttribution:'MapLibre'};class us{constructor(o=Mf){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(m=>typeof m!="string"?"":m)):typeof this.options.customAttribution=="string"&&o.push(this.options.customAttribution)),this._map.style.stylesheet){const m=this._map.style.stylesheet;this.styleOwner=m.owner,this.styleId=m.id}const h=this._map.style.sourceCaches;for(const m in h){const y=h[m];if(y.used||y.usedForTerrain){const E=y.getSource();E.attribution&&o.indexOf(E.attribution)<0&&o.push(E.attribution)}}o=o.filter(m=>String(m).trim()),o.sort((m,y)=>m.length-y.length),o=o.filter((m,y)=>{for(let E=y+1;E=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 Ad{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 Gu{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 m of d)if(m.id===o)return void(m.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 xi=u.X([{name:"a_pos3d",type:"Int16",components:3}]);class Ni 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 m of o.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))d[m.key]=!0,this._renderableTilesKeys.push(m.key),this._tiles[m.key]||(m.posMatrix=new Float64Array(16),u.aN(m.posMatrix,0,u.W,0,u.W,0,1),this._tiles[m.key]=new Uo(m,this.tileSize));for(const m in this._tiles)d[m]||delete this._tiles[m]}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 m=this._tiles[d].tileID;if(m.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(m.canonical.isChildOf(o.canonical)){const y=o.clone();y.posMatrix=new Float64Array(16);const E=m.canonical.z-o.canonical.z,C=m.canonical.x-(m.canonical.x>>E<>E<>E;u.aN(y.posMatrix,0,k,0,k,0,1),u.H(y.posMatrix,y.posMatrix,[-C*k,-M*k,0]),h[d]=y}else if(o.canonical.isChildOf(m.canonical)){const y=o.clone();y.posMatrix=new Float64Array(16);const E=o.canonical.z-m.canonical.z,C=o.canonical.x-(o.canonical.x>>E<>E<>E;u.aN(y.posMatrix,0,u.W,0,u.W,0,1),u.H(y.posMatrix,y.posMatrix,[C*k,M*k,0]),u.J(y.posMatrix,y.posMatrix,[1/2**E,1/2**E,0]),h[d]=y}}return h}getSourceTile(o,h){const d=this.sourceCache._source;let m=o.overscaledZ-this.deltaZoom;if(m>d.maxzoom&&(m=d.maxzoom),m=d.minzoom&&(!y||!y.dem);)y=this.sourceCache.getTileByID(o.scaledTo(m--).key);return y}tilesAfterTime(o=Date.now()){return Object.values(this._tiles).filter(h=>h.timeAdded>=o)}}class kd{constructor(o,h,d){this.painter=o,this.sourceCache=new Ni(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,m=u.W){var y;if(!(h>=0&&h=0&&do.canonical.z&&(o.canonical.z>=m?y=o.canonical.z-m:u.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const E=o.canonical.x-(o.canonical.x>>y<>y<>8<<4|y>>8,h[E+3]=0;const d=new u.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),m=new $(o,d,o.gl.RGBA,{premultiply:!1});return m.bind(o.gl.NEAREST,o.gl.CLAMP_TO_EDGE),this._coordsTexture=m,m}pointCoordinate(o){this.painter.maybeDrawDepthAndCoords(!0);const h=new Uint8Array(4),d=this.painter.context,m=d.gl,y=Math.round(o.x*this.painter.pixelRatio/devicePixelRatio),E=Math.round(o.y*this.painter.pixelRatio/devicePixelRatio),C=Math.round(this.painter.height/devicePixelRatio);d.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),m.readPixels(y,C-E-1,1,1,m.RGBA,m.UNSIGNED_BYTE,h),d.bindFramebuffer.set(null);const M=h[0]+(h[2]>>4<<8),k=h[1]+((15&h[2])<<8),N=this.coordsIndex[255-h[3]],F=N&&this.sourceCache.getTileByID(N);if(!F)return null;const W=this._coordsTextureSize,rt=(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 sa={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Pf{constructor(o,h){this.painter=o,this.terrain=h,this.pool=new qu(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 m=o.sourceCaches[d].getVisibleCoordinates();for(const y of m){const E=this.terrain.sourceCache.getTerrainCoords(y);for(const C in E)this._coordsDescendingInv[d][C]||(this._coordsDescendingInv[d][C]=[]),this._coordsDescendingInv[d][C].push(E[C])}}this._coordsDescendingInvStr={};for(const d of o._order){const m=o._layers[d],y=m.source;if(sa[m.type]&&!this._coordsDescendingInvStr[y]){this._coordsDescendingInvStr[y]={};for(const E in this._coordsDescendingInv[y])this._coordsDescendingInvStr[y][E]=this._coordsDescendingInv[y][E].map(C=>C.key).sort().join()}}for(const d of this._renderableTiles)for(const m in this._coordsDescendingInvStr){const y=this._coordsDescendingInvStr[m][d.tileID.key];y&&y!==d.rttCoords[m]&&(d.rtt=[])}}renderLayer(o){if(o.isHidden(this.painter.transform.zoom))return!1;const h=o.type,d=this.painter,m=this._renderableLayerIds[this._renderableLayerIds.length-1]===o.id;if(sa[h]&&(this._prevType&&sa[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(o.id),!m))return!0;if(sa[this._prevType]||sa[h]&&m){this._prevType=h;const y=this._stacks.length-1,E=this._stacks[y]||[];for(const C of this._renderableTiles){if(this.pool.isFull()&&(Wc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(C),C.rtt[y]){const k=this.pool.getObjectForId(C.rtt[y].id);if(k.stamp===C.rtt[y].stamp){this.pool.useObject(k);continue}}const M=this.pool.getOrCreateFreeObject();this.pool.useObject(M),this.pool.stampObject(M),C.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},Df={showCompass:!0,showZoom:!0,visualizePitch:!1};class Rf{constructor(o,h,d=!1){this.mousedown=E=>{this.startMouse(u.e({},E,{ctrlKey:!0,preventDefault:()=>E.preventDefault()}),A.mousePos(this.element,E)),A.addEventListener(window,"mousemove",this.mousemove),A.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=E=>{this.moveMouse(E,A.mousePos(this.element,E))},this.mouseup=E=>{this.mouseRotate.dragEnd(E),this.mousePitch&&this.mousePitch.dragEnd(E),this.offTemp()},this.touchstart=E=>{E.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=A.touchPos(this.element,E.targetTouches)[0],this.startTouch(E,this._startPos),A.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),A.addEventListener(window,"touchend",this.touchend))},this.touchmove=E=>{E.targetTouches.length!==1?this.reset():(this._lastPos=A.touchPos(this.element,E.targetTouches)[0],this.moveTouch(E,this._lastPos))},this.touchend=E=>{E.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 m=o.dragRotate._mouseRotate.getClickTolerance(),y=o.dragRotate._mousePitch.getClickTolerance();this.element=h,this.mouseRotate=Zl({clickTolerance:m,enable:!0}),this.touchRotate=(({enable:E,clickTolerance:C,bearingDegreesPerPixelMoved:M=.8})=>{const k=new ye;return new jl({clickTolerance:C,move:(N,F)=>({bearingDelta:(F.x-N.x)*M}),moveStateManager:k,enable:E,assignEvents:$c})})({clickTolerance:m,enable:!0}),this.map=o,d&&(this.mousePitch=Wl({clickTolerance:y,enable:!0}),this.touchPitch=(({enable:E,clickTolerance:C,pitchDegreesPerPixelMoved:M=-.5})=>{const k=new ye;return new jl({clickTolerance:C,move:(N,F)=>({pitchDelta:(F.y-N.y)*M}),moveStateManager:k,enable:E,assignEvents:$c})})({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:m}=this.mouseRotate.dragMove(o,h)||{};if(m&&d.setBearing(d.getBearing()+m),this.mousePitch){const{pitchDelta:y}=this.mousePitch.dragMove(o,h)||{};y&&d.setPitch(d.getPitch()+y)}}moveTouch(o,h){const d=this.map,{bearingDelta:m}=this.touchRotate.dragMove(o,h)||{};if(m&&d.setBearing(d.getBearing()+m),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 aa;function th(_,o,h){const d=new u.M(_.lng,_.lat);if(_=new u.M(_.lng,_.lat),o){const m=new u.M(_.lng-360,_.lat),y=new u.M(_.lng+360,_.lat),E=h.locationPoint(_).distSqr(o);h.locationPoint(m).distSqr(o)180;){const m=h.locationPoint(_);if(m.x>=0&&m.y>=0&&m.x<=h.width&&m.y<=h.height)break;_.lng>h.center.lng?_.lng-=360:_.lng+=360}return _.lng!==d.lng&&h.locationPoint(_).y>h.height/2-h.getHorizon()?_:d}const Zu={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 eh(_,o,h){const d=_.classList;for(const m in Zu)d.remove(`maplibregl-${h}-anchor-${m}`);d.add(`maplibregl-${h}-anchor-${o}`)}class Wu extends u.E{constructor(o){if(super(),this._onKeyPress=h=>{const d=h.code,m=h.charCode||h.keyCode;d!=="Space"&&d!=="Enter"&&m!==32&&m!==13||this.togglePopup()},this._onMapClick=h=>{const d=h.originalEvent.target,m=this._element;this._popup&&(d===m||m.contains(d))&&this.togglePopup()},this._update=h=>{var d;if(!this._map)return;const m=this._map.loaded()&&!this._map.isMoving();((h==null?void 0:h.type)==="terrain"||(h==null?void 0:h.type)==="render"&&!m)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?th(this._lngLat,this._flatPos,this._map.transform):(d=this._lngLat)===null||d===void 0?void 0:d.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let y="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?y=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(y=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let E="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?E="rotateX(0deg)":this._pitchAlignment==="map"&&(E=`rotateX(${this._map.getPitch()}deg)`),h&&h.type!=="moveend"||(this._pos=this._pos.round()),A.setTransform(this._element,`${Zu[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${E} ${y}`),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,m=27;h.setAttributeNS(null,"display","block"),h.setAttributeNS(null,"height",`${d}px`),h.setAttributeNS(null,"width",`${m}px`),h.setAttributeNS(null,"viewBox",`0 0 ${m} ${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 E=A.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"fill-rule","nonzero");const C=A.createNS("http://www.w3.org/2000/svg","g");C.setAttributeNS(null,"transform","translate(3.0, 29.0)"),C.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 _t of M){const kt=A.createNS("http://www.w3.org/2000/svg","ellipse");kt.setAttributeNS(null,"opacity","0.04"),kt.setAttributeNS(null,"cx","10.5"),kt.setAttributeNS(null,"cy","5.80029008"),kt.setAttributeNS(null,"rx",_t.rx),kt.setAttributeNS(null,"ry",_t.ry),C.appendChild(kt)}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 F=A.createNS("http://www.w3.org/2000/svg","g");F.setAttributeNS(null,"opacity","0.25"),F.setAttributeNS(null,"fill","#000000");const W=A.createNS("http://www.w3.org/2000/svg","path");W.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"),F.appendChild(W);const rt=A.createNS("http://www.w3.org/2000/svg","g");rt.setAttributeNS(null,"transform","translate(6.0, 7.0)"),rt.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 at=A.createNS("http://www.w3.org/2000/svg","circle");at.setAttributeNS(null,"fill","#000000"),at.setAttributeNS(null,"opacity","0.25"),at.setAttributeNS(null,"cx","5.5"),at.setAttributeNS(null,"cy","5.5"),at.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(at),it.appendChild(tt),E.appendChild(C),E.appendChild(k),E.appendChild(F),E.appendChild(rt),E.appendChild(it),h.appendChild(E),h.setAttributeNS(null,"height",d*this._scale+"px"),h.setAttributeNS(null,"width",m*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()}),eh(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 m=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":[m,-1*(38.1-13.5+m)],"bottom-right":[-m,-1*(38.1-13.5+m)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=o,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 this._element.style.opacity===this._opacityWhenCovered?this:o?(o.isOpen()?o.remove():(o.setLngLat(this._lngLat),o.addTo(this._map)),this):this}_updateOpacity(o=!1){var h,d;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 m=this._map,y=m.terrain.depthAtPoint(this._pos),E=m.terrain.getElevationForLngLatZoom(this._lngLat,m.transform.tileZoom);if(m.transform.lngLatToCameraDepth(this._lngLat,E)-y<.006)return void(this._element.style.opacity=this._opacity);const C=-this._offset.y/m.transform._pixelPerMeter,M=Math.sin(m.getPitch()*Math.PI/180)*C,k=m.terrain.depthAtPoint(new u.P(this._pos.x,this._pos.y-this._offset.y)),N=m.transform.lngLatToCameraDepth(this._lngLat,E+M)-k>.006;!((d=this._popup)===null||d===void 0)&&d.isOpen()&&N&&this._popup.remove(),this._element.style.opacity=N?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 nh={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Xl=0,hl=!1;const ih={maxWidth:100,unit:"metric"};function rh(_,o,h){const d=h&&h.maxWidth||100,m=_._container.clientHeight/2,y=_.unproject([0,m]),E=_.unproject([d,m]),C=y.distanceTo(E);if(h&&h.unit==="imperial"){const M=3.2808*C;M>5280?fl(o,d,M/5280,_._getUIString("ScaleControl.Miles")):fl(o,d,M,_._getUIString("ScaleControl.Feet"))}else h&&h.unit==="nautical"?fl(o,d,C/1852,_._getUIString("ScaleControl.NauticalMiles")):C>=1e3?fl(o,d,C/1e3,_._getUIString("ScaleControl.Kilometers")):fl(o,d,C,_._getUIString("ScaleControl.Meters"))}function fl(_,o,h,d){const m=function(y){const E=Math.pow(10,`${Math.floor(y)}`.length-1);let C=y/E;return C=C>=10?10:C>=5?5:C>=3?3:C>=2?2:C>=1?1:function(M){const k=Math.pow(10,Math.ceil(-Math.log(M)/Math.LN10));return Math.round(M*k)/k}(C),E*C}(h);_.style.width=o*(m/h)+"px",_.innerHTML=`${m} ${d}`}const Nf={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},zf=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function oh(_){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 oh(new u.P(0,0))}const Dd=v;f.AJAXError=u.be,f.Evented=u.E,f.LngLat=u.M,f.MercatorCoordinate=u.Y,f.Point=u.P,f.addProtocol=u.bf,f.config=u.a,f.removeProtocol=u.bg,f.AttributionControl=us,f.BoxZoomHandler=as,f.CanvasSource=rs,f.CooperativeGesturesHandler=Ee,f.DoubleClickZoomHandler=Tf,f.DragPanHandler=Pd,f.DragRotateHandler=ls,f.EdgeInsets=Gl,f.FullscreenControl=class extends u.E{constructor(_={}){super(),this._onFullscreenChange=()=>{var o;let h=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((o=h==null?void 0:h.shadowRoot)===null||o===void 0)&&o.fullscreenElement;)h=h.shadowRoot.fullscreenElement;h===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()}},f.GeoJSONSource=Ti,f.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,m=this._map.getBearing(),y=u.e({bearing:m},this.options.fitBoundsOptions),E=St.fromLngLat(h,d);this._map.fitBounds(E,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 Wu({element:this._dotElement}),this._circleElement=A.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Wu({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({},nh,_)}onAdd(_){return this._map=_,this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(){return u._(this,arguments,void 0,function*(o=!1){if(aa!==void 0&&!o)return aa;if(window.navigator.permissions===void 0)return aa=!!window.navigator.geolocation,aa;try{aa=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{aa=!!window.navigator.geolocation}return aa})}().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,Xl=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),m=Math.ceil(this._accuracy/(d/this._map._container.clientHeight)*2);this._circleElement.style.width=`${m}px`,this._circleElement.style.height=`${m}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":Xl--,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"),Xl++,Xl>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)}},f.Hash=Sf,f.ImageSource=Wn,f.KeyboardHandler=ka,f.LngLatBounds=St,f.LogoControl=Ad,f.Map=class extends so{constructor(_){if(u.bc.mark(u.bd.create),(_=u.e({},ju,_)).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 Hc(_.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 Gu,this._controls=[],this._mapId=u.a3(),this._locale=u.e({},Af,_.locale),this._clickTolerance=_.clickTolerance,this._overridePixelRatio=_.pixelRatio,this._maxCanvasSize=_.maxCanvasSize,this.transformCameraUpdate=_.transformCameraUpdate,this._imageQueueHandle=G.addThrottleControl(()=>this.isMoving()),this._requestManager=new j(_.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=wf(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 Lf(this,_),this._hash=_.hash&&new Sf(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 us(typeof _.attributionControl=="boolean"?void 0:_.attributionControl)),_.maplibreLogo&&this.addControl(new Ad,_.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],m=h[1],y=this._getClampedPixelRatio(d,m);if(this._resizeCanvas(d,m,y),this.painter.resize(d,m,y),this.painter.overLimit()){const C=this.painter.context.gl;this._maxCanvasSize=[C.drawingBufferWidth,C.drawingBufferHeight];const M=this._getClampedPixelRatio(d,m);this._resizeCanvas(d,m,M),this.painter.resize(d,m,M)}this.transform.resize(d,m),(o=this._requestedCameraState)===null||o===void 0||o.resize(d,m);const E=!this._moving;return E&&(this.stop(),this.fire(new u.k("movestart",_)).fire(new u.k("move",_))),this.fire(new u.k("resize",_)),E&&this.fire(new u.k("moveend",_)),this}_getClampedPixelRatio(_,o){const{0:h,1:d}=this._maxCanvasSize,m=this.getPixelRatio(),y=_*m,E=o*m;return Math.min(y>h?h/y:1,E>d?d/E:1)*m}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(St.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 E=this.getLayer(o)?this.queryRenderedFeatures(y.point,{layers:[o]}):[];E.length?d||(d=!0,h.call(this,new oo(_,this,y.originalEvent,{features:E}))):d=!1},mouseout:()=>{d=!1}}}}if(_==="mouseleave"||_==="mouseout"){let d=!1;return{layer:o,listener:h,delegates:{mousemove:E=>{(this.getLayer(o)?this.queryRenderedFeatures(E.point,{layers:[o]}):[]).length?d=!0:d&&(d=!1,h.call(this,new oo(_,this,E.originalEvent)))},mouseout:E=>{d&&(d=!1,h.call(this,new oo(_,this,E.originalEvent)))}}}}{const d=m=>{const y=this.getLayer(o)?this.queryRenderedFeatures(m.point,{layers:[o]}):[];y.length&&(m.features=y,h.call(this,m),delete m.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 m in d.delegates)this.on(m,d.delegates[m]);return this}once(_,o,h){if(h===void 0)return super.once(_,o);const d=this._createDelegatedListener(_,o,h);for(const m in d.delegates)this.once(m,d.delegates[m]);return this}off(_,o,h){return h===void 0?super.off(_,o):(this._delegatedListeners&&this._delegatedListeners[_]&&(d=>{const m=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 Io(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 Io(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(_,o){if(typeof _=="string"){const h=this._requestManager.transformRequest(_,"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 kd(this.painter,o,_),this.painter.renderToTexture=new Pf(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 m=h[d];if(m.state!=="loaded"&&m.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:m=!1,stretchX:y,stretchY:E,content:C}=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,F=o;return this.style.addImage(_,{data:new u.R({width:M,height:k},new Uint8Array(N)),pixelRatio:d,stretchX:y,stretchY:E,content:C,sdf:m,version:0,userImage:F}),F.onAdd&&F.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:E,content:C,sdf:m,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:m,height:y,data:E}=d;if(m===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(m!==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 C=!(o instanceof HTMLImageElement||u.b(o));return h.data.replace(E,C),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(_,"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 m=this._controlContainer=A.create("div","maplibregl-control-container",_),y=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(E=>{y[E]=A.create("div",`maplibregl-ctrl-${E} `,m)}),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 vd(h,this.transform),U.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 m=this.transform.zoom,y=L.now();this.style.zoomHistory.update(m,y);const E=new u.a8(m,{now:y,fadeDuration:o,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),C=E.crossFadingFactor();C===1&&C===this._crossFadingFactor||(h=!0,this._crossFadingFactor=C),this.style.update(E)}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.bc.mark(u.bd.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.bc.mark(u.bd.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.bc.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.bc.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 kf}getCameraTargetElevation(){return this.transform.elevation}},f.MapMouseEvent=oo,f.MapTouchEvent=Ps,f.MapWheelEvent=If,f.Marker=Wu,f.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({},Df,_),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 Rf(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}},f.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=>{var h;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 C of this.options.className.split(" "))this._container.classList.add(C);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._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?th(this._lngLat,this._flatPos,this._map.transform):(h=this._lngLat)===null||h===void 0?void 0:h.wrap(),this._trackPointer&&!o)return;const d=this._flatPos=this._pos=this._trackPointer&&o?o:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&o?o:this._map.transform.locationPoint(this._lngLat));let m=this.options.anchor;const y=oh(this.options.offset);if(!m){const C=this._container.offsetWidth,M=this._container.offsetHeight;let k;k=d.y+y.bottom.ythis._map.transform.height-M?["bottom"]:[],d.xthis._map.transform.width-C/2&&k.push("right"),m=k.length===0?"bottom":k.join("-")}let E=d.add(y[m]);this.options.subpixelPositioning||(E=E.round()),A.setTransform(this._container,`${Zu[m]} translate(${E.x}px,${E.y}px)`),eh(this._container,m,"popup")},this._onClose=()=>{this.remove()},this.options=u.e(Object.create(Nf),_)}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._flatPos=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._flatPos=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(_)}setSubpixelPositioning(_){this.options.subpixelPositioning=_}_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(zf);_&&_.focus()}},f.RasterDEMTileSource=We,f.RasterTileSource=Mt,f.ScaleControl=class{constructor(_){this._onMove=()=>{rh(this._map,this._container,this.options)},this.setUnit=o=>{this.options.unit=o,rh(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},ih),_)}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}},f.ScrollZoomHandler=Jc,f.Style=Io,f.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}},f.TwoFingersTouchPitchHandler=Td,f.TwoFingersTouchRotateHandler=Cf,f.TwoFingersTouchZoomHandler=Cd,f.TwoFingersTouchZoomRotateHandler=Vu,f.VectorTileSource=An,f.VideoSource=wo,f.addSourceType=(_,o)=>u._(void 0,void 0,void 0,function*(){if(Ca(_))throw new Error(`A source type called "${_}" already exists.`);((h,d)=>{Ts[h]=d})(_,o)}),f.clearPrewarmedResources=function(){const _=dn;_&&(_.isPreloaded()&&_.numActive()===1?(_.release(Ie),dn=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()"))},f.getMaxParallelImageRequests=function(){return u.a.MAX_PARALLEL_IMAGE_REQUESTS},f.getRTLTextPluginStatus=function(){return te().getRTLTextPluginStatus()},f.getVersion=function(){return Dd},f.getWorkerCount=function(){return sn.workerCount},f.getWorkerUrl=function(){return u.a.WORKER_URL},f.importScriptInWorkers=function(_){return Ci().broadcast("IS",_)},f.prewarm=function(){Pn().acquire(Ie)},f.setMaxParallelImageRequests=function(_){u.a.MAX_PARALLEL_IMAGE_REQUESTS=_},f.setRTLTextPlugin=function(_,o){return te().setRTLTextPlugin(_,o)},f.setWorkerCount=function(_){sn.workerCount=_},f.setWorkerUrl=function(_){u.a.WORKER_URL=_}});var c=n;return c})})(px);var hS=px.exports;const ds=hx(hS);function Q0(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 fS(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 pS(t){return t===!0?["has","point_count"]:t===!1?["!",["has","point_count"]]:void 0}function $0(t,e){return["case",["boolean",["feature-state","hover"],!1],e,t]}var ec=dS;function dS(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||(Rt(i),n=!0)},o(s){Wt(i),n=!1},d(s){s&&Vt(e),i&&i.d(s)}}}function gS(t,e,n){let i,s,c,f,u,v,w,I,L,A,U,z,{$$slots:K={},$$scope:J}=e,{id:Q=Rm("layer")}=e,{source:O=void 0}=e,{sourceLayer:G=void 0}=e,{beforeId:j=void 0}=e,{beforeLayerType:lt=void 0}=e,{type:xt}=e,{paint:dt=void 0}=e,{layout:ht=void 0}=e,{filter:ct=void 0}=e,{applyToClusters:Pt=void 0}=e,{minzoom:$=void 0}=e,{maxzoom:Lt=void 0}=e,{manageHoverState:ee=!1}=e,{hovered:Tt=null}=e,{interactive:re=!0}=e,{hoverCursor:_e=void 0}=e,{eventsIfTopMost:qt=!1}=e;const Ne=wu(),{map:Ce,source:pn,self:Ve,minzoom:Ie,maxzoom:sn,eventTopMost:In,layerInfo:dn}=uS();qe(t,Ce,mt=>n(31,L=mt)),qe(t,pn,mt=>n(32,A=mt)),qe(t,Ve,mt=>n(0,I=mt)),qe(t,Ie,mt=>n(34,z=mt)),qe(t,sn,mt=>n(33,U=mt)),_s(()=>{I&&L&&(dn.delete(I),L==null||L.removeLayer(I))});let mn;function Pn(mt){var Mt,We;if(!re||!I||!L||qt&&In(mt)!==I)return;let St=mt.features??[],xe=(We=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:We.cluster_id,An={event:mt,map:L,clusterId:xe,layer:I,source:u,features:St};Ne(mt.type,An)}function gi(mt){var Mt,We;if(!re||!I||!L||qt&&In(mt)!==I)return;_e&&(L.getCanvas().style.cursor=_e);let St=mt.features??[];n(6,Tt=St[0]??null);let xe=(We=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:We.cluster_id;Ne("mouseenter",{event:mt,map:L,clusterId:xe,layer:I,source:u,features:St})}function Ci(mt){var Mt,We,Ti;if(!re||!L)return;if(qt&&In(mt)!==I){n(6,Tt=null),ee&&mn!==void 0&&(L==null||L.setFeatureState({source:u,sourceLayer:G,id:mn},{hover:!1}),mn=void 0);return}L.getCanvas().style.cursor=_e;let St=mt.features??[],xe=(We=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:We.cluster_id,An=(Ti=St[0])==null?void 0:Ti.id;An!==mn&&(ee&&(mn!==void 0&&(L==null||L.setFeatureState({source:u,id:mn,sourceLayer:G},{hover:!1})),L==null||L.setFeatureState({source:u,id:An,sourceLayer:G},{hover:!0})),mn=An,n(6,Tt=St[0]??null)),Ne("mousemove",{event:mt,map:L,clusterId:xe,layer:I,source:u,features:St})}function _i(mt){if(!(!re||!I||!L)){if(_e&&(L.getCanvas().style.cursor=""),n(6,Tt=null),ee&&mn!==void 0){const St={source:u,id:mn,sourceLayer:G};L==null||L.setFeatureState(St,{hover:!1}),mn=void 0}Ne("mouseleave",{map:L,layer:I,source:u})}}let li=!0;function Kt(mt){L&&(L.off("click",mt,Pn),L.off("dblclick",mt,Pn),L.off("contextmenu",mt,Pn),L.off("mouseenter",mt,gi),L.off("mousemove",mt,Ci),L.off("mouseleave",mt,_i))}return _s(()=>{L&&I&&Kt(I)}),t.$$set=mt=>{"id"in mt&&n(7,Q=mt.id),"source"in mt&&n(8,O=mt.source),"sourceLayer"in mt&&n(9,G=mt.sourceLayer),"beforeId"in mt&&n(10,j=mt.beforeId),"beforeLayerType"in mt&&n(11,lt=mt.beforeLayerType),"type"in mt&&n(12,xt=mt.type),"paint"in mt&&n(13,dt=mt.paint),"layout"in mt&&n(14,ht=mt.layout),"filter"in mt&&n(15,ct=mt.filter),"applyToClusters"in mt&&n(16,Pt=mt.applyToClusters),"minzoom"in mt&&n(17,$=mt.minzoom),"maxzoom"in mt&&n(18,Lt=mt.maxzoom),"manageHoverState"in mt&&n(19,ee=mt.manageHoverState),"hovered"in mt&&n(6,Tt=mt.hovered),"interactive"in mt&&n(20,re=mt.interactive),"hoverCursor"in mt&&n(21,_e=mt.hoverCursor),"eventsIfTopMost"in mt&&n(22,qt=mt.eventsIfTopMost),"$$scope"in mt&&n(35,J=mt.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&65536&&n(30,i=pS(Pt)),t.$$.dirty[0]&1073774592&&n(24,s=fS("all",i,ct)),t.$$.dirty[0]&131072|t.$$.dirty[1]&8&&n(26,c=$??z),t.$$.dirty[0]&262144|t.$$.dirty[1]&4&&n(25,f=Lt??U),t.$$.dirty[0]&256|t.$$.dirty[1]&2&&n(29,u=O||A),t.$$.dirty[0]&654343809|t.$$.dirty[1]&1&&L&&I!==Q&&u){I&&(Kt(I),dn.delete(I));let mt=j;if(!j&<){let St=L.getStyle().layers,xe=typeof lt=="function"?lt:Mt=>Mt.type===lt,An=St==null?void 0:St.find(xe);An&&(mt=An.id)}Jn(Ve,I=Q,I),L.addLayer(ec({id:I,type:xt,source:u,"source-layer":G,filter:s,paint:dt,layout:ht,minzoom:c,maxzoom:f}),mt),n(23,li=!0),L.on("click",I,Pn),L.on("dblclick",I,Pn),L.on("contextmenu",I,Pn),L.on("mouseenter",I,gi),L.on("mousemove",I,Ci),L.on("mouseleave",I,_i)}t.$$.dirty[0]&1048577&&I&&dn.set(I,{interactive:re}),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(28,v=I?Q0((mt,St)=>L==null?void 0:L.setPaintProperty(I,mt,St)):void 0),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(27,w=I?Q0((mt,St)=>L==null?void 0:L.setLayoutProperty(I,mt,St)):void 0),t.$$.dirty[0]&268443648&&(v==null||v(dt)),t.$$.dirty[0]&134234112&&(w==null||w(ht)),t.$$.dirty[0]&100663297|t.$$.dirty[1]&1&&I&&(L==null||L.setLayerZoomRange(I,c,f)),t.$$.dirty[0]&25165825|t.$$.dirty[1]&1&&I&&(li?n(23,li=!1):L==null||L.setFilter(I,s))},[I,Ce,pn,Ve,Ie,sn,Tt,Q,O,G,j,lt,xt,dt,ht,ct,Pt,$,Lt,ee,re,_e,qt,li,s,f,c,w,v,u,i,L,A,U,z,J,K]}let mx=class extends fn{constructor(e){super(),hn(this,e,gS,mS,en,{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 _S(t){let e;const n=t[15].default,i=wr(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)&&Ir(i,n,s,s[23],e?Sr(n,s[23],c,null):Er(s[23]),null)},i(s){e||(Rt(i,s),e=!0)},o(s){Wt(i,s),e=!1},d(s){i&&i.d(s)}}}function yS(t){let e,n,i;function s(f){t[16](f)}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:[_S]},$$scope:{ctx:t}};return t[0]!==void 0&&(c.hovered=t[0]),e=new mx({props:c}),Cr.push(()=>hu(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(){Ae(e.$$.fragment)},m(f,u){Me(e,f,u),i=!0},p(f,[u]){const v={};u&2&&(v.id=f[1]),u&4&&(v.source=f[2]),u&8&&(v.sourceLayer=f[3]),u&16&&(v.beforeId=f[4]),u&32&&(v.beforeLayerType=f[5]),u&64&&(v.paint=f[6]),u&128&&(v.layout=f[7]),u&256&&(v.filter=f[8]),u&512&&(v.minzoom=f[9]),u&1024&&(v.maxzoom=f[10]),u&2048&&(v.hoverCursor=f[11]),u&4096&&(v.manageHoverState=f[12]),u&8192&&(v.eventsIfTopMost=f[13]),u&16384&&(v.interactive=f[14]),u&8388608&&(v.$$scope={dirty:u,ctx:f}),!n&&u&1&&(n=!0,v.hovered=f[0],cu(()=>n=!1)),e.$set(v)},i(f){i||(Rt(e.$$.fragment,f),i=!0)},o(f){Wt(e.$$.fragment,f),i=!1},d(f){Pe(e,f)}}}function vS(t,e,n){let{$$slots:i={},$$scope:s}=e,{id:c=Rm("fill")}=e,{source:f=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:v=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:I}=e,{layout:L=void 0}=e,{filter:A=void 0}=e,{minzoom:U=void 0}=e,{maxzoom:z=void 0}=e,{hoverCursor:K=void 0}=e,{manageHoverState:J=!1}=e,{hovered:Q=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function j($){Q=$,n(0,Q)}function lt($){Nn.call(this,t,$)}function xt($){Nn.call(this,t,$)}function dt($){Nn.call(this,t,$)}function ht($){Nn.call(this,t,$)}function ct($){Nn.call(this,t,$)}function Pt($){Nn.call(this,t,$)}return t.$$set=$=>{"id"in $&&n(1,c=$.id),"source"in $&&n(2,f=$.source),"sourceLayer"in $&&n(3,u=$.sourceLayer),"beforeId"in $&&n(4,v=$.beforeId),"beforeLayerType"in $&&n(5,w=$.beforeLayerType),"paint"in $&&n(6,I=$.paint),"layout"in $&&n(7,L=$.layout),"filter"in $&&n(8,A=$.filter),"minzoom"in $&&n(9,U=$.minzoom),"maxzoom"in $&&n(10,z=$.maxzoom),"hoverCursor"in $&&n(11,K=$.hoverCursor),"manageHoverState"in $&&n(12,J=$.manageHoverState),"hovered"in $&&n(0,Q=$.hovered),"eventsIfTopMost"in $&&n(13,O=$.eventsIfTopMost),"interactive"in $&&n(14,G=$.interactive),"$$scope"in $&&n(23,s=$.$$scope)},[Q,c,f,u,v,w,I,L,A,U,z,K,J,O,G,i,j,lt,xt,dt,ht,ct,Pt,s]}let xS=class extends fn{constructor(e){super(),hn(this,e,vS,yS,en,{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 bS(t,e,n){let i;const{map:s}=Kh();qe(t,s,v=>n(4,i=v));let{position:c="top-left"}=e,{container:f=void 0}=e,u=null;return _s(()=>{i!=null&&i.loaded()&&u&&i.removeControl(u)}),t.$$set=v=>{"position"in v&&n(1,c=v.position),"container"in v&&n(2,f=v.container)},t.$$.update=()=>{if(t.$$.dirty&30&&i&&!u){let v;typeof f=="string"?v=document.querySelector(f)??void 0:v=f,n(3,u=new ds.FullscreenControl({container:v})),i.addControl(u,c)}},[s,c,f,u,i]}class wS extends fn{constructor(e){super(),hn(this,e,bS,null,en,{position:1,container:2})}}function SS(t,e,n,i,s){let c=!1;t.getSource(e)&&(c=!0,t.removeSource(e));const f=()=>{i(e)&&(t.addSource(e,n),s())};if(c){const u=()=>{e&&(t.getSource(e)?setTimeout(u,1):f())};u()}else f()}function IS(t,e,n){ox().then(()=>{let i=ex(t);if(!i)return;i.getSource(e)===n&&i.removeSource(e)})}function nv(t){let e=t[0],n,i,s=iv(t);return{c(){s.c(),n=bo()},m(c,f){s.m(c,f),Ut(c,n,f),i=!0},p(c,f){f&1&&en(e,e=c[0])?(ri(),Wt(s,1,1,Oe),oi(),s=iv(c),s.c(),Rt(s,1),s.m(n.parentNode,n)):s.p(c,f)},i(c){i||(Rt(s),i=!0)},o(c){Wt(s),i=!1},d(c){c&&Vt(n),s.d(c)}}}function iv(t){let e;const n=t[15].default,i=wr(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)&&Ir(i,n,s,s[14],e?Sr(n,s[14],c,null):Er(s[14]),null)},i(s){e||(Rt(i,s),e=!0)},o(s){Wt(i,s),e=!1},d(s){i&&i.d(s)}}}function ES(t){let e,n,i=t[0]&&nv(t);return{c(){i&&i.c(),e=bo()},m(s,c){i&&i.m(s,c),Ut(s,e,c),n=!0},p(s,[c]){s[0]?i?(i.p(s,c),c&1&&Rt(i,1)):(i=nv(s),i.c(),Rt(i,1),i.m(e.parentNode,e)):i&&(ri(),Wt(i,1,1,()=>{i=null}),oi())},i(s){n||(Rt(i),n=!0)},o(s){Wt(i),n=!1},d(s){s&&Vt(e),i&&i.d(s)}}}function CS(t,e,n){let i,s,c,{$$slots:f={},$$scope:u}=e,{id:v=Rm("geojson")}=e,{data:w}=e,{generateId:I=!1}=e,{promoteId:L=void 0}=e,{filter:A=void 0}=e,{lineMetrics:U=void 0}=e,{cluster:z=void 0}=e;const{map:K,cluster:J,self:Q}=lS();qe(t,K,j=>n(13,s=j)),qe(t,J,j=>n(16,c=j)),qe(t,Q,j=>n(0,i=j));let O,G=!0;return _s(()=>{i&&O&&s&&(IS(K,i,O),Jn(Q,i=null,i),n(11,O=void 0))}),t.$$set=j=>{"id"in j&&n(4,v=j.id),"data"in j&&n(5,w=j.data),"generateId"in j&&n(6,I=j.generateId),"promoteId"in j&&n(7,L=j.promoteId),"filter"in j&&n(8,A=j.filter),"lineMetrics"in j&&n(9,U=j.lineMetrics),"cluster"in j&&n(10,z=j.cluster),"$$scope"in j&&n(14,u=j.$$scope)},t.$$.update=()=>{t.$$.dirty&1024&&Jn(J,c=z,c),t.$$.dirty&12273&&s&&i!==v&&(Jn(Q,i=v,i),SS(s,i,ec({type:"geojson",data:w,filter:A,lineMetrics:U,generateId:I,promoteId:L,cluster:!!z,clusterMinPoints:z==null?void 0:z.minPoints,clusterMaxZoom:z==null?void 0:z.maxZoom,clusterRadius:z==null?void 0:z.radius,clusterProperties:z==null?void 0:z.properties}),j=>s&&j===i,()=>{i&&(n(11,O=s==null?void 0:s.getSource(i)),n(12,G=!0))})),t.$$.dirty&8208&&(s==null||s.on("style.load",()=>{n(11,O=s==null?void 0:s.getSource(v))})),t.$$.dirty&6176&&O&&(G?n(12,G=!1):O.setData(w)),t.$$.dirty&3072&&(O==null||O.setClusterOptions(ec({cluster:!!z,clusterMaxZoom:z==null?void 0:z.maxZoom,clusterRadius:z==null?void 0:z.radius})))},[i,K,J,Q,v,w,I,L,A,U,z,O,G,s,u,f]}let Jh=class extends fn{constructor(e){super(),hn(this,e,CS,ES,en,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10})}};function TS(t,e,n){let i;const{map:s}=Kh();qe(t,s,A=>n(8,i=A));let{position:c="top-left"}=e,{positionOptions:f=void 0}=e,{fitBoundsOptions:u=void 0}=e,{trackUserLocation:v=!1}=e,{showAccuracyCircle:w=!0}=e,{showUserLocation:I=!0}=e,L=null;return _s(()=>{i!=null&&i.loaded()&&L&&i.removeControl(L)}),t.$$set=A=>{"position"in A&&n(1,c=A.position),"positionOptions"in A&&n(2,f=A.positionOptions),"fitBoundsOptions"in A&&n(3,u=A.fitBoundsOptions),"trackUserLocation"in A&&n(4,v=A.trackUserLocation),"showAccuracyCircle"in A&&n(5,w=A.showAccuracyCircle),"showUserLocation"in A&&n(6,I=A.showUserLocation)},t.$$.update=()=>{t.$$.dirty&510&&i&&!L&&(n(7,L=new ds.GeolocateControl({positionOptions:f,fitBoundsOptions:u,trackUserLocation:v,showAccuracyCircle:w,showUserLocation:I})),i.addControl(L,c))},[s,c,f,u,v,w,I,L,i]}class LS extends fn{constructor(e){super(),hn(this,e,TS,null,en,{position:1,positionOptions:2,fitBoundsOptions:3,trackUserLocation:4,showAccuracyCircle:5,showUserLocation:6})}}function MS(t){let e;const n=t[15].default,i=wr(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)&&Ir(i,n,s,s[23],e?Sr(n,s[23],c,null):Er(s[23]),null)},i(s){e||(Rt(i,s),e=!0)},o(s){Wt(i,s),e=!1},d(s){i&&i.d(s)}}}function PS(t){let e,n,i;function s(f){t[16](f)}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:[MS]},$$scope:{ctx:t}};return t[0]!==void 0&&(c.hovered=t[0]),e=new mx({props:c}),Cr.push(()=>hu(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(){Ae(e.$$.fragment)},m(f,u){Me(e,f,u),i=!0},p(f,[u]){const v={};u&2&&(v.id=f[1]),u&4&&(v.source=f[2]),u&8&&(v.sourceLayer=f[3]),u&16&&(v.beforeId=f[4]),u&32&&(v.beforeLayerType=f[5]),u&64&&(v.paint=f[6]),u&128&&(v.layout=f[7]),u&256&&(v.filter=f[8]),u&512&&(v.minzoom=f[9]),u&1024&&(v.maxzoom=f[10]),u&2048&&(v.hoverCursor=f[11]),u&4096&&(v.manageHoverState=f[12]),u&8192&&(v.eventsIfTopMost=f[13]),u&16384&&(v.interactive=f[14]),u&8388608&&(v.$$scope={dirty:u,ctx:f}),!n&&u&1&&(n=!0,v.hovered=f[0],cu(()=>n=!1)),e.$set(v)},i(f){i||(Rt(e.$$.fragment,f),i=!0)},o(f){Wt(e.$$.fragment,f),i=!1},d(f){Pe(e,f)}}}function AS(t,e,n){let{$$slots:i={},$$scope:s}=e,{id:c=Rm("line")}=e,{source:f=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:v=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:I}=e,{layout:L=void 0}=e,{filter:A=void 0}=e,{minzoom:U=void 0}=e,{maxzoom:z=void 0}=e,{hoverCursor:K=void 0}=e,{manageHoverState:J=!1}=e,{hovered:Q=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function j($){Q=$,n(0,Q)}function lt($){Nn.call(this,t,$)}function xt($){Nn.call(this,t,$)}function dt($){Nn.call(this,t,$)}function ht($){Nn.call(this,t,$)}function ct($){Nn.call(this,t,$)}function Pt($){Nn.call(this,t,$)}return t.$$set=$=>{"id"in $&&n(1,c=$.id),"source"in $&&n(2,f=$.source),"sourceLayer"in $&&n(3,u=$.sourceLayer),"beforeId"in $&&n(4,v=$.beforeId),"beforeLayerType"in $&&n(5,w=$.beforeLayerType),"paint"in $&&n(6,I=$.paint),"layout"in $&&n(7,L=$.layout),"filter"in $&&n(8,A=$.filter),"minzoom"in $&&n(9,U=$.minzoom),"maxzoom"in $&&n(10,z=$.maxzoom),"hoverCursor"in $&&n(11,K=$.hoverCursor),"manageHoverState"in $&&n(12,J=$.manageHoverState),"hovered"in $&&n(0,Q=$.hovered),"eventsIfTopMost"in $&&n(13,O=$.eventsIfTopMost),"interactive"in $&&n(14,G=$.interactive),"$$scope"in $&&n(23,s=$.$$scope)},[Q,c,f,u,v,w,I,L,A,U,z,K,J,O,G,i,j,lt,xt,dt,ht,ct,Pt,s]}let Vp=class extends fn{constructor(e){super(),hn(this,e,AS,PS,en,{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 kS(t,e,n){let i;const s=wu();let{layer:c=void 0}=e;const{map:f}=Kh();qe(t,f,I=>n(2,i=I));function u(I){s(I.type,{...I,map:f})}const v=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","contextmenu","mouseover","mouseout"],w=["click","dblclick","contextmenu","mousemove","movestart","moveend","zoomstart","zoom","zoomend"];return _s(()=>{if(i)if(c)for(const I of v)i.off(I,c,u);else for(const I of w)i.off(I,u)}),t.$$set=I=>{"layer"in I&&n(1,c=I.layer)},t.$$.update=()=>{if(t.$$.dirty&6&&i)if(c)for(const I of v)i.on(I,c,u);else for(const I of w)i.on(I,u)},[f,c,i]}class gx extends fn{constructor(e){super(),hn(this,e,kS,null,en,{layer:1})}}function DS(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,f=Math.round(e.lng*s)/s,u=`${n}/${c}/${f}`,v=t.getBearing(),w=t.getPitch();return(v||w)&&(u+=`/${Math.round(v*10)/10}`),w&&(u+=`/${Math.round(w)}`),`#${u}`}function RS(t){return t.replace("#","").split("/").map(parseFloat)}var im=W_;function W_(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)?rv(t,e):{}.toString.call(t)=="[object Set]"?rv(Array.from(t),Array.from(e)):{}.toString.call(t)=="[object Object]"?zS(t,e):NS(t,e)}function NS(t,e){return t.toString()===e.toString()}function rv(t,e){var n=t.length;if(n!=e.length)return!1;for(var i=0;in(6,i=I));let{position:c="top-left"}=e,{showCompass:f=!0}=e,{showZoom:u=!0}=e,{visualizePitch:v=!1}=e,w=null;return _s(()=>{i!=null&&i.loaded()&&w&&i.removeControl(w)}),t.$$set=I=>{"position"in I&&n(1,c=I.position),"showCompass"in I&&n(2,f=I.showCompass),"showZoom"in I&&n(3,u=I.showZoom),"visualizePitch"in I&&n(4,v=I.visualizePitch)},t.$$.update=()=>{t.$$.dirty&126&&i&&!w&&(n(5,w=new ds.NavigationControl({showCompass:f,showZoom:u,visualizePitch:v})),i.addControl(w,c))},[s,c,f,u,v,w,i]}class FS extends fn{constructor(e){super(),hn(this,e,OS,null,en,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function BS(t,e,n){let i;const{map:s}=Kh();qe(t,s,w=>n(5,i=w));let{position:c="bottom-left"}=e,{maxWidth:f=void 0}=e,{unit:u="metric"}=e,v=null;return _s(()=>{i!=null&&i.loaded()&&v&&i.removeControl(v)}),t.$$set=w=>{"position"in w&&n(1,c=w.position),"maxWidth"in w&&n(2,f=w.maxWidth),"unit"in w&&n(3,u=w.unit)},t.$$.update=()=>{t.$$.dirty&62&&i&&!v&&(n(4,v=new ds.ScaleControl({maxWidth:f,unit:u})),i.addControl(v,c))},[s,c,f,u,v,i]}class VS extends fn{constructor(e){super(),hn(this,e,BS,null,en,{position:1,maxWidth:2,unit:3})}}const{window:US}=B2,GS=t=>({map:t[0]&16,loadedImages:t[0]&32,allImagesLoaded:t[0]&64}),ov=t=>({map:t[4],loadedImages:t[5],allImagesLoaded:t[6]});function sv(t){let e,n,i=t[3]&&av(t);const s=t[39].default,c=wr(s,t,t[38],ov);return{c(){i&&i.c(),e=fe(),c&&c.c()},m(f,u){i&&i.m(f,u),Ut(f,e,u),c&&c.m(f,u),n=!0},p(f,u){f[3]?i?(i.p(f,u),u[0]&8&&Rt(i,1)):(i=av(f),i.c(),Rt(i,1),i.m(e.parentNode,e)):i&&(ri(),Wt(i,1,1,()=>{i=null}),oi()),c&&c.p&&(!n||u[0]&112|u[1]&128)&&Ir(c,s,f,f[38],n?Sr(s,f[38],u,GS):Er(f[38]),ov)},i(f){n||(Rt(i),Rt(c,f),n=!0)},o(f){Wt(i),Wt(c,f),n=!1},d(f){f&&Vt(e),i&&i.d(f),c&&c.d(f)}}}function av(t){let e,n,i,s,c,f,u,v;return e=new FS({props:{position:t[7]}}),i=new LS({props:{position:t[7],fitBoundsOptions:{maxZoom:12}}}),c=new wS({props:{position:t[7]}}),u=new VS({props:{position:t[7]}}),{c(){Ae(e.$$.fragment),n=fe(),Ae(i.$$.fragment),s=fe(),Ae(c.$$.fragment),f=fe(),Ae(u.$$.fragment)},m(w,I){Me(e,w,I),Ut(w,n,I),Me(i,w,I),Ut(w,s,I),Me(c,w,I),Ut(w,f,I),Me(u,w,I),v=!0},p(w,I){const L={};I[0]&128&&(L.position=w[7]),e.$set(L);const A={};I[0]&128&&(A.position=w[7]),i.$set(A);const U={};I[0]&128&&(U.position=w[7]),c.$set(U);const z={};I[0]&128&&(z.position=w[7]),u.$set(z)},i(w){v||(Rt(e.$$.fragment,w),Rt(i.$$.fragment,w),Rt(c.$$.fragment,w),Rt(u.$$.fragment,w),v=!0)},o(w){Wt(e.$$.fragment,w),Wt(i.$$.fragment,w),Wt(c.$$.fragment,w),Wt(u.$$.fragment,w),v=!1},d(w){w&&(Vt(n),Vt(s),Vt(f)),Pe(e,w),Pe(i,w),Pe(c,w),Pe(u,w)}}}function qS(t){let e,n,i,s,c,f=t[4]&&t[0]&&sv(t);return{c(){e=jt("div"),f&&f.c(),Zt(e,"class",n=gm(t[2])+" svelte-p00lfq"),Zt(e,"data-testid","map-container"),Za(e,"expand-map",!t[2])},m(u,v){Ut(u,e,v),f&&f.m(e,null),t[40](e),i=!0,s||(c=[$e(US,"hashchange",t[11]),g_(t[10].call(null,e))],s=!0)},p(u,v){u[4]&&u[0]?f?(f.p(u,v),v[0]&17&&Rt(f,1)):(f=sv(u),f.c(),Rt(f,1),f.m(e,null)):f&&(ri(),Wt(f,1,1,()=>{f=null}),oi()),(!i||v[0]&4&&n!==(n=gm(u[2])+" svelte-p00lfq"))&&Zt(e,"class",n),(!i||v[0]&4)&&Za(e,"expand-map",!u[2])},i(u){i||(Rt(f),i=!0)},o(u){Wt(f),i=!1},d(u){u&&Vt(e),f&&f.d(),t[40](null),s=!1,yr(c)}}}function jS(t,e,n){let i,s,c,f,{$$slots:u={},$$scope:v}=e,{map:w=null}=e,{mapContainer:I=void 0}=e,{class:L=void 0}=e,{style:A}=e,{diffStyleUpdates:U=!1}=e,{center:z=void 0}=e,{zoom:K=void 0}=e,{pitch:J=0}=e,{bearing:Q=0}=e,{bounds:O=void 0}=e,{hash:G=!1}=e,{loaded:j=!1}=e,{minZoom:lt=0}=e,{maxZoom:xt=22}=e,{antialias:dt=void 0}=e,{zoomOnDoubleClick:ht=!0}=e,{locale:ct=void 0}=e,{interactive:Pt=!0}=e,{attributionControl:$=!0}=e,{cooperativeGestures:Lt=!1}=e,{preserveDrawingBuffer:ee=!1}=e,{maxBounds:Tt=void 0}=e,{images:re=[]}=e,{standardControls:_e=!1}=e,{filterLayers:qt=void 0}=e,{transformRequest:Ne=void 0}=e;const Ce=wu(),{map:pn,loadedImages:Ve}=aS();qe(t,pn,Kt=>n(4,c=Kt)),qe(t,Ve,Kt=>n(5,f=Kt));let Ie=new Set;async function sn(Kt,mt=!1){if(c&&!(!c.loaded()&&!mt))if("url"in Kt){Ie.add(Kt.id);try{let St=await c.loadImage(Kt.url);c==null||c.addImage(Kt.id,St.data,Kt.options),f.add(Kt.id),Ve.set(f)}catch(St){Ce("error",St)}finally{Ie.delete(Kt.id)}}else c.addImage(Kt.id,Kt.data,Kt.options),f.add(Kt.id),Ve.set(f)}let In,dn,mn,Pn;function gi(Kt){return _i(),Jn(pn,c=new ds.Map(ec({container:Kt,style:A,locale:ct,center:z,zoom:K,pitch:J,bearing:Q,minZoom:lt,maxZoom:xt,antialias:dt,interactive:Pt,preserveDrawingBuffer:ee,maxBounds:Tt,bounds:O,attributionControl:$,transformRequest:Ne,cooperativeGestures:Lt})),c),c.on("load",mt=>{mt.target.getContainer().setAttribute("data-testid","map"),mt.target.getCanvas().setAttribute("data-testid","map-canvas"),n(0,j=!0),Ce("load",c)}),c.on("error",mt=>Ce("error",{...mt,map:c})),c.on("movestart",mt=>Ce("movestart",{...mt,map:c})),c.on("moveend",mt=>{if(n(12,z=mt.target.getCenter()),n(13,K=mt.target.getZoom()),n(14,O=mt.target.getBounds()),Ce("moveend",{...mt,map:c}),G){let St=window.location.href.replace(/(#.+)?$/,DS(c));window.history.replaceState(window.history.state,"",St)}}),c.on("click",mt=>Ce("click",{...mt,map:c})),c.on("dblclick",mt=>Ce("dblclick",{...mt,map:c})),c.on("contextmenu",mt=>Ce("contextmenu",{...mt,map:c})),c.on("zoomstart",mt=>Ce("zoomstart",{...mt,map:c})),c.on("zoom",mt=>{n(13,K=mt.target.getZoom()),Ce("zoom",{...mt,map:c})}),c.on("zoomend",mt=>{n(13,K=mt.target.getZoom()),Ce("zoomend",{...mt,map:c})}),c.on("style.load",()=>{if(c){const mt=c.getStyle();if(n(35,In=mt.layers.map(St=>St.id)),n(36,dn=Object.keys(mt.sources)),Pn)for(const[St,xe]of Object.entries(Pn))c.addSource(St,xe);if(mn)for(const St of mn)c.addLayer(St);for(const St of re)sn(St,!0)}}),c.on("styledata",mt=>{if(c&&qt){const St=c.getStyle().layers;if(St)for(let xe of St)qt(xe)||c.setLayoutProperty(xe.id,"visibility","none")}Ce("styledata",{...mt,map:c})}),{destroy(){n(0,j=!1),c==null||c.remove(),Jn(pn,c=null,c)}}}let Ci=A;function _i(){if(G){let Kt=RS(window.location.hash);Kt.length>=3&&(n(13,K=Kt[0]),n(12,z=[Kt[2],Kt[1]])),Kt.length==5&&(n(17,Q=Kt[3]),n(16,J=Kt[4]))}}function li(Kt){Cr[Kt?"unshift":"push"](()=>{I=Kt,n(1,I)})}return t.$$set=Kt=>{"map"in Kt&&n(15,w=Kt.map),"mapContainer"in Kt&&n(1,I=Kt.mapContainer),"class"in Kt&&n(2,L=Kt.class),"style"in Kt&&n(18,A=Kt.style),"diffStyleUpdates"in Kt&&n(19,U=Kt.diffStyleUpdates),"center"in Kt&&n(12,z=Kt.center),"zoom"in Kt&&n(13,K=Kt.zoom),"pitch"in Kt&&n(16,J=Kt.pitch),"bearing"in Kt&&n(17,Q=Kt.bearing),"bounds"in Kt&&n(14,O=Kt.bounds),"hash"in Kt&&n(20,G=Kt.hash),"loaded"in Kt&&n(0,j=Kt.loaded),"minZoom"in Kt&&n(21,lt=Kt.minZoom),"maxZoom"in Kt&&n(22,xt=Kt.maxZoom),"antialias"in Kt&&n(23,dt=Kt.antialias),"zoomOnDoubleClick"in Kt&&n(24,ht=Kt.zoomOnDoubleClick),"locale"in Kt&&n(25,ct=Kt.locale),"interactive"in Kt&&n(26,Pt=Kt.interactive),"attributionControl"in Kt&&n(27,$=Kt.attributionControl),"cooperativeGestures"in Kt&&n(28,Lt=Kt.cooperativeGestures),"preserveDrawingBuffer"in Kt&&n(29,ee=Kt.preserveDrawingBuffer),"maxBounds"in Kt&&n(30,Tt=Kt.maxBounds),"images"in Kt&&n(31,re=Kt.images),"standardControls"in Kt&&n(3,_e=Kt.standardControls),"filterLayers"in Kt&&n(32,qt=Kt.filterLayers),"transformRequest"in Kt&&n(33,Ne=Kt.transformRequest),"$$scope"in Kt&&n(38,v=Kt.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&8&&n(7,i=typeof _e=="boolean"?void 0:_e),t.$$.dirty[0]&16&&n(15,w=c),t.$$.dirty[0]&786448|t.$$.dirty[1]&112&&c&&!im(A,Ci)){const Kt=c.getStyle();if(In&&(mn=Kt.layers.filter(mt=>!In.includes(mt.id))),dn){const mt=Object.keys(Kt.sources).filter(St=>!dn.includes(St));Pn={};for(const St of mt)Pn[St]=Kt.sources[St]}n(37,Ci=A),c.setStyle(A,{diff:U}),Jn(Ve,f=new Set,f),n(34,Ie=new Set)}if(t.$$.dirty[0]&49|t.$$.dirty[1]&9&&j&&c!=null&&c.loaded())for(let Kt of re)!f.has(Kt.id)&&!Ie.has(Kt.id)&&!c.hasImage(Kt.id)&&sn(Kt);t.$$.dirty[0]&32|t.$$.dirty[1]&1&&n(6,s=re.every(Kt=>f.has(Kt.id))),t.$$.dirty[0]&4112&&z&&!im(z,c==null?void 0:c.getCenter())&&(c==null||c.panTo(z)),t.$$.dirty[0]&8208&&K&&!im(K,c==null?void 0:c.getZoom())&&(c==null||c.zoomTo(K)),t.$$.dirty[0]&16400&&O&&!im(O,c==null?void 0:c.getBounds())&&(c==null||c.fitBounds(O)),t.$$.dirty[0]&16777232&&(ht?c==null||c.doubleClickZoom.enable():c==null||c.doubleClickZoom.disable())},[j,I,L,_e,c,f,s,i,pn,Ve,gi,_i,z,K,O,w,J,Q,A,U,G,lt,xt,dt,ht,ct,Pt,$,Lt,ee,Tt,re,qt,Ne,Ie,In,dn,Ci,v,u,li]}class ZS extends fn{constructor(e){super(),hn(this,e,jS,qS,en,{map:15,mapContainer:1,class:2,style:18,diffStyleUpdates:19,center:12,zoom:13,pitch:16,bearing:17,bounds:14,hash:20,loaded:0,minZoom:21,maxZoom:22,antialias:23,zoomOnDoubleClick:24,locale:25,interactive:26,attributionControl:27,cooperativeGestures:28,preserveDrawingBuffer:29,maxBounds:30,images:31,standardControls:3,filterLayers:32,transformRequest:33},null,[-1,-1])}}const WS=t=>({marker:t&8}),lv=t=>({marker:t[3]});function HS(t){let e,n,i,s,c,f,u;const v=t[19].default,w=wr(v,t,t[18],lv);return{c(){e=jt("div"),w&&w.c(),Zt(e,"tabindex",n=t[1]?0:void 0),Zt(e,"role",i=t[1]?"button":void 0),or(e,"z-index",t[2])},m(I,L){Ut(I,e,L),w&&w.m(e,null),c=!0,f||(u=[g_(t[7].call(null,e)),g_(s=XS.call(null,e,t[0])),$e(e,"click",r_(t[20])),$e(e,"dblclick",r_(t[21])),$e(e,"contextmenu",r_(t[22])),$e(e,"mouseenter",t[23]),$e(e,"mouseleave",t[24]),$e(e,"mousemove",t[25]),$e(e,"keydown",t[8])],f=!0)},p(I,[L]){w&&w.p&&(!c||L&262152)&&Ir(w,v,I,I[18],c?Sr(v,I[18],L,WS):Er(I[18]),lv),(!c||L&2&&n!==(n=I[1]?0:void 0))&&Zt(e,"tabindex",n),(!c||L&2&&i!==(i=I[1]?"button":void 0))&&Zt(e,"role",i),s&&Dm(s.update)&&L&1&&s.update.call(null,I[0]),L&4&&or(e,"z-index",I[2])},i(I){c||(Rt(w,I),c=!0)},o(I){Wt(w,I),c=!1},d(I){I&&Vt(e),w&&w.d(I),f=!1,yr(u)}}}function XS(t,e){const n=t.className;function i(s){s?t.className=`${n} ${s}`:t.className=n}return i(e),{update:i}}function YS(t,e,n){let i,s,c,{$$slots:f={},$$scope:u}=e,{marker:v=void 0}=e,{lngLat:w}=e,{class:I=void 0}=e,{interactive:L=!0}=e,{asButton:A=!1}=e,{draggable:U=!1}=e,{feature:z=null}=e,{offset:K=void 0}=e,{zIndex:J=void 0}=e,{rotation:Q=0}=e,{opacity:O=1}=e;const G=wu(),{map:j,layerEvent:lt,self:xt}=cS();qe(t,j,qt=>n(27,c=qt)),qe(t,lt,qt=>n(26,i=qt)),qe(t,xt,qt=>n(3,s=qt));function dt(qt){Jn(xt,s=new ds.Marker({element:qt,rotation:Q,draggable:U,offset:K,opacity:O.toString()}).setLngLat(w).addTo(c),s),n(11,v=s);const Ne=()=>Pt("dragstart"),Ce=()=>{ht(),Pt("drag")},pn=()=>{ht(),Pt("dragend")};return U&&(s.on("dragstart",Ne),s.on("drag",Ce),s.on("dragend",pn)),{destroy(){U&&(s==null||s.off("dragstart",Ne),s==null||s.off("drag",Ce),s==null||s.off("dragend",pn)),n(11,v=void 0),s==null||s.remove()}}}function ht(){let qt=s==null?void 0:s.getLngLat();qt&&(Array.isArray(w)?n(10,w=[qt.lng,qt.lat]):w&&"lon"in w?n(10,w={lon:qt.lng,lat:qt.lat}):n(10,w=qt))}function ct(qt){qt.key===" "&&(qt.preventDefault(),qt.stopPropagation(),Pt("click"))}function Pt(qt){if(!L)return;let Ne=s==null?void 0:s.getLngLat();if(!Ne)return;const Ce=[Ne.lng,Ne.lat];let pn={map:c,marker:s,lngLat:Ce,features:[{type:"Feature",properties:(z==null?void 0:z.properties)??{},geometry:{type:"Point",coordinates:Ce}}]};Jn(lt,i={...pn,layerType:"marker",type:qt},i),G(qt,pn)}const $=()=>Pt("click"),Lt=()=>Pt("dblclick"),ee=()=>Pt("contextmenu"),Tt=qt=>{Pt("mouseenter")},re=()=>{Pt("mouseleave")},_e=()=>Pt("mousemove");return t.$$set=qt=>{"marker"in qt&&n(11,v=qt.marker),"lngLat"in qt&&n(10,w=qt.lngLat),"class"in qt&&n(0,I=qt.class),"interactive"in qt&&n(12,L=qt.interactive),"asButton"in qt&&n(1,A=qt.asButton),"draggable"in qt&&n(13,U=qt.draggable),"feature"in qt&&n(14,z=qt.feature),"offset"in qt&&n(15,K=qt.offset),"zIndex"in qt&&n(2,J=qt.zIndex),"rotation"in qt&&n(16,Q=qt.rotation),"opacity"in qt&&n(17,O=qt.opacity),"$$scope"in qt&&n(18,u=qt.$$scope)},t.$$.update=()=>{t.$$.dirty&1032&&(s==null||s.setLngLat(w)),t.$$.dirty&32776&&(s==null||s.setOffset(K??[0,0])),t.$$.dirty&65544&&(s==null||s.setRotation(Q)),t.$$.dirty&131080&&(s==null||s.setOpacity(O.toString()))},[I,A,J,s,j,lt,xt,dt,ct,Pt,w,v,L,U,z,K,Q,O,u,f,$,Lt,ee,Tt,re,_e]}class uv extends fn{constructor(e){super(),hn(this,e,YS,HS,en,{marker:11,lngLat:10,class:0,interactive:12,asButton:1,draggable:13,feature:14,offset:15,zIndex:2,rotation:16,opacity:17})}}var Up=Uint8Array,_x=Uint16Array,KS=Int32Array,JS=new Up([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]),QS=new Up([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]),yx=function(t,e){for(var n=new _x(31),i=0;i<31;++i)n[i]=e+=1<>1|(jn&21845)<<1,vl=(vl&52428)>>2|(vl&13107)<<2,vl=(vl&61680)>>4|(vl&3855)<<4,eI[jn]=((vl&65280)>>8|(vl&255)<<8)>>1;var vl,jn,Nm=new Up(288);for(jn=0;jn<144;++jn)Nm[jn]=8;var jn;for(jn=144;jn<256;++jn)Nm[jn]=9;var jn;for(jn=256;jn<280;++jn)Nm[jn]=7;var jn;for(jn=280;jn<288;++jn)Nm[jn]=8;var jn,nI=new Up(32);for(jn=0;jn<32;++jn)nI[jn]=5;var jn,iI=new Up(0),rI=typeof TextDecoder<"u"&&new TextDecoder,oI=0;try{rI.decode(iI,{stream:!0}),oI=1}catch{}const ja={Footway:"black",Indoors:"grey",BridgeOrTunnel:"black",WithTraffic:"#4C3926",Crossing:"green",Severance:"red"},xx=["#CDE594","#80C6A3","#1F9EB7","#186290","#080C54"],bx=[1,4,7,10,13,15];const sI=t=>({}),cv=t=>({}),aI=t=>({}),hv=t=>({});function lI(t){let e,n,i,s;const c=t[1].left,f=wr(c,t,t[0],hv),u=t[1].main,v=wr(u,t,t[0],cv);return{c(){e=jt("div"),f&&f.c(),n=fe(),i=jt("div"),v&&v.c(),Zt(e,"class","left svelte-k43lgc"),Zt(i,"class","main svelte-k43lgc")},m(w,I){Ut(w,e,I),f&&f.m(e,null),Ut(w,n,I),Ut(w,i,I),v&&v.m(i,null),s=!0},p(w,[I]){f&&f.p&&(!s||I&1)&&Ir(f,c,w,w[0],s?Sr(c,w[0],I,aI):Er(w[0]),hv),v&&v.p&&(!s||I&1)&&Ir(v,u,w,w[0],s?Sr(u,w[0],I,sI):Er(w[0]),cv)},i(w){s||(Rt(f,w),Rt(v,w),s=!0)},o(w){Wt(f,w),Wt(v,w),s=!1},d(w){w&&(Vt(e),Vt(n),Vt(i)),f&&f.d(w),v&&v.d(w)}}}function uI(t,e,n){let{$$slots:i={},$$scope:s}=e;return t.$$set=c=>{"$$scope"in c&&n(0,s=c.$$scope)},[s,i]}class cI extends fn{constructor(e){super(),hn(this,e,uI,lI,en,{})}}var hI=Object.defineProperty,fI=(t,e,n)=>e in t?hI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fv=(t,e,n)=>(fI(t,typeof e!="symbol"?e+"":e,n),n);function bp(){}function wx(t){return t()}function pv(){return Object.create(null)}function zm(t){t.forEach(wx)}function Sx(t){return typeof t=="function"}function pI(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function dI(t){return Object.keys(t).length===0}function mI(t,e){t.appendChild(e)}function gI(t,e,n){t.insertBefore(e,n||null)}function Ix(t){t.parentNode&&t.parentNode.removeChild(t)}function dv(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 _I(t){return Array.from(t.childNodes)}function rm(t,e,n){t.classList.toggle(e,!!n)}let H_;function yp(t){H_=t}const Ih=[],mv=[];let Th=[];const gv=[],yI=Promise.resolve();let x_=!1;function vI(){x_||(x_=!0,yI.then(Ex))}function b_(t){Th.push(t)}const u_=new Set;let xh=0;function Ex(){if(xh!==0)return;const t=H_;do{try{for(;xht.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),Th=e}const wI=new Set;function SI(t,e){t&&t.i&&(wI.delete(t),t.i(e))}function II(t,e,n){const{fragment:i,after_update:s}=t.$$;i&&i.m(e,n),b_(()=>{const c=t.$$.on_mount.map(wx).filter(Sx);t.$$.on_destroy?t.$$.on_destroy.push(...c):zm(c),t.$$.on_mount=[]}),s.forEach(b_)}function EI(t,e){const n=t.$$;n.fragment!==null&&(bI(n.after_update),zm(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function CI(t,e){t.$$.dirty[0]===-1&&(Ih.push(t),vI(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const z=U.length?U[0]:A;return w.ctx&&s(w.ctx[L],w.ctx[L]=z)&&(!w.skip_bound&&w.bound[L]&&w.bound[L](z),I&&CI(t,L)),A}):[],w.update(),I=!0,zm(w.before_update),w.fragment=i?i(w.ctx):!1,e.target){if(e.hydrate){const L=_I(e.target);w.fragment&&w.fragment.l(L),L.forEach(Ix)}else w.fragment&&w.fragment.c();e.intro&&SI(t.$$.fragment),II(t,e.target,e.anchor),Ex()}yp(v)}class LI{constructor(){fv(this,"$$"),fv(this,"$$set")}$destroy(){EI(this,1),this.$destroy=bp}$on(e,n){if(!Sx(n))return bp;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&&!dI(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const MI="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(MI);function PI(t){let e,n,i;return{c(){e=dv("svg"),n=dv("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){gI(s,e,c),mI(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:bp,o:bp,d(s){s&&Ix(e)}}}function AI(t,e,n){let{displayIn:i}=e;return t.$$set=s=>{"displayIn"in s&&n(0,i=s.displayIn)},[i]}class kI extends LI{constructor(e){super(),TI(this,e,AI,PI,pI,{displayIn:0})}}const DI=[{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"}],RI={decimalLatitude:40.123,decimalLongitude:-74.123},NI=[{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}],zI=[{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 OI(){const t=[];return DI.forEach(e=>{e.decimalLatitude?t.push(e):t.push({...e,...RI})}),[...t,...NI,...zI]}const FI=OI();FI.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 BI(t,e){var n={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},i,s,c,f;return f={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function u(w){return function(I){return v([w,I])}}function v(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 c_(t,e,n,i){var s=new fu(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 _v(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 UI(t,e,n){return e===null?t:(t===null||(e=ru(t.key,e,n),e.left=t),e)}function w_(t,e,n,i,s){if(t){i(""+e+(n?"└── ":"├── ")+s(t)+` -`);var c=e+(n?" ":"│ ");t.left&&w_(t.left,c,!1,i,s),t.right&&w_(t.right,c,!0,i,s)}}var X_=function(){function t(e){e===void 0&&(e=VI),this._root=null,this._size=0,this._comparator=e}return t.prototype.insert=function(e,n){return this._size++,this._root=c_(e,n,this._root,this._comparator)},t.prototype.add=function(e,n){var i=new fu(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),f=s(e,c.key);return f===0?this._root=c:(f<0?(i.left=c.left,i.right=c,c.left=null):f>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=[],f=this._comparator,u=this._root,v;c.length!==0||u;)if(u)c.push(u),u=u.left;else{if(u=c.pop(),v=f(u.key,n),v>0)break;if(f(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 qI(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&&E_(e,n,0,s-1,c),this._root===null)this._root=S_(e,n,0,s),this._size=s;else{var f=jI(this.toList(),GI(e,n),c);s=this._size+s,this._root=I_({head:f},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 w_(this._root,"",!0,function(i){return n.push(i)},e),n.join("")},t.prototype.update=function(e,n,i){var s=this._comparator,c=_v(e,this._root,s),f=c.left,u=c.right;s(e,n)<0?u=c_(n,i,u,s):f=c_(n,i,f,s),this._root=UI(f,u,s)},t.prototype.split=function(e){return _v(e,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var e,n,i;return BI(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 S_(t,e,n,i){var s=i-n;if(s>0){var c=n+Math.floor(s/2),f=t[c],u=e[c],v=new fu(f,u);return v.left=S_(t,e,n,c),v.right=S_(t,e,c+1,i),v}return null}function GI(t,e){for(var n=new fu(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 I_(t,e,n){var i=n-e;if(i>0){var s=e+Math.floor(i/2),c=I_(t,e,s),f=t.head;return f.left=c,t.head=t.head.next,f.right=I_(t,s+1,n),f}return null}function jI(t,e,n){for(var i=new fu(null,null),s=i,c=t,f=e;c!==null&&f!==null;)n(c.key,f.key)<0?(s.next=c,c=c.next):(s.next=f,f=f.next),s=s.next;return c!==null?s.next=c:f!==null&&(s.next=f),i.next}function E_(t,e,n,i,s){if(!(n>=i)){for(var c=t[n+i>>1],f=n-1,u=i+1;;){do f++;while(s(t[f],c)<0);do u--;while(s(t[u],c)>0);if(f>=u)break;var v=t[f];t[f]=t[u],t[u]=v,v=e[f],e[f]=e[u],e[u]=v}E_(t,e,n,u,s),E_(t,e,u+1,i,s)}}function na(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yv(t,e){for(var n=0;nn.x?1:e.yn.y?1:0}}]);function t(e,n){na(this,t),e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=n}return No(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:v<0&&L<0?wA?1:0:Lv?1:0}}}]),t}(),KI=0,vm=function(){No(t,null,[{key:"compare",value:function(e,n){var i=e.leftSE.point.x,s=n.leftSE.point.x,c=e.rightSE.point.x,f=n.rightSE.point.x;if(fu&&v>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(uv&&u>I)return 1;var U=n.comparePoint(e.leftSE.point);if(U!==0)return U;var z=e.comparePoint(n.rightSE.point);return z<0?1:z>0?-1:1}if(uv)return 1;if(cf){var J=e.comparePoint(n.rightSE.point);if(J<0)return 1;if(J>0)return-1}if(c!==f){var Q=w-u,O=c-i,G=I-v,j=f-s;if(Q>O&&Gj)return-1}return c>f?1:cI?1:e.idn.id?1:0}}]);function t(e,n,i,s){na(this,t),this.id=++KI,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 No(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(),Ga.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 f=n;n=i,i=f}for(var u=0,v=i.rings.length;u0)s=n,c=e,f=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var v=new Ga(s,!0),w=new Ga(c,!1);return new t(v,w,[i],[f])}}]),t}(),Sv=function(){function t(e,n,i){if(na(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=wp.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,f=1,u=e.length;fthis.bbox.ur.x&&(this.bbox.ur.x=v.x),v.y>this.bbox.ur.y&&(this.bbox.ur.y=v.y),c=v)}(s.x!==c.x||s.y!==c.y)&&this.segments.push(vm.fromRing(c,s,this))}return No(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 No(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 No(t,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,i=this.polys.length;n0&&(e=s)}for(var c=e.segment.prevInResult(),f=c?c.prevInResult():null;;){if(!c)return null;if(!f)return c.ringOut;if(f.ringOut!==c.ringOut)return f.ringOut.enclosingRing()!==c.ringOut?c.ringOut:c.ringOut.enclosingRing();c=f.prevInResult(),f=c?c.prevInResult():null}}}]),t}(),Ev=function(){function t(e){na(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return No(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]:vm.compare;na(this,t),this.queue=e,this.tree=new X_(n),this.segments=[]}return No(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,f=s,u=void 0,v=void 0;u===void 0;)c=this.tree.prev(c),c===null?u=null:c.key.consumedBy===void 0&&(u=c.key);for(;v===void 0;)f=this.tree.next(f),f===null?v=null:f.key.consumedBy===void 0&&(v=f.key);if(e.isLeft){var w=null;if(u){var I=u.getIntersection(n);if(I!==null&&(n.isAnEndpoint(I)||(w=I),!u.isAnEndpoint(I)))for(var L=this._splitSafely(u,I),A=0,U=L.length;A0?(this.tree.remove(n),i.push(e)):(this.segments.push(n),n.prev=u)}else{if(u&&v){var ht=u.getIntersection(v);if(ht!==null){if(!u.isAnEndpoint(ht))for(var ct=this._splitSafely(u,ht),Pt=0,$=ct.length;Pt<$;Pt++)i.push(ct[Pt]);if(!v.isAnEndpoint(ht))for(var Lt=this._splitSafely(v,ht),ee=0,Tt=Lt.length;eeCv)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var j=new tE(z),lt=z.size,xt=z.pop();xt;){var dt=xt.key;if(z.size===lt){var ht=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(ht.id," ")+"[".concat(ht.leftSE.point.x,", ").concat(ht.leftSE.point.y,"] -> ")+"[".concat(ht.rightSE.point.x,", ").concat(ht.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(z.size>Cv)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(j.segments.length>eE)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var ct=j.process(dt),Pt=0,$=ct.length;Pt<$;Pt++){var Lt=ct[Pt];Lt.consumedBy===void 0&&z.insert(Lt)}lt=z.size,xt=z.pop()}wp.reset();var ee=QI.factory(j.segments),Tt=new $I(ee);return Tt.getGeom()}}]),t}(),pa=new nE,iE=function(t){for(var e=arguments.length,n=new Array(e>1?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};Ct.prototype.clone=function(){};Ct.prototype.copy=function(){return new Ct(this)};Ct.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};Ct.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)};Ct.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)};Ct.prototype.hashCode=function(){var t=17;return t=37*t+Ct.hashCode(this.x),t=37*t+Ct.hashCode(this.y),t};Ct.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z};Ct.prototype.interfaces_=function(){return[ns,Fm,is]};Ct.prototype.getClass=function(){return Ct};Ct.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=Ze.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}};gc.DimensionalComparator.get=function(){return wl};gc.serialVersionUID.get=function(){return 6683108902428367e3};gc.NULL_ORDINATE.get=function(){return Ze.NaN};gc.X.get=function(){return 0};gc.Y.get=function(){return 1};gc.Z.get=function(){return 2};Object.defineProperties(Ct,gc);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 f=wl.compare(n.z,i.z);return f};wl.prototype.interfaces_=function(){return[Lh]};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 Mh=function(){};Mh.prototype.create=function(){};Mh.prototype.interfaces_=function(){return[]};Mh.prototype.getClass=function(){return Mh};var At=function(){},Gp={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};At.prototype.interfaces_=function(){return[]};At.prototype.getClass=function(){return At};At.toLocationSymbol=function(t){switch(t){case At.EXTERIOR:return"e";case At.BOUNDARY:return"b";case At.INTERIOR:return"i";case At.NONE:return"-"}throw new Qn("Unknown location value: "+t)};Gp.INTERIOR.get=function(){return 0};Gp.BOUNDARY.get=function(){return 1};Gp.EXTERIOR.get=function(){return 2};Gp.NONE.get=function(){return-1};Object.defineProperties(At,Gp);var Be=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},zo=function(){},Rx={LOG_10:{configurable:!0}};zo.prototype.interfaces_=function(){return[]};zo.prototype.getClass=function(){return zo};zo.log10=function(t){var e=Math.log(t);return Ze.isInfinite(e)||Ze.isNaN(e)?e:e/zo.LOG_10};zo.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}};zo.wrap=function(t,e){return t<0?e- -t%e:t%e};zo.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],f=arguments[2],u=arguments[3],v=s;return c>v&&(v=c),f>v&&(v=f),u>v&&(v=u),v}};zo.average=function(t,e){return(t+e)/2};Rx.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(zo,Rx);var ia=function(t){this.str=t};ia.prototype.append=function(t){this.str+=t};ia.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)};ia.prototype.toString=function(t){return this.str};var Zs=function(t){this.value=t};Zs.prototype.intValue=function(){return this.value};Zs.prototype.compareTo=function(t){return this.valuet?1:0};Zs.isNaN=function(t){return Number.isNaN(t)};var Sp=function(){};Sp.isWhitespace=function(t){return t<=32&&t>=0||t===127};Sp.toUpperCase=function(t){return t.toUpperCase()};var Ot=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)}},Es={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}};Ot.prototype.le=function(t){return(this._hi9?(I=!0,L="9"):L="0"+w,f.append(L),n=n.subtract(Ot.valueOf(w)).multiply(Ot.TEN),I&&n.selfAdd(Ot.TEN);var A=!0,U=Ot.magnitude(n._hi);if(U<0&&Math.abs(U)>=u-v&&(A=!1),!A)break}return e[0]=i,f.toString()};Ot.prototype.sqr=function(){return this.multiply(this)};Ot.prototype.doubleValue=function(){return this._hi+this._lo};Ot.prototype.subtract=function(){if(arguments[0]instanceof Ot){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}};Ot.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}};Ot.prototype.isZero=function(){return this._hi===0&&this._lo===0};Ot.prototype.selfSubtract=function(){if(arguments[0]instanceof Ot){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)}};Ot.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};Ot.prototype.min=function(t){return this.le(t)?this:t};Ot.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Ot){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,f=null,u=null,v=null,w=null,I=null,L=null;return v=this._hi/n,w=Ot.SPLIT*v,s=w-v,L=Ot.SPLIT*n,s=w-s,c=v-s,f=L-n,I=v*n,f=L-f,u=n-f,L=s*f-I+s*u+c*f+c*u,w=(this._hi-I-L+this._lo-v*i)/n,L=v+w,this._hi=L,this._lo=v-L+w,this}};Ot.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};Ot.prototype.divide=function(){if(arguments[0]instanceof Ot){var t=arguments[0],e=null,n=null,i=null,s=null,c=null,f=null,u=null,v=null;c=this._hi/t._hi,f=Ot.SPLIT*c,e=f-c,v=Ot.SPLIT*t._hi,e=f-e,n=c-e,i=v-t._hi,u=c*t._hi,i=v-i,s=t._hi-i,v=e*i-u+e*s+n*i+n*s,f=(this._hi-u-v+this._lo-c*t._lo)/t._hi,v=c+f;var w=v,I=c-v+f;return new Ot(w,I)}else if(typeof arguments[0]=="number"){var L=arguments[0];return Ze.isNaN(L)?Ot.createNaN():Ot.copy(this).selfDivide(L,0)}};Ot.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo};Ot.prototype.pow=function(t){if(t===0)return Ot.valueOf(1);var e=new Ot(this),n=Ot.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};Ot.prototype.ceil=function(){if(this.isNaN())return Ot.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new Ot(t,e)};Ot.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0};Ot.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()};Ot.prototype.setValue=function(){if(arguments[0]instanceof Ot){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}};Ot.prototype.max=function(t){return this.ge(t)?this:t};Ot.prototype.sqrt=function(){if(this.isZero())return Ot.valueOf(0);if(this.isNegative())return Ot.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=Ot.valueOf(e),i=this.subtract(n.sqr()),s=i._hi*(t*.5);return n.add(s)};Ot.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Ot){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,f=null,u=null;return s=this._hi+e,f=s-this._hi,c=s-f,c=e-f+(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 v=arguments[0],w=arguments[1],I=null,L=null,A=null,U=null,z=null,K=null,J=null,Q=null;z=this._hi+v,A=this._lo+w,J=z-this._hi,Q=A-this._lo,K=z-J,U=A-Q,K=v-J+(this._hi-K),U=w-Q+(this._lo-U),J=K+A,I=z+J,L=J+(z-I),J=U+L;var O=I+J,G=J+(I-O);return this._hi=O,this._lo=G,this}};Ot.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Ot){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,f=null,u=null,v=null,w=null;v=Ot.SPLIT*this._hi,s=v-this._hi,w=Ot.SPLIT*n,s=v-s,c=this._hi-s,f=w-n,v=this._hi*n,f=w-f,u=n-f,w=s*f-v+s*u+c*f+c*u+(this._hi*i+this._lo*n);var I=v+w;s=v-I;var L=w+s;return this._hi=I,this._lo=L,this}};Ot.prototype.selfSqr=function(){return this.selfMultiply(this)};Ot.prototype.floor=function(){if(this.isNaN())return Ot.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new Ot(t,e)};Ot.prototype.negate=function(){return this.isNaN()?this:new Ot(-this._hi,-this._lo)};Ot.prototype.clone=function(){};Ot.prototype.multiply=function(){if(arguments[0]instanceof Ot){var t=arguments[0];return t.isNaN()?Ot.createNaN():Ot.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return Ze.isNaN(e)?Ot.createNaN():Ot.copy(this).selfMultiply(e,0)}};Ot.prototype.isNaN=function(){return Ze.isNaN(this._hi)};Ot.prototype.intValue=function(){return Math.trunc(this._hi)};Ot.prototype.toString=function(){var t=Ot.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()};Ot.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."+Ot.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var c=i-n.length,f=Ot.stringOfChar("0",c);s=n+f+".0"}return this.isNegative()?"-"+s:s};Ot.prototype.reciprocal=function(){var t=null,e=null,n=null,i=null,s=null,c=null,f=null,u=null;s=1/this._hi,c=Ot.SPLIT*s,t=c-s,u=Ot.SPLIT*this._hi,t=c-t,e=s-t,n=u-this._hi,f=s*this._hi,n=u-n,i=this._hi-n,u=t*n-f+t*i+e*n+e*i,c=(1-f-u-s*this._lo)/this._hi;var v=s+c,w=s-v+c;return new Ot(v,w)};Ot.prototype.toSciNotation=function(){if(this.isZero())return Ot.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=Ot.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};Ot.prototype.abs=function(){return this.isNaN()?Ot.NaN:this.isNegative()?this.negate():new Ot(this)};Ot.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0};Ot.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo};Ot.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0};Ot.prototype.trunc=function(){return this.isNaN()?Ot.NaN:this.isPositive()?this.floor():this.ceil()};Ot.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};Ot.prototype.interfaces_=function(){return[is,ns,Fm]};Ot.prototype.getClass=function(){return Ot};Ot.sqr=function(t){return Ot.valueOf(t).selfMultiply(t)};Ot.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return Ot.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new Ot(e)}};Ot.sqrt=function(t){return Ot.valueOf(t).sqrt()};Ot.parse=function(t){for(var e=0,n=t.length;Sp.isWhitespace(t.charAt(e));)e++;var i=!1;if(e=n);){var w=t.charAt(e);if(e++,Sp.isDigit(w)){var I=w-"0";c.selfMultiply(Ot.TEN),c.selfAdd(I),f++;continue}if(w==="."){u=f;continue}if(w==="e"||w==="E"){var L=t.substring(e);try{v=Zs.parseInt(L)}catch(J){throw J instanceof Error?new Error("Invalid exponent "+L+" in string "+t):J}finally{}break}throw new Error("Unexpected character '"+w+"' at position "+e+" in string "+t)}var A=c,U=f-u-v;if(U===0)A=c;else if(U>0){var z=Ot.TEN.pow(U);A=c.divide(z)}else if(U<0){var K=Ot.TEN.pow(-U);A=c.multiply(K)}return i?A.negate():A};Ot.createNaN=function(){return new Ot(Ze.NaN,Ze.NaN)};Ot.copy=function(t){return new Ot(t)};Ot.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};Ot.stringOfChar=function(t,e){for(var n=new ia,i=0;i0){if(c<=0)return $r.signum(f);i=s+c}else if(s<0){if(c>=0)return $r.signum(f);i=-s-c}else return $r.signum(f);var u=$r.DP_SAFE_EPSILON*i;return f>=u||-f>=u?$r.signum(f):2};$r.signum=function(t){return t>0?1:t<0?-1:0};Nx.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties($r,Nx);var wn=function(){},qp={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};qp.X.get=function(){return 0};qp.Y.get=function(){return 1};qp.Z.get=function(){return 2};qp.M.get=function(){return 3};wn.prototype.setOrdinate=function(t,e,n){};wn.prototype.size=function(){};wn.prototype.getOrdinate=function(t,e){};wn.prototype.getCoordinate=function(){};wn.prototype.getCoordinateCopy=function(t){};wn.prototype.getDimension=function(){};wn.prototype.getX=function(t){};wn.prototype.clone=function(){};wn.prototype.expandEnvelope=function(t){};wn.prototype.copy=function(){};wn.prototype.getY=function(t){};wn.prototype.toCoordinateArray=function(){};wn.prototype.interfaces_=function(){return[Fm]};wn.prototype.getClass=function(){return wn};Object.defineProperties(wn,qp);var zx=function(){},Qh=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}(zx),dr=function(){};dr.arraycopy=function(t,e,n,i,s){for(var c=0,f=e;ft._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}};Le.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Le){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))}};Le.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};Le.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)};Le.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};Le.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};Le.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};Le.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e};Le.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()}};Le.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Le){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof Ct){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)}};Le.prototype.centre=function(){return this.isNull()?null:new Ct((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};Le.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof Ct){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Le){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],f=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)};Le.prototype.hashCode=function(){var t=17;return t=37*t+Ct.hashCode(this._minx),t=37*t+Ct.hashCode(this._maxx),t=37*t+Ct.hashCode(this._miny),t=37*t+Ct.hashCode(this._maxy),t};Le.prototype.interfaces_=function(){return[ns,is]};Le.prototype.getClass=function(){return Le};Le.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],f=arguments[3],u=Math.min(c.x,f.x),v=Math.max(c.x,f.x),w=Math.min(i.x,s.x),I=Math.max(i.x,s.x);return!(w>v||Iv)||In?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}};si.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};si.prototype.setPrecisionModel=function(t){this._precisionModel=t};si.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 f=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>s?c=f:c=u,c===0&&!t.equals(e)&&(c=Math.max(f,u))}return tn.isTrue(!(c===0&&!t.equals(e)),"Bad distance calculation"),c};si.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,c=Math.sqrt(i*i+s*s);return tn.isTrue(!(c===0&&!t.equals(e)),"Invalid distance calculation"),c};_c.DONT_INTERSECT.get=function(){return 0};_c.DO_INTERSECT.get=function(){return 1};_c.COLLINEAR.get=function(){return 2};_c.NO_INTERSECTION.get=function(){return 0};_c.POINT_INTERSECTION.get=function(){return 1};_c.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(si,_c);var Su=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 Le(this._inputLines[0][0],this._inputLines[0][1]),s=new Le(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,Le.intersects(i,s,n)&&ge.orientationIndex(i,s,n)===0&&ge.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,f){f.x=this.smallestInAbsValue(n.x,i.x,s.x,c.x),f.y=this.smallestInAbsValue(n.y,i.y,s.y,c.y),n.x-=f.x,n.y-=f.y,i.x-=f.x,i.y-=f.y,s.x-=f.x,s.y-=f.y,c.x-=f.x,c.y-=f.y},e.prototype.safeHCoordinateIntersection=function(n,i,s,c){var f=null;try{f=ms.intersection(n,i,s,c)}catch(u){if(u instanceof Qh)f=e.nearestEndpoint(n,i,s,c);else throw u}finally{}return f},e.prototype.intersection=function(n,i,s,c){var f=this.intersectionWithNormalization(n,i,s,c);return this.isInSegmentEnvelopes(f)||(f=new Ct(e.nearestEndpoint(n,i,s,c))),this._precisionModel!==null&&this._precisionModel.makePrecise(f),f},e.prototype.smallestInAbsValue=function(n,i,s,c){var f=n,u=Math.abs(f);return Math.abs(i)1e-4&&dr.out.println("Distance = "+f.distance(u))},e.prototype.intersectionWithNormalization=function(n,i,s,c){var f=new Ct(n),u=new Ct(i),v=new Ct(s),w=new Ct(c),I=new Ct;this.normalizeToEnvCentre(f,u,v,w,I);var L=this.safeHCoordinateIntersection(f,u,v,w);return L.x+=I.x,L.y+=I.y,L},e.prototype.computeCollinearIntersection=function(n,i,s,c){var f=Le.intersects(n,i,s),u=Le.intersects(n,i,c),v=Le.intersects(s,c,n),w=Le.intersects(s,c,i);return f&&u?(this._intPt[0]=s,this._intPt[1]=c,t.COLLINEAR_INTERSECTION):v&&w?(this._intPt[0]=n,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):f&&v?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!u&&!w?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):f&&w?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!u&&!v?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):u&&v?(this._intPt[0]=c,this._intPt[1]=n,c.equals(n)&&!f&&!w?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):u&&w?(this._intPt[0]=c,this._intPt[1]=i,c.equals(i)&&!f&&!v?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(n,i,s,c,f){var u=n.xi.x?n.x:i.x,I=n.y>i.y?n.y:i.y,L=s.xc.x?s.x:c.x,z=s.y>c.y?s.y:c.y,K=u>L?u:L,J=wA?v:A,O=I0&&u>0||f<0&&u<0)return t.NO_INTERSECTION;var v=ge.orientationIndex(s,c,n),w=ge.orientationIndex(s,c,i);if(v>0&&w>0||v<0&&w<0)return t.NO_INTERSECTION;var I=f===0&&u===0&&v===0&&w===0;return I?this.computeCollinearIntersection(n,i,s,c):(f===0||u===0||v===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:f===0?this._intPt[0]=new Ct(s):u===0?this._intPt[0]=new Ct(c):v===0?this._intPt[0]=new Ct(n):w===0&&(this._intPt[0]=new Ct(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 f=n,u=ge.distancePointLine(n,s,c),v=ge.distancePointLine(i,s,c);return v0?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(f=Math.floor(n/t),n=n-f*t,i=i-f*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||(f=Math.floor(t/n),t=t-f*n,e=e-f*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 qs=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};qs.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,f=e.x-this._p.x,u=e.y-this._p.y,v=ic.signOfDet2x2(s,c,f,u);if(v===0)return this._isPointOnSegment=!0,null;u0&&this._crossingCount++}};qs.prototype.isPointInPolygon=function(){return this.getLocation()!==At.EXTERIOR};qs.prototype.getLocation=function(){return this._isPointOnSegment?At.BOUNDARY:this._crossingCount%2===1?At.INTERIOR:At.EXTERIOR};qs.prototype.isOnSegment=function(){return this._isPointOnSegment};qs.prototype.interfaces_=function(){return[]};qs.prototype.getClass=function(){return qs};qs.locatePointInRing=function(){if(arguments[0]instanceof Ct&&Be(arguments[1],wn)){for(var t=arguments[0],e=arguments[1],n=new qs(t),i=new Ct,s=new Ct,c=1;c1||v<0||v>1)&&(s=!0)}}return s?zo.min(ge.distancePointLine(t,n,i),ge.distancePointLine(e,n,i),ge.distancePointLine(n,t,e),ge.distancePointLine(i,t,e)):0};ge.isPointInRing=function(t,e){return ge.locatePointInRing(t,e)!==At.EXTERIOR};ge.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new Ct;t.getCoordinate(0,i);for(var s=i.x,c=i.y,f=1;fn.y&&(n=c,i=s)}var f=i;do f=f-1,f<0&&(f=e);while(t[f].equals2D(n)&&f!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(n)&&u!==i);var v=t[f],w=t[u];if(v.equals2D(n)||w.equals2D(n)||v.equals2D(w))return!1;var I=ge.computeOrientation(v,n,w),L=!1;return I===0?L=v.x>w.x:L=I>0,L};ge.locatePointInRing=function(t,e){return qs.locatePointInRing(t,e)};ge.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)};ge.computeOrientation=function(t,e,n){return ge.orientationIndex(t,e,n)};ge.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 I=((f.y-c.y)*(u.x-f.x)-(f.x-c.x)*(u.y-f.y))/v;return Math.abs(I)*Math.sqrt(v)}};ge.isOnLine=function(t,e){for(var n=new Su,i=1;i0};Ah.prototype.interfaces_=function(){return[$o]};Ah.prototype.getClass=function(){return Ah};var kh=function(){};kh.prototype.isInBoundary=function(t){return t>1};kh.prototype.interfaces_=function(){return[$o]};kh.prototype.getClass=function(){return kh};var Dh=function(){};Dh.prototype.isInBoundary=function(t){return t===1};Dh.prototype.interfaces_=function(){return[$o]};Dh.prototype.getClass=function(){return Dh};var Oi=function(){};Oi.prototype.add=function(){};Oi.prototype.addAll=function(){};Oi.prototype.isEmpty=function(){};Oi.prototype.iterator=function(){};Oi.prototype.size=function(){};Oi.prototype.toArray=function(){};Oi.prototype.remove=function(){};function K_(t){this.message=t||""}K_.prototype=new Error;K_.prototype.name="IndexOutOfBoundsException";var $h=function(){};$h.prototype.hasNext=function(){};$h.prototype.next=function(){};$h.prototype.remove=function(){};var gs=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}(Oi);function tf(t){this.message=t||""}tf.prototype=new Error;tf.prototype.name="NoSuchElementException";var ce=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Oi&&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,Oi]},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 fE(this)},e.prototype.get=function(n){if(n<0||n>=this.size())throw new K_;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 I=arguments[0],L=arguments[1];return this.add(I,L),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var A=arguments[0],U=arguments[1],z=arguments[2];if(z)for(var K=0;K=0;J--)i.add(A[J],U);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof Ct){var Q=arguments[0],O=arguments[1],G=arguments[2];if(!G){var j=this.size();if(j>0){if(Q>0){var lt=this.get(Q-1);if(lt.equals2D(O))return null}if(QPt&&($=-1);for(var Lt=ct;Lt!==Pt;Lt+=$)i.add(dt[Lt],ht);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new Ct(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(ce),cn=function(){},Vm={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Vm.ForwardComparator.get=function(){return Ip};Vm.BidirectionalComparator.get=function(){return Rh};Vm.coordArrayType.get=function(){return new Array(0).fill(null)};cn.prototype.interfaces_=function(){return[]};cn.prototype.getClass=function(){return cn};cn.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))};cn.ptNotInList=function(t,e){for(var n=0;n=t?e:[]};cn.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e};cn.extract=function(t,e,n){e=zo.clamp(e,0,t.length),n=zo.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=cn.compare(n,i),c=cn.isEqualReversed(n,i);return c?0:s};Rh.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=cn.increasingDirection(n),c=cn.increasingDirection(i),f=s>0?0:n.length-1,u=c>0?0:n.length-1,v=0;v0)e=e.right;else return e.value}return null};Tr.prototype.put=function(t,e){if(this.root_===null)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:qa,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 f={key:t,left:null,right:null,value:e,parent:i,color:qa,getValue:function(){return this.value},getKey:function(){return this.key}};return s<0?i.left=f:i.right=f,this.fixAfterInsertion(f),this.size_++,null};Tr.prototype.fixAfterInsertion=function(t){var e=this;for(t.color=nu;t!=null&&t!==this.root_&&t.parent.color===nu;)if(Gn(t)===h_(Gn(Gn(t)))){var n=Pv(Gn(Gn(t)));Mv(n)===nu?(Fa(Gn(t),qa),Fa(n,qa),Fa(Gn(Gn(t)),nu),t=Gn(Gn(t))):(t===Pv(Gn(t))&&(t=Gn(t),e.rotateLeft(t)),Fa(Gn(t),qa),Fa(Gn(Gn(t)),nu),e.rotateRight(Gn(Gn(t))))}else{var i=h_(Gn(Gn(t)));Mv(i)===nu?(Fa(Gn(t),qa),Fa(i,qa),Fa(Gn(Gn(t)),nu),t=Gn(Gn(t))):(t===h_(Gn(t))&&(t=Gn(t),e.rotateRight(t)),Fa(Gn(t),qa),Fa(Gn(Gn(t)),nu),e.rotateLeft(Gn(Gn(t))))}this.root_.color=qa};Tr.prototype.values=function(){var t=new ce,e=this.getFirstEntry();if(e!==null)for(t.add(e.value);(e=Tr.successor(e))!==null;)t.add(e.value);return t};Tr.prototype.entrySet=function(){var t=new J_,e=this.getFirstEntry();if(e!==null)for(t.add(e);(e=Tr.successor(e))!==null;)t.add(e);return t};Tr.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}};Tr.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}};Tr.prototype.getFirstEntry=function(){var t=this.root_;if(t!=null)for(;t.left!=null;)t=t.left;return t};Tr.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}};Tr.prototype.size=function(){return this.size_};var Ep=function(){};Ep.prototype.interfaces_=function(){return[]};Ep.prototype.getClass=function(){return Ep};function Fx(){}Fx.prototype=new Um;function Ws(){this.array_=[],arguments[0]instanceof Oi&&this.addAll(arguments[0])}Ws.prototype=new Fx;Ws.prototype.contains=function(t){for(var e=this,n=0,i=this.array_.length;n=0;){var f=s.substring(0,c);i.add(f),s=s.substring(c+n),c=s.indexOf(e)}s.length>0&&i.add(s);for(var u=new Array(i.size()).fill(null),v=0;v0)for(var c=s;c0&&i.append(" ");for(var c=0;c0&&i.append(","),i.append(Jo.toString(t.getOrdinate(s,c)))}return i.append(")"),i.toString()}};Ii.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return Ii.createClosedRing(t,e,4);var i=e.getOrdinate(0,wn.X)===e.getOrdinate(n-1,wn.X)&&e.getOrdinate(0,wn.Y)===e.getOrdinate(n-1,wn.Y);return i?e:Ii.createClosedRing(t,e,n+1)};Ii.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),s=e.size();Ii.copy(e,0,i,0,s);for(var c=s;c0&&Ii.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 ge.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var i=this._points.copy();Ii.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,f=0,u=0;f= 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}(di),da=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),f=0;f0?e.createPoint(n[0]):e.createPoint():t};Lp.prototype.interfaces_=function(){return[ts.GeometryEditorOperation]};Lp.prototype.getClass=function(){return Lp};var Mp=function(){};Mp.prototype.edit=function(t,e){return t instanceof _a?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof di?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof _o?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t};Mp.prototype.interfaces_=function(){return[ts.GeometryEditorOperation]};Mp.prototype.getClass=function(){return Mp};var wi=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 ia(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n3&&(i=3),i<2?new wi(n):new wi(n,i)}};ya.prototype.interfaces_=function(){return[Mh,is]};ya.prototype.getClass=function(){return ya};ya.instance=function(){return ya.instanceObject};$_.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};$_.instanceObject.get=function(){return new ya};Object.defineProperties(ya,$_);var Vx=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 ce,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 J_;return this.map_.entries().forEach(function(i){return n.add(i)}),n},e.prototype.size=function(){return this.map_.size()},e}(vc),Ln=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 Xs){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}}},ty={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Ln.prototype.equals=function(t){if(!(t instanceof Ln))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale};Ln.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new Zs(n).compareTo(new Zs(i))};Ln.prototype.getScale=function(){return this._scale};Ln.prototype.isFloating=function(){return this._modelType===Ln.FLOATING||this._modelType===Ln.FLOATING_SINGLE};Ln.prototype.getType=function(){return this._modelType};Ln.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Ln.FLOATING?t="Floating":this._modelType===Ln.FLOATING_SINGLE?t="Floating-Single":this._modelType===Ln.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t};Ln.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(Ze.isNaN(t))return t;if(this._modelType===Ln.FLOATING_SINGLE){var e=t;return e}return this._modelType===Ln.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof Ct){var n=arguments[0];if(this._modelType===Ln.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}};Ln.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Ln.FLOATING?t=16:this._modelType===Ln.FLOATING_SINGLE?t=6:this._modelType===Ln.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t};Ln.prototype.setScale=function(t){this._scale=Math.abs(t)};Ln.prototype.interfaces_=function(){return[is,ns]};Ln.prototype.getClass=function(){return Ln};Ln.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e};ty.serialVersionUID.get=function(){return 7777263578777804e3};ty.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(Ln,ty);var Xs=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ey={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Xs.prototype.readResolve=function(){return Xs.nameToTypeMap.get(this._name)};Xs.prototype.toString=function(){return this._name};Xs.prototype.interfaces_=function(){return[is]};Xs.prototype.getClass=function(){return Xs};ey.serialVersionUID.get=function(){return-552860263173159e4};ey.nameToTypeMap.get=function(){return new Vx};Object.defineProperties(Xs,ey);Ln.Type=Xs;Ln.FIXED=new Xs("FIXED");Ln.FLOATING=new Xs("FLOATING");Ln.FLOATING_SINGLE=new Xs("FLOATING SINGLE");var un=function t(){this._precisionModel=new Ln,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?Be(arguments[0],Mh)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Ln&&(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]))},Ux={serialVersionUID:{configurable:!0}};un.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new Ct(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new Ct(t.getMinX(),t.getMinY()),new Ct(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new Ct(t.getMinX(),t.getMinY()),new Ct(t.getMinX(),t.getMaxY()),new Ct(t.getMaxX(),t.getMaxY()),new Ct(t.getMaxX(),t.getMinY()),new Ct(t.getMinX(),t.getMinY())]),null)};un.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new di(this.getCoordinateSequenceFactory().create(t),this);if(Be(t,wn))return new di(t,this)}else return new di(this.getCoordinateSequenceFactory().create([]),this)};un.prototype.createMultiLineString=function(){if(arguments.length===0)return new pu(null,this);if(arguments.length===1){var t=arguments[0];return new pu(t,this)}};un.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,s=t.iterator();s.hasNext();){var c=s.next(),f=c.getClass();e===null&&(e=f),f!==e&&(n=!0),c.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(un.toGeometryArray(t));var u=t.iterator().next(),v=t.size()>1;if(v){if(u instanceof Ui)return this.createMultiPolygon(un.toPolygonArray(t));if(u instanceof di)return this.createMultiLineString(un.toLineStringArray(t));if(u instanceof _o)return this.createMultiPoint(un.toPointArray(t));tn.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u};un.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)};un.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Ct){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(Be(arguments[0],wn)){var e=arguments[0];return new _o(e,this)}}};un.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};un.prototype.createPolygon=function(){if(arguments.length===0)return new Ui(null,null,this);if(arguments.length===1){if(Be(arguments[0],wn)){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 _a){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];return new Ui(i,s,this)}};un.prototype.getSRID=function(){return this._SRID};un.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Vr(null,this);if(arguments.length===1){var t=arguments[0];return new Vr(t,this)}};un.prototype.createGeometry=function(t){var e=new ts(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})};un.prototype.getPrecisionModel=function(){return this._precisionModel};un.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],wn)){var e=arguments[0];return new _a(e,this)}}};un.prototype.createMultiPolygon=function(){if(arguments.length===0)return new da(null,this);if(arguments.length===1){var t=arguments[0];return new da(t,this)}};un.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Nh(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Nh(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],wn)){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]};ra.prototype.push=function(t){return this.array_.push(t),t};ra.prototype.pop=function(t){if(this.array_.length===0)throw new Wm;return this.array_.pop()};ra.prototype.peek=function(){if(this.array_.length===0)throw new Wm;return this.array_[this.array_.length-1]};ra.prototype.empty=function(){return this.array_.length===0};ra.prototype.isEmpty=function(){return this.empty()};ra.prototype.search=function(t){return this.array_.indexOf(t)};ra.prototype.size=function(){return this.array_.length};ra.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===ge.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)};Ys.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])};Ys.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)};Ys.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();i.isForward()&&e.checkForRightmostCoordinate(i)}tn.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())};Ys.prototype.interfaces_=function(){return[]};Ys.prototype.getClass=function(){return Ys};var Ka=function(t){function e(n,i){t.call(this,e.msgWithCoord(n,i)),this.pt=i?new Ct(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}(Xa),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 Ur=function(){this._finder=null,this._dirEdgeList=new ce,this._nodes=new ce,this._rightMostCoord=null,this._env=null,this._finder=new Ys};Ur.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}};Ur.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};Ur.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 Ka("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var c=t.getEdges().iterator();c.hasNext();){var f=c.next();f.setVisited(!0),e.copySymDepths(f)}};Ur.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(ne.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)};Ur.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};Ur.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)}};Ur.prototype.computeDepths=function(t){var e=this,n=new J_,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 f=c.getEdges().iterator();f.hasNext();){var u=f.next(),v=u.getSym();if(!v.isVisited()){var w=v.getNode();n.contains(w)||(i.addLast(w),n.add(w))}}}};Ur.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0};Ur.prototype.getEnvelope=function(){if(this._env===null){for(var t=new Le,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]=At.NONE,n[ne.RIGHT]=At.NONE,this.location=n}for(var i=0;i1&&t.append(At.toLocationSymbol(this.location[ne.LEFT])),t.append(At.toLocationSymbol(this.location[ne.ON])),this.location.length>1&&t.append(At.toLocationSymbol(this.location[ne.RIGHT])),t.toString()};qn.prototype.setLocations=function(t,e,n){this.location[ne.ON]=t,this.location[ne.LEFT]=e,this.location[ne.RIGHT]=n};qn.prototype.get=function(t){return t1};qn.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};ki.prototype.addPoints=function(t,e,n){var i=this,s=t.getCoordinates();if(e){var c=1;n&&(c=0);for(var f=c;f=0;v--)i._pts.add(s[v])}};ki.prototype.isHole=function(){return this._isHole};ki.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)};ki.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!ge.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};ki.prototype.addHole=function(t){this._holes.add(t)};ki.prototype.isShell=function(){return this._shell===null};ki.prototype.getLabel=function(){return this._label};ki.prototype.getEdges=function(){return this._edges};ki.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};ki.prototype.getShell=function(){return this._shell};ki.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===At.NONE)return null;if(this._label.getLocation(n)===At.NONE)return this._label.setLocation(n,i),null}};ki.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)};ki.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)};Oo.prototype.isInResult=function(){return this._isInResult};Oo.prototype.isVisited=function(){return this._isVisited};Oo.prototype.interfaces_=function(){return[]};Oo.prototype.getClass=function(){return Oo};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 Dn(0,At.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=At.NONE;if(s=this._label.getLocation(i),!n.isNull(i)){var c=n.getLocation(i);s!==At.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 Dn(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 Dn)for(var s=arguments[0],c=0;c<2;c++){var f=n.computeMergedLocation(s,c),u=n._label.getLocation(c);u===At.NONE&&n._label.setLocation(c,f)}},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=At.NONE;this._label!==null&&(i=this._label.getLocation(n));var s=null;switch(i){case At.BOUNDARY:s=At.INTERIOR;break;case At.INTERIOR:s=At.BOUNDARY;break;default:s=At.BOUNDARY;break}this._label.setLocation(n,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oo),Ks=function(){this.nodeMap=new Tr,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Ks.prototype.find=function(t){return this.nodeMap.get(t)};Ks.prototype.addNode=function(){if(arguments[0]instanceof Ct){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)}};Ks.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};Ks.prototype.iterator=function(){return this.nodeMap.values().iterator()};Ks.prototype.values=function(){return this.nodeMap.values()};Ks.prototype.getBoundaryNodes=function(t){for(var e=new ce,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===At.BOUNDARY&&e.add(i)}return e};Ks.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)};Ks.prototype.interfaces_=function(){return[]};Ks.prototype.getClass=function(){return Ks};var Rn=function(){},Wp={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Rn.prototype.interfaces_=function(){return[]};Rn.prototype.getClass=function(){return Rn};Rn.isNorthern=function(t){return t===Rn.NE||t===Rn.NW};Rn.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2};Rn.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};Rn.isInHalfPlane=function(t,e){return e===Rn.SE?t===Rn.SE||t===Rn.SW:t===e||t===e+1};Rn.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?Rn.NE:Rn.SE:e>=0?Rn.NW:Rn.SW}else if(arguments[0]instanceof Ct&&arguments[1]instanceof Ct){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?Rn.NE:Rn.SE:i.y>=n.y?Rn.NW:Rn.SW}};Wp.NE.get=function(){return 0};Wp.NW.get=function(){return 1};Wp.SW.get=function(){return 2};Wp.SE.get=function(){return 3};Object.defineProperties(Rn,Wp);var Lr=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],f=arguments[1],u=arguments[2],v=arguments[3];this._edge=c,this.init(f,u),this._label=v}};Lr.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){f.linkDirectedEdgesForMinimalEdgeRings();var u=f.buildMinimalRings(),v=i.findShell(u);v!==null?(i.placePolygonHoles(v,u),e.add(v)):n.addAll(u)}else s.add(f)}return s};yo.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1};yo.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new ce,i=t.iterator();i.hasNext();){var s=i.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var c=new SE(s,e._geometryFactory);n.add(c),c.setInResult()}}return n};yo.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}};yo.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t};yo.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),s=n.getCoordinateN(0),c=null,f=null,u=e.iterator();u.hasNext();){var v=u.next(),w=v.getLinearRing(),I=w.getEnvelopeInternal();c!==null&&(f=c.getLinearRing().getEnvelopeInternal());var L=!1;I.contains(i)&&ge.isPointInRing(s,w.getCoordinates())&&(L=!0),L&&(c===null||f.contains(I))&&(c=v)}return c};yo.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 tn.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n};yo.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];ai.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),s=new ce,c=this.buildMinimalEdgeRings(i,this._shellList,s);this.sortShellsAndHoles(c,this._shellList,s),this.placeFreeHoles(this._shellList,s)}};yo.prototype.interfaces_=function(){return[]};yo.prototype.getClass=function(){return yo};var Oh=function(){};Oh.prototype.getBounds=function(){};Oh.prototype.interfaces_=function(){return[]};Oh.prototype.getClass=function(){return Oh};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[Oh,is]};xs.prototype.getClass=function(){return xs};var Ja=function(){this._size=null,this._items=null,this._size=0,this._items=new ce,this._items.add(null)};Ja.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};Ja.prototype.size=function(){return this._size};Ja.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)};Ja.prototype.clear=function(){this._size=0,this._items.clear()};Ja.prototype.isEmpty=function(){return this._size===0};Ja.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)};Ja.prototype.interfaces_=function(){return[]};Ja.prototype.getClass=function(){return Ja};var Tl=function(){};Tl.prototype.visitItem=function(t){};Tl.prototype.interfaces_=function(){return[]};Tl.prototype.getClass=function(){return Tl};var rc=function(){};rc.prototype.insert=function(t,e){};rc.prototype.remove=function(t,e){};rc.prototype.query=function(){};rc.prototype.interfaces_=function(){return[]};rc.prototype.getClass=function(){return rc};var Vi=function(){if(this._childBoundables=new ce,this._bounds=null,this._level=null,arguments.length!==0&&arguments.length===1){var t=arguments[0];this._level=t}},qx={serialVersionUID:{configurable:!0}};Vi.prototype.getLevel=function(){return this._level};Vi.prototype.size=function(){return this._childBoundables.size()};Vi.prototype.getChildBoundables=function(){return this._childBoundables};Vi.prototype.addChildBoundable=function(t){tn.isTrue(this._bounds===null),this._childBoundables.add(t)};Vi.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};Vi.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};Vi.prototype.interfaces_=function(){return[Oh,is]};Vi.prototype.getClass=function(){return Vi};qx.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(Vi,qx);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;sPi.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")};Pi.prototype.isLeaves=function(){return!(Pi.isComposite(this._boundable1)||Pi.isComposite(this._boundable2))};Pi.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0};Pi.prototype.expand=function(t,e,n,i){for(var s=this,c=t.getChildBoundables(),f=c.iterator();f.hasNext();){var u=f.next(),v=new Pi(u,e,s._itemDistance);v.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},Ym={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};sr.prototype.getNodeCapacity=function(){return this._nodeCapacity};sr.prototype.lastNode=function(t){return t.get(t.size()-1)};sr.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 Vi?n+=t.size(s):s instanceof xs&&(n+=1)}return n}};sr.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};sr.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new ce:e}else if(arguments.length===1){for(var n=arguments[0],i=new ce,s=n.getChildBoundables().iterator();s.hasNext();){var c=s.next();if(c instanceof Vi){var f=t.itemsTree(c);f!==null&&i.add(f)}else c instanceof xs?i.add(c.getItem()):tn.shouldNeverReachHere()}return i.size()<=0?null:i}};sr.prototype.insert=function(t,e){tn.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new xs(t,e))};sr.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new ce;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],c=arguments[2];if(tn.isTrue(i>-2),s.getLevel()===i)return c.add(s),null;for(var f=s.getChildBoundables().iterator();f.hasNext();){var u=f.next();u instanceof Vi?t.boundablesAtLevel(i,u,c):(tn.isTrue(u instanceof xs),i===-1&&c.add(u))}return null}};sr.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new ce;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 Vi)for(var c=arguments[0],f=arguments[1],u=arguments[2],v=f.getChildBoundables(),w=0;wn&&(n=c)}}return n+1}};sr.prototype.createParentBoundables=function(t,e){var n=this;tn.isTrue(!t.isEmpty());var i=new ce;i.add(this.createNode(e));var s=new ce(t);bs.sort(s,this.getComparator());for(var c=s.iterator();c.hasNext();){var f=c.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(e)),n.lastNode(i).addChildBoundable(f)}return i};sr.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};sr.prototype.interfaces_=function(){return[is]};sr.prototype.getClass=function(){return sr};sr.compareDoubles=function(t,e){return t>e?1:t0);for(var f=new ce,u=0;u0;){var z=U.poll(),K=z.getDistance();if(K>=L)break;z.isLeaves()?(L=K,A=z):z.expandToQueue(U,L)}return[A.getBoundable(0).getItem(),A.getBoundable(1).getItem()]}}else if(arguments.length===3){var J=arguments[0],Q=arguments[1],O=arguments[2],G=new xs(J,Q),j=new Pi(this.getRoot(),G,O);return this.nearestNeighbour(j)[0]}},e.prototype.interfaces_=function(){return[rc,is]},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 Av},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[Lh]},compare:function(i,s){return t.compareDoubles(e.centreX(i.getBounds()),e.centreX(s.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[Lh]},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}(sr),Av=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 Le(s.getBounds()):n.expandToInclude(s.getBounds())}return n},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vi),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 tn.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 Ct(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[ns]};Ll.prototype.getClass=function(){return Ll};var Gr=function(){this._nodeMap=new Tr,this._edge=null;var t=arguments[0];this._edge=t};Gr.prototype.getSplitCoordinates=function(){var t=this,e=new jp;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()};Gr.prototype.addCollapsedNodes=function(){var t=this,e=new ce;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)}};Gr.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};Gr.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 Ct&&arguments[1]instanceof Ct){var s=arguments[0],c=arguments[1],f=c.x-s.x,u=c.y-s.y;if(f===0&&u===0)throw new Qn("Cannot compute the octant for two identical points "+s);return oc.octant(f,u)}};var va=function(){};va.prototype.getCoordinates=function(){};va.prototype.size=function(){};va.prototype.getCoordinate=function(t){};va.prototype.isClosed=function(){};va.prototype.setData=function(t){};va.prototype.getData=function(){};va.prototype.interfaces_=function(){return[]};va.prototype.getClass=function(){return va};var Pp=function(){};Pp.prototype.addIntersection=function(t,e){};Pp.prototype.interfaces_=function(){return[va]};Pp.prototype.getClass=function(){return Pp};var Ei=function(){this._nodeList=new Gr(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Ei.prototype.getCoordinates=function(){return this._pts};Ei.prototype.size=function(){return this._pts.length};Ei.prototype.getCoordinate=function(t){return this._pts[t]};Ei.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};Ei.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))};Ei.prototype.setData=function(t){this._data=t};Ei.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:oc.octant(t,e)};Ei.prototype.getData=function(){return this._data};Ei.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 Ct(n.getIntersection(s));this.addIntersection(c,i)}};Ei.prototype.toString=function(){return ys.toLineString(new wi(this._pts))};Ei.prototype.getNodeList=function(){return this._nodeList};Ei.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 Ct){var i=arguments[0];return ge.orientationIndex(this.p0,this.p1,i)}};ke.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])};ke.prototype.isVertical=function(){return this.p0.x===this.p1.x};ke.prototype.equals=function(t){if(!(t instanceof ke))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)};ke.prototype.intersection=function(t){var e=new Su;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null};ke.prototype.project=function(){if(arguments[0]instanceof Ct){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new Ct(t);var e=this.projectionFactor(t),n=new Ct;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 ke){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 f=this.project(i.p0);s<0&&(f=this.p0),s>1&&(f=this.p1);var u=this.project(i.p1);return c<0&&(u=this.p0),c>1&&(u=this.p1),new ke(f,u)}};ke.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};ke.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};ke.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1};ke.prototype.distancePerpendicular=function(t){return ge.distancePointLinePerpendicular(t,this.p0,this.p1)};ke.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};ke.prototype.midPoint=function(){return ke.midPoint(this.p0,this.p1)};ke.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};ke.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 f=this.closestPoint(t.p1);s=f.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};ke.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};ke.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};ke.prototype.distance=function(){if(arguments[0]instanceof ke){var t=arguments[0];return ge.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof Ct){var e=arguments[0];return ge.distancePointLine(e,this.p0,this.p1)}};ke.prototype.pointAlong=function(t){var e=new Ct;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};ke.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};ke.prototype.interfaces_=function(){return[ns,is]};ke.prototype.getClass=function(){return ke};ke.midPoint=function(t,e){return new Ct((t.x+e.x)/2,(t.y+e.y)/2)};Zx.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(ke,Zx);var Ap=function(){this.tempEnv1=new Le,this.tempEnv2=new Le,this._overlapSeg1=new ke,this._overlapSeg2=new ke};Ap.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)}};Ap.prototype.interfaces_=function(){return[]};Ap.prototype.getClass=function(){return Ap};var vo=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};vo.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]};vo.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 f=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var i=Rn.quadrant(t[n],t[n+1]),s=e+1;sf.getId()&&(f.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 kv},Object.defineProperties(e,n),e}(kp),kv=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],f=n.getContext(),u=s.getContext();this._si.processIntersections(f,i,u,c)}else return t.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ap),Tn=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],f=arguments[2],u=arguments[3];this.setQuadrantSegments(s),this.setEndCapStyle(c),this.setJoinStyle(f),this.setMitreLimit(u)}}},nl={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}};Tn.prototype.getEndCapStyle=function(){return this._endCapStyle};Tn.prototype.isSingleSided=function(){return this._isSingleSided};Tn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=Tn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Tn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Tn.JOIN_ROUND&&(this._quadrantSegments=Tn.DEFAULT_QUADRANT_SEGMENTS)};Tn.prototype.getJoinStyle=function(){return this._joinStyle};Tn.prototype.setJoinStyle=function(t){this._joinStyle=t};Tn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t};Tn.prototype.getSimplifyFactor=function(){return this._simplifyFactor};Tn.prototype.getQuadrantSegments=function(){return this._quadrantSegments};Tn.prototype.setEndCapStyle=function(t){this._endCapStyle=t};Tn.prototype.getMitreLimit=function(){return this._mitreLimit};Tn.prototype.setMitreLimit=function(t){this._mitreLimit=t};Tn.prototype.setSingleSided=function(t){this._isSingleSided=t};Tn.prototype.interfaces_=function(){return[]};Tn.prototype.getClass=function(){return Tn};Tn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)};nl.CAP_ROUND.get=function(){return 1};nl.CAP_FLAT.get=function(){return 2};nl.CAP_SQUARE.get=function(){return 3};nl.JOIN_ROUND.get=function(){return 1};nl.JOIN_MITRE.get=function(){return 2};nl.JOIN_BEVEL.get=function(){return 3};nl.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};nl.DEFAULT_MITRE_LIMIT.get=function(){return 5};nl.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(Tn,nl);var mi=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=ge.COUNTERCLOCKWISE,this._inputLine=t||null},Hp={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};mi.prototype.isDeletable=function(t,e,n,i){var s=this._inputLine[t],c=this._inputLine[e],f=this._inputLine[n];return!this.isConcave(s,c,f)||!this.isShallow(s,c,f,i)?!1:this.isShallowSampled(s,c,t,n,i)};mi.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])};Fo.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-=_n.PI_TIMES_2;for(;t<=-Math.PI;)t+=_n.PI_TIMES_2;return t};_n.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)}};_n.isAcute=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,c=n.x-e.x,f=n.y-e.y,u=i*c+s*f;return u>0};_n.isObtuse=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,c=n.x-e.x,f=n.y-e.y,u=i*c+s*f;return u<0};_n.interiorAngle=function(t,e,n){var i=_n.angle(e,t),s=_n.angle(e,n);return Math.abs(s-i)};_n.normalizePositive=function(t){if(t<0){for(;t<0;)t+=_n.PI_TIMES_2;t>=_n.PI_TIMES_2&&(t=0)}else{for(;t>=_n.PI_TIMES_2;)t-=_n.PI_TIMES_2;t<0&&(t=0)}return t};_n.angleBetween=function(t,e,n){var i=_n.angle(e,t),s=_n.angle(e,n);return _n.diff(i,s)};_n.diff=function(t,e){var n=null;return tMath.PI&&(n=2*Math.PI-n),n};_n.toRadians=function(t){return t*Math.PI/180};_n.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?_n.COUNTERCLOCKWISE:n<0?_n.CLOCKWISE:_n.NONE};_n.angleBetweenOriented=function(t,e,n){var i=_n.angle(e,t),s=_n.angle(e,n),c=s-i;return c<=-Math.PI?c+_n.PI_TIMES_2:c>Math.PI?c-_n.PI_TIMES_2:c};xc.PI_TIMES_2.get=function(){return 2*Math.PI};xc.PI_OVER_2.get=function(){return Math.PI/2};xc.PI_OVER_4.get=function(){return Math.PI/4};xc.COUNTERCLOCKWISE.get=function(){return ge.COUNTERCLOCKWISE};xc.CLOCKWISE.get=function(){return ge.CLOCKWISE};xc.NONE.get=function(){return ge.COLLINEAR};Object.defineProperties(_n,xc);var Hn=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 ke,this._seg1=new ke,this._offset0=new ke,this._offset1=new ke,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 Su,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Tn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(i)},Xp={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}};Hn.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=ge.computeOrientation(this._s0,this._s1,this._s2),i=n===ge.CLOCKWISE&&this._side===ne.LEFT||n===ge.COUNTERCLOCKWISE&&this._side===ne.RIGHT;n===0?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)};Hn.prototype.addLineEndCap=function(t,e){var n=new ke(t,e),i=new ke;this.computeOffsetSegment(n,ne.LEFT,this._distance,i);var s=new ke;this.computeOffsetSegment(n,ne.RIGHT,this._distance,s);var c=e.x-t.x,f=e.y-t.y,u=Math.atan2(f,c);switch(this._bufParams.getEndCapStyle()){case Tn.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,ge.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case Tn.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(s.p1);break;case Tn.CAP_SQUARE:var v=new Ct;v.x=Math.abs(this._distance)*Math.cos(u),v.y=Math.abs(this._distance)*Math.sin(u);var w=new Ct(i.p1.x+v.x,i.p1.y+v.y),I=new Ct(s.p1.x+v.x,s.p1.y+v.y);this._segList.addPt(w),this._segList.addPt(I);break}};Hn.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t};Hn.prototype.addMitreJoin=function(t,e,n,i){var s=!0,c=null;try{c=ms.intersection(e.p0,e.p1,n.p0,n.p1);var f=i<=0?1:c.distance(t)/Math.abs(i);f>this._bufParams.getMitreLimit()&&(s=!1)}catch(u){if(u instanceof Qh)c=new Ct(0,0),s=!1;else throw u}finally{}s?this._segList.addPt(c):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())};Hn.prototype.addFilletCorner=function(t,e,n,i,s){var c=e.x-t.x,f=e.y-t.y,u=Math.atan2(f,c),v=n.x-t.x,w=n.y-t.y,I=Math.atan2(w,v);i===ge.CLOCKWISE?u<=I&&(u+=2*Math.PI):u>=I&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,I,i,s),this._segList.addPt(n)};Hn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new Ct((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 Ct((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)}};Hn.prototype.createCircle=function(t){var e=new Ct(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};Hn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)};Hn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Fo,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Hn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};Hn.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()===Tn.JOIN_BEVEL||this._bufParams.getJoinStyle()===Tn.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,ge.CLOCKWISE,this._distance))};Hn.prototype.closeRing=function(){this._segList.closeRing()};Hn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};Hn.prototype.interfaces_=function(){return[]};Hn.prototype.getClass=function(){return Hn};Xp.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};Xp.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};Xp.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};Xp.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(Hn,Xp);var to=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};to.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&&cn.reverse(c),c};to.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var s=mi.simplify(t,-i),c=s.length-1;n.initSideSegments(s[c],s[c-1],ne.LEFT),n.addFirstSegment();for(var f=c-2;f>=0;f--)n.addNextSegment(s[f],!0)}else{n.addSegments(t,!1);var u=mi.simplify(t,i),v=u.length-1;n.initSideSegments(u[0],u[1],ne.LEFT),n.addFirstSegment();for(var w=2;w<=v;w++)n.addNextSegment(u[w],!0)}n.addLastSegment(),n.closeRing()};to.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===ne.RIGHT&&(i=-i);var s=mi.simplify(t,i),c=s.length-1;n.initSideSegments(s[c-1],s[0],e);for(var f=1;f<=c;f++){var u=f!==1;n.addNextSegment(s[f],u)}n.closeRing()};to.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=mi.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 f=mi.simplify(t,-n),u=f.length-1;e.initSideSegments(f[u],f[u-1],ne.LEFT);for(var v=u-2;v>=0;v--)e.addNextSegment(f[v],!0);e.addLastSegment(),e.addLineEndCap(f[1],f[0]),e.closeRing()};to.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Tn.CAP_ROUND:e.createCircle(t);break;case Tn.CAP_SQUARE:e.createSquare(t);break}};to.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};to.prototype.getBufferParameters=function(){return this._bufParams};to.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()};to.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return to.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()};to.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var s=mi.simplify(t,-i),c=s.length-1;n.initSideSegments(s[c],s[c-1],ne.LEFT),n.addFirstSegment();for(var f=c-2;f>=0;f--)n.addNextSegment(s[f],!0)}else{var u=mi.simplify(t,i),v=u.length-1;n.initSideSegments(u[0],u[1],ne.LEFT),n.addFirstSegment();for(var w=2;w<=v;w++)n.addNextSegment(u[w],!0)}n.addLastSegment()};to.prototype.getSegGen=function(t){return new Hn(this._precisionModel,this._bufParams,t)};to.prototype.interfaces_=function(){return[]};to.prototype.getClass=function(){return to};to.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],gs)&&arguments[0]instanceof Ct&&arguments[1]instanceof P_)for(var f=arguments[0],u=arguments[1],v=arguments[2],w=u.getEdge().getCoordinates(),I=0;It._seg.p1.y&&t._seg.reverse();var L=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(Lt._seg.p1.y)&&ge.computeOrientation(t._seg.p0,t._seg.p1,f)!==ge.RIGHT){var A=u.getDepth(ne.LEFT);t._seg.p0.equals(w[I])||(A=u.getDepth(ne.RIGHT));var U=new mu(t._seg,A);v.add(U)}}else if(Be(arguments[2],gs)&&arguments[0]instanceof Ct&&Be(arguments[1],gs))for(var z=arguments[0],K=arguments[1],J=arguments[2],Q=K.iterator();Q.hasNext();){var O=Q.next();O.isForward()&&t.findStabbedSegments(z,O,J)}}};sc.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=bs.min(e);return n._leftDepth};sc.prototype.interfaces_=function(){return[]};sc.prototype.getClass=function(){return sc};Hx.DepthSegment.get=function(){return mu};Object.defineProperties(sc,Hx);var mu=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new ke(t),this._leftDepth=e};mu.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)};mu.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)};mu.prototype.toString=function(){return this._upwardSeg.toString()};mu.prototype.interfaces_=function(){return[ns]};mu.prototype.getClass=function(){return mu};var Mn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Mn.prototype.area=function(){return Mn.area(this.p0,this.p1,this.p2)};Mn.prototype.signedArea=function(){return Mn.signedArea(this.p0,this.p1,this.p2)};Mn.prototype.interpolateZ=function(t){if(t===null)throw new Qn("Supplied point is null.");return Mn.interpolateZ(t,this.p0,this.p1,this.p2)};Mn.prototype.longestSideLength=function(){return Mn.longestSideLength(this.p0,this.p1,this.p2)};Mn.prototype.isAcute=function(){return Mn.isAcute(this.p0,this.p1,this.p2)};Mn.prototype.circumcentre=function(){return Mn.circumcentre(this.p0,this.p1,this.p2)};Mn.prototype.area3D=function(){return Mn.area3D(this.p0,this.p1,this.p2)};Mn.prototype.centroid=function(){return Mn.centroid(this.p0,this.p1,this.p2)};Mn.prototype.inCentre=function(){return Mn.inCentre(this.p0,this.p1,this.p2)};Mn.prototype.interfaces_=function(){return[]};Mn.prototype.getClass=function(){return Mn};Mn.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)};Mn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2};Mn.det=function(t,e,n,i){return t*i-e*n};Mn.interpolateZ=function(t,e,n,i){var s=e.x,c=e.y,f=n.x-s,u=i.x-s,v=n.y-c,w=i.y-c,I=f*w-u*v,L=t.x-s,A=t.y-c,U=(w*L-u*A)/I,z=(-v*L+f*A)/I,K=e.z+U*(n.z-e.z)+z*(i.z-e.z);return K};Mn.longestSideLength=function(t,e,n){var i=t.distance(e),s=e.distance(n),c=n.distance(t),f=i;return s>f&&(f=s),c>f&&(f=c),f};Mn.isAcute=function(t,e,n){return!(!_n.isAcute(t,e,n)||!_n.isAcute(e,n,t)||!_n.isAcute(n,t,e))};Mn.circumcentre=function(t,e,n){var i=n.x,s=n.y,c=t.x-i,f=t.y-s,u=e.x-i,v=e.y-s,w=2*Mn.det(c,f,u,v),I=Mn.det(f,c*c+f*f,v,u*u+v*v),L=Mn.det(c,c*c+f*f,u,u*u+v*v),A=i-I/w,U=s+L/w;return new Ct(A,U)};Mn.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,s=new ms(t.x+n/2,t.y+i/2,1),c=new ms(t.x-i+n/2,t.y+n+i/2,1);return new ms(s,c)};Mn.angleBisector=function(t,e,n){var i=e.distance(t),s=e.distance(n),c=i/(i+s),f=n.x-t.x,u=n.y-t.y,v=new Ct(t.x+c*f,t.y+c*u);return v};Mn.area3D=function(t,e,n){var i=e.x-t.x,s=e.y-t.y,c=e.z-t.z,f=n.x-t.x,u=n.y-t.y,v=n.z-t.z,w=s*v-c*u,I=c*f-i*v,L=i*u-s*f,A=w*w+I*I+L*L,U=Math.sqrt(A)/2;return U};Mn.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,s=(t.y+e.y+n.y)/3;return new Ct(i,s)};Mn.inCentre=function(t,e,n){var i=e.distance(n),s=t.distance(n),c=t.distance(e),f=i+s+c,u=(i*t.x+s*e.x+c*n.x)/f,v=(i*t.y+s*e.y+c*n.y)/f;return new Ct(u,v)};var es=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new ce;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};es.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,At.EXTERIOR,At.INTERIOR)};es.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=cn.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,At.EXTERIOR,At.INTERIOR);for(var f=0;f0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(v,n,ne.opposite(i),At.INTERIOR,At.EXTERIOR)}};es.prototype.isTriangleErodedCompletely=function(t,e){var n=new Mn(t[0],t[1],t[2]),i=n.inCentre(),s=ge.distancePointLine(i,n.p0,n.p1);return s=_a.MINIMUM_VALID_SIZE&&ge.isCCW(t)&&(c=s,f=i,n=ne.opposite(n));var u=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(u,c,f)};es.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Ui?this.addPolygon(t):t instanceof di?this.addLineString(t):t instanceof _o?this.addPoint(t):t instanceof Nh?this.addCollection(t):t instanceof pu?this.addCollection(t):t instanceof da?this.addCollection(t):t instanceof Vr&&this.addCollection(t)};es.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};es.prototype.addCollection=function(t){for(var e=this,n=0;n=this._max)throw new tf;var t=this._parent.getGeometryN(this._index++);return t instanceof Vr?(this._subcollectionIterator=new ma(t),this._subcollectionIterator.next()):t};ma.prototype.remove=function(){throw new Error(this.getClass().getName())};ma.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)};ma.prototype.interfaces_=function(){return[$h]};ma.prototype.getClass=function(){return ma};ma.isAtomic=function(t){return!(t instanceof Vr)};var Ro=function(){this._geom=null;var t=arguments[0];this._geom=t};Ro.prototype.locate=function(t){return Ro.locate(t,this._geom)};Ro.prototype.interfaces_=function(){return[Bh]};Ro.prototype.getClass=function(){return Ro};Ro.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?ge.isPointInRing(t,e.getCoordinates()):!1};Ro.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Ro.isPointInRing(t,n))return!1;for(var i=0;i=0;c--){var f=n._edgeList.get(c),u=f.getSym();s===null&&(s=u),i!==null&&u.setNext(i),i=f}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),f=i.getDepth(ne.RIGHT),u=this.computeDepths(s+1,this._edgeList.size(),c),v=this.computeDepths(0,s,u);if(v!==f)throw new Ka("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var w=arguments[0],I=arguments[1],L=arguments[2],A=L,U=w;U=0;u--){var v=i._resultAreaEdgeList.get(u),w=v.getSym();switch(s===null&&v.getEdgeRing()===n&&(s=v),f){case i._SCANNING_FOR_INCOMING:if(w.getEdgeRing()!==n)continue;c=w,f=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(v.getEdgeRing()!==n)continue;c.setNextMin(v),f=i._SCANNING_FOR_INCOMING;break}}f===this._LINKING_TO_OUTGOING&&(tn.isTrue(s!==null,"found null for first outgoing dirEdge"),tn.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],f=0,u=this.iterator();u.hasNext();){var v=u.next();v.getEdgeRing()===c&&f++}return f}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var n=At.NONE,i=this.iterator();i.hasNext();){var s=i.next(),c=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=At.INTERIOR;break}if(c.isInResult()){n=At.EXTERIOR;break}}}if(n===At.NONE)return null;for(var f=n,u=this.iterator();u.hasNext();){var v=u.next(),w=v.getSym();v.isLineEdge()?v.getEdge().setCovered(f===At.INTERIOR):(v.isInResult()&&(f=At.EXTERIOR),w.isInResult()&&(f=At.INTERIOR))}},e.prototype.computeLabelling=function(n){var i=this;t.prototype.computeLabelling.call(this,n),this._label=new Dn(At.NONE);for(var s=this.iterator();s.hasNext();)for(var c=s.next(),f=c.getEdge(),u=f.getLabel(),v=0;v<2;v++){var w=u.getLocation(v);(w===At.INTERIOR||w===At.BOUNDARY)&&i._label.setLocation(v,At.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Mr),Xx=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 EE)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(zh),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[ns]};Ml.prototype.getClass=function(){return Ml};Ml.orientation=function(t){return cn.increasingDirection(t)===1};Ml.compareOriented=function(t,e,n,i){for(var s=e?1:-1,c=i?1:-1,f=e?t.length:-1,u=i?n.length:-1,v=e?0:t.length-1,w=i?0:n.length-1;;){var I=t[v].compareTo(n[w]);if(I!==0)return I;v+=s,w+=c;var L=v===f,A=w===u;if(L&&!A)return-1;if(!L&&A)return 1;if(L&&A)return 0}};var ws=function(){this._edges=new ce,this._ocaMap=new Tr};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 f=new Array(i).fill(null),u=0;f[u++]=new Ct(t.coord);for(var v=t.segmentIndex+1;v<=e.segmentIndex;v++)f[u++]=n.edge.pts[v];return c&&(f[u]=e.coord),new Sm(f,new Dn(this.edge._label))};xa.prototype.add=function(t,e,n){var i=new Js(t,e,n),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)};xa.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1};xa.prototype.interfaces_=function(){return[]};xa.prototype.getClass=function(){return xa};var _u=function(){};_u.prototype.getChainStartIndices=function(t){var e=this,n=0,i=new ce;i.add(new Zs(n));do{var s=e.findChainEnd(t,n);i.add(new Zs(s)),n=s}while(nn?e:n};Qa.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?At.EXTERIOR:At.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===At.EXTERIOR||s===At.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],f=arguments[1],u=arguments[2];u===At.INTERIOR&&this._depth[c][f]++}};pr.prototype.interfaces_=function(){return[]};pr.prototype.getClass=function(){return pr};pr.depthAtLocation=function(t){return t===At.EXTERIOR?0:t===At.INTERIOR?1:pr.NULL_VALUE};Yx.NULL_VALUE.get=function(){return-1};Object.defineProperties(pr,Yx);var Sm=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new xa(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,Dn.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,f=!0,u=this.pts.length,v=0;v0?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 Qa(this)),this._mce},e.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new Le;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(f)return!1;var u=this.intersectsToleranceSquare(t,e);return tn.isTrue(!(f&&u),"Found bad envelope test"),u};eo.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 Ct(this._maxx,this._maxy),this._corner[1]=new Ct(this._minx,this._maxy),this._corner[2]=new Ct(this._minx,this._miny),this._corner[3]=new Ct(this._maxx,this._miny)};eo.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))};eo.prototype.scale=function(t){return Math.round(t*this._scaleFactor)};eo.prototype.getCoordinate=function(){return this._originalPt};eo.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)};eo.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=eo.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Le(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv};eo.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()))};eo.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))};eo.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};eo.prototype.interfaces_=function(){return[]};eo.prototype.getClass=function(){return eo};Jx.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(eo,Jx);var Dp=function(){this.tempEnv1=new Le,this.selectedSegment=new ke};Dp.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)}};Dp.prototype.interfaces_=function(){return[]};Dp.prototype.getClass=function(){return Dp};var Vh=function(){this._index=null;var t=arguments[0];this._index=t},Qx={HotPixelSnapAction:{configurable:!0}};Vh.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 $x(e,n,i);return this._index.query(s,{interfaces_:function(){return[Tl]},visitItem:function(f){var u=f;u.select(s,c)}}),c.isNodeAdded()}};Vh.prototype.interfaces_=function(){return[]};Vh.prototype.getClass=function(){return Vh};Qx.HotPixelSnapAction.get=function(){return $x};Object.defineProperties(Vh,Qx);var $x=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}(Dp),ac=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new ce};ac.prototype.processIntersections=function(t,e,n,i){var s=this;if(t===n&&e===i)return null;var c=t.getCoordinates()[e],f=t.getCoordinates()[e+1],u=n.getCoordinates()[i],v=n.getCoordinates()[i+1];if(this._li.computeIntersection(c,f,u,v),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var w=0;w=0;e--){try{t.bufferReducedPrecision(e)}catch(c){if(c instanceof Ka)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=fr.precisionScaleFactor(this._argGeom,this._distance,n),s=new Ln(i);this.bufferFixedPrecision(s)}};fr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Ln.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()};fr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)};fr.prototype.bufferOriginalPrecision=function(){try{var t=new Fr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Xa)this._saveException=e;else throw e}finally{}};fr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry};fr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)};fr.prototype.interfaces_=function(){return[]};fr.prototype.getClass=function(){return fr};fr.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new fr(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],f=arguments[2],u=new fr(s);u.setQuadrantSegments(f);var v=u.getResultGeometry(c);return v}else if(arguments[2]instanceof Tn&&arguments[0]instanceof Fe&&typeof arguments[1]=="number"){var w=arguments[0],I=arguments[1],L=arguments[2],A=new fr(w,L),U=A.getResultGeometry(I);return U}}else if(arguments.length===4){var z=arguments[0],K=arguments[1],J=arguments[2],Q=arguments[3],O=new fr(z);O.setQuadrantSegments(J),O.setEndCapStyle(Q);var G=O.getResultGeometry(K);return G}};fr.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),s=zo.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),c=e>0?e:0,f=s+2*c,u=Math.trunc(Math.log(f)/Math.log(10)+1),v=n-u,w=Math.pow(10,v);return w};ef.CAP_ROUND.get=function(){return Tn.CAP_ROUND};ef.CAP_BUTT.get=function(){return Tn.CAP_FLAT};ef.CAP_FLAT.get=function(){return Tn.CAP_FLAT};ef.CAP_SQUARE.get=function(){return Tn.CAP_SQUARE};ef.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(fr,ef);var Nr=function(){this._pt=[new Ct,new Ct],this._distance=Ze.NaN,this._isNull=!0};Nr.prototype.getCoordinates=function(){return this._pt};Nr.prototype.getCoordinate=function(t){return this._pt[t]};Nr.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)}};Nr.prototype.interfaces_=function(){return[]};Nr.prototype.getClass=function(){return Nr};var fa=function(){};fa.prototype.interfaces_=function(){return[]};fa.prototype.getClass=function(){return fa};fa.computeDistance=function(){if(arguments[2]instanceof Nr&&arguments[0]instanceof di&&arguments[1]instanceof Ct)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=t.getCoordinates(),s=new ke,c=0;c0||this._isIn?At.INTERIOR:At.EXTERIOR)};Ss.prototype.interfaces_=function(){return[]};Ss.prototype.getClass=function(){return Ss};var zr=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}},tb={INSIDE_AREA:{configurable:!0}};zr.prototype.isInsideArea=function(){return this._segIndex===zr.INSIDE_AREA};zr.prototype.getCoordinate=function(){return this._pt};zr.prototype.getGeometryComponent=function(){return this._component};zr.prototype.getSegmentIndex=function(){return this._segIndex};zr.prototype.interfaces_=function(){return[]};zr.prototype.getClass=function(){return zr};tb.INSIDE_AREA.get=function(){return-1};Object.defineProperties(zr,tb);var Il=function(t){this._pts=t||null};Il.prototype.filter=function(t){t instanceof _o&&this._pts.add(t)};Il.prototype.interfaces_=function(){return[Hs]};Il.prototype.getClass=function(){return Il};Il.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof _o?bs.singletonList(t):Il.getPoints(t,new ce)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof _o?n.add(e):e instanceof Vr&&e.apply(new Il(n)),n}};var uc=function(){this._locations=null;var t=arguments[0];this._locations=t};uc.prototype.filter=function(t){(t instanceof _o||t instanceof di||t instanceof Ui)&&this._locations.add(new zr(t,0,t.getCoordinate()))};uc.prototype.interfaces_=function(){return[Hs]};uc.prototype.getClass=function(){return uc};uc.getLocations=function(t){var e=new ce;return t.apply(new uc(e)),e};var mr=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}};mr.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=Ha.getPolygons(this._geom[n]);if(c.size()>0){var f=uc.getLocations(this._geom[s]);if(this.computeContainmentDistance(f,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],gs)&&Be(arguments[1],gs)){for(var u=arguments[0],v=arguments[1],w=arguments[2],I=0;Ithis._minDistance)return null;for(var s=e.getCoordinates(),c=n.getCoordinate(),f=0;fthis._minDistance)return null;for(var U=I.getCoordinates(),z=L.getCoordinates(),K=0;Kthis._distance&&this.initialize(e,n,i)}};br.prototype.interfaces_=function(){return[]};br.prototype.getClass=function(){return br};var Vs=function(){};Vs.prototype.interfaces_=function(){return[]};Vs.prototype.getClass=function(){return Vs};Vs.computeDistance=function(){if(arguments[2]instanceof br&&arguments[0]instanceof di&&arguments[1]instanceof Ct)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new ke,s=t.getCoordinates(),c=0;c1||t<=0)throw new Qn("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t};Qo.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)};Qo.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};Qo.prototype.computeOrientedDistance=function(t,e,n){var i=new cc(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())}};Qo.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};Qo.prototype.interfaces_=function(){return[]};Qo.prototype.getClass=function(){return Qo};Qo.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Qo(t,e);return n.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],c=arguments[2],f=new Qo(i,s);return f.setDensifyFraction(c),f.distance()}};oy.MaxPointDistanceFilter.get=function(){return cc};oy.MaxDensifiedByFractionDistanceFilter.get=function(){return kl};Object.defineProperties(Qo,oy);var cc=function(){this._maxPtDist=new br,this._minPtDist=new br,this._euclideanDist=new Vs,this._geom=null;var t=arguments[0];this._geom=t};cc.prototype.filter=function(t){this._minPtDist.initialize(),Vs.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};cc.prototype.getMaxPointDistance=function(){return this._maxPtDist};cc.prototype.interfaces_=function(){return[ga]};cc.prototype.getClass=function(){return cc};var kl=function(){this._maxPtDist=new br,this._minPtDist=new br,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,f=(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])+")"}};mo.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=mo.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(),mo.VERBOSE&&dr.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};mo.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ui||this._input instanceof da||this._input instanceof Vr))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)};mo.prototype.getErrorIndicator=function(){return this._errorIndicator};mo.prototype.checkMinimumDistance=function(t,e,n){var i=new mr(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")};gr.prototype.report=function(t){if(!gr.VERBOSE)return null;dr.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))};gr.prototype.getErrorMessage=function(){return this._errorMsg};gr.prototype.interfaces_=function(){return[]};gr.prototype.getClass=function(){return gr};gr.isValidMsg=function(t,e,n){var i=new gr(t,e,n);return i.isValid()?null:i.getErrorMessage()};gr.isValid=function(t,e,n){var i=new gr(t,e,n);return!!i.isValid()};ay.VERBOSE.get=function(){return!1};ay.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties(gr,ay);var $s=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};$s.prototype.getCoordinates=function(){return this._pts};$s.prototype.size=function(){return this._pts.length};$s.prototype.getCoordinate=function(t){return this._pts[t]};$s.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};$s.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:oc.octant(this.getCoordinate(t),this.getCoordinate(t+1))};$s.prototype.setData=function(t){this._data=t};$s.prototype.getData=function(){return this._data};$s.prototype.toString=function(){return ys.toLineString(new wi(this._pts))};$s.prototype.interfaces_=function(){return[va]};$s.prototype.getClass=function(){return $s};var ar=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new ce,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};ar.prototype.getInteriorIntersection=function(){return this._interiorIntersection};ar.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t};ar.prototype.getIntersectionSegments=function(){return this._intSegments};ar.prototype.count=function(){return this._intersectionCount};ar.prototype.getIntersections=function(){return this._intersections};ar.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};ar.prototype.setKeepIntersections=function(t){this._keepIntersections=t};ar.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],f=t.getCoordinates()[e+1],u=n.getCoordinates()[i],v=n.getCoordinates()[i+1];this._li.computeIntersection(c,f,u,v),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=c,this._intSegments[1]=f,this._intSegments[2]=u,this._intSegments[3]=v,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};ar.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2};ar.prototype.hasIntersection=function(){return this._interiorIntersection!==null};ar.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};ar.prototype.interfaces_=function(){return[gu]};ar.prototype.getClass=function(){return ar};ar.createAllIntersectionsFinder=function(t){var e=new ar(t);return e.setFindAllIntersections(!0),e};ar.createAnyIntersectionFinder=function(t){return new ar(t)};ar.createIntersectionCounter=function(t){var e=new ar(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Is=function(){this._li=new Su,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Is.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};Is.prototype.getIntersections=function(){return this._segInt.getIntersections()};Is.prototype.isValid=function(){return this.execute(),this._isValid};Is.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};Is.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new ar(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new iy;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};Is.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ka(this.getErrorMessage(),this._segInt.getInteriorIntersection())};Is.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])};Is.prototype.interfaces_=function(){return[]};Is.prototype.getClass=function(){return Is};Is.computeIntersections=function(t){var e=new Is(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var vu=function t(){this._nv=null;var e=arguments[0];this._nv=new Is(t.toSegmentStrings(e))};vu.prototype.checkValid=function(){this._nv.checkValid()};vu.prototype.interfaces_=function(){return[]};vu.prototype.getClass=function(){return vu};vu.toSegmentStrings=function(t){for(var e=new ce,n=t.iterator();n.hasNext();){var i=n.next();e.add(new $s(i.getCoordinates(),i))}return e};vu.checkValid=function(t){var e=new vu(t);e.checkValid()};var hc=function(t){this._mapOp=t};hc.prototype.map=function(t){for(var e=this,n=new ce,i=0;i0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)};no.prototype.interfaces_=function(){return[]};no.prototype.getClass=function(){return no};var wa=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new ke,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof di&&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}};wa.prototype.snapVertices=function(t,e){for(var n=this,i=this._isClosed?t.size()-1:t.size(),s=0;s=0&&t.add(f+1,new Ct(c),!1)}};wa.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(Si.computeOverlaySnapTolerance(s),Si.computeOverlaySnapTolerance(c))}};Si.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),i=n*Si.SNAP_PRECISION_FACTOR;return i};Si.snapToSelf=function(t,e,n){var i=new Si(t);return i.snapToSelf(e,n)};eb.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(Si,eb);var nb=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 wa(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}(no),Rr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Rr.prototype.getCommon=function(){return Ze.longBitsToDouble(this._commonBits)};Rr.prototype.add=function(t){var e=Ze.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=Rr.signExpBits(this._commonBits),this._isFirst=!1,null;var n=Rr.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Rr.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=Rr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};Rr.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}};Rr.prototype.interfaces_=function(){return[]};Rr.prototype.getClass=function(){return Rr};Rr.getBit=function(t,e){var n=1<>52};Rr.zeroLowerBits=function(t,e){var n=(1<=0;i--){if(Rr.getBit(t,i)!==Rr.getBit(e,i))return n;n++}return 52};var Dl=function(){this._commonCoord=null,this._ccFilter=new pc},ly={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 Ct(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};ly.CommonCoordinateFilter.get=function(){return pc};ly.Translater.get=function(){return Rl};Object.defineProperties(Dl,ly);var pc=function(){this._commonBitsX=new Rr,this._commonBitsY=new Rr};pc.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)};pc.prototype.getCommonCoordinate=function(){return new Ct(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};pc.prototype.interfaces_=function(){return[ga]};pc.prototype.getClass=function(){return pc};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 lr=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()};lr.prototype.selfSnap=function(t){var e=new Si(t),n=e.snapTo(t,this._snapTolerance);return n};lr.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};lr.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t};lr.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Ye.overlayOp(e[0],e[1],t);return this.prepareResult(n)};lr.prototype.checkValid=function(t){t.isValid()||dr.out.println("Snapped geometry is invalid")};lr.prototype.computeSnapTolerance=function(){this._snapTolerance=Si.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};lr.prototype.snap=function(t){var e=this.removeCommonBits(t),n=Si.snap(e[0],e[1],this._snapTolerance);return n};lr.prototype.interfaces_=function(){return[]};lr.prototype.getClass=function(){return lr};lr.overlayOp=function(t,e,n){var i=new lr(t,e);return i.getResultGeometry(n)};lr.union=function(t,e){return lr.overlayOp(t,e,Ye.UNION)};lr.intersection=function(t,e){return lr.overlayOp(t,e,Ye.INTERSECTION)};lr.symDifference=function(t,e){return lr.overlayOp(t,e,Ye.SYMDIFFERENCE)};lr.difference=function(t,e){return lr.overlayOp(t,e,Ye.DIFFERENCE)};var qr=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};qr.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=Ye.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(n=!0)}catch(c){if(c instanceof Xa)i=c;else throw c}finally{}if(!n)try{e=lr.overlayOp(this._geom[0],this._geom[1],t)}catch(c){throw c instanceof Xa?i:c}finally{}return e};qr.prototype.interfaces_=function(){return[]};qr.prototype.getClass=function(){return qr};qr.overlayOp=function(t,e,n){var i=new qr(t,e);return i.getResultGeometry(n)};qr.union=function(t,e){return qr.overlayOp(t,e,Ye.UNION)};qr.intersection=function(t,e){return qr.overlayOp(t,e,Ye.INTERSECTION)};qr.symDifference=function(t,e){return qr.overlayOp(t,e,Ye.SYMDIFFERENCE)};qr.difference=function(t,e){return qr.overlayOp(t,e,Ye.DIFFERENCE)};var Rp=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Rp.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)};Rp.prototype.interfaces_=function(){return[]};Rp.prototype.getClass=function(){return Rp};var xo=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}},uy={INSERT:{configurable:!0},DELETE:{configurable:!0}};xo.prototype.isDelete=function(){return this._eventType===xo.DELETE};xo.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t};xo.prototype.getObject=function(){return this._obj};xo.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0};xo.prototype.getInsertEvent=function(){return this._insertEvent};xo.prototype.isInsert=function(){return this._eventType===xo.INSERT};xo.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label};xo.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};xo.prototype.interfaces_=function(){return[ns]};xo.prototype.getClass=function(){return xo};uy.INSERT.get=function(){return 1};uy.DELETE.get=function(){return 2};Object.defineProperties(xo,uy);var Im=function(){};Im.prototype.interfaces_=function(){return[]};Im.prototype.getClass=function(){return Im};var _r=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};_r.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(_r.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};_r.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};_r.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t};_r.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};_r.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};_r.prototype.hasProperIntersection=function(){return this._hasProper};_r.prototype.hasIntersection=function(){return this._hasIntersection};_r.prototype.isDone=function(){return this._isDone};_r.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))};_r.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e};_r.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],f=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,c,f,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))))};_r.prototype.interfaces_=function(){return[]};_r.prototype.getClass=function(){return _r};_r.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var CE=function(t){function e(){t.call(this),this.events=new ce,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};Np.prototype.interfaces_=function(){return[Lh]};Np.prototype.getClass=function(){return Np};var TE=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}(Sa),LE=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}(Sa),Ia=function(){this._leaves=new ce,this._root=null,this._level=0};Ia.prototype.buildTree=function(){var t=this;bs.sort(this._leaves,new Sa.NodeComparator);for(var e=this._leaves,n=null,i=new ce;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);n=e,e=i,i=n}};Ia.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 TE(t,e,n))};Ia.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)};Ia.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};Ia.prototype.printNode=function(t){dr.out.println(ys.toLineString(new Ct(t._min,this._level),new Ct(t._max,this._level)))};Ia.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};Ia.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 f=c.next();i[s++]=f.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===At.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=cn.removeRepeatedPoints(n.getCoordinates());if(c.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=c[0],null;var f=i,u=s;ge.isCCW(c)&&(f=s,u=i);var v=new Sm(c,new Dn(this._argIndex,At.BOUNDARY,f,u));this._lineEdgeMap.put(n,v),this.insertEdge(v),this.insertPoint(this._argIndex,c[0],At.BOUNDARY)},e.prototype.insertPoint=function(n,i,s){var c=this._nodes.addNode(i),f=c.getLabel();f===null?c._label=new Dn(n,s):f.setLocation(n,s)},e.prototype.createEdgeSetIntersector=function(){return new CE},e.prototype.addSelfIntersectionNodes=function(n){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var c=s.next(),f=c.getLabel().getLocation(n),u=c.eiList.iterator();u.hasNext();){var v=u.next();i.addSelfIntersectionNode(n,v.coord,f)}},e.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof da&&(this._useBoundaryDeterminationRule=!1),n instanceof Ui)this.addPolygon(n);else if(n instanceof di)this.addLineString(n);else if(n instanceof _o)this.addPoint(n);else if(n instanceof Nh)this.addCollection(n);else if(n instanceof pu)this.addCollection(n);else if(n instanceof da)this.addCollection(n);else if(n instanceof Vr)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 Gh(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)?At.BOUNDARY:At.INTERIOR},e}(ai),jh=function(){if(this._li=new Su,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 sp(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=$o.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 sp(0,e,i),this._arg[1]=new sp(1,n,i)}else if(arguments.length===3){var s=arguments[0],c=arguments[1],f=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 sp(0,s,f),this._arg[1]=new sp(1,c,f)}};jh.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()};jh.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)};jh.prototype.interfaces_=function(){return[]};jh.prototype.getClass=function(){return jh};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 ce,i=0;i=t.size()?null:t.get(e)};Ai.union=function(t){var e=new Ai(t);return e.union()};ob.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(Ai,ob);var Em=function(){};Em.prototype.interfaces_=function(){return[]};Em.prototype.getClass=function(){return Em};Em.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ye.createEmptyResult(Ye.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),qr.overlayOp(t,e,Ye.UNION)};function Iu(){return new Cm}function Cm(){this.reset()}Cm.prototype={constructor:Cm,reset:function(){this.s=this.t=0},add:function(t){Dv(om,t,this.t),Dv(this,om.s,this.s),this.s?this.t+=om.t:this.s=om.t},valueOf:function(){return this.s}};var om=new Cm;function Dv(t,e,n){var i=t.s=e+n,s=i-e,c=i-s;t.t=e-c+(n-s)}var pi=1e-6,Bn=Math.PI,Wa=Bn/2,Rv=Bn/4,$a=Bn*2,iu=180/Bn,Fs=Bn/180,Or=Math.abs,ME=Math.atan,Wh=Math.atan2,Fi=Math.cos,Bi=Math.sin,nf=Math.sqrt;function sb(t){return t>1?0:t<-1?Bn:Math.acos(t)}function dc(t){return t>1?Wa:t<-1?-Wa:Math.asin(t)}function pp(){}function Tm(t,e){t&&zv.hasOwnProperty(t.type)&&zv[t.type](t,e)}var Nv={Feature:function(t,e){Tm(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,s=n.length;++iBn?t-$a:t<-Bn?t+$a:t,e]}R_.invert=R_;function AE(t,e,n){return(t%=$a)?e||n?ab(Bv(t),Vv(e,n)):Bv(t):e||n?Vv(e,n):R_}function Fv(t){return function(e,n){return e+=t,[e>Bn?e-$a:e<-Bn?e+$a:e,n]}}function Bv(t){var e=Fv(t);return e.invert=Fv(-t),e}function Vv(t,e){var n=Fi(t),i=Bi(t),s=Fi(e),c=Bi(e);function f(u,v){var w=Fi(v),I=Fi(u)*w,L=Bi(u)*w,A=Bi(v),U=A*n+I*i;return[Wh(L*s-U*c,I*n-A*i),dc(U*s+L*c)]}return f.invert=function(u,v){var w=Fi(v),I=Fi(u)*w,L=Bi(u)*w,A=Bi(v),U=A*s-L*c;return[Wh(L*s+A*c,I*n+U*i),dc(U*n-I*i)]},f}function kE(t,e,n,i,s,c){if(n){var f=Fi(e),u=Bi(e),v=i*n;s==null?(s=e+i*$a,c=e-v/2):(s=Uv(f,s),c=Uv(f,c),(i>0?sc)&&(s+=i*$a));for(var w,I=s;i>0?I>c:I1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function DE(t,e,n,i,s,c){var f=t[0],u=t[1],v=e[0],w=e[1],I=0,L=1,A=v-f,U=w-u,z;if(z=n-f,!(!A&&z>0)){if(z/=A,A<0){if(z0){if(z>L)return;z>I&&(I=z)}if(z=s-f,!(!A&&z<0)){if(z/=A,A<0){if(z>L)return;z>I&&(I=z)}else if(A>0){if(z0)){if(z/=U,U<0){if(z0){if(z>L)return;z>I&&(I=z)}if(z=c-u,!(!U&&z<0)){if(z/=U,U<0){if(z>L)return;z>I&&(I=z)}else if(U>0){if(z0&&(t[0]=f+I*A,t[1]=u+I*U),L<1&&(e[0]=f+L*A,e[1]=u+L*U),!0}}}}}function dm(t,e){return Or(t[0]-e[0])=0;--u)s.point((L=I[u])[0],L[1]);else i(A.x,A.p.x,-1,s);A=A.p}A=A.o,I=A.z,U=!U}while(!A.v);s.lineEnd()}}}function Gv(t){if(e=t.length){for(var e,n=0,i=t[0],s;++ne?1:t>=e?0:NaN}function RE(t){return t.length===1&&(t=NE(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 NE(t){return function(e,n){return cb(t(e),n)}}RE(cb);function hb(t){for(var e=t.length,n,i=-1,s=0,c,f;++i=0;)for(f=t[e],n=f.length;--n>=0;)c[--s]=f[n];return c}var dp=1e9,um=-dp;function zE(t,e,n,i){function s(w,I){return t<=w&&w<=n&&e<=I&&I<=i}function c(w,I,L,A){var U=0,z=0;if(w==null||(U=f(w,L))!==(z=f(I,L))||v(w,I)<0^L>0)do A.point(U===0||U===3?t:n,U>1?i:e);while((U=(U+L+4)%4)!==z);else A.point(I[0],I[1])}function f(w,I){return Or(w[0]-t)0?0:3:Or(w[0]-n)0?2:1:Or(w[1]-e)0?1:0:I>0?3:2}function u(w,I){return v(w.x,I.x)}function v(w,I){var L=f(w,1),A=f(I,1);return L!==A?L-A:L===0?I[1]-w[1]:L===1?w[0]-I[0]:L===2?w[1]-I[1]:I[0]-w[0]}return function(w){var I=w,L=lb(),A,U,z,K,J,Q,O,G,j,lt,xt,dt={point:ht,lineStart:Lt,lineEnd:ee,polygonStart:Pt,polygonEnd:$};function ht(re,_e){s(re,_e)&&I.point(re,_e)}function ct(){for(var re=0,_e=0,qt=U.length;_ei&&(In-Ie)*(i-sn)>(dn-sn)*(t-Ie)&&++re:dn<=i&&(In-Ie)*(i-sn)<(dn-sn)*(t-Ie)&&--re;return re}function Pt(){I=L,A=[],U=[],xt=!0}function $(){var re=ct(),_e=xt&&re,qt=(A=hb(A)).length;(_e||qt)&&(w.polygonStart(),_e&&(w.lineStart(),c(null,null,1,w),w.lineEnd()),qt&&ub(A,u,re,c,w),w.polygonEnd()),I=w,A=U=z=null}function Lt(){dt.point=Tt,U&&U.push(z=[]),lt=!0,j=!1,O=G=NaN}function ee(){A&&(Tt(K,J),Q&&j&&L.rejoin(),A.push(L.result())),dt.point=ht,j&&I.lineEnd()}function Tt(re,_e){var qt=s(re,_e);if(U&&z.push([re,_e]),lt)K=re,J=_e,Q=qt,lt=!1,qt&&(I.lineStart(),I.point(re,_e));else if(qt&&j)I.point(re,_e);else{var Ne=[O=Math.max(um,Math.min(dp,O)),G=Math.max(um,Math.min(dp,G))],Ce=[re=Math.max(um,Math.min(dp,re)),_e=Math.max(um,Math.min(dp,_e))];DE(Ne,Ce,t,e,n,i)?(j||(I.lineStart(),I.point(Ne[0],Ne[1])),I.point(Ce[0],Ce[1]),qt||I.lineEnd(),xt=!1):qt&&(I.lineStart(),I.point(re,_e),xt=!1)}O=re,G=_e,j=qt}return dt}}var p_=Iu();function OE(t,e){var n=e[0],i=e[1],s=[Bi(n),-Fi(n),0],c=0,f=0;p_.reset();for(var u=0,v=t.length;u=0?1:-1,ht=dt*xt,ct=ht>Bn,Pt=z*j;if(p_.add(Wh(Pt*dt*Bi(ht),K*lt+Pt*Fi(ht))),c+=ct?xt+dt*$a:xt,ct^A>=n^O>=n){var $=Lm(Hh(L),Hh(Q));D_($);var Lt=Lm(s,$);D_(Lt);var ee=(ct^xt>=0?-1:1)*dc(Lt[2]);(i>ee||i===ee&&($[0]||$[1]))&&(f+=ct^xt>=0?1:-1)}}return(c<-pi||czp&&(zp=t),ePm&&(Pm=e)}Iu();function fb(t,e,n,i){return function(s,c){var f=e(c),u=s.invert(i[0],i[1]),v=lb(),w=e(v),I=!1,L,A,U,z={point:K,lineStart:Q,lineEnd:O,polygonStart:function(){z.point=G,z.lineStart=j,z.lineEnd=lt,A=[],L=[]},polygonEnd:function(){z.point=K,z.lineStart=Q,z.lineEnd=O,A=hb(A);var xt=OE(L,u);A.length?(I||(c.polygonStart(),I=!0),ub(A,VE,xt,n,c)):xt&&(I||(c.polygonStart(),I=!0),c.lineStart(),n(null,null,1,c),c.lineEnd()),I&&(c.polygonEnd(),I=!1),A=L=null},sphere:function(){c.polygonStart(),c.lineStart(),n(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function K(xt,dt){var ht=s(xt,dt);t(xt=ht[0],dt=ht[1])&&c.point(xt,dt)}function J(xt,dt){var ht=s(xt,dt);f.point(ht[0],ht[1])}function Q(){z.point=J,f.lineStart()}function O(){z.point=K,f.lineEnd()}function G(xt,dt){U.push([xt,dt]);var ht=s(xt,dt);w.point(ht[0],ht[1])}function j(){w.lineStart(),U=[]}function lt(){G(U[0][0],U[0][1]),w.lineEnd();var xt=w.clean(),dt=v.result(),ht,ct=dt.length,Pt,$,Lt;if(U.pop(),L.push(U),U=null,!!ct){if(xt&1){if($=dt[0],(Pt=$.length-1)>0){for(I||(c.polygonStart(),I=!0),c.lineStart(),ht=0;ht1&&xt&2&&dt.push(dt.pop().concat(dt.shift())),A.push(dt.filter(BE))}}return z}}function BE(t){return t.length>1}function VE(t,e){return((t=t.x)[0]<0?t[1]-Wa-pi:Wa-t[1])-((e=e.x)[0]<0?e[1]-Wa-pi:Wa-e[1])}const Zv=fb(function(){return!0},UE,qE,[-Bn,-Wa]);function UE(t){var e=NaN,n=NaN,i=NaN,s;return{lineStart:function(){t.lineStart(),s=1},point:function(c,f){var u=c>0?Bn:-Bn,v=Or(c-e);Or(v-Bn)0?Wa:-Wa),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(c,n),s=0):i!==u&&v>=Bn&&(Or(e-i)pi?ME((Bi(e)*(c=Fi(i))*Bi(n)-Bi(i)*(s=Fi(e))*Bi(t))/(s*c*f)):(e+i)/2}function qE(t,e,n,i){var s;if(t==null)s=n*Wa,i.point(-Bn,s),i.point(0,s),i.point(Bn,s),i.point(Bn,0),i.point(Bn,-s),i.point(0,-s),i.point(-Bn,-s),i.point(-Bn,0),i.point(-Bn,s);else if(Or(t[0]-e[0])>pi){var c=t[0]0,s=Or(n)>pi;function c(I,L,A,U){kE(U,t,e,A,I,L)}function f(I,L){return Fi(I)*Fi(L)>n}function u(I){var L,A,U,z,K;return{lineStart:function(){z=U=!1,K=1},point:function(J,Q){var O=[J,Q],G,j=f(J,Q),lt=i?j?0:w(J,Q):j?w(J+(J<0?Bn:-Bn),Q):0;if(!L&&(z=U=j)&&I.lineStart(),j!==U&&(G=v(L,O),(!G||dm(L,G)||dm(O,G))&&(O[0]+=pi,O[1]+=pi,j=f(O[0],O[1]))),j!==U)K=0,j?(I.lineStart(),G=v(O,L),I.point(G[0],G[1])):(G=v(L,O),I.point(G[0],G[1]),I.lineEnd()),L=G;else if(s&&L&&i^j){var xt;!(lt&A)&&(xt=v(O,L,!0))&&(K=0,i?(I.lineStart(),I.point(xt[0][0],xt[0][1]),I.point(xt[1][0],xt[1][1]),I.lineEnd()):(I.point(xt[1][0],xt[1][1]),I.lineEnd(),I.lineStart(),I.point(xt[0][0],xt[0][1])))}j&&(!L||!dm(L,O))&&I.point(O[0],O[1]),L=O,U=j,A=lt},lineEnd:function(){U&&I.lineEnd(),L=null},clean:function(){return K|(z&&U)<<1}}}function v(I,L,A){var U=Hh(I),z=Hh(L),K=[1,0,0],J=Lm(U,z),Q=sm(J,J),O=J[0],G=Q-O*O;if(!G)return!A&&I;var j=n*Q/G,lt=-n*O/G,xt=Lm(K,J),dt=am(K,j),ht=am(J,lt);f_(dt,ht);var ct=xt,Pt=sm(dt,ct),$=sm(ct,ct),Lt=Pt*Pt-$*(sm(dt,dt)-1);if(!(Lt<0)){var ee=nf(Lt),Tt=am(ct,(-Pt-ee)/$);if(f_(Tt,dt),Tt=k_(Tt),!A)return Tt;var re=I[0],_e=L[0],qt=I[1],Ne=L[1],Ce;_e0^Tt[1]<(Or(Tt[0]-re)Bn^(re<=Tt[0]&&Tt[0]<=_e)){var sn=am(ct,(-Pt+ee)/$);return f_(sn,dt),[Tt,k_(sn)]}}}function w(I,L){var A=i?t:Bn-t,U=0;return I<-A?U|=1:I>A&&(U|=2),L<-A?U|=4:L>A&&(U|=8),U}return fb(f,u,c,i?[0,-t]:[-Bn,t-Bn])}function pb(t){return function(e){var n=new N_;for(var i in t)n[i]=t[i];return n.stream=e,n}}function N_(){}N_.prototype={constructor:N_,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 db(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),PE(n,t.stream(jv));var f=jv.result(),u=Math.min(i/(f[1][0]-f[0][0]),s/(f[1][1]-f[0][1])),v=+e[0][0]+(i-u*(f[1][0]+f[0][0]))/2,w=+e[0][1]+(s-u*(f[1][1]+f[0][1]))/2;return c!=null&&t.clipExtent(c),t.scale(u*150).translate([v,w])}function ZE(t,e,n){return db(t,[[0,0],e],n)}var Wv=16,WE=Fi(30*Fs);function Hv(t,e){return+e?XE(t,e):HE(t)}function HE(t){return pb({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function XE(t,e){function n(i,s,c,f,u,v,w,I,L,A,U,z,K,J){var Q=w-i,O=I-s,G=Q*Q+O*O;if(G>4*e&&K--){var j=f+A,lt=u+U,xt=v+z,dt=nf(j*j+lt*lt+xt*xt),ht=dc(xt/=dt),ct=Or(Or(xt)-1)e||Or((Q*ee+O*Tt)/G-.5)>.3||f*A+u*U+v*z2?Tt[2]%360*Fs:0,Lt()):[w*iu,I*iu,L*iu]},ct.precision=function(Tt){return arguments.length?(xt=Hv($,lt=Tt*Tt),ee()):nf(lt)},ct.fitExtent=function(Tt,re){return db(ct,Tt,re)},ct.fitSize=function(Tt,re){return ZE(ct,Tt,re)};function Lt(){U=ab(A=AE(w,I,L),e);var Tt=e(u,v);return c=i-Tt[0]*n,f=s+Tt[1]*n,ee()}function ee(){return dt=ht=null,ct}return function(){return e=t.apply(this,arguments),ct.invert=e.invert&&Pt,Lt()}}function mb(t){return function(e,n){var i=Fi(e),s=Fi(n),c=t(i*s);return[c*s*Bi(e),c*Bi(n)]}}function gb(t){return function(e,n){var i=nf(e*e+n*n),s=t(i),c=Bi(s),f=Fi(s);return[Wh(e*c,i*f),dc(i&&n*c/i)]}}var QE=mb(function(t){return nf(2/(1+t))});QE.invert=gb(function(t){return 2*dc(t/2)});var _b=mb(function(t){return(t=sb(t))&&t/Bi(t)});_b.invert=gb(function(t){return t});function $E(){return KE(_b).scale(79.4188).clipAngle(180-.001)}function Xv(t,e){return[t,e]}Xv.invert=Xv;function tC(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 kx(t,function(f){var u=mm(f,e,i,s);u&&c.push(u)}),L_(c);case"FeatureCollection":return Lv(t,function(f){var u=mm(f,e,i,s);u&&Lv(u,function(v){v&&c.push(v)})}),L_(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 f=[];return kx(t,function(K){var J=mm(K,e,n,i);J&&f.push(J)}),L_(f)}var u=eC(c),v={type:c.type,coordinates:vb(c.coordinates,u)},w=new ny,I=w.read(v),L=lE(uE(e,n),"meters"),A=fr.bufferOp(I,L,i),U=new Gx;if(A=U.write(A),!yb(A.coordinates)){var z={type:A.type,coordinates:xb(A.coordinates,u)};return Om(z,s)}}function yb(t){return Array.isArray(t[0])?yb(t[0]):isNaN(t[0])}function vb(t,e){return typeof t[0]!="object"?e(t):t.map(function(n){return vb(n,e)})}function xb(t,e){return typeof t[0]!="object"?e.invert(t):t.map(function(n){return xb(n,e)})}function eC(t){var e=hE(t).geometry.coordinates,n=[-e[0],-e[1]];return $E().rotate(n).scale(ko)}function nC(t,e){var n=xm(t),i=xm(e),s=t.properties||{},c=Tx.difference(n.coordinates,i.coordinates);return c.length===0?null:c.length===1?Mx(c[0],s):Px(c,s)}function Yv(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 Kv(t,e){const n=nC({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},t);if(!n)return;n.properties={isMask:"y"};const i=tC(t,0);if(i.geometry.type==="Polygon")for(const s of i.geometry.coordinates)Yv(s);else for(const s of i.geometry.coordinates)for(const c of s)Yv(c);e({type:"FeatureCollection",features:[i,n]})}let Jv={type:"FeatureCollection",features:[]};function iC(t,e,n=!0,i=!0,s={},c={},f={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,v=[],w,I;function L(){(f!=null&&f.fill||f!=null&&f.line)&&t.addSource("full-geom",{type:"geojson",data:Jv}),f!=null&&f.fill&&t.addLayer({...f==null?void 0:f.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),f!=null&&f.line&&t.addLayer({...f==null?void 0:f.line,id:"full-geom-line",type:"line",source:"full-geom"})}t.loaded()?L():t.once("load",()=>{L()});const A=z=>{u==null||u({type:"mapClick",coordinates:[z.lngLat.lng,z.lngLat.lat]})};function U(z=!1){if(!e)throw new Error;const K=document.createElement("div");return z&&K.classList.add("marker-interactive"),new kI({props:{displayIn:"maplibre"},target:K}),new e.Marker({element:K,offset:[1,-13]})}return{setEventHandler(z){z?(u=z,t.on("click",A)):(u=void 0,t.off("click",A))},flyTo(z,K){t.flyTo({center:z,zoom:K,...s})},fitBounds(z,K,J){t.fitBounds([[z[0],z[1]],[z[2],z[3]]],{padding:K,maxZoom:J,...c})},indicateReverse(z){t.getCanvasContainer().style.cursor=z?"crosshair":""},setReverseMarker(z){!e||!n||(I?z?I.setLngLat(z):(I.remove(),I=void 0):z&&(I=(typeof n=="object"?new e.Marker(n):U()).setLngLat(z).addTo(t),I.getElement().classList.add("marker-reverse")))},setMarkers(z,K){if(!n)return;function J(Q){var O;(O=t.getSource("full-geom"))==null||O.setData(Q)}for(const Q of v)Q.remove();if(v.length=0,J(Jv),!!e){if(K){let Q=!1;if(K.geometry.type==="GeometryCollection"){const O=K.geometry.geometries.filter(G=>G.type==="Polygon"||G.type==="MultiPolygon");if(O.length>0){let G=O.pop();for(const j of O)G=cE(G,j);Kv({...K,geometry:G},J),Q=!0}else{const G=K.geometry.geometries.filter(j=>j.type==="LineString"||j.type==="MultiLineString");G.length>0&&(J({...K,geometry:{type:"GeometryCollection",geometries:G}}),Q=!0)}}if(!Q){if(K.geometry.type==="Polygon"||K.geometry.type==="MultiPolygon")Kv(K,J);else if(K.geometry.type==="LineString"||K.geometry.type==="MultiLineString"){J(K);return}}n&&v.push((typeof n=="object"?new e.Marker(n):U()).setLngLat(K.center).addTo(t))}if(i)for(const Q of z??[]){if(Q===K)continue;const O=(typeof i=="object"?new e.Marker(i):U(!0)).setLngLat(Q.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(Q.place_type[0]==="reverse"?Q.place_name:Q.place_name.replace(/,.*/,""))).addTo(t),G=O.getElement();G.addEventListener("click",j=>{j.stopPropagation(),u==null||u({type:"markerClick",id:Q.id})}),G.addEventListener("mouseenter",()=>{u==null||u({type:"markerMouseEnter",id:Q.id}),O.togglePopup()}),G.addEventListener("mouseleave",()=>{u==null||u({type:"markerMouseLeave",id:Q.id}),O.togglePopup()}),v.push(O)}}},setSelectedMarker(z){w&&w.getElement().classList.toggle("marker-selected",!1),w=z>-1?v[z]:void 0,w==null||w.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const z=t.getCenter();return[t.getZoom(),z.lng,z.lat]}}}function rC(t){let e,n;return{c(){e=Sl("svg"),n=Sl("path"),Zt(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"),Zt(e,"viewBox","0 0 14 14"),Zt(e,"width","13"),Zt(e,"height","13"),Zt(e,"class","svelte-en2qvf")},m(i,s){Ut(i,e,s),Gt(e,n)},p:Oe,i:Oe,o:Oe,d(i){i&&Vt(e)}}}class bb extends fn{constructor(e){super(),hn(this,e,null,rC,en,{})}}function oC(t){let e,n;return{c(){e=Sl("svg"),n=Sl("path"),Zt(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"),Zt(e,"viewBox","0 0 30 30"),Zt(e,"fill","none"),Zt(e,"xmlns","http://www.w3.org/2000/svg"),Zt(e,"class","svelte-d2loi5")},m(i,s){Ut(i,e,s),Gt(e,n)},p:Oe,i:Oe,o:Oe,d(i){i&&Vt(e)}}}class wb extends fn{constructor(e){super(),hn(this,e,null,oC,en,{})}}function sC(t){let e,n;return{c(){e=jt("img"),go(e.src,n=t[3]+"area.svg")||Zt(e,"src",n),Zt(e,"alt",t[6]),Zt(e,"class","svelte-ltkwvy")},m(i,s){Ut(i,e,s)},p(i,s){s&8&&!go(e.src,n=i[3]+"area.svg")&&Zt(e,"src",n),s&64&&Zt(e,"alt",i[6])},d(i){i&&Vt(e)}}}function aC(t){let e,n;return{c(){e=jt("img"),go(e.src,n=t[3]+"reverse.svg")||Zt(e,"src",n),Zt(e,"alt",t[6]),Zt(e,"class","svelte-ltkwvy")},m(i,s){Ut(i,e,s)},p(i,s){s&8&&!go(e.src,n=i[3]+"reverse.svg")&&Zt(e,"src",n),s&64&&Zt(e,"alt",i[6])},d(i){i&&Vt(e)}}}function lC(t){let e,n;return{c(){e=jt("img"),go(e.src,n=t[3]+"poi.svg")||Zt(e,"src",n),Zt(e,"alt",t[6]),Zt(e,"class","svelte-ltkwvy")},m(i,s){Ut(i,e,s)},p(i,s){s&8&&!go(e.src,n=i[3]+"poi.svg")&&Zt(e,"src",n),s&64&&Zt(e,"alt",i[6])},d(i){i&&Vt(e)}}}function uC(t){let e,n;return{c(){e=jt("img"),go(e.src,n=t[3]+"postal_code.svg")||Zt(e,"src",n),Zt(e,"alt",t[6]),Zt(e,"class","svelte-ltkwvy")},m(i,s){Ut(i,e,s)},p(i,s){s&8&&!go(e.src,n=i[3]+"postal_code.svg")&&Zt(e,"src",n),s&64&&Zt(e,"alt",i[6])},d(i){i&&Vt(e)}}}function cC(t){let e,n;return{c(){e=jt("img"),go(e.src,n=t[3]+"street.svg")||Zt(e,"src",n),Zt(e,"alt",t[6]),Zt(e,"class","svelte-ltkwvy")},m(i,s){Ut(i,e,s)},p(i,s){s&8&&!go(e.src,n=i[3]+"street.svg")&&Zt(e,"src",n),s&64&&Zt(e,"alt",i[6])},d(i){i&&Vt(e)}}}function hC(t){let e,n;return{c(){e=jt("img"),go(e.src,n=t[3]+"road.svg")||Zt(e,"src",n),Zt(e,"alt",t[6]),Zt(e,"class","svelte-ltkwvy")},m(i,s){Ut(i,e,s)},p(i,s){s&8&&!go(e.src,n=i[3]+"road.svg")&&Zt(e,"src",n),s&64&&Zt(e,"alt",i[6])},d(i){i&&Vt(e)}}}function fC(t){let e,n;return{c(){e=jt("img"),go(e.src,n=t[3]+"housenumber.svg")||Zt(e,"src",n),Zt(e,"alt",t[6]),Zt(e,"class","svelte-ltkwvy")},m(i,s){Ut(i,e,s)},p(i,s){s&8&&!go(e.src,n=i[3]+"housenumber.svg")&&Zt(e,"src",n),s&64&&Zt(e,"alt",i[6])},d(i){i&&Vt(e)}}}function pC(t){let e,n,i,s;return{c(){e=jt("img"),go(e.src,n=t[5])||Zt(e,"src",n),Zt(e,"alt",t[4]),Zt(e,"class","svelte-ltkwvy")},m(c,f){Ut(c,e,f),i||(s=$e(e,"error",t[14]),i=!0)},p(c,f){f&32&&!go(e.src,n=c[5])&&Zt(e,"src",n),f&16&&Zt(e,"alt",c[4])},d(c){c&&Vt(e),i=!1,s()}}}function Qv(t){let e,n;return{c(){e=jt("span"),n=Cn(t[6]),Zt(e,"class","secondary svelte-ltkwvy")},m(i,s){Ut(i,e,s),Gt(e,n)},p(i,s){s&64&&Br(n,i[6])},d(i){i&&Vt(e)}}}function dC(t){var dt,ht;let e,n,i,s,c,f,u,v,w=(t[7]?t[0].place_name:t[0].place_name.replace(/,.*/,""))+"",I,L,A=t[2]==="always"||t[2]&&!t[0].address&&((dt=t[0].properties)==null?void 0:dt.kind)!=="road"&&((ht=t[0].properties)==null?void 0:ht.kind)!=="road_relation"&&!t[0].id.startsWith("address.")&&!t[0].id.startsWith("postal_code.")&&(!t[0].id.startsWith("poi.")||!t[5])&&!t[7],U,z,K=(t[7]?"":t[0].place_name.replace(/[^,]*,?\s*/,""))+"",J,Q,O;function G(ct,Pt){var $,Lt;return Pt&1&&(n=null),Pt&1&&(i=null),Pt&1&&(s=null),ct[5]?pC:ct[0].address?fC:(($=ct[0].properties)==null?void 0:$.kind)==="road"||((Lt=ct[0].properties)==null?void 0:Lt.kind)==="road_relation"?hC:(n==null&&(n=!!ct[0].id.startsWith("address.")),n?cC:(i==null&&(i=!!ct[0].id.startsWith("postal_code.")),i?uC:(s==null&&(s=!!ct[0].id.startsWith("poi.")),s?lC:ct[7]?aC:sC)))}let j=G(t,-1),lt=j(t),xt=A&&Qv(t);return{c(){e=jt("li"),lt.c(),c=fe(),f=jt("span"),u=jt("span"),v=jt("span"),I=Cn(w),L=fe(),xt&&xt.c(),U=fe(),z=jt("span"),J=Cn(K),Zt(v,"class","primary svelte-ltkwvy"),Zt(u,"class","svelte-ltkwvy"),Zt(z,"class","line2 svelte-ltkwvy"),Zt(f,"class","texts svelte-ltkwvy"),Zt(e,"tabindex","0"),Zt(e,"data-selected",t[1]),Zt(e,"class","svelte-ltkwvy"),Za(e,"selected",t[1])},m(ct,Pt){Ut(ct,e,Pt),lt.m(e,null),Gt(e,c),Gt(e,f),Gt(f,u),Gt(u,v),Gt(v,I),Gt(u,L),xt&&xt.m(u,null),Gt(f,U),Gt(f,z),Gt(z,J),Q||(O=[$e(e,"mouseenter",t[12]),$e(e,"focus",t[13])],Q=!0)},p(ct,[Pt]){var $,Lt;j===(j=G(ct,Pt))&<?lt.p(ct,Pt):(lt.d(1),lt=j(ct),lt&&(lt.c(),lt.m(e,c))),Pt&1&&w!==(w=(ct[7]?ct[0].place_name:ct[0].place_name.replace(/,.*/,""))+"")&&Br(I,w),Pt&37&&(A=ct[2]==="always"||ct[2]&&!ct[0].address&&(($=ct[0].properties)==null?void 0:$.kind)!=="road"&&((Lt=ct[0].properties)==null?void 0:Lt.kind)!=="road_relation"&&!ct[0].id.startsWith("address.")&&!ct[0].id.startsWith("postal_code.")&&(!ct[0].id.startsWith("poi.")||!ct[5])&&!ct[7]),A?xt?xt.p(ct,Pt):(xt=Qv(ct),xt.c(),xt.m(u,null)):xt&&(xt.d(1),xt=null),Pt&1&&K!==(K=(ct[7]?"":ct[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Br(J,K),Pt&2&&Zt(e,"data-selected",ct[1]),Pt&2&&Za(e,"selected",ct[1])},i:Oe,o:Oe,d(ct){ct&&Vt(e),lt.d(),xt&&xt.d(),Q=!1,yr(O)}}}function mC(t,e,n){var G;let i,s,{feature:c}=e,{selected:f=!1}=e,{showPlaceType:u}=e,{missingIconsCache:v}=e,{iconsBaseUrl:w}=e;const I=(G=c.properties)==null?void 0:G.categories;let L,A,U=0,z=c.place_type[0]==="reverse";function K(j){A&&v.add(A),n(10,U++,U)}function J(j){Nn.call(this,t,j)}function Q(j){Nn.call(this,t,j)}const O=j=>K(j.currentTarget);return t.$$set=j=>{"feature"in j&&n(0,c=j.feature),"selected"in j&&n(1,f=j.selected),"showPlaceType"in j&&n(2,u=j.showPlaceType),"missingIconsCache"in j&&n(9,v=j.missingIconsCache),"iconsBaseUrl"in j&&n(3,w=j.iconsBaseUrl)},t.$$.update=()=>{var j,lt,xt,dt;if(t.$$.dirty&3640)do n(11,i--,i),n(4,L=I==null?void 0:I[i]),n(5,A=L?w+L.replace(/ /g,"_")+".svg":void 0);while(i>-1&&(!A||v.has(A)));t.$$.dirty&1&&n(6,s=c.id.startsWith("poi.")?(lt=(j=c.properties)==null?void 0:j.categories)==null?void 0:lt.join(", "):((dt=(xt=c.properties)==null?void 0:xt.place_type_name)==null?void 0:dt[0])??c.place_type[0])},n(11,i=(I==null?void 0:I.length)??0),[c,f,u,w,L,A,s,z,K,v,U,i,J,Q,O]}class gC extends fn{constructor(e){super(),hn(this,e,mC,dC,en,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function _C(t){let e;return{c(){e=jt("div"),e.innerHTML='',Zt(e,"class","svelte-7cmwmc")},m(n,i){Ut(n,e,i)},p:Oe,i:Oe,o:Oe,d(n){n&&Vt(e)}}}class yC extends fn{constructor(e){super(),hn(this,e,null,_C,en,{})}}function vC(t){let e,n;return{c(){e=Sl("svg"),n=Sl("path"),Zt(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"),Zt(e,"viewBox","0 0 60.006 21.412"),Zt(e,"width","14"),Zt(e,"height","20"),Zt(e,"class","svelte-en2qvf")},m(i,s){Ut(i,e,s),Gt(e,n)},p:Oe,i:Oe,o:Oe,d(i){i&&Vt(e)}}}class xC extends fn{constructor(e){super(),hn(this,e,null,vC,en,{})}}function bC(t){let e,n,i;return{c(){e=Sl("svg"),n=Sl("circle"),i=Sl("path"),Zt(n,"cx","4.789"),Zt(n,"cy","4.787"),Zt(n,"r","3.85"),or(n,"stroke-width","1.875"),or(n,"fill","none"),Zt(i,"d","M12.063 12.063 7.635 7.635"),or(i,"stroke-width","1.875"),or(i,"stroke-linecap","round"),Zt(e,"xmlns","http://www.w3.org/2000/svg"),Zt(e,"width","13"),Zt(e,"height","13"),Zt(e,"viewBox","0 0 13 13"),Zt(e,"class","svelte-1bpbt60")},m(s,c){Ut(s,e,c),Gt(e,n),Gt(e,i)},p:Oe,i:Oe,o:Oe,d(s){s&&Vt(e)}}}class wC extends fn{constructor(e){super(),hn(this,e,null,bC,en,{})}}function SC(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 $v(t){const e=[...t];return e[2]i[0]||s.maxZoom!=null&&s.maxZoomDate.now()){if(!ap.coords)break t;return ap.coords}let c;try{return c=await new Promise((f,u)=>{n.signal.addEventListener("abort",()=>{u(Error("aborted"))}),navigator.geolocation.getCurrentPosition(v=>{f([v.coords.longitude,v.coords.latitude].map(w=>w.toFixed(6)).join(","))},v=>{u(v)},s)}),c}catch{}finally{s.cachedLocationExpiry&&(ap={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 t1=/(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,e1=/(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,n1=/(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,i1=/(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 EC(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(f=>Number(f.trim()));let n=r1(e[0],t),i=r1(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 r1(t,e){const n=Math.abs(t),i=Math.floor(n),s=(n-i)*60;if(e=="DM"){let u=CC(s,3).toFixed(3).padStart(6,"0");return`${i}° ${u}'`}let c=Math.floor(s),f=((s-c)*60).toFixed(1).padStart(4,"0");return c=c.toString().padStart(2,"0"),`${i}° ${c}' ${f}"`}function CC(t,e){const n=Math.pow(10,e);return Math.round((t+Number.EPSILON)*n)/n}function hy(t,e){e||(e=5),t=t.replace(/\s+/g," ").trim();let n=null,i=null,s="",c="",f=[],u=!1;if(t1.test(t))if(f=t1.exec(t),u=cm(f),u){if(n=f[2],i=f[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");f[1]?(s=f[1],c=f[5]):f[4]&&(s=f[4],c=f[8])}else throw new Error("invalid decimal coordinate format");else if(e1.test(t))if(f=e1.exec(t),u=cm(f),u)n=Math.abs(parseInt(f[2])),f[4]&&(n+=f[4]/60),f[6]&&(n+=f[6].replace(",",".")/3600),parseInt(f[2])<0&&(n=-1*n),i=Math.abs(parseInt(f[9])),f[11]&&(i+=f[11]/60),f[13]&&(i+=f[13].replace(",",".")/3600),parseInt(f[9])<0&&(i=-1*i),f[1]?(s=f[1],c=f[8]):f[7]&&(s=f[7],c=f[14]);else throw new Error("invalid DMS coordinates format");else if(n1.test(t))if(f=n1.exec(t),u=cm(f),u)n=Math.abs(parseInt(f[2])),f[4]&&(n+=f[4]/60),f[6]&&(n+=f[6]/3600),parseInt(f[2])<0&&(n=-1*n),i=Math.abs(parseInt(f[10])),f[12]&&(i+=f[12]/60),f[14]&&(i+=f[14]/3600),parseInt(f[10])<0&&(i=-1*i),f[1]?(s=f[1],c=f[9]):f[8]&&(s=f[8],c=f[16]);else throw new Error("invalid DMS coordinates format");else if(i1.test(t))if(f=i1.exec(t),u=cm(f),u)n=Math.abs(parseInt(f[2])),f[4]&&(n+=f[4]/60),f[6]&&(n+=f[6]/3600),parseInt(f[2])<0&&(n=-1*n),i=Math.abs(parseInt(f[10])),f[12]&&(i+=f[12]/60),f[14]&&(i+=f[14]/3600),parseInt(f[10])<0&&(i=-1*i),f[1]?(s=f[1],c=f[9]):f[8]&&(s=f[8],c=f[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 v=/S|SOUTH/i;v.test(s)&&n>0&&(n=-1*n),v=/W|WEST/i,v.test(c)&&i>0&&(i=-1*i);const w=f[0].trim();let I,L;const A=/[,/;\u0020]/g,U=w.match(A);if(U==null){const J=Math.floor(t.length/2);I=w.substring(0,J).trim(),L=w.substring(J).trim()}else{let J;U.length%2==1?J=Math.floor(U.length/2):J=U.length/2-1;let Q=0;if(J==0)Q=w.indexOf(U[0]),I=w.substring(0,Q).trim(),L=w.substring(Q+1).trim();else{let O=0,G=0;for(;O<=J;)Q=w.indexOf(U[O],G),G=Q+1,O++;I=w.substring(0,Q).trim(),L=w.substring(Q+1).trim()}}const z=I.split(".");if(z.length==2&&z[1]==0&&z[1].length!=2)throw new Error("invalid coordinates format");const K=L.split(".");if(K.length==2&&K[1]==0&&K[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(I)||/^\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:I,verbatimLongitude:L,decimalLatitude:n,decimalLongitude:i,decimalCoordinates:`${n},${i}`,closeEnough:TC,toCoordinateFormat:EC})}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,...PC})}),[...t,...AC,...kC]}const RC=DC();hy.formats=RC.map(t=>t.verbatimCoordinates);const NC=hy;function s1(t,e,n){const i=t.slice();return i[81]=e[n],i[83]=n,i}function a1(t){let e,n;return e=new yC({}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function l1(t){let e,n,i,s,c;return n=new xC({}),{c(){e=jt("button"),Ae(n.$$.fragment),Zt(e,"type","button"),Zt(e,"title",t[9]),Zt(e,"class","svelte-zh3kmv"),Za(e,"active",t[0])},m(f,u){Ut(f,e,u),Me(n,e,null),i=!0,s||(c=$e(e,"click",t[67]),s=!0)},p(f,u){(!i||u[0]&512)&&Zt(e,"title",f[9]),(!i||u[0]&1)&&Za(e,"active",f[0])},i(f){i||(Rt(n.$$.fragment,f),i=!0)},o(f){Wt(n.$$.fragment,f),i=!1},d(f){f&&Vt(e),Pe(n),s=!1,c()}}}function zC(t){let e,n=[],i=new Map,s,c,f,u=po(t[14]);const v=w=>w[81].id+(w[81].address?","+w[81].address:"");for(let w=0;w{dt=null}),oi()),(!G||re[0]&2)&&Za(w,"displayable",Tt[1]!==""),Tt[5]===!0?ht?(ht.p(Tt,re),re[0]&32&&Rt(ht,1)):(ht=l1(Tt),ht.c(),Rt(ht,1),ht.m(i,z)):ht&&(ri(),Wt(ht,1,1,()=>{ht=null}),oi()),Pt&&Pt.p&&(!G||re[1]&134217728)&&Ir(Pt,ct,Tt,Tt[58],G?Sr(ct,Tt[58],re,null):Er(Tt[58]),null);let _e=J;J=ee(Tt),J===_e?~J&&Lt[J].p(Tt,re):(Q&&(ri(),Wt(Lt[_e],1,1,()=>{Lt[_e]=null}),oi()),~J?(Q=Lt[J],Q?Q.p(Tt,re):(Q=Lt[J]=$[J](Tt),Q.c()),Rt(Q,1),Q.m(n,null)):Q=null),(!G||re[0]&4&&O!==(O=gm(Tt[2])+" svelte-zh3kmv"))&&Zt(n,"class",O),(!G||re[0]&22)&&Za(n,"can-collapse",Tt[4]&&Tt[1]==="")},i(Tt){G||(Rt(xt),Rt(c.$$.fragment,Tt),Rt(L.$$.fragment,Tt),Rt(dt),Rt(ht),Rt(Pt,Tt),Rt(Q),G=!0)},o(Tt){Wt(xt),Wt(c.$$.fragment,Tt),Wt(L.$$.fragment,Tt),Wt(dt),Wt(ht),Wt(Pt,Tt),Wt(Q),G=!1},d(Tt){Tt&&(Vt(e),Vt(n)),Pe(c),t[61](null),Pe(L),dt&&dt.d(),ht&&ht.d(),Pt&&Pt.d(Tt),~J&&Lt[J].d(),j=!1,yr(lt)}}}function UC(t,e,n){let i,{$$slots:s={},$$scope:c}=e,{class:f=void 0}=e,{apiKey:u}=e,{bbox:v=void 0}=e,{clearButtonTitle:w="clear"}=e,{clearOnBlur:I=!1}=e,{collapsed:L=!1}=e,{country:A=void 0}=e,{debounceSearch:U=200}=e,{enableReverse:z=!1}=e,{errorMessage:K="Something went wrong…"}=e,{filter:J=()=>!0}=e,{flyTo:Q=!0}=e,{fuzzyMatch:O=!0}=e,{language:G=void 0}=e,{limit:j=void 0}=e,{mapController:lt=void 0}=e,{minLength:xt=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:ht="Search"}=e,{proximity:ct=[{type:"server-geolocation"}]}=e,{reverseActive:Pt=z==="always"}=e,{reverseButtonTitle:$="toggle reverse geocoding"}=e,{searchValue:Lt=""}=e,{showFullGeometry:ee=!0}=e,{showPlaceType:Tt="ifNeeded"}=e,{showResultsWhileTyping:re=!0}=e,{selectFirst:_e=!0}=e,{flyToSelected:qt=!1}=e,{markerOnSelected:Ne=!0}=e,{types:Ce=void 0}=e,{excludeTypes:pn=!1}=e,{zoom:Ve=16}=e,{maxZoom:Ie=18}=e,{apiUrl:sn="https://api.maptiler.com/geocoding"}=e,{fetchParameters:In={}}=e,{iconsBaseUrl:dn="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.2/icons/"}=e,{adjustUrlQuery:mn=Y=>{}}=e;function Pn(){Mt.focus()}function gi(){Mt.blur()}function Ci(Y,vt=!0){n(1,Lt=Y),vt?(n(15,We=-1),il()):(Gi(),setTimeout(()=>{Mt.focus(),Mt.select()}))}function _i(){n(14,mt=void 0),n(55,xe=void 0),n(15,We=-1)}function li(){n(54,St=[]),n(55,xe=void 0)}let Kt=!1,mt,St,xe,An="",Mt,We=-1,Ti,on=[],Wn,wo,rs,Ts;const Ca=new Set,vr=wu();_s(()=>{lt&&(lt.setEventHandler(void 0),lt.indicateReverse(!1),lt.setSelectedMarker(-1),lt.setMarkers(void 0,void 0))});function il(Y){if(wo&&(clearTimeout(wo),wo=void 0),We>-1&&mt)n(55,xe=mt[We]),n(1,Lt=xe.place_type[0]==="reverse"?xe.place_name:xe.place_name.replace(/,.*/,"")),n(18,Ti=void 0),n(54,St=void 0),n(15,We=-1);else if(Lt){const vt=Y||!os(Lt);te(Lt,{exact:!0}).then(()=>{n(54,St=mt),n(55,xe=void 0),vt&&Uo()}).catch(pt=>n(18,Ti=pt))}}function os(Y){try{return NC(Y,6)}catch{return!1}}async function te(Y,{byId:vt=!1,exact:pt=!1}={}){n(18,Ti=void 0),Wn==null||Wn.abort();const It=new AbortController;n(19,Wn=It);try{const Nt=os(Y),Ft=new URLSearchParams;if(G!==void 0&&Ft.set("language",Array.isArray(G)?G.join(","):G??""),Ce&&Ft.set("types",Ce.join(",")),pn&&Ft.set("excludeTypes",String(pn)),v&&Ft.set("bbox",v.map(Ge=>Ge.toFixed(6)).join(",")),A&&Ft.set("country",Array.isArray(A)?A.join(","):A),!vt&&!Nt){const Ge=await IC(lt,ct,It);Ge&&Ft.set("proximity",Ge),(pt||!re)&&Ft.set("autocomplete","false"),Ft.set("fuzzyMatch",String(O))}j!==void 0&&(!Nt||(Ce==null?void 0:Ce.length)===1)&&Ft.set("limit",String(j)),Ft.set("key",u),mn(Ft);const Ht=sn+"/"+encodeURIComponent(Nt?Nt.decimalLongitude+","+Nt.decimalLatitude:Y)+".json?"+Ft.toString();if(Ht===An){vt?(n(14,mt=void 0),n(55,xe=on[0])):n(14,mt=on);return}An=Ht;const we=await fetch(Ht,{signal:It.signal,...In});if(!we.ok)throw new Error(await we.text());const Te=await we.json();vr("response",{url:Ht,featureCollection:Te}),vt?(n(14,mt=void 0),n(55,xe=Te.features[0]),on=[xe]):(n(14,mt=Te.features.filter(J)),Nt&&mt.unshift({type:"Feature",properties:{},id:"reverse_"+Nt.decimalLongitude+"_"+Nt.decimalLatitude,text:Nt.decimalLatitude+", "+Nt.decimalLongitude,place_name:Nt.decimalLatitude+", "+Nt.decimalLongitude,place_type:["reverse"],center:[Nt.decimalLongitude,Nt.decimalLatitude],bbox:[Nt.decimalLongitude,Nt.decimalLatitude,Nt.decimalLongitude,Nt.decimalLatitude],geometry:{type:"Point",coordinates:[Nt.decimalLongitude,Nt.decimalLatitude]}}),on=mt,Nt&&Mt.focus())}catch(Nt){if(Nt&&typeof Nt=="object"&&"name"in Nt&&Nt.name==="AbortError")return;throw Nt}finally{It===Wn&&n(19,Wn=void 0)}}function Uo(){var pt;if(!(St!=null&&St.length)||!Q)return;const Y=[180,90,-180,-90],vt=!St.some(It=>!It.matching_text);for(const It of St)if(vt||!It.matching_text)for(const Nt of[0,1,2,3])Y[Nt]=Math[Nt<2?"min":"max"](Y[Nt],((pt=It.bbox)==null?void 0:pt[Nt])??It.center[Nt%2]);lt&&St.length>0&&(xe&&Y[0]===Y[2]&&Y[1]===Y[3]?lt.flyTo(xe.center,Ve):lt.fitBounds($v(Y),50,Ie))}function jr(Y){n(0,Pt=z==="always"),n(14,mt=void 0),n(55,xe=void 0),n(15,We=-1),Ci(Y[1].toFixed(6)+", "+SC(Y[0],[-180,180],!0).toFixed(6),!1)}function rl(Y){if(!mt)return;let vt=Y.key==="ArrowDown"?1:Y.key==="ArrowUp"?-1:0;vt&&(We===(_e?0:-1)&&vt===-1&&n(15,We=mt.length),n(15,We+=vt),We>=mt.length&&n(15,We=-1),We<0&&_e&&n(15,We=0),Y.preventDefault())}function Gi(Y=!0){if(n(18,Ti=void 0),re){if(wo&&clearTimeout(wo),Lt.length{te(vt).catch(pt=>n(18,Ti=pt))},Y?U:0)}else n(14,mt=void 0),n(18,Ti=void 0)}function se(Y){n(55,xe=Y),n(1,Lt=Y.place_name),n(15,We=-1)}const Ke=()=>Mt.focus();function Xe(Y){Cr[Y?"unshift":"push"](()=>{Mt=Y,n(17,Mt)})}function Li(){Lt=this.value,n(1,Lt),n(13,Kt),n(27,I)}const Go=()=>n(13,Kt=!0),He=()=>n(13,Kt=!1),oa=()=>Gi(),Di=()=>{n(1,Lt=""),Mt.focus()},st=()=>n(0,Pt=!Pt),B=()=>n(18,Ti=void 0),q=Y=>n(15,We=Y),X=Y=>se(Y),nt=()=>{_e||n(15,We=-1)},yt=()=>{};return t.$$set=Y=>{"class"in Y&&n(2,f=Y.class),"apiKey"in Y&&n(25,u=Y.apiKey),"bbox"in Y&&n(26,v=Y.bbox),"clearButtonTitle"in Y&&n(3,w=Y.clearButtonTitle),"clearOnBlur"in Y&&n(27,I=Y.clearOnBlur),"collapsed"in Y&&n(4,L=Y.collapsed),"country"in Y&&n(28,A=Y.country),"debounceSearch"in Y&&n(29,U=Y.debounceSearch),"enableReverse"in Y&&n(5,z=Y.enableReverse),"errorMessage"in Y&&n(6,K=Y.errorMessage),"filter"in Y&&n(30,J=Y.filter),"flyTo"in Y&&n(31,Q=Y.flyTo),"fuzzyMatch"in Y&&n(32,O=Y.fuzzyMatch),"language"in Y&&n(33,G=Y.language),"limit"in Y&&n(34,j=Y.limit),"mapController"in Y&&n(35,lt=Y.mapController),"minLength"in Y&&n(36,xt=Y.minLength),"noResultsMessage"in Y&&n(7,dt=Y.noResultsMessage),"placeholder"in Y&&n(8,ht=Y.placeholder),"proximity"in Y&&n(37,ct=Y.proximity),"reverseActive"in Y&&n(0,Pt=Y.reverseActive),"reverseButtonTitle"in Y&&n(9,$=Y.reverseButtonTitle),"searchValue"in Y&&n(1,Lt=Y.searchValue),"showFullGeometry"in Y&&n(38,ee=Y.showFullGeometry),"showPlaceType"in Y&&n(10,Tt=Y.showPlaceType),"showResultsWhileTyping"in Y&&n(39,re=Y.showResultsWhileTyping),"selectFirst"in Y&&n(11,_e=Y.selectFirst),"flyToSelected"in Y&&n(40,qt=Y.flyToSelected),"markerOnSelected"in Y&&n(41,Ne=Y.markerOnSelected),"types"in Y&&n(42,Ce=Y.types),"excludeTypes"in Y&&n(43,pn=Y.excludeTypes),"zoom"in Y&&n(44,Ve=Y.zoom),"maxZoom"in Y&&n(45,Ie=Y.maxZoom),"apiUrl"in Y&&n(46,sn=Y.apiUrl),"fetchParameters"in Y&&n(47,In=Y.fetchParameters),"iconsBaseUrl"in Y&&n(12,dn=Y.iconsBaseUrl),"adjustUrlQuery"in Y&&n(48,mn=Y.adjustUrlQuery),"$$scope"in Y&&n(58,c=Y.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&134225920&&setTimeout(()=>{n(16,rs=Kt),I&&!Kt&&n(1,Lt="")}),t.$$.dirty[0]&16386|t.$$.dirty[1]&32&&Lt.lengthn(18,Ti=Y)),t.$$.dirty[1]&50356241&&(lt&&xe&&xe.id!==Ts&&Q&&(!xe.bbox||xe.bbox[0]===xe.bbox[2]&&xe.bbox[1]===xe.bbox[3]?lt.flyTo(xe.center,xe.id.startsWith("poi.")||xe.id.startsWith("address.")?Ie:Ve):lt.fitBounds($v(xe.bbox),50,Ie),n(14,mt=void 0),n(54,St=void 0),n(15,We=-1)),n(56,Ts=xe==null?void 0:xe.id)),t.$$.dirty[0]&18432&&_e&&mt!=null&&mt.length&&n(15,We=0),t.$$.dirty[0]&2050&&(_e||n(15,We=-1)),t.$$.dirty[0]&16384|t.$$.dirty[1]&8388608&&St!==mt&&n(54,St=void 0),t.$$.dirty[0]&81921|t.$$.dirty[1]&8388624&<&<.setEventHandler(Y=>{switch(Y.type){case"mapClick":Pt&&jr(Y.coordinates);break;case"markerClick":{const vt=mt==null?void 0:mt.find(pt=>pt.id===Y.id);vt&&se(vt)}break;case"markerMouseEnter":St&&n(15,We=rs?(mt==null?void 0:mt.findIndex(vt=>vt.id===Y.id))??-1:-1);break;case"markerMouseLeave":St&&n(15,We=-1);break}}),t.$$.dirty[0]&49152&&n(57,i=mt==null?void 0:mt[We]),t.$$.dirty[1]&67133969&<&&i&&Q&&qt&<.flyTo(i.center,i.id.startsWith("poi.")||i.id.startsWith("address.")?Ie:Ve),t.$$.dirty[1]&1040&&(Ne||lt==null||lt.setMarkers(void 0,void 0)),t.$$.dirty[1]&75498512&<&&Ne&&!St&&(lt.setMarkers(i?[i]:void 0,void 0),lt.setSelectedMarker(i?0:-1)),t.$$.dirty[1]&25165840&<&<.setMarkers(St,xe),t.$$.dirty[0]&32768|t.$$.dirty[1]&8388624&&St&<&<.setSelectedMarker(We),t.$$.dirty[0]&2|t.$$.dirty[1]&16&<){const Y=os(Lt);lt.setReverseMarker(Y?[Y.decimalLongitude,Y.decimalLatitude]:void 0)}t.$$.dirty[1]&67108864&&vr("select",i),t.$$.dirty[1]&16777216&&vr("pick",xe),t.$$.dirty[0]&81920&&vr("optionsVisibilityChange",rs&&!!mt),t.$$.dirty[0]&16384&&vr("featuresListed",mt),t.$$.dirty[1]&8388608&&vr("featuresMarked",St),t.$$.dirty[0]&1&&vr("reverseToggle",Pt),t.$$.dirty[0]&2&&vr("queryChange",Lt),t.$$.dirty[0]&1|t.$$.dirty[1]&16&<&<.indicateReverse(Pt)},[Pt,Lt,f,w,L,z,K,dt,ht,$,Tt,_e,dn,Kt,mt,We,rs,Mt,Ti,Wn,Ca,il,rl,Gi,se,u,v,I,A,U,J,Q,O,G,j,lt,xt,ct,ee,re,qt,Ne,Ce,pn,Ve,Ie,sn,In,mn,Pn,gi,Ci,_i,li,St,xe,Ts,i,c,s,Ke,Xe,Li,Go,He,oa,Di,st,B,q,X,nt,yt]}class GC extends fn{constructor(e){super(),hn(this,e,UC,VC,en,{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]}}function c1(t){let e,n,i;return n=new GC({props:{mapController:t[1],apiKey:t[0]}}),{c(){e=jt("div"),Ae(n.$$.fragment),Zt(e,"class","svelte-ixhnie")},m(s,c){Ut(s,e,c),Me(n,e,null),i=!0},p(s,c){const f={};c&2&&(f.mapController=s[1]),c&1&&(f.apiKey=s[0]),n.$set(f)},i(s){i||(Rt(n.$$.fragment,s),i=!0)},o(s){Wt(n.$$.fragment,s),i=!1},d(s){s&&Vt(e),Pe(n)}}}function qC(t){let e,n,i=t[1]&&c1(t);return{c(){i&&i.c(),e=bo()},m(s,c){i&&i.m(s,c),Ut(s,e,c),n=!0},p(s,[c]){s[1]?i?(i.p(s,c),c&2&&Rt(i,1)):(i=c1(s),i.c(),Rt(i,1),i.m(e.parentNode,e)):i&&(ri(),Wt(i,1,1,()=>{i=null}),oi())},i(s){n||(Rt(i),n=!0)},o(s){Wt(i),n=!1},d(s){s&&Vt(e),i&&i.d(s)}}}function jC(t,e,n){let i,{apiKey:s}=e,{map:c}=e;return t.$$set=f=>{"apiKey"in f&&n(0,s=f.apiKey),"map"in f&&n(2,c=f.map)},t.$$.update=()=>{t.$$.dirty&4&&n(1,i=c?iC(c,ds):null)},[s,i,c]}class ZC extends fn{constructor(e){super(),hn(this,e,jC,qC,en,{apiKey:0,map:2})}}function h1(t,e,n){const i=t.slice();return i[1]=e[n][0],i[2]=e[n][1],i}function f1(t){let e,n,i,s=t[1]+"",c,f;return{c(){e=jt("li"),n=jt("span"),i=fe(),c=Cn(s),f=fe(),Zt(n,"class","svelte-kzgqtg"),or(n,"background",t[2])},m(u,v){Ut(u,e,v),Gt(e,n),Gt(e,i),Gt(e,c),Gt(e,f)},p(u,v){v&1&&or(n,"background",u[2]),v&1&&s!==(s=u[1]+"")&&Br(c,s)},d(u){u&&Vt(e)}}}function WC(t){let e,n=po(t[0]),i=[];for(let s=0;s{"rows"in s&&n(0,i=s.rows)},[i]}class XC extends fn{constructor(e){super(),hn(this,e,HC,WC,en,{rows:0})}}function p1(t){let e,n;return{c(){e=jt("div"),n=Cn(t[0]),Zt(e,"class","svelte-1uuov7f")},m(i,s){Ut(i,e,s),Gt(e,n)},p(i,s){s&1&&Br(n,i[0])},d(i){i&&Vt(e)}}}function YC(t){let e,n=t[0]&&p1(t);return{c(){n&&n.c(),e=bo()},m(i,s){n&&n.m(i,s),Ut(i,e,s)},p(i,[s]){i[0]?n?n.p(i,s):(n=p1(i),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:Oe,o:Oe,d(i){i&&Vt(e),n&&n.d(i)}}}function KC(t,e,n){let{loading:i}=e;return t.$$set=s=>{"loading"in s&&n(0,i=s.loading)},[i]}class JC extends fn{constructor(e){super(),hn(this,e,KC,YC,en,{loading:0})}}const QC=t=>({dialog:t&1}),d1=t=>({dialog:t[0]});function $C(t){let e,n,i,s,c;const f=t[4].default,u=wr(f,t,t[3],d1);return{c(){e=jt("dialog"),n=jt("article"),u&&u.c(),e.open=!0},m(v,w){Ut(v,e,w),Gt(e,n),u&&u.m(n,null),t[6](e),i=!0,s||(c=[$e(window,"click",t[1]),$e(window,"keydown",t[2]),$e(e,"close",t[5])],s=!0)},p(v,[w]){u&&u.p&&(!i||w&9)&&Ir(u,f,v,v[3],i?Sr(f,v[3],w,QC):Er(v[3]),d1)},i(v){i||(Rt(u,v),i=!0)},o(v){Wt(u,v),i=!1},d(v){v&&Vt(e),u&&u.d(v),t[6](null),s=!1,yr(c)}}}function tT(t,e,n){let{$$slots:i={},$$scope:s}=e,c;function f(I){c.open&&I.target==c&&c.close()}function u(I){(I.key=="Escape"||I.key=="Enter")&&(I.stopPropagation(),c.close())}function v(I){Nn.call(this,t,I)}function w(I){Cr[I?"unshift":"push"](()=>{c=I,n(0,c)})}return t.$$set=I=>{"$$scope"in I&&n(3,s=I.$$scope)},[c,f,u,s,i,v,w]}class eT extends fn{constructor(e){super(),hn(this,e,tT,$C,en,{})}}var fo=63710088e-1,fy={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},nT={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},z_={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 ea(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 iT(t,e,n){switch(t){case"Point":return Xo(e).geometry;case"LineString":return Us(e).geometry;case"Polygon":return py(e).geometry;case"MultiPoint":return Ib(e).geometry;case"MultiLineString":return Sb(e).geometry;case"MultiPolygon":return Eb(e).geometry;default:throw new Error(t+" is invalid")}}function Xo(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(!Am(t[0])||!Am(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return ea(i,e,n)}function rT(t,e,n){return n===void 0&&(n={}),mc(t.map(function(i){return Xo(i,e)}),n)}function py(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 dy(t,e){e===void 0&&(e="kilometers");var n=fy[e];if(!n)throw new Error(e+" units is invalid");return t*n}function Km(t,e){e===void 0&&(e="kilometers");var n=fy[e];if(!n)throw new Error(e+" units is invalid");return t/n}function uT(t,e){return Op(Km(t,e))}function cT(t){var e=t%360;return e<0&&(e+=360),e}function Op(t){var e=t%(2*Math.PI);return e*180/Math.PI}function Gs(t){var e=t%360;return e*Math.PI/180}function hT(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 dy(Km(t,e),n)}function fT(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=z_[e];if(!i)throw new Error("invalid original units");var s=z_[n];if(!s)throw new Error("invalid final units");return t/i*s}function Am(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function my(t){return!!t&&t.constructor===Object}function pT(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(!Am(e))throw new Error("bbox must only contain numbers")})}function dT(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 mT=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:z_,bearingToAzimuth:cT,convertArea:fT,convertLength:hT,degreesToRadians:Gs,earthRadius:fo,factors:fy,feature:ea,featureCollection:mc,geometry:iT,geometryCollection:aT,isNumber:Am,isObject:my,lengthToDegrees:uT,lengthToRadians:Km,lineString:Us,lineStrings:sT,multiLineString:Sb,multiPoint:Ib,multiPolygon:Eb,point:Xo,points:rT,polygon:py,polygons:oT,radiansToDegrees:Op,radiansToLength:dy,round:lT,unitsFactors:nT,validateBBox:pT,validateId:dT},Symbol.toStringTag,{value:"Module"}));function Fp(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 Yh(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 Cb(t,e,n){if(n===void 0&&(n={}),n.final===!0)return gT(t,e);var i=Fp(t),s=Fp(e),c=Gs(i[0]),f=Gs(s[0]),u=Gs(i[1]),v=Gs(s[1]),w=Math.sin(f-c)*Math.cos(v),I=Math.cos(u)*Math.sin(v)-Math.sin(u)*Math.cos(v)*Math.cos(f-c);return Op(Math.atan2(w,I))}function gT(t,e){var n=Cb(e,t);return n=(n+180)%360,n}function lp(t,e,n){n===void 0&&(n={});var i=Fp(t),s=Fp(e),c=Gs(s[1]-i[1]),f=Gs(s[0]-i[0]),u=Gs(i[1]),v=Gs(s[1]),w=Math.pow(Math.sin(c/2),2)+Math.pow(Math.sin(f/2),2)*Math.cos(u)*Math.cos(v);return dy(2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w)),n.units)}function m1(t,e,n,i){i===void 0&&(i={});var s=Fp(t),c=Gs(s[0]),f=Gs(s[1]),u=Gs(n),v=Km(e,i.units),w=Math.asin(Math.sin(f)*Math.cos(v)+Math.cos(f)*Math.sin(v)*Math.cos(u)),I=c+Math.atan2(Math.sin(u)*Math.sin(v)*Math.cos(f),Math.cos(v)-Math.sin(f)*Math.sin(w)),L=Op(I),A=Op(w);return Xo([L,A],i.properties)}function Yp(t,e,n){if(t!==null)for(var i,s,c,f,u,v,w,I=0,L=0,A,U=t.type,z=U==="FeatureCollection",K=U==="Feature",J=z?t.features.length:1,Q=0;Qv||z>w||K>I){u=L,v=i,w=z,I=K,c=0;return}var J=Us([u,L],n.properties);if(e(J,i,s,K,c)===!1)return!1;c++,u=L})===!1)return!1}}})}function ST(t,e,n){var i=n,s=!1;return Lb(t,function(c,f,u,v,w){s===!1&&n===void 0?i=c:i=e(i,c,f,u,v,w),s=!0}),i}function Mb(t,e){if(!t)throw new Error("geojson is required");rf(t,function(n,i,s){if(n.geometry!==null){var c=n.geometry.type,f=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[f,u,v,w]}var _y={exports:{}},Pb={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(cx,function(){function n(O,G,j,lt,xt){(function dt(ht,ct,Pt,$,Lt){for(;$>Pt;){if($-Pt>600){var ee=$-Pt+1,Tt=ct-Pt+1,re=Math.log(ee),_e=.5*Math.exp(2*re/3),qt=.5*Math.sqrt(re*_e*(ee-_e)/ee)*(Tt-ee/2<0?-1:1),Ne=Math.max(Pt,Math.floor(ct-Tt*_e/ee+qt)),Ce=Math.min($,Math.floor(ct+(ee-Tt)*_e/ee+qt));dt(ht,ct,Ne,Ce,Lt)}var pn=ht[ct],Ve=Pt,Ie=$;for(i(ht,Pt,ct),Lt(ht[$],pn)>0&&i(ht,Pt,$);Ve0;)Ie--}Lt(ht[Pt],pn)===0?i(ht,Pt,Ie):i(ht,++Ie,$),Ie<=ct&&(Pt=Ie+1),ct<=Ie&&($=Ie-1)}})(O,G,j||0,lt||O.length-1,xt||s)}function i(O,G,j){var lt=O[G];O[G]=O[j],O[j]=lt}function s(O,G){return OG?1:0}var c=function(O){O===void 0&&(O=9),this._maxEntries=Math.max(4,O),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function f(O,G,j){if(!j)return G.indexOf(O);for(var lt=0;lt=O.minX&&G.maxY>=O.minY}function J(O){return{children:O,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Q(O,G,j,lt,xt){for(var dt=[G,j];dt.length;)if(!((j=dt.pop())-(G=dt.pop())<=lt)){var ht=G+Math.ceil((j-G)/lt/2)*lt;n(O,ht,G,j,xt),dt.push(G,ht,ht,j)}}return c.prototype.all=function(){return this._all(this.data,[])},c.prototype.search=function(O){var G=this.data,j=[];if(!K(O,G))return j;for(var lt=this.toBBox,xt=[];G;){for(var dt=0;dt=0&&xt[G].children.length>this._maxEntries;)this._split(xt,G),G--;this._adjustParentBBoxes(lt,xt,G)},c.prototype._split=function(O,G){var j=O[G],lt=j.children.length,xt=this._minEntries;this._chooseSplitAxis(j,xt,lt);var dt=this._chooseSplitIndex(j,xt,lt),ht=J(j.children.splice(dt,j.children.length-dt));ht.height=j.height,ht.leaf=j.leaf,u(j,this.toBBox),u(ht,this.toBBox),G?O[G-1].children.push(ht):this._splitRoot(j,ht)},c.prototype._splitRoot=function(O,G){this.data=J([O,G]),this.data.height=O.height+1,this.data.leaf=!1,u(this.data,this.toBBox)},c.prototype._chooseSplitIndex=function(O,G,j){for(var lt,xt,dt,ht,ct,Pt,$,Lt=1/0,ee=1/0,Tt=G;Tt<=j-G;Tt++){var re=v(O,0,Tt,this.toBBox),_e=v(O,Tt,j,this.toBBox),qt=(xt=re,dt=_e,ht=void 0,ct=void 0,Pt=void 0,$=void 0,ht=Math.max(xt.minX,dt.minX),ct=Math.max(xt.minY,dt.minY),Pt=Math.min(xt.maxX,dt.maxX),$=Math.min(xt.maxY,dt.maxY),Math.max(0,Pt-ht)*Math.max(0,$-ct)),Ne=A(re)+A(_e);qt=G;Lt--){var ee=O.children[Lt];w(ht,O.leaf?xt(ee):ee),ct+=U(ht)}return ct},c.prototype._adjustParentBBoxes=function(O,G,j){for(var lt=j;lt>=0;lt--)w(G[lt],O)},c.prototype._condense=function(O){for(var G=O.length-1,j=void 0;G>=0;G--)O[G].children.length===0?G>0?(j=O[G-1].children).splice(j.indexOf(O[G]),1):this.clear():u(O[G],this.toBBox)},c})})(Pb);var AT=Pb.exports;const kT=fx(mT),Ab=fx(TT);var yy={};Object.defineProperty(yy,"__esModule",{value:!0});var DT=Ab;function O_(t){var e=[1/0,1/0,-1/0,-1/0];return DT.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],f=n[1][0],u=n[1][1],v=i[0][0],w=i[0][1],I=i[1][0],L=i[1][1],A=(L-w)*(f-s)-(I-v)*(u-c),U=(I-v)*(c-w)-(L-w)*(s-v),z=(f-s)*(c-w)-(u-c)*(s-v);if(A===0)return null;var K=U/A,J=z/A;if(K>=0&&K<=1&&J>=0&&J<=1){var Q=s+K*(f-s),O=c+K*(u-c);return Xo([Q,O])}return null}function FT(t,e,n){n===void 0&&(n={});var i=Xo([1/0,1/0],{dist:1/0}),s=0;return rf(t,function(c){for(var f=Yh(c),u=0;u0&&(J=K.features[0],J.properties.dist=lp(e,J,n),J.properties.location=s+lp(v,J,n)),v.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()}});cr(this,"onClick",e=>{if(this.beforeUpdate(),this.active&&this.cursor){let n=[];if(v1(this.points).forEach((i,s)=>{n.push([s+1,FT(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))});cr(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.cursor=d_(e.lngLat.toArray()),this.onClick(e),this.finish())});cr(this,"onMouseDown",e=>{this.active&&!this.dragFrom&&this.hover!=null&&(e.preventDefault(),this.cursor=null,this.dragFrom=e.lngLat.toArray(),this.beforeUpdate(),this.redraw())});cr(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});cr(this,"onKeypress",e=>{this.active&&(e.key=="Enter"?(e.stopPropagation(),this.finish()):e.key=="z"&&e.ctrlKey&&this.undo())});cr(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 f=d_(s);f.properties.hover=this.hover==c,f.properties.idx=c,e.features.push(f)}),e.features=e.features.concat(v1(this.points));let n=this.polygonFeature();n&&(n.properties.hover=this.hover=="polygon",e.features.push(n)),zb.set(e);let i="crosshair";this.hover!=null&&(i=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=i,Ob.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=d_(e.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let e=this.points.map(Nb),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>GT&&this.previousStates.shift()}}function v1(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 jT(t){let e,n,i;return{c(){e=Cn("Undo ("),n=Cn(t[1]),i=Cn(")")},m(s,c){Ut(s,e,c),Ut(s,n,c),Ut(s,i,c)},p(s,c){c&2&&Br(n,s[1])},d(s){s&&(Vt(e),Vt(n),Vt(i))}}}function ZT(t){let e;return{c(){e=Cn("Undo")},m(n,i){Ut(n,e,i)},p:Oe,d(n){n&&Vt(e)}}}function WT(t){let e,n,i,s,c,f,u,v,w,I,L;function A(K,J){return K[1]==0?ZT:jT}let U=A(t),z=U(t);return{c(){e=jt("div"),n=jt("button"),n.textContent="Finish",i=fe(),s=jt("button"),s.textContent="Cancel",c=fe(),f=jt("button"),z.c(),v=fe(),w=jt("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
  • `,f.disabled=u=t[1]==0,or(e,"display","flex"),or(e,"justify-content","space-between")},m(K,J){Ut(K,e,J),Gt(e,n),Gt(e,i),Gt(e,s),Gt(e,c),Gt(e,f),z.m(f,null),Ut(K,v,J),Ut(K,w,J),I||(L=[$e(n,"click",t[2]),$e(s,"click",t[3]),$e(f,"click",t[4])],I=!0)},p(K,[J]){U===(U=A(K))&&z?z.p(K,J):(z.d(1),z=U(K),z&&(z.c(),z.m(f,null))),J&2&&u!==(u=K[1]==0)&&(f.disabled=u)},i:Oe,o:Oe,d(K){K&&(Vt(e),Vt(v),Vt(w)),z.d(),I=!1,yr(L)}}}function HT(t,e,n){let i;qe(t,Ob,v=>n(1,i=v));let{polygonTool:s}=e;const c=()=>s.finish(),f=()=>s.cancel(),u=()=>s.undo();return t.$$set=v=>{"polygonTool"in v&&n(0,s=v.polygonTool)},[s,i,c,f,u]}class XT extends fn{constructor(e){super(),hn(this,e,HT,WT,en,{polygonTool:0})}}let YT=Date.now();function Kp(t){return`${t}-${YT++}`}const Fb=Symbol.for("svelte-maplibre");function KT(){return q_(Fb)}function x1(t){return{subscribe:t.subscribe}}function Bb({key:t,setPopupTarget:e=!1,setCluster:n=!1,setMouseEvent:i=!1}){let s=KT(),c=Yi(null),f=x1(c),u={...s,[t]:x1(c)};if(e&&(u.popupTarget=f),i){let v=Yi(null);u.layerEvent=v,s.layerEvent=v}return n&&(u.cluster=Yi()),G_(Fb,u),{...s,self:c}}function JT(){return Bb({key:"source",setCluster:!0})}function QT(t=!0){return Bb({key:"layer",setPopupTarget:t,setMouseEvent:t})}function b1(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 $T(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 tL(t){return t===!0?["has","point_count"]:t===!1?["!",["has","point_count"]]:void 0}function w1(t){let e=t[0],n,i,s=S1(t);return{c(){s.c(),n=bo()},m(c,f){s.m(c,f),Ut(c,n,f),i=!0},p(c,f){f[0]&1&&en(e,e=c[0])?(ri(),Wt(s,1,1,Oe),oi(),s=S1(c),s.c(),Rt(s,1),s.m(n.parentNode,n)):s.p(c,f)},i(c){i||(Rt(s),i=!0)},o(c){Wt(s),i=!1},d(c){c&&Vt(n),s.d(c)}}}function S1(t){let e;const n=t[36].default,i=wr(n,t,t[35],null);return{c(){i&&i.c()},m(s,c){i&&i.m(s,c),e=!0},p(s,c){i&&i.p&&(!e||c[1]&16)&&Ir(i,n,s,s[35],e?Sr(n,s[35],c,null):Er(s[35]),null)},i(s){e||(Rt(i,s),e=!0)},o(s){Wt(i,s),e=!1},d(s){i&&i.d(s)}}}function eL(t){let e,n,i=t[0]&&w1(t);return{c(){i&&i.c(),e=bo()},m(s,c){i&&i.m(s,c),Ut(s,e,c),n=!0},p(s,c){s[0]?i?(i.p(s,c),c[0]&1&&Rt(i,1)):(i=w1(s),i.c(),Rt(i,1),i.m(e.parentNode,e)):i&&(ri(),Wt(i,1,1,()=>{i=null}),oi())},i(s){n||(Rt(i),n=!0)},o(s){Wt(i),n=!1},d(s){s&&Vt(e),i&&i.d(s)}}}function nL(t,e,n){let i,s,c,f,u,v,w,I,L,A,U,z,{$$slots:K={},$$scope:J}=e,{id:Q=Kp("layer")}=e,{source:O=void 0}=e,{sourceLayer:G=void 0}=e,{beforeId:j=void 0}=e,{beforeLayerType:lt=void 0}=e,{type:xt}=e,{paint:dt=void 0}=e,{layout:ht=void 0}=e,{filter:ct=void 0}=e,{applyToClusters:Pt=void 0}=e,{minzoom:$=void 0}=e,{maxzoom:Lt=void 0}=e,{manageHoverState:ee=!1}=e,{hovered:Tt=null}=e,{interactive:re=!0}=e,{hoverCursor:_e=void 0}=e,{eventsIfTopMost:qt=!1}=e;const Ne=wu(),{map:Ce,source:pn,self:Ve,minzoom:Ie,maxzoom:sn,eventTopMost:In,layerInfo:dn}=QT();qe(t,Ce,mt=>n(31,L=mt)),qe(t,pn,mt=>n(32,A=mt)),qe(t,Ve,mt=>n(0,I=mt)),qe(t,Ie,mt=>n(34,z=mt)),qe(t,sn,mt=>n(33,U=mt)),_s(()=>{I&&L&&(dn.delete(I),L==null||L.removeLayer(I))});let mn;function Pn(mt){var Mt,We;if(!re||!I||!L||qt&&In(mt)!==I)return;let St=mt.features??[],xe=(We=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:We.cluster_id,An={event:mt,map:L,clusterId:xe,layer:I,source:u,features:St};Ne(mt.type,An)}function gi(mt){var Mt,We;if(!re||!I||!L||qt&&In(mt)!==I)return;_e&&(L.getCanvas().style.cursor=_e);let St=mt.features??[];n(6,Tt=St[0]??null);let xe=(We=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:We.cluster_id;Ne("mouseenter",{event:mt,map:L,clusterId:xe,layer:I,source:u,features:St})}function Ci(mt){var Mt,We,Ti;if(!re||!L)return;if(qt&&In(mt)!==I){n(6,Tt=null),ee&&mn!==void 0&&(L==null||L.setFeatureState({source:u,sourceLayer:G,id:mn},{hover:!1}),mn=void 0);return}L.getCanvas().style.cursor=_e;let St=mt.features??[],xe=(We=(Mt=St[0])==null?void 0:Mt.properties)==null?void 0:We.cluster_id,An=(Ti=St[0])==null?void 0:Ti.id;An!==mn&&(ee&&(mn!==void 0&&(L==null||L.setFeatureState({source:u,id:mn,sourceLayer:G},{hover:!1})),L==null||L.setFeatureState({source:u,id:An,sourceLayer:G},{hover:!0})),mn=An,n(6,Tt=St[0]??null)),Ne("mousemove",{event:mt,map:L,clusterId:xe,layer:I,source:u,features:St})}function _i(mt){if(!(!re||!I||!L)){if(_e&&(L.getCanvas().style.cursor=""),n(6,Tt=null),ee&&mn!==void 0){const St={source:u,id:mn,sourceLayer:G};L==null||L.setFeatureState(St,{hover:!1}),mn=void 0}Ne("mouseleave",{map:L,layer:I,source:u})}}let li=!0;function Kt(mt){L&&(L.off("click",mt,Pn),L.off("dblclick",mt,Pn),L.off("contextmenu",mt,Pn),L.off("mouseenter",mt,gi),L.off("mousemove",mt,Ci),L.off("mouseleave",mt,_i))}return _s(()=>{L&&I&&Kt(I)}),t.$$set=mt=>{"id"in mt&&n(7,Q=mt.id),"source"in mt&&n(8,O=mt.source),"sourceLayer"in mt&&n(9,G=mt.sourceLayer),"beforeId"in mt&&n(10,j=mt.beforeId),"beforeLayerType"in mt&&n(11,lt=mt.beforeLayerType),"type"in mt&&n(12,xt=mt.type),"paint"in mt&&n(13,dt=mt.paint),"layout"in mt&&n(14,ht=mt.layout),"filter"in mt&&n(15,ct=mt.filter),"applyToClusters"in mt&&n(16,Pt=mt.applyToClusters),"minzoom"in mt&&n(17,$=mt.minzoom),"maxzoom"in mt&&n(18,Lt=mt.maxzoom),"manageHoverState"in mt&&n(19,ee=mt.manageHoverState),"hovered"in mt&&n(6,Tt=mt.hovered),"interactive"in mt&&n(20,re=mt.interactive),"hoverCursor"in mt&&n(21,_e=mt.hoverCursor),"eventsIfTopMost"in mt&&n(22,qt=mt.eventsIfTopMost),"$$scope"in mt&&n(35,J=mt.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&65536&&n(30,i=tL(Pt)),t.$$.dirty[0]&1073774592&&n(24,s=$T("all",i,ct)),t.$$.dirty[0]&131072|t.$$.dirty[1]&8&&n(26,c=$??z),t.$$.dirty[0]&262144|t.$$.dirty[1]&4&&n(25,f=Lt??U),t.$$.dirty[0]&256|t.$$.dirty[1]&2&&n(29,u=O||A),t.$$.dirty[0]&654343809|t.$$.dirty[1]&1&&L&&I!==Q&&u){I&&(Kt(I),dn.delete(I));let mt=j;if(!j&<){let St=L.getStyle().layers,xe=typeof lt=="function"?lt:Mt=>Mt.type===lt,An=St==null?void 0:St.find(xe);An&&(mt=An.id)}Jn(Ve,I=Q,I),L.addLayer(ec({id:I,type:xt,source:u,"source-layer":G,filter:s,paint:dt,layout:ht,minzoom:c,maxzoom:f}),mt),n(23,li=!0),L.on("click",I,Pn),L.on("dblclick",I,Pn),L.on("contextmenu",I,Pn),L.on("mouseenter",I,gi),L.on("mousemove",I,Ci),L.on("mouseleave",I,_i)}t.$$.dirty[0]&1048577&&I&&dn.set(I,{interactive:re}),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(28,v=I?b1((mt,St)=>L==null?void 0:L.setPaintProperty(I,mt,St)):void 0),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(27,w=I?b1((mt,St)=>L==null?void 0:L.setLayoutProperty(I,mt,St)):void 0),t.$$.dirty[0]&268443648&&(v==null||v(dt)),t.$$.dirty[0]&134234112&&(w==null||w(ht)),t.$$.dirty[0]&100663297|t.$$.dirty[1]&1&&I&&(L==null||L.setLayerZoomRange(I,c,f)),t.$$.dirty[0]&25165825|t.$$.dirty[1]&1&&I&&(li?n(23,li=!1):L==null||L.setFilter(I,s))},[I,Ce,pn,Ve,Ie,sn,Tt,Q,O,G,j,lt,xt,dt,ht,ct,Pt,$,Lt,ee,re,_e,qt,li,s,f,c,w,v,u,i,L,A,U,z,J,K]}class vy extends fn{constructor(e){super(),hn(this,e,nL,eL,en,{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 iL(t){let e;const n=t[16].default,i=wr(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)&&Ir(i,n,s,s[24],e?Sr(n,s[24],c,null):Er(s[24]),null)},i(s){e||(Rt(i,s),e=!0)},o(s){Wt(i,s),e=!1},d(s){i&&i.d(s)}}}function rL(t){let e,n,i;function s(f){t[17](f)}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:[iL]},$$scope:{ctx:t}};return t[0]!==void 0&&(c.hovered=t[0]),e=new vy({props:c}),Cr.push(()=>hu(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(){Ae(e.$$.fragment)},m(f,u){Me(e,f,u),i=!0},p(f,[u]){const v={};u&2&&(v.id=f[1]),u&4&&(v.source=f[2]),u&8&&(v.sourceLayer=f[3]),u&16&&(v.beforeId=f[4]),u&32&&(v.beforeLayerType=f[5]),u&64&&(v.paint=f[6]),u&128&&(v.layout=f[7]),u&256&&(v.filter=f[8]),u&512&&(v.applyToClusters=f[9]),u&1024&&(v.minzoom=f[10]),u&2048&&(v.maxzoom=f[11]),u&4096&&(v.hoverCursor=f[12]),u&8192&&(v.manageHoverState=f[13]),u&16384&&(v.eventsIfTopMost=f[14]),u&32768&&(v.interactive=f[15]),u&16777216&&(v.$$scope={dirty:u,ctx:f}),!n&&u&1&&(n=!0,v.hovered=f[0],cu(()=>n=!1)),e.$set(v)},i(f){i||(Rt(e.$$.fragment,f),i=!0)},o(f){Wt(e.$$.fragment,f),i=!1},d(f){Pe(e,f)}}}function oL(t,e,n){let{$$slots:i={},$$scope:s}=e,{id:c=Kp("circle")}=e,{source:f=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:v=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:I}=e,{layout:L=void 0}=e,{filter:A=void 0}=e,{applyToClusters:U=void 0}=e,{minzoom:z=void 0}=e,{maxzoom:K=void 0}=e,{hoverCursor:J=void 0}=e,{manageHoverState:Q=!1}=e,{hovered:O=null}=e,{eventsIfTopMost:G=!1}=e,{interactive:j=!0}=e;function lt(Lt){O=Lt,n(0,O)}function xt(Lt){Nn.call(this,t,Lt)}function dt(Lt){Nn.call(this,t,Lt)}function ht(Lt){Nn.call(this,t,Lt)}function ct(Lt){Nn.call(this,t,Lt)}function Pt(Lt){Nn.call(this,t,Lt)}function $(Lt){Nn.call(this,t,Lt)}return t.$$set=Lt=>{"id"in Lt&&n(1,c=Lt.id),"source"in Lt&&n(2,f=Lt.source),"sourceLayer"in Lt&&n(3,u=Lt.sourceLayer),"beforeId"in Lt&&n(4,v=Lt.beforeId),"beforeLayerType"in Lt&&n(5,w=Lt.beforeLayerType),"paint"in Lt&&n(6,I=Lt.paint),"layout"in Lt&&n(7,L=Lt.layout),"filter"in Lt&&n(8,A=Lt.filter),"applyToClusters"in Lt&&n(9,U=Lt.applyToClusters),"minzoom"in Lt&&n(10,z=Lt.minzoom),"maxzoom"in Lt&&n(11,K=Lt.maxzoom),"hoverCursor"in Lt&&n(12,J=Lt.hoverCursor),"manageHoverState"in Lt&&n(13,Q=Lt.manageHoverState),"hovered"in Lt&&n(0,O=Lt.hovered),"eventsIfTopMost"in Lt&&n(14,G=Lt.eventsIfTopMost),"interactive"in Lt&&n(15,j=Lt.interactive),"$$scope"in Lt&&n(24,s=Lt.$$scope)},[O,c,f,u,v,w,I,L,A,U,z,K,J,Q,G,j,i,lt,xt,dt,ht,ct,Pt,$,s]}class sL extends fn{constructor(e){super(),hn(this,e,oL,rL,en,{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 aL(t){let e;const n=t[15].default,i=wr(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)&&Ir(i,n,s,s[23],e?Sr(n,s[23],c,null):Er(s[23]),null)},i(s){e||(Rt(i,s),e=!0)},o(s){Wt(i,s),e=!1},d(s){i&&i.d(s)}}}function lL(t){let e,n,i;function s(f){t[16](f)}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:[aL]},$$scope:{ctx:t}};return t[0]!==void 0&&(c.hovered=t[0]),e=new vy({props:c}),Cr.push(()=>hu(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(){Ae(e.$$.fragment)},m(f,u){Me(e,f,u),i=!0},p(f,[u]){const v={};u&2&&(v.id=f[1]),u&4&&(v.source=f[2]),u&8&&(v.sourceLayer=f[3]),u&16&&(v.beforeId=f[4]),u&32&&(v.beforeLayerType=f[5]),u&64&&(v.paint=f[6]),u&128&&(v.layout=f[7]),u&256&&(v.filter=f[8]),u&512&&(v.minzoom=f[9]),u&1024&&(v.maxzoom=f[10]),u&2048&&(v.hoverCursor=f[11]),u&4096&&(v.manageHoverState=f[12]),u&8192&&(v.eventsIfTopMost=f[13]),u&16384&&(v.interactive=f[14]),u&8388608&&(v.$$scope={dirty:u,ctx:f}),!n&&u&1&&(n=!0,v.hovered=f[0],cu(()=>n=!1)),e.$set(v)},i(f){i||(Rt(e.$$.fragment,f),i=!0)},o(f){Wt(e.$$.fragment,f),i=!1},d(f){Pe(e,f)}}}function uL(t,e,n){let{$$slots:i={},$$scope:s}=e,{id:c=Kp("fill")}=e,{source:f=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:v=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:I}=e,{layout:L=void 0}=e,{filter:A=void 0}=e,{minzoom:U=void 0}=e,{maxzoom:z=void 0}=e,{hoverCursor:K=void 0}=e,{manageHoverState:J=!1}=e,{hovered:Q=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function j($){Q=$,n(0,Q)}function lt($){Nn.call(this,t,$)}function xt($){Nn.call(this,t,$)}function dt($){Nn.call(this,t,$)}function ht($){Nn.call(this,t,$)}function ct($){Nn.call(this,t,$)}function Pt($){Nn.call(this,t,$)}return t.$$set=$=>{"id"in $&&n(1,c=$.id),"source"in $&&n(2,f=$.source),"sourceLayer"in $&&n(3,u=$.sourceLayer),"beforeId"in $&&n(4,v=$.beforeId),"beforeLayerType"in $&&n(5,w=$.beforeLayerType),"paint"in $&&n(6,I=$.paint),"layout"in $&&n(7,L=$.layout),"filter"in $&&n(8,A=$.filter),"minzoom"in $&&n(9,U=$.minzoom),"maxzoom"in $&&n(10,z=$.maxzoom),"hoverCursor"in $&&n(11,K=$.hoverCursor),"manageHoverState"in $&&n(12,J=$.manageHoverState),"hovered"in $&&n(0,Q=$.hovered),"eventsIfTopMost"in $&&n(13,O=$.eventsIfTopMost),"interactive"in $&&n(14,G=$.interactive),"$$scope"in $&&n(23,s=$.$$scope)},[Q,c,f,u,v,w,I,L,A,U,z,K,J,O,G,i,j,lt,xt,dt,ht,ct,Pt,s]}class cL extends fn{constructor(e){super(),hn(this,e,uL,lL,en,{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 hL(t,e,n,i,s){let c=!1;t.getSource(e)&&(c=!0,t.removeSource(e));const f=()=>{i(e)&&(t.addSource(e,n),s())};if(c){const u=()=>{e&&(t.getSource(e)?setTimeout(u,1):f())};u()}else f()}function fL(t,e,n){ox().then(()=>{let i=ex(t);if(!i)return;i.getSource(e)===n&&i.removeSource(e)})}function I1(t){let e=t[0],n,i,s=E1(t);return{c(){s.c(),n=bo()},m(c,f){s.m(c,f),Ut(c,n,f),i=!0},p(c,f){f&1&&en(e,e=c[0])?(ri(),Wt(s,1,1,Oe),oi(),s=E1(c),s.c(),Rt(s,1),s.m(n.parentNode,n)):s.p(c,f)},i(c){i||(Rt(s),i=!0)},o(c){Wt(s),i=!1},d(c){c&&Vt(n),s.d(c)}}}function E1(t){let e;const n=t[15].default,i=wr(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)&&Ir(i,n,s,s[14],e?Sr(n,s[14],c,null):Er(s[14]),null)},i(s){e||(Rt(i,s),e=!0)},o(s){Wt(i,s),e=!1},d(s){i&&i.d(s)}}}function pL(t){let e,n,i=t[0]&&I1(t);return{c(){i&&i.c(),e=bo()},m(s,c){i&&i.m(s,c),Ut(s,e,c),n=!0},p(s,[c]){s[0]?i?(i.p(s,c),c&1&&Rt(i,1)):(i=I1(s),i.c(),Rt(i,1),i.m(e.parentNode,e)):i&&(ri(),Wt(i,1,1,()=>{i=null}),oi())},i(s){n||(Rt(i),n=!0)},o(s){Wt(i),n=!1},d(s){s&&Vt(e),i&&i.d(s)}}}function dL(t,e,n){let i,s,c,{$$slots:f={},$$scope:u}=e,{id:v=Kp("geojson")}=e,{data:w}=e,{generateId:I=!1}=e,{promoteId:L=void 0}=e,{filter:A=void 0}=e,{lineMetrics:U=void 0}=e,{cluster:z=void 0}=e;const{map:K,cluster:J,self:Q}=JT();qe(t,K,j=>n(13,s=j)),qe(t,J,j=>n(16,c=j)),qe(t,Q,j=>n(0,i=j));let O,G=!0;return _s(()=>{i&&O&&s&&(fL(K,i,O),Jn(Q,i=null,i),n(11,O=void 0))}),t.$$set=j=>{"id"in j&&n(4,v=j.id),"data"in j&&n(5,w=j.data),"generateId"in j&&n(6,I=j.generateId),"promoteId"in j&&n(7,L=j.promoteId),"filter"in j&&n(8,A=j.filter),"lineMetrics"in j&&n(9,U=j.lineMetrics),"cluster"in j&&n(10,z=j.cluster),"$$scope"in j&&n(14,u=j.$$scope)},t.$$.update=()=>{t.$$.dirty&1024&&Jn(J,c=z,c),t.$$.dirty&12273&&s&&i!==v&&(Jn(Q,i=v,i),hL(s,i,ec({type:"geojson",data:w,filter:A,lineMetrics:U,generateId:I,promoteId:L,cluster:!!z,clusterMinPoints:z==null?void 0:z.minPoints,clusterMaxZoom:z==null?void 0:z.maxZoom,clusterRadius:z==null?void 0:z.radius,clusterProperties:z==null?void 0:z.properties}),j=>s&&j===i,()=>{i&&(n(11,O=s==null?void 0:s.getSource(i)),n(12,G=!0))})),t.$$.dirty&8208&&(s==null||s.on("style.load",()=>{n(11,O=s==null?void 0:s.getSource(v))})),t.$$.dirty&6176&&O&&(G?n(12,G=!1):O.setData(w)),t.$$.dirty&3072&&(O==null||O.setClusterOptions(ec({cluster:!!z,clusterMaxZoom:z==null?void 0:z.maxZoom,clusterRadius:z==null?void 0:z.radius})))},[i,K,J,Q,v,w,I,L,A,U,z,O,G,s,u,f]}class mL extends fn{constructor(e){super(),hn(this,e,dL,pL,en,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10})}}function gL(t){let e;const n=t[15].default,i=wr(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)&&Ir(i,n,s,s[23],e?Sr(n,s[23],c,null):Er(s[23]),null)},i(s){e||(Rt(i,s),e=!0)},o(s){Wt(i,s),e=!1},d(s){i&&i.d(s)}}}function _L(t){let e,n,i;function s(f){t[16](f)}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:[gL]},$$scope:{ctx:t}};return t[0]!==void 0&&(c.hovered=t[0]),e=new vy({props:c}),Cr.push(()=>hu(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(){Ae(e.$$.fragment)},m(f,u){Me(e,f,u),i=!0},p(f,[u]){const v={};u&2&&(v.id=f[1]),u&4&&(v.source=f[2]),u&8&&(v.sourceLayer=f[3]),u&16&&(v.beforeId=f[4]),u&32&&(v.beforeLayerType=f[5]),u&64&&(v.paint=f[6]),u&128&&(v.layout=f[7]),u&256&&(v.filter=f[8]),u&512&&(v.minzoom=f[9]),u&1024&&(v.maxzoom=f[10]),u&2048&&(v.hoverCursor=f[11]),u&4096&&(v.manageHoverState=f[12]),u&8192&&(v.eventsIfTopMost=f[13]),u&16384&&(v.interactive=f[14]),u&8388608&&(v.$$scope={dirty:u,ctx:f}),!n&&u&1&&(n=!0,v.hovered=f[0],cu(()=>n=!1)),e.$set(v)},i(f){i||(Rt(e.$$.fragment,f),i=!0)},o(f){Wt(e.$$.fragment,f),i=!1},d(f){Pe(e,f)}}}function yL(t,e,n){let{$$slots:i={},$$scope:s}=e,{id:c=Kp("line")}=e,{source:f=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:v=void 0}=e,{beforeLayerType:w=void 0}=e,{paint:I}=e,{layout:L=void 0}=e,{filter:A=void 0}=e,{minzoom:U=void 0}=e,{maxzoom:z=void 0}=e,{hoverCursor:K=void 0}=e,{manageHoverState:J=!1}=e,{hovered:Q=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function j($){Q=$,n(0,Q)}function lt($){Nn.call(this,t,$)}function xt($){Nn.call(this,t,$)}function dt($){Nn.call(this,t,$)}function ht($){Nn.call(this,t,$)}function ct($){Nn.call(this,t,$)}function Pt($){Nn.call(this,t,$)}return t.$$set=$=>{"id"in $&&n(1,c=$.id),"source"in $&&n(2,f=$.source),"sourceLayer"in $&&n(3,u=$.sourceLayer),"beforeId"in $&&n(4,v=$.beforeId),"beforeLayerType"in $&&n(5,w=$.beforeLayerType),"paint"in $&&n(6,I=$.paint),"layout"in $&&n(7,L=$.layout),"filter"in $&&n(8,A=$.filter),"minzoom"in $&&n(9,U=$.minzoom),"maxzoom"in $&&n(10,z=$.maxzoom),"hoverCursor"in $&&n(11,K=$.hoverCursor),"manageHoverState"in $&&n(12,J=$.manageHoverState),"hovered"in $&&n(0,Q=$.hovered),"eventsIfTopMost"in $&&n(13,O=$.eventsIfTopMost),"interactive"in $&&n(14,G=$.interactive),"$$scope"in $&&n(23,s=$.$$scope)},[Q,c,f,u,v,w,I,L,A,U,z,K,J,O,G,i,j,lt,xt,dt,ht,ct,Pt,s]}class vL extends fn{constructor(e){super(),hn(this,e,yL,_L,en,{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 xL(t){let e,n,i,s,c,f;return e=new cL({props:{id:"edit-polygon-fill",filter:BT,paint:{"fill-color":"red","fill-opacity":["case",["boolean",["get","hover"],"false"],1,.5]}}}),i=new vL({props:{id:"edit-polygon-lines",filter:VT,paint:{"line-color":"black","line-width":8,"line-opacity":.5}}}),c=new sL({props:{id:"edit-polygon-vertices",filter:UT,paint:{"circle-color":"black","circle-opacity":["case",["has","hovered"],1,.5],"circle-radius":10}}}),{c(){Ae(e.$$.fragment),n=fe(),Ae(i.$$.fragment),s=fe(),Ae(c.$$.fragment)},m(u,v){Me(e,u,v),Ut(u,n,v),Me(i,u,v),Ut(u,s,v),Me(c,u,v),f=!0},p:Oe,i(u){f||(Rt(e.$$.fragment,u),Rt(i.$$.fragment,u),Rt(c.$$.fragment,u),f=!0)},o(u){Wt(e.$$.fragment,u),Wt(i.$$.fragment,u),Wt(c.$$.fragment,u),f=!1},d(u){u&&(Vt(n),Vt(s)),Pe(e,u),Pe(i,u),Pe(c,u)}}}function bL(t){let e,n;return e=new mL({props:{data:t[0],$$slots:{default:[xL]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(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||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function wL(t,e,n){let i;return qe(t,zb,s=>n(0,i=s)),[i]}class Vb extends fn{constructor(e){super(),hn(this,e,wL,bL,en,{})}}function SL(t){let e,n,i,s,c,f,u;return{c(){e=jt("button"),e.textContent="Import current view",n=fe(),i=jt("i"),i.textContent="or...",s=fe(),c=jt("button"),c.textContent="Draw an area to import on the map",Zt(e,"type","button"),Zt(c,"type","button")},m(v,w){Ut(v,e,w),Ut(v,n,w),Ut(v,i,w),Ut(v,s,w),Ut(v,c,w),f||(u=[$e(e,"click",t[1]),$e(c,"click",t[2])],f=!0)},p:Oe,i:Oe,o:Oe,d(v){v&&(Vt(e),Vt(n),Vt(i),Vt(s),Vt(c)),f=!1,yr(u)}}}function IL(t){let e,n;return e=new XT({props:{polygonTool:t[0]}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,s){const c={};s&1&&(c.polygonTool=i[0]),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function EL(t){let e,n,i,s;const c=[IL,SL],f=[];function u(v,w){return v[0]?0:1}return e=u(t),n=f[e]=c[e](t),{c(){n.c(),i=bo()},m(v,w){f[e].m(v,w),Ut(v,i,w),s=!0},p(v,[w]){let I=e;e=u(v),e===I?f[e].p(v,w):(ri(),Wt(f[I],1,1,()=>{f[I]=null}),oi(),n=f[e],n?n.p(v,w):(n=f[e]=c[e](v),n.c()),Rt(n,1),n.m(i.parentNode,i))},i(v){s||(Rt(n),s=!0)},o(v){Wt(n),s=!1},d(v){v&&Vt(i),f[e].d(v)}}}function up(t){return[t.lng,t.lat]}function CL(t,e,n){let{map:i}=e;const s=wu();let c=null;async function f(I){try{s("loading","Loading from Overpass");let A=await(await fetch(XL(I))).text();s("gotXml",A)}catch(L){s("error",L.toString())}}function u(){let I=i.getBounds();return{type:"Feature",properties:{},geometry:{coordinates:[[up(I.getSouthWest()),up(I.getNorthWest()),up(I.getNorthEast()),up(I.getSouthEast()),up(I.getSouthWest())]],type:"Polygon"}}}async function v(){if(i){if(i.getZoom()<13){s("error","Zoom in more to import");return}await f(u())}}function w(){i&&(n(0,c=new qT(i)),c.startNew(),c.addEventListenerSuccess(async I=>{n(0,c=null),await f(I)}),c.addEventListenerFailure(()=>{n(0,c=null)}))}return t.$$set=I=>{"map"in I&&n(3,i=I.map)},[c,v,w,i]}class TL extends fn{constructor(e){super(),hn(this,e,CL,EL,en,{map:3})}}const LL=Symbol.for("svelte-maplibre");function ML(){return q_(LL)}function PL(t){return"layerType"in t&&t.layerType==="deckgl"}const AL=t=>({features:t[0]&16,data:t[0]&16,map:t[0]&4,close:t[0]&1}),C1=t=>{var e;return{features:t[4],data:(e=t[4])==null?void 0:e[0],map:t[2],close:t[31]}};function T1(t){let e,n,i=(t[4]||t[3]instanceof ds.Marker)&&L1(t);return{c(){e=jt("div"),i&&i.c()},m(s,c){Ut(s,e,c),i&&i.m(e,null),t[32](e),n=!0},p(s,c){s[4]||s[3]instanceof ds.Marker?i?(i.p(s,c),c[0]&24&&Rt(i,1)):(i=L1(s),i.c(),Rt(i,1),i.m(e,null)):i&&(ri(),Wt(i,1,1,()=>{i=null}),oi())},i(s){n||(Rt(i),n=!0)},o(s){Wt(i),n=!1},d(s){s&&Vt(e),i&&i.d(),t[32](null)}}}function L1(t){let e;const n=t[30].default,i=wr(n,t,t[29],C1);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)&&Ir(i,n,s,s[29],e?Sr(n,s[29],c,AL):Er(s[29]),C1)},i(s){e||(Rt(i,s),e=!0)},o(s){Wt(i,s),e=!1},d(s){i&&i.d(s)}}}function kL(t){let e,n,i=t[9].default&&T1(t);return{c(){i&&i.c(),e=bo()},m(s,c){i&&i.m(s,c),Ut(s,e,c),n=!0},p(s,c){s[9].default?i?(i.p(s,c),c[0]&512&&Rt(i,1)):(i=T1(s),i.c(),Rt(i,1),i.m(e.parentNode,e)):i&&(ri(),Wt(i,1,1,()=>{i=null}),oi())},i(s){n||(Rt(i),n=!0)},o(s){Wt(i),n=!1},d(s){s&&Vt(e),i&&i.d(s)}}}function DL(t,e,n){let i,s,c,f,u,v,{$$slots:w={},$$scope:I}=e;const L=F2(w);let{closeButton:A=void 0}=e,{closeOnClickOutside:U=!0}=e,{closeOnClickInside:z=!1}=e,{closeOnMove:K=!1}=e,{openOn:J="click"}=e,{openIfTopMost:Q=!0}=e,{focusAfterOpen:O=!0}=e,{anchor:G=void 0}=e,{offset:j=void 0}=e,{popupClass:lt=void 0}=e,{maxWidth:xt=void 0}=e,{lngLat:dt=void 0}=e,{html:ht=void 0}=e,{open:ct=!1}=e;const Pt=wu(),{map:$,popupTarget:Lt,layerEvent:ee,layer:Tt,eventTopMost:re}=ML();qe(t,$,St=>n(2,c=St)),qe(t,Lt,St=>n(3,u=St)),qe(t,ee,St=>n(28,f=St)),qe(t,Tt,St=>n(35,v=St));const _e=["click","dblclick","contextmenu"];let qt,Ne=!1,Ce;function pn(){if(!qt)return;let St=qt.getElement();!St||St===Ce||(Ce=St,J==="hover"&&(Ce.style.pointerEvents="none"),Ce.addEventListener("mouseenter",()=>{n(24,Ne=!0)},{passive:!0}),Ce.addEventListener("mouseleave",()=>{n(24,Ne=!1)},{passive:!0}),Ce.addEventListener("click",()=>{z&&n(0,ct=!1)},{passive:!0}))}U_(()=>{if(c)return c.on("click",_i),c.on("contextmenu",_i),typeof u=="string"&&(c.on("click",u,In),c.on("dblclick",u,In),c.on("contextmenu",u,In),c.on("mousemove",u,Ci),c.on("mouseleave",u,gi),c.on("touchstart",u,mn),c.on("touchend",u,Pn)),()=>{c!=null&&c.loaded()&&(qt==null||qt.remove(),c.off("click",_i),c.off("contextmenu",_i),u instanceof ds.Marker?u.getPopup()===qt&&u.setPopup(void 0):typeof u=="string"&&(c.off("click",u,In),c.off("dblclick",u,In),c.off("contextmenu",u,In),c.off("mousemove",u,Ci),c.off("mouseleave",u,gi),c.off("touchstart",u,mn),c.off("touchend",u,Pn)))}});function Ve(St){return Q?!("marker"in St)&&!PL(St)&&re(St)!==v:!1}let Ie=null,sn="normal";function In(St){St.type===J&&(Ve(St)||("layerType"in St?St.layerType==="deckgl"?(n(10,dt=St.coordinate),n(4,Ie=St.object?[St.object]:null)):(n(10,dt=St.lngLat),n(4,Ie=St.features??[])):(n(10,dt=St.lngLat),n(4,Ie=St.features??[])),setTimeout(()=>n(0,ct=!0))))}let dn=null;function mn(St){dn=St.point}function Pn(St){if(!dn||J!=="hover")return;let xe=dn.dist(St.point);dn=null,xe<3&&(n(10,dt=St.lngLat),n(4,Ie=St.features??[]),qt.isOpen()?n(25,sn="justOpened"):(n(25,sn="opening"),n(0,ct=!0)))}function gi(St){J!=="hover"||dn||sn!=="normal"||(n(0,ct=!1),n(4,Ie=null))}function Ci(St){if(!(J!=="hover"||dn||sn!=="normal")){if(Ve(St)){n(0,ct=!1),n(4,Ie=null);return}n(0,ct=!0),n(4,Ie=St.features??[]),n(10,dt=St.lngLat)}}function _i(St){if(sn==="justOpened"){n(25,sn="normal");return}if(!U)return;let xe=[Ce,u instanceof ds.Marker?u==null?void 0:u.getElement():null];ct&&qt.isOpen()&&!xe.some(An=>An==null?void 0:An.contains(St.originalEvent.target))&&(St.type==="contextmenu"&&J==="contextmenu"||St.type!=="contextmenu")&&n(0,ct=!1)}_s(()=>{c&&(qt!=null&&qt.isOpen())&&qt.remove()});let li;const Kt=()=>n(0,ct=!1);function mt(St){Cr[St?"unshift":"push"](()=>{li=St,n(1,li)})}return t.$$set=St=>{"closeButton"in St&&n(11,A=St.closeButton),"closeOnClickOutside"in St&&n(12,U=St.closeOnClickOutside),"closeOnClickInside"in St&&n(13,z=St.closeOnClickInside),"closeOnMove"in St&&n(14,K=St.closeOnMove),"openOn"in St&&n(15,J=St.openOn),"openIfTopMost"in St&&n(16,Q=St.openIfTopMost),"focusAfterOpen"in St&&n(17,O=St.focusAfterOpen),"anchor"in St&&n(18,G=St.anchor),"offset"in St&&n(19,j=St.offset),"popupClass"in St&&n(20,lt=St.popupClass),"maxWidth"in St&&n(21,xt=St.maxWidth),"lngLat"in St&&n(10,dt=St.lngLat),"html"in St&&n(22,ht=St.html),"open"in St&&n(0,ct=St.open),"$$scope"in St&&n(29,I=St.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&14336&&n(27,i=A??(!U&&!z)),t.$$.dirty[0]&146685952&&(qt||(n(23,qt=new ds.Popup({closeButton:i,closeOnClick:!1,closeOnMove:K,focusAfterOpen:O,maxWidth:xt,className:lt,anchor:G,offset:j})),Ce=qt.getElement(),qt.on("open",()=>{n(0,ct=!0),pn(),Pt("open",qt)}),qt.on("close",()=>{n(0,ct=!1),Pt("close",qt)}),qt.on("hover",()=>{Pt("hover",qt)}))),t.$$.dirty[0]&8421384&&qt&&u instanceof ds.Marker&&(J==="click"?u.setPopup(qt):u.getPopup()===qt&&u.setPopup(void 0)),t.$$.dirty[0]&268468224&&_e.includes(J)&&(f==null?void 0:f.type)===J&&(In(f),Jn(ee,f=null,f)),t.$$.dirty[0]&268468224&&n(26,s=J==="hover"&&((f==null?void 0:f.type)==="mousemove"||(f==null?void 0:f.type)==="mouseenter")),t.$$.dirty[0]&352354304&&J==="hover"&&ee&&(s&&f&&(f.layerType==="deckgl"?(n(10,dt=f.coordinate),n(4,Ie=f.object?[f.object]:null)):(n(10,dt=f.lngLat),n(4,Ie=f.features??[]))),n(0,ct=(s||Ne)??!1)),t.$$.dirty[0]&12582914&&(li?qt.setDOMContent(li):ht&&qt.setHTML(ht)),t.$$.dirty[0]&8389632&&dt&&qt.setLngLat(dt),t.$$.dirty[0]&41943045&&c){let St=qt.isOpen();ct&&!St?(qt.addTo(c),sn==="opening"&&n(25,sn="justOpened")):!ct&&St&&qt.remove()}},[ct,li,c,u,Ie,$,Lt,ee,Tt,L,dt,A,U,z,K,J,Q,O,G,j,lt,xt,ht,qt,Ne,sn,s,i,f,I,w,Kt,mt]}class RL extends fn{constructor(e){super(),hn(this,e,DL,kL,en,{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])}}const NL=t=>({props:t&8}),M1=t=>({props:FL(t[3])});function zL(t){let e;const n=t[1].default,i=wr(n,t,t[2],M1);return{c(){i&&i.c()},m(s,c){i&&i.m(s,c),e=!0},p(s,c){i&&i.p&&(!e||c&12)&&Ir(i,n,s,s[2],e?Sr(n,s[2],c,NL):Er(s[2]),M1)},i(s){e||(Rt(i,s),e=!0)},o(s){Wt(i,s),e=!1},d(s){i&&i.d(s)}}}function OL(t){let e,n;return e=new RL({props:{openOn:t[0],$$slots:{default:[zL,({features:i})=>({3:i}),({features:i})=>i?8:0]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(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||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function FL(t){return t?t[0].properties??{}:(console.log("A Popup with null features should be impossible"),{})}function BL(t,e,n){let{$$slots:i={},$$scope:s}=e,{openOn:c="hover"}=e;return t.$$set=f=>{"openOn"in f&&n(0,c=f.openOn),"$$scope"in f&&n(2,s=f.$$scope)},[c,i,s]}class Ub extends fn{constructor(e){super(),hn(this,e,BL,OL,en,{openOn:0})}}function P1(t,e,n){const i=t.slice();return i[1]=e[n][0],i[2]=e[n][1],i}function A1(t){let e,n,i=t[1]+"",s,c,f,u=t[2]+"",v,w;return{c(){e=jt("tr"),n=jt("td"),s=Cn(i),c=fe(),f=jt("td"),v=Cn(u),w=fe()},m(I,L){Ut(I,e,L),Gt(e,n),Gt(n,s),Gt(e,c),Gt(e,f),Gt(f,v),Gt(e,w)},p(I,L){L&1&&i!==(i=I[1]+"")&&Br(s,i),L&1&&u!==(u=I[2]+"")&&Br(v,u)},d(I){I&&Vt(e)}}}function VL(t){let e,n,i=po(Object.entries(t[0])),s=[];for(let c=0;c{"properties"in s&&n(0,i=s.properties)},[i]}class GL extends fn{constructor(e){super(),hn(this,e,UL,VL,en,{properties:0})}}function k1(t,e,n){const i=t.slice();return i[3]=e[n],i}function D1(t,e,n){const i=t.slice();return i[6]=e[n],i}function R1(t){let e,n;return{c(){e=jt("span"),n=Cn(`  - `),or(e,"background",t[6]),or(e,"width","100%"),or(e,"border","1px solid black")},m(i,s){Ut(i,e,s),Gt(e,n)},p(i,s){s&1&&or(e,"background",i[6])},d(i){i&&Vt(e)}}}function qL(t){let e,n=t[3]+"",i;return{c(){e=jt("span"),i=Cn(n)},m(s,c){Ut(s,e,c),Gt(e,i)},p(s,c){c&2&&n!==(n=s[3]+"")&&Br(i,n)},d(s){s&&Vt(e)}}}function jL(t){let e,n=t[3].toFixed(t[2])+"",i;return{c(){e=jt("span"),i=Cn(n)},m(s,c){Ut(s,e,c),Gt(e,i)},p(s,c){c&6&&n!==(n=s[3].toFixed(s[2])+"")&&Br(i,n)},d(s){s&&Vt(e)}}}function N1(t){let e;function n(c,f){return c[2]>0?jL:qL}let i=n(t),s=i(t);return{c(){s.c(),e=bo()},m(c,f){s.m(c,f),Ut(c,e,f)},p(c,f){i===(i=n(c))&&s?s.p(c,f):(s.d(1),s=i(c),s&&(s.c(),s.m(e.parentNode,e)))},d(c){c&&Vt(e),s.d(c)}}}function ZL(t){let e,n,i,s=po(t[0]),c=[];for(let v=0;v{"colorScale"in f&&n(0,i=f.colorScale),"limits"in f&&n(1,s=f.limits),"decimalPlaces"in f&&n(2,c=f.decimalPlaces)},[i,s,c]}class HL extends fn{constructor(e){super(),hn(this,e,WL,ZL,en,{colorScale:0,limits:1,decimalPlaces:2})}}function XL(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 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 YL(t,e,n){let i=["step",t];for(let s=1;s({}),z1=t=>({}),JL=t=>({}),O1=t=>({});function QL(t){let e,n,i,s;const c=t[3].sidebar,f=wr(c,t,t[2],O1),u=t[3].map,v=wr(u,t,t[2],z1);return{c(){e=jt("div"),f&&f.c(),n=fe(),i=jt("div"),v&&v.c()},m(w,I){Ut(w,e,I),f&&f.m(e,null),t[4](e),Ut(w,n,I),Ut(w,i,I),v&&v.m(i,null),t[5](i),s=!0},p(w,[I]){f&&f.p&&(!s||I&4)&&Ir(f,c,w,w[2],s?Sr(c,w[2],I,JL):Er(w[2]),O1),v&&v.p&&(!s||I&4)&&Ir(v,u,w,w[2],s?Sr(u,w[2],I,KL):Er(w[2]),z1)},i(w){s||(Rt(f,w),Rt(v,w),s=!0)},o(w){Wt(f,w),Wt(v,w),s=!1},d(w){w&&(Vt(e),Vt(n),Vt(i)),f&&f.d(w),t[4](null),v&&v.d(w),t[5](null)}}}function $L(t,e,n){let i,s;qe(t,F_,w=>n(0,i=w)),qe(t,B_,w=>n(1,s=w));let{$$slots:c={},$$scope:f}=e;function u(w){Cr[w?"unshift":"push"](()=>{i=w,F_.set(i)})}function v(w){Cr[w?"unshift":"push"](()=>{s=w,B_.set(s)})}return t.$$set=w=>{"$$scope"in w&&n(2,f=w.$$scope)},[i,s,f,c,u,v]}class Qm extends fn{constructor(e){super(),hn(this,e,$L,QL,en,{})}}function tM(t){let e,n,i,s,c,f,u,v,w,I,L,A,U;return{c(){e=jt("div"),n=jt("h2"),n.textContent="Debug mode",i=fe(),s=jt("div"),c=jt("button"),c.textContent="Change study area",f=fe(),u=jt("button"),u.textContent="Route mode",v=fe(),w=jt("button"),w.textContent="Score mode",I=fe(),L=jt("p"),L.textContent="Hover to see a segment's properties, and click to open OSM",Zt(e,"slot","sidebar")},m(z,K){Ut(z,e,K),Gt(e,n),Gt(e,i),Gt(e,s),Gt(s,c),Gt(s,f),Gt(s,u),Gt(s,v),Gt(s,w),Gt(e,I),Gt(e,L),A||(U=[$e(c,"click",t[5]),$e(u,"click",t[6]),$e(w,"click",t[7])],A=!0)},p:Oe,d(z){z&&Vt(e),A=!1,yr(U)}}}function eM(t){let e,n,i=t[8].kind+"",s,c,f,u;return f=new GL({props:{properties:t[8]}}),{c(){e=jt("h2"),n=Cn("Classified as "),s=Cn(i),c=fe(),Ae(f.$$.fragment)},m(v,w){Ut(v,e,w),Gt(e,n),Gt(e,s),Ut(v,c,w),Me(f,v,w),u=!0},p(v,w){(!u||w&256)&&i!==(i=v[8].kind+"")&&Br(s,i);const I={};w&256&&(I.properties=v[8]),f.$set(I)},i(v){u||(Rt(f.$$.fragment,v),u=!0)},o(v){Wt(f.$$.fragment,v),u=!1},d(v){v&&(Vt(e),Vt(c)),Pe(f,v)}}}function nM(t){let e,n;return e=new Ub({props:{openOn:"hover",$$slots:{default:[eM,({props:i})=>({8:i}),({props:i})=>i?256:0]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,s){const c={};s&768&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function iM(t){let e,n;return e=new Vp({props:{id:"network",paint:{"line-width":$0(5,7),"line-color":au(["get","kind"],ja,"yellow"),"line-opacity":t[0]?t[1]/100:au(["get","kind"],{Severance:0},t[1]/100)},manageHoverState:!0,hoverCursor:"pointer",$$slots:{default:[nM]},$$scope:{ctx:t}}}),e.$on("click",t[4]),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,s){const c={};s&3&&(c.paint={"line-width":$0(5,7),"line-color":au(["get","kind"],ja,"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||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function rM(t){let e,n,i;return n=new Jh({props:{data:JSON.parse(tl(t[2]).render()),generateId:!0,$$slots:{default:[iM]},$$scope:{ctx:t}}}),{c(){e=jt("div"),Ae(n.$$.fragment),Zt(e,"slot","map")},m(s,c){Ut(s,e,c),Me(n,e,null),i=!0},p(s,c){const f={};c&4&&(f.data=JSON.parse(tl(s[2]).render())),c&515&&(f.$$scope={dirty:c,ctx:s}),n.$set(f)},i(s){i||(Rt(n.$$.fragment,s),i=!0)},o(s){Wt(n.$$.fragment,s),i=!1},d(s){s&&Vt(e),Pe(n)}}}function oM(t){let e,n;return e=new Qm({props:{$$slots:{map:[rM],sidebar:[tM]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,[s]){const c={};s&527&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function sM(t,e,n){let i,s;qe(t,Nl,L=>n(2,i=L)),qe(t,Yo,L=>n(3,s=L));let{showSeverances:c}=e,{opacity:f}=e;const u=L=>window.open(tl(L.detail.features[0].properties).way,"_blank"),v=()=>Jn(Yo,s="title",s),w=()=>Jn(Yo,s="route",s),I=()=>Jn(Yo,s="score",s);return t.$$set=L=>{"showSeverances"in L&&n(0,c=L.showSeverances),"opacity"in L&&n(1,f=L.opacity)},[c,f,i,s,u,v,w,I]}class aM extends fn{constructor(e){super(),hn(this,e,sM,oM,en,{showSeverances:0,opacity:1})}}function F1(t,e,n){const i=t.slice();return i[2]=e[n],i}function B1(t){let e,n,i=V1(t[2])+"",s,c;return{c(){e=jt("li"),n=jt("a"),c=fe(),Zt(n,"href",s=tl(t[2].properties).way),Zt(n,"target","_blank")},m(f,u){Ut(f,e,u),Gt(e,n),n.innerHTML=i,Gt(e,c)},p(f,u){u&1&&i!==(i=V1(f[2])+"")&&(n.innerHTML=i),u&1&&s!==(s=tl(f[2].properties).way)&&Zt(n,"href",s)},d(f){f&&Vt(e)}}}function lM(t){let e,n,i,s=(t[0].route_length/t[0].direct_length).toFixed(1)+"",c,f,u,v,w,I=t[1](t[0])+"",L,A,U,z,K=po(t[0].features),J=[];for(let Q=0;Q{"route_gj"in c&&n(0,i=c.route_gj)},[i,s]}class cM extends fn{constructor(e){super(),hn(this,e,uM,lM,en,{route_gj:0})}}function hM(t){let e,n;return e=new Vp({props:{id:"network",paint:{"line-width":5,"line-color":au(["get","kind"],ja,"yellow"),"line-opacity":t[0]?t[1]/100:au(["get","kind"],{Severance:0},t[1]/100)}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,s){const c={};s&3&&(c.paint={"line-width":5,"line-color":au(["get","kind"],ja,"yellow"),"line-opacity":i[0]?i[1]/100:au(["get","kind"],{Severance:0},i[1]/100)}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function fM(t){let e,n;return e=new Jh({props:{data:JSON.parse(tl(t[2]).render()),$$slots:{default:[hM]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,[s]){const c={};s&4&&(c.data=JSON.parse(tl(i[2]).render())),s&11&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function pM(t,e,n){let i;qe(t,Nl,f=>n(2,i=f));let{showSeverances:s}=e,{opacity:c}=e;return t.$$set=f=>{"showSeverances"in f&&n(0,s=f.showSeverances),"opacity"in f&&n(1,c=f.opacity)},[s,c,i]}class qb extends fn{constructor(e){super(),hn(this,e,pM,fM,en,{showSeverances:0,opacity:1})}}function U1(t){let e,n;return{c(){e=jt("p"),n=Cn(t[5])},m(i,s){Ut(i,e,s),Gt(e,n)},p(i,s){s&32&&Br(n,i[5])},d(i){i&&Vt(e)}}}function G1(t){let e,n;return e=new cM({props:{route_gj:t[4]}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,s){const c={};s&16&&(c.route_gj=i[4]),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function dM(t){let e,n,i,s,c,f,u,v,w,I,L,A,U,z,K,J,Q=t[5]&&U1(t),O=t[4]&&G1(t);return{c(){e=jt("div"),n=jt("h2"),n.textContent="Route mode",i=fe(),s=jt("div"),c=jt("button"),c.textContent="Change study area",f=fe(),u=jt("button"),u.textContent="Score mode",v=fe(),w=jt("button"),w.textContent="Debug OSM",I=fe(),L=jt("p"),L.innerHTML=`Move the A and B pins to find a walking route. (Hint: right-click - to set the first pin somewhere.)`,A=fe(),Q&&Q.c(),U=fe(),O&&O.c(),Zt(e,"slot","sidebar")},m(G,j){Ut(G,e,j),Gt(e,n),Gt(e,i),Gt(e,s),Gt(s,c),Gt(s,f),Gt(s,u),Gt(e,v),Gt(e,w),Gt(e,I),Gt(e,L),Gt(e,A),Q&&Q.m(e,null),Gt(e,U),O&&O.m(e,null),z=!0,K||(J=[$e(c,"click",t[11]),$e(u,"click",t[12]),$e(w,"click",t[13])],K=!0)},p(G,j){G[5]?Q?Q.p(G,j):(Q=U1(G),Q.c(),Q.m(e,U)):Q&&(Q.d(1),Q=null),G[4]?O?(O.p(G,j),j&16&&Rt(O,1)):(O=G1(G),O.c(),Rt(O,1),O.m(e,null)):O&&(ri(),Wt(O,1,1,()=>{O=null}),oi())},i(G){z||(Rt(O),z=!0)},o(G){Wt(O),z=!1},d(G){G&&Vt(e),Q&&Q.d(),O&&O.d(),K=!1,yr(J)}}}function mM(t){let e;return{c(){e=jt("span"),e.textContent="A",Zt(e,"class","dot svelte-1ej0v4r")},m(n,i){Ut(n,e,i)},p:Oe,d(n){n&&Vt(e)}}}function gM(t){let e;return{c(){e=jt("span"),e.textContent="B",Zt(e,"class","dot svelte-1ej0v4r")},m(n,i){Ut(n,e,i)},p:Oe,d(n){n&&Vt(e)}}}function q1(t){let e,n;return e=new Jh({props:{data:t[4],$$slots:{default:[_M]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,s){const c={};s&16&&(c.data=i[4]),s&32768&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function _M(t){let e,n;return e=new Vp({props:{id:"route",beforeId:"network",paint:{"line-width":20,"line-color":"cyan","line-opacity":.5}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p:Oe,i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function yM(t){let e,n,i,s,c,f,u,v,w,I,L,A;n=new gx({}),n.$on("contextmenu",t[7]),s=new qb({props:{showSeverances:t[0],opacity:t[1]}});function U(O){t[9](O)}let z={draggable:!0,$$slots:{default:[mM]},$$scope:{ctx:t}};t[2]!==void 0&&(z.lngLat=t[2]),f=new uv({props:z}),Cr.push(()=>hu(f,"lngLat",U));function K(O){t[10](O)}let J={draggable:!0,$$slots:{default:[gM]},$$scope:{ctx:t}};t[3]!==void 0&&(J.lngLat=t[3]),w=new uv({props:J}),Cr.push(()=>hu(w,"lngLat",K));let Q=t[4]&&q1(t);return{c(){e=jt("div"),Ae(n.$$.fragment),i=fe(),Ae(s.$$.fragment),c=fe(),Ae(f.$$.fragment),v=fe(),Ae(w.$$.fragment),L=fe(),Q&&Q.c(),Zt(e,"slot","map")},m(O,G){Ut(O,e,G),Me(n,e,null),Gt(e,i),Me(s,e,null),Gt(e,c),Me(f,e,null),Gt(e,v),Me(w,e,null),Gt(e,L),Q&&Q.m(e,null),A=!0},p(O,G){const j={};G&1&&(j.showSeverances=O[0]),G&2&&(j.opacity=O[1]),s.$set(j);const lt={};G&32768&&(lt.$$scope={dirty:G,ctx:O}),!u&&G&4&&(u=!0,lt.lngLat=O[2],cu(()=>u=!1)),f.$set(lt);const xt={};G&32768&&(xt.$$scope={dirty:G,ctx:O}),!I&&G&8&&(I=!0,xt.lngLat=O[3],cu(()=>I=!1)),w.$set(xt),O[4]?Q?(Q.p(O,G),G&16&&Rt(Q,1)):(Q=q1(O),Q.c(),Rt(Q,1),Q.m(e,null)):Q&&(ri(),Wt(Q,1,1,()=>{Q=null}),oi())},i(O){A||(Rt(n.$$.fragment,O),Rt(s.$$.fragment,O),Rt(f.$$.fragment,O),Rt(w.$$.fragment,O),Rt(Q),A=!0)},o(O){Wt(n.$$.fragment,O),Wt(s.$$.fragment,O),Wt(f.$$.fragment,O),Wt(w.$$.fragment,O),Wt(Q),A=!1},d(O){O&&Vt(e),Pe(n),Pe(s),Pe(f),Pe(w),Q&&Q.d()}}}function vM(t){let e,n;return e=new Qm({props:{$$slots:{map:[yM],sidebar:[dM]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,[s]){const c={};s&32895&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function hm(t,e,n){return e+t*(n-e)}function xM(t,e,n){let i,s;qe(t,Nl,O=>n(8,i=O)),qe(t,Yo,O=>n(6,s=O));let{showSeverances:c}=e,{opacity:f}=e,u=Array.from(i.getBounds()),v={lng:hm(.4,u[0],u[2]),lat:hm(.4,u[1],u[3])},w={lng:hm(.6,u[0],u[2]),lat:hm(.6,u[1],u[3])},I=null,L="";function A(O){n(2,v=O.detail.lngLat)}function U(O){v=O,n(2,v)}function z(O){w=O,n(3,w)}const K=()=>Jn(Yo,s="title",s),J=()=>Jn(Yo,s="score",s),Q=()=>Jn(Yo,s="debug",s);return t.$$set=O=>{"showSeverances"in O&&n(0,c=O.showSeverances),"opacity"in O&&n(1,f=O.opacity)},t.$$.update=()=>{if(t.$$.dirty&268&&v&&w)try{n(4,I=JSON.parse(i.compareRoute({x1:v.lng,y1:v.lat,x2:w.lng,y2:w.lat}))),n(5,L="")}catch(O){n(4,I=null),n(5,L=O.toString())}},[c,f,v,w,I,L,s,A,i,U,z,K,J,Q]}class bM extends fn{constructor(e){super(),hn(this,e,xM,vM,en,{showSeverances:0,opacity:1})}}function wM(t){let e,n,i,s,c,f,u,v,w,I,L,A,U,z,K,J;return U=new HL({props:{colorScale:xx,limits:bx}}),{c(){e=jt("div"),n=jt("h2"),n.textContent="Score mode",i=fe(),s=jt("div"),c=jt("button"),c.textContent="Change study area",f=fe(),u=jt("button"),u.textContent="Route mode",v=fe(),w=jt("button"),w.textContent="Debug OSM",I=fe(),L=jt("p"),L.innerHTML=`The desire lines are coloured based on their detour factor. Click one - to see the route`,A=fe(),Ae(U.$$.fragment),Zt(e,"slot","sidebar")},m(Q,O){Ut(Q,e,O),Gt(e,n),Gt(e,i),Gt(e,s),Gt(s,c),Gt(s,f),Gt(s,u),Gt(e,v),Gt(e,w),Gt(e,I),Gt(e,L),Gt(e,A),Me(U,e,null),z=!0,K||(J=[$e(c,"click",t[7]),$e(u,"click",t[8]),$e(w,"click",t[9])],K=!0)},p:Oe,i(Q){z||(Rt(U.$$.fragment,Q),z=!0)},o(Q){Wt(U.$$.fragment,Q),z=!1},d(Q){Q&&Vt(e),Pe(U),K=!1,yr(J)}}}function SM(t){let e,n=t[11].score.toFixed(1)+"",i,s;return{c(){e=jt("span"),i=Cn(n),s=Cn("x"),or(e,"font-size","26px")},m(c,f){Ut(c,e,f),Gt(e,i),Gt(e,s)},p(c,f){f&2048&&n!==(n=c[11].score.toFixed(1)+"")&&Br(i,n)},d(c){c&&Vt(e)}}}function IM(t){let e,n;return e=new Ub({props:{openOn:"hover",$$slots:{default:[SM,({props:i})=>({11:i}),({props:i})=>i?2048:0]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,s){const c={};s&6144&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function EM(t){let e,n;return e=new Vp({props:{id:"scores",paint:{"line-width":8,"line-color":YL(["get","score"],bx,xx)},$$slots:{default:[IM]},$$scope:{ctx:t}}}),e.$on("click",t[5]),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,s){const c={};s&4096&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function j1(t){let e,n;return e=new Jh({props:{data:t[2],$$slots:{default:[CM]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(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||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function CM(t){let e,n;return e=new Vp({props:{id:"route",beforeId:"network",paint:{"line-width":20,"line-color":"cyan","line-opacity":.5}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p:Oe,i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function TM(t){let e,n,i,s,c,f,u,v;n=new gx({}),n.$on("click",t[6]),s=new qb({props:{showSeverances:t[0],opacity:t[1]}}),f=new Jh({props:{data:JSON.parse(tl(t[3]).makeHeatmap()),$$slots:{default:[EM]},$$scope:{ctx:t}}});let w=t[2]&&j1(t);return{c(){e=jt("div"),Ae(n.$$.fragment),i=fe(),Ae(s.$$.fragment),c=fe(),Ae(f.$$.fragment),u=fe(),w&&w.c(),Zt(e,"slot","map")},m(I,L){Ut(I,e,L),Me(n,e,null),Gt(e,i),Me(s,e,null),Gt(e,c),Me(f,e,null),Gt(e,u),w&&w.m(e,null),v=!0},p(I,L){const A={};L&1&&(A.showSeverances=I[0]),L&2&&(A.opacity=I[1]),s.$set(A);const U={};L&8&&(U.data=JSON.parse(tl(I[3]).makeHeatmap())),L&4096&&(U.$$scope={dirty:L,ctx:I}),f.$set(U),I[2]?w?(w.p(I,L),L&4&&Rt(w,1)):(w=j1(I),w.c(),Rt(w,1),w.m(e,null)):w&&(ri(),Wt(w,1,1,()=>{w=null}),oi())},i(I){v||(Rt(n.$$.fragment,I),Rt(s.$$.fragment,I),Rt(f.$$.fragment,I),Rt(w),v=!0)},o(I){Wt(n.$$.fragment,I),Wt(s.$$.fragment,I),Wt(f.$$.fragment,I),Wt(w),v=!1},d(I){I&&Vt(e),Pe(n),Pe(s),Pe(f),w&&w.d()}}}function LM(t){let e,n;return e=new Qm({props:{$$slots:{map:[TM],sidebar:[wM]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,[s]){const c={};s&4127&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function MM(t,e,n){let i,s,c;qe(t,Jm,z=>n(10,i=z)),qe(t,Nl,z=>n(3,s=z)),qe(t,Yo,z=>n(4,c=z));let{showSeverances:f}=e,{opacity:u}=e,v=null;function w(z){try{let K=z.detail.features[0].geometry.coordinates;n(2,v=JSON.parse(s.compareRoute({x1:K[0][0],y1:K[0][1],x2:K[1][0],y2:K[1][1]})))}catch(K){window.alert(`No route: ${K}`),n(2,v=null)}}function I(z){i.queryRenderedFeatures(z.detail.point,{layers:["scores"]}).length>0||n(2,v=null)}const L=()=>Jn(Yo,c="title",c),A=()=>Jn(Yo,c="route",c),U=()=>Jn(Yo,c="debug",c);return t.$$set=z=>{"showSeverances"in z&&n(0,f=z.showSeverances),"opacity"in z&&n(1,u=z.opacity)},[f,u,v,s,c,w,I,L,A,U]}class PM extends fn{constructor(e){super(),hn(this,e,MM,LM,en,{showSeverances:0,opacity:1})}}function Z1(t,e,n){const i=t.slice();return i[17]=e[n][0],i[18]=e[n][1],i}function W1(t,e,n){const i=t.slice();return i[21]=e[n][0],i[22]=e[n][1],i}function H1(t){let e,n=t[22]+"",i,s;return{c(){e=jt("option"),i=Cn(n),e.__value=s=t[21],tc(e,e.__value)},m(c,f){Ut(c,e,f),Gt(e,i)},p(c,f){f&4&&n!==(n=c[22]+"")&&Br(i,n),f&4&&s!==(s=c[21])&&(e.__value=s,tc(e,e.__value))},d(c){c&&Vt(e)}}}function X1(t){let e,n,i=po(t[18]),s=[];for(let c=0;ct[7].call(f)),Zt(z,"type","file")},m(ht,ct){Me(e,ht,ct),Ut(ht,n,ct),Ut(ht,i,ct),Gt(i,s),Gt(s,c),Gt(s,f),Gt(f,u);for(let Pt=0;Ptn(12,i=j)),qe(t,Nl,j=>n(13,s=j)),qe(t,Jm,j=>n(4,c=j));let f="",u="",v=!1,w=[];U_(async()=>{try{let j=await fetch("/osm/areas.json");if(j.ok)v=!0,console.log("Using local cache, not od2net.org"),n(2,w=await j.json());else{let lt=await fetch("https://assets.od2net.org/severance_pbfs/areas.json");n(2,w=await lt.json())}}catch{}});let I;async function L(j){try{A(await I.files[0].arrayBuffer()),n(0,f="")}catch(lt){window.alert(`Couldn't open this file: ${lt}`)}n(1,u="")}function A(j){n(1,u="Building map model from OSM input"),console.time("load"),Jn(Nl,s=new eS(new Uint8Array(j),i),s),console.timeEnd("load")}function U(j){try{A(new TextEncoder().encode(j.detail)),n(0,f="")}catch(lt){window.alert(`Couldn't import from Overpass: ${lt}`)}n(1,u="")}async function z(j){j!=""&&(v?await K(`/osm/${j}.pbf`):await K(`https://assets.od2net.org/severance_pbfs/${j}.pbf`))}async function K(j){try{n(1,u=`Downloading ${j}`);let lt=await fetch(j);A(await lt.arrayBuffer())}catch(lt){window.alert(`Couldn't open from URL ${j}: ${lt}`)}n(1,u="")}function J(){f=q2(this),n(0,f),n(2,w)}function Q(j){Cr[j?"unshift":"push"](()=>{I=j,n(3,I)})}const O=j=>n(1,u=j.detail),G=j=>window.alert(j.detail);return t.$$.update=()=>{t.$$.dirty&1&&z(f)},[f,u,w,I,c,L,U,J,Q,O,G]}class DM extends fn{constructor(e){super(),hn(this,e,kM,AM,en,{})}}function Y1(t){let e,n;return e=new eT({props:{$$slots:{default:[RM,({dialog:i})=>({9:i}),({dialog:i})=>i?512:0]},$$scope:{ctx:t}}}),e.$on("close",t[5]),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,s){const c={};s&1536&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function RM(t){let e,n,i,s,c,f,u,v,w,I,L,A,U,z,K,J,Q,O,G,j,lt,xt;function dt(){return t[4](t[9])}return{c(){e=jt("h1"),e.textContent="Severance Snape",n=fe(),i=jt("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=fe(),c=jt("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.`,f=fe(),u=jt("p"),u.innerHTML=`This tool is experimental, so there will be bugs both with OSM - data and what the tool shows!`,v=fe(),w=jt("p"),w.textContent="To use this tool, you need to:",I=fe(),L=jt("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=fe(),U=jt("p"),U.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.`,z=fe(),K=jt("p"),K.innerHTML=`This open source - tool is created by - Dustin Carlino - and relies heavily on - OpenStreetMap data.`,J=fe(),Q=jt("details"),Q.innerHTML='Changelog

    GitHub has more detail; this is a summary

    • 17 February - use Pico for styling
    • 21 January - fix shortest route calculations
    ',O=fe(),G=jt("center"),j=jt("button"),j.textContent="Start!"},m(ht,ct){Ut(ht,e,ct),Ut(ht,n,ct),Ut(ht,i,ct),Ut(ht,s,ct),Ut(ht,c,ct),Ut(ht,f,ct),Ut(ht,u,ct),Ut(ht,v,ct),Ut(ht,w,ct),Ut(ht,I,ct),Ut(ht,L,ct),Ut(ht,A,ct),Ut(ht,U,ct),Ut(ht,z,ct),Ut(ht,K,ct),Ut(ht,J,ct),Ut(ht,Q,ct),Ut(ht,O,ct),Ut(ht,G,ct),Gt(G,j),lt||(xt=$e(j,"click",dt),lt=!0)},p(ht,ct){t=ht},d(ht){ht&&(Vt(e),Vt(n),Vt(i),Vt(s),Vt(c),Vt(f),Vt(u),Vt(v),Vt(w),Vt(I),Vt(L),Vt(A),Vt(U),Vt(z),Vt(K),Vt(J),Vt(Q),Vt(O),Vt(G)),lt=!1,xt()}}}function NM(t){let e;return{c(){e=jt("p"),e.textContent="Waiting for MapLibre and WASM to load..."},m(n,i){Ut(n,e,i)},i:Oe,o:Oe,d(n){n&&Vt(e)}}}function zM(t){let e,n;return e=new DM({}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function OM(t){let e,n,i,s,c,f,u,v,w,I,L,A,U,z,K,J,Q,O,G,j,lt=t[1]&&Y1(t);const xt=[zM,NM],dt=[];function ht(ct,Pt){return ct[2]&&ct[0]?0:1}return w=ht(t),I=dt[w]=xt[w](t),{c(){e=jt("div"),lt&<.c(),n=fe(),i=jt("h2"),i.textContent="Choose your study area",s=fe(),c=jt("button"),c.textContent="About this tool",f=fe(),u=jt("hr"),v=fe(),I.c(),L=fe(),A=jt("div"),U=jt("label"),z=jt("input"),K=Cn(` - 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 - `),J=jt("a"),J.textContent="separate ways",Q=Cn(". Disable this in those places.)"),Zt(z,"type","checkbox"),Zt(J,"href","https://wiki.openstreetmap.org/wiki/Sidewalks#Sidewalk_as_separate_way"),Zt(J,"target","_blank"),Zt(e,"slot","sidebar")},m(ct,Pt){Ut(ct,e,Pt),lt&<.m(e,null),Gt(e,n),Gt(e,i),Gt(e,s),Gt(e,c),Gt(e,f),Gt(e,u),Gt(e,v),dt[w].m(e,null),Gt(e,L),Gt(e,A),Gt(A,U),Gt(U,z),z.checked=t[3],Gt(U,K),Gt(U,J),Gt(U,Q),O=!0,G||(j=[$e(c,"click",t[6]),$e(z,"change",t[7])],G=!0)},p(ct,Pt){ct[1]?lt?(lt.p(ct,Pt),Pt&2&&Rt(lt,1)):(lt=Y1(ct),lt.c(),Rt(lt,1),lt.m(e,n)):lt&&(ri(),Wt(lt,1,1,()=>{lt=null}),oi());let $=w;w=ht(ct),w!==$&&(ri(),Wt(dt[$],1,1,()=>{dt[$]=null}),oi(),I=dt[w],I||(I=dt[w]=xt[w](ct),I.c()),Rt(I,1),I.m(e,L)),Pt&8&&(z.checked=ct[3])},i(ct){O||(Rt(lt),Rt(I),O=!0)},o(ct){Wt(lt),Wt(I),O=!1},d(ct){ct&&Vt(e),lt&<.d(),dt[w].d(),G=!1,yr(j)}}}function FM(t){let e,n,i;return n=new Vb({}),{c(){e=jt("div"),Ae(n.$$.fragment),Zt(e,"slot","map")},m(s,c){Ut(s,e,c),Me(n,e,null),i=!0},p:Oe,i(s){i||(Rt(n.$$.fragment,s),i=!0)},o(s){Wt(n.$$.fragment,s),i=!1},d(s){s&&Vt(e),Pe(n)}}}function BM(t){let e,n;return e=new Qm({props:{$$slots:{map:[FM],sidebar:[OM]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,[s]){const c={};s&1039&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function VM(t,e,n){let i,s,c,f;qe(t,Nl,A=>n(8,i=A)),qe(t,m_,A=>n(1,s=A)),qe(t,Jm,A=>n(2,c=A)),qe(t,V_,A=>n(3,f=A));let{wasmReady:u}=e;Jn(Nl,i=null,i);const v=A=>tl(A).close(),w=()=>Jn(m_,s=!1,s),I=()=>Jn(m_,s=!0,s);function L(){f=this.checked,V_.set(f)}return t.$$set=A=>{"wasmReady"in A&&n(0,u=A.wasmReady)},[u,s,c,f,v,w,I,L]}class UM extends fn{constructor(e){super(),hn(this,e,VM,BM,en,{wasmReady:0})}}function K1(t){let e,n,i,s,c,f,u,v,w,I,L,A,U,z,K,J,Q,O,G;return f=new XC({props:{rows:[["Footway (ground, outdoors)",ja.Footway],["Indoors footway",ja.Indoors],["Footway not on the ground",ja.BridgeOrTunnel],["Street with vehicle traffic (maybe with a sidewalk, maybe not)",ja.WithTraffic],["Crossing",ja.Crossing],["Severance",ja.Severance]]}}),{c(){e=jt("hr"),n=fe(),i=jt("div"),s=jt("button"),s.textContent="Zoom to fit",c=fe(),Ae(f.$$.fragment),u=fe(),v=jt("div"),w=jt("label"),I=jt("input"),L=Cn(` - Show severances`),A=fe(),U=jt("div"),z=jt("label"),K=Cn(`Network opacity: - `),J=jt("input"),Zt(I,"type","checkbox"),Zt(J,"type","range"),Zt(J,"min","0"),Zt(J,"max","100")},m(j,lt){Ut(j,e,lt),Ut(j,n,lt),Ut(j,i,lt),Gt(i,s),Ut(j,c,lt),Me(f,j,lt),Ut(j,u,lt),Ut(j,v,lt),Gt(v,w),Gt(w,I),I.checked=t[6],Gt(w,L),Ut(j,A,lt),Ut(j,U,lt),Gt(U,z),Gt(z,K),Gt(z,J),tc(J,t[5]),Q=!0,O||(G=[$e(s,"click",t[8]),$e(I,"change",t[14]),$e(J,"change",t[15]),$e(J,"input",t[15])],O=!0)},p(j,lt){lt&64&&(I.checked=j[6]),lt&32&&tc(J,j[5])},i(j){Q||(Rt(f.$$.fragment,j),Q=!0)},o(j){Wt(f.$$.fragment,j),Q=!1},d(j){j&&(Vt(e),Vt(n),Vt(i),Vt(c),Vt(u),Vt(v),Vt(A),Vt(U)),Pe(f,j),O=!1,yr(G)}}}function GM(t){let e,n,i,s,c,f,u=t[7]!="title"&&K1(t);return{c(){e=jt("div"),n=jt("h1"),n.textContent="Severance Snape",i=fe(),s=jt("div"),c=fe(),u&&u.c(),Zt(e,"slot","left")},m(v,w){Ut(v,e,w),Gt(e,n),Gt(e,i),Gt(e,s),t[13](s),Gt(e,c),u&&u.m(e,null),f=!0},p(v,w){v[7]!="title"?u?(u.p(v,w),w&128&&Rt(u,1)):(u=K1(v),u.c(),Rt(u,1),u.m(e,null)):u&&(ri(),Wt(u,1,1,()=>{u=null}),oi())},i(v){f||(Rt(u),f=!0)},o(v){Wt(u),f=!1},d(v){v&&Vt(e),t[13](null),u&&u.d()}}}function J1(t){let e,n;return e=new UM({props:{wasmReady:t[4]}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,s){const c={};s&16&&(c.wasmReady=i[4]),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function Q1(t){let e,n,i,s,c,f;e=new Jh({props:{data:JSON.parse(t[3].getInvertedBoundary()),$$slots:{default:[qM]},$$scope:{ctx:t}}});const u=[WM,ZM,jM],v=[];function w(I,L){return I[7]=="route"?0:I[7]=="score"?1:I[7]=="debug"?2:-1}return~(i=w(t))&&(s=v[i]=u[i](t)),{c(){Ae(e.$$.fragment),n=fe(),s&&s.c(),c=bo()},m(I,L){Me(e,I,L),Ut(I,n,L),~i&&v[i].m(I,L),Ut(I,c,L),f=!0},p(I,L){const A={};L&8&&(A.data=JSON.parse(I[3].getInvertedBoundary())),L&131072&&(A.$$scope={dirty:L,ctx:I}),e.$set(A);let U=i;i=w(I),i===U?~i&&v[i].p(I,L):(s&&(ri(),Wt(v[U],1,1,()=>{v[U]=null}),oi()),~i?(s=v[i],s?s.p(I,L):(s=v[i]=u[i](I),s.c()),Rt(s,1),s.m(c.parentNode,c)):s=null)},i(I){f||(Rt(e.$$.fragment,I),Rt(s),f=!0)},o(I){Wt(e.$$.fragment,I),Wt(s),f=!1},d(I){I&&(Vt(n),Vt(c)),Pe(e,I),~i&&v[i].d(I)}}}function qM(t){let e,n;return e=new xS({props:{paint:{"fill-color":"black","fill-opacity":.3}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p:Oe,i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function jM(t){let e,n;return e=new aM({props:{showSeverances:t[6],opacity:t[5]}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(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||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function ZM(t){let e,n;return e=new PM({props:{showSeverances:t[6],opacity:t[5]}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(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||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function WM(t){let e,n;return e=new bM({props:{showSeverances:t[6],opacity:t[5]}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(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||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function HM(t){let e,n,i,s,c,f,u,v,w;e=new ZC({props:{map:t[0],apiKey:Gb}}),c=new Vb({});let I=t[7]=="title"&&J1(t),L=t[3]&&Q1(t);return{c(){Ae(e.$$.fragment),n=fe(),i=jt("div"),s=fe(),Ae(c.$$.fragment),f=fe(),I&&I.c(),u=fe(),L&&L.c(),v=bo()},m(A,U){Me(e,A,U),Ut(A,n,U),Ut(A,i,U),t[11](i),Ut(A,s,U),Me(c,A,U),Ut(A,f,U),I&&I.m(A,U),Ut(A,u,U),L&&L.m(A,U),Ut(A,v,U),w=!0},p(A,U){const z={};U&1&&(z.map=A[0]),e.$set(z),A[7]=="title"?I?(I.p(A,U),U&128&&Rt(I,1)):(I=J1(A),I.c(),Rt(I,1),I.m(u.parentNode,u)):I&&(ri(),Wt(I,1,1,()=>{I=null}),oi()),A[3]?L?(L.p(A,U),U&8&&Rt(L,1)):(L=Q1(A),L.c(),Rt(L,1),L.m(v.parentNode,v)):L&&(ri(),Wt(L,1,1,()=>{L=null}),oi())},i(A){w||(Rt(e.$$.fragment,A),Rt(c.$$.fragment,A),Rt(I),Rt(L),w=!0)},o(A){Wt(e.$$.fragment,A),Wt(c.$$.fragment,A),Wt(I),Wt(L),w=!1},d(A){A&&(Vt(n),Vt(i),Vt(s),Vt(f),Vt(u),Vt(v)),Pe(e,A),t[11](null),Pe(c,A),I&&I.d(A),L&&L.d(A)}}}function XM(t){let e,n,i,s;function c(u){t[12](u)}let f={style:`https://api.maptiler.com/maps/dataviz/style.json?key=${Gb}`,standardControls:!0,hash:!0,$$slots:{default:[HM]},$$scope:{ctx:t}};return t[0]!==void 0&&(f.map=t[0]),n=new ZS({props:f}),Cr.push(()=>hu(n,"map",c)),{c(){e=jt("div"),Ae(n.$$.fragment),Zt(e,"slot","main"),or(e,"position","relative"),or(e,"width","100%"),or(e,"height","100vh")},m(u,v){Ut(u,e,v),Me(n,e,null),s=!0},p(u,v){const w={};v&131325&&(w.$$scope={dirty:v,ctx:u}),!i&&v&1&&(i=!0,w.map=u[0],cu(()=>i=!1)),n.$set(w)},i(u){s||(Rt(n.$$.fragment,u),s=!0)},o(u){Wt(n.$$.fragment,u),s=!1},d(u){u&&Vt(e),Pe(n)}}}function YM(t){let e,n;return e=new cI({props:{$$slots:{main:[XM],left:[GM]},$$scope:{ctx:t}}}),{c(){Ae(e.$$.fragment)},m(i,s){Me(e,i,s),n=!0},p(i,[s]){const c={};s&131327&&(c.$$scope={dirty:s,ctx:i}),e.$set(c)},i(i){n||(Rt(e.$$.fragment,i),n=!0)},o(i){Wt(e.$$.fragment,i),n=!1},d(i){Pe(e,i)}}}function KM(t,e,n){let i,s,c,f;qe(t,B_,j=>n(9,i=j)),qe(t,F_,j=>n(10,s=j)),qe(t,Nl,j=>n(3,c=j)),qe(t,Yo,j=>n(7,f=j));let u=!1;U_(async()=>{await ux(),n(4,u=!0)});let v,w=100,I=!0;function L(){v&&c&&v.fitBounds(Array.from(c.getBounds()),{animate:!1})}function A(j){c&&(console.log("New map model loaded"),L(),Jn(Yo,f="route",f))}let U,z;function K(j){Cr[j?"unshift":"push"](()=>{z=j,n(2,z),n(9,i)})}function J(j){v=j,n(0,v)}function Q(j){Cr[j?"unshift":"push"](()=>{U=j,n(1,U),n(10,s)})}function O(){I=this.checked,n(6,I)}function G(){w=U2(this.value),n(5,w)}return t.$$.update=()=>{t.$$.dirty&1&&v&&Jm.set(v),t.$$.dirty&8&&A(),t.$$.dirty&1026&&U&&s&&(n(1,U.innerHTML="",U),U.appendChild(s)),t.$$.dirty&516&&z&&i&&(n(2,z.innerHTML="",z),z.appendChild(i))},[v,U,z,c,u,w,I,f,L,i,s,K,J,Q,O,G]}class JM extends fn{constructor(e){super(),hn(this,e,KM,YM,en,{})}}new JM({target:document.getElementById("app")}); diff --git a/index.html b/index.html index 9a76d77..26a3eda 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,8 @@ Severance Snape - - + +